UI-Project/src/lang/zh.js
@@ -104,7 +104,8 @@ }, order:{ dilapidation:'破损', Takeaway:'人工拿走', takeaway:'人工拿走', takeon:'摆片完成', }, searchOrder:{ cageinformation:'理片笼信息', @@ -263,6 +264,8 @@ height:'高', thickness:'厚', glasstakeout:'玻璃拿走清单', layoutID:'版图ID', glassID:'玻璃ID', }, reportWork:{ lowerbit:'下片位', @@ -455,6 +458,10 @@ projectnumber: '工程号', right: '正常', stop: '终止', inquire: '查询', starttime :'开始时间', endtime :'结束时间', loading :'正在上片:', }, reportmanage:{ productiontime :'生产时间', UI-Project/src/main.js
@@ -23,7 +23,7 @@ app.use(VXETable) app.use(pinia) app.use(router) app.use(ElementPlus) // app.use(ElementPlus) app.use(ElementPlus,{ locale: zhCn, }) UI-Project/src/views/Identify/identify.vue
@@ -11,8 +11,8 @@ @current-change="handleCurrentChange" /> </div> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> <el-scrollbar height="550px" width="1200px" style="background-color: #e9e9eb;"> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading"> <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;"> <div style="position: relative;"> <div v-for="(rect, index) in adjustedRects" @@ -35,12 +35,12 @@ </div> </el-scrollbar> <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> <el-button :disabled="currentGlassRect?.glass_state === 8" type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> {{ $t('order.dilapidation') }} </el-button> <el-button type="danger" plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;"> <el-button :disabled="currentGlassRect?.glass_state === 9" type="danger" plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;"> <el-icon class="el-icon--right"><Upload /></el-icon> {{ $t('order.Takeaway') }}</el-button> {{ $t('order.takeaway') }}</el-button> </el-dialog> </el-card> </template> @@ -60,6 +60,7 @@ const glass_id = ref(); const inputValue = ref(''); const currentGlassId = ref(null); // 存储当前点击矩形的 glass_id const currentstate = ref(null); const adjustedRects = ref([]); const raw = ref([]); let webSocket: WebSocket | null = null; @@ -68,12 +69,15 @@ const currentPage = ref(1); const disabled = false; const size = 'small'; const rawData = ref([]); const rawData = ref([]); // const handleBind = (row) => { // blind.value = true; // 打开绑定架子对话框 // }; // 显示对话框并设置当前 glass_id function showDialog(glassId: number) { const currentGlassRect = computed(() => { return adjustedRects.value.find(rect => rect.glass_id === currentGlassId.value); }); function showDialog(glassId: number) { currentGlassId.value = glassId; blind.value = true; adjustedRects.value = adjustedRects.value.map(rect => @@ -103,7 +107,7 @@ // window.location.reload() blind.value = false; updateRectStatus(currentGlassId.value, 8); } else { } else { // 请求失败,显示错误消息 ElMessage.error(response.msg); } @@ -131,7 +135,7 @@ // window.location.reload() blind.value = false; updateRectStatus(currentGlassId.value, 9); } else { } else { // 请求失败,显示错误消息 ElMessage.error(response.msg); } @@ -146,20 +150,19 @@ var url="/cacheGlass/taskCache/cutTerritory?current="+inputValue.value; const response = await request.post(url) if (response.code === 200) { console.log(response.data); const rawRects = response.data[0]; rawData.value = response.data; totalPages.value = rawData.value.length; const scaleFactor = 1621.78/6000; const scaleFactory = 750/3300; adjustedRects.value = rawRects.map(rect => ({ ...rect, x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor, y_axis: rect.y_axis * 0.17, y_axis: rect.y_axis * scaleFactory, width: rect.width * scaleFactor , widtha: rect.width , heighta: rect.height , height: rect.height * 0.165 , height: rect.height * scaleFactory, glass_state: rect.glass_state })); // 如果WebSocket已连接,则关闭 @@ -177,36 +180,35 @@ currentPage.value = val; const page = currentPage.value - 1 const scaleFactor = 1621.78/6000; const scaleFactory = 750/3300; adjustedRects.value = rawData.value[page]?.map(rect => ({ // adjustedRects.value = rawRects.map(rect => ({ ...rect, x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor, y_axis: rect.y_axis * 0.17, y_axis: rect.y_axis * scaleFactory, width: rect.width * scaleFactor , widtha: rect.width , heighta: rect.height , height: rect.height * 0.165 , height: rect.height * scaleFactory, glass_state: rect.glass_state })); })); }; function getRectColor(state: number): string { switch (state) { case 0: return '#e1f3d8'; case 100: return '#c8c9cc'; case 110: return '#b3e19d'; case 120: return '#f89898'; case 8: return '#911005'; case 9: return '#f3d19e'; // default: // return '#911005'; // 默认颜色 } } function getRectColor(state: number): string { switch (state) { case 0: return '#e1f3d8'; case 100: return '#c8c9cc'; case 110: return '#b3e19d'; case 120: return '#f89898'; case 8: return '#911005'; case 9: return '#f3d19e'; } } // 更新矩形状态 function updateRectStatus(glassId: string, status: number) { adjustedRects.value.forEach(rect => { @@ -215,50 +217,25 @@ } }); } // const connectWebSocket = () => { // if (!webSocket) { // const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; // webSocket = new WebSocket(socketUrl); // webSocket.onmessage = (event) => { // const data = JSON.parse(event.data); // const scaleFactor = 1621.78/6000; // adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ // ...rect, // x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor, // y_axis: rect.y_axis * 0.17, // width: rect.width * scaleFactor , // widtha: rect.width , // heighta: rect.height , // height: rect.height * 0.165 , // glass_state: rect.glass_state, // isActive: false // })); // }; // webSocket.onerror = (error) => { // console.error('WebSocket Error:', error); // }; // webSocket.onclose = () => { // console.log('WebSocket Connection Closed'); // // 可以选择重新连接 // }; // } // }; const connectWebSocket = () => { if (!webSocket) { const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; webSocket = new WebSocket(socketUrl); webSocket.onmessage = (event) => { const data = JSON.parse(event.data); const scaleFactor = 1621.78 / 6000; const scaleFactor = 1621.78/6000; const scaleFactory = 750/3300; if (data.currentCutTerritory && data.currentCutTerritory.length > 0) { const newRects = data.currentCutTerritory[0].map(rect => { const existingRect = adjustedRects.value.find(r => r.glass_id === rect.glass_id); if (existingRect) { return { ...existingRect, x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor, y_axis: rect.y_axis * 0.17, y_axis: rect.y_axis * scaleFactory, width: rect.width * scaleFactor, height: rect.height * 0.165, height: rect.height * scaleFactory, widtha: rect.width, heighta: rect.height, glass_state: rect.glass_state, @@ -269,9 +246,9 @@ return { ...rect, x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor, y_axis: rect.y_axis * 0.17, y_axis: rect.y_axis * scaleFactory, width: rect.width * scaleFactor, height: rect.height * 0.165, height: rect.height * scaleFactory, widtha: rect.width, heighta: rect.height, glass_state: rect.glass_state, @@ -281,10 +258,12 @@ } }); adjustedRects.value = newRects; } else if (data.currentCutTerritory == '') { adjustedRects.value = []; } }; } }; onMounted(() => { // 初始时,如果输入框为空,则连接WebSocket if (!inputValue.value) { UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -1,5 +1,5 @@ <script setup> import {Search} from "@element-plus/icons-vue"; <script setup lang="ts"> import {Search ,Delete, Upload,Edit} from "@element-plus/icons-vue"; import {reactive} from "vue"; import request from "@/utils/request" import { ref, onMounted, onBeforeUnmount,nextTick } from 'vue'; @@ -21,6 +21,15 @@ const dialogVisible = ref(false) const width = ref(); const height = ref(); const currentRect = ref(null); const canSelectProject1 = ref(true); const canSelectProject2 = ref(true); const canSelectProjecta = ref(true); const cantakea = ref(true); const cantakeb = ref(true); const canona = ref(true); const canonb = ref(true); const canSelectProjectb = ref(true); const adjustedRects1 = ref([]); const adjustedRects2 = ref([]); const adjustedRectsa = ref([]); @@ -85,9 +94,16 @@ }; const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; const handleMessage = (data) => { // 进炉中右 if (data.intoGlass2 && data.intoGlass2.length > 0) { // 提取新的矩形ID const newGlassIds = new Set(data.intoGlass2[0].map(rect => rect.glassId)); // 过滤出已存在的矩形 const existingRects = adjustedRects2.value.filter(rect => newGlassIds.has(rect.glassId)); // 计算新的矩形 const newRects = data.intoGlass2[0].map(rect => { const scaleFactor = 794.67/5087; const scaleFactorY = 430/2800; let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; let newX = rect.yCoordinate; if (rect.width < rect.height) { @@ -99,13 +115,13 @@ } if (rect.angle === 0) { adjustedWidth = widtha * scaleFactor; adjustedHeight = heighta * 0.1; adjustedHeight = heighta * scaleFactorY; // adjustedWidtha = widtha; // adjustedHeighta = heighta; newX = 5087 - (rect.yCoordinate + widtha); } else { adjustedWidth = heighta * scaleFactor; adjustedHeight = widtha * 0.1; adjustedHeight = widtha * scaleFactorY; // adjustedWidtha = widtha; // adjustedHeighta = heighta; newX = 5087 - (rect.yCoordinate + heighta); @@ -113,25 +129,32 @@ return { ...rect, xcoordinate: newX * scaleFactor, ycoordinate: rect.xCoordinate * 0.1, ycoordinate: rect.xCoordinate * scaleFactorY, width: adjustedWidth, height: adjustedHeight, widtha: rect.width, heighta: rect.height, } }); // 合并新旧矩形,保留 isActive 状态 adjustedRects2.value = adjustedRects2.value.map(oldRect => { }); // 合并新旧矩形,并保留 isActive 状态 adjustedRects2.value = existingRects.map(oldRect => { const newRect = newRects.find(r => r.glassId === oldRect.glassId); if (newRect) { return { ...oldRect, ...newRect, isActive: oldRect.isActive }; } return oldRect; // 如果旧矩形在新数据中不存在,则保留原样 }).concat(newRects.filter(r => !adjustedRects2.value.some(o => o.glassId === r.glassId))); return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); } else if (data.intoGlass2 == null) { adjustedRects2.value = [] } // 进炉中左 if (data.intoGlass && data.intoGlass.length > 0) { const newGlassIds = new Set(data.intoGlass[0].map(rect => rect.glassId)); const existingRects = adjustedRects1.value.filter(rect => newGlassIds.has(rect.glassId)); const newRects = data.intoGlass[0].map(rect => { const scaleFactor = 794.67/5087; const scaleFactor = 810.89/5087; const scaleFactorY = 430/2800; let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; let newX = rect.yCoordinate; if (rect.width < rect.height) { @@ -143,13 +166,13 @@ } if (rect.angle === 0) { adjustedWidth = widtha * scaleFactor; adjustedHeight = heighta * 0.1; adjustedHeight = heighta * scaleFactorY; // adjustedWidtha = widtha; // adjustedHeighta = heighta; newX = 5087 - (rect.yCoordinate + widtha); } else { adjustedWidth = heighta * scaleFactor; adjustedHeight = widtha * 0.1; adjustedHeight = widtha * scaleFactorY; // adjustedWidtha = widtha; // adjustedHeighta = heighta; newX = 5087 - (rect.yCoordinate + heighta); @@ -157,26 +180,32 @@ return { ...rect, xcoordinate: newX * scaleFactor, ycoordinate: rect.xCoordinate * 0.1, ycoordinate: rect.xCoordinate * scaleFactorY, width: adjustedWidth, height: adjustedHeight, widtha: rect.width, heighta: rect.height, } }); // 合并新旧矩形,保留 isActive 状态 adjustedRects1.value = adjustedRects1.value.map(oldRect => { }); // 合并新旧矩形,并保留 isActive 状态 adjustedRects1.value = existingRects.map(oldRect => { const newRect = newRects.find(r => r.glassId === oldRect.glassId); if (newRect) { return { ...oldRect, ...newRect, isActive: oldRect.isActive }; } return oldRect; // 如果旧矩形在新数据中不存在,则保留原样 }).concat(newRects.filter(r => !adjustedRects1.value.some(o => o.glassId === r.glassId))); return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); } else if (data.overGlass == null) { adjustedRects1.value = [] } if (data.waitingGlass && data.waitingGlass.length > 0) { const newGlassIds = new Set(data.waitingGlass[0].map(rect => rect.glassId)); const existingRects = adjustedRectsa.value.filter(rect => newGlassIds.has(rect.glassId)); const newRects = data.waitingGlass[0].map(rect => { const scaleFactor = 1621.78/5190; let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; const scaleFactor = 1390/5190; const scaleFactorY = 750/2800; let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; let newX = rect.yCoordinate; if (rect.width < rect.height) { widtha = rect.height; @@ -187,13 +216,13 @@ } if (rect.angle === 0) { adjustedWidth = widtha * scaleFactor; adjustedHeight = heighta * 0.16; adjustedHeight = heighta * scaleFactorY; // adjustedWidtha = widtha; // adjustedHeighta = heighta; newX = 5190 - (rect.yCoordinate + widtha); } else { adjustedWidth = heighta * scaleFactor; adjustedHeight = widtha * 0.16; adjustedHeight = widtha * scaleFactorY; // adjustedWidtha = widtha; // adjustedHeighta = heighta; newX = 5190 - (rect.yCoordinate + heighta); @@ -201,26 +230,34 @@ return { ...rect, x: newX * scaleFactor, y: rect.xCoordinate * 0.16, y: rect.xCoordinate * scaleFactorY, width: adjustedWidth, height: adjustedHeight, widtha: rect.width, heighta: rect.height, } }); // 合并新旧矩形,保留 isActive 状态 adjustedRectsa.value = adjustedRectsa.value.map(oldRect => { }); // 合并新旧矩形,并保留 isActive 状态 adjustedRectsa.value = existingRects.map(oldRect => { const newRect = newRects.find(r => r.glassId === oldRect.glassId); if (newRect) { return { ...oldRect, ...newRect, isActive: oldRect.isActive }; } return oldRect; // 如果旧矩形在新数据中不存在,则保留原样 }).concat(newRects.filter(r => !adjustedRectsa.value.some(o => o.glassId === r.glassId))); return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); } else if (data.waitingGlass == null) { adjustedRectsa.value = [] } if (data.outGlass && data.outGlass.length > 0) { // 提取新的矩形ID const newGlassIds = new Set(data.outGlass[0].map(rect => rect.glassId)); // 过滤出已存在的矩形 const existingRects = adjustedRectsb.value.filter(rect => newGlassIds.has(rect.glassId)); // 计算新的矩形 const newRects = data.outGlass[0].map(rect => { const scaleFactor = 1621.78/5190; const scaleFactory = 550/2800; const scaleFactor = 1390/5190; const scaleFactory = 750/2800; let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta,newY; let newX = rect.yCoordinate; if (rect.width < rect.height) { @@ -254,37 +291,92 @@ widtha: rect.width, heighta: rect.height, } }); // 合并新旧矩形,保留 isActive 状态 adjustedRectsb.value = adjustedRectsb.value.map(oldRect => { }); // 合并新旧矩形,并保留 isActive 状态 adjustedRectsb.value = existingRects.map(oldRect => { const newRect = newRects.find(r => r.glassId === oldRect.glassId); if (newRect) { return { ...oldRect, ...newRect, isActive: oldRect.isActive }; } return oldRect; // 如果旧矩形在新数据中不存在,则保留原样 }).concat(newRects.filter(r => !adjustedRectsb.value.some(o => o.glassId === r.glassId))); return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); } else if (data.outGlass == null) { adjustedRectsb.value = [] } }; onMounted(() => { initializeWebSocket(socketUrl, handleMessage); }); function updateRectColors() { function updateRectColorsa() { adjustedRectsa.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 5; rect.state = 8; } }); } function updateoutColorsa() { adjustedRectsa.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 9; } }); } function updateonColorsa() { adjustedRectsa.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 1; } }); } function updateRectColorsb() { adjustedRectsb.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 8; } }); } function updateoutColorsb() { adjustedRectsb.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 9; } }); } function updateonColorsb() { adjustedRectsb.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 3; } }); } function updateRectColors1() { adjustedRects1.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 8; } }); } function updateRectColors2() { adjustedRects2.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 8; } }); } function getRectColora(state) { switch (state) { case 0: return '#7AC5CD'; case 1: return '#7AC5CD'; case 1: return '#95d475'; case -1: return '#CDAF95'; case 5: return '#911005'; case -1: return '#CDAF95'; case 8: return '#911005'; case 9: return '#4682B4'; } } function getRectColorb(state) { @@ -293,8 +385,10 @@ return '#eebe77'; case 4: return '#CD6090'; case 5: return '#911005'; case 8: return '#911005'; case 9: return '#4682B4'; } } function showDialog1(rect) { @@ -305,6 +399,12 @@ currentGlassId.value = rect.glassId; currenttemperingFeedSequence.value = rect.temperingFeedSequence; blind1.value = true; currentRect.value = rect; if (currentRect.value.state == 8) { canSelectProject1.value = false; } else if (currentRect.value.state !== 8) { canSelectProject1.value = true; } } function showDialog2(rect) { const index = adjustedRects2.value.findIndex(r => r.glassId === rect.glassId); @@ -314,6 +414,12 @@ currentGlassId.value = rect.glassId; currenttemperingFeedSequence.value = rect.temperingFeedSequence; blind2.value = true; currentRect.value = rect; if (currentRect.value.state == 8) { canSelectProject2.value = false; } else if (currentRect.value.state !== 8) { canSelectProject2.value = true; } } function showDialoga(rect) { const index = adjustedRectsa.value.findIndex(r => r.glassId === rect.glassId); @@ -322,7 +428,23 @@ } currentGlassId.value = rect.glassId; currenttemperingFeedSequence.value = rect.temperingFeedSequence; blinda.value = true; blinda.value = true; currentRect.value = rect; if (currentRect.value.state == 8) { canSelectProjecta.value = false; } else if (currentRect.value.state !== 8) { canSelectProjecta.value = true; } if (currentRect.value.state == 9) { cantakea.value = false; } else if (currentRect.value.state !== 9) { cantakea.value = true; } if (currentRect.value.state == 1) { canona.value = false; } else if (currentRect.value.state == 0) { canona.value = true; } } function showDialogb(rect) { const index = adjustedRectsb.value.findIndex(r => r.glassId === rect.glassId); @@ -332,6 +454,22 @@ currentGlassId.value = rect.glassId; currenttemperingFeedSequence.value = rect.temperingFeedSequence; blindb.value = true; currentRect.value = rect; if (currentRect.value.state == 8) { canSelectProjectb.value = false; } else if (currentRect.value.state !== 8) { canSelectProjectb.value = true; } if (currentRect.value.state == 9) { cantakeb.value = false; } else if (currentRect.value.state !== 9) { cantakeb.value = true; } if (currentRect.value.state == 3) { canonb.value = false; } else if (currentRect.value.state !== 3) { canonb.value = true; } } const handleDialogClose1 = () => { adjustedRects1.value.forEach(rect => { @@ -364,13 +502,13 @@ glassId: currentGlassId.value, // temperingFeedSequence: currenttemperingFeedSequence.value, line: 4001, status: 2, status: 8, workingProcedure: '钢化', }) if (response.code == 200) { ElMessage.success(response.message); ElMessage.success('成功!'); blind1.value = false; updateRectColors(); updateRectColors1(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); @@ -385,15 +523,14 @@ try { const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { glassId: currentGlassId.value, // temperingFeedSequence: currenttemperingFeedSequence.value, line: 4001, status: 2, status: 8, workingProcedure: '钢化', }) if (response.code == 200) { ElMessage.success(response.message); ElMessage.success('成功!'); blind2.value = false; updateRectColors(); updateRectColors2(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); @@ -404,19 +541,19 @@ console.error(error); } } // 进炉前破损 const handleDamagea = async () => { try { const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { glassId: currentGlassId.value, // temperingFeedSequence: currenttemperingFeedSequence.value, line: 4001, status: 2, status: 8, workingProcedure: '钢化', }) if (response.code == 200) { ElMessage.success(response.message); ElMessage.success('成功!'); blinda.value = false; updateRectColors(); updateRectColorsa(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); @@ -427,19 +564,19 @@ console.error(error); } } const handleDamageb = async () => { // 进炉前人工拿走 const takeouta = async () => { try { const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { glassId: currentGlassId.value, // temperingFeedSequence: currenttemperingFeedSequence.value, line: 4001, status: 2, status: 9, workingProcedure: '钢化', }) if (response.code == 200) { ElMessage.success(response.message); blindb.value = false; updateRectColors(); ElMessage.success('成功!'); blinda.value = false; updateoutColorsa(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); @@ -448,6 +585,98 @@ catch (error) { // 处理错误 console.error(error); } } // 进炉前放回 const takeona = async () => { try { const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { glassId: currentGlassId.value, line: 4001, status: 1, workingProcedure: '钢化', }) if (response.code == 200) { ElMessage.success('成功!'); blinda.value = false; updateonColorsa(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); } } catch (error) { // 处理错误 console.error(error); } } // 已出炉破损 const handleDamageb = async () => { try { const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { glassId: currentGlassId.value, line: 4001, status: 8, workingProcedure: '钢化', }) if (response.code == 200) { ElMessage.success('成功!'); blindb.value = false; updateRectColorsb(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); } } catch (error) { // 处理错误 // console.error(error); } } // 已出炉人工拿走 const takeoutb = async () => { try { const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { glassId: currentGlassId.value, line: 4001, status: 9, workingProcedure: '钢化', }) if (response.code == 200) { ElMessage.success('成功!'); blindb.value = false; updateoutColorsb(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); } } catch (error) { // 处理错误 // console.error(error); } } // 已出炉放回 const takeonb = async () => { try { const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { glassId: currentGlassId.value, line: 4001, status: 3, workingProcedure: '钢化', }) if (response.code == 200) { ElMessage.success('成功!'); blindb.value = false; updateonColorsb(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); } } catch (error) { // 处理错误 // console.error(error); } } onBeforeUnmount(() => { @@ -463,11 +692,11 @@ <el-button id="searchButton" type="info" @click="dialogFormVisiblec = true;dialogFormVisibleb = false;dialogFormVisible = false;dialogFormVisiblea = false">{{ $t('processCard.print') }}</el-button> <div v-if="dialogFormVisible" > <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> <div style="width: 49%;float: left;background-color: #f4f4f5;height: 550px;"> <div style="width: 50%;float: left;background-color: #f4f4f5;height: 430px;"> <div v-if="adjustedRects1.length > 0"> <!-- <div style="text-align: center;">炉号:{{ engineerIdDisplay }}-{{ adjustedRects[0].temperingLayoutId }}</div> --> <div style="text-align: center;"> 炉号:{{ adjustedRects1[0].engineerId }}-{{ adjustedRects1[0].temperingLayoutId }} </div> <el-scrollbar height="550px" style="background-color: #e9e9eb;"> <el-scrollbar height="430px" style="background-color: #e9e9eb;"> <div style="position: relative;max-width: 1400px;"> <div v-for="(rect, index) in adjustedRects1" @@ -479,23 +708,23 @@ left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`, backgroundColor: rect.isActive ? '#ADFF2F' : rect.state === 5 ? '#911005' : 'lightblue' }" backgroundColor: rect.isActive ? '#ADFF2F' : rect.state === 8 ? '#911005' : 'lightblue' }" > <div class="centered-text"> <div >{{ rect.glassId }}</div> <div >{{ rect.flowCardId }}</div> <div>{{ rect.widtha }}*{{ rect.heighta }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> </div> </div> </div> </el-scrollbar> </div> </div> <div style="width: 49%;float: right;background-color: #f4f4f5;height: 550px;"> <div style="width: 49%;float: right;background-color: #f4f4f5;height: 430px;"> <div v-if="adjustedRects2.length > 0"> <div style="text-align: center;"> 炉号:{{ adjustedRects2[0].engineerId }}-{{ adjustedRects2[0].temperingLayoutId }} </div> <!-- <div style="text-align: center;">炉号:{{ engineerIdDisplay2 }}-{{ adjustedRects[0].temperingLayoutId }}</div> --> <el-scrollbar height="550px" style="background-color: #e9e9eb;"> <el-scrollbar height="430px" style="background-color: #e9e9eb;"> <div style="position: relative;max-width: 1400px;"> <div v-for="(rect, index) in adjustedRects2" @@ -507,12 +736,12 @@ left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`, backgroundColor: rect.isActive ? '#ADFF2F' : rect.state === 5 ? '#911005' : 'lightblue' }" backgroundColor: rect.isActive ? '#ADFF2F' : rect.state === 8 ? '#911005' : 'lightblue' }" > <div class="centered-text"> <div >{{ rect.glassId }}</div> <div >{{ rect.flowCardId }}</div> <div>{{ rect.widtha }}*{{ rect.heighta }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> </div> </div> </div> @@ -523,11 +752,11 @@ </div> <div v-if="dialogFormVisiblea"> <!-- 进炉前 --> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading"> <div v-if="adjustedRectsa.length > 0"> <div style="text-align: center;"> 炉号:{{ adjustedRectsa[0].engineerId }}-{{ adjustedRectsa[0].temperingLayoutId }} </div> <!-- <div style="text-align: center;">炉号:{{ engineerIdDisplaya }}-{{ adjustedRects[0].temperingLayoutId }}</div> --> <el-scrollbar height="550px" style="background-color: #e9e9eb;"> <el-scrollbar height="750px" style="background-color: #e9e9eb;"> <div style="position: relative;max-width: 1400px;"> <div v-for="(rect, index) in adjustedRectsa" @@ -538,9 +767,9 @@ width: `${rect.width}px`, height: `${rect.height}px`, backgroundColor: rect.isActive ? '#ADFF2F' : getRectColora(rect.state) }"> <div class="centered-text"> <div>{{ rect.glassId }}</div> <div >{{ rect.flowCardId }}</div> <div>{{ rect.widtha }}*{{ rect.heighta }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> </div> </div> </div> @@ -550,11 +779,11 @@ </div> <div v-if="dialogFormVisibleb"> <!-- 已出炉 --> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading"> <div v-if="adjustedRectsb.length > 0"> <div style="text-align: center;"> 炉号:{{ adjustedRectsb[0].engineerId }}-{{ adjustedRectsb[0].temperingLayoutId }} </div> <!-- <div style="text-align: center;">炉号:{{ engineerIdDisplayb }}-{{ adjustedRects[0].temperingLayoutId }}</div> --> <el-scrollbar height="550px" style="background-color: #e9e9eb;"> <el-scrollbar height="750px" style="background-color: #e9e9eb;"> <div style="position: relative;max-width: 1400px;"> <div v-for="(rect, index) in adjustedRectsb" @@ -566,9 +795,9 @@ backgroundColor: rect.isActive ? '#ADFF2F' : getRectColorb(rect.state) }"> <!-- backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }"> --> <div class="centered-text"> <div >{{ rect.glassId }}</div> <div >{{ rect.flowCardId }}</div> <div>{{ rect.widtha }}*{{ rect.heighta }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> </div> </div> </div> @@ -578,49 +807,69 @@ </div> <div v-if="dialogFormVisiblec"> <!-- 打印 --> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading"> <div style="display: flex; flex-direction: row; align-items: center; margin-top: 5px;margin-left: 10px;"> <el-input :placeholder="$t('processCard.projectnumber')" v-model="engineerId" autocomplete="off" style="width: 300px;"/> <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('processCard.inquire') }}</el-button> <el-button type="info" style="margin-left: 10px;" @click="printing()">{{ $t('processCard.printing') }}</el-button> </div> <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;"> <el-table height="350" height="600" ref="table" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" :data="tableData" > <el-table-column prop="engineerId" :label="$t('processCard.project')" width="200" align="center"/> <el-table-column prop="workingProcedure" :label="$t('processCard.awayprocess')" align="center"/> <el-table-column prop="deviceName" :label="$t('processCard.awayequipment')" align="center"/> <el-table-column prop="teamsGroupsName" :label="$t('processCard.awayteam')" align="center"/> <el-table-column prop="temperingLayoutId" :label="$t('processCard.layoutID')" align="center"/> <el-table-column prop="temperingFeedSequence" :label="$t('processCard.temperingfeed')" align="center"/> <el-table-column prop="glassId" :label="$t('processCard.glassID')" align="center"/> <el-table-column prop="width" :label="$t('processCard.width')" align="center"/> <el-table-column prop="height" :label="$t('processCard.height')" align="center"/> <el-table-column prop="thickness" :label="$t('processCard.thickness')" align="center"/> </el-table> </div> </el-card> </el-card> </div> <!-- 进炉中 --> <el-dialog v-model="blind1" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose1"> <el-button type="warning" plain :icon="Delete" @click="handleDamage1" style="width: 140px;margin-left: 10px;"> <el-button :disabled="!canSelectProject1" type="warning" plain :icon="Delete" @click="handleDamage1" style="width: 150px;margin-left: 10px;"> {{ $t('order.dilapidation') }} </el-button> </el-dialog> <el-dialog v-model="blind2" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose2"> <el-button type="warning" plain :icon="Delete" @click="handleDamage2" style="width: 140px;margin-left: 10px;"> <el-button :disabled="!canSelectProject2" type="warning" plain :icon="Delete" @click="handleDamage2" style="width: 150px;margin-left: 10px;"> {{ $t('order.dilapidation') }} </el-button> </el-dialog> <!-- 进炉前 --> <el-dialog v-model="blinda" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClosea"> <el-button type="warning" plain :icon="Delete" @click="handleDamagea" style="width: 140px;margin-left: 10px;"> <el-button type="warning" plain :icon="Delete" @click="handleDamagea" :disabled="!canSelectProjecta" style="width: 150px;margin-left: 10px;"> {{ $t('order.dilapidation') }} </el-button> <el-button :disabled="!cantakea" type="danger" plain @click="takeouta" style="width: 150px;margin-left: 10px;margin-top: 10px;"> <el-icon class="el-icon--right"><Upload /></el-icon> {{ $t('order.takeaway') }} </el-button> <el-button type="success" plain :icon="Edit" @click="takeona" :disabled="!canona" style="width: 150px;margin-left: 10px;margin-top: 10px;"> {{ $t('order.takeon') }} </el-button> </el-dialog> <!-- 已出炉 --> <el-dialog v-model="blindb" top="30vh" width="15%" style="text-align: center;" @close="handleDialogCloseb"> <el-button type="warning" plain :icon="Delete" @click="handleDamageb" style="width: 140px;margin-left: 10px;"> <el-button :disabled="!canSelectProjectb" type="warning" plain :icon="Delete" @click="handleDamageb" style="width: 150px;margin-left: 10px;"> {{ $t('order.dilapidation') }} </el-button> <el-button :disabled="!cantakeb" type="danger" plain @click="takeoutb" style="width: 150px;margin-left: 10px;margin-top: 10px;"> <el-icon class="el-icon--right"><Upload /></el-icon> {{ $t('order.takeaway') }} </el-button> <!-- <el-button type="success" plain :icon="Edit" @click="takeonb" :disabled="!canonb" style="width: 150px;margin-left: 10px;margin-top: 10px;"> {{ $t('order.takeon') }} </el-button> --> </el-dialog> <el-dialog v-model="dialogVisible" @@ -671,7 +920,7 @@ border: 1px solid black; background-color: #337ecc; display:flex; align-items:center; align-items:center; justify-content:center; } #home-card { @@ -714,7 +963,7 @@ } .rect { border: 1px solid black; /* 设置矩形的边框 */ background-color: lightblue; /* 设置矩形的背景色 */ /* background-color: lightblue; 设置矩形的背景色 */ } #rect { position: relative; /* 确保箭头可以相对于矩形定位 */ UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
@@ -11,7 +11,8 @@ const adjustedRects = ref([]); const currentGlassId = ref(null); const currenttemperingFeedSequence = ref(null); const currentRect = ref(null); const canSelectProject = ref(true); const dialogFormVisible = ref(true) const dialogFormVisiblea = ref(false) const blind = ref(false) @@ -31,12 +32,18 @@ } let socket = null; const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; // 定义消息处理函数,更新 receivedData 变量 const handleMessage = (data) => { // 更新 tableData 的数据 if(data.overGlass!=null){ adjustedRects.value = data.overGlass[0].map(rect => { const scaleFactor = 1621.78/5190; const handleMessage = (data) => { if (data.overGlass && data.overGlass.length > 0) { // 提取新的矩形ID const newGlassIds = new Set(data.overGlass[0].map(rect => rect.glassId)); // 过滤出已存在的矩形 const existingRects = adjustedRects.value.filter(rect => newGlassIds.has(rect.glassId)); // 计算新的矩形 const newRects = data.overGlass[0].map(rect => { const scaleFactor = 1390/5190; const scaleFactorY = 750/2800; let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta; let newX = rect.yCoordinate; @@ -49,91 +56,35 @@ } if (rect.angle === 0) { adjustedWidth = widtha * scaleFactor; adjustedHeight = heighta * 0.16; // adjustedWidtha = widtha; // adjustedHeighta = heighta; // newX = 5190 - (rect.yCoordinate + rect.width); adjustedHeight = heighta * scaleFactorY; } else { adjustedWidth = heighta * scaleFactor; adjustedHeight = widtha * 0.16; // adjustedWidtha = heighta; // adjustedHeighta = widtha; // newX = 5190 - (rect.yCoordinate + rect.height); adjustedHeight = widtha * scaleFactorY; } return { ...rect, xcoordinate: newX * scaleFactor, ycoordinate: rect.xCoordinate * 0.16, ycoordinate: rect.xCoordinate * scaleFactorY, width: adjustedWidth, height: adjustedHeight, widtha: rect.width, heighta: rect.height, // isActive: false, }; }); } }); // 合并新旧矩形,并保留 isActive 状态 adjustedRects.value = existingRects.map(oldRect => { const newRect = newRects.find(r => r.glassId === oldRect.glassId); if (newRect) { return { ...oldRect, ...newRect, isActive: oldRect.isActive }; } return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); } else if (data.overGlass == null) { adjustedRects.value = [] } }; // const handleMessage = (data) => { // // 假设 data.overGlass[0] 是矩形数组 // const newRects = data.overGlass[0].map(newRect => ({ // ...newRect, // const scaleFactor = 1621.78 / 5190; // let widtha, heighta, adjustedWidth, adjustedHeight; // // 交换宽度和高度(如果矩形是“横向”的) // if (rect.width < rect.height) { // widtha = rect.height; // heighta = rect.width; // } else { // widtha = rect.width; // heighta = rect.height; // } // // 根据角度调整宽度和高度 // if (rect.angle === 0) { // adjustedWidth = widtha * scaleFactor; // adjustedHeight = heighta * 0.16; // } else { // adjustedWidth = heighta * scaleFactor; // adjustedHeight = widtha * 0.16; // } // // 注意:这里可能需要重新考虑 newX 的计算方式 // // 暂时保留为原始 yCoordinate 的处理,但通常 x 坐标不应来自 y 坐标 // let newX = rect.yCoordinate; // 可能是个错误,除非有特定用途 // // 返回新的矩形对象 // return { // ...rect, // 复制原始矩形的所有属性 // xcoordinate: newX * scaleFactor, // 注意:这里的 newX 可能需要调整 // ycoordinate: rect.xCoordinate * 0.16, // width: adjustedWidth, // height: adjustedHeight, // widtha, // heighta, // isActive: false, // 默认为非激活状态 // // 可以添加其他需要的属性 // } // })); // 使用新数据更新 adjustedRects // 注意:这里我们假设 adjustedRects.value 中的矩形也有 id 属性 // adjustedRects.value = adjustedRects.value.map(oldRect => { // const updatedRect = newRects.find(newRect => newRect.id === oldRect.id); // if (updatedRect) { // // 如果找到了对应的矩形,则合并属性和保留原始激活状态(如果需要的话) // // 但在这个例子中,我们总是将 isActive 设置为 false // return { // ...oldRect, // ...updatedRect, // 合并新矩形的属性,但会覆盖 isActive // isActive: false, // 总是设置为 false,除非您有更复杂的逻辑 // }; // } // // 如果没有找到对应的矩形,则保留原样 // return oldRect; // }).concat(newRects.filter(newRect => !adjustedRects.value.some(oldRect => oldRect.id === newRect.id))); // // concat 用于添加那些在 adjustedRects.value 中不存在的新矩形 // }; function updateRectColors() { adjustedRects.value.forEach(rect => { if (rect.glassId === glassId) { @@ -151,17 +102,28 @@ return '#911005'; } } function showDialog(rect) { rect.isActive = true; function showDialog(rect) { const index = adjustedRects.value.findIndex(r => r.glassId === rect.glassId); if (index !== -1) { adjustedRects.value[index].isActive = true; } currentGlassId.value = rect.glassId; currenttemperingFeedSequence.value = rect.temperingFeedSequence; blind.value = true; blind.value = true; currentRect.value = rect; if (currentRect.value.state == 8) { canSelectProject.value = false; } else if (currentRect.value.state !== 8) { canSelectProject.value = true; } } const handleDialogClose = () => { adjustedRects.value.forEach(rect => { rect.isActive = false; // 关闭对话框时重置所有矩形的 isActive 状态 rect.isActive = false; }); }; blind.value = false; }; // 破损 const handleDamage = async () => { try { @@ -203,11 +165,11 @@ <template> <div style="margin-top: 10px;"> <div> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading"> <!-- <el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> --> <div v-if="adjustedRects.length > 0"> <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> <el-scrollbar height="550px" width="1200px" style="background-color: #e9e9eb;"> <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;"> <div style="position: relative;"> <div v-for="(rect, index) in adjustedRects" @@ -219,10 +181,9 @@ backgroundColor: rect.isActive ? '#ADFF2F' : getRectColora(rect.state) }"> <div class="centered-text"> <div >{{ rect.glassId }}</div> <div >{{ rect.flowCardId }}</div> <div>{{ rect.widtha }}*{{ rect.heighta }}</div> <!-- <div style="margin-top: 25px;margin-left: -60px;">{{ rect.widtha }}*{{ rect.heighta }}</div> --> <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> </div> </div> </div> @@ -231,7 +192,7 @@ </el-card> </div> <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> <el-button type="warning" plain :icon="Delete" @click="handleDamage" style="width: 140px;margin-left: 10px;"> <el-button :disabled="!canSelectProject" type="warning" plain :icon="Delete" @click="handleDamage" style="width: 140px;margin-left: 10px;"> {{ $t('order.dilapidation') }} </el-button> </el-dialog> UI-Project/src/views/Returns/returns.vue
@@ -28,14 +28,13 @@ const filmsId = ref(''); const patternThickness = ref(''); const number = ref(''); const canSelectProject = ref(true); // 假设开始时可以选择项目 const canSelectProject = ref(true); const canStartLoading = ref(false); import { WebSocketHost ,host} from '@/utils/constants' import request from "@/utils/request" const ida = ref(null); import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; import { ref, onMounted, onUnmounted, onBeforeUnmount } from "vue"; // 响应式数据 const selectedProjectNo = ref(''); // 当前选中的工程号 const selectedProjectNoa = ref(''); // 当前选中的工程号 const selectedValue = ref(''); // 当前选中的宽 UI-Project/src/views/Slicecage/slicecage.vue
@@ -1239,7 +1239,7 @@ <el-table :data="paginatedUsers" @row-click="handleRowClick" height="500" height="700" @expand-change="handleExpandChange" row-key="id" default-expand-all @@ -1351,7 +1351,7 @@ <el-button style="margin-left: 10px;size: mini;" type="danger">停止</el-button> <el-button style="margin-left: 10px;size: mini;" type="primary">添加</el-button> </div> --> <el-table ref="table" style="margin-top: 20px;height: 500px;" <el-table ref="table" style="margin-top: 20px;height: 700px;" :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <!-- <el-table-column prop="id" fixed align="center" :label="$t('searchOrder.sheetID')" min-width="150"/> --> UI-Project/src/views/largescreen/largescreen.vue
@@ -1,30 +1,15 @@ <template> <el-card style="flex: 1;margin-left: 1px;margin-top: 10px;margin-right: 1px;" v-loading="loading"> <el-scrollbar height="800px"> <div id="top" style="height: 150px;display: flex;"> <div style="font-size: 20px;font-weight: bold;">{{ $t('large.loading') }}{{ temperingtotal }} </div> <div id="top" style="height: 150px;display: flex; justify-content: center; align-items: center;"> <div class="echarts-container"> <div v-for="(processData, index) in processesData" :key="index" class="echarts-item"> <div v-for="(processData, index) in processesData" :key="index" class="echarts-item" @click="showDialog"> <div :id="'pieChart_' + index" class="pie-chart"></div> </div> </div> </div> <div style="display: flex;"> <!-- <div id="centerleft" style="margin-top: 10px;height: 240px;width: 340px;background-color: #911005;"> <el-table height="240" ref="table" width="340px" @selection-change="handleSelectionChange" :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column fixed prop="orderId" align="center" :label="$t('large.number')" min-width="110" /> <el-table-column prop="project" align="center" :label="$t('large.projectname')" min-width="100" /> <el-table-column prop="responsibleProcess" align="center" :label="$t('large.responsibleprocess')" min-width="100" /> <el-table-column prop="breakageQuantity" align="center" :label="$t('large.numberfractions')" min-width="110" /> <el-table-column prop="patchProcesses" align="center" :label="$t('large.process')" min-width="100" /> <el-table-column fixed="right" :label="$t('large.operate')" align="center" width="100"> <template #default="scope"> <el-button size="mini" type="text" plain @click="handleBinda">{{ $t('large.mes') }}</el-button> </template> </el-table-column> </el-table> </div> --> <div class="parter" style="margin-top: 10px;margin-left: 150px; height: 240px;width: 1000px;"> <img src="../../assets/dpxsa.png" style="margin-left: -10px; width: 100%;height: 100%;" alt="Your Image"> <div class="moving-rect lipiana" v-show="woshia"></div> @@ -34,7 +19,6 @@ <div class="moving-rect overlaya" v-show="flake"></div> <div class="moving-rect overlayb" v-show="flakeb"></div> <div class="moving-rect overlayc" v-show="flakec"></div> <div class="moving-rect overlayd" v-show="flaked"></div> <div class="moving-rect longa" v-show="dalipiana"></div> <div class="moving-rect longb" v-show="dalipianb"></div> <div class="moving-rect shangpianji" v-show="shangpian"></div> @@ -48,7 +32,7 @@ </div> </div> <div id="bottom" style="margin-top: 10px;height: 190px;"> <el-table height="390" ref="table" <el-table height="350" ref="table" @selection-change="handleSelectionChange" :data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column prop="orderId" align="center" :label="$t('large.orderId')" min-width="50" /> @@ -79,7 +63,7 @@ </el-scrollbar> </el-card> <el-dialog v-model="blinda" top="5vh" width="85%"> <el-table height="400" ref="table" <el-table height="650" ref="table" @selection-change="handleSelectionChange" :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column prop="orderId" fixed align="center" :label="$t('large.orderId')" min-width="110" /> @@ -119,11 +103,23 @@ </div> </template> </el-dialog> <el-dialog v-model="blind" top="10vh" width="70%" > <el-date-picker style="margin-left: 1px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" :start-placeholder="$t('large.starttime')" :end-placeholder="$t('large.endtime')" :default-time="defaultTime" /> <el-button type="primary" style="margin-left: 10px;margin-top: -6px;" @click="selectReportData()">{{ $t('large.inquire') }}</el-button> <div style="height: 550px;display: flex;margin-top: 10px;justify-content: center; align-items: center;"> <div class="echarts-container"> <div v-for="(processData, index) in dialogprocesses" :key="index" class="echarts-item"> <div :id="'dialogPieChart_' + index" class="pie-chart"></div> </div> </div> </div> </el-dialog> </template> <script setup> import { Delete, Upload } from '@element-plus/icons-vue' import { ElMessage, ElMessageBox } from 'element-plus' import { ref, onMounted , onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect } from "vue"; import { ref, onMounted , onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect,nextTick } from "vue"; import request from "@/utils/request" import { WebSocketHost ,host} from '@/utils/constants' import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; @@ -135,10 +131,10 @@ const tableDatac = ref([]) const adjustedRects = ref([]); const chartRefs = ref([]); const timeRange = ref([]) const flake = ref(false) const flakeb = ref(false) const flakec = ref(false) const flaked = ref(false) const woshia = ref(false) const woshic = ref(false) const dalipiana = ref(false) @@ -151,7 +147,9 @@ const xiapian4 = ref(false) const xiapian5 = ref(false) const xiapian6 = ref(false) const blind = ref(false) const temperingtotal = ref(0) const thisProcess = ref(); // 用于存储process_id的响应式引用 // 定义一个响应式引用来存储图表实例 const chartDom = ref(null); @@ -162,6 +160,7 @@ await fetchFlowCardId(row.orderId); }; const processesData = ref([]); const dialogprocesses = ref([]); const fetchFlowCardId = async (orderId) => { try { const response = await request.post('/loadGlass/order/order/selectOrderdetail',{ @@ -213,6 +212,8 @@ tableDatac.value = data.orders[0] socket.onmessage = (event) => { const data = JSON.parse(event.data); console.log(data.device[0]); processesData.value = data.device[0].map(rect => ({ ...rect, completedQuantity: rect.completedQuantity, @@ -235,32 +236,29 @@ flake.value = tasks.some(task => task.state == 1); flakeb.value = tasks.some(task => task.state == 2); flakec.value = tasks.some(task => task.state == 3); flaked.value = tasks.some(task => task.state == 4); }; // 卧式理片 const socketUrl3 = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlassIsRun`; const handleMessage3 = (data) => { const tasks = data.taskCaches[0]; const tasks = data.taskCaches[0]; woshia.value = tasks.some(task => task.line == 2001); woshic.value = tasks.some(task => task.line == 2002); console.log(tasks); }; // 大理片笼 const socketUrl4 = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/isRun`; const handleMessage4 = (data) => { const tasks = data.bigStorageCageDetailsOutTask[0]; const taskss = data.bigStorageCageDetailsFeedTask[0]; const tasks = data.bigStorageCageDetailsOutTask[0]; dalipiana.value = tasks.some(task => task.slot !== null && task.slot !== undefined); const taskss = data.bigStorageCageDetailsFeedTask[0]; dalipianb.value = taskss.some(task => task.slot !== null && task.slot !== undefined); }; // 上片 const socketUrl5 = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlassIsRun`; const handleMessage5 = (data) => { if(data.engineering.length !==0 ){ shangpian.value = true; } }; const tasks = data.engineering; shangpian.value = tasks.some(task => task.state == 1); temperingtotal.value = data.engineering[0].engineerId }; // 下片 const socketUrl6 = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unLoadGlassIsRun`; const handleMessage6 = (data) => { @@ -314,7 +312,49 @@ } ] }; chart.setOption(options); }); }; const renderPieCharts1 = () => { dialogprocesses.value.forEach((data, index) => { const chart = echarts.init(document.getElementById('dialogPieChart_' + index)); const options = { title: { text: `${data.thisProcess} `, left: 'center', }, tooltip: { trigger: 'item', }, series: [ { name: `${data.thisProcess} `, type: 'pie', radius: ['40%', '70%'], avoidLabelOverlap: false, data: [ { value: data.completedQuantity, name: t('large.completedquantity') }, { value: data.breakageQuantity, name: t('large.scrapquantity') } ], emphasis: { itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } }, label: { show: false, position: 'center', }, labelLine: { show: false }, } ] }; chart.setOption(options); }); }; @@ -355,8 +395,34 @@ closeWebSocket5(); closeWebSocket6(); }); </script> function showDialog() { blind.value = true; } // 查询数据 const selectReportData = async () => { const response = await request.post("/loadGlass/reporting_work/reporting-work/selectDamage", { reportingWorkTime: timeRange.value[0], reportingWorkTime2: timeRange.value[1], }) if (response.code === 200) { console.log(response.data); dialogprocesses.value = response.data.map(rect => ({ ...rect, completedQuantity: rect.completedQuantity, breakageQuantity: rect.breakageQuantity, thisProcess: rect.thisProcess, })); await nextTick(); renderPieCharts1(); ElMessage.success(response.message); } else { ElMessage.error(response.message); } }; </script> <style scoped> .echarts-container { display: flex; @@ -458,7 +524,7 @@ top: 9px; left: 200px; transform: translateX(-50%); animation: move-xiapianji 6s infinite; animation: move-xiapianji 15s infinite; } @keyframes move-xiapianji { 0% { @@ -475,7 +541,7 @@ top: 190px; right: 530px; transform: translateX(-50%); animation: move-lipiana 6s infinite; animation: move-lipiana 15s infinite; } @keyframes move-lipiana { 0% { @@ -492,7 +558,7 @@ top: 160px; left: 502px; transform: translateX(-50%); animation: move-lipianb 6s infinite; animation: move-lipianb 15s infinite; } @keyframes move-lipianb { 0% { @@ -509,7 +575,7 @@ top: 215px; right: 490px; transform: translateX(-50%); animation: move-lipianc 6s infinite; animation: move-lipianc 15s infinite; } @keyframes move-lipianc { 0% { @@ -526,7 +592,7 @@ top: 160px; left: 555px; transform: translateX(-50%); animation: move-lipiand 6s infinite; animation: move-lipiand 15s infinite; } @keyframes move-lipiand { 0% { @@ -543,7 +609,7 @@ top: 213px; right: 800px; transform: translateX(-50%); animation: move-overlaya 6s infinite; animation: move-overlaya 15s infinite; } @keyframes move-overlaya { 0% { @@ -560,7 +626,7 @@ top: 110px; left: 13px; transform: translateX(-50%); animation: move-overlayb 6s infinite; animation: move-overlayb 15s infinite; } @keyframes move-overlayb { 0% { @@ -577,7 +643,7 @@ top: 7px; left: 13px; transform: translateX(-50%); animation: move-overlayc 6s infinite; animation: move-overlayc 15s infinite; } @keyframes move-overlayc { 0% { @@ -594,7 +660,7 @@ top: 157px; right: 90px; transform: translateX(-50%); animation: move-shangpianji 6s infinite; animation: move-shangpianji 15s infinite; } @keyframes move-shangpianji { 0% { hangzhoumesParent/JsonFile/PlcCacheVerticalGlass.json
@@ -4,7 +4,7 @@ "dataType": "word", "parameteInfor": [{ "codeId": "D01ID", "addressIndex": "0", "addressIndex": "32", "addressLenght": "32", "ratio": "1", "unit": "" hangzhoumesParent/common/servicebase/src/main/java/com/mes/damage/controller/DamageController.java
@@ -66,7 +66,7 @@ @ApiOperation("拿走数据查询") @PostMapping("/selectDamagePrint") public Result selectDamagePrint(@RequestBody Damage damage) { List<Damage> damage2=damageService.selectDamagePrint(damage); List<DamagePrint> damage2=damageService.selectDamagePrint(damage); return Result.build(200,"查询成功",damage2); } @ApiOperation("拿走打印查询") hangzhoumesParent/common/servicebase/src/main/java/com/mes/damage/service/DamageService.java
@@ -36,7 +36,7 @@ */ void batchInsertDamage(List<Damage> damageList); List<Damage> selectDamagePrint(Damage damage); List<DamagePrint> selectDamagePrint(Damage damage); List<DamagePrint> selectDamagePrintDetails(Damage damage); } hangzhoumesParent/common/servicebase/src/main/java/com/mes/damage/service/impl/DamageServiceImpl.java
@@ -145,20 +145,25 @@ } this.saveBatch(damageList); } /** * 拿走打印数据查询 */ @Override public List<Damage> selectDamagePrint(Damage damage) { QueryWrapper<Damage> wrapper = new QueryWrapper<>(); wrapper.select("working_procedure,engineer_id,teams_groups_name,device_name,count(glass_id)as glass_id") .eq("type",damage.getType()) .eq("working_procedure",damage.getWorkingProcedure()) .groupBy("working_procedure,engineer_id,teams_groups_name,device_name"); if (damage.getEngineerId() != null) { wrapper.eq("engineer_id", damage.getEngineerId()); } return this.list(wrapper); public List<DamagePrint> selectDamagePrint(Damage damage) { MPJQueryWrapper<Damage> listDamage=new MPJQueryWrapper<Damage>() .select("t.engineer_id,t.glass_id,b.tempering_layout_id,b.tempering_feed_sequence,b.width,b.height,b.thickness") .leftJoin("glass_info as b on t.glass_id=b.glass_id") .eq("t.working_procedure",damage.getWorkingProcedure()) .eq("t.type",damage.getType()); // 动态添加条件,当 id 有值时 if (damage.getEngineerId() != null) { listDamage.eq("t.engineer_id", damage.getEngineerId()); } return damageMapper.selectJoinList(DamagePrint.class,listDamage); } /** * 拿走打印打印详情查询 */ @Override public List<DamagePrint> selectDamagePrintDetails(Damage damage) { List<DamagePrint> listDamage=damageMapper.selectJoinList(DamagePrint.class,new MPJQueryWrapper<Damage>() hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/entity/Orderdetail.java
@@ -28,6 +28,14 @@ private String project; /** * 流程卡号 */ private String processId; /** * 订单序号 */ private String orderNumber; /** * 产品名称 */ private String productName; @@ -35,30 +43,40 @@ /** * 宽 */ private String width; private double width; /** * 高 */ private String height; private double height; /** * 面积 */ private double area; /** * 包装方式 * 数量 */ private Integer quantity; /** * 状态 * 补片数量 */ private String processingNote; private Integer numberPatches; /** * 送货时间 * 已入数量 */ private String deliveryDate; private Integer receivedQuantity; /** * 生产状态 */ private Integer terminationStatus; /** * 包装方式 */ private String packType; /** * 工程号 */ private String projectNo; hangzhoumesParent/common/servicebase/src/main/java/com/mes/pp/entity/request/Reportingdamage.java
@@ -31,6 +31,10 @@ * 次破时间 */ private String reportingWorkTime; /** * 次破时间2 */ private String reportingWorkTime2; } hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java
@@ -4,6 +4,8 @@ import com.github.yulichang.base.MPJBaseMapper; import com.mes.temperingglass.entity.TemperingGlassInfo; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import java.util.List; @@ -19,5 +21,13 @@ public interface TemperingGlassInfoMapper extends MPJBaseMapper<TemperingGlassInfo> { boolean saveBatch(@Param(value = "list") List<TemperingGlassInfo> list); //绕过全局逻辑进行查询 @Select("SELECT * FROM tempering_glass_info " + "WHERE tempering_layout_id = #{temperingLayoutId} " + "AND engineer_id = #{engineerId} " + "ORDER BY tempering_layout_id DESC, tempering_feed_sequence ASC") List<TemperingGlassInfo> selectByEngineerIdAndLayoutId(String engineerId, Integer temperingLayoutId); //绕过全局逻辑进行修改 @Update("UPDATE tempering_glass_info " + "SET state = #{state}, " + "deleted = CASE WHEN #{state} < 8 THEN 0 ELSE deleted END " + "WHERE glass_id = #{glassId}") Integer updateTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo); } hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java
@@ -2,7 +2,6 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.mes.temperingglass.entity.TemperingGlassInfo; import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; import com.mes.temperingglass.service.TemperingGlassInfoService; @@ -36,7 +35,8 @@ QueryWrapper<TemperingGlassInfo> glassinfo = new QueryWrapper<>(); glassinfo.eq("engineer_id", glass.getEngineerId()) .eq("tempering_layout_id", glass.getTemperingLayoutId()); return temperingMapper.selectList(glassinfo); //return temperingMapper.selectList(glassinfo); return temperingMapper.selectByEngineerIdAndLayoutId(glass.getEngineerId(),glass.getTemperingLayoutId()); }else { return null; } @@ -45,11 +45,13 @@ @Override public List<TemperingGlassInfo> selectIntoGlass(TemperingGlassInfo temperingGlassInfo) { //获取进炉中的玻璃信息 QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); wrapper.eq("tempering_layout_id", temperingGlassInfo.getTemperingLayoutId()) .eq("engineer_id", temperingGlassInfo.getEngineerId()) .orderByAsc("tempering_layout_id","tempering_feed_sequence"); return temperingMapper.selectList(wrapper); // QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); // wrapper.eq("tempering_layout_id", temperingGlassInfo.getTemperingLayoutId()) // .eq("engineer_id", temperingGlassInfo.getEngineerId()) // .orderByAsc("tempering_layout_id","tempering_feed_sequence"); // return temperingMapper.selectList(wrapper); return temperingMapper.selectByEngineerIdAndLayoutId(temperingGlassInfo.getEngineerId(),temperingGlassInfo.getTemperingLayoutId()); } @Override @@ -60,13 +62,9 @@ TemperingGlassInfo glass=temperingMapper.selectOne(wrap); //根据工程号和版图获取数据 if(glass != null) { QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); wapper.eq("engineer_id", glass.getEngineerId()) .eq("tempering_layout_id", glass.getTemperingLayoutId()) .orderByAsc("tempering_layout_id", "tempering_feed_sequence"); return temperingMapper.selectList(wapper); return temperingMapper.selectByEngineerIdAndLayoutId(glass.getEngineerId(),glass.getTemperingLayoutId()); } return null; return null; } @Override @@ -80,24 +78,22 @@ if (glassinfo == null) { return null; // 直接返回null,表示没有找到符合条件的记录 } QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); wrapper.eq("tempering_layout_id",glassinfo.getTemperingLayoutId()) .eq("engineer_id",glassinfo.getEngineerId()); return temperingMapper.selectByEngineerIdAndLayoutId(glassinfo.getEngineerId(),glassinfo.getTemperingLayoutId()); return temperingMapper.selectList(wrapper); } @Override public List<TemperingGlassInfo> selectLayoutId() { QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); wrapper.select("distinct tempering_layout_id,engineer_id") wrapper.select("tempering_layout_id,engineer_id,max(id) as id") .eq("state",2) .orderByAsc("tempering_layout_id"); .groupBy("tempering_layout_id,engineer_id") .orderByDesc("id"); return temperingMapper.selectList(wrapper); } @Override public List<TemperingGlassInfo> selectTaskType() { public List<TemperingGlassInfo> selectTaskType() { QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); wrapper.select("state") .groupBy("state"); @@ -106,11 +102,7 @@ @Override public Integer updateTemperingState(TemperingGlassInfo temperingGlassInfo) { UpdateWrapper<TemperingGlassInfo> wrapper = new UpdateWrapper<>(); wrapper.eq("glass_id",temperingGlassInfo.getGlassId()) .lt("state",6) .set("state", temperingGlassInfo.getState());; if (temperingMapper.update(null,wrapper) > 0) { if (temperingMapper.updateTemperingGlassInfo(temperingGlassInfo) > 0) { return 200; }else { return 100; hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java
@@ -149,7 +149,7 @@ arguments.put("state","8"); //拿走:200/破损:201 arguments.put("line","1001"); //线路: arguments.put("workingProcedure","识别"); //设备名称: edgStorageCageDetailsService.identWorn(arguments); // edgStorageCageDetailsService.identWorn(arguments); log.info("识别台【破损/拿走】:{}", 1); } hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
@@ -1,8 +1,12 @@ package com.mes.bigstorage.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.mes.bigstorage.entity.BigStorageCageDetails; import com.mes.bigstorage.service.BigStorageCageDetailsService; import com.mes.bigstorage.service.BigStorageCageService; import com.mes.common.config.Const; import com.mes.common.utils.RedisUtil; import com.mes.utils.Result; import io.swagger.annotations.Api; @@ -107,5 +111,20 @@ bigStorageCageDetailsService.temperingSwitch(flag); return Result.build(200, "修改成功", redisUtil.getCacheObject("temperingSwitch")); } @ApiOperation("流程卡查询") @PostMapping("/selectFlowCardByCache") public Result selectFlowCardByCache() { List<Map<String, Object>> flowCardIdCount=bigStorageCageDetailsService.listMaps( new QueryWrapper<BigStorageCageDetails>() .select("flow_card_id,layer,count(*) as count") .eq("state", Const.GLASS_STATE_IN) .eq("tempering_layout_id",0) .groupBy("flow_card_id,layer") ); return Result.build(200, "查询成功", flowCardIdCount); } } hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java
@@ -94,20 +94,26 @@ /** * 工程号 */ @ApiModelProperty(value = "工程号") @ApiModelProperty(value = "工程号", position = 16) private String engineerId; /** * 工程号 */ @ApiModelProperty(value = "层", position = 17) private String layer; /** * 进片任务 */ @ApiModelProperty(value = "进片任务", position = 16) @ApiModelProperty(value = "进片任务", position = 18) @TableField(exist = false) private BigStorageCageFeedTask bigStorageCageFeedTask; /** * 出片任务 */ @ApiModelProperty(value = "出片任务", position = 17) @ApiModelProperty(value = "出片任务", position = 19) @TableField(exist = false) private BigStorageCageOutTask bigStorageCageOutTask; hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -276,10 +276,9 @@ .gt(BigStorageCage::getRemainWidth, Math.max(glassInfo.getWidth(), glassInfo.getHeight())) .last("limit 1"); if (glassInfo.getTemperingLayoutId() == 0) { //todo:同流程进同一格 // wrapper.eq(BigStorageCageDetails::getFlowCardId,glassInfo.getFlowCardId()) // .eq(BigStorageCageDetails::get) wrapper.eq(BigStorageCageDetails::getWidth, glassInfo.getWidth()).eq(BigStorageCageDetails::getHeight, glassInfo.getHeight()); wrapper.eq(BigStorageCageDetails::getFlowCardId,glassInfo.getFlowCardId()) .eq(BigStorageCageDetails::getLayer,glassInfo.getLayer()); // wrapper.eq(BigStorageCageDetails::getWidth, glassInfo.getWidth()).eq(BigStorageCageDetails::getHeight, glassInfo.getHeight()); } else { wrapper.eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1); } hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcSlicecage.java
@@ -1,10 +1,13 @@ package com.mes.job; import cn.hutool.json.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.mes.bigstorage.entity.BigStorageCageDetails; import com.mes.bigstorage.service.BigStorageCageDetailsService; import com.mes.bigstorage.service.BigStorageCageService; import com.mes.common.S7object; import com.mes.common.config.Const; import com.mes.common.utils.RedisUtil; import com.mes.device.PlcParameterObject; import com.mes.temperingglass.entity.TemperingGlassInfo; @@ -68,11 +71,15 @@ } jsonObject.append("temperingSwitch", temperingSwitch); } public void queryDataSource2() throws InterruptedException { //出片队列 List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list(); List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list( new LambdaQueryWrapper<TemperingGlassInfo>() .inSql(TemperingGlassInfo::getEngineerId,"select distinct engineer_id from tempering_glass_info where state<4") ); jsonObject.append("temperingGlassInfoList", temperingGlassInfoList); } hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
@@ -2,6 +2,7 @@ import cn.hutool.core.lang.Assert; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; @@ -156,6 +157,16 @@ String d03ToMES = plcParameterObject.getPlcParameter("D03ToMES").getValue(); String d05ToMES = plcParameterObject.getPlcParameter("D05ToMES").getValue(); log.info("执行空车送片任务,获取到的大车状态为{},卧转立状态分别为d03:{},d05:{}", e01Status, d03ToMES, d05ToMES); List<BigStorageCageFeedTask> bigStorageCageFeedTasks = bigStorageCageFeedTaskService.list( new LambdaQueryWrapper<BigStorageCageFeedTask>() .ne(BigStorageCageFeedTask::getTargetSlot, 0) .lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT) ); if (bigStorageCageFeedTasks.size() > 0) { Date endDate = new Date(); log.info("大车有正在执行的任务{},结束送片任务,任务结束时间:{},共耗时:{}ms,结束扫码任务", bigStorageCageFeedTasks, endDate, endDate.getTime() - startDate.getTime()); return; } if (REQUEST_WORD.equals(e01Status)) { Date endDate = new Date(); log.info("进片大车非空闲,结束送片任务,任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); @@ -282,8 +293,12 @@ return; } //是否有人工下片任务 有直接出 // List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() // .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL).orderByDesc(BigStorageCageDetails::getWidth)); List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL).orderByDesc(BigStorageCageDetails::getWidth)); .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL) .orderByAsc(BigStorageCageDetails::getSlot) .orderByDesc(BigStorageCageDetails::getId)); if (CollectionUtils.isNotEmpty(artificialList)) { computeOutMoreGlassInfo(artificialList, Boolean.FALSE, mesToPLCAddress); Date endDate = new Date(); @@ -543,18 +558,19 @@ */ public Boolean judgeGlassTypeStatus(String glassId, Integer line, String mesAddress) { //1、获取任务表中相邻玻璃 List<EdgGlassTaskInfo> edgGlassTaskInfoList ; edgGlassTaskInfoList= edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() List<EdgGlassTaskInfo> edgGlassTaskInfoList; edgGlassTaskInfoList = edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() .eq(EdgGlassTaskInfo::getLine, line) .apply("time >= (select time from edg_glass_task_info where line='" + line + "' and glass_id = '" + glassId + "' and deleted = 0)") .orderByAsc(EdgGlassTaskInfo::getTime)); if(edgGlassTaskInfoList==null){ log.info("线路:{}识别玻璃信息未出现在尺寸表中,获取相邻两块玻璃失败",line); }else{ edgGlassTaskInfoList= edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() .eq(EdgGlassTaskInfo::getGlassId, glassId) .last("limit 1")); log.info("在尺寸表中获取玻璃信息{}",edgGlassTaskInfoList); if (edgGlassTaskInfoList == null) { log.info("线路:{}识别玻璃信息未出现在尺寸表中,获取相邻两块玻璃失败", line); } else { edgGlassTaskInfoList = edgGlassTaskInfoService.list(new QueryWrapper<EdgGlassTaskInfo>() .select("Top 1 *") .eq("glass_id", glassId) ); log.info("在尺寸表中获取玻璃信息{}", edgGlassTaskInfoList); } Assert.isFalse(CollectionUtils.isEmpty(edgGlassTaskInfoList), "识别玻璃信息未出现在尺寸表中,获取相邻两块玻璃失败"); //2、获取卧转立剩余宽度 @@ -716,7 +732,7 @@ for (int i = 1; i <= taskList.size(); i++) { s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), taskList.get(i - 1).getLine()); s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), taskList.get(i - 1).getTargetSlot()); log.info("向plc发送第{}片玻璃已完成", i); log.info("向plc发送第{}片玻璃已完成,起始位置是{},目标位置是", i, taskList.get(i - 1).getLine(), taskList.get(i - 1).getTargetSlot()); } int returnData = 0; int count = 1; hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
@@ -3,7 +3,7 @@ spring: profiles: active: dev active: cz application: name: cacheVerticalGlass mybatis-plus: @@ -16,7 +16,7 @@ minCount: 20 carWidth: 5000 #大车宽度 slotWidth: 5000 #大车宽度 inCarMaxSize: 1 #进片大车最大存放玻璃数量 inCarMaxSize: 1 #进片大车最大存放玻璃数量 outCarMaxSize: 2 #出片大车最大存放玻璃数量 glassGap: 350 #玻璃间距 xMaxSize: 2800 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/test/java/com/mes/CacheVerticalGlassModuleApplicationTest.java
@@ -1,5 +1,7 @@ package com.mes; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.mes.bigstorage.entity.BigStorageCage; import com.mes.bigstorage.service.BigStorageCageDetailsService; import com.mes.bigstorage.service.BigStorageCageService; @@ -7,7 +9,10 @@ import com.mes.common.config.Const; import com.mes.damage.entity.Damage; import com.mes.damage.service.DamageService; import com.mes.edgglasstask.entity.EdgGlassTaskInfo; import com.mes.edgglasstask.service.EdgGlassTaskInfoService; import com.mes.job.PlcStorageCageTask; import com.mes.temperingglass.entity.TemperingGlassInfo; import lombok.extern.slf4j.Slf4j; import org.junit.Test; import org.junit.runner.RunWith; @@ -37,6 +42,8 @@ BigStorageCageDetailsService bigStorageCageDetailsService; @Autowired DamageService damageService; @Autowired EdgGlassTaskInfoService edgGlassTaskInfoService; // @Autowired // BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper; @@ -167,4 +174,13 @@ plcStorageCageTask.updateOutGlassStateTask(); } @Test public void chaxun(){ List<EdgGlassTaskInfo> edgGlassTaskInfoList = edgGlassTaskInfoService.list(new QueryWrapper<EdgGlassTaskInfo>() .select("Top 1 *") .eq("glass_id", "P24072402|1|13") ); log.info("在尺寸表中获取玻璃信息{}", edgGlassTaskInfoList); } } hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcScreenTask.java
@@ -40,7 +40,6 @@ public void screenHome() { JSONObject jsonObject = new JSONObject(); Reportingdamage reportingdamage = new Reportingdamage(); //reportingdamage.setReportingWorkTime("2024-05-11"); // 获取当前日期 LocalDate today = LocalDate.now(); // 计算最近七天的开始日期 @@ -52,8 +51,9 @@ String startOfPeriodStr = startOfPeriod.format(formatter); String endOfPeriodStr = endOfPeriod.format(formatter); // 设置为最近七天的时间范围 reportingdamage.setReportingWorkTime("2024-05-11" + " to " + endOfPeriodStr); //reportingdamage.setReportingWorkTime(startOfPeriodStr + " to " + endOfPeriodStr); reportingdamage.setReportingWorkTime("2024-05-11"); //reportingdamage.setReportingWorkTime("2024-05-11"); reportingdamage.setReportingWorkTime2(endOfPeriodStr); //扇形图各设备的加工破损数量 List<Reportingdamage> device = reportingWorkService.selectDamage(reportingdamage); jsonObject.append("device", device); hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
@@ -66,27 +66,7 @@ if (outGlass != null) { jsonObject.append("overGlass", overGlass); } //当前钢化工程的拿走数据 LambdaQueryWrapper<TemperingGlassInfo> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.select(TemperingGlassInfo::getEngineerId) .lt(TemperingGlassInfo::getState, Const.TEMPERING_END) .groupBy(TemperingGlassInfo::getEngineerId); List<String> engineerIds = temperingAgoService.list(queryWrapper) .stream() .map(TemperingGlassInfo::getEngineerId) .distinct() .collect(Collectors.toList()); List<Damage> temperingTakeGlassInfos = damageService.list( new LambdaQueryWrapper<Damage>() .in(Damage::getEngineerId, engineerIds) .eq(Damage::getType, Const.GLASS_STATE_TAKE) .orderByAsc(Damage::getId) ); jsonObject.append("temperingTakeGlassInfos", temperingTakeGlassInfos); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); if (sendwServer != null) { hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java
@@ -33,13 +33,7 @@ log.info("等待中的玻璃信息{}",glass); return Result.build(200, "", glass); } // @ApiOperation("查询进炉中的钢化等片中的版图信息,状态全为1的为已到。") // @GetMapping("/selectIntoGlass") // 查询进炉中的钢化等片中的版图信息,状态全为1的为已到。 // public Result <List<TemperingGlassInfo>> selectIntoGlass() { // List<TemperingGlassInfo> glass = temperingAgoService.selectIntoGlass(); // log.info("进炉中的玻璃版图信息{}",glass); // return Result.build(200, "", glass); // } @ApiOperation("//钢化后显示出炉的版图信息。") @GetMapping("/selectOutGlass") //钢化后显示出炉的版图信息 public Result <List<TemperingGlassInfo>> selectOutGlass() { @@ -48,10 +42,12 @@ return Result.build(200, "", glass); } @ApiOperation("//钢化破损") @ApiOperation("//钢化破损拿走放回") @PostMapping("/updateTemperingState") //钢化后显示出炉的版图信息 public Result <Integer> updateTemperingState(@RequestBody Damage damage) { damageService.insertDamage(damage); if(damage.getStatus()>5) { damageService.insertDamage(damage); } TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); temperingGlassInfo.setState(damage.getStatus()); temperingGlassInfo.setGlassId(damage.getGlassId()); hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/controller/DownWorkstationController.java
@@ -137,6 +137,26 @@ return Result.build(200, "修改成功", redisUtil.getCacheObject("autoPrint")); } @ApiOperation("新增虚拟工位") @PostMapping("/insertDownWorkstation") public Result insertDownWorkstation() { DownWorkstation downWorkstation = new DownWorkstation(); downWorkstation.setTotalQuantity(0); downWorkstation.setRacksNumber(0); downWorkstation.setOtherNumber(0); downWorkstation.setDeviceId(3); downWorkstation.setEnableState(1); downWorkstation.setWorkState(1); downWorkstationService.save(downWorkstation); return Result.build(200, "新增成功", 1); } @ApiOperation("删除虚拟工位") @PostMapping("/deleteDownWorkstation") public Result deleteDownWorkstation(DownWorkstation downWorkstation) { downWorkstationService.removeById(downWorkstation.getWorkstationId()); return Result.build(200, "删除成功", 1); } } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
@@ -367,11 +367,21 @@ List<Integer> workList = new ArrayList(); if (flag08) { if (!"2".equals(glassStatus11)) { workList.addAll(Const.G11_WORK_STATION); List<Integer> wroklistOne = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() .eq(DownWorkstation::getEnableState, Const.SLOT_ON).in(DownWorkstation::getWorkstationId, Const.G11_WORK_STATION)) .stream() .map(DownWorkstation::getWorkstationId) .collect(Collectors.toList()); workList.addAll(wroklistOne); } } else { if (!"2".equals(glassStatus06)) { workList.addAll(Const.G06_WORK_STATION); List<Integer> wroklistTwo = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() .eq(DownWorkstation::getEnableState, Const.SLOT_ON).in(DownWorkstation::getWorkstationId, Const.G06_WORK_STATION)) .stream() .map(DownWorkstation::getWorkstationId) .collect(Collectors.toList()); workList.addAll(wroklistTwo); } } List<Integer> workStationAll = Arrays.asList(1, 2, 3, 4, 5, 6); hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
@@ -48,7 +48,7 @@ log.info("发送工位玻璃信息"); JSONObject jsonObject = new JSONObject(); List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(1, 6); List<DownWorkstation> data = downWorkstationService.list(); jsonObject.append("params", data); log.info(jsonObject.toString()); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass"); @@ -148,6 +148,16 @@ autoPrint = redisUtil.getCacheObject("autoPrint"); } jsonObject4.append("autoPrint", autoPrint); //人工下片位置最后一片 DownGlassTask takeGlass = downGlassTaskService.getOne( new QueryWrapper<DownGlassTask>() .select("Top 1 *") .eq("end_cell", Const.G13_WORK_STATION) .orderByDesc("id") ); jsonObject4.append("takeGlass", takeGlass); ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("unloadglass"); if (sendwServer4 != null) {