From aea7379082d3a9d53a35f62e8ff435254be8d213 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期二, 04 十一月 2025 19:46:59 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject

---
 hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java                                           |   23 ++
 hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java                 |    4 
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml                           |  142 +++++++++++------
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java          |    4 
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java |    7 
 hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java                                         |   59 +++++++
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java    |    8 +
 hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java                                                    |   85 ++--------
 hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/service/impl/SysMenuServiceImpl.java                                      |    5 
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageGlassInfoServiceImpl.java   |   20 ++
 hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/entity/SysMenu.java                                                       |    2 
 hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java      |    7 
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java                             |   16 ++
 hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java                                 |   42 ++++-
 hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml                            |   34 +++
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java            |   10 +
 hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageDetailsController.java         |    7 
 hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java               |    4 
 18 files changed, 348 insertions(+), 131 deletions(-)

diff --git a/hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/entity/SysMenu.java b/hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/entity/SysMenu.java
index 37476c6..0559a3f 100644
--- a/hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/entity/SysMenu.java
+++ b/hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/entity/SysMenu.java
@@ -65,7 +65,7 @@
     /**
      * 鎺掑簭
      */
-    private String listSort;
+    private Integer listSort;
 
     /**
      * 鍒涘缓鏃堕棿
diff --git a/hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/service/impl/SysMenuServiceImpl.java b/hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/service/impl/SysMenuServiceImpl.java
index 597f93c..4e96f47 100644
--- a/hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/service/impl/SysMenuServiceImpl.java
+++ b/hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/service/impl/SysMenuServiceImpl.java
@@ -65,11 +65,12 @@
                 .innerJoin(SysRoleMenu.class, SysRoleMenu::getRoleId, SysUserRole::getRoleId)
                 .innerJoin(SysMenu.class, SysMenu::getId, SysRoleMenu::getMenuId)
                 .eq(SysUser::getId, user.getId())
-                .like(StringUtils.isNotBlank(request.getKey()), SysMenu::getMenuName, request.getKey());
+                .like(StringUtils.isNotBlank(request.getKey()), SysMenu::getMenuName, request.getKey())
+                .orderByAsc(SysMenu::getListSort);
 
         //
         List<SysMenu> menuList = sysUserRoleMapper.selectJoinList(SysMenu.class, wrapper);
-        log.info("userinfos:{}",menuList);
+        log.info("userinfos:{}", menuList);
         return create(menuList);
     }
 
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java
index 94ca28e..8a1bf3a 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java
@@ -8,6 +8,8 @@
 import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer;
 import com.kangaroohy.milo.model.ReadWriteEntity;
 import com.kangaroohy.milo.service.MiloService;
+import com.mes.alarm.entity.ProductAlarmInfo;
+import com.mes.alarm.service.ProductAlarmInfoService;
 import com.mes.common.config.Const;
 import com.mes.common.config.ConstSysConfig;
 import com.mes.damage.service.DamageService;
@@ -113,8 +115,24 @@
     private String glassIdOne = "";
     private String glassIdTwo = "";
 
+    @Resource
+    private ProductAlarmInfoService productAlarmInfoService;
+
+    private static final String ALARM_MODULE = "纾ㄨ竟";
+    private static final String ALARM_TYPE1 = "涓�绾垮崸寮忕悊鐗囩";
+    private static final String ALARM_TYPE2 = "浜岀嚎鍗у紡鐞嗙墖绗�";
+    private static final String ALARM_CODE_NOGLASS = "noGlass";
+
     @Scheduled(fixedDelay = 1000)
     public void startOneOpcTask() throws Exception {
+        List<ProductAlarmInfo> alarmInfos = productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>()
+                .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW)
+                .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE)
+                .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE1));
+        if (CollectionUtil.isNotEmpty(alarmInfos)) {
+            log.info("鐣岄潰鎶ヨ锛岀瓑寰呬汉宸ュ共棰勫鐞�");
+            return;
+        }
         S7DataWL s7DataWLTwo = s7SerializerWLTwo.read(S7DataWL.class);
         S7DataWL s7DataWLOne = s7SerializerWLOne.read(S7DataWL.class);
         S7DataWLExtra s7DataWLExtraTwo = s7SerializerWLTwo.read(S7DataWLExtra.class);
@@ -132,6 +150,14 @@
 
     @Scheduled(fixedDelay = 1000)
     public void startTwoOpcTask() throws Exception {
+        List<ProductAlarmInfo> alarmInfos = productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>()
+                .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW)
+                .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE)
+                .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE2));
+        if (CollectionUtil.isNotEmpty(alarmInfos)) {
+            log.info("鐣岄潰鎶ヨ锛岀瓑寰呬汉宸ュ共棰勫鐞�");
+            return;
+        }
         S7DataWL s7DataWLOne = s7SerializerWLOne.read(S7DataWL.class);
         S7DataWL s7DataWLTwo = s7SerializerWLTwo.read(S7DataWL.class);
         S7DataWLExtra s7DataWLExtraTwo = s7SerializerWLTwo.read(S7DataWLExtra.class);
@@ -280,6 +306,17 @@
         GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, task.getGlassIdIn()));
         if (null == glassInfo) {
             log.info("杩涚墖鐜荤拑淇℃伅涓嶅瓨鍦紝鐜荤拑id:{}", task.getGlassIdIn());
+            ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+            alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+            alarmInfo.setAlarmModule(ALARM_MODULE);
+            if (deviceId == 1) {
+                alarmInfo.setAlarmType(ALARM_TYPE1);
+            } else {
+                alarmInfo.setAlarmType(ALARM_TYPE2);
+            }
+            alarmInfo.setAlarmCode(ALARM_CODE_NOGLASS);
+            alarmInfo.setAlarmMessage(task.getGlassIdIn());
+            productAlarmInfoService.save(alarmInfo);
             Date endDate = new Date();
             log.info("缁撴潫杩涚墖浠诲姟璁惧涓簕}锛岀粨鏉熸椂闂翠负锛歿}锛屽叡鑰楁椂锛歿}ms", deviceId, endDate, endDate.getTime() - startDate.getTime());
             return Boolean.FALSE;
@@ -343,6 +380,24 @@
 
     private boolean outTask(S7DataWL task, int deviceId, int cellFlag) {
         Date startDate = new Date();
+        GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, task.getGlassIdIn()));
+        if (null == glassInfo) {
+            log.info("杩涚墖鐜荤拑淇℃伅涓嶅瓨鍦紝鐜荤拑id:{}", task.getGlassIdIn());
+            ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+            alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+            alarmInfo.setAlarmModule(ALARM_MODULE);
+            if (deviceId == 1) {
+                alarmInfo.setAlarmType(ALARM_TYPE1);
+            } else {
+                alarmInfo.setAlarmType(ALARM_TYPE2);
+            }
+            alarmInfo.setAlarmCode(ALARM_CODE_NOGLASS);
+            alarmInfo.setAlarmMessage(task.getGlassIdIn());
+            productAlarmInfoService.save(alarmInfo);
+            Date endDate = new Date();
+            log.info("缁撴潫杩涚墖浠诲姟璁惧涓簕}锛岀粨鏉熸椂闂翠负锛歿}锛屽叡鑰楁椂锛歿}ms", deviceId, endDate, endDate.getTime() - startDate.getTime());
+            return Boolean.FALSE;
+        }
         //鑾峰彇瀵瑰簲鐨勮澶囩姸鎬佷俊鎭�
         S7DataWL s7DataWLOne = s7SerializerWLOne.read(S7DataWL.class);
         S7DataWL s7DataWLTwo = s7SerializerWLTwo.read(S7DataWL.class);
@@ -382,9 +437,9 @@
                 cell = Const.ONE_OUT_TARGET_POSITION;
             } else if (Const.OUT_BUSY.equals(twoOutState)) {
                 cell = Const.TWO_OUT_TARGET_POSITION;
-            }else if(Const.OUT_BUSY.equals(oneOutState)){
+            } else if (Const.OUT_BUSY.equals(oneOutState)) {
                 cell = Const.ONE_OUT_TARGET_POSITION;
-            }else{
+            } else {
                 return Boolean.FALSE;
             }
         }
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
index 3154bf8..57ec394 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
@@ -2,6 +2,8 @@
 
 import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.mes.alarm.entity.ProductAlarmInfo;
+import com.mes.alarm.service.ProductAlarmInfoService;
 import com.mes.common.config.Const;
 import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
 import com.mes.edgglasstask.service.EdgGlassTaskInfoService;
@@ -55,6 +57,13 @@
     EngineeringService engineeringService;
     @Resource
     LargenScreenService largenScreenService;
+    @Resource
+    private ProductAlarmInfoService productAlarmInfoService;
+
+    private static final String ALARM_MODULE = "纾ㄨ竟";
+    private static final String ALARM_TYPE1 = "涓�绾垮崸寮忕悊鐗囩";
+    private static final String ALARM_TYPE2 = "浜岀嚎鍗у紡鐞嗙墖绗�";
+    private static final String ALARM_CODE_NOGLASS = "noGlass";
 
     @Resource
     private WebSocketUtils webSocketUtils;
@@ -81,6 +90,20 @@
                 .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW)
                 .orderByDesc(EdgStorageDeviceTaskHistory::getCreateTime).last("limit 1"));
         jsonObject.append("taskMessage", taskHistory);
+
+        //鎺ㄩ�佹姤璀︿俊鎭�
+        if (deviceId == 1) {
+            jsonObject.append("alarmInfo", productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>()
+                    .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW)
+                    .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE)
+                    .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE1)));
+        } else {
+
+            jsonObject.append("alarmInfo", productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>()
+                    .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW)
+                    .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE)
+                    .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE2)));
+        }
         webSocketUtils.sendToWeb(webSocketName, jsonObject);
     }
 
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 22de43c..69724e6 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
@@ -6,7 +6,9 @@
 import com.mes.bigstorage.entity.BigStorageCageDetails;
 import com.mes.bigstorage.entity.dto.GlassInfoLackDTO;
 import com.mes.bigstorage.entity.dto.TemperingGlassCountDTO;
+import com.mes.bigstorage.entity.request.BigCageDetailsRequest;
 import com.mes.bigstorage.entity.vo.BigStorageQueryVO;
+import com.mes.bigstorage.entity.vo.BigCageDetailsVO;
 import com.mes.bigstorage.service.BigStorageCageDetailsService;
 import com.mes.bigstorage.service.BigStorageCageService;
 import com.mes.common.config.Const;
@@ -211,5 +213,11 @@
         return Result.build(200, "", result);
     }
 
+    @ApiOperation("锛堝垪琛級鎸夊垪琛ㄧ収鏌ヨ鏉′欢锛堣澶噄d銆佹祦绋嬪崱銆佽啘绯伙級鑾峰彇璁惧瀵瑰簲鐨勭瀛愮幓鐠冧俊鎭�")
+    @PostMapping("/queryVerticalSheetCageDetailsList")
+    public Result<List<BigCageDetailsVO>> queryVerticalSheetCageDetailsList(@RequestBody BigCageDetailsRequest request) {
+        return Result.build(200, "鏌ヨ鎴愬姛", bigStorageCageDetailsService.queryVerticalSheetCageDetailsList(request));
+    }
+
 }
 
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 0e91ac2..3ef60d6 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
@@ -4,7 +4,9 @@
 import com.mes.base.entity.vo.BigStorageVO;
 import com.mes.bigstorage.entity.BigStorageCageDetails;
 import com.mes.bigstorage.entity.dto.*;
+import com.mes.bigstorage.entity.request.BigCageDetailsRequest;
 import com.mes.bigstorage.entity.vo.BigStorageQueryVO;
+import com.mes.bigstorage.entity.vo.BigCageDetailsVO;
 import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO;
 import org.apache.ibatis.annotations.Param;
 
@@ -73,4 +75,12 @@
     BigStorageSlotDTO queryNeedDispatchSlotBySequence();
 
     List<TemperingGlassCountDTO> queryTemperingGlassCountSummary(int isTempering);
+
+    /**
+     * 锛堝垪琛級鎸夊垪琛ㄧ収鏌ヨ鏉′欢锛堣澶噄d銆佹祦绋嬪崱銆佽啘绯伙級鑾峰彇璁惧瀵瑰簲鐨勭瀛愮幓鐠冧俊鎭�
+     *
+     * @param request
+     * @return
+     */
+    List<BigCageDetailsVO> queryVerticalSheetCageDetailsList(BigCageDetailsRequest request);
 }
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 2392ac2..d72f637 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
@@ -4,7 +4,9 @@
 import com.mes.base.entity.vo.BigStorageVO;
 import com.mes.bigstorage.entity.BigStorageCageDetails;
 import com.mes.bigstorage.entity.dto.*;
