Browse Source

fix: 修复大屏

master
李永德 2 years ago
parent
commit
73369ed8a9
  1. 2
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/dto/SchBasePointDto.java
  2. 67
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java
  3. 128
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_STORAGE.wql
  4. BIN
      lms/nladmin-system/src/main/java/org/nl/wms/wms.xls

2
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/dto/SchBasePointDto.java

@ -32,6 +32,8 @@ public class SchBasePointDto implements Serializable{
* 货位状态
*/
private String point_status;
private String stand_status;
private String stand_status_name;
/**
* 物料标识
*/

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

@ -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;

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

@ -15,6 +15,7 @@
#################################################
输入.flag TYPEAS s_string
输入.point_id TYPEAS s_string
输入.point_type TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
@ -41,29 +42,43 @@
IF 输入.flag = "1"
PAGEQUERY
SELECT
material.material_code,
vd.qty as ivt_qty,
vd.weight as ivt_weight,
vd.create_time as instorage_time,
IF(LENGTH(point.vehicle_code)>0, '1', '') AS struct_url,
point.*
material.material_code,
vd.qty AS ivt_qty,
vd.weight AS ivt_weight,
vd.create_time AS instorage_time,
IF(LENGTH( vd.stand_status )> 0,vd.stand_status,'') AS stand_status,
CASE vd.stand_status
WHEN '2' THEN '静置中'
WHEN '3' THEN '静置完成'
WHEN '4' THEN '强制静置完成'
WHEN '5' THEN '静置超时'
ELSE ''
END AS stand_status_name,
IF(LENGTH( point.vehicle_code )> 0, '1', '') AS struct_url,
point.*
FROM
sch_base_point point
LEFT JOIN st_ivt_vehicle_detail vd ON vd.vehicle_code = point.vehicle_code AND vd.vehicle_type = point.vehicle_type AND vd.is_delete = '0'
LEFT JOIN md_me_material_detail material ON material.material_id = (
SELECT
ve.material_id
FROM
st_ivt_vehicle_detail ve
WHERE
ve.vehicle_code = point.vehicle_code
AND ve.vehicle_type = point.vehicle_type
AND ve.is_delete = '0'
)
sch_base_point point
LEFT JOIN st_ivt_vehicle_detail vd ON vd.vehicle_code = point.vehicle_code
AND vd.vehicle_type = point.vehicle_type
AND vd.is_delete = '0'
LEFT JOIN md_me_materialbase material ON material.material_id = (
SELECT
ve.material_id
FROM
st_ivt_vehicle_detail ve
WHERE
ve.vehicle_code = point.vehicle_code
AND ve.vehicle_type = point.vehicle_type
AND ve.is_delete = '0'
)
WHERE
point.region_code = 'KLHJ'
point.region_code = 'KLHJ' AND point_type != '3'
OPTION 输入.point_type <> ""
point_type = 输入.point_type
ENDOPTION
ORDER BY
point.point_code ASC
point.sort_seq ASC,
point.point_code ASC
ENDSELECT
ENDPAGEQUERY
ENDIF
@ -80,7 +95,7 @@
FROM
sch_base_point point
LEFT JOIN st_ivt_vehicle_detail vd ON vd.vehicle_code = point.vehicle_code AND vd.vehicle_type = point.vehicle_type AND vd.is_delete = '0'
LEFT JOIN md_me_material_detail material ON material.material_id = (
LEFT JOIN md_me_materialbase material ON material.material_id = (
SELECT
ve.material_id
FROM
@ -93,6 +108,7 @@
WHERE
point.region_code = 'BCPHJ'
ORDER BY
point.sort_seq ASC,
point.point_code ASC
ENDSELECT
ENDPAGEQUERY
@ -105,7 +121,7 @@
point.*
FROM
sch_base_point point
LEFT JOIN md_me_material_detail material ON material.material_id = (
LEFT JOIN md_me_materialbase material ON material.material_id = (
SELECT ve.material_id FROM st_ivt_vehicle_detail ve WHERE ve.vehicle_code = point.vehicle_code
AND ve.vehicle_type = point.vehicle_type AND ve.is_delete = '0'
)
@ -119,4 +135,72 @@
ENDPAGEQUERY
ENDIF
IF 输入.flag = "4"
PAGEQUERY
SELECT
material.material_code,
vd.qty AS ivt_qty,
vd.weight AS ivt_weight,
vd.create_time AS instorage_time,
IF(LENGTH( vd.stand_status )> 0,vd.stand_status,'') AS stand_status,
CASE vd.stand_status
WHEN '2' THEN '静置中'
WHEN '3' THEN '静置完成'
WHEN '4' THEN '强制静置完成'
WHEN '5' THEN '静置超时'
ELSE ''
END AS stand_status_name,
IF(LENGTH( point.vehicle_code )> 0, '1', '') AS struct_url,
point.*
FROM
sch_base_point point
LEFT JOIN st_ivt_vehicle_detail vd ON vd.vehicle_code = point.vehicle_code
AND vd.vehicle_type = point.vehicle_type
AND vd.is_delete = '0'
LEFT JOIN md_me_materialbase material ON material.material_id = (
SELECT
ve.material_id
FROM
st_ivt_vehicle_detail ve
WHERE
ve.vehicle_code = point.vehicle_code
AND ve.vehicle_type = point.vehicle_type
AND ve.is_delete = '0'
)
WHERE
point.region_code = 'KLHJ' AND point_type IN ('1','2')
ORDER BY
point.point_code ASC
ENDSELECT
ENDPAGEQUERY
ENDIF
IF 输入.flag = "5"
PAGEQUERY
SELECT
material.material_code,
vd.qty as ivt_qty,
CASE WHEN vd.is_full = '1' THEN '是' ELSE '否' END AS is_full,
IF(LENGTH(point.vehicle_code)>0, '2', '') AS struct_url,
vd.create_time as instorage_time,
point.*
FROM
sch_base_point point
LEFT JOIN st_ivt_vehicle_detail vd ON vd.vehicle_code = point.vehicle_code AND vd.vehicle_type = point.vehicle_type AND vd.is_delete = '0'
LEFT JOIN md_me_materialbase material ON material.material_id = (
SELECT
ve.material_id
FROM
st_ivt_vehicle_detail ve
WHERE
ve.vehicle_code = point.vehicle_code
AND ve.vehicle_type = point.vehicle_type
AND ve.is_delete = '0'
)
WHERE
point.region_code = 'BCPHJ'
ORDER BY
point.point_code ASC
ENDSELECT
ENDPAGEQUERY
ENDIF

BIN
lms/nladmin-system/src/main/java/org/nl/wms/wms.xls

Binary file not shown.
Loading…
Cancel
Save