From f68d3c71819feb59e7a227a5d992b059b900916c Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期五, 28 三月 2025 08:28:26 +0800
Subject: [PATCH] 修改报表,界面添加查询流程卡个数,调整推送数据到前端的间隔

---
 hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java |   58 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
index 54db40d..c6288dd 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
@@ -94,6 +94,15 @@
         String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress();
         String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue();
 
+//        requestWord="3";
+//        glassIdeValue="P25031802|4|1";
+//        out06Glassstate="1";
+//        out08Glassstate="1";
+//        out11Glassstate ="1";
+//        out13Glassstate="1";
+//        currentSlot="1";
+//        confirmationWrodValue="0";
+
 
         log.info("1銆佽幏鍙栧埌鐨勮姹傚瓧涓猴細{}锛岃幏鍙栧埌鐨勬壂鎻廔D涓猴細{}锛岃幏鍙栧埌鐨勭‘璁ゅ瓧涓猴細{}锛岃幏鍙栧埌鐨勫嚭鐗囩姸鎬佸垎鍒负锛歡06:{}銆乬08:{}銆乬11:{}銆乬13:{},褰撳墠鏍煎瓙鍙蜂负锛歿}",
                 requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot);
@@ -135,7 +144,7 @@
         PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject;
         if (CollectionUtils.isNotEmpty(list)) {
             s7control.writeWord(plcMesObject.getPlcParameter("alarm_signal").getAddress(), 1);
-        }else{
+        } else {
             s7control.writeWord(plcMesObject.getPlcParameter("alarm_signal").getAddress(), 0);
         }
     }
@@ -156,7 +165,7 @@
             //涓嬬墖鏁伴噺-1
             for (DownGlassTask downGlassTask : downGlassTaskList
             ) {
-                if (Const.GLASS_CACHE_TYPE_OUT_ALL.equals(downGlassTask.getTaskType())) {
+                if (Const.GLASS_CACHE_TYPE_OUT_ALL.contains(downGlassTask.getTaskType())) {
                     downWorkstationService.update(
                             new LambdaUpdateWrapper<DownWorkstation>()
                                     .setSql("racks_number = racks_number-1")
@@ -171,7 +180,7 @@
                 damage.setLine(Const.TEMPERING_OUT_TARGET_POSITION);
                 damage.setWorkingProcedure("涓嬬墖");
                 damage.setRemark("涓嬬墖");
-                damage.setStatus(0);
+                damage.setStatus(1);
                 damage.setType(e.getTaskStatus());
                 return damage;
             }).collect(Collectors.toList());
@@ -197,7 +206,10 @@
             //鏇存柊宸ヤ綅鍏朵粬鐜荤拑淇℃伅鐨勬暟閲�
             QueryWrapper<Damage> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("process_id", downWorkstation.getFlowCardId());
-            queryWrapper.eq("technology_number", downWorkstation.getLayer());
+            queryWrapper.gt("type", 3);
+            if (downWorkstation.getLayer() != 0) {
+                queryWrapper.eq("technology_number", downWorkstation.getLayer());
+            }
             int otherNumber = damageService.count(queryWrapper);
             downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getOtherNumber, otherNumber)
                     .eq(DownWorkstation::getWorkstationId, downWorkstation.getWorkstationId()));