+import com.mes.bigstorage.entity.request.BigCageDetailsRequest;
 import com.mes.bigstorage.entity.vo.BigStorageQueryVO;
+import com.mes.bigstorage.entity.vo.BigCageDetailsVO;
 import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO;
 import com.mes.glassinfo.entity.GlassInfo;
 import com.mes.pp.entity.OptimizeProject;
@@ -155,4 +157,6 @@
      * @return OptimizeProject 閽㈠寲鎺掍骇椤哄簭
      */
     List<OptimizeProject> queryTemperingOrder();
+
+    List<BigCageDetailsVO> queryVerticalSheetCageDetailsList(BigCageDetailsRequest request);
 }
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 b648bf9..073cc6c 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
@@ -11,7 +11,9 @@
 import com.mes.bigstorage.entity.BigStorageCage;
 import com.mes.bigstorage.entity.BigStorageCageDetails;
 import com.mes.bigstorage.entity.dto.*;
+import com.mes.bigstorage.entity.request.BigCageDetailsRequest;
 import com.mes.bigstorage.entity.vo.BigStorageQueryVO;
+import com.mes.bigstorage.entity.vo.BigCageDetailsVO;
 import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper;
 import com.mes.bigstorage.service.BigStorageCageDetailsService;
 import com.mes.bigstorage.service.BigStorageCageService;
