From e9a656d0f021e7996dd18cf70415e7050f85be23 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 20 五月 2025 14:04:49 +0800
Subject: [PATCH] 删除多余文件
---
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/OpcLoadGlassTask.java | 37 ++++++++++++++++++++++++++-----------
1 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/OpcLoadGlassTask.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/OpcLoadGlassTask.java
index f32b804..da8eb31 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/OpcLoadGlassTask.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/OpcLoadGlassTask.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer;
import com.mes.common.config.Const;
import com.mes.engineering.entity.Engineering;
import com.mes.engineering.mapper.EngineeringMapper;
@@ -14,11 +15,13 @@
import com.mes.pp.service.OptimizeProjectService;
import com.mes.rawglassdetails.entity.RawGlassStorageDetails;
import com.mes.rawglassdetails.service.RawGlassStorageDetailsService;
+import com.mes.s7.entity.S7Data;
import com.mes.uppattenusage.entity.UpPattenUsage;
import com.mes.uppattenusage.entity.vo.UpPattenUsageVO;
import com.mes.uppattenusage.mapper.UpPattenUsageMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@@ -53,6 +56,9 @@
@Resource
private OptimizeProjectService optimizeProjectService;
+ @Autowired(required = false)
+ S7Serializer s7Serializer;
+
private static final List<Integer> LOAD_STATION_01 = Arrays.asList(101, 102);
private static final List<Integer> LOAD_STATION_02 = Arrays.asList(103, 104);
@@ -69,22 +75,22 @@
//2銆�1鍙蜂笂鐗囦綅鏄惁鏈夊師鐗囷紝鍘熺墖灏哄鏄惁鍜屼笂鐗囧緟涓婄墖鐨勫昂瀵镐竴鑷�
//3銆�1鍙锋棤鍘熺墖锛屼笖娌℃湁鏋跺瓙锛�2鍙蜂笂鐗囦綅灏哄鏄惁鍜屽甫涓婄墖灏哄涓�鑷�
//4銆佷笉涓�鑷村彲鑳藉嚭鐜扮幓鐠冪牬鎹熷鑷寸殑涓婁竴鏋跺師鐗囨暟閲忎笉澶�
- @Scheduled(fixedDelay = 300)
+ @Scheduled(fixedDelay = 5000)
public void opcLoadGlassOne() {
opcLoadGlassChild(LOAD_GLASS_DEVICE_ONE_TASK, LOAD_GLASS_ONE_DEVICE);
}
- @Scheduled(fixedDelay = 300)
+ // @Scheduled(fixedDelay = 5000)
public void opcLoadGlassTwo() {
opcLoadGlassChild(LOAD_GLASS_DEVICE_TWO_TASK, LOAD_GLASS_TWO_DEVICE);
}
- @Scheduled(fixedDelay = 300)
+ @Scheduled(fixedDelay = 5000)
public void opcLoadGlassOneFinish() {
opcLoadGlassFinishChid(LOAD_GLASS_DEVICE_ONE_TASK, LOAD_GLASS_ONE_DEVICE);
}
- @Scheduled(fixedDelay = 300)
+ // @Scheduled(fixedDelay = 5000)
public void opcLoadGlassTwoFinish() {
opcLoadGlassFinishChid(LOAD_GLASS_DEVICE_TWO_TASK, LOAD_GLASS_TWO_DEVICE);
}
@@ -92,7 +98,7 @@
/**
* 瀹氭椂浠诲姟鎵爜宸插畬鎴愪笂鐗囩殑宸ョ▼锛屽皢宸ョ▼鐘舵�佹敼涓哄凡瀹屾垚锛屽悓姝p琛ㄧ殑宸ョ▼琛紝鐘舵�佹敼涓�300
*/
- @Scheduled(fixedDelay = 3000)
+ @Scheduled(fixedDelay = 5000)
public void updateEngineerState() {
log.info("淇敼宸插畬鎴愬伐绋嬬姸鎬佷换鍔″紑濮嬫墽琛�");
List<Engineering> engineerings = engineeringMapper.selectList(new LambdaQueryWrapper<Engineering>().eq(Engineering::getState, Const.ENGINEERING_RUNNING));
@@ -109,6 +115,7 @@
}
private void opcLoadGlassChild(String tableName, Integer deviceId) {
+ S7Data S7DataSP1 = s7Serializer.read(S7Data.class);
Engineering engineering = engineeringMapper.selectOne(new LambdaQueryWrapper<Engineering>()
.eq(Engineering::getState, Const.ENGINEERING_RUNNING).eq(Engineering::getStationCell, deviceId));
if (null == engineering) {
@@ -117,11 +124,14 @@
}
//浠诲姟鏆傚仠
LoadGlassDeviceTask task = loadGlassDeviceTaskService.queryTaskMessage(tableName);
- if (0 == task.getInkageState()) {
+ ;
+ if ("0".equals(S7DataSP1.getInkageState().toString())) {
+// if (0 == task.getInkageState()) {
log.info("{}涓婄墖绾匡紝澶勪簬绂荤嚎鐘舵�侊細{}锛岀粨鏉熸湰鍦颁笂鐗囪姹�", deviceId, task.getInkageState());
return;
}
- if (task.getTaskRunning().equals(Const.ENGINEERING_RUNNING)) {
+ if (S7DataSP1.getTaskRunning().toString().equals(Const.ENGINEERING_RUNNING)) {
+// if (task.getTaskRunning().equals(Const.ENGINEERING_RUNNING)) {
log.info("{}涓婄墖绾匡紝鏈夋鍦ㄦ墽琛岀殑浠诲姟锛岀粨鏉熸湰鍦颁笂鐗囪姹�", deviceId);
return;
}
@@ -181,19 +191,24 @@
}
private void opcLoadGlassFinishChid(String tableName, Integer deviceId) {
+ S7Data S7DataSP1 = s7Serializer.read(S7Data.class);
LoadGlassDeviceTask task = loadGlassDeviceTaskService.queryTaskMessage(tableName);
- if (task.getTaskRunning().equals(Const.ENGINEERING_NEW)) {
+ if (S7DataSP1.getTaskRunning().toString().equals(Const.ENGINEERING_NEW)) {
+// if (task.getTaskRunning().equals(Const.ENGINEERING_NEW)) {
log.info("鏃犱换鍔�,缁撴潫");
return;
}
- if (task.getTaskState() <= 1) {
+ if (Integer.parseInt(S7DataSP1.getTaskState().toString()) <= 1) {
+// if (task.getTaskState() <= 1) {
log.info("浠诲姟姝e湪鎵ц,缁撴潫");
return;
}
//鑾峰彇浠诲姟瀹屾垚鎯呭喌
// 宸插畬鎴愭暟閲� 鐮存崯鏁伴噺
- Integer finishCount = task.getFinishCount();
- Integer damageCount = task.getDamageCount();
+ Integer finishCount = Integer.parseInt(S7DataSP1.getFinishCount().toString());
+ Integer damageCount = Integer.parseInt(S7DataSP1.getDamageCount().toString());
+// Integer finishCount = task.getFinishCount();
+// Integer damageCount = task.getDamageCount();
//鏇存柊褰撳墠鏋跺瓙涓婄殑鍘熺墖鍓╀綑鎯呭喌
rawGlassStorageDetailsService.update(new UpdateWrapper<RawGlassStorageDetails>()
--
Gitblit v1.8.0