From ef95ea52988b3d43fd0fbf8016e353d39c0ff210 Mon Sep 17 00:00:00 2001 From: linfso Date: Sun, 25 Aug 2024 08:58:30 +0800 Subject: [PATCH] md --- .../impl/EmisTmsScanRecordServiceImpl.java | 4 +- .../resources/mapper/EmisWaybillMapper.xml | 64 +++++++++++++------ 2 files changed, 47 insertions(+), 21 deletions(-) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsScanRecordServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsScanRecordServiceImpl.java index 0d2465c4e..51ef742ed 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsScanRecordServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsScanRecordServiceImpl.java @@ -186,11 +186,11 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm billCodeInStr=WaybillHelper.formatQueryValue(billCodeInStr); String[] billCodeArrTmp = billCodeInStr.split(","); - Set billCodeSet = new HashSet(); + Set billCodeSet = new HashSet(); for(int i = 0 ; i < billCodeArrTmp.length ; i++){ billCodeSet.add(billCodeArrTmp[i]); } - String billCodeArr[] = billCodeSet.toArray(); + String billCodeArr[] = (String[]) billCodeSet.toArray(); // 合包和拆包需单独处理 diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml index 193aecd6c..8edc10b9d 100644 --- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml @@ -1097,6 +1097,13 @@ or EXISTS (select 1 from emis_tms_scan_record etsr where a.bill_code=etsr.main_bill_code and etsr.scan_site_code=#{params.privSiteCode}) + + + or EXISTS ( + select 1 from emis_customer_user ecu where a.cust_no=ecu.monthly_pay_code and ecu.owner_site=#{params.privSiteCode} + ) + + or a.salesmen=#{params.privEmpName} or a.payee=#{params.privEmpName} or a.operate_employee_code=#{params.privEmpCode} @@ -1271,8 +1278,12 @@ a.del_flag='0' and a.order_status !='0' and a.order_status!='2' and a.id = #{id} + and ( FIND_IN_SET(`order_sn`,#{orderSn}) or order_sn like concat('%', #{orderSn}, '%') ) - and ( FIND_IN_SET(`bill_code`,#{billCode}) or bill_code like concat('%', #{billCode}, '%') ) + + + and ( FIND_IN_SET(`bill_code`,#{billCode}) or bill_code like concat('%', #{billCode}, '%') ) + and cust_order_id=#{custOrderId} and bill_code_sub like concat('%', #{billCodeSub}, '%') @@ -1431,6 +1442,19 @@ and a.waybill_status='0' and a.order_status='0' + + and a.bill_code in ( + select bill_code from emis_waybill_problem_info ewpi where ewpi.del_flag='0' and FIND_IN_SET( ewpi.`problem_type`, #{params.problemQueryIds} ) + ) + + + + and a.bill_code not in ( + select bill_code from emis_waybill_problem_info ewpi where ewpi.del_flag='0' and FIND_IN_SET( ewpi.`problem_type`, #{params.problemQueryIds} ) + ) + + + and a.waybill_status!='0' and a.order_status='1' @@ -1443,16 +1467,20 @@ - - and a.bill_code in ( - select bill_code from emis_waybill_problem_info ewpi where ewpi.del_flag='0' and FIND_IN_SET( ewpi.`problem_type`, #{params.problemQueryIds} ) - ) + + + and a.order_date = ]]> #{params.beginOrderDate} + + + and a.order_date #{params.endOrderDate} - - and a.bill_code not in ( - select bill_code from emis_waybill_problem_info ewpi where ewpi.del_flag='0' and FIND_IN_SET( ewpi.`problem_type`, #{params.problemQueryIds} ) - ) + + and a.payee=#{payee} + + + + and a.salesmen=#{salesmen} @@ -1495,7 +1523,7 @@ - and a.bill_code not in( select etp.bill_code from emis_tms_pack_dtl etp where etp.del_flag='0' ) + and not EXISTS ( select 1 from emis_tms_pack_dtl etp where etp.del_flag='0' and etp.main_bill_code=a.bill_code ) and a.trans_line_type in( select line_code from emis_trans_line etl where etl.trans_type=1 ) @@ -1530,18 +1558,16 @@ UNION SELECT #{params.privSiteCode} FROM dual ) - or - a.sign_site_code in ( - SELECT t1.site_code FROM ( - SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid := - #{params.privSiteCode} ) pd - WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code) - UNION - SELECT #{params.privSiteCode} FROM dual - ) or EXISTS (select 1 from emis_tms_scan_record etsr where a.bill_code=etsr.main_bill_code and etsr.scan_site_code=#{params.privSiteCode}) + + + or EXISTS ( + select 1 from emis_customer_user ecu where a.cust_no=ecu.monthly_pay_code and ecu.owner_site=#{params.privSiteCode} + ) + + or a.salesmen=#{params.privEmpName} or a.payee=#{params.privEmpName} or a.operate_employee_code=#{params.privEmpCode}