@@ -620,4 +622,9 @@
         }
         return resultList;
     }
+
+    @Override
+    public List<BigCageDetailsVO> queryVerticalSheetCageDetailsList(BigCageDetailsRequest request) {
+        return baseMapper.queryVerticalSheetCageDetailsList(request);
+    }
 }
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
index 51e5208..55f94e6 100644
--- 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
@@ -4,6 +4,8 @@
 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.alarm.entity.ProductAlarmInfo;
+import com.mes.alarm.service.ProductAlarmInfoService;
 import com.mes.bigstorage.entity.BigStorageCage;
 import com.mes.bigstorage.entity.BigStorageCageDetails;
 import com.mes.bigstorage.entity.BigStorageGlassInfo;
@@ -48,6 +50,15 @@
     BigStorageGlassRelationInfoService bigStorageGlassRelationInfoService;
     @Resource
     SysConfigService sysConfigService;
+    @Resource
+    private ProductAlarmInfoService productAlarmInfoService;
+
+    private static final String ALARM_MODULE = "閽㈠寲";
+    private static final String ALARM_TYPE = "閽㈠寲澶х悊鐗�";
+    private static final String ALARM_CODE_SIZE = "sizeSame";
+    private static final String ALARM_CODE_ID = "idSame";
+    private static final String ALARM_CODE_SLOT = "slotLess";
+    private static final String ALARM_CODE_OVER = "overSize";
 //    @Value("${mes.slotWidth}")
 //    private Integer slotWidth;
 //    @Value("${mes.glassGap}")
@@ -118,6 +129,15 @@
             } else {
                 BigStorageCage bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
                         .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getSlot, beforeGlass.getSlot()));
+                if (bigStorageCage == null) {
+                    ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+                    alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+                    alarmInfo.setAlarmModule(ALARM_MODULE);
+                    alarmInfo.setAlarmType(ALARM_TYPE);
+                    alarmInfo.setAlarmCode(ALARM_CODE_SLOT);
+                    alarmInfo.setAlarmMessage("");
+                    productAlarmInfoService.save(alarmInfo);
+                }
                 Assert.isTrue(null != bigStorageCage, "娌℃湁绌轰綑鐨勭瀛愬瓨鏀剧幓鐠�");
                 storageCageDTO = new BigStorageDTO();
                 storageCageDTO.setWidth(bigStorageCage.getRemainWidth());
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
index 5cbe4f6..07c694b 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -104,6 +104,8 @@
     private static final String ALARM_TYPE = "閽㈠寲澶х悊鐗�";
     private static final String ALARM_CODE_SIZE = "sizeSame";
     private static final String ALARM_CODE_ID = "idSame";
