From 0926a39aef0c9fdcee823e189bac2e532c6f0d4b Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期日, 20 十月 2024 21:06:51 +0800
Subject: [PATCH] 1、对接原片仓储opc 2、关闭liquibase,仅需要有脚本变动的时候开启在执行,避免启动报错 3、原片仓储新增入库请求、出库情况,调整整体逻辑,增加格子号架子号,任务表、详情表、工位表都需要记录架子信息,用于任务执行过程中,架子在执行过程中可返回架子对应的工位上,避免架子乱放后格子架子号不对应的情况发生。
---
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java | 37 +++++++++++++++++++++++++++++--------
1 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
index f7e63e5..220c807 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
@@ -1,5 +1,10 @@
package com.mes.job;
+
import cn.hutool.json.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.mes.common.config.Const;
+import com.mes.damage.entity.Damage;
+import com.mes.damage.service.DamageService;
import com.mes.temperingglass.service.TemperingGlassInfoService;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.tools.WebSocketServer;
@@ -10,6 +15,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.stream.Collectors;
/**
* @author SNG-010
@@ -20,21 +26,27 @@
@Autowired
private TemperingGlassInfoService temperingAgoService;
+ @Autowired
+ private DamageService damageService;
+
/**
* fixedRate : 涓婁竴涓皟鐢ㄥ紑濮嬪悗鍐嶆璋冪敤鐨勫欢鏃讹紙涓嶇敤绛夊緟涓婁竴娆¤皟鐢ㄥ畬鎴愶級
* fixedDelay : 涓婁竴涓皟鐢ㄧ粨鏉熷悗鍐嶆璋冪敤鐨勫欢鏃�
*/
@Scheduled(fixedDelay = 1000)
- public void temperingGlassHome(){
+ public void temperingGlassHome() {
JSONObject jsonObject = new JSONObject();
//姝e湪绛夊緟杩涚墖鐨勭幓鐠�
List<TemperingGlassInfo> waitingGlass = temperingAgoService.selectWaitingGlass();
- jsonObject.append("waitingGlass", waitingGlass);
+ if (waitingGlass != null) {
+ jsonObject.append("waitingGlass", waitingGlass);
+ }
+
//鑾峰彇鏁村湪鐐変腑鐨勪袱涓増鍥緄d
List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId();
//杩涚倝涓殑鐜荤拑
- if(!layoutId.isEmpty()) {
+ if (!layoutId.isEmpty()) {
List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0));
jsonObject.append("intoGlass", intoGlass);
//杩涚倝涓殑绗簩涓増鍥�
@@ -45,11 +57,16 @@
}
//鍑虹倝鍚庣殑鐜荤拑
List<TemperingGlassInfo> outGlass = temperingAgoService.selectOutGlass();
- jsonObject.append("outGlass", outGlass);
+ if (outGlass != null) {
+ jsonObject.append("outGlass", outGlass);
+ }
+
//杩囨棆杞彴閽㈠寲鍚庣殑鐜荤拑
List<TemperingGlassInfo> overGlass = temperingAgoService.selectOverGlass();
+ if (outGlass != null) {
+ jsonObject.append("overGlass", overGlass);
+ }
- jsonObject.append("overGlass", overGlass);
ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass");
if (sendwServer != null) {
@@ -62,13 +79,16 @@
}
}
}
+
@Scheduled(fixedDelay = 1000)
- public void temperingIsRun(){
+ public void temperingIsRun() {
JSONObject jsonObject = new JSONObject();
//姝e湪杩涜鐨勪换鍔�
- List<TemperingGlassInfo>temperingTaskType=temperingAgoService.selectTaskType();
+ List<TemperingGlassInfo> temperingTaskType = temperingAgoService.selectTaskType();
jsonObject.append("temperingTaskType", temperingTaskType);
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun");
+
+
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingIsRun");
if (sendwServer != null) {
for (WebSocketServer webserver : sendwServer) {
if (webserver != null) {
@@ -78,6 +98,7 @@
}
}
}
+
}
--
Gitblit v1.8.0