|
@ -56,14 +56,14 @@ public class CockpitServiceImpl implements CockpitService{ |
|
|
JSONArray result = WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "1").process().getResultJSONArray(0); |
|
|
JSONArray result = WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "1").process().getResultJSONArray(0); |
|
|
if(ObjectUtil.isNotEmpty(result)) { |
|
|
if(ObjectUtil.isNotEmpty(result)) { |
|
|
res = result.toJavaList(WorkorderDto.class); |
|
|
res = result.toJavaList(WorkorderDto.class); |
|
|
res.forEach(r -> { |
|
|
// res.forEach(r -> {
|
|
|
// todo: 未根据实际,可以不需要客户
|
|
|
// todo: 未根据实际,可以不需要客户
|
|
|
r.setCust_name("新余钢铁"); |
|
|
// r.setCust_name("新余钢铁");
|
|
|
if(StringUtils.isNotEmpty(r.getLabel())) { |
|
|
// if(StringUtils.isNotEmpty(r.getLabel())) {
|
|
|
r.setLabel(r.getLabel().substring(0, 2)); |
|
|
// r.setLabel(r.getLabel().substring(0, 2));
|
|
|
r.setShift_type(r.getLabel().substring(0, 2) + "白班"); |
|
|
// r.setShift_type(r.getLabel().substring(0, 2) + "白班");
|
|
|
} |
|
|
// }
|
|
|
}); |
|
|
// });
|
|
|
} |
|
|
} |
|
|
return res; |
|
|
return res; |
|
|
}, pool); |
|
|
}, pool); |
|
@ -72,25 +72,28 @@ public class CockpitServiceImpl implements CockpitService{ |
|
|
map.put("productionTask", ""); |
|
|
map.put("productionTask", ""); |
|
|
return null; |
|
|
return null; |
|
|
}); |
|
|
}); |
|
|
|
|
|
/** |
|
|
|
|
|
* 为了不破坏原来的输出形式,会有冗余数据的输出 |
|
|
|
|
|
*/ |
|
|
// 2、获取原料计划完成情况
|
|
|
// 2、获取原料计划完成情况
|
|
|
CompletableFuture<JSONArray> materialTask = CompletableFuture.supplyAsync(() -> WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "2").process().getResultJSONArray(0), pool); |
|
|
CompletableFuture<JSONArray> materialTask = CompletableFuture.supplyAsync(() -> WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "5").process().getResultJSONArray(0), pool); |
|
|
materialTask.thenAccept((result) -> map.put("materialTask", result)).exceptionally((e) -> { |
|
|
materialTask.thenAccept((result) -> map.put("materialTask", result)).exceptionally((e) -> { |
|
|
log.error("获取原料计划完成情况: {}", e.getMessage(), e); |
|
|
log.error("获取原料计划完成情况: {}", e.getMessage(), e); |
|
|
map.put("materialTask", ""); |
|
|
map.put("materialTask", ""); |
|
|
return null; |
|
|
return null; |
|
|
}); |
|
|
}); |
|
|
// 3、获取成品计划完成情况,今日压制量,干燥量,成品量
|
|
|
// 3、获取成品计划完成情况,今日压制量,干燥量,成品量
|
|
|
CompletableFuture<JSONArray> finishedTask = CompletableFuture.supplyAsync(() -> WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "3").process().getResultJSONArray(0), pool); |
|
|
CompletableFuture<JSONArray> finishedTask = CompletableFuture.supplyAsync(() -> WQL.getWO("COCKPIT_PRODUCTION").addParam("flag", "4").process().getResultJSONArray(0), pool); |
|
|
finishedTask.thenAccept((result) -> { |
|
|
finishedTask.thenAccept((result) -> { |
|
|
List<ProductionStatisticsDto> planRes = new CopyOnWriteArrayList<>(); |
|
|
List<ProductionStatisticsDto> planRes = new CopyOnWriteArrayList<>(); |
|
|
List<ProductionStatisticsDto> finishedRes = new CopyOnWriteArrayList<>(); |
|
|
List<ProductionStatisticsDto> finishedRes = new CopyOnWriteArrayList<>(); |
|
|
if(ObjectUtil.isNotEmpty(result)) { |
|
|
if(ObjectUtil.isNotEmpty(result)) { |
|
|
//成品计划完成情况,应前端要求分开两个一样的数据结果,简化调用
|
|
|
//成品计划完成情况,应前端要求分开两个一样的数据结果,简化调用数据采集
|
|
|
planRes = result.toJavaList(ProductionStatisticsDto.class); |
|
|
planRes = result.toJavaList(ProductionStatisticsDto.class); |
|
|
getProcedureName(planRes, 1); |
|
|
// getProcedureName(planRes, 1);
|
|
|
//今日压制量,干燥量,成品量
|
|
|
//今日压制量,干燥量,成品量
|
|
|
finishedRes = result.toJavaList(ProductionStatisticsDto.class); |
|
|
finishedRes = result.toJavaList(ProductionStatisticsDto.class); |
|
|
getProcedureName(finishedRes, 2); |
|
|
// getProcedureName(finishedRes, 2);
|
|
|
} |
|
|
} |
|
|
map.put("planRes", planRes); |
|
|
map.put("planRes", planRes); |
|
|
map.put("finishedRes", finishedRes); |
|
|
map.put("finishedRes", finishedRes); |
|
@ -319,14 +322,14 @@ public class CockpitServiceImpl implements CockpitService{ |
|
|
private void getProcedureName(List<ProductionStatisticsDto> result, Integer type) { |
|
|
private void getProcedureName(List<ProductionStatisticsDto> result, Integer type) { |
|
|
if(type == 1) { |
|
|
if(type == 1) { |
|
|
result.forEach(r -> { |
|
|
result.forEach(r -> { |
|
|
if(StringUtils.isNotEmpty(r.getLabel())) { |
|
|
if(StringUtils.isNotEmpty(r.getWorkorder_procedure())) { |
|
|
r.setWorkorder_procedure(r.getLabel().substring(0, 2)); |
|
|
r.setWorkorder_procedure(ProductionStatisticsEnum.getName(r.getWorkorder_procedure())); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
result.forEach(r -> { |
|
|
result.forEach(r -> { |
|
|
if(StringUtils.isNotEmpty(r.getWorkorder_procedure())) { |
|
|
if(StringUtils.isNotEmpty(r.getWorkorder_procedure())) { // 处理字段
|
|
|
r.setWorkorder_procedure(ProductionStatisticsEnum.getName(r.getWorkorder_procedure())); |
|
|
r.setWorkorder_procedure(ProductionStatisticsEnum.getName(r.getWorkorder_procedure())); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|