From 0cee0c4bb1d9e67dab378acdb070933f2c58f1bd Mon Sep 17 00:00:00 2001 From: linfso Date: Tue, 21 May 2024 09:47:16 +0800 Subject: [PATCH] md --- .../erp/emis/service/EmisBaseService.java | 56 ++++++++++++++++--- .../mapper/EmisCustomerUserMapper.xml | 6 +- .../resources/mapper/EmisPrintTplMapper.xml | 4 +- 3 files changed, 54 insertions(+), 12 deletions(-) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java index a7cd45bdc..8c931f9de 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java @@ -202,6 +202,37 @@ public class EmisBaseService { } + /** + * 根据客户编号,获取客户信息 + * @param customerCode + * @return + */ + public EmisCustomerUser getCustomerUserByCode(String customerCode){ + EmisCustomerUser queryEmisCustomerUser = new EmisCustomerUser(); + queryEmisCustomerUser.setCustomerCode(customerCode); + List list=emisCustomerUserMapper.selectEmisCustomerUserList(queryEmisCustomerUser); + if(CollectionUtils.isEmpty(list)){ + return null; + } + return list.get(0); + } + + /** + * 根据月结编号获取客户信息 + * @param monthlyPayCode + * @return + */ + public EmisCustomerUser getCustomerUserByMonthlyPayCode(String monthlyPayCode){ + EmisCustomerUser queryEmisCustomerUser = new EmisCustomerUser(); + queryEmisCustomerUser.setMonthlyPayCode(monthlyPayCode); + List list=emisCustomerUserMapper.selectEmisCustomerUserList(queryEmisCustomerUser); + if(CollectionUtils.isEmpty(list)){ + return null; + } + return list.get(0); + } + + /** * 获取打印信息 * @param billCode @@ -210,25 +241,25 @@ public class EmisBaseService { * @param printType * @return */ - public Map getWaybillPrintOrder(String billCode, String billCodeRange, String lang, String printType){ - if(StringUtils.isEmpty(billCode)){ + public Map getWaybillPrintOrder(String billCode, String billCodeRange, String lang, String printType) { + if (StringUtils.isEmpty(billCode)) { return null; } EmisWaybill waybill = emisWaybillMapper.selectEmisWaybillByBillCode(billCode); - if(waybill==null){ + if (waybill == null) { return null; } - Map order = new HashMap<>(); + Map order = new HashMap<>(); order.put("orderSn", waybill.getOrderSn()); order.put("ydSn", billCode); order.put("logisticNo", billCode); order.put("kdgs", "TANEX"); order.put("pdfInfo", waybill.getThirdCode()); - String pdfInfo=waybill.getThirdCode(); - pdfInfo=pdfInfo.replace("][","||"); + String pdfInfo = waybill.getThirdCode(); + pdfInfo = pdfInfo.replace("][", "||"); // String[] striparr = pdfInfo.split("||"); String[] striparr = pdfInfo.split("\\|\\|"); @@ -239,11 +270,22 @@ public class EmisBaseService { order.put("packageWJC", packageWJC); order.put("package3dm", package3dm); - order.put("address", waybill.getReceiveAddress()); + order.put("address", waybill.getReceiveAddress()); order.put("company", waybill.getReceiveCompany()); order.put("mobile", waybill.getReceiveMobile()); order.put("consignee", waybill.getReceiveName()); + // + String custName=waybill.getReceiveCompany(); + + if ( "2".equals(waybill.getPaymentType()) || "4".equals(waybill.getPaymentType()) || "5".equals(waybill.getPaymentType() ) { + EmisCustomerUser custUser=getCustomerUserByMonthlyPayCode(waybill.getCustNo()); + if(custUser!=null){ + custName= custUser.getCustName(); + } + } + order.put("custName", custName); + order.put("sendAddress", waybill.getSendAddress()); order.put("sendCompany", waybill.getSendCompany()); order.put("sendMobile", waybill.getSendMobile()); diff --git a/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml b/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml index 3acf44bff..b8fd24460 100644 --- a/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml @@ -110,11 +110,9 @@ and customer_name like concat('%', #{custName}, '%') and id = #{id} - and customer_code like concat('%', #{customerCode}, '%') + and customer_code =#{customerCode} and customer_name like concat('%', #{customerName}, '%') - - and customer_name_en like concat('%', #{customerNameEn}, '%') and simple_name like concat('%', #{simpleName}, '%') and contact like concat('%', #{contact}, '%') @@ -134,7 +132,7 @@ and nick_name like concat('%', #{nickName}, '%') and union_id like concat('%', #{unionId}, '%') and openid like concat('%', #{openid}, '%') - and monthly_pay_code like concat('%', #{monthlyPayCode}, '%') + and monthly_pay_code=#{monthlyPayCode} and user_name like concat('%', #{userName}, '%') and password like concat('%', #{password}, '%') and biz_site like concat('%', #{bizSite}, '%') diff --git a/emis-biz/src/main/resources/mapper/EmisPrintTplMapper.xml b/emis-biz/src/main/resources/mapper/EmisPrintTplMapper.xml index c53048941..89f153009 100644 --- a/emis-biz/src/main/resources/mapper/EmisPrintTplMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisPrintTplMapper.xml @@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"