From cf33278c73767f72e35a4898c23765f52a3bfd1d Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期二, 03 十二月 2024 09:06:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/ywMes'
---
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-yw.yml | 30
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java | 5
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/UpdateHollowBigStorageCageDTO.java | 16
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageDeviceTaskMapper.xml | 3
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/changelog/ywChangelog.sql | 47
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageGlassRelationInfoServiceImpl.java | 25
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageGlassInfoController.java | 18
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/impl/BigStorageBaseServiceImpl.java | 9
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java | 28
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageServiceImpl.java | 7
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardVirtualSlotDTO.java | 25
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application.yml | 45
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageGlassInfoServiceImpl.java | 200 +
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java | 20
hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/mapper/BigStorageCageTaskMapper.java | 2
hangzhoumesParent/moduleService/GlassStorageModule/src/main/resources/application-yw.yml | 28
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-yw.yml | 33
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java | 16
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java | 46
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageGlassInfoService.java | 35
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-prod.yml | 30
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml | 223 ++
hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java | 28
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/BigStorageSequenceDTO.java | 17
hangzhoumesParent/moduleService/pom.xml | 1
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassRelationInfoService.java | 36
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/BigStorageBaseService.java | 2
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageServiceImpl.java | 19
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java | 67
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationInfo.java | 57
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassOutRelationInfoMapper.java | 15
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageFeedTaskService.java | 3
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java | 2
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-dev.yml | 30
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/opctask/entity/EdgStorageDeviceTaskHistory.java | 5
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageDetailsController.java | 18
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-yw.yml | 30
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java | 18
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/HollowGlassDetailsDTO.java | 50
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/controller/HollowBigStorageCageHistoryTaskController.java | 18
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/mapper/HollowBigStorageCageHistoryTaskMapper.java | 15
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java | 16
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java | 52
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java | 6
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java | 24
hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/BigStorageCageBaseInfo.java | 29
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml | 32
hangzhoumesParent/mesHub/src/main/java/com/mes/MesHubApplication.java | 25
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java | 28
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageDTO.java | 6
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageSequenceDTO.java | 17
hangzhoumesParent/moduleService/CacheVerticalGlassModule/pom.xml | 24
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageGlassRelationInfoMapper.xml | 20
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/HollowBigStorageDTO.java | 31
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/GlassInfoService.java | 4
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/logback-spring.xml | 170 +
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java | 17
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java | 34
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java | 6
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-cz.yml | 30
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageMapper.java | 15
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java | 10
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java | 205 ++
hangzhoumesParent/mesHub/src/main/resources/application-dev.yml | 22
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java | 31
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardGlassInfoDTO.java | 49
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageService.java | 15
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageTask.java | 155 +
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java | 768 +++++++
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassTask.java | 238 +
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java | 81
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java | 19
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/HollowGlassApplication.java | 27
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-yw.yml | 32
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/dto/HollowGlassInfoDTO.java | 17
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageGlassInfoMapper.java | 15
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java | 7
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageRelationDTO.java | 24
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java | 5
hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/entity/BigStorageCageTask.java | 2
hangzhoumesParent/common/servicebase/src/main/resources/mapper/GlassInfoMapper.xml | 31
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/controller/HollowGlassQueueInfoController.java | 40
hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/HollowBigStorageCageBaseInfo.java | 64
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCage.java | 47
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/mapper/HollowGlassQueueInfoMapper.java | 15
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassRelationInfo.java | 91
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/service/HollowBigStorageCageHistoryTaskService.java | 15
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java | 745 +++++++
hangzhoumesParent/common/servicebase/src/main/resources/mapper/BigStorageCageTaskMapper.xml | 8
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java | 6
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/LackDetailsDTO.java | 53
hangzhoumesParent/mesHub/pom.xml | 47
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-yw.yml | 32
hangzhoumesParent/moduleService/howllowGlassModule/pom.xml | 19
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageGlassRelationInfoController.java | 18
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/opccallback/BigStorageStartCallback.java | 23
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml | 2
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java | 31
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml | 127 +
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCageDetails.java | 81
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageGlassRelationInfoMapper.java | 19
hangzhoumesParent/mesHub/src/main/resources/application.yml | 30
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java | 13
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java | 258 ++
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageGlassRelationInfoService.java | 18
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java | 27
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml | 110
hangzhoumesParent/pom.xml | 1
hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/service/BigStorageCageTaskService.java | 26
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java | 47
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageGlassRelationInfo.java | 50
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-yw.yml | 25
hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/service/impl/BigStorageCageTaskServiceImpl.java | 5
/dev/null | 25
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java | 85
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageGlassInfo.java | 74
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassRelationInfoController.java | 45
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/entity/HollowBigStorageCageHistoryTask.java | 55
120 files changed, 5,693 insertions(+), 349 deletions(-)
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/BigStorageCageBaseInfo.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/BigStorageCageBaseInfo.java
index b5c0c8e..6cb86a8 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/BigStorageCageBaseInfo.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/BigStorageCageBaseInfo.java
@@ -12,10 +12,26 @@
public class BigStorageCageBaseInfo {
/**
+ * 宸ョ▼鍙�
+ */
+ @ApiModelProperty(value = "宸ョ▼鍙�", position = 16)
+ private String engineerId;
+ /**
* 鐜荤拑id
*/
@ApiModelProperty(value = "鐜荤拑id")
private String glassId;
+ /**
+ * 閽㈠寲鐗堝浘id
+ */
+ @ApiModelProperty(value = "閽㈠寲鐗堝浘id", position = 12)
+ private Integer temperingLayoutId;
+
+ /**
+ * 閽㈠寲鐗堝浘鐗囧簭
+ */
+ @ApiModelProperty(value = "閽㈠寲鐗堝浘鐗囧簭", position = 13)
+ private Integer temperingFeedSequence;
/**
* 瀹�
@@ -33,17 +49,4 @@
*/
@ApiModelProperty(value = "鐜荤拑id")
private Integer slot;
-
- /**
- * x鍧愭爣
- */
- @ApiModelProperty(value = "x鍧愭爣", position = 13)
- private Integer xCoordinate;
-
- /**
- * y鍧愭爣
- */
- @ApiModelProperty(value = "y鍧愭爣", position = 14)
- private Integer yCoordinate;
-
}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/HollowBigStorageCageBaseInfo.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/HollowBigStorageCageBaseInfo.java
new file mode 100644
index 0000000..261ec06
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/HollowBigStorageCageBaseInfo.java
@@ -0,0 +1,64 @@
+package com.mes.base.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/6/21 9:40
+ * @Description:
+ */
+@Data
+public class HollowBigStorageCageBaseInfo {
+
+ /**
+ * 宸ョ▼鍙�
+ */
+ @ApiModelProperty(value = "宸ョ▼鍙�", position = 16)
+ private String engineerId;
+ /**
+ * 鐜荤拑id
+ */
+ @ApiModelProperty(value = "鐜荤拑id")
+ private String glassId;
+ /**
+ * 閽㈠寲鐗堝浘id
+ */
+ @ApiModelProperty(value = "閽㈠寲鐗堝浘id", position = 12)
+ private Integer temperingLayoutId;
+
+ /**
+ * 閽㈠寲鐗堝浘鐗囧簭
+ */
+ @ApiModelProperty(value = "閽㈠寲鐗堝浘鐗囧簭", position = 13)
+ private Integer temperingFeedSequence;
+
+ /**
+ * 瀹�
+ */
+ @ApiModelProperty(value = "瀹�")
+ private double width;
+ /**
+ * 瀹�
+ */
+ @ApiModelProperty(value = "楂�")
+ private double height;
+
+ /**
+ * 鏍煎瓙鍙�
+ */
+ @ApiModelProperty(value = "鐜荤拑id")
+ private Integer slot;
+
+ /**
+ * /*灞傚彿
+ */
+ private Integer layer;
+
+ /**
+ * 鏍煎瓙鍙�
+ */
+ @ApiModelProperty(value = "鐜荤拑id")
+
+ private Integer isPair;
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/entity/BigStorageCageTask.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/entity/BigStorageCageTask.java
similarity index 90%
rename from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/entity/BigStorageCageTask.java
rename to hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/entity/BigStorageCageTask.java
index 9af4e18..467e1f9 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/entity/BigStorageCageTask.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/entity/BigStorageCageTask.java
@@ -2,6 +2,7 @@
import lombok.AllArgsConstructor;
import lombok.Data;
+import lombok.NoArgsConstructor;
/**
* (BigStorageCageInOneTask)琛ㄥ疄浣撶被
@@ -11,6 +12,7 @@
*/
@Data
@AllArgsConstructor
+@NoArgsConstructor
public class BigStorageCageTask {
/**
* 鐜荤拑id
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/mapper/BigStorageCageTaskMapper.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/mapper/BigStorageCageTaskMapper.java
similarity index 90%
rename from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/mapper/BigStorageCageTaskMapper.java
rename to hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/mapper/BigStorageCageTaskMapper.java
index 6681b66..5793a69 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/mapper/BigStorageCageTaskMapper.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/mapper/BigStorageCageTaskMapper.java
@@ -17,6 +17,8 @@
boolean updateTaskMessage(@Param("tableName") String tableName, @Param("task") BigStorageCageTask bigStorageCageInTask);
+ boolean updateOutTaskMessage(@Param("tableName") String tableName);
+
int saveTaskMessage(@Param("tableName") String tableName, @Param("list") List<BigStorageCageTask> taskList);
int removeAll(String tableName);
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/service/BigStorageCageTaskService.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/service/BigStorageCageTaskService.java
new file mode 100644
index 0000000..a9efe94
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/service/BigStorageCageTaskService.java
@@ -0,0 +1,26 @@
+package com.mes.bigstoragecagetask.service;
+
+import com.mes.bigstoragecagetask.entity.BigStorageCageTask;
+
+import java.util.List;
+
+/**
+ * (BigStorageCageInOneTask)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author makejava
+ * @since 2024-11-08 21:40:20
+ */
+public interface BigStorageCageTaskService {
+
+
+ List<BigStorageCageTask> queryTaskMessage(String tableName);
+
+ boolean updateTaskMessage(String tableName, BigStorageCageTask bigStorageCageInTask);
+
+ boolean updateOutTaskMessage(String tableName);
+
+ int saveTaskMessage(String tableName, List<BigStorageCageTask> taskList);
+
+ int removeAll(String tableName);
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/service/impl/BigStorageCageTaskServiceImpl.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/service/impl/BigStorageCageTaskServiceImpl.java
similarity index 89%
rename from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/service/impl/BigStorageCageTaskServiceImpl.java
rename to hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/service/impl/BigStorageCageTaskServiceImpl.java
index af12d05..e5d984c 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/service/impl/BigStorageCageTaskServiceImpl.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/bigstoragecagetask/service/impl/BigStorageCageTaskServiceImpl.java
@@ -31,6 +31,11 @@
}
@Override
+ public boolean updateOutTaskMessage(String tableName) {
+ return bigStorageCageInTaskMapper.updateOutTaskMessage(tableName);
+ }
+
+ @Override
public int saveTaskMessage(String tableName, List<BigStorageCageTask> taskList) {
return bigStorageCageInTaskMapper.saveTaskMessage(tableName, taskList);
}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
index a05dfe6..7efbd7d 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
@@ -183,8 +183,9 @@
public static final Integer TEMPERING_START = 2;
public static final Integer TEMPERING_SUCCESS = 3;
public static final Integer TEMPERING_END = 4;
-// public static final Integer TEMPERING_DAMAGE = 8;
-// public static final Integer TEMPERING_TAKE = 9;
+ public static final Integer TEMPERING_PAUSE = 5;
+ public static final Integer TEMPERING_DAMAGE = 8;
+ public static final Integer TEMPERING_TAKE = 9;
/**
* 涓嬬墖
@@ -276,4 +277,16 @@
public static final Integer BIG_STORAGE_TASK_EMPTY = 0;
public static final Integer BIG_STORAGE_TASK_RUNNING = 1;
+ /**
+ * 涓┖澶х悊鐗囩鍑虹墖鐘舵�両
+ * 0 绌轰换鍔�
+ * 1 鍚姩
+ * 2 鏆傚仠
+ * 3 瀹屾垚
+ */
+ public static final Integer HOLLOW_FLOW_CARD_NEW = 0;
+ public static final Integer HOLLOW_FLOW_CARD_START = 1;
+ public static final Integer HOLLOW_FLOW_CARD_PAUSE = 2;
+ public static final Integer HOLLOW_FLOW_CARD_SUCCESS = 3;
+
}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/dto/HollowGlassInfoDTO.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/dto/HollowGlassInfoDTO.java
new file mode 100644
index 0000000..1919a49
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/dto/HollowGlassInfoDTO.java
@@ -0,0 +1,17 @@
+package com.mes.glassinfo.entity.dto;
+
+import com.mes.glassinfo.entity.GlassInfo;
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/28 10:02
+ * @Description:
+ */
+@Data
+public class HollowGlassInfoDTO extends GlassInfo {
+ /**
+ * 涓┖绾挎��
+ */
+ private int hollowSequence;
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java
index e8b3016..bfbd706 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java
@@ -3,6 +3,10 @@
import com.baomidou.dynamic.datasource.annotation.DS;
import com.github.yulichang.base.MPJBaseMapper;
import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.entity.dto.HollowGlassInfoDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
/**
* <p>
@@ -15,4 +19,5 @@
@DS("hangzhoumes")
public interface GlassInfoMapper extends MPJBaseMapper<GlassInfo> {
+ List<HollowGlassInfoDTO> listBySize(@Param("engineerId") String engineerId);
}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/xml/GlassInfoMapper.xml b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/xml/GlassInfoMapper.xml
deleted file mode 100644
index 3c9381f..0000000
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/xml/GlassInfoMapper.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.mes.glassinfo.mapper.GlassInfoMapper">
-
-</mapper>
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/GlassInfoService.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/GlassInfoService.java
index b2a6af1..4ba8260 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/GlassInfoService.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/GlassInfoService.java
@@ -2,6 +2,7 @@
import com.github.yulichang.base.MPJBaseService;
import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.entity.dto.HollowGlassInfoDTO;
import java.util.List;
import java.util.Map;
@@ -33,7 +34,6 @@
List<Map<String, Object>> getFlowCardId();
-
-
+ List<HollowGlassInfoDTO> listBySize(String engineerId);
}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
index 7269cac..60755bc 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
@@ -6,6 +6,7 @@
import com.github.yulichang.query.MPJQueryWrapper;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.entity.OptimizeGlassinfo;
+import com.mes.glassinfo.entity.dto.HollowGlassInfoDTO;
import com.mes.glassinfo.mapper.GlassInfoMapper;
import com.mes.glassinfo.service.GlassInfoService;
import com.mes.pp.entity.OptimizeProject;
@@ -136,5 +137,10 @@
return result;
}
+ @Override
+ public List<HollowGlassInfoDTO> listBySize(String engineerId) {
+ return baseMapper.listBySize(engineerId);
+ }
+
}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/entity/TemperingGlass.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/entity/TemperingGlass.java
deleted file mode 100644
index f5f52fa..0000000
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/entity/TemperingGlass.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.mes.temperingglass.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.mes.base.entity.BigStorageCageBaseInfo;
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * (TemperingGlassInfo)琛ㄥ疄浣撶被
- *
- * @author makejava
- * @since 2024-11-18 08:36:18
- */
-@Data
-@TableName("tempering_glass_info")
-public class TemperingGlass extends BigStorageCageBaseInfo implements Serializable {
- /**
- * 閽㈠寲灏忕墖淇℃伅琛╥d
- */
- @TableId(value = "id", type = IdType.AUTO)
- private Long id;
- /**
- * 娴佺▼鍗�
- */
- private String flowCardId;
- /**
- * 娴佺▼鍗$幓鐠冪被鍨�
- */
- private Integer glassType;
- /**
- * 鍘氬害
- */
- private Double thickness;
- /**
- * 鑶滅郴
- */
- private String filmsid;
- /**
- * 鎬诲眰鏁�
- */
- private Integer totalLayer;
- /**
- * 灞傛暟
- */
- private Integer layer;
- /**
- * 閽㈠寲鏄惁鎺ュ彈妯斁
- */
- private Integer ishorizontal;
- /**
- * 閽㈠寲鐗堝浘id
- */
- private Integer temperingLayoutId;
- /**
- * 閽㈠寲鐗堝浘鐗囧簭
- */
- private Integer temperingFeedSequence;
- /**
- * 鏃嬭浆瑙掑害锛堥�嗘椂閽堬級
- */
- private Integer angle;
- /**
- * 宸ョ▼鍙�
- */
- private String engineerId;
- /**
- * 鐘舵��
- */
- private Integer state;
- /**
- * 閽㈠寲绫诲瀷
- */
- private Integer temperingType;
-
- private String deleted;
-
-
-}
-
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java
index aecb3b9..a61d9a6 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java
@@ -64,22 +64,21 @@
private Integer ishorizontal;
/**
- * 閽㈠寲鐗堝浘id
- */
- @ApiModelProperty(value = "閽㈠寲鐗堝浘id", position = 11)
- private Integer temperingLayoutId;
-
- /**
- * 閽㈠寲鐗堝浘鐗囧簭
- */
- @ApiModelProperty(value = "閽㈠寲鐗堝浘鐗囧簭", position = 12)
- private Integer temperingFeedSequence;
-
- /**
* 鏃嬭浆瑙掑害锛堥�嗘椂閽堬級
*/
@ApiModelProperty(value = "鏃嬭浆瑙掑害锛堥�嗘椂閽堬級", position = 15)
private Integer angle;
+ /**
+ * x鍧愭爣
+ */
+ @ApiModelProperty(value = "x鍧愭爣", position = 13)
+ private Integer xCoordinate;
+
+ /**
+ * y鍧愭爣
+ */
+ @ApiModelProperty(value = "y鍧愭爣", position = 14)
+ private Integer yCoordinate;
/**
* 鐘舵��
@@ -87,11 +86,6 @@
@ApiModelProperty(value = "鐘舵��", position = 16)
private Integer state;
- /**
- * 宸ョ▼id
- */
- @ApiModelProperty(value = "宸ョ▼id", position = 17)
- private String engineerId;
@TableLogic
private int deleted;
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/mapper/TemperingGlassMapper.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/mapper/TemperingGlassMapper.java
deleted file mode 100644
index 45d4f01..0000000
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/mapper/TemperingGlassMapper.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.mes.temperingglass.mapper;
-
-import com.github.yulichang.base.MPJBaseMapper;
-import com.mes.temperingglass.entity.TemperingGlass;
-
-/**
- * (TemperingGlassInfo)琛ㄦ暟鎹簱璁块棶灞�
- *
- * @author makejava
- * @since 2024-11-18 08:36:17
- */
-public interface TemperingGlassMapper extends MPJBaseMapper<TemperingGlass> {
-
-}
-
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/TemperingGlassService.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/TemperingGlassService.java
deleted file mode 100644
index c66138b..0000000
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/TemperingGlassService.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.mes.temperingglass.service;
-
-import com.github.yulichang.base.MPJBaseService;
-import com.mes.temperingglass.entity.TemperingGlass;
-
-/**
- * (TemperingGlassInfo)琛ㄦ湇鍔℃帴鍙�
- *
- * @author makejava
- * @since 2024-11-18 08:36:18
- */
-public interface TemperingGlassService extends MPJBaseService<TemperingGlass> {
-
-}
-
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassServiceImpl.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassServiceImpl.java
deleted file mode 100644
index 2a9d8f3..0000000
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassServiceImpl.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.mes.temperingglass.service.impl;
-
-import com.github.yulichang.base.MPJBaseServiceImpl;
-import com.mes.temperingglass.entity.TemperingGlass;
-import com.mes.temperingglass.mapper.TemperingGlassMapper;
-import com.mes.temperingglass.service.TemperingGlassService;
-import org.springframework.stereotype.Service;
-
-/**
- * (TemperingGlass)琛ㄦ湇鍔″疄鐜扮被
- *
- * @author makejava
- * @since 2024-11-18 08:36:18
- */
-@Service
-public class TemperingGlassServiceImpl extends MPJBaseServiceImpl<TemperingGlassMapper, TemperingGlass> implements TemperingGlassService {
-
-}
-
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageInTaskMapper.xml b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/BigStorageCageTaskMapper.xml
similarity index 86%
rename from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageInTaskMapper.xml
rename to hangzhoumesParent/common/servicebase/src/main/resources/mapper/BigStorageCageTaskMapper.xml
index 84a0817..ca5269d 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageInTaskMapper.xml
+++ b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/BigStorageCageTaskMapper.xml
@@ -34,5 +34,13 @@
where glass_id = #{task.glassId}
</update>
+ <update id="updateOutTaskMessage">
+ UPDATE ${tableName}
+ SET glass_id = ''
+ , start_slot = 0
+ , target_slot = 0
+ , task_state = 0
+ </update>
+
</mapper>
\ No newline at end of file
diff --git a/hangzhoumesParent/common/servicebase/src/main/resources/mapper/GlassInfoMapper.xml b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/GlassInfoMapper.xml
new file mode 100644
index 0000000..5d27b6a
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/GlassInfoMapper.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.mes.glassinfo.mapper.GlassInfoMapper">
+
+ <select id="listBySize" resultType="com.mes.glassinfo.entity.dto.HollowGlassInfoDTO">
+ with glass_list as (
+ SELECT flow_card_id,
+ glass_type,
+ GREATEST(width, height) as width,
+ least(width, height) as height,
+ thickness,
+ filmsid,
+ total_layer,
+ layer,
+ ismultiple,
+ max_width,
+ max_height,
+ tempering_layout_id,
+ tempering_feed_sequence,
+ engineer_id,
+ glass_id
+ FROM glass_info
+ where engineer_id = #{engineerId}
+ )
+ select row_number()
+ over (order by flow_card_id, height desc, width desc, tempering_layout_id, tempering_feed_sequence) as rn,
+ t.*
+ from glass_list t
+
+ </select>
+</mapper>
diff --git a/hangzhoumesParent/mesHub/pom.xml b/hangzhoumesParent/mesHub/pom.xml
new file mode 100644
index 0000000..6e16f26
--- /dev/null
+++ b/hangzhoumesParent/mesHub/pom.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>hangzhoumesParent</artifactId>
+ <groupId>com.mes</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>mesHub</artifactId>
+
+ <properties>
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+ </properties>
+ <dependencies>
+ <!--web 闇�瑕佸惎鍔ㄩ」鐩�-->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+
+
+ <dependency>
+ <artifactId>servicebase</artifactId>
+ <groupId>com.mes</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/hangzhoumesParent/mesHub/src/main/java/com/mes/MesHubApplication.java b/hangzhoumesParent/mesHub/src/main/java/com/mes/MesHubApplication.java
new file mode 100644
index 0000000..5463108
--- /dev/null
+++ b/hangzhoumesParent/mesHub/src/main/java/com/mes/MesHubApplication.java
@@ -0,0 +1,25 @@
+package com.mes;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/28 15:52
+ * @Description:
+ */
+@SpringBootApplication
+@EnableSwagger2WebMvc
+@EnableDiscoveryClient
+@MapperScan(basePackages = "com.mes.*.mapper")
+@EnableScheduling
+public class MesHubApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(MesHubApplication.class, args);
+ }
+
+}
diff --git a/hangzhoumesParent/mesHub/src/main/resources/application-dev.yml b/hangzhoumesParent/mesHub/src/main/resources/application-dev.yml
new file mode 100644
index 0000000..bccda49
--- /dev/null
+++ b/hangzhoumesParent/mesHub/src/main/resources/application-dev.yml
@@ -0,0 +1,22 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 127.0.0.1:8848
+ application:
+ name: cacheGlass
+ redis:
+ database: 0
+ host: 127.0.0.1
+ port: 6379
+ password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/mesHub/src/main/resources/application.yml b/hangzhoumesParent/mesHub/src/main/resources/application.yml
new file mode 100644
index 0000000..18512da
--- /dev/null
+++ b/hangzhoumesParent/mesHub/src/main/resources/application.yml
@@ -0,0 +1,30 @@
+server:
+ port: 8180
+
+spring:
+ application:
+ name: mesHub
+ liquibase:
+ enabled: false
+ task:
+ scheduling:
+ pool:
+ size: 10
+ thread-name-prefix: mesHub
+ profiles:
+ active: dev
+mybatis-plus:
+ mapper-locations: classpath*:mapper/*.xml
+ configuration:
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+kangaroohy:
+ milo:
+ enabled: false
+ primary: default
+ config:
+ default:
+ endpoint: opc.tcp://192.168.2.100:49320
+ security-policy: basic256sha256
+ username: admin
+ password: 1qaz2wsx3edc4rfv
+
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java
index 387c397..635f475 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java
@@ -1,6 +1,9 @@
package com.mes.edgglasstask.entity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -21,21 +24,58 @@
private static final long serialVersionUID = 1L;
+ /**
+ * 纾ㄨ竟浠诲姟id
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+ /**
+ * 鐜荤拑id
+ */
+ @ApiModelProperty(value = "鐜荤拑id", position = 2)
private String glassId;
+ /**
+ * 瀹�
+ */
+ @ApiModelProperty(value = "瀹�", position = 3)
private Integer width;
+ /**
+ * 楂�
+ */
+ @ApiModelProperty(value = "楂�", position = 4)
private Integer height;
+ /**
+ * 鍘氬害
+ */
+ @ApiModelProperty(value = "鍘氬害", position = 5)
private Integer thickness;
- private Integer glassType;
- private Integer status;
+ /**
+ * 鐘舵��
+ */
+ @ApiModelProperty(value = "鐘舵��", position = 6)
+ private Integer state;
+ /**
+ * 绾胯矾
+ */
+ @ApiModelProperty(value = "绾胯矾", position = 7)
private Integer line;
- private Date time;
+ /**
+ * 绾胯矾
+ */
+ @ApiModelProperty(value = "寮�濮嬫椂闂�", position = 8)
+ private Date createTime;
+ /**
+ * 绾胯矾
+ */
+ @ApiModelProperty(value = "鏇存柊鏃堕棿", position = 9)
+ private Date updateTime;
@TableLogic
private int deleted;
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java
index 88390a6..60e6139 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java
@@ -42,9 +42,9 @@
}
LambdaQueryWrapper<EdgGlassTaskInfo> edgGlassWrapper = new LambdaQueryWrapper<EdgGlassTaskInfo>()
.in(CollectionUtils.isNotEmpty(request.getCellList()), EdgGlassTaskInfo::getLine, request.getCellList())
- .in(CollectionUtils.isNotEmpty(request.getStateList()), EdgGlassTaskInfo::getStatus, request.getStateList())
- .between(null != request.getBeginDate(), EdgGlassTaskInfo::getTime, request.getBeginDate(), request.getEndDate())
- .orderByDesc(EdgGlassTaskInfo::getTime);
+ .in(CollectionUtils.isNotEmpty(request.getStateList()), EdgGlassTaskInfo::getState, request.getStateList())
+ .between(null != request.getBeginDate(), EdgGlassTaskInfo::getCreateTime, request.getBeginDate(), request.getEndDate())
+ .orderByDesc(EdgGlassTaskInfo::getCreateTime);
return this.list(edgGlassWrapper);
}
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/entity/EdgGlassTaskQueueInfo.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/entity/EdgGlassTaskQueueInfo.java
deleted file mode 100644
index dbd957c..0000000
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/entity/EdgGlassTaskQueueInfo.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.mes.edgglasstaskqueueinfo.entity;
-
-import lombok.Data;
-
-import java.util.Date;
-
-/**
- * (EdgGlassTaskQueueInfo)琛ㄥ疄浣撶被
- *
- * @author makejava
- * @since 2024-11-03 15:42:12
- */
-@SuppressWarnings("serial")
-@Data
-public class EdgGlassTaskQueueInfo {
- /**
- * 纾ㄨ竟鍓嶇幓鐠僫d
- */
- private String glassId;
- /**
- * 瀹�
- */
- private Integer width;
- /**
- * 楂�
- */
- private Integer height;
- /**
- * 鍘�
- */
- private Integer thickness;
- /**
- * 鐘舵��
- */
- private Integer state;
- /**
- * 绾胯矾
- */
- private Integer line;
- /**
- * 鍒涘缓鏃堕棿
- */
- private Date createTime;
- /**
- * 鏇存柊鏃堕棿
- */
- private Date updateTime;
-
-
-}
-
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/mapper/EdgGlassTaskQueueInfoDao.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/mapper/EdgGlassTaskQueueInfoDao.java
deleted file mode 100644
index 19b9833..0000000
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/mapper/EdgGlassTaskQueueInfoDao.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.mes.edgglasstaskqueueinfo.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.mes.edgglasstaskqueueinfo.entity.EdgGlassTaskQueueInfo;
-
-/**
- * (EdgGlassTaskQueueInfo)琛ㄦ暟鎹簱璁块棶灞�
- *
- * @author makejava
- * @since 2024-11-03 15:42:11
- */
-public interface EdgGlassTaskQueueInfoDao extends BaseMapper<EdgGlassTaskQueueInfo> {
-
-}
-
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/service/EdgGlassTaskQueueInfoService.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/service/EdgGlassTaskQueueInfoService.java
deleted file mode 100644
index 6fa89e7..0000000
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/service/EdgGlassTaskQueueInfoService.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.mes.edgglasstaskqueueinfo.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.mes.edgglasstaskqueueinfo.entity.EdgGlassTaskQueueInfo;
-
-/**
- * (EdgGlassTaskQueueInfo)琛ㄦ湇鍔℃帴鍙�
- *
- * @author makejava
- * @since 2024-11-03 15:42:16
- */
-public interface EdgGlassTaskQueueInfoService extends IService<EdgGlassTaskQueueInfo> {
-
-}
-
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/service/impl/EdgGlassTaskQueueInfoServiceImpl.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/service/impl/EdgGlassTaskQueueInfoServiceImpl.java
deleted file mode 100644
index 91e1941..0000000
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstaskqueueinfo/service/impl/EdgGlassTaskQueueInfoServiceImpl.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.mes.edgglasstaskqueueinfo.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.mes.edgglasstaskqueueinfo.entity.EdgGlassTaskQueueInfo;
-import com.mes.edgglasstaskqueueinfo.mapper.EdgGlassTaskQueueInfoDao;
-import com.mes.edgglasstaskqueueinfo.service.EdgGlassTaskQueueInfoService;
-import org.springframework.stereotype.Service;
-
-/**
- * (EdgGlassTaskQueueInfo)琛ㄦ湇鍔″疄鐜扮被
- *
- * @author makejava
- * @since 2024-11-03 15:42:19
- */
-@Service
-public class EdgGlassTaskQueueInfoServiceImpl extends ServiceImpl<EdgGlassTaskQueueInfoDao, EdgGlassTaskQueueInfo> implements EdgGlassTaskQueueInfoService {
-
-}
-
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java
index a401280..e01c67f 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java
@@ -494,7 +494,7 @@
damageService.insertDamage(damage);
//淇敼纾ㄨ竟闃熷垪鏁版嵁鐘舵��
edgGlassTaskInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskInfo>()
- .set(EdgGlassTaskInfo::getStatus, request.getState()).eq(EdgGlassTaskInfo::getGlassId, request.getGlassId()));
+ .set(EdgGlassTaskInfo::getState, request.getState()).eq(EdgGlassTaskInfo::getGlassId, request.getGlassId()));
return "success";
}
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
index 8e0191c..2e352b0 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
@@ -30,7 +30,6 @@
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
@@ -100,7 +99,7 @@
public static String engineerId = "";
- @Scheduled(fixedDelay = 1000)
+ // @Scheduled(fixedDelay = 1000)
public void plcHomeEdgTask() {
Date startDate = new Date();
log.info("鏈浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
@@ -161,7 +160,7 @@
}
- @Scheduled(fixedDelay = 1000)
+ // @Scheduled(fixedDelay = 1000)
public void dealDamageTask() {
Date startDate = new Date();
log.info("鍗у紡鐞嗙墖鐮存崯鐜荤拑娓呴櫎浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
@@ -842,9 +841,10 @@
edgGlassTaskInfo.setHeight((int) (glassInfo.getHeight() * ratio));
edgGlassTaskInfo.setWidth((int) (glassInfo.getWidth() * ratio));
edgGlassTaskInfo.setThickness((int) (glassInfo.getThickness() * ratio));
- edgGlassTaskInfo.setStatus(Const.EDG_GLASS_BEFORE);
+ edgGlassTaskInfo.setState(Const.EDG_GLASS_BEFORE);
edgGlassTaskInfo.setLine(endcell);
- edgGlassTaskInfo.setTime(new Date());
+ edgGlassTaskInfo.setCreateTime(new Date());
+ edgGlassTaskInfo.setUpdateTime(new Date());
//鍏堝皢鍘嗗彶瀵瑰垪琛ㄤ腑鏈幓鐠冪殑鏁版嵁鍒犻櫎锛岄噸鏂版柊澧炰竴浠芥渶鏂扮殑鏁版嵁
edgGlassTaskInfoService.remove(new LambdaQueryWrapper<EdgGlassTaskInfo>().eq(EdgGlassTaskInfo::getGlassId, glassInfo.getGlassId()));
return edgGlassTaskInfoService.save(edgGlassTaskInfo);
@@ -872,7 +872,7 @@
}
}
- @Scheduled(fixedDelay = 1000)
+ // @Scheduled(fixedDelay = 1000)
public void CacheGlassTasks() {
JSONObject jsonObject = new JSONObject();
List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory();
@@ -899,7 +899,7 @@
}
}
- @Scheduled(fixedDelay = 1000)
+ // @Scheduled(fixedDelay = 1000)
public void cacheGlassIsRun() {
JSONObject jsonObject = new JSONObject();
//姝e湪杩涜鐨勪换鍔�
@@ -917,7 +917,7 @@
}
}
- @Scheduled(fixedDelay = 1000)
+ // @Scheduled(fixedDelay = 1000)
public void CacheGlassTaskss() {
JSONObject jsonObject = new JSONObject();
//log.info("鏈璇嗗埆鐗堝浘{},++++{}",engineerId,currentCutTerritorys);
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassTask.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassTask.java
index 68cc6a7..5745741 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassTask.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassTask.java
@@ -5,11 +5,12 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.kangaroohy.milo.model.ReadWriteEntity;
import com.kangaroohy.milo.service.MiloService;
import com.mes.common.config.Const;
-import com.mes.edgglasstaskqueueinfo.entity.EdgGlassTaskQueueInfo;
-import com.mes.edgglasstaskqueueinfo.service.EdgGlassTaskQueueInfoService;
+import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
+import com.mes.edgglasstask.service.EdgGlassTaskInfoService;
import com.mes.edgstoragecage.entity.EdgStorageCage;
import com.mes.edgstoragecage.entity.EdgStorageCageDetails;
import com.mes.edgstoragecage.service.EdgStorageCageDetailsService;
@@ -58,8 +59,11 @@
@Resource
EdgStorageDeviceTaskService edgStorageDeviceTaskService;
- @Resource
- EdgGlassTaskQueueInfoService edgGlassTaskQueueInfoService;
+ // @Resource
+// EdgGlassTaskQueueInfoService edgGlassTaskQueueInfoService;
+ @Autowired
+ EdgGlassTaskInfoService edgGlassTaskInfoService;
+
@Resource
GlassInfoService glassInfoService;
@Resource
@@ -75,11 +79,27 @@
private int threshold;
@Value("${mes.cellLength}")
private int cellLength;
+ @Value("${mes.ratio}")
+ private int ratio;
+ @Value("${mes.min.one.firstLength}")
+ private int minOneFirstLength;
+
+ @Value("${mes.min.one.secondLength}")
+ private int minOneSecondLength;
+
+ @Value("${mes.min.two.firstLength}")
+ private int minTwoFirstLength;
+
+ @Value("${mes.min.two.secondLength}")
+ private int minTwoSecondLength;
+
+ private String glassInIdOne = "";
+ private String glassInIdTwo = "";
private String glassIdOne = "";
private String glassIdTwo = "";
-// @Scheduled(fixedDelay = Long.MAX_VALUE)
+ // @Scheduled(fixedDelay = Long.MAX_VALUE)
// public void startOneOpcTask() throws Exception {
// miloService.subscriptionFromOpcUa(Arrays.asList("mes.WL1.edg_storage_device_one_task[1].task_state"), cacheGlassStartCallback);
// }
@@ -101,7 +121,7 @@
private void startOneOpcTaskChild(String tableName, int device) {
EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(tableName);
- try {
+// try {
if (task == null) {
log.info("浠诲姟琛ㄥ熀纭�鏁版嵁褰曞叆澶辫触锛岃妫�鏌ユ暟鎹槸鍚﹀綍鍏ユ垚鍔�");
return;
@@ -110,35 +130,41 @@
//闃叉鍑虹墖浠诲姟涓旂鍓嶆湁鐜荤拑鐨勬儏鍐碉紝灏嗚繘鐗噄d缃┖锛屽嵆鍑虹墖浠呰�冭檻绗煎唴鐨勭幓鐠�
task.setGlassIdIn("");
}
- int request = task.getTaskState();
+ int request = task.getTaskState();
+ int taskRunning = task.getTaskRunning();
log.info("寮�濮嬫墽琛屼换鍔★紝浠诲姟璇蜂俊鎭负{}", task);
- if (request == 0) {
- log.info("鏈敹鍒颁换鍔¤姹傦紝缁撴潫鏈浠诲姟");
- } else if (request == 1) {
- //杩涚墖浠诲姟
- log.info("杩涚墖浠诲姟锛氳繘鐗囩幓鐠僫d涓猴細{}", task.getGlassIdIn());
+ if (request == 0) {
+ log.info("璁惧锛歿}鐘舵�侊細{}", device, request);
+ log.info("鏈敹鍒颁换鍔¤姹傦紝缁撴潫鏈浠诲姟");
+ } else if (request == 1 && taskRunning == 0) {
+ //杩涚墖浠诲姟
+ log.info("璁惧锛歿}鐘舵�侊細{}", device, request);
+ log.info("杩涚墖浠诲姟锛氳繘鐗囩幓鐠僫d涓猴細{}", task.getGlassIdIn());
+ intoTask(task, tableName, device);
+ } else if (request == 2 && taskRunning == 0) {
+ //鍑虹墖浠诲姟
+ outTask(task, tableName, device);
+ } else if (request == 3 && taskRunning == 0) {
+ //鐩撮�氫换鍔�
+ log.info("璁惧锛歿}鐘舵�侊細{}", device, request);
+ if (!outTask(task, tableName, device)) {
intoTask(task, tableName, device);
- } else if (request == 2) {
- //鍑虹墖浠诲姟
- outTask(task, tableName, device);
- } else if (request == 3) {
- //鐩撮�氫换鍔�
- if (!outTask(task, tableName, device)) {
- intoTask(task, tableName, device);
- }
- } else if (request == 4) {
- log.info("灏嗗惎鍔ㄥ瓙鏀逛负0");
- task.setTaskRunning(Const.GLASS_CACHE_TYPE_RUNNING);
- edgStorageDeviceTaskService.updateTaskMessage(tableName, task);
- } else {
- finishTask(task, tableName);
}
- } catch (Exception e) {
- log.info("鎵ц浠诲姟杩囩▼涓彂鐢熷紓甯革紝浠诲姟瀛梴}锛寋}", task.getTaskState(), e.getMessage());
- log.info("灏嗗惎鍔ㄥ瓙鏀逛负0");
- task.setTaskState(Const.GLASS_CACHE_TYPE_EMPTY);
+ } else if (request == 4) {
+ log.info("璁惧锛歿}鐘舵�侊細{}", device, request);
+ log.info("灏嗗惎鍔ㄥ瓙鏀逛负4");
+ task.setTaskRunning(Const.GLASS_CACHE_TYPE_RUNNING);
edgStorageDeviceTaskService.updateTaskMessage(tableName, task);
+ } else {
+ log.info("璁惧锛歿}鐘舵�侊細{}", device, request);
+ finishTask(task, tableName);
}
+// } catch (Exception e) {
+// log.info("鎵ц浠诲姟杩囩▼涓彂鐢熷紓甯革紝浠诲姟瀛梴}锛寋}", task.getTaskState(), e.getMessage());
+// log.info("灏嗗惎鍔ㄥ瓧鏀逛负0");
+// task.setTaskRunning(Const.GLASS_CACHE_TYPE_EMPTY);
+// edgStorageDeviceTaskService.updateTaskMessage(tableName, task);
+// }
}
@@ -181,11 +207,12 @@
miloService.writeToOpcUa(list);
miloService.writeToOpcWord(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".thickness", (int) glassInfo.getThickness() * 10));
//淇敼纾ㄨ竟瀵瑰垪涓殑纾ㄨ竟绾胯矾鍙婄姸鎬�
- edgGlassTaskQueueInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskQueueInfo>()
- .set(EdgGlassTaskQueueInfo::getLine, cell)
- .set(EdgGlassTaskQueueInfo::getState, Const.EDG_GLASS_START)
- .eq(EdgGlassTaskQueueInfo::getGlassId, glassId)
- .eq(EdgGlassTaskQueueInfo::getState, Const.EDG_GLASS_BEFORE));
+ edgGlassTaskInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskInfo>()
+ .set(EdgGlassTaskInfo::getLine, cell)
+ .set(EdgGlassTaskInfo::getState, Const.EDG_GLASS_START)
+ .set(EdgGlassTaskInfo::getUpdateTime, new Date())
+ .eq(EdgGlassTaskInfo::getGlassId, glassId)
+ .eq(EdgGlassTaskInfo::getState, Const.EDG_GLASS_BEFORE));
if (cell == 1) {
glassIdOne = glassId;
} else {
@@ -195,10 +222,33 @@
}
private boolean intoTask(EdgStorageDeviceTask task, String tableName, int deviceId) {
+ Date startDate = new Date();
+ log.info("寮�濮嬫墽琛岃繘鐗囦换鍔★紝浠诲姟淇℃伅涓猴細{},琛ㄥ悕涓猴細{},璁惧id:{},寮�濮嬫椂闂达細{}", task, tableName, deviceId, startDate);
//鑾峰彇鐜荤拑鐨勫熀鏈俊鎭�
GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, task.getGlassIdIn()));
if (null == glassInfo) {
log.info("杩涚墖鐜荤拑淇℃伅涓嶅瓨鍦紝鐜荤拑id:{}", task.getGlassIdIn());
+ Date endDate = new Date();
+ log.info("缁撴潫杩涚墖浠诲姟璁惧涓簕}锛岀粨鏉熸椂闂翠负锛歿}锛屽叡鑰楁椂锛歿}ms", deviceId, endDate, endDate.getTime() - startDate.getTime());
+ return Boolean.FALSE;
+ }
+ if (glassInIdOne.equals(task.getGlassIdIn()) || glassInIdTwo.equals(task.getGlassIdIn())) {
+ log.info("鐜荤拑id涓庝笂娆$浉鍚岋紝绂佹杩涚墖");
+ Date endDate = new Date();
+ log.info("缁撴潫杩涚墖浠诲姟璁惧涓簕}锛岀粨鏉熸椂闂翠负锛歿}锛屽叡鑰楁椂锛歿}ms", deviceId, endDate, endDate.getTime() - startDate.getTime());
+
+ return Boolean.FALSE;
+ }
+ int firstLength = minTwoFirstLength;
+ int secondLength = minTwoSecondLength;
+ if (deviceId == 1) {
+ firstLength = minOneFirstLength;
+ secondLength = minOneSecondLength;
+ }
+ if (Math.max(glassInfo.getWidth(), glassInfo.getHeight()) < firstLength || Math.min(glassInfo.getWidth(), glassInfo.getHeight()) < secondLength) {
+ log.info("杩涚墖鐜荤拑灏哄灏忎簬{}*{}锛岀姝㈣繘绗肩幓鐠僫d:{}锛屽昂瀵镐负{}銆亄}", firstLength, secondLength, task.getGlassIdIn(), glassInfo.getWidth(), glassInfo.getHeight());
+ Date endDate = new Date();
+ log.info("缁撴潫杩涚墖浠诲姟璁惧涓簕}锛岀粨鏉熸椂闂翠负锛歿}锛屽叡鑰楁椂锛歿}ms", deviceId, endDate, endDate.getTime() - startDate.getTime());
return Boolean.FALSE;
}
//鑾峰彇褰撳墠杩涚墖鐜荤拑id鍜岃繘鐗囨牸瀛� 鐩稿悓灏哄鍙互鏀句笅鐨勬牸瀛�
@@ -210,12 +260,10 @@
.eq(EdgStorageCage::getDeviceId, deviceId)
.eq(EdgStorageCage::getEnableState, Const.SLOT_ON)
.ge(EdgStorageCage::getRemainWidth, Math.max(glassInfo.getWidth(), glassInfo.getHeight())).last("order by abs(slot - " + task.getCurrentCell() + ")"));
-// //鐩撮�氫换鍔�
-// if (flag && CollectionUtil.isNotEmpty(emptyList)) {
-// return emptyList.get(0);
-// }
if (CollectionUtil.isEmpty(storageCageList) || storageCageList.size() == 1) {
log.info("娌℃湁澶氫綑鐨勭┖鏍煎瓙");
+ Date endDate = new Date();
+ log.info("缁撴潫杩涚墖浠诲姟璁惧涓簕}锛岀粨鏉熸椂闂翠负锛歿}锛屽叡鑰楁椂锛歿}ms", deviceId, endDate, endDate.getTime() - startDate.getTime());
return Boolean.FALSE;
}
edgStorageCage = storageCageList.get(0);
@@ -232,14 +280,27 @@
task.setStartCell(edgStorageCage.getSlot());
task.setTaskRunning(Const.GLASS_CACHE_TYPE_IN);
edgStorageDeviceTaskService.updateTaskMessage(tableName, task);
- saveHistoryTask(task);
+ saveHistoryTask(task, deviceId);
+ //璁板綍杩涚墖浠诲姟鐨勭幓鐠僫d鐢ㄤ簬涓嬫浠诲姟鐨勬瘮杈冿紝闃叉鍚屼竴鍧楃幓鐠冮噸澶嶆墽琛�
+ if (deviceId == 1) {
+ glassInIdOne = task.getGlassIdIn();
+ } else {
+ glassInIdTwo = task.getGlassIdIn();
+ }
+ edgStorageCageService.update(new UpdateWrapper<EdgStorageCage>()
+ .setSql("remain_width = remain_width -" + (glassGap + Math.max(details.getWidth(), details.getHeight()))).eq("device_id", deviceId)
+ .eq("slot", task.getStartCell()));
+ Date endDate = new Date();
+ log.info("缁撴潫杩涚墖浠诲姟璁惧涓簕}锛岀粨鏉熸椂闂翠负锛歿}锛屽叡鑰楁椂锛歿}ms", deviceId, endDate, endDate.getTime() - startDate.getTime());
return Boolean.TRUE;
}
private boolean outTask(EdgStorageDeviceTask task, String tableName, int deviceId) {
+ Date startDate = new Date();
+ log.info("寮�濮嬫墽琛屽嚭鐗�/鐩撮�氫换鍔★紝浠诲姟淇℃伅涓猴細{},琛ㄥ悕涓猴細{},璁惧id:{},寮�濮嬫椂闂达細{}", task, tableName, deviceId, startDate);
EdgStorageCageDetails edgStorageCageDetails = null;
//绗煎唴鏄増鍥剧浉宸槸鍚﹁秴杩囬槇鍊�
- boolean flag = queryMaxMinDiff(threshold);
+ boolean flag = queryMaxMinDiffByDevice(threshold, deviceId);
if (flag) {
EdgStorageCageDetails minEdgDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>()
.inSql(EdgStorageCageDetails::getSlot, "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON)
@@ -305,7 +366,17 @@
}
if (edgStorageCageDetails == null && StringUtils.isNotBlank(task.getGlassIdIn())) {
//鍜屼笂娆′换鍔′笉瀛樺湪鐩稿悓灏哄
+ int firstLength = minTwoFirstLength;
+ int secondLength = minTwoSecondLength;
+ if (deviceId == 1) {
+ firstLength = minOneFirstLength;
+ secondLength = minOneSecondLength;
+ }
GlassInfo glassInInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, task.getGlassIdIn()));
+ if (Math.max(glassInInfo.getWidth(), glassInInfo.getHeight()) < firstLength || Math.min(glassInInfo.getWidth(), glassInInfo.getHeight()) < secondLength) {
+ log.info("鐩撮�氫换鍔¤繘鐗囩幓鐠冨昂瀵稿皬浜巤}*{}", firstLength, secondLength);
+ return Boolean.FALSE;
+ }
edgStorageCageDetails = new EdgStorageCageDetails();
BeanUtils.copyProperties(glassInInfo, edgStorageCageDetails);
}
@@ -321,6 +392,10 @@
return Boolean.FALSE;
}
log.info("5銆佺洿閫氫换鍔�,灏嗙幓鐠冧俊鎭彃鍏ュ崸寮忕悊鐗囩,褰撳墠鐜荤拑淇℃伅:{}", edgStorageCageDetails);
+ if (glassInIdOne.equals(task.getGlassIdIn()) || glassInIdTwo.equals(task.getGlassIdIn())) {
+ log.info("鐜荤拑id涓庝笂娆$浉鍚岋紝绂佹杩涚墖");
+ return Boolean.FALSE;
+ }
//鐜荤拑淇℃伅鏇挎崲
String glassIdChange = queryAndChangeGlass(glassId);
//澶勭悊鍦ㄥ崸鐞嗗唴鐨勭幓鐠冧俊鎭細绗煎唴鐨勬暟鎹鐞�
@@ -371,43 +446,57 @@
task.setTaskRunning(taskType);
edgStorageDeviceTaskService.updateTaskMessage(tableName, task);
- saveHistoryTask(task);
+ saveHistoryTask(task, deviceId);
+ //璁板綍鐩撮�氫换鍔$殑鐜荤拑id鐢ㄤ簬涓嬫浠诲姟鐨勬瘮杈冿紝闃叉鍚屼竴鍧楃幓鐠冮噸澶嶆墽琛�
+ if (3 == task.getTaskState()) {
+ if (deviceId == 1) {
+ glassInIdOne = edgStorageCageDetails.getGlassId();
+ } else {
+ glassInIdTwo = edgStorageCageDetails.getGlassId();
+ }
+ }
//鏇存柊璇︽儏琛ㄤ换鍔″嚭鐗囦腑
edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>()
.set(EdgStorageCageDetails::getState, Const.GLASS_STATE_OUT)
.eq(EdgStorageCageDetails::getGlassId, edgStorageCageDetails.getGlassId()));
//纾ㄨ竟瀵瑰垪琛ㄦ柊澧炰竴鏉℃暟鎹�
- EdgGlassTaskQueueInfo edgInfo = new EdgGlassTaskQueueInfo();
- BeanUtils.copyProperties(task, edgInfo);
- edgInfo.setGlassId(edgStorageCageDetails.getGlassId());
- edgInfo.setCreateTime(new Date());
- edgInfo.setWidth((int) edgStorageCageDetails.getWidth());
- edgInfo.setHeight((int) edgStorageCageDetails.getHeight());
- edgInfo.setThickness((int) edgStorageCageDetails.getThickness());
- edgInfo.setState(Const.EDG_GLASS_BEFORE);
- edgGlassTaskQueueInfoService.save(edgInfo);
+ saveGlassSize(edgStorageCageDetails);
+// edgStorageCageService.update(new UpdateWrapper<EdgStorageCage>()
+// .setSql("remain_width = remain_width +" + Math.max(edgStorageCageDetails.getWidth(), edgStorageCageDetails.getHeight()))
+// .eq("device_id", deviceId)
+// .eq("slot", task.getStartCell()));
+ Date endDate = new Date();
+ log.info("缁撴潫鍑虹墖/鐩撮�氫换鍔¤澶囦负{}锛岀粨鏉熸椂闂翠负锛歿}锛屽叡鑰楁椂锛歿}ms", deviceId, endDate, endDate.getTime() - startDate.getTime());
return Boolean.TRUE;
}
private boolean finishTask(EdgStorageDeviceTask task, String tableName) {
- log.info("褰撳墠浠诲姟淇℃伅涓猴細{}", task);
- if (task.getTaskState() <= 4 && task.getTaskRunning() == 0) {
+ if (task.getTaskState() <= 4) {
log.info("鏈夋鍦ㄦ墽琛岀殑浠诲姟鎴栬繖浠诲姟宸叉墽琛屼换鍔$姸鎬亄}锛屼换鍔″惎鍔ㄦ儏鍐祘}锛岀粨鏉�", task.getTaskState(), task.getTaskRunning());
return Boolean.FALSE;
}
+ Date startDate = new Date();
+ log.info("寮�濮嬫墽琛屽畬鎴愪换鍔″悗娓呴櫎鍔ㄤ綔锛屼换鍔′俊鎭负锛歿},琛ㄥ悕涓猴細{},寮�濮嬫椂闂达細{}", task, tableName, startDate);
Integer cell = task.getStartCell();
Integer state = task.getTaskState();
task.setTaskRunning(Const.GLASS_CACHE_TYPE_EMPTY);
task.setGlassIdOut("");
task.setStartCell(0);
- edgStorageDeviceTaskService.updateTaskMessage(tableName, task);
+
+ EdgStorageDeviceTaskHistory taskHistory = edgStorageDeviceTaskHistoryService.getOne(new LambdaQueryWrapper<EdgStorageDeviceTaskHistory>()
+ .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW)
+ .orderByDesc(EdgStorageDeviceTaskHistory::getCreateTime).last("limit 1"));
+ int device = tableName.equals("edg_storage_device_one_task") ? 1 : 2;
+ updateCellRemainWidth(cell, device, taskHistory);
edgStorageDeviceTaskHistoryService.update(new LambdaUpdateWrapper<EdgStorageDeviceTaskHistory>()
.eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW)
.set(EdgStorageDeviceTaskHistory::getTaskState,
Const.GLASS_CACHE_TYPE_FINISH.equals(state) ? Const.RAW_GLASS_TASK_SUCCESS : Const.RAW_GLASS_TASK_FAILURE)
);
- int device = tableName.equals("edg_storage_device_one_task") ? 1 : 2;
- updateCellRemainWidth(cell, device);
+ //鏈�鍚庢洿鏂颁换鍔★紝淇濊瘉浠诲姟鍓嶇殑鍔ㄤ綔閮藉仛瀹�
+ edgStorageDeviceTaskService.updateTaskMessage(tableName, task);
+ Date endDate = new Date();
+ log.info("缁撴潫瀹屾垚浠诲姟鍚庢竻闄ゅ姩浣滐紝琛ㄥ悕涓猴細{},缁撴潫鏃堕棿涓猴細{}锛屽叡鑰楁椂锛歿}ms", tableName, endDate, endDate.getTime() - startDate.getTime());
return Boolean.TRUE;
}
@@ -434,7 +523,7 @@
"where engineer_id = '" + glassInfo.getEngineerId() + "' and width = " + glassInfo.getWidth() + " and height = " + glassInfo.getHeight()
+ " and state != 100")
.orderByAsc(GlassInfo::getTemperingLayoutId)
- .orderBy(Boolean.TRUE, Boolean.TRUE, GlassInfo::getTemperingFeedSequence)
+ .orderByAsc(GlassInfo::getTemperingFeedSequence)
.last("Limit 1");
GlassInfo swapGlassInfo = glassInfoService.getOne(queryWrapper);
if (swapGlassInfo != null && !glassInfo.getGlassId().equals(swapGlassInfo.getGlassId())) {
@@ -497,11 +586,12 @@
*
* @return
*/
- public boolean queryMaxMinDiff(int threshold) {
+ public boolean queryMaxMinDiffByDevice(int threshold, int deviceId) {
//鑾峰彇绗煎瓙鍐呮渶澶х増鍥緄d鍜屾渶灏忕増鍥緄d鎻掑�硷紝鍒ゆ柇鏄惁澶т簬闃堝�硷紝澶т簬闃堝�肩洿鎺ュ嚭鏈�灏忕増鍥剧幓鐠�
QueryWrapper<EdgStorageCageDetails> queryWrapper = new QueryWrapper<>();
queryWrapper.select("max(tempering_layout_id)-min(tempering_layout_id) as diff")
.eq("state", Const.GLASS_STATE_IN)
+ .eq("device_id", deviceId)
.inSql("slot", "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON);
List<Object> list = edgStorageCageDetailsService.listObjs(queryWrapper);
//鑾峰彇绗煎唴鐜荤拑鐗堝浘宸�兼槸鍚﹀ぇ浜庨槇鍊�
@@ -513,29 +603,53 @@
}
}
- public boolean saveHistoryTask(EdgStorageDeviceTask task) {
+ public boolean saveHistoryTask(EdgStorageDeviceTask task, int deviceId) {
EdgStorageDeviceTaskHistory taskHistory = new EdgStorageDeviceTaskHistory();
BeanUtils.copyProperties(task, taskHistory);
taskHistory.setTaskType(task.getTaskRunning());
taskHistory.setCreateTime(new Date());
taskHistory.setTaskState(Const.RAW_GLASS_TASK_NEW);
+ taskHistory.setDeviceId(deviceId);
edgStorageDeviceTaskHistoryService.save(taskHistory);
return Boolean.TRUE;
}
- private boolean updateCellRemainWidth(int slot, int device) {
+ private boolean updateCellRemainWidth(int slot, int device, EdgStorageDeviceTaskHistory taskHistory) {
List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getSlot, slot)
.eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN));
int remainWidth = cellLength;
if (CollectionUtil.isNotEmpty(list)) {
- int widthTotal = (int) list.stream().map(e -> Math.max(e.getWidth(), e.getHeight()) + glassGap).mapToDouble(Double::intValue).sum();
- remainWidth = cellLength - widthTotal >= 0 ? cellLength - widthTotal : 0;
+ if (2 == taskHistory.getTaskType()) {
+ remainWidth = 0;
+ } else {
+ EdgStorageCage storageCage = edgStorageCageService.getOne(new LambdaQueryWrapper<EdgStorageCage>()
+ .eq(EdgStorageCage::getDeviceId, device).eq(EdgStorageCage::getSlot, slot));
+ EdgStorageCageDetails bigDetails = list.stream().filter(e -> e.getGlassId().equals(taskHistory.getGlassIdIn())).findFirst().orElse(null);
+ remainWidth = storageCage.getRemainWidth() - glassGap - (int) Math.max(bigDetails.getWidth(), bigDetails.getHeight());
+ if (remainWidth <= 0) {
+ remainWidth = 0;
+ }
+ }
}
edgStorageCageService.update(new LambdaUpdateWrapper<EdgStorageCage>().
set(EdgStorageCage::getRemainWidth, remainWidth).eq(EdgStorageCage::getSlot, slot).eq(EdgStorageCage::getDeviceId, device));
return Boolean.TRUE;
}
+ private boolean saveGlassSize(EdgStorageCageDetails glassInfo) {
+ EdgGlassTaskInfo edgGlassTaskInfo = new EdgGlassTaskInfo();
+ BeanUtils.copyProperties(glassInfo, edgGlassTaskInfo);
+ edgGlassTaskInfo.setHeight((int) (glassInfo.getHeight() * ratio));
+ edgGlassTaskInfo.setWidth((int) (glassInfo.getWidth() * ratio));
+ edgGlassTaskInfo.setThickness((int) (glassInfo.getThickness() * ratio));
+ edgGlassTaskInfo.setState(Const.EDG_GLASS_BEFORE);
+ edgGlassTaskInfo.setCreateTime(new Date());
+ edgGlassTaskInfo.setUpdateTime(new Date());
+ //鍏堝皢鍘嗗彶瀵瑰垪琛ㄤ腑鏈幓鐠冪殑鏁版嵁鍒犻櫎锛岄噸鏂版柊澧炰竴浠芥渶鏂扮殑鏁版嵁
+ edgGlassTaskInfoService.remove(new LambdaQueryWrapper<EdgGlassTaskInfo>().eq(EdgGlassTaskInfo::getGlassId, glassInfo.getGlassId()));
+ return edgGlassTaskInfoService.save(edgGlassTaskInfo);
+ }
+
private ReadWriteEntity generateReadWriteEntity(String identifier, Object value) {
return ReadWriteEntity.builder()
.identifier(identifier)
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/opctask/entity/EdgStorageDeviceTaskHistory.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/opctask/entity/EdgStorageDeviceTaskHistory.java
index 9a992c4..1e5c449 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/opctask/entity/EdgStorageDeviceTaskHistory.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/opctask/entity/EdgStorageDeviceTaskHistory.java
@@ -58,6 +58,11 @@
*/
private Date updateTime;
+ /**
+ * 璁惧淇℃伅
+ */
+ private Integer deviceId;
+
}
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-yw.yml b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-yw.yml
new file mode 100644
index 0000000..6f455aa
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-yw.yml
@@ -0,0 +1,32 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://192.168.2.100:3306/hangzhoumes?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ pp:
+ url: jdbc:mysql://192.168.2.100:3306/pp?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ salve_hangzhoumes:
+ url: jdbc:sqlserver://192.168.2.100:1433;databasename=mes
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 192.168.2.100:8848
+ application:
+ name: cacheGlass
+ redis:
+ database: 0
+ host: 192.168.2.100
+ port: 6379
+ password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageDeviceTaskMapper.xml b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageDeviceTaskMapper.xml
index 8c76445..50f680e 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageDeviceTaskMapper.xml
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageDeviceTaskMapper.xml
@@ -29,8 +29,5 @@
current_cell = #{task.currentCell},
start_cell = #{task.startCell},
end_cell = #{task.endCell}
- <if test="task.taskState == 0">
- ,task_state = #{task.taskState}
- </if>
</update>
</mapper>
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/pom.xml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/pom.xml
index 6b6533a..955faaf 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/pom.xml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/pom.xml
@@ -2,15 +2,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-<parent>
- <artifactId>moduleService</artifactId>
- <groupId>com.mes</groupId>
- <version>1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
-</parent>
-<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>moduleService</artifactId>
+ <groupId>com.mes</groupId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
-<artifactId>cacheVerticalGlass</artifactId>
+ <artifactId>cacheVerticalGlass</artifactId>
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -18,9 +18,9 @@
<scope>test</scope>
</dependency>
</dependencies>
-<properties>
- <maven.compiler.source>8</maven.compiler.source>
- <maven.compiler.target>8</maven.compiler.target>
-</properties>
+ <properties>
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+ </properties>
</project>
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
index bd2e2de..b069d57 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
@@ -106,6 +106,13 @@
return Result.build(200, "鏌ヨ鎴愬姛", bigStorageCageDetailsService.selectTemperingGlass());
}
+ @ApiOperation("鏄惁璋冨害寮�鍏�")
+ @PostMapping("/dispatchSwitch")
+ public Result dispatchSwitch(Boolean flag) {
+ bigStorageCageDetailsService.dispatchSwitch(flag);
+ return Result.build(200, "淇敼鎴愬姛", redisUtil.getCacheObject("dispatchSwitch"));
+ }
+
@ApiOperation("鏄惁閽㈠寲寮�鍏�")
@PostMapping("/temperingSwitch")
public Result temperingSwitch(Boolean flag) {
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageGlassInfoController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageGlassInfoController.java
new file mode 100644
index 0000000..ad1c7f3
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageGlassInfoController.java
@@ -0,0 +1,18 @@
+package com.mes.bigstorage.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * (BigStorageGlassInfo)琛ㄦ帶鍒跺眰
+ *
+ * @author makejava
+ * @since 2024-11-24 10:15:34
+ */
+@RestController
+@RequestMapping("bigStorageGlassInfo")
+public class BigStorageGlassInfoController {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageGlassRelationInfoController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageGlassRelationInfoController.java
new file mode 100644
index 0000000..54ce5a4
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageGlassRelationInfoController.java
@@ -0,0 +1,18 @@
+package com.mes.bigstorage.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * (BigStorageGlassRelationInfo)琛ㄦ帶鍒跺眰
+ *
+ * @author makejava
+ * @since 2024-11-24 10:17:42
+ */
+@RestController
+@RequestMapping("bigStorageGlassRelationInfo")
+public class BigStorageGlassRelationInfoController {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java
index 4c06b4b..da3d47e 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java
@@ -12,6 +12,7 @@
import lombok.EqualsAndHashCode;
import java.io.Serializable;
+import java.util.Date;
/**
* <p>
@@ -68,16 +69,16 @@
private double thickness;
/**
- * 閽㈠寲鐗堝浘id
+ * x鍧愭爣
*/
- @ApiModelProperty(value = "閽㈠寲鐗堝浘id", position = 12)
- private Integer temperingLayoutId;
+ @ApiModelProperty(value = "x鍧愭爣", position = 13)
+ private Integer xCoordinate;
/**
- * 閽㈠寲鐗堝浘鐗囧簭
+ * y鍧愭爣
*/
- @ApiModelProperty(value = "閽㈠寲鐗堝浘鐗囧簭", position = 13)
- private Integer temperingFeedSequence;
+ @ApiModelProperty(value = "y鍧愭爣", position = 14)
+ private Integer yCoordinate;
/**
* 鐘舵��
@@ -94,16 +95,19 @@
/**
* 宸ョ▼鍙�
*/
- @ApiModelProperty(value = "宸ョ▼鍙�", position = 16)
- private String engineerId;
-
- /**
- * 宸ョ▼鍙�
- */
@ApiModelProperty(value = "灞�", position = 17)
private int layer;
/**
+ * 鍒涘缓鏃堕棿
+ */
+ private Date createTime;
+ /**
+ * 鏇存柊鏃堕棿
+ */
+ private Date updateTime;
+
+ /**
* 杩涚墖浠诲姟
*/
@ApiModelProperty(value = "杩涚墖浠诲姟", position = 18)
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageGlassInfo.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageGlassInfo.java
new file mode 100644
index 0000000..39fa8c0
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageGlassInfo.java
@@ -0,0 +1,74 @@
+package com.mes.bigstorage.entity;
+
+import lombok.Data;
+
+/**
+ * (BigStorageGlassInfo)琛ㄥ疄浣撶被
+ *
+ * @author makejava
+ * @since 2024-11-24 10:15:35
+ */
+@Data
+public class BigStorageGlassInfo {
+ /**
+ * /*澶х悊鐗囩淇℃伅琛╥d
+ */
+ private Long id;
+ /**
+ * /*鐜荤拑id
+ */
+ private String glassId;
+ /**
+ * /*娴佺▼鍗″彿
+ */
+ private String flowCardId;
+ /**
+ * /*鐜荤拑绫诲瀷
+ */
+ private Integer glassType;
+ /**
+ * /*瀹�
+ */
+ private Double width;
+ /**
+ * /*楂�
+ */
+ private Double height;
+ /**
+ * /*鍘氬害
+ */
+ private Double thickness;
+ /**
+ * /*閽㈠寲鐗堝浘id
+ */
+ private Integer temperingLayoutId;
+ /**
+ * /*閽㈠寲鐗堝浘鐗囧簭
+ */
+ private Integer temperingFeedSequence;
+ /**
+ * /*x鍧愭爣
+ */
+ private Integer xCoordinate;
+ /**
+ * /*y鍧愭爣
+ */
+ private Integer yCoordinate;
+
+ private String engineerId;
+ /**
+ * /*灞傚彿
+ */
+ private Integer layer;
+ /**
+ * /*铏氭嫙鏍煎瓙鍙�
+ */
+ private Integer virtualSlot;
+ /**
+ * /*鏍煎瓙娆″簭
+ */
+ private Integer slotSequence;
+
+
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageGlassRelationInfo.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageGlassRelationInfo.java
new file mode 100644
index 0000000..ccc1fd5
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageGlassRelationInfo.java
@@ -0,0 +1,50 @@
+package com.mes.bigstorage.entity;
+
+import lombok.Data;
+
+/**
+ * (BigStorageGlassRelationInfo)琛ㄥ疄浣撶被
+ *
+ * @author makejava
+ * @since 2024-11-24 10:17:43
+ */
+@Data
+public class BigStorageGlassRelationInfo {
+ /**
+ * /*閽㈠寲鐜荤拑鍏崇郴琛╥d
+ */
+ private Long id;
+
+ private String engineerId;
+ /**
+ * /*鐜荤拑id
+ */
+ private String glassId;
+ /**
+ * /*閽㈠寲鐗堝浘id
+ */
+ private Integer temperingLayoutId;
+ /**
+ * /*閽㈠寲鐗堝浘鐗囧簭
+ */
+ private Integer temperingFeedSequence;
+ /**
+ * /*铏氭嫙鏍煎瓙
+ */
+ private Integer virtualSlot;
+ /**
+ * /*鏍煎瓙鍐呮搴�
+ */
+ private Integer slotSequence;
+ /**
+ * /*瀹為檯绗煎瓙鍙�
+ */
+ private Integer deviceId;
+ /**
+ * /*瀹為檯鏍煎瓙鍙�
+ */
+ private Integer slot;
+
+
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageDTO.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageDTO.java
similarity index 78%
rename from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageDTO.java
rename to hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageDTO.java
index 465c7a2..decf3f3 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageDTO.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageDTO.java
@@ -1,4 +1,4 @@
-package com.mes.bigstorage.entity;
+package com.mes.bigstorage.entity.dto;
import lombok.Data;
@@ -27,4 +27,8 @@
* 绗煎瓙鍙�
*/
private Integer deviceId;
+ /**
+ * 搴忓彿
+ */
+ private Integer slotSequence;
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageRelationDTO.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageRelationDTO.java
new file mode 100644
index 0000000..9ab2385
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageRelationDTO.java
@@ -0,0 +1,24 @@
+package com.mes.bigstorage.entity.dto;
+
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/25 18:53
+ * @Description:
+ */
+@Data
+public class BigStorageRelationDTO {
+
+
+ private String engineerId;
+ /**
+ * /*閽㈠寲鐗堝浘id
+ */
+ private Integer temperingLayoutId;
+ /**
+ * /*铏氭嫙鏍煎瓙
+ */
+ private Integer virtualSlot;
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageSequenceDTO.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageSequenceDTO.java
new file mode 100644
index 0000000..a976537
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/dto/BigStorageSequenceDTO.java
@@ -0,0 +1,17 @@
+package com.mes.bigstorage.entity.dto;
+
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/25 18:53
+ * @Description:
+ */
+@Data
+public class BigStorageSequenceDTO {
+
+ private Integer slot;
+ private Integer maxSequence;
+ private Integer minSequence;
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java
index 4627118..8c0306f 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java
@@ -2,6 +2,8 @@
import com.github.yulichang.base.MPJBaseMapper;
import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.entity.dto.BigStorageRelationDTO;
+import com.mes.bigstorage.entity.dto.BigStorageSequenceDTO;
import com.mes.bigstorage.entity.dto.SlotSequenceDTO;
import com.mes.bigstorage.entity.dto.TemperingLayoutDTO;
import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO;
@@ -47,4 +49,8 @@
void updateBySlot(@Param(value = "list") List<UpdateBigStorageCageDTO> glassList, @Param(value = "state") int state);
List<Map<String, Object>> selectTemperingGlassCount();
+
+ List<BigStorageRelationDTO> queryIsAllNeedDispatchVirtualSlot();
+
+ List<BigStorageSequenceDTO> queryNeedDispatchSlot(BigStorageRelationDTO bigStorageRelationDTO);
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageGlassInfoMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageGlassInfoMapper.java
new file mode 100644
index 0000000..5516c61
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageGlassInfoMapper.java
@@ -0,0 +1,15 @@
+package com.mes.bigstorage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.bigstorage.entity.BigStorageGlassInfo;
+
+/**
+ * (BigStorageGlassInfo)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author makejava
+ * @since 2024-11-24 10:15:34
+ */
+public interface BigStorageGlassInfoMapper extends BaseMapper<BigStorageGlassInfo> {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageGlassRelationInfoMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageGlassRelationInfoMapper.java
new file mode 100644
index 0000000..2d86be6
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageGlassRelationInfoMapper.java
@@ -0,0 +1,19 @@
+package com.mes.bigstorage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.bigstorage.entity.BigStorageGlassRelationInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * (BigStorageGlassRelationInfo)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author makejava
+ * @since 2024-11-24 10:17:43
+ */
+public interface BigStorageGlassRelationInfoMapper extends BaseMapper<BigStorageGlassRelationInfo> {
+
+ List<String> queryNeedOutGlassId(@Param("engineerId") String engineerId, @Param("temperingLayoutId") Integer temperingLayoutId, @Param("temperingFeedSequence") Integer temperingFeedSequence);
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java
index 8daa7b7..74183c1 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java
@@ -2,9 +2,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.mes.bigstorage.entity.BigStorageCageDetails;
-import com.mes.bigstorage.entity.BigStorageDTO;
-import com.mes.bigstorage.entity.dto.SlotSequenceDTO;
-import com.mes.bigstorage.entity.dto.TemperingLayoutDTO;
+import com.mes.bigstorage.entity.dto.*;
import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO;
import com.mes.glassinfo.entity.GlassInfo;
@@ -78,4 +76,10 @@
String temperingSwitch(Boolean flag);
void appointEngineerId(String engineerId);
+
+ List<BigStorageRelationDTO> queryIsAllNeedDispatchVirtualSlot();
+
+ List<BigStorageSequenceDTO> dispatchBigStorageGlassInfo(BigStorageRelationDTO bigStorageRelationDTO);
+
+ String dispatchSwitch(Boolean flag);
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageGlassInfoService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageGlassInfoService.java
new file mode 100644
index 0000000..6464aad
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageGlassInfoService.java
@@ -0,0 +1,35 @@
+package com.mes.bigstorage.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.bigstorage.entity.BigStorageGlassInfo;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
+
+/**
+ * (BigStorageGlassInfo)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author makejava
+ * @since 2024-11-24 10:15:35
+ */
+public interface BigStorageGlassInfoService extends IService<BigStorageGlassInfo> {
+
+ /**
+ * 鎸夌収鐜荤拑id鑾峰彇涓┖鐩爣鏍煎瓙
+ *
+ * @return
+ */
+ BigStorageDTO queryBigStorageTargetSlot(String engineerId, Integer temperingLayoutId, Integer temperingFeedSequence);
+
+ /**
+ * 鐢熸垚涓┖鐜荤拑淇℃伅
+ */
+ void generateBigStorageGlassInfo(String engineerId, int temperingLayoutId);
+
+ /**
+ * 鏍煎瓙閰嶅
+ *
+ * @param bigStorageGlassInfo
+ * @return
+ */
+ int bigStorageSlotPair(BigStorageGlassInfo bigStorageGlassInfo);
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageGlassRelationInfoService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageGlassRelationInfoService.java
new file mode 100644
index 0000000..da1456b
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageGlassRelationInfoService.java
@@ -0,0 +1,18 @@
+package com.mes.bigstorage.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.bigstorage.entity.BigStorageGlassRelationInfo;
+
+import java.util.List;
+
+/**
+ * (BigStorageGlassRelationInfo)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author makejava
+ * @since 2024-11-24 10:17:43
+ */
+public interface BigStorageGlassRelationInfoService extends IService<BigStorageGlassRelationInfo> {
+
+ List<String> queryNeedOutGlassId(String engineerId, Integer temperingLayoutId, Integer temperingFeedSequence);
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
index ee80460..3c478b9 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -8,9 +8,7 @@
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
-import com.mes.bigstorage.entity.BigStorageDTO;
-import com.mes.bigstorage.entity.dto.SlotSequenceDTO;
-import com.mes.bigstorage.entity.dto.TemperingLayoutDTO;
+import com.mes.bigstorage.entity.dto.*;
import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.bigstorage.service.BigStorageCageService;
@@ -296,7 +294,7 @@
}
bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
.eq(BigStorageCage::getEnableState, Const.SLOT_ON)
- .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot)
// .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0")
.inSql(BigStorageCage::getDeviceId,
"select distinct device_id from big_storage_cage_details where engineer_id = '" + glassInfo.getEngineerId() + "' and tempering_layout_id = " + glassInfo.getTemperingLayoutId())
@@ -337,7 +335,7 @@
}
for (Integer item : deviceUsedList) {
bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
- .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot)
.eq(BigStorageCage::getEnableState, Const.SLOT_ON)
.eq(BigStorageCage::getDeviceId, item)
.last("limit 1"));
@@ -432,6 +430,12 @@
}
@Override
+ public String dispatchSwitch(Boolean flag) {
+ redisUtil.setCacheObject("dispatchSwitch", flag);
+ return "success";
+ }
+
+ @Override
public String temperingSwitch(Boolean flag) {
redisUtil.setCacheObject("temperingSwitch", flag);
return "success";
@@ -441,4 +445,14 @@
public void appointEngineerId(String engineerId) {
redisUtil.setCacheObject("temperingengineerId", engineerId);
}
+
+ @Override
+ public List<BigStorageRelationDTO> queryIsAllNeedDispatchVirtualSlot() {
+ return baseMapper.queryIsAllNeedDispatchVirtualSlot();
+ }
+
+ @Override
+ public List<BigStorageSequenceDTO> dispatchBigStorageGlassInfo(BigStorageRelationDTO bigStorageRelationDTO) {
+ return baseMapper.queryNeedDispatchSlot(bigStorageRelationDTO);
+ }
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageServiceImpl.java
index 769d6a4..ac0d729 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageServiceImpl.java
@@ -197,13 +197,10 @@
.orderByDesc(GlassInfo::getTemperingFeedSequence);
List<GlassInfo> glassInfoList = glassInfoService.list(glassInfoWrapper);
if (glassInfoList.size() == Integer.parseInt(temperingNo.toString())) {
- for (GlassInfo glassInfo : glassInfoList
- ) {
-
+ for (GlassInfo glassInfo : glassInfoList) {
TemperingGlassInfo temperingGlassInfo = new TemperingGlassInfo();
BeanUtils.copyProperties(glassInfo, temperingGlassInfo);
temperingGlassInfoService.save(temperingGlassInfo);
-
}
key = true;
}
@@ -259,7 +256,7 @@
MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>();
wrapper.selectAll(BigStorageCage.class).selectCollection(BigStorageCageDetails.class, BigStorageCage::getBigStorageCageDetails)
.leftJoin(BigStorageCageDetails.class, on -> on.eq(BigStorageCageDetails::getSlot, BigStorageCage::getSlot)
- .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL, Const.GLASS_STATE_OUT_ING));
+ .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL).orderByAsc(BigStorageCageDetails::getUpdateTime));
List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper);
Map<Integer, List<BigStorageCage>> listMap = bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId()));
return listMap;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageGlassInfoServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageGlassInfoServiceImpl.java
new file mode 100644
index 0000000..9586097
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageGlassInfoServiceImpl.java
@@ -0,0 +1,200 @@
+package com.mes.bigstorage.service.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.bigstorage.entity.BigStorageCage;
+import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.entity.BigStorageGlassInfo;
+import com.mes.bigstorage.entity.BigStorageGlassRelationInfo;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
+import com.mes.bigstorage.mapper.BigStorageGlassInfoMapper;
+import com.mes.bigstorage.service.BigStorageCageDetailsService;
+import com.mes.bigstorage.service.BigStorageCageService;
+import com.mes.bigstorage.service.BigStorageGlassInfoService;
+import com.mes.bigstorage.service.BigStorageGlassRelationInfoService;
+import com.mes.common.config.Const;
+import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.service.GlassInfoService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * (BigStorageGlassInfo)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author makejava
+ * @since 2024-11-24 10:15:35
+ */
+@Service
+@Slf4j
+public class BigStorageGlassInfoServiceImpl extends ServiceImpl<BigStorageGlassInfoMapper, BigStorageGlassInfo> implements BigStorageGlassInfoService {
+ @Resource
+ GlassInfoService glassInfoService;
+ @Resource
+ BigStorageCageService bigStorageCageService;
+ @Resource
+ BigStorageCageDetailsService bigStorageCageDetailsService;
+ @Resource
+ BigStorageGlassRelationInfoService bigStorageGlassRelationInfoService;
+ @Value("${mes.slotWidth}")
+ private Integer slotWidth;
+ @Value("${mes.glassGap}")
+ private Integer glassGap;
+ @Value("${mes.outCarMaxSize}")
+ private Integer outCarMaxSize;
+
+ @Override
+ public BigStorageDTO queryBigStorageTargetSlot(String engineerId, Integer temperingLayoutId, Integer temperingFeedSequence) {
+ //鎸夌収鐜荤拑淇℃伅鑾峰彇鍏崇郴琛ㄦ槸鍚︽湁瀵瑰簲鐨勫叧绯�
+ BigStorageGlassRelationInfo relationInfoOne = bigStorageGlassRelationInfoService.getOne(new LambdaQueryWrapper<BigStorageGlassRelationInfo>()
+ .eq(BigStorageGlassRelationInfo::getEngineerId, engineerId)
+ .eq(BigStorageGlassRelationInfo::getTemperingLayoutId, temperingLayoutId)
+ .eq(BigStorageGlassRelationInfo::getTemperingFeedSequence, temperingFeedSequence)
+ );
+ if (relationInfoOne == null) {
+ //鐞嗙墖绗煎叧绯昏〃涓病鏈夊搴旂殑鏁版嵁锛屾煡鐪嬬悊鐗囩铏氭嫙浣嶇疆琛ㄦ槸鍚︽湁鏈伐绋嬩笅鐨勬墍鏈夌幓鐠冭櫄鎷熶俊鎭�
+ BigStorageGlassInfo bigStorageGlassInfo = this.getOne(new LambdaQueryWrapper<BigStorageGlassInfo>()
+ .eq(BigStorageGlassInfo::getEngineerId, engineerId)
+ .eq(BigStorageGlassInfo::getTemperingLayoutId, temperingLayoutId)
+ .eq(BigStorageGlassInfo::getTemperingFeedSequence, temperingFeedSequence));
+ if (null == bigStorageGlassInfo) {
+ //铏氭嫙浣嶇疆琛ㄦ病鏈夋湰宸ョ▼涓嬬殑鎵�鏈夌幓鐠冭櫄鎷熶俊鎭紝鎸夌収鐜荤拑id鐢熸垚鏈伐绋嬩笅鎵�鏈夌幓鐠冪殑铏氭嫙淇℃伅
+ generateBigStorageGlassInfo(engineerId, temperingLayoutId);
+ bigStorageGlassInfo = this.getOne(new LambdaQueryWrapper<BigStorageGlassInfo>()
+ .eq(BigStorageGlassInfo::getEngineerId, engineerId)
+ .eq(BigStorageGlassInfo::getTemperingLayoutId, temperingLayoutId)
+ .eq(BigStorageGlassInfo::getTemperingFeedSequence, temperingFeedSequence));
+ }
+ //鎸夌収铏氭嫙浣嶇疆鍜屽ぇ鐞嗙墖绗肩幇鏈夊彲鐢ㄦ牸瀛愮敓鎴愬叧绯昏〃
+ bigStorageSlotPair(bigStorageGlassInfo);
+ //鍏崇郴琛ㄨ幏鍙栧疄闄呬綅缃�
+ relationInfoOne = bigStorageGlassRelationInfoService.getOne(new LambdaQueryWrapper<BigStorageGlassRelationInfo>()
+ .eq(BigStorageGlassRelationInfo::getEngineerId, engineerId)
+ .eq(BigStorageGlassRelationInfo::getTemperingLayoutId, temperingLayoutId)
+ .eq(BigStorageGlassRelationInfo::getTemperingFeedSequence, temperingFeedSequence));
+ }
+ BigStorageCageDetails bigStorageCageDetails = bigStorageCageDetailsService.getOne(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getSlot, relationInfoOne.getSlot()).in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)
+ .orderByDesc(BigStorageCageDetails::getSequence).last("limit 1"));
+ if (null == bigStorageCageDetails) {
+ BigStorageDTO storageDTO = new BigStorageDTO();
+ storageDTO.setDeviceId(relationInfoOne.getDeviceId());
+ storageDTO.setSlot(relationInfoOne.getSlot());
+ storageDTO.setSlotSequence(relationInfoOne.getSlotSequence());
+ storageDTO.setWidth(slotWidth);
+ return storageDTO;
+ }
+ BigStorageGlassRelationInfo relationInfoBefore = bigStorageGlassRelationInfoService.getOne(new LambdaQueryWrapper<BigStorageGlassRelationInfo>()
+ .eq(BigStorageGlassRelationInfo::getEngineerId, relationInfoOne.getEngineerId())
+ .eq(BigStorageGlassRelationInfo::getTemperingLayoutId, relationInfoOne.getTemperingLayoutId())
+ .eq(BigStorageGlassRelationInfo::getVirtualSlot, relationInfoOne.getVirtualSlot())
+ .eq(BigStorageGlassRelationInfo::getSlotSequence, relationInfoOne.getSlotSequence() - 1));
+ BigStorageCage storageCage = null;
+ if (null == relationInfoBefore) {
+ //琛ㄧず搴忓彿娌℃湁鎴栬�� 搴忓彿涓�1鍙堜笉鏄涓�鍧楁潵鐨� 鏂板紑涓�鏍�
+ storageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
+ .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot).last("limit 1"));
+ } else {
+ BigStorageCageDetails beforeGlass = bigStorageCageDetailsService.getOne(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)
+ .eq(BigStorageCageDetails::getEngineerId, relationInfoBefore.getEngineerId())
+ .eq(BigStorageCageDetails::getTemperingLayoutId, relationInfoBefore.getTemperingLayoutId())
+ .eq(BigStorageCageDetails::getTemperingFeedSequence, relationInfoBefore.getTemperingFeedSequence())
+ );
+ if (null == beforeGlass) {
+ storageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
+ .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot).last("limit 1"));
+ } else {
+ storageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
+ .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getSlot, beforeGlass.getSlot()));
+ }
+ }
+ Assert.isTrue(null != storageCage, "娌℃湁绌轰綑鐨勭瀛愬瓨鏀剧幓鐠�");
+ BigStorageDTO storageDTO = new BigStorageDTO();
+ storageDTO.setDeviceId(storageCage.getDeviceId());
+ storageDTO.setSlotSequence(relationInfoOne.getSlotSequence());
+ storageDTO.setSlot(storageCage.getSlot());
+ storageDTO.setWidth(storageCage.getRemainWidth());
+ return storageDTO;
+ }
+
+ @Override
+ public void generateBigStorageGlassInfo(String engineerId, int temperingLayoutId) {
+ List<BigStorageGlassInfo> list = this.list(new LambdaQueryWrapper<BigStorageGlassInfo>()
+ .eq(BigStorageGlassInfo::getEngineerId, engineerId).eq(BigStorageGlassInfo::getTemperingLayoutId, temperingLayoutId));
+ if (CollectionUtil.isNotEmpty(list)) {
+ return;
+ }
+// Engineering engineering = engineeringMapper.selectOne(new LambdaQueryWrapper<Engineering>()
+// .eq(Engineering::getEngineerId, glassInfo.getEngineerId()));
+ //鑾峰彇鐜荤拑鐨勫伐绋媔d锛屾寜鐓у伐绋媔d鑾峰彇宸ョ▼涓嬬殑鎵�鏈夌幓鐠冧俊鎭�
+ List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>()
+ .eq(GlassInfo::getEngineerId, engineerId)
+ .orderByAsc(GlassInfo::getTemperingLayoutId).orderByAsc(GlassInfo::getTemperingFeedSequence));
+ Map<Integer, List<GlassInfo>> trmperingIdMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getTemperingLayoutId));
+ List<BigStorageGlassInfo> bigStorageGlassInfoList = new ArrayList<>();
+ //鏂瑰紡涓�锛氬皢鐜荤拑鎸夌増鍥俱�佺増搴� 渚濇鐢熸垚铏氭嫙鏍煎瓙淇℃伅锛屾牸瀛愪竴鐩村線鍚庣疮鍔�
+ trmperingIdMap.forEach((e, v) -> {
+ int remainWidth = slotWidth;
+ int slotNumber = 1;
+ int slotSequence = 1;
+ for (GlassInfo item : v) {
+ int maxLength = (int) Math.max(item.getWidth(), item.getHeight());
+ if (remainWidth > maxLength && slotSequence <= outCarMaxSize) {
+ remainWidth = remainWidth - maxLength - glassGap;
+ } else {
+ slotNumber = slotNumber + 1;
+ slotSequence = 1;
+ remainWidth = slotWidth - maxLength - glassGap;
+ }
+ BigStorageGlassInfo bigStorage = new BigStorageGlassInfo();
+ BeanUtils.copyProperties(item, bigStorage);
+ bigStorage.setVirtualSlot(slotNumber);
+ bigStorage.setSlotSequence(slotSequence++);
+ bigStorage.setId(null);
+ bigStorageGlassInfoList.add(bigStorage);
+ }
+ });
+ this.saveBatch(bigStorageGlassInfoList);
+ log.info("鍒嗛厤瀹屾瘯");
+
+ }
+
+ @Override
+ public int bigStorageSlotPair(BigStorageGlassInfo bigStorageGlassInfo) {
+ //鑾峰彇鎵�鏈夌┖闂插彲鐢ㄧ殑鏍煎瓙鍙�
+ BigStorageCage storageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
+ .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot).last("limit 1"));
+ Assert.isTrue(null != storageCage, "娌℃湁绌轰綑鐨勭瀛愬瓨鏀剧幓鐠�");
+ Integer slot = storageCage.getSlot();
+ //鑾峰彇璇ュ伐绋嬪悓涓�娴佺▼鍗″悓涓�杞︾殑鐜荤拑淇℃伅
+ List<BigStorageGlassInfo> bigStorageGlassInfoList = this.list(new LambdaQueryWrapper<BigStorageGlassInfo>()
+ .eq(BigStorageGlassInfo::getEngineerId, bigStorageGlassInfo.getEngineerId())
+ .eq(BigStorageGlassInfo::getTemperingLayoutId, bigStorageGlassInfo.getTemperingLayoutId())
+ .eq(BigStorageGlassInfo::getVirtualSlot, bigStorageGlassInfo.getVirtualSlot()));
+ //璁剧疆鍏崇郴琛ㄧ殑瀹為檯鏍煎瓙鍙�
+ List<BigStorageGlassRelationInfo> relationInfoList = bigStorageGlassInfoList.stream().map(e -> {
+ BigStorageGlassRelationInfo info = new BigStorageGlassRelationInfo();
+ BeanUtils.copyProperties(e, info);
+ info.setSlot(slot);
+ info.setDeviceId(storageCage.getDeviceId());
+ return info;
+ }).collect(Collectors.toList());
+ //淇濆瓨鍏崇郴琛�
+ bigStorageGlassRelationInfoService.saveBatch(relationInfoList);
+ //杩斿洖鏍煎瓙淇℃伅
+ return slot;
+ }
+
+
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageGlassRelationInfoServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageGlassRelationInfoServiceImpl.java
new file mode 100644
index 0000000..df41e60
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageGlassRelationInfoServiceImpl.java
@@ -0,0 +1,25 @@
+package com.mes.bigstorage.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.bigstorage.entity.BigStorageGlassRelationInfo;
+import com.mes.bigstorage.mapper.BigStorageGlassRelationInfoMapper;
+import com.mes.bigstorage.service.BigStorageGlassRelationInfoService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * (BigStorageGlassRelationInfo)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author makejava
+ * @since 2024-11-24 10:17:43
+ */
+@Service
+public class BigStorageGlassRelationInfoServiceImpl extends ServiceImpl<BigStorageGlassRelationInfoMapper, BigStorageGlassRelationInfo> implements BigStorageGlassRelationInfoService {
+
+ @Override
+ public List<String> queryNeedOutGlassId(String engineerId, Integer temperingLayoutId, Integer temperingFeedSequence) {
+ return baseMapper.queryNeedOutGlassId(engineerId, temperingLayoutId, temperingFeedSequence);
+ }
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/service/BigStorageCageTaskService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/service/BigStorageCageTaskService.java
deleted file mode 100644
index 0a5b186..0000000
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/service/BigStorageCageTaskService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.mes.bigstoragecagetask.service;
-
-import com.mes.bigstoragecagetask.entity.BigStorageCageTask;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * (BigStorageCageInOneTask)琛ㄦ湇鍔℃帴鍙�
- *
- * @author makejava
- * @since 2024-11-08 21:40:20
- */
-public interface BigStorageCageTaskService {
-
-
- List<BigStorageCageTask> queryTaskMessage(String tableName);
-
- boolean updateTaskMessage(@Param("tableName") String tableName, @Param("task") BigStorageCageTask bigStorageCageInTask);
-
- int saveTaskMessage(@Param("tableName") String tableName, List<BigStorageCageTask> taskList);
-
- int removeAll(@Param("tableName") String tableName);
-}
-
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java
index 0256f9e..32df294 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java
@@ -2,7 +2,7 @@
import com.baomidou.dynamic.datasource.annotation.DS;
import com.github.yulichang.base.MPJBaseMapper;
-import com.mes.bigstorage.entity.BigStorageDTO;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
import org.apache.ibatis.annotations.Param;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageFeedTaskService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageFeedTaskService.java
index 40e1827..6b504a9 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageFeedTaskService.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageFeedTaskService.java
@@ -1,9 +1,8 @@
package com.mes.bigstoragetask.service;
-import com.baomidou.mybatisplus.extension.service.IService;
import com.github.yulichang.base.MPJBaseService;
import com.mes.bigstorage.entity.BigStorageCageDetails;
-import com.mes.bigstorage.entity.BigStorageDTO;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
import java.util.List;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java
index 262cc3f..4493d6f 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java
@@ -3,7 +3,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.bigstorage.entity.BigStorageCageDetails;
-import com.mes.bigstorage.entity.BigStorageDTO;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper;
import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java
index 000519d..b1d148d 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java
@@ -1,5 +1,7 @@
package com.mes.edgglasstask.entity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -22,11 +24,13 @@
@EqualsAndHashCode(callSuper = false)
public class EdgGlassTaskInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+
/**
* 纾ㄨ竟浠诲姟id
*/
- private static final long serialVersionUID = 1L;
-
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
/**
* 鐜荤拑id
*/
@@ -51,29 +55,29 @@
@ApiModelProperty(value = "鍘氬害", position = 5)
private Integer thickness;
- /**
- * 鐜荤拑绫诲瀷
- */
- @ApiModelProperty(value = "鐜荤拑绫诲瀷", position = 6)
- private Integer glassType;
/**
* 鐘舵��
*/
- @ApiModelProperty(value = "鐘舵��", position = 7)
- private Integer status;
+ @ApiModelProperty(value = "鐘舵��", position = 6)
+ private Integer state;
/**
* 绾胯矾
*/
- @ApiModelProperty(value = "绾胯矾", position = 8)
+ @ApiModelProperty(value = "绾胯矾", position = 7)
private Integer line;
/**
* 绾胯矾
*/
- @ApiModelProperty(value = "鏃堕棿", position = 9)
- private Date time;
+ @ApiModelProperty(value = "寮�濮嬫椂闂�", position = 8)
+ private Date createTime;
+ /**
+ * 绾胯矾
+ */
+ @ApiModelProperty(value = "鏇存柊鏃堕棿", position = 9)
+ private Date updateTime;
@TableLogic
private int deleted;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java
index 899f474..97a7cb2 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java
@@ -3,7 +3,6 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
-import com.mes.bigstorage.service.BigStorageCageService;
import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
import com.mes.edgglasstask.mapper.EdgGlassTaskInfoMapper;
import com.mes.edgglasstask.service.EdgGlassTaskInfoService;
@@ -29,8 +28,8 @@
public int judgeTasktype(String plcFeedReqLine){
LambdaQueryWrapper<EdgGlassTaskInfo> edgGlassTaskInfoWrapper=new LambdaQueryWrapper<>();
edgGlassTaskInfoWrapper
- .eq(EdgGlassTaskInfo::getLine,plcFeedReqLine)
- .orderByDesc(EdgGlassTaskInfo::getTime);
+ .eq(EdgGlassTaskInfo::getLine, plcFeedReqLine)
+ .orderByDesc(EdgGlassTaskInfo::getCreateTime);
EdgGlassTaskInfo edgGlassTaskInfo=baseMapper.selectOne(edgGlassTaskInfoWrapper);
double width=bigStorageCageDetailsService.selectGetBoard(plcFeedReqLine);
if(edgGlassTaskInfo.getWidth()<width){
@@ -48,8 +47,8 @@
LambdaQueryWrapper<EdgGlassTaskInfo> edgGlassTaskInfoWrapper=new LambdaQueryWrapper<>();
edgGlassTaskInfoWrapper
- .eq(EdgGlassTaskInfo::getLine,1)
- .orderByDesc(EdgGlassTaskInfo::getTime);
+ .eq(EdgGlassTaskInfo::getLine, 1)
+ .orderByDesc(EdgGlassTaskInfo::getCreateTime);
List<EdgGlassTaskInfo> edgGlassTaskInfoList1=baseMapper.selectList(edgGlassTaskInfoWrapper);
int i=0;
for (EdgGlassTaskInfo edgGlassTaskInfo:edgGlassTaskInfoList1
@@ -64,8 +63,8 @@
}
edgGlassTaskInfoWrapper
- .eq(EdgGlassTaskInfo::getLine,2)
- .orderByDesc(EdgGlassTaskInfo::getTime);
+ .eq(EdgGlassTaskInfo::getLine, 2)
+ .orderByDesc(EdgGlassTaskInfo::getCreateTime);
List<EdgGlassTaskInfo> edgGlassTaskInfoList2=baseMapper.selectList(edgGlassTaskInfoWrapper);
i=0;
for (EdgGlassTaskInfo edgGlassTaskInfo:edgGlassTaskInfoList2
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
new file mode 100644
index 0000000..a1e6a58
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
@@ -0,0 +1,205 @@
+package com.mes.job;
+
+import cn.hutool.json.JSONObject;
+import cn.smallbun.screw.core.util.CollectionUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.service.BigStorageCageDetailsService;
+import com.mes.bigstorage.service.BigStorageCageService;
+import com.mes.bigstoragecagetask.entity.BigStorageCageTask;
+import com.mes.bigstoragecagetask.service.BigStorageCageTaskService;
+import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.service.GlassInfoService;
+import com.mes.temperingglass.entity.TemperingGlassInfo;
+import com.mes.temperingglass.service.TemperingGlassInfoService;
+import com.mes.tools.WebSocketServer;
+import com.mes.utils.RedisUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author SNG-015
+ */
+@Component
+@Slf4j
+public class OPCPlcSlicecage {
+
+ @Resource
+ private BigStorageCageService bigStorageCageService;
+ @Resource
+ private BigStorageCageDetailsService bigStorageCageDetailsService;
+ @Resource
+ private TemperingGlassInfoService temperingGlassInfoService;
+ @Resource
+ private RedisUtil redisUtil;
+ @Autowired
+ private GlassInfoService glassInfoService;
+ @Resource
+ private BigStorageCageTaskService bigStorageCageTaskService;
+
+ @Value("${mes.scan.ip}")
+ private String scanIp;
+
+ @Value("${mes.scan.port}")
+ private Integer scanPort;
+
+ private JSONObject jsonObject = new JSONObject();
+
+ public void queryDataSource1() throws InterruptedException {
+ List<Double> carPostion = new ArrayList<>();
+ carPostion.add(0.25);
+ carPostion.add(0.5);
+ jsonObject.append("carPostion", carPostion);
+ //鐣岄潰灞曠ず绗煎瓙淇℃伅
+ jsonObject.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail());
+
+ //杩涚墖浠诲姟鏁版嵁
+ List<BigStorageCageTask> inTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_in_one_task");
+ jsonObject.append("bigStorageCageDetailsFeedTask", inTaskList);
+
+ //鍑虹墖浠诲姟鏁版嵁
+ List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
+ jsonObject.append("bigStorageCageDetailsOutTask", outTaskList);
+
+ //鐞嗙墖绗间娇鐢ㄦ儏鍐�
+ List<Map<String, Object>> bigStorageCageUsage = bigStorageCageService.selectBigStorageCageUsage();
+ jsonObject.append("bigStorageCageUsage", bigStorageCageUsage);
+
+ //鐞嗙墖绗艰〃鏍间俊鎭�
+ jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetailAll());
+
+ //閽㈠寲寮�鍏�
+ boolean temperingSwitch = false;
+ if (redisUtil.getCacheObject("temperingSwitch") == null) {
+ redisUtil.setCacheObject("temperingSwitch", false);
+ } else {
+ temperingSwitch = redisUtil.getCacheObject("temperingSwitch");
+ }
+ jsonObject.append("temperingSwitch", temperingSwitch);
+ //鎵撳嵃寮�鍏�
+ boolean autoPrint = false;
+ if (redisUtil.getCacheObject("autoPrint") == null) {
+ redisUtil.setCacheObject("autoPrint", false);
+ } else {
+ autoPrint = redisUtil.getCacheObject("autoPrint");
+ }
+ jsonObject.append("autoPrint", autoPrint);
+
+ //褰撳墠鎸囧畾宸ョ▼
+ String temperingengineerId = "";
+ if (redisUtil.getCacheObject("temperingengineerId") == null) {
+ redisUtil.setCacheObject("temperingengineerId", temperingengineerId);
+ } else {
+ temperingengineerId = redisUtil.getCacheObject("temperingengineerId");
+ }
+ jsonObject.append("temperingengineerId", temperingengineerId);
+
+
+ }
+
+ public void queryDataSource2() throws InterruptedException {
+ //鍑虹墖闃熷垪
+ List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(
+ new LambdaQueryWrapper<TemperingGlassInfo>()
+ .inSql(TemperingGlassInfo::getEngineerId, "select distinct engineer_id from tempering_glass_info where state<4")
+ );
+ jsonObject.append("temperingGlassInfoList", temperingGlassInfoList);
+
+ }
+
+ /**
+ * fixedRate : 涓婁竴涓皟鐢ㄥ紑濮嬪悗鍐嶆璋冪敤鐨勫欢鏃讹紙涓嶇敤绛夊緟涓婁竴娆¤皟鐢ㄥ畬鎴愶級
+ * fixedDelay : 涓婁竴涓皟鐢ㄧ粨鏉熷悗鍐嶆璋冪敤鐨勫欢鏃�
+ */
+ @Scheduled(fixedDelay = 1000)
+ public void plcStorageCageTask() throws InterruptedException {
+ jsonObject = new JSONObject();
+ try {
+ //鏌ヨ浣跨敤鏁版嵁婧�1鏌ヨ鏁版嵁
+ queryDataSource1();
+ //鏌ヨ浣跨敤鏁版嵁婧�2鏌ヨ鏁版嵁
+ queryDataSource2();
+
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ if (webserver != null) {
+ webserver.sendMessage(jsonObject.toString());
+ List<String> messages = webserver.getMessages();
+ if (!messages.isEmpty()) {
+ // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
+ webserver.clearMessages();
+ }
+ } else {
+ log.info("Home is closed");
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ // @Scheduled(fixedDelay = 1000)
+ public void temperingIsRun() {
+ JSONObject jsonObject = new JSONObject();
+ //杩涚墖浠诲姟鏁版嵁
+ List<BigStorageCageDetails> bigStorageCageDetailsFeedTask = bigStorageCageDetailsService.selectFeedTask();
+ jsonObject.append("bigStorageCageDetailsFeedTask", bigStorageCageDetailsFeedTask);
+ //鍑虹墖浠诲姟鏁版嵁
+ List<BigStorageCageDetails> bigStorageCageDetailsOutTask = bigStorageCageDetailsService.selectOutTask();
+ jsonObject.append("bigStorageCageDetailsOutTask", bigStorageCageDetailsOutTask);
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ if (webserver != null) {
+ webserver.sendMessage(jsonObject.toString());
+ } else {
+ log.info("Home is closed");
+ }
+ }
+ }
+ }
+
+ // @Scheduled(fixedDelay = Long.MAX_VALUE)
+ public void scanCodeTask() {
+ log.info("鎵弿浠诲姟宸插惎鍔�");
+ while (true) {
+ JSONObject jsonObject = new JSONObject();
+ try (Socket socket = new Socket(scanIp, scanPort);
+ BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {
+ // 鎺ユ敹鏈嶅姟鍣ㄥ搷搴�
+ log.info("绛夊緟鎵爜涓�......");
+ String glassId = in.readLine();
+ log.info("鎵弿鍒扮殑鐜荤拑id锛歿}", glassId);
+ List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage");
+ if (CollectionUtils.isNotEmpty(sendwServer)) {
+ //鎸夌収鐜荤拑id鑾峰彇鐜荤拑淇℃伅杩斿洖缁欏墠绔晫闈紝鍏蜂綋闇�瑕佸摢浜涙暟鎹緟纭
+ GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
+ .eq(GlassInfo::getGlassId, glassId).last("limit 1"));
+ if (null == glassInfo) {
+ log.info("鎸夌収鐜荤拑id锛歿}锛屾棤娉曟壘鍒扮幓鐠冧俊鎭�", glassId);
+ } else {
+ for (WebSocketServer webserver : sendwServer) {
+ jsonObject.append("scanGlass", glassInfo);
+ webserver.sendMessage(jsonObject.toString());
+ }
+ }
+ }
+ } catch (Exception exception) {
+ log.info("璇诲彇寮傚父锛屽師鍥犱负{}", exception.getMessage());
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
new file mode 100644
index 0000000..d4cbd15
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -0,0 +1,745 @@
+package com.mes.job;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.github.yulichang.toolkit.JoinWrappers;
+import com.kangaroohy.milo.model.ReadWriteEntity;
+import com.kangaroohy.milo.service.MiloService;
+import com.mes.base.entity.BigStorageCageBaseInfo;
+import com.mes.bigstorage.entity.BigStorageCage;
+import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
+import com.mes.bigstorage.entity.dto.BigStorageRelationDTO;
+import com.mes.bigstorage.entity.dto.BigStorageSequenceDTO;
+import com.mes.bigstorage.entity.dto.TemperingLayoutDTO;
+import com.mes.bigstorage.service.BigStorageCageDetailsService;
+import com.mes.bigstorage.service.BigStorageCageService;
+import com.mes.bigstorage.service.BigStorageGlassInfoService;
+import com.mes.bigstorage.service.BigStorageGlassRelationInfoService;
+import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask;
+import com.mes.bigstoragecagetask.entity.BigStorageCageTask;
+import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService;
+import com.mes.bigstoragecagetask.service.BigStorageCageTaskService;
+import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO;
+import com.mes.common.config.Const;
+import com.mes.damage.entity.Damage;
+import com.mes.damage.service.DamageService;
+import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
+import com.mes.edgglasstask.service.EdgGlassTaskInfoService;
+import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.service.GlassInfoService;
+import com.mes.temperingglass.entity.TemperingGlassInfo;
+import com.mes.temperingglass.service.TemperingGlassInfoService;
+import com.mes.utils.RedisUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author SNG-015
+ */
+@Component
+@Slf4j
+public class OpcPlcStorageCageNewTask {
+ @Resource
+ private BigStorageCageDetailsService bigStorageCageDetailsService;
+ @Resource
+ private TemperingGlassInfoService temperingGlassInfoService;
+ @Resource
+ private DamageService damageService;
+ @Resource
+ private GlassInfoService glassInfoService;
+ @Resource
+ private BigStorageGlassRelationInfoService bigStorageGlassRelationInfoService;
+ @Resource
+ private BigStorageCageService bigStorageCageService;
+ @Resource
+ private BigStorageCageHistoryTaskService bigStorageCageHistoryTaskService;
+ @Resource
+ private BigStorageCageTaskService bigStorageCageTaskService;
+ @Resource
+ private BigStorageGlassInfoService bigStorageGlassInfoService;
+ @Resource
+ private EdgGlassTaskInfoService edgGlassTaskInfoService;
+
+ @Autowired(required = false)
+ MiloService miloService;
+
+ @Resource
+ private RedisUtil redisUtil;
+
+ @Value("${mes.slotWidth}")
+ private Integer slotWidth;
+
+ @Value("${mes.glassGap}")
+ private Integer glassGap;
+
+ @Value("${mes.carWidth}")
+ private Integer carWidth;
+
+ @Value("${mes.outCarMaxSize}")
+ private Integer outCarMaxSize;
+
+ @Value("${mes.temperingOutTargetPosition}")
+ private Integer temperingOutTargetPosition;
+ @Value("${mes.artificialOutTargetPosition}")
+ private Integer artificialOutTargetPosition;
+
+
+ @Scheduled(fixedDelay = 1000)
+ public void inBigStorageTask() throws Exception {
+ ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1A.DLP1A.mesControl");
+ if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
+ log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫杩涚墖浠诲姟");
+ return;
+ }
+ ReadWriteEntity requestEntity = miloService.readFromOpcUa("DLP1A.DLP1A.RequestMes");
+ if (!"1".equals(requestEntity.getValue() + "")) {
+ log.info("褰撳墠鏈敹鍒拌繘鐗囪姹傦紝缁撴潫杩涚墖浠诲姟");
+ return;
+ }
+ ReadWriteEntity mesReplyEntity = miloService.readFromOpcUa("DLP1A.DLP1A.MesReply");
+ if ("1".equals(mesReplyEntity.getValue() + "")) {
+ log.info("鏈夋鍦ㄦ墽琛岀殑浠诲姟锛岀粨鏉熻繘鐗囦换鍔�");
+ return;
+ }
+ //鑾峰彇杩涚墖浠诲姟淇℃伅
+ List<BigStorageCageTask> inTaskList = new ArrayList();
+ ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP1A.DLP1A.FROM1");
+ List<String> glassIdList = new ArrayList<>();
+ for (int i = 1; i <= 6; i++) {
+ ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP1A.DLP1A.DI" + i);
+ if (null != requestWord.getValue()) {
+ BigStorageCageTask task = new BigStorageCageTask();
+ task.setGlassId(requestWord.getValue() + "");
+ task.setStartSlot(Integer.parseInt(fromOpcUa.getValue() + ""));
+ inTaskList.add(task);
+ glassIdList.add(requestWord.getValue() + "");
+ continue;
+ }
+ }
+ if (CollectionUtil.isEmpty(inTaskList)) {
+ log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫杩涚墖浠诲姟");
+ return;
+ }
+ log.info("鑾峰彇浠诲姟鐨勭幓鐠僫d锛歿}", glassIdList);
+ Map<String, Long> glassCountMap = glassIdList.stream().collect(Collectors.groupingBy(e -> e, Collectors.counting()));
+ for (Map.Entry<String, Long> entry : glassCountMap.entrySet()) {
+ if (entry.getValue() > 1) {
+ log.info("杩涚墖鐜荤拑{}瀛樺湪鐩稿悓锛岀粨鏉熸湰娆′换鍔�", entry.getKey());
+ //todo:鍚憄lc鍙戦�佹姤璀�
+ return;
+ }
+ }
+ List<BigStorageCageDetails> detailsList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>().in(BigStorageCageDetails::getGlassId, glassIdList)
+ .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
+ if (CollectionUtil.isNotEmpty(detailsList)) {
+ log.info("鐞嗙墖绗煎瓨鍦ㄧ浉鍚岀殑杩涚墖鐜荤拑{}锛岀粨鏉熸湰娆′换鍔�", detailsList);
+ //todo:鍚憄lc鍙戦�佹姤璀�
+ return;
+ }
+ List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIdList));
+
+ if (glassInfoList.size() != inTaskList.size()) {
+ log.info("杩涚墖浠诲姟鏁伴噺{}涓庣幓鐠冩暟閲弡}涓嶅尮閰嶏紝缁撴潫鏈杩涚墖", inTaskList.size(), glassInfoList.size());
+ //todo:鍚憄lc鍙戦�佹姤璀�
+ return;
+ }
+ //淇敼纾ㄨ竟瀵瑰垪琛ㄧ殑鐜荤拑鐘舵��
+ edgGlassTaskInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskInfo>()
+ .set(EdgGlassTaskInfo::getState, Const.EDG_GLASS_SUCCESS).in(EdgGlassTaskInfo::getGlassId, glassIdList));
+ Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId));
+ //璁$畻鐩爣鏍煎瓙
+ List<BigStorageCageHistoryTask> historyTasks = new ArrayList<>();
+ for (BigStorageCageTask task : inTaskList) {
+ GlassInfo info = glassListMap.get(task.getGlassId()).get(0);
+ BigStorageDTO bigStorageDTO = bigStorageGlassInfoService.queryBigStorageTargetSlot(info.getEngineerId(), info.getTemperingLayoutId(), info.getTemperingFeedSequence());
+ //鑾峰彇鐩爣鏍煎瓙淇℃伅
+// BigStorageDTO bigStorageDTO = bigStorageCageDetailsService.queryTargetSlotByTempering(info);
+// 涓存椂鏇存柊鏍煎瓙鐨勫墿浣欏昂瀵革細闃叉鐩搁偦鐜荤拑杩涘悓涓�鏍煎瓙閫犳垚鍓╀綑灏哄涓嶈冻锛岀幓鐠冭秺鐣岀殑鎯呭喌锛屼换鍔″畬鎴愬悗鍐嶆鏇存柊澶х悊鐗囩琛ㄥ墿浣欏搴︼紙鎸夌収绗煎唴鐜荤拑鏁伴噺鏇存柊澶х悊鐗囩鍓╀綑灏哄锛�
+ bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>()
+ .set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap)
+ .eq(BigStorageCage::getSlot, bigStorageDTO.getSlot()));
+ task.setTargetSlot(bigStorageDTO.getSlot());
+ task.setGlassId(info.getGlassId());
+ bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", task);
+ //瀛樻斁鍘嗗彶浠诲姟
+ BigStorageCageHistoryTask historyTask = new BigStorageCageHistoryTask();
+ BeanUtils.copyProperties(task, historyTask);
+ historyTask.setTaskType(Const.BIG_STORAGE_BEFORE_IN);
+ historyTask.setGlassCount(glassInfoList.size());
+ historyTask.setTaskState(Const.ENGINEERING_NEW);
+ historyTasks.add(historyTask);
+ BigStorageCageDetails cageDetails = new BigStorageCageDetails();
+ BeanUtils.copyProperties(info, cageDetails);
+ cageDetails.setSlot(bigStorageDTO.getSlot());
+ cageDetails.setState(Const.GLASS_STATE_NEW);
+ cageDetails.setDeviceId(bigStorageDTO.getDeviceId());
+ cageDetails.setSequence(bigStorageDTO.getSlotSequence());
+ cageDetails.setGap(glassGap);
+ cageDetails.setId(null);
+ bigStorageCageDetailsService.save(cageDetails);
+ }
+ //鍘嗗彶鏁版嵁鍏ュ簱
+ bigStorageCageHistoryTaskService.saveBatch(historyTasks);
+ //鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
+ List<ReadWriteEntity> list = new ArrayList<>();
+ for (int i = 1; i <= inTaskList.size(); i++) {
+ list.add(generateReadWriteEntity("DLP1A.DLP1A.TO" + i, inTaskList.get(i - 1).getTargetSlot()));
+ }
+ list.add(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 1));
+ miloService.writeToOpcWord(list);
+ }
+
+ @Scheduled(fixedDelay = 1000)
+ public void outBigStorageTask() throws Exception {
+ Date startDate = new Date();
+ ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1B.DLP1B.mesControl");
+ if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
+ log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫杩涚墖浠诲姟");
+ return;
+ }
+ ReadWriteEntity requestEntity = miloService.readFromOpcUa("DLP1B.DLP1B.RequestMes");
+ if (!"1".equals(requestEntity.getValue() + "")) {
+ log.info("褰撳墠鏈敹鍒板嚭鐗囪姹傦紝缁撴潫鍑虹墖浠诲姟");
+ return;
+ }
+ //鑾峰彇鍑虹墖浠诲姟琛�
+ List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
+ if (CollectionUtil.isNotEmpty(outTaskList)) {
+ log.info("鏈夋鍦ㄦ墽琛岀殑鍑虹墖浠诲姟锛岀粨鏉熸湰娆″嚭鐗囦换鍔�");
+ return;
+ }
+ //鏄惁鍏佽閽㈠寲
+ //鏄惁鏈夋鍦ㄩ挗鍖栫殑鐜荤拑:閽㈠寲灏忕墖琛ㄥ叧鑱斿巻鍙蹭换鍔¤〃锛岀瓫閫夋湭鍑虹鐨勭幓鐠冧俊鎭�
+// 鑾峰彇褰撳墠閽㈠寲浠诲姟鏈畬鎴愬嚭鐗囩殑鐜荤拑淇℃伅
+ List<TemperingGlassInfo> unFinishTemperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>()
+ .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW).orderByAsc(TemperingGlassInfo::getTemperingFeedSequence));
+ if (CollectionUtil.isNotEmpty(unFinishTemperingGlassInfoList)) {
+// List<String> glassIdList = unFinishTemperingGlassInfoList.stream().map(TemperingGlassInfo::getGlassId).collect(Collectors.toList());
+// List<BigStorageCageHistoryTask> historyTaskList = bigStorageCageHistoryTaskService.list(new LambdaQueryWrapper<BigStorageCageHistoryTask>()
+// .eq(BigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_BEFORE_OUT)
+// .in(BigStorageCageHistoryTask::getGlassId, glassIdList));
+// List<TemperingGlassInfo> temperingGlassList = unFinishTemperingGlassInfoList;
+// if (CollectionUtil.isNotEmpty(historyTaskList)) {
+// List<String> taskGlassList = historyTaskList.stream().map(BigStorageCageHistoryTask::getGlassId).collect(Collectors.toList());
+// temperingGlassList = unFinishTemperingGlassInfoList.stream().filter(e -> !taskGlassList.contains(e.getGlassId())).collect(Collectors.toList());
+// }
+// if (CollectionUtil.isNotEmpty(unFinishTemperingGlassInfoList)) {
+ log.info("鏈夋鍦ㄥ嚭鐗囩殑閽㈠寲浠诲姟");
+ computeOutGlassInfoByVirtualSlot(unFinishTemperingGlassInfoList, "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
+ Date endDate = new Date();
+ log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
+ return;
+ }
+
+ if (redisUtil.getCacheObject("temperingSwitch")) {
+ //閽㈠寲浼樺厛锛氳幏鍙栫悊鐗囩 鐜荤拑灏忕墖 鐮存崯琛� 鏁伴噺 鍒ゆ柇绗煎唴鐗堝浘鏄惁鍒伴綈
+ List<TemperingLayoutDTO> temperingLayoutDTOList = bigStorageCageDetailsService.temperingIsAll();
+ if (CollectionUtil.isNotEmpty(temperingLayoutDTOList)) {
+ //鐜荤拑鍒伴綈鍖呮嫭宸插嚭鐗囩殑
+ //鍒伴綈锛屽皢鐜荤拑灏忕墖鏁版嵁瀛樺叆閽㈠寲灏忕墖琛紝閫昏緫鐢熸垚鍑虹墖浠诲姟 缁撴潫
+ for (TemperingLayoutDTO item : temperingLayoutDTOList) {
+// if (item.getEngineerId().equals(redisUtil.getCacheObject("temperingengineerId"))) {
+ List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class)
+ .selectAll(GlassInfo.class)
+ .select("-1 as state")
+ .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot)
+ .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId)
+ .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
+ .eq(GlassInfo::getTemperingLayoutId, item.getTemperingLayoutId())
+ .eq(GlassInfo::getEngineerId, item.getEngineerId())
+ .orderByAsc(GlassInfo::getTemperingFeedSequence));
+ if (CollectionUtil.isNotEmpty(temperingGlassInfos)) {
+ temperingGlassInfoService.saveBatch(temperingGlassInfos);
+ computeOutGlassInfoByVirtualSlot(temperingGlassInfos, "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
+ Date endDate = new Date();
+ log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
+ return;
+ }
+// }
+ }
+ }
+ }
+ //鏄惁鏈変汉宸ヤ笅鐗囦换鍔� 鏈夌洿鎺ュ嚭
+ List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL)
+ .orderByAsc(BigStorageCageDetails::getSlot)
+ .orderByAsc(BigStorageCageDetails::getId).last("limit " + outCarMaxSize));
+ if (CollectionUtil.isNotEmpty(artificialList)) {
+ computeOutGlassInfoByVirtualSlot(artificialList, "big_storage_cage_out_one_task", artificialOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
+ Date endDate = new Date();
+ log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
+ return;
+ }
+ //鏄惁瀛樺湪闇�瑕佸唴閮ㄨ皟搴︾殑鏍煎瓙:鎵ц鍐呴儴璋冨害浠诲姟
+ if (redisUtil.getCacheObject("dispatchSwitch")) {
+ //todo:鑾峰彇绗煎唴鍗曟牸宸茬粡鍒伴綈鐨勭幓鐠冩牸瀛愪俊鎭�
+ List<BigStorageRelationDTO> virtualList = bigStorageCageDetailsService.queryIsAllNeedDispatchVirtualSlot();
+ if (CollectionUtil.isEmpty(virtualList)) {
+ log.info("娌℃湁闇�瑕佽皟搴︾殑鏍煎瓙");
+ return;
+ }
+ List<BigStorageCageDetails> list = new ArrayList<>();
+ loop:
+ for (BigStorageRelationDTO dto : virtualList) {
+ List<BigStorageSequenceDTO> sequenceDTOList = bigStorageCageDetailsService.dispatchBigStorageGlassInfo(dto);
+ if (CollectionUtil.isEmpty(sequenceDTOList) || sequenceDTOList.size() == 1) {
+ continue;
+ }
+ int sequence = -1;
+ int startSlot = -1;
+ for (BigStorageSequenceDTO item : sequenceDTOList) {
+ if (item.getMinSequence() == sequence + 1) {
+ //鐢熸垚璋冨害浠诲姟
+ int targetSlot = item.getSlot();
+ list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN).eq(BigStorageCageDetails::getSlot, startSlot));
+ computeOutGlassInfoByVirtualSlot(list, "big_storage_cage_out_one_task", targetSlot, Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH);
+ List<Integer> slotList = new ArrayList<>();
+ slotList.add(targetSlot);
+ updateSlotRemainBySlots(slotList);
+ break loop;
+ }
+ sequence = item.getMaxSequence();
+ startSlot = item.getSlot();
+ }
+ }
+ }
+ Date endDate = new Date();
+ log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
+ return;
+ }
+
+ @Scheduled(fixedDelay = 1000)
+ public void finishInBigStorageTask() throws Exception {
+ ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1A.DLP1A.mesControl");
+ if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
+ log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫瀹屾垚杩涚墖浠诲姟");
+ return;
+ }
+ //鑾峰彇杩涚墖浠诲姟琛�
+// List<BigStorageCageTask> inTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_in_one_task");
+ List<BigStorageCageTask> inTaskList = new ArrayList();
+
+ List<String> glassIdList = new ArrayList<>();
+ ReadWriteEntity toWord = miloService.readFromOpcUa("DLP1A.DLP1A.TO1");
+ if ("0".equals(toWord.getValue() + "")) {
+ log.info("瀹屾垚浠诲姟宸叉墽琛岋紝缁撴潫鏈瀹屾垚杩涚墖浠诲姟");
+ return;
+ }
+ for (int i = 1; i <= 6; i++) {
+ ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP1A.DLP1A.DI" + i);
+ ReadWriteEntity statetWord = miloService.readFromOpcUa("DLP1A.DLP1A.STATE" + i);
+ ReadWriteEntity toOpcUa = miloService.readFromOpcUa("DLP1A.DLP1A.TO" + i);
+ ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP1A.DLP1A.FROM" + i);
+
+ if (null != requestWord.getValue()) {
+ BigStorageCageTask task = new BigStorageCageTask();
+ task.setGlassId(requestWord.getValue() + "");
+ task.setTargetSlot(Integer.parseInt(toOpcUa.getValue() + ""));
+ task.setTaskState(Integer.parseInt(statetWord.getValue() + ""));
+ task.setStartSlot(Integer.parseInt(fromOpcUa.getValue() + ""));
+ inTaskList.add(task);
+ glassIdList.add(requestWord.getValue() + "");
+ continue;
+ }
+ }
+ if (CollectionUtil.isEmpty(inTaskList)) {
+ log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫瀹屾垚杩涚墖浠诲姟");
+ return;
+ }
+ List<BigStorageCageTask> unFinishTaskList = inTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList());
+ if (CollectionUtil.isNotEmpty(unFinishTaskList)) {
+ log.info("瀛樺湪鏈畬鎴愮殑鐜荤拑淇℃伅,鐜荤拑锛歿}", unFinishTaskList);
+ return;
+ }
+ Map<Integer, List<BigStorageCageTask>> taskMap = inTaskList.stream().collect(Collectors.groupingBy(BigStorageCageTask::getTaskState));
+ //鎸夌収浠诲姟鐘舵�佷慨鏀瑰ぇ鐞嗙墖绗煎唴鐨勭幓鐠冩暟鎹�
+// 閲嶆柊璁$畻澶х悊鐗囩鍐呯殑鍓╀綑灏哄
+ taskMap.forEach((e1, v) -> {
+ if (e1 == 2) {
+ //杩涚墖瀹屾垚
+ log.info("3銆佽幏鍙栬繘鐗囧凡瀹屾垚鐨勭幓鐠冧俊鎭痠d:{}", v);
+ List<Integer> inSuccessGlassSlot = v.stream().map(BigStorageCageTask::getTargetSlot).collect(Collectors.toList());
+ List<UpdateBigStorageCageDTO> storageCageDTOList = v.stream().map(e -> {
+ UpdateBigStorageCageDTO storageCageDTO = new UpdateBigStorageCageDTO();
+ BeanUtils.copyProperties(e, storageCageDTO);
+ return storageCageDTO;
+ }).collect(Collectors.toList());
+ bigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_IN);
+ log.info("4銆佸ぇ鐞嗙墖绗艰繘鐗囩姸鎬佸凡瀹屾垚宸插畬鎴愮殑鐜荤拑淇℃伅id:{}", v);
+ updateSlotRemainBySlots(inSuccessGlassSlot);
+ } else if (e1 == 3) {
+ //鐮存崯澶勭悊
+ dealDamageInTask(v);
+ } else {
+ //娓呯┖鐞嗙墖绗肩┖鏁版嵁
+ noDealInTask(v);
+ }
+ });
+ for (BigStorageCageTask item : inTaskList) {
+ //鏇存柊鍘嗗彶浠诲姟琛ㄤ腑鐨勪换鍔$姸鎬�
+ bigStorageCageHistoryTaskService.update(new LambdaUpdateWrapper<BigStorageCageHistoryTask>()
+ .set(BigStorageCageHistoryTask::getTaskState, item.getTaskState())
+ .eq(BigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_BEFORE_IN)
+ .eq(BigStorageCageHistoryTask::getTargetSlot, item.getTargetSlot())
+ .eq(BigStorageCageHistoryTask::getGlassId, item.getGlassId()));
+ item.setTargetSlot(0);
+ //娓呯┖浠诲姟琛ㄦ暟鎹�
+ bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", item);
+ }
+ //娓呯┖鍚姩鐘舵��
+ //鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
+ //鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
+ List<ReadWriteEntity> list = new ArrayList<>();
+ for (int i = 1; i <= 6; i++) {
+ list.add(generateReadWriteEntity("DLP1A.DLP1A.TO" + i, 0));
+ }
+ list.add(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 0));
+ miloService.writeToOpcWord(list);
+ }
+
+ @Scheduled(fixedDelay = 1000)
+ public void finishOutBigStorageTask() throws Exception {
+ ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1B.DLP1B.mesControl");
+ if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
+ log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫瀹屾垚鍑虹墖浠诲姟");
+ return;
+ }
+ //鑾峰彇杩涚墖浠诲姟琛�
+ List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
+ if (CollectionUtil.isEmpty(outTaskList)) {
+ log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫瀹屾垚杩涚墖浠诲姟");
+ return;
+ }
+ List<BigStorageCageTask> unFinishTaskList = outTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList());
+ if (CollectionUtil.isNotEmpty(unFinishTaskList)) {
+ log.info("瀛樺湪鏈畬鎴愮殑鐜荤拑淇℃伅,鐜荤拑锛歿}", unFinishTaskList);
+ return;
+ }
+ Map<Integer, List<BigStorageCageTask>> taskMap = outTaskList.stream().collect(Collectors.groupingBy(BigStorageCageTask::getTaskState));
+ int taskType = 0;
+ if (Const.OUT_TARGET_POSITION_ALL.contains(outTaskList.get(0).getTargetSlot())) {
+ taskType = Const.BIG_STORAGE_BEFORE_OUT;
+ } else {
+ taskType = Const.BIG_STORAGE_BEFORE_DISPATCH;
+ }
+ //鎸夌収浠诲姟鐘舵�佷慨鏀瑰ぇ鐞嗙墖绗煎唴鐨勭幓鐠冩暟鎹�
+// 閲嶆柊璁$畻澶х悊鐗囩鍐呯殑鍓╀綑灏哄
+ Integer finalTaskType = taskType;
+ taskMap.forEach((e1, v) -> {
+ if (e1 == 2) {
+ //杩涚墖瀹屾垚
+ log.info("3銆佽幏鍙栬繘鐗囧凡瀹屾垚鐨勭幓鐠冧俊鎭痠d:{}", v);
+ List<Integer> outSuccessGlassSlot = new ArrayList<>();
+ if (finalTaskType.equals(Const.BIG_STORAGE_BEFORE_OUT)) {
+ outSuccessGlassSlot = v.stream().map(BigStorageCageTask::getStartSlot).collect(Collectors.toList());
+ } else {
+ List<Integer> targetSuccessGlassSlot = v.stream().map(BigStorageCageTask::getTargetSlot).collect(Collectors.toList());
+ List<Integer> startoutSuccessGlassSlot = v.stream().map(BigStorageCageTask::getStartSlot).collect(Collectors.toList());
+ outSuccessGlassSlot.addAll(targetSuccessGlassSlot);
+ outSuccessGlassSlot.addAll(startoutSuccessGlassSlot);
+ }
+ List<UpdateBigStorageCageDTO> storageCageDTOList = v.stream().map(e -> {
+ UpdateBigStorageCageDTO storageCageDTO = new UpdateBigStorageCageDTO();
+ storageCageDTO.setGlassId(e.getGlassId());
+ if (finalTaskType.equals(Const.BIG_STORAGE_BEFORE_OUT)) {
+ storageCageDTO.setTargetSlot(e.getStartSlot());
+ } else {
+ storageCageDTO.setTargetSlot(e.getTargetSlot());
+ }
+ return storageCageDTO;
+ }).collect(Collectors.toList());
+ if (finalTaskType.equals(Const.BIG_STORAGE_BEFORE_OUT)) {
+ bigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_OUT);
+ } else {
+ bigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_IN);
+ }
+ log.info("4銆佸ぇ鐞嗙墖绗艰繘鐗囩姸鎬佸凡瀹屾垚宸插畬鎴愮殑鐜荤拑淇℃伅id:{}", v);
+ updateSlotRemainBySlots(outSuccessGlassSlot);
+ } else if (e1 == 3) {
+ //鐮存崯澶勭悊
+ dealDamageOutTask(v);
+ } else {
+ //娓呯┖鐞嗙墖绗肩┖鏁版嵁
+ noDealOutTask(v);
+ }
+ });
+ for (BigStorageCageTask item : outTaskList) {
+ //鏇存柊鍘嗗彶浠诲姟琛ㄤ腑鐨勪换鍔$姸鎬�
+ bigStorageCageHistoryTaskService.update(new LambdaUpdateWrapper<BigStorageCageHistoryTask>()
+ .set(BigStorageCageHistoryTask::getTaskState, item.getTaskState())
+ .eq(BigStorageCageHistoryTask::getTaskType, taskType)
+ .eq(BigStorageCageHistoryTask::getGlassId, item.getGlassId()));
+ //鏇存柊閽㈠寲灏忕墖琛�
+ Integer taskState = item.getTaskState();
+ if (taskState == 2) {
+ temperingGlassInfoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>()
+ .set(TemperingGlassInfo::getState, Const.TEMPERING_OUT).eq(TemperingGlassInfo::getGlassId, item.getGlassId()));
+ } else if (taskState == 3) {
+// temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().eq(TemperingGlassInfo::getGlassId, item.getGlassId()));
+ temperingGlassInfoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>()
+ .set(TemperingGlassInfo::getState, Const.TEMPERING_DAMAGE
+ ).eq(TemperingGlassInfo::getGlassId, item.getGlassId()));
+
+ } else {
+// 绌烘墽琛�
+ }
+ }
+// 閲嶇疆浠诲姟琛ㄦ暟鎹�
+ bigStorageCageTaskService.updateOutTaskMessage("big_storage_cage_out_one_task");
+ //娓呯┖鍚姩鐘舵��
+ //鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
+ miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 0));
+ }
+
+ private void dealDamageInTask(List<BigStorageCageTask> damageTaskList) {
+// 鑾峰彇杩涚墖浠诲姟琛ㄤ腑鐘舵�佷负鐮存崯鐨勬暟鎹�
+ log.info("鐮存崯鐨勭幓鐠冧俊鎭湁锛歿}", damageTaskList);
+ //绉婚櫎鐞嗙墖绗艰鎯呰〃浠诲姟鎵ц杩囩▼涓牬鎹熺殑鐜荤拑
+ bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW)
+ .in(BigStorageCageDetails::getGlassId, damageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList())));
+ //灏嗙牬鎹熶俊鎭柊澧炲叆鐮存崯琛�
+ List<Integer> slotList = new ArrayList<>();
+ for (BigStorageCageTask item : damageTaskList) {
+ Damage damage = new Damage();
+ damage.setGlassId(item.getGlassId());
+ damage.setLine(item.getStartSlot());
+ damage.setWorkingProcedure("纾ㄨ竟");
+ damage.setRemark("杩涚鍓嶅崸杞珛");
+ damage.setStatus(1);
+ damage.setType(item.getTaskState());
+ damageService.insertDamage(damage);
+ slotList.add(item.getTargetSlot());
+ }
+ //鏇存柊鏍煎瓙鍓╀綑瀹藉害
+ updateSlotRemainBySlots(slotList);
+ log.info("杩涚墖浠诲姟-鐮存崯浠诲姟鎵ц瀹屾垚");
+ }
+
+ private void dealDamageOutTask(List<BigStorageCageTask> damageTaskList) {
+// 鑾峰彇杩涚墖浠诲姟琛ㄤ腑鐘舵�佷负鐮存崯鐨勬暟鎹�
+ log.info("鐮存崯鐨勭幓鐠冧俊鎭湁锛歿}", damageTaskList);
+ //绉婚櫎鐞嗙墖绗艰鎯呰〃浠诲姟鎵ц杩囩▼涓牬鎹熺殑鐜荤拑
+ bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)
+ .in(BigStorageCageDetails::getGlassId, damageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList())));
+ //灏嗙牬鎹熶俊鎭柊澧炲叆鐮存崯琛�
+ List<Integer> slotList = new ArrayList<>();
+ for (BigStorageCageTask item : damageTaskList) {
+ Damage damage = new Damage();
+ damage.setGlassId(item.getGlassId());
+ damage.setLine(item.getStartSlot());
+ damage.setWorkingProcedure("閽㈠寲鍓�");
+ damage.setRemark("杩涚鍚庡崸杞珛");
+ damage.setStatus(1);
+ damage.setType(item.getTaskState());
+ damageService.insertDamage(damage);
+ slotList.add(item.getTargetSlot());
+ slotList.add(item.getStartSlot());
+ }
+ //鏇存柊鏍煎瓙鍓╀綑瀹藉害
+ updateSlotRemainBySlots(slotList);
+ log.info("鍑虹墖浠诲姟-鐮存崯浠诲姟鎵ц瀹屾垚");
+ }
+
+ private void noDealInTask(List<BigStorageCageTask> noDealTaskList) {
+// 鑾峰彇杩涚墖浠诲姟琛ㄤ腑鐘舵�佷负鐮存崯鐨勬暟鎹�
+ log.info("鐮存崯鐨勭幓鐠冧俊鎭湁锛歿}", noDealTaskList);
+ //绉婚櫎鐞嗙墖绗艰鎯呰〃鏈墽琛屼换鍔$殑绌鸿褰曚俊鎭�
+ bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW)
+ .in(BigStorageCageDetails::getGlassId, noDealTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList())));
+ //璁板綍鏍煎瓙鍙凤紝鎸夋牸瀛愬彿鏇存柊鍓╀綑灏哄
+ List<Integer> slotList = new ArrayList<>();
+ for (BigStorageCageTask item : noDealTaskList) {
+ slotList.add(item.getTargetSlot());
+ slotList.add(item.getStartSlot());
+ }
+ //鏇存柊鏍煎瓙鍓╀綑瀹藉害
+ updateSlotRemainBySlots(slotList);
+ log.info("杩涚墖浠诲姟-鏃犲姩浣滄墽琛屽畬鎴�");
+ }
+
+ private void noDealOutTask(List<BigStorageCageTask> noDealTaskList) {
+// 鑾峰彇杩涚墖浠诲姟琛ㄤ腑鐘舵�佷负鐮存崯鐨勬暟鎹�
+ log.info("鐮存崯鐨勭幓鐠冧俊鎭湁锛歿}", noDealTaskList);
+ if (Const.OUT_TARGET_POSITION_ALL.contains(noDealTaskList.get(0).getTargetSlot())) {
+ //鍑虹墖浠诲姟:灏嗗嚭鐗囦腑鐘舵�佹仮澶嶄负鍦ㄧ鍐�
+ List<String> glassList = noDealTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList());
+ bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>()
+ .set(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
+ .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
+ .in(BigStorageCageDetails::getGlassId, glassList));
+
+ } else {
+ //璋冨害浠诲姟锛氬皢璋冨害涓姸鎬佹敼涓哄湪绗煎唴锛屾牸瀛愬彿鎭㈠涓鸿皟搴﹀墠鐨勬牸瀛�
+ for (BigStorageCageTask item : noDealTaskList) {
+ bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>()
+ .set(BigStorageCageDetails::getSlot, item.getStartSlot())
+ .set(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
+ .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
+ .eq(BigStorageCageDetails::getGlassId, item.getGlassId()));
+ }
+ }
+ //灏嗙牬鎹熶俊鎭柊澧炲叆鐮存崯琛�
+ List<Integer> slotList = new ArrayList<>();
+ for (BigStorageCageTask item : noDealTaskList) {
+ slotList.add(item.getTargetSlot());
+ slotList.add(item.getStartSlot());
+ }
+ //鏇存柊鏍煎瓙鍓╀綑瀹藉害
+ updateSlotRemainBySlots(slotList);
+ log.info("鍑虹墖浠诲姟-鏃犲姩浣滄墽琛屽畬鎴�");
+ }
+
+ /**
+ * 鍑虹墖涓�娆′粎鐢熸垚涓�杞︾幓鐠�
+ *
+ * @param list
+ * @param <T>
+ * @return
+ */
+ private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfoByVirtualSlot(List<T> list, String tableName, int targetSlot, int state, int taskType) {
+ //浠诲姟鏁版嵁:鑾峰彇杞﹀瓙瀛樻斁鐜荤拑鏈�澶ф暟閲�,鐜荤拑闂撮殧
+ List<String> glassIdList = bigStorageGlassRelationInfoService.queryNeedOutGlassId(
+ list.get(0).getEngineerId(), list.get(0).getTemperingLayoutId(), list.get(0).getTemperingFeedSequence());
+ List<T> outGlassList = list.stream().filter(e -> glassIdList.contains(e.getGlassId())).collect(Collectors.toList());
+ Assert.isFalse(CollectionUtil.isEmpty(outGlassList), "鏈幏鍙栧嚭鐗囨暟鎹紝缁撴潫鍑虹墖浠诲姟");
+ log.info("鑾峰彇鍑虹墖浠诲姟鏁版嵁{}鏉★紝鎵ц淇濆瓨", outGlassList.size());
+ List<BigStorageCageTask> bigStorageCageTaskList = outGlassList.stream()
+ .map(e -> new BigStorageCageTask(e.getGlassId(), e.getSlot(), targetSlot, 0)).collect(Collectors.toList());
+
+ List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList());
+ int glassCount = bigStorageCageTaskList.size();
+ //鐢熸垚鍑虹墖浠诲姟鏉℃暟涓嶈冻6琛ュ叏
+ while (bigStorageCageTaskList.size() < 6) {
+ bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0));
+ }
+ //娓呯┖浠诲姟琛ㄦ暟鎹�
+ bigStorageCageTaskService.removeAll("big_storage_cage_out_one_task");
+ bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList);
+ List<BigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> {
+ BigStorageCageHistoryTask history = new BigStorageCageHistoryTask();
+ BeanUtils.copyProperties(e, history);
+ history.setGlassCount(glassCount);
+ history.setTaskType(taskType);
+ return history;
+ }).collect(Collectors.toList());
+ bigStorageCageHistoryTaskService.saveBatch(historyList);
+
+ log.info("灏嗗嚭鐗囩幓鐠儃}鐜荤拑鐘舵�佹敼涓哄嚭鐗囦腑", glassIds);
+ bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>()
+ .set(BigStorageCageDetails::getState, state)
+ .set(Const.BIG_STORAGE_BEFORE_DISPATCH.equals(taskType), BigStorageCageBaseInfo::getSlot, targetSlot)
+ .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
+ .in(BigStorageCageDetails::getGlassId, glassIds));
+ try {
+ miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 1));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return Boolean.TRUE;
+ }
+
+ // /**
+// * 鍑虹墖涓�娆′粎鐢熸垚涓�杞︾幓鐠�
+// *
+// * @param list
+// * @param <T>
+// * @return
+// */
+ private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, String tableName, int targetSlot, int state, int taskType) {
+ //浠诲姟鏁版嵁:鑾峰彇杞﹀瓙瀛樻斁鐜荤拑鏈�澶ф暟閲�,鐜荤拑闂撮殧
+ List<BigStorageCageTask> bigStorageCageTaskList = new ArrayList<>();
+ //鎵撹溅鍓╀綑灏哄
+ Integer remainWidth = carWidth;
+ for (T e : list) {
+ if (bigStorageCageTaskList.size() >= outCarMaxSize || Math.max((int) e.getWidth(), (int) e.getHeight()) > remainWidth) {
+ break;
+ }
+ //璁$畻褰撳墠鍑虹墖杞﹀墿灏哄
+ remainWidth = remainWidth - Math.max((int) e.getWidth(), (int) e.getHeight()) - glassGap;
+ bigStorageCageTaskList.add(new BigStorageCageTask(e.getGlassId(), e.getSlot(), targetSlot,
+ 0));
+ }
+ Assert.isFalse(CollectionUtil.isEmpty(bigStorageCageTaskList), "鏈幏鍙栧嚭鐗囨暟鎹紝缁撴潫鍑虹墖浠诲姟");
+ log.info("鑾峰彇鍑虹墖浠诲姟鏁版嵁{}鏉★紝鎵ц淇濆瓨", bigStorageCageTaskList.size());
+ List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList());
+ int glassCount = bigStorageCageTaskList.size();
+ //鐢熸垚鍑虹墖浠诲姟鏉℃暟涓嶈冻6琛ュ叏
+ while (bigStorageCageTaskList.size() < 6) {
+ bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0));
+ }
+ //娓呯┖浠诲姟琛ㄦ暟鎹�
+ bigStorageCageTaskService.removeAll("big_storage_cage_out_one_task");
+ bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList);
+ List<BigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> {
+ BigStorageCageHistoryTask history = new BigStorageCageHistoryTask();
+ BeanUtils.copyProperties(e, history);
+ history.setGlassCount(glassCount);
+ history.setTaskType(taskType);
+ return history;
+ }).collect(Collectors.toList());
+ bigStorageCageHistoryTaskService.saveBatch(historyList);
+
+ log.info("灏嗗嚭鐗囩幓鐠儃}鐜荤拑鐘舵�佹敼涓哄嚭鐗囦腑", glassIds);
+ bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>()
+ .set(BigStorageCageDetails::getState, state)
+ .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
+ .set(Const.GLASS_STATE_SCHEDULE_ING.equals(state), BigStorageCageBaseInfo::getSlot, targetSlot)
+ .in(BigStorageCageDetails::getGlassId, glassIds));
+ try {
+ miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 1));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return Boolean.TRUE;
+ }
+
+
+ public void updateSlotRemainBySlots(List<Integer> slotList) {
+ //鑾峰彇鏍煎瓙鍐呮墍鏈夌殑鐜荤拑淇℃伅
+ List<BigStorageCageDetails> inSlotGlassList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .in(BigStorageCageDetails::getSlot, slotList).in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
+ Map<Integer, Double> slotRemainMap = new HashMap<>();
+ //鏄惁瀛樺湪鏈夋牸瀛愰潪绌虹殑鐜荤拑
+ if (CollectionUtil.isNotEmpty(inSlotGlassList)) {
+ //瀛樺湪 灏嗘牸瀛愬唴鐨勭幓鐠冨垎鍒繘琛屾洿鏂�
+ slotRemainMap = inSlotGlassList.stream()
+ .collect(Collectors.groupingBy(BigStorageCageDetails::getSlot, Collectors.summingDouble(item -> Math.max(item.getWidth(), item.getHeight()) + glassGap)));
+ slotRemainMap.forEach((e, v) -> {
+ double remainWidth = slotWidth - v >= 0 ? slotWidth - v : 0;
+ bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, remainWidth)
+ .eq(BigStorageCage::getSlot, e));
+ });
+ }
+ //杩囨护涓嶅瓨鍦ㄧ幓鐠冪殑鏍煎瓙 灏嗗搴﹂噸缃负鍘熷瀹藉害5000
+ Set<Integer> remainSlotList = slotRemainMap.keySet();
+ slotList.removeAll(remainSlotList);
+ if (CollectionUtil.isNotEmpty(slotList)) {
+ bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, slotWidth)
+ .in(BigStorageCage::getSlot, slotList));
+ }
+ }
+
+ private ReadWriteEntity generateReadWriteEntity(String identifier, Object value) {
+ return ReadWriteEntity.builder()
+ .identifier(identifier)
+ //Kep涓槸Long绫诲瀷锛屽嵆锛欼nt32锛孞ava涓殑int绫诲瀷
+ .value(value)
+ .build();
+ }
+}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageTask.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageTask.java
index 000af98..865eb34 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageTask.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageTask.java
@@ -1,17 +1,16 @@
package com.mes.job;
+import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.github.yulichang.toolkit.JoinWrappers;
-import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.kangaroohy.milo.model.ReadWriteEntity;
import com.kangaroohy.milo.service.MiloService;
import com.mes.base.entity.BigStorageCageBaseInfo;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
-import com.mes.bigstorage.entity.BigStorageDTO;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
import com.mes.bigstorage.entity.dto.SlotSequenceDTO;
import com.mes.bigstorage.entity.dto.TemperingLayoutDTO;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
@@ -26,16 +25,14 @@
import com.mes.damage.service.DamageService;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
-import com.mes.temperingglass.entity.TemperingGlass;
import com.mes.temperingglass.entity.TemperingGlassInfo;
-import com.mes.temperingglass.service.TemperingGlassService;
+import com.mes.temperingglass.service.TemperingGlassInfoService;
import com.mes.utils.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@@ -51,7 +48,7 @@
@Resource
private BigStorageCageDetailsService bigStorageCageDetailsService;
@Resource
- private TemperingGlassService temperingGlassService;
+ private TemperingGlassInfoService temperingGlassInfoService;
@Resource
private DamageService damageService;
@Resource
@@ -84,8 +81,13 @@
@Value("${mes.sequence.order}")
private boolean sequenceOrder;
+ @Value("${mes.temperingOutTargetPosition}")
+ private Integer temperingOutTargetPosition;
+ @Value("${mes.artificialOutTargetPosition}")
+ private Integer artificialOutTargetPosition;
- @Scheduled(fixedDelay = 1000)
+
+ // @Scheduled(fixedDelay = 1000)
public void inBigStorageTask() throws Exception {
ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1A.DLP1A.mesControl");
if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
@@ -104,12 +106,29 @@
}
//鑾峰彇杩涚墖浠诲姟琛�
List<BigStorageCageTask> inTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_in_one_task");
- if (CollectionUtils.isEmpty(inTaskList)) {
+ if (CollectionUtil.isEmpty(inTaskList)) {
log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫杩涚墖浠诲姟");
}
+
List<String> glassIdList = inTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList());
log.info("鑾峰彇浠诲姟鐨勭幓鐠僫d锛歿}", glassIdList);
+ Map<String, Long> glassCountMap = glassIdList.stream().collect(Collectors.groupingBy(e -> e, Collectors.counting()));
+ for (Map.Entry<String, Long> entry : glassCountMap.entrySet()) {
+ if (entry.getValue() > 1) {
+ log.info("杩涚墖鐜荤拑{}瀛樺湪鐩稿悓锛岀粨鏉熸湰娆′换鍔�", entry.getKey());
+ //todo:鍚憄lc鍙戦�佹姤璀�
+ return;
+ }
+ }
+ List<BigStorageCageDetails> detailsList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>().in(BigStorageCageDetails::getGlassId, glassIdList)
+ .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
+ if (CollectionUtil.isNotEmpty(detailsList)) {
+ log.info("鐞嗙墖绗煎瓨鍦ㄧ浉鍚岀殑杩涚墖鐜荤拑{}锛岀粨鏉熸湰娆′换鍔�", detailsList);
+ //todo:鍚憄lc鍙戦�佹姤璀�
+ return;
+ }
List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIdList));
+
Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId));
//璁$畻鐩爣鏍煎瓙
@@ -147,7 +166,7 @@
miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 1));
}
- @Scheduled(fixedDelay = 1000)
+ // @Scheduled(fixedDelay = 1000)
public void outBigStorageTask() throws Exception {
Date startDate = new Date();
ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1B.DLP1B.mesControl");
@@ -162,36 +181,41 @@
}
//鑾峰彇鍑虹墖浠诲姟琛�
List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
- if (CollectionUtils.isNotEmpty(outTaskList)) {
+ if (CollectionUtil.isNotEmpty(outTaskList)) {
log.info("鏈夋鍦ㄦ墽琛岀殑鍑虹墖浠诲姟锛岀粨鏉熸湰娆″嚭鐗囦换鍔�");
return;
}
//todo:鏄惁鍏佽閽㈠寲
if (redisUtil.getCacheObject("temperingSwitch")) {
//鏄惁鏈夋鍦ㄩ挗鍖栫殑鐜荤拑:閽㈠寲灏忕墖琛ㄥ叧鑱斿巻鍙蹭换鍔¤〃锛岀瓫閫夋湭鍑虹鐨勭幓鐠冧俊鎭�
- List<TemperingGlass> temperingGlassList = temperingGlassService.selectJoinList(TemperingGlass.class, new MPJLambdaWrapper<TemperingGlass>()
- .selectAll(TemperingGlass.class)
- .leftJoin(BigStorageCageHistoryTask.class, BigStorageCageHistoryTask::getGlassId, TemperingGlass::getGlassId)
- .eq(TemperingGlass::getState, Const.TEMPERING_NEW)
- .eq(BigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_BEFORE_OUT)
- .isNull(BigStorageCageHistoryTask::getGlassId)
- .orderBy(Boolean.TRUE, sequenceOrder, TemperingGlass::getTemperingFeedSequence));
- //todo:鍘嗗彶浠诲姟琛�
- if (CollectionUtils.isNotEmpty(temperingGlassList)) {
- log.info("鏈夋鍦ㄥ嚭鐗囩殑閽㈠寲浠诲姟");
- computeOutGlassInfo(temperingGlassList, "big_storage_cage_out_one_task", Const.TEMPERING_OUT_TARGET_POSITION, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
- Date endDate = new Date();
- log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
- return;
+// 鑾峰彇褰撳墠閽㈠寲浠诲姟鏈畬鎴愬嚭鐗囩殑鐜荤拑淇℃伅
+ List<TemperingGlassInfo> unFinishTemperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>().eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW));
+ if (CollectionUtil.isNotEmpty(unFinishTemperingGlassInfoList)) {
+ List<String> glassIdList = unFinishTemperingGlassInfoList.stream().map(TemperingGlassInfo::getGlassId).collect(Collectors.toList());
+ List<BigStorageCageHistoryTask> historyTaskList = bigStorageCageHistoryTaskService.list(new LambdaQueryWrapper<BigStorageCageHistoryTask>()
+ .eq(BigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_BEFORE_OUT)
+ .in(BigStorageCageHistoryTask::getGlassId, glassIdList));
+ List<TemperingGlassInfo> temperingGlassList = unFinishTemperingGlassInfoList;
+ if (CollectionUtil.isNotEmpty(historyTaskList)) {
+ List<String> taskGlassList = historyTaskList.stream().map(BigStorageCageHistoryTask::getGlassId).collect(Collectors.toList());
+ temperingGlassList = unFinishTemperingGlassInfoList.stream().filter(e -> !taskGlassList.contains(e.getGlassId())).collect(Collectors.toList());
+ }
+ if (CollectionUtil.isNotEmpty(temperingGlassList)) {
+ log.info("鏈夋鍦ㄥ嚭鐗囩殑閽㈠寲浠诲姟");
+ computeOutGlassInfo(temperingGlassList, "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
+ Date endDate = new Date();
+ log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
+ return;
+ }
}
//閽㈠寲浼樺厛锛氳幏鍙栫悊鐗囩 鐜荤拑灏忕墖 鐮存崯琛� 鏁伴噺 鍒ゆ柇绗煎唴鐗堝浘鏄惁鍒伴綈
List<TemperingLayoutDTO> temperingLayoutDTOList = bigStorageCageDetailsService.temperingIsAll();
- if (CollectionUtils.isNotEmpty(temperingLayoutDTOList)) {
+ if (CollectionUtil.isNotEmpty(temperingLayoutDTOList)) {
//鐜荤拑鍒伴綈鍖呮嫭宸插嚭鐗囩殑
//鍒伴綈锛屽皢鐜荤拑灏忕墖鏁版嵁瀛樺叆閽㈠寲灏忕墖琛紝閫昏緫鐢熸垚鍑虹墖浠诲姟 缁撴潫
for (TemperingLayoutDTO item : temperingLayoutDTOList) {
// if (item.getEngineerId().equals(redisUtil.getCacheObject("temperingengineerId"))) {
- List<TemperingGlass> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlass.class, JoinWrappers.lambda(GlassInfo.class)
+ List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class)
.selectAll(GlassInfo.class)
.select("-1 as state")
.selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot)
@@ -200,9 +224,9 @@
.eq(GlassInfo::getTemperingLayoutId, item.getTemperingLayoutId())
.eq(GlassInfo::getEngineerId, item.getEngineerId())
.orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence));
- if (CollectionUtils.isNotEmpty(temperingGlassInfos)) {
- temperingGlassService.saveBatch(temperingGlassInfos);
- computeOutGlassInfo(temperingGlassInfos, "big_storage_cage_out_one_task", Const.TEMPERING_OUT_TARGET_POSITION, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
+ if (CollectionUtil.isNotEmpty(temperingGlassInfos)) {
+ temperingGlassInfoService.saveBatch(temperingGlassInfos);
+ computeOutGlassInfo(temperingGlassInfos, "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
Date endDate = new Date();
log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
return;
@@ -215,16 +239,16 @@
List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
.eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL)
.orderByAsc(BigStorageCageDetails::getSlot)
- .orderByDesc(BigStorageCageDetails::getId));
- if (CollectionUtils.isNotEmpty(artificialList)) {
- computeOutGlassInfo(artificialList, "big_storage_cage_out_one_task", Const.ARTIFICIAL_OUT_TARGET_POSITION, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
+ .orderByAsc(BigStorageCageDetails::getId));
+ if (CollectionUtil.isNotEmpty(artificialList)) {
+ computeOutGlassInfo(artificialList, "big_storage_cage_out_one_task", artificialOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
Date endDate = new Date();
log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
return;
}
//鏄惁瀛樺湪闇�瑕佸唴閮ㄨ皟搴︾殑鏍煎瓙:鎵ц鍐呴儴璋冨害浠诲姟
List<TemperingLayoutDTO> temperingOccupySlotList = bigStorageCageDetailsService.queryTemperingOccupySlot();
- if (CollectionUtils.isNotEmpty(temperingOccupySlotList)) {
+ if (CollectionUtil.isNotEmpty(temperingOccupySlotList)) {
loop:
for (TemperingLayoutDTO temperingOccupySlot : temperingOccupySlotList) {
List<SlotSequenceDTO> slotSequenceList = bigStorageCageDetailsService.queryGlassMaxAndMin(temperingOccupySlot.getEngineerId(), temperingOccupySlot.getTemperingLayoutId());
@@ -235,14 +259,16 @@
int totalCount = first.getGlassCount() + second.getGlassCount();
if (totalCount <= 6 && first.getMinSequence() == second.getMaxSequence() + 1
&& second.getRemainWidth() > slotWidth && slotWidth >= 0) {
-
List<BigStorageCageDetails> list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
.eq(BigStorageCageDetails::getSlot, first.getSlot()).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
.orderBy(Boolean.TRUE, sequenceOrder, BigStorageCageDetails::getTemperingFeedSequence));
- if (CollectionUtils.isNotEmpty(list)) {
+ if (CollectionUtil.isNotEmpty(list)) {
computeOutGlassInfo(list, "big_storage_cage_out_one_task", second.getSlot(), Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH);
}
- updateSlotRemainBySlots(Arrays.asList(second.getSlot()));
+ //浣跨敤Arrays.asList() 浣跨敤removeAll鎶ラ敊锛屾敼涓烘甯镐娇鐢↙ist
+ List<Integer> slotList = new ArrayList<>();
+ slotList.add(second.getSlot());
+ updateSlotRemainBySlots(slotList);
break loop;
}
}
@@ -253,7 +279,7 @@
return;
}
- @Scheduled(fixedDelay = 1000)
+ // @Scheduled(fixedDelay = 1000)
public void finishInBigStorageTask() throws Exception {
ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1A.DLP1A.mesControl");
if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
@@ -262,12 +288,12 @@
}
//鑾峰彇杩涚墖浠诲姟琛�
List<BigStorageCageTask> inTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_in_one_task");
- if (CollectionUtils.isEmpty(inTaskList)) {
+ if (CollectionUtil.isEmpty(inTaskList)) {
log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫瀹屾垚杩涚墖浠诲姟");
return;
}
List<BigStorageCageTask> unFinishTaskList = inTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList());
- if (CollectionUtils.isNotEmpty(unFinishTaskList)) {
+ if (CollectionUtil.isNotEmpty(unFinishTaskList)) {
log.info("瀛樺湪鏈畬鎴愮殑鐜荤拑淇℃伅,鐜荤拑锛歿}", unFinishTaskList);
return;
}
@@ -311,21 +337,21 @@
miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 0));
}
- @Scheduled(fixedDelay = 1000)
+ // @Scheduled(fixedDelay = 1000)
public void finishOutBigStorageTask() throws Exception {
-// ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1B.DLP1B.mesControl");
-// if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
-// log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫瀹屾垚鍑虹墖浠诲姟");
-// return;
-// }
+ ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1B.DLP1B.mesControl");
+ if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
+ log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫瀹屾垚鍑虹墖浠诲姟");
+ return;
+ }
//鑾峰彇杩涚墖浠诲姟琛�
List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
- if (CollectionUtils.isEmpty(outTaskList)) {
+ if (CollectionUtil.isEmpty(outTaskList)) {
log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫瀹屾垚杩涚墖浠诲姟");
return;
}
List<BigStorageCageTask> unFinishTaskList = outTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList());
- if (CollectionUtils.isNotEmpty(unFinishTaskList)) {
+ if (CollectionUtil.isNotEmpty(unFinishTaskList)) {
log.info("瀛樺湪鏈畬鎴愮殑鐜荤拑淇℃伅,鐜荤拑锛歿}", unFinishTaskList);
return;
}
@@ -359,7 +385,7 @@
}
return storageCageDTO;
}).collect(Collectors.toList());
- bigStorageCageDetailsService.updateBySlot(storageCageDTOList, finalTaskType);
+ bigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_OUT);
log.info("4銆佸ぇ鐞嗙墖绗艰繘鐗囩姸鎬佸凡瀹屾垚宸插畬鎴愮殑鐜荤拑淇℃伅id:{}", v);
updateSlotRemainBySlots(outSuccessGlassSlot);
} else if (e1 == 3) {
@@ -376,9 +402,23 @@
.set(BigStorageCageHistoryTask::getTaskState, item.getTaskState())
.eq(BigStorageCageHistoryTask::getTaskType, taskType)
.eq(BigStorageCageHistoryTask::getGlassId, item.getGlassId()));
+ //鏇存柊閽㈠寲灏忕墖琛�
+ Integer taskState = item.getTaskState();
+ if (taskState == 2) {
+ temperingGlassInfoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>()
+ .set(TemperingGlassInfo::getState, Const.TEMPERING_OUT).eq(TemperingGlassInfo::getGlassId, item.getGlassId()));
+ } else if (taskState == 3) {
+// temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().eq(TemperingGlassInfo::getGlassId, item.getGlassId()));
+ temperingGlassInfoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>()
+ .set(TemperingGlassInfo::getState, Const.TEMPERING_DAMAGE
+ ).eq(TemperingGlassInfo::getGlassId, item.getGlassId()));
+
+ } else {
+// 绌烘墽琛�
+ }
}
- //娓呯┖浠诲姟琛ㄦ暟鎹�
- bigStorageCageTaskService.removeAll("big_storage_cage_out_one_task");
+// 閲嶇疆浠诲姟琛ㄦ暟鎹�
+ bigStorageCageTaskService.updateOutTaskMessage("big_storage_cage_out_one_task");
//娓呯┖鍚姩鐘舵��
//鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 0));
@@ -504,7 +544,7 @@
bigStorageCageTaskList.add(new BigStorageCageTask(e.getGlassId(), e.getSlot(), targetSlot,
0));
}
- Assert.isFalse(CollectionUtils.isEmpty(bigStorageCageTaskList), "鏈幏鍙栧嚭鐗囨暟鎹紝缁撴潫鍑虹墖浠诲姟");
+ Assert.isFalse(CollectionUtil.isEmpty(bigStorageCageTaskList), "鏈幏鍙栧嚭鐗囨暟鎹紝缁撴潫鍑虹墖浠诲姟");
log.info("鑾峰彇鍑虹墖浠诲姟鏁版嵁{}鏉★紝鎵ц淇濆瓨", bigStorageCageTaskList.size());
List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList());
int glassCount = bigStorageCageTaskList.size();
@@ -512,6 +552,8 @@
while (bigStorageCageTaskList.size() < 6) {
bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0));
}
+ //娓呯┖浠诲姟琛ㄦ暟鎹�
+ bigStorageCageTaskService.removeAll("big_storage_cage_out_one_task");
bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList);
List<BigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> {
BigStorageCageHistoryTask history = new BigStorageCageHistoryTask();
@@ -527,6 +569,11 @@
.set(BigStorageCageDetails::getState, state)
.set(Const.GLASS_STATE_SCHEDULE_ING.equals(state), BigStorageCageBaseInfo::getSlot, targetSlot)
.in(BigStorageCageDetails::getGlassId, glassIds));
+ try {
+ miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 1));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
return Boolean.TRUE;
}
@@ -537,7 +584,7 @@
.in(BigStorageCageDetails::getSlot, slotList).in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
Map<Integer, Double> slotRemainMap = new HashMap<>();
//鏄惁瀛樺湪鏈夋牸瀛愰潪绌虹殑鐜荤拑
- if (CollectionUtils.isNotEmpty(inSlotGlassList)) {
+ if (CollectionUtil.isNotEmpty(inSlotGlassList)) {
//瀛樺湪 灏嗘牸瀛愬唴鐨勭幓鐠冨垎鍒繘琛屾洿鏂�
slotRemainMap = inSlotGlassList.stream()
.collect(Collectors.groupingBy(BigStorageCageDetails::getSlot, Collectors.summingDouble(item -> Math.max(item.getWidth(), item.getHeight()) + glassGap)));
@@ -550,7 +597,7 @@
//杩囨护涓嶅瓨鍦ㄧ幓鐠冪殑鏍煎瓙 灏嗗搴﹂噸缃负鍘熷瀹藉害5000
Set<Integer> remainSlotList = slotRemainMap.keySet();
slotList.removeAll(remainSlotList);
- if (CollectionUtils.isNotEmpty(slotList)) {
+ if (CollectionUtil.isNotEmpty(slotList)) {
bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, slotWidth)
.in(BigStorageCage::getSlot, slotList));
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
index 72b79af..81f5276 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
@@ -10,7 +10,7 @@
import com.mes.base.entity.BigStorageCageBaseInfo;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
-import com.mes.bigstorage.entity.BigStorageDTO;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
import com.mes.bigstorage.entity.dto.SlotSequenceDTO;
import com.mes.bigstorage.entity.dto.TemperingLayoutDTO;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
@@ -37,7 +37,6 @@
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@@ -98,7 +97,7 @@
private String d01GlassId = "";
private String d04GlassId = "";
- @Scheduled(fixedDelay = 300)
+ // @Scheduled(fixedDelay = 300)
public void plcToHomeEdgScan() {
Date startDate = new Date();
log.info("澶х悊鐗囩鎵爜浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
@@ -127,34 +126,34 @@
}
//鎸夌収绾胯矾鍙婄幓鐠僫d鑾峰彇鐩搁偦涓ゅ潡鐜荤拑 鍗ц浆绔嬩笂鐨勭幓鐠�: 鐘舵�佷负0涓嶆搷浣滐紙D01閫佺墖锛�0涓嶆搷浣滐紝1鍏佽閫佺墖锛夛紝璇锋眰瀛椾负1锛� 锛�02鐜荤拑id涓虹┖鎴栬�呭崸杞珛鏈惎鍔級
if (!REQUEST_WORD.equals(mesD01Value) && REQUEST_WORD.equals(d01ToMES) && (StringUtils.isBlank(d02State) || !REQUEST_WORD.equals(d03State))) {
- List<BigStorageCageFeedTask> bigStorageCageFeedTasks=bigStorageCageFeedTaskService.list(
- new LambdaQueryWrapper<BigStorageCageFeedTask>()
- .gt(BigStorageCageFeedTask::getTargetSlot,0)
- .eq(BigStorageCageFeedTask::getLine,Const.A09_OUT_TARGET_POSITION)
- .eq(BigStorageCageFeedTask::getTaskState,Const.BIG_STORAGE_IN_UP)
+ List<BigStorageCageFeedTask> bigStorageCageFeedTasks = bigStorageCageFeedTaskService.list(
+ new LambdaQueryWrapper<BigStorageCageFeedTask>()
+ .gt(BigStorageCageFeedTask::getTargetSlot, 0)
+ .eq(BigStorageCageFeedTask::getLine, Const.A09_OUT_TARGET_POSITION)
+ .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP)
);
- if(CollectionUtils.isEmpty(bigStorageCageFeedTasks)){
+ if (CollectionUtils.isEmpty(bigStorageCageFeedTasks)) {
if (!d01GlassId.equals(d01Id)) {
judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION, mesD01Address);
edgGlassTaskInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskInfo>()
- .set(EdgGlassTaskInfo::getStatus, Const.EDG_GLASS_SUCCESS).eq(EdgGlassTaskInfo::getGlassId, d01Id));
+ .set(EdgGlassTaskInfo::getState, Const.EDG_GLASS_SUCCESS).eq(EdgGlassTaskInfo::getGlassId, d01Id));
// d01GlassId = d01Id;
}
}
}
// 鐘舵�佷负0涓嶆搷浣滐紙D01閫佺墖锛�0涓嶆搷浣滐紝1鍏佽閫佺墖锛夛紝璇锋眰瀛椾负1锛� 鍗ц浆绔嬫湭鍚姩
if (!REQUEST_WORD.equals(mesD04Value) && REQUEST_WORD.equals(d04ToMES) && !REQUEST_WORD.equals(d05State)) {
- List<BigStorageCageFeedTask> bigStorageCageFeedTasks=bigStorageCageFeedTaskService.list(
+ List<BigStorageCageFeedTask> bigStorageCageFeedTasks = bigStorageCageFeedTaskService.list(
new LambdaQueryWrapper<BigStorageCageFeedTask>()
- .gt(BigStorageCageFeedTask::getTargetSlot,0)
- .eq(BigStorageCageFeedTask::getLine,Const.A10_OUT_TARGET_POSITION)
- .eq(BigStorageCageFeedTask::getTaskState,Const.BIG_STORAGE_IN_UP)
+ .gt(BigStorageCageFeedTask::getTargetSlot, 0)
+ .eq(BigStorageCageFeedTask::getLine, Const.A10_OUT_TARGET_POSITION)
+ .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP)
);
- if(CollectionUtils.isEmpty(bigStorageCageFeedTasks)){
+ if (CollectionUtils.isEmpty(bigStorageCageFeedTasks)) {
if (!d04GlassId.equals(d04Id)) {
judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD04Address);
edgGlassTaskInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskInfo>()
- .set(EdgGlassTaskInfo::getStatus, Const.EDG_GLASS_SUCCESS).eq(EdgGlassTaskInfo::getGlassId, d04Id));
+ .set(EdgGlassTaskInfo::getState, Const.EDG_GLASS_SUCCESS).eq(EdgGlassTaskInfo::getGlassId, d04Id));
// d04GlassId = d04Id;
}
}
@@ -164,7 +163,7 @@
log.info("澶х悊鐗囩鎵爜浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
}
- @Scheduled(fixedDelay = 300)
+ // @Scheduled(fixedDelay = 300)
public void plcToHomeEdgFreeCarTask() {
Date startDate = new Date();
log.info("澶х悊鐗囩绌鸿溅杩涚墖浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
@@ -254,8 +253,8 @@
//鑾峰彇鍗ц浆绔嬪墿浣欏搴�
if (computeIsRun(lineFirst, lineGlassId)) {
computeTargetByLine(lineFirst);
- }else{
- log.info("褰撳墠绾胯矾锛歿}锛屾湁鎵爜鐜荤拑锛歿}",lineFirst,lineGlassId);
+ } else {
+ log.info("褰撳墠绾胯矾锛歿}锛屾湁鎵爜鐜荤拑锛歿}", lineFirst, lineGlassId);
}
}
Date endDate = new Date();
@@ -298,7 +297,7 @@
log.info("澶х悊鐗囩绌鸿溅杩涚墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
}
- @Scheduled(fixedDelay = 10000)
+ // @Scheduled(fixedDelay = 10000)
public void plcToHomeEdgOutTask() {
Date startDate = new Date();
log.info("澶х悊鐗囩绌鸿溅杩涚墖浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
@@ -421,7 +420,7 @@
}
}
- @Scheduled(fixedDelay = 300)
+ // @Scheduled(fixedDelay = 300)
public void updateInGlassStateTask() {
Date startDate = new Date();
log.info("1銆佸ぇ鐞嗙墖绗艰繘鐗囧畬鎴愬悗鏇存柊澶х悊鐗囩鏁版嵁浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
@@ -456,7 +455,7 @@
}
- @Scheduled(fixedDelay = 300)
+ // @Scheduled(fixedDelay = 300)
public void updateOutGlassStateTask() {
Date startDate = new Date();
log.info("1銆佸ぇ鐞嗙墖绗煎嚭鐗囧畬鎴愬悗鏇存柊澶х悊鐗囩鏁版嵁浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
@@ -500,7 +499,7 @@
}
- @Scheduled(fixedDelay = 300)
+ // @Scheduled(fixedDelay = 300)
public void updateScheduleGlassStateTask() {
Date startDate = new Date();
log.info("1銆佸ぇ鐞嗙墖绗艰皟搴﹀畬鎴愬悗鏇存柊澶х悊鐗囩鏁版嵁浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
@@ -540,7 +539,7 @@
/**
* 澶勭悊鐮存崯琛ㄤ换鍔�
*/
- @Scheduled(fixedDelay = 300)
+// @Scheduled(fixedDelay = 300)
public void dealDamageTask() {
Date startDate = new Date();
log.info("澶х悊鐗囩鐮存崯鐜荤拑娓呴櫎浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
@@ -606,7 +605,7 @@
/**
* 纭瀛楁竻绌�
*/
- @Scheduled(fixedDelay = 300)
+// @Scheduled(fixedDelay = 300)
public void confirmClear() {
PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
String d01ToMES = plcParameterObject.getPlcParameter("D01ToMES").getValue();
@@ -620,19 +619,19 @@
String mesD03Address = plcParameterObject.getPlcParameter("MESToD03").getAddress();
String mesD05Address = plcParameterObject.getPlcParameter("MESToD05").getAddress();
if (!REQUEST_WORD.equals(d01ToMES)) {
- log.info("鍦板潃锛歿}鍐欏叆0",mesD01Address);
+ log.info("鍦板潃锛歿}鍐欏叆0", mesD01Address);
S7object.getinstance().plccontrol.writeWord(mesD01Address, 0);
}
if (!REQUEST_WORD.equals(d04ToMES)) {
- log.info("鍦板潃锛歿}鍐欏叆0",mesD04Address);
+ log.info("鍦板潃锛歿}鍐欏叆0", mesD04Address);
S7object.getinstance().plccontrol.writeWord(mesD04Address, 0);
}
if (!REQUEST_WORD.equals(d03ToMES)) {
- log.info("鍦板潃锛歿}鍐欏叆0",mesD03Address);
+ log.info("鍦板潃锛歿}鍐欏叆0", mesD03Address);
S7object.getinstance().plccontrol.writeWord(mesD03Address, 0);
}
if (!REQUEST_WORD.equals(d05ToMES)) {
- log.info("鍦板潃锛歿}鍐欏叆0",mesD05Address);
+ log.info("鍦板潃锛歿}鍐欏叆0", mesD05Address);
S7object.getinstance().plccontrol.writeWord(mesD05Address, 0);
}
}
@@ -640,7 +639,7 @@
/**
* 杩涚墖鐘舵�佷慨鏀�
*/
- @Scheduled(fixedDelay = 300)
+// @Scheduled(fixedDelay = 300)
public void feedStatusUpdate() {
PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
String mesD03Address = plcParameterObject.getPlcParameter("MESToD03").getAddress();
@@ -673,8 +672,8 @@
.filter(glassIds1::contains)
.distinct()
.collect(Collectors.toList());
- log.info("D3id{},鍖归厤id:{}",glassIds1,matchingIds1);
- if(CollectionUtils.isNotEmpty(matchingIds1)){
+ log.info("D3id{},鍖归厤id:{}", glassIds1, matchingIds1);
+ if (CollectionUtils.isNotEmpty(matchingIds1)) {
bigStorageCageFeedTaskService.update(
new LambdaUpdateWrapper<BigStorageCageFeedTask>()
.in(BigStorageCageFeedTask::getGlassId, matchingIds1)
@@ -689,8 +688,8 @@
.filter(glassIds2::contains)
.distinct()
.collect(Collectors.toList());
- log.info("D5id{},鍖归厤id:{}",glassIds2,matchingIds2);
- if(CollectionUtils.isNotEmpty(matchingIds2)){
+ log.info("D5id{},鍖归厤id:{}", glassIds2, matchingIds2);
+ if (CollectionUtils.isNotEmpty(matchingIds2)) {
bigStorageCageFeedTaskService.update(
new LambdaUpdateWrapper<BigStorageCageFeedTask>()
.in(BigStorageCageFeedTask::getGlassId, matchingIds2)
@@ -701,7 +700,7 @@
}
if (CollectionUtils.isEmpty(glassIds1)) {
S7object.getinstance().plccontrol.writeWord(mesD03Address, 0);
- log.info("{}绾夸慨鏀圭幓鐠冪姸鎬佷负3",Const.A09_OUT_TARGET_POSITION);
+ log.info("{}绾夸慨鏀圭幓鐠冪姸鎬佷负3", Const.A09_OUT_TARGET_POSITION);
bigStorageCageFeedTaskService.update(
new LambdaUpdateWrapper<BigStorageCageFeedTask>()
.eq(BigStorageCageFeedTask::getLine, Const.A09_OUT_TARGET_POSITION)
@@ -713,7 +712,7 @@
}
if (CollectionUtils.isEmpty(glassIds2)) {
S7object.getinstance().plccontrol.writeWord(mesD05Address, 0);
- log.info("{}绾夸慨鏀圭幓鐠冪姸鎬佷负3",Const.A10_OUT_TARGET_POSITION);
+ log.info("{}绾夸慨鏀圭幓鐠冪姸鎬佷负3", Const.A10_OUT_TARGET_POSITION);
bigStorageCageFeedTaskService.update(
new LambdaUpdateWrapper<BigStorageCageFeedTask>()
.eq(BigStorageCageFeedTask::getLine, Const.A10_OUT_TARGET_POSITION)
@@ -749,7 +748,7 @@
edgGlassTaskInfoList = edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>()
.eq(EdgGlassTaskInfo::getLine, line)
.apply("time >= (select time from edg_glass_task_info where line='" + line + "' and glass_id = '" + glassId + "' and deleted = 0)")
- .orderByAsc(EdgGlassTaskInfo::getTime));
+ .orderByAsc(EdgGlassTaskInfo::getCreateTime));
if (edgGlassTaskInfoList.size() == 0) {
edgGlassTaskInfoList = edgGlassTaskInfoService.list(new QueryWrapper<EdgGlassTaskInfo>()
.select("Top 1 *")
@@ -987,7 +986,7 @@
returnData = glassIds2;
}
// returnData = s7control.readWord(outLine, 1).get(0);
- log.info("宸插悜plc绗瑊}娆″彂閫佽繘鐗囦换鍔$‘璁わ紝鍦板潃涓猴細{},鍐欏叆鐨勫唴瀹逛负{},璇诲埌鐨勮姹備负{}", count++, outLine, 2,returnData);
+ log.info("宸插悜plc绗瑊}娆″彂閫佽繘鐗囦换鍔$‘璁わ紝鍦板潃涓猴細{},鍐欏叆鐨勫唴瀹逛负{},璇诲埌鐨勮姹備负{}", count++, outLine, 2, returnData);
}
// while (returnData != 0) {
// s7control.writeWord(outLine, 2);
@@ -1028,7 +1027,7 @@
if (maxX + minLength <= xMaxSize) {
bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION,
e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1, new Date()));
- maxX = Math.max(maxX, e.getXCoordinate());
+// maxX = Math.max(maxX, e.getXCoordinate());
} else {
break;
}
@@ -1087,12 +1086,12 @@
if (maxX + minLength <= xMaxSize) {
bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION,
e.getWidth() * 10, e.getHeight() * 10, trainNumber, serialNumber++, 1, new Date()));
- maxX = Math.max(maxX, e.getXCoordinate());
+// maxX = Math.max(maxX, e.getXCoordinate());
} else {
remainWidth = carWidth - maxLength - glassGap;
trainNumber = trainNumber + 1;
serialNumber = 1;
- maxX = e.getXCoordinate();
+// maxX = e.getXCoordinate();
bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION,
e.getWidth() * 10, e.getHeight(), trainNumber, serialNumber++, 1, new Date()));
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/opccallback/BigStorageStartCallback.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/opccallback/BigStorageStartCallback.java
index 9c3c9d4..a539b6d 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/opccallback/BigStorageStartCallback.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/opccallback/BigStorageStartCallback.java
@@ -11,7 +11,7 @@
import com.mes.base.entity.BigStorageCageBaseInfo;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
-import com.mes.bigstorage.entity.BigStorageDTO;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
import com.mes.bigstorage.entity.dto.SlotSequenceDTO;
import com.mes.bigstorage.entity.dto.TemperingLayoutDTO;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
@@ -37,7 +37,6 @@
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -121,7 +120,7 @@
}
- @Scheduled(fixedDelay = 10000)
+ // @Scheduled(fixedDelay = 10000)
public void plcToHomeEdgOutTask() {
String mesToPLCAddress = "";
List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>()
@@ -233,7 +232,7 @@
/**
* 纭瀛楁竻绌�
*/
- @Scheduled(fixedDelay = 300)
+// @Scheduled(fixedDelay = 300)
public void confirmClear() {
PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
String d01ToMES = plcParameterObject.getPlcParameter("D01ToMES").getValue();
@@ -261,7 +260,7 @@
/**
* 杩涚墖鐘舵�佷慨鏀�
*/
- @Scheduled(fixedDelay = 300)
+// @Scheduled(fixedDelay = 300)
public void feedStatusUpdate() {
PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
List<String> glassIds1 = new ArrayList<>();
@@ -358,7 +357,7 @@
edgGlassTaskInfoList = edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>()
.eq(EdgGlassTaskInfo::getLine, line)
.apply("time >= (select time from edg_glass_task_info where line='" + line + "' and glass_id = '" + glassId + "' and deleted = 0)")
- .orderByAsc(EdgGlassTaskInfo::getTime));
+ .orderByAsc(EdgGlassTaskInfo::getCreateTime));
if (edgGlassTaskInfoList.size() == 0) {
edgGlassTaskInfoList = edgGlassTaskInfoService.list(new QueryWrapper<EdgGlassTaskInfo>()
.select("Top 1 *")
@@ -604,7 +603,7 @@
if (maxX + minLength <= xMaxSize) {
bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION,
e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1, new Date()));
- maxX = Math.max(maxX, e.getXCoordinate());
+// maxX = Math.max(maxX, e.getXCoordinate());
} else {
break;
}
@@ -663,12 +662,12 @@
if (maxX + minLength <= xMaxSize) {
bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION,
e.getWidth() * 10, e.getHeight() * 10, trainNumber, serialNumber++, 1, new Date()));
- maxX = Math.max(maxX, e.getXCoordinate());
+// maxX = Math.max(maxX, e.getXCoordinate());
} else {
remainWidth = carWidth - maxLength - glassGap;
trainNumber = trainNumber + 1;
serialNumber = 1;
- maxX = e.getXCoordinate();
+// maxX = e.getXCoordinate();
bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION,
e.getWidth() * 10, e.getHeight(), trainNumber, serialNumber++, 1, new Date()));
}
@@ -716,7 +715,7 @@
return null;
}
- @Scheduled(fixedDelay = 300)
+ // @Scheduled(fixedDelay = 300)
public void querySizeByEngineerTask() {
log.info("鏌ヨ缁撴灉锛歿}", querySizeByEngineer("P24072402", 1, 10, 8));
log.info("鏌ヨ缁撴灉锛歿}", querySizeByEngineer("P24072402", 1, 5, 8));
@@ -786,7 +785,7 @@
bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
.eq(BigStorageCage::getEnableState, Const.SLOT_ON)
- .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot)
.inSql(BigStorageCage::getDeviceId,
"select distinct device_id from big_storage_cage_details where engineer_id = '" + engineerId + "' and tempering_layout_id = " + temperingLayoutId)
.last("limit 1"));
@@ -804,7 +803,7 @@
List<Integer> deviceUsedList = bigStorageCageService.queryFreeDeviceByUsed(thickness);
for (Integer item : deviceUsedList) {
bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
- .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot)
.eq(BigStorageCage::getEnableState, Const.SLOT_ON)
.eq(BigStorageCage::getDeviceId, item)
.last("limit 1"));
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/BigStorageBaseService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/BigStorageBaseService.java
index 0402283..e611458 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/BigStorageBaseService.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/BigStorageBaseService.java
@@ -1,6 +1,6 @@
package com.mes.tools.service;
-import com.mes.bigstorage.entity.BigStorageDTO;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
import com.mes.glassinfo.entity.GlassInfo;
import java.util.List;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/impl/BigStorageBaseServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/impl/BigStorageBaseServiceImpl.java
index b7e267c..b948c1e 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/impl/BigStorageBaseServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/impl/BigStorageBaseServiceImpl.java
@@ -7,7 +7,7 @@
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
-import com.mes.bigstorage.entity.BigStorageDTO;
+import com.mes.bigstorage.entity.dto.BigStorageDTO;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.bigstorage.service.BigStorageCageService;
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
@@ -20,7 +20,6 @@
import com.mes.tools.service.BigStorageBaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -554,7 +553,7 @@
}
- @Scheduled(fixedDelay = 300)
+ // @Scheduled(fixedDelay = 300)
public void querySizeByEngineerTask() {
log.info("鏌ヨ缁撴灉锛歿}", querySizeByEngineer("P24072402", 1, 10, 8));
log.info("鏌ヨ缁撴灉锛歿}", querySizeByEngineer("P24072402", 1, 5, 8));
@@ -624,7 +623,7 @@
bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
.eq(BigStorageCage::getEnableState, Const.SLOT_ON)
- .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot)
.inSql(BigStorageCage::getDeviceId,
"select distinct device_id from big_storage_cage_details where engineer_id = '" + engineerId + "' and tempering_layout_id = " + temperingLayoutId)
.last("limit 1"));
@@ -642,7 +641,7 @@
List<Integer> deviceUsedList = bigStorageCageService.queryFreeDeviceByUsed(thickness);
for (Integer item : deviceUsedList) {
bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
- .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot)
.eq(BigStorageCage::getEnableState, Const.SLOT_ON)
.eq(BigStorageCage::getDeviceId, item)
.last("limit 1"));
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-yw.yml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-yw.yml
new file mode 100644
index 0000000..4ac536a
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-yw.yml
@@ -0,0 +1,30 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://192.168.2.100:3306/hangzhoumes?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ pp:
+ url: jdbc:mysql://192.168.2.100:3306/pp?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ salve_hangzhoumes:
+ url: jdbc:sqlserver://192.168.2.100:1433;databasename=mes
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 192.168.2.100:8848
+ redis:
+ database: 0
+ host: 192.168.2.100
+ port: 6379
+ password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
index b130faf..1c2632d 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
@@ -3,7 +3,7 @@
spring:
profiles:
- active: cz
+ active: yw
application:
name: cacheVerticalGlass
liquibase:
@@ -15,21 +15,31 @@
thread-name-prefix: task-cacheVertical
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml
-# configuration:
-# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+ configuration:
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mes:
sequence:
- order: false
- minCount: 20
- carWidth: 5000 #澶ц溅瀹藉害
- slotWidth: 5500 #澶ц溅瀹藉害
- inCarMaxSize: 2 #杩涚墖澶ц溅鏈�澶у瓨鏀剧幓鐠冩暟閲�
- outCarMaxSize: 3 #鍑虹墖澶ц溅鏈�澶у瓨鏀剧幓鐠冩暟閲�
- glassGap: 350 #鐜荤拑闂磋窛
+ order: true
+ minCount: 30
+ carWidth: 6200 #澶ц溅瀹藉害
+ slotWidth: 6200 #澶ц溅瀹藉害
+ inCarMaxSize: 5 #杩涚墖澶ц溅鏈�澶у瓨鏀剧幓鐠冩暟閲�
+ outCarMaxSize: 6 #鍑虹墖澶ц溅鏈�澶у瓨鏀剧幓鐠冩暟閲�
+ glassGap: 250 #鐜荤拑闂磋窛
xMaxSize: 2800
+ temperingOutTargetPosition: 930
+ artificialOutTargetPosition: 931
+
scan:
ip: 192.168.30.199
port: 5000
kangaroohy:
milo:
- enabled: false
\ No newline at end of file
+ enabled: true
+ primary: default
+ config:
+ default:
+ endpoint: opc.tcp://192.168.2.100:49320
+ security-policy: basic256sha256
+ username: admin
+ password: 1qaz2wsx3edc4rfv
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
index 5ef3b71..003bd62 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
@@ -19,24 +19,32 @@
<result column="remain_width" property="remainWidth"/>
</resultMap>
+ <resultMap id="virtualSlotSequenceDTO" type="com.mes.bigstorage.entity.dto.BigStorageRelationDTO">
+ <result column="engineer_id" property="engineerId"/>
+ <result column="tempering_layout_id" property="temperingLayoutId"/>
+ <result column="virtual_slot" property="virtualSlot"/>
+ </resultMap>
+ <resultMap id="baseSlotSequenceDTO" type="com.mes.bigstorage.entity.dto.BigStorageSequenceDTO">
+ <result column="slot" property="slot"/>
+ <result column="max_sequence" property="maxSequence"/>
+ <result column="min_sequence" property="minSequence"/>
+ </resultMap>
+
<select id="temperingIsAll" resultMap="temperingLayoutDTO">
SELECT T2.*
FROM (
SELECT T.ENGINEER_ID,
T.TEMPERING_LAYOUT_ID,
COUNT(T.TEMPERING_FEED_SEQUENCE) AS COUNT
- FROM
- GLASS_INFO T
- LEFT JOIN DAMAGE T1
- ON T.ENGINEER_ID = T1.ENGINEER_ID
- AND T.GLASS_ID = T1.GLASS_ID
- AND (T1.TYPE = 8
- OR T1.TYPE = 9 )
- WHERE
- T1.GLASS_ID IS NULL
- GROUP BY
- T.ENGINEER_ID,
- T.TEMPERING_LAYOUT_ID
+ FROM GLASS_INFO T
+ LEFT JOIN DAMAGE T1
+ ON T.ENGINEER_ID = T1.ENGINEER_ID
+ AND T.GLASS_ID = T1.GLASS_ID
+ AND (T1.TYPE = 8
+ OR T1.TYPE = 9)
+ WHERE T1.GLASS_ID IS NULL
+ GROUP BY T.ENGINEER_ID,
+ T.TEMPERING_LAYOUT_ID
) T2
INNER JOIN (SELECT ENGINEER_ID, TEMPERING_LAYOUT_ID, COUNT(TEMPERING_FEED_SEQUENCE) AS COUNT
FROM BIG_STORAGE_CAGE_DETAILS
@@ -44,7 +52,7 @@
GROUP BY ENGINEER_ID, TEMPERING_LAYOUT_ID) T3 ON T2.ENGINEER_ID = T3.ENGINEER_ID
AND T2.TEMPERING_LAYOUT_ID = T3.TEMPERING_LAYOUT_ID
AND T2.COUNT = T3.COUNT
- INNER JOIN ENGINEERING T4 ON T2.ENGINEER_ID=T4.ENGINEER_ID
+ INNER JOIN ENGINEERING T4 ON T2.ENGINEER_ID = T4.ENGINEER_ID
ORDER BY T4.ID, T2.TEMPERING_LAYOUT_ID
</select>
@@ -91,17 +99,77 @@
(#{item.glassId}, #{item.targetSlot})
</foreach>
)
+ and state !=101
</where>
</update>
<select id="selectTemperingGlassCount" resultType="java.util.Map">
- select a.engineer_id,a.tempering_layout_id,count2,count1,count2-count1 as count3,count(c.glass_id) as count4 from
- (select engineer_id,tempering_layout_id,count(*) as count1 from big_storage_cage_details where state=100 group by engineer_id,tempering_layout_id) as a
- left join
- (select engineer_id,tempering_layout_id,count(*) as count2 from glass_info group by engineer_id,tempering_layout_id) as b
- on a.engineer_id=b.engineer_id and a.tempering_layout_id=b.tempering_layout_id
- left join damage as c on a.engineer_id=c.engineer_id and a.tempering_layout_id=c.tempering_layout_id and (type = 8 or type = 9)
- group by a.engineer_id,a.tempering_layout_id
- order by a.engineer_id,a.tempering_layout_id
+ select a.engineer_id,
+ a.tempering_layout_id,
+ count2,
+ count1,
+ count2 - count1 as count3,
+ count(c.glass_id) as count4
+ from (select engineer_id, tempering_layout_id, count(*) as count1
+ from big_storage_cage_details
+ where state = 100
+ group by engineer_id, tempering_layout_id) as a
+ left join
+ (select engineer_id, tempering_layout_id, count(*) as count2
+ from glass_info
+ group by engineer_id, tempering_layout_id) as b
+ on a.engineer_id = b.engineer_id and a.tempering_layout_id = b.tempering_layout_id
+ left join damage as c
+ on a.engineer_id = c.engineer_id and a.tempering_layout_id = c.tempering_layout_id and
+ (type = 8 or type = 9)
+ group by a.engineer_id, a.tempering_layout_id
+ order by a.engineer_id, a.tempering_layout_id
+ </select>
+
+ <select id="queryIsAllNeedDispatchVirtualSlot" resultMap="virtualSlotSequenceDTO">
+ with relation_temp as (
+ select engineer_id, tempering_layout_id, virtual_slot, count(1) as slot_count
+ from big_storage_glass_relation_info
+ group by engineer_id, tempering_layout_id, virtual_slot
+ ),
+ details_temp as (
+ select t.engineer_id, t.tempering_layout_id, t.virtual_slot, count(1) as slot_count
+ from big_storage_glass_relation_info t
+ left join big_storage_cage_details t1 on
+ t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and
+ t.tempering_feed_sequence = t1.tempering_feed_sequence
+ where t1.state = 100
+ group by t.engineer_id, t.tempering_layout_id, t.virtual_slot
+ ),
+ result_one as (
+ select t.*, t1.slot_count as tslot_count
+ from relation_temp t
+ INNER JOIN details_temp t1 on t.engineer_id = t1.engineer_id and
+ t.tempering_layout_id = t1.tempering_layout_id and
+ t.virtual_slot = t1.virtual_slot
+ where t.slot_count = t1.slot_count
+ )
+ select engineer_id, tempering_layout_id, virtual_slot
+ from result_one
+ order by engineer_id, tempering_layout_id
+ </select>
+
+ <select id="queryNeedDispatchSlot" resultMap="baseSlotSequenceDTO">
+ with glass_id_temp as (
+ select engineer_id, tempering_layout_id, tempering_feed_sequence
+ from big_storage_glass_relation_info
+ where (engineer_id, tempering_layout_id, virtual_slot) =
+ (#{engineerId}, #{temperingLayoutId}, #{virtualSlot})
+ )
+ select t.slot, max(t1.tempering_feed_sequence) as max_sequence, min(t1.tempering_feed_sequence) as min_sequence
+ from big_storage_cage_details t
+ inner join big_storage_glass_relation_info t1
+ on t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and
+ t.tempering_feed_sequence = t1.tempering_feed_sequence
+ where (t.engineer_id, t.tempering_layout_id, t.tempering_feed_sequence) in
+ (select engineer_id, tempering_layout_id, tempering_feed_sequence from glass_id_temp)
+ and t.state = 100
+ group by t.slot
+ order by max_sequence
</select>
</mapper>
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml
index 954de19..3c508d8 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper">
- <resultMap id="bigStorageDTO" type="com.mes.bigstorage.entity.BigStorageDTO">
+ <resultMap id="bigStorageDTO" type="com.mes.bigstorage.entity.dto.BigStorageDTO">
<result column="REMAIN_WIDTH" property="width"/>
<result column="GLASS_COUNT" property="glassCount"/>
</resultMap>
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageGlassRelationInfoMapper.xml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageGlassRelationInfoMapper.xml
new file mode 100644
index 0000000..88cf822
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageGlassRelationInfoMapper.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.mes.bigstorage.mapper.BigStorageGlassRelationInfoMapper">
+
+ <select id="queryNeedOutGlassId" resultType="java.lang.String">
+ select glass_id
+ from glass_info
+ where (engineer_id, tempering_layout_id, tempering_feed_sequence) in (
+ SELECT engineer_id, tempering_layout_id, tempering_feed_sequence
+ FROM big_storage_glass_relation_info
+ WHERE (engineer_id, tempering_layout_id, virtual_slot) =
+ (SELECT engineer_id, tempering_layout_id, virtual_slot
+ FROM big_storage_glass_relation_info
+ WHERE engineer_id = #{engineerId}
+ and tempering_layout_id = #{temperingLayoutId}
+ and tempering_feed_sequence = #{temperingFeedSequence}
+ )
+ )
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/resources/application-yw.yml b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/resources/application-yw.yml
new file mode 100644
index 0000000..28ab7a4
--- /dev/null
+++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/resources/application-yw.yml
@@ -0,0 +1,28 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://192.168.2.100:3306/hangzhoumes?serverTimezone=GMT%2b8&allowMultiQueries=true
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ salve_hangzhoumes:
+ url: jdbc:sqlserver://192.168.2.100:1433;databasename=hangzhoumes
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+ druid:
+ wall:
+ multi-statement-allow: true
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 192.168.2.100:8848
+ redis:
+ database: 0
+ host: 192.168.2.100
+ port: 6379
+ password: 123456
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
index 0cfcb0c..0923dd2 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
@@ -7,7 +7,6 @@
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.query.MPJQueryWrapper;
import com.mes.engineering.entity.Engineering;
-import com.mes.engineering.mapper.EngineeringMapper;
import com.mes.engineering.service.EngineeringService;
import com.mes.pp.entity.OptimizeProject;
import com.mes.pp.mapper.OptimizeProjectMapper;
@@ -157,6 +156,10 @@
}
@Override
+ public List<Engineering> setRawGlassTaskRequest(Engineering request) {
+ return null;
+ }
+
public Object Engineering(Engineering request) {
return null;
}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-yw.yml b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-yw.yml
new file mode 100644
index 0000000..0a24d82
--- /dev/null
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-yw.yml
@@ -0,0 +1,33 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://192.168.2.100:3306/hangzhoumes?serverTimezone=GMT%2b8&allowMultiQueries=true
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ pp:
+ url: jdbc:mysql://192.168.2.100:3306/pp?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ sd:
+ url: jdbc:mysql://192.168.2.100:3306/sd?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ druid:
+ wall:
+ multi-statement-allow: true
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 192.168.2.100:8848
+ redis:
+ database: 0
+ host: 192.168.2.100
+ port: 6379
+ password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-yw.yml b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-yw.yml
new file mode 100644
index 0000000..1f08d98
--- /dev/null
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-yw.yml
@@ -0,0 +1,32 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://192.168.2.100:3306/hangzhoumes?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ pp:
+ url: jdbc:mysql://192.168.2.100:3306/pp?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ sd:
+ url: jdbc:mysql://192.168.2.100:3306/sd?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 192.168.2.100:8848
+ application:
+ name: temperingGlass
+ redis:
+ database: 0
+ host: 192.168.2.100
+ port: 6379
+ password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/changelog/ywChangelog.sql b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/changelog/ywChangelog.sql
index 9832dd6..98cb14c 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/changelog/ywChangelog.sql
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/changelog/ywChangelog.sql
@@ -199,7 +199,7 @@
start_slot int DEFAULT '0' COMMENT '璧峰鏍煎瓙',
target_slot int DEFAULT '0' COMMENT '鐩爣鏍煎瓙',
task_state int DEFAULT NULL COMMENT '浠诲姟鐘舵�� '
-)
+);
-- rollback DROP TABLE big_storage_cage_in_one_task;
-- changeset zsh:20241112003
@@ -256,7 +256,7 @@
start_slot int DEFAULT '0' COMMENT '璧峰鏍煎瓙',
target_slot int DEFAULT '0' COMMENT '鐩爣鏍煎瓙',
task_state int DEFAULT NULL COMMENT '浠诲姟鐘舵�� '
-)
+);
-- rollback DROP TABLE big_storage_cage_out_one_task;
-- changeset zsh:20241113002
@@ -303,3 +303,46 @@
INSERT INTO big_storage_cage_out_two_task(glass_id, start_slot, target_slot, task_state)
VALUES (NULL, 0, 0, 0);
+
+-- changeset zsh:20241126001
+-- preconditions onFail:CONTINUE onError:CONTINUE
+-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'big_storage_glass_info' and table_schema = 'hangzhoumes';
+CREATE TABLE big_storage_glass_info
+(
+ id bigint NOT NULL AUTO_INCREMENT COMMENT '澶х悊鐗囩淇℃伅琛╥d',
+ glass_id varchar(20) DEFAULT NULL COMMENT '鐜荤拑id',
+ flow_card_id varchar(20) DEFAULT NULL COMMENT '娴佺▼鍗″彿',
+ glass_type int DEFAULT NULL COMMENT '鐜荤拑绫诲瀷',
+ width double DEFAULT NULL COMMENT '瀹�',
+ height double DEFAULT NULL COMMENT '楂�',
+ thickness double DEFAULT NULL COMMENT '鍘氬害',
+ tempering_layout_id int DEFAULT NULL COMMENT '閽㈠寲鐗堝浘id',
+ tempering_feed_sequence int DEFAULT NULL COMMENT '閽㈠寲鐗堝浘鐗囧簭',
+ x_coordinate int DEFAULT NULL COMMENT 'x鍧愭爣',
+ y_coordinate int DEFAULT NULL COMMENT 'y鍧愭爣',
+ engineer_id varchar(50) DEFAULT NULL,
+ layer int DEFAULT NULL COMMENT '灞傚彿',
+ virtual_slot int DEFAULT NULL COMMENT '铏氭嫙鏍煎瓙鍙�',
+ slot_sequence int DEFAULT NULL COMMENT '鏍煎瓙娆″簭',
+ PRIMARY KEY (id) USING BTREE
+);
+-- rollback DROP TABLE big_storage_glass_info;
+
+-- changeset zsh:20241126002
+-- preconditions onFail:CONTINUE onError:CONTINUE
+-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'big_storage_glass_relation_info' and table_schema = 'hangzhoumes';
+CREATE TABLE big_storage_glass_relation_info
+(
+ id bigint NOT NULL AUTO_INCREMENT COMMENT '閽㈠寲鐜荤拑鍏崇郴琛╥d',
+ engineer_id varchar(50) DEFAULT NULL,
+ glass_id varchar(20) DEFAULT NULL COMMENT '鐜荤拑id',
+ tempering_layout_id int DEFAULT NULL COMMENT '閽㈠寲鐗堝浘id',
+ tempering_feed_sequence int DEFAULT NULL COMMENT '閽㈠寲鐗堝浘鐗囧簭',
+ virtual_slot int DEFAULT NULL COMMENT '铏氭嫙鏍煎瓙',
+ slot_sequence int DEFAULT NULL COMMENT '鏍煎瓙鍐呮搴�',
+ slot int DEFAULT NULL COMMENT '瀹為檯鏍煎瓙鍙�',
+ device_id int DEFAULT NULL COMMENT '瀹為檯绗煎瓙鍙�',
+ PRIMARY KEY (id) USING BTREE
+);
+-- rollback DROP TABLE big_storage_glass_relation_info;
+
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-yw.yml b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-yw.yml
new file mode 100644
index 0000000..720c9a3
--- /dev/null
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-yw.yml
@@ -0,0 +1,25 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://192.168.2.100:3306/hangzhoumes?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ pp:
+ url: jdbc:mysql://192.168.2.100:3306/pp?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 192.168.2.100:8848
+ redis:
+ database: 0
+ host: 192.168.2.100
+ port: 6379
+ password: 123456
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/pom.xml b/hangzhoumesParent/moduleService/howllowGlassModule/pom.xml
new file mode 100644
index 0000000..87ee9eb
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/pom.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>moduleService</artifactId>
+ <groupId>com.mes</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>howllowGlass</artifactId>
+
+ <properties>
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+ </properties>
+
+</project>
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/HollowGlassApplication.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/HollowGlassApplication.java
new file mode 100644
index 0000000..d981d97
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/HollowGlassApplication.java
@@ -0,0 +1,27 @@
+package com.mes;
+
+import lombok.extern.slf4j.Slf4j;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/28 14:21
+ * @Description:
+ */
+@Slf4j
+@SpringBootApplication
+@EnableSwagger2WebMvc
+@EnableDiscoveryClient
+@MapperScan(basePackages = "com.mes.*.mapper")
+@EnableScheduling
+public class HollowGlassApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(HollowGlassApplication.class, args);
+ }
+}
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java
new file mode 100644
index 0000000..6b96a2e
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java
@@ -0,0 +1,18 @@
+package com.mes.hollow.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * (HollowBigStorageCage)琛ㄦ帶鍒跺眰
+ *
+ * @author makejava
+ * @since 2024-11-21 09:22:39
+ */
+@RestController
+@RequestMapping("hollowBigStorageCage")
+public class HollowBigStorageCageController {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageDetailsController.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageDetailsController.java
new file mode 100644
index 0000000..053b1bf
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageDetailsController.java
@@ -0,0 +1,18 @@
+package com.mes.hollow.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * (HollowBigStorageCageDetails)琛ㄦ帶鍒跺眰
+ *
+ * @author makejava
+ * @since 2024-11-21 09:23:12
+ */
+@RestController
+@RequestMapping("hollowBigStorageCageDetails")
+public class HollowBigStorageCageDetailsController {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
new file mode 100644
index 0000000..12b593a
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
@@ -0,0 +1,34 @@
+package com.mes.hollow.controller;
+
+
+import com.mes.hollow.entity.HollowGlassOutRelationInfo;
+import com.mes.hollow.service.HollowGlassOutRelationInfoService;
+import com.mes.utils.Result;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * (HollowGlassOutRelationInfo)琛ㄦ帶鍒跺眰
+ *
+ * @author makejava
+ * @since 2024-11-30 13:57:28
+ */
+@RestController
+@RequestMapping("hollowGlassOutRelationInfo")
+public class HollowGlassOutRelationInfoController {
+
+ @Resource
+ HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService;
+
+ @ApiOperation("棰嗗彇浠诲姟")
+ @PostMapping("/receiveTask")
+ public Result<HollowGlassOutRelationInfo> receiveTask(String flowCardId, int cell, int totalPairQuantity) {
+ return Result.success(hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell, totalPairQuantity));
+ }
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassRelationInfoController.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassRelationInfoController.java
new file mode 100644
index 0000000..8a7ed1e
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassRelationInfoController.java
@@ -0,0 +1,45 @@
+package com.mes.hollow.controller;
+
+
+import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
+import com.mes.hollow.entity.dto.LackDetailsDTO;
+import com.mes.hollow.service.HollowGlassRelationInfoService;
+import com.mes.utils.Result;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * (HollowGlassRelationInfo)琛ㄦ帶鍒跺眰
+ *
+ * @author makejava
+ * @since 2024-11-23 15:59:27
+ */
+@RestController
+@RequestMapping("hollowGlassRelationInfo")
+public class HollowGlassRelationInfoController {
+
+ @Resource
+ HollowGlassRelationInfoService hollowGlassRelationInfoService;
+
+ @ApiOperation("鐣岄潰鐐瑰嚮鍒涘缓浠诲姟锛氭煡璇腑绌烘墍鏈夋祦绋嬪崱瀵瑰簲鐨勭幓鐠冧俊鎭�")
+ @PostMapping("/queryHollowAllFlowCard")
+ public Result<Map<String, List<FlowCardGlassInfoDTO>>> queryHollowAllFlowCard() {
+ Map<String, List<FlowCardGlassInfoDTO>> bigStorageCageDetails = hollowGlassRelationInfoService.queryHollowAllFlowCard();
+ return Result.success(bigStorageCageDetails);
+ }
+
+ @ApiOperation("鏌ヨ鎸囧畾娴佺▼鍗″強灞傛暟鐨勭己鐗囪鎯�")
+ @PostMapping("/queryLackByFlowCard")
+ public Result<List<LackDetailsDTO>> queryLackByFlowCard(String flowCardId, int layer) {
+ List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryLackByFlowCard(flowCardId, layer);
+ return Result.success(lackDetailsList);
+ }
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCage.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCage.java
new file mode 100644
index 0000000..2e6c606
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCage.java
@@ -0,0 +1,47 @@
+package com.mes.hollow.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+/**
+ * (HollowBigStorageCage)琛ㄥ疄浣撶被
+ *
+ * @author makejava
+ * @since 2024-11-21 09:22:45
+ */
+@Data
+public class HollowBigStorageCage {
+ /**
+ * /*澶х悊鐗囩琛╥d
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+ /**
+ * /*璁惧id
+ */
+ private Integer deviceId;
+ /**
+ * /*鏍呮牸鍙�
+ */
+ private Integer slot;
+ /**
+ * /*鏈�灏忓帤搴�
+ */
+ private Integer minThickness;
+ /**
+ * /*鏈�澶у帤搴�
+ */
+ private Integer maxThickness;
+ /**
+ * /*鍚敤鐘舵��
+ */
+ private Integer enableState;
+ /**
+ * /*鍓╀綑瀹藉害
+ */
+ private Integer remainWidth;
+
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCageDetails.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCageDetails.java
new file mode 100644
index 0000000..fb77157
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCageDetails.java
@@ -0,0 +1,81 @@
+package com.mes.hollow.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.mes.base.entity.HollowBigStorageCageBaseInfo;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * (HollowBigStorageCageDetails)琛ㄥ疄浣撶被
+ *
+ * @author makejava
+ * @since 2024-11-21 09:23:12
+ */
+@Data
+public class HollowBigStorageCageDetails extends HollowBigStorageCageBaseInfo {
+ /**
+ * /*澶х悊鐗囩璇︽儏琛╥d
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+ /**
+ * 璁惧id
+ */
+ private Integer deviceId;
+ /**
+ * /*铏氭嫙鏍煎瓙
+ */
+ private Integer virtualSlot;
+ /**
+ * /*灏忕墖鍦ㄦ牸鍐呯殑椤哄簭
+ */
+ private Integer sequence;
+ /**
+ * /*娴佺▼鍗″彿
+ */
+ private String flowCardId;
+ /**
+ * /*鐜荤拑绫诲瀷
+ */
+ private Integer glassType;
+ /**
+ * 鑶滅郴
+ */
+ private String filmsId;
+ /**
+ * /*鍘氬害
+ */
+ private Double thickness;
+ /**
+ * /*鐘舵��
+ */
+ private Integer state;
+ /**
+ * /*鐜荤拑闂撮殭
+ */
+ private Integer gap;
+
+ private String engineerId;
+ /**
+ * /*灞傚彿
+ */
+ private Integer totalLayer;
+
+ /**
+ * /*灞傚彿
+ */
+ private Integer hollowSequence;
+
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ private Date createTime;
+ /**
+ * 鏇存柊鏃堕棿
+ */
+ private Date updateTime;
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationInfo.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationInfo.java
new file mode 100644
index 0000000..4882347
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationInfo.java
@@ -0,0 +1,57 @@
+package com.mes.hollow.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * (HollowGlassOutRelationInfo)琛ㄥ疄浣撶被
+ *
+ * @author makejava
+ * @since 2024-11-30 13:57:29
+ */
+@Data
+public class HollowGlassOutRelationInfo {
+ /**
+ * /*涓┖鐜荤拑鍏崇郴琛╥d
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+ /**
+ * /*娴佺▼鍗�
+ */
+ private String flowCardId;
+ /**
+ * /*鎬诲眰鏁�
+ */
+ private Integer totalLayer;
+ /**
+ * /*璺嚎
+ */
+ private Integer cell;
+ /**
+ * /*鐘舵��0鏂板 1鎵ц涓� 2鏆傚仠 3缁撴潫
+ */
+ private Integer state;
+ /**
+ * 鎬婚厤瀵规暟閲�
+ */
+ private Integer totalPairQuantity;
+ /**
+ * 宸插畬鎴愰厤瀵规暟閲�
+ */
+ private Integer pairQuantity;
+ /**
+ * /*鍒涘缓鏃堕棿
+ */
+ private Date createTime;
+ /**
+ * /*鏇存柊鏃堕棿
+ */
+ private Date updateTime;
+
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassRelationInfo.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassRelationInfo.java
new file mode 100644
index 0000000..cb8336f
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassRelationInfo.java
@@ -0,0 +1,91 @@
+package com.mes.hollow.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+/**
+ * (HollowGlassRelationInfo)琛ㄥ疄浣撶被
+ *
+ * @author makejava
+ * @since 2024-11-23 15:59:29
+ */
+@Data
+public class HollowGlassRelationInfo {
+ /**
+ * /*涓┖鐜荤拑鍏崇郴琛╥d
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 宸ョ▼鍙�
+ */
+ private String engineerId;
+
+ /**
+ * 閽㈠寲鐗堝浘id
+ */
+ private Integer temperingLayoutId;
+
+ /**
+ * 閽㈠寲鐗堝浘鐗囧簭
+ */
+ private Integer temperingFeedSequence;
+
+ /**
+ * /*鐜荤拑ID
+ */
+ private String glassId;
+ /**
+ * /*娴佺▼鍗�
+ */
+ private String flowCardId;
+
+ /**
+ * 鑶滅郴
+ */
+ private String filmsId;
+
+ /**
+ * 瀹藉害
+ */
+ private double width;
+
+ /**
+ * 楂樺害
+ */
+ private double height;
+
+ /**
+ * /*鍘氬害
+ */
+ private Double thickness;
+ /**
+ * /*鎬诲眰鏁�
+ */
+ private Integer totalLayer;
+ /**
+ * /*灞傛暟
+ */
+ private Integer layer;
+ /**
+ * /*铏氭嫙鏍煎瓙鍙�
+ */
+ private Integer virtualSlot;
+ /**
+ * /*涓┖鏍煎瓙娆″簭
+ */
+ private Integer slotSequence;
+ /**
+ * /*涓┖鎬绘搴�
+ */
+ private Integer hollowSequence;
+ /**
+ * /*涓┖鎬绘搴�
+ */
+ private Integer orderSort;
+
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/BigStorageSequenceDTO.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/BigStorageSequenceDTO.java
new file mode 100644
index 0000000..151d858
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/BigStorageSequenceDTO.java
@@ -0,0 +1,17 @@
+package com.mes.hollow.entity.dto;
+
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/25 18:53
+ * @Description:
+ */
+@Data
+public class BigStorageSequenceDTO {
+
+ private Integer slot;
+ private Integer maxSequence;
+ private Integer minSequence;
+
+}
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardGlassInfoDTO.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardGlassInfoDTO.java
new file mode 100644
index 0000000..e5da531
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardGlassInfoDTO.java
@@ -0,0 +1,49 @@
+package com.mes.hollow.entity.dto;
+
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/30 13:34
+ * @Description:
+ */
+@Data
+public class FlowCardGlassInfoDTO {
+
+ /**
+ * 宸ョ▼鍙�
+ */
+ private String engineerId;
+ /**
+ * 娴佺▼鍗�
+ */
+ private String flowCardId;
+ /**
+ * 鑶滅郴
+ */
+ private String filmsId;
+ /**
+ * 灞傚彿
+ */
+ private int layer;
+ /**
+ * 灞傚彿
+ */
+ private int sumCount;
+ /**
+ * 閰嶅鏁伴噺
+ */
+ private int pairCount;
+ /**
+ * 瀹為檯鏁伴噺
+ */
+ private int realCount;
+ /**
+ * 鐮存崯鏁伴噺
+ */
+ private int damageCount;
+ /**
+ * 缂哄皯鏁伴噺
+ */
+ private int lackCount;
+}
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardVirtualSlotDTO.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardVirtualSlotDTO.java
new file mode 100644
index 0000000..84670d9
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardVirtualSlotDTO.java
@@ -0,0 +1,25 @@
+package com.mes.hollow.entity.dto;
+
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/30 16:10
+ * @Description:
+ */
+@Data
+public class FlowCardVirtualSlotDTO {
+
+ /**
+ * 娴佺▼鍗″彿
+ */
+ private String flowCardId;
+ /**
+ * 灞傚彿
+ */
+ private Integer layer;
+ /**
+ * /*铏氭嫙鏍煎瓙
+ */
+ private Integer virtualSlot;
+}
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/HollowBigStorageDTO.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/HollowBigStorageDTO.java
new file mode 100644
index 0000000..343c97a
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/HollowBigStorageDTO.java
@@ -0,0 +1,31 @@
+package com.mes.hollow.entity.dto;
+
+import com.mes.hollow.entity.HollowGlassRelationInfo;
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/27 11:36
+ * @Description:
+ */
+@Data
+public class HollowBigStorageDTO extends HollowGlassRelationInfo {
+ /**
+ * 鏍煎瓙鍙�
+ */
+ private Integer slot;
+ /**
+ * 鍓╀綑瀹藉害
+ */
+ private Integer remainWidth;
+
+ /**
+ * 鐜荤拑鏁伴噺
+ */
+ private Integer glassCount;
+
+ /**
+ * 绗煎瓙鍙�
+ */
+ private Integer deviceId;
+}
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/HollowGlassDetailsDTO.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/HollowGlassDetailsDTO.java
new file mode 100644
index 0000000..f4347e1
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/HollowGlassDetailsDTO.java
@@ -0,0 +1,50 @@
+package com.mes.hollow.entity.dto;
+
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/28 23:35
+ * @Description:
+ */
+@Data
+public class HollowGlassDetailsDTO {
+
+ /**
+ * 娴佺▼鍗″彿
+ */
+ private String flowCardId;
+
+ /**
+ * 娴佺▼鍗″彿
+ */
+ private Integer orderSort;
+ /**
+ * 瀹藉害
+ */
+ private double width;
+
+ /**
+ * 楂樺害
+ */
+ private double height;
+
+ /**
+ * /*鍘氬害
+ */
+ private double thickness;
+ /**
+ * /*灞傛暟
+ */
+ private Integer layer;
+
+ /**
+ * 鏁伴噺
+ */
+ private Integer quantity;
+
+ /**
+ * /*涓┖鎬绘搴�
+ */
+ private Integer hollowSequence;
+}
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/LackDetailsDTO.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/LackDetailsDTO.java
new file mode 100644
index 0000000..03b3924
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/LackDetailsDTO.java
@@ -0,0 +1,53 @@
+package com.mes.hollow.entity.dto;
+
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/11/25 18:53
+ * @Description:
+ */
+@Data
+public class LackDetailsDTO {
+
+ /**
+ * 娴佺▼鍗�
+ */
+ private String flowCardId;
+ /**
+ * 娴佺▼鍗�
+ */
+ private int layer;
+ /**
+ * 鑶滅郴
+ */
+ private String filmsId;
+ /**
+ * 瀹藉害
+ */
+ private double width;
+
+ /**
+ * 楂樺害
+ */
+ private double height;
+
+ /**
+ * /*鍘氬害
+ */
+ private Double thickness;
+ /**
+ * /*鎬荤墖鏁�
+ */
+ private Integer totalCount;
+ /**
+ * /*缂哄皯鐗囨暟
+ */
+ private Integer lackCount;
+ /**
+ * /*鐮存崯鐗囨暟
+ */
+ private Integer damageCount;
+
+
+}
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/UpdateHollowBigStorageCageDTO.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/UpdateHollowBigStorageCageDTO.java
new file mode 100644
index 0000000..e0c9392
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/UpdateHollowBigStorageCageDTO.java
@@ -0,0 +1,16 @@
+package com.mes.hollow.entity.dto;
+
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/7/26 9:05
+ * @Description:
+ */
+@Data
+public class UpdateHollowBigStorageCageDTO {
+
+ private String glassId;
+
+ private int targetSlot;
+}
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
new file mode 100644
index 0000000..699d21d
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
@@ -0,0 +1,31 @@
+package com.mes.hollow.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.hollow.entity.HollowBigStorageCageDetails;
+import com.mes.hollow.entity.dto.BigStorageSequenceDTO;
+import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
+import com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO;
+import com.mes.hollow.entity.dto.UpdateHollowBigStorageCageDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * (HollowBigStorageCageDetails)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author makejava
+ * @since 2024-11-21 09:23:12
+ */
+public interface HollowBigStorageCageDetailsMapper extends BaseMapper<HollowBigStorageCageDetails> {
+
+ void updateBySlot(@Param("list") List<UpdateHollowBigStorageCageDTO> storageCageDTOList, @Param("state") Integer state);
+
+ List<FlowCardGlassInfoDTO> hollowIsAll(@Param("flowCardId") String flowCardId, @Param("totalLayer") int totalLayer, @Param("flag") Boolean flag);
+
+ List<FlowCardVirtualSlotDTO> queryIsAllNeedDispatchVirtualSlot();
+
+ List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO);
+
+ List<HollowBigStorageCageDetails> queryOutGlassList(@Param("flowCardId") String flowCardId, @Param("cell") int cell);
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageMapper.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageMapper.java
new file mode 100644
index 0000000..b8f0656
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageMapper.java
@@ -0,0 +1,15 @@
+package com.mes.hollow.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.hollow.entity.HollowBigStorageCage;
+
+/**
+ * (HollowBigStorageCage)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author makejava
+ * @since 2024-11-21 09:22:40
+ */
+public interface HollowBigStorageCageMapper extends BaseMapper<HollowBigStorageCage> {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassOutRelationInfoMapper.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassOutRelationInfoMapper.java
new file mode 100644
index 0000000..4b542cb
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassOutRelationInfoMapper.java
@@ -0,0 +1,15 @@
+package com.mes.hollow.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.hollow.entity.HollowGlassOutRelationInfo;
+
+/**
+ * (HollowGlassOutRelationInfo)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author makejava
+ * @since 2024-11-30 13:57:28
+ */
+public interface HollowGlassOutRelationInfoMapper extends BaseMapper<HollowGlassOutRelationInfo> {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java
new file mode 100644
index 0000000..611fd94
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java
@@ -0,0 +1,27 @@
+package com.mes.hollow.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.hollow.entity.HollowGlassRelationInfo;
+import com.mes.hollow.entity.dto.HollowGlassDetailsDTO;
+import com.mes.hollow.entity.dto.LackDetailsDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * (HollowGlassRelationInfo)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author makejava
+ * @since 2024-11-23 15:59:29
+ */
+public interface HollowGlassRelationInfoMapper extends BaseMapper<HollowGlassRelationInfo> {
+
+
+ List<HollowGlassDetailsDTO> queryFlowCardIdMaxLayerGlassInfo(@Param("flowCardId") String flowCardId, @Param("totalLayer") int totalLayer);
+
+
+ List<HollowGlassDetailsDTO> queryFlowCardIdLayerGlassInfo(@Param("flowCardId") String flowCardId, @Param("totalLayer") int totalLayer, @Param("layer") int layer);
+
+ List<LackDetailsDTO> queryLackByFlowCard(String flowCardId, int layer);
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
new file mode 100644
index 0000000..0e1feb6
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
@@ -0,0 +1,31 @@
+package com.mes.hollow.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.hollow.entity.HollowBigStorageCageDetails;
+import com.mes.hollow.entity.dto.BigStorageSequenceDTO;
+import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
+import com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO;
+import com.mes.hollow.entity.dto.UpdateHollowBigStorageCageDTO;
+
+import java.util.List;
+
+/**
+ * (HollowBigStorageCageDetails)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author makejava
+ * @since 2024-11-21 09:23:12
+ */
+public interface HollowBigStorageCageDetailsService extends IService<HollowBigStorageCageDetails> {
+
+ void updateBySlot(List<UpdateHollowBigStorageCageDTO> storageCageDTOList, Integer glassStateIn);
+
+ List<FlowCardGlassInfoDTO> hollowIsAll(String flow_card_id, Integer totalLayer, Boolean flag);
+
+
+ List<FlowCardVirtualSlotDTO> queryIsAllNeedDispatchVirtualSlot();
+
+ List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO);
+
+ List<HollowBigStorageCageDetails> queryOutGlassList(String flowCardId, int cell);
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageService.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageService.java
new file mode 100644
index 0000000..88b3fd8
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageService.java
@@ -0,0 +1,15 @@
+package com.mes.hollow.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.hollow.entity.HollowBigStorageCage;
+
+/**
+ * (HollowBigStorageCage)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author makejava
+ * @since 2024-11-21 09:22:45
+ */
+public interface HollowBigStorageCageService extends IService<HollowBigStorageCage> {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
new file mode 100644
index 0000000..999c34e
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
@@ -0,0 +1,16 @@
+package com.mes.hollow.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.hollow.entity.HollowGlassOutRelationInfo;
+
+/**
+ * (HollowGlassOutRelationInfo)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author makejava
+ * @since 2024-11-30 13:57:29
+ */
+public interface HollowGlassOutRelationInfoService extends IService<HollowGlassOutRelationInfo> {
+
+ HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell, int totalPairQuantity);
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassRelationInfoService.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassRelationInfoService.java
new file mode 100644
index 0000000..d5e5f59
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassRelationInfoService.java
@@ -0,0 +1,36 @@
+package com.mes.hollow.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.hollow.entity.HollowGlassRelationInfo;
+import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
+import com.mes.hollow.entity.dto.HollowBigStorageDTO;
+import com.mes.hollow.entity.dto.LackDetailsDTO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * (HollowGlassRelationInfo)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author makejava
+ * @since 2024-11-23 15:59:30
+ */
+public interface HollowGlassRelationInfoService extends IService<HollowGlassRelationInfo> {
+ /**
+ * 鎸夌収鐜荤拑id鑾峰彇涓┖鐩爣鏍煎瓙
+ *
+ * @return
+ */
+ HollowBigStorageDTO queryHollowTargetSlot(String flowCardId, double width, double height, int totalLayer, int layer);
+
+ /**
+ * 鐢熸垚涓┖鐜荤拑淇℃伅
+ */
+ void generateHollowGlassInfo(String flowCardId, int totalLayer, int layer);
+
+ Map<String, List<FlowCardGlassInfoDTO>> queryHollowAllFlowCard();
+
+ List<LackDetailsDTO> queryLackByFlowCard(String flowCardId, int layer);
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
new file mode 100644
index 0000000..9331204
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
@@ -0,0 +1,52 @@
+package com.mes.hollow.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.hollow.entity.HollowBigStorageCageDetails;
+import com.mes.hollow.entity.dto.BigStorageSequenceDTO;
+import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
+import com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO;
+import com.mes.hollow.entity.dto.UpdateHollowBigStorageCageDTO;
+import com.mes.hollow.mapper.HollowBigStorageCageDetailsMapper;
+import com.mes.hollow.service.HollowBigStorageCageDetailsService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * (HollowBigStorageCageDetails)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author makejava
+ * @since 2024-11-21 09:23:12
+ */
+@Service
+@Slf4j
+public class HollowBigStorageCageDetailsServiceImpl extends ServiceImpl<HollowBigStorageCageDetailsMapper, HollowBigStorageCageDetails> implements HollowBigStorageCageDetailsService {
+
+
+ @Override
+ public void updateBySlot(List<UpdateHollowBigStorageCageDTO> storageCageDTOList, Integer state) {
+ baseMapper.updateBySlot(storageCageDTOList, state);
+ }
+
+ @Override
+ public List<FlowCardGlassInfoDTO> hollowIsAll(String flow_card_id, Integer totalLayer, Boolean flag) {
+ return baseMapper.hollowIsAll(flow_card_id, totalLayer, flag);
+ }
+
+ @Override
+ public List<FlowCardVirtualSlotDTO> queryIsAllNeedDispatchVirtualSlot() {
+ return baseMapper.queryIsAllNeedDispatchVirtualSlot();
+ }
+
+ @Override
+ public List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO) {
+ return baseMapper.queryNeedDispatchSlot(flowCardVirtualSlotDTO);
+ }
+
+ @Override
+ public List<HollowBigStorageCageDetails> queryOutGlassList(String flowCardId, int cell) {
+ return baseMapper.queryOutGlassList(flowCardId, cell);
+ }
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageServiceImpl.java
new file mode 100644
index 0000000..68350a7
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageServiceImpl.java
@@ -0,0 +1,19 @@
+package com.mes.hollow.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.hollow.entity.HollowBigStorageCage;
+import com.mes.hollow.mapper.HollowBigStorageCageMapper;
+import com.mes.hollow.service.HollowBigStorageCageService;
+import org.springframework.stereotype.Service;
+
+/**
+ * (HollowBigStorageCage)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author makejava
+ * @since 2024-11-21 09:22:46
+ */
+@Service
+public class HollowBigStorageCageServiceImpl extends ServiceImpl<HollowBigStorageCageMapper, HollowBigStorageCage> implements HollowBigStorageCageService {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
new file mode 100644
index 0000000..63438cc
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -0,0 +1,47 @@
+package com.mes.hollow.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.common.config.Const;
+import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.service.GlassInfoService;
+import com.mes.hollow.entity.HollowGlassOutRelationInfo;
+import com.mes.hollow.mapper.HollowGlassOutRelationInfoMapper;
+import com.mes.hollow.service.HollowGlassOutRelationInfoService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * (HollowGlassOutRelationInfo)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author makejava
+ * @since 2024-11-30 13:57:29
+ */
+@Service
+@Slf4j
+public class HollowGlassOutRelationInfoServiceImpl extends ServiceImpl<HollowGlassOutRelationInfoMapper, HollowGlassOutRelationInfo> implements HollowGlassOutRelationInfoService {
+
+ @Resource
+ GlassInfoService glassInfoService;
+
+ @Override
+ public HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell, int totalPairQuantity) {
+ GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, flowCardId).last("limit 1"));
+ HollowGlassOutRelationInfo info = new HollowGlassOutRelationInfo();
+ if (null == glassInfo) {
+ log.info("璇ユ祦绋嬪崱淇℃伅绯荤粺鏈壘鍒�");
+ return info;
+ }
+ info.setFlowCardId(flowCardId);
+ info.setCell(cell);
+ info.setTotalLayer(glassInfo.getTotalLayer());
+ info.setTotalLayer(glassInfo.getTotalLayer());
+ info.setState(Const.HOLLOW_FLOW_CARD_NEW);
+ info.setTotalPairQuantity(totalPairQuantity);
+ this.save(info);
+ return info;
+ }
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
new file mode 100644
index 0000000..d699497
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
@@ -0,0 +1,258 @@
+package com.mes.hollow.service.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.common.config.Const;
+import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.service.GlassInfoService;
+import com.mes.hollow.entity.HollowBigStorageCage;
+import com.mes.hollow.entity.HollowBigStorageCageDetails;
+import com.mes.hollow.entity.HollowGlassRelationInfo;
+import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
+import com.mes.hollow.entity.dto.HollowBigStorageDTO;
+import com.mes.hollow.entity.dto.HollowGlassDetailsDTO;
+import com.mes.hollow.entity.dto.LackDetailsDTO;
+import com.mes.hollow.mapper.HollowGlassRelationInfoMapper;
+import com.mes.hollow.service.HollowBigStorageCageDetailsService;
+import com.mes.hollow.service.HollowBigStorageCageService;
+import com.mes.hollow.service.HollowGlassRelationInfoService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * (HollowGlassRelationInfo)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author makejava
+ * @since 2024-11-23 15:59:30
+ */
+@Service
+@Slf4j
+public class HollowGlassRelationInfoServiceImpl extends ServiceImpl<HollowGlassRelationInfoMapper, HollowGlassRelationInfo> implements HollowGlassRelationInfoService {
+
+ @Resource
+ GlassInfoService glassInfoService;
+ @Resource
+ HollowBigStorageCageService hollowBigStorageCageService;
+ @Resource
+ HollowGlassRelationInfoService hollowGlassRelationInfoService;
+ @Resource
+ HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService;
+ @Value("${mes.slotWidth}")
+ private Integer slotWidth;
+ @Value("${mes.glassGap}")
+ private Integer glassGap;
+
+ @Value("${mes.outCarMaxSize}")
+ private Integer outCarMaxSize;
+
+ @Override
+ public HollowBigStorageDTO queryHollowTargetSlot(String flowCardId, double width, double height, int totalLayer, int layer) {
+ //鎸夌収鐜荤拑淇℃伅鑾峰彇鍏崇郴琛ㄤ腑瀵瑰簲鐨勫ぇ鐞嗙墖绗兼牸瀛愬彿
+ HollowGlassRelationInfo relationInfoOne = hollowGlassRelationInfoService.getOne(new LambdaQueryWrapper<HollowGlassRelationInfo>()
+ .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId)
+ .eq(HollowGlassRelationInfo::getWidth, width)
+ .eq(HollowGlassRelationInfo::getHeight, height)
+ .eq(HollowGlassRelationInfo::getLayer, layer)
+ .isNull(HollowGlassRelationInfo::getTemperingLayoutId)
+ .isNull(HollowGlassRelationInfo::getTemperingFeedSequence)
+ .orderByAsc(HollowGlassRelationInfo::getHollowSequence)
+ .last("limit 1")
+ );
+ if (relationInfoOne == null) {
+ //鐞嗙墖绗煎叧绯昏〃涓病鏈夊搴旂殑鏁版嵁锛屾煡鐪嬬悊鐗囩铏氭嫙浣嶇疆琛ㄦ槸鍚︽湁鏈伐绋嬩笅鐨勬墍鏈夌幓鐠冭櫄鎷熶俊鎭�
+ //铏氭嫙浣嶇疆琛ㄦ病鏈夋湰宸ョ▼涓嬬殑鎵�鏈夌幓鐠冭櫄鎷熶俊鎭紝鎸夌収鐜荤拑id鐢熸垚鏈伐绋嬩笅鎵�鏈夌幓鐠冪殑铏氭嫙淇℃伅
+ generateHollowGlassInfo(flowCardId, totalLayer, layer);
+ relationInfoOne = this.getOne(new LambdaQueryWrapper<HollowGlassRelationInfo>()
+ .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId)
+ .eq(HollowGlassRelationInfo::getWidth, width)
+ .eq(HollowGlassRelationInfo::getHeight, height)
+ .eq(HollowGlassRelationInfo::getLayer, layer)
+ .isNull(HollowGlassRelationInfo::getTemperingLayoutId)
+ .isNull(HollowGlassRelationInfo::getTemperingFeedSequence)
+ .orderByAsc(HollowGlassRelationInfo::getHollowSequence)
+ .last("limit 1")
+ );
+ }
+ HollowBigStorageCageDetails hollowDetails = hollowBigStorageCageDetailsService.getOne(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
+ .eq(HollowBigStorageCageDetails::getSlot, relationInfoOne.getVirtualSlot()).in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)
+ .orderByDesc(HollowBigStorageCageDetails::getSequence).last("limit 1"));
+ HollowBigStorageCage storageCage = null;
+ if (null == hollowDetails) {
+ storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
+ .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth).last("limit 1"));
+ HollowBigStorageDTO storageDTO = new HollowBigStorageDTO();
+ BeanUtils.copyProperties(storageCage, storageDTO);
+ BeanUtils.copyProperties(relationInfoOne, storageDTO);
+ return storageDTO;
+ }
+ HollowGlassRelationInfo relationInfoBefore = hollowGlassRelationInfoService.getOne(new LambdaQueryWrapper<HollowGlassRelationInfo>()
+ .eq(HollowGlassRelationInfo::getEngineerId, relationInfoOne.getEngineerId())
+ .eq(HollowGlassRelationInfo::getTemperingLayoutId, relationInfoOne.getTemperingLayoutId())
+ .eq(HollowGlassRelationInfo::getVirtualSlot, relationInfoOne.getVirtualSlot())
+ .eq(HollowGlassRelationInfo::getSlotSequence, relationInfoOne.getSlotSequence() - 1));
+ if (null == relationInfoBefore) {
+ //琛ㄧず搴忓彿娌℃湁鎴栬�� 搴忓彿涓�1鍙堜笉鏄涓�鍧楁潵鐨� 鏂板紑涓�鏍�
+ storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
+ .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth).last("limit 1"));
+ } else {
+ HollowBigStorageCageDetails beforeGlass = hollowBigStorageCageDetailsService.getOne(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
+ .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)
+ .eq(HollowBigStorageCageDetails::getEngineerId, relationInfoBefore.getEngineerId())
+ .eq(HollowBigStorageCageDetails::getTemperingLayoutId, relationInfoBefore.getTemperingLayoutId())
+ .eq(HollowBigStorageCageDetails::getTemperingFeedSequence, relationInfoBefore.getTemperingFeedSequence())
+ );
+ if (null == beforeGlass) {
+ storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
+ .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth).last("limit 1"));
+ } else {
+ storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
+ .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getSlot, beforeGlass.getSlot()));
+ }
+ }
+ Assert.isTrue(null != storageCage, "娌℃湁绌轰綑鐨勭瀛愬瓨鏀剧幓鐠�");
+ HollowBigStorageDTO storageDTO = new HollowBigStorageDTO();
+ BeanUtils.copyProperties(storageCage, storageDTO);
+ BeanUtils.copyProperties(relationInfoOne, storageDTO);
+ return storageDTO;
+ }
+
+ @Override
+ public void generateHollowGlassInfo(String flowCardId, int totalLayer, int layer) {
+
+ GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, flowCardId)
+ .eq(GlassInfo::getLayer, layer).last("limit 1"));
+ if (null == glassInfo) {
+ log.info("褰撳墠娴佺▼鍗′俊鎭负瀵煎叆mes绯荤粺娴佺▼鍗★細{}锛屽眰鏁皗}", flowCardId, layer);
+ return;
+ }
+ //鎸夌収娴佺▼鍗¤幏鍙栨湰娴佺▼鍗℃渶鍚庝竴灞傛垨绗竴娆$殑鐜荤拑鏁版嵁
+ List<HollowGlassDetailsDTO> glassDetailsDTOS = this.baseMapper.queryFlowCardIdMaxLayerGlassInfo(flowCardId, totalLayer);
+ if (CollectionUtil.isEmpty(glassDetailsDTOS)) {
+ log.info("褰撳墠娴佺▼鍗℃渶澶栧眰鏁版嵁鏈壘鍒帮紝璇峰湪erp纭鏁版嵁鏃犺锛屾祦绋嬪崱锛歿}锛屾�诲眰鏁皗}", flowCardId, totalLayer);
+ return;
+ }
+ if (totalLayer != layer) {
+ glassDetailsDTOS = this.baseMapper.queryFlowCardIdLayerGlassInfo(flowCardId, totalLayer, layer);
+ }
+ if (CollectionUtil.isEmpty(glassDetailsDTOS)) {
+ log.info("褰撳墠娴佺▼鍗℃渶澶栧眰鏁版嵁鏈壘鍒帮紝璇峰湪erp纭鏁版嵁鏃犺锛屾祦绋嬪崱锛歿}锛屾�诲眰鏁皗},灞傛暟{}", flowCardId, totalLayer, layer);
+ return;
+ }
+ ArrayList<HollowGlassDetailsDTO> tempGlassList = new ArrayList<>();
+ int hollowSequence = 1;
+ for (HollowGlassDetailsDTO item : glassDetailsDTOS) {
+ for (int i = 0; i < item.getQuantity(); i++) {
+ HollowGlassDetailsDTO dto = new HollowGlassDetailsDTO();
+ BeanUtils.copyProperties(item, dto);
+ dto.setHollowSequence(hollowSequence++);
+ tempGlassList.add(dto);
+ }
+ }
+ //鏂瑰紡涓�锛氬皢鐜荤拑鎸夋祦绋嬪崱銆佸昂瀵搞�佺増鍥俱�佺増搴� 渚濇鐢熸垚铏氭嫙鏍煎瓙淇℃伅锛屾牸瀛愪竴鐩村線鍚庣疮鍔�
+// flowCardIdMap.forEach((e, v) -> {
+// int remainWidth = slotWidth;
+// int slotNumber = 1;
+// for (GlassInfo item : v) {
+// int maxLength = (int) Math.max(item.getWidth(), item.getHeight());
+// if (remainWidth > maxLength) {
+// remainWidth = remainWidth - maxLength - glassGap;
+// } else {
+// slotNumber = slotNumber + 1;
+// remainWidth = slotWidth - maxLength - glassGap;
+// }
+// HollowGlassInfo hollow = new HollowGlassInfo();
+// BeanUtils.copyProperties(item, hollow);
+// hollow.setSlot(slotNumber);
+// hollowGlassInfoList.add(hollow);
+// }
+// });
+// this.saveBatch(hollowGlassInfoList);
+ //鑾峰彇涓┖澶х悊鐗囩鐨勬墍鏈夌┖闂叉牸瀛�
+// List<HollowBigStorageCage> hollowSlotList = HollowBigStorageCageService.list(new LambdaQueryWrapper<HollowBigStorageCage>()
+// .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth));
+ //鏂瑰紡浜岋細灏嗙幓鐠冩寜娴佺▼鍗°�佸昂瀵搞�佺増鍥俱�佺増搴� 锛屼紭鍏堝皢鏍煎瓙鍏ㄩ儴琛ュ叏鍚� 渚濇璁$畻鍚庨潰鐨勬牸瀛愬彿
+ List<HollowGlassRelationInfo> relationInfoList = new ArrayList();
+ List<List<HollowGlassRelationInfo>> tempHollowList = new ArrayList<>();
+ int slotNumber = 1;
+ for (HollowGlassDetailsDTO item : tempGlassList) {
+ boolean flag = false;
+ for (List<HollowGlassRelationInfo> temp : tempHollowList) {
+ int sum = 0;
+ for (HollowGlassRelationInfo i : temp) {
+ sum = sum + (int) Math.max(i.getHeight(), i.getWidth()) + glassGap;
+ }
+ if (sum + (int) Math.max(item.getHeight(), item.getWidth()) <= slotWidth && temp.size() < outCarMaxSize) {
+ HollowGlassRelationInfo hollow = new HollowGlassRelationInfo();
+ BeanUtils.copyProperties(item, hollow);
+ hollow.setSlotSequence(temp.size() + 1);
+ hollow.setTotalLayer(totalLayer);
+ hollow.setVirtualSlot(temp.get(0).getVirtualSlot());
+ hollow.setFilmsId(glassInfo.getFilmsid());
+ hollow.setThickness(glassInfo.getThickness());
+ temp.add(hollow);
+ flag = true;
+ break;
+ }
+ }
+ if (!flag) {
+ List<HollowGlassRelationInfo> newList = new ArrayList<>();
+ HollowGlassRelationInfo hollow = new HollowGlassRelationInfo();
+ BeanUtils.copyProperties(item, hollow);
+ hollow.setSlotSequence(1);
+ hollow.setTotalLayer(totalLayer);
+ hollow.setVirtualSlot(slotNumber++);
+ hollow.setFilmsId(glassInfo.getFilmsid());
+ hollow.setThickness(glassInfo.getThickness());
+ newList.add(hollow);
+ tempHollowList.add(newList);
+ }
+ }
+ for (List<HollowGlassRelationInfo> item : tempHollowList) {
+ relationInfoList.addAll(item);
+ }
+ log.info("鍒嗛厤瀹屾瘯");
+ this.saveBatch(relationInfoList);
+ }
+
+ @Override
+ public Map<String, List<FlowCardGlassInfoDTO>> queryHollowAllFlowCard() {
+ List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
+ .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN));
+ if (CollectionUtil.isEmpty(detailsList)) {
+ log.info("绗煎唴鏃犵幓鐠�");
+ return new HashMap<>();
+ }
+ Map<String, List<HollowBigStorageCageDetails>> listMap = detailsList.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getFlowCardId));
+ List<FlowCardGlassInfoDTO> dtos = new ArrayList<>();
+ listMap.forEach((e, v) -> {
+ HollowBigStorageCageDetails cageDetails = v.get(0);
+ dtos.addAll(hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE));
+ });
+ return dtos.stream().collect(Collectors.groupingBy(FlowCardGlassInfoDTO::getFlowCardId));
+ }
+
+ @Override
+ public List<LackDetailsDTO> queryLackByFlowCard(String flowCardId, int layer) {
+
+ return this.baseMapper.queryLackByFlowCard(flowCardId, layer);
+// return this.list(new LambdaQueryWrapper<HollowGlassRelationInfo>()
+// .eq(HollowGlassRelationInfo::getFlowCardId,flowCardId)
+// .eq(HollowGlassRelationInfo::getLayer,layer)
+// .isNull(HollowGlassRelationInfo::getTemperingLayoutId)
+// .isNull(HollowGlassRelationInfo::getTemperingFeedSequence)
+// );
+ }
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/controller/HollowGlassQueueInfoController.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/controller/HollowGlassQueueInfoController.java
new file mode 100644
index 0000000..34c1fe9
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/controller/HollowGlassQueueInfoController.java
@@ -0,0 +1,40 @@
+package com.mes.hollowqueue.controller;
+
+import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
+import com.mes.hollowqueue.service.HollowGlassQueueInfoService;
+import com.mes.utils.Result;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * (HollowGlassQueueInfo)琛ㄦ帶鍒跺眰
+ *
+ * @author makejava
+ * @since 2024-11-30 10:19:53
+ */
+@RestController
+@RequestMapping("hollowGlassQueueInfo")
+public class HollowGlassQueueInfoController {
+
+ @Resource
+ HollowGlassQueueInfoService hollowGlassQueueInfoService;
+
+ @ApiOperation("寮哄埗鍑虹墖")
+ @PostMapping("/forceOutGlass")
+ public Result<String> forceOutGlass(String flowCardId, int cell, int totalPairQuantity) {
+ hollowGlassQueueInfoService.forceOutGlass(flowCardId, cell, totalPairQuantity);
+ return Result.success("success");
+ }
+
+ @ApiOperation("鎸夌収绾胯矾鏌ヨ姝e湪鍑虹墖鐨勭幓鐠冮槦鍒�")
+ @PostMapping("/queryHollowGlassQueueInfo")
+ public Result<List<HollowGlassQueueInfo>> queryHollowGlassQueueInfo(int cell) {
+ return Result.success(hollowGlassQueueInfoService.queryHollowGlassQueueInfo(cell));
+ }
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java
new file mode 100644
index 0000000..c7095e2
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java
@@ -0,0 +1,85 @@
+package com.mes.hollowqueue.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.mes.base.entity.HollowBigStorageCageBaseInfo;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * (HollowGlassQueueInfo)琛ㄥ疄浣撶被
+ *
+ * @author makejava
+ * @since 2024-11-30 10:19:55
+ */
+@Data
+public class HollowGlassQueueInfo extends HollowBigStorageCageBaseInfo {
+ /**
+ * /*澶х悊鐗囩璇︽儏琛╥d
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+ /**
+ * /*璁惧id
+ */
+ private Integer deviceId;
+ /**
+ * /*铏氭嫙鏍呮牸鍙�
+ */
+ private Integer virtualSlot;
+ /**
+ * /*鏍呮牸鍙�
+ */
+ private Integer slot;
+ /**
+ * /*灏忕墖鍦ㄦ牸鍐呯殑椤哄簭
+ */
+ private Integer sequence;
+ /**
+ * /*娴佺▼鍗″彿
+ */
+ private String flowCardId;
+ /**
+ * /*鐜荤拑绫诲瀷
+ */
+ private Integer glassType;
+ /**
+ * /*鍘氬害
+ */
+ private Double thickness;
+ /**
+ * /*鐘舵��
+ */
+ private Integer state;
+ /**
+ * /*鐜荤拑闂撮殭
+ */
+ private Integer gap;
+
+ private String engineerId;
+ /**
+ * /*鎬诲眰鍙�
+ */
+ private Integer totalLayer;
+ /**
+ * /*鍒涘缓鏃堕棿
+ */
+ private Date createTime;
+ /**
+ * /*鏇存柊鏃堕棿
+ */
+ private Date updateTime;
+ /**
+ * /*涓┖椤哄簭
+ */
+ private Integer hollowSequence;
+
+ /**
+ * 璺嚎
+ */
+ private Integer cell;
+
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/mapper/HollowGlassQueueInfoMapper.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/mapper/HollowGlassQueueInfoMapper.java
new file mode 100644
index 0000000..e32c481
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/mapper/HollowGlassQueueInfoMapper.java
@@ -0,0 +1,15 @@
+package com.mes.hollowqueue.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
+
+/**
+ * (HollowGlassQueueInfo)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author makejava
+ * @since 2024-11-30 10:19:54
+ */
+public interface HollowGlassQueueInfoMapper extends BaseMapper<HollowGlassQueueInfo> {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java
new file mode 100644
index 0000000..a394fa8
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java
@@ -0,0 +1,20 @@
+package com.mes.hollowqueue.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
+
+import java.util.List;
+
+/**
+ * (HollowGlassQueueInfo)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author makejava
+ * @since 2024-11-30 10:19:55
+ */
+public interface HollowGlassQueueInfoService extends IService<HollowGlassQueueInfo> {
+
+ void forceOutGlass(String flowCardId, int cell, int totalPairQuantity);
+
+ List<HollowGlassQueueInfo> queryHollowGlassQueueInfo(int cell);
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java
new file mode 100644
index 0000000..0c41e55
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java
@@ -0,0 +1,67 @@
+package com.mes.hollowqueue.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.common.config.Const;
+import com.mes.hollow.entity.HollowBigStorageCageDetails;
+import com.mes.hollow.entity.HollowGlassOutRelationInfo;
+import com.mes.hollow.service.HollowBigStorageCageDetailsService;
+import com.mes.hollow.service.HollowGlassOutRelationInfoService;
+import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
+import com.mes.hollowqueue.mapper.HollowGlassQueueInfoMapper;
+import com.mes.hollowqueue.service.HollowGlassQueueInfoService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * (HollowGlassQueueInfo)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author makejava
+ * @since 2024-11-30 10:19:56
+ */
+@Service
+public class HollowGlassQueueInfoServiceImpl extends ServiceImpl<HollowGlassQueueInfoMapper, HollowGlassQueueInfo> implements HollowGlassQueueInfoService {
+
+ @Resource
+ HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService;
+
+ @Resource
+ HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService;
+
+ @Override
+ public void forceOutGlass(String flowCardId, int cell, int totalPairQuantity) {
+ hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell, totalPairQuantity);
+ hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
+ .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)
+ .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
+ );
+ List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.queryOutGlassList(flowCardId, cell);
+
+ List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> {
+ HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo();
+ BeanUtils.copyProperties(queue, queueInfo);
+ queueInfo.setState(Const.TEMPERING_NEW);
+ queueInfo.setCell(cell);
+ return queueInfo;
+ }).collect(Collectors.toList());
+ this.saveBatch(hollowQueues);
+ }
+ @Override
+ public List<HollowGlassQueueInfo> queryHollowGlassQueueInfo(int cell) {
+ HollowGlassOutRelationInfo one = hollowGlassOutRelationInfoService.getOne(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
+ .eq(HollowGlassOutRelationInfo::getCell, cell)
+ .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
+ );
+ this.list(new LambdaQueryWrapper<HollowGlassQueueInfo>()
+ .eq(HollowGlassQueueInfo::getFlowCardId, one.getFlowCardId())
+ .eq(HollowGlassQueueInfo::getCell, one.getCell())
+ );
+ return null;
+ }
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/controller/HollowBigStorageCageHistoryTaskController.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/controller/HollowBigStorageCageHistoryTaskController.java
new file mode 100644
index 0000000..cb5d659
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/controller/HollowBigStorageCageHistoryTaskController.java
@@ -0,0 +1,18 @@
+package com.mes.hollowtask.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * (HollowBigStorageCageHistoryTask)琛ㄦ帶鍒跺眰
+ *
+ * @author makejava
+ * @since 2024-11-27 15:22:45
+ */
+@RestController
+@RequestMapping("hollowBigStorageCageHistoryTask")
+public class HollowBigStorageCageHistoryTaskController {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/entity/HollowBigStorageCageHistoryTask.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/entity/HollowBigStorageCageHistoryTask.java
new file mode 100644
index 0000000..77c9398
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/entity/HollowBigStorageCageHistoryTask.java
@@ -0,0 +1,55 @@
+package com.mes.hollowtask.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * (HollowBigStorageCageHistoryTask)琛ㄥ疄浣撶被
+ *
+ * @author makejava
+ * @since 2024-11-27 15:22:47
+ */
+@Data
+public class HollowBigStorageCageHistoryTask {
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+ /**
+ * /*鐜荤拑id
+ */
+ private String glassId;
+ /**
+ * /*璧峰鏍煎瓙
+ */
+ private Integer startSlot;
+ /**
+ * /*鐩爣鏍煎瓙
+ */
+ private Integer targetSlot;
+ /**
+ * /*浠诲姟鐘舵��
+ */
+ private Integer taskState;
+ /**
+ * /*鐜荤拑鏁伴噺
+ */
+ private Integer glassCount;
+ /**
+ * /*浠诲姟绫诲瀷
+ */
+ private Integer taskType;
+ /**
+ * /*鍒涘缓鏃堕棿
+ */
+ private Date createTime;
+ /**
+ * /*鏇存柊鏃堕棿
+ */
+ private Date updateTime;
+
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/mapper/HollowBigStorageCageHistoryTaskMapper.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/mapper/HollowBigStorageCageHistoryTaskMapper.java
new file mode 100644
index 0000000..017f26e
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/mapper/HollowBigStorageCageHistoryTaskMapper.java
@@ -0,0 +1,15 @@
+package com.mes.hollowtask.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask;
+
+/**
+ * (HollowBigStorageCageHistoryTask)琛ㄦ暟鎹簱璁块棶灞�
+ *
+ * @author makejava
+ * @since 2024-11-27 15:22:46
+ */
+public interface HollowBigStorageCageHistoryTaskMapper extends BaseMapper<HollowBigStorageCageHistoryTask> {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/service/HollowBigStorageCageHistoryTaskService.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/service/HollowBigStorageCageHistoryTaskService.java
new file mode 100644
index 0000000..4ba073a
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/service/HollowBigStorageCageHistoryTaskService.java
@@ -0,0 +1,15 @@
+package com.mes.hollowtask.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask;
+
+/**
+ * (HollowBigStorageCageHistoryTask)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author makejava
+ * @since 2024-11-27 15:22:47
+ */
+public interface HollowBigStorageCageHistoryTaskService extends IService<HollowBigStorageCageHistoryTask> {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java
new file mode 100644
index 0000000..0910a0f
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java
@@ -0,0 +1,19 @@
+package com.mes.hollowtask.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask;
+import com.mes.hollowtask.mapper.HollowBigStorageCageHistoryTaskMapper;
+import com.mes.hollowtask.service.HollowBigStorageCageHistoryTaskService;
+import org.springframework.stereotype.Service;
+
+/**
+ * (HollowBigStorageCageHistoryTask)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author makejava
+ * @since 2024-11-27 15:22:48
+ */
+@Service
+public class HollowBigStorageCageHistoryTaskServiceImpl extends ServiceImpl<HollowBigStorageCageHistoryTaskMapper, HollowBigStorageCageHistoryTask> implements HollowBigStorageCageHistoryTaskService {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
new file mode 100644
index 0000000..bbfea54
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
@@ -0,0 +1,768 @@
+package com.mes.job;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.kangaroohy.milo.model.ReadWriteEntity;
+import com.kangaroohy.milo.service.MiloService;
+import com.mes.base.entity.HollowBigStorageCageBaseInfo;
+import com.mes.bigstoragecagetask.entity.BigStorageCageTask;
+import com.mes.bigstoragecagetask.service.BigStorageCageTaskService;
+import com.mes.common.config.Const;
+import com.mes.damage.entity.Damage;
+import com.mes.damage.service.DamageService;
+import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.service.GlassInfoService;
+import com.mes.hollow.entity.HollowBigStorageCage;
+import com.mes.hollow.entity.HollowBigStorageCageDetails;
+import com.mes.hollow.entity.HollowGlassOutRelationInfo;
+import com.mes.hollow.entity.HollowGlassRelationInfo;
+import com.mes.hollow.entity.dto.*;
+import com.mes.hollow.service.HollowBigStorageCageDetailsService;
+import com.mes.hollow.service.HollowBigStorageCageService;
+import com.mes.hollow.service.HollowGlassOutRelationInfoService;
+import com.mes.hollow.service.HollowGlassRelationInfoService;
+import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
+import com.mes.hollowqueue.service.HollowGlassQueueInfoService;
+import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask;
+import com.mes.hollowtask.service.HollowBigStorageCageHistoryTaskService;
+import com.mes.temperingglass.entity.TemperingGlassInfo;
+import com.mes.temperingglass.service.TemperingGlassInfoService;
+import com.mes.utils.RedisUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author SNG-015
+ */
+@Component
+@Slf4j
+public class OpcPlcStorageCageHollowTask {
+ @Resource
+ private HollowBigStorageCageService hollowBigStorageCageService;
+
+ @Resource
+ private HollowBigStorageCageHistoryTaskService hollowBigStorageCageHistoryTaskService;
+ @Resource
+ private HollowGlassRelationInfoService hollowGlassRelationInfoService;
+ @Resource
+ private HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService;
+ @Resource
+ private DamageService damageService;
+ @Resource
+ private GlassInfoService glassInfoService;
+ @Resource
+ private BigStorageCageTaskService bigStorageCageTaskService;
+
+ @Resource
+ private TemperingGlassInfoService temperingGlassInfoService;
+ @Resource
+ private HollowGlassQueueInfoService hollowGlassQueueInfoService;
+ @Resource
+ private HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService;
+
+ private static final String BIG_STORAGE_CAGE_IN_TWO_TASK = "big_storage_cage_in_two_task";
+ private static final String BIG_STORAGE_CAGE_OUT_TWO_TASK = "big_storage_cage_out_two_task";
+ @Autowired(required = false)
+ MiloService miloService;
+ @Resource
+ private RedisUtil redisUtil;
+
+ @Value("${mes.slotWidth}")
+ private Integer slotWidth;
+
+ @Value("${mes.glassGap}")
+ private Integer glassGap;
+
+ @Value("${mes.carWidth}")
+ private Integer carWidth;
+
+ @Value("${mes.outCarMaxSize}")
+ private Integer outCarMaxSize;
+
+ @Scheduled(fixedDelay = 1000)
+ public void inBigStorageTask() throws Exception {
+ ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2A.DLP2A.mesControl");
+ if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
+ log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫杩涚墖浠诲姟");
+ return;
+ }
+ ReadWriteEntity requestEntity = miloService.readFromOpcUa("DLP2A.DLP2A.RequestMes");
+ if (!"1".equals(requestEntity.getValue() + "")) {
+ log.info("褰撳墠鏈敹鍒拌繘鐗囪姹傦紝缁撴潫杩涚墖浠诲姟");
+ return;
+ }
+ ReadWriteEntity mesReplyEntity = miloService.readFromOpcUa("DLP2A.DLP2A.MesReply");
+ if ("1".equals(mesReplyEntity.getValue() + "")) {
+ log.info("鏈夋鍦ㄦ墽琛岀殑浠诲姟锛岀粨鏉熻繘鐗囦换鍔�");
+ return;
+ }
+
+ List<BigStorageCageTask> inTaskList = new ArrayList();
+ ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP2A.DLP2A.FROM1");
+ List<String> glassIdList = new ArrayList<>();
+ for (int i = 1; i <= 6; i++) {
+ ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP2A.DLP2A.DI" + i);
+ if (null != requestWord.getValue()) {
+ BigStorageCageTask task = new BigStorageCageTask();
+ task.setGlassId(requestWord.getValue() + "");
+ task.setStartSlot(Integer.parseInt(fromOpcUa.getValue() + ""));
+ inTaskList.add(task);
+ glassIdList.add(requestWord.getValue() + "");
+ continue;
+ }
+ }
+ if (CollectionUtil.isEmpty(inTaskList)) {
+ log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫杩涚墖浠诲姟");
+ return;
+ }
+ log.info("鑾峰彇浠诲姟鐨勭幓鐠僫d锛歿}", glassIdList);
+ Map<String, Long> glassCountMap = glassIdList.stream().collect(Collectors.groupingBy(e -> e, Collectors.counting()));
+ for (Map.Entry<String, Long> entry : glassCountMap.entrySet()) {
+ if (entry.getValue() > 1) {
+ log.info("杩涚墖鐜荤拑{}瀛樺湪鐩稿悓锛岀粨鏉熸湰娆′换鍔�", entry.getKey());
+ //todo:鍚憄lc鍙戦�佹姤璀�
+ return;
+ }
+ }
+ List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>().in(HollowBigStorageCageDetails::getGlassId, glassIdList)
+ .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
+ if (CollectionUtil.isNotEmpty(detailsList)) {
+ log.info("鐞嗙墖绗煎瓨鍦ㄧ浉鍚岀殑杩涚墖鐜荤拑{}锛岀粨鏉熸湰娆′换鍔�", detailsList);
+ //todo:鍚憄lc鍙戦�佹姤璀�
+ return;
+ }
+ List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIdList));
+
+ if (glassInfoList.size() != inTaskList.size()) {
+ log.info("杩涚墖浠诲姟鏁伴噺{}涓庣幓鐠冩暟閲弡}涓嶅尮閰嶏紝缁撴潫鏈杩涚墖", inTaskList.size(), glassInfoList.size());
+ //todo:鍚憄lc鍙戦�佹姤璀�
+ return;
+ }
+ //淇敼閽㈠寲浠诲姟琛ㄤ腑鐨勭姸鎬�
+ temperingGlassInfoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>()
+ .set(TemperingGlassInfo::getState, Const.TEMPERING_END).in(TemperingGlassInfo::getGlassId, glassIdList));
+
+ Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId));
+
+ //璁$畻鐩爣鏍煎瓙
+ List<HollowBigStorageCageHistoryTask> historyTasks = new ArrayList<>();
+ for (BigStorageCageTask task : inTaskList) {
+ GlassInfo info = glassListMap.get(task.getGlassId()).get(0);
+ HollowBigStorageDTO bigStorageDTO = hollowGlassRelationInfoService.queryHollowTargetSlot(info.getFlowCardId(),
+ info.getWidth(), info.getHeight(), info.getTotalLayer(), info.getLayer());
+// 涓存椂鏇存柊鏍煎瓙鐨勫墿浣欏昂瀵革細闃叉鐩搁偦鐜荤拑杩涘悓涓�鏍煎瓙閫犳垚鍓╀綑灏哄涓嶈冻锛岀幓鐠冭秺鐣岀殑鎯呭喌锛屼换鍔″畬鎴愬悗鍐嶆鏇存柊澶х悊鐗囩琛ㄥ墿浣欏搴︼紙鎸夌収绗煎唴鐜荤拑鏁伴噺鏇存柊澶х悊鐗囩鍓╀綑灏哄锛�
+ hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>()
+ .set(HollowBigStorageCage::getRemainWidth, bigStorageDTO.getRemainWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap)
+ .eq(HollowBigStorageCage::getSlot, bigStorageDTO.getSlot()));
+ task.setTargetSlot(bigStorageDTO.getSlot());
+ task.setGlassId(info.getGlassId());
+ bigStorageCageTaskService.updateTaskMessage(BIG_STORAGE_CAGE_IN_TWO_TASK, task);
+ //瀛樻斁鍘嗗彶浠诲姟
+ HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask();
+ BeanUtils.copyProperties(task, historyTask);
+ historyTask.setTaskType(Const.BIG_STORAGE_AFTER_IN);
+ historyTask.setGlassCount(glassInfoList.size());
+ historyTask.setTaskState(Const.ENGINEERING_NEW);
+ historyTasks.add(historyTask);
+ //瀛樻斁璇︽儏鏁版嵁
+ HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails();
+ BeanUtils.copyProperties(bigStorageDTO, cageDetails);
+ BeanUtils.copyProperties(info, cageDetails);
+ cageDetails.setState(Const.GLASS_STATE_NEW);
+ cageDetails.setSequence(bigStorageDTO.getSlotSequence());
+ cageDetails.setGap(glassGap);
+ cageDetails.setId(null);
+ hollowBigStorageCageDetailsService.save(cageDetails);
+ hollowGlassRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassRelationInfo>()
+ .set(HollowGlassRelationInfo::getGlassId, cageDetails.getGlassId())
+ .set(HollowGlassRelationInfo::getTemperingLayoutId, cageDetails.getTemperingLayoutId())
+ .set(HollowGlassRelationInfo::getTemperingFeedSequence, cageDetails.getTemperingFeedSequence())
+ .set(HollowGlassRelationInfo::getEngineerId, cageDetails.getEngineerId())
+ .eq(HollowGlassRelationInfo::getFlowCardId, bigStorageDTO.getFlowCardId())
+ .eq(HollowGlassRelationInfo::getLayer, bigStorageDTO.getLayer())
+ .eq(HollowGlassRelationInfo::getVirtualSlot, bigStorageDTO.getVirtualSlot())
+ .eq(HollowGlassRelationInfo::getSlotSequence, bigStorageDTO.getSlotSequence())
+ .eq(HollowGlassRelationInfo::getHollowSequence, bigStorageDTO.getHollowSequence())
+ );
+ }
+ //鍘嗗彶鏁版嵁鍏ュ簱
+ hollowBigStorageCageHistoryTaskService.saveBatch(historyTasks);
+ //鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
+ List<ReadWriteEntity> list = new ArrayList<>();
+ for (int i = 1; i <= inTaskList.size(); i++) {
+ list.add(generateReadWriteEntity("DLP2A.DLP2A.TO" + i, inTaskList.get(i - 1).getTargetSlot()));
+ }
+ list.add(generateReadWriteEntity("DLP2A.DLP2A.MesReply", 1));
+ miloService.writeToOpcWord(list);
+ }
+
+ @Scheduled(fixedDelay = 1000)
+ public void outBigStorageTask() throws Exception {
+ Date startDate = new Date();
+ ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2B.DLP2B.mesControl");
+ if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
+ log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫杩涚墖浠诲姟");
+ return;
+ }
+ ReadWriteEntity requestEntity = miloService.readFromOpcUa("DLP2B.DLP2B.RequestMes");
+ if (!"1".equals(requestEntity.getValue() + "")) {
+ log.info("褰撳墠鏈敹鍒板嚭鐗囪姹傦紝缁撴潫鍑虹墖浠诲姟");
+ return;
+ }
+ //鑾峰彇鍑虹墖浠诲姟琛�
+ List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
+ if (CollectionUtil.isNotEmpty(outTaskList)) {
+ log.info("鏈夋鍦ㄦ墽琛岀殑鍑虹墖浠诲姟锛岀粨鏉熸湰娆″嚭鐗囦换鍔�");
+ return;
+ }
+
+ //鑾峰彇绌洪棽涓旈鍙栦换鍔$殑鏁版嵁淇℃伅锛屾病鏈変换鍔$洿鎺ヨ蛋鐜荤拑璋冨害
+ ReadWriteEntity oneEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outOneRequest");
+ ReadWriteEntity twoEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outTwoRequest");
+ ReadWriteEntity threeEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outThreeRequest");
+ int cell = -1;
+ HollowGlassOutRelationInfo hollowGlassOutRelationInfo = null;
+ if ("1".equals(oneEntity.getValue() + "")) {
+ cell = 930;
+ hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
+ .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
+ .eq(HollowGlassOutRelationInfo::getCell, cell)
+ .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
+ );
+ }
+ if (1 == 1 || null == hollowGlassOutRelationInfo && "1".equals(twoEntity.getValue() + "")) {
+ cell = 931;
+ hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
+ .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
+ .eq(HollowGlassOutRelationInfo::getCell, cell)
+ .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
+ );
+ }
+ if (null == hollowGlassOutRelationInfo && "1".equals(threeEntity.getValue() + "")) {
+ cell = 932;
+ hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
+ .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
+ .eq(HollowGlassOutRelationInfo::getCell, cell)
+ .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
+ );
+ }
+ if (null != hollowGlassOutRelationInfo) {
+ //鏄惁鍏佽涓┖
+ //鏄惁鏈夋鍦ㄤ腑绌虹殑鐜荤拑:涓┖灏忕墖琛ㄧ瓫閫夋湭鍑虹鐨勭幓鐠冧俊鎭�
+// 鑾峰彇褰撳墠涓┖浠诲姟鏈畬鎴愬嚭鐗囩殑鐜荤拑淇℃伅
+ List<HollowGlassQueueInfo> unFinishHollowQueueList = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>()
+ .eq(HollowGlassQueueInfo::getFlowCardId, hollowGlassOutRelationInfo.getFlowCardId())
+ .eq(HollowGlassQueueInfo::getCell, cell)
+ .eq(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW)
+ .orderByAsc(HollowGlassQueueInfo::getHollowSequence));
+ if (CollectionUtil.isNotEmpty(unFinishHollowQueueList)) {
+ log.info("鏈夋鍦ㄥ嚭鐗囩殑涓┖浠诲姟");
+ Integer isPair = unFinishHollowQueueList.get(0).getIsPair();
+ hollowOutGlassByIsPair(unFinishHollowQueueList, hollowGlassOutRelationInfo.getCell(), isPair, hollowGlassOutRelationInfo.getTotalLayer());
+ Date endDate = new Date();
+ log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
+ return;
+ } else {
+ //灏嗕腑绌轰换鍔$姸鎬佹敼涓哄凡瀹屾垚
+ hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
+ .eq(HollowGlassOutRelationInfo::getFlowCardId, hollowGlassOutRelationInfo.getFlowCardId())
+ .eq(HollowGlassOutRelationInfo::getCell, hollowGlassOutRelationInfo.getCell())
+ .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_SUCCESS));
+ }
+
+ if (redisUtil.getCacheObject("hollowSwitch")) {
+ List<HollowGlassOutRelationInfo> HollowGlassOutRelationInfoList = hollowGlassOutRelationInfoService
+ .list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
+ .eq(HollowGlassOutRelationInfo::getCell, cell)
+ .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_NEW));
+ for (HollowGlassOutRelationInfo e : HollowGlassOutRelationInfoList) {
+ //涓┖浼樺厛锛氳幏鍙栫悊鐗囩 鐜荤拑灏忕墖 鐮存崯琛� 鏁伴噺 鍒ゆ柇绗煎唴鐗堝浘鏄惁鍒伴綈
+ List<FlowCardGlassInfoDTO> flowCardGlassInfoDTO = hollowBigStorageCageDetailsService.hollowIsAll(e.getFlowCardId(), e.getTotalLayer(), Boolean.TRUE);
+ if (CollectionUtil.isNotEmpty(flowCardGlassInfoDTO)) {
+ //鐜荤拑鍒伴綈鍖呮嫭宸插嚭鐗囩殑
+ //鍒伴綈锛屽皢鐜荤拑灏忕墖鏁版嵁瀛樺叆涓┖灏忕墖琛紝閫昏緫鐢熸垚鍑虹墖浠诲姟 缁撴潫
+ for (FlowCardGlassInfoDTO item : flowCardGlassInfoDTO) {
+ List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.queryOutGlassList(item.getFlowCardId(), cell);
+ int finalCell = cell;
+ List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> {
+ HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo();
+ BeanUtils.copyProperties(queue, queueInfo);
+ queueInfo.setState(Const.TEMPERING_NEW);
+ queueInfo.setCell(finalCell);
+ return queueInfo;
+ }).collect(Collectors.toList());
+ if (CollectionUtil.isNotEmpty(hollowQueues)) {
+ hollowGlassQueueInfoService.saveBatch(hollowQueues);
+ Integer isPair = hollowQueues.get(0).getIsPair();
+ hollowOutGlassByIsPair(hollowQueues, cell, isPair, e.getTotalLayer());
+ //灏嗕腑绌轰换鍔$姸鎬佹敼涓哄紑濮�
+ hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
+ .eq(HollowGlassOutRelationInfo::getFlowCardId, e.getFlowCardId())
+ .eq(HollowGlassOutRelationInfo::getCell, cell)
+ .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START));
+ Date endDate = new Date();
+ log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+// redisUtil.setCacheObject("dispatchHollowSwitch",true);
+ //鏄惁瀛樺湪闇�瑕佸唴閮ㄨ皟搴︾殑鏍煎瓙:鎵ц鍐呴儴璋冨害浠诲姟
+ if (redisUtil.getCacheObject("dispatchHollowSwitch")) {
+ //todo:鑾峰彇绗煎唴鍗曟牸宸茬粡鍒伴綈鐨勭幓鐠冩牸瀛愪俊鎭�
+ List<FlowCardVirtualSlotDTO> virtualList = hollowBigStorageCageDetailsService.queryIsAllNeedDispatchVirtualSlot();
+ if (CollectionUtil.isEmpty(virtualList)) {
+ log.info("娌℃湁闇�瑕佽皟搴︾殑鏍煎瓙");
+ return;
+ }
+ List<HollowBigStorageCageDetails> list = new ArrayList<>();
+ loop:
+ for (FlowCardVirtualSlotDTO dto : virtualList) {
+ List<BigStorageSequenceDTO> sequenceDTOList = hollowBigStorageCageDetailsService.queryNeedDispatchSlot(dto);
+ if (CollectionUtil.isEmpty(sequenceDTOList) || sequenceDTOList.size() == 1) {
+ continue;
+ }
+ int sequence = -1;
+ int startSlot = -1;
+ for (BigStorageSequenceDTO item : sequenceDTOList) {
+ if (item.getMinSequence() == sequence + 1) {
+ //鐢熸垚璋冨害浠诲姟
+ int targetSlot = item.getSlot();
+ list = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
+ .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN).eq(HollowBigStorageCageDetails::getSlot, startSlot));
+ hollowOutGlassByIsPair(list, targetSlot, 0, 0);
+ List<Integer> slotList = new ArrayList<>();
+ slotList.add(targetSlot);
+ updateSlotRemainBySlots(slotList);
+ break loop;
+ }
+ sequence = item.getMaxSequence();
+ startSlot = item.getSlot();
+ }
+ }
+ }
+ Date endDate = new Date();
+ log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
+ return;
+ }
+
+ @Scheduled(fixedDelay = 1000)
+ public void finishInBigStorageTask() throws Exception {
+ ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2A.DLP2A.mesControl");
+ if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
+ log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫瀹屾垚杩涚墖浠诲姟");
+ return;
+ }
+ //鑾峰彇杩涚墖浠诲姟琛�
+ List<BigStorageCageTask> inTaskList = new ArrayList();
+ List<String> glassIdList = new ArrayList<>();
+ ReadWriteEntity toWord = miloService.readFromOpcUa("DLP2A.DLP2A.TO1");
+ if ("0".equals(toWord.getValue() + "")) {
+ log.info("瀹屾垚浠诲姟宸叉墽琛岋紝缁撴潫鏈瀹屾垚杩涚墖浠诲姟");
+ return;
+ }
+ for (int i = 1; i <= 6; i++) {
+ ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP2A.DLP2A.DI" + i);
+ ReadWriteEntity statetWord = miloService.readFromOpcUa("DLP2A.DLP2A.STATE" + i);
+ ReadWriteEntity toOpcUa = miloService.readFromOpcUa("DLP2A.DLP2A.TO" + i);
+ ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP2A.DLP2A.FROM" + i);
+
+ if (null != requestWord.getValue()) {
+ BigStorageCageTask task = new BigStorageCageTask();
+ task.setGlassId(requestWord.getValue() + "");
+ task.setTargetSlot(Integer.parseInt(toOpcUa.getValue() + ""));
+ task.setTaskState(Integer.parseInt(statetWord.getValue() + ""));
+ task.setStartSlot(Integer.parseInt(fromOpcUa.getValue() + ""));
+ inTaskList.add(task);
+ glassIdList.add(requestWord.getValue() + "");
+ continue;
+ }
+ }
+ if (CollectionUtil.isEmpty(inTaskList)) {
+ log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫瀹屾垚杩涚墖浠诲姟");
+ return;
+ }
+ List<BigStorageCageTask> unFinishTaskList = inTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList());
+ if (CollectionUtil.isNotEmpty(unFinishTaskList)) {
+ log.info("瀛樺湪鏈畬鎴愮殑鐜荤拑淇℃伅,鐜荤拑锛歿}", unFinishTaskList);
+ return;
+ }
+ Map<Integer, List<BigStorageCageTask>> taskMap = inTaskList.stream().collect(Collectors.groupingBy(BigStorageCageTask::getTaskState));
+ //鎸夌収浠诲姟鐘舵�佷慨鏀瑰ぇ鐞嗙墖绗煎唴鐨勭幓鐠冩暟鎹�
+// 閲嶆柊璁$畻澶х悊鐗囩鍐呯殑鍓╀綑灏哄
+ taskMap.forEach((e1, v) -> {
+ if (e1 == 2) {
+ //杩涚墖瀹屾垚
+ log.info("3銆佽幏鍙栬繘鐗囧凡瀹屾垚鐨勭幓鐠冧俊鎭痠d:{}", v);
+ List<Integer> inSuccessGlassSlot = v.stream().map(BigStorageCageTask::getTargetSlot).collect(Collectors.toList());
+ List<UpdateHollowBigStorageCageDTO> storageCageDTOList = v.stream().map(e -> {
+ UpdateHollowBigStorageCageDTO storageCageDTO = new UpdateHollowBigStorageCageDTO();
+ BeanUtils.copyProperties(e, storageCageDTO);
+ return storageCageDTO;
+ }).collect(Collectors.toList());
+ hollowBigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_IN);
+ log.info("4銆佸ぇ鐞嗙墖绗艰繘鐗囩姸鎬佸凡瀹屾垚宸插畬鎴愮殑鐜荤拑淇℃伅id:{}", v);
+ updateSlotRemainBySlots(inSuccessGlassSlot);
+ } else if (e1 == 3) {
+ //鐮存崯澶勭悊
+ dealDamageInTask(v);
+ } else {
+ //娓呯┖鐞嗙墖绗肩┖鏁版嵁
+ noDealInTask(v);
+ }
+ });
+ for (BigStorageCageTask item : inTaskList) {
+ //鏇存柊鍘嗗彶浠诲姟琛ㄤ腑鐨勪换鍔$姸鎬�
+ hollowBigStorageCageHistoryTaskService.update(new LambdaUpdateWrapper<HollowBigStorageCageHistoryTask>()
+ .set(HollowBigStorageCageHistoryTask::getTaskState, item.getTaskState())
+ .eq(HollowBigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_AFTER_IN)
+ .eq(HollowBigStorageCageHistoryTask::getTargetSlot, item.getTargetSlot())
+ .eq(HollowBigStorageCageHistoryTask::getGlassId, item.getGlassId()));
+ item.setTargetSlot(0);
+ //娓呯┖浠诲姟琛ㄦ暟鎹�
+ bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", item);
+ }
+ //娓呯┖鍚姩鐘舵��
+ //鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
+ //鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
+ List<ReadWriteEntity> list = new ArrayList<>();
+ for (int i = 1; i <= 6; i++) {
+ list.add(generateReadWriteEntity("DLP2A.DLP2A.TO" + i, 0));
+ }
+ list.add(generateReadWriteEntity("DLP2A.DLP2A.MesReply", 0));
+ miloService.writeToOpcWord(list);
+ }
+
+ @Scheduled(fixedDelay = 1000)
+ public void finishOutBigStorageTask() throws Exception {
+ ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2B.DLP2B.mesControl");
+ if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
+ log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫瀹屾垚鍑虹墖浠诲姟");
+ return;
+ }
+ //鑾峰彇杩涚墖浠诲姟琛�
+ List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
+ if (CollectionUtil.isEmpty(outTaskList)) {
+ log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫瀹屾垚杩涚墖浠诲姟");
+ return;
+ }
+ List<BigStorageCageTask> unFinishTaskList = outTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList());
+ if (CollectionUtil.isNotEmpty(unFinishTaskList)) {
+ log.info("瀛樺湪鏈畬鎴愮殑鐜荤拑淇℃伅,鐜荤拑锛歿}", unFinishTaskList);
+ return;
+ }
+ Map<Integer, List<BigStorageCageTask>> taskMap = outTaskList.stream().collect(Collectors.groupingBy(BigStorageCageTask::getTaskState));
+ int taskType = 0;
+ if (Const.OUT_TARGET_POSITION_ALL.contains(outTaskList.get(0).getTargetSlot())) {
+ taskType = Const.BIG_STORAGE_AFTER_OUT;
+ } else {
+ taskType = Const.BIG_STORAGE_AFTER_DISPATCH;
+ }
+ //鎸夌収浠诲姟鐘舵�佷慨鏀瑰ぇ鐞嗙墖绗煎唴鐨勭幓鐠冩暟鎹�
+// 閲嶆柊璁$畻澶х悊鐗囩鍐呯殑鍓╀綑灏哄
+ Integer finalTaskType = taskType;
+ taskMap.forEach((e1, v) -> {
+ if (e1 == 2) {
+ //杩涚墖瀹屾垚
+ log.info("3銆佽幏鍙栬繘鐗囧凡瀹屾垚鐨勭幓鐠冧俊鎭痠d:{}", v);
+ List<Integer> outSuccessGlassSlot = new ArrayList<>();
+ if (finalTaskType.equals(Const.BIG_STORAGE_AFTER_OUT)) {
+ outSuccessGlassSlot = v.stream().map(BigStorageCageTask::getStartSlot).collect(Collectors.toList());
+ } else {
+ List<Integer> targetSuccessGlassSlot = v.stream().map(BigStorageCageTask::getTargetSlot).collect(Collectors.toList());
+ List<Integer> startoutSuccessGlassSlot = v.stream().map(BigStorageCageTask::getStartSlot).collect(Collectors.toList());
+ outSuccessGlassSlot.addAll(targetSuccessGlassSlot);
+ outSuccessGlassSlot.addAll(startoutSuccessGlassSlot);
+ }
+ List<UpdateHollowBigStorageCageDTO> storageCageDTOList = v.stream().map(e -> {
+ UpdateHollowBigStorageCageDTO storageCageDTO = new UpdateHollowBigStorageCageDTO();
+ storageCageDTO.setGlassId(e.getGlassId());
+ if (finalTaskType.equals(Const.BIG_STORAGE_AFTER_OUT)) {
+ storageCageDTO.setTargetSlot(e.getStartSlot());
+ } else {
+ storageCageDTO.setTargetSlot(e.getTargetSlot());
+ }
+ return storageCageDTO;
+ }).collect(Collectors.toList());
+ if (finalTaskType.equals(Const.BIG_STORAGE_AFTER_OUT)) {
+ hollowBigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_OUT);
+ } else {
+ hollowBigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_IN);
+ }
+ log.info("4銆佸ぇ鐞嗙墖绗艰繘鐗囩姸鎬佸凡瀹屾垚宸插畬鎴愮殑鐜荤拑淇℃伅id:{}", v);
+ updateSlotRemainBySlots(outSuccessGlassSlot);
+ } else if (e1 == 3) {
+ //鐮存崯澶勭悊
+ dealDamageOutTask(v);
+ } else {
+ //娓呯┖鐞嗙墖绗肩┖鏁版嵁
+ noDealOutTask(v);
+ }
+ });
+ for (BigStorageCageTask item : outTaskList) {
+ //鏇存柊鍘嗗彶浠诲姟琛ㄤ腑鐨勪换鍔$姸鎬�
+ hollowBigStorageCageHistoryTaskService.update(new LambdaUpdateWrapper<HollowBigStorageCageHistoryTask>()
+ .set(HollowBigStorageCageHistoryTask::getTaskState, item.getTaskState())
+ .eq(HollowBigStorageCageHistoryTask::getTaskType, taskType)
+ .eq(HollowBigStorageCageHistoryTask::getGlassId, item.getGlassId()));
+ //鏇存柊涓┖灏忕墖琛�
+ Integer taskState = item.getTaskState();
+ if (taskState == 2) {
+ hollowGlassQueueInfoService.update(new LambdaUpdateWrapper<HollowGlassQueueInfo>()
+ .set(HollowGlassQueueInfo::getState, Const.TEMPERING_OUT).eq(HollowGlassQueueInfo::getGlassId, item.getGlassId()));
+ } else if (taskState == 3) {
+// temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().eq(TemperingGlassInfo::getGlassId, item.getGlassId()));
+ hollowGlassQueueInfoService.update(new LambdaUpdateWrapper<HollowGlassQueueInfo>()
+ .set(HollowGlassQueueInfo::getState, Const.TEMPERING_DAMAGE).eq(HollowGlassQueueInfo::getGlassId, item.getGlassId()));
+
+ } else {
+// 绌烘墽琛�
+ }
+ }
+// 閲嶇疆浠诲姟琛ㄦ暟鎹�
+ bigStorageCageTaskService.updateOutTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
+ //娓呯┖鍚姩鐘舵��
+ //鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
+ miloService.writeToOpcWord(generateReadWriteEntity("DLP2B.DLP2B.MesReply", 0));
+ }
+
+ private void dealDamageInTask(List<BigStorageCageTask> damageTaskList) {
+// 鑾峰彇杩涚墖浠诲姟琛ㄤ腑鐘舵�佷负鐮存崯鐨勬暟鎹�
+ log.info("鐮存崯鐨勭幓鐠冧俊鎭湁锛歿}", damageTaskList);
+ //绉婚櫎鐞嗙墖绗艰鎯呰〃浠诲姟鎵ц杩囩▼涓牬鎹熺殑鐜荤拑
+ hollowBigStorageCageDetailsService.remove(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
+ .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_NEW)
+ .in(HollowBigStorageCageDetails::getGlassId, damageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList())));
+ //灏嗙牬鎹熶俊鎭柊澧炲叆鐮存崯琛�
+ List<Integer> slotList = new ArrayList<>();
+ for (BigStorageCageTask item : damageTaskList) {
+ Damage damage = new Damage();
+ damage.setGlassId(item.getGlassId());
+ damage.setLine(item.getStartSlot());
+ damage.setWorkingProcedure("纾ㄨ竟");
+ damage.setRemark("杩涚鍓嶅崸杞珛");
+ damage.setStatus(1);
+ damage.setType(item.getTaskState());
+ damageService.insertDamage(damage);
+ slotList.add(item.getTargetSlot());
+ }
+ //鏇存柊鏍煎瓙鍓╀綑瀹藉害
+ updateSlotRemainBySlots(slotList);
+ log.info("杩涚墖浠诲姟-鐮存崯浠诲姟鎵ц瀹屾垚");
+ }
+
+ private void dealDamageOutTask(List<BigStorageCageTask> damageTaskList) {
+// 鑾峰彇杩涚墖浠诲姟琛ㄤ腑鐘舵�佷负鐮存崯鐨勬暟鎹�
+ log.info("鐮存崯鐨勭幓鐠冧俊鎭湁锛歿}", damageTaskList);
+ //绉婚櫎鐞嗙墖绗艰鎯呰〃浠诲姟鎵ц杩囩▼涓牬鎹熺殑鐜荤拑
+ hollowBigStorageCageDetailsService.remove(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
+ .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)
+ .in(HollowBigStorageCageDetails::getGlassId, damageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList())));
+ //灏嗙牬鎹熶俊鎭柊澧炲叆鐮存崯琛�
+ List<Integer> slotList = new ArrayList<>();
+ for (BigStorageCageTask item : damageTaskList) {
+ Damage damage = new Damage();
+ damage.setGlassId(item.getGlassId());
+ damage.setLine(item.getStartSlot());
+ damage.setWorkingProcedure("涓┖鍓�");
+ damage.setRemark("杩涚鍚庡崸杞珛");
+ damage.setStatus(1);
+ damage.setType(item.getTaskState());
+ damageService.insertDamage(damage);
+ slotList.add(item.getTargetSlot());
+ slotList.add(item.getStartSlot());
+ }
+ //鏇存柊鏍煎瓙鍓╀綑瀹藉害
+ updateSlotRemainBySlots(slotList);
+ log.info("鍑虹墖浠诲姟-鐮存崯浠诲姟鎵ц瀹屾垚");
+ }
+
+ private void noDealInTask(List<BigStorageCageTask> noDealTaskList) {
+// 鑾峰彇杩涚墖浠诲姟琛ㄤ腑鐘舵�佷负鐮存崯鐨勬暟鎹�
+ log.info("鐮存崯鐨勭幓鐠冧俊鎭湁锛歿}", noDealTaskList);
+ //绉婚櫎鐞嗙墖绗艰鎯呰〃鏈墽琛屼换鍔$殑绌鸿褰曚俊鎭�
+ hollowBigStorageCageDetailsService.remove(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
+ .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_NEW)
+ .in(HollowBigStorageCageDetails::getGlassId, noDealTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList())));
+ //璁板綍鏍煎瓙鍙凤紝鎸夋牸瀛愬彿鏇存柊鍓╀綑灏哄
+ List<Integer> slotList = new ArrayList<>();
+ for (BigStorageCageTask item : noDealTaskList) {
+ slotList.add(item.getTargetSlot());
+ slotList.add(item.getStartSlot());
+ }
+ //鏇存柊鏍煎瓙鍓╀綑瀹藉害
+ updateSlotRemainBySlots(slotList);
+ log.info("杩涚墖浠诲姟-鏃犲姩浣滄墽琛屽畬鎴�");
+ }
+
+ private void noDealOutTask(List<BigStorageCageTask> noDealTaskList) {
+// 鑾峰彇杩涚墖浠诲姟琛ㄤ腑鐘舵�佷负鐮存崯鐨勬暟鎹�
+ log.info("鐮存崯鐨勭幓鐠冧俊鎭湁锛歿}", noDealTaskList);
+ if (Const.OUT_TARGET_POSITION_ALL.contains(noDealTaskList.get(0).getTargetSlot())) {
+ //鍑虹墖浠诲姟:灏嗗嚭鐗囦腑鐘舵�佹仮澶嶄负鍦ㄧ鍐�
+ List<String> glassList = noDealTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList());
+ hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>()
+ .set(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
+ .ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
+ .in(HollowBigStorageCageDetails::getGlassId, glassList));
+
+ } else {
+ //璋冨害浠诲姟锛氬皢璋冨害涓姸鎬佹敼涓哄湪绗煎唴锛屾牸瀛愬彿鎭㈠涓鸿皟搴﹀墠鐨勬牸瀛�
+ for (BigStorageCageTask item : noDealTaskList) {
+ hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>()
+ .set(HollowBigStorageCageDetails::getSlot, item.getStartSlot())
+ .set(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
+ .ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
+ .eq(HollowBigStorageCageDetails::getGlassId, item.getGlassId()));
+ }
+ }
+ //灏嗙牬鎹熶俊鎭柊澧炲叆鐮存崯琛�
+ List<Integer> slotList = new ArrayList<>();
+ for (BigStorageCageTask item : noDealTaskList) {
+ slotList.add(item.getTargetSlot());
+ slotList.add(item.getStartSlot());
+ }
+ //鏇存柊鏍煎瓙鍓╀綑瀹藉害
+ updateSlotRemainBySlots(slotList);
+ log.info("鍑虹墖浠诲姟-鏃犲姩浣滄墽琛屽畬鎴�");
+ }
+
+
+ private <T extends HollowBigStorageCageBaseInfo> Boolean hollowOutGlassByIsPair(List<T> list, int targetSlot, int isPair, int totalLayer) {
+ List<T> resultList = new ArrayList<>();
+ int taskType = Const.BIG_STORAGE_AFTER_OUT;
+ int taskState = Const.GLASS_STATE_OUT_ING;
+ for (T t : list) {
+ if (isPair == (t.getIsPair() == null ? 0 : t.getIsPair())) {
+ resultList.add(t);
+ }
+ }
+ if (isPair == 0) {
+ taskType = Const.BIG_STORAGE_AFTER_DISPATCH;
+ taskState = Const.GLASS_STATE_SCHEDULE_ING;
+ totalLayer = 0;
+ }
+ return computeOutGlassInfo(resultList, BIG_STORAGE_CAGE_OUT_TWO_TASK, targetSlot, taskState, taskType, totalLayer);
+ }
+
+ /**
+ * 鍑虹墖涓�娆′粎鐢熸垚涓�杞︾幓鐠�
+ *
+ * @param <T>
+ * @param list
+ * @param totalLayer
+ * @return
+ */
+ private <T extends HollowBigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, String tableName, int targetSlot, int state, int taskType, int totalLayer) {
+ //浠诲姟鏁版嵁:鑾峰彇杞﹀瓙瀛樻斁鐜荤拑鏈�澶ф暟閲�,鐜荤拑闂撮殧
+ List<BigStorageCageTask> tempList = new ArrayList<>();
+ List<T> tempTList = new ArrayList<>();
+ //鎵撹溅鍓╀綑灏哄
+ Integer remainWidth = carWidth;
+ for (T e : list) {
+ if (tempList.size() >= outCarMaxSize || Math.max((int) e.getWidth(), (int) e.getHeight()) > remainWidth) {
+ break;
+ }
+ //璁$畻褰撳墠鍑虹墖杞﹀墿灏哄
+ remainWidth = remainWidth - Math.max((int) e.getWidth(), (int) e.getHeight()) - glassGap;
+ tempTList.add(e);
+ tempList.add(new BigStorageCageTask(e.getGlassId(), e.getSlot(), targetSlot,
+ 0));
+ }
+ Assert.isFalse(CollectionUtil.isEmpty(tempList), "鏈幏鍙栧嚭鐗囨暟鎹紝缁撴潫鍑虹墖浠诲姟");
+ log.info("鑾峰彇鍑虹墖浠诲姟鏁版嵁{}鏉★紝鎵ц淇濆瓨", tempList.size());
+ List<BigStorageCageTask> bigStorageCageTaskList = tempList;
+ if (taskType == Const.BIG_STORAGE_AFTER_OUT) {
+ if (tempList.size() <= totalLayer) {
+ bigStorageCageTaskList = tempList;
+ } else {
+ int remainCount = tempList.size() % totalLayer;
+// tempList.subList(0,)
+ }
+ }
+ List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList());
+ int glassCount = bigStorageCageTaskList.size();
+ //鐢熸垚鍑虹墖浠诲姟鏉℃暟涓嶈冻6琛ュ叏
+ while (bigStorageCageTaskList.size() < 6) {
+ bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0));
+ }
+ //娓呯┖浠诲姟琛ㄦ暟鎹�
+ bigStorageCageTaskService.removeAll(tableName);
+ bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList);
+ List<HollowBigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> {
+ HollowBigStorageCageHistoryTask history = new HollowBigStorageCageHistoryTask();
+ BeanUtils.copyProperties(e, history);
+ history.setGlassCount(glassCount);
+ history.setTaskType(taskType);
+ return history;
+ }).collect(Collectors.toList());
+ hollowBigStorageCageHistoryTaskService.saveBatch(historyList);
+
+ log.info("灏嗗嚭鐗囩幓鐠儃}鐜荤拑鐘舵�佹敼涓哄嚭鐗囦腑", glassIds);
+ hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>()
+ .set(HollowBigStorageCageDetails::getState, state)
+ .set(Const.BIG_STORAGE_AFTER_DISPATCH.equals(taskType), HollowBigStorageCageDetails::getSlot, targetSlot)
+ .ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
+ .in(HollowBigStorageCageDetails::getGlassId, glassIds));
+ try {
+ miloService.writeToOpcWord(generateReadWriteEntity("DLP2B.DLP2B.MesReply", 1));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return Boolean.TRUE;
+ }
+
+ public void updateSlotRemainBySlots(List<Integer> slotList) {
+ //鑾峰彇鏍煎瓙鍐呮墍鏈夌殑鐜荤拑淇℃伅
+ List<HollowBigStorageCageDetails> inSlotGlassList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
+ .in(HollowBigStorageCageDetails::getSlot, slotList).in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
+ Map<Integer, Double> slotRemainMap = new HashMap<>();
+ //鏄惁瀛樺湪鏈夋牸瀛愰潪绌虹殑鐜荤拑
+ if (CollectionUtils.isNotEmpty(inSlotGlassList)) {
+ //瀛樺湪 灏嗘牸瀛愬唴鐨勭幓鐠冨垎鍒繘琛屾洿鏂�
+ slotRemainMap = inSlotGlassList.stream()
+ .collect(Collectors.groupingBy(HollowBigStorageCageDetails::getSlot, Collectors.summingDouble(item -> Math.max(item.getWidth(), item.getHeight()) + glassGap)));
+ slotRemainMap.forEach((e, v) -> {
+ double remainWidth = slotWidth - v >= 0 ? slotWidth - v : 0;
+ hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>().set(HollowBigStorageCage::getRemainWidth, remainWidth)
+ .eq(HollowBigStorageCage::getSlot, e));
+ });
+ }
+ //杩囨护涓嶅瓨鍦ㄧ幓鐠冪殑鏍煎瓙 灏嗗搴﹂噸缃负鍘熷瀹藉害6200
+ Set<Integer> remainSlotList = slotRemainMap.keySet();
+ slotList.removeAll(remainSlotList);
+ if (CollectionUtils.isNotEmpty(slotList)) {
+ hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>().set(HollowBigStorageCage::getRemainWidth, slotWidth)
+ .in(HollowBigStorageCage::getSlot, slotList));
+ }
+ }
+
+ private ReadWriteEntity generateReadWriteEntity(String identifier, Object value) {
+ return ReadWriteEntity.builder()
+ .identifier(identifier)
+ //Kep涓槸Long绫诲瀷锛屽嵆锛欼nt32锛孞ava涓殑int绫诲瀷
+ .value(value)
+ .build();
+ }
+//
+// private List<BigStorageCageTask> computeOutTaskList(List<BigStorageCageTask> taskList, int totalLayer, int target) {
+//// if (target == 931){}
+// if (taskList.get(0).get)
+// return null;
+// }
+}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-cz.yml b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-cz.yml
new file mode 100644
index 0000000..3bb68c2
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-cz.yml
@@ -0,0 +1,30 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ salve_hangzhoumes:
+ url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+ pp:
+ url: jdbc:mysql://192.168.1.199:3306/pp?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 127.0.0.1:8848
+ redis:
+ database: 0
+ host: 127.0.0.1
+ port: 6379
+ password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-dev.yml b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-dev.yml
new file mode 100644
index 0000000..25a3889
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-dev.yml
@@ -0,0 +1,30 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ salve_hangzhoumes:
+ url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+ pp:
+ url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 127.0.0.1:8848
+ redis:
+ database: 0
+ host: 127.0.0.1
+ port: 6379
+ password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-prod.yml b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-prod.yml
new file mode 100644
index 0000000..95262e6
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-prod.yml
@@ -0,0 +1,30 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ salve_hangzhoumes:
+ url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+ pp:
+ url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 10.153.19.150:8848
+ redis:
+ database: 0
+ host: 10.153.19.150
+ port: 6379
+ password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-yw.yml b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-yw.yml
new file mode 100644
index 0000000..4ac536a
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application-yw.yml
@@ -0,0 +1,30 @@
+spring:
+ datasource:
+ dynamic:
+ primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
+ strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
+ datasource:
+ hangzhoumes:
+ url: jdbc:mysql://192.168.2.100:3306/hangzhoumes?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ pp:
+ url: jdbc:mysql://192.168.2.100:3306/pp?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ salve_hangzhoumes:
+ url: jdbc:sqlserver://192.168.2.100:1433;databasename=mes
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+ cloud:
+ nacos:
+ discovery:
+ server-addr: 192.168.2.100:8848
+ redis:
+ database: 0
+ host: 192.168.2.100
+ port: 6379
+ password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application.yml
new file mode 100644
index 0000000..56609e7
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/application.yml
@@ -0,0 +1,45 @@
+server:
+ port: 8181
+
+spring:
+ profiles:
+ active: yw
+ application:
+ name: hollowGlass
+ liquibase:
+ enabled: false
+ task:
+ scheduling:
+ pool:
+ size: 10
+ thread-name-prefix: task-hollowGlass
+mybatis-plus:
+ mapper-locations: classpath*:mapper/*.xml
+ configuration:
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+mes:
+ sequence:
+ order: true
+ minCount: 30
+ carWidth: 6200 #澶ц溅瀹藉害
+ slotWidth: 6200 #澶ц溅瀹藉害
+ inCarMaxSize: 5 #杩涚墖澶ц溅鏈�澶у瓨鏀剧幓鐠冩暟閲�
+ outCarMaxSize: 6 #鍑虹墖澶ц溅鏈�澶у瓨鏀剧幓鐠冩暟閲�
+ glassGap: 250 #鐜荤拑闂磋窛
+ xMaxSize: 2800
+ temperingOutTargetPosition: 930
+ artificialOutTargetPosition: 931
+
+ scan:
+ ip: 192.168.30.199
+ port: 5000
+kangaroohy:
+ milo:
+ enabled: true
+ primary: default
+ config:
+ default:
+ endpoint: opc.tcp://192.168.2.100:49320
+ security-policy: basic256sha256
+ username: admin
+ password: 1qaz2wsx3edc4rfv
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/logback-spring.xml b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/logback-spring.xml
new file mode 100644
index 0000000..efaa333
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/logback-spring.xml
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="10 seconds">
+ <!-- logger涓婁笅鏂囧悕绉帮紙鏍规嵁涓氬姟淇敼锛� -->
+ <contextName>cacheVerticalGlass</contextName>
+
+ <!-- 瀹氫箟浜嗕竴涓悕涓簊erverName鐨勫睘鎬э紝瀹冪殑鍊兼潵鑷簬logging.file.name锛屽鏋滄病鏈夋壘鍒拌灞炴�ч粯璁や负MyServerName锛堟牴鎹笟鍔′慨鏀癸級 -->
+ <springProperty name="serverName" source="logging.file.name" defaultValue="hollowGlass"/>
+ <springProperty name="logging.path" source="logging.file.path" defaultValue="././logs/"/>
+
+ <!-- 褰╄壊鏃ュ織渚濊禆鐨勬覆鏌撶被 -->
+ <!-- 瀹氫箟浜嗕竴涓悕涓篶lr鐨勮浆鎹㈣鍒欙紝瀹冧娇鐢╫rg.springframework.boot.logging.logback.ColorConverter绫昏繘琛岃浆鎹紝杩欎釜鍏冪礌閫氬父鐢ㄤ簬灏嗘棩蹇楄緭鍑轰腑鐨勬枃鏈潃鑹诧紝浠ヤ究鏇村鏄撳湴鍖哄垎涓嶅悓鐨勬棩蹇楃骇鍒垨鍏朵粬淇℃伅 -->
+ <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
+ <!-- WhitespaceThrowableProxyConverter鍜孍xtendedWhitespaceThrowableProxyConverter閮芥槸鐢ㄤ簬灏嗗紓甯镐俊鎭浆鎹负瀛楃涓诧紝骞跺皢鍏朵腑鐨勬崲琛岀鏇挎崲涓虹┖鏍硷紝浠ヤ究鏇村鏄撳湴鍦ㄦ棩蹇楄緭鍑轰腑鏄剧ず鐨勭被銆傚畠浠箣闂寸殑鍖哄埆鍦ㄤ簬锛孍xtendedWhitespaceThrowableProxyConverter鍦ㄨ緭鍑哄紓甯镐俊鎭椂浼氬寘鍚洿澶氱殑璇︾粏淇℃伅锛屼緥濡傚紓甯哥殑绫诲悕銆佹柟娉曞悕鍜岃鍙风瓑 -->
+ <!-- 瀹氫箟浜嗕竴涓悕涓簑ex鐨勮浆鎹㈣鍒欙紝瀹冧娇鐢╫rg.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter绫昏繘琛岃浆鎹紝杩欎釜鍏冪礌閫氬父鐢ㄤ簬灏嗗紓甯镐俊鎭浆鎹负瀛楃涓诧紝骞跺皢鍏朵腑鐨勬崲琛岀鏇挎崲涓虹┖鏍硷紝浠ヤ究鏇村鏄撳湴鍦ㄦ棩蹇楄緭鍑轰腑鏄剧ず -->
+ <conversionRule conversionWord="wex"
+ converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
+ <!-- 瀹氫箟浜嗕竴涓悕涓簑Ex鐨勮浆鎹㈣鍒欙紝瀹冧娇鐢╫rg.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter绫昏繘琛岃浆鎹紝杩欎釜鍏冪礌閫氬父鐢ㄤ簬灏嗗紓甯镐俊鎭浆鎹负瀛楃涓诧紝骞跺皢鍏朵腑鐨勬崲琛岀鏇挎崲涓虹┖鏍硷紝浠ヤ究鏇村鏄撳湴鍦ㄦ棩蹇楄緭鍑轰腑鏄剧ず -->
+ <conversionRule conversionWord="wEx"
+ converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
+
+ <!-- 褰╄壊鏃ュ織鏍煎紡 -->
+ <!-- value鍊兼槸鏃ュ織杈撳嚭妯℃澘锛� :-鏄睘鎬у悕鍜屽叾榛樿鍊间箣闂寸殑鍒嗛殧绗︼紝浣滅敤涓�:鐩稿悓 -->
+ <!-- 瀹氫箟鏃ュ織杈撳嚭鏍煎紡鐨勮浆鎹㈣鍒欙紝%d{yyyy-MM-dd HH:mm:ss.SSS}琛ㄧず鏃ユ湡鍜屾椂闂达紝%clr琛ㄧず灏嗚緭鍑烘枃鏈潃鑹诧紝{faint}琛ㄧず浣跨敤娣¤壊 -->
+ <!-- %5p琛ㄧず鏃ュ織绾у埆杈撳嚭鍙冲榻愶紝宸﹁竟浠ョ┖鏍煎~鍏� -->
+ <!-- ${PID:- }琛ㄧず杩涚▼ID锛�%clr琛ㄧず灏嗚緭鍑烘枃鏈潃鑹诧紝{magenta}琛ㄧず浣跨敤娲嬬孩鑹� -->
+ <!-- -琛ㄧず涓�涓垎闅旂 -->
+ <!-- %t锛氭樉绀轰骇鐢熻鏃ュ織鐨勭嚎绋嬪悕锛�%15锛氳嫢瀛楃闀垮害灏忎簬15锛屽垯宸﹁竟鐢ㄧ┖鏍煎~鍏咃紱%.15锛氳嫢瀛楃闀垮害瓒呰繃15锛屾埅鍘诲浣欏瓧绗� -->
+ <!-- %-40锛氳嫢瀛楃闀垮害灏忎簬40锛屽垯鍙宠竟鐢ㄧ┖鏍煎~鍏咃紱%.40锛氳嫢瀛楃闀垮害瓒呰繃40锛屾埅鍘诲浣欏瓧绗︼紱logger{39}瀵瑰簲鐨勬槸鈥渓ogging.WARNING鈥濈骇鍒�傚叿浣撴潵璇达紝Python鐨刲ogging妯″潡瀹氫箟浜嗕互涓嬪嚑涓骇鍒紙浠庝綆鍒伴珮锛夛細NOTSET銆丏EBUG銆両NFO銆乄ARNING銆丒RROR銆丆RITICAL銆傚洜姝わ紝logger{39}琛ㄧず鐨勬槸WARNING绾у埆锛屽嵆鏃ュ織璁板綍鍣ㄤ細璁板綍鎵�鏈塛ARNING绾у埆鍙婁互涓婄殑鏃ュ織淇℃伅 -->
+ <!-- %m琛ㄧず鏃ュ織娑堟伅锛�%n琛ㄧず鎹㈣绗︼紱${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}琛ㄧず寮傚父淇℃伅銆傚鏋滄棩蹇楄緭鍑轰腑鍖呭惈寮傚父淇℃伅锛岃繖涓鍒欏皢浼氬皢鍏惰浆鎹负瀛楃涓诧紝骞跺皢鍏朵腑鐨勬崲琛岀鏇挎崲涓虹┖鏍硷紝浠ヤ究鏇村鏄撳湴鍦ㄦ棩蹇楄緭鍑轰腑鏄剧ず -->
+ <property name="CONSOLE_LOG_PATTERN"
+ value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+
+ <!--1. 杈撳嚭鍒版帶鍒跺彴-->
+ <!-- 瀹氫箟鎺у埗鍙版棩蹇楄緭鍑虹殑appender锛宑lass="ch.qos.logback.core.ConsoleAppender"琛ㄧず浣跨敤Logback妗嗘灦鎻愪緵鐨凜onsoleAppender绫绘潵杈撳嚭鏃ュ織鍒版帶鍒跺彴 -->
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <!--姝ゆ棩蹇梐ppender鏄负寮�鍙戜娇鐢紝鍙厤缃渶搴曠骇鍒紝鎺у埗鍙拌緭鍑虹殑鏃ュ織绾у埆鏄ぇ浜庢垨绛変簬姝ょ骇鍒殑鏃ュ織淇℃伅-->
+ <!-- 瀹氫箟鏃ュ織杈撳嚭绾у埆鐨勮繃婊ゅ櫒锛宑lass="ch.qos.logback.classic.filter.ThresholdFilter"琛ㄧず浣跨敤Logback妗嗘灦鎻愪緵鐨凾hresholdFilter绫绘潵杩囨护鏃ュ織杈撳嚭锛�<level>debug</level>琛ㄧず鍙緭鍑篸ebug绾у埆鍙婁互涓婄殑鏃ュ織 -->
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>debug</level>
+ </filter>
+ <encoder>
+ <!-- ${CONSOLE_LOG_PATTERN}琛ㄧず鎺у埗鍙版棩蹇楄緭鍑烘牸寮忥紝UTF-8琛ㄧず缂栫爜鏍煎紡 -->
+ <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
+ <!-- 璁剧疆瀛楃闆� -->
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+ <!--2. 杈撳嚭鍒版枃妗�-->
+ <!-- 2.1 level涓� DEBUG 鏃ュ織锛屾椂闂存粴鍔ㄨ緭鍑� -->
+ <!-- 瀹氫箟鏂囦欢鏃ュ織杈撳嚭鐨刟ppender锛宑lass="ch.qos.logback.core.rolling.RollingFileAppender"琛ㄧず浣跨敤Logback妗嗘灦鎻愪緵鐨凴ollingFileAppender绫绘潵杈撳嚭鏃ュ織鍒版枃浠� -->
+ <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <!-- 姝e湪璁板綍鐨勬棩蹇楁枃妗g殑璺緞鍙婃枃妗e悕 -->
+ <file>${logging.path}/${serverName}/web_debug.log</file>
+ <!--鏃ュ織鏂囨。杈撳嚭鏍煎紡-->
+ <encoder>
+ <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+ <charset>UTF-8</charset> <!-- 璁剧疆瀛楃闆� -->
+ </encoder>
+ <!-- 鏃ュ織璁板綍鍣ㄧ殑婊氬姩绛栫暐锛屾寜鏃ユ湡锛屾寜澶у皬璁板綍 -->
+ <!-- 瀹氫箟鏃ュ織鏂囦欢婊氬姩绛栫暐鐨勬爣绛撅紝class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"琛ㄧず浣跨敤Logback妗嗘灦鎻愪緵鐨凾imeBasedRollingPolicy绫绘潵瀹氫箟鏃ュ織鏂囦欢鐨勬粴鍔ㄧ瓥鐣� -->
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <!-- 鏃ュ織褰掓。 -->
+ <!-- 瀹氫箟鏃ュ織鏂囦欢鍚嶇殑妯″紡銆傚湪杩欎釜妯″紡涓紝${logging.path}琛ㄧず鏃ュ織鏂囦欢鐨勮矾寰勶紝%d{yyyy-MM-dd}琛ㄧず鏃ユ湡鏍煎紡锛�%i琛ㄧず鏂囦欢绱㈠紩 -->
+ <fileNamePattern>${logging.path}/${serverName}/web-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+ <!-- 瀹氫箟鏃ュ織鏂囦欢婊氬姩绛栫暐鐨勬爣绛撅紝class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"琛ㄧず浣跨敤Logback妗嗘灦鎻愪緵鐨凷izeAndTimeBasedFNATP绫绘潵瀹氫箟鏃ュ織鏂囦欢鐨勬粴鍔ㄧ瓥鐣ワ紝<maxFileSize>100MB</maxFileSize>琛ㄧず鏃ュ織鏂囦欢鐨勬渶澶уぇ灏忎负100MB銆傝繖涓粴鍔ㄧ瓥鐣ラ�氬父鐢ㄤ簬鎸夌収鏃堕棿鍜屾枃浠跺ぇ灏忔粴鍔ㄦ棩蹇楁枃浠讹紝浠ヤ究鏇村ソ鍦扮鐞嗘棩蹇楁枃浠剁殑澶у皬鍜屾暟閲� -->
+ <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+ <maxFileSize>100MB</maxFileSize>
+ </timeBasedFileNamingAndTriggeringPolicy>
+ <!--鏃ュ織鏂囨。淇濈暀澶╂暟-->
+ <maxHistory>15</maxHistory>
+ </rollingPolicy>
+ <!-- 姝ゆ棩蹇楁枃妗e彧璁板綍debug绾у埆鐨� -->
+ <!-- 瀹氫箟鏃ュ織杈撳嚭绾у埆鐨勮繃婊ゅ櫒銆傚湪杩欎釜杩囨护鍣ㄤ腑锛宑lass="ch.qos.logback.classic.filter.LevelFilter"琛ㄧず浣跨敤Logback妗嗘灦鎻愪緵鐨凩evelFilter绫绘潵杩囨护鏃ュ織杈撳嚭锛�<level>debug</level>琛ㄧず鍙緭鍑篸ebug绾у埆鍙婁互涓婄殑鏃ュ織 -->
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>debug</level>
+ <!-- <onMatch>ACCEPT</onMatch>琛ㄧず濡傛灉鏃ュ織浜嬩欢涓庤繃婊ゅ櫒鍖归厤锛屽垯鎺ュ彈璇ヤ簨浠讹紝<onMismatch>DENY</onMismatch>琛ㄧず濡傛灉鏃ュ織浜嬩欢涓庤繃婊ゅ櫒涓嶅尮閰嶏紝鍒欐嫆缁濊浜嬩欢 -->
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ </appender>
+ <!-- 2.2 level涓� INFO 鏃ュ織锛屾椂闂存粴鍔ㄨ緭鍑� -->
+ <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <!-- 姝e湪璁板綍鐨勬棩蹇楁枃妗g殑璺緞鍙婃枃妗e悕 -->
+ <file>${logging.path}/${serverName}/web_info.log</file>
+ <!--鏃ュ織鏂囨。杈撳嚭鏍煎紡-->
+ <encoder>
+ <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ <!-- 鏃ュ織璁板綍鍣ㄧ殑婊氬姩绛栫暐锛屾寜鏃ユ湡锛屾寜澶у皬璁板綍 -->
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <!-- 澶╁ぉ鏃ュ織褰掓。璺緞浠ュ強鏍煎紡 -->
+ <fileNamePattern>${logging.path}/${serverName}/web-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+ <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+ <maxFileSize>100MB</maxFileSize>
+ </timeBasedFileNamingAndTriggeringPolicy>
+ <!--鏃ュ織鏂囨。淇濈暀澶╂暟-->
+ <maxHistory>15</maxHistory>
+ </rollingPolicy>
+ <!-- 姝ゆ棩蹇楁枃妗e彧璁板綍info绾у埆鐨� -->
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>info</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ </appender>
+ <!-- 2.3 level涓� WARN 鏃ュ織锛屾椂闂存粴鍔ㄨ緭鍑� -->
+ <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <!-- 姝e湪璁板綍鐨勬棩蹇楁枃妗g殑璺緞鍙婃枃妗e悕 -->
+ <file>${logging.path}/${serverName}/web_warn.log</file>
+ <!--鏃ュ織鏂囨。杈撳嚭鏍煎紡-->
+ <encoder>
+ <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+ <charset>UTF-8</charset> <!-- 姝ゅ璁剧疆瀛楃闆� -->
+ </encoder>
+ <!-- 鏃ュ織璁板綍鍣ㄧ殑婊氬姩绛栫暐锛屾寜鏃ユ湡锛屾寜澶у皬璁板綍 -->
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <fileNamePattern>${logging.path}/${serverName}/web-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+ <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+ <maxFileSize>100MB</maxFileSize>
+ </timeBasedFileNamingAndTriggeringPolicy>
+ <!--鏃ュ織鏂囨。淇濈暀澶╂暟-->
+ <maxHistory>15</maxHistory>
+ </rollingPolicy>
+ <!-- 姝ゆ棩蹇楁枃妗e彧璁板綍warn绾у埆鐨� -->
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>warn</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ </appender>
+ <!-- 2.4 level涓� ERROR 鏃ュ織锛屾椂闂存粴鍔ㄨ緭鍑� -->
+ <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <!-- 姝e湪璁板綍鐨勬棩蹇楁枃妗g殑璺緞鍙婃枃妗e悕 -->
+ <file>${logging.path}/${serverName}/web_error.log</file>
+ <!--鏃ュ織鏂囨。杈撳嚭鏍煎紡-->
+ <encoder>
+ <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+ <charset>UTF-8</charset> <!-- 姝ゅ璁剧疆瀛楃闆� -->
+ </encoder>
+ <!-- 鏃ュ織璁板綍鍣ㄧ殑婊氬姩绛栫暐锛屾寜鏃ユ湡锛屾寜澶у皬璁板綍 -->
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <fileNamePattern>${logging.path}/${serverName}/web-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+ <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+ <maxFileSize>100MB</maxFileSize>
+ </timeBasedFileNamingAndTriggeringPolicy>
+ <!--鏃ュ織鏂囨。淇濈暀澶╂暟-->
+ <maxHistory>15</maxHistory>
+ </rollingPolicy>
+ <!-- 姝ゆ棩蹇楁枃妗e彧璁板綍ERROR绾у埆鐨� -->
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>ERROR</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ </appender>
+ <!-- 4.1 寮�鍙戠幆澧�:鎵撳嵃鎺у埗鍙�-->
+ <!-- 鐢ㄤ簬鍦⊿pring Boot搴旂敤绋嬪簭涓厤缃棩蹇楄褰曠殑鏍囩銆傚湪杩欎釜鏍囩涓紝name="dev"琛ㄧず杩欎釜閰嶇疆鏂囦欢鍙湪dev鐜涓敓鏁堬紝<logger name="com.myClass.controller" level="debug"/>琛ㄧず涓篶om.myClass.controller锛堟牴鎹笟鍔′慨鏀癸級杩欎釜鍖呬笅鐨勭被閰嶇疆鏃ュ織杈撳嚭绾у埆涓篸ebug -->
+ <!-- <springProfile name="dev">-->
+ <!-- <logger name="com.myClass.controller" level="debug"/>-->
+ <!-- </springProfile>-->
+ <!-- 鐢ㄤ簬閰嶇疆鏃ュ織杈撳嚭鐨勬爣绛俱�傚湪杩欎釜鏍囩涓紝level="info"琛ㄧず鏃ュ織杈撳嚭绾у埆涓篿nfo锛�<appender-ref ref="CONSOLE"/>銆�<appender-ref ref="DEBUG_FILE"/>銆�<appender-ref ref="INFO_FILE"/>銆�<appender-ref ref="WARN_FILE"/>銆�<appender-ref ref="ERROR_FILE"/>琛ㄧず灏嗘棩蹇楄緭鍑哄埌涓嶅悓鐨刟ppender涓紝鍒嗗埆涓烘帶鍒跺彴銆乨ebug鏂囦欢銆乮nfo鏂囦欢銆亀arn鏂囦欢鍜宔rror鏂囦欢 -->
+ <root level="info">
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="DEBUG_FILE"/>
+ <appender-ref ref="INFO_FILE"/>
+ <appender-ref ref="WARN_FILE"/>
+ <appender-ref ref="ERROR_FILE"/>
+ </root>
+</configuration>
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
new file mode 100644
index 0000000..b94c140
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.mes.hollow.mapper.HollowBigStorageCageDetailsMapper">
+
+ <resultMap id="baseMap" type="com.mes.hollow.entity.dto.FlowCardGlassInfoDTO">
+ <result column="engineer_id" property="engineerId"/>
+ <result column="flow_card_id" property="flowCardId"/>
+ <result column="layer" property="layer"/>
+ <result column="sum_count" property="sumCount"/>
+ <result column="pair_count" property="pairCount"/>
+ <result column="real_count" property="realCount"/>
+ <result column="damage_count" property="damageCount"/>
+ <result column="lack_count" property="lackCount"/>
+ </resultMap>
+ <resultMap id="virtualSlotSequenceDTO" type="com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO">
+ <result column="flow_card_id" property="flowCardId"/>
+ <result column="layer" property="layer"/>
+ <result column="virtual_slot" property="virtualSlot"/>
+ </resultMap>
+ <resultMap id="baseSlotSequenceDTO" type="com.mes.hollow.entity.dto.BigStorageSequenceDTO">
+ <result column="slot" property="slot"/>
+ <result column="max_sequence" property="maxSequence"/>
+ <result column="min_sequence" property="minSequence"/>
+ </resultMap>
+
+ <update id="updateBySlot">
+ update hollow_big_storage_cage_details
+ <set>
+ state = #{state}
+ </set>
+ <where>
+ (glass_id,slot) in (
+ <foreach collection="list" item="item" separator=",">
+ (#{item.glassId}, #{item.targetSlot})
+ </foreach>
+ )
+ and state !=101
+ </where>
+ </update>
+
+ <select id="hollowIsAll" resultMap="baseMap">
+ WITH sum_flow_layer_count AS (
+ SELECT
+ flow_card_id,
+ layer,
+ min( films_id ) AS films_id,
+ count(*) AS sum_count
+ FROM
+ hollow_glass_relation_info
+ GROUP BY
+ flow_card_id,
+ layer
+ ),
+ real_flow_layer_count AS (
+ SELECT
+ flow_card_id,
+ layer,
+ count(*) AS real_count
+ FROM
+ hollow_glass_relation_info
+ WHERE
+ tempering_layout_id IS NOT NULL
+ AND tempering_feed_sequence IS NOT NULL
+ GROUP BY
+ flow_card_id,
+ layer
+ ),
+ damage_flow_layer_count AS ( SELECT process_id AS flow_card_id, technology_number AS layer, count(*)
+ damage_count FROM damage GROUP BY process_id, technology_number ),
+ lack_flow_layer_count AS (
+ SELECT
+ t.flow_card_id,
+ t.layer,
+ ( sum_count - real_count - damage_count ) AS lack_count
+ FROM
+ sum_flow_layer_count t
+ INNER JOIN real_flow_layer_count t1 ON t.flow_card_id = t1.flow_card_id
+ AND t.layer = t1.layer
+ INNER JOIN damage_flow_layer_count t2 ON t1.flow_card_id = t2.flow_card_id
+ AND t1.layer = t2.layer
+ ),
+ layer_one AS ( SELECT * FROM hollow_glass_relation_info WHERE layer = 1 AND tempering_layout_id IS NOT NULL AND
+ tempering_feed_sequence IS NOT NULL ),
+ layer_two AS ( SELECT * FROM hollow_glass_relation_info WHERE layer = 2 AND tempering_layout_id IS NOT NULL AND
+ tempering_feed_sequence IS NOT NULL ),
+ layer_three AS ( SELECT * FROM hollow_glass_relation_info WHERE layer = 3 AND tempering_layout_id IS NOT NULL
+ AND tempering_feed_sequence IS NOT NULL )
+ ,
+ pair_flow_layer_count AS (
+ SELECT
+ t.flow_card_id,
+ count(*) AS pair_count
+ FROM
+ layer_one t
+ INNER JOIN layer_two t1 ON t.flow_card_id = t1.flow_card_id
+ AND t.virtual_slot = t1.virtual_slot
+ AND t.slot_sequence = t1.slot_sequence
+ <if test="totalLayer == 3">
+ inner join layer_three t2
+ on t.flow_card_id = t2.flow_card_id and
+ t.virtual_slot = t2.virtual_slot and t.slot_sequence = t2.slot_sequence
+ </if>
+ GROUP BY
+ t.flow_card_id
+ )
+ ,result_flow_layer_count AS (
+ SELECT
+ t.flow_card_id,
+ t.layer,
+ t.films_id,
+ sum_count,
+ t3.pair_count,
+ IFNULL(real_count,0) as real_count,
+ IFNULL(damage_count,0) as damage_count,
+ IFNULL(lack_count,0) as lack_count
+ FROM
+ sum_flow_layer_count t
+ left JOIN real_flow_layer_count t1 ON t.flow_card_id = t1.flow_card_id
+ AND t.layer = t1.layer
+ left JOIN lack_flow_layer_count t2 ON t.flow_card_id = t2.flow_card_id
+ AND t.layer = t2.layer
+ left JOIN pair_flow_layer_count t3 ON t.flow_card_id = t3.flow_card_id
+ left JOIN damage_flow_layer_count t4 ON t.flow_card_id = t4.flow_card_id
+ AND t.layer = t4.layer
+ ) SELECT
+ *
+ FROM
+ result_flow_layer_count
+ WHERE
+ flow_card_id = #{flowCardId}
+ <if test="flag == true">
+ and sum_count = pair_count
+ </if>
+ </select>
+
+
+ <select id="queryIsAllNeedDispatchVirtualSlot" resultMap="virtualSlotSequenceDTO">
+ with relation_temp as (
+ select flow_card_id, layer, virtual_slot, count(1) as slot_count
+ from hollow_glass_relation_info
+ group by flow_card_id, layer, virtual_slot
+ ),
+ details_temp as (
+ select flow_card_id, layer, virtual_slot, count(1) as slot_count
+ from hollow_big_storage_cage_details
+ where state = 100
+ group by flow_card_id, layer, virtual_slot
+ ),
+ result_one as (
+ select t.*, t1.slot_count as tslot_count
+ from relation_temp t
+ INNER JOIN details_temp t1 on t.flow_card_id = t1.flow_card_id and
+ t.layer = t1.layer and
+ t.virtual_slot = t1.virtual_slot
+ where t.slot_count = t1.slot_count
+ )
+ select flow_card_id, layer, virtual_slot
+ from result_one
+ order by flow_card_id, layer, virtual_slot
+ </select>
+
+ <select id="queryNeedDispatchSlot" resultMap="baseSlotSequenceDTO">
+ select slot, max(sequence) as max_sequence, min(sequence) as min_sequence
+ from hollow_big_storage_cage_details
+ where (flow_card_id, layer, virtual_slot) = (#{flowCardId}, #{layer}, #{virtualSlot})
+ group by slot
+ order by max_sequence
+ </select>
+ <select id="queryOutGlassList" resultType="com.mes.hollow.entity.HollowBigStorageCageDetails">
+ with flow_card_id_layer as (
+ select flow_card_id, max(total_layer) as total_layer
+ FROM hollow_big_storage_cage_details
+ group by flow_card_id
+ ),
+ details_sequence_count_temp as (
+ SELECT flow_card_id, hollow_sequence, count(1) as max_count
+ FROM hollow_big_storage_cage_details
+ and state = 100
+ group by flow_card_id, hollow_sequence
+ ),
+ glass_out_temp as (
+ select t1.*, case when t.total_layer = t1.max_count then 1 else 0 end is_pair
+ from flow_card_id_layer t
+ inner join details_sequence_count_temp t1 on t.flow_card_id = t1.flow_card_id
+ ),
+ result_detail as (
+ select t.id,
+ t.device_id,
+ t.virtual_slot,
+ t.slot,
+ t.glass_id,
+ t.sequence,
+ t.flow_card_id,
+ t.glass_type,
+ t.width,
+ t.height,
+ t.thickness,
+ t.tempering_layout_id,
+ t.tempering_feed_sequence,
+ t.state,
+ t.gap,
+ t.engineer_id,
+ t.total_layer,
+ t.layer,
+ t.create_time,
+ t.update_time,
+ t.hollow_sequence,
+ t.films_id,
+ t1.is_pair
+ from hollow_big_storage_cage_details t
+ INNER JOIN glass_out_temp t1
+ on t.flow_card_id = t1.flow_card_id and t.hollow_sequence = t1.hollow_sequence
+ where t.state = 100
+ and t.flow_card_id = #{flowCardId}
+ )
+ select *
+ from result_detail
+ order by flow_card_id, hollow_sequence
+ <if test="cell != 931">
+ desc
+ </if>
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
new file mode 100644
index 0000000..292e3cc
--- /dev/null
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.mes.hollow.mapper.HollowGlassRelationInfoMapper">
+
+ <resultMap id="baseMap" type="com.mes.hollow.entity.dto.HollowGlassDetailsDTO">
+ <result column="process_id" property="flowCardId"/>
+ <result column="child_width" property="width"/>
+ <result column="child_height" property="height"/>
+ <result column="order_number" property="orderSort"/>
+ <result column="technology_number" property="layer"/>
+ <result column="quantity" property="quantity"/>
+ </resultMap>
+ <resultMap id="lackBaseMap" type="com.mes.hollow.entity.dto.LackDetailsDTO">
+ <result column="flow_card_id" property="flowCardId"/>
+ <result column="layer" property="layer"/>
+ <result column="films_id" property="filmsId"/>
+ <result column="first_length" property="width"/>
+ <result column="second_Length" property="height"/>
+ <result column="thickness" property="thickness"/>
+ <result column="lack_cout" property="lackCount"/>
+ </resultMap>
+ <select id="queryFlowCardIdMaxLayerGlassInfo" resultMap="baseMap">
+ with temp_flow as (SELECT t.process_id,
+ t.order_id,
+ t.order_number,
+ t.technology_number,
+ t.quantity,
+ t1.child_width,
+ t1.child_height
+
+ from pp.flow_card t
+ LEFT JOIN sd.order_glass_detail t1
+ on t.order_id = t1.order_id
+ and t.order_number = t1.order_number
+ and t.technology_number = t1.technology_number
+ where t.process_id = #{flowCardId}),
+ glass_info_temp as (
+ select process_id,
+ order_id,
+ GREATEST(child_width, child_height) as first_length,
+ least(child_width, child_height) as second_length,
+ child_width,
+ child_height,
+ order_number,
+ technology_number,
+ quantity
+ from temp_flow
+ where technology_number = #{totalLayer}
+ )
+ select row_number() over (order by second_length desc,first_length desc) as rn, t.*
+ from glass_info_temp t
+ </select>
+
+ <select id="queryFlowCardIdLayerGlassInfo" resultMap="baseMap">
+ with temp_flow as (SELECT t.process_id,
+ t.order_id,
+ t.order_number,
+ t.technology_number,
+ t.quantity,
+ t1.child_width,
+ t1.child_height
+
+ from pp.flow_card t
+ LEFT JOIN sd.order_glass_detail t1
+ on t.order_id = t1.order_id
+ and t.order_number = t1.order_number
+ and t.technology_number = t1.technology_number
+ where t.process_id = #{flowCardId}),
+ glass_info_max_layer_temp as (
+ select process_id,
+ order_id,
+ GREATEST(child_width, child_height) as first_length,
+ least(child_width, child_height) as second_length,
+ child_width,
+ child_height,
+ order_number,
+ technology_number,
+ quantity
+ from temp_flow
+ where technology_number = #{totalLayer}
+ ),
+ glass_info_layer_temp as (
+ select process_id,
+ order_id,
+ GREATEST(child_width, child_height) as first_length,
+ least(child_width, child_height) as second_length,
+ child_width,
+ child_height,
+ order_number,
+ technology_number,
+ quantity
+ from temp_flow
+ where technology_number = #{layer}
+ ),
+ max_layer_sequence as (
+ select row_number() over (order by second_length desc,first_length desc) as rn, t.order_number
+ from glass_info_max_layer_temp t
+ ),
+ result as (select t.*
+ from glass_info_layer_temp t
+ INNER join max_layer_sequence t1 on t.order_number = t1.order_number
+ order by t1.rn)
+ select *
+ from result
+ </select>
+ <select id="queryLackByFlowCard" resultMap="lackBaseMap">
+ with relation_length as (
+ select flow_card_id,
+ layer,
+ tempering_layout_id,
+ tempering_feed_sequence,
+ GREATEST(width, height) as first_length,
+ LEAST(width, height) as second_Length,
+ width,
+ height,
+ thickness,
+ films_id
+ from hollow_glass_relation_info
+ where flow_card_id = #{flowCardId}
+ and tempering_layout_id is null
+ and tempering_feed_sequence is null
+ )
+ select flow_card_id, layer, first_length, films_id, second_Length, thickness, count(*) as lack_cout
+ from relation_length
+ group by flow_card_id, layer, films_id, first_length, second_Length, thickness
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/pom.xml b/hangzhoumesParent/moduleService/pom.xml
index 55ea5f6..7d2c012 100644
--- a/hangzhoumesParent/moduleService/pom.xml
+++ b/hangzhoumesParent/moduleService/pom.xml
@@ -19,6 +19,7 @@
<module>TemperingGlassModule</module>
<module>UnLoadGlassModule</module>
<module>GlassStorageModule</module>
+ <module>howllowGlassModule</module>
</modules>
<properties>
diff --git a/hangzhoumesParent/pom.xml b/hangzhoumesParent/pom.xml
index a9b0a6b..b371f22 100644
--- a/hangzhoumesParent/pom.xml
+++ b/hangzhoumesParent/pom.xml
@@ -11,6 +11,7 @@
<module>common</module>
<module>moduleService</module>
<module>gateway</module>
+ <module>mesHub</module>
</modules>
<packaging>pom</packaging>
--
Gitblit v1.8.0