From 7664b90f93c4862785b8c3c18ad26a0cf0eeec33 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 06 八月 2024 09:52:17 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/HangZhouMes

---
 UI-Project/config.js                                                                           |    7 +
 UI-Project/src/views/Slicecage/slicecage.vue                                                   |   51 ++++++++++++-----
 UI-Project/src/views/Identify/identify.vue                                                     |   63 +++++++++++++++++++-
 hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java |   25 +++++--
 UI-Project/src/utils/constants.js                                                              |    3 
 5 files changed, 119 insertions(+), 30 deletions(-)

diff --git a/UI-Project/config.js b/UI-Project/config.js
index b15a1a5..8801d0c 100644
--- a/UI-Project/config.js
+++ b/UI-Project/config.js
@@ -1,7 +1,10 @@
 export default {
- serverUrl: "10.153.19.150:88/api",
+//  serverUrl: "10.153.19.150:88/api",
 //  serverUrl: "192.168.1.199:88/api",
-  serverUrl2: "10.153.19.150:88"
+ serverUrl: "127.0.0.1:88/api",
+  // serverUrl2: "10.153.19.150:88"
   // serverUrl2: "192.168.1.199:88"
+    serverUrl2: "127.0.0.1:88"
+
   //serverUrl:"res.abeim.cn"
 }
\ No newline at end of file
diff --git a/UI-Project/src/utils/constants.js b/UI-Project/src/utils/constants.js
index 67d36d2..7e57f58 100644
--- a/UI-Project/src/utils/constants.js
+++ b/UI-Project/src/utils/constants.js
@@ -1,3 +1,4 @@
 // export const WebSocketHost = "192.168.1.199";
-export const WebSocketHost = "10.153.19.150";
+// export const WebSocketHost = "10.153.19.150";
+export const WebSocketHost = "127.0.0.1";
 export const host = "88";
\ No newline at end of file
diff --git a/UI-Project/src/views/Identify/identify.vue b/UI-Project/src/views/Identify/identify.vue
index e7be5c2..59982e5 100644
--- a/UI-Project/src/views/Identify/identify.vue
+++ b/UI-Project/src/views/Identify/identify.vue
@@ -1,6 +1,20 @@
-<template>  
+<template>
+  <div style="display: flex;">
+<el-input v-model="inputValue" style="margin-left: 15px;margin-top: 10px;width: 240px" placeholder="璇疯緭鍏ュ伐绋嬪彿" @blur="handleBlur"/>
+<el-pagination
+      v-model:current-page="currentPage3"
+      v-model:page-size="pageSize3"
+      :size="size"
+      :disabled="disabled"
+      :background="background"
+      layout="prev, pager, next, jumper"
+      :total="1000"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+    />
+    </div>
     <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading">
-      <el-scrollbar height="600px" >
+      <el-scrollbar height="550px" >
   <div id="app" style="margin-top: 20px;">  
     <!-- <div  
       :style="{ width: `${olWidth}px`, height: `${olHeight}px`,position: 'relative',}"
@@ -41,7 +55,7 @@
 <script setup lang="ts">  
 import { Delete, Upload } from '@element-plus/icons-vue'
 import { ElMessage, ElMessageBox } from 'element-plus'
-import { ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue';  
+import { ref, onMounted, onBeforeUnmount,onUnmounted,watchEffect } from 'vue';  
 import request from "@/utils/request"
 import { WebSocketHost ,host} from '@/utils/constants'
 import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
@@ -53,7 +67,7 @@
 const olHeight = ref();
 const process_id = ref(); // 鐢ㄤ簬瀛樺偍process_id鐨勫搷搴斿紡寮曠敤 
 const glass_id = ref();
-// const rects = ref([]); // 鐢ㄤ簬瀛樺偍鐭╁舰鏁版嵁鐨勫搷搴斿紡寮曠敤  
+const inputValue = ref('');
 const currentGlassId = ref(null); // 瀛樺偍褰撳墠鐐瑰嚮鐭╁舰鐨� glass_id  
 const adjustedRects = ref([]);
 // const handleBind = (row) => {
@@ -155,6 +169,42 @@
     console.error(error);
   }
 }
