diff --git a/wms-vue/src/components/duochaxun/RenXiao.vue b/wms-vue/src/components/duochaxun/RenXiao.vue
index 70bb3a5..0150f4e 100644
--- a/wms-vue/src/components/duochaxun/RenXiao.vue
+++ b/wms-vue/src/components/duochaxun/RenXiao.vue
@@ -23,7 +23,6 @@
查找
导出
重置
- 是否显示全部查询条件
@@ -105,6 +104,16 @@ export default {
},
// 表头配置
columns: [
+ {
+ prop: '组别',
+ minWidth: '150px',
+ label: '组别'
+ },
+ {
+ prop: '账号',
+ minWidth: '150px',
+ label: '账号'
+ },
{
prop: '操作人',
minWidth: '150px',
diff --git a/wms/src/main/java/com/yc/wms/controller/RenXiaoController.java b/wms/src/main/java/com/yc/wms/controller/RenXiaoController.java
index 31cbfc4..23a2346 100644
--- a/wms/src/main/java/com/yc/wms/controller/RenXiaoController.java
+++ b/wms/src/main/java/com/yc/wms/controller/RenXiaoController.java
@@ -56,51 +56,57 @@ public class RenXiaoController {
endDate=sdf.format(date);
}
/* 基础sql数据查询*/
- String sql=" select Row_number() OVER(order by v.操作人 asc) as id,v.操作人,sum(v.整理 ) '整理',sum(v.拣货 ) as '拣货',sum(v.清点 ) as '清点',sum(v.合单 ) as '合单', "
+ String sql=" select Row_number() OVER(order by v.操作人 asc) as id,max(v.组别) '组别',max(v.账号) '账号',v.操作人,sum(v.整理 ) '整理',sum(v.拣货 ) as '拣货',sum(v.清点 ) as '清点',sum(v.合单 ) as '合单', "
+" sum(v.交单 ) as '交单',sum(v.盘点) as '盘点',sum(v.入库) as '入库',sum(v.移库) as '移库' from ( "
- +" select r.operator as '操作人',count(r.id) as '整理',0 as '拣货',0 as '清点',0 as '合单', "
- +" 0 as '交单',0 as '盘点',0 as '入库',0 as '移库' "
+ +" select max(w.describe) '组别',max(w.code) as '账号',r.operator as '操作人',count(r.id) as '整理',0 as '拣货',0 as '清点',0 as '合单',0 as '交单',0 as '盘点',0 as '入库',0 as '移库' "
+" from RECEIVED_RECORD r "
+ +" LEFT JOIN WORKER w ON r.operator=w.name "
+" where CONVERT(VARCHAR, r.RECEIVE_DATE, 23)>='"+startDate+"' and CONVERT(VARCHAR, r.RECEIVE_DATE, 23)<='"+endDate+"' "
+" group by r.operator "
+" union ALL "
- +" select w.NAME,0,count(t.id) as '拣货',0,0,0,0,0,0 from task t "
+ +" select max(w.describe) '组别',max(w.code) as '账号',w.NAME,0,count(t.id) as '拣货',0,0,0,0,0,0 from task t "
+" LEFT JOIN WORKER w ON t.WORKER4_ID=w.id "
+" where CONVERT(VARCHAR,t.OPERATE_TIME, 23)>='"+startDate+"' and CONVERT(VARCHAR,t.OPERATE_TIME, 23)<='"+endDate+"' "
+" group by w.NAME "
+" "
+" union ALL "
- +" select w.NAME,0,0,count(t.id) as '清点',0,0,0,0,0 from task t "
+ +" select max(w.describe) '组别',max(w.code) as '账号',w.NAME,0,0,count(t.id) as '清点',0,0,0,0,0 from task t "
+" LEFT JOIN WORKER w ON t.WORKER2_ID=w.id "
- +" where CONVERT(VARCHAR,t.ARRIVAL_TIME, 23)>='"+startDate+"' and CONVERT(VARCHAR,t.ARRIVAL_TIME, 23)<='"+endDate+"'"
+ +" where CONVERT(VARCHAR,t.ARRIVAL_TIME, 23)>='"+startDate+"' and CONVERT(VARCHAR,t.ARRIVAL_TIME, 23)<='"+endDate+"' "
+" group by w.NAME "
+" "
+" union ALL "
- +" select t.strBill5,0,0,0,count(DISTINCT(s.LP)) as '合单' ,0,0,0,0 from task t "
+ +" select max(w.describe) '组别',max(w.code) as '账号',t.strBill5,0,0,0,count(DISTINCT(s.LP)) as '合单' ,0,0,0,0 from task t "
+" left join stock s on s.id=t.DST_LP "
- +" where CONVERT(VARCHAR,t.operator_Date, 23)>='"+startDate+"' and CONVERT(VARCHAR,t.operator_Date, 23)<='"+endDate+"'"
+ +" LEFT JOIN WORKER w ON t.strBill5=w.name "
+ +" where CONVERT(VARCHAR,t.operator_Date, 23)>='"+startDate+"' and CONVERT(VARCHAR,t.operator_Date, 23)<='2024-9-29' "
+" group by t.strBill5 "
+" union ALL "
- +" select t.operator,0,0,0,0,count(DISTINCT(s.LP)) as '交单' ,0,0,0 "
+ +" select max(w.describe) '组别',max(w.code) as '账号',t.operator,0,0,0,0,count(DISTINCT(s.LP)) as '交单' ,0,0,0 "
+" from task t "
+ +" LEFT JOIN WORKER w ON t.operator=w.name "
+" left join stock s on s.id=t.DST_LP "
- +" where CONVERT(VARCHAR,t.dateline, 23)>='"+startDate+"' and CONVERT(VARCHAR,t.dateline, 23)<='"+endDate+"'"
+ +" where CONVERT(VARCHAR,t.dateline, 23)>='"+startDate+"' and CONVERT(VARCHAR,t.dateline, 23)<='"+endDate+"' "
+" group by t.operator "
+" union ALL "
- +" select w.NAME,0,0,0,0,0,count(rd.id) as '盘点' ,0,0 from COUNT_RECORD rd "
+ +" select max(w.describe) '组别',max(w.code) as '账号',w.NAME,0,0,0,0,0,count(rd.id) as '盘点' ,0,0 from COUNT_RECORD rd "
+" left join WORKER w on w.id=rd.WORKER_ID "
- +" where CONVERT(VARCHAR,rd.END_DATE, 23)>='"+startDate+"' and CONVERT(VARCHAR,rd.END_DATE, 23)>='"+endDate+"'"
- +" and rd.WORKER_ID is not null "
+ +" where CONVERT(VARCHAR,rd.END_DATE, 23)>='"+startDate+"' and CONVERT(VARCHAR,rd.END_DATE, 23)<='"+endDate+"' "
+ +" and rd.WORKER_ID is not null "
+" group by w.NAME "
+" "
+" union ALL "
- +" select t.operator,0,0,0,0,0,0,count(t.id) as '入库',0 from INVENTORY_LOG t where t.LOG_TYPE='RECEIVING' "
+ +" select max(w.describe) '组别',max(w.code) as '账号',t.operator,0,0,0,0,0,0,count(t.id) as '入库',0 "
+ +" from INVENTORY_LOG t LEFT JOIN WORKER w ON t.operator=w.name "
+ +" where t.LOG_TYPE='RECEIVING' "
+" and CONVERT(VARCHAR,t.occur_Time, 23)>='"+startDate+"' "
+" and CONVERT(VARCHAR,t.occur_Time, 23)<='"+endDate+"' "
+" group by t.operator "
+" union ALL "
- +" select t.operator,0,0,0,0,0,0,0,count(t.id) as '移库' from INVENTORY_LOG t where t.LOG_TYPE='MOVE' "
- +" and CONVERT(VARCHAR,t.occur_Time, 23)>='"+startDate+"' "
+ +" select max(w.describe) '组别',max(w.code) as '账号',t.operator,0,0,0,0,0,0,0,count(t.id) as '移库' "
+ +" from INVENTORY_LOG t LEFT JOIN WORKER w ON t.operator=w.name "
+ +" where t.LOG_TYPE='MOVE' "
+ +" and CONVERT(VARCHAR,t.occur_Time, 23)>='2024-05-29' "
+" and CONVERT(VARCHAR,t.occur_Time, 23)<='"+endDate+"' "
+" group by t.operator ) v "
+" group by v.操作人 ";
@@ -150,9 +156,7 @@ class RenXiao implements Serializable {
@Id
private Long id;
/* 库区名称*/
- @Transient
private String 组别="";
- @Transient
private String 账号="";
private String 操作人="";
private Integer 整理=0;