+    private static final String ALARM_CODE_SLOT = "slotLess";
+    private static final String ALARM_CODE_OVER = "overSize";
 
     @Resource
     private RedisUtil redisUtil;
@@ -231,6 +233,13 @@
                         .ge(BigStorageCage::getMaxThickness, entry.getKey()));
                 if (count < entry.getValue()) {
                     log.info("绗煎唴鏍煎瓙鍓╀綑鏁伴噺涓嶈冻锛岀粨鏉熸湰娆¤繘鐗�");
+                    ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+                    alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+                    alarmInfo.setAlarmModule(ALARM_MODULE);
+                    alarmInfo.setAlarmType(ALARM_TYPE);
+                    alarmInfo.setAlarmCode(ALARM_CODE_SLOT);
+                    alarmInfo.setAlarmMessage(count + "");
+                    productAlarmInfoService.save(alarmInfo);
                     //鍚憄lc鍙戦�佹姤璀�:绗煎唴鏍煎瓙鍓╀綑鏁伴噺涓嶈冻
 //                    miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 16));
                     s7DataDLPOne = new S7DataDLPOne();
@@ -247,6 +256,13 @@
                     .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
             if (count > 0) {
                 log.info("鐩撮�氱墖鍙板瓨鍦ㄧ幓鐠冿紝缁撴潫鏈杩涚墖");
+                ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+                alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+                alarmInfo.setAlarmModule(ALARM_MODULE);
+                alarmInfo.setAlarmType(ALARM_TYPE);
+                alarmInfo.setAlarmCode(ALARM_CODE_OVER);
+                alarmInfo.setAlarmMessage("");
+                productAlarmInfoService.save(alarmInfo);
                 //鍚憄lc鍙戦�佹姤璀�:鐩撮�氱墖鍙板瓨鍦ㄧ幓鐠冿紝鏃犳硶缁х画鐩撮��
 //                miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 64));
                 s7DataDLPOne = new S7DataDLPOne();
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
index cd59ad9..b87c897 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
@@ -76,7 +76,7 @@
                              WHERE ENGINEER_ID = #{engineerId}
                                AND TEMPERING_LAYOUT_ID = #{temperingLayoutId}
                              GROUP BY ENGINEER_ID,
-                                      TEMPERING_LAYOUT_ID) T1
+                                 TEMPERING_LAYOUT_ID) T1
                             ON T.ENGINEER_ID = T1.ENGINEER_ID
                                 AND T.TEMPERING_LAYOUT_ID = T1.TEMPERING_LAYOUT_ID
                                 AND T.COUNT = T1.COUNT
@@ -89,14 +89,14 @@
                         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)
+                     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
+                     T.TEMPERING_LAYOUT_ID
              ) T2
                  INNER JOIN (SELECT ENGINEER_ID, TEMPERING_LAYOUT_ID, COUNT(TEMPERING_FEED_SEQUENCE) AS COUNT
                              FROM BIG_STORAGE_CAGE_DETAILS
@@ -212,31 +212,31 @@
 
     <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
+        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
+        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
         AND T1.DEVICE_ID IN
         <foreach collection="deviceIdList" item="item" open='(' close=')' separator=','>
             #{item}
         </foreach>
-                 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
-             )
+        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
@@ -296,35 +296,55 @@
     <select id="querybigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO">
         select bsc.device_id, bsc.slot, count(bscd.glass_id) as count
         from big_storage_cage bsc
-                 left join big_storage_cage_details bscd
-                           on bsc.slot = bscd.slot and bscd.state in (100, 102, 103, 104)
+            left join big_storage_cage_details bscd
+        on bsc.slot = bscd.slot and bscd.state in (100, 102, 103, 104)
         group by bsc.device_id, bsc.slot
         order by bsc.device_id, bsc.slot
     </select>
     <select id="queryNeedDispatch" resultType="com.mes.bigstorage.entity.BigStorageCageDetails">
