diff --git a/src/main/java/com/gaotao/modules/customer/mapper/CustomerMapper.java b/src/main/java/com/gaotao/modules/customer/mapper/CustomerMapper.java index 60b79c2..8c4e4c2 100644 --- a/src/main/java/com/gaotao/modules/customer/mapper/CustomerMapper.java +++ b/src/main/java/com/gaotao/modules/customer/mapper/CustomerMapper.java @@ -16,4 +16,9 @@ public interface CustomerMapper extends BaseMapper { Integer generateCustomerNo(@Param("site") String site); IPage selectCustomerPage(@Param("page") Page customerPage, @Param("params") Customer customer); + + List queryCustomer(@Param("customerName") String customerName, + @Param("customerNo") String customerNo, + @Param("site") String site, + @Param("active") String active); } diff --git a/src/main/java/com/gaotao/modules/label/service/impl/LabelFormatCustomerServiceImpl.java b/src/main/java/com/gaotao/modules/label/service/impl/LabelFormatCustomerServiceImpl.java index 0071f84..c389143 100644 --- a/src/main/java/com/gaotao/modules/label/service/impl/LabelFormatCustomerServiceImpl.java +++ b/src/main/java/com/gaotao/modules/label/service/impl/LabelFormatCustomerServiceImpl.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gaotao.common.constant.SysMsgConstant; import com.gaotao.common.utils.Constant; import com.gaotao.modules.customer.entity.Customer; +import com.gaotao.modules.customer.mapper.CustomerMapper; import com.gaotao.modules.customer.service.CustomerService; import com.gaotao.modules.label.entity.LabelFormatCustomer; import com.gaotao.modules.label.mapper.LabelFormatCustomerMapper; @@ -22,7 +23,7 @@ public class LabelFormatCustomerServiceImpl extends ServiceImpl selectLabelFormatCustomerList(LabelFormatCustomer labelFormatCustomer) { return baseMapper.selectLabelFormatCustomerList(labelFormatCustomer); @@ -64,12 +65,7 @@ public class LabelFormatCustomerServiceImpl extends ServiceImpl list = customerService.lambdaQuery() - .eq(Customer::getCustomerNo, customerNo) - .eq(Customer::getSite, site) - .eq(Customer::getCustomerName, customerName) - .eq(Customer::getActive, Constant.ACTIVE) - .list(); + List list = customerMapper.queryCustomer(customerNo, customerName, site,Constant.ACTIVE); if (list.isEmpty()) { throw new RuntimeException(sysMsgService.getLanguageMsg(SysMsgConstant.MSG_CUSTOMER_NOT_EXISTS)); } diff --git a/src/main/java/com/gaotao/modules/part/service/impl/ExternalPartCustomerServiceImpl.java b/src/main/java/com/gaotao/modules/part/service/impl/ExternalPartCustomerServiceImpl.java index d9282c2..79570b4 100644 --- a/src/main/java/com/gaotao/modules/part/service/impl/ExternalPartCustomerServiceImpl.java +++ b/src/main/java/com/gaotao/modules/part/service/impl/ExternalPartCustomerServiceImpl.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gaotao.common.constant.SysMsgConstant; import com.gaotao.common.utils.Constant; import com.gaotao.modules.customer.entity.Customer; +import com.gaotao.modules.customer.mapper.CustomerMapper; import com.gaotao.modules.customer.service.CustomerService; import com.gaotao.modules.part.entity.ExternalPartCustomer; import com.gaotao.modules.part.mapper.ExternalPartCustomerMapper; @@ -25,7 +26,7 @@ public class ExternalPartCustomerServiceImpl extends ServiceImpl selectExternalPartCustomerList(ExternalPartCustomer externalPartCustomer) { @@ -77,12 +78,7 @@ public class ExternalPartCustomerServiceImpl extends ServiceImpl list = customerService.lambdaQuery() - .eq(Customer::getCustomerNo, customerNo) - .eq(Customer::getSite, site) - .eq(Customer::getCustomerName, customerName) - .eq(Customer::getActive, Constant.ACTIVE) - .list(); + List list = customerMapper.queryCustomer(customerName,customerNo,site,Constant.ACTIVE); if (list.isEmpty()) { throw new RuntimeException(sysMsgService.getLanguageMsg(SysMsgConstant.MSG_CUSTOMER_NOT_EXISTS)); } diff --git a/src/main/resources/mapper/customer/CustomerMapper.xml b/src/main/resources/mapper/customer/CustomerMapper.xml index 9ed11a3..d86c83d 100644 --- a/src/main/resources/mapper/customer/CustomerMapper.xml +++ b/src/main/resources/mapper/customer/CustomerMapper.xml @@ -49,4 +49,13 @@ + + \ No newline at end of file