opt:优化输送线状态采集

This commit is contained in:
2024-11-29 15:32:51 +08:00
parent 4b32fcb1d1
commit 15c500f10e
2 changed files with 25 additions and 19 deletions

View File

@@ -969,24 +969,30 @@ public class CockpitServiceImpl implements CockpitService {
//查询检测站点数据
CompletableFuture<List<Map<String, Object>>> task3 = CompletableFuture.supplyAsync(() -> {
JSONArray site = (JSONArray) redisUtils.get("site");
JSONArray siteMain = (JSONArray) redisUtils.get("siteMain");
log.info("读取acs缓存检测站点数量: {}", site.size());
if (ObjectUtil.isNotEmpty(siteMain)) {
for (Object object : siteMain) {
array.add(object);
}
}
//todo 待补充信号逻辑
if (ObjectUtil.isNotEmpty(site)) {
for (Object object : site) {
JSONObject jsonObject = (JSONObject) object;
if (StringUtils.isBlank(jsonObject.getString("device_status"))) {
//0故障1正常
jsonObject.put("device_status", "1");
}
array.add(jsonObject);
}
JSONObject ssxDetail = new JSONObject();
ssxDetail.put("ssx_detail", site);
array.add(ssxDetail);
} else {
array.add(new JSONObject());
JSONObject ssxDetail = new JSONObject();
ssxDetail.put("ssx_detail", ssxDetail);
array.add(ssxDetail);
}
return null;
}, pool);
task3.exceptionally((e) -> {
log.error("读取设备缓存信息: {}", e.getMessage(), e);
JSONObject ssxDetail = new JSONObject();
ssxDetail.put("ssx_detail", ssxDetail);
array.add(ssxDetail);
return null;
});
//查询AGV数据
@@ -1049,19 +1055,18 @@ public class CockpitServiceImpl implements CockpitService {
log.error("读取设备缓存信息: {}", e.getMessage(), e);
return null;
});
// todo 输送线详情对接Redis
//普涂线详情
CompletableFuture<JSONArray> task6 = CompletableFuture.supplyAsync(() -> {
JSONArray result = cockpitMapper.getSSXInteriorList();
JSONObject ssxDetail = new JSONObject();
ssxDetail.put("ssx_detail", result);
array.add(ssxDetail);
JSONArray ptx = (JSONArray) redisUtils.get("ptx");
if (ObjectUtil.isNotEmpty(ptx)) {
for (Object object : ptx) {
array.add(object);
}
}
return null;
}, pool);
task6.exceptionally((e) -> {
log.error("输送线详情{}", e.getMessage(), e);
JSONObject ssxDetail = new JSONObject();
ssxDetail.put("ssx_detail", ssxDetail);
array.add(ssxDetail);
log.error("普涂线详情{}", e.getMessage(), e);
return null;
});
// 库位详情

View File

@@ -260,7 +260,8 @@
parent_point_code AS device
FROM `sch_base_point`
WHERE region_code = 'GH'
AND point_type = '2'
AND ( point_type in (2,3,4))
ORDER BY device_code
</select>
<select id="getSSXInteriorList" resultType="com.alibaba.fastjson.JSONObject">
SELECT