-        SELECT * FROM big_storage_cage_details WHERE STATE = 100 AND SLOT = (SELECT SLOT FROM big_storage_cage_details WHERE STATE = 100 AND sequence = 1 order by slot desc LIMIT 1) ORDER BY tempering_feed_sequence
+        SELECT *
+        FROM big_storage_cage_details
+        WHERE STATE = 100
+          AND SLOT =
+              (SELECT SLOT FROM big_storage_cage_details WHERE STATE = 100 AND sequence = 1 order by slot desc LIMIT 1)
+        ORDER BY tempering_feed_sequence
     </select>
 
     <select id="queryNeedDispatchSlotBySequence" resultType="com.mes.bigstorage.entity.dto.BigStorageSlotDTO">
         with glass_temp as (
-        select t.* ,t1.virtual_slot,t1.slot_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.state = 100
-        ),slot_max_temp as (
-        select ROW_NUMBER()over(PARTITION by engineer_id, tempering_layout_id, virtual_slot order by slot_sequence desc)
-        as rn,t.* from glass_temp t where t.device_id in (5,6)
-        ) ,slot_max_message as (select * from slot_max_temp where rn =1)
-        ,slot_min_temp as (
-        select ROW_NUMBER()over(PARTITION by engineer_id, tempering_layout_id, virtual_slot order by slot_sequence) as
-        rn,t.* from glass_temp t where t.device_id in (5,6)
-        ) ,slot_min_message as (select * from slot_min_temp where rn =1)
-        ,result as (
-        select t.slot as target_slot ,t1.slot as start_slot from slot_max_message t inner join slot_min_message t1 on
-        t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and t.virtual_slot =
-        t1.virtual_slot and t.tempering_layout_id = t1.tempering_layout_id and t.tempering_feed_sequence =
-        t1.tempering_feed_sequence -1
-        )select * from result limit 1
+            select t.*, t1.virtual_slot, t1.slot_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.state = 100
+        )
+           , slot_max_temp as (
+            select ROW_NUMBER() over(PARTITION by engineer_id, tempering_layout_id, virtual_slot order by slot_sequence desc)
+        as rn,t.*
+            from glass_temp t
+            where t.device_id in (5, 6)
+        )
+           , slot_max_message as (select * from slot_max_temp where rn = 1)
+           , slot_min_temp as (
+            select ROW_NUMBER() over(PARTITION by engineer_id, tempering_layout_id, virtual_slot order by slot_sequence) as
+        rn,t.*
+            from glass_temp t
+            where t.device_id in (5, 6)
+        )
+           , slot_min_message as (select * from slot_min_temp where rn = 1)
+           , result as (
+            select t.slot as target_slot, t1.slot as start_slot
+            from slot_max_message t
+                     inner join slot_min_message t1 on
+                    t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and
+                    t.virtual_slot =
+                    t1.virtual_slot and t.tempering_layout_id = t1.tempering_layout_id and t.tempering_feed_sequence =
+                                                                                           t1.tempering_feed_sequence - 1
+        )
+        select *
+        from result limit 1
     </select>
     <select id="queryTemperingGlassCountSummary" resultMap="temperingGlassCount">
         with glass_info_temp as (
@@ -382,4 +402,30 @@
         from secondary_summary
         order by engineer_id, films_id, thickness
     </select>
+    <select id="queryVerticalSheetCageDetailsList"
+            resultType="com.mes.bigstorage.entity.vo.BigCageDetailsVO">
+        SELECT t.id,t.device_id,t.slot,t.remain_width ,t.enable_state,t1.engineer_id,
+        t1.id as detail_id,t1.device_id as detail_device_id ,t1.slot as
+        detail_slot,t1.engineer_id,t1.glass_id,t1.tempering_layout_id,t1.tempering_feed_sequence,
+        t1.flow_card_id,t1.layer,t1.width,t1.height,t1.thickness,t1.films_id
+        FROM big_storage_cage t
+        left join big_storage_cage_details t1 on t.slot = t1.slot
+        and t1.state in (100, 102, 103, 104)
+        <if test="filmsId != null and filmsId != ''">
+            and t1.films_id like CONCAT('%', #{filmsId}, '%')
+        </if>
+        <if test="flowCardId != null and flowCardId != ''">
+            and t1.flow_card_id like CONCAT('%', #{flowCardId}, '%')
+        </if>
+        <if test="engineerId != null and engineerId != ''">
+            and t1.engineer_id like CONCAT('%', #{engineerId}, '%')
+        </if>
+        <if test="glassId != null and glassId != ''">
+            and t1.glass_id like CONCAT('%', #{glassId}, '%')
+        </if>
+        <if test="thickness != -1">
+            and t1.thickness = #{thickness}
+        </if>
+        order by t.slot
+    </select>
 </mapper>
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
index baa53ca..39a87d4 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
@@ -17,6 +17,7 @@
 import com.mes.glassinfo.service.GlassInfoService;
 import com.mes.tools.DateUtil;
 import com.mes.tools.WebSocketServer;
+import com.mes.tools.WebSocketUtils;
 import com.mes.utils.RedisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
@@ -25,6 +26,7 @@
 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;
@@ -47,6 +49,8 @@
     private DownGlassTaskService downGlassTaskService;
     @Autowired
     private GlassInfoService glassInfoService;
+    @Resource
+    private WebSocketUtils webSocketUtils;
 
     @Value("${mes.scan.ip}")
     private String scanIp;
@@ -65,15 +69,8 @@
         List<DownWorkstation> data = downWorkstationService.list();
         jsonObject.append("params", data);
         log.info(jsonObject.toString());
-        ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
-        if (sendwServer != null) {
-            for (WebSocketServer webserver : sendwServer) {
-                if (webserver != null && webserver.session.isOpen()) {
-                    log.info("宸插彂閫�");
-                    webserver.sendMessage(jsonObject.toString());
-                }
-            }
-        }
+        webSocketUtils.sendToWeb("unloadglass", jsonObject);
+
     }
 
     @Scheduled(fixedDelay = 1000)
@@ -83,14 +80,7 @@
         List<Map<String, Object>> glassinfodata = downWorkstationService.getTotalGlassDimensionsByWorkstation(1, 3);
         jsonObject2.append("glassinfo", glassinfodata);
         log.info(jsonObject2.toString());
-        ArrayList<WebSocketServer> sendwServer2 = WebSocketServer.sessionMap.get("unloadglass2");
-        if (sendwServer2 != null) {
-            for (WebSocketServer webserver : sendwServer2) {
-                if (webserver != null && webserver.session.isOpen()) {
-                    webserver.sendMessage(jsonObject2.toString());
-                }
-            }
-        }
+        webSocketUtils.sendToWeb("unloadglass2", jsonObject2);
     }
 
     @Scheduled(fixedDelay = 1000)
@@ -100,14 +90,7 @@
         List<Map<String, Object>> glassinfodata2 = downWorkstationService.getTotalGlassDimensionsByWorkstation(4, 6);
         jsonObject3.append("glassinfo2", glassinfodata2);
         log.info(jsonObject3.toString());
-        ArrayList<WebSocketServer> sendwServer3 = WebSocketServer.sessionMap.get("unloadglass3");
-        if (sendwServer3 != null) {
-            for (WebSocketServer webserver : sendwServer3) {
-                if (webserver != null && webserver.session.isOpen()) {
-                    webserver.sendMessage(jsonObject3.toString());
-                }
-            }
-        }
+        webSocketUtils.sendToWeb("unloadglass3", jsonObject3);
     }
 
     @Scheduled(fixedDelay = 2000)
@@ -117,14 +100,7 @@
         List<Map<String, Object>> list = downStorageCageService.selectDownStorageCages();
         jsonObject4.append("params2", list);
         log.info(jsonObject4.toString());
-        ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("downcache");
-        if (sendwServer4 != null) {
-            for (WebSocketServer webserver : sendwServer4) {
-                if (webserver != null && webserver.session.isOpen()) {
-                    webserver.sendMessage(jsonObject4.toString());
-                }
-            }
-        }
+        webSocketUtils.sendToWeb("downcache", jsonObject4);
     }
 
     @Scheduled(fixedDelay = 2000)
@@ -170,18 +146,11 @@
                         .lt("task_status", Const.UNLOAD_GLASS_DOWN)
                         .orderByAsc("id")
         );