+const handleBlur = async () => {  
+  if (inputValue.value !== '') {  
+    try {  
+      var url="/cacheGlass/taskCache/cutTerritory?current="+inputValue.value;
+      const response = await request.post(url)
+      if (response.data && response.data.currentCutTerritory) {  
+        // 鍋囪杩斿洖鐨勬暟鎹渶瑕佽皟鏁村潗鏍囧拰灏哄  
+        adjustedRects.value = response.data.currentCutTerritory.map(rect => ({  
+          ...rect,  
+          x_axis: 1360 - (rect.x_axis + rect.width) * 0.37,  
+          y_axis: (rect.y_axis * 100) * 0.003,  
+          width: (rect.width * 100) * 0.002,  
+          height: (rect.height * 100) * 0.002,  
+          widtha: rect.width ,
+          heighta: rect.height ,
+          glass_state: rect.glass_state  
+        }));
+      }  
+    } catch (error) {  
+      console.error('璇锋眰鏁版嵁澶辫触:', error);  
+    }  
+  }  
+};  
+// const handleBlur = async () => {  
+//   if (inputValue.value !=''){
+//     try {  
+//       var url="/cacheGlass/taskCache/cutTerritory?current="+inputValue.value;
+//       const response = await request.post(url)
+//       console.log(response.data.length);  
+//     if (response.code == 200) {
+//       adjustedRects.value = response.data
+//       ElMessage.success(response.message);
+//     } else {
+//       ElMessage.error(response.msg);
+//     }
+// }
 function getRectColor(state: number): string {  
   switch (state) {  
     case 0:  
@@ -205,6 +255,11 @@
     closeWebSocket(socket);
     }
     });
