基础信息产品+bom

highway
A0010407 1 year ago
parent dbd2f24a45
commit 9692f1e09e

@ -58,4 +58,7 @@ public interface BaseProductMapper {
* @return
*/
public int deleteBaseProductByProductIds(String[] productIds);
String checkNameUnique(BaseProduct baseProduct);
String checkCodeUnique(BaseProduct baseProduct);
}

@ -57,4 +57,7 @@ public interface IBaseProductService {
* @return
*/
public int deleteBaseProductByProductId(String productId);
boolean checkCodeUnique(BaseProduct baseProduct);
boolean checkNameUnique(BaseProduct baseProduct);
}

@ -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;
}
}
}

@ -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
<where>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
<if test="bomCode != null and bomCode != ''"> and bb.bom_code like concat('%', #{bomCode}, '%')</if>
</where>
</select>

@ -56,8 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBaseProductList" parameterType="BaseProduct" resultMap="BaseProductResult">
<include refid="selectBaseProductVo"/>
<where>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="productDescZh != null and productDescZh != ''"> and product_desc_zh = #{productDescZh}</if>
<if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
<if test="productDescZh != null and productDescZh != ''"> and product_desc_zh like concat('%', #{productDescZh}, '%')</if>
<if test="productModel != null and productModel != ''"> and product_model = #{productModel}</if>
<if test="productDescEn != null and productDescEn != ''"> and product_desc_en = #{productDescEn}</if>
<if test="ruleCode != null and ruleCode != ''"> and rule_code = #{ruleCode}</if>
@ -250,4 +250,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{productId}
</foreach>
</delete>
<select id="checkNameUnique" parameterType="BaseProduct" resultType ="java.lang.String">
select product_desc_zh
from base_product
where product_desc_zh = #{productDescZh}
</select>
<select id="checkCodeUnique" parameterType="BaseProduct" resultType ="java.lang.String">
select product_code
from base_product
where product_code = #{productCode}
</select>
</mapper>
Loading…
Cancel
Save