Browse Source

20240925

print/logistic/save
qiezi 2 years ago
parent
commit
ba12a89072
  1. 5
      src/main/java/com/gaotao/modules/customer/mapper/CustomerMapper.java
  2. 10
      src/main/java/com/gaotao/modules/label/service/impl/LabelFormatCustomerServiceImpl.java
  3. 10
      src/main/java/com/gaotao/modules/part/service/impl/ExternalPartCustomerServiceImpl.java
  4. 9
      src/main/resources/mapper/customer/CustomerMapper.xml

5
src/main/java/com/gaotao/modules/customer/mapper/CustomerMapper.java

@ -16,4 +16,9 @@ public interface CustomerMapper extends BaseMapper<Customer> {
Integer generateCustomerNo(@Param("site") String site);
IPage<Customer> selectCustomerPage(@Param("page") Page<Customer> customerPage, @Param("params") Customer customer);
List<Customer> queryCustomer(@Param("customerName") String customerName,
@Param("customerNo") String customerNo,
@Param("site") String site,
@Param("active") String active);
}

10
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<LabelFormatCusto
private SysMsgService sysMsgService;
@Autowired
private CustomerService customerService;
private CustomerMapper customerMapper;
@Override
public List<LabelFormatCustomer> selectLabelFormatCustomerList(LabelFormatCustomer labelFormatCustomer) {
return baseMapper.selectLabelFormatCustomerList(labelFormatCustomer);
@ -64,12 +65,7 @@ public class LabelFormatCustomerServiceImpl extends ServiceImpl<LabelFormatCusto
private void customerExists(String customerNo,String customerName,String site){
List<Customer> list = customerService.lambdaQuery()
.eq(Customer::getCustomerNo, customerNo)
.eq(Customer::getSite, site)
.eq(Customer::getCustomerName, customerName)
.eq(Customer::getActive, Constant.ACTIVE)
.list();
List<Customer> list = customerMapper.queryCustomer(customerNo, customerName, site,Constant.ACTIVE);
if (list.isEmpty()) {
throw new RuntimeException(sysMsgService.getLanguageMsg(SysMsgConstant.MSG_CUSTOMER_NOT_EXISTS));
}

10
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<ExternalPartCus
@Autowired
private SysMsgService sysMsgService;
@Autowired
private CustomerService customerService;
private CustomerMapper customerMapper;
@Override
public List<ExternalPartCustomer> selectExternalPartCustomerList(ExternalPartCustomer externalPartCustomer) {
@ -77,12 +78,7 @@ public class ExternalPartCustomerServiceImpl extends ServiceImpl<ExternalPartCus
private void customerExists(String customerNo,String customerName,String site){
List<Customer> list = customerService.lambdaQuery()
.eq(Customer::getCustomerNo, customerNo)
.eq(Customer::getSite, site)
.eq(Customer::getCustomerName, customerName)
.eq(Customer::getActive, Constant.ACTIVE)
.list();
List<Customer> list = customerMapper.queryCustomer(customerName,customerNo,site,Constant.ACTIVE);
if (list.isEmpty()) {
throw new RuntimeException(sysMsgService.getLanguageMsg(SysMsgConstant.MSG_CUSTOMER_NOT_EXISTS));
}

9
src/main/resources/mapper/customer/CustomerMapper.xml

@ -49,4 +49,13 @@
</if>
</where>
</select>
<select id="queryCustomer" resultType="com.gaotao.modules.customer.entity.Customer">
select site, customer_no, customer_name, active, create_time, create_by
from customer
where customer_no = #{customerNo}
and site = #{site}
and active = #{active}
and customer_name = #{customerName}
</select>
</mapper>
Loading…
Cancel
Save