+  watchEffect(() => {  
+  if (inputValue.value === '') {  
+    handleMessage();  
+  }  
+}); 
 onBeforeUnmount(() => {
   console.log("鍏抽棴浜�")
   closeWebSocket();
diff --git a/UI-Project/src/views/Slicecage/slicecage.vue b/UI-Project/src/views/Slicecage/slicecage.vue
index 4ed89ea..9837905 100644
--- a/UI-Project/src/views/Slicecage/slicecage.vue
+++ b/UI-Project/src/views/Slicecage/slicecage.vue
@@ -76,19 +76,7 @@
 const cell8=ref(true);
 const cell9=ref(true);
 const selectedRow = ref(null); // 瀛樺偍閫変腑鐨勮鏁版嵁  
- 
-onMounted(async () => {  
-  try {  
-    const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass');
-    if (response.code === 200) {  
-      tableDatagh.value = response.data
-    } else {  
-      ElMessage.warning(response.msg)
-    }  
-  } catch (error) {  
-    // console.error('Error fetching rects :', error);  
-  }  
-}); 
+
     // 褰撳墠椤电爜鍜屾瘡椤垫樉绀虹殑鏉℃暟
     const currentPage = ref(1);
     const itemsPerPage = computed(() => {
@@ -513,6 +501,40 @@
   dialoglea.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗�
   fetchFlowCardId(); 
 };
+const handleganghua = () => {
+  dialogFormVisiblec.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗�
+  fetchFlow(); 
+};
+// 閽㈠寲鏌ヨ
+ 
+onMounted(async () => {  
+  try {  
+    const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass');
+    if (response.code === 200) {  
+      tableDatagh.value = response.data
+    } else {  
+      ElMessage.warning(response.msg)
+    }  
+  } catch (error) {  
+    // console.error('Error fetching rects :', error);  
+  }  
+}); 
+const fetchFlow = async () => {
+  try  {
+    const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass')
+    if (response.code == 200) {
+      ElMessage.success(response.message);
+      tableDatagh.value = response.data
+    } else {
+      ElMessage.error(response.message);
+    }
+}
+catch (error) {
+    // 澶勭悊閿欒
+    console.error(error);
+  }
+}
+// 鍊肩彮淇℃伅
 const fetchFlowCardId = async () => {
   try  {
     const response = await request.post('/cacheVerticalGlass/work_assignment/selectWorkAssignment',{
@@ -523,7 +545,6 @@
       ElMessage.success(response.message);
       tableDatax.value = response.data;
       console.log(tableDatax.value);
-      console
     } else {
       ElMessage.error(response.message);
     }
@@ -742,7 +763,7 @@
   <div style="height: 600px;">
     <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">{{ $t('searchOrder.cageinformation') }}</el-button>
     <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button>
-    <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="warning" @click="dialogFormVisiblec = true">{{ $t('searchOrder.temperingqueries') }}</el-button>
+    <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="warning" @click="handleganghua">{{ $t('searchOrder.temperingqueries') }}</el-button>
     <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button>
     <el-switch style="margin-top: 5px;margin-left: 10px;" v-model="ganghua" class="mb-2" :inactive-text="$t('searchOrder.temperedswitch')" @change="handleChange" />
     <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading">
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 0dd3ec0..4103025 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
@@ -87,7 +87,7 @@
     @Value("${mes.min.two.secondLength}")
     private String minTwoSecondLength;
 
-    public static String engineerId="";
+    public static String engineerId = "";
 
     @Scheduled(fixedDelay = 1000)
     public void plcHomeEdgTask() {
@@ -140,11 +140,12 @@
         Date endDate = new Date();
         log.info("鏈浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms", endDate, endDate.getTime() - startDate.getTime());
     }
+
     @Scheduled(fixedDelay = 1000)
-    public void temperingIsRun(){
+    public void temperingIsRun() {
         JSONObject jsonObject = new JSONObject();
         //姝e湪杩涜鐨勪换鍔�
-        List<TaskCache>taskCaches=taskCacheService.selectTaskCacheIsRun();
+        List<TaskCache> taskCaches = taskCacheService.selectTaskCacheIsRun();
         jsonObject.append("taskCaches", taskCaches);
         ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun");
         if (sendwServer != null) {
@@ -157,6 +158,7 @@
             }
         }
     }
+
     /**
      * 杩涚墖浠诲姟
      *
@@ -173,20 +175,23 @@
 
         //鏌ヨ鐜荤拑骞惰繘琛屼氦鎹�
         GlassInfo glassInfo = queryAndChangeGlass(glassId);
-        log.info("3銆佸皢鐜荤拑淇℃伅鎻掑叆鍗у紡鐞嗙墖绗�,褰撳墠鐜荤拑淇℃伅:{}", glassInfo);
+        if (glassInfo == null) {
+            return;
+        }
+        log.info("4銆佸皢鐜荤拑淇℃伅鎻掑叆鍗у紡鐞嗙墖绗�,褰撳墠鐜荤拑淇℃伅:{}", glassInfo);
         EdgStorageCageDetails details = new EdgStorageCageDetails();
         BeanUtils.copyProperties(glassInfo, details);
         details.setState(Const.GLASS_STATE_IN);
         details.setSlot(nearestEmpty.getSlot());
         details.setDeviceId(nearestEmpty.getDeviceId());
         edgStorageCageDetailsService.save(details);
-        log.info("4銆佺幓鐠冧俊鎭凡瀛樺叆鐞嗙墖绗艰鎯呰〃锛岀幓鐠冧俊鎭负{}", details);
+        log.info("5銆佺幓鐠冧俊鎭凡瀛樺叆鐞嗙墖绗艰鎯呰〃锛岀幓鐠冧俊鎭负{}", details);
         //娣诲姞杩涚墖浠诲姟
         boolean taskCache = saveTaskCache(details.getGlassId(), 0, nearestEmpty.getSlot(), Const.GLASS_CACHE_TYPE_IN);
-        log.info("5銆佺敓鎴愯繘鐗囦换鍔′俊鎭瓨鍏ヤ换鍔¤〃鏄惁瀹屾垚锛歿}", taskCache);
+        log.info("6銆佺敓鎴愯繘鐗囦换鍔′俊鎭瓨鍏ヤ换鍔¤〃鏄惁瀹屾垚锛歿}", taskCache);
 
         S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1);
-        log.info("6銆佸彂閫佺‘璁ゅ瓧瀹屾垚");
+        log.info("7銆佸彂閫佺‘璁ゅ瓧瀹屾垚");
 
 
     }
@@ -201,6 +206,10 @@
         GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId));
 //                .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1"));
         Assert.isFalse(null == glassInfo, "鐜荤拑淇℃伅涓嶅瓨鍦�");
+        if ((glassInfo.getWidth() < Double.parseDouble(minTwoFirstLength) && glassInfo.getHeight() < Double.parseDouble(minTwoSecondLength)) || (glassInfo.getWidth() < Double.parseDouble(minTwoSecondLength) && glassInfo.getHeight() < Double.parseDouble(minTwoFirstLength))) {
+            log.info("3銆佺幓鐠冧俊鎭笉绗﹀悎杩涘叆鐞嗙墖绗兼渶灏忓昂瀵革紝鐜荤拑淇℃伅涓簕}", glassInfo);
+            return null;
+        }
         //鎸夌収鐜荤拑灏哄
         LambdaQueryWrapper<GlassInfo> queryWrapper = new LambdaQueryWrapper<GlassInfo>()
                 .eq(GlassInfo::getWidth, glassInfo.getWidth())
@@ -698,7 +707,7 @@
     @Scheduled(fixedDelay = 1000)
     public void CacheGlassTasks() {
         JSONObject jsonObject = new JSONObject();
-        List<Map<String, Object>> currentCutTerritorys= edgStorageCageDetailsService.selectCutTerritory();
+        List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory();
 //        List<Map<String, Object>> currentCutTerritorys=new ArrayList<>();
 //        if(engineerId==null||engineerId.isEmpty()){
 //            //璇嗗埆鎽嗙墖 褰撳墠鐗堝浘鏁版嵁

--
Gitblit v1.8.0