opt:优化输送线状态采集
This commit is contained in:
@@ -969,24 +969,30 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
//查询检测站点数据
|
//查询检测站点数据
|
||||||
CompletableFuture<List<Map<String, Object>>> task3 = CompletableFuture.supplyAsync(() -> {
|
CompletableFuture<List<Map<String, Object>>> task3 = CompletableFuture.supplyAsync(() -> {
|
||||||
JSONArray site = (JSONArray) redisUtils.get("site");
|
JSONArray site = (JSONArray) redisUtils.get("site");
|
||||||
|
JSONArray siteMain = (JSONArray) redisUtils.get("siteMain");
|
||||||
log.info("读取acs缓存检测站点数量: {}", site.size());
|
log.info("读取acs缓存检测站点数量: {}", site.size());
|
||||||
|
if (ObjectUtil.isNotEmpty(siteMain)) {
|
||||||
|
for (Object object : siteMain) {
|
||||||
|
array.add(object);
|
||||||
|
}
|
||||||
|
}
|
||||||
//todo 待补充信号逻辑
|
//todo 待补充信号逻辑
|
||||||
if (ObjectUtil.isNotEmpty(site)) {
|
if (ObjectUtil.isNotEmpty(site)) {
|
||||||
for (Object object : site) {
|
JSONObject ssxDetail = new JSONObject();
|
||||||
JSONObject jsonObject = (JSONObject) object;
|
ssxDetail.put("ssx_detail", site);
|
||||||
if (StringUtils.isBlank(jsonObject.getString("device_status"))) {
|
array.add(ssxDetail);
|
||||||
//0故障1正常
|
|
||||||
jsonObject.put("device_status", "1");
|
|
||||||
}
|
|
||||||
array.add(jsonObject);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
array.add(new JSONObject());
|
JSONObject ssxDetail = new JSONObject();
|
||||||
|
ssxDetail.put("ssx_detail", ssxDetail);
|
||||||
|
array.add(ssxDetail);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}, pool);
|
}, pool);
|
||||||
task3.exceptionally((e) -> {
|
task3.exceptionally((e) -> {
|
||||||
log.error("读取设备缓存信息: {}", e.getMessage(), e);
|
log.error("读取设备缓存信息: {}", e.getMessage(), e);
|
||||||
|
JSONObject ssxDetail = new JSONObject();
|
||||||
|
ssxDetail.put("ssx_detail", ssxDetail);
|
||||||
|
array.add(ssxDetail);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
//查询AGV数据
|
//查询AGV数据
|
||||||
@@ -1049,19 +1055,18 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
log.error("读取设备缓存信息: {}", e.getMessage(), e);
|
log.error("读取设备缓存信息: {}", e.getMessage(), e);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
// todo 输送线详情,对接Redis
|
//普涂线详情
|
||||||
CompletableFuture<JSONArray> task6 = CompletableFuture.supplyAsync(() -> {
|
CompletableFuture<JSONArray> task6 = CompletableFuture.supplyAsync(() -> {
|
||||||
JSONArray result = cockpitMapper.getSSXInteriorList();
|
JSONArray ptx = (JSONArray) redisUtils.get("ptx");
|
||||||
JSONObject ssxDetail = new JSONObject();
|
if (ObjectUtil.isNotEmpty(ptx)) {
|
||||||
ssxDetail.put("ssx_detail", result);
|
for (Object object : ptx) {
|
||||||
array.add(ssxDetail);
|
array.add(object);
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}, pool);
|
}, pool);
|
||||||
task6.exceptionally((e) -> {
|
task6.exceptionally((e) -> {
|
||||||
log.error("输送线详情{}", e.getMessage(), e);
|
log.error("普涂线详情{}", e.getMessage(), e);
|
||||||
JSONObject ssxDetail = new JSONObject();
|
|
||||||
ssxDetail.put("ssx_detail", ssxDetail);
|
|
||||||
array.add(ssxDetail);
|
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
// 库位详情
|
// 库位详情
|
||||||
|
|||||||
@@ -260,7 +260,8 @@
|
|||||||
parent_point_code AS device
|
parent_point_code AS device
|
||||||
FROM `sch_base_point`
|
FROM `sch_base_point`
|
||||||
WHERE region_code = 'GH'
|
WHERE region_code = 'GH'
|
||||||
AND point_type = '2'
|
AND ( point_type in (2,3,4))
|
||||||
|
ORDER BY device_code
|
||||||
</select>
|
</select>
|
||||||
<select id="getSSXInteriorList" resultType="com.alibaba.fastjson.JSONObject">
|
<select id="getSSXInteriorList" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Reference in New Issue
Block a user