-        if(takeGlass!=null){
+        if (takeGlass != null) {
             jsonObject4.append("takeGlass", takeGlass);
         }
 
-        ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("unloadglass");
-        if (sendwServer4 != null) {
-            for (WebSocketServer webserver : sendwServer4) {
-                if (webserver != null && webserver.session.isOpen()) {
-                    webserver.sendMessage(jsonObject4.toString());
-                }
-            }
-        }
+        webSocketUtils.sendToWeb("unloadglass", jsonObject4);
     }
 
     @Scheduled(fixedDelay = 1000)
@@ -192,16 +161,8 @@
         jsonObject.append("downWorkstation", downWorkstation);
         List<DownGlassTask> downGlassTask = downGlassTaskService.selectOutTaskCache();
         jsonObject.append("downGlassTask", downGlassTask);
-        ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unLoadGlassIsRun");
-        if (sendwServer != null) {
-            for (WebSocketServer webserver : sendwServer) {
-                if (webserver != null) {
-                    webserver.sendMessage(jsonObject.toString());
-                } else {
-                    log.info("unLoadGlassIsRun is closed");
-                }
-            }
-        }
+
+        webSocketUtils.sendToWeb("unLoadGlassIsRun", jsonObject);
     }
 
     @Scheduled(fixedDelay = Long.MAX_VALUE)
@@ -215,20 +176,14 @@
                 log.info("绛夊緟鎵爜涓�......");
                 String glassId = in.readLine();
                 log.info("鎵弿鍒扮殑鐜荤拑id锛歿}", glassId);
-                List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
-                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());
-                        }
-                    }
+                //鎸夌収鐜荤拑id鑾峰彇鐜荤拑淇℃伅杩斿洖缁欏墠绔晫闈紝鍏蜂綋闇�瑕佸摢浜涙暟鎹緟纭
+                GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
+                        .eq(GlassInfo::getGlassId, glassId).last("limit 1"));
+                if (null == glassInfo) {
+                    log.info("鎸夌収鐜荤拑id锛歿}锛屾棤娉曟壘鍒扮幓鐠冧俊鎭�", glassId);
+                    return;
                 }
+                webSocketUtils.sendToWeb("scanGlass", glassInfo);
             } catch (Exception exception) {
                 log.info("璇诲彇寮傚父锛屽師鍥犱负{}", exception.getMessage());
             }
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageDetailsController.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageDetailsController.java
index e52515e..4ffe9d2 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageDetailsController.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageDetailsController.java
@@ -3,6 +3,8 @@
 
 import com.mes.hollow.entity.HollowBigStorageCageDetails;
 import com.mes.hollow.entity.dto.HollowBigStorageAndDetailsDTO;
+import com.mes.hollow.entity.request.HollowBigCageDetailsRequest;
+import com.mes.hollow.entity.vo.HollowBigCageDetailsVO;
 import com.mes.hollow.service.HollowBigStorageCageDetailsService;
 import com.mes.utils.Result;
 import io.swagger.annotations.Api;
@@ -54,5 +56,10 @@
         return Result.build(200, "鍚敤/绂佺敤鎴愬姛", 1);
     }
 
+    @ApiOperation("锛堝垪琛級鎸夊垪琛ㄧ収鏌ヨ鏉′欢锛堣澶噄d銆佹祦绋嬪崱銆佽啘绯伙級鑾峰彇璁惧瀵瑰簲鐨勭瀛愮幓鐠冧俊鎭�")
+    @PostMapping("/queryVerticalSheetCageDetailsList")
+    public Result<List<HollowBigCageDetailsVO>> queryVerticalSheetCageDetailsList(@RequestBody HollowBigCageDetailsRequest request) {
+        return Result.build(200, "鏌ヨ鎴愬姛", hollowBigStorageCageDetailsService.queryVerticalSheetCageDetailsList(request));
+    }
 }
 
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
index 360e8cb..a4e4668 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
@@ -7,6 +7,8 @@
 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.entity.request.HollowBigCageDetailsRequest;
