Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
3 文件已复制
42个文件已修改
6 文件已重命名
6个文件已添加
15个文件已删除
| | |
| | | |
| | | adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | x_axis: (rect.x_axis*100) * 0.005, // 将x值除以3 |
| | | y_axis: (rect.y_axis*100) * 0.005, |
| | | width: (rect.width*100) * 0.004 , |
| | | x_axis: (rect.x_axis*100) * 0.004, // 将x值除以3 |
| | | y_axis: (rect.y_axis*100) * 0.004, |
| | | width: (rect.width*100) * 0.002 , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height:( rect.height*100) * 0.004 , |
| | | height:( rect.height*100) * 0.002 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | console.log(adjustedRects.value); |
| | |
| | | // adjustedRects.value = data.currentCutTerritory[0] |
| | | adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | x_axis: (rect.x_axis*100) * 0.005, // 将x值除以3 |
| | | y_axis: (rect.y_axis*100) * 0.005, |
| | | width: (rect.width*100) * 0.004 , |
| | | x_axis: (rect.x_axis*100) * 0.004, // 将x值除以3 |
| | | y_axis: (rect.y_axis*100) * 0.004, |
| | | width: (rect.width*100) * 0.002 , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height:( rect.height*100) * 0.004 , |
| | | height:( rect.height*100) * 0.002 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | // console.log("更新后数据", tableData); |
| | |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | adjustedRects.value = data.intoGlass[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | xcoordinate: rect.xcoordinate, // 将x值除以3 |
| | | ycoordinate: rect.ycoordinate, |
| | | width: rect.width , |
| | | height: rect.height , |
| | | xcoordinate: rect.xCoordinate * 0.5, // 将x值除以3 |
| | | ycoordinate: rect.ycoordinate * 0.5, |
| | | width: rect.width * 0.4, |
| | | height: rect.height * 0.4, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | })); |
| | | console.log(data.intoGlass[0]); |
| | | adjustedRectsa.value = data.waitingGlass[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | xcoordinate: rect.xcoordinate, // 将x值除以3 |
| | | ycoordinate: rect.ycoordinate, |
| | | width: rect.width , |
| | | height: rect.height , |
| | | xcoordinate: rect.xCoordinate * 0.5, // 将x值除以3 |
| | | ycoordinate: rect.ycoordinate * 0.5, |
| | | width: rect.width * 0.4, |
| | | height: rect.height * 0.4, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | state: rect.state |
| | | })); |
| | | |
| | | adjustedRectsb.value = data.outGlass[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | xcoordinate: rect.xcoordinate, // 将x值除以3 |
| | | ycoordinate: rect.ycoordinate, |
| | | width: rect.width , |
| | | height: rect.height , |
| | | xcoordinate: rect.xCoordinate * 0.5, // 将x值除以3 |
| | | ycoordinate: rect.ycoordinate * 0.5, |
| | | width: rect.width * 0.4, |
| | | height: rect.height * 0.4, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | state: rect.state |
| | | })); |
| | | }; |
| | | |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | // onMounted(async () => { |
| | | // try { |
| | | // const response = await request.get('/temperingGlass/temperingGlassInfo/SelectIntoGlass'); |
| | | // if (response.code === 200) { |
| | | // const rawRects = response.data; // 设置矩形数据 |
| | | // console.log(response.data); |
| | | // const { height: newheight,width: newwidth } = response.data; // 获取尺寸 |
| | | // height.value = newheight; |
| | | // width.value = newwidth; |
| | | |
| | | // adjustedRects.value = rawRects.map(rect => ({ |
| | | // ...rect, // 复制原始对象的其他属性 |
| | | // xcoordinate: rect.xcoordinate, // 将x值除以3 |
| | | // ycoordinate: rect.ycoordinate, |
| | | // width: rect.width , |
| | | // height: rect.height , |
| | | // })); |
| | | // console.log(rect); |
| | | |
| | | // // console.log( (rect.width*100) / 300 ); |
| | | // } else { |
| | | // // console.error('Failed to fetch rectangles from API.'); |
| | | // console.error('Failed to fetch rects from API.'); |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rectangles :', error); |
| | | // console.error('Error fetching rects :', error); |
| | | // } |
| | | // }); |
| | | // 进炉前 |
| | | // const handleConfirm = async () => { |
| | | // try { |
| | | // const response = await request.post('/temperingGlass/temperingGlassInfo/SelectWaitingGlass'); |
| | | // if (response.code === 200) { |
| | | // const rawRects = response.data; // 设置矩形数据 |
| | | // console.log(response.data); |
| | | // const { height: newheight,width: newwidth } = response.data; // 获取尺寸 |
| | | // height.value = newheight; |
| | | // width.value = newwidth; |
| | | |
| | | // adjustedRectsa.value = rawRects.map(rect => ({ |
| | | // ...rect, // 复制原始对象的其他属性 |
| | | // xcoordinate: rect.xcoordinate, // 将x值除以3 |
| | | // ycoordinate: rect.ycoordinate, |
| | | // width: rect.width , |
| | | // height: rect.height , |
| | | // })); |
| | | // console.log(rect); |
| | | |
| | | // // console.log( (rect.width*100) / 300 ); |
| | | // } else { |
| | | // // console.error('Failed to fetch rectangles from API.'); |
| | | // console.error('Failed to fetch rects from API.'); |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rectangles :', error); |
| | | // console.error('Error fetching rects :', error); |
| | | // } |
| | | // }; |
| | | |
| | | // 已出炉 |
| | | // const handleConfirma = async () => { |
| | | // try { |
| | | // const response = await request.get('/temperingGlass/temperingGlassInfo/SelectOutGlass'); |
| | | // if (response.code === 200) { |
| | | // const rawRects = response.data; // 设置矩形数据 |
| | | // console.log(response.data); |
| | | // const { height: newheight,width: newwidth } = response.data; // 获取尺寸 |
| | | // height.value = newheight; |
| | | // width.value = newwidth; |
| | | |
| | | // adjustedRectsb.value = rawRects.map(rect => ({ |
| | | // ...rect, // 复制原始对象的其他属性 |
| | | // xcoordinate: rect.xcoordinate, // 将x值除以3 |
| | | // ycoordinate: rect.ycoordinate, |
| | | // width: rect.width , |
| | | // height: rect.height , |
| | | // })); |
| | | // console.log(rect); |
| | | |
| | | // // console.log( (rect.width*100) / 300 ); |
| | | // } else { |
| | | // // console.error('Failed to fetch rectangles from API.'); |
| | | // console.error('Failed to fetch rects from API.'); |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rectangles :', error); |
| | | // console.error('Error fetching rects :', 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: [ |
| | | { |
| | | } |
| | | ], |
| | | }) |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="margin-top: 10px;"> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true;dialogFormVisiblea = false;dialogFormVisibleb = false;">进炉中</el-button> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="handleConfirm();dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;" >进炉前</el-button> |
| | | <el-button id="searchButton" type="success" @click="handleConfirma();dialogFormVisibleb = true;dialogFormVisible = false;dialogFormVisiblea = false">已出炉玻璃</el-button> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;" >进炉前</el-button> |
| | | <el-button id="searchButton" type="success" @click="dialogFormVisibleb = true;dialogFormVisible = false;dialogFormVisiblea = false">已出炉玻璃</el-button> |
| | | <div v-if="dialogFormVisible" > |
| | | <!-- <div style="display: flex;margin-bottom: 20px;"> |
| | | <div style="margin-left: 450px;font-size: 20px;">工程号:P20240305001 </div> |
| | | <div style="margin-left: 150px;font-size: 20px;">版图编号:1</div> |
| | | </div> --> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> |
| | | <el-scrollbar height="630px"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 700px;" v-loading="loading"> |
| | | <div style="width: 49%;float: left;background-color: #f4f4f5;height: 650px;"> |
| | | <el-scrollbar height="630px"> |
| | | <div v-for="(group, groupId) in groupedRects" :key="groupId" style="position: relative;"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }" |
| | | > |
| | | <div class="centered-text"> |
| | | <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | | <div style="width: 49%;float: right;background-color: #f4f4f5;height: 650px;"> |
| | | <el-scrollbar height="630px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="index" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }" |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | | |
| | | </el-card> |
| | | </div> |
| | | <div v-if="dialogFormVisiblea"> |
| | |
| | | v-for="(rect, index) in adjustedRectsa" |
| | | :key="index" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }" |
| | | > |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, |
| | | width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: rect.state === 0 ? '#dedfe0' : '#d1edc4' }"> |
| | | <div class="centered-text"> |
| | | <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | v-for="(rect, index) in adjustedRectsb" |
| | | :key="index" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }" |
| | | > |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, |
| | | width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }"> |
| | | <div class="centered-text"> |
| | | <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | |
| | | import { ref } from 'vue' |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | const adjustedRects = ref([]); |
| | | |
| | | const dialogFormVisible = ref(true) |
| | | const dialogFormVisiblea = ref(false) |
| | |
| | | } |
| | | } |
| | | |
| | | 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: [ |
| | | { |
| | | } |
| | | ], |
| | | }) |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | adjustedRects.value = data.overGlass[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | xcoordinate: rect.xCoordinate * 0.5, // 将x值除以3 |
| | | ycoordinate: rect.ycoordinate * 0.5, |
| | | width: rect.width * 0.4, |
| | | height: rect.height * 0.4, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | })); |
| | | console.log(data.intoGlass[0]); |
| | | }; |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="margin-top: 10px;"> |
| | | <div> |
| | | <el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> |
| | | <div style="display: flex;margin-top: 20px;"> |
| | | <div style="margin-left: 400px;font-size: 20px;">工程号:P20240305001 </div> |
| | | <div style="margin-left: 150px;font-size: 20px;">版图编号:1</div> |
| | | </div> |
| | | <div> |
| | | <div id="boxa" style="width: 700px;height: 220px;margin-left: 260px;"> |
| | | <div style="margin-top: 85px;"> NG202405060798A01-1</div> |
| | | <div> 500×1500</div> |
| | | </div> |
| | | </div> |
| | | <el-scrollbar height="630px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="index" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, |
| | | width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: rect.state === 4 ? '#d1edc4' : '#f8e3c5' }"> |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </el-card> |
| | | </div> |
| | | </div> |
| | |
| | | margin-top: 70px; |
| | | margin-bottom: 50px; |
| | | } |
| | | .rect { |
| | | border: 1px solid black; /* 设置矩形的边框 */ |
| | | background-color: lightblue; /* 设置矩形的背景色 */ |
| | | } |
| | | .centered-text { |
| | | /* 设置文字居中样式 */ |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 100%; /* 确保div占据整个矩形的高度 */ |
| | | } |
| | | </style> |
| | |
| | | label: thickness, |
| | | })); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求失败的情况 |
| | |
| | | flakea.value = true |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | ElMessage.warning(res.message) |
| | | // router.push("/login") |
| | | } |
| | | }); |
| | |
| | | } |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求错误 |
| | |
| | | } |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求错误 |
| | |
| | | } |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | |
| | | })); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | // ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | catch (error) { |
| | |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | selectedProjectNoa.value = '' |
| | | selectedProjectNoa.value = ''; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blinda.value = false; |
| | | tableData.splice([]); |
| | | // tableData.splice([]); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | else { |
| | |
| | | tableData.splice([]); |
| | | |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | else { |
| | |
| | | const confirmCuttingMachine = () => { |
| | | cuttingMachineStatus.value = 'green'; |
| | | }; |
| | | |
| | | |
| | | const toggleEnableState = async (row: any) => { |
| | | // 检查 id 是否为空 |
| | | if (!row.id) { |
| | | ElMessage.error('该工程未保存到上片表!'); |
| | | return; // 如果 id 为空,则不执行后续操作 |
| | | } |
| | | |
| | | const newState = row.state === 100 ? 0 : 100; |
| | | |
| | | try { |
| | | // 发送请求到后端更新状态 |
| | | const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求错误 |
| | | console.error('更新玻璃状态请求失败:', error); |
| | | ElMessage.error('更新玻璃状态时发生错误'); |
| | | } |
| | | }; |
| | | |
| | | const wsUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`; |
| | | const ws = new WebSocket(wsUrl); |
| | |
| | | <el-button @click="confirmCuttingMachine" style="margin-left: 30px;margin-top: -3px;" >确认</el-button> |
| | | <div style="margin-left: 70px;">{{ upstatus }} </div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatusColor, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;" >确认</el-button> |
| | | <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;" >切换</el-button> |
| | | |
| | | </div> |
| | | <el-button style="margin-top: 5px;margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true">选择工程</el-button> |
| | |
| | | <el-table-column prop="filmsId" label="膜系" align="center"/> |
| | | <el-table-column prop="layoutSequence" label="数量" align="center"/> |
| | | <el-table-column prop="thickness" label="厚度" align="center"/> |
| | | <el-table-column |
| | | <!-- <el-table-column |
| | | align="center" |
| | | label="状态" |
| | | min-width="80" |
| | |
| | | <el-tag :type="getStatusType(scope.row.state)"> |
| | | {{ getStatusText(scope.row.state) }} |
| | | </el-tag> |
| | | </template> |
| | | </template> --> |
| | | <el-table-column |
| | | align="center" |
| | | label="启用状态" |
| | | min-width="80" |
| | | prop="state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="scope.row.state === 100 ? 'success' : 'warning'" |
| | | @click="toggleEnableState(scope.row)" |
| | | > |
| | | {{ scope.row.state === 100 ? '通过' : '等待中' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="大理片笼表ID" min-width="80" /> |
| | | <el-table-column prop="deviceId" align="center" label="设备ID" min-width="120" /> |
| | | <el-table-column prop="deviceId" align="center" label="理片笼号" min-width="120" /> |
| | | <el-table-column prop="slot" align="center" label="栅格号" min-width="120" /> |
| | | <el-table-column |
| | | align="center" |
| | |
| | | public static final Integer GLASS_STATE_IN = 100; |
| | | public static final Integer GLASS_STATE_OUT = 101; |
| | | public static final Integer GLASS_STATE_TAKE = 200; |
| | | public static final Integer A10_OUT_TARGET_DAMAGE = 201; |
| | | public static final Integer GLASS_STATE_DAMAGE = 201; |
| | | |
| | | /** |
| | | * 卧式理片笼详情表玻璃状态 |
| | |
| | | public static final Integer EDG_GLASS_START = 1; |
| | | public static final Integer EDG_GLASS_SUCCESS = 2; |
| | | |
| | | /** |
| | | * 磨边任务玻璃状态 |
| | | * 1单机自动状态 |
| | | * 2联机自动状态 |
| | | * 3手动状态 |
| | | */ |
| | | public static final Integer BIG_STORAGE_STAND_ALONE = 1; |
| | | public static final Integer BIG_STORAGE_ONLINE = 2; |
| | | public static final Integer BIG_STORAGE_MT = 3; |
| | | |
| | | /** |
| | | * 大理片笼请求 |
| | | * 0 大理片笼无请求 |
| | | * 1 大理片笼进片请求 |
| | | */ |
| | | public static final Integer BIG_STORAGE_REQUEST = 0; |
| | | public static final Integer BIG_STORAGE_REQUEST_IN = 1; |
| | | |
| | | /** |
| | | * 卧转立进片请求 |
| | | * 1 任务生成 |
| | | * 2 卧转立进片完成 |
| | | * 3 大车进片完成 |
| | | * 4 大理片笼进片完成 |
| | | */ |
| | | public static final Integer BIG_STORAGE_IN_NEW = 1; |
| | | public static final Integer BIG_STORAGE_IN_UP = 2; |
| | | public static final Integer BIG_STORAGE_IN_CAR = 3; |
| | | public static final Integer BIG_STORAGE_IN_SLOT = 4; |
| | | /** |
| | | * 卧转立出片请求 |
| | | * 1 任务生成 |
| | | * 2 玻璃进大车完成 |
| | | * 3 大车出片完成 |
| | | */ |
| | | public static final Integer BIG_STORAGE_OUT_NEW = 1; |
| | | public static final Integer BIG_STORAGE_OUT_CAR = 2; |
| | | public static final Integer BIG_STORAGE_OUT_SUCCESS = 3; |
| | | |
| | | /** |
| | | * 卧转立出片请求 |
| | | * 1 上车等待 |
| | | * 2 上车启动 |
| | | */ |
| | | public static final Integer BIG_STORAGE_IN_WAIT = 1; |
| | | public static final Integer BIG_STORAGE_IN_RUN = 2; |
| | | |
| | | /** |
| | | * 大理片笼宽度 及 玻璃间距 |
| | | */ |
| | | public static final Integer BIG_STORAGE_WIDTH = 5000; |
| | | public static final Integer BIG_STORAGE_GAP = 20; |
| | | |
| | | /** |
| | | * 钢化小片表 |
| | | * -1 生成任务 |
| | | * 0 出片完成 |
| | | * 1 摆片完成 |
| | | * 2 进炉完成 |
| | | * 3 钢化完成 |
| | | * 4 出片完成 |
| | | * 5 破损 |
| | | * 6 拿走 |
| | | */ |
| | | |
| | | public static final Integer TEMPERING_NEW =-1; |
| | | public static final Integer TEMPERING_OUT =0; |
| | | public static final Integer TEMPERING_DROP =1; |
| | | public static final Integer TEMPERING_START =2; |
| | | public static final Integer TEMPERING_SUCCESS =3; |
| | | public static final Integer TEMPERING_END =4; |
| | | public static final Integer TEMPERING_DAMAGE =5; |
| | | public static final Integer TEMPERING_TAKE =6; |
| | | |
| | | } |
| | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 保存小片表 |
| | | */ |
| | | void saveGlassInfo(List<GlassInfo> glassinfo); |
| | | |
| | | /** |
| | | * @param flowCardId |
| | | * @return 根据流程卡号查询玻璃信息 |
| | | */ |
| | | int getGlassInfoCountByFlowCardId(String flowCardId); |
| | | |
| | | /** |
| | | * @return |
| | | * 查询所有工程状态不为300不同流程卡号 |
| | | */ |
| | | List<Map<String, Object>> getFlowCardId(); |
| | | } |
| | | |
| | |
| | | package com.mes.glassinfo.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.entity.OptimizeGlassinfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public void saveGlassInfo(List<GlassInfo> glassinfo) { |
| | | this.saveBatch(glassinfo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int getGlassInfoCountByFlowCardId(String flowCardId) { |
| | | return baseMapper.selectCount(new QueryWrapper<GlassInfo>().lambda() |
| | | .eq(GlassInfo::getFlowCardId, flowCardId)); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getFlowCardId() { |
| | | return baseMapper.selectJoinMaps(JoinWrappers.lambda(GlassInfo.class) |
| | | .select(GlassInfo::getFlowCardId) |
| | | .leftJoin(UpPattenUsage.class, on -> on |
| | | .eq(OptimizeProject::getProjectNo, GlassInfo::getEngineerId) |
| | | .ne(OptimizeProject::getState, 300) |
| | | ) |
| | | .groupBy(GlassInfo::getFlowCardId) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
File was renamed from hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java |
| | |
| | | * 状态 |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 格子号 |
| | | */ |
| | | private Integer slot; |
| | | |
| | | |
| | | } |
File was renamed from hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java |
| | |
| | | package com.mes.temperingglass.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface TemperingGlassInfoMapper extends BaseMapper<TemperingGlassInfo>, MPJBaseMapper<TemperingGlassInfo> { |
| | | public interface TemperingGlassInfoMapper extends MPJBaseMapper<TemperingGlassInfo> { |
| | | |
| | | } |
File was renamed from hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingAgoService.java |
| | |
| | | |
| | | List<TemperingGlassInfo> selectWaitingGlass(); |
| | | |
| | | List<TemperingGlassInfo> selectIntoGlass(); |
| | | List<TemperingGlassInfo> selectIntoGlass(int layoutId); |
| | | |
| | | List<TemperingGlassInfo> selectOutGlass(); |
| | | |
| | | TemperingGlassInfo selectOverGlass(); |
| | | List<TemperingGlassInfo> selectOverGlass(); |
| | | |
| | | List<TemperingGlassInfo> selectLayoutId(); |
| | | } |
File was renamed from hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingAgoServiceImpl.java |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import com.mes.temperingglass.mapper.TemperingMapper; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @DS("salve_hangzhoumes") |
| | | public class TemperingAgoServiceImpl extends MPJBaseServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingAgoService { |
| | | @Autowired |
| | | TemperingMapper temperingMapper; |
| | | TemperingGlassInfoMapper temperingMapper; |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectWaitingGlass() { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectIntoGlass() { |
| | | public List<TemperingGlassInfo> selectIntoGlass(int layoutId) { |
| | | //获取进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("state",2) |
| | | .eq("tempering_layout_id", layoutId) |
| | | .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public TemperingGlassInfo selectOverGlass() { |
| | | //获取过旋转台的玻璃 |
| | | public List<TemperingGlassInfo> selectOverGlass() { |
| | | //获取过旋转台最大的钢化版图id |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.select("top 1 *").eq("state", 4) |
| | | .orderByAsc("tempering_layout_id") |
| | | .orderByDesc("tempering_feed_sequence"); |
| | | return temperingMapper.selectOne(wapper); |
| | | .orderByDesc("tempering_layout_id"); |
| | | //根据最大的版图id显示钢化后的版图信息 |
| | | TemperingGlassInfo glassinfo= temperingMapper.selectOne(wapper); |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("tempering_layout_id",glassinfo.getTemperingLayoutId()); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectLayoutId() { |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("distinct tempering_layout_id") |
| | | .eq("state",2) |
| | | .orderByAsc("tempering_layout_id"); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | } |
| | |
| | | public EdgStorageCageDetails queryChangeGlassInfo(int endcell, String glassId) { |
| | | //获取笼子内数量前二的玻璃数量 |
| | | MPJQueryWrapper<EdgStorageCageDetails> wrapper = new MPJQueryWrapper<>(); |
| | | wrapper.select("count(t.glass_id), t.width, t.height") |
| | | wrapper.select("count(t.glass_id) as count, t.width, t.height") |
| | | .eq("t.state", Const.GLASS_STATE_IN) |
| | | .groupBy("t.width, t.height"); |
| | | if (endcell == Const.A09_OUT_TARGET_POSITION) { |
copy from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
copy to hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-cz.yml
File was copied from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://192.168.1.199:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | application: |
| | | name: cacheGlass |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | # hangzhoumes: |
| | | # url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # pp: |
| | | # url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # salve_hangzhoumes: |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | # username: sa |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | active: cz |
| | | application: |
| | | name: cacheGlass |
| | | mybatis-plus: |
| | |
| | | secondLength: 2500 |
| | | sequence: |
| | | order: false |
| | | |
| | |
| | | package com.mes; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.job.CacheGlassTask; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = CacheGlassModuleApplication.class) |
| | | @SpringBootTest(classes = CacheGlassModuleApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | public class CacheGlassModuleApplicationTest { |
| | | |
| | | @Autowired |
| | | EdgStorageCageService edgStorageCageService; |
| | | @Autowired |
| | | EdgStorageCageDetailsService edgStorageCageDetailsService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | TaskCacheMapper taskCacheMapper; |
| | | |
| | | @Autowired |
| | |
| | | OptimizeDetailMapper optimizeDetailMapper; |
| | | @Autowired |
| | | GlassInfoService glassInfoService; |
| | | @Autowired |
| | | CacheGlassTask cacheGlassTask; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | | String url=getClass().getResource("").getPath(); |
| | | String url = getClass().getResource("").getPath(); |
| | | log.info("完整路径:{}", Arrays.asList(url)); |
| | | } |
| | | |
| | | @Test |
| | | public void queryChangeGlassInfo() { |
| | | cacheGlassTask.queryChangeGlassInfo(Const.A10_OUT_TARGET_POSITION, ""); |
| | | } |
| | | |
| | | @Test |
| | | public void testChangeCellSize() { |
| | | // String url=getClass().getResource("").getPath(); |
| | | // log.info("完整路径:{}", Arrays.asList(url)); |
| | | cacheGlassTask.queryChangeGlassInfo(Const.A09_OUT_TARGET_POSITION, ""); |
| | | } |
| | | |
| | | @Test |
| | | public void testCellSize() { |
| | | // String url=getClass().getResource("").getPath(); |
| | | // log.info("完整路径:{}", Arrays.asList(url)); |
| | | cacheGlassTask.outTo(0, 0, "", "NG24051802A001|1|1|1|1", 0); |
| | | } |
| | | |
| | | @Test |
| | | public void testinTo() { |
| | | // String url=getClass().getResource("").getPath(); |
| | | // log.info("完整路径:{}", Arrays.asList(url)); |
| | | // NG24051802A001|1|4|1|4 |
| | | // cacheGlassTask.inTo("NG24051802A001|1|1|1|1", "1", "1"); |
| | | // cacheGlassTask.inTo("NG24051802A001|1|4|1|4", "1", "1"); |
| | | cacheGlassTask.inTo("NG24051802A001|1|1|2|1", "1", "1"); |
| | | } |
| | | |
| | | @Test |
| | | public void testChangeGlassInfo() { |
| | | // String url=getClass().getResource("").getPath(); |
| | | // log.info("完整路径:{}", Arrays.asList(url)); |
| | | // NG24051802A001|1|4|1|4 |
| | | cacheGlassTask.queryAndChangeGlass("NG24051802A001|1|1|1|1"); |
| | | // cacheGlassTask.queryAndChangeGlass("NG24051802A001|1|4|1|4"); |
| | | } |
| | | |
| | | @Test |
| | | public void testSqlServer() { |
| | | List<TaskCache> list=taskCacheMapper.selectList(null); |
| | | log.info("数据{}",list); |
| | | List<TaskCache> list = taskCacheMapper.selectList(null); |
| | | log.info("数据{}", list); |
| | | log.info("Sql数据:{}", Arrays.asList(list)); |
| | | } |
| | | |
| | |
| | | log.info("Sql数据:{}", Arrays.asList(list)); |
| | | } |
| | | |
| | | @Test |
| | | public void testglassinfo() { |
| | | List<GlassInfo> glassInfos=glassInfoService.selectId("7"); |
| | | log.info("玻璃数据数据:{}", Arrays.asList(glassInfos)); |
| | | } |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | | List<Map<String, Object>> map= edgStorageCageService.selectEdgStorageCages(); |
| | | List<Map<String, Object>> map = edgStorageCageService.selectEdgStorageCages(); |
| | | log.info("笼内信息:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testSelectCacheEmpty() { |
| | | List<EdgStorageCage> map= edgStorageCageService.selectCacheEmpty(); |
| | | List<EdgStorageCage> map = edgStorageCageService.selectCacheEmpty(); |
| | | log.info("笼内空格:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testScan() { |
| | | List<Map<String, Object>> map= edgStorageCageDetailsService.selectCutTerritory(); |
| | | List<Map<String, Object>> map = edgStorageCageDetailsService.selectCutTerritory(); |
| | | log.info("切割当前版图信息:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testPpOptimizeDetail() { |
| | | List<OptimizeDetail> optimizeDetail=optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>() |
| | | List<OptimizeDetail> optimizeDetail = optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>() |
| | | .eq("project_no", "P24032204") |
| | | .eq("stock_id",5) |
| | | .eq("stock_id", 5) |
| | | ); |
| | | log.info("切割当前版图信息:{}", Arrays.asList(optimizeDetail)); |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void testOptimizeDetail() { |
| | | List<Map<String, Object>> map2=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | List<Map<String, Object>> map2 = optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | .selectAll(OptimizeDetail.class) |
| | | .selectAs(OptimizeLayout::getWidth,"olWidth") |
| | | .selectAs(OptimizeLayout::getWidth,"olHeight") |
| | | .select(OptimizeLayout::getWidth,OptimizeLayout::getHeight) |
| | | .leftJoin(OptimizeLayout.class,on-> on.eq(OptimizeLayout::getProjectNo,OptimizeDetail::getProjectNo) |
| | | .eq(OptimizeLayout::getStockId,OptimizeDetail::getStockId)) |
| | | .eq(OptimizeDetail::getProjectNo,"P24032204" ) |
| | | .eq(OptimizeDetail::getStockId,5) |
| | | .selectAs(OptimizeLayout::getWidth, "olWidth") |
| | | .selectAs(OptimizeLayout::getWidth, "olHeight") |
| | | .select(OptimizeLayout::getWidth, OptimizeLayout::getHeight) |
| | | .leftJoin(OptimizeLayout.class, on -> on.eq(OptimizeLayout::getProjectNo, OptimizeDetail::getProjectNo) |
| | | .eq(OptimizeLayout::getStockId, OptimizeDetail::getStockId)) |
| | | .eq(OptimizeDetail::getProjectNo, "P24032204") |
| | | .eq(OptimizeDetail::getStockId, 5) |
| | | ); |
| | | log.info("切割当前版图信息1:{}", Arrays.asList(map2)); |
| | | } |
| | | |
| | | @Test |
| | | public void testOutTask() { |
| | | EdgStorageCageDetails edgStorageCageDetails=edgStorageCageDetailsService.selectConformGlass("1",3); |
| | | EdgStorageCageDetails edgStorageCageDetails = edgStorageCageDetailsService.selectConformGlass("1", 3); |
| | | |
| | | log.info("出片任务:{}", Arrays.asList(edgStorageCageDetails)); |
| | | } |
New file |
| | |
| | | package com.mes.bigstorage.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/6/11 16:45 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class BigStorageDTO { |
| | | private Integer slot; |
| | | private Integer width; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | void finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails); |
| | | |
| | | void outBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails); |
| | | |
| | | /** |
| | | * 按照版图信息获取进片笼子信息 |
| | | * |
| | | * @param glassInfo |
| | | */ |
| | | BigStorageDTO queryTargetSlotByTempering(GlassInfo glassInfo); |
| | | } |
| | |
| | | package com.mes.bigstorage.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface BigStorageCageService extends IService<BigStorageCage> { |
| | | public interface BigStorageCageService extends MPJBaseService<BigStorageCage> { |
| | | |
| | | void updateRemainWidth(int slot); |
| | | |
| | |
| | | package com.mes.bigstorage.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | |
| | | */ |
| | | @Override |
| | | public List<BigStorageCageDetails> selectTask(int taskType) { |
| | | if(taskType==1){ |
| | | if (taskType == 1) { |
| | | //进片任务数据 |
| | | LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>(); |
| | | feedWrapper.eq(BigStorageCageDetails::getState, 1) |
| | | .or() |
| | | .eq(BigStorageCageDetails::getState, 2); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList=baseMapper.selectList(feedWrapper); |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList=bigStorageCageFeedTaskMapper.selectList(null); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper); |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskMapper.selectList(null); |
| | | |
| | | Map<String, BigStorageCageFeedTask> listMap = bigStorageCageFeedTaskList.stream() |
| | | .collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, task -> task)); |
| | |
| | | bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | } |
| | | return bigStorageCageDetailsList; |
| | | }else{ |
| | | } else { |
| | | //出片任务数据 |
| | | LambdaQueryWrapper<BigStorageCageDetails> outWrapper = new LambdaQueryWrapper<>(); |
| | | outWrapper.eq(BigStorageCageDetails::getState, 3) |
| | | .or() |
| | | .eq(BigStorageCageDetails::getState, 4); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList=baseMapper.selectList(outWrapper); |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList=bigStorageCageOutTaskMapper.selectList(null); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(outWrapper); |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = bigStorageCageOutTaskMapper.selectList(null); |
| | | |
| | | Map<String, BigStorageCageOutTask> listMap = bigStorageCageOutTaskList.stream() |
| | | .collect(Collectors.toMap(BigStorageCageOutTask::getGlassId, task -> task)); |
| | |
| | | * 判断当前玻璃是否能上车 |
| | | */ |
| | | @Override |
| | | public double selectGetBoard(String plcFeedReqLine){ |
| | | double carWidth=5000; |
| | | public double selectGetBoard(String plcFeedReqLine) { |
| | | double carWidth = 5000; |
| | | LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>(); |
| | | feedWrapper.eq(BigStorageCageDetails::getState, plcFeedReqLine); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList=baseMapper.selectList(feedWrapper); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> bigStorageCageFeedTaskWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageFeedTaskWrapper |
| | | .eq(BigStorageCageFeedTask::getTaskState,plcFeedReqLine) |
| | | .eq(BigStorageCageFeedTask::getLine,plcFeedReqLine); |
| | | .eq(BigStorageCageFeedTask::getTaskState, plcFeedReqLine) |
| | | .eq(BigStorageCageFeedTask::getLine, plcFeedReqLine); |
| | | |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList=bigStorageCageFeedTaskMapper.selectList(bigStorageCageFeedTaskWrapper); |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskMapper.selectList(bigStorageCageFeedTaskWrapper); |
| | | Map<String, BigStorageCageFeedTask> listMap = bigStorageCageFeedTaskList.stream() |
| | | .collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, task -> task)); |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) { |
| | | BigStorageCageFeedTask bigStorageCageFeedTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | } |
| | | for (BigStorageCageDetails bigStorageCageDetails:bigStorageCageDetailsList |
| | | ) { |
| | | if(bigStorageCageDetails.getBigStorageCageFeedTask().getTaskState()==0){ |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | | ) { |
| | | if (bigStorageCageDetails.getBigStorageCageFeedTask().getTaskState() == 0) { |
| | | carWidth -= Integer.parseInt(bigStorageCageDetails.getWidth().toString()) + bigStorageCageDetails.getGap(); |
| | | } |
| | | } |
| | |
| | | |
| | | //栓除出片任务.更新格子宽度 |
| | | @Override |
| | | public void deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails){ |
| | | public void deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | baseMapper.deleteById(bigStorageCageDetails.getId()); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | } |
| | | |
| | | //理片笼详情破损 |
| | | @Override |
| | | public void damageBigStorageCageDetails(String glassId){ |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper=new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getGlassId,glassId); |
| | | TemperingGlassInfo temperingGlassInfo=temperingGlassInfoMapper.selectOne(temperingGlassInfoWrapper); |
| | | public void damageBigStorageCageDetails(String glassId) { |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getGlassId, glassId); |
| | | TemperingGlassInfo temperingGlassInfo = temperingGlassInfoMapper.selectOne(temperingGlassInfoWrapper); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper=new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getGlassId,glassId); |
| | | BigStorageCageDetails bigStorageCageDetails=baseMapper.selectOne(bigStorageCageDetailsWrapper); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getGlassId, glassId); |
| | | BigStorageCageDetails bigStorageCageDetails = baseMapper.selectOne(bigStorageCageDetailsWrapper); |
| | | |
| | | if(temperingGlassInfo.getState()==-2){ |
| | | if (temperingGlassInfo.getState() == -2) { |
| | | temperingGlassInfoMapper.deleteById(temperingGlassInfo); |
| | | }else{ |
| | | } else { |
| | | temperingGlassInfo.setState(5); |
| | | temperingGlassInfoMapper.updateById(temperingGlassInfo); |
| | | } |
| | |
| | | |
| | | //查询玻璃信息 |
| | | @Override |
| | | public BigStorageCageDetails selectBigStorageCageDetails(String glassId){ |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper=new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getGlassId,glassId); |
| | | GlassInfo glassInfo=glassInfoMapper.selectOne(glassInfoWrapper); |
| | | BigStorageCageDetails bigStorageCageDetails=new BigStorageCageDetails(); |
| | | public BigStorageCageDetails selectBigStorageCageDetails(String glassId) { |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getGlassId, glassId); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper); |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetails.setGap(20); |
| | |
| | | |
| | | //理片笼详情添加 |
| | | @Override |
| | | public void insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails){ |
| | | public void insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | baseMapper.insert(bigStorageCageDetails); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | } |
| | | |
| | | //理片笼详情完成 |
| | | @Override |
| | | public void finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails){ |
| | | if(bigStorageCageDetails.getState()==1||bigStorageCageDetails.getState()==2){ |
| | | public void finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | if (bigStorageCageDetails.getState() == 1 || bigStorageCageDetails.getState() == 2) { |
| | | bigStorageCageDetails.setState(0); |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | bigStorageCageFeedTaskMapper.deleteById(bigStorageCageDetails.getBigStorageCageFeedTask().getId()); |
| | | }else{ |
| | | } else { |
| | | baseMapper.deleteById(bigStorageCageDetails.getId()); |
| | | bigStorageCageOutTaskMapper.deleteById(bigStorageCageDetails.getBigStorageCageOutTask().getId()); |
| | | } |
| | |
| | | |
| | | //手动出片 |
| | | @Override |
| | | public void outBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails){ |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper =new LambdaQueryWrapper<>(); |
| | | public void outBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper |
| | | .eq(TemperingGlassInfo::getGlassId,bigStorageCageDetails.getGlassId()); |
| | | TemperingGlassInfo temperingGlassInfo=temperingGlassInfoMapper.selectOne(temperingGlassInfoWrapper); |
| | | if(temperingGlassInfo.getGlassId()==null){ |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper=new LambdaQueryWrapper<>(); |
| | | .eq(TemperingGlassInfo::getGlassId, bigStorageCageDetails.getGlassId()); |
| | | TemperingGlassInfo temperingGlassInfo = temperingGlassInfoMapper.selectOne(temperingGlassInfoWrapper); |
| | | if (temperingGlassInfo.getGlassId() == null) { |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper |
| | | .eq(GlassInfo::getGlassId,bigStorageCageDetails.getGlassId()); |
| | | GlassInfo glassInfo=glassInfoMapper.selectOne(glassInfoWrapper); |
| | | TemperingGlassInfo temperingGlassInfo1=new TemperingGlassInfo(); |
| | | .eq(GlassInfo::getGlassId, bigStorageCageDetails.getGlassId()); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper); |
| | | TemperingGlassInfo temperingGlassInfo1 = new TemperingGlassInfo(); |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo1); |
| | | |
| | | if(temperingGlassInfo.getTemperingLayoutId()!=null){ |
| | | if (temperingGlassInfo.getTemperingLayoutId() != null) { |
| | | temperingGlassInfo1.setState(-1); |
| | | }else{ |
| | | } else { |
| | | temperingGlassInfo1.setState(-2); |
| | | } |
| | | temperingGlassInfoMapper.insert(temperingGlassInfo1); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public BigStorageDTO queryTargetSlotByTempering(GlassInfo glassInfo) { |
| | | // MPJLambdaWrapper<BigStorageDTO> wrapper = new MPJLambdaWrapper<>(BigStorageCage.class) |
| | | // .selectAll(BigStorageDTO.class) |
| | | // .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | // .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | // .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1) |
| | | // .last("limit 1"); |
| | | BigStorageDTO bigStorageDTO = null; |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(BigStorageCage.class) |
| | | .selectAsClass(BigStorageCage.class, BigStorageDTO.class) |
| | | .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1) |
| | | .last("limit 1"); |
| | | bigStorageDTO = bigStorageCageService.selectJoinOne(BigStorageDTO.class, wrapper); |
| | | if (null != bigStorageDTO) { |
| | | return bigStorageDTO; |
| | | } |
| | | BigStorageCage bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, Const.BIG_STORAGE_WIDTH) |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where tempering_layout_id = " + glassInfo.getTemperingLayoutId()) |
| | | .last("limit 1")); |
| | | if (null != bigStorageCage) { |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | return bigStorageDTO; |
| | | } |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, Const.BIG_STORAGE_WIDTH) |
| | | .last("limit 1")); |
| | | Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃"); |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | return bigStorageDTO; |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id", position = 2) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键id", position = 2) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | |
| | | * 目标位置 |
| | | */ |
| | | @ApiModelProperty(value = "目标位置", position = 4) |
| | | private Integer tragetSlot; |
| | | private Integer targetSlot; |
| | | |
| | | /** |
| | | * 玻璃类型 |
| | |
| | | */ |
| | | @ApiModelProperty(value = "线路", position = 7) |
| | | private Integer line; |
| | | /** |
| | | * 宽度 |
| | | */ |
| | | @ApiModelProperty(value = "宽度", position = 8) |
| | | private Integer width; |
| | | /** |
| | | * 高度 |
| | | */ |
| | | @ApiModelProperty(value = "高度", position = 8) |
| | | private Integer height; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间", position = 8) |
| | | private Date createTime; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.bigstoragetask.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @DS("salve_hangzhoumes") |
| | | public interface BigStorageCageFeedTaskMapper extends BaseMapper<BigStorageCageFeedTask> { |
| | | |
| | | List<String> querySitToUpGlass(); |
| | | } |
| | |
| | | package com.mes.bigstoragetask.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | void addFeedTask(BigStorageCageDetails slotInfo, Integer plcFeedReqLine, int taskType); |
| | | |
| | | List<BigStorageCageFeedTask> querybigStorageCageFeedTask(int taskState); |
| | | |
| | | /** |
| | | * 查询卧转立玻璃是否进片完成 |
| | | */ |
| | | List<String> querySitToUpGlass(); |
| | | } |
| | |
| | | package com.mes.bigstoragetask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import net.bytebuddy.matcher.FilterableList; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | bigStorageCageFeedTask.setId(slotInfo.getId()); |
| | | bigStorageCageFeedTask.setTaskState(0); |
| | | bigStorageCageFeedTask.setLine(plcFeedReqLine); |
| | | bigStorageCageFeedTask.setTragetSlot(slotInfo.getSlot()); |
| | | bigStorageCageFeedTask.setTaskType(taskType); |
| | | baseMapper.insert(bigStorageCageFeedTask); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageCageFeedTask> querybigStorageCageFeedTask(int taskState){ |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> getFeedTaskWrapper=new LambdaQueryWrapper<>(); |
| | | getFeedTaskWrapper.eq(BigStorageCageFeedTask::getTaskState,taskState); |
| | | public List<BigStorageCageFeedTask> querybigStorageCageFeedTask(int taskState) { |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> getFeedTaskWrapper = new LambdaQueryWrapper<>(); |
| | | getFeedTaskWrapper.eq(BigStorageCageFeedTask::getTaskState, taskState); |
| | | return baseMapper.selectList(getFeedTaskWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> querySitToUpGlass() { |
| | | return baseMapper.querySitToUpGlass(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.damage.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/glassinfo/damage") |
| | | public class DamageController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.damage.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class Damage implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private String glassId; |
| | | |
| | | private Integer deviceId; |
| | | |
| | | private String engineerId; |
| | | |
| | | private Integer temperingLayoutId; |
| | | |
| | | private LocalDateTime damageTime; |
| | | |
| | | private String remark; |
| | | |
| | | private Integer type; |
| | | |
| | | private Integer status; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.damage.mapper; |
| | | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | */ |
| | | public interface DamageMapper extends BaseMapper<Damage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.damage.service; |
| | | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | */ |
| | | public interface DamageService extends IService<Damage> { |
| | | |
| | | } |
| | |
| | | package com.mes.edgglasstask.entity; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import net.sf.jsqlparser.expression.DateTimeLiteralExpression; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 线路 |
| | | */ |
| | | @ApiModelProperty(value = "时间", position = 9) |
| | | private DateTime time; |
| | | private Date time; |
| | | |
| | | } |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | 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.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.edgstoragetask.service.TaskCacheService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author SNG-015 |
| | |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | @Value("${mes.sequence.order}") |
| | | private boolean sequenceOrder; |
| | | |
| | | public static boolean bigStorageCageFullAlarm = false; |
| | | |
| | | private int line1Time=0; |
| | | private int line2Time=0; |
| | | private int line1Time = 0; |
| | | private int line2Time = 0; |
| | | |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | // @Scheduled(fixedDelay = 5000) |
| | | // public void plcStorageCageTask() throws InterruptedException { |
| | | // |
| | | // PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | // try { |
| | | // |
| | | // String plcFeedGlassid = ""; |
| | | // String plcFeedReqLine = "0"; |
| | | // if ("1".equals(plcParameterObject.getPlcParameter("D01Request").getValue())) { |
| | | // plcFeedReqLine = "1"; |
| | | // plcFeedGlassid = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | // } |
| | | // if ("1".equals(plcParameterObject.getPlcParameter("D04Request").getValue())) { |
| | | // plcFeedReqLine = "2"; |
| | | // plcFeedGlassid = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | // } |
| | | // line1Time += 1; |
| | | // line2Time += 1; |
| | | // |
| | | // if (!("0".equals(plcFeedReqLine))) { |
| | | // log.info("1、Plc进片请求时"); |
| | | // BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | // GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid); |
| | | // log.info("2、根据玻璃id获取玻璃信息" + glassInfo); |
| | | // if (bigStorageCageDetailsService.selectGetBoard(plcFeedReqLine) >= 0) { |
| | | // BigStorageCageDetails slotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails); |
| | | // if (slotInfo != null) { |
| | | // int taskType = edgGlassTaskInfoService.judgeTasktype(plcFeedReqLine); |
| | | // log.info("3、查询任务表判断当前任务类型为上车等到还是上车启动" + taskType); |
| | | // bigStorageCageFeedTaskService.addFeedTask(slotInfo, Integer.parseInt(plcFeedReqLine), taskType); |
| | | // log.info("4、添加任务到任务表"); |
| | | // bigStorageCageFullAlarm = false; |
| | | // } else { |
| | | // bigStorageCageFullAlarm = true; |
| | | // } |
| | | // } else { |
| | | // log.info("当前玻璃宽度不够上车" + glassInfo); |
| | | // if (!("1".equals(plcFeedReqLine))) { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1); |
| | | // } else { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1); |
| | | // } |
| | | // } |
| | | // } else { |
| | | // List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskService.querybigStorageCageFeedTask(1); |
| | | // log.info("5、查询任务表是否有已经完成的进片任务" + bigStorageCageFeedTaskList.size()); |
| | | // for (BigStorageCageFeedTask bigStorageCageFeedTask : bigStorageCageFeedTaskList |
| | | // ) { |
| | | // BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | // bigStorageCageDetails.setId(bigStorageCageFeedTask.getId()); |
| | | // bigStorageCageDetails.setState(1); |
| | | // bigStorageCageDetailsService.updateById(bigStorageCageDetails); |
| | | // log.info("6、修改理片笼详情玻璃状态"); |
| | | // bigStorageCageFeedTaskService.removeById(bigStorageCageFeedTask); |
| | | // log.info("7、删除已经完成的进片任务"); |
| | | // } |
| | | // //启动阈值 |
| | | // if (line1Time >= 300) { |
| | | // if ("0".equals(plcParameterObject.getPlcParameter("D05Go").getValue())) { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1); |
| | | // } |
| | | // } |
| | | // if (line2Time >= 300) { |
| | | // if ("0".equals(plcParameterObject.getPlcParameter("D02Go").getValue())) { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //查询出片表是否有任务未完成的任务 |
| | | // List<BigStorageCageOutTask> bigStorageCageOutTask = bigStorageCageOutTaskService.querybigStorageCageOutTask(0); |
| | | // if (bigStorageCageOutTask.size() == 0) { |
| | | // boolean result = bigStorageCageService.outGlass(); |
| | | // log.info("8、没有未完成任务时调用出片接口"); |
| | | // if (result == false) { |
| | | // temperingGlassInfoService.schedulingTask(); |
| | | // } |
| | | // } |
| | | // bigStorageCageOutTaskService.updateOutTask(); |
| | | // log.info("9、根据任务表状态修改钢化小片表任务状态"); |
| | | // |
| | | // //来不及送时直接走 |
| | | // String line = Integer.toString(edgGlassTaskInfoService.startTask()); |
| | | // |
| | | // if (!(line.equals(plcFeedReqLine))) { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1); |
| | | // } else { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1); |
| | | // } |
| | | // |
| | | // |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | try { |
| | | |
| | | String plcFeedGlassid = ""; |
| | | String plcFeedReqLine = "0"; |
| | | if ("1".equals(plcParameterObject.getPlcParameter("D01Request").getValue())) { |
| | | plcFeedReqLine = "1"; |
| | | plcFeedGlassid=plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | } |
| | | if ("1".equals(plcParameterObject.getPlcParameter("D04Request").getValue())) { |
| | | plcFeedReqLine = "2"; |
| | | plcFeedGlassid=plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | } |
| | | line1Time+=1; |
| | | line2Time+=1; |
| | | |
| | | if (!("0".equals(plcFeedReqLine))) { |
| | | log.info("1、Plc进片请求时"); |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid); |
| | | log.info("2、根据玻璃id获取玻璃信息" + glassInfo); |
| | | if(bigStorageCageDetailsService.selectGetBoard(plcFeedReqLine)>=0){ |
| | | BigStorageCageDetails slotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails); |
| | | if (slotInfo != null) { |
| | | int taskType = edgGlassTaskInfoService.judgeTasktype(plcFeedReqLine); |
| | | log.info("3、查询任务表判断当前任务类型为上车等到还是上车启动" + taskType); |
| | | bigStorageCageFeedTaskService.addFeedTask(slotInfo, Integer.parseInt(plcFeedReqLine), taskType); |
| | | log.info("4、添加任务到任务表"); |
| | | bigStorageCageFullAlarm = false; |
| | | } else { |
| | | bigStorageCageFullAlarm = true; |
| | | } |
| | | }else{ |
| | | log.info("当前玻璃宽度不够上车" + glassInfo); |
| | | if(!("1".equals(plcFeedReqLine))){ |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1); |
| | | }else{ |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1); |
| | | } |
| | | } |
| | | } else { |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskService.querybigStorageCageFeedTask(1); |
| | | log.info("5、查询任务表是否有已经完成的进片任务" + bigStorageCageFeedTaskList.size()); |
| | | for (BigStorageCageFeedTask bigStorageCageFeedTask : bigStorageCageFeedTaskList |
| | | ) { |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | bigStorageCageDetails.setId(bigStorageCageFeedTask.getId()); |
| | | bigStorageCageDetails.setState(1); |
| | | bigStorageCageDetailsService.updateById(bigStorageCageDetails); |
| | | log.info("6、修改理片笼详情玻璃状态"); |
| | | bigStorageCageFeedTaskService.removeById(bigStorageCageFeedTask); |
| | | log.info("7、删除已经完成的进片任务"); |
| | | } |
| | | //启动阈值 |
| | | if(line1Time>=300){ |
| | | if("0".equals(plcParameterObject.getPlcParameter("D05Go").getValue())){ |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1); |
| | | } |
| | | } |
| | | if(line2Time>=300){ |
| | | if("0".equals(plcParameterObject.getPlcParameter("D02Go").getValue())){ |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //查询出片表是否有任务未完成的任务 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTask=bigStorageCageOutTaskService.querybigStorageCageOutTask(0); |
| | | if(bigStorageCageOutTask.size()==0){ |
| | | boolean result=bigStorageCageService.outGlass(); |
| | | log.info("8、没有未完成任务时调用出片接口"); |
| | | if (result==false){ |
| | | temperingGlassInfoService.schedulingTask(); |
| | | } |
| | | } |
| | | bigStorageCageOutTaskService.updateOutTask(); |
| | | log.info("9、根据任务表状态修改钢化小片表任务状态"); |
| | | |
| | | //来不及送时直接走 |
| | | String line=Integer.toString(edgGlassTaskInfoService.startTask()); |
| | | |
| | | if(!(line.equals(plcFeedReqLine))){ |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1); |
| | | }else{ |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1); |
| | | } |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | public void plcToHomeEdgScan() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String d01Request = plcParameterObject.getPlcParameter("D01Request").getValue(); |
| | | String d01ID1 = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | String d04Request = plcParameterObject.getPlcParameter("D04Request").getValue(); |
| | | String d04ID1 = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | log.info("1、获取到的请求字d01为:{},获取到的扫描ID为:{};获取到的请求字d04为:{},获取到的扫描ID为:{};", |
| | | d01Request, d01ID1, d04Request, d04ID1); |
| | | if (!"1".equals(d01Request) && !"1".equals(d04Request)) { |
| | | log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | return; |
| | | } |
| | | // 0:不干预 ; 1:条件满足情况下立即发车 |
| | | String d02GoAdress = plcParameterObject.getPlcParameter("D02Go").getAddress(); |
| | | // 0:不干预 ; 1:条件满足情况下立即发车 |
| | | String d05GoAdress = plcParameterObject.getPlcParameter("D05Go").getAddress(); |
| | | Boolean flag01 = Boolean.FALSE; |
| | | Boolean flag04 = Boolean.FALSE; |
| | | //按照线路及玻璃id获取相邻两块玻璃 卧转立上的玻璃 |
| | | if ("1".equals(d01Request)) { |
| | | flag01 = judgeGlassTypeStatus(d01ID1, Const.A09_OUT_TARGET_POSITION); |
| | | } |
| | | if ("1".equals(d04Request)) { |
| | | flag04 = judgeGlassTypeStatus(d04ID1, Const.A10_OUT_TARGET_POSITION); |
| | | } |
| | | if (flag01 && flag04) { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer startLine = getStartLine(); |
| | | //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine, d02GoAdress, d05GoAdress); |
| | | } else if (flag01 || flag04) { |
| | | Integer startLine = flag01.equals(Boolean.TRUE) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine, d02GoAdress, d05GoAdress); |
| | | } else { |
| | | log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgFreeCarTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String freeCar = plcParameterObject.getPlcParameter("freeCar").getValue(); |
| | | if ("1".equals(freeCar)) { |
| | | log.info("大车非空闲"); |
| | | return; |
| | | } |
| | | String d01Request = plcParameterObject.getPlcParameter("D01Request").getValue(); |
| | | String d01ID1 = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | String d04Request = plcParameterObject.getPlcParameter("D04Request").getValue(); |
| | | String d04ID1 = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | log.info("1、获取到的请求字d01为:{},获取到的扫描ID为:{};获取到的请求字d04为:{},获取到的扫描ID为:{};", |
| | | d01Request, d01ID1, d04Request, d04ID1); |
| | | //两条线都有进卧转立任务,直接结束 |
| | | if (Const.BIG_STORAGE_REQUEST_IN.equals(d01Request) |
| | | && Const.BIG_STORAGE_REQUEST_IN.equals(d04Request) |
| | | && StringUtils.isNotBlank(d01ID1) |
| | | && StringUtils.isNotBlank(d04ID1)) { |
| | | log.info("两条线都存在进片任务,结束任务"); |
| | | return; |
| | | } |
| | | //获取两条线卧转立是否有玻璃,且任务状态都为2 |
| | | List<String> lineList = bigStorageCageFeedTaskService.querySitToUpGlass(); |
| | | if (CollectionUtils.isEmpty(lineList)) { |
| | | log.info("两条线卧转立为空或者有进片任务未完成,结束任务"); |
| | | return; |
| | | } |
| | | // 0:不干预 ; 1:条件满足情况下立即发车 |
| | | String d02GoAdress = plcParameterObject.getPlcParameter("D02Go").getAddress(); |
| | | // 0:不干预 ; 1:条件满足情况下立即发车 |
| | | String d05GoAdress = plcParameterObject.getPlcParameter("D05Go").getAddress(); |
| | | String line1 = lineList.get(0); |
| | | String flagLine = line1.equals(Const.A09_OUT_TARGET_POSITION) ? d01ID1 : d04ID1; |
| | | if (lineList.size() == 1) { |
| | | //发送 |
| | | if (StringUtils.isNotBlank(flagLine)) { |
| | | return; |
| | | } |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(Integer.parseInt(flagLine), d02GoAdress, d05GoAdress); |
| | | } |
| | | if (StringUtils.isBlank(d01ID1) && StringUtils.isBlank(d04ID1)) { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer line = getStartLine(); |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(line, d02GoAdress, d05GoAdress); |
| | | return; |
| | | } |
| | | int outLine = StringUtils.isBlank(d01ID1) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(outLine, d02GoAdress, d05GoAdress); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgOutTask() { |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 按照玻璃id判断玻璃状态及卧转立是否可直接启动 |
| | | */ |
| | | public Boolean judgeGlassTypeStatus(String glassId, Integer line) { |
| | | //1、获取任务表中相邻玻璃 |
| | | List<EdgGlassTaskInfo> edgGlassTaskInfoList = edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() |
| | | .eq(EdgGlassTaskInfo::getLine, line) |
| | | .apply("time >= (select time from edg_glass_task_info where glass_id = '" + glassId + "')") |
| | | .orderByAsc(EdgGlassTaskInfo::getTime)); |
| | | Assert.isFalse(CollectionUtils.isEmpty(edgGlassTaskInfoList), "识别玻璃信息未出现在尺寸表中,获取相邻两块玻璃失败"); |
| | | //2、获取卧转立剩余宽度 |
| | | Map<String, Object> map = bigStorageCageFeedTaskService.getMap(new QueryWrapper<BigStorageCageFeedTask>() |
| | | .select("cast(5000 - sum(width + 20) as INT)as remainWidth") |
| | | .eq("line", line).eq("task_state", Const.BIG_STORAGE_IN_UP)); |
| | | Integer remainWidth = null == map ? 5000 : Integer.parseInt(map.get("remainWidth") + ""); |
| | | //2、获取卧转立 |
| | | Integer widthFirst = edgGlassTaskInfoList.get(0).getWidth(); |
| | | if (edgGlassTaskInfoList.size() == 1) { |
| | | if (remainWidth >= widthFirst) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst); |
| | | return Boolean.FALSE; |
| | | } else { |
| | | //记录无法放下玻璃,后续判断启动 |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | | Integer widthSecond = edgGlassTaskInfoList.get(1).getWidth(); |
| | | if (remainWidth >= widthFirst) { |
| | | if (remainWidth - widthFirst - Const.BIG_STORAGE_GAP >= widthSecond) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthSecond); |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthSecond); |
| | | } |
| | | return Boolean.FALSE; |
| | | |
| | | } else { |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加任务信息 |
| | | */ |
| | | private Boolean addFeedTask(String glassId, Integer line, Integer taskType, Integer width) { |
| | | BigStorageCageFeedTask bigStorageCageFeedTask = new BigStorageCageFeedTask(); |
| | | bigStorageCageFeedTask.setGlassId(glassId); |
| | | bigStorageCageFeedTask.setTaskState(Const.BIG_STORAGE_REQUEST_IN); |
| | | bigStorageCageFeedTask.setLine(line); |
| | | bigStorageCageFeedTask.setTaskType(taskType); |
| | | bigStorageCageFeedTask.setWidth(width); |
| | | bigStorageCageFeedTask.setCreateTime(new Date()); |
| | | return bigStorageCageFeedTaskService.save(bigStorageCageFeedTask); |
| | | } |
| | | |
| | | /** |
| | | * 获取需要启动的线路:两条线都可启动 获取第一片玻璃版图id最小 版序最大的线路 |
| | | * |
| | | * @return |
| | | */ |
| | | public Integer getStartLine() { |
| | | List<BigStorageCageFeedTask> taskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .inSql(BigStorageCageFeedTask::getId, "select min(id) from big_storage_cage_feed_task where task_state = 2 group by line")); |
| | | Assert.isFalse(CollectionUtils.isEmpty(taskList), "卧转立两条线都没有玻璃进片任务"); |
| | | Map<String, Integer> taskMap = taskList.stream().collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, |
| | | BigStorageCageFeedTask::getLine)); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .in(GlassInfo::getGlassId, taskMap.keySet()) |
| | | .orderByAsc(GlassInfo::getTemperingLayoutId) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence) |
| | | .last("limit 1")); |
| | | return taskMap.get(glassInfo.getGlassId()); |
| | | } |
| | | |
| | | /** |
| | | * 计算任务表进片线路的目标格子,并启动任务 |
| | | */ |
| | | public boolean computeTargetByLine(Integer line, String d02GoAdress, String d05GoAdress) { |
| | | //1、获取任务表中的所有玻璃(指定线路且已经进卧转立完成) |
| | | List<BigStorageCageFeedTask> taskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getLine, line) |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP) |
| | | .orderByAsc(BigStorageCageFeedTask::getId)); |
| | | //2、去笼子内查找是否可以继续存放的笼子 |
| | | List<String> glassIds = taskList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()); |
| | | List<GlassInfo> glassInfos = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIds)); |
| | | AtomicReference<Integer> temperingLayoutIdTemp = new AtomicReference<>(0); |
| | | AtomicReference<Integer> temperingFeedSequenceTemp = new AtomicReference<>(0); |
| | | AtomicReference<BigStorageDTO> bigStorageDTO = new AtomicReference<>(new BigStorageDTO()); |
| | | Map<String, GlassInfo> glassInfoMap = glassInfos.stream().collect(Collectors.toMap(GlassInfo::getGlassId, p -> p)); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = new ArrayList<>(); |
| | | AtomicBoolean taskFlag = new AtomicBoolean(Boolean.TRUE); |
| | | taskList.stream().forEach(e -> { |
| | | BigStorageCageDetails cageDetails = new BigStorageCageDetails(); |
| | | //按照版图信息获取进片笼子格子号 |
| | | GlassInfo info = glassInfoMap.get(e.getGlassId()); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | if (temperingLayoutIdTemp.equals(info.getTemperingLayoutId()) |
| | | && temperingFeedSequenceTemp.equals(info.getTemperingFeedSequence() + 1) |
| | | && info.getWidth() <= bigStorageDTO.get().getWidth()) { |
| | | bigStorageDTO.get().setWidth(bigStorageDTO.get().getWidth() - info.getWidth().intValue() - Const.BIG_STORAGE_GAP); |
| | | } else { |
| | | bigStorageDTO.set(bigStorageCageDetailsService.queryTargetSlotByTempering(info)); |
| | | } |
| | | e.setTargetSlot(bigStorageDTO.get().getSlot()); |
| | | cageDetails.setSlot(bigStorageDTO.get().getSlot()); |
| | | cageDetails.setState(Const.GLASS_STATE_IN); |
| | | temperingLayoutIdTemp.set(info.getTemperingLayoutId()); |
| | | temperingFeedSequenceTemp.set(info.getTemperingFeedSequence()); |
| | | bigStorageCageDetailsList.add(cageDetails); |
| | | taskFlag.set(bigStorageCageFeedTaskService.updateById(e)); |
| | | if (!taskFlag.get()) { |
| | | return; |
| | | } |
| | | }); |
| | | //3、更新进片任务表 遇到问题:无法批量更新,批量更新无法走指定从库 |
| | | |
| | | //4、在详情表中加入进片玻璃信息 |
| | | bigStorageCageDetailsService.saveBatch(bigStorageCageDetailsList); |
| | | if (taskFlag.get()) { |
| | | String lineAddress = line.equals(Const.A09_OUT_TARGET_POSITION) ? d02GoAdress : d05GoAdress; |
| | | // S7object.getinstance().plccontrol.writeWord(lineAddress, (short) 1); |
| | | } |
| | | return taskFlag.get(); |
| | | } |
| | | } |
copy from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
copy to hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-cz.yml
File was copied from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | active: dev |
| | | application: |
| | | name: cacheVerticalGlass |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | mes: |
| | | sequence: |
| | | order: false |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper"> |
| | | |
| | | <select id="querySitToUpGlass" resultType="java.lang.String"> |
| | | select t.line |
| | | from ( |
| | | select line, |
| | | COUNT(glass_id) as total_count, |
| | | SUM(case task_state when 2 then 1 else 0 end) as real_count |
| | | from big_storage_cage_feed_task |
| | | where task_state in (1, 2) |
| | | group by line |
| | | ) t |
| | | where t.total_count = t.real_count |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.job.PlcStorageCageTask; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | */ |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = CacheVerticalClassModuleApplication.class) |
| | | @SpringBootTest(classes = CacheVerticalClassModuleApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | public class CacheVerticalGlassModuleApplicationTest { |
| | | |
| | | @Autowired |
| | | BigStorageCageService bigStorageCageService; |
| | | @Autowired |
| | | PlcStorageCageTask plcStorageCageTask; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | | log.info("完整路径:{}", Arrays.asList("123")); |
| | | } |
| | | |
| | | @Test |
| | | public void computeTargetByLine() { |
| | | // log.info("获取大理片笼信息:{}",bigStorageCageService.querybigStorageCageDetail()); |
| | | plcStorageCageTask.computeTargetByLine(2001, "", ""); |
| | | } |
| | | |
| | | @Test |
| | | public void judgeGlassTypeStatus() { |
| | | // log.info("获取大理片笼信息:{}",bigStorageCageService.querybigStorageCageDetail()); |
| | | plcStorageCageTask.judgeGlassTypeStatus("P24060403|6|7", Const.A09_OUT_TARGET_POSITION); |
| | | } |
| | | |
| | | @Test |
| | | public void getStartLine() { |
| | | // log.info("获取大理片笼信息:{}",bigStorageCageService.querybigStorageCageDetail()); |
| | | Integer startLine = plcStorageCageTask.getStartLine(); |
| | | log.info("---------{}", startLine); |
| | | } |
| | | |
| | | @Test |
| | | public void selectBigStorageCageUsage() { |
| | | // bigStorageCageService.querybigStorageCageDetail(1); |
| | | log.info("获取大理片笼信息:{}", bigStorageCageService.selectBigStorageCageUsage()); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | |
| | | @SpringBootApplication |
| | | @EnableSwagger2 |
| | | @EnableDiscoveryClient |
| | | @EnableScheduling |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | public class LoadGlassModuleApplication { |
| | | public static void main(String[] args) { |
| | |
| | | public Result <List<UpPattenUsage>> pauseTask(@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(),glass); |
| | | if(work){ |
| | | return Result.build(200,"成功",glass); |
| | | }else { |
| | | return Result.build(100,"失败",glass); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("暂停") |
| | | @PostMapping("/pause") //暂停上片任务 |
| | | @ResponseBody |
| | | public Result <List<UpPattenUsage>> pause(@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(),glass); |
| | | boolean work=engineeringService.pauseTask(engineering.getEngineerId(),engineering.getState()); |
| | | List<UpPattenUsage> glass = upPattenUsageService.prioritylist();String message; |
| | | if(work){ |
| | | return Result.build(200,"成功",glass); |
| | | }else { |
| | | return Result.build(100,"成功",glass); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("开始上片") |
| | |
| | | * @return Engineering |
| | | */ |
| | | List<Engineering> selectTask(); |
| | | |
| | | boolean pauseTask(String engineerId, Integer state); |
| | | } |
| | |
| | | LambdaUpdateChainWrapper<Engineering> pauseWrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper()); |
| | | pauseWrapper.set(Engineering::getState,0); |
| | | pauseWrapper.eq(Engineering::getState,1); |
| | | pauseWrapper.update(); |
| | | boolean pause = pauseWrapper.update(); |
| | | //使用projectId作为条件开始工程 |
| | | LambdaUpdateChainWrapper<Engineering> wrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper()); |
| | | wrapper.set(Engineering::getState,state); |
| | | wrapper.eq(Engineering::getEngineerId,projectId); |
| | | return wrapper.update(); |
| | | wrapper.update(); |
| | | return pause; |
| | | } |
| | | |
| | | @Override |
| | |
| | | return engineeringMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public boolean pauseTask(String engineerId, Integer state) { |
| | | //暂停正在进行工程 |
| | | LambdaUpdateChainWrapper<Engineering> pauseWrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper()); |
| | | pauseWrapper.set(Engineering::getState,0); |
| | | pauseWrapper.eq(Engineering::getState,1); |
| | | return pauseWrapper.update(); |
| | | } |
| | | |
| | | } |
| | |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | @Scheduled(fixedDelay = 3000000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcLoadGlassTask() throws InterruptedException { |
| | | try { |
| | | //获取联机状态 |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 30000000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcLoadGlassReport(){ |
| | | //获取是否有汇报 |
| | | String loadStatus = plcParameterObject.getPlcParameter("PlcStatus").getValue(); |
| | |
| | | private EngineeringService engineeringService; |
| | | @Autowired |
| | | private OptimizeProjectService optimizeProjectService; |
| | | @ApiOperation("显示正在出片的工程信息") |
| | | @ApiOperation("显示选择的工程信息") |
| | | @GetMapping("/prioritylist") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<List<UpPattenUsage>> prioritylist() { |
| | |
| | | @PostMapping("/selectUpPattenUsage") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<List<UpPattenUsage>> selectUpPattenUsage(@RequestBody Engineering engineering) { |
| | | List<UpPattenUsage> upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId()); |
| | | return Result.build(200, "", upPattenUsages); |
| | | List<UpPattenUsage> upPattenUsages=null; |
| | | UpPattenUsage upPattenUsage = upPattenUsageService.selectedEngineering(engineering.getEngineerId()); |
| | | if(upPattenUsage == null){ |
| | | upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId()); |
| | | }else { |
| | | upPattenUsages= upPattenUsageService.selectUpPattenUsage(upPattenUsage); |
| | | } |
| | | |
| | | if (!upPattenUsages.isEmpty()) { |
| | | return Result.build(200, "成功", upPattenUsages); |
| | | }else { |
| | | return Result.build(100, "失败", upPattenUsages); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ApiOperation("切换原片上片状态") |
| | | @PostMapping("/updateGlassState") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<Boolean> updateGlassState(@RequestBody UpPattenUsage upPattenUsage) { |
| | | Boolean whether = upPattenUsageService.updateGlassState(upPattenUsage); |
| | | if (whether){ |
| | | return Result.build(200, "成功", whether); |
| | | }else { |
| | | return Result.build(100, "失败", whether); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | List<UpPattenUsage> prioritylist(); |
| | | /** |
| | | * 查询上片表的工程信息 |
| | | * @return List<UpPattenUsage> |
| | | */ |
| | | List<UpPattenUsage> selectUpPattenUsage(UpPattenUsage upPattenUsage); |
| | | /** |
| | | * 查询上片顺序信息 |
| | | * @return List<UpPattenUsage> |
| | | */ |
| | |
| | | */ |
| | | UpPattenUsage selectSequence(UpPattenUsage upPattenUsage); |
| | | |
| | | |
| | | Boolean updateGlassState(UpPattenUsage upPattenUsage); |
| | | } |
| | | |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.engineering.entity.Engineering; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<UpPattenUsage> selectUpPattenUsage(UpPattenUsage upPattenUsage) { |
| | | LambdaQueryWrapper<UpPattenUsage> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(UpPattenUsage::getEngineeringId,upPattenUsage.getEngineeringId()); |
| | | return this.list(wrapper); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return this.getOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateGlassState(UpPattenUsage upPattenUsage) { |
| | | UpdateWrapper<UpPattenUsage> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("id",upPattenUsage.getId()) |
| | | .set("state",upPattenUsage.getState()); |
| | | return this.update(updateWrapper); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @PostMapping("/updateGlassMessage") |
| | | @ResponseBody |
| | | public Result<List<UpWorkstation>> updateGlassMessage(@RequestBody UpWorkstation upwork) { |
| | | upWorkstationService.updateGlassMessage(upwork); |
| | | Boolean info= upWorkstationService.updateGlassMessage(upwork); |
| | | List<UpWorkstation> glass = upWorkstationService.list(); |
| | | return Result.build(200, "", glass); |
| | | if(info){ |
| | | return Result.build(200, "成功", glass); |
| | | }else{ |
| | | return Result.build(100, "失败", glass); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | * 增加人工输入的工位玻璃信息 |
| | | * @param upwork |
| | | */ |
| | | void updateGlassMessage(UpWorkstation upwork); |
| | | Boolean updateGlassMessage(UpWorkstation upwork); |
| | | |
| | | |
| | | String updateMesInkageLoad(short inKageWord); |
| | |
| | | * 增加人工输入的工位玻璃信息/删除人工搬走的玻璃信息 |
| | | */ |
| | | @Override |
| | | public void updateGlassMessage(UpWorkstation upwork) { |
| | | public Boolean updateGlassMessage(UpWorkstation upwork) { |
| | | int update = 0; |
| | | UpdateWrapper<UpWorkstation> updateWrapper = new UpdateWrapper<>(); |
| | | if (upwork.getWorkstationId() == 1 || upwork.getWorkstationId() == 3) { |
| | | updateWrapper.eq("workstation_id", upwork.getWorkstationId()); |
| | | int update = this.baseMapper.update(upwork, updateWrapper); |
| | | 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); |
| | | update = this.baseMapper.update(upwork, updateWrapper); |
| | | } |
| | | } |
| | | return update>0; |
| | | } |
| | | |
| | | @Override |
| | |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "InkageStatus", |
| | | "addressIndex":"22", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | "codeId": "InkageStatus", |
| | | "addressIndex":"22", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "WorkId", |
File was renamed from hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-loc.yml |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://192.168.56.10:3306/pp?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://192.168.1.199:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | |
| | | port: 8083 |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | active: cz |
| | | application: |
| | | name: loadGlass |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | |
| | | |
| | | @Test |
| | | public void textengineering(){ |
| | | Engineering engineering=new Engineering(); |
| | | List<Engineering> glass= engineeringService.selectEngineering("P24032204"); |
| | | engineeringService.saveEngineering(glass); |
| | | log.info("glassinfo:{}", Arrays.asList(glass)); |
| | |
| | | List<OptimizeProject> engineerings=optimizeProjectService.listByState(optimizeRequest); |
| | | log.info("上片表任务中的数据{}",engineerings); |
| | | } |
| | | @Test |
| | | public void textengineering6(){ |
| | | //上片表最后一片 |
| | | UpPattenUsage upPattenUsage=new UpPattenUsage(); |
| | | upPattenUsage.setState(100); |
| | | upPattenUsage.setId(2248L); |
| | | boolean isOver= upPattenUsageService.updateGlassState(upPattenUsage); |
| | | log.info("更改是否成功{}",isOver); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | import com.mes.tools.WebSocketServer; |
| | |
| | | //正在等待进片的玻璃 |
| | | List<TemperingGlassInfo> waitingGlass = temperingAgoService.selectWaitingGlass(); |
| | | jsonObject.append("waitingGlass", waitingGlass); |
| | | //获取整在炉中的两个版图id |
| | | List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId(); |
| | | //进炉中的玻璃 |
| | | List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(); |
| | | List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0).getTemperingLayoutId()); |
| | | jsonObject.append("intoGlass", intoGlass); |
| | | //进炉中的第二个版图 |
| | | if (layoutId.size() > 1) { |
| | | List<TemperingGlassInfo> intoGlass2 = temperingAgoService.selectIntoGlass(layoutId.get(1).getTemperingLayoutId()); |
| | | jsonObject.append("intoGlass2", intoGlass2); |
| | | } |
| | | //出炉后的玻璃 |
| | | List<TemperingGlassInfo> outGlass = temperingAgoService.selectOutGlass(); |
| | | jsonObject.append("outGlass", outGlass); |
| | | //过旋转台钢化后的玻璃 |
| | | TemperingGlassInfo overGlass = temperingAgoService.selectOverGlass(); |
| | | List<TemperingGlassInfo> overGlass = temperingAgoService.selectOverGlass(); |
| | | jsonObject.append("overGlass", overGlass); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); |
| | |
| | | package com.mes.temperingglass.controller; |
| | | |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | import com.mes.temperingglass.service.TemperingOverService; |
| | | import com.mes.temperingglass.service.TemperingService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public class TemperingGlassInfoController { |
| | | |
| | | @Autowired |
| | | TemperingService temperingService; |
| | | @Autowired |
| | | private TemperingAgoService temperingAgoService; |
| | | |
| | | @ApiOperation("查询钢化等片中的版图信息,状态为1的为已到,状态为0的为等待中") |
| | |
| | | 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("查询进炉中的钢化等片中的版图信息,状态全为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() { |
copy from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
copy to hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-cz.yml
File was copied from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | application: |
| | | name: temperingGlass |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | |
| | | port: 8084 |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | active: cz |
| | | application: |
| | | name: temperingGlass |
| | | mybatis-plus: |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/3/27 16:37 |
| | | * @Description: |
| | | */ |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = TemperingGlassModuleApplication.class) |
| | | public class TemperingApplicationTest { |
| | | |
| | | @Autowired |
| | | private TemperingAgoService temperingAgoService; |
| | | |
| | | |
| | | @Test |
| | | public void testFindPa() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectIntoGlass(); |
| | | log.info("进炉中的玻璃:{}", Arrays.asList(glass)); |
| | | } |
| | | @Test |
| | | public void testFindPa2() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectOutGlass(); |
| | | log.info("已出中的玻璃:{}", Arrays.asList(glass)); |
| | | } |
| | | |
| | | @Test |
| | | public void testFindPa3() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectWaitingGlass(); |
| | | log.info("等待中的玻璃:{}", Arrays.asList(glass)); |
| | | } |
| | | @Test |
| | | public void testFindPa4() { |
| | | TemperingGlassInfo glass = temperingAgoService.selectOverGlass(); |
| | | log.info("等待中的玻璃:{}", Arrays.asList(glass)); |
| | | } |
| | | } |
| | | //package com.mes; |
| | | // |
| | | //import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | //import com.mes.temperingglass.service.TemperingAgoService; |
| | | //import lombok.extern.slf4j.Slf4j; |
| | | //import org.junit.Test; |
| | | //import org.junit.runner.RunWith; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.test.context.SpringBootTest; |
| | | //import org.springframework.test.context.junit4.SpringRunner; |
| | | // |
| | | //import java.util.Arrays; |
| | | //import java.util.List; |
| | | // |
| | | ///** |
| | | // * @Author : zhoush |
| | | // * @Date: 2024/3/27 16:37 |
| | | // * @Description: |
| | | // */ |
| | | //@Slf4j |
| | | //@RunWith(SpringRunner.class) |
| | | //@SpringBootTest(classes = TemperingGlassModuleApplication.class) |
| | | //public class TemperingApplicationTest { |
| | | // |
| | | // @Autowired |
| | | // private TemperingAgoService temperingAgoService; |
| | | // |
| | | // |
| | | // @Test |
| | | // public void testFindPa() { |
| | | // List<TemperingGlassInfo> glass = temperingAgoService.selectIntoGlass(12); |
| | | // log.info("进炉中的玻璃:{}", Arrays.asList(glass)); |
| | | // } |
| | | // @Test |
| | | // public void testFindPa2() { |
| | | // List<TemperingGlassInfo> glass = temperingAgoService.selectOutGlass(); |
| | | // log.info("已出中的玻璃:{}", Arrays.asList(glass)); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void testFindPa3() { |
| | | // List<TemperingGlassInfo> glass = temperingAgoService.selectWaitingGlass(); |
| | | // log.info("等待中的玻璃:{}", Arrays.asList(glass)); |
| | | // } |
| | | // @Test |
| | | // public void testFindPa4() { |
| | | // List<TemperingGlassInfo> glass = temperingAgoService.selectOverGlass(); |
| | | // log.info("等待中的玻璃:{}", Arrays.asList(glass)); |
| | | // } |
| | | // @Test |
| | | // public void testFindPa5() { |
| | | // List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId(); |
| | | // //进炉中的玻璃 |
| | | // log.info("版图id:{}", Arrays.asList(layoutId.get(0).getTemperingLayoutId())); |
| | | // List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0).getTemperingLayoutId()); |
| | | // log.info("玻璃版图id:{}", Arrays.asList(intoGlass)); |
| | | // List<TemperingGlassInfo> intoGlass2 = temperingAgoService.selectIntoGlass(layoutId.get(1).getTemperingLayoutId()); |
| | | // log.info("玻璃版图id:{}", Arrays.asList(intoGlass2)); |
| | | // } |
| | | //} |
File was renamed from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
| | | password: 123456 |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | active: cz |
| | | application: |
| | | name: unLoadGlass |
| | | |