Browse Source

fix: 大屏

master
李永德 2 years ago
parent
commit
d05e0af2c1
  1. 51
      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

51
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);
if (ObjectUtil.isNotEmpty(result)) {
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;
}, pool);
@ -91,20 +84,22 @@ public class CockpitServiceImpl implements CockpitService {
finishedTask.thenAccept((result) -> {
List<ProductionStatisticsDto> planRes = new CopyOnWriteArrayList<>();
List<ProductionStatisticsDto> finishedRes = new CopyOnWriteArrayList<>();
if (ObjectUtil.isNotEmpty(result)) {
//成品计划完成情况,应前端要求分开两个一样的数据结果,简化调用数据采集
planRes = result.toJavaList(ProductionStatisticsDto.class);
setResultComplete(planRes);
//今日压制量,干燥量,成品量
finishedRes = result.toJavaList(ProductionStatisticsDto.class);
setResultComplete(finishedRes);
}
//成品计划完成情况,应前端要求分开两个一样的数据结果,简化调用数据采集
planRes = result.toJavaList(ProductionStatisticsDto.class);
setResultComplete(planRes);
//今日压制量,干燥量,成品量
finishedRes = result.toJavaList(ProductionStatisticsDto.class);
setResultComplete(finishedRes);
map.put("planRes", planRes);
map.put("finishedRes", finishedRes);
}).exceptionally((e) -> {
log.error("获取成品计划完成情况: {}", e.getMessage(), e);
map.put("planRes", "");
map.put("finishedRes", "");
List<ProductionStatisticsDto> planRes = new CopyOnWriteArrayList<>();
List<ProductionStatisticsDto> finishedRes = new CopyOnWriteArrayList<>();
setResultComplete(planRes);
setResultComplete(finishedRes);
map.put("planRes", planRes);
map.put("finishedRes", finishedRes);
return null;
});
CompletableFuture<Void> allQuery = CompletableFuture.allOf(productionTask, materialTask, finishedTask);
@ -388,7 +383,7 @@ public class CockpitServiceImpl implements CockpitService {
result.add(ProductionStatisticsDto
.builder()
.workorder_procedure(ProductionStatisticsEnum.getName(String.valueOf(i)))
.label(String.valueOf(i))
.label(String.valueOf(i))
.real_qty(BigDecimal.valueOf(0))
.plan_qty(BigDecimal.valueOf(0))
.build());
@ -398,26 +393,6 @@ public class CockpitServiceImpl implements CockpitService {
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
d.is_used = '1'
ORDER BY
d.device_model,
d.device_code
d.device_model DESC,
d.device_code DESC
ENDSELECT
ENDPAGEQUERY
ENDIF

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

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

Loading…
Cancel
Save