Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
# Conflicts:
# UI-Project/src/views/Caching/cachingun.vue
| | |
| | | const userStore = useUserInfoStore() |
| | | const user = userStore.user.userName |
| | | |
| | | // store.createWebSocket(); |
| | | function quit() { |
| | | userStore.$patch({ |
| | | let userInfoStr = window.localStorage.getItem('userInfo') |
| | | console.log(userInfoStr); |
| | | // const userInfoStr = localStorage.getItem('userInfo'); |
| | | // let userInfo = userInfoStr.user.token; |
| | | let token = userInfo; // 提取 token |
| | | // 退出登录方法 |
| | | const quit = async () => { |
| | | try { |
| | | const response = await request.get('/loadGlass/sys/user/logout', { |
| | | token: token, |
| | | user: null, |
| | | }) |
| | | // router.push('/login') |
| | | let token = window.localStorage.getItem('userInfo') |
| | | console.log(token); |
| | | request.get("/loadGlass/sys/user/login").then((res) => { |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.msg); |
| | | console.log(res.data); |
| | | if (response.code === 200) { |
| | | // 登出成功,清除本地存储的 userInfo |
| | | localStorage.removeItem('userInfo'); |
| | | // 可以在这里重置应用状态,如导航到登录页等 |
| | | console.log('登出成功'); |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | | // router.push("/login"); |
| | | // 处理错误情况 |
| | | console.error('登出失败', response); |
| | | } |
| | | }); |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | // store.createWebSocket(); |
| | | // function quit() { |
| | | // userStore.$patch({ |
| | | // user: null, |
| | | // }) |
| | | // // router.push('/login') |
| | | // request.get("/loadGlass/sys/user/login").then((res) => { |
| | | // if (res.code === 200) { |
| | | // ElMessage.success(res.msg); |
| | | // console.log(res.data); |
| | | // } else { |
| | | // ElMessage.warning(res.msg); |
| | | // // router.push("/login"); |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | //提取菜单模块列表 |
| | | let menuList = $ref([]) |
| | |
| | | const adda = ref(false) |
| | | |
| | | 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.post("/cacheGlass/edgStorageCage/selectEdgStorageCage").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.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://10.153.19.150:88/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> |
| | |
| | | <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 { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | const blind = ref(false) |
| | | const olWidth = ref(); |
| | | const olHeight = ref(); |
| | |
| | | height:( rect.height*100) * 0.004 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | console.log(adjustedRects.value); |
| | | |
| | | console.log(rect); |
| | | |
| | | // console.log( (rect.width*100) / 300 ); |
| | | } else { |
| | |
| | | } |
| | | }); |
| | | } |
| | | const socketUrl = `ws://10.153.19.150:88/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.005, // 将x值除以3 |
| | | y_axis: (rect.y_axis*100) * 0.005, |
| | | width: (rect.width*100) * 0.004 , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height:( rect.height*100) * 0.004 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | // console.log("更新后数据", tableData); |
| | | |
| | | }; |
| | | |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import type { TableColumnCtx } from 'element-plus' |
| | | |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | const dialogFormVisible = ref(false) |
| | | const blind = ref(false) |
| | |
| | | const adda = ref(false) |
| | | const flake = ref(false) |
| | | const flakea = ref(false) |
| | | // const patternHeight = ref(''); |
| | | // const patternWidth = ref(''); |
| | | // const filmsId = ref(''); |
| | | // const patternThickness = ref(''); |
| | | // const number = ref(''); |
| | | // patternHeight.value = ''; |
| | | // patternWidth.value = ''; |
| | | // filmsId.value = ''; |
| | | // patternThickness.value = ''; |
| | | // number.value = ''; |
| | | import { WebSocketHost } from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | const ida = ref(null); |
| | | import { ref, onMounted, onUnmounted } from "vue"; |
| | | // import http from "@/http/index"; |
| | | |
| | | let ruleForm = ref({ |
| | | projectNo: '', |
| | | workstationId: '', |
| | | patternHeight: '', |
| | | patternWidth: '', |
| | | filmsId: '', |
| | | patternThickness: '', |
| | | number: '', |
| | | |
| | | }) |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { ref, onMounted, onUnmounted, onBeforeUnmount } from "vue"; |
| | | // 响应式数据 |
| | | const selectedProjectNo = ref(''); // 当前选中的工程号 |
| | | const selectedProjectNoa = ref(''); // 当前选中的工程号 |
| | | const selectedValue = ref(''); // 当前选中的宽 |
| | | const selectedValuea = ref(''); |
| | | const selectedValueb = ref(''); |
| | | const selectedValuec = ref(''); |
| | | const upstatus = ref(''); // 假设这个用于显示自动/手动状态 |
| | | const cuttingMachine = ref(''); // 假设这个用于存储后端返回的状态值(0或1) |
| | | const cuttingMachineStatusColor = ref(''); // 用于动态设置i标签的背景色 |
| | | const inKageWord = ref(0); // 用于存储要传递给接口的inKageWord值 |
| | | const options = ref<any[]>([]); // 下拉选项列表 |
| | | const selectOptions = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsa = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsb = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsc = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const tableDataa = ref([]) |
| | | |
| | | |
| | | const tableData = reactive([]); |
| | | // let filterData = ref({ |
| | | // damageDetails: { |
| | | // state: '', |
| | | // }, |
| | | |
| | | // }) |
| | | // 发送获取表格数据的请求 |
| | | const fetchTableData = async () => { |
| | | try { |
| | | const response = await request.get("/loadGlass/up-patten-usage/prioritylist"); |
| | | |
| | | // 检查响应状态 |
| | | if (response.code === 200) { |
| | | // 更新表格数据 |
| | | 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)); |
| | | const uniqueFilmsIds = new Set(response.data.map(item => item.filmsId)); |
| | | const uniqueThicknesses = new Set(response.data.map(item => item.thickness)); |
| | | |
| | | selectOptions.value = Array.from(uniqueWidths).map(width => ({ |
| | | value: width, // 假设这是你想要作为value的属性 |
| | | label: width, // 假设这是你想要显示的label |
| | | })); |
| | | selectOptionsa.value = Array.from(uniqueHeights).map(height => ({ |
| | | value: height, |
| | | label: height, |
| | | })); |
| | | selectOptionsb.value = Array.from(uniqueFilmsIds).map(filmsId => ({ |
| | | value: filmsId, |
| | | label: filmsId, |
| | | })); |
| | | selectOptionsc.value = Array.from(uniqueThicknesses).map(thickness => ({ |
| | | value: thickness, |
| | | label: thickness, |
| | | })); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | |
| | | // ElMessage.error('获取表格数据失败,请重试'); |
| | | } |
| | | }; |
| | | onMounted(async () => { |
| | | await fetchTableData(); |
| | | request.get("/loadGlass/LoadGlass/list").then((res) => { |
| | | window.localStorage.setItem('patternWidth', res.data.patternWidth) |
| | | window.localStorage.setItem('workstationId', res.data.workstationId) |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | tableDataa.value = res.data |
| | | console.log(res.data.patternWidth); |
| | | |
| | | // 设置定时器来定期刷新数据 |
| | | const intervalId = setInterval(async () => { |
| | | await fetchTableData(); |
| | | }, 1000); // 每1秒刷新一次 |
| | | |
| | | // 组件卸载时清除定时器 |
| | | onUnmounted(() => { |
| | | clearInterval(intervalId); |
| | | }); |
| | | }); |
| | | onMounted(async () => { |
| | | await fetchTableDataa(); |
| | | |
| | | // 设置定时器来定期刷新数据 |
| | | const intervalId = setInterval(async () => { |
| | | await fetchTableDataa(); |
| | | }, 1000); // 每1秒刷新一次 |
| | | |
| | | // 组件卸载时清除定时器 |
| | | onUnmounted(() => { |
| | | clearInterval(intervalId); |
| | | }); |
| | | }); |
| | | // request.get("/loadGlass/LoadGlass/list").then((res) => { |
| | | // if (res.code === 200) { |
| | | // console.log(res.data); |
| | | // tableDataa.value = res.data; |
| | | |
| | | // if (tableDataa.value.length === 2) { |
| | | // if (tableDataa.value[0].patternWidth > 0) { |
| | | // flake.value = true; |
| | | // } |
| | | |
| | | // if (tableDataa.value[1].patternWidth > 0) { |
| | | // flakea.value = true; |
| | | // } |
| | | // } |
| | | // } else { |
| | | // ElMessage.warning(res.msg); |
| | | // // router.push("/login"); |
| | | // } |
| | | // }); |
| | | async function fetchTableDataa() { |
| | | try { |
| | | const res = await request.get("/loadGlass/LoadGlass/list"); |
| | | if (res.code === 200) { |
| | | tableDataa.value = res.data; |
| | | |
| | | // 根据数据更新 flake 和 flakea 的值 |
| | | if (res.data.length >= 2) { |
| | | if (res.data[0].patternWidth > 0) { |
| | | flake.value = true; |
| | | } else { |
| | | flake.value = false; |
| | | } |
| | | |
| | | if (res.data[1].patternWidth > 0) { |
| | | flakea.value = true; |
| | | } else { |
| | | flakea.value = false; |
| | | } |
| | | let workstationId = window.localStorage.getItem('workstationId') |
| | | let patternWidth = window.localStorage.getItem('patternWidth') |
| | | if (patternWidth !== '' || workstationId == '1') { |
| | | flake.value = true |
| | | } else if (patternWidth !== '' || workstationId == '2') { |
| | | flakea.value = true |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | | ElMessage.warning(res.msg) |
| | | // router.push("/login") |
| | | } |
| | | } catch (error) { |
| | | console.error('获取表格数据失败', error); |
| | | // 可以在这里添加额外的错误处理逻辑 |
| | | } |
| | | } |
| | | // request.get("/loadGlass/LoadGlass/list").then((res) => { |
| | | // window.localStorage.setItem('patternWidth', res.data.patternWidth) |
| | | // window.localStorage.setItem('workstationId', res.data.workstationId) |
| | | // if (res.code == 200) { |
| | | // console.log(res.data); |
| | | // tableDataa.value = res.data |
| | | // console.log(res.data.patternWidth); |
| | | |
| | | // let workstationId = window.localStorage.getItem('workstationId') |
| | | // let patternWidth = window.localStorage.getItem('patternWidth') |
| | | // if (patternWidth !== '' || workstationId == '1') { |
| | | // flake.value = true |
| | | // } else if (patternWidth !== '' || workstationId == '2') { |
| | | // flakea.value = true |
| | | // } |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // // router.push("/login") |
| | | // } |
| | | // }); |
| | | }); |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | |
| | | }) |
| | | const titleSelectJsona = ref({ |
| | | processTypea: [], |
| | | |
| | | }) |
| | | // const getBasicData = ref({ |
| | | // id: '', |
| | | // projectNo: '', |
| | | // }) |
| | | // const requestData = { |
| | | // // projectNo:"P24030805", |
| | | // state:100 |
| | | // }; |
| | | // request.post("/loadGlass/optimizeProject/listByState", requestData) |
| | | // .then((res) => { |
| | | // if (res.code == 200) { |
| | | // titleSelectJson.value.processType = res.data; |
| | | // console.log(res.data); |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // // router.push("/login") |
| | | // } |
| | | // }); |
| | | // 初始请求参数 |
| | | const socketUrl = `ws://10.153.19.150:88/api/loadGlass/api/talk/loadGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | |
| | | tableData.splice(0, tableData.length, ...data.prioritylist[0]); |
| | | tableDataa.value = data.list[0] |
| | | // console.log("更新后数据", tableData); |
| | | }; |
| | | const requestData = { |
| | | state: 100 |
| | | }; |
| | | // 响应式数据 |
| | | const selectedProjectNo = ref(''); // 当前选中的工程号 |
| | | const selectedProjectNoa = ref(''); // 当前选中的工程号 |
| | | const options = ref<any[]>([]); // 下拉选项列表 |
| | | |
| | | // 调用接口获取选项数据的函数 |
| | | const fetchOptions = async (queryString: string) => { |
| | | try { |
| | |
| | | |
| | | if (response.code == 200) { |
| | | titleSelectJson.value.processType = response.data; |
| | | console.log(response.data); |
| | | |
| | | } else { |
| | | ElMessage.warning(response.data); |
| | | } |
| | | } catch (error) { |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | // 开始上片下拉选 |
| | | const fetchOptionsa = async (queryString: string) => { |
| | | try { |
| | | // 发送请求到后端接口 |
| | | const response = await request.get('/loadGlass/engineering/engineering/selectTask'); |
| | | if (response.code == 200) { |
| | | titleSelectJsona.value.processTypea = response.data; |
| | | console.log(response.data); |
| | | |
| | | } else { |
| | |
| | | }; |
| | | // 初始化加载数据(如果需要) |
| | | onMounted(() => { |
| | | // 在组件挂载后调用 fetchOptions('') 来加载初始数据(如果需要) |
| | | fetchOptions(''); |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onMounted(() => { |
| | | // 在组件挂载后调用 fetchOptions('') 来加载初始数据(如果需要) |
| | | fetchOptionsa(''); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | // const billall = () => { |
| | | // request.post("/loadGlass/optimizeProject/listByState", requestData) |
| | | // .then((res: any) => { |
| | | // // if (res.code == 200) { |
| | | // tableData.value = res.data; |
| | | // // let self = this |
| | | // // } |
| | | // }) |
| | | // .catch((err: any) => {}); |
| | | // } |
| | | const user = ref(''); |
| | | // 定义表头上传数据 |
| | | // let titleUploadData = ref({ |
| | | // projectNo:'', |
| | | // }) |
| | | const projectNo = ref(''); |
| | | const workstationId = ref(''); |
| | | const id = ref(''); |
| | |
| | | const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', { |
| | | id: workstationId.value, |
| | | workstationId: workstationId.value, |
| | | patternHeight: patternHeight.value, |
| | | patternWidth: patternWidth.value, |
| | | filmsId: filmsId.value, |
| | | patternThickness: patternThickness.value, |
| | | patternHeight: selectedValuea.value, |
| | | patternWidth: selectedValue.value, |
| | | filmsId: selectedValueb.value, |
| | | patternThickness: selectedValuec.value, |
| | | number: number.value |
| | | }); |
| | | if (response.code == 200) { |
| | |
| | | // window.location.reload() |
| | | add.value = false; |
| | | tableDataa.value = response.data; |
| | | // patternHeight = ''; |
| | | // patternWidth.value = ''; |
| | | // filmsId.value = ''; |
| | | // patternThickness.value = ''; |
| | | // number.value = ''; |
| | | selectedValuea.value = ''; |
| | | selectedValue.value = ''; |
| | | selectedValueb.value = ''; |
| | | selectedValuec.value = ''; |
| | | number.value = ''; |
| | | window.localStorage.setItem('workstationId', response.data.workstationId) |
| | | let workstationId = window.localStorage.getItem('workstationId') |
| | | if (workstationId == '1') { |
| | |
| | | const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', { |
| | | id: workstationId.value, |
| | | workstationId: workstationId.value, |
| | | patternHeight: patternHeight.value, |
| | | patternWidth: patternWidth.value, |
| | | filmsId: filmsId.value, |
| | | patternThickness: patternThickness.value, |
| | | patternHeight: selectedValuea.value, |
| | | patternWidth: selectedValue.value, |
| | | filmsId: selectedValueb.value, |
| | | patternThickness: selectedValuec.value, |
| | | number: number.value |
| | | }); |
| | | if (response.code == 200) { |
| | |
| | | // window.location.reload() |
| | | add.value = false; |
| | | tableDataa.value = response.data; |
| | | selectedValuea.value = ''; |
| | | selectedValue.value = ''; |
| | | selectedValueb.value = ''; |
| | | selectedValuec.value = ''; |
| | | number.value = ''; |
| | | window.localStorage.setItem('workstationId', response.data.workstationId) |
| | | let workstationId = window.localStorage.getItem('workstationId') |
| | | if (workstationId == '1') { |
| | |
| | | // 选择工程确认 |
| | | const handleup = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/up-patten-usage/saveUpPattenUsage', { |
| | | 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); |
| | | // window.location.reload() |
| | | dialogFormVisible.value = false; |
| | | tableData.splice(0, tableData.length, ...response.data); |
| | | selectedProjectNo.value = '' |
| | | markingMachineStatus.value = '#911005'; |
| | | cuttingMachineStatus.value = '#911005'; |
| | | const uniqueWidths = new Set(response.data.map(item => item.width)); |
| | | const uniqueHeights = new Set(response.data.map(item => item.height)); |
| | | const uniqueFilmsIds = new Set(response.data.map(item => item.filmsId)); |
| | | const uniqueThicknesses = new Set(response.data.map(item => item.thickness)); |
| | | |
| | | selectOptions.value = Array.from(uniqueWidths).map(width => ({ |
| | | value: width, // 假设这是你想要作为value的属性 |
| | | label: width, // 假设这是你想要显示的label |
| | | })); |
| | | selectOptionsa.value = Array.from(uniqueHeights).map(height => ({ |
| | | value: height, |
| | | label: height, |
| | | })); |
| | | selectOptionsb.value = Array.from(uniqueFilmsIds).map(filmsId => ({ |
| | | value: filmsId, |
| | | label: filmsId, |
| | | })); |
| | | selectOptionsc.value = Array.from(uniqueThicknesses).map(thickness => ({ |
| | | value: thickness, |
| | | label: thickness, |
| | | })); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | |
| | | } |
| | | // 开始上片 |
| | | const handle = async () => { |
| | | if (markingMachineStatus.value === 'green' && cuttingMachineStatus.value === 'green') { |
| | | |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | |
| | | const response = await request.post('/loadGlass/engineering/engineering/changeTask', { |
| | | engineerId: selectedProjectNoa.value, |
| | | engineerId: engineeringId, |
| | | state: 1, |
| | | }) |
| | | if (response.code == 200) { |
| | |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | tableData.splice(0, tableData.length, ...response.data); |
| | | selectedProjectNoa.value = '' |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } else if (markingMachineStatus.value === '#911005' || cuttingMachineStatus.value === '#911005') { |
| | | // 提示用户打标机未就绪 |
| | | ElMessage.warning('请确认打标机和切割机的就绪状态!'); |
| | | } |
| | | } |
| | | // 暂停 |
| | | const handlea = async () => { |
| | |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/changeTask', { |
| | | const response = await request.post('/loadGlass/engineering/engineering/pauseTask', { |
| | | engineeringId: engineeringId, |
| | | state: 0, |
| | | }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blinda.value = false; |
| | | // tableData.value = response.data |
| | | // tableData.value = []; |
| | | tableData.splice([]); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/changeTask', { |
| | | const response = await request.post('/loadGlass/engineering/engineering/pauseTask', { |
| | | engineeringId: engineeringId, |
| | | state: 0, |
| | | }) |
| | |
| | | } |
| | | } |
| | | onMounted(fetchTableData); |
| | | onMounted(fetchTableDataa); |
| | | function getStatusText(state: number) { |
| | | switch (state) { |
| | | case 0: |
| | |
| | | return '上片中'; |
| | | case 100: |
| | | return '已完成'; |
| | | default: |
| | | return '未知状态'; |
| | | } |
| | | } |
| | | |
| | | function getStatusType(state: number) { |
| | | // 这里假设只有100时类型不是success,其他都是success |
| | | return state === 100 ? 'info' : 'success'; // 根据需要调整类型 |
| | | switch (state) { |
| | | case 0: |
| | | return 'warning'; |
| | | case 1: |
| | | return 'primary'; |
| | | case 2: |
| | | return 'primary'; |
| | | case 100: |
| | | return 'success'; |
| | | } |
| | | // const open = () => { |
| | | // ElMessageBox.confirm( |
| | | // '是否删除该条信息?', |
| | | // '提示', |
| | | // { |
| | | // confirmButtonText: '是', |
| | | // cancelButtonText: '取消', |
| | | // type: 'warning', |
| | | // } |
| | | // ) |
| | | // .then(() => { |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '删除成功!', |
| | | // }) |
| | | // }) |
| | | // .catch(() => { |
| | | // ElMessage({ |
| | | // type: 'info', |
| | | // message: '删除失败', |
| | | // }) |
| | | // }) |
| | | // } |
| | | } |
| | | // 开始上片 |
| | | const handleBind = (row) => { |
| | | // engineeringId.value = row.engineeringId; |
| | | |
| | | blind.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 暂停 |
| | | const handleBinda = (row) => { |
| | | // engineeringId.value = row.engineeringId; |
| | | |
| | | blinda.value = true; // 打开绑定架子对话框 |
| | | blinda.value = true; |
| | | }; |
| | | // 停止任务 |
| | | const handleBindb = (row) => { |
| | | // engineeringId.value = row.engineeringId; |
| | | |
| | | blindb.value = true; // 打开绑定架子对话框 |
| | | blindb.value = true; |
| | | }; |
| | | |
| | | // 删除 |
| | | const handleBindRacka = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | |
| | | adda.value = true; // 打开绑定架子对话框 |
| | | workstationId.value = row.workstationId; |
| | | adda.value = true; |
| | | }; |
| | | 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 markingMachineStatus = ref('#911005'); |
| | | const cuttingMachineStatus = ref('#911005'); |
| | | // 定义一个方法来改变颜色状态 |
| | | const confirmMarkingMachine = () => { |
| | | markingMachineStatus.value = 'green'; |
| | | }; |
| | | const confirmCuttingMachine = () => { |
| | | cuttingMachineStatus.value = 'green'; |
| | | }; |
| | | |
| | | |
| | | |
| | | const wsUrl = 'ws://10.153.19.150:88/api/loadGlass/api/talk/loadGlass'; |
| | | const ws = new WebSocket(wsUrl); |
| | | ws.onopen = () => { |
| | | console.log('WebSocket连接已打开'); |
| | | }; |
| | | |
| | | // 监听WebSocket的错误事件 |
| | | ws.onerror = (error) => { |
| | | console.error('WebSocket发生错误:', error); |
| | | }; |
| | | |
| | | // 监听WebSocket的关闭事件 |
| | | ws.onclose = (event) => { |
| | | if (event.wasClean) { |
| | | console.log('WebSocket连接已正常关闭'); |
| | | } else { |
| | | console.error('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'; |
| | | inKageWord.value = status === '1' ? 0 : 1; |
| | | } else { |
| | | // 处理错误情况或无效数据 |
| | | console.error('接收到的数据无效', data); |
| | | } |
| | | } catch (error) { |
| | | console.error('解析WebSocket消息时发生错误', error); |
| | | } |
| | | }; |
| | | const confirmCutting = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/LoadGlass/updateMesInkageLoad', |
| | | inKageWord.value |
| | | ); |
| | | if (response.code == 200) { |
| | | const status = response.data.status; |
| | | upstatus.value = status === '1' ? '上片机联机状态:' : '上片机手动状态:'; |
| | | cuttingMachineStatusColor.value = status === '1' ? '#911005' : 'green'; |
| | | // 显示成功消息 |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message || '请求失败'); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error('请求时发生错误', error); |
| | | 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> |
| | | <div> |
| | | <div id="dotClass"> |
| | | <div>打标机就绪状态:</div> |
| | | <i style="margin-top: 2px; background-color: green;width:18px; height:18px; border-radius: 50%; display: block"></i> |
| | | <el-button style="margin-left: 30px;margin-top: -3px;">手动确认</el-button> |
| | | |
| | | <i :style="{ marginTop: '2px', backgroundColor: markingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmMarkingMachine" style="margin-left: 30px;margin-top: -3px;">确认</el-button> |
| | | <div style="margin-left: 70px;">切割机就绪状态:</div> |
| | | <i style="margin-top: 2px; background-color: #911005 ;width:18px; height:18px; border-radius: 50%; display: block"></i> |
| | | <el-button style="margin-left: 30px;margin-top: -3px;" >手动确认</el-button> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <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> |
| | | |
| | | </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-table-column prop="engineeringId" label="工程号" width="200" align="center"/> |
| | | <el-table-column prop="width" label="原片宽" align="center"/> |
| | | <el-table-column prop="height" label="原片长" align="center"/> |
| | | <el-table-column prop="height" label="原片高" align="center"/> |
| | | <el-table-column prop="filmsId" label="膜系" align="center"/> |
| | | <el-table-column prop="layoutSequence" label="数量" align="center"/> |
| | | <el-table-column prop="thickness" label="厚度" align="center"/> |
| | |
| | | {{ getStatusText(scope.row.state) }} |
| | | </el-tag> |
| | | </template> |
| | | <!-- <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.state==0?"等待中":"上片中" }}</el-tag> |
| | | </template> --> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | </el-card> |
| | | <el-dialog v-model="blind" top="24vh" width="30%" title="是否开始上片?" > |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <el-form-item label="工程号:" :required="true"> |
| | | <el-select |
| | | v-model="selectedProjectNoa" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择工程" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJsona['processTypea']" |
| | | :key="item.id" |
| | | :label="item.engineerId" |
| | | :value="item.engineerId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <el-dialog v-model="blind" top="30vh" width="25%" title="是否开始上片?" > |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handle"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- <el-dialog v-model="blind" top="30vh" width="25%" title="是否开始上片?" > |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handle"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="blind = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> --> |
| | | <el-dialog v-model="blinda" top="30vh" width="25%" title="是否暂停?" > |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | |
| | | <div id="overlaya" v-show="flakea"></div> |
| | | </div> |
| | | <div style="margin-top: -350px;margin-left: 650px;"> |
| | | <el-table :data="tableDataa" border style="width: 60%" |
| | | <el-table :data="tableDataa" border style="width: 70%" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column prop="workstationId" align="center" label="工位" min-width="50" /> |
| | | <el-table-column prop="patternWidth" align="center" label="宽" min-width="80" /> |
| | | <el-table-column prop="patternHeight" align="center" label="高" min-width="80" /> |
| | | <el-table-column prop="filmsId" align="center" label="膜系" min-width="80" /> |
| | |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="高:" :required="true" style="width: 14vw"> |
| | | <el-input v-model="patternHeight" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | <el-form-item label="宽:" :required="true" style="width: 14vw"> |
| | | <el-select |
| | | v-model="selectedValue" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择宽" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptions" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="宽:" :required="true" style="width: 14vw"> |
| | | <el-input v-model="patternWidth" autocomplete="off" /> |
| | | <el-form-item label="高:" :required="true" style="width: 14vw"> |
| | | <el-select |
| | | v-model="selectedValuea" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择高" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsa" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item></div> |
| | | </div> |
| | | </el-col> |
| | |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="膜系:" :required="true" style="width: 14vw;"> |
| | | <el-input v-model="filmsId" autocomplete="off" /> |
| | | <el-select |
| | | v-model="selectedValueb" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择膜系" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsb" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="厚度:" :required="true" style="width: 14vw"> |
| | | <el-input v-model="patternThickness" autocomplete="off" /> |
| | | <el-select |
| | | v-model="selectedValuec" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择厚度" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsc" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-input v-model="patternThickness" autocomplete="off" /> --> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | |
| | | <el-dialog v-model="dialogFormVisible" top="24vh" width="30%" title="工程" > |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <el-form-item label="工程号:" :required="true"> |
| | |
| | | const adda = ref(false) |
| | | |
| | | 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://10.153.19.150:88/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> |
| | |
| | | const adda = ref(false) |
| | | |
| | | 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://10.153.19.150:88/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> |
| | |
| | | const add = ref(false) |
| | | const adda = ref(false) |
| | | |
| | | const editingUser = ref({}); // 用于存储当前编辑的用户数据 |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | |
| | | console.error(error); |
| | | } |
| | | }; |
| | | // 处理编辑按钮点击 |
| | | function handleEdit(row) { |
| | | editingUser.value = { ...row }; // 使用展开运算符复制当前行数据 |
| | | adda.value = true; // 显示对话框 |
| | | } |
| | | // 编辑 |
| | | const getTableRowa = async () => { |
| | | try { |
| | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | add.value = false; |
| | | editingUser.value = {}; |
| | | adda.value = false; |
| | | tableData.value = response.data; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | |
| | | <el-table-column prop="id" align="center" label="排序" min-width="140"/> |
| | | <el-table-column fixed="right" label="操作" align="center"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="adda = true">编辑</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleEdit(scope.row)">编辑</el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-table-column prop="id" align="center" label="排序" min-width="180" /> |
| | | <el-table-column fixed="right" label="操作" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="adda = true">编辑</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleEdit(scope.row)">编辑</el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-dialog> |
| | | <el-dialog v-model="adda" top="23vh" width="37%" title="修改菜单" > |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form :model="editingUser" ref="formRef" size="mini" label-width="150px"> |
| | | <el-form label-width="100px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="菜单栏:" :required="true" style="width: 25vw"> |
| | | <el-input v-model="menuName" autocomplete="off" /> |
| | | <el-input v-model="editingUser.menuName" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="链接:" :required="true" style="width: 25vw"> |
| | | <el-input v-model="url" autocomplete="off" /> |
| | | <el-input v-model="editingUser.url" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="排序:" :required="true" style="width: 25vw"> |
| | | <el-input v-model="parentId" autocomplete="off" /> |
| | | <el-input v-model="editingUser.parentId" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | const router = useRouter() |
| | | const add = ref(false) |
| | | const adda = ref(false) |
| | | |
| | | const editingUser = ref({}); // 用于存储当前编辑的用户数据 |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | |
| | | console.error(error); |
| | | } |
| | | }; |
| | | // 处理编辑按钮点击 |
| | | function handleEdit(row) { |
| | | editingUser.value = { ...row }; // 使用展开运算符复制当前行数据 |
| | | adda.value = true; // 显示对话框 |
| | | } |
| | | // 编辑 |
| | | const getTableRowa = async () => { |
| | | try { |
| | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | add.value = false; |
| | | editingUser.value = {}; |
| | | adda.value = false; |
| | | tableData.value = response.data; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | |
| | | <el-table-column prop="name" align="center" label="角色" min-width="180" /> |
| | | <el-table-column fixed="right" label="操作" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="adda = true">编辑</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleEdit(scope.row)">编辑</el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-dialog> |
| | | <el-dialog v-model="adda" top="23vh" width="37%" title="修改角色" > |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form :model="editingUser" ref="formRef" size="mini" label-width="150px"> |
| | | <el-form label-width="100px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="角色:" :required="true" style="width: 25vw"> |
| | | <el-input v-model="name" autocomplete="off" /> |
| | | <el-input v-model="editingUser.name" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | const router = useRouter() |
| | | const add = ref(false) |
| | | const adda = ref(false) |
| | | |
| | | const editingUser = ref({}); // 用于存储当前编辑的用户数据 |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | // 处理编辑按钮点击 |
| | | function handleEdit(row) { |
| | | editingUser.value = { ...row }; // 使用展开运算符复制当前行数据 |
| | | adda.value = true; // 显示对话框 |
| | | } |
| | | // 添加 |
| | | const getTableRow = async () => { |
| | | try { |
| | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | add.value = false; |
| | | editingUser.value = {}; |
| | | adda.value = false; |
| | | tableData.value = response.data; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | |
| | | <el-table-column fixed="right" label="操作" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="open(scope.row)">重置密码</el-button> |
| | | <el-button size="mini" type="text" plain @click="adda = true">编辑</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleEdit(scope.row)">编辑</el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-dialog> |
| | | <el-dialog v-model="adda" top="23vh" width="37%" title="修改用户" > |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form :model="editingUser" ref="formRef" size="mini" label-width="150px"> |
| | | <el-form label-width="100px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="用户名:" :required="true" style="width: 25vw"> |
| | | <el-input v-model="userName" autocomplete="off" /> |
| | | <el-input v-model="editingUser.userName" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <!-- <el-table-column align="center" label="角色" min-width="80"> |
| | | <template #default="scope"> |
| | | <el-tag v-for="role in scope.row.roleList"> |
| | | {{role.name}} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> --> |
| | | <el-form-item label="角色:" :required="true" style="width: 25vw;"> |
| | | <el-select |
| | | v-model="selectedProjectNoa" |
| | |
| | | <div> |
| | | <el-form-item label="密码:" :required="true" style="width: 25vw;"> |
| | | <el-input style="width: 340px;" |
| | | v-model="password" |
| | | v-model="editingUser.password" |
| | | autocomplete="off" |
| | | :prefix-icon="Lock" |
| | | show-password/> |
New file |
| | |
| | | { |
| | | "plcAddressBegin":"DB11.0", |
| | | "plcAddressLenght":"80", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "A06_request_word", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "A05_scanning_ID", |
| | | "addressIndex":"2", |
| | | "addressLenght":"30", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "Current_slot", |
| | | "addressIndex":"36", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MES_confirmation_word", |
| | | "addressIndex":"38", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "A08_glass_status", |
| | | "addressIndex":"68", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "A10_glass_status", |
| | | "addressIndex":"70", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "A09_prohibit_film_production", |
| | | "addressIndex":"72", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | , |
| | | { |
| | | "codeId": "A10_prohibit_film_production", |
| | | "addressIndex":"74", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | ] |
| | | } |
New file |
| | |
| | | { |
| | | "plcAddressBegin":"DB.0", |
| | | "plcAddressLenght":"72", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "D01Request", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "D01ID1", |
| | | "addressIndex":"2", |
| | | "addressLenght":"6", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04Request", |
| | | "addressIndex":"8", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04ID1", |
| | | "addressIndex":"10", |
| | | "addressLenght":"6", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D02Go", |
| | | "addressIndex":"20", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D05Go", |
| | | "addressIndex":"22", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | , |
| | | { |
| | | "codeId": "DeviceStatus", |
| | | "addressIndex":"70", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | ] |
| | | } |
New file |
| | |
| | | { |
| | | "plcAddressBegin":"DB1.2000", |
| | | "plcAddressLenght":"100", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "loadRequest", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "PlcStatus", |
| | | "addressIndex":"10", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MesToPlc", |
| | | "addressIndex":"20", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "InkageStatus", |
| | | "addressIndex":"22", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "WorkId", |
| | | "addressIndex":"24", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "GlassWidth", |
| | | "addressIndex":"26", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "GlassHeight", |
| | | "addressIndex":"28", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | , |
| | | { |
| | | "codeId": "MesToPlcStatus", |
| | | "addressIndex":"40", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MesToPlcStatusId", |
| | | "addressIndex":"42", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MesTaskStatus", |
| | | "addressIndex":"56", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | ] |
| | | } |
New file |
| | |
| | | { |
| | | "plcAddressBegin": "DB100.0", |
| | | "plcAddressLenght": "142", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | { |
| | | "codeId": "RequestWord", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04ID", |
| | | "addressIndex": "2", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06RobotTaskRequestWord", |
| | | "addressIndex": "4", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06ID", |
| | | "addressIndex": "6", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11RobotTaskRequestWord", |
| | | "addressIndex": "8", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G011ID", |
| | | "addressIndex": "10", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "12", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "14", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "16", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "18", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "MESSendingWord", |
| | | "addressIndex": "20", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InputGrid", |
| | | "addressIndex": "22", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "OutputGrid", |
| | | "addressIndex": "24", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "OutputID", |
| | | "addressIndex": "26", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "FrontOrRearLowerSlice", |
| | | "addressIndex": "28", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "30", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06RobotTaskReply", |
| | | "addressIndex": "32", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06Rack", |
| | | "addressIndex": "34", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11RobotTaskReply", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11Rack", |
| | | "addressIndex": "38", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "40", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "42", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "44", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "46", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "48", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "50", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "52", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "54", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "MESTaskState", |
| | | "addressIndex": "56", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "58", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "AlarmState", |
| | | "addressIndex": "60", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm1", |
| | | "addressIndex": "62", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm2", |
| | | "addressIndex": "64", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm3", |
| | | "addressIndex": "66", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm4", |
| | | "addressIndex": "68", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "neirong", |
| | | "addressIndex": "70", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "device", |
| | | "addressIndex": "72", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "74", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "76", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut1", |
| | | "addressIndex": "78", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut2", |
| | | "addressIndex": "80", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut3", |
| | | "addressIndex": "82", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut4", |
| | | "addressIndex": "84", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut5", |
| | | "addressIndex": "86", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut6", |
| | | "addressIndex": "88", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut7", |
| | | "addressIndex": "90", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "92", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "94", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "96", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "98", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "100", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04ActionState", |
| | | "addressIndex": "102", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05ActionState", |
| | | "addressIndex": "104", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06ActionState", |
| | | "addressIndex": "106", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G07ActionState", |
| | | "addressIndex": "108", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08ActionState", |
| | | "addressIndex": "110", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09ActionState", |
| | | "addressIndex": "112", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10ActionState", |
| | | "addressIndex": "114", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11ActionState", |
| | | "addressIndex": "116", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G12ActionState", |
| | | "addressIndex": "118", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13ActionState", |
| | | "addressIndex": "120", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04IDS", |
| | | "addressIndex": "122", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05IDS", |
| | | "addressIndex": "124", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06IDS", |
| | | "addressIndex": "126", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G07IDS", |
| | | "addressIndex": "128", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08IDS", |
| | | "addressIndex": "130", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09IDS", |
| | | "addressIndex": "132", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10IDS", |
| | | "addressIndex": "134", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11IDS", |
| | | "addressIndex": "136", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G12IDS", |
| | | "addressIndex": "138", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13ID", |
| | | "addressIndex": "140", |
| | | "addressLenght": "2" |
| | | } |
| | | ] |
| | | } |
| | |
| | | package com.mes.common.config; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/24 10:33 |
| | |
| | | public static final Integer GLASS_CACHE_TYPE_IN = 1; |
| | | public static final Integer GLASS_CACHE_TYPE_OUT = 2; |
| | | public static final Integer GLASS_CACHE_TYPE_THROUGH = 3; |
| | | public static final List<Integer> GLASS_CACHE_TYPE_OUT_ALL = Arrays.asList(2, 3); |
| | | |
| | | /** |
| | | * 磨边任务玻璃状态 |
| | |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.socket.server.standard.ServerEndpointExporter; |
| | | |
| | | /** |
| | | * @author SNG-010 |
| | | */ |
| | | @Configuration |
| | | public class WebSocketConfig { |
| | | /** |
| | |
| | | import com.github.xingshuangs.iot.utils.ShortUtil; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.nio.charset.Charset; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | |
| | |
| | | Array.setByte(valueList, i, plcValueArray[plcParameterInfo.getAddressIndex() + i]); |
| | | |
| | | } |
| | | |
| | | if (plcParameterInfo.getAddressLength() == 2) { |
| | | plcParameterInfo.setValue(String.valueOf(byte2short(valueList))); |
| | | } else if (plcParameterInfo.getAddressLength() == 4) { |
| | |
| | | optimizeGlassinfos = optimizeProjectMapper.selectJoinList(OptimizeGlassinfo.class, new MPJQueryWrapper<OptimizeProject>() |
| | | .select("b.process_id,t.type,b.width,b.height,t.glass_thickness,t.glass_type,b.p_width,b.p_height,b.layer, b.total_layer, b.stock_id,b.heat_layout_id,b.heat_layout_sort,b.x_axis,b.y_axis,b.project_no,b.glass_id") |
| | | .leftJoin("optimize_detail b on t.project_no=b.project_no") |
| | | .eq("t.state",100) |
| | | //.eq("t.state",100) |
| | | .eq("t.project_no", engineeringId)); |
| | | } |
| | | |
| | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.entity.request.OptimizeRequest; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * 将工程信息更新状态为已领取 |
| | | */ |
| | | void changeTask(String engineeringId, int i); |
| | | /** |
| | | * 完成工程任务改为300 |
| | | * |
| | | * @return |
| | | */ |
| | | boolean overTask(UpPattenUsage sequence, int state); |
| | | } |
| | |
| | | import com.mes.pp.entity.request.OptimizeRequest; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<OptimizeProject> listByState(OptimizeRequest optimizeRequest) { |
| | | log.info("将参数传入到查询类里,工程号做非空判断模糊查询"); |
| | | //将参数传入到查询类里,工程号做非空判断模糊查询 |
| | | LambdaQueryWrapper<OptimizeProject> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(OptimizeProject::getState,optimizeRequest.getState()) |
| | | .or(qw -> qw.eq(OptimizeProject::getState, 200)) |
| | | .like(StringUtils.isNotBlank(optimizeRequest.getProjectNo()),OptimizeProject::getProjectNo,optimizeRequest.getProjectNo()) |
| | | //.groupBy(OptimizeProject::getProjectNo) |
| | | ; |
| | | log.info("返回工程信息"); |
| | | //返回工程信息 |
| | | return this.list(wrapper); |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public boolean overTask(UpPattenUsage sequence, int state) { |
| | | if(sequence.getState()==100){ |
| | | UpdateWrapper<OptimizeProject> wrapper=new UpdateWrapper<>(); |
| | | wrapper.eq("project_no",sequence.getEngineeringId()) |
| | | .set("state",state); |
| | | boolean updateSuccess = this.update(wrapper); |
| | | log.info("工程完成更新状态{}",updateSuccess); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | // |
| | | List<SysMenu> menuList = sysUserRoleMapper.selectJoinList(SysMenu.class, wrapper); |
| | | log.info("userinfos:{}",menuList); |
| | | return create(menuList); |
| | | } |
| | | |
| | |
| | | spring: |
| | | datasource: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false |
| | | username: root |
| | | password: beibo.123/ |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | |
| | | |
| | | 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.taskcache.entity.TaskCache; |
| | |
| | | @Autowired |
| | | private EdgStorageCageService edgStorageCageService; |
| | | |
| | | @Autowired |
| | | private EdgStorageCageDetailsService edgStorageCageDetailsService; |
| | | |
| | | @ApiOperation("查询磨边缓存理片笼内详情 参数()") |
| | | @PostMapping("/selectEdgStorageCage") |
| | | @ResponseBody |
| | |
| | | @ResponseBody |
| | | public Result updateEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | return Result.build(200,"更换成功",1); |
| | | return Result.build(200,"【启用/禁用】成功",1); |
| | | } |
| | | |
| | | @ApiOperation("磨边缓存理片笼信息 功能:对笼内栅格玻璃进行【清除/更换/绑定】 EdgStorageCage格子信息,EdgStorageCageDetails 玻璃信息 ") |
| | | @PostMapping("/edgStorageCageGlass") |
| | | @ResponseBody |
| | | public Result edgStorageCageGlass(@RequestBody EdgStorageCageDetails edgStorageCageDetails,int edgStorageCageId) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCageDetails(edgStorageCageId,edgStorageCageDetails); |
| | | return Result.build(200,"删除成功",1); |
| | | return Result.build(200,"【清除/更换/绑定】成功",1); |
| | | } |
| | | |
| | | @ApiOperation("磨边模块汇报玻璃状态 功能:对笼内栅格玻璃进行【破损/拿走】 ") |
| | | @PostMapping("/edgReportStatus") |
| | | @ResponseBody |
| | | public Result edgReportStatus(@RequestBody Map<String, String> arguments) { |
| | | String edgStorageCageDetailsId=arguments.get("glassId"); |
| | | int controlsId=Integer.valueOf(arguments.get("controlsId")); |
| | | boolean isSucess=edgStorageCageDetailsService.identWorn(edgStorageCageDetailsId,controlsId); |
| | | return Result.build(200,"【破损/拿走】成功",1); |
| | | } |
| | | |
| | | } |
| | |
| | | boolean updateEdgStorageCage(EdgStorageCage edgStorageCage); |
| | | |
| | | boolean updateEdgStorageCageDetails(int edgStorageCageId, EdgStorageCageDetails edgStorageCageDetails); |
| | | |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | if (edgStorageCageDetails.size() == 1) { |
| | | EdgStorageCageDetails item = edgStorageCageDetails.get(0); |
| | | item.setState(ControlsId); |
| | | baseMapper.update(edgStorageCageDetails.get(0), new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | baseMapper.update(item, new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | return true; |
| | | } |
| | | // Sql版本 |
| | |
| | | public List<Map<String, Object>> selectCutTerritory() { |
| | | List<UpPattenUsage> upPattenUsage = upPattenUsageMapper.selectList(new MPJLambdaWrapper<UpPattenUsage>() |
| | | .selectAll(UpPattenUsage.class) |
| | | .eq(UpPattenUsage::getState, 1)); |
| | | |
| | | .eq(UpPattenUsage::getState, 1).or().eq(UpPattenUsage::getState, 0).orderByDesc(UpPattenUsage::getState)); |
| | | if (!upPattenUsage.isEmpty()) { |
| | | UpPattenUsage upPattenUsage1 = upPattenUsage.get(0); |
| | | return optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | List<Map<String, Object>> cutTerritorys=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | .selectAll(OptimizeDetail.class) |
| | | .selectAs(OptimizeLayout::getWidth, "olWidth") |
| | | .selectAs(OptimizeLayout::getWidth, "olHeight") |
| | |
| | | .eq(OptimizeDetail::getProjectNo, upPattenUsage1.getEngineeringId()) |
| | | .eq(OptimizeDetail::getStockId, upPattenUsage1.getLayoutSequence()) |
| | | ); |
| | | List<Map<String, Object>> ResultcutTerritorys=new ArrayList<>(); |
| | | for (Map<String, Object> cutTerritory : cutTerritorys) { |
| | | EdgStorageCageDetails edgStorageCageDetails=baseMapper.selectOne(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .selectAll(EdgStorageCageDetails.class) |
| | | .eq(EdgStorageCageDetails::getGlassId, cutTerritory.get("glass_id"))); |
| | | // log.info("内容:{}-------{}",cutTerritory,edgStorageCageDetails); |
| | | if(edgStorageCageDetails!=null){ |
| | | cutTerritory.put("glass_state",edgStorageCageDetails.getState()); |
| | | }else{ |
| | | cutTerritory.put("glass_state",0); |
| | | } |
| | | ResultcutTerritorys.add(cutTerritory); |
| | | } |
| | | return ResultcutTerritorys; |
| | | |
| | | // Sql版本 |
| | | // return optimizeDetailMapper.selectJoinMaps(new MPJQueryWrapper<OptimizeDetail>().selectAll(OptimizeDetail.class) |
| | |
| | | log.info("正常" + edgItem); |
| | | EdgStorageCageDetails edgDItem = edgStorageCageDetailsMapper.selectById(edgStorageCageDetails.getId()); |
| | | if (edgItem != null) { |
| | | //移除 |
| | | //移除 (破损,目前两个概念混合在一起,建议拆开) |
| | | EdgStorageCageDetails result = edgStorageCageDetailsMapper.selectOne(new MPJLambdaWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getSlot, edgStorageCageId)); |
| | | if (result != null) { |
| | | result.setSlot(0); |
| | | result.setState(201); |
| | | edgStorageCageDetailsMapper.updateById(result); |
| | | } |
| | | //添加 |
| | |
| | | package com.mes.glassinfo.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | /** |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface GlassInfoMapper extends BaseMapper<GlassInfo> { |
| | | public interface GlassInfoMapper extends MPJBaseMapper<GlassInfo> { |
| | | |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.lang.Assert; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | |
| | | @Value("${mes.sequence.order}") |
| | | private boolean sequenceOrder; |
| | | |
| | | @Value("${mes.firstLength}") |
| | | private String firstLength; |
| | | |
| | | @Value("${mes.secondLength}") |
| | | private String secondLength; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcHomeEdgTask() { |
| | |
| | | * @param confirmationWrodAddress |
| | | * @param currentSlot |
| | | */ |
| | | private void inTo(String glassId, String confirmationWrodAddress, String currentSlot) { |
| | | public void inTo(String glassId, String confirmationWrodAddress, String currentSlot) { |
| | | log.info("1、按照玻璃id:{}获取玻璃小片信息,当前格子为:{}", glassId, currentSlot); |
| | | //添加进片任务 查找空格 |
| | | EdgStorageCage nearestEmpty = edgStorageCageService.selectNearestEmpty(Integer.parseInt(currentSlot), Boolean.FALSE); |
| | |
| | | * @return |
| | | */ |
| | | public GlassInfo queryAndChangeGlass(String glassId) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId) |
| | | .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | Assert.isFalse(null == glassInfo, "玻璃信息不存在"); |
| | | //按照玻璃尺寸 |
| | | LambdaQueryWrapper<GlassInfo> queryWrapper = new LambdaQueryWrapper<GlassInfo>() |
| | |
| | | GlassInfo swapGlassInfo = glassInfoService.getOne(queryWrapper); |
| | | if (swapGlassInfo != null && !glassInfo.getGlassId().equals(swapGlassInfo.getGlassId())) { |
| | | String swapGlassId = swapGlassInfo.getGlassId(); |
| | | log.info("将玻璃{}和玻璃{},信息互换,进玻璃 {}", glassInfo, swapGlassInfo, swapGlassInfo); |
| | | swapGlassInfo.setGlassId(glassId); |
| | | glassInfo.setGlassId(swapGlassId); |
| | | glassInfoService.updateById(swapGlassInfo); |
| | |
| | | log.info("笼子内和待进片没有玻璃"); |
| | | return Boolean.FALSE; |
| | | } |
| | | EdgStorageCageDetails a09EdgGlass = queryGlassByTaskCache(Const.A09_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT); |
| | | EdgStorageCageDetails a10EdgGlass = queryGlassByTaskCache(Const.A10_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT); |
| | | EdgStorageCageDetails a09EdgGlass = queryGlassByTaskCache(Const.A09_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | EdgStorageCageDetails a10EdgGlass = queryGlassByTaskCache(Const.A10_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | endcell = queryLineByGlassInfo(a09EdgGlass, a10EdgGlass, glassInfo, out08Glassstate, out10Glassstate); |
| | | } else { |
| | | //判断两条线是否都空闲 |
| | | endcell = out10Glassstate == 2 ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | |
| | | if ((out08Glassstate == 0 && out10Glassstate == 0) || (out08Glassstate == 1 && out10Glassstate == 1)) { |
| | | EdgStorageCageDetails a09EdgGlass = queryGlassByTaskCache(Const.A09_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT); |
| | | EdgStorageCageDetails a10EdgGlass = queryGlassByTaskCache(Const.A10_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT); |
| | | EdgStorageCageDetails a09EdgGlass = queryGlassByTaskCache(Const.A09_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | EdgStorageCageDetails a10EdgGlass = queryGlassByTaskCache(Const.A10_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | if (a09EdgGlass == null && a10EdgGlass == null) { |
| | | MPJQueryWrapper<EdgStorageCageDetails> wrapper = new MPJQueryWrapper<>(); |
| | | wrapper.select("count(t.glass_id), t.width, t.height") |
| | |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and t1.first_length <3500 and t1.second_length<2600 "); |
| | | "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") "); |
| | | } |
| | | wrapper.last("order by count(t.glass_id) desc limit 2"); |
| | | List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper); |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | MPJQueryWrapper<GlassInfo> queryWrapper = new MPJQueryWrapper<GlassInfo>() |
| | | .selectAll(GlassInfo.class).eq("t.glass_id", glassId); |
| | | .selectAll(GlassInfo.class).eq("t.glass_id", glassId) |
| | | .inSql("t.engineer_id", "select engineer_id from engineering where state = 1"); |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | queryWrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from glass_info) t1 " + |
| | | "on t.glass_id = t1.glass_id and t1.first_length <3500 and t1.second_length<2600 "); |
| | | "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") "); |
| | | } |
| | | GlassInfo one = glassInfoService.getOne(queryWrapper); |
| | | if (one != null) { |
| | |
| | | //todo: 获取正在执行的工程信息 |
| | | if (StringUtils.isNotBlank(glassId)) { |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, glassId)); |
| | | .eq(GlassInfo::getGlassId, glassId) |
| | | .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | EdgStorageCageDetails resultDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(one, resultDetails); |
| | | glassList.add(resultDetails); |
| | |
| | | return glassDetails; |
| | | } |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, glassId)); |
| | | .eq(GlassInfo::getGlassId, glassId) |
| | | .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1") |
| | | ); |
| | | EdgStorageCageDetails resultDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(one, resultDetails); |
| | | if (null == glassDetails) { |
| | |
| | | */ |
| | | private List<EdgStorageCageDetails> queryGlassByTaskLine(int line) { |
| | | //获取任务表中最后一次出片的玻璃id |
| | | LambdaQueryWrapper<TaskCache> queryWrapper = new LambdaQueryWrapper<TaskCache>().eq(TaskCache::getTaskType, Const.GLASS_CACHE_TYPE_OUT) |
| | | .eq(TaskCache::getEndCell, line).orderByDesc(TaskCache::getCreateTime); |
| | | List<TaskCache> taskCacheList = taskCacheService.list(queryWrapper); |
| | | if (CollectionUtil.isEmpty(taskCacheList)) { |
| | | TaskCache taskCache = taskCacheService.queryGlassByTaskCache(line, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | if (null == taskCache) { |
| | | log.info("没有找到{}线任务信息", line); |
| | | return new ArrayList<>(); |
| | | } |
| | | TaskCache taskCache = taskCacheList.get(0); |
| | | MPJQueryWrapper<EdgStorageCageDetails> mpjLambdaWrapper = new MPJQueryWrapper<>(); |
| | | mpjLambdaWrapper.select("t1.*") |
| | | .innerJoin("edg_storage_cage_details t1 on t.width = t1.width and t.height = t1.height") |
| | |
| | | * 按照任务类型、线号获取任务信息 |
| | | * |
| | | * @param line |
| | | * @param taskType |
| | | * @param taskTypes |
| | | * @return |
| | | */ |
| | | private EdgStorageCageDetails queryGlassByTaskCache(int line, int taskType) { |
| | | LambdaQueryWrapper<TaskCache> queryWrapper = new LambdaQueryWrapper<TaskCache>().eq(TaskCache::getTaskType, taskType) |
| | | .eq(TaskCache::getEndCell, line).orderByDesc(TaskCache::getCreateTime); |
| | | List<TaskCache> list = taskCacheService.list(queryWrapper); |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | private EdgStorageCageDetails queryGlassByTaskCache(int line, List<Integer> taskTypes) { |
| | | TaskCache taskCache = taskCacheService.queryGlassByTaskCache(line, taskTypes); |
| | | if (null == taskCache) { |
| | | log.info("没有找到{}线任务信息", line); |
| | | return null; |
| | | } |
| | | return edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getGlassId, list.get(0).getGlassId())); |
| | | return edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId()) |
| | | .inSql(EdgStorageCageDetails::getEngineerId, "select engineer_id from engineering where state = 1").last(" limit 1 ")); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (endcell == Const.A09_OUT_TARGET_POSITION) { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and t1.first_length <3500 and t1.second_length<2600 "); |
| | | "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") "); |
| | | } |
| | | wrapper.last("order by count(t.glass_id) desc limit 2"); |
| | | List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper); |
| | |
| | | } else { |
| | | log.info("获取玻璃数量前2的玻璃占比为{},小于2", mix); |
| | | //获取任务表中最后一次出片的玻璃id |
| | | LambdaQueryWrapper<TaskCache> queryWrapper = new LambdaQueryWrapper<TaskCache>().eq(TaskCache::getTaskType, Const.GLASS_CACHE_TYPE_OUT) |
| | | .eq(TaskCache::getEndCell, endcell).orderByDesc(TaskCache::getCreateTime); |
| | | List<TaskCache> taskCacheList = taskCacheService.list(queryWrapper); |
| | | log.info("获取任务表中{}线最后一次出片的玻璃任务信息:{}", endcell, taskCacheList); |
| | | if (CollectionUtil.isEmpty(taskCacheList)) { |
| | | TaskCache taskCache = taskCacheService.queryGlassByTaskCache(endcell, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | log.info("获取任务表中{}线最后一次出片的玻璃任务信息:{}", endcell, taskCache); |
| | | if (null == taskCache) { |
| | | log.info("{}线没有出片任务信息,直接出片", endcell); |
| | | return queryMinGlass(firstSize.getWidth(), firstSize.getHeight(), glassId); |
| | | } |
| | | TaskCache taskCache = taskCacheList.get(0); |
| | | EdgStorageCageDetails outGlassInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId())); |
| | | log.info("{}线有出片任务信息,任务信息为{},玻璃信息为{}", endcell, taskCache, outGlassInfo); |
| | |
| | | return edgGlassTaskInfoService.save(edgGlassTaskInfo); |
| | | } |
| | | |
| | | /** |
| | | * 当前切割版图信息 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void currentCutTerritory(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | 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"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 磨边任务 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void selectEdgTask(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String,Object>> EdgTasks1 = taskCacheService.selectEdgInfo("2001"); |
| | | List<Map<String,Object>> EdgTasks2 = taskCacheService.selectEdgInfo("2002"); |
| | | jsonObject.append("EdgTasks1", EdgTasks1); |
| | | jsonObject.append("EdgTasks2", EdgTasks2); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | 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"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 磨边前 缓存内信息 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void selectEdgStorageCage(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> EdgStorageCageinfos=edgStorageCageService.selectEdgStorageCages(); |
| | | jsonObject.append("EdgStorageCageinfos", EdgStorageCageinfos); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | 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"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @PostMapping("/identControls") |
| | | @ResponseBody |
| | | public Result identControls(@RequestParam(name = "identId", required = false) String identId,@RequestParam(name = "controlsId", required = false) int controlsId) { |
| | | |
| | | boolean issucess = edgStorageCageDetailsService.identWorn(identId,controlsId); |
| | | return Result.build(200,"成功",issucess); |
| | | } |
| | |
| | | @ApiOperation("磨边任务 参数()") |
| | | @PostMapping("/selectEdgTask") |
| | | @ResponseBody |
| | | public Result selectEdgTask(String line) { |
| | | List<TaskCache> EdgTasks = taskCacheService.selectEdgInfo(line); |
| | | public Result selectEdgTask(@RequestBody Map<String, String> arguments) { |
| | | String line=arguments.get("line"); |
| | | List<Map<String,Object>> EdgTasks = taskCacheService.selectEdgInfo(line); |
| | | return Result.build(200,"成功",EdgTasks); |
| | | } |
| | | |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @DS("salve_hangzhoumes") |
| | | public interface TaskCacheMapper extends BaseMapper<TaskCache> { |
| | | |
| | | TaskCache queryGlassByTaskCache(@Param(value = "line") int line, @Param(value = "taskTypes") List<Integer> taskTypes); |
| | | } |
| | |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TaskCacheService extends IService<TaskCache> { |
| | | |
| | | |
| | | boolean insertTaskCache(TaskCache taskCache); |
| | | /** |
| | | * 查询磨边任务 |
| | | * |
| | | * @param line |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectEdgInfo(String line); |
| | | List<Map<String,Object>> selectEdgInfo(String line); |
| | | |
| | | /** |
| | | * 查询磨边任务 |
| | | * |
| | | * @param line |
| | | * @return |
| | | */ |
| | | TaskCache queryGlassByTaskCache(int line, List<Integer> taskTypes); |
| | | |
| | | /** |
| | | * 查询理片任务 |
| | | * |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectCacheInfo(); |
| | |
| | | * @param line |
| | | * @return |
| | | */ |
| | | TaskCache selectLastOutCacheInfo(String line); |
| | | TaskCache selectLastOutCacheInfo(int line); |
| | | |
| | | } |
| | |
| | | package com.mes.taskcache.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.mapper.TaskCacheMapper; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TaskCacheServiceImpl extends ServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService { |
| | | |
| | | @Autowired |
| | | EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | |
| | | @Autowired |
| | | GlassInfoMapper glassInfoMapper; |
| | | /** |
| | | * 添加理片笼任务 |
| | | * @param taskCache |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean insertTaskCache(TaskCache taskCache){ |
| | | baseMapper.insert(taskCache); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 查询磨边任务 |
| | | * |
| | | * @param line |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectEdgInfo(String line) { |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getEndCell, line)); |
| | | public List<Map<String,Object>> selectEdgInfo(String line) { |
| | | List<TaskCache> taskCache=baseMapper.selectList(new MPJLambdaWrapper<TaskCache>() |
| | | .selectAll(TaskCache.class) |
| | | .eq(TaskCache::getEndCell, line) |
| | | .eq(TaskCache::getTaskStatus,1) |
| | | .orderByAsc(TaskCache::getCreateTime)); |
| | | List<Map<String,Object>> result=new ArrayList<>(); |
| | | int serialNumber=1; |
| | | for(TaskCache taskCache1:taskCache){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | GlassInfo glassInfo=glassInfoMapper.selectOne(new MPJLambdaWrapper<GlassInfo>() |
| | | .selectAll(GlassInfo.class) |
| | | .eq(GlassInfo::getGlassId,taskCache1.getGlassId())); |
| | | if(glassInfo!=null){ |
| | | map.put("Line",line);//线路 2001 1线, 2002 2线 |
| | | map.put("Width",glassInfo.getWidth());//宽 |
| | | map.put("Height",glassInfo.getHeight());//高 |
| | | map.put("Thickness",glassInfo.getThickness());//厚 |
| | | map.put("GlassId",glassInfo.getGlassId());//玻璃ID |
| | | map.put("FlowCardId",glassInfo.getFlowCardId());//流程卡号 |
| | | map.put("TemperingLayoutId",glassInfo.getTemperingLayoutId());// 暂不显示 钢化版图ID |
| | | map.put("TemperingFeedSequence",glassInfo.getTemperingFeedSequence());// 暂不显示 钢化版图ID内的序号 |
| | | map.put("FilmsId",glassInfo.getFilmsid());//膜系 |
| | | map.put("SerialNumber",serialNumber);//出片顺序 |
| | | result.add(map); |
| | | } |
| | | serialNumber++; |
| | | } |
| | | |
| | | return result; |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_cell",line)); |
| | | } |
| | | |
| | | @Override |
| | | public TaskCache queryGlassByTaskCache(int line, List<Integer> taskTypes) { |
| | | return baseMapper.queryGlassByTaskCache(line, taskTypes); |
| | | } |
| | | |
| | | /** |
| | | * 查询待理片工作的任务 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 查询全部任务 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 查询待进片任务 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 查询待出片任务 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 查询 A09 或 A10 最新的一片 出片任务 |
| | | * |
| | | * @param line |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询 A09 或 A10 最新的一片 出片任务 |
| | | * |
| | | * @param line |
| | | * @return |
| | | */ |
| | | @Override |
| | | public TaskCache selectLastOutCacheInfo(String line) { |
| | | public TaskCache selectLastOutCacheInfo(int line){ |
| | | return baseMapper.selectOne(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getEndCell, line).eq(TaskCache::getTaskStatus, 1).orderByDesc(TaskCache::getCreateTime)); |
| | | } |
| | | |
| | |
| | | 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://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://10.153.19.150: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 |
| | | url: jdbc:mysql://10.153.19.150: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://10.153.19.150:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: '!QAZ2wsx' |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | |
| | | mes: |
| | | threshold: 3 |
| | | ratio: 10 |
| | | firstLength: 3500 |
| | | secondLength: 2500 |
| | | 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.taskcache.mapper.TaskCacheMapper"> |
| | | |
| | | <select id="queryGlassByTaskCache" resultType="com.mes.taskcache.entity.TaskCache"> |
| | | SELECT top 1 |
| | | glass_id |
| | | ,start_cell |
| | | , end_cell |
| | | , task_type |
| | | , task_status |
| | | , create_time |
| | | FROM task_cache |
| | | <where> |
| | | end_cell = #{line} |
| | | AND task_type in |
| | | <foreach collection="taskTypes" item="item" open='(' close=')' separator=','> |
| | | #{item} |
| | | </foreach> |
| | | </where> |
| | | ORDER BY create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.mapper.TaskCacheMapper; |
| | | import com.mes.taskcache.service.impl.TaskCacheServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | |
| | | |
| | | @Autowired |
| | | TaskCacheMapper taskCacheMapper; |
| | | |
| | | @Autowired |
| | | TaskCacheServiceImpl taskCacheServiceImpl; |
| | | @Autowired |
| | | OptimizeDetailMapper optimizeDetailMapper; |
| | | @Autowired |
| | |
| | | @Test |
| | | public void testSqlServer() { |
| | | List<TaskCache> list=taskCacheMapper.selectList(null); |
| | | log.info("数据{}",list); |
| | | log.info("Sql数据:{}", Arrays.asList(list)); |
| | | } |
| | | |
| | | @Test |
| | | public void testEdgtask() { |
| | | List<Map<String,Object>> list=taskCacheServiceImpl.selectEdgInfo("2001"); |
| | | log.info("数据{}",list); |
| | | log.info("Sql数据:{}", Arrays.asList(list)); |
| | | } |
| | |
| | | } |
| | | @Test |
| | | public void testOptimizeDetail() { |
| | | |
| | | List<Map<String, Object>> map2=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | .selectAll(OptimizeDetail.class) |
| | | .selectAs(OptimizeLayout::getWidth,"olWidth") |
| | |
| | | public void testOutTask() { |
| | | EdgStorageCageDetails edgStorageCageDetails=edgStorageCageDetailsService.selectConformGlass("1",3); |
| | | |
| | | log.info("切割当前版图信息1:{}", Arrays.asList(edgStorageCageDetails)); |
| | | log.info("出片任务:{}", Arrays.asList(edgStorageCageDetails)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @ApiOperation("查询理片笼信息") |
| | | @GetMapping("/bigStorageCage") |
| | | public Result querybigStorageCageDetail() { |
| | | return Result.build(200,"查询成功",bigStorageCageService.querybigStorageCageDetail()); |
| | | public Result querybigStorageCageDetail(int deviceId) { |
| | | return Result.build(200,"查询成功",bigStorageCageService.querybigStorageCageDetail(deviceId)); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.mes.bigstorage.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.utils.Result; |
| | |
| | | public Result insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.save(bigStorageCageDetails); |
| | | return Result.build(200,"添加成功",1); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情删除") |
| | |
| | | public Result deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.removeById(bigStorageCageDetails.getId()); |
| | | return Result.build(200,"删除成功",1); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务查询") |
| | | @PostMapping("/selectBigStorageCageDetails") |
| | | public Result selectBigStorageCageDetails(int state) { |
| | | LambdaQueryWrapper<BigStorageCageDetails> selectWrapper = new LambdaQueryWrapper<>(); |
| | | selectWrapper.eq(BigStorageCageDetails::getState,state); |
| | | return Result.build(200,"查询成功",bigStorageCageDetailsService.list(selectWrapper)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface BigStorageCageDetailsService extends IService<BigStorageCageDetails> { |
| | | |
| | | List<BigStorageCageDetails> selectTask(int taskType); |
| | | |
| | | boolean selectGetBoard(GlassInfo glassInfo, String plcFeedReqLine); |
| | | } |
| | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | boolean outGlass(); |
| | | |
| | | List<BigStorageCage> querybigStorageCageDetail(); |
| | | List<BigStorageCage> querybigStorageCageDetail(int deviceId); |
| | | |
| | | List<Map<String, Object>> selectBigStorageCageUsage(); |
| | | |
| | | boolean selectWidthSufficient(BigStorageCageDetails layoutSlotInfo,double width); |
| | | } |
| | |
| | | package com.mes.bigstorage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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.BigStorageCageDetailsService; |
| | | 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.glassinfo.entity.GlassInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class BigStorageCageDetailsServiceImpl extends ServiceImpl<BigStorageCageDetailsMapper, BigStorageCageDetails> implements BigStorageCageDetailsService { |
| | | @Resource |
| | | private BigStorageCageMapper bigStorageCageMapper; |
| | | |
| | | @Resource |
| | | private BigStorageCageOutTaskMapper bigStorageCageOutTaskMapper; |
| | | @Resource |
| | | private BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper; |
| | | |
| | | /** |
| | | * 查询进/出片任务 |
| | | */ |
| | | @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 boolean selectGetBoard(GlassInfo glassInfo, String plcFeedReqLine){ |
| | | double carWidth=5000; |
| | | LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>(); |
| | | feedWrapper.eq(BigStorageCageDetails::getState, plcFeedReqLine); |
| | | |
| | | 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); |
| | | } |
| | | for (BigStorageCageDetails bigStorageCageDetails:bigStorageCageDetailsList |
| | | ) { |
| | | if(bigStorageCageDetails.getBigStorageCageFeedTask().getTaskState()==0){ |
| | | carWidth -= Integer.parseInt(bigStorageCageDetails.getWidth().toString()) + bigStorageCageDetails.getGap(); |
| | | } |
| | | } |
| | | if(carWidth>=0){ |
| | | return true; |
| | | }else{ |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | @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); |
| | | .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() - 1); |
| | | BigStorageCageDetails layoutSlotInfo; |
| | | layoutSlotInfo= bigStorageCageDetailsMapper.selectOne(wrapper); |
| | | |
| | | log.info("1、查询理片笼内片序-1等于当前玻璃片序的玻璃"+layoutSlotInfo); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | |
| | | log.info("2、查询理片笼内片序+1等于当前玻璃片序的玻璃的结果不为空时"); |
| | | if (layoutSlotInfo.getSlot() != null) { |
| | | log.info("2、查询理片笼内片序-1等于当前玻璃片序的玻璃的结果不为空时"+layoutSlotInfo.getSlot()); |
| | | if (layoutSlotInfo.getSlot() != null&&selectWidthSufficient(layoutSlotInfo,bigStorageCageDetails.getWidth())) { |
| | | bigStorageCageDetails.setSlot(layoutSlotInfo.getSlot()); |
| | | } else { |
| | | log.info("3、查询理片笼内片序+1等于当前玻璃片序的玻璃的结果为空时获取当前玻璃版图id是否存在理片笼内"); |
| | | log.info("3、查询理片笼内片序-1等于当前玻璃片序的玻璃的结果为空时获取当前玻璃版图id是否存在理片笼内"); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailslambdaQueryWrapper |
| | | .select(BigStorageCageDetails::getTemperingLayoutId); |
| | | layoutSlotInfo = bigStorageCageDetailsMapper.selectOne(bigStorageCageDetailslambdaQueryWrapper); |
| | | |
| | | if(layoutSlotInfo != null){ |
| | | if(layoutSlotInfo != null&&selectWidthSufficient(layoutSlotInfo,bigStorageCageDetails.getWidth())){ |
| | | log.info("4、获取笼子内适合的格子"); |
| | | BigStorageCage bigStorageCage=bigStorageCageSlot(layoutSlotInfo.getDeviceId()); |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | |
| | | 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); |
| | | if(bigStorageCage!=null){ |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | | found=true; |
| | | break; |
| | | } |
| | | } |
| | | if(found){ |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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所有小片小片到钢化小片表 |
| | | log.info("4、添加此钢化版图id所有小片小片到钢化小片表"); |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper=new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.select(GlassInfo::getTemperingLayoutId) |
| | | .orderByDesc(GlassInfo::getTemperingFeedSequence); |
| | | List<GlassInfo> glassInfoList= glassInfoService.list(glassInfoWrapper); |
| | | for (GlassInfo glassInfo:glassInfoList |
| | | ) { |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo); |
| | | temperingGlassInfoService.save(temperingGlassInfo); |
| | | } |
| | | 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<>(); |
| | | BigStorageCageWrapper.eq(BigStorageCage::getSlot,deviceId); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageDetails> BigStorageCageDetailsWrapper =new LambdaQueryWrapper<>(); |
| | | BigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getSlot,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") |
| | | .select("ROUND(1 - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) / COUNT(device_id), 2) AS percentage") |
| | | .select("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 boolean selectWidthSufficient(BigStorageCageDetails layoutSlotInfo,double width) { |
| | | LambdaQueryWrapper<BigStorageCage> BigStorageCageWrapper = new LambdaQueryWrapper<>(); |
| | | BigStorageCageWrapper.eq(BigStorageCage::getSlot,layoutSlotInfo.getSlot()); |
| | | BigStorageCage bigStorageCage=baseMapper.selectOne(BigStorageCageWrapper); |
| | | if(bigStorageCage.getRemainWidth()>width){ |
| | | return true; |
| | | }else{ |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 BigStorageCageFeedTask 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 tragetSlot; |
| | | |
| | | /** |
| | | * 玻璃类型 |
| | | */ |
| | | @ApiModelProperty(value = "玻璃类型", position = 5) |
| | | private Integer taskType; |
| | | |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | @ApiModelProperty(value = "任务类型", position = 6) |
| | | private Integer taskState; |
| | | |
| | | /** |
| | | * 线路 |
| | | */ |
| | | @ApiModelProperty(value = "线路", position = 7) |
| | | private Integer line; |
| | | |
| | | |
| | |
| | | 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.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface BigStorageCageFeedTaskMapper extends BaseMapper<BigStorageCageFeedTask> { |
| | | |
| | | } |
| | |
| | | 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> { |
| | | |
| | | } |
| | |
| | | |
| | | 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.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.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; |
| | | |
| | | /** |
| | | * <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; |
| | | |
| | | |
| | | } |
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> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.edgglasstask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.mapper.EdgGlassTaskInfoMapper; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | @Service |
| | | public class EdgGlassTaskInfoServiceImpl extends ServiceImpl<EdgGlassTaskInfoMapper, EdgGlassTaskInfo> implements EdgGlassTaskInfoService { |
| | | |
| | | } |
| | |
| | | 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> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | 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.device.PlcParameterObject; |
| | | import com.mes.edgstoragetask.service.TaskCacheService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.menu.service.SysMenuService; |
| | | 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; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class PlcSlicecage { |
| | | |
| | | @Resource |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | /** |
| | | * 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); |
| | | |
| | | 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(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | 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.edgstoragetask.service.TaskCacheService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.menu.service.SysMenuService; |
| | | 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; |
| | | |
| | | @Component |
| | |
| | | @Resource |
| | | private TaskCacheService taskCacheService; |
| | | |
| | | @Resource |
| | | private SysMenuService sysMenuService; |
| | | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | |
| | | public static boolean bigStorageCageFullAlarm = false; |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 300) |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | | // 爆笼报警 |
| | | boolean bigStorageCageFullAlarm = false; |
| | | |
| | | String plcFeedGlassid = ""; |
| | | String plcFeedReqLine = "0"; |
| | |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid); |
| | | log.info("2、根据玻璃id获取玻璃信息" + glassInfo); |
| | | if(bigStorageCageDetailsService.selectGetBoard(glassInfo,plcFeedReqLine)){ |
| | | BigStorageCageDetails slotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails); |
| | | if (slotInfo != null) { |
| | | int taskType = taskCacheService.judgeTasktype(); |
| | |
| | | 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); |
| | |
| | | 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(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | 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> { |
| | | |
| | | } |
| | |
| | | ) { |
| | | 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(0); |
| | | baseMapper.updateById(temperingGlassInfo); |
| | | log.info("3、添加刚小片表信息到任务表"); |
| | | log.info("3、修改钢化小片表任务状态"); |
| | | BigStorageCageOutTask bigStorageCageOutTask =new BigStorageCageOutTask(); |
| | | bigStorageCageOutTask.setId(temperingGlassInfo.getId()); |
| | | }else{ |
| | |
| | | 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) { |
| | |
| | | |
| | | 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.service.OptimizeProjectService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.service.UpPattenUsageService; |
| | | import com.mes.utils.Result; |
| | |
| | | private EngineeringService engineeringService; |
| | | @Autowired |
| | | private UpPattenUsageService upPattenUsageService; |
| | | |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | | private OptimizeProjectService optimizeProjectService; |
| | | @ApiOperation("开始/暂停任务/传递工程号和状态,开始是1 暂停是0") |
| | | @PostMapping("/changeTask") //调用上片任务 |
| | | @PostMapping("/pauseTask") //调用上片任务 |
| | | @ResponseBody |
| | | public Result <List<UpPattenUsage>> changeTask(@RequestBody Engineering engineering) { |
| | | 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); |
| | | } |
| | | |
| | | @ApiOperation("开始上片") |
| | | @PostMapping("/changeTask") //调用上片任务 |
| | | @ResponseBody |
| | | public Result <Boolean> changeTask(@RequestBody Engineering engineering) { |
| | | log.info("engineeringId:{}", engineering); |
| | | UpPattenUsage upPattenUsage = upPattenUsageService.selectedEngineering(engineering.getEngineerId()); |
| | | if (upPattenUsage != null) { |
| | | boolean work=engineeringService.changeTask(engineering.getEngineerId(),engineering.getState()); |
| | | List<UpPattenUsage> glass = upPattenUsageService.prioritylist(); |
| | | optimizeProjectService.changeTask(engineering.getEngineerId(), 200); |
| | | return Result.build(200, "已保存过", work); |
| | | } else { |
| | | List<UpPattenUsage> upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId()); |
| | | log.info("将查询出的UpPattenUsage数据保存到数据库表里"); |
| | | upPattenUsageService.saveUpPattenUsage(upPattenUsages); |
| | | log.info("从PP表查询glassinfo的数据并保存到表里"); |
| | | List<GlassInfo> glassinfo = glassInfoService.selectGlassInfo(engineering.getEngineerId()); |
| | | glassInfoService.saveGlassInfo(glassinfo); |
| | | log.info("从PP表查询engineering的数据并保存到表里"); |
| | | List<Engineering> listEngineering = engineeringService.selectEngineering(engineering.getEngineerId()); |
| | | engineeringService.saveEngineering(listEngineering); |
| | | log.info("更改pp表状态为已领取"); |
| | | //将engineering表状态为正在上片 |
| | | boolean work=engineeringService.changeTask(engineering.getEngineerId(),engineering.getState()); |
| | | List<UpPattenUsage> glass = upPattenUsageService.prioritylist(); |
| | | optimizeProjectService.changeTask(engineering.getEngineerId(), 200); |
| | | return Result.build(200, "保存成功", work); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ApiOperation("查询可以上片的工程号") |
| | | @GetMapping("/selectTask") //调用上片任务 |
| | | @ResponseBody |
| | |
| | | * @return Engineering |
| | | */ |
| | | Engineering selectInitiate(Integer state); |
| | | |
| | | /** |
| | | * 查询上片任务 |
| | | * @return Engineering |
| | | */ |
| | | List<Engineering> selectTask(); |
| | | } |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.common.S7object; |
| | | 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; |
| | | import com.mes.uppattenusage.service.UpPattenUsageService; |
| | | import com.mes.workstation.entity.UpWorkstation; |
| | |
| | | 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 |
| | |
| | | private EngineeringService engineeringService; |
| | | @Autowired |
| | | private UpPattenUsageService upPattenUsageService; |
| | | @Autowired |
| | | private OptimizeProjectService optimizeProjectService; |
| | | |
| | | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | |
| | |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | @Scheduled(fixedDelay = 3000000) |
| | | public void plcLoadGlassTask() throws InterruptedException { |
| | | try { |
| | | //获取联机状态 |
| | | String inkageStatus =plcParameterObject.getPlcParameter("MesToPlc").getValue(); |
| | | //获取是否有上片请求 |
| | | String loadRequest = plcParameterObject.getPlcParameter("loadRequest").getValue(); |
| | | //mes状态 |
| | | String mesToPlc = plcParameterObject.getPlcParameter("MesToPlc").getValue(); |
| | | if("1".equals(inkageStatus)&&"1".equals(loadRequest)) { |
| | | //判断开始上片的工程号 |
| | | Engineering engineering = engineeringService.selectInitiate(1); |
| | | if ("1".equals(loadRequest) && engineering != null) { |
| | | if (engineering != null) { |
| | | log.info("开始上片任务"); |
| | | UpPattenUsage upPattenUsage = upWorkstationService.selectPriority(engineering); |
| | | log.info("当有请求时查询当前上片顺序的玻璃信息{}", upPattenUsage); |
| | |
| | | int workId = upwork.getWorkstationId();//工位id |
| | | double width = upwork.getPatternWidth();//宽度 |
| | | double height = upwork.getPatternHeight();//高度 |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("WorkId").getAddress(), (short) workId); |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("GlassWidth").getAddress(), (short) width); |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("GlassHeight").getAddress(), (short) height); |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("MesToPlc").getAddress(), (short) 1); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("WorkId").getAddress(), workId); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("GlassWidth").getAddress(), (long) width); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("GlassHeight").getAddress(), (long) height); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlc").getAddress(), 1); |
| | | //更改上片表状态 |
| | | upPattenUsageService.updateUpPattenUsageState(upPattenUsage, workId); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | if ("1".equals(mesToPlc) && "0".equals(loadRequest)) { |
| | | //请求字为零时,任务字清零 |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | @Scheduled(fixedDelay = 30000000) |
| | | public void plcLoadGlassReport() { |
| | | //获取是否有汇报 |
| | | String loadStatus = plcParameterObject.getPlcParameter("PlcStatus").getValue(); |
| | |
| | | switch (loadStatus) { |
| | | case "1": |
| | | log.info("收到汇报任务完成"); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlcStatus").getAddress(), 1); |
| | | //减少工位数量,完成任务状态 |
| | | overTask(loadStatus, 100); |
| | | break; |
| | | case "2": |
| | | log.info("收到汇报未完成任务"); |
| | |
| | | overTask(loadStatus, 0); |
| | | break; |
| | | case "0": |
| | | log.info("收到汇报清0状态"); |
| | | //减少工位数量,完成任务状态 |
| | | overTask(loadStatus, 100); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlcStatus").getAddress(), 0); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void loadGlassHome(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | List<UpPattenUsage> upPattenUsages = upPattenUsageService.prioritylist(); |
| | | jsonObject.append("prioritylist", upPattenUsages); |
| | | //工位信息 |
| | | List<UpWorkstation> upWorkstations = upWorkstationService.list(); |
| | | jsonObject.append("list", upWorkstations); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); |
| | | 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"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void loadGlassStatus(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | //String inkageStatus =plcParameterObject.getPlcParameter("MesToPlc").getValue(); |
| | | String inkageStatus ="1"; |
| | | jsonObject.append("InkageStatus", inkageStatus); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); |
| | | 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"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void overTask(String loadStatus, int state) { |
| | | |
| | | UpPattenUsage upPattenUsage = upPattenUsageService.selectOverTask(); |
| | | if (upPattenUsage != null) { |
| | | log.info("收到汇报清{}状态", loadStatus); |
| | |
| | | upWorkstationService.reduceWorkstationNumber(upPattenUsage.getState()); |
| | | //完成上片表状态 |
| | | upPattenUsageService.updateUpPattenUsageState(upPattenUsage, state); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlcStatus").getAddress(), 0); |
| | | //判断是否是最后一块玻璃 |
| | | UpPattenUsage sequence=upPattenUsageService.selectSequence(upPattenUsage); |
| | | //如果是最后一块时完成工程任务 |
| | | optimizeProjectService.overTask(sequence,300); |
| | | } |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlcStatus").getAddress(), 1); |
| | | } |
| | | |
| | | } |
| | |
| | | return Result.build(200, "", glass); |
| | | } |
| | | |
| | | @ApiOperation("点击选择工程保存后进行调用,传入工程号") |
| | | @PostMapping("/saveUpPattenUsage") //查询现在上片机的玻璃信息 |
| | | @ApiOperation("选择工程号后显示上片顺序预览") |
| | | @PostMapping("/selectUpPattenUsage") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<Engineering> saveUpPattenUsage(@RequestBody Engineering engineering) { |
| | | log.info("engineeringId:{}", engineering); |
| | | UpPattenUsage upPattenUsage= upPattenUsageService.selectedEngineering(engineering.getEngineerId()); |
| | | if (upPattenUsage!=null){ |
| | | log.info("已保存过"); |
| | | return Result.build(200, "已保存的工程", null); |
| | | }else { |
| | | public Result<List<UpPattenUsage>> selectUpPattenUsage(@RequestBody Engineering engineering) { |
| | | List<UpPattenUsage> upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId()); |
| | | log.info("将查询出的UpPattenUsage数据保存到数据库表里"); |
| | | upPattenUsageService.saveUpPattenUsage(upPattenUsages); |
| | | log.info("从PP表查询glassinfo的数据并保存到表里"); |
| | | List<GlassInfo> glassinfo=glassInfoService.selectGlassInfo(engineering.getEngineerId()); |
| | | glassInfoService.saveGlassInfo(glassinfo); |
| | | log.info("从PP表查询engineering的数据并保存到表里"); |
| | | List<Engineering> listEngineering= engineeringService.selectEngineering(engineering.getEngineerId()); |
| | | engineeringService.saveEngineering(listEngineering); |
| | | log.info("更改pp表状态为已领取"); |
| | | optimizeProjectService.changeTask(engineering.getEngineerId(), 200); |
| | | // List<UpPattenUsage> data=upPattenUsageService.prioritylist(); |
| | | // log.info("显示保存后的上片顺序表"); |
| | | return Result.build(200, "", engineering); |
| | | return Result.build(200, "", upPattenUsages); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | * @return UpPattenUsage |
| | | */ |
| | | UpPattenUsage selectOverTask(); |
| | | /** |
| | | * 查询上片最后一块的玻璃 |
| | | * @return UpPattenUsage |
| | | */ |
| | | UpPattenUsage selectSequence(UpPattenUsage upPattenUsage); |
| | | |
| | | } |
| | | |
| | |
| | | public List<UpPattenUsage> prioritylist() { |
| | | //获取正在上片的任务id |
| | | Engineering engineering= engineeringService.selectInitiate(1); |
| | | log.info("将参数传入到查询类里{}",engineering); |
| | | //log.info("将参数传入到查询类里{}",engineering); |
| | | if(engineering!=null){ |
| | | LambdaQueryWrapper<UpPattenUsage> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(UpPattenUsage::getEngineeringId,engineering.getEngineerId()); |
| | |
| | | return this.getOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | //获取最后一块玻璃 |
| | | public UpPattenUsage selectSequence(UpPattenUsage upPattenUsage) { |
| | | QueryWrapper<UpPattenUsage>wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("engineering_id",upPattenUsage.getEngineeringId()) |
| | | .orderByDesc("layout_sequence") |
| | | .last("limit 1"); |
| | | return this.getOne(wrapper); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public Result<String> updateMesInkageLoad(@RequestBody short inKageWord) { |
| | | String result = upWorkstationService.updateMesInkageLoad(inKageWord); |
| | | return Result.success(result); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | log.info("修改设备联动请求为{}:0离线;1联动", inKageWord); |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("InkageStatus").getAddress(), inKageWord); |
| | | return "success"; |
| | | //读取plc的值 |
| | | return plcParameterObject.getPlcParameter("InkageStatus").getValue(); |
| | | } |
| | | |
| | | } |
| | |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # hangzhoumes: |
| | | # url: jdbc:mysql://10.153.19.150: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 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | 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.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.entity.request.OptimizeRequest; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.service.impl.UpPattenUsageServiceImpl; |
| | |
| | | engineeringService.saveEngineering(glass); |
| | | log.info("glassinfo:{}", Arrays.asList(glass)); |
| | | } |
| | | @Test |
| | | public void textengineering2(){ |
| | | //更新工程表状态为已领取 |
| | | //optimizeProjectService.changeTask("P24050801",200); |
| | | engineeringService.changeTask("P24051102",1); |
| | | } |
| | | |
| | | @Test |
| | | public void textengineering3(){ |
| | | //判断是否已保存过工程号到上片表 |
| | | UpPattenUsage upPattenUsage=upPattenUsageService.selectOverTask(); |
| | | log.info("上片表任务中的数据{}",upPattenUsage); |
| | | //上片表最后一片 |
| | | UpPattenUsage upPattenUsage=new UpPattenUsage(); |
| | | upPattenUsage.setEngineeringId("P24051103"); |
| | | UpPattenUsage upPattenUsage1=upPattenUsageService.selectSequence(upPattenUsage); |
| | | log.info("上片表任务中的数据{}",upPattenUsage1); |
| | | boolean isOver= optimizeProjectService.overTask(upPattenUsage1,300); |
| | | log.info("更改是否成功{}",isOver); |
| | | } |
| | | @Test |
| | | public void textengineering4(){ |
| | | //判断是否已保存过工程号到上片表 |
| | | List<Engineering> engineerings=engineeringService.selectTask(); |
| | | log.info("上片表任务中的数据{}",engineerings); |
| | | |
| | | } |
| | | @Test |
| | | public void textengineering5(){ |
| | | //显示选择工程 |
| | | OptimizeRequest optimizeRequest=new OptimizeRequest(); |
| | | optimizeRequest.setState(100); |
| | | List<OptimizeProject> engineerings=optimizeProjectService.listByState(optimizeRequest); |
| | | log.info("上片表任务中的数据{}",engineerings); |
| | | } |
| | | |
| | | } |