1.任务完成,取消,指令创建,指令完成,取消,自动创建指令,各源头异常记录。
2.修改RGV下发指令失败,指令取消未对接成功处理及日志记录
This commit is contained in:
2024-10-10 23:05:43 +08:00
parent 642b070c06
commit 3ddf71077e
15 changed files with 356 additions and 336 deletions

View File

@@ -156,20 +156,20 @@ public class CockpitServiceImpl implements CockpitService {
//今日生产任务
CompletableFuture<List<Map<String, Object>>> task7 = CompletableFuture.supplyAsync(() -> {
List<Map<String, Object>> result =cockpitMapper.getTdWorkmsg();
List<Map<String, Object>> today_work = new ArrayList<>();
if (ObjectUtil.isEmpty(result)) {
//测试数据,上线后删除
Map<String, Object> item1 = new HashMap<>();
item1.put("workorder_code", "240918001");
item1.put("material_name", "TS_12Z中负");
item1.put("plan_qty", "100");
item1.put("real_qty", "0");
item1.put("point_name", "普涂线01");
item1.put("device_code", "LTX01");
item1.put("workorder_status", "生产中");
today_work.add(item1);
}
getHomeInfo.put("today_work", today_work);
// List<Map<String, Object>> today_work = new ArrayList<>();
// if (ObjectUtil.isEmpty(result)) {
// //测试数据,上线后删除
// Map<String, Object> item1 = new HashMap<>();
// item1.put("workorder_code", "240918001");
// item1.put("material_name", "TS_12Z中负");
// item1.put("plan_qty", "100");
// item1.put("real_qty", "0");
// item1.put("point_name", "普涂线01");
// item1.put("device_code", "LTX01");
// item1.put("workorder_status", "生产中");
// today_work.add(item1);
// }
getHomeInfo.put("today_work", result);
return null;
}, pool);
task7.exceptionally((e) -> {
@@ -207,7 +207,7 @@ public class CockpitServiceImpl implements CockpitService {
CompletableFuture<List<Map<String, Object>>> task10 = CompletableFuture.supplyAsync(() -> {
List<Map<String, Object>> result =cockpitMapper.faultAlarm();
//测试数据,上线后删除
faultAlarmDefault(result, "GHS01");
//faultAlarmDefault(result, "GHS01");
getHomeInfo.put("fault_alarm", result);
return null;
}, pool);
@@ -219,7 +219,6 @@ public class CockpitServiceImpl implements CockpitService {
//近30日故障统计
CompletableFuture<JSONArray> task11 = CompletableFuture.supplyAsync(() -> {
JSONArray result=cockpitMapper.monthlyFaultStatistics();
//测试数据,上线后删除
getHomeInfo.put("monthly_fault_statistics", result);
return null;
}, pool);
@@ -321,11 +320,11 @@ public class CockpitServiceImpl implements CockpitService {
//实时故障告警
List<Map<String, Object>> fault_alarm = cockpitMapper.FaultTime("TBX");
//测试数据,上线后删除
faultAlarmDefault(fault_alarm, "LTX01");
//faultAlarmDefault(fault_alarm, "LTX01");
//近30日故障统计
JSONArray monthly_fault_statistics = cockpitMapper.FaultTotal("TBX");
//测试数据,上线后删除
monthlyFaultStatisticsDefault(monthly_fault_statistics, "LTX01");
//monthlyFaultStatisticsDefault(monthly_fault_statistics, "LTX01");
List<Map<String, Object>> monthly_produce_statistics = cockpitMapper.getTbxMonthlyStatistics();
List<Map<String, Object>> tbxMonthlyStatistics = new ArrayList<>();
for (int i = 0; i < 30; i++) {
@@ -410,7 +409,7 @@ public class CockpitServiceImpl implements CockpitService {
//今日固化任务
List<Map<String, Object>> gh_material_summary = new ArrayList<>();
List<TaskInfo> taskInfos = getTasks(RegionCodeConstant.CURING_ZONE);
if (ObjectUtil.isNotEmpty(taskInfos)) {
// if (ObjectUtil.isNotEmpty(taskInfos)) {
taskInfos.forEach(r -> {
Map<String, Object> item = new HashMap<>();
item.put("material_name", r.getMaterial_name());
@@ -419,21 +418,21 @@ public class CockpitServiceImpl implements CockpitService {
item.put("type", r.getType());
gh_material_summary.add(item);
});
} else {
//测试数据,上线后删除
Map<String, Object> item1 = new HashMap<>();
item1.put("material_name", "TS_1.9A正");
item1.put("material_spec", "正涂片极板1.9A/大片");
item1.put("qty", "100");
item1.put("type", "入库");
Map<String, Object> item2 = new HashMap<>();
item2.put("material_name", "TS_15A负");
item2.put("material_spec", "负涂片极板15A/大片");
item2.put("qty", "100");
item2.put("type", "出库");
gh_material_summary.add(item1);
gh_material_summary.add(item2);
}
// } else {
// //测试数据,上线后删除
// Map<String, Object> item1 = new HashMap<>();
// item1.put("material_name", "TS_1.9A正");
// item1.put("material_spec", "正涂片极板1.9A/大片");
// item1.put("qty", "100");
// item1.put("type", "入库");
// Map<String, Object> item2 = new HashMap<>();
// item2.put("material_name", "TS_15A负");
// item2.put("material_spec", "负涂片极板15A/大片");
// item2.put("qty", "100");
// item2.put("type", "出库");
// gh_material_summary.add(item1);
// gh_material_summary.add(item2);
// }
stopWatch2.stop();
System.out.println("今日固化任务统计花费时间---= totalTime = " + stopWatch2.getTotalTimeMillis());
@@ -442,7 +441,7 @@ public class CockpitServiceImpl implements CockpitService {
stopWatch3.start();
//实时故障告警
List<Map<String, Object>> fault_alarm = cockpitMapper.FaultTime("GH");
faultAlarmDefault(fault_alarm, "GHS01");
//faultAlarmDefault(fault_alarm, "GHS01");
stopWatch3.stop();
System.out.println("查询实时故障告警花费时间---= totalTime = " + stopWatch3.getTotalTimeMillis());
@@ -452,11 +451,9 @@ public class CockpitServiceImpl implements CockpitService {
//近30日故障统计
JSONArray monthly_fault_statistics = cockpitMapper.FaultTotal("GH");
//测试数据,上线后删除
monthlyFaultStatisticsDefault(monthly_fault_statistics, "GHS01");
//monthlyFaultStatisticsDefault(monthly_fault_statistics, "GHS01");
stopWatch4.stop();
System.out.println("查询近30日故障统计花费时间---= totalTime = " + stopWatch4.getTotalTimeMillis());
getGhsInfo.put("curing_summary", curing_summary);
getGhsInfo.put("monthly_gh_qty", monthly_gh_qty_default);
getGhsInfo.put("gh_material_summary", gh_material_summary);
@@ -550,12 +547,12 @@ public class CockpitServiceImpl implements CockpitService {
//近30日故障统计
JSONArray monthly_fault_statistics = cockpitMapper.monthlyFaultStatistics();
//测试数据,上线后删除
if (ObjectUtil.isEmpty(monthly_fault_statistics)) {
JSONObject item = new JSONObject();
item.put("region_name", "GHS");
item.put("alarm_qty", "1");
monthly_fault_statistics.add(item);
}
// if (ObjectUtil.isEmpty(monthly_fault_statistics)) {
// JSONObject item = new JSONObject();
// item.put("region_name", "GHS");
// item.put("alarm_qty", "1");
// monthly_fault_statistics.add(item);
// }
getHandlingInfo.put("device_status", device_status);
getHandlingInfo.put("fault_alarm", fault_alarm);
getHandlingInfo.put("monthly_fault_statistics", monthly_fault_statistics);

View File

@@ -485,17 +485,17 @@
) g ON g.workorder_code = w.workorder_code
WHERE
w.point_code = #{deviceCode}
<!-- AND <choose>-->
<!-- <when test="dateType == 1">-->
<!-- w.create_time BETWEEN CONCAT(DATE(NOW()), ' 07:00:00') AND CONCAT(DATE(NOW()), ' 18:00:00')-->
<!-- </when>-->
<!-- <when test="dateType == 2">-->
<!-- w.create_time BETWEEN CONCAT(DATE(NOW()), ' 18:30:00') AND CONCAT(DATE_ADD(DATE(NOW()), INTERVAL 1 DAY), ' 06:30:00')-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- 1 = 1-->
<!-- </otherwise>-->
<!-- </choose>-->
AND <choose>
<when test="dateType == 1">
w.create_time BETWEEN CONCAT(DATE(NOW()), ' 07:00:00') AND CONCAT(DATE(NOW()), ' 18:00:00')
</when>
<when test="dateType == 2">
w.create_time BETWEEN CONCAT(DATE(NOW()), ' 18:30:00') AND CONCAT(DATE_ADD(DATE(NOW()), INTERVAL 1 DAY), ' 06:30:00')
</when>
<otherwise>
1 = 1
</otherwise>
</choose>
</select>
<select id="ltProduction" resultType="com.alibaba.fastjson.JSONObject">
SELECT
@@ -692,7 +692,7 @@ GROUP BY
'网络超时'
WHEN '512' THEN
'信号丢失'
ELSE ''
ELSE '其他'
END AS fault_cause,
d.device_code AS device_name,
d.failure_time AS alarm_time