Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
3 文件已复制
91个文件已修改
2 文件已重命名
19个文件已添加
6个文件已删除
| | |
| | | export const WebSocketHost = "localhost"; |
| | | // export const WebSocketHost = "192.168.1.199"; |
| | | export const WebSocketHost = "10.153.19.150"; |
| | | export const host = "88"; |
| | |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | |
| | | const tableData = ref([]) |
| | | const slot = ref('') |
| | | |
| | | |
| | | request.post("/cacheGlass/edgStorageCage/selectEdgStorageCage").then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | console.log(res.data); |
| | | tableData.value = res.data |
| | | console.log(res.data[0].slot); |
| | | const adjustedRects = ref([]); |
| | | onMounted(async () => { |
| | | try { |
| | | const response = await request.post('/cacheGlass/edgStorageCage/selectEdgStorageCage'); // 替换为你的API端点 |
| | | if (response.code === 200) { |
| | | const rawRects = response.data; // 设置矩形数据 |
| | | tableData.value = response.data |
| | | console.log(response.data); |
| | | adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | width: rect.width * 0.5 , |
| | | id: rect.id * 10, |
| | | })); |
| | | console.log(adjustedRects.value); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error fetching rects :', error); |
| | | } |
| | | }); |
| | | |
| | | const toggleEnableState = async (row) => { |
| | | const newState = row.enable_state === 1 ? 0 : 1; |
| | | // 发送请求到后端更新状态(这里省略了实际的请求逻辑) |
| | | const response = await request.post('/cacheGlass/edgStorageCage/updateEdgStorageCage', { id: row.id, enablestate: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | row.enable_state = newState; |
| | | }; |
| | | const open = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableData.value = data.EdgStorageCageinfos[0] |
| | | // adjustedRects.value = data.EdgStorageCageinfos[0] |
| | | adjustedRects.value = data.EdgStorageCageinfos[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | width: rect.width * 0.5 , |
| | | id: rect.id * 10, |
| | | })); |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | } |
| | | ] |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | }) |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | prop="enable_state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.enable_state==1?"启用":"未启用" }}</el-tag> |
| | | <el-tag |
| | | :type="scope.row.enable_state === 1 ? 'success' : 'danger'" |
| | | @click="toggleEnableState(scope.row)" |
| | | > |
| | | {{ scope.row.enable_state === 1 ? '启用' : '禁用' }} |
| | | </el-tag> |
| | | </template> |
| | | <!-- <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.enable_state==1?"启用":"未启用" }}</el-tag> |
| | | </template> --> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" width="200"> |
| | | <template #default="scope"> |
| | |
| | | </el-card> |
| | | </div> |
| | | <div id="awatch"> |
| | | <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;"> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -124px;margin-left: 480px;"></div> |
| | | <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;position: relative;"> |
| | | <div style="position: absolute; width: 500px;height: 95px;margin-top: -165px;margin-left: 450px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="rect" |
| | | :style="{ position: 'absolute', |
| | | top: `${rect.id}px`, left: `10px`, width: `${rect.width}px`, height: `5px`, |
| | | backgroundColor: '#409EFF' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | <!-- <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -124px;margin-left: 480px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -30px;margin-left: 850px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: 30px;margin-left: 695px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: 30px;margin-left: 695px;"></div> --> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | } |
| | | #awatch{ |
| | | height: 460px; |
| | | width: 1500px; |
| | | /* margin-top: -60px; */ |
| | | } |
| | | </style> |
| | |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | |
| | | const tableData = ref([]) |
| | | const slot = ref('') |
| | | const adjustedRects = ref([]); |
| | | |
| | | |
| | | request.get("/unLoadGlass/downStorage/selectStorageCage").then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | console.log(res.data); |
| | | tableData.value = res.data |
| | | console.log(res.data[0].slot); |
| | | onMounted(async () => { |
| | | try { |
| | | const response = await request.get('/unLoadGlass/downStorage/selectStorageCage'); // 替换为你的API端点 |
| | | if (response.code === 200) { |
| | | const rawRects = response.data; // 设置矩形数据 |
| | | tableData.value = response.data |
| | | console.log(response.data); |
| | | adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | width: rect.width * 0.5 , |
| | | id: rect.id * 10, |
| | | })); |
| | | console.log(adjustedRects.value); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error fetching rects :', error); |
| | | } |
| | | }); |
| | | |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | const toggleEnableState = async (row) => { |
| | | const newState = row.enable_state === 1 ? 0 : 1; |
| | | // 发送请求到后端更新状态(这里省略了实际的请求逻辑) |
| | | const response = await request.post('/unLoadGlass/downStorage/updateDownStorageCage', { id: row.id, enablestate: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | ] |
| | | row.enable_state = newState; |
| | | }; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableData.splice(0, tableData.length, ...data.params[0]); |
| | | // tableData.value = data.params[0] |
| | | // adjustedRects.value = data.EdgStorageCageinfos[0] |
| | | adjustedRects.value = data.params[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | width: rect.width * 0.5 , |
| | | id: rect.id * 10, |
| | | })); |
| | | |
| | | }) |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | |
| | | |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | prop="enable_state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.enable_state==1?"启用":"未启用" }}</el-tag> |
| | | <el-tag |
| | | :type="scope.row.enable_state === 1 ? 'success' : 'danger'" |
| | | @click="toggleEnableState(scope.row)" |
| | | > |
| | | {{ scope.row.enable_state === 1 ? '启用' : '禁用' }} |
| | | </el-tag> |
| | | </template> |
| | | <!-- <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.enable_state==1?"启用":"未启用" }}</el-tag> |
| | | </template> --> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" width="200"> |
| | | <template #default="scope"> |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <!-- <el-dialog v-model="adda" top="30vh" width="25%" title="是否删除该条信息?" > |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirma"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="adda = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> --> |
| | | </div> |
| | | <div id="awatch"> |
| | | <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;"> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -124px;margin-left: 480px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -30px;margin-left: 850px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: 30px;margin-left: 695px;"></div> |
| | | <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;position: relative;"> |
| | | <div style="position: absolute; width: 500px;height: 95px;margin-top: -165px;margin-left: 450px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="rect" |
| | | :style="{ position: 'absolute', |
| | | top: `${rect.id}px`, left: `10px`, width: `${rect.width}px`, height: `5px`, |
| | | backgroundColor: '#409EFF' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | } |
| | | #awatch{ |
| | | height: 460px; |
| | | width: 1500px; |
| | | /* margin-top: -60px; */ |
| | | } |
| | | </style> |
| | |
| | | </el-scrollbar> |
| | | </el-card> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted } from 'vue'; |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | const blind = ref(false) |
| | | const olWidth = ref(); |
| | | const olHeight = ref(); |
| | |
| | | |
| | | 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); |
| | | |
| | | console.log(rect); |
| | | |
| | | // console.log( (rect.width*100) / 300 ); |
| | | } else { |
| | |
| | | } |
| | | }); |
| | | } |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | |
| | | // adjustedRects.value = data.currentCutTerritory[0] |
| | | adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | 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.002 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | // console.log("更新后数据", tableData); |
| | | |
| | | }; |
| | | |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import request from "@/utils/request" |
| | | |
| | | import { ref, onMounted } from 'vue'; |
| | | // import { ref } from 'vue' |
| | | |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | const dialogFormVisible = ref(true) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | |
| | | const adjustedRectsa = ref([]); |
| | | const adjustedRectsb = ref([]); |
| | | // 进炉中 |
| | | 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 => ({ |
| | | 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(rect); |
| | | console.log(data.intoGlass[0]); |
| | | adjustedRectsa.value = data.waitingGlass[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, |
| | | state: rect.state |
| | | })); |
| | | |
| | | // 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); |
| | | } |
| | | adjustedRectsb.value = data.outGlass[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, |
| | | state: rect.state |
| | | })); |
| | | }; |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | // 进炉前 |
| | | 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: [ |
| | | { |
| | | } |
| | | ], |
| | | }) |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </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-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" |
| | | :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> |
| | | </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 |
| | |
| | | :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> |
| | | </el-scrollbar> |
| | | </div> |
| | | |
| | | </el-card> |
| | | </div> |
| | | <div v-if="dialogFormVisiblea"> |
| | |
| | | <el-scrollbar height="630px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | 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> |
| | |
| | | <el-scrollbar height="630px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | 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> |
| | | <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> |
| | |
| | | const adda = ref(false) |
| | | const flake = ref(false) |
| | | const flakea = ref(false) |
| | | import { WebSocketHost } from '@/utils/constants' |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | const ida = ref(null); |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | |
| | | const selectedValuea = ref(''); |
| | | const selectedValueb = ref(''); |
| | | const selectedValuec = ref(''); |
| | | const upstatus = ref(''); // 假设这个用于显示自动/手动状态 |
| | | const upstatus = ref('上片机手动状态:'); // 假设这个用于显示自动/手动状态 |
| | | const cuttingMachine = ref(''); // 假设这个用于存储后端返回的状态值(0或1) |
| | | const cuttingMachineStatusColor = ref(''); // 用于动态设置i标签的背景色 |
| | | const cuttingMachineStatusColor = ref('#911005'); // 用于动态设置i标签的背景色 |
| | | const inKageWord = ref(0); // 用于存储要传递给接口的inKageWord值 |
| | | const options = ref<any[]>([]); // 下拉选项列表 |
| | | const selectOptions = ref<Array<any>>([]); // 下拉选选项数组 |
| | |
| | | // 更新表格数据 |
| | | console.log('成功获取表格数据:', response.data); |
| | | tableData.splice(0, tableData.length, ...response.data); |
| | | window.localStorage.setItem('engineeringId', response.data[0].engineeringId) |
| | | // window.localStorage.setItem('engineeringId', response.data[0].engineeringId) |
| | | // 获取唯一值 |
| | | const uniqueWidths = new Set(response.data.map(item => item.width)); |
| | | const uniqueHeights = new Set(response.data.map(item => item.height)); |
| | |
| | | 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") |
| | | } |
| | | }); |
| | |
| | | const titleSelectJsona = ref({ |
| | | processTypea: [], |
| | | }) |
| | | const socketUrl = `ws://10.153.19.150:88/api/loadGlass/api/talk/loadGlass`; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | |
| | | } |
| | | } 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) { |
| | | // 处理错误 |
| | |
| | | const response = await request.post('/loadGlass/up-patten-usage/selectUpPattenUsage', { |
| | | engineerId: selectedProjectNo.value, |
| | | }) |
| | | window.localStorage.setItem('engineeringId', selectedProjectNo.value) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | |
| | | })); |
| | | } 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://10.153.19.150:88/api/loadGlass/api/talk/loadGlass'; |
| | | const wsUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`; |
| | | const ws = new WebSocket(wsUrl); |
| | | ws.onopen = () => { |
| | | console.log('WebSocket连接已打开'); |
| | |
| | | |
| | | // 监听WebSocket的消息事件 |
| | | ws.onmessage = (event) => { |
| | | // 假设服务器发送的是JSON格式的字符串 |
| | | try { |
| | | const data = JSON.parse(event.data); // 解析消息为JSON |
| | | |
| | | // 假设服务器发送的数据结构是 { InkageStatus: ["1"] } |
| | | if (data && Array.isArray(data.InkageStatus) && data.InkageStatus.length > 0) { |
| | | const status = data.InkageStatus[0]; |
| | | cuttingMachine.value = status; |
| | | upstatus.value = status === '1' ? '上片机联机状态:' : '上片机手动状态:'; |
| | | cuttingMachineStatusColor.value = status === '1' ? '#911005' : 'green'; |
| | | cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005'; |
| | | inKageWord.value = status === '1' ? 0 : 1; |
| | | } else { |
| | | // 处理错误情况或无效数据 |
| | |
| | | if (response.code == 200) { |
| | | const status = response.data.status; |
| | | upstatus.value = status === '1' ? '上片机联机状态:' : '上片机手动状态:'; |
| | | cuttingMachineStatusColor.value = status === '1' ? '#911005' : 'green'; |
| | | cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005'; |
| | | // 显示成功消息 |
| | | ElMessage.success(response.message); |
| | | } else { |
| | |
| | | ElMessage.error('请求时发生错误'); |
| | | } |
| | | }; |
| | | // const confirmCutting = async () => { |
| | | // try { |
| | | // const response = await request.post('/loadGlass/LoadGlass/updateMesInkageLoad', { |
| | | // inKageWord: inKageWord.value |
| | | // }) |
| | | // if (response.code == 200) { |
| | | // inKageWord == '1' ? '上片机联机状态:' : '上片机手动状态:'; |
| | | // inKageWord.value == '1' ? '#911005' : 'green'; |
| | | // ElMessage.success(response.message); |
| | | // } else { |
| | | // // 请求失败,显示错误消息 |
| | | // ElMessage.error(response.msg); |
| | | // } |
| | | // } |
| | | // catch (error) { |
| | | // // 处理错误 |
| | | // console.error(error); |
| | | // } |
| | | // } |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <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-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="primary" @click="handleBind">开始上片</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" @click="handleBinda">暂停</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handleBindb">停止任务</el-button> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handleBindb">停止任务</el-button> --> |
| | | |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | |
| | | <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> --> |
| | | <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> |
| | |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | |
| | | import { ref } from 'vue' |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { tr } from "element-plus/es/locale"; |
| | | const dialogFormVisible = ref(false) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | | const tableData = ref([]) |
| | | const tableDatab = ref([]) |
| | | const tableDatac = ref([]) |
| | | const tableDatad = ref([]) |
| | | const tableDatae = ref([]) |
| | | const adjustedRects = ref([]); |
| | | const height = ref([]); |
| | | |
| | | const carposition1 = ref(60); |
| | | const carposition2 = ref(220); |
| | |
| | | const timers2 =ref(true); |
| | | const timers3 =ref(true); |
| | | const timers4 =ref(true); |
| | | const cellshow=ref(false); |
| | | const cellshow5=ref(false); |
| | | const c1=ref(false); |
| | | const c2=ref(false); |
| | |
| | | const million1=ref(0); |
| | | const million3=ref(0); |
| | | const million4=ref(0); |
| | | const cell1=ref(true); |
| | | const cell2=ref(true); |
| | | const cell3=ref(true); |
| | | const cell4=ref(true); |
| | | const cell5=ref(true); |
| | | const cell6=ref(true); |
| | | const cell7=ref(true); |
| | | const cell8=ref(true); |
| | | |
| | | const currentPage4 = ref(4) |
| | | const pageSize4 = ref(100) |
| | | const tableData = [ |
| | | { |
| | | id: '1', |
| | | a: '1', |
| | | b: '1', |
| | | c: '123456789', |
| | | d: '1568251', |
| | | e: '1', |
| | | f: '100*100', |
| | | g: '', |
| | | }, |
| | | ] |
| | | const tableDatab = [ |
| | | { |
| | | id: '2', |
| | | a: '2', |
| | | b: '2', |
| | | c: '123456789', |
| | | d: '1568251', |
| | | e: '1', |
| | | f: '100*100', |
| | | g: '', |
| | | } |
| | | ] |
| | | |
| | | const dialogForm = () => { |
| | | ElMessageBox.confirm( |
| | | '确定要急停吗?', |
| | |
| | | } |
| | | |
| | | var timer=setInterval(() => { |
| | | console.log(million.value,million1.value); |
| | | // console.log(million.value,million1.value); |
| | | million.value+=1; |
| | | if(million.value-million1.value!==12){ |
| | | |
| | |
| | | } |
| | | }else{ |
| | | million1.value=million.value; |
| | | if(cellshow.value==true){ |
| | | cellshow.value=false; |
| | | |
| | | }else{ |
| | | cellshow.value=true; |
| | | |
| | | } |
| | | if(cellshow1.value==true){ |
| | | cellshow1.value=false; |
| | | }else{ |
| | |
| | | }, 1000); |
| | | |
| | | var timer=setInterval(() => { |
| | | console.log(million3.value,million4.value); |
| | | // console.log(million3.value,million4.value); |
| | | million3.value+=1; |
| | | if(million3.value-million4.value!==12){ |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableDatac.value = data.bigStorageCageDetailsOutTask[0] |
| | | tableDatad.value = data.bigStorageCageDetailsFeedTask[0] |
| | | tableData.value = data.bigStorageCageInfo[0] |
| | | tableDatab.value = data.temperingGlassInfoList[0] |
| | | tableDatae.value = data.bigStorageCageUsage[0] |
| | | adjustedRects.value = data.bigStorageCageInfo1[0] |
| | | // adjustedRects.value = data.bigStorageCageInfo1[0].map(rect => ({ |
| | | // ...rect, // 复制原始对象的其他属性 |
| | | // height: rect.length *0.5, |
| | | |
| | | // })); |
| | | window.localStorage.setItem('length', data.bigStorageCageInfo1[0].length) |
| | | let length = window.localStorage.getItem('length') |
| | | console.log(length); |
| | | |
| | | }; |
| | | // function getRectHeight(length: number) { |
| | | // return length > 0 ? 29 / length : 29; |
| | | // } |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | function getStatusType(enableState: number) { |
| | | switch (enableState) { |
| | | case 0: |
| | | return 'warning'; |
| | | case 1: |
| | | return 'success'; |
| | | } |
| | | ], |
| | | }) |
| | | } |
| | | function getStatusText(enableState: number) { |
| | | switch (enableState) { |
| | | case 0: |
| | | return '禁用'; |
| | | case 1: |
| | | return '启用'; |
| | | } |
| | | } |
| | | function getStatusTypea(ishorizontal: number) { |
| | | switch (ishorizontal) { |
| | | case 0: |
| | | return 'warning'; |
| | | case 1: |
| | | return 'success'; |
| | | } |
| | | } |
| | | function getStatusTexta(ishorizontal: number) { |
| | | switch (ishorizontal) { |
| | | case 0: |
| | | return '不接受'; |
| | | case 1: |
| | | return '接受'; |
| | | } |
| | | } |
| | | function getStatusTypeb(state: number) { |
| | | switch (state) { |
| | | case 0: |
| | | return 'success'; |
| | | case 1: |
| | | return 'primary'; |
| | | } |
| | | } |
| | | function getStatusTextb(state: number) { |
| | | switch (state) { |
| | | case 0: |
| | | return '出片完成'; |
| | | case 1: |
| | | return '等待中'; |
| | | case 2: |
| | | return '等待中'; |
| | | } |
| | | } |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="height: 700px;"> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisible = true">手动进片</el-button> --> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">订单信息</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">理片笼信息</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">出片队列</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">终止进片</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">终止出片</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger" @click="dialogForm">软急停</el-button> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">终止进片</el-button> --> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">终止出片</el-button> --> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger" @click="dialogForm">软急停</el-button> --> |
| | | |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <el-table height="100%" ref="table" |
| | | @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="a" align="center" label="笼子" min-width="120" /> |
| | | <el-table-column prop="b" align="center" label="格子" min-width="120" /> |
| | | <el-table-column prop="c" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="d" align="center" label="流程卡号" min-width="120" /> |
| | | <el-table-column prop="e" align="center" label="钢化版图号" min-width="157" /> |
| | | <el-table-column prop="f" align="center" label="尺寸" min-width="120" /> |
| | | <el-table-column prop="g" align="center" label="结束任务" min-width="120"> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="text">完成任务</el-button> |
| | | :data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="bigStorageCageOutTask.glassId" align="center" label="出片玻璃ID" min-width="80" /> |
| | | <el-table-column prop="bigStorageCageOutTask.startSlot" align="center" label="起始位置" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageOutTask.endSlot" align="center" label="目标位置" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageOutTask.trainNumber" align="center" label="车次" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageOutTask.serialNumber" align="center" label="序号" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageOutTask.taskState" align="center" label="任务状态" min-width="157"> |
| | | <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.bigStorageCageOutTask.taskState==0?"等待进片":"进行中" }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="结束任务" align="center" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">完成任务</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <el-table height="100%" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="进片玻璃ID" min-width="80" /> |
| | | <el-table-column prop="a" align="center" label="笼子" min-width="120" /> |
| | | <el-table-column prop="b" align="center" label="格子" min-width="120" /> |
| | | <el-table-column prop="c" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="d" align="center" label="流程卡号" min-width="120" /> |
| | | <el-table-column prop="e" align="center" label="钢化版图号" min-width="157" /> |
| | | <el-table-column prop="f" align="center" label="尺寸" min-width="120" /> |
| | | <el-table-column prop="g" align="center" label="结束任务" min-width="120"> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="text">完成任务</el-button> |
| | | :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="bigStorageCageFeedTask.glassId" align="center" label="进片玻璃ID" min-width="80" /> |
| | | <el-table-column prop="bigStorageCageFeedTask.tragetSlot" align="center" label="目标位置" min-width="120" /> |
| | | <!-- <el-table-column prop="task_type" align="center" label="任务类型" min-width="120" />没有返回字段 --> |
| | | <el-table-column prop="bigStorageCageFeedTask.taskState" align="center" label="任务状态" min-width="120"> |
| | | <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.bigStorageCageFeedTask.taskState==0?"等待进片":"进行中" }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="bigStorageCageFeedTask.line" align="center" label="线路" min-width="120" /> |
| | | <el-table-column fixed="right" label="结束任务" align="center" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">完成任务</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <div style="padding: 10px;display: flex;height:110px;"> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#1</el-col> |
| | | <div v-for="(item, index) in tableDatae" :key="index" id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#{{ item.device_id }}</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | <span>使用率</span><span>{{ item.percentage }}</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | <span>空闲(格子数)</span><span>{{ item.count }}</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#2</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#3</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#4</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#5</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#6</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#7</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#8</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <!-- <div v-for="n in 8" :key="n" id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#1</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> --> |
| | | </div> |
| | | <!-- <div id="awatch"> |
| | | <img src="../../assets/cp.png" alt="" style="width: 70%;height: 70%;margin-left: 160px;"> |
| | |
| | | </div> |
| | | |
| | | <div v-show="c2" class="img-car3" :style="'z-index:999;left:247px;top:' + carposition3 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow3" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div> |
| | | <div v-show="cellshow3" style="margin-top:10px;width:220px;height:5px;background-color:#409EFF;"></div> |
| | | </div> |
| | | <div class="img-car4" :style="'z-index:999;left:704px;top:' + carposition4 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow4" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div> |
| | | </div> |
| | | <div v-show="cellshow" style="width: 200px;height: 5px;position: absolute;top:70px;left: 480px;background-color: #409EFF;"> |
| | | <div v-show="cell1" style="width: 227px;height: 29px;position: absolute;top:55px;left: 465px;"> |
| | | <div |
| | | v-for="(item, index) in adjustedRects" |
| | | :key="index" |
| | | :style="{ |
| | | top: `1px`, width: `227px`, |
| | | backgroundColor: '#409EFF', |
| | | height: `height`+ `px` |
| | | }" |
| | | > |
| | | </div> |
| | | <div v-show="cellshow5" style="width: 200px;height: 5px;position: absolute;top:70px;left: 480px;background-color: #409EFF;"> |
| | | <!-- <div |
| | | v-for="(item, index) in adjustedRects" |
| | | height: `${rect.height}px`, |
| | | :key="index" |
| | | :style="{ |
| | | width: '227px', |
| | | height: '1px', |
| | | backgroundColor: '#409EFF', |
| | | top: '1px' |
| | | }" |
| | | > |
| | | </div> --> |
| | | </div> |
| | | <!-- <div v-show="cell2" style="width: 227px;height: 29px;position: absolute;top:86px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:117px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:148px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:208px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:238px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:269px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;background-color: #409EFF;"> |
| | | </div> --> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisiblea" top="10vh" width="85%" title="订单信息" > |
| | | <el-input placeholder="请输入工程号" style="width: 180px;size: mini;"></el-input> |
| | | <el-button style="margin-left: 10px;size: mini;" type="primary">查询</el-button> |
| | | <el-dialog v-model="dialogFormVisiblea" top="10vh" width="85%" title="理片笼信息" > |
| | | <!-- <el-input placeholder="请输入工程号" style="width: 180px;size: mini;"></el-input> --> |
| | | <!-- <el-button style="margin-left: 10px;size: mini;" type="primary">查询</el-button> --> |
| | | <el-table ref="table" style="margin-top: 20px;height: 500px;" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDataa" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="ida" align="center" label="玻璃id" min-width="80" /> |
| | | <el-table-column prop="typea" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="typea" align="center" label="长" min-width="120" /> |
| | | <el-table-column prop="typea" align="center" label="宽" min-width="120" /> |
| | | <el-table-column prop="typea" align="center" label="厚" min-width="120" /> |
| | | :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="理片笼号" min-width="120" /> |
| | | <el-table-column prop="slot" align="center" label="栅格号" min-width="120" /> |
| | | <el-table-column |
| | | align="center" |
| | | label="启用状态" |
| | | min-width="80" |
| | | prop="enableState" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType(scope.row.enableState)"> |
| | | {{ getStatusText(scope.row.enableState) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remainWidth" align="center" label="剩余宽度" min-width="120" /> |
| | | </el-table> |
| | | <div id="demo-pagination-block"> |
| | | <el-pagination |
| | |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleb" top="10vh" width="85%" title="出片队列" > |
| | | <div style="display: flex;"> |
| | | <p style="margin-top: 4px;">队列状态:</p> |
| | | <p style="margin-top: 4px;">开始</p> |
| | | <p style="margin-top: 3px;">队列状态:</p> |
| | | <p style="margin-top: 3px;">开始</p> |
| | | <el-button style="margin-left: 10px;size: mini;" type="danger">停止</el-button> |
| | | <el-button style="margin-left: 10px;size: mini;" type="primary">添加</el-button> |
| | | </div> |
| | | <el-table ref="table" style="margin-top: 20px;height: 500px;" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="铝框id" min-width="80" /> |
| | | <el-table-column prop="type" align="center" label="玻璃id" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="订单编号" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="列表编号" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="箱子编号" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="长" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="宽" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="玻璃状态" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="顺序" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="完成" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="操作" min-width="120" /> |
| | | <el-table-column prop="id" fixed align="center" label="钢化小片信息表id" min-width="150"/> |
| | | <!-- <el-table-column prop="glass_id" align="center" label="玻璃id" min-width="120" /> --> |
| | | <el-table-column prop="flowcardId" fixed align="center" label="流程卡" min-width="120" /> |
| | | <el-table-column prop="glassType" align="center" label="流程卡玻璃类型" min-width="150" /> |
| | | <el-table-column prop="width" align="center" label="宽" min-width="80" /> |
| | | <el-table-column prop="height" align="center" label="高" min-width="80" /> |
| | | <el-table-column prop="thickness" align="center" label="厚度" min-width="80" /> |
| | | <el-table-column prop="filmsid" align="center" label="膜系" min-width="80" /> |
| | | <!-- <el-table-column prop="ishorizontal" align="center" label="钢化是否接受横放" min-width="150" /> --> |
| | | <el-table-column |
| | | align="center" |
| | | label="钢化是否接受横放" |
| | | min-width="150" |
| | | prop="ishorizontal" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypea(scope.row.ishorizontal)"> |
| | | {{ getStatusTexta(scope.row.ishorizontal) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="temperingLayoutId" align="center" label="钢化版图id" min-width="120" /> |
| | | <el-table-column prop="temperingFeedSequence" align="center" label="钢化版图片序" min-width="120" /> |
| | | <el-table-column prop="xCoordinate" align="center" label="x坐标" min-width="80" /> |
| | | <el-table-column prop="yCoordinate" align="center" label="y坐标" min-width="80" /> |
| | | <el-table-column prop="angle" align="center" label="旋转角度(逆时针)" min-width="150" /> |
| | | <!-- <el-table-column prop="state" align="center" label="状态" min-width="80" /> --> |
| | | <el-table-column |
| | | align="center" |
| | | label="状态" |
| | | min-width="80" |
| | | prop="state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypeb(scope.row.state)"> |
| | | {{ getStatusTextb(scope.row.state) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">添加</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleBindRacka(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | |
| | | } |
| | | }; |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | } |
| | | ] |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableData.value = data.EdgTasks1[0] |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | }) |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | |
| | | } |
| | | }; |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | } |
| | | ] |
| | | |
| | | }) |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableData.value = data.EdgTasks2[0] |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | import { initializeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost } from '@/utils/constants'; |
| | | const racks = ref([ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456',downGlassInfoList:"" } }, |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678',downGlassInfoList:"" } }, |
| | | |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' ,downGlassInfoList:""} } |
| | | |
| | | ]); |
| | | |
| | |
| | | content: itemData.item.content, |
| | | fillColor: itemData.item.fillColor, |
| | | width: itemData.item.width === 0 ? "" : 10, |
| | | height: itemData.item.height === 0 ? "" : 90 |
| | | height: itemData.item.height === 0 ? "" : 90, |
| | | downGlassInfoList:itemData.item.downGlassInfoList |
| | | }; |
| | | |
| | | if (index === 2 && itemData.item.width > 0) { |
| | |
| | | console.error(error); |
| | | } |
| | | }; |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:8085/api/talk/unloadglass2`; |
| | | //const socketUrl = `ws://${WebSocketHost}:88/api/unLoadGlass/api/talk/unloadglass2`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | |
| | |
| | | content: itemData.item.content, |
| | | fillColor: itemData.item.fillColor, |
| | | width: itemData.item.width === 0 ? "" : 10, |
| | | height: itemData.item.height === 0 ? "" : 90 |
| | | height: itemData.item.height === 0 ? "" : 90, |
| | | downGlassInfoList:itemData.item.downGlassInfoList |
| | | }; |
| | | |
| | | if (index === 2 && itemData.item.width > 0) { |
| | |
| | | } |
| | | |
| | | rack.item = newItem; |
| | | |
| | | |
| | | // console.log("显示图1",racks.value); // 打印更新后的 racks 值 |
| | | } |
| | |
| | | fetchFlowCardId(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | const showCustomAlert = (downGlassInfoList) => { |
| | | let tableContent = '<table border="1" style="border-collapse: collapse; width: 100%;">'; |
| | | tableContent += '<tr><th style="background-color: #f2f2f2;">玻璃ID</th><th style="background-color: #f2f2f2;">膜系</th><th style="background-color: #f2f2f2;">厚度</th><th style="background-color: #f2f2f2;">宽度</th><th style="background-color: #f2f2f2;">高度</th></tr>'; |
| | | |
| | | downGlassInfoList.forEach(info => { |
| | | tableContent += `<tr> |
| | | <td>${info.glassId}</td> |
| | | <td>${info.Filmsid}</td> |
| | | <td>${info.thickness}</td> |
| | | <td>${info.width}</td> |
| | | <td>${info.height}</td> |
| | | </tr>`; |
| | | }); |
| | | |
| | | const showCustomAlert = (content) => { |
| | | var str="架号 : 111\n" + |
| | | "长 : 111\n" + |
| | | "宽 : 111\n" + |
| | | "厚 : 111\n"+ |
| | | "玻璃ID : 111\n"+ |
| | | "膜系 : 111\n"; |
| | | tableContent += '</table>'; |
| | | |
| | | Swal.fire({ |
| | | title: '玻璃信息', |
| | | html: '<pre>' + str + '</pre>', |
| | | html: tableContent, |
| | | customClass: { |
| | | popup: 'format-pre' |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const showRectInfo = (rectInfo) => { |
| | | const content = rectInfo.item.content; |
| | | showCustomAlert(content); |
| | | |
| | | const showRectInfo = (rack) => { |
| | | const content = rack.item.content; |
| | | console.log(rack.item.downGlassInfoList[0].flowCardId) |
| | | console.log(content) |
| | | if(content==rack.item.downGlassInfoList[0].flowCardId){ |
| | | const downGlassInfoList = rack.item.downGlassInfoList; |
| | | console.log(downGlassInfoList) |
| | | showCustomAlert(downGlassInfoList); |
| | | |
| | | } |
| | | |
| | | }; |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | import Swal from 'sweetalert2' |
| | | import request from "@/utils/request"; |
| | | import { initializeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost } from '@/utils/constants'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | const racks = ref([ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | |
| | |
| | | } |
| | | }; |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:8085/api/talk/unloadglass3`; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass3`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | |
| | |
| | | content: itemData.item.content, |
| | | fillColor: itemData.item.fillColor, |
| | | width: itemData.item.width === 0 ? "" : 10, |
| | | height: itemData.item.height === 0 ? "" : 90 |
| | | height: itemData.item.height === 0 ? "" : 90, |
| | | downGlassInfoList:itemData.item.downGlassInfoList |
| | | }; |
| | | |
| | | if (index === 2 && itemData.item.width > 0) { |
| | |
| | | fetchFlowCardId(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | const showCustomAlert = (downGlassInfoList) => { |
| | | let tableContent = '<table border="1" style="border-collapse: collapse; width: 100%;">'; |
| | | tableContent += '<tr><th style="background-color: #f2f2f2;">玻璃ID</th><th style="background-color: #f2f2f2;">膜系</th><th style="background-color: #f2f2f2;">厚度</th><th style="background-color: #f2f2f2;">宽度</th><th style="background-color: #f2f2f2;">高度</th></tr>'; |
| | | |
| | | downGlassInfoList.forEach(info => { |
| | | tableContent += `<tr> |
| | | <td>${info.glassId}</td> |
| | | <td>${info.Filmsid}</td> |
| | | <td>${info.thickness}</td> |
| | | <td>${info.width}</td> |
| | | <td>${info.height}</td> |
| | | </tr>`; |
| | | }); |
| | | |
| | | // const showCustomAlert = (content) => { |
| | | // var str="架号 : 111\n" + |
| | | // "长 : 111\n" + |
| | | // "宽 : 111\n" + |
| | | // "厚 : 111\n"+ |
| | | // "玻璃ID : 111\n"+ |
| | | // "膜系 : 111\n"; |
| | | tableContent += '</table>'; |
| | | |
| | | // Swal.fire({ |
| | | // title: '玻璃信息', |
| | | // html: '<pre>' + str + '</pre>', |
| | | // customClass: { |
| | | // popup: 'format-pre' |
| | | // } |
| | | // }); |
| | | // }; |
| | | |
| | | const showRectInfo = (rectInfo) => { |
| | | const content = rectInfo.item.content; |
| | | showCustomAlert(content); |
| | | Swal.fire({ |
| | | title: '玻璃信息', |
| | | html: tableContent, |
| | | customClass: { |
| | | popup: 'format-pre' |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | |
| | | const showRectInfo = (rack) => { |
| | | const content = rack.item.content; |
| | | console.log(rack.item.downGlassInfoList[0].flowCardId) |
| | | console.log(content) |
| | | if(content==rack.item.downGlassInfoList[0].flowCardId){ |
| | | const downGlassInfoList = rack.item.downGlassInfoList; |
| | | console.log(downGlassInfoList) |
| | | showCustomAlert(downGlassInfoList); |
| | | |
| | | } |
| | | |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | import Landingindicationtwo from "./Landingindicationtwo.vue"; |
| | | import request from "@/utils/request"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost } from '@/utils/constants'; |
| | | |
| | | |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | const dialogFormVisiblea = ref(false) |
| | | |
| | | const dialogFormVisiblea2 = ref(false) |
| | |
| | | }; |
| | | |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:8085/api/talk/unloadglass`; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | |
| | | // 更新 tableData 的数据 |
| | | |
| | | tableData.splice(0, tableData.length, ...data.params[0]); |
| | | // console.log("更新后数据", tableData); |
| | | // console.log("更新后数据", data.params[0]); |
| | | |
| | | }; |
| | | |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | * @param param 参数实例 |
| | | */ |
| | | public void addPlcBit(PlcBitInfo param) { |
| | | if (plcBitMap != null) |
| | | if (plcBitMap != null) { |
| | | plcBitMap.put(param.getCodeId(),param); |
| | | } |
| | | else { |
| | | plcBitMap = new LinkedHashMap<String,PlcBitInfo>(); |
| | | plcBitMap.put(param.getCodeId(),param); |
| | |
| | | // 2、全局配置 |
| | | // 全局配置 |
| | | GlobalConfig gc = new GlobalConfig(); |
| | | gc.setOutputDir("D:\\Documents\\hangzhoumesParent3\\"); |
| | | gc.setOutputDir("D:\\Documents\\hangzhoumesParent4\\"); |
| | | |
| | | gc.setServiceName("%sService"); //去掉Service接口的首字母I |
| | | gc.setAuthor("wu"); |
| | |
| | | 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(); |
| | | 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 |
| | |
| | | List<Map<String, Object>> map= edgStorageCageService.selectEdgStorageCages(); |
| | | log.info("笼内信息:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testSelectCacheEmpty() { |
| | | List<EdgStorageCage> map= edgStorageCageService.selectCacheEmpty(); |
| | | log.info("笼内空格:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testScan() { |
| | | List<Map<String, Object>> map= edgStorageCageDetailsService.selectCutTerritory(); |
| | |
| | | log.info("切割当前版图信息:{}", Arrays.asList(optimizeDetail)); |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void testOptimizeDetail() { |
| | | List<Map<String, Object>> map2=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | |
| | | package com.mes.bigstorage.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.utils.Result; |
| | |
| | | @Autowired |
| | | private BigStorageCageService bigStorageCageService; |
| | | |
| | | @ApiOperation("查询理片笼信息") |
| | | @GetMapping("/bigStorageCage") |
| | | public Result querybigStorageCageDetail() { |
| | | return Result.build(200,"查询成功",bigStorageCageService.querybigStorageCageDetail()); |
| | | @ApiOperation("理片笼启用禁用") |
| | | @GetMapping("/updateStorageCageDisabled") |
| | | public Result updateStorageCageDisabled(int slot,int enableState) { |
| | | bigStorageCageService.updateStorageCageDisabled(slot,enableState); |
| | | return Result.build(200,"启用/禁用成功",1); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.mes.bigstorage.controller; |
| | | |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.utils.Result; |
| | |
| | | @Autowired |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | |
| | | @ApiOperation("理片笼详情") |
| | | @PostMapping("/queryBigStorageCageDetails") |
| | | public Result queryBigStorageCageDetails() { |
| | | return Result.build(200,"查询成功",bigStorageCageDetailsService.list()); |
| | | |
| | | @ApiOperation("玻璃详情查询") |
| | | @PostMapping("/selectBigStorageCageDetails") |
| | | public Result selectBigStorageCageDetails(String glassId) { |
| | | BigStorageCageDetails bigStorageCageDetails=bigStorageCageDetailsService.selectBigStorageCageDetails(glassId); |
| | | return Result.build(200,"查询成功",bigStorageCageDetails); |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情添加") |
| | | @PostMapping("/insertBigStorageCageDetails") |
| | | public Result insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.save(bigStorageCageDetails); |
| | | bigStorageCageDetailsService.insertBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"添加成功",1); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情删除") |
| | | @PostMapping("/deleteBigStorageCageDetails") |
| | | public Result deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.removeById(bigStorageCageDetails.getId()); |
| | | bigStorageCageDetailsService.deleteBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务破损") |
| | | @PostMapping("/damageBigStorageCageDetails") |
| | | public Result damageBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.damageBigStorageCageDetails(bigStorageCageDetails.getGlassId()); |
| | | return Result.build(200,"破损成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务完成") |
| | | @PostMapping("/finishBigStorageCageDetails") |
| | | public Result finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.finishBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"破损成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务出片") |
| | | @PostMapping("/outBigStorageCageDetails") |
| | | public Result outBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.outBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"破损成功",1); |
| | | } |
| | | } |
| | | |
| | |
| | | * 启用状态 |
| | | */ |
| | | @ApiModelProperty(value = "启用状态", position = 5) |
| | | private String enableState; |
| | | private Integer enableState; |
| | | |
| | | /** |
| | | * 剩余宽度 |
| | |
| | | package com.mes.bigstorage.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @ApiModel(description = "<p> </p>") |
| | | @Api(description = "大理片笼详情") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | |
| | | @ApiModelProperty(value = "玻璃间隙", position = 15) |
| | | private Integer gap; |
| | | |
| | | /** |
| | | * 进片任务 |
| | | */ |
| | | @ApiModelProperty(value = "进片任务", position = 16) |
| | | @TableField(exist = false) |
| | | private BigStorageCageFeedTask bigStorageCageFeedTask; |
| | | |
| | | /** |
| | | * 出片任务 |
| | | */ |
| | | @ApiModelProperty(value = "出片任务", position = 17) |
| | | @TableField(exist = false) |
| | | private BigStorageCageOutTask bigStorageCageOutTask; |
| | | |
| | | } |
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; |
| | | } |
| | |
| | | package com.mes.bigstorage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import feign.Param; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface BigStorageCageDetailsMapper extends BaseMapper<BigStorageCageDetails> { |
| | | public interface BigStorageCageDetailsMapper extends MPJBaseMapper<BigStorageCageDetails> { |
| | | |
| | | } |
| | |
| | | package com.mes.bigstorage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface BigStorageCageMapper extends BaseMapper<BigStorageCage> { |
| | | public interface BigStorageCageMapper extends MPJBaseMapper<BigStorageCage> { |
| | | |
| | | } |
| | |
| | | |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface BigStorageCageDetailsService extends IService<BigStorageCageDetails> { |
| | | |
| | | List<BigStorageCageDetails> selectTask(int taskType); |
| | | |
| | | double selectGetBoard(String plcFeedReqLine); |
| | | |
| | | void deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails); |
| | | |
| | | void damageBigStorageCageDetails(String glassId); |
| | | |
| | | BigStorageCageDetails selectBigStorageCageDetails(String glassId); |
| | | |
| | | void insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails); |
| | | |
| | | 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; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface BigStorageCageService extends IService<BigStorageCage> { |
| | | public interface BigStorageCageService extends MPJBaseService<BigStorageCage> { |
| | | |
| | | void updateRemainWidth(int slot); |
| | | |
| | |
| | | |
| | | boolean outGlass(); |
| | | |
| | | List<BigStorageCage> querybigStorageCageDetail(); |
| | | List<BigStorageCage> querybigStorageCageDetail(int deviceId); |
| | | |
| | | List<Map<String, Object>> selectBigStorageCageUsage(); |
| | | |
| | | void updateStorageCageDisabled(int slot,int enableState); |
| | | } |
| | |
| | | package com.mes.bigstorage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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.mapper.BigStorageCageMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | 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; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Service |
| | | public class BigStorageCageDetailsServiceImpl extends ServiceImpl<BigStorageCageDetailsMapper, BigStorageCageDetails> implements BigStorageCageDetailsService { |
| | | @Resource |
| | | private BigStorageCageMapper bigStorageCageMapper; |
| | | public class BigStorageCageDetailsServiceImpl extends MPJBaseServiceImpl<BigStorageCageDetailsMapper, BigStorageCageDetails> implements BigStorageCageDetailsService { |
| | | |
| | | @Resource |
| | | private BigStorageCageOutTaskMapper bigStorageCageOutTaskMapper; |
| | | @Resource |
| | | private BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper; |
| | | @Resource |
| | | private TemperingGlassInfoMapper temperingGlassInfoMapper; |
| | | @Resource |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private GlassInfoMapper glassInfoMapper; |
| | | |
| | | /** |
| | | * 查询进/出片任务 |
| | | */ |
| | | @Override |
| | | public List<BigStorageCageDetails> selectTask(int taskType) { |
| | | 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); |
| | | |
| | | 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); |
| | | } |
| | | return bigStorageCageDetailsList; |
| | | } 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); |
| | | |
| | | Map<String, BigStorageCageOutTask> listMap = bigStorageCageOutTaskList.stream() |
| | | .collect(Collectors.toMap(BigStorageCageOutTask::getGlassId, task -> task)); |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) { |
| | | BigStorageCageOutTask bigStorageCageOutTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | bigStorageCageDetails.setBigStorageCageOutTask(bigStorageCageOutTask); |
| | | } |
| | | return bigStorageCageDetailsList; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 判断当前玻璃是否能上车 |
| | | */ |
| | | @Override |
| | | public double selectGetBoard(String plcFeedReqLine) { |
| | | double carWidth = 5000; |
| | | LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>(); |
| | | feedWrapper.eq(BigStorageCageDetails::getState, plcFeedReqLine); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> bigStorageCageFeedTaskWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageFeedTaskWrapper |
| | | .eq(BigStorageCageFeedTask::getTaskState, plcFeedReqLine) |
| | | .eq(BigStorageCageFeedTask::getLine, plcFeedReqLine); |
| | | |
| | | 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) { |
| | | carWidth -= Integer.parseInt(bigStorageCageDetails.getWidth().toString()) + bigStorageCageDetails.getGap(); |
| | | } |
| | | } |
| | | return carWidth; |
| | | |
| | | } |
| | | |
| | | |
| | | //栓除出片任务.更新格子宽度 |
| | | @Override |
| | | 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); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getGlassId, glassId); |
| | | BigStorageCageDetails bigStorageCageDetails = baseMapper.selectOne(bigStorageCageDetailsWrapper); |
| | | |
| | | if (temperingGlassInfo.getState() == -2) { |
| | | temperingGlassInfoMapper.deleteById(temperingGlassInfo); |
| | | } else { |
| | | temperingGlassInfo.setState(5); |
| | | temperingGlassInfoMapper.updateById(temperingGlassInfo); |
| | | } |
| | | baseMapper.deleteById(bigStorageCageDetails.getId()); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | //todo:插入破损数据 |
| | | |
| | | } |
| | | |
| | | //查询玻璃信息 |
| | | @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(); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetails.setGap(20); |
| | | return bigStorageCageDetails; |
| | | } |
| | | |
| | | //理片笼详情添加 |
| | | @Override |
| | | 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) { |
| | | bigStorageCageDetails.setState(0); |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | bigStorageCageFeedTaskMapper.deleteById(bigStorageCageDetails.getBigStorageCageFeedTask().getId()); |
| | | } else { |
| | | baseMapper.deleteById(bigStorageCageDetails.getId()); |
| | | bigStorageCageOutTaskMapper.deleteById(bigStorageCageDetails.getBigStorageCageOutTask().getId()); |
| | | } |
| | | |
| | | } |
| | | |
| | | //手动出片 |
| | | @Override |
| | | 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<>(); |
| | | glassInfoWrapper |
| | | .eq(GlassInfo::getGlassId, bigStorageCageDetails.getGlassId()); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper); |
| | | TemperingGlassInfo temperingGlassInfo1 = new TemperingGlassInfo(); |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo1); |
| | | |
| | | if (temperingGlassInfo.getTemperingLayoutId() != null) { |
| | | temperingGlassInfo1.setState(-1); |
| | | } 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.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstorage.mapper.BigStorageCageMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class BigStorageCageServiceImpl extends ServiceImpl<BigStorageCageMapper, BigStorageCage> implements BigStorageCageService { |
| | | public class BigStorageCageServiceImpl extends MPJBaseServiceImpl<BigStorageCageMapper, BigStorageCage> implements BigStorageCageService { |
| | | @Resource |
| | | private BigStorageCageMapper bigStorageCageMapper; |
| | | |
| | |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | @Resource |
| | | private GlassInfoService glassInfoService; |
| | | |
| | | //进片逻辑 |
| | | @Override |
| | | public BigStorageCageDetails feedGlass(GlassInfo glassInfo, BigStorageCageDetails bigStorageCageDetails) { |
| | | |
| | | log.info("1、查询理片笼内片序+1等于当前玻璃片序的玻璃"); |
| | | LambdaQueryWrapper<BigStorageCageDetails> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1); |
| | | BigStorageCageDetails layoutSlotInfo; |
| | | layoutSlotInfo= bigStorageCageDetailsMapper.selectOne(wrapper); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | //玻璃不钢化时 |
| | | if(glassInfo.getTemperingLayoutId()==null){ |
| | | |
| | | log.info("2、查询理片笼内片序+1等于当前玻璃片序的玻璃的结果不为空时"); |
| | | if (layoutSlotInfo.getSlot() != null) { |
| | | bigStorageCageDetails.setSlot(layoutSlotInfo.getSlot()); |
| | | } else { |
| | | log.info("3、查询理片笼内片序+1等于当前玻璃片序的玻璃的结果为空时获取当前玻璃版图id是否存在理片笼内"); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailslambdaQueryWrapper |
| | | .select(BigStorageCageDetails::getTemperingLayoutId); |
| | | layoutSlotInfo = bigStorageCageDetailsMapper.selectOne(bigStorageCageDetailslambdaQueryWrapper); |
| | | BigStorageCage bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on |
| | | .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId) |
| | | .eq(BigStorageCage::getSlot, BigStorageCageDetails::getSlot)) |
| | | .isNull(BigStorageCageDetails::getTemperingLayoutId) |
| | | .gt(BigStorageCage::getRemainWidth, 2000) |
| | | .orderByAsc(BigStorageCage::getDeviceId, BigStorageCage::getSlot) |
| | | .last("limit 1") |
| | | ); |
| | | |
| | | if(layoutSlotInfo != null){ |
| | | log.info("4、获取笼子内适合的格子"); |
| | | BigStorageCage bigStorageCage=bigStorageCageSlot(layoutSlotInfo.getDeviceId()); |
| | | if(bigStorageCage.getSlot()!=null){ |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(bigStorageCage.getDeviceId()); |
| | | } |
| | | }else{ |
| | | //玻璃钢化时 |
| | | BigStorageCage bigStorageCage=new BigStorageCage(); |
| | | |
| | | bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on |
| | | .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId) |
| | | .eq(BigStorageCage::getSlot, BigStorageCageDetails::getSlot)) |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() - 1) |
| | | .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth()) |
| | | ); |
| | | log.info("1、查询理片笼内片序-1等于当前玻璃片序的玻璃"+bigStorageCage); |
| | | |
| | | log.info("2、查询理片笼内片序-1等于当前玻璃片序的玻璃的结果不为空时"+bigStorageCage.getSlot()); |
| | | if (bigStorageCage.getSlot() != null) { |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(bigStorageCage.getDeviceId()); |
| | | } else { |
| | | log.info("3、查询理片笼内片序-1等于当前玻璃片序的玻璃的结果为空时获取当前玻璃版图id是否存在理片笼内"); |
| | | |
| | | bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on |
| | | .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId) |
| | | .eq(BigStorageCage::getSlot, BigStorageCageDetails::getSlot)) |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth()) |
| | | ); |
| | | |
| | | if(bigStorageCage != null){ |
| | | log.info("4、获取笼子内适合的格子"); |
| | | BigStorageCage bigStorageCages=bigStorageCageSlot(bigStorageCage.getDeviceId()); |
| | | bigStorageCageDetails.setSlot(bigStorageCages.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(bigStorageCages.getDeviceId()); |
| | | }else{ |
| | | log.info("5、获取每个笼子版图id的个数"); |
| | | QueryWrapper<BigStorageCageDetails> queryWrapper = new QueryWrapper<>(); |
| | |
| | | List<Map<String, Object>> bigStorageCageDetailsCount= bigStorageCageDetailsMapper.selectMaps(queryWrapper); |
| | | |
| | | log.info("5、查询笼子内是否有合适的格子"); |
| | | boolean found=false; |
| | | for (Map<String, Object> map : bigStorageCageDetailsCount) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | int deviceId = Integer.parseInt(entry.getKey()); |
| | | BigStorageCage bigStorageCage=bigStorageCageSlot(deviceId); |
| | | BigStorageCage bigStorageCages=bigStorageCageSlot(deviceId); |
| | | if(bigStorageCage!=null){ |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageCageDetails.setSlot(bigStorageCages.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(deviceId); |
| | | found=true; |
| | | break; |
| | | } |
| | | } |
| | | if(found){ |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | if (bigStorageCageDetails.getSlot() != null) { |
| | | log.info("6、当找到合适的格子时添加玻璃到笼子表"); |
| | |
| | | return bigStorageCageMapper.selectOne(bigStorageCageWrapper); |
| | | } |
| | | |
| | | |
| | | //出片逻辑 |
| | | @Override |
| | | public boolean outGlass() { |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(); |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper=new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getState,-1); |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(temperingGlassInfoWrapper); |
| | | log.info("1、查询钢化小片任务表是否有待出玻璃"+temperingGlassInfoList.size()); |
| | | |
| | | if(temperingGlassInfoList!=null){ |
| | | if(temperingGlassInfoList.size()>0){ |
| | | temperingGlassInfoService.addOutTask(temperingGlassInfoList); |
| | | log.info("2、添加任务到任务表"); |
| | | return true; |
| | | }else{ |
| | | log.info("3、没有可出的玻璃时获取是否有小片到齐的版图"); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailslambdaQueryWrapper |
| | | .select(BigStorageCageDetails::getTemperingLayoutId) |
| | | .groupBy(BigStorageCageDetails::getTemperingLayoutId); |
| | | List<Map<String, Object>> temperingLayoutIdList = bigStorageCageDetailsMapper.selectMaps(bigStorageCageDetailslambdaQueryWrapper); |
| | | for (Map<String, Object> map : temperingLayoutIdList) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | String layoutId = entry.getKey().substring(0, entry.getKey().indexOf('-')); |
| | | String layoutNum = entry.getKey().substring(entry.getKey().indexOf('-') + 1); |
| | | if (layoutNum.equals(entry.getValue())) { |
| | | //4、添加此钢化版图id所有小片小片到钢化小片表 |
| | | |
| | | QueryWrapper<BigStorageCageDetails> wrapper = Wrappers.query(); |
| | | wrapper.select("tempering_layout_id", "count(tempering_layout_id)") |
| | | .groupBy("tempering_layout_id"); |
| | | List<Map<String, Object>> temperingLayoutIdList = bigStorageCageDetailsMapper.selectMaps(wrapper); |
| | | |
| | | boolean key=false; |
| | | for (Map<String, Object> row : temperingLayoutIdList) { |
| | | for (Map.Entry<String, Object> entry : row.entrySet()) { |
| | | String temperingId = entry.getKey(); |
| | | Object temperingNo = entry.getValue(); |
| | | |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper=new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getTemperingLayoutId,temperingId) |
| | | .orderByDesc(GlassInfo::getTemperingFeedSequence); |
| | | List<GlassInfo> glassInfoList= glassInfoService.list(glassInfoWrapper); |
| | | if(glassInfoList.size()==Integer.parseInt(temperingNo.toString())){ |
| | | for (GlassInfo glassInfo:glassInfoList |
| | | ) { |
| | | |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo); |
| | | temperingGlassInfoService.save(temperingGlassInfo); |
| | | |
| | | } |
| | | key=true; |
| | | } |
| | | if(key){ |
| | | return false; |
| | | } |
| | | } |
| | |
| | | bigStorageCageMapper.update(bigStorageCage, bigStorageCageWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //查询大理片信息,前端展示用 |
| | | @Override |
| | | public List<BigStorageCage> querybigStorageCageDetail() { |
| | | //1、获取大理片笼信息 |
| | | List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectList(null); |
| | | public List<BigStorageCage> querybigStorageCageDetail(int deviceId) { |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper =new LambdaQueryWrapper<>(); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper =new LambdaQueryWrapper<>(); |
| | | if(deviceId!=0){ |
| | | bigStorageCageWrapper.eq(BigStorageCage::getDeviceId,deviceId); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getDeviceId,deviceId); |
| | | } |
| | | |
| | | List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectList(bigStorageCageWrapper); |
| | | log.info("1、获取大理片笼信息完成,获取到的数据{}", bigStorageCages.size()); |
| | | //2获取理片笼所有信息 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsMapper.selectList(null); |
| | | |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsMapper.selectList(bigStorageCageDetailsWrapper); |
| | | |
| | | Map<Integer, List<BigStorageCageDetails>> listMap = bigStorageCageDetailsList.stream().collect(Collectors.groupingBy(BigStorageCageDetails::getSlot)); |
| | | for (BigStorageCage bigStorageCage : bigStorageCages) { |
| | | List<BigStorageCageDetails> bigStorageCageDetails = listMap.get(bigStorageCage.getSlot()); |
| | |
| | | return bigStorageCages; |
| | | } |
| | | |
| | | //笼子使用情况,界面展示用 |
| | | @Override |
| | | public List<Map<String, Object>> selectBigStorageCageUsage() { |
| | | QueryWrapper<BigStorageCage> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("device_id,ROUND(1 - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) / COUNT(device_id), 2) AS percentage,COUNT(device_id) - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) AS count") |
| | | |
| | | .groupBy("device_id"); |
| | | List<Map<String, Object>> bigStorageCageUsages=baseMapper.selectMaps(wrapper); |
| | | |
| | | return bigStorageCageUsages; |
| | | } |
| | | |
| | | //笼子的启用/禁用 |
| | | @Override |
| | | public void updateStorageCageDisabled(int slot,int enableState){ |
| | | BigStorageCage bigStorageCage=new BigStorageCage(); |
| | | bigStorageCage.setEnableState(enableState); |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageWrapper.eq(BigStorageCage::getSlot,slot); |
| | | baseMapper.update(bigStorageCage,bigStorageCageWrapper); |
| | | } |
| | | } |
| | |
| | | |
| | | @Autowired |
| | | private BigStorageCageFeedTaskService bigStorageCageFeedTaskService; |
| | | @ApiOperation("进片任务信息") |
| | | @GetMapping("/querybigStorageCageTask") |
| | | public List<BigStorageCageFeedTask> querybigStorageCageFeedTask(int taskState) { |
| | | return bigStorageCageFeedTaskService.querybigStorageCageFeedTask(taskState); |
| | | } |
| | | // @ApiOperation("进片任务信息") |
| | | // @GetMapping("/querybigStorageCageFeedTask") |
| | | // public List<BigStorageCageFeedTask> querybigStorageCageFeedTask(int taskState) { |
| | | // return bigStorageCageFeedTaskService.querybigStorageCageFeedTask(taskState); |
| | | // } |
| | | } |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private BigStorageCageOutTaskService bigStorageCageOutTaskService; |
| | | @ApiOperation("进片任务信息") |
| | | @GetMapping("/querybigStorageCageTask") |
| | | public List<BigStorageCageOutTask> querybigStorageCageOutTask(int taskState) { |
| | | return bigStorageCageOutTaskService.querybigStorageCageOutTask(taskState); |
| | | } |
| | | // @ApiOperation("出片任务信息") |
| | | // @GetMapping("/querybigStorageCageOutTask") |
| | | // public List<BigStorageCageOutTask> querybigStorageCageOutTask(int taskState) { |
| | | // return bigStorageCageOutTaskService.querybigStorageCageOutTask(taskState); |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | 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> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @ApiModel(description = "<p> 理片进笼任务 </p>") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class BigStorageCageFeedTask implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id", position = 2) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private Integer tragetSlot; |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | @ApiModelProperty(value = "玻璃id", position = 3) |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 目标位置 |
| | | */ |
| | | @ApiModelProperty(value = "目标位置", position = 4) |
| | | private Integer targetSlot; |
| | | |
| | | /** |
| | | * 玻璃类型 |
| | | */ |
| | | @ApiModelProperty(value = "玻璃类型", position = 5) |
| | | private Integer taskType; |
| | | |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | @ApiModelProperty(value = "任务类型", position = 6) |
| | | private Integer taskState; |
| | | |
| | | /** |
| | | * 线路 |
| | | */ |
| | | @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; |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @ApiModel(description = "<p> 理片出笼任务 </p>") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class BigStorageCageOutTask implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id", position = 2) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | @ApiModelProperty(value = "玻璃id", position = 3) |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 开始位置 |
| | | */ |
| | | @ApiModelProperty(value = "开始位置", position = 4) |
| | | private Integer startSlot; |
| | | |
| | | /** |
| | | * 目标位置 |
| | | */ |
| | | @ApiModelProperty(value = "目标位置", position = 5) |
| | | private Integer endSlot; |
| | | |
| | | /** |
| | | * 车次 |
| | | */ |
| | | @ApiModelProperty(value = "车次", position = 6) |
| | | private Integer trainNumber; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | @ApiModelProperty(value = "序号", position = 7) |
| | | private Integer serialNumber; |
| | | |
| | | /** |
| | | * 任务状态 |
| | | */ |
| | | @ApiModelProperty(value = "任务状态", position = 8) |
| | | private Integer taskState; |
| | | |
| | | |
| | |
| | | package com.mes.bigstoragetask.mapper; |
| | | |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface BigStorageCageFeedTaskMapper extends BaseMapper<BigStorageCageFeedTask> { |
| | | |
| | | List<String> querySitToUpGlass(); |
| | | } |
| | |
| | | package com.mes.bigstoragetask.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface BigStorageCageOutTaskMapper extends BaseMapper<BigStorageCageOutTask> { |
| | | |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | |
| | | void updateOutTask(); |
| | | |
| | | void deleteOutTask(Long taskId); |
| | | void deleteOutTask(String glassId); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | getFeedTaskWrapper.eq(BigStorageCageFeedTask::getTaskState,taskState); |
| | | return baseMapper.selectList(getFeedTaskWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> querySitToUpGlass() { |
| | | return baseMapper.querySitToUpGlass(); |
| | | } |
| | | } |
| | |
| | | package com.mes.bigstoragetask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | BigStorageCageOutTaskMapper bigStorageCageOutTaskMapper; |
| | | @Resource |
| | | BigStorageCageDetailsMapper bigStorageCageDetailsMapper; |
| | | |
| | | /** |
| | | * 查询任务信息 |
| | | */ |
| | | @Override |
| | | public List<BigStorageCageOutTask> querybigStorageCageOutTask(int taskState){ |
| | | log.info("根据传入的任务状态查询任务信息:"+taskState); |
| | |
| | | return baseMapper.selectList(getOutTaskWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 检测PLC是否完成任务 |
| | | */ |
| | | @Override |
| | | public void updateOutTask(){ |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList=querybigStorageCageOutTask(1); |
| | | log.info("查询任务表是否有已完成的出片任务"+bigStorageCageOutTaskList.size()); |
| | | for (BigStorageCageOutTask bigStorageCageOutTask:bigStorageCageOutTaskList |
| | | ) { |
| | | deleteOutTask(bigStorageCageOutTask.getId()); |
| | | deleteOutTask(bigStorageCageOutTask.getGlassId()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 完成出片任务 |
| | | */ |
| | | @Override |
| | | public void deleteOutTask(Long taskId){ |
| | | public void deleteOutTask(String glassId){ |
| | | log.info("根据任务id修改钢化小片表状态,删除已完成的出片任务,删除笼子表玻璃"); |
| | | temperingGlassInfoMapper.deleteById(taskId); |
| | | bigStorageCageOutTaskMapper.deleteById(taskId); |
| | | bigStorageCageDetailsMapper.deleteById(taskId); |
| | | |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper =new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getGlassId,glassId); |
| | | TemperingGlassInfo temperingGlassInfo=temperingGlassInfoMapper.selectOne(temperingGlassInfoWrapper); |
| | | //判断是否手动任务,不钢化任务完成后删掉,钢化任务完成后改状态为0 |
| | | if(temperingGlassInfo.getState()==-2){ |
| | | temperingGlassInfoMapper.deleteById(temperingGlassInfo.getId()); |
| | | }else{ |
| | | temperingGlassInfo.setState(0); |
| | | temperingGlassInfoMapper.updateById(temperingGlassInfo); |
| | | } |
| | | |
| | | LambdaQueryWrapper<BigStorageCageOutTask> bigStorageCageOutTaskWrapper =new LambdaQueryWrapper<>(); |
| | | bigStorageCageOutTaskWrapper.eq(BigStorageCageOutTask::getGlassId,glassId); |
| | | BigStorageCageOutTask bigStorageCageOutTask=bigStorageCageOutTaskMapper.selectOne(bigStorageCageOutTaskWrapper); |
| | | bigStorageCageOutTaskMapper.deleteById(bigStorageCageOutTask.getId()); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper =new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getGlassId,glassId); |
| | | BigStorageCageDetails bigStorageCageDetails=bigStorageCageDetailsMapper.selectOne(bigStorageCageDetailsWrapper); |
| | | bigStorageCageDetailsMapper.deleteById(bigStorageCageOutTask.getId()); |
| | | |
| | | } |
| | | } |
| | |
| | | private S7object() { |
| | | if (plccontrol == null) { |
| | | plccontrol = new S7control(plcType, ip, port, 0, 0); |
| | | String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcCacheVerticalGlass.json"; |
| | | |
| | | String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheVerticalGlass.json").getPath(); |
| | | //log.info(PLCAutoMes.class.getResource("").getPath()); |
| | | PlcMesObject = InitUtil.initword(PlcLoadGlass); |
| | | } |
| | | } |
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> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.edgglasstask.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/edgGlassTaskInfo") |
| | | public class EdgGlassTaskInfoController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.edgglasstask.entity; |
| | | |
| | | 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> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | @ApiModel(description = "<p> </p>") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class EdgGlassTaskInfo implements Serializable { |
| | | |
| | | /** |
| | | * 磨边任务id |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | @ApiModelProperty(value = "玻璃id", position = 2) |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | @ApiModelProperty(value = "宽", position = 3) |
| | | private Integer width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | @ApiModelProperty(value = "高", position = 4) |
| | | private Integer height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty(value = "厚度", position = 5) |
| | | private Integer thickness; |
| | | |
| | | /** |
| | | * 玻璃类型 |
| | | */ |
| | | @ApiModelProperty(value = "玻璃类型", position = 6) |
| | | private Integer glassType; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @ApiModelProperty(value = "状态", position = 7) |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 线路 |
| | | */ |
| | | @ApiModelProperty(value = "线路", position = 8) |
| | | private Integer line; |
| | | |
| | | /** |
| | | * 线路 |
| | | */ |
| | | @ApiModelProperty(value = "时间", position = 9) |
| | | private Date time; |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.edgglasstask.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface EdgGlassTaskInfoMapper extends BaseMapper<EdgGlassTaskInfo> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.edgglasstask.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | public interface EdgGlassTaskInfoService extends IService<EdgGlassTaskInfo> { |
| | | |
| | | int judgeTasktype(String plcFeedReqLine); |
| | | |
| | | int startTask(); |
| | | } |
New file |
| | |
| | | package com.mes.edgglasstask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.mapper.EdgGlassTaskInfoMapper; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | @Service |
| | | public class EdgGlassTaskInfoServiceImpl extends ServiceImpl<EdgGlassTaskInfoMapper, EdgGlassTaskInfo> implements EdgGlassTaskInfoService { |
| | | |
| | | @Resource |
| | | BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Override |
| | | public int judgeTasktype(String plcFeedReqLine){ |
| | | LambdaQueryWrapper<EdgGlassTaskInfo> edgGlassTaskInfoWrapper=new LambdaQueryWrapper<>(); |
| | | edgGlassTaskInfoWrapper |
| | | .eq(EdgGlassTaskInfo::getLine,plcFeedReqLine) |
| | | .orderByDesc(EdgGlassTaskInfo::getTime); |
| | | EdgGlassTaskInfo edgGlassTaskInfo=baseMapper.selectOne(edgGlassTaskInfoWrapper); |
| | | double width=bigStorageCageDetailsService.selectGetBoard(plcFeedReqLine); |
| | | if(edgGlassTaskInfo.getWidth()<width){ |
| | | return 0; |
| | | }else{ |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int startTask(){ |
| | | |
| | | double line1Width=bigStorageCageDetailsService.selectGetBoard("1"); |
| | | double line2Width=bigStorageCageDetailsService.selectGetBoard("2"); |
| | | |
| | | LambdaQueryWrapper<EdgGlassTaskInfo> edgGlassTaskInfoWrapper=new LambdaQueryWrapper<>(); |
| | | edgGlassTaskInfoWrapper |
| | | .eq(EdgGlassTaskInfo::getLine,1) |
| | | .orderByDesc(EdgGlassTaskInfo::getTime); |
| | | List<EdgGlassTaskInfo> edgGlassTaskInfoList1=baseMapper.selectList(edgGlassTaskInfoWrapper); |
| | | int i=0; |
| | | for (EdgGlassTaskInfo edgGlassTaskInfo:edgGlassTaskInfoList1 |
| | | ) { |
| | | if(edgGlassTaskInfo.getWidth()<line1Width){ |
| | | i+=1; |
| | | line1Width-=edgGlassTaskInfo.getWidth()+20; |
| | | } |
| | | } |
| | | if(i==2){ |
| | | return 2; |
| | | } |
| | | |
| | | edgGlassTaskInfoWrapper |
| | | .eq(EdgGlassTaskInfo::getLine,2) |
| | | .orderByDesc(EdgGlassTaskInfo::getTime); |
| | | List<EdgGlassTaskInfo> edgGlassTaskInfoList2=baseMapper.selectList(edgGlassTaskInfoWrapper); |
| | | i=0; |
| | | for (EdgGlassTaskInfo edgGlassTaskInfo:edgGlassTaskInfoList2 |
| | | ) { |
| | | if(edgGlassTaskInfo.getWidth()<line2Width){ |
| | | i+=1; |
| | | line2Width-=edgGlassTaskInfo.getWidth()+20; |
| | | } |
| | | } |
| | | if(i==2) { |
| | | return 1; |
| | | }else{ |
| | | return 2; |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.mes.userinfo.controller; |
| | | package com.mes.edgstoragetask.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | package com.mes.edgstoragetask.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.mes.edgstoragetask.entity.TaskCache; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface TaskCacheMapper extends BaseMapper<TaskCache> { |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface TaskCacheService extends IService<TaskCache> { |
| | | |
| | | int judgeTasktype(); |
| | | } |
| | |
| | | @Qualifier("") |
| | | @Service |
| | | public class TaskCacheServiceImpl extends ServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService { |
| | | @Resource |
| | | private BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper; |
| | | @Override |
| | | public int judgeTasktype(){ |
| | | //判断根据当前卧转立任务与磨边线任务判断是否启动卧转立 |
| | | // for (int i=1;i<=2;i++){ |
| | | // //查询卧转立当前任务 |
| | | // int width=5000; |
| | | // int num=0; |
| | | // List<BigStorageCageFeedTask> bgStorageCageFeedTask =bigStorageCageFeedTaskMapper.(); |
| | | // //查询磨边线当前任务 |
| | | // LambdaQueryWrapper<TaskCache> taskCacheWrapper=new LambdaQueryWrapper<>(); |
| | | // taskCacheWrapper.eq(TaskCache::getTaskStauts,"0"); |
| | | // List<TaskCache> taskCacheList=taskCacheService.list(taskCacheWrapper); |
| | | // //判断当前线路还需要再上几片才能满足小车宽度 |
| | | // for (TaskCache taskCache:taskCacheList |
| | | // ) { |
| | | // if(taskCache.getId().equals("1")){ |
| | | // //进片车宽度减去小片宽度 |
| | | // } |
| | | // } |
| | | // //片数小于等于2时另一条线卧转立启动 |
| | | // log.info("发送卧转立启动信号"); |
| | | // } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.common.S7object; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author SNG-015 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class PlcSlicecage { |
| | | |
| | | @Resource |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | | //界面展示笼子信息 |
| | | jsonObject.append("bigStorageCageInfo1", bigStorageCageService.querybigStorageCageDetail(1)); |
| | | jsonObject.append("bigStorageCageInfo2", bigStorageCageService.querybigStorageCageDetail(2)); |
| | | jsonObject.append("bigStorageCageInfo3", bigStorageCageService.querybigStorageCageDetail(3)); |
| | | jsonObject.append("bigStorageCageInfo4", bigStorageCageService.querybigStorageCageDetail(4)); |
| | | jsonObject.append("bigStorageCageInfo5", bigStorageCageService.querybigStorageCageDetail(5)); |
| | | jsonObject.append("bigStorageCageInfo6", bigStorageCageService.querybigStorageCageDetail(6)); |
| | | jsonObject.append("bigStorageCageInfo7", bigStorageCageService.querybigStorageCageDetail(7)); |
| | | jsonObject.append("bigStorageCageInfo8", bigStorageCageService.querybigStorageCageDetail(8)); |
| | | |
| | | //进片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1); |
| | | jsonObject.append("bigStorageCageDetailsFeedTask", bigStorageCageDetailsFeedTask); |
| | | |
| | | //出片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsOutTask=bigStorageCageDetailsService.selectTask(2); |
| | | jsonObject.append("bigStorageCageDetailsOutTask", bigStorageCageDetailsOutTask); |
| | | |
| | | //理片笼使用情况 |
| | | List<Map<String, Object>> bigStorageCageUsage=bigStorageCageService.selectBigStorageCageUsage(); |
| | | jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); |
| | | |
| | | //出片队列 |
| | | List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list(); |
| | | jsonObject.append("temperingGlassInfoList", temperingGlassInfoList); |
| | | |
| | | //报警信息 |
| | | jsonObject.append("bigStorageCageFullAlarm", PlcStorageCageTask.bigStorageCageFullAlarm); |
| | | |
| | | //理片笼表格信息 |
| | | jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetail(0)); |
| | | |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | 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.edgstoragetask.service.TaskCacheService; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.menu.service.SysMenuService; |
| | | import com.mes.tools.WebSocketServer; |
| | | 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 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class PlcStorageCageTask { |
| | |
| | | @Resource |
| | | private BigStorageCageOutTaskService bigStorageCageOutTaskService; |
| | | @Resource |
| | | private TaskCacheService taskCacheService; |
| | | |
| | | private EdgGlassTaskInfoService edgGlassTaskInfoService; |
| | | @Resource |
| | | private SysMenuService sysMenuService; |
| | | 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; |
| | | |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | | // 爆笼报警 |
| | | boolean bigStorageCageFullAlarm = false; |
| | | |
| | | String plcFeedGlassid = ""; |
| | | String plcFeedReqLine = "0"; |
| | | if ("1".equals(plcParameterObject.getPlcParameter("D01Request").getValue())) { |
| | | plcFeedReqLine = "1"; |
| | | plcFeedGlassid=plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | // @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 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; |
| | | } |
| | | if ("1".equals(plcParameterObject.getPlcParameter("D04Request").getValue())) { |
| | | plcFeedReqLine = "2"; |
| | | plcFeedGlassid=plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | // 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 (!("0".equals(plcFeedReqLine))) { |
| | | log.info("1、Plc进片请求时"); |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid); |
| | | log.info("2、根据玻璃id获取玻璃信息" + glassInfo); |
| | | BigStorageCageDetails slotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails); |
| | | if (slotInfo != null) { |
| | | int taskType = taskCacheService.judgeTasktype(); |
| | | log.info("3、查询任务表判断当前任务类型为上车等到还是上车启动" + taskType); |
| | | bigStorageCageFeedTaskService.addFeedTask(slotInfo, Integer.parseInt(plcFeedReqLine), taskType); |
| | | log.info("4、添加任务到任务表"); |
| | | bigStorageCageFullAlarm = false; |
| | | 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 { |
| | | bigStorageCageFullAlarm = true; |
| | | 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 { |
| | | 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、删除已经完成的进片任务"); |
| | | //记录无法放下玻璃,后续判断启动 |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | | |
| | | //查询出片表是否有任务未完成的任务 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTask=bigStorageCageOutTaskService.querybigStorageCageOutTask(0); |
| | | if(bigStorageCageOutTask.size()==0){ |
| | | bigStorageCageService.outGlass(); |
| | | log.info("8、没有未完成任务时调用出片接口"); |
| | | } |
| | | bigStorageCageOutTaskService.updateOutTask(); |
| | | log.info("9、根据任务表状态修改钢化小片表任务状态"); |
| | | |
| | | //报警信息 |
| | | jsonObject.append("bigStorageCageFullAlarm", bigStorageCageFullAlarm); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | 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 { |
| | | log.info("Home is closed"); |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthSecond); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | |
| | | |
| | | @Autowired |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | @Autowired |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | |
| | | @ApiOperation("钢化小片信息") |
| | | @GetMapping("/queryTemperingGlassInfo") |
| | | public Result queryTemperingGlassInfo() { |
| | | return Result.build(200,"查询成功",temperingGlassInfoService.list()); |
| | | @ApiOperation("出片任务删除") |
| | | @PostMapping("/deleteTemperingGlassInfo") |
| | | public Result deleteTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo) { |
| | | temperingGlassInfoService.removeById(temperingGlassInfo); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | | @ApiOperation("手动添加出片任务") |
| | | @PostMapping("/insertTemperingGlassInfo") |
| | | public Result insertBigStorageCageDetail(TemperingGlassInfo temperingGlassInfo) { |
| | | temperingGlassInfoService.save(temperingGlassInfo); |
| | | return Result.build(200,"添加成功",1); |
| | | @ApiOperation("出片任务破损") |
| | | @PostMapping("/damageTemperingGlassInfo") |
| | | public Result damageTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo) { |
| | | bigStorageCageDetailsService.damageBigStorageCageDetails(temperingGlassInfo.getGlassId()); |
| | | return Result.build(200,"破损成功",1); |
| | | } |
| | | } |
| | | |
| | |
| | | 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; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @ApiModel(description = "<p> 钢化小片信息表 </p>") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class TemperingGlassInfo implements Serializable { |
| | |
| | | /** |
| | | * 钢化小片信息表id |
| | | */ |
| | | @ApiModelProperty(value = "钢化小片信息表id", position = 2) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | @ApiModelProperty(value = "玻璃id", position = 3) |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | @ApiModelProperty(value = "流程卡", position = 4) |
| | | private String flowcardId; |
| | | |
| | | /** |
| | | * 流程卡玻璃类型 |
| | | */ |
| | | @ApiModelProperty(value = "流程卡玻璃类型", position = 5) |
| | | private Integer glassType; |
| | | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | @ApiModelProperty(value = "宽", position = 6) |
| | | private Double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | @ApiModelProperty(value = "高", position = 7) |
| | | private Double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty(value = "厚度", position = 8) |
| | | private Double thickness; |
| | | |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | @ApiModelProperty(value = "膜系", position = 9) |
| | | private Integer filmsid; |
| | | |
| | | /** |
| | | * 钢化是否接受横放 |
| | | */ |
| | | @ApiModelProperty(value = "钢化是否接受横放", position = 10) |
| | | private Integer ishorizontal; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | @ApiModelProperty(value = "钢化版图id", position = 11) |
| | | private Integer temperingLayoutId; |
| | | |
| | | /** |
| | | * 钢化版图片序 |
| | | */ |
| | | @ApiModelProperty(value = "钢化版图片序", position = 12) |
| | | private Integer temperingFeedSequence; |
| | | |
| | | /** |
| | | * x坐标 |
| | | */ |
| | | @ApiModelProperty(value = "x坐标", position = 13) |
| | | private Integer xCoordinate; |
| | | |
| | | /** |
| | | * y坐标 |
| | | */ |
| | | @ApiModelProperty(value = "y坐标", position = 14) |
| | | private Integer yCoordinate; |
| | | |
| | | /** |
| | | * 旋转角度(逆时针) |
| | | */ |
| | | @ApiModelProperty(value = "旋转角度(逆时针)", position = 15) |
| | | private Integer angle; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @ApiModelProperty(value = "状态", position = 16) |
| | | private Integer state; |
| | | |
| | | |
| | |
| | | package com.mes.temperingglass.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface TemperingGlassInfoMapper extends BaseMapper<TemperingGlassInfo> { |
| | | |
| | | } |
| | |
| | | |
| | | public void addOutTask(List<TemperingGlassInfo> temperingGlassInfoList); |
| | | |
| | | void schedulingTask(); |
| | | } |
| | |
| | | package com.mes.temperingglass.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstorage.mapper.BigStorageCageMapper; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TemperingGlassInfoServiceImpl extends ServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingGlassInfoService { |
| | | |
| | | @Resource |
| | | private BigStorageCageDetailsMapper bigStorageCageDetailsMapper; |
| | | @Resource |
| | | private BigStorageCageMapper bigStorageCageMapper; |
| | | |
| | | @Override |
| | | public void addOutTask(List<TemperingGlassInfo> temperingGlassInfoList) { |
| | | double carWidth=5000; |
| | |
| | | ) { |
| | | log.info("1、当出片车宽度大于玻璃宽度时"); |
| | | if((carWidth-temperingGlassInfo.getWidth())>0){ |
| | | carWidth-=temperingGlassInfo.getWidth()-gap; |
| | | log.info("2、添加刚小片表信息到任务表"); |
| | | temperingGlassInfo.setState(1); |
| | | carWidth-=temperingGlassInfo.getWidth()+gap; |
| | | log.info("2、添加钢化小片表信息到任务表"); |
| | | temperingGlassInfo.setState(-1); |
| | | baseMapper.updateById(temperingGlassInfo); |
| | | log.info("3、添加刚小片表信息到任务表"); |
| | | log.info("3、修改钢化小片表任务状态"); |
| | | BigStorageCageOutTask bigStorageCageOutTask =new BigStorageCageOutTask(); |
| | | bigStorageCageOutTask.setId(temperingGlassInfo.getId()); |
| | | }else{ |
| | |
| | | } |
| | | } |
| | | |
| | | //调度 |
| | | @Override |
| | | public void schedulingTask(){ |
| | | QueryWrapper<BigStorageCageDetails> detailsWrapper1 = Wrappers.query(); |
| | | detailsWrapper1.select("tempering_layout_id", "count(distinct slot)") |
| | | .groupBy("tempering_layout_id"); |
| | | List<Map<String, Object>> temperingLayoutIdList = bigStorageCageDetailsMapper.selectMaps(detailsWrapper1); |
| | | |
| | | boolean key=false; |
| | | for (Map<String, Object> row : temperingLayoutIdList) { |
| | | for (Map.Entry<String, Object> entry : row.entrySet()) { |
| | | String temperingId = entry.getKey(); |
| | | int temperingNo = Integer.parseInt(entry.getValue().toString()); |
| | | if(temperingNo>8){ |
| | | QueryWrapper<BigStorageCageDetails> detailsWrapper2 = Wrappers.query(); |
| | | detailsWrapper2.select("tempering_layout_id", "slot") |
| | | .select("max(tempering_feed_sequence) as max_sequence", "min(tempering_feed_sequence) as min_sequence") |
| | | .groupBy("tempering_layout_id", "slot") |
| | | .orderByAsc("tempering_layout_id") |
| | | .orderByDesc("min_sequence"); |
| | | |
| | | List<Map<String, Object>> result = bigStorageCageDetailsMapper.selectMaps(detailsWrapper2); |
| | | for (Map<String, Object> rows : result) { |
| | | // 获取每行的值 |
| | | Object temperingLayoutId = rows.get("tempering_layout_id"); |
| | | int slot = Integer.parseInt(rows.get("slot").toString()); |
| | | int maxSequence = Integer.parseInt(rows.get("max_sequence").toString()); |
| | | int minSequence = Integer.parseInt(rows.get("min_sequence").toString()); |
| | | |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper=new LambdaQueryWrapper<>(); |
| | | bigStorageCageWrapper.eq(BigStorageCage::getSlot,slot); |
| | | BigStorageCage bigStorageCage=bigStorageCageMapper.selectOne(bigStorageCageWrapper); |
| | | Integer remainWidth=5000-bigStorageCage.getRemainWidth(); |
| | | |
| | | BigStorageCage bigStorageCages=bigStorageCageMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on |
| | | .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId) |
| | | .eq(BigStorageCage::getSlot, BigStorageCageDetails::getSlot)) |
| | | .gt(BigStorageCage::getRemainWidth,remainWidth) |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId,temperingLayoutId) |
| | | .eq(BigStorageCageDetails::getTemperingFeedSequence,minSequence-1) |
| | | ); |
| | | |
| | | if(bigStorageCages.getSlot()!=null){ |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper=new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper |
| | | .eq(BigStorageCageDetails::getSlot,slot) |
| | | .orderByDesc(BigStorageCageDetails::getTemperingFeedSequence); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList=bigStorageCageDetailsMapper.selectList(bigStorageCageDetailsWrapper); |
| | | for (BigStorageCageDetails bigStorageCageDetails:bigStorageCageDetailsList |
| | | ) { |
| | | BigStorageCageOutTask bigStorageCageOutTask=new BigStorageCageOutTask(); |
| | | bigStorageCageOutTask.setTaskState(-3); |
| | | bigStorageCageOutTask.setStartSlot(slot); |
| | | bigStorageCageOutTask.setEndSlot(bigStorageCages.getSlot()); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
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 |
| | | 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) { |
| | |
| | | @Autowired |
| | | private OptimizeProjectService optimizeProjectService; |
| | | @ApiOperation("开始/暂停任务/传递工程号和状态,开始是1 暂停是0") |
| | | @PostMapping("/pauseTask") //调用上片任务 |
| | | @PostMapping("/pauseTask") //暂停上片任务 |
| | | @ResponseBody |
| | | 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.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("开始上片") |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | |
| | | * @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(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 30000000) |
| | | @Scheduled(fixedDelay = 3000000) |
| | | public void plcLoadGlassReport(){ |
| | | //获取是否有汇报 |
| | | String loadStatus = plcParameterObject.getPlcParameter("PlcStatus").getValue(); |
| | |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | // List<String> messages = webserver.getMessages(); |
| | | // if (!messages.isEmpty()) { |
| | | // // // 将最后一个消息转换为整数类型的列表 |
| | | // webserver.clearMessages(); |
| | | // } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | import com.mes.workstation.entity.UpWorkstation; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | |
| | | * 增加人工输入的工位玻璃信息 |
| | | * @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 |
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 |
| | |
| | | |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.entity.request.OptimizeRequest; |
| | |
| | | |
| | | @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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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 TemperingGlassModuleApplication { |
| | | public static void main(String[] args) { |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author SNG-010 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class PlcTemperingGlassTask { |
| | | |
| | | @Autowired |
| | | private TemperingAgoService temperingAgoService; |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void loadGlassHome(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在等待进片的玻璃 |
| | | List<TemperingGlassInfo> waitingGlass = temperingAgoService.selectWaitingGlass(); |
| | | jsonObject.append("waitingGlass", waitingGlass); |
| | | //进炉中的玻璃 |
| | | List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(); |
| | | jsonObject.append("intoGlass", intoGlass); |
| | | //出炉后的玻璃 |
| | | List<TemperingGlassInfo> outGlass = temperingAgoService.selectOutGlass(); |
| | | jsonObject.append("outGlass", outGlass); |
| | | //过旋转台钢化后的玻璃 |
| | | List<TemperingGlassInfo> overGlass = temperingAgoService.selectOverGlass(); |
| | | jsonObject.append("overGlass", overGlass); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | 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.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | // TidyUpGlassModule 钢化模块 |
| | | public class TemperingGlassInfoController { |
| | | |
| | | @Autowired |
| | | TemperingService temperingService; |
| | | @Autowired |
| | | private TemperingOverService temperingOverService; |
| | | @Autowired |
| | | private TemperingAgoService temperingAgoService; |
| | | |
| | |
| | | @ApiOperation("//钢化后显示出炉的版图信息。") |
| | | @GetMapping("/selectOutGlass") //钢化后显示出炉的版图信息 |
| | | public Result <List<TemperingGlassInfo>> selectOutGlass() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.SelectOutGlass(); |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectOutGlass(); |
| | | log.info("钢化出炉后的玻璃信息{}",glass); |
| | | return Result.build(200, "", glass); |
| | | } |
| | |
| | | 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; |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface TemperingGlassInfoMapper extends BaseMapper<TemperingGlassInfo>, MPJBaseMapper<TemperingGlassInfo> { |
| | | |
| | | } |
| | |
| | | package com.mes.temperingglass.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @DS("salve_hangzhoumes") |
| | | public interface TemperingMapper extends BaseMapper<TemperingGlassInfo> { |
| | | |
| | | |
| | | //查询该玻璃的尺寸和坐标 |
| | | //@Select("select *from glass_info where id=#{glassid};") |
| | | //GlassInfo SelectGlass(String glassid); |
| | | //是否可以发送进炉信号 |
| | | @Select("select count(*) from glass_info where id=#{glassid};") |
| | | int SelectTempering(String glassid); |
| | | |
| | | //查询等待中的钢化版图玻璃信息 |
| | | @Select("select*from tempering_glass_info a left join (select flowcard_id,count(state)state from tempering_glass_info GROUP BY flowcard_id,state)b on a.flowcard_id=b.flowcard_id where b.state=2") |
| | | List<TemperingGlassInfo> SelectWaitingGlass(); |
| | | |
| | | //查询进炉中的钢化版图玻璃信息 |
| | | @Select("select*from tempering_glass_info a left join (select flowcard_id,min(state)state1 from tempering_glass_info GROUP BY flowcard_id having state1=1)b on a.flowcard_id=b.flowcard_id where b.state1=1") |
| | | List<TemperingGlassInfo> SelectInGlass(); |
| | | |
| | | //查询钢化后的钢化版图信息 |
| | | @Select("select*from tempering_glass_info a left join (select flowcard_id,min(state)state1 from tempering_glass_info GROUP BY flowcard_id having state1=2)b on a.flowcard_id=b.flowcard_id where b.state1=2") |
| | | List<TemperingGlassInfo> SelectOutGlass(); |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.temperingglass.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import java.util.List; |
| | |
| | | |
| | | List<TemperingGlassInfo> selectIntoGlass(); |
| | | |
| | | List<TemperingGlassInfo> SelectOutGlass(); |
| | | List<TemperingGlassInfo> selectOutGlass(); |
| | | |
| | | List<TemperingGlassInfo> selectOverGlass(); |
| | | } |
| | |
| | | package com.mes.temperingglass.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import com.mes.temperingglass.mapper.TemperingMapper; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Service |
| | | @DS("salve_hangzhoumes") |
| | | public class TemperingAgoServiceImpl extends MPJBaseServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingAgoService { |
| | | @Autowired |
| | | TemperingMapper temperingMapper; |
| | |
| | | public List<TemperingGlassInfo> selectWaitingGlass() { |
| | | //获取等待进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.inSql("flowcard_id", "select flowcard_id from tempering_glass_info GROUP BY flowcard_id,state having count(state) = 2"); |
| | | //wrapper.eq("state",1); |
| | | wrapper.in("state",1,0); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | |
| | | public List<TemperingGlassInfo> selectIntoGlass() { |
| | | //获取进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.inSql("flowcard_id", "select flowcard_id from tempering_glass_info where state=1 GROUP BY flowcard_id,state having count(state) = 1"); |
| | | |
| | | wrapper.eq("state",2) |
| | | .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> SelectOutGlass() { |
| | | public List<TemperingGlassInfo> selectOutGlass() { |
| | | //获取出炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.eq("state", 3); |
| | | wapper.eq("state", 3) |
| | | .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectOverGlass() { |
| | | //获取过旋转台最大的钢化版图id |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.select("top 1 *").eq("state", 4) |
| | | .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); |
| | | } |
| | | } |
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 |
| | |
| | | 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 |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | 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 |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | port: 8084 |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | active: cz |
| | | application: |
| | | name: temperingGlass |
| | | mybatis-plus: |
| | |
| | | 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; |
| | |
| | | @SpringBootTest(classes = TemperingGlassModuleApplication.class) |
| | | public class TemperingApplicationTest { |
| | | |
| | | @Resource |
| | | private OptimizeProjectMapper optimizeProjectMapper; |
| | | @Autowired |
| | | private TemperingAgoService temperingAgoService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | |
| | | |
| | | @Test |
| | |
| | | } |
| | | @Test |
| | | public void testFindPa2() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.SelectOutGlass(); |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectOutGlass(); |
| | | log.info("已出中的玻璃:{}", Arrays.asList(glass)); |
| | | } |
| | | |
| | |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectWaitingGlass(); |
| | | log.info("等待中的玻璃:{}", Arrays.asList(glass)); |
| | | } |
| | | @Test |
| | | public void testFindPa4() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectOverGlass(); |
| | | log.info("等待中的玻璃:{}", Arrays.asList(glass)); |
| | | } |
| | | } |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.common.S7object; |
| | | //import com.mes.common.S7object; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | |
| | | private DownStorageCageDetailsService downStorageCageDetailsService; |
| | | @Autowired |
| | | private DownStorageCageService downStorageCageService; |
| | | |
| | | @ApiOperation("添加玻璃") |
| | | @PostMapping("/add") |
| | | public String addDownStorageCageDetails(@RequestBody DownStorageCageDetails details) { |
| | | downStorageCageDetailsService.addDownStorageCageDetails(details); |
| | |
| | | @ResponseBody |
| | | public Result updateDownStorageCage(@RequestBody DownStorageCage downStorageCage) { |
| | | boolean isSucess=downStorageCageService.updateDownStorageCage(downStorageCage); |
| | | return Result.build(200,"更换成功",1); |
| | | return Result.build(200,"更换成功",isSucess); |
| | | } |
| | | @ApiOperation("删除缓存理片笼信息 功能:对笼内栅格玻璃进行【清除】") |
| | | @PostMapping("/deleteDownStorageCage") |
| | |
| | | * @param end |
| | | * @return log.info(" 单片情况根据传入的工位查询符合按照大小出片, 并且优先出满架的小片 "); |
| | | */ |
| | | List<DownStorageCageDetails> CacheOut(int start, int end); |
| | | |
| | | |
| | | /** |
| | | * @return 出片 |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> CacheOut(int start, int end) { |
| | | log.info("单片情况根据传入的工位查询符合按照大小出片,并且优先出满架的小片"); |
| | | return downStorageCageDetailsMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("t.*") |
| | | .leftJoin("(SELECT t1.* FROM down_storage_cage_details t1 " |
| | | + "JOIN (SELECT flow_card_id, MAX(width*height) AS max_width FROM glass_info GROUP BY flow_card_id) t " |
| | | + "ON t1.flow_card_id = t.flow_card_id WHERE t1.width*t1.height = t.max_width) t3" |
| | | + " ON t.glass_id = t3.glass_id") |
| | | .leftJoin("down_workstation t4 ON t3.flow_card_id = t4.flow_card_id") |
| | | .isNull(Boolean.parseBoolean("t.glass_id"), "SELECT glass_id FROM down_glass_info") |
| | | .between("t4.workstation_id", start, end) |
| | | // 根据 racks_number 排序 |
| | | .orderByDesc("t4.racks_number") |
| | | |
| | | ); |
| | | } |
| | | // @Override |
| | | // public List<DownStorageCageDetails> CacheOut(int start, int end) { |
| | | // log.info("单片情况根据传入的工位查询符合按照大小出片,并且优先出满架的小片"); |
| | | // return downStorageCageDetailsMapper.selectJoinList( |
| | | // DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | // .select("t.*") |
| | | // .leftJoin("(SELECT t1.* FROM down_storage_cage_details t1 " |
| | | // + "JOIN (SELECT flow_card_id, MAX(width*height) AS max_width FROM glass_info GROUP BY flow_card_id) t " |
| | | // + "ON t1.flow_card_id = t.flow_card_id WHERE t1.width*t1.height = t.max_width) t3" |
| | | // + " ON t.glass_id = t3.glass_id") |
| | | // .leftJoin("down_workstation t4 ON t3.flow_card_id = t4.flow_card_id") |
| | | // .isNull(Boolean.parseBoolean("t.glass_id"), "SELECT glass_id FROM down_glass_info") |
| | | // .between("t4.workstation_id", start, end) |
| | | // // 根据 racks_number 排序 |
| | | // .orderByDesc("t4.racks_number") |
| | | // |
| | | // ); |
| | | // } |
| | | |
| | | |
| | | // @Override |
| | |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | |
| | | import com.mes.device.PlcParameterObject; |
| | | //import com.mes.device.PlcParameterObject; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
New file |
| | |
| | | package com.mes.engineering.controller; |
| | | |
| | | |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | |
| | | 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 java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | @RestController |
| | | @Slf4j |
| | | @RequestMapping("/engineering/engineering") |
| | | public class EngineeringController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.engineering.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class Engineering implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 工程表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 工程名称 |
| | | */ |
| | | private String engineerName; |
| | | |
| | | /** |
| | | * 平均利用率 |
| | | */ |
| | | private Double avgAvailability; |
| | | |
| | | /** |
| | | * 有效利用率 |
| | | */ |
| | | private Double validAvailability; |
| | | |
| | | /** |
| | | * 尾片利用率 |
| | | */ |
| | | private Double lastAvailability; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | private Integer state; |
| | | |
| | | /** |
| | | * 小片总数 |
| | | */ |
| | | private Integer glassTotal; |
| | | |
| | | /** |
| | | * 小片总面积 |
| | | */ |
| | | private Double glassTotalArea; |
| | | |
| | | /** |
| | | * 计划原片总数 |
| | | */ |
| | | private Integer planPatternTotal; |
| | | |
| | | /** |
| | | * 计划原片总面积 |
| | | */ |
| | | private Double planPatternTotalArea; |
| | | |
| | | /** |
| | | * 实际原片总数 |
| | | */ |
| | | private Integer realityPatternTotal; |
| | | |
| | | /** |
| | | * 实际原片总面积 |
| | | */ |
| | | private Double realityPatternTotalArea; |
| | | |
| | | /** |
| | | * 膜系id |
| | | */ |
| | | private String filmsId; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String notes; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.engineering.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.engineering.entity.Engineering; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | public interface EngineeringMapper extends MPJBaseMapper<Engineering> { |
| | | |
| | | } |
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.engineering.mapper.EngineeringMapper"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.mes.engineering.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.engineering.entity.Engineering; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | public interface EngineeringService extends IService<Engineering> { |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.engineering.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.mapper.EngineeringMapper; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class EngineeringServiceImpl extends ServiceImpl<EngineeringMapper, Engineering> implements EngineeringService { |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.glassinfo.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import org.mapstruct.Mapper; |
| | | |
| | |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | public interface GlassInfoMapper extends BaseMapper<GlassInfo> { |
| | | public interface GlassInfoMapper extends MPJBaseMapper<GlassInfo> { |
| | | |
| | | |
| | | |
| | |
| | | package com.mes.glassinfo.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.mapper.EngineeringMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | |
| | | @Service |
| | | public class GlassInfoServiceImpl extends ServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService { |
| | | |
| | | private EngineeringMapper engineeringMapper; |
| | | private GlassInfoMapper glassInfoMapper; |
| | | |
| | | @Autowired(required=false) |
| | | public GlassInfoServiceImpl(GlassInfoMapper glassInfoMapper) { |
| | | public GlassInfoServiceImpl(GlassInfoMapper glassInfoMapper, EngineeringMapper engineeringMapper) { |
| | | this.glassInfoMapper = glassInfoMapper; |
| | | this.engineeringMapper = engineeringMapper; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getFlowCardId() { |
| | | return baseMapper.selectMaps(new QueryWrapper<GlassInfo>().lambda().select(GlassInfo::getFlowCardId).groupBy(GlassInfo::getFlowCardId)); |
| | | return baseMapper.selectJoinMaps(JoinWrappers.lambda(GlassInfo.class) |
| | | .select(GlassInfo::getFlowCardId) |
| | | .leftJoin(Engineering.class, on -> on |
| | | .eq(Engineering::getEngineerId, GlassInfo::getEngineerId) |
| | | .eq(Engineering::getState, 0) |
| | | ) |
| | | .groupBy(GlassInfo::getFlowCardId) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public GlassInfo selectGlassId(String id) { |
| | | return baseMapper.selectOne(new QueryWrapper<GlassInfo>().lambda() |
| | |
| | | }else{ |
| | | |
| | | log.info("4、如果不属于版图id和片序的顺序执行进片任务"); |
| | | |
| | | |
| | | //添加进片任务 查找空格 |
| | | List<DownStorageCageDetails> list = downStorageCageService.selectCacheEmpty(); |
| | | if(list.size()>0){ |
| | |
| | | package com.mes.job;
|
| | |
|
| | | import cn.hutool.json.JSONObject;
|
| | | import com.mes.downstorage.service.DownStorageCageService;
|
| | | import com.mes.downworkstation.entity.DownWorkstation;
|
| | | import com.mes.downworkstation.service.DownWorkstationService;
|
| | | import com.mes.tools.WebSocketServer;
|
| | |
| | | @Component
|
| | | public class Downpush {
|
| | |
|
| | |
|
| | | @Autowired
|
| | | private DownWorkstationService downWorkstationService;
|
| | | @Scheduled(fixedDelay = 1000)
|
| | | public void Downpush() {
|
| | | @Autowired
|
| | | private DownStorageCageService downStorageCageService;
|
| | |
|
| | |
|
| | | @Scheduled(fixedDelay = 2000)
|
| | | public void sendDownWorkstations() {
|
| | | log.info("发送工位玻璃信息");
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | JSONObject jsonObject2 = new JSONObject();
|
| | | JSONObject jsonObject3 = new JSONObject();
|
| | |
|
| | | List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(1,6);
|
| | | List<Map<String, Object>> glassinfodata = downWorkstationService.getTotalGlassDimensionsByWorkstation(1,3);
|
| | | List<Map<String, Object>> glassinfodata2 = downWorkstationService.getTotalGlassDimensionsByWorkstation(4,6);
|
| | | jsonObject.append("params",data);
|
| | | jsonObject2.append("glassinfo",glassinfodata);
|
| | | jsonObject3.append("glassinfo2",glassinfodata2);
|
| | | log.info(jsonObject.toString());
|
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
|
| | | ArrayList<WebSocketServer> sendwServer2 = WebSocketServer.sessionMap.get("unloadglass2");
|
| | | ArrayList<WebSocketServer> sendwServer3 = WebSocketServer.sessionMap.get("unloadglass3");
|
| | | // log.info(sendwServer.toString());
|
| | | if (sendwServer != null) {
|
| | | for (WebSocketServer webserver : sendwServer) {
|
| | |
|
| | | if (webserver != null&&webserver.session.isOpen()) {
|
| | | log.info("已发送");
|
| | | webserver.sendMessage(jsonObject.toString());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = 1000)
|
| | | public void sendGlassInfoData() {
|
| | | log.info("发送工位显示图信息1");
|
| | | JSONObject jsonObject2 = new JSONObject();
|
| | | List<Map<String, Object>> glassinfodata = downWorkstationService.getTotalGlassDimensionsByWorkstation(1,3);
|
| | | jsonObject2.append("glassinfo",glassinfodata);
|
| | | log.info(jsonObject2.toString());
|
| | | ArrayList<WebSocketServer> sendwServer2 = WebSocketServer.sessionMap.get("unloadglass2");
|
| | | if (sendwServer2 != null) {
|
| | | for (WebSocketServer webserver : sendwServer2) {
|
| | |
|
| | | if (webserver != null&&webserver.session.isOpen()) {
|
| | | webserver.sendMessage(jsonObject2.toString());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = 1000)
|
| | | public void sendGlassInfoData2() {
|
| | | log.info("发送工位显示图信息2");
|
| | | JSONObject jsonObject3 = new JSONObject();
|
| | | List<Map<String, Object>> glassinfodata2 = downWorkstationService.getTotalGlassDimensionsByWorkstation(4,6);
|
| | | jsonObject3.append("glassinfo2",glassinfodata2);
|
| | | log.info(jsonObject3.toString());
|
| | | ArrayList<WebSocketServer> sendwServer3 = WebSocketServer.sessionMap.get("unloadglass3");
|
| | | if (sendwServer3 != null) {
|
| | | for (WebSocketServer webserver : sendwServer3) {
|
| | |
|
| | | if (webserver != null&&webserver.session.isOpen()) {
|
| | | webserver.sendMessage(jsonObject3.toString());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = 2000)
|
| | | public void sendDownStorageCages() {
|
| | | log.info("发送缓存玻璃信息");
|
| | | JSONObject jsonObject4 = new JSONObject();
|
| | | List<Map<String, Object>> list=downStorageCageService.selectDownStorageCages();
|
| | | jsonObject4.append("params2",list);
|
| | | log.info(jsonObject4.toString());
|
| | | ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("downcache");
|
| | | if (sendwServer4 != null) {
|
| | | for (WebSocketServer webserver : sendwServer4) {
|
| | | if (webserver != null&&webserver.session.isOpen()) {
|
| | | webserver.sendMessage(jsonObject4.toString());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
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 |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | active: cz |
| | | application: |
| | | name: unLoadGlass |
| | | |
| | |
| | | import com.mes.UnLoadGlassApplication; |
| | | import com.mes.downglassinfo.service.impl.DownGlassInfoServiceImpl; |
| | | import com.mes.downglassinfo.service.impl.DownGlassTaskServiceImpl; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import com.mes.downstorage.service.impl.DownStorageCageDetailsServiceImpl; |
| | | import com.mes.downstorage.service.impl.DownStorageCageServiceImpl; |
| | | |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.impl.DownWorkstationServiceImpl; |
| | | import com.mes.glassinfo.service.impl.GlassInfoServiceImpl; |
| | | import com.mes.utils.Result; |
| | | 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.context.annotation.Bean; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = UnLoadGlassApplication.class) |
| | | |
| | | public class UnloadGlassModuleApplicationTest { |
| | | |
| | | @Autowired |
| | |
| | | GlassInfoServiceImpl glassInfoServiceImpl; |
| | | @Autowired |
| | | DownWorkstationService downWorkstationService; |
| | | @Autowired |
| | | DownStorageCageService downStorageCageService; |
| | | |
| | | |
| | | |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void CacheEmpty() { |
| | | log.info("测试出片"); |
| | | downStorageCageDetailsService.CacheOut(1,2); |
| | | // @Test |
| | | // public void CacheEmpty() { |
| | | // log.info("测试出片"); |
| | | // downStorageCageDetailsService.CacheOut(1,2); |
| | | // |
| | | // } |
| | | |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void CacheEmpty1() { |
| | | log.info("测试出片"); |
| | |
| | | downStorageCageServiceImpl.selectCacheEmpty(); |
| | | } |
| | | |
| | | @Test |
| | | public void getFlowCardId() { |
| | | |
| | | |
| | | glassInfoServiceImpl.getFlowCardId(); |
| | | } |
| | | |
| | | @Test |
| | | public void updateDownStorageCage() { |
| | | |
| | | |
| | | DownStorageCage downStorageCage= new DownStorageCage(); |
| | | downStorageCage.setEnableState("0"); |
| | | downStorageCage.setId(1); |
| | | downStorageCageService.updateDownStorageCage(downStorageCage); |
| | | |
| | | } |
| | | |
| | | |
| | | } |