Browse Source

fix: 大屏

master
李永德 2 years ago
parent
commit
d05e0af2c1
  1. 37
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java
  2. 4
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_DEVICE.wql
  3. 2
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_STORAGE.wql

37
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java

@ -51,13 +51,6 @@ 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 -> {
// r.setCust_name("新余钢铁");
// if(StringUtils.isNotEmpty(r.getLabel())) {
// r.setLabel(r.getLabel().substring(0, 2));
// r.setShift_type(r.getLabel().substring(0, 2) + "白班");
// }
// });
} }
return res; return res;
}, pool); }, pool);
@ -91,20 +84,22 @@ public class CockpitServiceImpl implements CockpitService {
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)) {
//成品计划完成情况,应前端要求分开两个一样的数据结果,简化调用数据采集 //成品计划完成情况,应前端要求分开两个一样的数据结果,简化调用数据采集
planRes = result.toJavaList(ProductionStatisticsDto.class); planRes = result.toJavaList(ProductionStatisticsDto.class);
setResultComplete(planRes); setResultComplete(planRes);
//今日压制量,干燥量,成品量 //今日压制量,干燥量,成品量
finishedRes = result.toJavaList(ProductionStatisticsDto.class); finishedRes = result.toJavaList(ProductionStatisticsDto.class);
setResultComplete(finishedRes); setResultComplete(finishedRes);
}
map.put("planRes", planRes); map.put("planRes", planRes);
map.put("finishedRes", finishedRes); map.put("finishedRes", finishedRes);
}).exceptionally((e) -> { }).exceptionally((e) -> {
log.error("获取成品计划完成情况: {}", e.getMessage(), e); log.error("获取成品计划完成情况: {}", e.getMessage(), e);
map.put("planRes", ""); List<ProductionStatisticsDto> planRes = new CopyOnWriteArrayList<>();
map.put("finishedRes", ""); List<ProductionStatisticsDto> finishedRes = new CopyOnWriteArrayList<>();
setResultComplete(planRes);
setResultComplete(finishedRes);
map.put("planRes", planRes);
map.put("finishedRes", finishedRes);
return null; return null;
}); });
CompletableFuture<Void> allQuery = CompletableFuture.allOf(productionTask, materialTask, finishedTask); CompletableFuture<Void> allQuery = CompletableFuture.allOf(productionTask, materialTask, finishedTask);
@ -398,26 +393,6 @@ public class CockpitServiceImpl implements CockpitService {
Collections.sort(result, Comparator.comparing(dto -> Integer.parseInt(dto.getLabel()))); Collections.sort(result, Comparator.comparing(dto -> Integer.parseInt(dto.getLabel())));
} }
/**
* 处理工序字段
*/
private void getProcedureName(List<ProductionStatisticsDto> result, int type) {
// if(type == 1) {
// result.forEach(r -> {
// if(StringUtils.isNotEmpty(r.getWorkorder_procedure())) {
// r.setWorkorder_procedure(ProductionStatisticsEnum.getName(r.getWorkorder_procedure()));
// }
// });
// }
// else{
// result.forEach(r -> {
// if(StringUtils.isNotEmpty(r.getWorkorder_procedure())) { // 处理字段
// r.setWorkorder_procedure(ProductionStatisticsEnum.getName(r.getWorkorder_procedure()));
// }
// });
// }
}
/** /**
* 判断静置状态 * 判断静置状态
*/ */

4
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_DEVICE.wql

@ -82,8 +82,8 @@
WHERE WHERE
d.is_used = '1' d.is_used = '1'
ORDER BY ORDER BY
d.device_model, d.device_model DESC,
d.device_code d.device_code DESC
ENDSELECT ENDSELECT
ENDPAGEQUERY ENDPAGEQUERY
ENDIF ENDIF

2
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_STORAGE.wql

@ -43,6 +43,7 @@
PAGEQUERY PAGEQUERY
SELECT SELECT
material.material_code, material.material_code,
HOUR(TIMEDIFF(NOW(), vd.create_time)) AS standing_time,
vd.qty AS ivt_qty, vd.qty AS ivt_qty,
vd.weight AS ivt_weight, vd.weight AS ivt_weight,
vd.create_time AS instorage_time, vd.create_time AS instorage_time,
@ -139,6 +140,7 @@
PAGEQUERY PAGEQUERY
SELECT SELECT
material.material_code, material.material_code,
HOUR(TIMEDIFF(NOW(), vd.create_time)) AS standing_time,
vd.qty AS ivt_qty, vd.qty AS ivt_qty,
vd.weight AS ivt_weight, vd.weight AS ivt_weight,
vd.create_time AS instorage_time, vd.create_time AS instorage_time,

Loading…
Cancel
Save