Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
27个文件已修改
4 文件已重命名
4个文件已添加
14个文件已删除
| | |
| | | } |
| | | }); |
| | | const toggleEnableState = async (row) => { |
| | | const newState = row.enable_state === 1 ? 0 : 1; |
| | | 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) { |
| | |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import request from "@/utils/request" |
| | | // import { ref } from 'vue' |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | const dialogFormVisible = ref(true) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | | const width = ref(); // 用于存储process_id的响应式引用 |
| | | const height = ref(); // 用于存储process_id的响应式引用 |
| | | const width = ref(); |
| | | const height = ref(); |
| | | const adjustedRects = ref([]); |
| | | const adjustedRects2 = ref([]); |
| | | const adjustedRectsa = ref([]); |
| | | const adjustedRectsb = ref([]); |
| | | // 进炉中 |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | // 进炉中 |
| | | adjustedRects.value = data.intoGlass[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | xcoordinate: rect.xCoordinate * 0.5, // 将x值除以3 |
| | | ycoordinate: rect.ycoordinate * 0.5, |
| | | width: rect.width * 0.4, |
| | | height: rect.height * 0.4, |
| | | ...rect, |
| | | xcoordinate: rect.xCoordinate * 0.3, |
| | | ycoordinate: rect.ycoordinate * 0.3, |
| | | width: rect.width * 0.2, |
| | | height: rect.height * 0.2, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | })); |
| | | adjustedRects2.value = data.intoGlass2[0].map(rect => ({ |
| | | ...rect, |
| | | xcoordinate: rect.xCoordinate * 0.3, |
| | | ycoordinate: rect.ycoordinate * 0.3, |
| | | width: rect.width * 0.2, |
| | | height: rect.height * 0.2, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | })); |
| | | console.log(data.intoGlass[0]); |
| | | // 进炉前 |
| | | adjustedRectsa.value = data.waitingGlass[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | xcoordinate: rect.xCoordinate * 0.5, // 将x值除以3 |
| | | xcoordinate: rect.xCoordinate * 0.5, |
| | | ycoordinate: rect.ycoordinate * 0.5, |
| | | width: rect.width * 0.4, |
| | | height: rect.height * 0.4, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | state: rect.state |
| | | })); |
| | | |
| | | })); |
| | | // 已出炉 |
| | | adjustedRectsb.value = data.outGlass[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | xcoordinate: rect.xCoordinate * 0.5, // 将x值除以3 |
| | | xcoordinate: rect.xCoordinate * 0.5, |
| | | ycoordinate: rect.ycoordinate * 0.5, |
| | | width: rect.width * 0.4, |
| | | height: rect.height * 0.4, |
| | |
| | | })); |
| | | }; |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | | <template> |
| | | <div style="margin-top: 10px;"> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true;dialogFormVisiblea = false;dialogFormVisibleb = false;">进炉中</el-button> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;" >进炉前</el-button> |
| | |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 700px;" v-loading="loading"> |
| | | <div style="width: 49%;float: left;background-color: #f4f4f5;height: 650px;"> |
| | | <el-scrollbar height="630px"> |
| | | <div v-for="(group, groupId) in groupedRects" :key="groupId" style="position: relative;"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="index" |
| | | class="rect" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }" |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | |
| | | <el-scrollbar height="630px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | v-for="(rect, index) in adjustedRects2" |
| | | :key="index" |
| | | class="rect" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }" |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | | |
| | | </el-card> |
| | | </div> |
| | | <div v-if="dialogFormVisiblea"> |
| | | <!-- 进炉前 --> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> |
| | | <el-scrollbar height="630px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | |
| | | </el-card> |
| | | </div> |
| | | <div v-if="dialogFormVisibleb"> |
| | | <!-- 已出炉 --> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> |
| | | <el-scrollbar height="630px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | #boxa{ |
| | | border: 1px solid rgb(119, 116, 116); |
| | |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="数量:" :required="true" style="width: 14vw;"> |
| | | <el-input v-model="number" autocomplete="off" /> |
| | | <el-input placeholder="请输入数量" v-model="number" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | |
| | | const tableDatad = ref([]) |
| | | const tableDatae = ref([]) |
| | | const adjustedRects = ref([]); |
| | | const height = ref([]); |
| | | |
| | | // const height = ref([]); |
| | | const add = ref(false) |
| | | const flowCardId = ref(''); |
| | | const gap = ref(''); |
| | | const glassId = ref(''); |
| | | const glassType = ref(''); |
| | | const height = ref(''); |
| | | const sequence = ref(''); |
| | | const state = ref(''); |
| | | const temperingFeedSequence = ref(''); |
| | | const temperingLayoutId = ref(''); |
| | | const thickness = ref(''); |
| | | const width = ref(''); |
| | | const carposition1 = ref(60); |
| | | const carposition2 = ref(220); |
| | | const carposition3 = ref(60); |
| | |
| | | |
| | | const currentPage4 = ref(4) |
| | | const pageSize4 = ref(100) |
| | | |
| | | const dialogForm = () => { |
| | | ElMessageBox.confirm( |
| | | '确定要急停吗?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '否', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '急停成功!', |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '急停失败', |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | var timer=setInterval(() => { |
| | | // console.log(million.value,million1.value); |
| | |
| | | } |
| | | |
| | | }, 1000); |
| | | |
| | | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | const handleBindRack = (row) => { |
| | | add.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 添加 |
| | | const handleConfirm = async () => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/insertBigStorageCageDetails', { |
| | | flowCardId: flowCardId.value, |
| | | gap: gap.value, |
| | | glassId: glassId.value, |
| | | glassType: glassType.value, |
| | | height: height.value, |
| | | sequence: sequence.value, |
| | | state: state.value, |
| | | temperingFeedSequence: temperingFeedSequence.value, |
| | | temperingLayoutId: temperingLayoutId.value, |
| | | thickness: thickness.value, |
| | | width: width.value, |
| | | }); |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | add.value = false; |
| | | tableData.value = response.data; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | }; |
| | | // 是否禁用 |
| | | const toggleEnableState = async (row) => { |
| | | const newState = row.enableState === 1 ? 0 : 1; |
| | | console.log(row.slot); |
| | | console.log(row.enableState); |
| | | var url="/cacheVerticalGlass/bigStorageCage/updateStorageCageDisabled?slot="+row.slot + "&enableState=" + newState; |
| | | console.log(url); |
| | | const response = await request.get(url) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | row.enableState = newState; |
| | | }; |
| | | // const tableData = ref([ |
| | | // // ...您的表格数据 |
| | | // id: |
| | | // deviceId slot enableState remainWidth |
| | | |
| | | // ]); |
| | | // 删除 |
| | | const opena = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | '是否删除该条信息?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/deleteBigStorageCageDetails", { |
| | | menuId: row.id, |
| | | }) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.msg); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | |
| | | |
| | | <template> |
| | | <div style="height: 700px;"> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisible = true">手动进片</el-button> --> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">理片笼信息</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">出片队列</el-button> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">终止进片</el-button> --> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">终止出片</el-button> --> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger" @click="dialogForm">软急停</el-button> --> |
| | | |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <el-table height="100%" ref="table" |
| | |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="bigStorageCageFeedTask.glassId" align="center" label="进片玻璃ID" min-width="80" /> |
| | | <el-table-column prop="bigStorageCageFeedTask.tragetSlot" align="center" label="目标位置" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageFeedTask.targetSlot" align="center" label="目标位置" min-width="120" /> |
| | | <!-- <el-table-column prop="task_type" align="center" label="任务类型" min-width="120" />没有返回字段 --> |
| | | <el-table-column prop="bigStorageCageFeedTask.taskState" align="center" label="任务状态" min-width="120"> |
| | | <template #default="scope"> |
| | |
| | | <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;background-color: #409EFF;"> |
| | | </div> --> |
| | | </div> |
| | | |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" top="12vh" width="85%" title="请确认玻璃信息" > |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <div style="display: flex;"> |
| | | <p style="margin-top: 4px;">确认状态:</p> |
| | | <el-button style="margin-left: 10px;size: mini;" type="success">允许</el-button> |
| | | <el-button style="margin-left: 10px;size: mini;" type="danger">不允许</el-button> |
| | | <p style="margin-left: 60px;margin-top: 4px;">当前状态:</p> |
| | | <div style="margin-top: 4px; margin-left: 10px;">手动</div> |
| | | <el-button style="margin-left: 10px;size: mini;" type="primary">切换</el-button> |
| | | <el-input placeholder="请输入玻璃id" style="width: 180px;size: mini;margin-left: 60px;"></el-input> |
| | | <el-button style="margin-left: 10px;size: mini;" type="primary">添加</el-button> |
| | | <p style="margin-left: 60px;margin-top: 4px;">玻璃id:</p> |
| | | <el-input style="width: 180px;size: mini;margin-left: 30px;"></el-input> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <p style="margin-left: 290px;margin-top: 20px;font-weight: bold;">上片位</p> |
| | | <p style="margin-left: 630px;margin-top: 20px;font-weight: bold;">扫码位</p> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">当前信息</p> |
| | | <el-form label-position="right" label-width="90px"> |
| | | <el-form-item style="width: 20vw" label="玻璃id:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="订单编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="列表编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="箱子编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="长:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="宽:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-dialog v-model="add" top="20vh" width="60%" title="添加理片笼信息" > |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form label-width="150px" 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="玻璃ID:" :required="true" style="width: 20vw;"> |
| | | <el-input placeholder="请输入玻璃ID" v-model="glassId" autocomplete="off" /> |
| | | </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: 20vw;"> |
| | | <el-input placeholder="请输入小片在格内的顺序" v-model="sequence" autocomplete="off" /> |
| | | </el-form-item></div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="流程卡号:" :required="true" style="width: 20vw;"> |
| | | <el-input placeholder="请输入流程卡号" v-model="flowCardId" autocomplete="off" /> |
| | | </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: 20vw;"> |
| | | <el-input placeholder="请输入玻璃类型" v-model="glassType" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="宽:" :required="true" style="width: 20vw;"> |
| | | <el-input placeholder="请输入宽" v-model="width" autocomplete="off" /> |
| | | </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: 20vw;"> |
| | | <el-input placeholder="请输入高" v-model="height" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="厚度:" :required="true" style="width: 20vw;"> |
| | | <el-input placeholder="请输入厚度" v-model="thickness" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="钢化版图ID:" :required="true" style="width: 20vw;"> |
| | | <el-input placeholder="请输入钢化版图ID" v-model="temperingLayoutId" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="钢化版图片序:" :required="true" style="width: 20vw;"> |
| | | <el-input placeholder="请输入钢化版图片序" v-model="temperingFeedSequence" autocomplete="off" /> |
| | | </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: 20vw;"> |
| | | <el-input placeholder="请输入启用状态" v-model="state" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="玻璃间隙:" :required="true" style="width: 20vw;"> |
| | | <el-input placeholder="请输入玻璃间隙" v-model="gap" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="add = false">取消</el-button> |
| | | </div> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">修改信息</p> |
| | | <el-form label-position="right" label-width="90px"> |
| | | <el-form-item style="width: 20vw" label="玻璃id:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="订单编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="列表编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="箱子编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="长:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="宽:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">修改信息</p> |
| | | <el-form label-position="right" label-width="90px"> |
| | | <el-form-item style="width: 20vw" label="玻璃id:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="订单编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="列表编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="箱子编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="长:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="宽:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">当前信息</p> |
| | | <el-form label-position="right" label-width="90px"> |
| | | <el-form-item style="width: 20vw" label="玻璃id:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="订单编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="列表编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="箱子编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="长:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="宽:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="dialogFormVisible = false"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="dialogFormVisible = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisiblea" top="10vh" width="85%" title="理片笼信息" > |
| | | <!-- <el-input placeholder="请输入工程号" style="width: 180px;size: mini;"></el-input> --> |
| | | <!-- <el-button style="margin-left: 10px;size: mini;" type="primary">查询</el-button> --> |
| | | <el-table ref="table" style="margin-top: 20px;height: 500px;" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="大理片笼表ID" min-width="80" /> |
| | | <el-table-column prop="deviceId" align="center" label="理片笼号" min-width="120" /> |
| | | <el-table-column prop="slot" align="center" label="栅格号" min-width="120" /> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisiblea" top="5vh" width="90%" title="理片笼信息" > |
| | | <el-table |
| | | :data="tableData" |
| | | height="600" |
| | | @expand-change="handleExpandChange" |
| | | row-key="id" |
| | | default-expand-all |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column type="expand"> |
| | | <template #default="props"> |
| | | <div v-if="props.row.bigStorageCageDetails && props.row.bigStorageCageDetails.length"> |
| | | <el-table |
| | | :data="props.row.bigStorageCageDetails" |
| | | border |
| | | style="width: 100%;margin-left: 20px;" |
| | | row-key="id" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <!-- <el-table-column prop="menuName" label="二级菜单栏" align="center" min-width="140" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"/> --> |
| | | <el-table-column prop="glassId" label="玻璃ID" align="center" min-width="100"/> |
| | | <el-table-column prop="sequence" align="center" label="小片在格内的顺序" min-width="120" /> |
| | | <el-table-column prop="flowCardId" align="center" label="流程卡号" min-width="120" /> |
| | | <el-table-column prop="glassType" align="center" label="玻璃类型" min-width="100" /> |
| | | <el-table-column prop="width" align="center" label="宽" min-width="80" /> |
| | | <el-table-column prop="height" align="center" label="高" min-width="80" /> |
| | | <el-table-column prop="thickness" align="center" label="厚度" min-width="80" /> |
| | | <el-table-column prop="temperingLayoutId" align="center" label="钢化版图ID" min-width="100" /> |
| | | <el-table-column prop="temperingFeedSequence" align="center" label="钢化版图片序" min-width="120" /> |
| | | <el-table-column |
| | | align="center" |
| | | label="启用状态" |
| | | min-width="80" |
| | | prop="state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType(scope.row.state)"> |
| | | {{ getStatusText(scope.row.state) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="gap" align="center" label="玻璃间隙" min-width="80" /> |
| | | <el-table-column fixed="right" label="操作" align="center" min-width="180"> |
| | | <template #default="scope"> |
| | | <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> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">出片</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="大理片笼表ID" align="center" min-width="100"/> |
| | | <el-table-column prop="deviceId" align="center" label="理片笼号" min-width="150" /> |
| | | <el-table-column prop="slot" align="center" label="栅格号" min-width="150" /> |
| | | <el-table-column |
| | | align="center" |
| | | label="启用状态" |
| | | min-width="80" |
| | | prop="enableState" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType(scope.row.enableState)"> |
| | | {{ getStatusText(scope.row.enableState) }} |
| | | </el-tag> |
| | | </template> |
| | | <el-tag |
| | | :type="scope.row.enableState === 1 ? 'success' : 'danger'" |
| | | @click="toggleEnableState(scope.row)" |
| | | > |
| | | {{ scope.row.enableState === 1 ? '启用' : '禁用' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remainWidth" align="center" label="剩余宽度" min-width="120" /> |
| | | |
| | | <el-table-column fixed="right" label="操作" align="center"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">添加</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div id="demo-pagination-block"> |
| | | <el-pagination |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleb" top="10vh" width="85%" title="出片队列" > |
| | | <div style="display: flex;"> |
| | | <!-- <div style="display: flex;"> |
| | | <p style="margin-top: 3px;">队列状态:</p> |
| | | <p style="margin-top: 3px;">开始</p> |
| | | <el-button style="margin-left: 10px;size: mini;" type="danger">停止</el-button> |
| | | <el-button style="margin-left: 10px;size: mini;" type="primary">添加</el-button> |
| | | </div> |
| | | </div> --> |
| | | <el-table ref="table" style="margin-top: 20px;height: 500px;" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" fixed align="center" label="钢化小片信息表id" min-width="150"/> |
| | | <!-- <el-table-column prop="glass_id" align="center" label="玻璃id" min-width="120" /> --> |
| | | <el-table-column prop="flowcardId" fixed align="center" label="流程卡" min-width="120" /> |
| | | <el-table-column prop="glassType" align="center" label="流程卡玻璃类型" min-width="150" /> |
| | | <el-table-column prop="width" align="center" label="宽" min-width="80" /> |
| | | <el-table-column prop="height" align="center" label="高" min-width="80" /> |
| | | <el-table-column prop="thickness" align="center" label="厚度" min-width="80" /> |
| | | <el-table-column prop="filmsid" align="center" label="膜系" min-width="80" /> |
| | | <!-- <el-table-column prop="ishorizontal" align="center" label="钢化是否接受横放" min-width="150" /> --> |
| | | <el-table-column |
| | | align="center" |
| | | label="钢化是否接受横放" |
| | |
| | | <el-table-column prop="xCoordinate" align="center" label="x坐标" min-width="80" /> |
| | | <el-table-column prop="yCoordinate" align="center" label="y坐标" min-width="80" /> |
| | | <el-table-column prop="angle" align="center" label="旋转角度(逆时针)" min-width="150" /> |
| | | <!-- <el-table-column prop="state" align="center" label="状态" min-width="80" /> --> |
| | | <el-table-column |
| | | align="center" |
| | | label="状态" |
| | |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">添加</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">破损</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleBindRacka(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | // 表单数据 |
| | | const workstationId = ref(''); |
| | | const flowCardId = ref(''); |
| | | const flowCardOptions = ref([]); |
| | | const flowCardOptions = ref('[]'); |
| | | const tableData = reactive([]); |
| | | // 方法 |
| | | const handleSelectionChange = () => { |
| | |
| | | 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 })); |
| | | |
| | | flowCardOptions.value = response.data.filter(item => item !== null) |
| | | .map(item => ({ flowcard_id: item.flow_card_id })); |
| | | console.log(flowCardOptions.value); |
| | | } |
| | | else { |
| | |
| | | <el-form-item label="架号:" :required="true" style="width: 18vw"> |
| | | <el-input v-model="workstationId" autocomplete="off"/> |
| | | </el-form-item> |
| | | <el-form-item label="流程卡号:" :required="true" style="width: 18vw;"> |
| | | <el-form-item label="流程卡号:" :required="false" style="width: 18vw;"> |
| | | <el-select v-model="flowCardId" placeholder="请选择流程卡号"> |
| | | <el-option v-for="item in flowCardOptions" :key="item.flowcard_id" :label="item.flowcard_id" :value="item.flowcard_id" /> |
| | | </el-select> |
| | |
| | | parentId: parentId.value, |
| | | url: url.value, |
| | | }); |
| | | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | |
| | | const opena = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | '是否删除该用户?', |
| | | '是否删除该菜单?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- <el-table height="240" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="menuName" align="center" label="菜单栏" min-width="180" /> |
| | | <el-table-column align="center" label="链接" min-width="180"> |
| | | <template #default="scope"> |
| | | <el-tag v-for="role in scope.row.children"> |
| | | {{role.url}} |
| | | </el-tag> |
| | | </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="opena(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> --> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | |
| | | const opena = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | '是否删除该用户?', |
| | | '是否删除该角色?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | |
| | | <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 placeholder="请输入角色" v-model="name" 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="editingUser.name" autocomplete="off" /> |
| | | <el-input placeholder="请输入角色" v-model="editingUser.name" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | * 卧式理片笼详情表玻璃状态 |
| | | * 识别后成功状态100 |
| | | * 出片任务101 |
| | | * 人工下片101 |
| | | * 拿走200 |
| | | * 破损201 |
| | | */ |
| | | public static final Integer GLASS_STATE_IN = 100; |
| | | public static final Integer GLASS_STATE_OUT = 101; |
| | | public static final Integer GLASS_STATE_ARTIFICIAL = 102; |
| | | public static final Integer GLASS_STATE_TAKE = 200; |
| | | public static final Integer GLASS_STATE_DAMAGE = 201; |
| | | |
New file |
| | |
| | | package com.mes.damage.service.impl; |
| | | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | */ |
| | | @Service |
| | | public class DamageServiceImpl extends ServiceImpl<DamageMapper, Damage> implements DamageService { |
| | | |
| | | } |
| | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 保存小片表 |
| | | */ |
| | | void saveGlassInfo(List<GlassInfo> glassinfo); |
| | | |
| | | /** |
| | | * @param flowCardId |
| | | * @return 根据流程卡号查询玻璃信息 |
| | | */ |
| | | int getGlassInfoCountByFlowCardId(String flowCardId); |
| | | |
| | | /** |
| | | * @return |
| | | * 查询所有工程状态不为300不同流程卡号 |
| | | */ |
| | | List<Map<String, Object>> getFlowCardId(); |
| | | } |
| | | |
| | |
| | | package com.mes.glassinfo.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.entity.OptimizeGlassinfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public void saveGlassInfo(List<GlassInfo> glassinfo) { |
| | | this.saveBatch(glassinfo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int getGlassInfoCountByFlowCardId(String flowCardId) { |
| | | return baseMapper.selectCount(new QueryWrapper<GlassInfo>().lambda() |
| | | .eq(GlassInfo::getFlowCardId, flowCardId)); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getFlowCardId() { |
| | | return baseMapper.selectJoinMaps(JoinWrappers.lambda(GlassInfo.class) |
| | | .select(GlassInfo::getFlowCardId) |
| | | .leftJoin(UpPattenUsage.class, on -> on |
| | | .eq(OptimizeProject::getProjectNo, GlassInfo::getEngineerId) |
| | | .ne(OptimizeProject::getState, 300) |
| | | ) |
| | | .groupBy(GlassInfo::getFlowCardId) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设备id |
| | | * 工程id |
| | | */ |
| | | private String engineerId; |
| | | |
| | |
| | | log.info("Sql数据:{}", Arrays.asList(list)); |
| | | } |
| | | |
| | | @Test |
| | | public void testglassinfo() { |
| | | List<GlassInfo> glassInfos = glassInfoService.selectId("7"); |
| | | log.info("玻璃数据数据:{}", Arrays.asList(glassInfos)); |
| | | } |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | |
| | | /** |
| | | * 大理片笼表id |
| | | */ |
| | | @ApiModelProperty(value = "大理片笼表id", position = 2) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "大理片笼表id", position = 2) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | |
| | | 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) |
| | |
| | | private Integer gap; |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | @ApiModelProperty(value = "工程号") |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 进片任务 |
| | | */ |
| | | @ApiModelProperty(value = "进片任务", position = 16) |
New file |
| | |
| | | package com.mes.bigstorage.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/6/13 15:51 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class SlotSequenceDTO { |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | private Integer temperingLayoutId; |
| | | /** |
| | | * 大理片详情中格子号 |
| | | */ |
| | | private Integer slot; |
| | | /** |
| | | * 格子内的最大序号 |
| | | */ |
| | | private Integer maxSequence; |
| | | /** |
| | | * 格子内的最小序号 |
| | | */ |
| | | private Integer minSequence; |
| | | |
| | | /** |
| | | * 格子剩余宽度 |
| | | */ |
| | | private Integer remainWidth; |
| | | } |
New file |
| | |
| | | package com.mes.bigstorage.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/6/13 15:51 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class TemperingLayoutDTO { |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | private Integer temperingLayoutId; |
| | | /** |
| | | * 当前版图数量 |
| | | */ |
| | | private Integer count; |
| | | |
| | | /** |
| | | * 当前版图占用格子数量 |
| | | */ |
| | | private Integer slotCount; |
| | | } |
| | |
| | | package com.mes.bigstorage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import feign.Param; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface BigStorageCageDetailsMapper extends MPJBaseMapper<BigStorageCageDetails> { |
| | | |
| | | /** |
| | | * 获取钢化版图已经到齐的工程号及版图id |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO temperingIsAll(); |
| | | |
| | | /** |
| | | * 获取每个钢化版图占用的格子数量 |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO queryTemperingOccupySlot(@Param(value = "count") int count); |
| | | |
| | | |
| | | List<SlotSequenceDTO> queryGlassMaxAndMin(@Param(value = "engineerId") String engineerId, @Param(value = "temperingLayoutId") Integer temperingLayoutId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | |
| | | * @param glassInfo |
| | | */ |
| | | BigStorageDTO queryTargetSlotByTempering(GlassInfo glassInfo); |
| | | |
| | | /** |
| | | * 获取钢化版图已经到齐的工程号及版图id |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO temperingIsAll(); |
| | | |
| | | /** |
| | | * 获取每个钢化版图占用的格子数量 |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO queryTemperingOccupySlot(); |
| | | |
| | | /** |
| | | * 获取版图每个格子的最大最小序号 |
| | | * |
| | | * @param engineerId |
| | | * @param temperingLayoutId |
| | | * @return |
| | | */ |
| | | List<SlotSequenceDTO> queryGlassMaxAndMin(String engineerId, Integer temperingLayoutId); |
| | | } |
| | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private GlassInfoMapper glassInfoMapper; |
| | | |
| | | @Value("${mes.minCount}") |
| | | private int minCount; |
| | | |
| | | /** |
| | | * 查询进/出片任务 |
| | |
| | | |
| | | @Override |
| | | public BigStorageDTO queryTargetSlotByTempering(GlassInfo glassInfo) { |
| | | // MPJLambdaWrapper<BigStorageDTO> wrapper = new MPJLambdaWrapper<>(BigStorageCage.class) |
| | | // .selectAll(BigStorageDTO.class) |
| | | // .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | // .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | // .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1) |
| | | // .last("limit 1"); |
| | | BigStorageDTO bigStorageDTO = null; |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(BigStorageCage.class) |
| | | .selectAsClass(BigStorageCage.class, BigStorageDTO.class) |
| | | .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1) |
| | | .last("limit 1"); |
| | | if (glassInfo.getTemperingLayoutId() == 0) { |
| | | wrapper.eq(BigStorageCageDetails::getWidth, glassInfo.getWidth()).eq(BigStorageCageDetails::getHeight, glassInfo.getHeight()); |
| | | } else { |
| | | wrapper.eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1); |
| | | } |
| | | bigStorageDTO = bigStorageCageService.selectJoinOne(BigStorageDTO.class, wrapper); |
| | | if (null != bigStorageDTO) { |
| | | return bigStorageDTO; |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public TemperingLayoutDTO temperingIsAll() { |
| | | return baseMapper.temperingIsAll(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public TemperingLayoutDTO queryTemperingOccupySlot() { |
| | | return baseMapper.queryTemperingOccupySlot(minCount); |
| | | } |
| | | |
| | | @Override |
| | | public List<SlotSequenceDTO> queryGlassMaxAndMin(String engineerId, Integer temperingLayoutId) { |
| | | return baseMapper.queryGlassMaxAndMin(engineerId, temperingLayoutId); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public BigStorageCageOutTask() { |
| | | } |
| | | |
| | | public BigStorageCageOutTask(String glassId, Integer startSlot, Integer endSlot, Integer trainNumber, Integer serialNumber, Integer taskState) { |
| | | this.glassId = glassId; |
| | | this.startSlot = startSlot; |
| | | this.endSlot = endSlot; |
| | | this.trainNumber = trainNumber; |
| | | this.serialNumber = serialNumber; |
| | | this.taskState = taskState; |
| | | } |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id", position = 2) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键id", position = 2) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value = "任务状态", position = 8) |
| | | private Integer taskState; |
| | | |
| | | |
| | | } |
| | |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | 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.edgglasstask.service.EdgGlassTaskInfoService; |
| | | 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.apache.commons.lang.StringUtils; |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Slf4j |
| | | public class PlcStorageCageTask { |
| | | |
| | | @Resource |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Resource |
| | |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | private static final String REQUEST_WORD = "1"; |
| | | |
| | | @Value("${mes.sequence.order}") |
| | | private boolean sequenceOrder; |
| | | |
| | | public static boolean bigStorageCageFullAlarm = false; |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | | |
| | | private int line1Time = 0; |
| | | private int line2Time = 0; |
| | | |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | // @Scheduled(fixedDelay = 5000) |
| | | // public void plcStorageCageTask() throws InterruptedException { |
| | | // |
| | | // PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | // try { |
| | | // |
| | | // String plcFeedGlassid = ""; |
| | | // String plcFeedReqLine = "0"; |
| | | // if ("1".equals(plcParameterObject.getPlcParameter("D01Request").getValue())) { |
| | | // plcFeedReqLine = "1"; |
| | | // plcFeedGlassid = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | // } |
| | | // if ("1".equals(plcParameterObject.getPlcParameter("D04Request").getValue())) { |
| | | // plcFeedReqLine = "2"; |
| | | // plcFeedGlassid = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | // } |
| | | // line1Time += 1; |
| | | // line2Time += 1; |
| | | // |
| | | // if (!("0".equals(plcFeedReqLine))) { |
| | | // log.info("1、Plc进片请求时"); |
| | | // BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | // GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid); |
| | | // log.info("2、根据玻璃id获取玻璃信息" + glassInfo); |
| | | // if (bigStorageCageDetailsService.selectGetBoard(plcFeedReqLine) >= 0) { |
| | | // BigStorageCageDetails slotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails); |
| | | // if (slotInfo != null) { |
| | | // int taskType = edgGlassTaskInfoService.judgeTasktype(plcFeedReqLine); |
| | | // log.info("3、查询任务表判断当前任务类型为上车等到还是上车启动" + taskType); |
| | | // bigStorageCageFeedTaskService.addFeedTask(slotInfo, Integer.parseInt(plcFeedReqLine), taskType); |
| | | // log.info("4、添加任务到任务表"); |
| | | // bigStorageCageFullAlarm = false; |
| | | // } else { |
| | | // bigStorageCageFullAlarm = true; |
| | | // } |
| | | // } else { |
| | | // log.info("当前玻璃宽度不够上车" + glassInfo); |
| | | // if (!("1".equals(plcFeedReqLine))) { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1); |
| | | // } else { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1); |
| | | // } |
| | | // } |
| | | // } else { |
| | | // List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskService.querybigStorageCageFeedTask(1); |
| | | // log.info("5、查询任务表是否有已经完成的进片任务" + bigStorageCageFeedTaskList.size()); |
| | | // for (BigStorageCageFeedTask bigStorageCageFeedTask : bigStorageCageFeedTaskList |
| | | // ) { |
| | | // BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | // bigStorageCageDetails.setId(bigStorageCageFeedTask.getId()); |
| | | // bigStorageCageDetails.setState(1); |
| | | // bigStorageCageDetailsService.updateById(bigStorageCageDetails); |
| | | // log.info("6、修改理片笼详情玻璃状态"); |
| | | // bigStorageCageFeedTaskService.removeById(bigStorageCageFeedTask); |
| | | // log.info("7、删除已经完成的进片任务"); |
| | | // } |
| | | // //启动阈值 |
| | | // if (line1Time >= 300) { |
| | | // if ("0".equals(plcParameterObject.getPlcParameter("D05Go").getValue())) { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1); |
| | | // } |
| | | // } |
| | | // if (line2Time >= 300) { |
| | | // if ("0".equals(plcParameterObject.getPlcParameter("D02Go").getValue())) { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //查询出片表是否有任务未完成的任务 |
| | | // List<BigStorageCageOutTask> bigStorageCageOutTask = bigStorageCageOutTaskService.querybigStorageCageOutTask(0); |
| | | // if (bigStorageCageOutTask.size() == 0) { |
| | | // boolean result = bigStorageCageService.outGlass(); |
| | | // log.info("8、没有未完成任务时调用出片接口"); |
| | | // if (result == false) { |
| | | // temperingGlassInfoService.schedulingTask(); |
| | | // } |
| | | // } |
| | | // bigStorageCageOutTaskService.updateOutTask(); |
| | | // log.info("9、根据任务表状态修改钢化小片表任务状态"); |
| | | // |
| | | // //来不及送时直接走 |
| | | // String line = Integer.toString(edgGlassTaskInfoService.startTask()); |
| | | // |
| | | // if (!(line.equals(plcFeedReqLine))) { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1); |
| | | // } else { |
| | | // S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1); |
| | | // } |
| | | // |
| | | // |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgScan() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String d01Request = plcParameterObject.getPlcParameter("D01Request").getValue(); |
| | | String d01ID1 = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | String d04Request = plcParameterObject.getPlcParameter("D04Request").getValue(); |
| | | String d04ID1 = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | log.info("1、获取到的请求字d01为:{},获取到的扫描ID为:{};获取到的请求字d04为:{},获取到的扫描ID为:{};", |
| | | d01Request, d01ID1, d04Request, d04ID1); |
| | | if (!"1".equals(d01Request) && !"1".equals(d04Request)) { |
| | | d01Request, d01Id, d04Request, d04Id); |
| | | if (!REQUEST_WORD.equals(d01Request) && !REQUEST_WORD.equals(d04Request)) { |
| | | log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | return; |
| | | } |
| | | // 0:不干预 ; 1:条件满足情况下立即发车 |
| | | String d02GoAdress = plcParameterObject.getPlcParameter("D02Go").getAddress(); |
| | | // 0:不干预 ; 1:条件满足情况下立即发车 |
| | | String d05GoAdress = plcParameterObject.getPlcParameter("D05Go").getAddress(); |
| | | Boolean flag01 = Boolean.FALSE; |
| | | Boolean flag04 = Boolean.FALSE; |
| | | //按照线路及玻璃id获取相邻两块玻璃 卧转立上的玻璃 |
| | | if ("1".equals(d01Request)) { |
| | | flag01 = judgeGlassTypeStatus(d01ID1, Const.A09_OUT_TARGET_POSITION); |
| | | if (REQUEST_WORD.equals(d01Request)) { |
| | | flag01 = judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION); |
| | | } |
| | | if ("1".equals(d04Request)) { |
| | | flag04 = judgeGlassTypeStatus(d04ID1, Const.A10_OUT_TARGET_POSITION); |
| | | if (REQUEST_WORD.equals(d04Request)) { |
| | | flag04 = judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION); |
| | | } |
| | | if (flag01 && flag04) { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer startLine = getStartLine(); |
| | | //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine, d02GoAdress, d05GoAdress); |
| | | computeTargetByLine(startLine); |
| | | } else if (flag01 || flag04) { |
| | | Integer startLine = flag01.equals(Boolean.TRUE) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine, d02GoAdress, d05GoAdress); |
| | | computeTargetByLine(startLine); |
| | | } else { |
| | | log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | } |
| | |
| | | public void plcToHomeEdgFreeCarTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String freeCar = plcParameterObject.getPlcParameter("freeCar").getValue(); |
| | | if ("1".equals(freeCar)) { |
| | | if (REQUEST_WORD.equals(freeCar)) { |
| | | log.info("大车非空闲"); |
| | | return; |
| | | } |
| | | String d01Request = plcParameterObject.getPlcParameter("D01Request").getValue(); |
| | | String d01ID1 = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | String d04Request = plcParameterObject.getPlcParameter("D04Request").getValue(); |
| | | String d04ID1 = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | log.info("1、获取到的请求字d01为:{},获取到的扫描ID为:{};获取到的请求字d04为:{},获取到的扫描ID为:{};", |
| | | d01Request, d01ID1, d04Request, d04ID1); |
| | | d01Request, d01Id, d04Request, d04Id); |
| | | //两条线都有进卧转立任务,直接结束 |
| | | if (Const.BIG_STORAGE_REQUEST_IN.equals(d01Request) |
| | | && Const.BIG_STORAGE_REQUEST_IN.equals(d04Request) |
| | | && StringUtils.isNotBlank(d01ID1) |
| | | && StringUtils.isNotBlank(d04ID1)) { |
| | | && StringUtils.isNotBlank(d01Id) |
| | | && StringUtils.isNotBlank(d04Id)) { |
| | | log.info("两条线都存在进片任务,结束任务"); |
| | | return; |
| | | } |
| | |
| | | log.info("两条线卧转立为空或者有进片任务未完成,结束任务"); |
| | | return; |
| | | } |
| | | // 0:不干预 ; 1:条件满足情况下立即发车 |
| | | String d02GoAdress = plcParameterObject.getPlcParameter("D02Go").getAddress(); |
| | | // 0:不干预 ; 1:条件满足情况下立即发车 |
| | | String d05GoAdress = plcParameterObject.getPlcParameter("D05Go").getAddress(); |
| | | String line1 = lineList.get(0); |
| | | String flagLine = line1.equals(Const.A09_OUT_TARGET_POSITION) ? d01ID1 : d04ID1; |
| | | String flagLine = line1.equals(Const.A09_OUT_TARGET_POSITION) ? d01Id : d04Id; |
| | | if (lineList.size() == 1) { |
| | | //发送 |
| | | if (StringUtils.isNotBlank(flagLine)) { |
| | | return; |
| | | } |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(Integer.parseInt(flagLine), d02GoAdress, d05GoAdress); |
| | | computeTargetByLine(Integer.parseInt(flagLine)); |
| | | return; |
| | | } |
| | | if (StringUtils.isBlank(d01ID1) && StringUtils.isBlank(d04ID1)) { |
| | | if (StringUtils.isBlank(d01Id) && StringUtils.isBlank(d04Id)) { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer line = getStartLine(); |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(line, d02GoAdress, d05GoAdress); |
| | | computeTargetByLine(line); |
| | | return; |
| | | } |
| | | int outLine = StringUtils.isBlank(d01ID1) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | int outLine = StringUtils.isBlank(d01Id) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(outLine, d02GoAdress, d05GoAdress); |
| | | computeTargetByLine(outLine); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgOutTask() { |
| | | //任务数据 获取车子存放玻璃最大数量 玻璃间隔 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | //是否有正在钢化的玻璃 |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, TemperingGlassInfo::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfoList)) { |
| | | log.info("有正在出片的钢化任务"); |
| | | //打车剩余尺寸 |
| | | Integer remainWidth = Const.BIG_STORAGE_WIDTH; |
| | | for (TemperingGlassInfo e : temperingGlassInfoList) { |
| | | if (bigStorageCageOutTaskList.size() > 5 || e.getWidth() > remainWidth) { |
| | | break; |
| | | } |
| | | remainWidth = remainWidth - e.getWidth().intValue() - Const.BIG_STORAGE_GAP; |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getState(), Const.A09_OUT_TARGET_POSITION, |
| | | 0, 0, 1)); |
| | | } |
| | | bigStorageCageOutTaskService.saveBatch(bigStorageCageOutTaskList); |
| | | return; |
| | | } |
| | | //todo:是否有人工下片任务 有直接出 |
| | | //笼内是否有人工下片玻璃 无 结束 |
| | | List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL).orderByDesc(BigStorageCageDetails::getWidth)); |
| | | if (CollectionUtils.isEmpty(artificialList)) { |
| | | Integer remainWidth = Const.BIG_STORAGE_WIDTH; |
| | | for (BigStorageCageDetails e : artificialList) { |
| | | if (remainWidth < e.getWidth().intValue()) { |
| | | break; |
| | | } |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), 0, 0, 0, 1)); |
| | | remainWidth = remainWidth - e.getWidth().intValue() - Const.BIG_STORAGE_GAP; |
| | | } |
| | | bigStorageCageOutTaskService.saveBatch(bigStorageCageOutTaskList); |
| | | return; |
| | | } |
| | | |
| | | //钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | | TemperingLayoutDTO temperingLayoutDTO = bigStorageCageDetailsService.temperingIsAll(); |
| | | if (null != temperingLayoutDTO) { |
| | | //玻璃到齐 |
| | | //到齐,将玻璃小片数据存入钢化小片表,逻辑生成出片任务 结束 |
| | | List<BigStorageCageDetails> bigStorageCageDetails = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, temperingLayoutDTO.getTemperingLayoutId()) |
| | | .eq(BigStorageCageDetails::getEngineerId, temperingLayoutDTO.getEngineerId())); |
| | | List<TemperingGlassInfo> temperingGlassInfos = bigStorageCageDetails.stream().map(e -> { |
| | | TemperingGlassInfo info = new TemperingGlassInfo(); |
| | | BeanUtils.copyProperties(e, info); |
| | | return info; |
| | | }).collect(Collectors.toList()); |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | |
| | | //大车剩余尺寸 |
| | | Integer remainWidth = Const.BIG_STORAGE_WIDTH; |
| | | for (TemperingGlassInfo e : temperingGlassInfoList) { |
| | | if (bigStorageCageOutTaskList.size() > 5 || e.getWidth() > remainWidth) { |
| | | break; |
| | | } |
| | | remainWidth = remainWidth - e.getWidth().intValue() - Const.BIG_STORAGE_GAP; |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getState(), Const.A09_OUT_TARGET_POSITION, |
| | | 0, 0, 1)); |
| | | } |
| | | bigStorageCageOutTaskService.saveBatch(bigStorageCageOutTaskList); |
| | | return; |
| | | } |
| | | //未到齐 执行内部调度任务 |
| | | TemperingLayoutDTO temperingOccupySlot = bigStorageCageDetailsService.queryTemperingOccupySlot(); |
| | | if (null != temperingOccupySlot) { |
| | | List<SlotSequenceDTO> slotSequenceList = bigStorageCageDetailsService.queryGlassMaxAndMin(temperingOccupySlot.getEngineerId(), temperingOccupySlot.getTemperingLayoutId()); |
| | | for (int i = 0; i < slotSequenceList.size() - 1; i++) { |
| | | SlotSequenceDTO first = slotSequenceList.get(i); |
| | | SlotSequenceDTO second = slotSequenceList.get(i + 1); |
| | | if (first.getMinSequence() == second.getMaxSequence() + 1 |
| | | && second.getRemainWidth() > Const.BIG_STORAGE_WIDTH - first.getRemainWidth() - Const.BIG_STORAGE_GAP) { |
| | | List<BigStorageCageDetails> list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getSlot, first.getSlot()).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | List<BigStorageCageOutTask> outTasks = list.stream().map(e -> new BigStorageCageOutTask(e.getGlassId(), first.getSlot(), second.getSlot(), |
| | | 0, 0, 1)).collect(Collectors.toList()); |
| | | bigStorageCageOutTaskService.saveBatch(outTasks); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | Assert.isFalse(CollectionUtils.isEmpty(edgGlassTaskInfoList), "识别玻璃信息未出现在尺寸表中,获取相邻两块玻璃失败"); |
| | | //2、获取卧转立剩余宽度 |
| | | Map<String, Object> map = bigStorageCageFeedTaskService.getMap(new QueryWrapper<BigStorageCageFeedTask>() |
| | | .select("cast(5000 - sum(width + 20) as INT)as remainWidth") |
| | | .select("cast(" + Const.BIG_STORAGE_WIDTH + " - sum(width + " + Const.BIG_STORAGE_GAP + ") as INT) as remainWidth") |
| | | .eq("line", line).eq("task_state", Const.BIG_STORAGE_IN_UP)); |
| | | Integer remainWidth = null == map ? 5000 : Integer.parseInt(map.get("remainWidth") + ""); |
| | | Integer remainWidth = null == map ? Const.BIG_STORAGE_WIDTH : Integer.parseInt(map.get("remainWidth") + ""); |
| | | //2、获取卧转立 |
| | | Integer widthFirst = edgGlassTaskInfoList.get(0).getWidth(); |
| | | if (edgGlassTaskInfoList.size() == 1) { |
| | | if (remainWidth >= widthFirst) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst); |
| | | return Boolean.FALSE; |
| | | } else { |
| | | //记录无法放下玻璃,后续判断启动 |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | | Integer widthSecond = edgGlassTaskInfoList.get(1).getWidth(); |
| | | if (remainWidth >= widthFirst) { |
| | | if (remainWidth - widthFirst - Const.BIG_STORAGE_GAP >= widthSecond) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthSecond); |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthSecond); |
| | | } |
| | | return Boolean.FALSE; |
| | | |
| | | } else { |
| | | return Boolean.TRUE; |
| | | Integer widthSecond = edgGlassTaskInfoList.get(1).getWidth(); |
| | | if (remainWidth >= widthFirst) { |
| | | if (remainWidth - widthFirst - Const.BIG_STORAGE_GAP >= widthSecond) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthSecond); |
| | | return Boolean.FALSE; |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthSecond); |
| | | } |
| | | } |
| | | } |
| | | //记录无法放下玻璃,后续判断启动 |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 获取需要启动的线路:两条线都可启动 获取第一片玻璃版图id最小 版序最大的线路 |
| | | * |
| | | * @return |
| | | * @return 需要启动的线路 |
| | | */ |
| | | public Integer getStartLine() { |
| | | List<BigStorageCageFeedTask> taskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | |
| | | /** |
| | | * 计算任务表进片线路的目标格子,并启动任务 |
| | | */ |
| | | public boolean computeTargetByLine(Integer line, String d02GoAdress, String d05GoAdress) { |
| | | public boolean computeTargetByLine(Integer line) { |
| | | //1、获取任务表中的所有玻璃(指定线路且已经进卧转立完成) |
| | | List<BigStorageCageFeedTask> taskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getLine, line) |
| | |
| | | //2、去笼子内查找是否可以继续存放的笼子 |
| | | List<String> glassIds = taskList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()); |
| | | List<GlassInfo> glassInfos = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIds)); |
| | | AtomicReference<Integer> temperingLayoutIdTemp = new AtomicReference<>(0); |
| | | AtomicReference<Integer> temperingFeedSequenceTemp = new AtomicReference<>(0); |
| | | AtomicReference<BigStorageDTO> bigStorageDTO = new AtomicReference<>(new BigStorageDTO()); |
| | | Map<String, GlassInfo> glassInfoMap = glassInfos.stream().collect(Collectors.toMap(GlassInfo::getGlassId, p -> p)); |
| | | |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = new ArrayList<>(); |
| | | AtomicBoolean taskFlag = new AtomicBoolean(Boolean.TRUE); |
| | | taskList.stream().forEach(e -> { |
| | | BigStorageCageDetails cageDetails = new BigStorageCageDetails(); |
| | | //按照版图信息获取进片笼子格子号 |
| | | List<BigStorageCageDetails> temperingList = computeIsTemperingTargetByLine(glassInfos, taskList, Boolean.TRUE); |
| | | List<BigStorageCageDetails> noTemperingList = computeIsTemperingTargetByLine(glassInfos, taskList, Boolean.FALSE); |
| | | bigStorageCageDetailsList.addAll(temperingList); |
| | | bigStorageCageDetailsList.addAll(noTemperingList); |
| | | //4、在详情表中加入进片玻璃信息 |
| | | bigStorageCageDetailsService.saveBatch(bigStorageCageDetailsList); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | /** |
| | | * 是否钢化玻璃进笼目标位置 |
| | | * |
| | | * @param glassInfos 当条线卧转立所有玻璃 |
| | | * @param taskList 当条线卧转立所有任务 |
| | | * @param isTempering true 钢化 false 不钢化 |
| | | */ |
| | | private List<BigStorageCageDetails> computeIsTemperingTargetByLine(List<GlassInfo> glassInfos, List<BigStorageCageFeedTask> taskList, Boolean isTempering) { |
| | | Map<String, GlassInfo> glassInfoMap; |
| | | if (isTempering) { |
| | | glassInfoMap = glassInfos.stream().filter(e -> e.getTemperingLayoutId() != 0) |
| | | .collect(Collectors.toMap(GlassInfo::getGlassId, p -> p)); |
| | | } else { |
| | | glassInfoMap = glassInfos.stream().filter(e -> e.getTemperingLayoutId() == 0) |
| | | .collect(Collectors.toMap(GlassInfo::getGlassId, p -> p)); |
| | | } |
| | | |
| | | //设置临时变量接受版图id,版序、格子号及剩余宽度 |
| | | Integer temperingLayoutIdTemp = 0; |
| | | Integer temperingFeedSequenceTemp = 0; |
| | | BigStorageDTO bigStorageDTO = new BigStorageDTO(); |
| | | |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = new ArrayList<>(); |
| | | for (BigStorageCageFeedTask e : taskList) { |
| | | GlassInfo info = glassInfoMap.get(e.getGlassId()); |
| | | if (info == null) { |
| | | continue; |
| | | } |
| | | BigStorageCageDetails cageDetails = new BigStorageCageDetails(); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | if (temperingLayoutIdTemp.equals(info.getTemperingLayoutId()) |
| | | && temperingFeedSequenceTemp.equals(info.getTemperingFeedSequence() + 1) |
| | | && info.getWidth() <= bigStorageDTO.get().getWidth()) { |
| | | bigStorageDTO.get().setWidth(bigStorageDTO.get().getWidth() - info.getWidth().intValue() - Const.BIG_STORAGE_GAP); |
| | | && info.getWidth() <= bigStorageDTO.getWidth()) { |
| | | bigStorageDTO.setWidth(bigStorageDTO.getWidth() - info.getWidth().intValue() - Const.BIG_STORAGE_GAP); |
| | | } else { |
| | | bigStorageDTO.set(bigStorageCageDetailsService.queryTargetSlotByTempering(info)); |
| | | bigStorageDTO = bigStorageCageDetailsService.queryTargetSlotByTempering(info); |
| | | } |
| | | e.setTargetSlot(bigStorageDTO.get().getSlot()); |
| | | cageDetails.setSlot(bigStorageDTO.get().getSlot()); |
| | | cageDetails.setState(Const.GLASS_STATE_IN); |
| | | temperingLayoutIdTemp.set(info.getTemperingLayoutId()); |
| | | temperingFeedSequenceTemp.set(info.getTemperingFeedSequence()); |
| | | bigStorageCageDetailsList.add(cageDetails); |
| | | taskFlag.set(bigStorageCageFeedTaskService.updateById(e)); |
| | | if (!taskFlag.get()) { |
| | | return; |
| | | } |
| | | }); |
| | | //3、更新进片任务表 遇到问题:无法批量更新,批量更新无法走指定从库 |
| | | |
| | | //4、在详情表中加入进片玻璃信息 |
| | | bigStorageCageDetailsService.saveBatch(bigStorageCageDetailsList); |
| | | if (taskFlag.get()) { |
| | | String lineAddress = line.equals(Const.A09_OUT_TARGET_POSITION) ? d02GoAdress : d05GoAdress; |
| | | // S7object.getinstance().plccontrol.writeWord(lineAddress, (short) 1); |
| | | cageDetails.setSlot(bigStorageDTO.getSlot()); |
| | | cageDetails.setState(Const.GLASS_STATE_IN); |
| | | |
| | | e.setTargetSlot(bigStorageDTO.getSlot()); |
| | | e.setTaskType(Const.BIG_STORAGE_IN_RUN); |
| | | |
| | | temperingLayoutIdTemp = info.getTemperingLayoutId(); |
| | | temperingFeedSequenceTemp = info.getTemperingFeedSequence(); |
| | | //3、更新进片任务表 遇到问题:无法批量更新,批量更新无法走指定从库 |
| | | bigStorageCageFeedTaskService.updateById(e); |
| | | bigStorageCageDetailsList.add(cageDetails); |
| | | } |
| | | return taskFlag.get(); |
| | | return bigStorageCageDetailsList; |
| | | } |
| | | } |
| | |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | mes: |
| | | sequence: |
| | | order: false |
| | | order: false |
| | | minCount: 5 |
| | | slotWidth: 5000 |
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.bigstorage.mapper.BigStorageCageDetailsMapper"> |
| | | |
| | | <resultMap id="temperingLayoutDTO" type="com.mes.bigstorage.entity.dto.TemperingLayoutDTO"> |
| | | <result column="engineer_id" property="engineerId"/> |
| | | <result column="tempering_layout_id" property="temperingLayoutId"/> |
| | | <result column="count" property="count"/> |
| | | <result column="slot_count" property="slotCount"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="slotSequenceDTO" type="com.mes.bigstorage.entity.dto.SlotSequenceDTO"> |
| | | <result column="engineer_id" property="engineerId"/> |
| | | <result column="tempering_layout_id" property="temperingLayoutId"/> |
| | | <result column="slot" property="slot"/> |
| | | <result column="max_sequence" property="maxSequence"/> |
| | | <result column="min_sequence" property="minSequence"/> |
| | | <result column="remain_width" property="remainWidth"/> |
| | | </resultMap> |
| | | |
| | | <select id="temperingIsAll" resultMap="temperingLayoutDTO"> |
| | | SELECT T.ENGINEER_ID, |
| | | T.TEMPERING_LAYOUT_ID, |
| | | COUNT(T.TEMPERING_FEED_SEQUENCE) AS COUNT |
| | | FROM |
| | | GLASS_INFO T |
| | | LEFT JOIN DAMAGE T1 |
| | | ON T.ENGINEER_ID = T1.ENGINEER_ID |
| | | AND T.GLASS_ID = T1.GLASS_ID |
| | | LEFT JOIN BIG_STORAGE_CAGE_DETAILS T2 ON T.ENGINEER_ID = T2.ENGINEER_ID |
| | | AND T.GLASS_ID = T2.GLASS_ID |
| | | WHERE |
| | | T1.GLASS_ID IS NULL |
| | | AND T2.GLASS_ID IS NULL |
| | | AND ( T.ENGINEER_ID |
| | | , T.TEMPERING_LAYOUT_ID ) IN ( SELECT DISTINCT ENGINEER_ID |
| | | , TEMPERING_LAYOUT_ID FROM BIG_STORAGE_CAGE_DETAILS WHERE STATE = 100 ) |
| | | GROUP BY |
| | | T.ENGINEER_ID, |
| | | T.TEMPERING_LAYOUT_ID |
| | | HAVING |
| | | COUNT = 0 |
| | | ORDER BY |
| | | T.TEMPERING_LAYOUT_ID |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="queryTemperingOccupySlot" resultMap="temperingLayoutDTO"> |
| | | SELECT TEMPERING_LAYOUT_ID, |
| | | COUNT(DISTINCT SLOT) as SLOT_COUNT |
| | | FROM BIG_STORAGE_CAGE_DETAILS |
| | | WHERE STATE = 100 |
| | | GROUP BY ENGINEER_ID, |
| | | TEMPERING_LAYOUT_ID |
| | | HAVING SLOT_COUNT >= #{count} LIMIT 1 |
| | | </select> |
| | | <select id="queryGlassMaxAndMin" resultMap="slotSequenceDTO"> |
| | | SELECT T.*, |
| | | T1.REMAIN_WIDTH |
| | | FROM ( |
| | | SELECT ENGINEER_ID, |
| | | TEMPERING_LAYOUT_ID, |
| | | SLOT, |
| | | MAX(TEMPERING_FEED_SEQUENCE) AS MAX_SEQUENCE, |
| | | MIN(TEMPERING_FEED_SEQUENCE) AS MIN_SEQUENCE |
| | | FROM BIG_STORAGE_CAGE_DETAILS |
| | | WHERE ENGINEER_ID = #{engineerId} |
| | | AND TEMPERING_LAYOUT_ID = #{temperingLayoutId} |
| | | GROUP BY ENGINEER_ID, |
| | | TEMPERING_LAYOUT_ID, |
| | | SLOT |
| | | ) T |
| | | INNER JOIN BIG_STORAGE_CAGE T1 ON T.SLOT = T1.SLOT |
| | | ORDER BY T.MAX_SEQUENCE DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | } |
| | | |
| | | @Test |
| | | public void outGlass() { |
| | | log.info("完整路径:{}", bigStorageCageService.outGlass()); |
| | | } |
| | | |
| | | @Test |
| | | public void computeTargetByLine() { |
| | | // log.info("获取大理片笼信息:{}",bigStorageCageService.querybigStorageCageDetail()); |
| | | plcStorageCageTask.computeTargetByLine(2001, "", ""); |
| | |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.mapper.DownGlassTaskMapper; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class DownGlassTaskServiceImpl extends ServiceImpl<DownGlassTaskMapper, DownGlassTask> implements DownGlassTaskService { |
| | | |
| | | |
| | | @Override |
| | | public List<DownGlassTask> getUnloadingTaskState() { |
| | | log.info("出片或直通任务状态为1 的任务"); |
| | | QueryWrapper<DownGlassTask> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("task_stauts", 0).eq("task_type", 2).or().eq("task_stauts", 3); |
| | | queryWrapper.eq("task_stauts", 1).eq("task_type", 2).or().eq("task_type", 3); |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | |
| | | */ |
| | | List<Map<String, Object>> selectDownStorageCages(); |
| | | |
| | | |
| | | /** |
| | | * @return 查询缓存中最多的流程卡 |
| | | */ |
| | | List<DownStorageCageDetails> selectCacheMax(); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | |
| | | return downStorageCageDetailsMapper.selectJoinMaps(JoinWrappers.lambda(DownStorageCageDetails.class) // 使用 JoinWrappers.lambda 创建联合查询 |
| | | .selectAll(DownStorageCageDetails.class) // 选择所有字段 |
| | | .eq(DownStorageCage::getSlot, DownStorageCageDetails::getSlot) // 设置关联条件 |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .orderByAsc(DownStorageCage::getSlot) // 按 slot 字段升序排序 |
| | | ); |
| | | } |
| | |
| | | anotherQueryWrapper.orderByAsc(DownStorageCageDetails::getTemperingLayoutId); |
| | | anotherQueryWrapper.orderByDesc(DownStorageCageDetails::getTemperingFeedSequence); |
| | | anotherQueryWrapper.in(DownStorageCageDetails::getFlowCardId, flowCardIds); |
| | | anotherQueryWrapper.eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN); |
| | | anotherQueryWrapper.last("LIMIT 1"); |
| | | return downStorageCageDetailsMapper.selectList(anotherQueryWrapper); |
| | | } else { |
| | |
| | | LambdaQueryWrapper<DownStorageCageDetails> cageDetailsQueryWrapper = Wrappers.lambdaQuery(); |
| | | cageDetailsQueryWrapper.in(DownStorageCageDetails::getGlassId, glassIds); |
| | | cageDetailsQueryWrapper.in(DownStorageCageDetails::getFlowCardId, flowCardIds); |
| | | cageDetailsQueryWrapper.eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN); |
| | | |
| | | log.info("按照流程卡的版图id 版图片序出"); |
| | | // Step 4: 查询 down_storage_cage_details 表并返回结果 |
| | |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | |
| | | //import com.mes.device.PlcParameterObject; |
| | | import com.google.common.base.Functions; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.sf.jsqlparser.statement.select.SelectItem; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | .select(DownStorageCageDetails::getWidth, DownStorageCageDetails::getHeight, DownStorageCageDetails::getGlassId) |
| | | .leftJoin(DownStorageCageDetails.class, on -> on |
| | | .eq(DownStorageCageDetails::getDeviceId, DownStorageCage::getDeviceId) |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot)) |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | ) |
| | | .isNull(DownStorageCageDetails::getSlot) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> selectCacheMax() { |
| | | return baseMapper.selectJoinList(DownStorageCageDetails.class, |
| | | JoinWrappers.lambda(DownStorageCage.class) |
| | | // 添加 DownStorageCage 的 enableState 为 1 的条件 |
| | | .select(DownStorageCageDetails::getFlowCardId) |
| | | .leftJoin(DownStorageCageDetails.class, on -> on |
| | | .eq(DownStorageCageDetails::getDeviceId, DownStorageCage::getDeviceId) |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(DownStorageCageDetails::getSlot) |
| | | .eq(DownStorageCage::getEnableState, 1) |
| | | .groupBy(DownStorageCageDetails::getFlowCardId) // 根据 flowCardId 分组 |
| | | // 使用子查询和排序来获取相同 FlowCardId 中的最多记录 |
| | | .having("count(*) = (select max(cnt) from (select count(*) as cnt from down_storage_cage_details group by flow_card_id) as temp)") |
| | | |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | .select(DownStorageCageDetails::getGlassId, DownStorageCageDetails::getWidth, DownStorageCageDetails::getHeight, DownStorageCageDetails::getId) |
| | | .leftJoin(DownStorageCageDetails.class, on -> on |
| | | .eq(DownStorageCageDetails::getDeviceId, DownStorageCage::getDeviceId) |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot)) |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | ); |
| | | |
| | | } |
| | |
| | | package com.mes.job; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | |
| | | @Autowired |
| | | DownWorkstationService downWorkstationService; |
| | | @Autowired |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | |
| | | @Autowired |
| | | private DownWorkstationTaskService downWorkstationTaskService; |
| | | |
| | | // @Value("${mes.threshold}") |
| | | // @Value("${mes.threshold}") |
| | | private int threshold; |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void autoBindRack() { |
| | | log.info("根据缓存中已经进片的玻璃种数量最多的流程卡号自动绑定一个启用状态的空架子"); |
| | | |
| | | List<DownStorageCageDetails> Details = downStorageCageService.selectCacheMax(); |
| | | if (Details.size() > 0) { |
| | | DownStorageCageDetails downStorageCageDetails = Details.get(0); |
| | | String flowCardId = downStorageCageDetails.getFlowCardId(); |
| | | int glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId); |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, null)); |
| | | List<DownWorkstation> downWorkstations = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getEnableState, 1)); |
| | | |
| | | if (!downWorkstations.stream().anyMatch(workstation -> workstation.getFlowCardId().equals(flowCardId))) { |
| | | downWorkstationService.updateFlowCardIdAndCount(flowCardId, glassInfoCount, downWorkstation.getWorkstationId()); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void plcdownGlassTask() { |
| | | // PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | // PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | // String taskRequestTypeValue = plcParameterObject.getPlcParameter("A06_request_word").getValue(); |
| | | // String glassIdeValue = plcParameterObject.getPlcParameter("A05_scanning_ID").getValue(); |
| | | // String confirmationWrodValue = plcParameterObject.getPlcParameter("MES_confirmation_word").getValue(); |
| | | // String outGlassstate = plcParameterObject.getPlcParameter("A09_glass_status").getValue(); |
| | | // String confirmationWrodAddress = plcParameterObject.getPlcParameter("MES_confirmation_word").getAddress(); |
| | | // String G06RobotTaskRequestWord = plcParameterObject.getPlcParameter("G06RobotTaskRequestWord").getAddress(); |
| | | // String MESSendingWord = plcParameterObject.getPlcParameter("MES_confirmation_word").getAddress(); |
| | | // String G06RobotTaskRequestWord = plcParameterObject.getPlcParameter("G06RobotTaskRequestWord").getAddress(); |
| | | |
| | | |
| | | String taskRequestTypeValue ="0"; |
| | | String glassIdeValue ="NG24041101C002-2-6-1-6"; |
| | | String confirmationWrodValue ="1"; |
| | | String outGlassstate="1"; |
| | | String confirmationWrodAddress="1"; |
| | | String G11RobotTaskRequestWord ="0"; |
| | | String G06RobotTaskRequestWord ="0"; |
| | | String G13RobotTaskRequestWord ="0"; |
| | | String taskRequestTypeValue = "0"; |
| | | String glassIdeValue = "NG24041101C002-2-6-1-6"; |
| | | String confirmationWrodValue = "1"; |
| | | String outGlassstate = "1"; |
| | | String MESSendingWord = "1"; |
| | | String G11RobotTaskRequestWord = "0"; |
| | | String G06RobotTaskRequestWord = "0"; |
| | | String G13RobotTaskRequestWord = "0"; |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态为:{}", |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态为:{}", |
| | | taskRequestTypeValue, glassIdeValue, confirmationWrodValue, outGlassstate); |
| | | |
| | | // if ("0".equals(taskRequestTypeValue)) { |
| | |
| | | // return; |
| | | // } |
| | | // log.info("2、获取到的请求字为0,将确认字改为0"); |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 0); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 0); |
| | | // return; |
| | | // } |
| | | // if (!"0".equals(confirmationWrodValue)) { |
| | | // log.info("2、获取到的请求字不为0,将确认字改为0"); |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 0); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 0); |
| | | // return; |
| | | // } |
| | | |
| | | if ("1".equals(taskRequestTypeValue)) { |
| | | log.info("3、进片请求,且确认字为0,执行进片任务"); |
| | | inTo(glassIdeValue, confirmationWrodAddress); |
| | | inTo(glassIdeValue, MESSendingWord); |
| | | } else if ("2".equals(taskRequestTypeValue)) { |
| | | |
| | | log.info("3、出片请求,且确认字为0,执行进片任务"); |
| | | outTo( confirmationWrodAddress); |
| | | outTo(MESSendingWord); |
| | | |
| | | } else if ("3".equals(taskRequestTypeValue)) { |
| | | log.info("3、进片和出片都空闲,执行出片任务"); |
| | | if (outTo(confirmationWrodAddress)) { |
| | | inTo(glassIdeValue, confirmationWrodAddress); |
| | | if (outTo(MESSendingWord)) { |
| | | inTo(glassIdeValue, MESSendingWord); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | if (("1".equals(G11RobotTaskRequestWord) || "1".equals(G06RobotTaskRequestWord)) || "1".equals(G13RobotTaskRequestWord)) { |
| | | if (("1".equals(G11RobotTaskRequestWord) || "1".equals(G06RobotTaskRequestWord)) || "1".equals(G13RobotTaskRequestWord)) { |
| | | log.info("4、有机器人下片请求,执行下片任务"); |
| | | insertdownglassinfo(); |
| | | } |
| | |
| | | //自动绑定架子,如果工位表没有绑定架子,默认将笼子中数量最多的流程卡号绑定机器手2的空架子 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 进片任务 |
| | | * |
| | | * @param glassId |
| | | * @param confirmationWrodAddress |
| | | * @param MESSendingWord |
| | | * @param |
| | | */ |
| | | private void inTo(String glassId, String confirmationWrodAddress) { |
| | | private void inTo(String glassId, String MESSendingWord) { |
| | | log.info("1、按照玻璃id:{}获取玻璃小片信息", glassId); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | if (glassInfo == null) { |
| | |
| | | } |
| | | log.info("2、获取到的玻璃信息为{}", glassInfo); |
| | | |
| | | if (glassInfo.getGlassId().equals(downStorageCageDetailsService.DirectConnection()) ) { |
| | | if (glassInfo.getGlassId().equals(downStorageCageDetailsService.DirectConnection())) { |
| | | //直通 |
| | | log.info("3、如果当前玻璃属于版图id和片序的顺序则直通,执行下片任务"); |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, glassInfo.getFlowCardId())); |
| | | int WorkstationId=downWorkstation.getWorkstationId(); |
| | | int WorkstationId = downWorkstation.getWorkstationId(); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, "0", String.valueOf(WorkstationId), "3"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | }else{ |
| | | } else { |
| | | |
| | | log.info("4、如果不属于版图id和片序的顺序执行进片任务"); |
| | | //添加进片任务 查找空格 |
| | | List<DownStorageCageDetails> list = downStorageCageService.selectCacheEmpty(); |
| | | if(list.size()>0){ |
| | | DownStorageCageDetails item = list.get(0); |
| | | //添加进片任务 查找空格 |
| | | List<DownStorageCageDetails> list = downStorageCageService.selectCacheEmpty(); |
| | | if (list.size() > 0) { |
| | | DownStorageCageDetails item = list.get(0); |
| | | |
| | | |
| | | log.info("5、查询卧式理片笼里面的空格:{}", list); |
| | | log.info("6、将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | DownStorageCageDetails details = new DownStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, details); |
| | | details.setState(Const.GLASS_STATE_IN); |
| | | details.setGlassId(glassInfo.getGlassId()); |
| | | details.setSlot(item.getSlot()); |
| | | details.setDeviceId(item.getDeviceId()); |
| | | downStorageCageDetailsService.save(details); |
| | | log.info("7、玻璃信息已存入理片笼详情表,玻璃信息为{}", details); |
| | | |
| | | log.info("5、查询卧式理片笼里面的空格:{}", list); |
| | | log.info("6、将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | DownStorageCageDetails details = new DownStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, details); |
| | | details.setState(1); |
| | | details.setGlassId(glassInfo.getGlassId()); |
| | | details.setSlot(item.getSlot()); |
| | | details.setDeviceId(item.getDeviceId()); |
| | | downStorageCageDetailsService.save(details); |
| | | log.info("7、玻璃信息已存入理片笼详情表,玻璃信息为{}", details); |
| | | |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, "0", item.getSlot() + "", "1"); |
| | | //添加进片任务 |
| | | log.info("8、生成进片任务信息存入任务表{}", downGlassTask); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | } |
| | | |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, "0", item.getSlot() + "", "1"); |
| | | //添加进片任务 |
| | | log.info("8、生成进片任务信息存入任务表{}", downGlassTask); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | } |
| | | |
| | | |
| | | } |
| | | log.info("9、发送确认字完成"); |
| | | //S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 1); |
| | | //S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 1); |
| | | } |
| | | |
| | | /** |
| | | * 出片任务 |
| | | * |
| | | * @param confirmationWrodAddress |
| | | * |
| | | * @param MESSendingWord |
| | | */ |
| | | private Boolean outTo( String confirmationWrodAddress) { |
| | | private Boolean outTo(String MESSendingWord) { |
| | | log.info("单片情况根据传入的料架号 查询符合按照版图id和片序出片,并且优先出满架的小片"); |
| | | List<DownStorageCageDetails> list = downStorageCageDetailsService.CacheOut1(1,3); |
| | | |
| | | List<DownStorageCageDetails> list2 = downStorageCageDetailsService.CacheOut1(4,6); |
| | | List<DownStorageCageDetails> list1to3 = downStorageCageDetailsService.CacheOut1(1, 3); |
| | | List<DownStorageCageDetails> list4to6 = downStorageCageDetailsService.CacheOut1(4, 6); |
| | | List<DownStorageCageDetails> list1to6 = downStorageCageDetailsService.CacheOut1(1, 6); |
| | | |
| | | List<DownStorageCageDetails> list3 = downStorageCageDetailsService.CacheOut1(1,6); |
| | | DownStorageCageDetails selectedItem = null; |
| | | |
| | | String endCell = ""; |
| | | |
| | | // 优先 超出尺寸优先人工出片 人工处理 |
| | | if (!list3.isEmpty()) { |
| | | |
| | | DownStorageCageDetails item3 = list3.get(0); |
| | | if (!list1to6.isEmpty()) { |
| | | DownStorageCageDetails item3 = list1to6.get(0); |
| | | if (item3.getHeight() >= 2500 && item3.getWidth() >= 2660) { |
| | | log.info("人工处理"); |
| | | String endcell = "7"; |
| | | |
| | | |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(item3, "9", endcell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 2); |
| | | |
| | | return true; |
| | | } |
| | | else if (!list2.isEmpty() && !list3.isEmpty()) { |
| | | selectedItem = item3; |
| | | endCell = "7"; |
| | | } else if (!list4to6.isEmpty() && !list1to6.isEmpty()) { |
| | | log.info("前后端都空闲 优先后端出片并且优先满架"); |
| | | DownStorageCageDetails item4 = list2.get(0); |
| | | |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, item4.getFlowCardId())); |
| | | String endcell = String.valueOf(downWorkstation.getWorkstationId()); |
| | | |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(item4, "9", endcell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | //S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 2); |
| | | |
| | | return true; |
| | | |
| | | } |
| | | // 按照版图id和片序符合前端出片 |
| | | else if (!list.isEmpty()) { |
| | | log.info("前端出片"); |
| | | DownStorageCageDetails item = list.get(0); |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, item.getFlowCardId())); |
| | | String endcell = String.valueOf(downWorkstation.getWorkstationId()); |
| | | // 出到 G06 |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(item, "9", endcell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 2); |
| | | |
| | | |
| | | return true; |
| | | // 按照版图id和片序符合后端出片 |
| | | } else if (!list2.isEmpty()) { |
| | | log.info("后端出片"); |
| | | DownStorageCageDetails item2 = list2.get(0); |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, item2.getFlowCardId())); |
| | | String endcell = String.valueOf(downWorkstation.getWorkstationId()); |
| | | // 出到 G11 |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(item2, "9", endcell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 2); |
| | | return true; |
| | | selectedItem = list4to6.get(0); |
| | | } |
| | | } |
| | | //如果同时前后端都空闲 优先后端出片并且优先满架 |
| | | |
| | | // 按照版图id和片序符合前端出片 |
| | | if (selectedItem == null && !list1to3.isEmpty()) { |
| | | log.info("前端出片"); |
| | | selectedItem = list1to3.get(0); |
| | | } |
| | | |
| | | // 按照版图id和片序符合后端出片 |
| | | if (selectedItem == null && !list4to6.isEmpty()) { |
| | | log.info("后端出片"); |
| | | selectedItem = list4to6.get(0); |
| | | } |
| | | |
| | | if (selectedItem != null) { |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne( |
| | | new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getFlowCardId, selectedItem.getFlowCardId()) |
| | | ); |
| | | endCell = String.valueOf(downWorkstation.getWorkstationId()); |
| | | if (endCell.isEmpty()) { |
| | | endCell = "7"; |
| | | } |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(selectedItem, "9", endCell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | LambdaQueryWrapper<DownStorageCageDetails> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(DownStorageCageDetails::getGlassId, selectedItem.getGlassId()); |
| | | DownStorageCageDetails updateDetail = new DownStorageCageDetails(); |
| | | updateDetail.setState(Const.GLASS_STATE_OUT); |
| | | downStorageCageDetailsService.update(updateDetail, wrapper); |
| | | log.info("更新出片玻璃的状态为{}", Const.GLASS_STATE_OUT); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 2); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | // 返回结果 |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // |
| | | // |
| | | public void insertdownglassinfo() { |
| | | try { |
| | | |
| | | List<DownGlassTask> taskdownGlassInf = downGlassTaskService.getUnloadingTaskState(); |
| | | if (taskdownGlassInf != null && !taskdownGlassInf.isEmpty()) { |
| | | List<DownGlassTask> taskdownGlassInf = downGlassTaskService.getUnloadingTaskState(); |
| | | if (taskdownGlassInf != null && !taskdownGlassInf.isEmpty()) { |
| | | |
| | | for (DownGlassTask downGlassInfo : taskdownGlassInf) { |
| | | // 创建新的 DownGlassInfo 对象并设置相关属性 |
| | | DownGlassInfo newdownGlassInfo = new DownGlassInfo(); |
| | | for (DownGlassTask downGlassInfo : taskdownGlassInf) { |
| | | // 创建新的 DownGlassInfo 对象并设置相关属性 |
| | | DownGlassInfo newdownGlassInfo = new DownGlassInfo(); |
| | | |
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId()); |
| | | // 初始化顺序字段值 |
| | | int sequence = maxSequence != null ? maxSequence + 1 : 1; |
| | | BeanUtils.copyProperties(downGlassInfo, newdownGlassInfo); |
| | | // 设置顺序字段值 |
| | | newdownGlassInfo.setSequence(sequence); |
| | | // 插入数据到下片玻璃信息表 |
| | | downGlassInfoService.insertDownGlassInfo(newdownGlassInfo); |
| | | log.info("插入数据到下片玻璃信息表"); |
| | | DownWorkstation downWorkstation1 = downWorkstationService.selectByFlowCardId(downGlassInfo.getFlowCardId()); |
| | | downWorkstationService.updateracksnumber(downGlassInfo.getFlowCardId(), downWorkstation1.getRacksnumber() + 1); |
| | | log.info("更新落架数量"); |
| | | sequence++; // 递增顺序字段值 |
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId()); |
| | | // 初始化顺序字段值 |
| | | int sequence = maxSequence != null ? maxSequence + 1 : 1; |
| | | BeanUtils.copyProperties(downGlassInfo, newdownGlassInfo); |
| | | // 设置顺序字段值 |
| | | newdownGlassInfo.setSequence(sequence); |
| | | // 插入数据到下片玻璃信息表 |
| | | downGlassInfoService.insertDownGlassInfo(newdownGlassInfo); |
| | | log.info("插入数据到下片玻璃信息表"); |
| | | DownWorkstation downWorkstation1 = downWorkstationService.selectByFlowCardId(downGlassInfo.getFlowCardId()); |
| | | downWorkstationService.updateracksnumber(downGlassInfo.getFlowCardId(), downWorkstation1.getRacksnumber() + 1); |
| | | log.info("更新落架数量"); |
| | | LambdaQueryWrapper<DownGlassTask> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(DownGlassTask::getGlassId, newdownGlassInfo.getGlassId()); |
| | | DownGlassTask updateDetail = new DownGlassTask(); |
| | | updateDetail.setTaskStauts(2); |
| | | downGlassTaskService.update(updateDetail, wrapper); |
| | | sequence++; // 递增顺序字段值 |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | // 打印异常信息 |
| | | e.printStackTrace(); |
| | |
| | | {
|
| | | "plcAddressBegin": "DB100.0",
|
| | | "plcAddressLenght": "142",
|
| | | "plcAddressLenght": "230",
|
| | | "dataType": "word",
|
| | | "parameteInfor": [
|
| | | {
|
| | |
| | | },
|
| | | {
|
| | | "codeId": "G04ID",
|
| | | "addressIndex": "2",
|
| | | "addressLenght": "2"
|
| | | "addressIndex": "30",
|
| | | "addressLenght": "30"
|
| | | },
|
| | | {
|
| | | "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",
|
| | | "codeId": "G06ID",
|
| | | "addressIndex": "62",
|
| | | "addressLenght": "2"
|
| | | "addressLenght": "30"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm2",
|
| | | "codeId": "G11RobotTaskRequestWord",
|
| | | "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",
|
| | | "codeId": "G011ID",
|
| | | "addressIndex": "94",
|
| | | "addressLenght": "2"
|
| | | "addressLenght": "30"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | |
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04ActionState",
|
| | | "codeId": "spare",
|
| | | "addressIndex": "102",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05ActionState",
|
| | | "codeId": "MESSendingWord",
|
| | | "addressIndex": "104",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06ActionState",
|
| | | "codeId": "InputGrid",
|
| | | "addressIndex": "106",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G07ActionState",
|
| | | "codeId": "OutputGrid",
|
| | | "addressIndex": "108",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08ActionState",
|
| | | "codeId": "OutputID",
|
| | | "addressIndex": "110",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09ActionState",
|
| | | "codeId": "FrontOrRearLowerSlice",
|
| | | "addressIndex": "112",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10ActionState",
|
| | | "codeId": "spare",
|
| | | "addressIndex": "114",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11ActionState",
|
| | | "codeId": "G06RobotTaskReply",
|
| | | "addressIndex": "116",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G12ActionState",
|
| | | "codeId": "G06Rack",
|
| | | "addressIndex": "118",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13ActionState",
|
| | | "codeId": "G11RobotTaskReply",
|
| | | "addressIndex": "120",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04IDS",
|
| | | "codeId": "G11Rack",
|
| | | "addressIndex": "122",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05IDS",
|
| | | "codeId": "spare",
|
| | | "addressIndex": "124",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06IDS",
|
| | | "codeId": "spare",
|
| | | "addressIndex": "126",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G07IDS",
|
| | | "codeId": "spare",
|
| | | "addressIndex": "128",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08IDS",
|
| | | "codeId": "spare",
|
| | | "addressIndex": "130",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09IDS",
|
| | | "codeId": "spare",
|
| | | "addressIndex": "132",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10IDS",
|
| | | "codeId": "spare",
|
| | | "addressIndex": "134",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11IDS",
|
| | | "codeId": "spare",
|
| | | "addressIndex": "136",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G12IDS",
|
| | | "codeId": "spare",
|
| | | "addressIndex": "138",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13ID",
|
| | | "codeId": "MESTaskState",
|
| | | "addressIndex": "140",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "142",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "AlarmState",
|
| | | "addressIndex": "144",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm1",
|
| | | "addressIndex": "146",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm2",
|
| | | "addressIndex": "148",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm3",
|
| | | "addressIndex": "150",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm4",
|
| | | "addressIndex": "152",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "neirong",
|
| | | "addressIndex": "154",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "device",
|
| | | "addressIndex": "156",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "158",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "160",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut1",
|
| | | "addressIndex": "162",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut2",
|
| | | "addressIndex": "164",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut3",
|
| | | "addressIndex": "166",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut4",
|
| | | "addressIndex": "168",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut5",
|
| | | "addressIndex": "170",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut6",
|
| | | "addressIndex": "172",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut7",
|
| | | "addressIndex": "174",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "176",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "178",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "180",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "182",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "184",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04ActionState",
|
| | | "addressIndex": "186",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05ActionState",
|
| | | "addressIndex": "190",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06ActionState",
|
| | | "addressIndex": "192",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G07ActionState",
|
| | | "addressIndex": "194",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08ActionState",
|
| | | "addressIndex": "196",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09ActionState",
|
| | | "addressIndex": "200",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10ActionState",
|
| | | "addressIndex": "202",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11ActionState",
|
| | | "addressIndex": "204",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G12ActionState",
|
| | | "addressIndex": "206",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13ActionState",
|
| | | "addressIndex": "208",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04IDS",
|
| | | "addressIndex": "210",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05IDS",
|
| | | "addressIndex": "212",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06IDS",
|
| | | "addressIndex": "214",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G07IDS",
|
| | | "addressIndex": "216",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08IDS",
|
| | | "addressIndex": "218",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09IDS",
|
| | | "addressIndex": "220",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10IDS",
|
| | | "addressIndex": "222",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11IDS",
|
| | | "addressIndex": "224",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G12IDS",
|
| | | "addressIndex": "226",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13ID",
|
| | | "addressIndex": "230",
|
| | | "addressLenght": "2"
|
| | | }
|
| | | ]
|
| | | } |