diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonToolsController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonToolsController.java
index a9188c5ab..12f33f601 100644
--- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonToolsController.java
+++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonToolsController.java
@@ -85,6 +85,9 @@ public class EmisCommonToolsController extends EmisBaseController
Map orderMap=emisBaseService.getWaybillStatMap(emisWaybill);
+
+// tba.waitGotCount,tbb.hasDoCount,tbc.hasCancelCount,tbd.hasChangeToCount
+
Map orderStatMap = new HashMap();
int waitTakeNum=(int)orderMap.getOrDefault("waitDoNum",0);
int takeNum=(int)orderMap.getOrDefault("hasDoNum",0);
diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml
index 642a79f1b..0dbc9c940 100644
--- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml
+++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml
@@ -1192,10 +1192,16 @@
- and a.waybill_status='0' and a.order_status='0'
+ and a.order_type='0'
+ and a.waybill_status='0'
+ and a.order_status in('0','3')
+ and (
+ a.take_piece_employee_code=#{params.privEmpCode}
+ or (a.pickup_method in('1','3') and a.operate_employee_code is null )
+ or (a.operate_employee_code=#{params.privEmpCode} )
+ )
-
and a.waybill_status!='0' and a.order_status!='2'
and (
@@ -2056,7 +2062,9 @@
SELECT #{params.privSiteCode} FROM dual
)
and (
- a.take_piece_employee_code=#{params.privEmpCode} or (a.take_piece_employee_code is null)
+ a.take_piece_employee_code=#{params.privEmpCode}
+ or (a.pickup_method in('1','3') and a.operate_employee_code is null )
+ or (a.operate_employee_code=#{params.privEmpCode} )
)
)
@@ -2073,11 +2081,18 @@
where a.del_flag='0'
and a.waybill_status!='0'
and a.order_status!='2'
-
+ and a.send_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
+ )
and (
- (a.operate_employee_code is not null and a.operate_employee_code=#{params.privEmpCode} )
- or (a.take_piece_employee_code is not null and a.take_piece_employee_code=#{params.privEmpCode} )
+ a.operate_employee_code=#{params.privEmpCode}
+ or a.take_piece_employee_code=#{params.privEmpCode}
or a.register_man_code=#{params.privEmpCode}
)
@@ -2094,12 +2109,19 @@
where a.del_flag='0'
and a.order_status='2'
- and (
- (a.operate_employee_code is not null and a.operate_employee_code=#{params.privEmpCode} )
- or
- (a.take_piece_employee_code is not null and a.take_piece_employee_code=#{params.privEmpCode} )
+ and a.send_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
+ )
+ and (
+ a.operate_employee_code=#{params.privEmpCode}
+ or a.take_piece_employee_code=#{params.privEmpCode}
+ or a.register_man_code=#{params.privEmpCode}
)
-
and a.send_date = ]]> #{params.beginDate}
@@ -2114,6 +2136,15 @@
where a.del_flag='0'
and a.order_status='3'
+ and a.send_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
+ )
+
and exists (
select 1 from emis_waybill_change_to ewcto where a.bill_code=ewcto.bill_code and ewcto.change_from=#{params.privEmpCode}
)