no message
parent
c568abe996
commit
ceea1c72ea
|
|
@ -98,7 +98,7 @@
|
|||
ref="tableData"
|
||||
border
|
||||
style="width: 100%;">
|
||||
<el-table-column prop="workstation" label="工作站/箱子数" width="180"></el-table-column>
|
||||
<el-table-column prop="workstation" label="工作站/子任务总数" width="180"></el-table-column>
|
||||
<el-table-column prop="g201" label="201" width="50"></el-table-column>
|
||||
<el-table-column prop="g202" label="202" width="50"></el-table-column>
|
||||
<el-table-column prop="g203" label="203" width="50"></el-table-column>
|
||||
|
|
@ -115,6 +115,7 @@
|
|||
<el-table-column prop="g214" label="214" width="50"></el-table-column>
|
||||
<el-table-column prop="g215" label="215" width="50"></el-table-column>
|
||||
<el-table-column prop="total" label="汇总" width="60"></el-table-column>
|
||||
<el-table-column prop="lxCount" label="容器数" width="60"></el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="table-title" v-if="true">
|
||||
|
|
|
|||
|
|
@ -44,10 +44,15 @@ public class JianHuoXiaoLvController {
|
|||
@Autowired
|
||||
private QueryUtil queryUtil;
|
||||
private static /* 基础sql数据查询*/
|
||||
String sql=" select t.id,bt.NAME as '单据类型',pt.sourceType as '出库类型',pt.id as '任务号',t.BILLCODE as '子任务号', "
|
||||
+" z.NAME as '库区',ptd.LINE_NUMBER as '拣货行' ,pt.UPDATE_TIME as '创建时间',t.dateBill3 as '生成合单任务时间', "
|
||||
+" t.dateBill1 as '下发时间',t.OPERATE_TIME as '拣货时间',t.ARRIVAL_TIME as '清点时间',t.operator_Date as '合单时间', "
|
||||
+" t.dateline as '交单时间', "
|
||||
String sql = " SELECT t.id,bt.NAME as '单据类型',pt.sourceType as '出库类型',pt.id as '任务号',t.BILLCODE as '子任务号', "
|
||||
+ " z.NAME as '库区',ptd.LINE_NUMBER as '拣货行' , "
|
||||
+ " CONVERT(VARCHAR(19), pt.UPDATE_TIME, 20) as '创建时间', "
|
||||
+ " CONVERT(VARCHAR(19), t.dateBill3, 20) as '生成合单任务时间', "
|
||||
+ " CONVERT(VARCHAR(19), t.dateBill1, 20) as '下发时间', "
|
||||
+ " CONVERT(VARCHAR(19), t.OPERATE_TIME, 20) as '拣货时间', "
|
||||
+ " CONVERT(VARCHAR(19), t.ARRIVAL_TIME, 20) as '清点时间', "
|
||||
+ " CONVERT(VARCHAR(19), t.operator_Date, 20) as '合单时间', "
|
||||
+ " CONVERT(VARCHAR(19), t.dateline, 20) as '交单时间', "
|
||||
+ " DATEDIFF(second, pt.UPDATE_TIME,t.dateBill1 )/60 as '创建-下发时间', "
|
||||
+ " DATEDIFF(second, t.dateBill1,t.OPERATE_TIME )/60 as '下发-拣货时间', "
|
||||
+ " DATEDIFF(second, t.OPERATE_TIME,t.operator_Date )/60 as '拣货-合单时间', "
|
||||
|
|
@ -55,13 +60,13 @@ public class JianHuoXiaoLvController {
|
|||
+ " DATEDIFF(second, t.OPERATE_TIME,t.ARRIVAL_TIME )/60 as '拣货-清点时间', "
|
||||
+ " DATEDIFF(second, t.ARRIVAL_TIME,t.operator_Date )/60 as '清点-合单时间', "
|
||||
+ " DATEDIFF(second, t.OPERATE_TIME,t.dateline )/60 as '拣货-交单时间' "
|
||||
+" from task t "
|
||||
+" left join PICK_TICKET_DETAIL ptd on ptd.id=t.PICK_TICKET_DETAIL_ID "
|
||||
+" left join PICK_TICKET pt on pt.id=ptd.PICK_TICKET_ID "
|
||||
+" left join BILL_TYPE bt on bt.id=pt.BILL_TYPE_ID "
|
||||
+" left join LOCATION loc on loc.id=t.SRC_LOC_ID "
|
||||
+" left join [ZONE] z on z.id=loc.ZONE_ID "
|
||||
+" where t.PLAN_QUANTITY>0 ";
|
||||
+ " FROM task t "
|
||||
+ " LEFT JOIN PICK_TICKET_DETAIL ptd ON ptd.id = t.PICK_TICKET_DETAIL_ID "
|
||||
+ " LEFT JOIN PICK_TICKET pt ON pt.id = ptd.PICK_TICKET_ID "
|
||||
+ " LEFT JOIN BILL_TYPE bt ON bt.id = pt.BILL_TYPE_ID "
|
||||
+ " LEFT JOIN LOCATION loc ON loc.id = t.SRC_LOC_ID "
|
||||
+ " LEFT JOIN [ZONE] z ON z.id = loc.ZONE_ID "
|
||||
+ " WHERE t.PLAN_QUANTITY > 0 ";
|
||||
@PostMapping("/queryList")
|
||||
public Result queryList(@RequestBody String json) {
|
||||
/* 返回data设置*/
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@ public class RongQiController {
|
|||
+" item.code AS liaohao, "
|
||||
+" MAX ( t.END_REGION ) AS old_gzz, "
|
||||
+" MAX ( s2.LP ) AS rqh, "
|
||||
+" t.BILLCODE AS zrwh "
|
||||
+" t.BILLCODE AS old_zrwh, "
|
||||
+" MAX (t.OLD_ZRW) AS zrwh "
|
||||
+" FROM "
|
||||
+" task t "
|
||||
+" LEFT JOIN PICK_TICKET_DETAIL ptd ON ptd.id= t.PICK_TICKET_DETAIL_ID "
|
||||
|
|
@ -81,6 +82,7 @@ public class RongQiController {
|
|||
+" 1 = 1 "
|
||||
+" AND pt.BILL_TYPE_ID= 1094 "
|
||||
+" AND wd.code= '"+wdCode+"' "
|
||||
+" and t.PLAN_QUANTITY>0 "
|
||||
+" AND t.WAVE_DOC_ID IS NOT NULL and z.id=1763 "
|
||||
+" GROUP BY "
|
||||
+" t.BILLCODE, "
|
||||
|
|
@ -137,6 +139,90 @@ public class RongQiController {
|
|||
Map<String, List<RQTaskModel>> groupedByRqh = listAll.stream()
|
||||
.collect(Collectors.groupingBy(RQTaskModel::getRqh));
|
||||
|
||||
|
||||
/* 容器数汇总-一个*/
|
||||
int gzzCount=groupedByRqh.size();
|
||||
rqLtList.get(0).setTotal(gzzCount);
|
||||
rqLtList.get(1).setTotal(gzzCount);
|
||||
/* 按工作站分组后,按子任务号分组,计算每个工作站完成的子任务数量*/
|
||||
/*for (int i = 0; i < 2; i++) {
|
||||
RongQiLt rongQiLt = rqLtList.get(i);
|
||||
Map<String, List<RQTaskModel>> groupedByGzz;
|
||||
if (i==0){
|
||||
groupedByGzz = listAll.stream()
|
||||
.collect(Collectors.groupingBy(RQTaskModel::getOldGzz));
|
||||
}else {
|
||||
groupedByGzz = listAll.stream()
|
||||
.collect(Collectors.groupingBy(RQTaskModel::getGzz));
|
||||
}
|
||||
for (String gzz : groupedByGzz.keySet()) {
|
||||
List<RQTaskModel> listGzz=groupedByGzz.get(gzz);
|
||||
Map<String, List<RQTaskModel>> groupedByZrwh;
|
||||
if (i==0){
|
||||
groupedByZrwh = listGzz.stream()
|
||||
.collect(Collectors.groupingBy(RQTaskModel::getOldZrwh));
|
||||
}else {
|
||||
groupedByZrwh = listGzz.stream()
|
||||
.collect(Collectors.groupingBy(RQTaskModel::getZrwh));
|
||||
}
|
||||
|
||||
int zrw=groupedByZrwh.size();
|
||||
switch (gzz){
|
||||
case "201":
|
||||
rongQiLt.setG201(zrw);
|
||||
break;
|
||||
case "202":
|
||||
rongQiLt.setG202(zrw);
|
||||
break;
|
||||
case "203":
|
||||
rongQiLt.setG203(zrw);
|
||||
break;
|
||||
case "204":
|
||||
rongQiLt.setG204(zrw);
|
||||
break;
|
||||
|
||||
case "205":
|
||||
rongQiLt.setG205(zrw);
|
||||
break;
|
||||
case "206":
|
||||
rongQiLt.setG206(zrw);
|
||||
break;
|
||||
case "207":
|
||||
rongQiLt.setG207(zrw);
|
||||
break;
|
||||
case "208":
|
||||
rongQiLt.setG208(zrw);
|
||||
break;
|
||||
case "209":
|
||||
rongQiLt.setG209(zrw);
|
||||
break;
|
||||
case "210":
|
||||
rongQiLt.setG210(zrw);
|
||||
break;
|
||||
case "211":
|
||||
rongQiLt.setG211(zrw);
|
||||
break;
|
||||
case "212":
|
||||
rongQiLt.setG212(zrw);
|
||||
break;
|
||||
case "213":
|
||||
rongQiLt.setG213(zrw);
|
||||
break;
|
||||
case "214":
|
||||
rongQiLt.setG214(zrw);
|
||||
break;
|
||||
case "215":
|
||||
rongQiLt.setG215(zrw);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
rongQiLt.setTotal(rongQiLt.getG201()+rongQiLt.getG202()+rongQiLt.getG203()+rongQiLt.getG204()+rongQiLt.getG205()
|
||||
+rongQiLt.getG206()+rongQiLt.getG207()+rongQiLt.getG208()+rongQiLt.getG209()
|
||||
+rongQiLt.getG210()+rongQiLt.getG211()+rongQiLt.getG212()+rongQiLt.getG213()+rongQiLt.getG214()+rongQiLt.getG215());
|
||||
}*/
|
||||
|
||||
for (String rqh : groupedByRqh.keySet()) {
|
||||
List<RQTaskModel> listRqh=groupedByRqh.get(rqh);
|
||||
Map<String, List<RQTaskModel>> groupedByGzz;
|
||||
|
|
@ -156,130 +242,98 @@ public class RongQiController {
|
|||
.filter(task -> task.getGzz() != null)
|
||||
.collect(Collectors.groupingBy(RQTaskModel::getGzz));
|
||||
}
|
||||
/* 工作站分配容器数*/
|
||||
int gzzCount=1;
|
||||
|
||||
for (String gzz : groupedByGzz.keySet()) {
|
||||
List<RQTaskModel> listGzz=groupedByGzz.get(gzz);
|
||||
/* 按AgvId任务分组,获取分组后的集合长度,算出当前料箱到当前工作站的次数*/
|
||||
/*Map<String, List<RQTaskModel>> groupedByAgvId = listGzz.stream()
|
||||
.collect(Collectors.groupingBy(RQTaskModel::getAgvId));*/
|
||||
/* 工作站拣货任务总行数*/
|
||||
Map<String, List<RQTaskModel>> groupedByAgvId = listGzz.stream()
|
||||
.collect(Collectors.groupingBy(RQTaskModel::getAgvId));
|
||||
/* 容器流通次数*/
|
||||
// int g=groupedByAgvId.size();
|
||||
int g=1;
|
||||
|
||||
//任务行数
|
||||
int taskCount=listGzz.size();
|
||||
/*for (RQTaskModel rqTaskModel : listGzz){
|
||||
taskCount=taskCount+rqTaskModel.getTs();
|
||||
}*/
|
||||
RongQiMz rongQiMz=rqMzList.get(i);
|
||||
switch (gzz){
|
||||
case "201":
|
||||
rongQi.setG201(taskCount);
|
||||
rqLtList.get(i).setG201(rqLtList.get(i).getG201()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG201().setTaskCount(rongQiMz.getG201().getTaskCount()+taskCount);
|
||||
rongQiMz.getG201().setLxCount(rongQiMz.getG201().getLxCount()+1);
|
||||
rongQiMz.getG201().setLxCount(rongQiMz.getG201().getLxCount()+g);
|
||||
break;
|
||||
case "202":
|
||||
rongQi.setG202(taskCount);
|
||||
rqLtList.get(i).setG202(rqLtList.get(i).getG202()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG202().setTaskCount(rongQiMz.getG202().getTaskCount()+taskCount);
|
||||
rongQiMz.getG202().setLxCount(rongQiMz.getG202().getLxCount()+1);
|
||||
rongQiMz.getG202().setLxCount(rongQiMz.getG202().getLxCount()+g);
|
||||
break;
|
||||
case "203":
|
||||
rongQi.setG203(taskCount);
|
||||
rqLtList.get(i).setG203(rqLtList.get(i).getG203()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG203().setTaskCount(rongQiMz.getG203().getTaskCount()+taskCount);
|
||||
rongQiMz.getG203().setLxCount(rongQiMz.getG203().getLxCount()+1);
|
||||
rongQiMz.getG203().setLxCount(rongQiMz.getG203().getLxCount()+g);
|
||||
break;
|
||||
case "204":
|
||||
rongQi.setG204(taskCount);
|
||||
rqLtList.get(i).setG204(rqLtList.get(i).getG204()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG204().setTaskCount(rongQiMz.getG204().getTaskCount()+taskCount);
|
||||
rongQiMz.getG204().setLxCount(rongQiMz.getG204().getLxCount()+1);
|
||||
rongQiMz.getG204().setLxCount(rongQiMz.getG204().getLxCount()+g);
|
||||
break;
|
||||
case "205":
|
||||
rongQi.setG205(taskCount);
|
||||
rqLtList.get(i).setG205(rqLtList.get(i).getG205()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG205().setTaskCount(rongQiMz.getG205().getTaskCount()+taskCount);
|
||||
rongQiMz.getG205().setLxCount(rongQiMz.getG205().getLxCount()+1);
|
||||
rongQiMz.getG205().setLxCount(rongQiMz.getG205().getLxCount()+g);
|
||||
break;
|
||||
case "206":
|
||||
rongQi.setG206(taskCount);
|
||||
rqLtList.get(i).setG206(rqLtList.get(i).getG206()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG206().setTaskCount(rongQiMz.getG206().getTaskCount()+taskCount);
|
||||
rongQiMz.getG206().setLxCount(rongQiMz.getG206().getLxCount()+1);
|
||||
rongQiMz.getG206().setLxCount(rongQiMz.getG206().getLxCount()+g);
|
||||
break;
|
||||
case "207":
|
||||
rongQi.setG207(taskCount);
|
||||
rqLtList.get(i).setG207(rqLtList.get(i).getG207()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG207().setTaskCount(rongQiMz.getG207().getTaskCount()+taskCount);
|
||||
rongQiMz.getG207().setLxCount(rongQiMz.getG207().getLxCount()+1);
|
||||
rongQiMz.getG207().setLxCount(rongQiMz.getG207().getLxCount()+g);
|
||||
break;
|
||||
case "208":
|
||||
rongQi.setG208(taskCount);
|
||||
rqLtList.get(i).setG208(rqLtList.get(i).getG208()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG208().setTaskCount(rongQiMz.getG208().getTaskCount()+taskCount);
|
||||
rongQiMz.getG208().setLxCount(rongQiMz.getG208().getLxCount()+1);
|
||||
rongQiMz.getG208().setLxCount(rongQiMz.getG208().getLxCount()+g);
|
||||
break;
|
||||
case "209":
|
||||
rongQi.setG209(taskCount);
|
||||
rqLtList.get(i).setG209(rqLtList.get(i).getG209()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG209().setTaskCount(rongQiMz.getG209().getTaskCount()+taskCount);
|
||||
rongQiMz.getG209().setLxCount(rongQiMz.getG209().getLxCount()+1);
|
||||
rongQiMz.getG209().setLxCount(rongQiMz.getG209().getLxCount()+g);
|
||||
break;
|
||||
case "210":
|
||||
rongQi.setG210(taskCount);
|
||||
rqLtList.get(i).setG210(rqLtList.get(i).getG210()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG210().setTaskCount(rongQiMz.getG210().getTaskCount()+taskCount);
|
||||
rongQiMz.getG210().setLxCount(rongQiMz.getG210().getLxCount()+1);
|
||||
rongQiMz.getG210().setLxCount(rongQiMz.getG210().getLxCount()+g);
|
||||
break;
|
||||
case "211":
|
||||
rongQi.setG211(taskCount);
|
||||
rqLtList.get(i).setG211(rqLtList.get(i).getG211()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG211().setTaskCount(rongQiMz.getG211().getTaskCount()+taskCount);
|
||||
rongQiMz.getG211().setLxCount(rongQiMz.getG211().getLxCount()+1);
|
||||
rongQiMz.getG211().setLxCount(rongQiMz.getG211().getLxCount()+g);
|
||||
break;
|
||||
case "212":
|
||||
rongQi.setG212(taskCount);
|
||||
rqLtList.get(i).setG212(rqLtList.get(i).getG212()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG212().setTaskCount(rongQiMz.getG212().getTaskCount()+taskCount);
|
||||
rongQiMz.getG212().setLxCount(rongQiMz.getG212().getLxCount()+1);
|
||||
rongQiMz.getG212().setLxCount(rongQiMz.getG212().getLxCount()+g);
|
||||
break;
|
||||
case "213":
|
||||
rongQi.setG213(taskCount);
|
||||
rqLtList.get(i).setG213(rqLtList.get(i).getG213()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG213().setTaskCount(rongQiMz.getG213().getTaskCount()+taskCount);
|
||||
rongQiMz.getG213().setLxCount(rongQiMz.getG213().getLxCount()+1);
|
||||
rongQiMz.getG213().setLxCount(rongQiMz.getG213().getLxCount()+g);
|
||||
break;
|
||||
case "214":
|
||||
rongQi.setG214(taskCount);
|
||||
rqLtList.get(i).setG214(rqLtList.get(i).getG214()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG214().setTaskCount(rongQiMz.getG214().getTaskCount()+taskCount);
|
||||
rongQiMz.getG214().setLxCount(rongQiMz.getG214().getLxCount()+1);
|
||||
rongQiMz.getG214().setLxCount(rongQiMz.getG214().getLxCount()+g);
|
||||
break;
|
||||
case "215":
|
||||
rongQi.setG215(taskCount);
|
||||
rqLtList.get(i).setG215(rqLtList.get(i).getG215()+gzzCount);
|
||||
rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
|
||||
rongQiMz.getG215().setTaskCount(rongQiMz.getG215().getTaskCount()+taskCount);
|
||||
rongQiMz.getG215().setLxCount(rongQiMz.getG215().getLxCount()+1);
|
||||
rongQiMz.getG215().setLxCount(rongQiMz.getG215().getLxCount()+g);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
gzzCount=0;
|
||||
}
|
||||
rongQi.setCount(rongQi.getG201()+rongQi.getG202()+rongQi.getG203()+rongQi.getG204()+rongQi.getG205()+rongQi.getG206()+rongQi.getG207()+rongQi.getG208()+rongQi.getG209()
|
||||
+rongQi.getG210()+rongQi.getG211()+rongQi.getG212()+rongQi.getG213()+rongQi.getG214()+rongQi.getG215());
|
||||
|
|
@ -479,7 +533,10 @@ class RongQiLt implements Serializable{
|
|||
private int g213=0;
|
||||
private int g214=0;
|
||||
private int g215=0;
|
||||
// 汇总
|
||||
private int total=0;
|
||||
// 料箱数
|
||||
private int lxCount=0;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
|
@ -513,7 +570,7 @@ class RQMzModel implements Serializable {
|
|||
private Long id;
|
||||
/*任务行*/
|
||||
private double taskCount=0;
|
||||
/*料箱数*/
|
||||
/*容器流通次数*/
|
||||
private double lxCount=0;
|
||||
/*命中率*/
|
||||
private double mz=0;
|
||||
|
|
|
|||
|
|
@ -28,72 +28,38 @@ public class KucunhuizongImpl implements Kucunhuizong {
|
|||
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
String sql="select Row_number() OVER(ORDER BY item.id,loc.id) as Row_Num,\n" +
|
||||
"max(inv.id) as id,\n" +
|
||||
"max(loc.code) as locCode,--库位号\n" +
|
||||
"max(item.code) as itemCode,--料号\n" +
|
||||
"max(item.name) as itemName,--描述\n" +
|
||||
"max(inv.BAR_CODE) as barCode,--序列号\n" +
|
||||
"max(inv.STATUS) as status,--状态\n" +
|
||||
"max(inv.LOCATION_ID) as LOCATION_ID,--库位ID\n" +
|
||||
"max(inv.ITEM_KEY_ID) as ITEM_KEY_ID,--料号属性ID\n" +
|
||||
"sum(inv.QUANTITY) as quantity,\t--库存数量\n" +
|
||||
"sum(inv.QUEUED_QUANTITY) as queuedQuantity,--占用数量\n" +
|
||||
"max(ik.PROP_C1) as propC1,--批次号\n" +
|
||||
"max(ik.PROP_C2) as propC2,--LOC\n" +
|
||||
"max(ik.PROP_C3) as propC3,--特殊标记\n" +
|
||||
"max(ik.PROP_C4) as propC4,--部门\n" +
|
||||
"max(ik.PROP_C5) as propC5,--供应商编号\n" +
|
||||
"max(ik.PROP_C6) as propC6,--申请人编号\n" +
|
||||
"max(ik.PROP_C7) as propC7,--申请人\n" +
|
||||
"max(ik.PROP_C8) as propC8,--暂存原因\n" +
|
||||
"max(ik.PROP_C9) as propC9,--工厂\n" +
|
||||
"max(inv.SOI) as soi,--入库单号\n" +
|
||||
"max(ik.PROP_D1) prop_D1,--生产日期\n" +
|
||||
"max(ik.PROP_D2) prop_D2,--到日期\n" +
|
||||
"max(z.name) as kqName,--库区\n" +
|
||||
"max(z.ID) as ZONE_ID,--库区ID\n" +
|
||||
"\n" +
|
||||
"case \n" +
|
||||
"\twhen max(inv.coun_Plan) is null then 0\n" +
|
||||
"\telse 1\n" +
|
||||
"end as lock,--是否盘点\n" +
|
||||
"case \n" +
|
||||
"\twhen max(z.NAME) in('7#堆垛区','3#货架区','3#料箱区') \n" +
|
||||
"then max(ls1.name) else max(ls.name) end as LSname,--AGV库位\n" +
|
||||
"max(item.Be_SAP_Item) Be_SAP_Item, --是否SAP料号\n" +
|
||||
"max(item.VOLUME) VOLUME,--体积\n" +
|
||||
"max(item.BE_WEIGHT) BE_WEIGHT,--是否危化品\n" +
|
||||
"max(item.SHIP_RULES) SHIP_RULES,--库存价值等级\n" +
|
||||
"max(item.FEE_TYPE) FEE_TYPE,--OA料号\n" +
|
||||
"max(item.SINGLE_ITEM) SINGLE_ITEM,--是否批号管理\n" +
|
||||
"max(item.BE_MARK_WEIGHT) BE_MARK_WEIGHT,--是否序列号\n" +
|
||||
"max(item.UNIT) UNIT,--单位\n" +
|
||||
"max(item.STR_EXTEND1) STR_EXTEND1,--备注\n" +
|
||||
"max(item.STR_EXTEND2) STR_EXTEND2,--币种\n" +
|
||||
"max(item.STR_EXTEND3) STR_EXTEND3,--标准价\n" +
|
||||
"max(item.STR_EXTEND4) STR_EXTEND4,--库存单位\n" +
|
||||
"ISNULL(stock1.agvFlag, 0) agvFlag,--是否在GAV仓\n" +
|
||||
"loc.id locId ,--库位id\n" +
|
||||
"max(lts.NAME) as lts_name,--库位类型\n" +
|
||||
"item.ISBOM validity,--是否有效期管理\n" +
|
||||
"CONVERT(varchar(100), min(inv.STORAGE_DATE), 20) as storageDate,--库存日期\n" +
|
||||
" max(inv.moveStatus) moveStatus,--工作站\n" +
|
||||
"inv.statuss inv_status,--退料标记\n" +
|
||||
"MAX(stock1.WEIGHT) as WEIGHT --重量\n" +
|
||||
"\n" +
|
||||
"from INVENTORY inv\n" +
|
||||
"left join ZONE kq on kq.id=inv.warehouse_Area_ID \n" +
|
||||
"left join LOCATION loc on loc.id=inv.LOCATION_ID\n" +
|
||||
"left join LOCATIONS lts on lts.id=loc.LOCATIONS_ID\n" +
|
||||
"left join STOCK stock1 on stock1.id=loc.stock\n" +
|
||||
"left join LOCATION_STORAGE ls1 on ls1.ID=stock1.locationStorage_ID\n" +
|
||||
"left join ZONE z on z.ID =loc.ZONE_ID\n" +
|
||||
"left join ITEM_KEY ik on ik.id=inv.ITEM_KEY_ID\n" +
|
||||
"left join ITEM item on item.id=ik.ITEM_ID\n" +
|
||||
"left join STOCK stock on stock.ID=inv.LP\n" +
|
||||
"left join LOCATION_STORAGE ls on ls.ID=stock.locationStorage_ID\n" +
|
||||
"where 1=1 and inv.QUANTITY>0 and item.Be_SAP_Item=1 and lts.NAME in('存货','不良品') and inv.status in('已入库','整理中','冻结','质检中')";
|
||||
String sql=" SELECT "
|
||||
+" ROW_NUMBER() OVER (ORDER BY inventory.id ASC) AS Row_Num,"
|
||||
+" inventory.id, "
|
||||
+" inventory.locCode, "
|
||||
+" inventory.itemCode, "
|
||||
+" inventory.itemName, "
|
||||
+" inventory.UNIT, "
|
||||
+" inventory.status, "
|
||||
+" inventory.statuss, "
|
||||
+" inventory.quantity, "
|
||||
+" inventory.queuedQuantity , "
|
||||
+" inventory.LSname, "
|
||||
+" inventory.weight, "
|
||||
+" inventory.propC1, "
|
||||
+" inventory.propC2, "
|
||||
+" inventory.propC3, "
|
||||
+" inventory.propC5, "
|
||||
+" inventory.propC9, "
|
||||
+" inventory.propD2, "
|
||||
+" inventory.kqName, "
|
||||
+" inventory.agvFlag, "
|
||||
+" inventory.SINGLE_ITEM, "
|
||||
+" inventory.validity, "
|
||||
+" inventory.storageDate, "
|
||||
+" inventory.invDes, "
|
||||
+" inventory.propC7, "
|
||||
+" inventory.lock "
|
||||
+" FROM INVENTORY_VIEW inventory "
|
||||
+" WHERE 1=1 "
|
||||
+" and inventory.quantity>0 and inventory.Be_SAP_Item=1 "
|
||||
+" and inventory.lts_name in('存货','不良品','数据虚拟库') "
|
||||
+" and inventory.status not in('待上架','已出库','已合单','合单完成') ";
|
||||
|
||||
//库位号
|
||||
if(kucunhuizong.locCode!=null){
|
||||
|
|
@ -108,7 +74,7 @@ public class KucunhuizongImpl implements Kucunhuizong {
|
|||
sb.append("'"+ str[i]+"'"+",");
|
||||
}
|
||||
}
|
||||
sql+=" and loc.code in ("+sb.toString()+")";
|
||||
sql+=" and inventory.locCode in ("+sb.toString()+")";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -125,14 +91,14 @@ public class KucunhuizongImpl implements Kucunhuizong {
|
|||
sb.append("'"+ str[i]+"'"+",");
|
||||
}
|
||||
}
|
||||
sql+=" and item.code in ("+sb.toString()+")";
|
||||
sql+=" and inventory.itemCode in ("+sb.toString()+")";
|
||||
}
|
||||
}
|
||||
|
||||
//物料描述
|
||||
if(kucunhuizong.itemName!=null){
|
||||
if(!kucunhuizong.itemName.trim().equals("")){
|
||||
sql+=" and item.name like "+"'%"+kucunhuizong.itemName.trim()+"%'";
|
||||
sql+=" and inventory.itemName like "+"'%"+kucunhuizong.itemName.trim()+"%'";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -146,7 +112,7 @@ public class KucunhuizongImpl implements Kucunhuizong {
|
|||
sb.append("'"+ kucunhuizong.propC2[i]+"'"+",");
|
||||
}
|
||||
}
|
||||
sql+=" and ik.PROP_C2 in ("+sb.toString()+")";;
|
||||
sql+=" and inventory.propC2 in ("+sb.toString()+")";;
|
||||
}
|
||||
|
||||
//库存状态
|
||||
|
|
@ -159,7 +125,7 @@ public class KucunhuizongImpl implements Kucunhuizong {
|
|||
sb.append("'"+ kucunhuizong.status[i]+"'"+",");
|
||||
}
|
||||
}
|
||||
sql+=" and inv.STATUS in ("+sb.toString()+")";;
|
||||
sql+=" and inventory.status in ("+sb.toString()+")";;
|
||||
}
|
||||
|
||||
//库区
|
||||
|
|
@ -172,7 +138,7 @@ public class KucunhuizongImpl implements Kucunhuizong {
|
|||
sb.append("'"+ kucunhuizong.kqName[i]+"'"+",");
|
||||
}
|
||||
}
|
||||
sql+=" and z.name in ("+sb.toString()+")";;
|
||||
sql+=" and z.kqName in ("+sb.toString()+")";;
|
||||
}
|
||||
|
||||
//批次号
|
||||
|
|
@ -188,14 +154,14 @@ public class KucunhuizongImpl implements Kucunhuizong {
|
|||
sb.append("'"+ str[i]+"'"+",");
|
||||
}
|
||||
}
|
||||
sql+=" and ik.PROP_C3 in ("+sb.toString()+")";
|
||||
sql+=" and inventory.propC1 in ("+sb.toString()+")";
|
||||
}
|
||||
}
|
||||
|
||||
//特殊标记
|
||||
if(kucunhuizong.propC3!=null){
|
||||
if(!kucunhuizong.propC3.trim().equals("")){
|
||||
sql+=" and item.name like "+"'%"+kucunhuizong.propC3.trim()+"%'";
|
||||
sql+=" and inventory.propC3 like "+"'%"+kucunhuizong.propC3.trim()+"%'";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -203,23 +169,23 @@ public class KucunhuizongImpl implements Kucunhuizong {
|
|||
if(kucunhuizong.storageDate!=null&&kucunhuizong.storageDate.length>0){
|
||||
String startDate = simpleDateFormat.format(kucunhuizong.storageDate[0]);
|
||||
String endDate = simpleDateFormat.format(kucunhuizong.storageDate[1]);
|
||||
sql+=" and CONVERT(DATE, inv.STORAGE_DATE) between "+"'"+startDate+"'"+" and "+ "'"+endDate+"'";
|
||||
sql+=" and CONVERT(DATE, inventory.storageDate) between "+"'"+startDate+"'"+" and "+ "'"+endDate+"'";
|
||||
}
|
||||
|
||||
//供应商号
|
||||
if(kucunhuizong.propC5!=null){
|
||||
if(!kucunhuizong.propC5.trim().equals("")){
|
||||
|
||||
sql+=" and ik.PROP_C5 = "+"'"+kucunhuizong.propC5.trim()+"'";
|
||||
sql+=" and inventory.propC5 = "+"'"+kucunhuizong.propC5.trim()+"'";
|
||||
}
|
||||
}
|
||||
|
||||
//是否盘点
|
||||
if(kucunhuizong.coun_Plan!=null&& !kucunhuizong.coun_Plan.equals("")){
|
||||
if (Integer.parseInt(kucunhuizong.coun_Plan)==0) {
|
||||
sql+=" and inv.coun_Plan is null";
|
||||
sql+=" and inventory.lock is null";
|
||||
}else {
|
||||
sql+=" and inv.coun_Plan is not null";
|
||||
sql+=" and inventory.lock is not null";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -227,30 +193,28 @@ public class KucunhuizongImpl implements Kucunhuizong {
|
|||
if(kucunhuizong.SINGLE_ITEM!=null&& !kucunhuizong.SINGLE_ITEM.equals("")){
|
||||
|
||||
if (Integer.parseInt(kucunhuizong.SINGLE_ITEM)==0) {
|
||||
sql+=" and ik.PROP_C1 is null";
|
||||
sql+=" and inventory.propC1 is null";
|
||||
}else {
|
||||
sql+=" and ik.PROP_C1 is not null";
|
||||
sql+=" and inventory.propC1 is not null";
|
||||
}
|
||||
}
|
||||
|
||||
//是否有效期管理
|
||||
if(kucunhuizong.validity!=null&& !kucunhuizong.validity.equals("")){
|
||||
|
||||
sql+=" and item.ISBOM = "+"'"+kucunhuizong.validity+"'";
|
||||
sql+=" and inventory.validity = "+"'"+kucunhuizong.validity+"'";
|
||||
}
|
||||
|
||||
//退料标记
|
||||
if(kucunhuizong.statuss!=null&& !kucunhuizong.statuss.equals("")){
|
||||
|
||||
sql+=" and inv.statuss = "+"'"+kucunhuizong.statuss+"'";
|
||||
sql+=" and inventory.statuss = "+"'"+kucunhuizong.statuss+"'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
String sqlCount = "select count(t.id) as nums from(" + sql+"\n " +
|
||||
" group by item.id,loc.id,ik.PROP_C1,ik.PROP_C2,ik.PROP_C3,ik.PROP_C5,ik.PROP_C7,inv.STATUS,item.isBOM,inv.statuss,stock1.agvFlag"+") t";
|
||||
String sqlFy = "select t.* from(" + sql+"\n " +
|
||||
" group by item.id,loc.id,ik.PROP_C1,ik.PROP_C2,ik.PROP_C3,ik.PROP_C5,ik.PROP_C7,inv.STATUS,item.isBOM,inv.statuss,stock1.agvFlag"+") t";
|
||||
String sqlCount = "select count(t.id) as nums from(" + sql+") t";
|
||||
String sqlFy = "select t.* from(" + sql+") t";
|
||||
|
||||
|
||||
sqlFy+= " WHERE Row_Num BETWEEN " + (pageNum-1) * pageSize + " AND " + (pageNum) * pageSize;
|
||||
|
|
|
|||
Loading…
Reference in New Issue