+import com.mes.hollow.entity.vo.HollowBigCageDetailsVO;
 import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
 import org.apache.ibatis.annotations.Param;
 
@@ -47,5 +49,7 @@
      * @return
      */
     List<FlowCardGlassInfoDTO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query);
+
+    List<HollowBigCageDetailsVO> queryVerticalSheetCageDetailsList(HollowBigCageDetailsRequest request);
 }
 
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
index 8ad47a8..7b748bf 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
@@ -4,7 +4,9 @@
 import com.mes.base.entity.vo.BigStorageVO;
 import com.mes.hollow.entity.HollowBigStorageCageDetails;
 import com.mes.hollow.entity.dto.*;
+import com.mes.hollow.entity.request.HollowBigCageDetailsRequest;
 import com.mes.hollow.entity.vo.HollowAllFlowCardVO;
+import com.mes.hollow.entity.vo.HollowBigCageDetailsVO;
 import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
 
 import java.util.List;
@@ -70,5 +72,7 @@
     List<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer();
 
     List<FlowCardGlassInfoDTO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query);
+
+    List<HollowBigCageDetailsVO> queryVerticalSheetCageDetailsList(HollowBigCageDetailsRequest request);
 }
 
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
index 589997e..d4389e8 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
@@ -11,6 +11,8 @@
 import com.mes.hollow.entity.HollowBigStorageCageDetails;
 import com.mes.hollow.entity.HollowGlassRelationInfo;
 import com.mes.hollow.entity.dto.*;
+import com.mes.hollow.entity.request.HollowBigCageDetailsRequest;
+import com.mes.hollow.entity.vo.HollowBigCageDetailsVO;
 import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
 import com.mes.hollow.mapper.HollowBigStorageCageDetailsMapper;
 import com.mes.hollow.service.HollowBigStorageCageDetailsService;
@@ -150,6 +152,11 @@
         return baseMapper.queryHollowAllFlowCard(query);
     }
 
