Merge remote-tracking branch 'origin/master'

highway
wws 1 year ago
commit 2492c033a4

@ -68,7 +68,7 @@
<resultMap type="BomComponent" id="BomComponentResult">
<result property="handle" column="handle" />
<result property="bomCode" column="bom_code" />
<result property="bomName" column="product_desc_zh" />
<result property="productDescZh" column="product_desc_zh" />
<result property="site" column="site" />
<result property="productCode" column="product_code" />
<result property="cumc" column="cumc" />
@ -305,17 +305,16 @@
</select>
<select id="selectBaseBomComponentList" parameterType="BomComponent" resultMap="BomComponentResult">
-- select bbc.bom_code,bpc1.product_desc_zh
-- from base_bom_component bbc,base_product_copy1 bpc1
-- left join base_product_copy1 bpc1 on bbc.product_code = (right(bpc1.product_code,11))
-- Where
<!-- <if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>-->
-- bbc.product_code = right(bpc1.product_code,11)
select distinct bbc.bom_code,bp.product_desc_zh,right(bp.product_code,11) as pc,bbc.product_code
from base_bom_component bbc,base_product bp
Where
bbc.product_code = right(bp.product_code,11)
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
<!--select distinct bbc.bom_code,bp.product_desc_zh,right(bp.product_code,11) as pc,bbc.product_code-->
select bbc.bom_code,b1.product_desc_zh,bbc.product_code,bbc.component,bp.product_desc_zh as componentName
from base_bom_component bbc
left join base_product b1 on right(b1.product_code,11) = bbc.product_code
left join base_product bp on right(bp.product_code,11) = bbc.component
<where>
<if test="bomCode != null and bomCode != ''"> and bom_code like concat('%', #{bomCode}, '%')</if>
<if test="productDescZh != null and productDescZh != ''"> and b1.product_desc_zh like concat('%', #{productDescZh}, '%')</if>
<!-- <if test="component != null and component != ''"> and component like concat('%', #{component}, '%')</if>-->
</where>
</select>
<select id="getWorkCenterList" parameterType="SysFactory" resultMap="SysFactoryResult">

@ -72,7 +72,13 @@ public class BaseSupplierController extends BaseController {
@Log(title = "供应商管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseSupplier baseSupplier) {
return toAjax(baseSupplierService.insertBaseSupplier(baseSupplier));
if (baseSupplierService.checkCodeUnique(baseSupplier)) {
return AjaxResult.error("供应商编码已存在!");
}else if(baseSupplierService.checkNameUnique(baseSupplier)){
return AjaxResult.error("供应商名称已存在!");
}else{
return toAjax(baseSupplierService.insertBaseSupplier(baseSupplier));
}
}
/**

@ -80,9 +80,9 @@ public class SysCustomerController extends BaseController {
sysCustomer.setCreateBy(SecurityUtils.getUsername());
sysCustomer.setCreateTime(DateUtils.getNowDate());
if (sysCustomerService.checkClientCodeUnique(sysCustomer)) {
return AjaxResult.error("组织编码已存在!");
return AjaxResult.error("客户编码已存在!");
}else if(sysCustomerService.checkClientNameUnique(sysCustomer)){
return AjaxResult.error("组织名称已存在!");
return AjaxResult.error("客户已存在!");
}else{
return toAjax(sysCustomerService.insertSysCustomer(sysCustomer));
}

@ -58,4 +58,7 @@ public interface BaseSupplierMapper {
* @return
*/
public int deleteBaseSupplierBySupplierIds(String[] supplierIds);
String checkNameUnique(BaseSupplier baseSupplier);
String checkCodeUnique(BaseSupplier baseSupplier);
}

@ -57,4 +57,7 @@ public interface IBaseSupplierService {
* @return
*/
public int deleteBaseSupplierBySupplierId(String supplierId);
boolean checkCodeUnique(BaseSupplier baseSupplier);
boolean checkNameUnique(BaseSupplier baseSupplier);
}

@ -97,4 +97,36 @@ public class BaseSupplierServiceImpl implements IBaseSupplierService {
public int deleteBaseSupplierBySupplierId(String supplierId) {
return baseSupplierMapper.deleteBaseSupplierBySupplierId(supplierId);
}
/**
*
*
* @return
*/
@Override
@DS("#header.poolName")
public boolean checkCodeUnique(BaseSupplier baseSupplier) {
String code = baseSupplierMapper.checkCodeUnique(baseSupplier);
if(code == null){
return false;
}else{
return true;
}
}
/**
*
*
* @return
*/
@Override
@DS("#header.poolName")
public boolean checkNameUnique(BaseSupplier baseSupplier) {
String name = baseSupplierMapper.checkNameUnique(baseSupplier);
if(name == null){
return false;
}else{
return true;
}
}
}

@ -40,8 +40,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBaseSupplierList" parameterType="BaseSupplier" resultMap="BaseSupplierResult">
<include refid="selectBaseSupplierVo"/>
<where>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if>
<if test="zhDesc != null and zhDesc != ''"> and zh_desc = #{zhDesc}</if>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if>
<if test="zhDesc != null and zhDesc != ''"> and zh_desc like concat('%', #{zhDesc}, '%')</if>
<if test="enDesc != null and enDesc != ''"> and en_desc = #{enDesc}</if>
<if test="supplierType != null and supplierType != ''"> and supplier_type = #{supplierType}</if>
<if test="accountNumber != null and accountNumber != ''"> and account_number = #{accountNumber}</if>
@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="area != null and area != ''"> and area = #{area}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="postcode != null and postcode != ''"> and postcode = #{postcode}</if>
<if test="contact != null and contact != ''"> and contact = #{contact}</if>
<if test="contact != null and contact != ''"> and contact like concat('%', #{contact}, '%')</if>
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
<if test="contactPosition != null and contactPosition != ''"> and contact_position = #{contactPosition}</if>
<if test="contactEmail != null and contactEmail != ''"> and contact_email = #{contactEmail}</if>
@ -170,4 +170,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{supplierId}
</foreach>
</delete>
<select id="checkNameUnique" parameterType="BaseSupplier" resultType ="java.lang.String">
select zh_desc
from base_supplier
where zh_desc = #{zhDesc}
</select>
<select id="checkCodeUnique" parameterType="BaseSupplier" resultType ="java.lang.String">
select supplier_code
from base_supplier
where supplier_code = #{supplierCode}
</select>
</mapper>
Loading…
Cancel
Save