From 06a852184f2711e72ae06650a793e52334bdefe0 Mon Sep 17 00:00:00 2001 From: 严智鑫 <test> Date: 星期三, 22 五月 2024 10:19:57 +0800 Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes --- UI-Project/src/views/Returns/returns.vue | 143 ++- UI-Project/src/views/Identify/identify.vue | 121 ++ UI-Project/src/views/Caching/cachingbefore.vue | 87 -- hangzhoumesParent/common/springsecurity/src/main/java/com/mes/menu/service/impl/SysMenuServiceImpl.java | 1 JsonFile/PlcLoadGlass.json | 78 ++ UI-Project/src/views/Caching/cachingun.vue | 95 -- hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageController.java | 14 hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/LoadGlassMapper.java | 2 hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/S7object.java | 4 hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterInfo.java | 2 hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml | 2 hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java | 8 hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java | 1 JsonFile/PlcCacheGlass.json | 64 + UI-Project/src/views/StockBasicData/stockBasicData.vue | 166 +--- hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java | 33 hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java | 53 + hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java | 5 UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue | 183 +++++ hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java | 24 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java | 21 hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageServiceImpl.java | 9 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java | 28 hangzhoumesParent/common/servicebase/src/main/java/com/mes/engineering/controller/EngineeringController.java | 9 hangzhoumesParent/common/servicebase/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java | 4 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java | 4 hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json | 11 JsonFile/PlcdownGlass.json | 362 ++++++++++ UI-Project/src/views/StockBasicData/Select.vue | 507 ------------- UI-Project/src/router/index.js | 11 JsonFile/PlcCacheVerticalGlass.json | 57 + hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/S7object.java | 10 32 files changed, 1,218 insertions(+), 901 deletions(-) diff --git a/JsonFile/PlcCacheGlass.json b/JsonFile/PlcCacheGlass.json new file mode 100644 index 0000000..01969b7 --- /dev/null +++ b/JsonFile/PlcCacheGlass.json @@ -0,0 +1,64 @@ +{ + "plcAddressBegin":"DB11.0", + "plcAddressLenght":"80", + "dataType":"word", + "parameteInfor":[ + { + "codeId": "A06_request_word", + "addressIndex":"0", + "addressLenght":"2", + "ratio":"1", + "unit":"m/min" + }, + { + "codeId": "A05_scanning_ID", + "addressIndex":"2", + "addressLenght":"30", + "ratio":"1", + "unit":"" + }, + { + "codeId": "Current_slot", + "addressIndex":"36", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "MES_confirmation_word", + "addressIndex":"38", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "A08_glass_status", + "addressIndex":"68", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "A10_glass_status", + "addressIndex":"70", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "A09_prohibit_film_production", + "addressIndex":"72", + "addressLenght":"2", + "ratio":"1", + "unit":"" + } + , + { + "codeId": "A10_prohibit_film_production", + "addressIndex":"74", + "addressLenght":"2", + "ratio":"1", + "unit":"" + } + ] +} diff --git a/JsonFile/PlcCacheVerticalGlass.json b/JsonFile/PlcCacheVerticalGlass.json new file mode 100644 index 0000000..5838dac --- /dev/null +++ b/JsonFile/PlcCacheVerticalGlass.json @@ -0,0 +1,57 @@ +{ + "plcAddressBegin":"DB.0", + "plcAddressLenght":"72", + "dataType":"word", + "parameteInfor":[ + { + "codeId": "D01Request", + "addressIndex":"0", + "addressLenght":"2", + "ratio":"1", + "unit":"m/min" + }, + { + "codeId": "D01ID1", + "addressIndex":"2", + "addressLenght":"6", + "ratio":"1", + "unit":"" + }, + { + "codeId": "D04Request", + "addressIndex":"8", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "D04ID1", + "addressIndex":"10", + "addressLenght":"6", + "ratio":"1", + "unit":"" + }, + { + "codeId": "D02Go", + "addressIndex":"20", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "D05Go", + "addressIndex":"22", + "addressLenght":"2", + "ratio":"1", + "unit":"" + } + , + { + "codeId": "DeviceStatus", + "addressIndex":"70", + "addressLenght":"2", + "ratio":"1", + "unit":"" + } + ] +} \ No newline at end of file diff --git a/JsonFile/PlcLoadGlass.json b/JsonFile/PlcLoadGlass.json new file mode 100644 index 0000000..9b0432b --- /dev/null +++ b/JsonFile/PlcLoadGlass.json @@ -0,0 +1,78 @@ +{ + "plcAddressBegin":"DB1.2000", + "plcAddressLenght":"100", + "dataType":"word", + "parameteInfor":[ + { + "codeId": "loadRequest", + "addressIndex":"0", + "addressLenght":"2", + "ratio":"1", + "unit":"m/min" + }, + { + "codeId": "PlcStatus", + "addressIndex":"10", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "MesToPlc", + "addressIndex":"20", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "InkageStatus", + "addressIndex":"22", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "WorkId", + "addressIndex":"24", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "GlassWidth", + "addressIndex":"26", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "GlassHeight", + "addressIndex":"28", + "addressLenght":"2", + "ratio":"1", + "unit":"" + } + , + { + "codeId": "MesToPlcStatus", + "addressIndex":"40", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "MesToPlcStatusId", + "addressIndex":"42", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { + "codeId": "MesTaskStatus", + "addressIndex":"56", + "addressLenght":"2", + "ratio":"1", + "unit":"" + } + ] +} \ No newline at end of file diff --git a/JsonFile/PlcdownGlass.json b/JsonFile/PlcdownGlass.json new file mode 100644 index 0000000..c813b1d --- /dev/null +++ b/JsonFile/PlcdownGlass.json @@ -0,0 +1,362 @@ +{ + "plcAddressBegin": "DB100.0", + "plcAddressLenght": "142", + "dataType": "word", + "parameteInfor": [ + { + "codeId": "RequestWord", + "addressIndex": "0", + "addressLenght": "2" + }, + { + "codeId": "G04ID", + "addressIndex": "2", + "addressLenght": "2" + }, + { + "codeId": "G06RobotTaskRequestWord", + "addressIndex": "4", + "addressLenght": "2" + }, + { + "codeId": "G06ID", + "addressIndex": "6", + "addressLenght": "2" + }, + { + "codeId": "G11RobotTaskRequestWord", + "addressIndex": "8", + "addressLenght": "2" + }, + { + "codeId": "G011ID", + "addressIndex": "10", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "12", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "14", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "16", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "18", + "addressLenght": "2" + }, + { + "codeId": "MESSendingWord", + "addressIndex": "20", + "addressLenght": "2" + }, + { + "codeId": "InputGrid", + "addressIndex": "22", + "addressLenght": "2" + }, + { + "codeId": "OutputGrid", + "addressIndex": "24", + "addressLenght": "2" + }, + { + "codeId": "OutputID", + "addressIndex": "26", + "addressLenght": "2" + }, + { + "codeId": "FrontOrRearLowerSlice", + "addressIndex": "28", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "30", + "addressLenght": "2" + }, + { + "codeId": "G06RobotTaskReply", + "addressIndex": "32", + "addressLenght": "2" + }, + { + "codeId": "G06Rack", + "addressIndex": "34", + "addressLenght": "2" + }, + { + "codeId": "G11RobotTaskReply", + "addressIndex": "36", + "addressLenght": "2" + }, + { + "codeId": "G11Rack", + "addressIndex": "38", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "40", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "42", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "44", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "46", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "48", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "50", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "52", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "54", + "addressLenght": "2" + }, + { + "codeId": "MESTaskState", + "addressIndex": "56", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "58", + "addressLenght": "2" + }, + { + "codeId": "AlarmState", + "addressIndex": "60", + "addressLenght": "2" + }, + { + "codeId": "Alarm1", + "addressIndex": "62", + "addressLenght": "2" + }, + { + "codeId": "Alarm2", + "addressIndex": "64", + "addressLenght": "2" + }, + { + "codeId": "Alarm3", + "addressIndex": "66", + "addressLenght": "2" + }, + { + "codeId": "Alarm4", + "addressIndex": "68", + "addressLenght": "2" + }, + { + "codeId": "neirong", + "addressIndex": "70", + "addressLenght": "2" + }, + { + "codeId": "device", + "addressIndex": "72", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "74", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "76", + "addressLenght": "2" + }, + { + "codeId": "InOut1", + "addressIndex": "78", + "addressLenght": "2" + }, + { + "codeId": "InOut2", + "addressIndex": "80", + "addressLenght": "2" + }, + { + "codeId": "InOut3", + "addressIndex": "82", + "addressLenght": "2" + }, + { + "codeId": "InOut4", + "addressIndex": "84", + "addressLenght": "2" + }, + { + "codeId": "InOut5", + "addressIndex": "86", + "addressLenght": "2" + }, + { + "codeId": "InOut6", + "addressIndex": "88", + "addressLenght": "2" + }, + { + "codeId": "InOut7", + "addressIndex": "90", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "92", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "94", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "96", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "98", + "addressLenght": "2" + }, + { + "codeId": "spare", + "addressIndex": "100", + "addressLenght": "2" + }, + { + "codeId": "G04ActionState", + "addressIndex": "102", + "addressLenght": "2" + }, + { + "codeId": "G05ActionState", + "addressIndex": "104", + "addressLenght": "2" + }, + { + "codeId": "G06ActionState", + "addressIndex": "106", + "addressLenght": "2" + }, + { + "codeId": "G07ActionState", + "addressIndex": "108", + "addressLenght": "2" + }, + { + "codeId": "G08ActionState", + "addressIndex": "110", + "addressLenght": "2" + }, + { + "codeId": "G09ActionState", + "addressIndex": "112", + "addressLenght": "2" + }, + { + "codeId": "G10ActionState", + "addressIndex": "114", + "addressLenght": "2" + }, + { + "codeId": "G11ActionState", + "addressIndex": "116", + "addressLenght": "2" + }, + { + "codeId": "G12ActionState", + "addressIndex": "118", + "addressLenght": "2" + }, + { + "codeId": "G13ActionState", + "addressIndex": "120", + "addressLenght": "2" + }, + { + "codeId": "G04IDS", + "addressIndex": "122", + "addressLenght": "2" + }, + { + "codeId": "G05IDS", + "addressIndex": "124", + "addressLenght": "2" + }, + { + "codeId": "G06IDS", + "addressIndex": "126", + "addressLenght": "2" + }, + { + "codeId": "G07IDS", + "addressIndex": "128", + "addressLenght": "2" + }, + { + "codeId": "G08IDS", + "addressIndex": "130", + "addressLenght": "2" + }, + { + "codeId": "G09IDS", + "addressIndex": "132", + "addressLenght": "2" + }, + { + "codeId": "G10IDS", + "addressIndex": "134", + "addressLenght": "2" + }, + { + "codeId": "G11IDS", + "addressIndex": "136", + "addressLenght": "2" + }, + { + "codeId": "G12IDS", + "addressIndex": "138", + "addressLenght": "2" + }, + { + "codeId": "G13ID", + "addressIndex": "140", + "addressLenght": "2" + } + ] +} \ No newline at end of file diff --git a/UI-Project/src/router/index.js b/UI-Project/src/router/index.js index c0773c2..910f514 100644 --- a/UI-Project/src/router/index.js +++ b/UI-Project/src/router/index.js @@ -112,13 +112,18 @@ /*----------- 纾ㄨ竟锛堝喎鍔犲伐锛� ----------------*/ { path: 'StockBasicData', - name: 'StockBasicData', - component: () => import('../views/StockBasicData/stockBasicData.vue'), + name: 'Select', + component: () => import('../views/StockBasicData/Select.vue'), children:[ { path: '/StockBasicData/stockBasicData', name: 'stockBasicData', component: () => import('../views/StockBasicData/stockBasicData.vue') + }, + { + path: '/StockBasicData/stockBasicDatatwo', + name: 'stockBasicDatatwo', + component: () => import('../views/StockBasicData/stockBasicDatatwo.vue') }, ] }, @@ -231,7 +236,7 @@ }, { path: '', - redirect: '/Slicecage/slicecage' + redirect: '/returns/returns' } ] }, diff --git a/UI-Project/src/views/Caching/cachingbefore.vue b/UI-Project/src/views/Caching/cachingbefore.vue index 284a33c..5b9d2a2 100644 --- a/UI-Project/src/views/Caching/cachingbefore.vue +++ b/UI-Project/src/views/Caching/cachingbefore.vue @@ -27,31 +27,6 @@ } }); -// const getTableRow = (row,type) =>{ -// switch (type) { -// case 'delete':{ -// let flowData = ref({ -// id:0, -// slot:row.slot -// }) -// request.post("/cacheGlass/edgStorageCage/edgStorageCageGlass",flowData.value).then((res) => { -// if(res.code==200){ -// ElMessage.success(t('searchOrder.msgDeleteSuccess')) -// router.push({path:'/main/delivery/selectDelivery',query:{random:Math.random()}}) -// }else{ -// ElMessage.warning(res.msg) -// router.push("/login") -// } -// }) - -// return -// } -// } -// } -// let slots = ref({ -// id:0, -// slot: slot.value -// }) const open = async(row) => { try { const confirmResult = await ElMessageBox.confirm( @@ -67,19 +42,15 @@ // 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛 var url="/cacheGlass/edgStorageCage/edgStorageCageGlass?edgStorageCageId="+row.id; console.log(url); - const deleteResponse = await request.post(url, { + const response = await request.post(url, { esdId: row.esdId }) - if (response.code == 200) { - // 鍒犻櫎鎴愬姛锛屾偍鍙互鏍规嵁闇�瑕佸鐞嗘垚鍔熺殑鎯呭喌 - // ElMessage({ - // type: 'success', - // message: '鍒犻櫎鎴愬姛锛�', - // }) + if (response.code === 200) { ElMessage.success(response.message); } else { // 鍒犻櫎澶辫触锛屾偍鍙互澶勭悊閿欒鎴栨樉绀洪敊璇俊鎭粰鐢ㄦ埛 - alert('鍒犻櫎澶辫触锛�' + deleteResponse.message); + ElMessage.error(response.msg); + // alert('鍒犻櫎澶辫触锛�' + deleteResponse.message); } } } catch (error) { @@ -87,56 +58,6 @@ console.error('鍙戠敓閿欒:', error); } }; -// const open = () => { -// ElMessageBox.confirm( -// '鏄惁鍒犻櫎璇ユ潯淇℃伅?', -// '鎻愮ず', -// { -// confirmButtonText: '鏄�', -// cancelButtonText: '鍙栨秷', -// type: 'warning', -// } -// ) -// .then(() => { -// ElMessage({ -// type: 'success', -// message: '鍒犻櫎鎴愬姛锛�', -// }) -// }) -// .catch(() => { -// ElMessage({ -// type: 'info', -// message: '鍒犻櫎澶辫触', -// }) -// }) -// } -// 鍒犻櫎 -// const handleBindRacka = (row) => { -// adda.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗� -// }; -// // 鍒犻櫎 -// const handleConfirma = async () => { -// try { -// window.localStorage.setItem('slot', res.data.slot) -// let slot = window.localStorage.getItem('slot') -// const response = await request.post('/cacheGlass/edgStorageCage/edgStorageCageGlass', { -// slot: slot.value, -// id: 0 -// }); - -// if (response.code == 200) { -// // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 -// ElMessage.success(response.message); -// adda.value = false; -// } else { -// // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� -// ElMessage.error(response.msg); -// } -// } catch (error) { -// // 澶勭悊閿欒 -// console.error(error); -// } -// }; const gridOptions = reactive({ border: "full",//琛ㄦ牸鍔犺竟妗� diff --git a/UI-Project/src/views/Caching/cachingun.vue b/UI-Project/src/views/Caching/cachingun.vue index 5a82915..ba1686f 100644 --- a/UI-Project/src/views/Caching/cachingun.vue +++ b/UI-Project/src/views/Caching/cachingun.vue @@ -27,35 +27,10 @@ } }); -// const getTableRow = (row,type) =>{ -// switch (type) { -// case 'delete':{ -// let flowData = ref({ -// id:0, -// slot:row.slot -// }) -// request.post("/cacheGlass/edgStorageCage/edgStorageCageGlass",flowData.value).then((res) => { -// if(res.code==200){ -// ElMessage.success(t('searchOrder.msgDeleteSuccess')) -// router.push({path:'/main/delivery/selectDelivery',query:{random:Math.random()}}) -// }else{ -// ElMessage.warning(res.msg) -// router.push("/login") -// } -// }) - -// return -// } -// } -// } -// let slots = ref({ -// id:0, -// slot: slot.value -// }) const open = async(row) => { try { const confirmResult = await ElMessageBox.confirm( - '鏄惁鍒犻櫎璇ユ潯淇℃伅?', + '鏄惁鎶ョ己璇ユ潯淇℃伅?', '鎻愮ず', { confirmButtonText: '鏄�', @@ -65,74 +40,24 @@ ); if (confirmResult === 'confirm') { // 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛 - const deleteResponse = await request.post("/cacheGlass/edgStorageCage/edgStorageCageGlass", { - id:0, - slot: row.slot + var url="/cacheGlass/edgStorageCage/edgStorageCageGlass?edgStorageCageId="+row.id; + console.log(url); + const response = await request.post(url, { + esdId: row.esdId }) - if (response.code == 200) { - // 鍒犻櫎鎴愬姛锛屾偍鍙互鏍规嵁闇�瑕佸鐞嗘垚鍔熺殑鎯呭喌 - alert('鍒犻櫎鎴愬姛锛�'); + if (response.code === 200) { + ElMessage.success(response.message); } else { // 鍒犻櫎澶辫触锛屾偍鍙互澶勭悊閿欒鎴栨樉绀洪敊璇俊鎭粰鐢ㄦ埛 - alert('鍒犻櫎澶辫触锛�' + deleteResponse.message); + ElMessage.error(response.msg); + // alert('鍒犻櫎澶辫触锛�' + deleteResponse.message); } } } catch (error) { // 澶勭悊鍙兘鍑虹幇鐨勯敊璇紝姣斿 ElMessageBox 鎶涘嚭鐨勫紓甯哥瓑 console.error('鍙戠敓閿欒:', error); } -}; -// const open = () => { -// ElMessageBox.confirm( -// '鏄惁鍒犻櫎璇ユ潯淇℃伅?', -// '鎻愮ず', -// { -// confirmButtonText: '鏄�', -// cancelButtonText: '鍙栨秷', -// type: 'warning', -// } -// ) -// .then(() => { -// ElMessage({ -// type: 'success', -// message: '鍒犻櫎鎴愬姛锛�', -// }) -// }) -// .catch(() => { -// ElMessage({ -// type: 'info', -// message: '鍒犻櫎澶辫触', -// }) -// }) -// } -// 鍒犻櫎 -// const handleBindRacka = (row) => { -// adda.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗� -// }; -// // 鍒犻櫎 -// const handleConfirma = async () => { -// try { -// window.localStorage.setItem('slot', res.data.slot) -// let slot = window.localStorage.getItem('slot') -// const response = await request.post('/cacheGlass/edgStorageCage/edgStorageCageGlass', { -// slot: slot.value, -// id: 0 -// }); - -// if (response.code == 200) { -// // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 -// ElMessage.success(response.message); -// adda.value = false; -// } else { -// // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� -// ElMessage.error(response.msg); -// } -// } catch (error) { -// // 澶勭悊閿欒 -// console.error(error); -// } -// }; - +}; const gridOptions = reactive({ border: "full",//琛ㄦ牸鍔犺竟妗� keepSource: true,//淇濇寔婧愭暟鎹� diff --git a/UI-Project/src/views/Identify/identify.vue b/UI-Project/src/views/Identify/identify.vue index 5e2bc03..84ef2b6 100644 --- a/UI-Project/src/views/Identify/identify.vue +++ b/UI-Project/src/views/Identify/identify.vue @@ -7,32 +7,31 @@ > <div v-for="(rect, index) in adjustedRects" - :key="index" + :key="rect.glass_id" class="rect" - @click="handleBind" - :style="{ position: 'absolute', top: `${rect.y_axis}px`, left: `${rect.x_axis}px`, width: `${rect.width}px`, height: `${rect.height}px` }" + @click="showDialog(rect.glass_id)" + :style="{ position: 'absolute', + top: `${rect.y_axis}px`, left: `${rect.x_axis}px`, width: `${rect.width}px`, height: `${rect.height}px`, + backgroundColor: getRectColor(rect.glass_state) + }" > <!-- 绠ご --> <!-- <div id="arrow"></div> <div id="line"></div> --> <!-- <div class="centered-text" >NG24030401B01</div> --> <div class="centered-text"> - <div>{{ rect.process_id }}</div> + <div>{{ rect.process_id }}</div> <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div> </div> </div> <!-- 鐐瑰嚮寮瑰嚭 --> <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;"> - <!-- <template #footer> --> - <!-- <div id="dialog-footer"> --> - <el-button type="warning" plain :icon="Delete" @click="handle" style="width: 120px;margin-left: 10px;"> + <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 120px;margin-left: 10px;"> 鐮存崯 </el-button> - <el-button type="danger" plain @click="blind = false" style="width: 120px;margin-top: 10px;"> + <el-button type="danger" plain @click="handleManualTake(currentGlassId)" style="width: 120px;margin-top: 10px;"> <el-icon class="el-icon--right"><Upload /></el-icon> 浜哄伐鎷胯蛋</el-button> - <!-- </div> --> - <!-- </template> --> </el-dialog> </div> </div> @@ -42,18 +41,25 @@ <script setup lang="ts"> import { Delete, Upload } from '@element-plus/icons-vue' +import { ElMessage, ElMessageBox } from 'element-plus' import { ref, onMounted } from 'vue'; import request from "@/utils/request" const blind = ref(false) const olWidth = ref(); const olHeight = ref(); const process_id = ref(); // 鐢ㄤ簬瀛樺偍process_id鐨勫搷搴斿紡寮曠敤 +const glass_id = ref(); // const rects = ref([]); // 鐢ㄤ簬瀛樺偍鐭╁舰鏁版嵁鐨勫搷搴斿紡寮曠敤 +const currentGlassId = ref(null); // 瀛樺偍褰撳墠鐐瑰嚮鐭╁舰鐨� glass_id const adjustedRects = ref([]); -const handleBind = (row) => { - - blind.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗� -}; +// const handleBind = (row) => { +// blind.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗� +// }; +// 鏄剧ず瀵硅瘽妗嗗苟璁剧疆褰撳墠 glass_id +function showDialog(glassId: number) { + currentGlassId.value = glassId; + blind.value = true; +} onMounted(async () => { try { const response = await request.post('/cacheGlass/taskCache/currentCutTerritory'); // 鏇挎崲涓轰綘鐨凙PI绔偣 @@ -61,10 +67,11 @@ // const process_id = response.data[0].process_id const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁 console.log(response.data); - const { olWidth: newolWidth, olHeight: newolHeight, process_id: newprocess_id } = response.data; // 鑾峰彇灏哄 + const { olWidth: newolWidth, olHeight: newolHeight, process_id: newprocess_id ,glass_id:newglass_id } = response.data; // 鑾峰彇灏哄 olWidth.value = newolWidth; // 璁剧疆瀹瑰櫒瀹藉害 olHeight.value = newolHeight; // 璁剧疆瀹瑰櫒楂樺害 process_id.value = newprocess_id; + glass_id.value = newglass_id; adjustedRects.value = rawRects.map(rect => ({ ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬� @@ -72,7 +79,9 @@ y_axis: (rect.y_axis*100) * 0.005, width: (rect.width*100) * 0.004 , height:( rect.height*100) * 0.004 , + glass_state: rect.glass_state })); + console.log(rect); // console.log( (rect.width*100) / 300 ); @@ -84,13 +93,91 @@ // console.error('Error fetching rectangles :', error); console.error('Error fetching rects :', error); } -}); +}); +// 鐮存崯 +const handleDamage = async () => { + try { + var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+201; + console.log(url); + const response = await request.post(url) + // const response = await request.post('/cacheGlass/taskCache/identControls', { + // identId: currentGlassId.value, + // controlsId: 201, + // }) + if (response.code == 200) { + // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 + ElMessage.success(response.message); + // window.location.reload() + blind.value = false; + updateRectStatus(currentGlassId.value, 201); + } else { + // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� + ElMessage.error(response.msg); + } +} +catch (error) { + // 澶勭悊閿欒 + console.error(error); + } +} +// // 浜哄伐鎷胯蛋 +const handleManualTake = async () => { + try { + var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+200; + console.log(url); + const response = await request.post(url) + // const response = await request.post('/cacheGlass/taskCache/identControls', { + // identId: currentGlassId.value, + // controlsId: 200, + // }) + if (response.code == 200) { + // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 + ElMessage.success(response.message); + // window.location.reload() + blind.value = false; + updateRectStatus(currentGlassId.value, 200); + } else { + // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� + ElMessage.error(response.msg); + } +} +catch (error) { + // 澶勭悊閿欒 + console.error(error); + } +} +function getRectColor(state: number): string { + switch (state) { + case 0: + return '#e1f3d8'; + case 100: + return '#c8c9cc'; + case 110: + return '#b3e19d'; + case 120: + return '#f89898'; + case 200: + return 'lightblue'; + case 201: + return '#f3d19e'; + default: + return '#911005'; // 榛樿棰滆壊 + } +} +// 鏇存柊鐭╁舰鐘舵�� +function updateRectStatus(glassId: string, status: number) { + adjustedRects.value.forEach(rect => { + if (rect.glass_id === glassId) { + rect.glass_state = status; // 鏇存柊鐭╁舰鐨勭姸鎬� + } + }); +} </script> <style scoped> .rect { border: 1px solid black; /* 璁剧疆鐭╁舰鐨勮竟妗� */ - background-color: lightblue; /* 璁剧疆鐭╁舰鐨勮儗鏅壊 */ + /* background-color: lightblue; 璁剧疆鐭╁舰鐨勮儗鏅壊 */ } .centered-text { /* 璁剧疆鏂囧瓧灞呬腑鏍峰紡 */ diff --git a/UI-Project/src/views/Returns/returns.vue b/UI-Project/src/views/Returns/returns.vue index 6164565..1bf0404 100644 --- a/UI-Project/src/views/Returns/returns.vue +++ b/UI-Project/src/views/Returns/returns.vue @@ -5,7 +5,6 @@ const router = useRouter() import type { TableColumnCtx } from 'element-plus' -// import { ref } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' const dialogFormVisible = ref(false) const blind = ref(false) @@ -15,9 +14,10 @@ const adda = ref(false) const flake = ref(false) const flakea = ref(false) +const state = reactive({updateKey: 0}) // const value = ref('') import request from "@/utils/request" - +const ida = ref(null); import { ref, onMounted } from "vue"; // import http from "@/http/index"; @@ -33,7 +33,7 @@ }) const tableDataa = ref([]) - + const tableData = reactive([]); // let filterData = ref({ // damageDetails: { @@ -70,7 +70,7 @@ if (tableDataa.value[0].patternWidth > 0) { flake.value = true; } - + if (tableDataa.value[1].patternWidth > 0) { flakea.value = true; } @@ -148,7 +148,7 @@ if (response.code == 200) { titleSelectJson.value.processType = response.data; console.log(response.data); - + } else { ElMessage.warning(response.data); } @@ -164,7 +164,7 @@ if (response.code == 200) { titleSelectJsona.value.processTypea = response.data; console.log(response.data); - + } else { ElMessage.warning(response.data); } @@ -214,14 +214,25 @@ // }) const projectNo = ref(''); const workstationId = ref(''); +const id = ref(''); const patternHeight = ref(''); const patternWidth = ref(''); const filmsId = ref(''); const patternThickness = ref(''); const number = ref(''); // 娣诲姞 +const handleBindRack = (row) => { + workstationId.value = row.workstationId; // 鍋囪rackNumber鏄灦鍙峰瓧娈电殑灞炴�у悕 + ida.value = row.id; + console.log(ida.value); + add.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗� +}; +// 娣诲姞 const handleConfirm = async () => { - try { + console.log(ida.value); + // console.log('id.value:', id.value); + if ((ida.value === 2 || ida.value === 4) && (parseInt(patternHeight.value, 10) >= 2700 )) { + try { const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', { id: workstationId.value, workstationId: workstationId.value, @@ -231,12 +242,12 @@ patternThickness: patternThickness.value, number: number.value }); - if (response.code == 200) { // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 ElMessage.success(response.message); - window.location.reload() + // window.location.reload() add.value = false; + tableDataa.value = response.data; window.localStorage.setItem('workstationId', response.data.workstationId) let workstationId = window.localStorage.getItem('workstationId') if (workstationId == '1') { @@ -248,11 +259,54 @@ // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� ElMessage.error(response.msg); } - } catch (error) { - // 澶勭悊閿欒 - console.error(error); - } -}; + } catch (error) { + // 澶勭悊璇锋眰閿欒 + console.error(error); + alert('璇锋眰澶辫触锛岃绋嶅悗鍐嶈瘯锛�'); + } + } + else if( ida.value === 1 || ida.value === 3){ + try { + const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', { + id: workstationId.value, + workstationId: workstationId.value, + patternHeight: patternHeight.value, + patternWidth: patternWidth.value, + filmsId: filmsId.value, + patternThickness: patternThickness.value, + number: number.value + }); + if (response.code == 200) { + // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 + ElMessage.success(response.message); + // window.location.reload() + add.value = false; + tableDataa.value = response.data; + window.localStorage.setItem('workstationId', response.data.workstationId) + let workstationId = window.localStorage.getItem('workstationId') + if (workstationId == '1') { + flake.value = true + } else if (workstationId == '2'){ + flakea.value = true + } + } else { + // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� + ElMessage.error(response.msg); + } + } catch (error) { + // 澶勭悊璇锋眰閿欒 + console.error(error); + alert('璇锋眰澶辫触锛岃绋嶅悗鍐嶈瘯锛�'); + } + } + else { + ElMessage({ + type: 'info', + message: '绗簩琛屽拰绗洓琛岀殑楂樺繀椤诲ぇ浜�2700鎵嶈兘淇濆瓨锛�', + }) + } + +}; // 鍒犻櫎 const handleConfirma = async () => { try { @@ -269,6 +323,7 @@ // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 ElMessage.success(response.message); adda.value = false; + tableDataa.value = response.data; window.localStorage.setItem('workstationId', response.data.workstationId) let workstationId = window.localStorage.getItem('workstationId') if (workstationId == '1') { @@ -294,7 +349,7 @@ if (response.code == 200) { // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 ElMessage.success(response.message); - window.location.reload() + // window.location.reload() dialogFormVisible.value = false; } else { // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� @@ -316,8 +371,10 @@ if (response.code == 200) { // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 ElMessage.success(response.message); - window.location.reload() + // window.location.reload() blind.value = false; + tableData.splice(0, tableData.length, ...response.data); + } else { // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� ElMessage.error(response.msg); @@ -328,36 +385,6 @@ console.error(error); } } -// const handle = async () => { -// try { -// let engineeringId = window.localStorage.getItem('engineeringId') -// console.log(engineeringId); -// if (engineeringId !== '') { -// const response = await request.post('/loadGlass/engineering/engineering/changeTask', { -// engineeringId: engineerId.va, -// state: 1, -// }) -// if (response.code == 200) { -// // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 -// ElMessage.success(response.message); -// blind.value = false; -// } else { -// // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� -// ElMessage.error(response.msg); -// } -// } -// else { -// ElMessage({ -// type: 'info', -// message: '宸ョ▼鍙蜂笉鑳戒负绌猴紒', -// }) -// } -// } -// catch (error) { -// // 澶勭悊閿欒 -// console.error(error); -// } -// } // 鏆傚仠 const handlea = async () => { try { @@ -371,8 +398,11 @@ if (response.code == 200) { // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 ElMessage.success(response.message); - window.location.reload() + // window.location.reload() blinda.value = false; + // tableData.value = response.data + // tableData.value = []; + state.updateKey ++ } else { // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� ElMessage.error(response.msg); @@ -403,9 +433,10 @@ if (response.code == 200) { // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 ElMessage.success(response.message); - window.location.reload() + // window.location.reload() blindb.value = false; - } else { + state.updateKey ++ + // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� ElMessage.error(response.msg); } @@ -423,11 +454,12 @@ } } onMounted(fetchTableData); -function getStatusText(state: number) { - switch (state) { +function getStatusText(state: number) { + switch (state) { case 0: return '绛夊緟涓�'; case 1: + return '涓婄墖涓�'; case 2: return '涓婄墖涓�'; case 100: @@ -482,12 +514,7 @@ blindb.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗� }; -// 娣诲姞 -const handleBindRack = (row) => { - workstationId.value = row.workstationId; // 鍋囪rackNumber鏄灦鍙峰瓧娈电殑灞炴�у悕 - - add.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗� -}; + // 鍒犻櫎 const handleBindRacka = (row) => { workstationId.value = row.workstationId; // 鍋囪rackNumber鏄灦鍙峰瓧娈电殑灞炴�у悕 @@ -550,7 +577,7 @@ <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handleBindb">鍋滄浠诲姟</el-button> <el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading"> - <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> + <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;" :key="state.updateKey"> <el-table height="150" ref="table" diff --git a/UI-Project/src/views/StockBasicData/Select.vue b/UI-Project/src/views/StockBasicData/Select.vue index b7539d3..d0567d3 100644 --- a/UI-Project/src/views/StockBasicData/Select.vue +++ b/UI-Project/src/views/StockBasicData/Select.vue @@ -1,486 +1,49 @@ <script setup> -import {Search} from "@element-plus/icons-vue"; -import {reactive} from "vue"; -import {useRouter} from "vue-router" -const router = useRouter() - -import { ref } from 'vue' -import { ElMessage, ElMessageBox } from 'element-plus' -const dialogFormVisible = ref(false) -const dialogFormVisiblea = ref(false) -const box = ref(true) -const boxa = ref(false) -const boxb = ref(false) -// const tableData = [ -// { -// id: '1', -// long: '1005', -// wide: '183.6', -// thick: '1991', -// type: '5', -// typea: '1', -// }, -// { -// id: '2', -// long: '105', -// wide: '183', -// thick: '191', -// typea: '1', -// type: '5' -// }, -// { -// id: '2', -// long: '105', -// wide: '183', -// thick: '191', -// typea: '1', -// type: '5' -// }, -// ] -const tableData = ref([ -{ - id: '2', - ida: '2', - long: '105', - wide: '183', - thick: '191', - typea: '1', - typeb: '1', - typec: '1', - type: '5' - }, - { - id: '12', - ida: '12', - long: '1105', - wide: '1183', - thick: '1911', - typea: '11', - typeb: '11', - typec: '11', - type: '15' - }, -]) -// 鏂板涓�琛� -const addTableData = ()=>{ - const newRow = { - id: null, - id: null, - long: null, - wide: null, - thick: null, - typea: null, - type: null, - typeb: null, - typec: null, - } - tableData.value.push(newRow) -} -// 鍒犻櫎 -const deleteTableData = (row) =>{ - const index = tableData.value.indexOf(row); - if (index !== -1) { - tableData.value.splice(index, 1); - } -} -const tableDataa = [ - { - ida: '3', - longa: '1005', - widea: '183.6', - thicka: '1991', - }, - { - ida: '4', - longa: '105', - widea: '183', - thicka: '191', - } -] -const open = () => { - ElMessageBox.confirm( - '鏄惁鍒犻櫎璇ユ潯淇℃伅?', - '鎻愮ず', - { - confirmButtonText: '鏄�', - cancelButtonText: '鍙栨秷', - type: 'warning', - } - ) - .then(() => { - ElMessage({ - type: 'success', - message: '鍒犻櫎鎴愬姛锛�', - }) - }) - .catch(() => { - ElMessage({ - type: 'info', - message: '鍒犻櫎澶辫触', - }) - }) -} -const getTableRow = (row,type) =>{ - switch (type) { - case 'edit' :{ - //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅') - router.push({path: '/main/returns/createReturns', query: { ReturnID: 'TH24010101' }}) - break - } - case 'delete':{ - alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅') - break - } - } +import {ArrowLeftBold, ArrowRight, Search} from "@element-plus/icons-vue" +import {useRouter} from "vue-router"; +let indexFlag=$ref(1) +function changeRouter(index){ + indexFlag=index } -const selectedRows = ref([]); -const handleSelectionChange = (selection) => { - selectedRows.value = selection; -}; -const showMessage = () => { - if (selectedRows.value.length === 0) { - ElMessage('璇疯嚦灏戦�夋嫨涓�涓�夐」') - } else{ - ElMessage({ - message: '鍑虹墖鎴愬姛锛�', - type: 'success', - }) - - } -}; -const pick = () => { - if (selectedRows.value.length === 0) { - ElMessage('璇疯嚦灏戦�夋嫨涓�涓�夐」') - } else{ - ElMessage({ - message: '鐮存崯鎴愬姛锛�', - type: 'success', - }) - - } -}; -const gridOptions = reactive({ - border: "full",//琛ㄦ牸鍔犺竟妗� - keepSource: true,//淇濇寔婧愭暟鎹� - align: 'center',//鏂囧瓧灞呬腑 - stripe:true,//鏂戦┈绾� - rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒 - id: 'OrderList', - showFooter: true,//鏄剧ず鑴� - printConfig: {}, - importConfig: {}, - exportConfig: {}, - scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔� - showOverflow:true, - columnConfig: { - resizable: true, - useKey: true - }, - filterConfig: { //绛涢�夐厤缃」 - remote: true - }, - customConfig: { - storage: true - }, - editConfig: { - trigger: 'click', - mode: 'row', - showStatus: true - }, - data: [ - { - 'id': '1', - 'long': '5', - 'wide': '1005', - 'thick': '183.6', - } - ], -}) </script> <template> - <div> - <el-button style="margin-top: 5px;margin-left: 5px;" id="searchButton" type="primary" @click="showMessage">鍑虹墖</el-button> - <el-button style="margin-top: 5px" id="searchButton" type="primary" @click="pick">鐮存崯</el-button> - <!-- <el-button style="margin-top: 5px" id="searchButton" type="primary" @click="dialogFormVisible = true">娣诲姞</el-button> --> - <el-button style="margin-top: 5px" id="searchButton" type="primary" @click="addTableData" >娣诲姞</el-button> - <el-button style="margin-top: 5px" id="searchButton" @click="boxb = true;box = false" >鍚堝苟</el-button> - <el-button style="margin-top: 5px" id="searchButton" @click="box = true;boxb = false" >鍗曠墖</el-button> + <!-- <div id="main-div"> --> + - <div v-if="box"> - <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> - <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 450px;"> - <el-table height="100%" ref="table" - @selection-change="handleSelectionChange" - :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> - <el-table-column type="selection" width="55" /> - <el-table-column prop="id" align="center" label="鏍呮牸鍙�" min-width="80" > - <template #default="scope"> - <el-input v-model="scope.row.id" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="ida" align="center" label="id" min-width="80"> - <template #default="scope"> - <el-input v-model="scope.row.ida" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="long" align="center" label="闀�" min-width="100" > - <template #default="scope"> - <el-input v-model="scope.row.long" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="wide" align="center" label="瀹�" min-width="100"> - <template #default="scope"> - <el-input v-model="scope.row.wide" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="type" align="center" label="鍘氬害" min-width="100"> - <template #default="scope"> - <el-input v-model="scope.row.type" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="typea" align="center" label="鑶滅郴" min-width="100" > - <template #default="scope"> - <el-input v-model="scope.row.typea" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="typeb" align="center" label="鍑虹墖椤哄簭" min-width="120" > - <template #default="scope"> - <el-input v-model="scope.row.typeb" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="typec" align="center" label="娴佺▼鍗″彿" min-width="150"> - <template #default="scope"> - <el-input v-model="scope.row.typec" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="thick" align="center" label="鍏朵粬" min-width="120" > - <template #default="scope"> - <el-input v-model="scope.row.thick" size="small"></el-input> - </template> - </el-table-column> - <el-table-column fixed="right" label="鎿嶄綔" align="center" width="200"> - <template #default="scope"> - <el-button size="mini" type="text" plain @click="dialogFormVisiblea = true">璇︽儏</el-button> - <el-button @click="deleteTableData(scope.row)" link icon="Delete" type="primary">鍒犻櫎</el-button> - </template> - </el-table-column> - </el-table> -</div> - - </el-card> - </div> - <div v-if="boxb"> - <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> - <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 450px;"> - <el-table height="100%" ref="table" - @selection-change="handleSelectionChange" - :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> - <el-table-column type="selection" width="55" /> - <el-table-column prop="id" align="center" label="鏍呮牸" min-width="80"> - <template #default="scope"> - <el-input v-model="scope.row.id" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="ida" align="center" label="id" min-width="80"> - <template #default="scope"> - <el-input v-model="scope.row.ida" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="long" align="center" label="闀�" min-width="120" > - <template #default="scope"> - <el-input v-model="scope.row.long" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="wide" align="center" label="瀹�" min-width="120"> - <template #default="scope"> - <el-input v-model="scope.row.wide" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="type" align="center" label="鍘氬害" min-width="120"> - <template #default="scope"> - <el-input v-model="scope.row.type" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="typea" align="center" label="鑶滅郴" min-width="120" > - <template #default="scope"> - <el-input v-model="scope.row.typea" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="typeb" align="center" label="鍑虹墖椤哄簭" min-width="120" > - <template #default="scope"> - <el-input v-model="scope.row.typeb" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="typec" align="center" label="娴佺▼鍗″彿" min-width="120"> - <template #default="scope"> - <el-input v-model="scope.row.typec" size="small"></el-input> - </template> - </el-table-column> - <el-table-column prop="thick" align="center" label="鍏朵粬" min-width="120" > - <template #default="scope"> - <el-input v-model="scope.row.thick" size="small"></el-input> - </template> - </el-table-column> - <el-table-column fixed="right" label="鎿嶄綔" align="center" width="200"> - <template #default="scope"> - <el-button size="mini" type="text" plain @click="dialogFormVisiblea = true">璇︽儏</el-button> - <el-button @click="deleteTableData(scope.row)" link icon="Delete" type="primary">鍒犻櫎</el-button> - </template> - </el-table-column> - </el-table> - </div> - </el-card> - </div> - </div> - <el-dialog v-model="dialogFormVisible" top="21vh" width="40%" title="娣诲姞" > - <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> - <el-form size="mini" label-width="150px"> - <el-form > - <el-row style="margin-top: -15px;margin-bottom: -2px;"> - <el-col :span="6"> - <div id="dt" style="font-size: 15px;"> - <div> - <el-form-item label="鏍呮牸鍙凤細" :required="true" style="width: 14vw"> - <el-input autocomplete="off" /> - </el-form-item></div></div> - </el-col> - <el-col :span="9"> - <div id="dta" style="font-size: 15px;"> - <div> - <el-form-item label="id锛�" :required="true" style="width: 14vw"> - <el-input autocomplete="off" /> - </el-form-item></div> - </div> - </el-col> - </el-row> - <el-row style="margin-top: 10px;"> - <el-col :span="6"> - <div id="dt" style="font-size: 15px;"> - <div> - <el-form-item label="闀匡細" :required="true" style="width: 13.2vw;margin-left: 14px;"> - <el-input autocomplete="off" /> - </el-form-item></div></div> - </el-col> - <el-col :span="9"> - <div id="dta" style="font-size: 15px;"> - <div> - <el-form-item label="瀹斤細" :required="true" style="width: 14vw"> - <el-input autocomplete="off" /> - </el-form-item></div></div> - </el-col> - </el-row> - <el-row style="margin-top: 10px;"> - <el-col :span="6"> - <div id="dt" style="font-size: 15px;"> - <div> - <el-form-item label="鍘氬害锛�" :required="true" style="width: 13.2vw;margin-left: 14px;"> - <el-input autocomplete="off" /> - </el-form-item></div></div> - </el-col> - <el-col :span="9"> - <div id="dta" style="font-size: 15px;"> - <div> - <el-form-item label="鑶滅郴锛�" :required="true" style="width: 14vw"> - <el-input autocomplete="off" /> - </el-form-item></div></div> - </el-col> - </el-row> - <el-row style="margin-top: 10px;"> - <el-col :span="6"> - <div id="dt" style="font-size: 15px;"> - <div> - <el-form-item label="鍑虹墖椤哄簭锛�" :required="true" style="width: 13.2vw;margin-left: 14px;"> - <el-input autocomplete="off" /> - </el-form-item></div></div> - </el-col> - <el-col :span="9"> - <div id="dta" style="font-size: 15px;"> - <div> - <el-form-item label="娴佺▼鍗″彿" :required="true" style="width: 14vw"> - <el-input autocomplete="off" /> - </el-form-item></div></div> - </el-col> - </el-row> - <el-row style="margin-top: 10px;"> - <el-col :span="6"> - <div id="dt" style="font-size: 15px;"> - <div> - <el-form-item label="鍏朵粬锛�" :required="true" style="width: 13.2vw;margin-left: 14px;"> - <el-input autocomplete="off" /> - </el-form-item></div></div> - </el-col> - </el-row> - </el-form> - </el-form> - </div> - <template #footer> - <div id="dialog-footer"> - <el-button type="primary" @click="dialogFormVisible = false"> - 纭 - </el-button> - <el-button @click="dialogFormVisible = false">鍙栨秷</el-button> - </div> - </template> - </el-dialog> - <el-dialog v-model="dialogFormVisiblea" top="21vh" width="40%" title="鍘熺墖淇℃伅"> - <el-table height="100%" ref="table" :data="tableDataa" @row-click="handle"> - <el-table-column - prop="long" - align="center" - label="闀�" - min-width="120" - /> - <el-table-column - prop="wide" - align="center" - label="瀹�" - min-width="120" - /> - <el-table-column - prop="thick" - align="center" - label="鍘�" - min-width="120" - /> - <el-table-column - prop="station" - align="center" - label="宸ヤ綅" - min-width="120" - /> - </el-table> - <div style="text-align: center; height: 22px; margin-top: 30px;"> - <el-button @click="dialogFormVisiblea = false">鍏抽棴</el-button> - </div> - </el-dialog> + <div id="main-body"> + <router-view /> + </div> + <!-- </div> --> </template> <style scoped> - -#dt { display:block; float:left;line-height: 20px;margin-left: 100px;} -#dta { display:block; float:left;line-height: 20px;margin-left: 80%;} -#dialog-footer{ - text-align: center; - margin-top: -15px; +#main-div{ + width: 100%; + height: 100%; } -#message{ - text-align: center; - align-items: center; - color: black; - width: 200px; - height: 100px; - background-color: #337ecc; - margin-left: 28%; +#div-title{ + height: 2%; + width: 100%; } -#box{ - position: relative; - - #icon{ - position: absolute; - bottom:10px; - right: 19px; - } +#searchButton{ + margin-top: -5px; + margin-left: 1rem; +} +/* #searchButton1{ +//margin-left: 10rem; +} */ +/*main-body鏍峰紡*/ +#main-body{ + width: 100%; + height: 95%; + /* margin-top: 1%; */ +} +#select{ + margin-left:0.5rem; +} +:deep(.indexTag .el-breadcrumb__inner){ + color: #5CADFE !important; } </style> \ No newline at end of file diff --git a/UI-Project/src/views/StockBasicData/stockBasicData.vue b/UI-Project/src/views/StockBasicData/stockBasicData.vue index efba1a1..cdeb549 100644 --- a/UI-Project/src/views/StockBasicData/stockBasicData.vue +++ b/UI-Project/src/views/StockBasicData/stockBasicData.vue @@ -13,9 +13,13 @@ const tableData = ref([]) const slot = ref('') - +const requestData = { + line: 2001 +}; +request.post("/cacheGlass/taskCache/selectEdgTask",{ + ...requestData, -request.post("/cacheGlass/taskCache/selectEdgTask").then((res) => { +}).then((res) => { if (res.code == 200) { console.log(res.data); @@ -26,36 +30,11 @@ } }); - -// const getTableRow = (row,type) =>{ -// switch (type) { -// case 'delete':{ -// let flowData = ref({ -// id:0, -// slot:row.slot -// }) -// request.post("/cacheGlass/edgStorageCage/edgStorageCageGlass",flowData.value).then((res) => { -// if(res.code==200){ -// ElMessage.success(t('searchOrder.msgDeleteSuccess')) -// router.push({path:'/main/delivery/selectDelivery',query:{random:Math.random()}}) -// }else{ -// ElMessage.warning(res.msg) -// router.push("/login") -// } -// }) - -// return -// } -// } -// } -// let slots = ref({ -// id:0, -// slot: slot.value -// }) -const open = async(row) => { +// 鐮存崯 + const open = async(row) => { try { const confirmResult = await ElMessageBox.confirm( - '鏄惁鍒犻櫎璇ユ潯淇℃伅?', + '鏄惁鐮存崯璇ユ潯淇℃伅?', '鎻愮ず', { confirmButtonText: '鏄�', @@ -65,16 +44,16 @@ ); if (confirmResult === 'confirm') { // 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛 - const deleteResponse = await request.post("/cacheGlass/edgStorageCage/edgStorageCageGlass", { - id:0, - slot: row.slot + const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { + glassId: row.GlassId, + controlsId: 300 }) - if (response.code == 200) { - // 鍒犻櫎鎴愬姛锛屾偍鍙互鏍规嵁闇�瑕佸鐞嗘垚鍔熺殑鎯呭喌 - alert('鍒犻櫎鎴愬姛锛�'); + if (response.code === 200) { + ElMessage.success(response.message); } else { // 鍒犻櫎澶辫触锛屾偍鍙互澶勭悊閿欒鎴栨樉绀洪敊璇俊鎭粰鐢ㄦ埛 - alert('鍒犻櫎澶辫触锛�' + deleteResponse.message); + ElMessage.error(response.msg); + // alert('鍒犻櫎澶辫触锛�' + deleteResponse.message); } } } catch (error) { @@ -82,56 +61,37 @@ console.error('鍙戠敓閿欒:', error); } }; -// const open = () => { -// ElMessageBox.confirm( -// '鏄惁鍒犻櫎璇ユ潯淇℃伅?', -// '鎻愮ず', -// { -// confirmButtonText: '鏄�', -// cancelButtonText: '鍙栨秷', -// type: 'warning', -// } -// ) -// .then(() => { -// ElMessage({ -// type: 'success', -// message: '鍒犻櫎鎴愬姛锛�', -// }) -// }) -// .catch(() => { -// ElMessage({ -// type: 'info', -// message: '鍒犻櫎澶辫触', -// }) -// }) -// } -// 鍒犻櫎 -// const handleBindRacka = (row) => { -// adda.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗� -// }; -// // 鍒犻櫎 -// const handleConfirma = async () => { -// try { -// window.localStorage.setItem('slot', res.data.slot) -// let slot = window.localStorage.getItem('slot') -// const response = await request.post('/cacheGlass/edgStorageCage/edgStorageCageGlass', { -// slot: slot.value, -// id: 0 -// }); - -// if (response.code == 200) { -// // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫 -// ElMessage.success(response.message); -// adda.value = false; -// } else { -// // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭� -// ElMessage.error(response.msg); -// } -// } catch (error) { -// // 澶勭悊閿欒 -// console.error(error); -// } -// }; +// 鎷胯蛋 + const opena = async(row) => { + try { + const confirmResult = await ElMessageBox.confirm( + '鏄惁鎷胯蛋璇ユ潯淇℃伅?', + '鎻愮ず', + { + confirmButtonText: '鏄�', + cancelButtonText: '鍙栨秷', + type: 'warning', + } + ); + if (confirmResult === 'confirm') { + // 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛 + const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { + glassId: row.GlassId, + controlsId: 301 + }) + if (response.code === 200) { + ElMessage.success(response.message); + } else { + // 鍒犻櫎澶辫触锛屾偍鍙互澶勭悊閿欒鎴栨樉绀洪敊璇俊鎭粰鐢ㄦ埛 + ElMessage.error(response.msg); + // alert('鍒犻櫎澶辫触锛�' + deleteResponse.message); + } + } + } catch (error) { + // 澶勭悊鍙兘鍑虹幇鐨勯敊璇紝姣斿 ElMessageBox 鎶涘嚭鐨勫紓甯哥瓑 + console.error('鍙戠敓閿欒:', error); + } +}; const gridOptions = reactive({ border: "full",//琛ㄦ牸鍔犺竟妗� @@ -171,9 +131,6 @@ ] }) - - - </script> <template> @@ -183,28 +140,17 @@ <el-table height="240" ref="table" @selection-change="handleSelectionChange" :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> - <el-table-column prop="slot" align="center" label="id" min-width="80" /> - <el-table-column prop="glass_id" align="center" label="闀�" min-width="80" /> - <el-table-column prop="width" align="center" label="瀹�" min-width="120" /> - <el-table-column prop="height" align="center" label="鍘氬害" min-width="120" /> - <el-table-column prop="height" align="center" label="鑶滅郴" min-width="120" /> - <el-table-column prop="height" align="center" label="鍑虹墖椤哄簭" min-width="120" /> - <el-table-column prop="height" align="center" label="娴佺▼鍗″彿" min-width="120" /> - <el-table-column prop="height" align="center" label="鍏朵粬" min-width="120" /> - <el-table-column - align="center" - label="鍚敤鐘舵��" - min-width="80" - prop="enable_state" - > - <template #default="scope"> - <el-tag type="success" >{{ scope.row.enable_state==1?"鍚敤":"鏈惎鐢�" }}</el-tag> - </template> - </el-table-column> + <el-table-column prop="GlassId" align="center" label="鐜荤拑id" min-width="180" /> + <el-table-column prop="Height" align="center" label="楂�" min-width="80" /> + <el-table-column prop="Width" align="center" label="瀹�" min-width="120" /> + <el-table-column prop="Thickness" align="center" label="鍘氬害" min-width="120" /> + <el-table-column prop="FilmsId" align="center" label="鑶滅郴" min-width="120" /> + <el-table-column prop="SerialNumber" align="center" label="鍑虹墖椤哄簭" min-width="120" /> + <el-table-column prop="FlowCardId" align="center" label="娴佺▼鍗″彿" min-width="120" /> <el-table-column fixed="right" label="鎿嶄綔" align="center" width="200"> <template #default="scope"> - <el-button size="mini" type="text" plain @click="open(scope.row)">鐮存崯</el-button> - <el-button size="mini" type="text" plain @click="open(scope.row)">鍒犻櫎</el-button> + <el-button size="mini" type="text" plain @click="open(scope.row)">鐮存崯</el-button> + <el-button size="mini" type="text" plain @click="opena(scope.row)">鎷胯蛋</el-button> </template> </el-table-column> </el-table> diff --git a/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue b/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue new file mode 100644 index 0000000..da758c0 --- /dev/null +++ b/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue @@ -0,0 +1,183 @@ +<script setup> +import {Search} from "@element-plus/icons-vue"; +import {reactive} from "vue"; +import {useRouter} from "vue-router" +const router = useRouter() +const adda = ref(false) + +import request from "@/utils/request" +import { ref, onMounted } from "vue"; +// import { ref } from 'vue' +import { ElMessage, ElMessageBox } from 'element-plus' +// import LanguageMixin from './lang/LanguageMixin' + +const tableData = ref([]) +const slot = ref('') +const requestData = { + line: 2002 +}; +request.post("/cacheGlass/taskCache/selectEdgTask",{ + ...requestData, + +}).then((res) => { + if (res.code == 200) { + + console.log(res.data); + tableData.value = res.data + console.log(res.data[0].slot); + } else { + ElMessage.warning(res.msg) + + } + }); +// 鐮存崯 + const open = async(row) => { + try { + const confirmResult = await ElMessageBox.confirm( + '鏄惁鐮存崯璇ユ潯淇℃伅?', + '鎻愮ず', + { + confirmButtonText: '鏄�', + cancelButtonText: '鍙栨秷', + type: 'warning', + } + ); + if (confirmResult === 'confirm') { + // 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛 + const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { + glassId: row.GlassId, + controlsId: 300 + }) + if (response.code === 200) { + ElMessage.success(response.message); + } else { + // 鍒犻櫎澶辫触锛屾偍鍙互澶勭悊閿欒鎴栨樉绀洪敊璇俊鎭粰鐢ㄦ埛 + ElMessage.error(response.msg); + // alert('鍒犻櫎澶辫触锛�' + deleteResponse.message); + } + } + } catch (error) { + // 澶勭悊鍙兘鍑虹幇鐨勯敊璇紝姣斿 ElMessageBox 鎶涘嚭鐨勫紓甯哥瓑 + console.error('鍙戠敓閿欒:', error); + } +}; +// 鎷胯蛋 + const opena = async(row) => { + try { + const confirmResult = await ElMessageBox.confirm( + '鏄惁鎷胯蛋璇ユ潯淇℃伅?', + '鎻愮ず', + { + confirmButtonText: '鏄�', + cancelButtonText: '鍙栨秷', + type: 'warning', + } + ); + if (confirmResult === 'confirm') { + // 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛 + const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { + glassId: row.GlassId, + controlsId: 301 + }) + if (response.code === 200) { + ElMessage.success(response.message); + } else { + // 鍒犻櫎澶辫触锛屾偍鍙互澶勭悊閿欒鎴栨樉绀洪敊璇俊鎭粰鐢ㄦ埛 + ElMessage.error(response.msg); + // alert('鍒犻櫎澶辫触锛�' + deleteResponse.message); + } + } + } catch (error) { + // 澶勭悊鍙兘鍑虹幇鐨勯敊璇紝姣斿 ElMessageBox 鎶涘嚭鐨勫紓甯哥瓑 + console.error('鍙戠敓閿欒:', error); + } +}; + +const gridOptions = reactive({ + border: "full",//琛ㄦ牸鍔犺竟妗� + keepSource: true,//淇濇寔婧愭暟鎹� + align: 'center',//鏂囧瓧灞呬腑 + stripe:true,//鏂戦┈绾� + rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒 + id: 'OrderList', + showFooter: true,//鏄剧ず鑴� + printConfig: {}, + importConfig: {}, + exportConfig: {}, + scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔� + showOverflow:true, + columnConfig: { + resizable: true, + useKey: true + }, + filterConfig: { //绛涢�夐厤缃」 + remote: true + }, + customConfig: { + storage: true + }, + editConfig: { + trigger: 'click', + mode: 'row', + showStatus: true + }, + data: [ + { + 'id': '1', + 'long': '5', + 'wide': '1005', + 'thick': '183.6', + } + ] + +}) +</script> + +<template> + <div> + <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> + <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> + <el-table height="240" ref="table" + @selection-change="handleSelectionChange" + :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> + <el-table-column prop="GlassId" align="center" label="鐜荤拑id" min-width="180" /> + <el-table-column prop="Height" align="center" label="楂�" min-width="80" /> + <el-table-column prop="Width" align="center" label="瀹�" min-width="120" /> + <el-table-column prop="Thickness" align="center" label="鍘氬害" min-width="120" /> + <el-table-column prop="FilmsId" align="center" label="鑶滅郴" min-width="120" /> + <el-table-column prop="SerialNumber" align="center" label="鍑虹墖椤哄簭" min-width="120" /> + <el-table-column prop="FlowCardId" align="center" label="娴佺▼鍗″彿" min-width="120" /> + <el-table-column fixed="right" label="鎿嶄綔" align="center" width="200"> + <template #default="scope"> + <el-button size="mini" type="text" plain @click="open(scope.row)">鐮存崯</el-button> + <el-button size="mini" type="text" plain @click="opena(scope.row)">鎷胯蛋</el-button> + </template> + </el-table-column> + </el-table> + </div> + </el-card> + </div> +</template> + +<style scoped> + +#dt { display:block; float:left;line-height: 20px;margin-left: 100px;} +#dta { display:block; float:left;line-height: 20px;margin-left: 80%;} +#dialog-footer{ + text-align: center; + margin-top: -15px; +} +#message{ + text-align: center; + align-items: center; + color: black; + width: 200px; + height: 100px; + background-color: #337ecc; + margin-left: 28%; +} +#awatch{ + height: 460px; + /* margin-top: -60px; */ +} +</style> \ No newline at end of file diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterInfo.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterInfo.java index 38155f0..313adc2 100644 --- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterInfo.java +++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterInfo.java @@ -105,7 +105,7 @@ if (addressLength < 2) { return null; } - int wordindex = index; + int wordindex = Integer.parseInt(stringdatas[1]) + index; return stringdatas[0] + "." + wordindex; /* if (addressLength == 2) { diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/engineering/controller/EngineeringController.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/engineering/controller/EngineeringController.java index 97571fa..7400f9f 100644 --- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/engineering/controller/EngineeringController.java +++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/engineering/controller/EngineeringController.java @@ -2,6 +2,8 @@ import com.mes.engineering.entity.Engineering; +import com.mes.uppattenusage.entity.UpPattenUsage; +import com.mes.uppattenusage.service.UpPattenUsageService; import com.mes.utils.Result; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -25,14 +27,17 @@ public class EngineeringController { @Autowired private EngineeringService engineeringService; + @Autowired + private UpPattenUsageService upPattenUsageService; @ApiOperation("寮�濮�/鏆傚仠浠诲姟/浼犻�掑伐绋嬪彿鍜岀姸鎬�,寮�濮嬫槸1 鏆傚仠鏄�0") @PostMapping("/changeTask") //璋冪敤涓婄墖浠诲姟 @ResponseBody - public Result <Boolean> changeTask(@RequestBody Engineering engineering) { + public Result <List<UpPattenUsage>> changeTask(@RequestBody Engineering engineering) { boolean work=engineeringService.changeTask(engineering.getEngineerId(),engineering.getState()); + List<UpPattenUsage> glass = upPattenUsageService.prioritylist(); log.info("StartorStop:{},{}", work,engineering); - return Result.build(200, engineering.getEngineerId(),work); + return Result.build(200, engineering.getEngineerId(),glass); } @ApiOperation("鏌ヨ鍙互涓婄墖鐨勫伐绋嬪彿") diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java index 6f81e0a..dd4950e 100644 --- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java +++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java @@ -62,8 +62,8 @@ List<GlassInfo> glassinfo=glassInfoService.selectGlassInfo(engineering.getEngineerId()); glassInfoService.saveGlassInfo(glassinfo); log.info("浠嶱P琛ㄦ煡璇ngineering鐨勬暟鎹苟淇濆瓨鍒拌〃閲�"); - List<Engineering> listengineering= engineeringService.selectEngineering(engineering.getEngineerId()); - engineeringService.saveEngineering(listengineering); + List<Engineering> listEngineering= engineeringService.selectEngineering(engineering.getEngineerId()); + engineeringService.saveEngineering(listEngineering); log.info("鏇存敼pp琛ㄧ姸鎬佷负宸查鍙�"); optimizeProjectService.changeTask(engineering.getEngineerId(), 200); // List<UpPattenUsage> data=upPattenUsageService.prioritylist(); 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 1e046b5..c65bd69 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 @@ -67,6 +67,7 @@ .eq(SysUser::getId, user.getId()) .like(StringUtils.isNotBlank(request.getKey()), SysMenu::getMenuName, request.getKey()); + // List<SysMenu> menuList = sysUserRoleMapper.selectJoinList(SysMenu.class, wrapper); return create(menuList); } diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/S7object.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/S7object.java index de9760b..f13c19b 100644 --- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/S7object.java +++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/S7object.java @@ -6,7 +6,6 @@ import com.mes.tools.S7control; - /** * @Author : zhoush * @Date: 2024/4/9 15:13 @@ -25,10 +24,9 @@ private S7object() { if (plccontrol == null) { plccontrol = new S7control(plcType, ip, port, 0, 0); - - String PlcCacheGlass=S7object.class.getResource("/JsonFile/PlcCacheGlass.json").getPath(); - //log.info(PLCAutoMes.class.getResource("").getPath()); - PlcMesObject = InitUtil.initword(PlcCacheGlass); + String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcCacheGlass.json"; +// String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheGlass.json").getPath(); + PlcMesObject = InitUtil.initword(PlcLoadGlass); } } @@ -54,7 +52,7 @@ e.printStackTrace(); } - byte[] getplcvlues= plccontrol.ReadByte(PlcMesObject.getPlcAddressBegin(),PlcMesObject.getPlcAddressLength()); + byte[] getplcvlues = plccontrol.ReadByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength()); PlcMesObject.setPlcParameterList(getplcvlues); } diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageServiceImpl.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageServiceImpl.java index c61632d..d42a54f 100644 --- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageServiceImpl.java +++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageServiceImpl.java @@ -1,5 +1,6 @@ package com.mes.edgstoragecage.service.impl; +import cn.hutool.core.collection.CollectionUtil; import com.github.yulichang.base.MPJBaseServiceImpl; import com.github.yulichang.toolkit.JoinWrappers; import com.github.yulichang.wrapper.MPJLambdaWrapper; @@ -37,14 +38,18 @@ @Override public EdgStorageCage selectNearestEmpty(int currentSlot) { - return this.selectJoinOne(EdgStorageCage.class, new MPJLambdaWrapper<EdgStorageCage>() + List<EdgStorageCage> emptyList = this.selectJoinList(EdgStorageCage.class, new MPJLambdaWrapper<EdgStorageCage>() .selectAll(EdgStorageCage.class) .leftJoin(EdgStorageCageDetails.class, on -> on .eq(EdgStorageCageDetails::getSlot, EdgStorageCage::getSlot) .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)) .isNull(EdgStorageCageDetails::getSlot) - .last("order by abs(t.slot - " + currentSlot + ") asc limit 1") + .last("order by abs(t.slot - " + currentSlot + ") asc limit 2") ); + if (CollectionUtil.isEmpty(emptyList) || emptyList.size() < 2) { + return null; + } + return emptyList.get(0); } /** 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 cd299b7..e91f0d9 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 @@ -7,6 +7,7 @@ import com.github.yulichang.query.MPJQueryWrapper; import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.mes.common.S7object; +import com.mes.common.WebSocketServer; import com.mes.common.config.Const; import com.mes.device.PlcParameterObject; import com.mes.edgglasstask.entity.EdgGlassTaskInfo; @@ -51,6 +52,9 @@ @Autowired EdgGlassTaskInfoService edgGlassTaskInfoService; + + @Autowired + WebSocketServer webServerService; @Value("${mes.threshold}") private int threshold; @@ -111,6 +115,27 @@ inTo(glassIdeValue, confirmationWrodAddress, currentSlot); } } + } + + public void plcToHomeEdgTask() { + // log.info("鎺ㄦ暟鎹�"); + // jsonObject.append("params", new short[] { 30, 40, }); +// ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home"); +// if (sendwServer != null) { +// for (WebSocketServer webserver : sendwServer) { +// webserver.sendMessage(jsonObject.toString()); +// if (webserver != null) { +// +// List<String> messages = webserver.getMessages(); +// +// if (!messages.isEmpty()) { +// // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛� +// webserver.clearMessages(); +// } +// } +// +// } +// } } /** @@ -191,7 +216,7 @@ } EdgStorageCageDetails a09EdgGlass = queryGlassByTaskCache(Const.A09_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT); EdgStorageCageDetails a10EdgGlass = queryGlassByTaskCache(Const.A10_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT); - endcell = queryLineByGlassInfo(a09EdgGlass, a10EdgGlass, glassInfo, out08Glassstate, out08Glassstate); + endcell = queryLineByGlassInfo(a09EdgGlass, a10EdgGlass, glassInfo, out08Glassstate, out10Glassstate); } else { //鍒ゆ柇涓ゆ潯绾挎槸鍚﹂兘绌洪棽 endcell = out08Glassstate == 1 ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; @@ -233,8 +258,12 @@ //鑾峰彇绗煎唴鎵�鏈夌幓鐠冧俊鎭紝鍖呮嫭寰呰繘鐗囩殑 List<EdgStorageCageDetails> glassList = queryEdgAllGlass(glassId); Assert.isTrue(CollectionUtil.isNotEmpty(glassList), "绗煎唴鍜屽緟杩涚墖閮芥病鏈夌幓鐠�"); - int othercell = endcell == Const.A10_OUT_TARGET_POSITION ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; - glassInfo = queryChangeGlassInfo(othercell, glassId); + if (glassList.size() == 1 && glassId.equals(glassList.get(0).getGlassId())) { + glassInfo = glassList.get(0); + } else { + int othercell = endcell == Const.A10_OUT_TARGET_POSITION ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; + glassInfo = queryChangeGlassInfo(othercell, glassId); + } } } } @@ -249,11 +278,13 @@ private List<EdgStorageCageDetails> queryEdgAllGlass(String glassId) { List<EdgStorageCageDetails> glassList = new ArrayList<>(); //鑾峰彇寰呰繘鐗囩幓鐠� - GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() - .eq(GlassInfo::getGlassId, glassId)); - EdgStorageCageDetails resultDetails = new EdgStorageCageDetails(); - BeanUtils.copyProperties(one, resultDetails); - glassList.add(resultDetails); + if (StringUtils.isNotBlank(glassId)) { + GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() + .eq(GlassInfo::getGlassId, glassId)); + EdgStorageCageDetails resultDetails = new EdgStorageCageDetails(); + BeanUtils.copyProperties(one, resultDetails); + glassList.add(resultDetails); + } //鑾峰彇绗煎唴鐜荤拑 List<EdgStorageCageDetails> details = edgStorageCageDetailsService.list(new LambdaQueryWrapper<EdgStorageCageDetails>() .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); @@ -399,9 +430,13 @@ MPJLambdaWrapper<EdgStorageCageDetails> wrapper = new MPJLambdaWrapper<>(); wrapper.select(EdgStorageCageDetails::getWidth, EdgStorageCageDetails::getHeight) .selectCount(EdgStorageCageDetails::getGlassId, EdgStorageCageDetails::getCount) + .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) .groupBy(EdgStorageCageDetails::getWidth, EdgStorageCageDetails::getHeight) .last("order by count(t.glass_id) desc limit 2"); List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper); + if (CollectionUtil.isEmpty(list)) { + return null; + } log.info("鑾峰彇绗煎瓙鍐呮暟閲忓墠浜岀殑鐜荤拑鏁伴噺锛歿}", list); //鑾峰彇瀹介珮鎷嶇涓�鐨勭幓鐠冧俊鎭� EdgStorageCageDetails firstSize = list.get(0); @@ -526,7 +561,7 @@ private boolean saveGlassSize(EdgStorageCageDetails glassInfo) { EdgGlassTaskInfo edgGlassTaskInfo = new EdgGlassTaskInfo(); BeanUtils.copyProperties(glassInfo, edgGlassTaskInfo); - edgGlassTaskInfo.setHeight((int) (glassInfo.getEdgHeight() * ratio)); + edgGlassTaskInfo.setHeight((int) (glassInfo.getHeight() * ratio)); edgGlassTaskInfo.setWidth((int) (glassInfo.getWidth() * ratio)); edgGlassTaskInfo.setThickness((int) (glassInfo.getThickness() * ratio)); edgGlassTaskInfo.setStatus(Const.EDG_GLASS_BEFORE); diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml index 39ff0e5..a344abc 100644 --- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml +++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml @@ -14,4 +14,4 @@ threshold: 3 ratio: 10 sequence: - order: true + order: false diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageController.java index 2564546..a81873e 100644 --- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageController.java +++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageController.java @@ -2,6 +2,7 @@ import com.mes.bigstorage.entity.BigStorageCage; import com.mes.bigstorage.service.BigStorageCageService; +import com.mes.utils.Result; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -27,17 +28,10 @@ @Autowired private BigStorageCageService bigStorageCageService; - //todo: 瀹炰緥浠g爜 寰呭垹闄� - @ApiOperation("娴嬭瘯") - @GetMapping("/index") - public String index() { - return "hello world"; - } - - @ApiOperation("鐞嗙墖绗间俊鎭�") + @ApiOperation("鏌ヨ鐞嗙墖绗间俊鎭�") @GetMapping("/bigStorageCage") - public List<BigStorageCage> querybigStorageCageDetail() { - return bigStorageCageService.querybigStorageCageDetail(); + public Result querybigStorageCageDetail() { + return Result.build(200,"鏌ヨ鎴愬姛",bigStorageCageService.querybigStorageCageDetail()); } } 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 2b003c0..5d3bc0b 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 @@ -3,6 +3,7 @@ import com.mes.bigstorage.entity.BigStorageCageDetails; import com.mes.bigstorage.service.BigStorageCageDetailsService; +import com.mes.utils.Result; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -29,11 +30,25 @@ private BigStorageCageDetailsService bigStorageCageDetailsService; @ApiOperation("鐞嗙墖绗艰鎯�") - @PostMapping("/bigStorageCageDetails") - public List<BigStorageCageDetails> bigStorageCageDetails() { - return bigStorageCageDetailsService.list(); + @PostMapping("/queryBigStorageCageDetails") + public Result queryBigStorageCageDetails() { + return Result.build(200,"鏌ヨ鎴愬姛",bigStorageCageDetailsService.list()); + } + + @ApiOperation("鐞嗙墖绗艰鎯呮坊鍔�") + @PostMapping("/insertBigStorageCageDetails") + public Result insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { + bigStorageCageDetailsService.save(bigStorageCageDetails); + return Result.build(200,"娣诲姞鎴愬姛",1); } + @ApiOperation("鐞嗙墖绗艰鎯呭垹闄�") + @PostMapping("/deleteBigStorageCageDetails") + public Result deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { + bigStorageCageDetailsService.removeById(bigStorageCageDetails.getId()); + return Result.build(200,"鍒犻櫎鎴愬姛",1); + + } } diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java index 102ff13..785ef2f 100644 --- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java +++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java @@ -24,9 +24,7 @@ private S7object() { if (plccontrol == null) { plccontrol = new S7control(plcType, ip, port, 0, 0); - - String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheVerticalGlass.json").getPath(); - //log.info(PLCAutoMes.class.getResource("").getPath()); + String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcCacheVerticalGlass.json"; PlcMesObject = InitUtil.initword(PlcLoadGlass); } } diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java index 43dcc90..c38d086 100644 --- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java +++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java @@ -2,9 +2,10 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; + +import java.io.Serializable; /** * <p> @@ -54,7 +55,7 @@ /** * 鑶滅郴 */ - private Integer filmsid; + private String filmsid; /** * 纾ㄥ墠瀹� diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java index 3178446..5418041 100644 --- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java +++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java @@ -1,9 +1,21 @@ package com.mes.temperingglass.controller; +import com.mes.bigstorage.entity.BigStorageCage; +import com.mes.bigstorage.service.BigStorageCageService; +import com.mes.temperingglass.entity.TemperingGlassInfo; +import com.mes.temperingglass.service.TemperingGlassInfoService; +import com.mes.utils.Result; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + +import java.util.List; /** * <p> @@ -13,9 +25,25 @@ * @author zhoush * @since 2024-03-27 */ +@Api(description = "閽㈠寲灏忕墖琛ㄤ俊鎭�") @RestController @RequestMapping("/temperingGlassInfo") public class TemperingGlassInfoController { + @Autowired + private TemperingGlassInfoService temperingGlassInfoService; + + @ApiOperation("閽㈠寲灏忕墖淇℃伅") + @GetMapping("/queryTemperingGlassInfo") + public Result queryTemperingGlassInfo() { + return Result.build(200,"鏌ヨ鎴愬姛",temperingGlassInfoService.list()); + } + + @ApiOperation("鎵嬪姩娣诲姞鍑虹墖浠诲姟") + @PostMapping("/insertTemperingGlassInfo") + public Result insertBigStorageCageDetail(TemperingGlassInfo temperingGlassInfo) { + temperingGlassInfoService.save(temperingGlassInfo); + return Result.build(200,"娣诲姞鎴愬姛",1); + } } diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java index d25f5ea..ed8f92d 100644 --- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java +++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java @@ -13,8 +13,8 @@ */ public class S7object extends Thread { public S7control plccontrol; // PLC閫氳绫诲疄渚� - private EPlcType plcType = EPlcType.S1200; // 瑗块棬瀛怭LC绫诲瀷 - private String ip = "192.168.10.1"; // plc ip鍦板潃 + private EPlcType plcType = EPlcType.S200_SMART; // 瑗块棬瀛怭LC绫诲瀷 + private String ip = "192.168.10.100"; // plc ip鍦板潃 private int port = 102; // plc 绔彛鍙� @@ -24,9 +24,7 @@ private S7object() { if (plccontrol == null) { plccontrol = new S7control(plcType, ip, port, 0, 0); - - String PlcLoadGlass = S7object.class.getResource("/JsonFile/PlcLoadGlass.json").getPath(); - //log.info(PLCAutoMes.class.getResource("").getPath()); + String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcLoadGlass.json"; PlcMesObject = InitUtil.initword(PlcLoadGlass); } } diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java index 984060f..f1907fe 100644 --- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java +++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java @@ -2,8 +2,6 @@ import com.mes.utils.Result; -import com.mes.workstation.entity.GlassInfo; -import com.mes.workstation.entity.UpWorkSequence; import com.mes.workstation.entity.UpWorkstation; import com.mes.workstation.service.UpWorkstationService; import io.swagger.annotations.ApiOperation; @@ -41,19 +39,21 @@ @ApiOperation("淇敼宸ヤ綅琛ㄥ鍔犵幓鐠冧俊鎭垨鑰呭垹闄ょ幓鐠冧俊鎭�,浼犻�扷pworkstation绫�,鍙慨鏀瑰楂樺帤鏁伴噺鑶滅郴") @PostMapping("/updateGlassMessage") @ResponseBody - public Result<UpWorkstation> updateGlassMessage(@RequestBody UpWorkstation upwork) { + public Result<List<UpWorkstation>> updateGlassMessage(@RequestBody UpWorkstation upwork) { upWorkstationService.updateGlassMessage(upwork); - return Result.build(200, "", upwork); + List<UpWorkstation> glass = upWorkstationService.list(); + return Result.build(200, "", glass); } -// @ApiOperation("寮�濮嬩笂鐗囦换鍔�") -// @PostMapping("/selectPriority") //璋冪敤涓婄墖浠诲姟 -// @ResponseBody -// public void selectPriority() { -// UpWorkSequence work=upWorkstationService.selectPriority(); -// log.info("鏄剧ず鍙笂鐨勭幓鐠冧俊鎭�:{}", work); -// -// } + + + @ApiOperation("淇敼涓婄墖mes鑱斿姩璇锋眰瀛�") + @PostMapping("/updateMesInkageLoad") + @ResponseBody + public Result<String> updateMesInkageLoad(@RequestBody short inKageWord) { + String result = upWorkstationService.updateMesInkageLoad(inKageWord); + return Result.success(result); + } } diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/LoadGlassMapper.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/LoadGlassMapper.java index aedecb4..93ba7fb 100644 --- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/LoadGlassMapper.java +++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/LoadGlassMapper.java @@ -11,7 +11,7 @@ public interface LoadGlassMapper extends BaseMapper<UpWorkstation> { //鍒ゆ柇浼樺厛宸ヤ綅鍚哥墖 @Select("select b.layout_sequence,a.number from up_workstation a left join up_patten_usage b " + - "on a.pattern_width=b.width and a.pattern_heigth=b.width " + + "on a.pattern_width=b.width and a.pattern_height=b.height " + "and a.pattern_thickness=b.thickness where a.workstation_id=#{id}") Map<String, Object> selectPriority(int id); diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java index 28547f4..bd2a6c8 100644 --- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java +++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java @@ -37,5 +37,6 @@ void updateGlassMessage(UpWorkstation upwork); + String updateMesInkageLoad(short inKageWord); } diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java index 3b8a57a..9949483 100644 --- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java +++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java @@ -3,10 +3,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mes.common.S7object; +import com.mes.device.PlcParameterObject; import com.mes.engineering.entity.Engineering; import com.mes.uppattenusage.entity.UpPattenUsage; import com.mes.uppattenusage.mapper.UpPattenUsageMapper; -import com.mes.workstation.entity.UpWorkSequence; import com.mes.workstation.entity.UpWorkstation; import com.mes.workstation.mapper.UpWorkstationMapper; import com.mes.workstation.service.UpWorkstationService; @@ -17,7 +18,7 @@ /** * <p> - * 鏈嶅姟瀹炵幇绫� + * 鏈嶅姟瀹炵幇绫� * </p> * * @author zhoush @@ -35,10 +36,11 @@ //鍒ゆ柇浼樺厛鍚哥墖浣嶇疆鍚庡彂閫佸嚭鐗囦换鍔� + @Override public UpPattenUsage selectPriority(Engineering engineering) { - QueryWrapper<UpPattenUsage> wrapper=new QueryWrapper<>(); + QueryWrapper<UpPattenUsage> wrapper = new QueryWrapper<>(); wrapper.eq("state", 0) - .eq("engineering_id",engineering.getEngineerId()) + .eq("engineering_id", engineering.getEngineerId()) .orderByAsc("layout_sequence") .last("limit 1"); return upPattenUsageMapper.selectOne(wrapper); @@ -64,7 +66,7 @@ wrapper.eq("id", upworkId) .setSql("number = number - 1"); boolean updateResult = upWorkstationMapper.update(null, wrapper) > 0; - log.info("鍑忓皯宸ヤ綅鏁伴噺{}",updateResult); + log.info("鍑忓皯宸ヤ綅鏁伴噺{}", updateResult); } @@ -74,10 +76,23 @@ @Override public void updateGlassMessage(UpWorkstation upwork) { UpdateWrapper<UpWorkstation> updateWrapper = new UpdateWrapper<>(); - updateWrapper.eq("workstation_id", upwork.getWorkstationId()); - int update = this.baseMapper.update(upwork, updateWrapper); + if (upwork.getWorkstationId() == 1 || upwork.getWorkstationId() == 3) { + updateWrapper.eq("workstation_id", upwork.getWorkstationId()); + int update = this.baseMapper.update(upwork, updateWrapper); + } else { + if (upwork.getPatternHeight() > 2700 || upwork.getPatternHeight() == 0) { + updateWrapper.eq("workstation_id", upwork.getWorkstationId()); + int update = this.baseMapper.update(upwork, updateWrapper); + } + } } + @Override + public String updateMesInkageLoad(short inKageWord) { + PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; + log.info("淇敼璁惧涓ゆ爧璇锋眰涓簕}锛�0鑱旂嚎锛�1鑱斿姩", inKageWord); + S7object.getinstance().plccontrol.WriteWord(plcParameterObject.getPlcParameter("InkageStatus").getAddress(), inKageWord); + return "success"; + } - -} +} \ No newline at end of file diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json index 1a32fde..d85b3d8 100644 --- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json +++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json @@ -1,6 +1,6 @@ { - "plcAddressBegin":"DB14.0", - "plcAddressLenght":"98", + "plcAddressBegin":"DB1.2000", + "plcAddressLenght":"100", "dataType":"word", "parameteInfor":[ { @@ -25,6 +25,13 @@ "unit":"" }, { + "codeId": "InkageStatus", + "addressIndex":"22", + "addressLenght":"2", + "ratio":"1", + "unit":"" + }, + { "codeId": "WorkId", "addressIndex":"24", "addressLenght":"2", diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/S7object.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/S7object.java index 7ec3d2e..92f56b5 100644 --- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/S7object.java +++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/S7object.java @@ -24,9 +24,7 @@ private S7object() { if (plccontrol == null) { plccontrol = new S7control(plcType, ip, port, 0, 0); - - String PlcCacheGlass=S7object.class.getResource("/JsonFile/PlcdownGlass.json").getPath(); - //log.info(PLCAutoMes.class.getResource("").getPath()); + String PlcCacheGlass = System.getProperty("user.dir") + "/JsonFile/PlcdownGlass.json"; PlcMesObject = InitUtil.initword(PlcCacheGlass); } } -- Gitblit v1.8.0