@@ -224,6 +236,7 @@
         //鐜荤拑灏哄鏄惁璧颁汉宸ヤ笅鐗�
         if (glassWidth > maxWidth || glassHeight > maxHeight || glassWidth < minWidth || glassHeight < minHeight) {
             log.info("璇ョ幓鐠冨昂瀵镐笉绗﹀悎瑕佹眰锛岄渶瑕佽蛋浜哄伐涓嬬墖鐩存帴杩涚墖");
+            return;
         } else {
             log.info("璇ョ幓鐠冨昂瀵搁潪浜哄伐涓嬬墖");
             //鑾峰彇璇ョ幓鐠冪殑娴佺▼鍗℃槸鍚﹀凡缁戝畾鏋跺瓙
@@ -272,7 +285,8 @@
                     for (DownGlassInfoDTO e : downGlassInfoDTOList) {
                         List<GlassInfo> glassInfoList = e.getGlassInfoList();
                         List<GlassInfo> glassInfoTempList = glassInfoList.stream().filter(item -> item.getWidth() == glassInfo.getWidth() && item.getHeight() == glassInfo.getHeight()
-                                && item.getThickness() == glassInfo.getThickness() && item.getFilmsid().equals(glassInfo.getFilmsid())).collect(Collectors.toList());
+                                && item.getThickness() == glassInfo.getThickness() && item.getMarkIcon().equals(glassInfo.getMarkIcon())
+                                && item.getFilmsid().equals(glassInfo.getFilmsid())).collect(Collectors.toList());
                         if (CollectionUtils.isNotEmpty(glassInfoTempList)) {
                             for (GlassInfo item : glassInfoTempList) {
                                 //鐜荤拑鏄惁涓哄灞傦細1銆佸厛鑾峰彇褰撳墠娴佺▼鍗¤惤鏋舵渶澶氱殑灞傛暟锛屽鏋滀负绌猴紝琛ㄦ槑鏈粦瀹氭祦绋嬪崱锛屾湭钀芥灦锛岀劧鍚庢寜鐓ф槸鍚﹀彲缁戝畾鏋跺瓙鍐冲畾鏄惁鏇挎崲銆傦紙鍙拷鐣ヤ笉璁★紝鏈牎楠屼粎鍦ㄥ墠涓�娆¤皟鐢ㄨ捣浣滅敤锛�
@@ -673,22 +687,28 @@
             wrapper.eq(DownGlassInfo::getLayer, downGlassInfo.getLayer());
         }
 //        downGlassInfo.setSequence(downGlassInfoService.queryMaxSequence(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()));
-        int k = 0;
-        DownGlassInfo downGlassInfo1 = downGlassInfoService.getOne(wrapper);
-        if (downGlassInfo1 != null) {
-            k = 1;
-        } else {
-            k = 1;
-        }
+        int k = 1;
+//        DownGlassInfo downGlassInfo1 = downGlassInfoService.getOne(wrapper);
+//        if (downGlassInfo1 != null) {
+//            k = 1;
+//        } else {
+//            k = 1;
+//        }
+        GlassInfo glassInfo = new GlassInfo();
+        BeanUtils.copyProperties(downStorageCageDetails, glassInfo);
+        GlassInfo glassInfo1 = glassInfoService.getOne(
+                new LambdaUpdateWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassInfo.getGlassId())
+        );
         downGlassInfo.setSequence(k);
         downGlassInfo.setWorkStationId(endCell);
         downGlassInfo.setGmtCreate(new Date());
+        downGlassInfo.setLayer(glassInfo1.getLayer());
         downGlassInfoService.save(downGlassInfo);
         //鐢熸垚浠诲姟淇℃伅
-        GlassInfo glassInfo = new GlassInfo();
-        downStorageCageDetails.setLayer(0);
-        BeanUtils.copyProperties(downStorageCageDetails, glassInfo);
+
+
         //鍒犻櫎鐞嗙墖绗艰〃鎷胯蛋/鐮存崯鏁版嵁鏁版嵁
+        glassInfo.setLayer(glassInfo1.getLayer());
         damageService.deleteByGlassId(glassInfo.getGlassId());
         return initDownGlassTask(glassInfo, downStorageCageDetails.getSlot(), endCell, taskType);
     }
@@ -707,6 +727,14 @@
         downGlassTask.setTaskStatus(0);
         downGlassTask.setCreateTime(new Date());
         downGlassTaskService.save(downGlassTask);
+        //娣诲姞鎶ュ伐鏁版嵁
+        Damage damage = new Damage();
+        damage.setGlassId(glassInfo.getGlassId());
+        damage.setWorkingProcedure("閽㈠寲");
+        damage.setLine(4001);
+        damage.setType(1);
+        damage.setRemark("閽㈠寲鍚庡崸寮忕悊鐗�");
+        damageService.insertDamage(damage);
         //鍚憄lc鍙戦�佸懡浠�
         return sendMessageToPlc((int) glassInfo.getWidth(), (int) glassInfo.getHeight(), (int) glassInfo.getThickness(),
                 startCell, endCell, taskType);

--
Gitblit v1.8.0