+    @Override
+    public List<HollowBigCageDetailsVO> queryVerticalSheetCageDetailsList(HollowBigCageDetailsRequest request) {
+        return baseMapper.queryVerticalSheetCageDetailsList(request);
+    }
+
     private List<HollowBigStorageAndDetailsDTO> hollowBigStorageCageDetailsChild(String glassId, Integer deviceId, Integer slot, int state) {
         //灏嗗搴旀牸瀛愬彿鐨勭幓鐠僫d缃负101
         this.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>()
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
index 4ec3629..7a890c0 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
@@ -117,6 +117,8 @@
     private static final String ALARM_TYPE = "涓┖澶х悊鐗�";
     private static final String ALARM_CODE_SIZE = "sizeSame";
     private static final String ALARM_CODE_ID = "idSame";
+    private static final String ALARM_CODE_SLOT = "slotLess";
+    private static final String ALARM_CODE_OVER = "overSize";
 
     /**
      * 鐩撮�氭牸瀛�
@@ -245,6 +247,13 @@
                     .ge(HollowBigStorageCage::getMaxThickness, entry.getKey()));
             if (count < entry.getValue()) {
                 log.info("绗煎唴鏍煎瓙鍓╀綑鏁伴噺涓嶈冻锛岀粨鏉熸湰娆¤繘鐗�");
+                ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+                alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+                alarmInfo.setAlarmModule(ALARM_MODULE);
+                alarmInfo.setAlarmType(ALARM_TYPE);
+                alarmInfo.setAlarmCode(ALARM_CODE_SLOT);
+                alarmInfo.setAlarmMessage(count + "");
+                productAlarmInfoService.save(alarmInfo);
                 //鍚憄lc鍙戦�佹姤璀�:绗煎唴鏍煎瓙鍓╀綑鏁伴噺涓嶈冻
                 s7DataZKDLPOne = new S7DataZKDLPOne();
                 s7DataZKDLPOne.setAlramSignal(16);
@@ -525,7 +534,7 @@
                     });
                 }
 
-                List<HollowGlassQueueInfo> infoList = unFinishHollowQueueList.stream().filter(e -> !(e.getSlot() > 500 && e.getSlot() < 900 && e.getIsPair() != 1)).collect(Collectors.toList());
+                List<HollowGlassQueueInfo> infoList = unFinishHollowQueueList.stream().filter(e -> !(e.getSlot() >= 500 && e.getSlot() < 900 && e.getIsPair() != 1)).collect(Collectors.toList());
                 log.info("鏈夋鍦ㄥ嚭鐗囩殑涓┖浠诲姟");
                 Integer isPair = infoList.get(0).getIsPair();
                 hollowOutGlassByIsPair(infoList, hollowGlassOutRelationInfo.getCell(), isPair, hollowGlassOutRelationInfo.getTotalLayer(), hollowGlassOutRelationInfo.getIsForce());
@@ -908,7 +917,11 @@
             log.info("褰撳墠鏈敹鍒拌繘鐗囪姹傦紝缁撴潫杩涚墖浠诲姟");
             return;
         }
-        if (StringUtils.isNotBlank(s7DataZKDLPOne.getId1())){
+        if (StringUtils.isNotBlank(s7DataZKDLPOne.getId1())) {
+            log.info("褰撳墠瀛樺湪杩涚墖浠诲姟锛岀粨鏉�");
+            return;
+        }
+        if (StringUtils.isNotBlank(s7DataZKDLPOne.getId1())) {
             log.info("褰撳墠瀛樺湪杩涚墖浠诲姟璇锋眰锛岀粨鏉熸湰娆″ぇ绗煎瓙璋冨害");
             return;
         }
@@ -924,15 +937,19 @@
         if (count > 0) {
             return;
         }
-        List<HollowBigStorageCageDetails> list = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
-                .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
-//                .in(HollowBigStorageCageDetails::getDeviceId, 6)
-                .in(HollowBigStorageCageDetails::getGlassId, glassIdList));
-        log.info("鑾峰彇璋冨害浠诲姟鍒楄〃锛歿}", list);
-        if (CollectionUtil.isEmpty(list)) {
+        HollowBigStorageCageDetails details = null;
+        for (String glassId : glassIdList) {
+            details = hollowBigStorageCageDetailsService.getOne(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
+                    .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
+                    .eq(HollowBigStorageCageDetails::getGlassId, glassId).last("limit 1"));
+            log.info("鑾峰彇璋冨害浠诲姟锛歿}", details);
+            if (details != null) {
+                break;
+            }
+        }
+        if (details == null) {
             return;
         }
-        HollowBigStorageCageDetails details = list.get(0);
         log.info("鑾峰彇闇�瑕佽皟搴︾殑鍗曟潯浠诲姟锛歿}", details);
         //鐢熸垚杩涜繘鐗囧ぇ杞︿换鍔�
         hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>()
@@ -1084,6 +1101,13 @@
                     S7DataZKDLPOne s7DataZKDLPOne = new S7DataZKDLPOne();
                     s7DataZKDLPOne.setAlramSignal(16);
                     s7SerializerZKDLPOne.write(s7DataZKDLPOne);
+                    ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+                    alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+                    alarmInfo.setAlarmModule(ALARM_MODULE);
+                    alarmInfo.setAlarmType(ALARM_TYPE);
+                    alarmInfo.setAlarmCode(ALARM_CODE_SLOT);
+                    alarmInfo.setAlarmMessage("");
+                    productAlarmInfoService.save(alarmInfo);
                     Assert.isFalse(storageCage == null, "浠诲姟璋冨害娌℃湁澶氫綑鏍煎瓙锛岀粨鏉熻皟搴︿换鍔�");
                 }
 
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
index d6b7a5d..ab2c8e4 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -207,8 +207,8 @@
     <select id="queryHollowbigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO">
         select hbsc.device_id, hbsc.slot, count(hbscd.glass_id) as count
         from hollow_big_storage_cage hbsc
-                 left join hollow_big_storage_cage_details hbscd
-                           on hbsc.slot = hbscd.slot and hbscd.state in (100, 102, 103, 104)
+            left join hollow_big_storage_cage_details hbscd
+        on hbsc.slot = hbscd.slot and hbscd.state in (100, 102, 103, 104)
         group by hbsc.device_id, hbsc.slot
         order by hbsc.device_id, hbsc.slot
     </select>
@@ -269,7 +269,7 @@
             AND films_id LIKE CONCAT( '%', #{filmsId}, '%')
         </if>
         <if test="thickness != 0">
-          AND thickness = #{thickness}
+            AND thickness = #{thickness}
         </if>
         ),
         hollow_details_temp AS (
@@ -293,7 +293,7 @@
             AND films_id LIKE CONCAT( '%', #{filmsId}, '%')
         </if>
         <if test="thickness != 0">
-          AND thickness = #{thickness}
+            AND thickness = #{thickness}
         </if>
         ),
         hollow_through_temp AS ( SELECT flow_card_id, MIN( hollow_sequence ) AS hollow_sequence, MAX( total_layer ) AS
@@ -416,6 +416,32 @@
         ORDER BY
         t.flow_card_id
     </select>
+    <select id="queryVerticalSheetCageDetailsList"
+            resultType="com.mes.hollow.entity.vo.HollowBigCageDetailsVO">
+        SELECT t.id,t.device_id,t.slot,t.remain_width ,t.enable_state,t1.virtual_slot,total_layer,t1.engineer_id,
+        t1.id as detail_id,t1.device_id as detail_device_id ,t1.slot as
+        detail_slot,t1.engineer_id,t1.glass_id,t1.tempering_layout_id,t1.tempering_feed_sequence,
+        t1.flow_card_id,t1.layer,t1.width,t1.height,t1.thickness,t1.films_id
+        FROM hollow_big_storage_cage t
+        left join hollow_big_storage_cage_details t1 on t.slot = t1.slot
+        and t1.state in (100, 102, 103, 104)
+        <if test="filmsId != null and filmsId != ''">
+            and t1.films_id like CONCAT('%', #{filmsId}, '%')
+        </if>
+        <if test="flowCardId != null and flowCardId != ''">
+            and t1.flow_card_id like CONCAT('%', #{flowCardId}, '%')
+        </if>
+        <if test="engineerId != null and engineerId != ''">
+            and t1.engineer_id like CONCAT('%', #{engineerId}, '%')
+        </if>
+        <if test="glassId != null and glassId != ''">
+            and t1.glass_id like CONCAT('%', #{glassId}, '%')
+        </if>
+        <if test="thickness != -1">
+            and t1.thickness = #{thickness}
+        </if>
+        order by t.slot
+    </select>
 
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0