|
|
@ -130,29 +130,52 @@ public class CockpitServiceImpl implements CockpitService { |
|
|
|
CompletableFuture<List<SchBasePointDto>> materialStorage = CompletableFuture.supplyAsync(() -> { |
|
|
|
List<SchBasePointDto> res = new CopyOnWriteArrayList<>(); |
|
|
|
// 查找所有困料货架
|
|
|
|
JSONArray result = WQL.getWO("COCKPIT_STORAGE").addParam("flag", "1").process().getResultJSONArray(0); |
|
|
|
JSONArray result = WQL.getWO("COCKPIT_STORAGE").addParam("flag", "1").addParam("point_type", "1").process().getResultJSONArray(0); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
res = result.toJavaList(SchBasePointDto.class); |
|
|
|
res.forEach(schBasePointDto -> { |
|
|
|
//Todo 空盅和强制完成状态相关逻辑待完善
|
|
|
|
//根据入库时间和静置时间判断静置状态
|
|
|
|
getStandingStatus(schBasePointDto); |
|
|
|
//是否满托
|
|
|
|
if (StringUtils.isNotEmpty(schBasePointDto.getIs_full())) { |
|
|
|
schBasePointDto.setIs_full(IsOrNotEnum.getName(schBasePointDto.getIs_full())); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
return res; |
|
|
|
}, pool); |
|
|
|
materialStorage.thenAccept((result) -> { |
|
|
|
//原料仓储监控信息,应前端要求分开两个一样的数据结果,简化调用
|
|
|
|
map.put("materialTask", result); |
|
|
|
//原料库存
|
|
|
|
map.put("materialList", result); |
|
|
|
}).exceptionally((e) -> { |
|
|
|
log.error("获取原料仓储信息: {}", e.getMessage(), e); |
|
|
|
map.put("materialTask", ""); |
|
|
|
return null; |
|
|
|
}); |
|
|
|
// 获取液压机旁边的数据
|
|
|
|
CompletableFuture<List<SchBasePointDto>> materialYJStorage = CompletableFuture.supplyAsync(() -> { |
|
|
|
List<SchBasePointDto> res = new CopyOnWriteArrayList<>(); |
|
|
|
// 查找所有困料货架
|
|
|
|
JSONArray result = WQL.getWO("COCKPIT_STORAGE").addParam("flag", "1").addParam("point_type", "2").process().getResultJSONArray(0); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
res = result.toJavaList(SchBasePointDto.class); |
|
|
|
} |
|
|
|
return res; |
|
|
|
}, pool); |
|
|
|
materialYJStorage.thenAccept((result) -> { |
|
|
|
//原料仓储监控信息-高速压机
|
|
|
|
map.put("materialYJTask", result); |
|
|
|
}).exceptionally((e) -> { |
|
|
|
log.error("获取原料(压机旁)仓储信息: {}", e.getMessage(), e); |
|
|
|
map.put("materialYJTask", ""); |
|
|
|
return null; |
|
|
|
}); |
|
|
|
// 获取所有的数据
|
|
|
|
CompletableFuture<List<SchBasePointDto>> materialAllStorage = CompletableFuture.supplyAsync(() -> { |
|
|
|
List<SchBasePointDto> res = new CopyOnWriteArrayList<>(); |
|
|
|
// 查找所有困料货架
|
|
|
|
JSONArray result = WQL.getWO("COCKPIT_STORAGE").addParam("flag", "4").process().getResultJSONArray(0); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
res = result.toJavaList(SchBasePointDto.class); |
|
|
|
} |
|
|
|
return res; |
|
|
|
}, pool); |
|
|
|
materialAllStorage.thenAccept((result) -> { |
|
|
|
//原料库存
|
|
|
|
map.put("materialList", result); |
|
|
|
}).exceptionally((e) -> { |
|
|
|
log.error("获取原料(所有)仓储信息: {}", e.getMessage(), e); |
|
|
|
map.put("materialList", ""); |
|
|
|
return null; |
|
|
|
}); |
|
|
@ -166,17 +189,29 @@ public class CockpitServiceImpl implements CockpitService { |
|
|
|
return res; |
|
|
|
}, pool); |
|
|
|
finishedStorage.thenAccept((result) -> { |
|
|
|
//成品仓储监控信息,应前端要求分开两个一样的数据结果,简化调用
|
|
|
|
map.put("productionTask", result); |
|
|
|
}).exceptionally((e) -> { |
|
|
|
log.error("获取成品仓储信息: {}", e.getMessage(), e); |
|
|
|
map.put("productionTask", ""); |
|
|
|
return null; |
|
|
|
}); |
|
|
|
CompletableFuture<List<SchBasePointDto>> finishedListStorage = CompletableFuture.supplyAsync(() -> { |
|
|
|
List<SchBasePointDto> res = new CopyOnWriteArrayList<>(); |
|
|
|
JSONArray result = WQL.getWO("COCKPIT_STORAGE").addParam("flag", "5").process().getResultJSONArray(0); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
res = result.toJavaList(SchBasePointDto.class); |
|
|
|
} |
|
|
|
return res; |
|
|
|
}, pool); |
|
|
|
finishedListStorage.thenAccept((result) -> { |
|
|
|
//成品库存
|
|
|
|
map.put("productionList", result); |
|
|
|
}).exceptionally((e) -> { |
|
|
|
log.error("获取成品仓储信息: {}", e.getMessage(), e); |
|
|
|
map.put("productionTask", ""); |
|
|
|
map.put("productionList", ""); |
|
|
|
return null; |
|
|
|
}); |
|
|
|
CompletableFuture<Void> allQuery = CompletableFuture.allOf(materialStorage, finishedStorage); |
|
|
|
CompletableFuture<Void> allQuery = CompletableFuture.allOf(materialStorage, finishedStorage, materialYJStorage, materialAllStorage, finishedListStorage); |
|
|
|
CompletableFuture<ConcurrentHashMap<String, Object>> future = allQuery.thenApply((result) -> map).exceptionally((e) -> { |
|
|
|
log.error(e.getMessage(), e); |
|
|
|
return null; |
|
|
|