diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseProductMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseProductMapper.java index ed331217..bba7be16 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseProductMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseProductMapper.java @@ -58,4 +58,7 @@ public interface BaseProductMapper { * @return 结果 */ public int deleteBaseProductByProductIds(String[] productIds); + + String checkNameUnique(BaseProduct baseProduct); + String checkCodeUnique(BaseProduct baseProduct); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseProductService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseProductService.java index 5528584d..a02abee7 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseProductService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseProductService.java @@ -57,4 +57,7 @@ public interface IBaseProductService { * @return 结果 */ public int deleteBaseProductByProductId(String productId); + + boolean checkCodeUnique(BaseProduct baseProduct); + boolean checkNameUnique(BaseProduct baseProduct); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseProductServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseProductServiceImpl.java index 54ec63e0..59b081df 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseProductServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseProductServiceImpl.java @@ -5,6 +5,7 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; import com.op.common.security.utils.SecurityUtils; +import com.op.wms.domain.BaseTeamT; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.wms.mapper.BaseProductMapper; @@ -97,4 +98,36 @@ public class BaseProductServiceImpl implements IBaseProductService { public int deleteBaseProductByProductId(String productId) { return baseProductMapper.deleteBaseProductByProductId(productId); } + + /** + * 判断产品信息 + * + * @return 结果 + */ + @Override + @DS("#header.poolName") + public boolean checkCodeUnique(BaseProduct baseProduct) { + String code = baseProductMapper.checkCodeUnique(baseProduct); + if(code == null){ + return false; + }else{ + return true; + } + } + + /** + * 判断产品信息 + * + * @return 结果 + */ + @Override + @DS("#header.poolName") + public boolean checkNameUnique(BaseProduct baseProduct) { + String name = baseProductMapper.checkNameUnique(baseProduct); + if(name == null){ + return false; + }else{ + return true; + } + } } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomMapper.xml index 04f2ec81..74595933 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomMapper.xml @@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join base_product bp on right(bp.product_code,11) = bbc.component and factory_code = #{factoryCode} - and bom_code = #{bomCode} + and bb.bom_code like concat('%', #{bomCode}, '%') diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseProductMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseProductMapper.xml index 20337c0c..ea713999 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseProductMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseProductMapper.xml @@ -56,8 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select product_desc_zh + from base_product + where product_desc_zh = #{productDescZh} + + + + \ No newline at end of file