Merge branch 'master' of http://bore.pub:10439/r/HangZhouMes
| | |
| | | import * as echarts from "echarts" |
| | | // echarts.registerMap('china', china) |
| | | // Vue.prototype.$echarts = echarts |
| | | |
| | | // app.component("v-chart", Echarts) |
| | | // app.config.globalProperties.$echarts = echarts |
| | | const app = createApp(App) |
| | |
| | | locale: zhCn, |
| | | }) |
| | | app.use(i18n) |
| | | |
| | | app.mount('#app') |
| | | app.mount('#app') |
| | |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = heighta * 0.12; |
| | | adjustedHeight = widtha * 0.1; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | newX = 5087 - (rect.yCoordinate + heighta); |
| | | } else { |
| | | adjustedWidth = widtha * 0.12; |
| | | adjustedHeight = heighta * 0.1; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | newX = 5087 - (rect.yCoordinate + widtha); |
| | | } |
| | | // if (rect.angle === 0) { |
| | |
| | | ycoordinate: rect.xCoordinate * 0.1, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | | heighta: adjustedHeighta, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | }; |
| | | }); |
| | | }else{ |
| | |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = heighta * 0.12; |
| | | adjustedHeight = widtha * 0.1; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | newX = 5087 - (rect.yCoordinate + heighta); |
| | | } else { |
| | | adjustedWidth = widtha * 0.12; |
| | | adjustedHeight = heighta * 0.1; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | newX = 5087 - (rect.yCoordinate + widtha); |
| | | } |
| | | // if (rect.angle === 0) { |
| | |
| | | ycoordinate: rect.xCoordinate * 0.1, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | | heighta: adjustedHeighta, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | }; |
| | | }); |
| | | }else{ |
| | |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * 0.24; |
| | | adjustedHeight = heighta * 0.16; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | newX = 5190 - (rect.yCoordinate + widtha); |
| | | } else { |
| | | adjustedWidth = heighta * 0.24; |
| | | adjustedHeight = widtha * 0.16; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | newX = 5190 - (rect.yCoordinate + heighta); |
| | | } |
| | | return { |
| | |
| | | y: rect.xCoordinate * 0.16, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | | heighta: adjustedHeighta, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | }; |
| | | }); |
| | | }else{ |
| | |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * 0.24; |
| | | adjustedHeight = heighta * 0.16; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | // newX = 5190 - (rect.yCoordinate + widtha); |
| | | } else { |
| | | adjustedWidth = heighta * 0.24; |
| | | adjustedHeight = widtha * 0.16; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | // adjustedWidtha = heighta; |
| | | // adjustedHeighta = widtha; |
| | | // newX = 5190 - (rect.yCoordinate + heighta); |
| | | } |
| | | return { |
| | |
| | | y: rect.xCoordinate * 0.16, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | | heighta: adjustedHeighta, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | }; |
| | | }); |
| | | }else{ |
| | |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * 0.24; |
| | | adjustedHeight = heighta * 0.16; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | // newX = 5190 - (rect.yCoordinate + rect.width); |
| | | } else { |
| | | adjustedWidth = heighta * 0.24; |
| | | adjustedHeight = widtha * 0.16; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | // adjustedWidtha = heighta; |
| | | // adjustedHeighta = widtha; |
| | | // newX = 5190 - (rect.yCoordinate + rect.height); |
| | | } |
| | | return { |
| | |
| | | ycoordinate: rect.xCoordinate * 0.16, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | | heighta: adjustedHeighta, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | }; |
| | | }); |
| | | } |
| | |
| | | import request from "@/utils/request"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import PrintFlow from './PrintFlow.vue' |
| | | import print from 'vue3-print-nb'; |
| | | const printLoading = ref(true) |
| | | const fullFlowCard = ref('') |
| | | const autoPrint = ref(false) |
| | | |
| | | // import PrintFlow from './PrintFlow.vue' |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisiblea2 = ref(false) |
| | | const dialogFormVisibleaDownGlass = ref(false) |
| | |
| | | const flowCardOptions = ref('[]'); |
| | | const tableData = reactive([]); |
| | | const downGlass = ref([]); |
| | | |
| | | const timeRange = ref(["2022-01-01", "2025-01-01"]) |
| | | const selectValuesa = reactive({}); |
| | | const selectOptionsa = ref([]); |
| | | const dialogTableVisible = ref(false) |
| | | const printFlowCardId = ref('') |
| | | const printLayer = ref('') |
| | | const now = new Date(); |
| | | const timeRange = ref([new Date(now.setHours(0, 0, 0, 0)), new Date(now.setHours(23, 59, 59, 999))]) |
| | | |
| | | const handleChange = async () => { |
| | | console.log("触发开关") |
| | | try { |
| | | const body = { |
| | | flag: autoPrint.value, // 使用 ganghua.value 获取当前开关的状态 |
| | | }; |
| | | |
| | | var url = "/unLoadGlass/downWorkStation/autoPrint?flag=" + autoPrint.value; |
| | | const response = await request.post(url) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | autoPrint.value = response.data |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | |
| | | |
| | | // const printFlowCardId = ref('') |
| | | // const printLayer=ref('') |
| | | |
| | | const handleInputChangea = (value, rowId) => { |
| | | // 更新对应行的 select 值 |
| | | selectValuesa[rowId] = value; |
| | |
| | | const response = await request.get('unLoadGlass/downWorkStation/getflowCardId'); |
| | | console.log(response) |
| | | if (response.code === 200) { |
| | | |
| | | |
| | | flowCardOptions.value = response.data.filter(item => item !== null) |
| | | .map(item => ({ flowcard_id: item.flow_card_id })); |
| | | console.log(flowCardOptions.value); |
| | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | console.log('绑定成功'); |
| | | |
| | | |
| | | ElMessage.success(response.message); |
| | | updatePageData(); |
| | | dialogFormVisiblea.value = false; |
| | |
| | | const response = await request.post('unLoadGlass/downWorkStation/clear', { |
| | | workstationId: workstationId.value, |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | if (response.code === 200) { |
| | | // 清除成功的逻辑 |
| | | console.log('清除成功'); |
| | |
| | | try { |
| | | // 发送获取表格数据的请求,并等待响应 |
| | | const response = await request.get('unLoadGlass/downWorkStation/getone'); |
| | | |
| | | |
| | | // 检查响应状态 |
| | | if (response.code === 200) { |
| | | // 更新表格数据 |
| | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | |
| | | // 更新 tableData 的数据 |
| | | if (data.downGlassInfos != null) { |
| | | downGlass.value = data.downGlassInfos[0][1]; |
| | |
| | | if (data.engineerIdList != null) { |
| | | selectOptionsa.value = data.engineerIdList[0] |
| | | } |
| | | if (data.autoPrint != null) { |
| | | autoPrint.value = data.autoPrint; |
| | | } |
| | | console.log(autoPrint.value) |
| | | |
| | | tableData.splice(0, tableData.length, ...data.params[0]); |
| | | if (fullFlowCard.value == "") { |
| | | for (let i = 0; i < tableData.length; i++) { |
| | | if (tableData[i].totalQuantity != 0) { |
| | | if (tableData[i].totalQuantity == tableData[i].racksNumber + tableData[i].otherNumber && fullFlowCard.value != tableData[i].flowCardId) { |
| | | // printFlowCardId.value = tableData[i].flowCardId; |
| | | fullFlowCard.value = tableData[i].flowCardId; |
| | | open(tableData[i]); |
| | | break; |
| | | } |
| | | } else { |
| | | console.log("没有flowCardId") |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // tableData.splice(0, tableData.length, ...data.params[0]); |
| | | |
| | | // console.log("更新后数据", data.params[0]); |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | const getTagType = (status) => { |
| | | return status === 1 ? 'success' : 'danger'; |
| | | // 根据状态值决定标签类型,这里假设状态为1时为成功(绿色),否则为失败(红色) |
| | | } |
| | | |
| | | |
| | | const toggleStatus = (row) => { |
| | | // 切换料架状态的逻辑 |
| | | row.enableState = 1 - row.enableState; // Toggle between 0 and 1 |
| | | // 此处可以添加保存状态的逻辑,比如调用 API 更新数据 |
| | | updateRowStatus(row); |
| | | }; |
| | | |
| | | |
| | | const updateRowStatus = async (row) => { |
| | | try { |
| | | // 假设你的后端 API 接收 PUT 请求,并且需要传递 row.id 和 row.enableState 参数 |
| | | |
| | | |
| | | |
| | | |
| | | const response = await request.post('unLoadGlass/downWorkStation/updateDownWorkstation', { |
| | | enableState: row.enableState, |
| | | id: row.id |
| | | |
| | | |
| | | |
| | | |
| | | }); |
| | | console.log('Updated row status:', response.data); |
| | | // 可以根据后端返回的数据进行进一步处理,比如更新本地状态等 |
| | |
| | | // 处理错误情况,比如提示用户更新失败 |
| | | } |
| | | }; |
| | | |
| | | |
| | | // 查询数据 |
| | | const selectDownGlassData = async () => { |
| | | |
| | | const response = await request.post("/unLoadGlass/downGlassInfo/setDownGlassInfoRequest", { |
| | | |
| | | const response = await request.post("/unLoadGlass/downGlassInfo/selectDownGlassInfo", { |
| | | workStationId: selectValuesa[0], |
| | | engineerId: selectValuesa[1], |
| | | beginDate: timeRange.value[0], |
| | | endDate: timeRange.value[1], |
| | | }) |
| | | if (response.code === 200) { |
| | | sendDownGlass.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | const open = async (row) => { |
| | | |
| | | printFlowCardId.value = row.flowCardId; |
| | | printLayer.value = row.layer |
| | | dialogTableVisible.value = true; |
| | | setTimeout(() => { |
| | | printFlowCard(); // 替换成你要执行的函数名 |
| | | dialogTableVisible.value = false; |
| | | }, 1000); |
| | | ; |
| | | |
| | | } |
| | | |
| | | const printFlowCard = () => { |
| | | // 需要打印的局部区域赋予"print-wrap"的id |
| | | let el = document.getElementById("child"); |
| | | let doc = document; |
| | | let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | let printId = "print-" + Date.now(); |
| | | |
| | | // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) |
| | | let content = doc.createElement("div"); |
| | | content.id = printId; |
| | | |
| | | // 样式控制与打印无关的元素隐藏 |
| | | let style = doc.createElement("style"); |
| | | style.innerHTML = |
| | | "body>#" + |
| | | printId + |
| | | "{display:none}@media print{" + |
| | | "@page {" + |
| | | " size: auto; " + |
| | | " margin: 2mm 2mm 0mm 1mm; " + |
| | | " }body>:not(#" + |
| | | printId + |
| | | "){display:none !important}body>#" + |
| | | printId + |
| | | "{display:block;padding-top:1px}}"; |
| | | // |
| | | content.innerHTML = el.outerHTML; |
| | | // // console.log("el.outerHTML", el.outerHTML); |
| | | body.appendChild(style); |
| | | |
| | | // 与style元素设置的样式相配合 |
| | | // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) |
| | | body.appendChild(content); |
| | | setTimeout(() => { |
| | | window.print(); |
| | | body.removeChild(content); |
| | | body.removeChild(style); |
| | | }, 20); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // const open=async(row)=>{ |
| | | |
| | | // printFlowCardId.value=row.flowCardId; |
| | | // printLayer.value=row.layer |
| | | // dialogTableVisible.value = true; |
| | | // setTimeout(() => { |
| | | // printFlowCard(); // 替换成你要执行的函数名 |
| | | // }, 1000); |
| | | // ; |
| | | // } |
| | | |
| | | // const printFlowCard = () => { |
| | | // // 需要打印的局部区域赋予"print-wrap"的id |
| | | // let el = document.getElementById("child"); |
| | | // let doc = document; |
| | | // let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | // let printId = "print-" + Date.now(); |
| | | |
| | | // // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) |
| | | // let content = doc.createElement("div"); |
| | | // content.id = printId; |
| | | |
| | | // // 样式控制与打印无关的元素隐藏 |
| | | // let style = doc.createElement("style"); |
| | | // style.innerHTML = |
| | | // "body>#" + |
| | | // printId + |
| | | // "{display:none}@media print{" + |
| | | // "@page {" + |
| | | // " size: auto; " + |
| | | // " margin: 2mm 2mm 0mm 1mm; " + |
| | | // " }body>:not(#" + |
| | | // printId + |
| | | // "){display:none !important}body>#" + |
| | | // printId + |
| | | // "{display:block;padding-top:1px}}"; |
| | | // // |
| | | // content.innerHTML = el.outerHTML; |
| | | // // // console.log("el.outerHTML", el.outerHTML); |
| | | // body.appendChild(style); |
| | | |
| | | // // 与style元素设置的样式相配合 |
| | | // // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) |
| | | // body.appendChild(content); |
| | | // setTimeout(() => { |
| | | // window.print(); |
| | | // body.removeChild(content); |
| | | // body.removeChild(style); |
| | | // }, 20); |
| | | // } |
| | | |
| | | |
| | | // beforeUnmount(() => { |
| | | // closeWebSocket(); |
| | | // }); |
| | |
| | | <div> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" |
| | | @click="dialogFormVisibleaDownGlass = true">落架详情</el-button> |
| | | <el-switch style="margin-top: 5px;margin-left: 10px;" v-model="autoPrint" class="mb-2" :inactive-text="$t('自动打印')" |
| | | @change="handleChange" /> |
| | | <el-card style="flex: 1;" v-loading="loading"> |
| | | <el-card style="flex: 1;margin-left: 4px;margin-top: 1px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | |
| | | @click="handleBindRack(scope.row)">{{ $t('reportWork.bindingshelves') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack2(scope.row)">{{ $t('reportWork.clear') |
| | | }}</el-button> |
| | | <el-button @click="open(scope.row)" :disabled="scope.row.flowCardId == null">打印</el-button> |
| | | <el-button @click="open(scope.row)" :disabled="scope.row.flowCardId==null">打印</el-button> |
| | | </template> |
| | | |
| | | |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisibleaDownGlass" top="2vh" width="97%" |
| | | :title="$t('searchOrder.cageinformation')"> |
| | |
| | | <el-option label="9" value="9"></el-option> |
| | | <el-option label="10" value="10"></el-option> |
| | | </el-select> |
| | | |
| | | |
| | | <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('basicData.plselectproject')" clearable |
| | | @input="handleInputChangea($event, row.id)"> |
| | | <el-option v-for="item in selectOptionsa" :key="item" :label="item" :value="item" /> |
| | | </el-select> |
| | | |
| | | <span class="demonstration">时间段</span> |
| | | <el-date-picker v-model="timeRange" type="datetimerange" range-separator="至" start-placeholder="开始日期" |
| | | end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" :start-placeholder="$t('reportmanage.starttime')" |
| | | :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" /> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectDownGlassData()">{{ |
| | | $t('reportmanage.inquire') |
| | | }}</el-button> |
| | |
| | | <el-table-column prop="Filmsid" align="center" :label="$t('膜系')" min-width="120" /> |
| | | <el-table-column prop="thickness" align="center" label="厚度" min-width="120" /> |
| | | <el-table-column prop="glassId" align="center" :label="$t('玻璃id')" min-width="120" /> |
| | | |
| | | |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | |
| | | </el-card> |
| | | <!-- workstationId: '1', |
| | | workstationId: '1005', |
| | |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | |
| | | |
| | | </div> |
| | | |
| | | |
| | | <el-dialog v-model="dialogFormVisiblea" top="21vh" width="40%" :title="$t('reportWork.bindingshelves')"> |
| | | <div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="100px"> |
| | |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | |
| | | |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('reportWork.sure') }} |
| | | </el-button> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" destroy-on-close style="width: 75%;height:75% "> |
| | | <!-- <template #header="{ close, titleId, titleClass }"> |
| | | <el-button @click="printFlowCard" >打印</el-button> |
| | | </template> --> |
| | | <print-flow id="child" :printFlowCardId="printFlowCardId" :printLayer="printLayer" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | |
| | | |
| | | <!-- <el-dialog |
| | | id="sizePrintCalrd" |
| | | v-model="dialogTableVisible" |
| | | destroy-on-close |
| | | style="width: 75%;height:75% "> |
| | | <print-flow |
| | | id="child" |
| | | :printFlowCardId="printFlowCardId" |
| | | :printLayer="printLayer" |
| | | style="width: 100%;height: 100%"/> |
| | | </el-dialog> --> |
| | | |
| | | </template> |
| | | <style scoped> |
| | | #dt { |
| | |
| | | line-height: 20px; |
| | | margin-left: 100px; |
| | | } |
| | | |
| | | |
| | | #dta { |
| | | display: block; |
| | | float: left; |
| | | line-height: 20px; |
| | | margin-left: 80%; |
| | | } |
| | | |
| | | |
| | | #dialog-footer { |
| | | text-align: center; |
| | | margin-top: -15px; |
| | | } |
| | | |
| | | |
| | | #message { |
| | | text-align: center; |
| | | align-items: center; |
| | |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | |
| | | |
| | | .awatch { |
| | | max-width: 100%; |
| | | } |
| | | |
| | | |
| | | #main-body { |
| | | margin-top: -40px; |
| | | margin-left: 150px; |
| | | } |
| | | |
| | | |
| | | #main-bodya { |
| | | margin-top: -40px; |
| | | margin-left: 100px; |
| | | } |
| | | |
| | | |
| | | :deep(#sizePrintCalrd .el-dialog__body) { |
| | | height: 85%; |
| | | width: 100%; |
| | |
| | | <div id="longa" v-show="dalipiana"></div> |
| | | <div id="longb" v-show="dalipianb"></div> |
| | | <div id="shangpianji" v-show="shangpian"></div> |
| | | <div id="xiapianji1" v-show="xiapian1"></div> |
| | | <div id="xiapianji2" v-show="xiapian2"></div> |
| | | <div id="xiapianji3" v-show="xiapian3"></div> |
| | | <div id="xiapianji4" v-show="xiapian4"></div> |
| | | <div id="xiapianji5" v-show="xiapian5"></div> |
| | | <div id="xiapianji6" v-show="xiapian6"></div> |
| | | </div> |
| | | <div id="centerright" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 240px;background-color: #911005;"> |
| | | <el-table height="240" ref="table" width="340px" |
| | |
| | | const dalipiana = ref(false) |
| | | const dalipianb = ref(false) |
| | | const shangpian = ref(false) |
| | | const xiapian1 = ref(false) |
| | | const xiapian2 = ref(false) |
| | | const xiapian3 = ref(false) |
| | | const xiapian4 = ref(false) |
| | | const xiapian5 = ref(false) |
| | | const xiapian6 = ref(false) |
| | | |
| | | const thisProcess = ref(); // 用于存储process_id的响应式引用 |
| | | // 定义一个响应式引用来存储图表实例 |
| | |
| | | let socket3 = null; |
| | | let socket4 = null; |
| | | let socket5 = null; |
| | | let socket6 = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | const handleMessage = (data) => { |
| | | tableData.value = data.awaitingRepairs[0] |
| | |
| | | const socketUrl3 = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlassIsRun`; |
| | | const handleMessage3 = (data) => { |
| | | const tasks = data.taskCaches[0]; |
| | | woshia.value = tasks.some(task => task.endCell == 2001 && task.glassId == 0); |
| | | woshic.value = tasks.some(task => task.endCell == 2002 && task.glassId == 0); |
| | | woshia.value = tasks.some(task => task.line == 2001); |
| | | woshic.value = tasks.some(task => task.line == 2002); |
| | | console.log(tasks); |
| | | |
| | | }; |
| | | // 大理片笼 |
| | | const socketUrl4 = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/isRun`; |
| | |
| | | if(data.engineering.length !==0 ){ |
| | | shangpian.value = true; |
| | | } |
| | | }; |
| | | // 下片 |
| | | const socketUrl6 = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unLoadGlassIsRun`; |
| | | const handleMessage6 = (data) => { |
| | | const tasks = data.downWorkstation[0]; |
| | | if (tasks && tasks.length >= 6) { |
| | | xiapian1.value = tasks[0].racksNumber !== 0; |
| | | xiapian2.value = tasks[1].racksNumber !== 0; |
| | | xiapian3.value = tasks[2].racksNumber !== 0; |
| | | xiapian4.value = tasks[3].racksNumber !== 0; |
| | | xiapian5.value = tasks[4].racksNumber !== 0; |
| | | xiapian6.value = tasks[5].racksNumber !== 0; |
| | | } |
| | | }; |
| | | const renderPieCharts = () => { |
| | | processesData.value.forEach((data, index) => { |
| | |
| | | socket3 = initializeWebSocket(socketUrl3, handleMessage3); |
| | | socket4 = initializeWebSocket(socketUrl4, handleMessage4); |
| | | socket5 = initializeWebSocket(socketUrl5, handleMessage5); |
| | | socket6 = initializeWebSocket(socketUrl6, handleMessage6); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | |
| | | if (socket5) { |
| | | closeWebSocket5(socket5); |
| | | } |
| | | if (socket6) { |
| | | closeWebSocket6(socket6); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | |
| | | closeWebSocket3(); |
| | | closeWebSocket4(); |
| | | closeWebSocket5(); |
| | | closeWebSocket6(); |
| | | }); |
| | | </script> |
| | | |
| | |
| | | margin-top: -90px; |
| | | margin-left: 568px; |
| | | } |
| | | #xiapianji1{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 10px; |
| | | height: 7px; |
| | | background-color: #529b2e; |
| | | margin-top: -213px; |
| | | margin-left: 111px; |
| | | } |
| | | #xiapianji2{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 10px; |
| | | height: 7px; |
| | | background-color: #529b2e; |
| | | margin-top: -213px; |
| | | margin-left: 140px; |
| | | } |
| | | #xiapianji3{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 10px; |
| | | height: 7px; |
| | | background-color: #529b2e; |
| | | margin-top: -202px; |
| | | margin-left: 126px; |
| | | } |
| | | #xiapianji4{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 10px; |
| | | height: 7px; |
| | | background-color: #529b2e; |
| | | margin-top: -213px; |
| | | margin-left: 175px; |
| | | } |
| | | #xiapianji5{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 10px; |
| | | height: 7px; |
| | | background-color: #529b2e; |
| | | margin-top: -213px; |
| | | margin-left: 204px; |
| | | } |
| | | #xiapianji6{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 10px; |
| | | height: 7px; |
| | | background-color: #529b2e; |
| | | margin-top: -202px; |
| | | margin-left: 190px; |
| | | } |
| | | </style> |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private String width; |
| | | private double width; |
| | | /** |
| | | * 高 |
| | | */ |
| | | private String height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 面积 |
| | | */ |
| | | private double area; |
| | | |
| | | |
| | | /** |
| | | * 包装方式 |
| | | * 数量 |
| | | */ |
| | | private Integer quantity; |
| | | /** |
| | | * 状态 |
| | | * 加工方式 |
| | | */ |
| | | private String processingNote; |
| | | /** |
| | |
| | | package com.mes.edgglasstask.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | private Integer line; |
| | | |
| | | private Date time; |
| | | |
| | | @TableLogic |
| | | private int deleted; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date beginDate; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.entity.request.EdgGlassInfoRequest; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | List<EdgGlassTaskInfo> selectEdgInfo(); |
| | | |
| | | String setEdgGlassInfoRequest(EdgGlassInfoRequest request); |
| | | /** |
| | | * 查询判断磨边线是否有玻璃运行 |
| | | * @param |
| | | * @return |
| | | */ |
| | | List<EdgGlassTaskInfo> selectTaskCacheIsRun(); |
| | | } |
| | |
| | | |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.entity.request.EdgGlassInfoRequest; |
| | | import com.mes.edgglasstask.mapper.EdgGlassTaskInfoMapper; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | redisUtil.setCacheObject("edgGlassRequest", request); |
| | | } |
| | | return "success"; |
| | | } |
| | | /** |
| | | * 查询判断磨边线是否有玻璃运行 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<EdgGlassTaskInfo> selectTaskCacheIsRun() { |
| | | QueryWrapper<EdgGlassTaskInfo> wrapper = new QueryWrapper<EdgGlassTaskInfo>() |
| | | .select("line") |
| | | .eq("status", 1) |
| | | .groupBy("line"); |
| | | |
| | | return this.list(wrapper); |
| | | } |
| | | } |
| | |
| | | package com.mes.edgstoragecage.controller; |
| | | |
| | | import com.mes.edgglasstask.entity.request.IdentWornRequest; |
| | | 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; |
| | | import com.mes.taskcache.service.impl.TaskCacheServiceImpl; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.awt.image.ImageProducer; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | @ApiOperation("查询磨边缓存理片笼内详情 参数()") |
| | | @PostMapping("/selectEdgStorageCage") |
| | | @ResponseBody |
| | | public Result selectEdgStorageCage() { |
| | | List<Map<String, Object>> list = edgStorageCageService.selectEdgStorageCages(); |
| | | return Result.build(200, "成功", list); |
| | | public Result selectEdgStorageCage () { |
| | | List<Map<String, Object>> list=edgStorageCageService.selectEdgStorageCages(); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | |
| | | // @ApiOperation("添加磨边缓存理片笼信息 功能:笼内绑定玻璃 参数(EdgStorageCage edgStorageCage)") |
| | | // @PostMapping("/insertEdgStorageCage") |
| | | // @ResponseBody |
| | | // public Result insertEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | // boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | // return Result.build(200,"添加成功",1); |
| | | // } |
| | | @ApiOperation("修改磨边缓存理片笼信息 功能:对笼内栅格进行【启用/禁用】") |
| | | @PostMapping("/updateEdgStorageCage") |
| | | @ResponseBody |
| | | public Result updateEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | String isSucess = edgStorageCageService.updateEdgStorageCage(edgStorageCage) ? "成功" : "失败"; |
| | | return Result.build(200, "【启用/禁用】" + isSucess, 1); |
| | | String isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage)?"成功":"失败"; |
| | | return Result.build(200,"【启用/禁用】"+isSucess,1); |
| | | } |
| | | |
| | | @ApiOperation("磨边缓存理片笼信息 功能:对笼内栅格玻璃进行【清除/更换/绑定】 EdgStorageCage格子信息,EdgStorageCageDetails 玻璃信息 ") |
| | | @PostMapping("/edgStorageCageGlass") |
| | | @ResponseBody |
| | | public Result edgStorageCageGlass(@RequestBody EdgStorageCageDetails edgStorageCageDetails, int edgStorageCageId) { |
| | | public Result edgStorageCageGlass(@RequestBody EdgStorageCageDetails edgStorageCageDetails,int edgStorageCageId) { |
| | | |
| | | String isSucess = edgStorageCageService.updateEdgStorageCageDetails(edgStorageCageId, edgStorageCageDetails) ? "成功" : "失败"; |
| | | return Result.build(200, "【清除/更换/绑定】" + isSucess, 1); |
| | | String isSucess=edgStorageCageService.updateEdgStorageCageDetails(edgStorageCageId,edgStorageCageDetails)?"成功":"失败"; |
| | | return Result.build(200,"【清除/更换/绑定】"+isSucess,1); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("磨边模块汇报玻璃状态 功能:对笼内栅格玻璃进行【破损/拿走】 ") |
| | | @PostMapping("/edgReportStatus") |
| | | @ResponseBody |
| | | public Result edgReportStatus(@RequestBody IdentWornRequest request) { |
| | | return Result.build(200, "【破损/拿走】" + edgStorageCageDetailsService.edgReportStatus(request), 1); |
| | | public Result edgReportStatus(@RequestBody Map<String, String> arguments) { |
| | | /*arguments.put("line","1002"); |
| | | arguments.put("machine","卧式理片");*/ |
| | | String isSucess=edgStorageCageDetailsService.identWorn(arguments)?"成功":"失败"; |
| | | return Result.build(200,"【破损/拿走】"+isSucess,1); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.mes.edgstoragecage.service; |
| | | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.edgglasstask.entity.request.IdentWornRequest; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | |
| | | import java.util.List; |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface EdgStorageCageDetailsService extends MPJBaseService<EdgStorageCageDetails> { |
| | | |
| | | /** |
| | | * 识别 破损/拿走 |
| | | * @param arguments |
| | | * @return |
| | | */ |
| | | boolean identWorn(Map<String, String> arguments); |
| | | |
| | | /** |
| | | * 获取 切割当前版图 |
| | |
| | | |
| | | /** |
| | | * 获取出片信息数据 |
| | | * |
| | | * @param glassId |
| | | * @param threshold |
| | | * @return |
| | | */ |
| | | EdgStorageCageDetails selectOutGlass(String glassId, int threshold); |
| | | |
| | | /** |
| | | * 识别 拿走:9/破损:8 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | String identControls(IdentWornRequest request); |
| | | |
| | | /** |
| | | * 磨边模块汇报玻璃状态 功能:对笼内栅格玻璃进行【破损/拿走】 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | String edgReportStatus(IdentWornRequest request); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.entity.request.IdentWornRequest; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageMapper; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.print.attribute.standard.MediaSize; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Autowired |
| | | DamageService damageService; |
| | | |
| | | @Autowired |
| | | EdgGlassTaskInfoService edgGlassTaskInfoService; |
| | | |
| | | /** |
| | | * 识别 拿走:200/破损:201 |
| | | * |
| | | * @param arguments |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean identWorn(Map<String, String> arguments) { |
| | | String glassId=arguments.get("glassId"); |
| | | int controlsId=arguments.get("controlsId").isEmpty()?0:Integer.parseInt(arguments.get("controlsId")); |
| | | int line=arguments.get("line").isEmpty()?0:Integer.parseInt(arguments.get("line")); |
| | | String machine=arguments.get("machine"); |
| | | if(controlsId==0||line==0||machine==null||glassId==null||glassId.isEmpty()){ |
| | | log.info("前端传递数据不全:{}",arguments); |
| | | return false; |
| | | } |
| | | int state; |
| | | if(controlsId==200||controlsId==201){ |
| | | state=controlsId==200?3:2; |
| | | }else if (controlsId==300||controlsId==301){ |
| | | state=controlsId==300?3:2; |
| | | }else{ |
| | | log.info("前端传递状态不合法:{}",arguments); |
| | | return false; |
| | | } |
| | | |
| | | List<GlassInfo> GlassInfos = glassInfoMapper.selectList(new MPJLambdaQueryWrapper<GlassInfo>() |
| | | .selectAll(GlassInfo.class) |
| | | .eq(GlassInfo::getGlassId, glassId)); |
| | | if (GlassInfos.size() == 1) { |
| | | Damage damage =new Damage(); |
| | | damage.setGlassId(glassId); |
| | | damage.setLine(line); |
| | | damage.setWorkingProcedure(machine); |
| | | damage.setRemark(""); |
| | | damage.setStatus(state);//201破损,200拿走 =》破损表 2破损 3 拿走 |
| | | damageService.insertDamage(damage); |
| | | }else{ |
| | | return false; |
| | | } |
| | | List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .selectAll(EdgStorageCageDetails.class) |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | if (edgStorageCageDetails.size() == 1) { |
| | | EdgStorageCageDetails item = edgStorageCageDetails.get(0); |
| | | item.setState(controlsId); |
| | | baseMapper.update(item, new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | } |
| | | |
| | | // Sql版本 |
| | | // List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | // if (edgStorageCageDetails.size() == 1) { |
| | | // EdgStorageCageDetails item=edgStorageCageDetails.get(0); |
| | | // item.setState(ControlsId); |
| | | // baseMapper.update(edgStorageCageDetails.get(0), new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | // return true; |
| | | // } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 获取 切割当前版图 |
| | |
| | | .orderByDesc(UpPattenUsage::getId)); |
| | | if (!upPattenUsage.isEmpty()) { |
| | | UpPattenUsage upPattenUsage1 = upPattenUsage.get(0); |
| | | List<Map<String, Object>> cutTerritorys = 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::getHeight, "olHeight") |
| | |
| | | .eq(OptimizeDetail::getProjectNo, upPattenUsage1.getEngineeringId()) |
| | | .eq(OptimizeDetail::getStockId, upPattenUsage1.getLayoutSequence()) |
| | | ); |
| | | List<Map<String, Object>> ResultcutTerritorys = new ArrayList<>(); |
| | | List<Map<String, Object>> ResultcutTerritorys=new ArrayList<>(); |
| | | for (Map<String, Object> cutTerritory : cutTerritorys) { |
| | | EdgStorageCageDetails edgStorageCageDetails = baseMapper.selectOne(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | | EdgStorageCageDetails edgStorageCageDetails=baseMapper.selectOne(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .selectAll(EdgStorageCageDetails.class) |
| | | .eq(EdgStorageCageDetails::getGlassId, cutTerritory.get("glass_id")) |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | // log.info("内容:{}-------{}",cutTerritory,edgStorageCageDetails); |
| | | if (edgStorageCageDetails != null) { |
| | | cutTerritory.put("glass_state", edgStorageCageDetails.getState()); |
| | | } else { |
| | | cutTerritory.put("glass_state", 0); |
| | | if(edgStorageCageDetails!=null){ |
| | | cutTerritory.put("glass_state",edgStorageCageDetails.getState()); |
| | | }else{ |
| | | cutTerritory.put("glass_state",0); |
| | | } |
| | | ResultcutTerritorys.add(cutTerritory); |
| | | } |
| | |
| | | @Override |
| | | public List<List<Map<String, Object>>> selectCurrentCutTerritory(String current) { |
| | | //结果 |
| | | List<Map<String, Object>> ResultcutTerritorys = new ArrayList<>(); |
| | | List<Map<String, Object>> ResultcutTerritorys=new ArrayList<>(); |
| | | //此工程的所有优化数据 |
| | | List<Map<String, Object>> cutTerritorys = 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::getHeight, "olHeight") |
| | |
| | | .eq(OptimizeDetail::getProjectNo, current) |
| | | ); |
| | | |
| | | Map<String, EdgStorageCageDetails> edgMaps = baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | | Map<String, EdgStorageCageDetails> edgMaps=baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .selectAll(EdgStorageCageDetails.class) |
| | | .eq(EdgStorageCageDetails::getEngineerId, current) |
| | | .eq(EdgStorageCageDetails::getEngineerId,current) |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | ).stream().collect(Collectors.toMap(EdgStorageCageDetails::getGlassId, EdgStorageCageDetails -> EdgStorageCageDetails)); |
| | | ).stream().collect(Collectors.toMap(EdgStorageCageDetails::getGlassId,EdgStorageCageDetails->EdgStorageCageDetails)); |
| | | for (Map<String, Object> cutTerritory : cutTerritorys) { |
| | | // log.info("内容:{}-------{}",cutTerritory,edgStorageCageDetails); |
| | | if (cutTerritory.get("glass_id") == null || "".equals(cutTerritory.get("glass_id"))) { |
| | | log.info("优化数据中glassId存在空值-----内容:{}", cutTerritorys); |
| | | if(cutTerritory.get("glass_id")==null||"".equals(cutTerritory.get("glass_id"))){ |
| | | log.info("优化数据中glassId存在空值-----内容:{}",cutTerritorys); |
| | | return new ArrayList<>(); |
| | | } else if (edgMaps.get(cutTerritory.get("glass_id")) != null) { |
| | | cutTerritory.put("glass_state", edgMaps.get(cutTerritory.get("glass_id")).getState()); |
| | | } else { |
| | | cutTerritory.put("glass_state", 0); |
| | | }else if(edgMaps.get(cutTerritory.get("glass_id"))!=null){ |
| | | cutTerritory.put("glass_state",edgMaps.get(cutTerritory.get("glass_id")).getState()); |
| | | }else{ |
| | | cutTerritory.put("glass_state",0); |
| | | } |
| | | ResultcutTerritorys.add(cutTerritory); |
| | | } |
| | | Map<String, List<Map<String, Object>>> groupBy = ResultcutTerritorys.stream().collect(Collectors.groupingBy(item -> item.get("stock_id").toString())); |
| | | Map<String, List<Map<String, Object>>> groupBy=ResultcutTerritorys.stream().collect(Collectors.groupingBy(item->item.get("stock_id").toString())); |
| | | // List<List<Map<String, Object>>> Result=groupBy.values().stream().collect(Collectors.toList()); |
| | | return new ArrayList<>(groupBy.values()); |
| | | //Sql版本 |
| | |
| | | EdgStorageCageDetails outEdgStorageCageDetails = null; |
| | | |
| | | // if (queryMaxMinDiff(threshold)) |
| | | //todo:逻辑1:获取两条线已出最后一块玻璃在笼内相同尺寸所剩数量,优先走数量少的线 |
| | | //todo:需要在卧式理片笼详情表中新增状态,用来表示玻璃进出理片笼情况 |
| | | if (oldEdgStorageCageDetails != null && minTemperingLayoutId != null) { |
| | | log.info("按照上一片已出玻璃宽度{},高度{},及版图id区间{}到{}获取出片任务玻璃信息", oldEdgStorageCageDetails.getWidth() |
| | | , oldEdgStorageCageDetails.getHeight(), minTemperingLayoutId.getTemperingLayoutId(), minTemperingLayoutId.getTemperingLayoutId() + threshold); |
| | | outEdgStorageCageDetails = this.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .notIn(CollectionUtils.isNotEmpty(glassIds), EdgStorageCageDetails::getGlassId, glassIds) |
| | | .eq(EdgStorageCageDetails::getWidth, oldEdgStorageCageDetails.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight, oldEdgStorageCageDetails.getHeight()) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .last("limit 1")); |
| | | log.info("出片任务的玻璃信息:{}", outEdgStorageCageDetails); |
| | | } |
| | | //todo:逻辑1:获取两条线已出最后一块玻璃在笼内相同尺寸所剩数量,优先走数量少的线 |
| | | //todo:需要在卧式理片笼详情表中新增状态,用来表示玻璃进出理片笼情况 |
| | | if (oldEdgStorageCageDetails != null && minTemperingLayoutId != null) { |
| | | log.info("按照上一片已出玻璃宽度{},高度{},及版图id区间{}到{}获取出片任务玻璃信息", oldEdgStorageCageDetails.getWidth() |
| | | , oldEdgStorageCageDetails.getHeight(), minTemperingLayoutId.getTemperingLayoutId(), minTemperingLayoutId.getTemperingLayoutId() + threshold); |
| | | outEdgStorageCageDetails = this.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .notIn(CollectionUtils.isNotEmpty(glassIds), EdgStorageCageDetails::getGlassId, glassIds) |
| | | .eq(EdgStorageCageDetails::getWidth, oldEdgStorageCageDetails.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight, oldEdgStorageCageDetails.getHeight()) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .last("limit 1")); |
| | | log.info("出片任务的玻璃信息:{}", outEdgStorageCageDetails); |
| | | } |
| | | if (outEdgStorageCageDetails == null) { |
| | | outEdgStorageCageDetails = minTemperingLayoutId; |
| | | } |
| | | return outEdgStorageCageDetails; |
| | | } |
| | | |
| | | @Override |
| | | public String identControls(IdentWornRequest request) { |
| | | //将识别破损的玻璃直接加入破损表 |
| | | Damage damage = new Damage(); |
| | | BeanUtils.copyProperties(request, damage); |
| | | damage.setType(request.getState()); |
| | | damage.setRemark(""); |
| | | damage.setStatus(0); |
| | | damageService.insertDamage(damage); |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public String edgReportStatus(IdentWornRequest request) { |
| | | //将磨边队列破损的玻璃直接加入破损表 |
| | | Damage damage = new Damage(); |
| | | BeanUtils.copyProperties(request, damage); |
| | | damage.setType(request.getState()); |
| | | damage.setRemark(""); |
| | | damage.setStatus(0); |
| | | damageService.insertDamage(damage); |
| | | //修改磨边队列数据状态 |
| | | edgGlassTaskInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskInfo>() |
| | | .set(EdgGlassTaskInfo::getStatus, request.getState()).eq(EdgGlassTaskInfo::getGlassId, request.getGlassId())); |
| | | return "success"; |
| | | } |
| | | } |
| | |
| | | public void temperingIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | List<EdgGlassTaskInfo> taskCaches = edgGlassTaskInfoService.selectTaskCacheIsRun(); |
| | | List<TaskCache> taskCaches = taskCacheService.selectTaskCacheIsRun(); |
| | | jsonObject.append("taskCaches", taskCaches); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun"); |
| | | if (sendwServer != null) { |
| | |
| | | public void cacheGlassIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | List<EdgGlassTaskInfo> taskCaches = edgGlassTaskInfoService.selectTaskCacheIsRun(); |
| | | List<TaskCache> taskCaches = taskCacheService.selectTaskCacheIsRun(); |
| | | jsonObject.append("taskCaches", taskCaches); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlassIsRun"); |
| | | if (sendwServer != null) { |
| | |
| | | package com.mes.taskcache.controller; |
| | | |
| | | import com.mes.edgglasstask.entity.request.IdentWornRequest; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.mes.job.CacheGlassTask.engineerId; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | private EdgStorageCageDetailsService edgStorageCageDetailsService; |
| | | |
| | | @Autowired |
| | | private EdgStorageCageService edgStorageCageService; |
| | | @Autowired |
| | | private TaskCacheService taskCacheService; |
| | | |
| | | @ApiOperation("查询切割版图信息-根据 工程号 参数(工程号)") |
| | |
| | | public Result cutTerritory(String current) { |
| | | //engineerId=current; |
| | | List<List<Map<String, Object>>> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current); |
| | | return Result.build(200, "成功", h); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @ApiOperation("识别显示 当前版图 参数()") |
| | | @PostMapping("/currentCutTerritory") |
| | | @ResponseBody |
| | | public Result currentCutTerritory() { |
| | | List<Map<String, Object>> h = edgStorageCageDetailsService.selectCutTerritory(); |
| | | return Result.build(200, "成功", h); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @ApiOperation("识别操作: 破损/拿走 参数(ID,功能[9:拿走,8:破损])") |
| | | @ApiOperation("识别操作: 破损/拿走 参数(ID,功能[200:拿走,201:破损])") |
| | | @PostMapping("/identControls") |
| | | @ResponseBody |
| | | public Result<String> identControls(@RequestBody IdentWornRequest request) { |
| | | return Result.build(200, "成功", edgStorageCageDetailsService.identControls(request)); |
| | | public Result identControls(@RequestBody Map<String, String> arguments) { |
| | | /* arguments.put("glassId","玻璃ID"); |
| | | arguments.put("controlsId","功能号[200拿走/201破损]");*/ |
| | | /*arguments.put("line","1001"); |
| | | arguments.put("machine","识别");*/ |
| | | boolean issucess = edgStorageCageDetailsService.identWorn(arguments); |
| | | return Result.build(200,"成功",issucess); |
| | | } |
| | | |
| | | @ApiOperation("磨边任务 参数()") |
| | | @PostMapping("/selectEdgTask") |
| | | @ResponseBody |
| | | 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); |
| | | String line=arguments.get("line"); |
| | | List<Map<String,Object>> EdgTasks = taskCacheService.selectEdgInfo(line); |
| | | return Result.build(200,"成功",EdgTasks); |
| | | } |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | TaskCache selectLastOutCacheInfo(int line); |
| | | /** |
| | | * 查询判断磨边线是否有玻璃运行 |
| | | * @param |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectTaskCacheIsRun(); |
| | | |
| | | } |
| | |
| | | return baseMapper.selectOne(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getEndCell, line).eq(TaskCache::getTaskStatus, 1).orderByDesc(TaskCache::getCreateTime)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询判断磨边线是否有玻璃运行 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectTaskCacheIsRun() { |
| | | List<TaskCache> taskCaches = null; |
| | | taskCaches = taskCacheMapper.selectJoinList(TaskCache.class, new MPJLambdaWrapper<TaskCache>() |
| | | .select("top 4 t.end_cell,ISNULL(b.glass_id, 0)as glass_id") |
| | | .leftJoin("big_storage_cage_feed_task as b on t.glass_id=b.glass_id ") |
| | | .groupBy("t.end_cell,b.glass_id,t.create_time") |
| | | .orderByDesc("t.create_time") |
| | | ); |
| | | return taskCaches; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public interface BigStorageCageMapper extends MPJBaseMapper<BigStorageCage> { |
| | | |
| | | List<Integer> queryFreeDeviceByUsed(@Param(value = "thickness") double thickness); |
| | | |
| | | List<Integer> queryFreeDeviceByNotUsed(@Param(value = "thickness") double thickness); |
| | | // |
| | | // List<Integer> queryFreeDeviceByNotUsed(@Param(value = "thickness") double thickness); |
| | | } |
| | |
| | | |
| | | List<Integer> queryFreeDeviceByUsed(double thickness); |
| | | |
| | | List<Integer> queryFreeDeviceByNotUsed(double thickness); |
| | | // List<Integer> queryFreeDeviceByNotUsed(double thickness); |
| | | } |
| | |
| | | } |
| | | |
| | | //获取玻璃的厚度:重新选笼子需要按照笼子可放玻璃厚度进行选择 |
| | | List<Integer> deviceNotUsedList = bigStorageCageService.queryFreeDeviceByNotUsed(glassInfo.getThickness()); |
| | | for (Integer item : deviceNotUsedList) { |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getDeviceId, item) |
| | | .last("limit 1")); |
| | | if (null != bigStorageCage) { |
| | | log.info("按照存笼玻璃格子数剩余最多得方式获取信息版图id:{},格子:{},玻璃id:{}", glassInfo.getTemperingLayoutId(), bigStorageCage.getSlot(), glassInfo.getGlassId()); |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | return bigStorageDTO; |
| | | } |
| | | } |
| | | // List<Integer> deviceNotUsedList = bigStorageCageService.queryFreeDeviceByNotUsed(glassInfo.getThickness()); |
| | | // for (Integer item : deviceNotUsedList) { |
| | | // bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | // .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | // .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | // .eq(BigStorageCage::getDeviceId, item) |
| | | // .last("limit 1")); |
| | | // if (null != bigStorageCage) { |
| | | // log.info("按照存笼玻璃格子数剩余最多得方式获取信息版图id:{},格子:{},玻璃id:{}", glassInfo.getTemperingLayoutId(), bigStorageCage.getSlot(), glassInfo.getGlassId()); |
| | | // bigStorageDTO = new BigStorageDTO(); |
| | | // bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | // bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | // bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | // return bigStorageDTO; |
| | | // } |
| | | // } |
| | | Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃"); |
| | | return bigStorageDTO; |
| | | } |
| | |
| | | return baseMapper.queryFreeDeviceByUsed(thickness); |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> queryFreeDeviceByNotUsed(double thickness) { |
| | | return baseMapper.queryFreeDeviceByNotUsed(thickness); |
| | | } |
| | | // @Override |
| | | // public List<Integer> queryFreeDeviceByNotUsed(double thickness) { |
| | | // return baseMapper.queryFreeDeviceByNotUsed(thickness); |
| | | // } |
| | | } |
| | |
| | | } |
| | | //获取出片任务表中状态为破损的数据 |
| | | List<BigStorageCageOutTask> outDamageTaskInfoList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .in(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | if (CollectionUtils.isNotEmpty(outDamageTaskInfoList)) { |
| | | log.info("获取出片任务表中破损的玻璃信息{}", outDamageTaskInfoList); |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().in(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | List<String> glassIdList = outDamageTaskInfoList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | //移除钢化下片表数据 |
| | | temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().in(TemperingGlassInfo::getGlassId, glassIdList)); |
| | |
| | | <select id="queryFreeDeviceByUsed" resultType="java.lang.Integer"> |
| | | SELECT T.DEVICE_ID |
| | | FROM BIG_STORAGE_CAGE T |
| | | LEFT JOIN (SELECT * FROM BIG_STORAGE_CAGE_DETAILS WHERE STATE NOT IN (101, 200, 201)) T1 |
| | | LEFT JOIN (SELECT * FROM BIG_STORAGE_CAGE_DETAILS WHERE STATE NOT IN (101, 8, 9)) T1 |
| | | ON T.SLOT = T1.SLOT |
| | | WHERE T.MAX_THICKNESS >= #{thickness} |
| | | AND T.ENABLE_STATE = 1 |
| | | GROUP BY T.DEVICE_ID |
| | | ORDER BY COUNT(DISTINCT T1.TEMPERING_LAYOUT_ID), |
| | | ORDER BY COUNT(DISTINCT T1.ENGINEER_ID) COUNT(DISTINCT T1.TEMPERING_LAYOUT_ID), |
| | | COUNT(DISTINCT T1.SLOT) |
| | | </select> |
| | | |
| | | <select id="queryFreeDeviceByNotUsed" resultType="java.lang.Integer"> |
| | | SELECT T.DEVICE_ID |
| | | FROM BIG_STORAGE_CAGE T |
| | | LEFT JOIN (SELECT * FROM BIG_STORAGE_CAGE_DETAILS WHERE STATE NOT IN (101, 200, 201)) T1 |
| | | ON T.SLOT = T1.SLOT |
| | | WHERE T.MAX_THICKNESS >= #{thickness} |
| | | AND T.ENABLE_STATE = 1 |
| | | GROUP BY T.DEVICE_ID |
| | | ORDER BY COUNT(DISTINCT T1.TEMPERING_LAYOUT_ID), |
| | | COUNT(DISTINCT T.SLOT) - COUNT(DISTINCT T1.SLOT) DESC |
| | | </select> |
| | | <!-- <select id="queryFreeDeviceByNotUsed" resultType="java.lang.Integer">--> |
| | | <!-- SELECT T.DEVICE_ID--> |
| | | <!-- FROM BIG_STORAGE_CAGE T--> |
| | | <!-- LEFT JOIN (SELECT * FROM BIG_STORAGE_CAGE_DETAILS WHERE STATE NOT IN (101, 8, 9)) T1--> |
| | | <!-- ON T.SLOT = T1.SLOT--> |
| | | <!-- WHERE T.MAX_THICKNESS >= #{thickness}--> |
| | | <!-- AND T.ENABLE_STATE = 1--> |
| | | <!-- GROUP BY T.DEVICE_ID--> |
| | | <!-- ORDER BY COUNT(DISTINCT T1.ENGINEER_ID)--> |
| | | <!-- COUNT(DISTINCT T1.TEMPERING_LAYOUT_ID),--> |
| | | <!-- COUNT(DISTINCT T.SLOT) - COUNT(DISTINCT T1.SLOT) DESC--> |
| | | <!-- </select>--> |
| | | </mapper> |
| | |
| | | List<Object> temperRecordIdListObj = temporalRecordService.listObjs(new QueryWrapper<TemperingRecord>().select("distinct tempering_layout_id")); |
| | | |
| | | List<String> temperRecordIdList = temperRecordIdListObj.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(temperRecordIdList)) { |
| | | log.info("当前系统没有需要钢化的玻璃信息"); |
| | | return; |
| | | } |
| | | List<TemperingGlassInfo> list = temporaryGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_START).notIn(TemperingGlassInfo::getTemperingLayoutId, temperRecordIdList)); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | |
| | | package com.mes.downglassinfo.controller; |
| | | |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.request.DownGlassInfoRequest; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.utils.Result; |
| | |
| | | Result.success(downGlassInfoService.setDownGlassInfoRequest(request)); |
| | | return Result.build(200, "查询成功", "1"); |
| | | |
| | | } |
| | | |
| | | @PostMapping("/downGlassPrint") |
| | | public Result downGlassPrint(@RequestBody DownGlassInfo downGlassInfo) { |
| | | return Result.build(200,"查询成功",downGlassInfoService.downGlassPrint(downGlassInfo)); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date beginDate; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | |
| | | package com.mes.downglassinfo.service.impl; |
| | | |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.HashMap;import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | |
| | | BeanUtils.copyProperties(details, downGlassInfo); |
| | | //获取当前流程卡最大片序 |
| | | downGlassInfo.setSequence(this.getMaxSequenceByFlowCardId(details.getFlowCardId(), details.getLayer()) + 1); |
| | | downGlassInfo.setWorkStationId(Const.G13_WORK_STATION); |
| | | this.save(downGlassInfo); |
| | | //生成任务信息 并向plc发送出片任务 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | |
| | | package com.mes.downworkstation.controller; |
| | | |
| | | |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.request.DownWorkRequest; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | private DownWorkstationService downWorkstationService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | @ApiOperation("获取工位信息") |
| | | @GetMapping("/getone") |
| | |
| | | @ResponseBody |
| | | public Result<String> closeAlarmSignal() { |
| | | return Result.build(200, "更换成功", downWorkstationService.closeAlarmSignal()); |
| | | } |
| | | |
| | | @ApiOperation("是否自动打印") |
| | | @PostMapping("/autoPrint") |
| | | public Result autoPrint(Boolean flag) { |
| | | downWorkstationService.autoPrint(flag); |
| | | return Result.build(200, "修改成功", redisUtil.getCacheObject("autoPrint")); |
| | | } |
| | | |
| | | |
| | |
| | | boolean updateDownWorkstationstate(DownWorkstation downWorkstation); |
| | | |
| | | String closeAlarmSignal(); |
| | | |
| | | void autoPrint(Boolean flag); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.entity.DownWorkstionAndDownGlassinfo; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @Autowired(required = false) |
| | | private DownWorkstationTaskMapper downWorkstationTaskMapper; |
| | | @Autowired |
| | | private DownGlassInfoService downGlassInfoService; |
| | | @Autowired |
| | | private DownGlassInfoMapper downGlassInfoMapper; |
| | | @Autowired |
| | | private DownGlassTaskService downGlassTaskService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private DownWorkstationTaskService downWorkstationTaskService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | // @Override |
| | | // public List<DownWorkstation> gettwoDownWorkstations() { |
| | |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public void autoPrint(Boolean flag){ |
| | | redisUtil.setCacheObject("autoPrint", flag); |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.hutool.core.lang.Assert; |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.common.S7object; |
| | |
| | | log.info("本次任务结束时间:{},共耗时:{}ms", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | /** |
| | | * 更新已绑定工位流程卡的破损/拿走的数量信息 |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void updateWorkStationOtherCount() { |
| | | Date startDate = new Date(); |
| | | log.info("下片破更新损玻璃数量任务开始执行时间:{}", startDate); |
| | | //获取已绑定流程卡的工位信息 |
| | | List<DownWorkstation> downWorkstationList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNotNull(DownWorkstation::getFlowCardId) |
| | | .ne(DownWorkstation::getFlowCardId, "") |
| | | .orderByDesc(DownWorkstation::getWorkstationId)); |
| | | for (DownWorkstation downWorkstation : downWorkstationList) { |
| | | //更新工位其他玻璃信息的数量 |
| | | QueryWrapper<Damage> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("process_id", downWorkstation.getFlowCardId()); |
| | | queryWrapper.eq("technology_number", downWorkstation.getLayer()); |
| | | int otherNumber = damageService.count(queryWrapper); |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getOtherNumber, otherNumber) |
| | | .eq(DownWorkstation::getWorkstationId, downWorkstation.getWorkstationId())); |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("下片破更新损玻璃数量任务结束时间:{},共耗时:{}ms", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | public void inTo(String glassId, String requestWord, String currentSlot) { |
| | | log.info("1、按照玻璃id:{}获取玻璃小片信息,当前格子为:{}", glassId, currentSlot); |
| | | //添加进片任务 查找空格 |
| | |
| | | BeanUtils.copyProperties(glassInfo, downStorageCageDetails); |
| | | downStorageCageDetails.setState(Const.GLASS_STATE_IN); |
| | | downStorageCageDetails.setSlot(nearestEmpty.getSlot()); |
| | | downStorageCageDetails.setDeviceId(nearestEmpty.getDeviceId()); |
| | | downStorageCageDetailsService.save(downStorageCageDetails); |
| | | // 生成进片任务 |
| | | initDownGlassTask(glassInfo, 0, nearestEmpty.getSlot(), Const.GLASS_CACHE_TYPE_IN); |
| | |
| | | //获取当前笼子空格信息 |
| | | DownStorageCage empty = downStorageCageService.selectCacheEmpty(Integer.parseInt(currentSlot), Boolean.TRUE); |
| | | cageDetails.setSlot(empty.getSlot()); |
| | | cageDetails.setDeviceId(empty.getDeviceId()); |
| | | tempList.add(cageDetails); |
| | | } |
| | | log.info("出片2:笼内玻璃的数据(包括待进片)有:{}", tempList); |
| | |
| | | .filter(item -> StringUtils.isNotBlank(item.getFlowCardId())).collect(Collectors.groupingBy(item -> item.getFlowCardId() + ":" + item.getLayer())); |
| | | //过滤筛选获取架子上对应流程卡+层数的笼子内的玻璃信息 |
| | | list = tempList.stream().filter(item -> listMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(list) && flag08 && !"2".equals(glassStatus13)) { |
| | | list = tempList.stream().filter(item -> { |
| | | double firstLength = Math.max(item.getWidth(), item.getHeight()); |
| | | double secondLength = Math.min(item.getWidth(), item.getHeight()); |
| | | return firstLength > maxWidth || secondLength > maxHeight; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | } else { |
| | | log.info("存在未绑定流程卡架子,直接获取笼内所有玻璃,且未绑定架子的玻璃信息(都可以出的玻璃)"); |
| | | log.info("存在未绑定流程卡架子,直接获取笼内所有玻璃,且未绑定架子的玻璃信息"); |
| | | //获取禁用及非本机械臂的架子的流程号及层数对应的玻璃信息 |
| | | List<DownWorkstation> downWorkstationOffList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .and(i -> i.in(DownWorkstation::getWorkstationId, offWorkStationList).or().eq(DownWorkstation::getEnableState, Const.SLOT_OFF))); |
| | |
| | | log.info("笼内玻璃无法执行出片"); |
| | | return Boolean.FALSE; |
| | | } |
| | | //获取具体出那一片玻璃 |
| | | //tao:人工--> 所有架子都未绑定时进行绑定 --->有未绑定架子时进行绑定 --->绑定过流程卡的玻璃-->玻璃流程卡多层--->玻璃流程卡单层 |
| | | String tempGlassId = null; |
| | | Boolean isNeedBind = Boolean.FALSE; |
| | | |
| | |
| | | loop: |
| | | if (StringUtils.isBlank(tempGlassId)) { |
| | | //获取正在落架的绑定流程卡的信息(流程卡、层数、落架数量) |
| | | //落架玻璃数为0,即使绑定了流程卡,也无法找到对应的架子信息,只能重新绑定 |
| | | //todo:落架玻璃数为0,即使绑定了流程卡,也无法找到对应的架子信息,只能重新绑定 |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationFlowCard(workList); |
| | | List<String> downGlassFlowList = downGlassInfoDTOList.stream().map(item -> item.getFlowCardId() + ":" + item.getLayer()).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(downGlassFlowList)) { |
| | |
| | | break loop; |
| | | } |
| | | //将笼子内的玻璃进行过滤,仅获取无法落架的流程卡玻璃 |
| | | //tao:当有空架时优先对笼内可出片且未绑架子的玻璃进出绑架并出片 |
| | | List<DownStorageCageDetails> noDownLoadList = list.stream().filter(item -> !downGlassFlowList.contains(item.getFlowCardId() + ":" + item.getLayer())) |
| | | .collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(noDownLoadList)) { |
| | |
| | | return Boolean.FALSE; |
| | | } |
| | | //将笼内玻璃的流程卡+层号 和落架的流程卡 去重,得出展示无法落架的玻璃,判断玻璃数是否超过阈值 |
| | | //笼内玻璃是否可落架:笼内是否有需要中空 |
| | | //笼内玻璃是否可落架:笼内是否有需要中空的 |
| | | List<DownStorageCageDetails> multiLayerList = list.stream().filter(item -> item.getTotalLayer() >= 2).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(multiLayerList)) { |
| | | for (DownStorageCageDetails item : multiLayerList) { |
| | |
| | | break loop; |
| | | } |
| | | Integer sequence = downGlassInfoService.queryMaxSequence(item.getFlowCardId(), item.getLayer()); |
| | | log.info("获取当前玻璃需要放的次序:笼内同流程 同层数的落架次序+1:{}", sequence); |
| | | log.info("获取当前玻璃需要放的次序:笼内同流程 同层数的通达次序+1:{}", sequence); |
| | | DownGlassInfo downGlassInfo = downGlassInfoService.getOne(new LambdaQueryWrapper<DownGlassInfo>() |
| | | .eq(DownGlassInfo::getFlowCardId, downGlassInfoDTO.getFlowCardId()) |
| | | .eq(DownGlassInfo::getLayer, downGlassInfoDTO.getLayer()).eq(DownGlassInfo::getSequence, sequence)); |
| | |
| | | JSONObject jsonObject4 = new JSONObject();
|
| | | jsonObject4.append("downGlassInfos", listMap);
|
| | | jsonObject4.append("engineerIdList", engineerIdList);
|
| | |
|
| | | //钢化开关
|
| | | boolean autoPrint=false;
|
| | | if(redisUtil.getCacheObject("autoPrint")==null){
|
| | | redisUtil.setCacheObject("autoPrint", false);
|
| | | }else{
|
| | | autoPrint=redisUtil.getCacheObject("autoPrint");
|
| | | }
|
| | | jsonObject4.append("autoPrint", autoPrint);
|
| | |
|
| | | ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (sendwServer4 != null) {
|
| | | for (WebSocketServer webserver : sendwServer4) {
|