Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
| | |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 报工管理 ----------------*/ |
| | | { |
| | | path: 'reportWork', |
| | | name: 'reportWork', |
| | | component: () => import('../views/ReportWork/reportWork.vue'), |
| | | children:[ |
| | | { |
| | | path: '/ReportWork/reportWork', |
| | | name: 'reportWork', |
| | | component: () => import('../views/ReportWork/reportWork.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 管理系统 ----------------*/ |
| | | { |
| | | path: 'sys', |
| | |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | backgroundColor: rect.state === 0 ? '#dedfe0' : '#d1edc4' }"> |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }"> |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | backgroundColor: rect.state === 4 ? '#d1edc4' : '#f8e3c5' }"> |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
New file |
| | |
| | | <template> |
| | | <div style="height: 600px;"> |
| | | <span class="demonstration">生产时间</span> |
| | | <el-date-picker v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" |
| | | start-placeholder="开始时间" end-placeholder="结束时间" :default-time="defaultTime" /> |
| | | <el-select v-model="report.type" placeholder="清选择类型"> |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="完工" value="1"></el-option> |
| | | <el-option label="破损" value="2"></el-option> |
| | | <el-option label="拿走" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.status" placeholder="清选择状态"> |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="未报工" value="1"></el-option> |
| | | <el-option label="待报工" value="2"></el-option> |
| | | <el-option label="已报工" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.workProcedure" placeholder="清选择工序"> |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="切割" value="1"></el-option> |
| | | <el-option label="磨边" value="2"></el-option> |
| | | <el-option label="钢化" value="3"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" @click="selectReportData()">查询</el-button> |
| | | <el-button type="success">报工</el-button> |
| | | <el-table height="100%" ref="table" :data="reportData" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="reportData.line" align="center" label="线路" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="工序" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="玻璃id" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="钢化版图id" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="生产时间" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="备注" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="类型" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="状态" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="流程卡" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="序号" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="层" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="破损类型" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="破损原因" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任工序" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任人员" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任班组" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任设备" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="报工班组" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="报工设备" min-width="120" /> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect } from "vue"; |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | const report = ref({ |
| | | type: '', |
| | | status: '', |
| | | workProcedure: '', |
| | | }); |
| | | const reportData = ref([]) |
| | | const timeRange = ref([new Date(2000, 10, 10), new Date(2200, 10, 11)]) |
| | | |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | console.log(timeRange.value[0]) |
| | | const response = await request.post("/loadGlass/damage/selectDamage", { |
| | | startTime: timeRange.value[0], |
| | | endTime: timeRange.value[1], |
| | | type: report.value.type, |
| | | status: report.value.status, |
| | | workProcedure: report.value.workProcedure, |
| | | }) |
| | | if (response.code === 200) { |
| | | reportData.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | const handleMessage = (data) => { |
| | | // adjustedRects.value = data.device[0].map(rect => ({ |
| | | // ...rect, |
| | | // completed: rect.completedQuantity, |
| | | // breakage: rect.breakageQuantity, |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | }; |
| | | let socket; |
| | | onMounted(() => { |
| | | socket = new WebSocket(socketUrl); |
| | | socket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | |
| | | // updateCharts(); |
| | | }; |
| | | // }; |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | |
| | | const currentPage = ref(1); |
| | | const itemsPerPage = computed(() => { |
| | | if (currentPage.value === 1) { |
| | | return 21; |
| | | return 55; |
| | | } else if (currentPage.value === 2) { |
| | | return 21; |
| | | return 55; |
| | | } else if (currentPage.value === 3) { |
| | | return 21; |
| | | return 55; |
| | | } else if (currentPage.value === 4) { |
| | | return 20; |
| | | return 55; |
| | | } else if (currentPage.value === 5) { |
| | | return 21; |
| | | return 55; |
| | | } else if (currentPage.value === 6) { |
| | | return 25; |
| | | } else if (currentPage.value === 7) { |
| | | return 51; |
| | | return 30; |
| | | } else if (currentPage.value === 8) { |
| | | return 25; |
| | | } else { |
| | |
| | | let index = 0; |
| | | for (let i = 1; i < currentPage.value; i++) { |
| | | if (i === 1) { |
| | | index += 21; |
| | | index += 55; |
| | | } else if (i === 2) { |
| | | index += 21; |
| | | index += 55; |
| | | } else if (i === 3) { |
| | | index += 21; |
| | | index += 55; |
| | | }else if (i === 4) { |
| | | index += 20; |
| | | index += 55; |
| | | }else if (i === 5) { |
| | | index += 21; |
| | | index += 55; |
| | | }else if (i === 6) { |
| | | index += 25; |
| | | }else if (i === 7) { |
| | | index += 51; |
| | | index += 30; |
| | | }else if (i === 8) { |
| | | index += 25; |
| | | } else { |
| | |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | if(data.bigStorageCageDetailsOutTask!=null){ |
| | | tableDatac.value = data.bigStorageCageDetailsOutTask[0] |
| | | adjusta.value = data.bigStorageCageDetailsOutTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | } |
| | | if(data.bigStorageCageDetailsFeedTask!=null){ |
| | | tableDatad.value = data.bigStorageCageDetailsFeedTask[0] |
| | | adjust.value = data.bigStorageCageDetailsFeedTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | } |
| | | |
| | | // adjust.value = data.bigStorageCageDetailsFeedTask[0].map(rect => ({ |
| | | // ...rect, |
| | | // })); |
| | | adjusta.value = data.bigStorageCageDetailsOutTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | adjust.value = data.bigStorageCageDetailsFeedTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | |
| | | // const adjust = computed(() => { |
| | | // return data.value.bigStorageCageDetailsFeedTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | // }); |
| | | if(data.bigStorageCageInfo!=null){ |
| | | tableData.value = data.bigStorageCageInfo[0] |
| | | } |
| | | if(data.temperingGlassInfoList!=null){ |
| | | tableDatab.value = data.temperingGlassInfoList[0] |
| | | } |
| | | if(data.bigStorageCageUsage!=null){ |
| | | tableDatae.value = data.bigStorageCageUsage[0] |
| | | } |
| | | if(data.carPostion!=null){ |
| | | carPosition.value = data.carPostion[0] |
| | | } |
| | | |
| | | |
| | | if(data.bigStorageCageInfos!=null){ |
| | | window.localStorage.setItem('length', data.bigStorageCageInfos[0][1].length) |
| | | let length = window.localStorage.getItem('length') |
| | | adjustedRects.value = data.bigStorageCageInfos[0][1].map(rect => ({ |
| | |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | } |
| | | |
| | | |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</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" |
| | | <el-table height="100px" ref="table" |
| | | :data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="bigStorageCageOutTask.glassId" align="center" :label="$t('searchOrder.outputglassID')" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageOutTask.startSlot" align="center" :label="$t('searchOrder.startposition')" min-width="120" /> |
| | |
| | | </el-card> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 3px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <el-table height="100%" ref="table" |
| | | <el-table height="100px" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="bigStorageCageFeedTask.glassId" align="center" :label="$t('searchOrder.intoglassid')" min-width="120" /> |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <div style="padding: 10px;display: flex;height:110px;"> |
| | | <div style="padding: 10px;display: flex;height:130px;"> |
| | | <div v-for="(item, index) in tableDatae" :key="index" id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#{{ item.device_id }}</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | |
| | | </div> |
| | | <!-- // 父级框 --> |
| | | <div class="img-dlpl" > |
| | | <div class="img-car1" :style="'z-index:999;left:247px;top:' + 350*carPosition[0] + 'px;position:absolute;'"> |
| | | <div class="img-car1" :style="'z-index:999;left:270px;top:' + 350*carPosition[0] + 'px;position:absolute;'"> |
| | | <div |
| | | v-for="(rect, index) in adjusta" |
| | | :key="rect.id" |
| | |
| | | width: '30px', |
| | | height: '5px', |
| | | backgroundColor: '#409EFF', |
| | | marginLeft: index * 5+ `px`, |
| | | marginLeft: 5+ `px`, |
| | | top: '10px', |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | <div class="img-car4" :style="'z-index:999;left:704px;top:' + 350*carPosition[1] + 'px;position:absolute;'"> |
| | | <div class="img-car4" :style="'z-index:999;left:740px;top:' + 350*carPosition[1] + 'px;position:absolute;'"> |
| | | <div |
| | | v-for="(rect, index) in adjust" |
| | | :key="rect.id" |
| | |
| | | width: '30px', |
| | | height: '5px', |
| | | backgroundColor: '#409EFF', |
| | | marginLeft: index * 5+ `px`, |
| | | marginLeft: 5+ `px`, |
| | | top: '10px', |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | <div style="position: relative;"> |
| | | <div v-show="cell1" style="width: 227px;height: 29px;position: relative;top:55px;left: 465px;"> |
| | | <div v-show="cell1" style="width: 227px;height: 29px;position: relative;top:50px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="rect" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell2" style="width: 227px;height: 29px;position: relative;top:56px;left: 465px;"> |
| | | <div v-show="cell2" style="width: 227px;height: 29px;position: relative;top:51px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsa" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:117px;left: 465px;"> |
| | | <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:110px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsb" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:148px;left: 465px;"> |
| | | <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:140px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsc" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:208px;left: 465px;"> |
| | | <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:170px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsd" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:238px;left: 465px;"> |
| | | <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:241px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectse" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:269px;left: 465px;"> |
| | | <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:271px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsf" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;"> |
| | | <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:301px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsg" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell9" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;"> |
| | | <div v-show="cell9" style="width: 227px;height: 29px;position: absolute;top:332px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsh" |
| | | :key="rect.id" |
| | |
| | | <el-button type="primary" plain style="margin-left: 10px;" @click="searchout">{{ $t('searchOrder.search') }}</el-button> |
| | | </div> |
| | | |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 500px;"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 200px;"> |
| | | <el-table height="100%" ref="table" |
| | | :data="tableDataf" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120" /> |
| | |
| | | } |
| | | |
| | | .img-dlpl{ |
| | | margin-left: 80px; |
| | | background-image:url('../../assets/dlpl.png'); |
| | | margin-left: 20px; |
| | | margin-top: 20px; |
| | | background-image:url('../../assets/dlpl9.png'); |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | | min-height: 400px; |
| | |
| | | } |
| | | .img-car1{ |
| | | display: flex; |
| | | background-image:url('../../assets/lp.png'); |
| | | background-image:url('../../assets/lp9.png'); |
| | | position: absolute; |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | |
| | | } |
| | | .img-car4{ |
| | | display: flex; |
| | | background-image:url('../../assets/lpa.png'); |
| | | background-image:url('../../assets/lpa9.png'); |
| | | position: absolute; |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | |
| | | <template> |
| | | <div class="glass-rack"> |
| | | <div > |
| | | <svg width="500" height="500" xmlns="http://www.w3.org/2000/svg"> |
| | | <svg width="500" height="370" xmlns="http://www.w3.org/2000/svg"> |
| | | <g stroke="null" id="Layer_1"> |
| | | <!-- 使用 v-for 循环渲染数据 --> |
| | | <g v-for="(rack, index) in racks" :key="index" :data="tableData"> |
| | |
| | | import { initializeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost } from '@/utils/constants'; |
| | | const racks = ref([ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: '',downGlassInfoList:"" } }, |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456',downGlassInfoList:"" } }, |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: '',downGlassInfoList:"" } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678',downGlassInfoList:"" } }, |
| | | |
| | | { x: 140, y: 320, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: '' ,downGlassInfoList:""} } |
| | | { x: 140, y: 280, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' ,downGlassInfoList:""} } |
| | | |
| | | ]); |
| | | |
| | |
| | | <template> |
| | | <div class="glass-rack"> |
| | | <div > |
| | | <svg width="500" height="500" xmlns="http://www.w3.org/2000/svg"> |
| | | <svg width="500" height="370" xmlns="http://www.w3.org/2000/svg"> |
| | | <g stroke="null" id="Layer_1"> |
| | | <!-- 使用 v-for 循环渲染数据 --> |
| | | <g v-for="(rack, index) in racks" :key="index"> |
| | |
| | | import { initializeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | const racks = ref([ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: '' } }, |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: '' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | |
| | | { x: 140, y: 320, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: '' } } |
| | | { x: 140, y: 280, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | |
| | | ]); |
| | | |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive, onMounted, onBeforeUnmount} from "vue"; |
| | | |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | |
| | | fetchFlowCardId(); |
| | | dialogFormVisiblea.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | |
| | | //获取流程卡号 |
| | | const fetchFlowCardId = async () => { |
| | | try { |
| | |
| | | } |
| | | }; |
| | | //确认 |
| | | |
| | | const handleConfirm = async () => { |
| | | try { |
| | | const firstPart = flowCardId.value.split('|')[0].trim(); // |
| | |
| | | workstationId: workstationId.value, |
| | | flowCardId: firstPart, |
| | | layer:twoPart |
| | | |
| | | }); |
| | | |
| | | console.log(response) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | |
| | | console.error(error); |
| | | } |
| | | }; |
| | | |
| | | |
| | | const updatePageData = () => { |
| | | // 假设你的页面上有一个名为 tableData 的 Vue 组件 |
| | | // 你可以直接更新 tableData 的数据 |
| | | fetchTableData() |
| | | // 使用 $forceUpdate() 强制更新组件 |
| | | |
| | | }; |
| | | |
| | | const handleBindRack2 = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | dialogFormVisiblea2.value = true; // 打开绑定架子对话框 |
| | |
| | | dialogFormVisiblea2.value = false; |
| | | } |
| | | }; |
| | | |
| | | |
| | | // 发送获取表格数据的请求 |
| | | const fetchTableData = async () => { |
| | | try { |
| | |
| | | ElMessage.error('获取表格数据失败,请重试'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | |
| | | // 更新 tableData 的数据 |
| | | |
| | | tableData.splice(0, tableData.length, ...data.params[0]); |
| | | // console.log("更新后数据", data.params[0]); |
| | | |
| | | }; |
| | | |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | |
| | | onMounted(() => { |
| | | fetchFlowCardId(); |
| | | fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | const getTagType =(status) => { |
| | | return status === 1 ? 'success' : 'danger'; |
| | | // 根据状态值决定标签类型,这里假设状态为1时为成功(绿色),否则为失败(红色) |
| | | } |
| | | |
| | | const toggleStatus = (row) => { |
| | | // 切换料架状态的逻辑 |
| | | row.enableState = 1 - row.enableState; // Toggle between 0 and 1 |
| | | // 此处可以添加保存状态的逻辑,比如调用 API 更新数据 |
| | | updateRowStatus(row); |
| | | }; |
| | | |
| | | const updateRowStatus = async (row) => { |
| | | try { |
| | | // 假设你的后端 API 接收 PUT 请求,并且需要传递 row.id 和 row.enableState 参数 |
| | | |
| | | |
| | | const response = await request.post('unLoadGlass/downWorkStation/updateDownWorkstation', { |
| | | enableState:row.enableState, |
| | | id:row.id |
| | | }); |
| | | console.log('Updated row status:', response.data); |
| | | // 可以根据后端返回的数据进行进一步处理,比如更新本地状态等 |
| | | } catch (error) { |
| | | console.error('Error updating row status:', error); |
| | | // 处理错误情况,比如提示用户更新失败 |
| | | } |
| | | }; |
| | | |
| | | |
| | | // beforeUnmount(() => { |
| | | // closeWebSocket(); |
| | | // }); |
| | | // setInterval(fetchTableData, 2000) |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <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: 200px;"> |
| | | <el-table height="100%" ref="table" |
| | | <el-card style="flex: 1;" v-loading="loading"> |
| | | <el-card style="flex: 1;margin-left: 4px;margin-top: 1px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="200px" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="workstationId" align="center" :label="$t('reportWork.lowerbit')" min-width="80" /> |
| | | <el-table-column prop="workstationId" align="center" :label="$t('reportWork.shelfnumber')" min-width="120" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('reportWork.cardnumber')" min-width="120" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('reportWork.cardnumber')" min-width="150" /> |
| | | <el-table-column prop="totalquantity" align="center" :label="$t('reportWork.totalquantity')" min-width="120" /> |
| | | <el-table-column prop="racksnumber" align="center" :label="$t('reportWork.beendropped')" min-width="120" /> |
| | | <el-table-column prop="layer" align="center" label="层数" min-width="120" /> |
| | | <el-table-column prop="otherNumber" align="center" label="人工下片数" min-width="120" /> |
| | | <el-table-column prop="artificialnumber" align="center" label="人工下片数" min-width="120" /> |
| | | <el-table-column prop="work_state" align="center" :label="$t('reportWork.state')" min-width="120" /> |
| | | <el-table-column prop="deviceId" align="center" :label="$t('reportWork.devicenumber')" min-width="120" /> |
| | | <el-table-column |
| | |
| | | prop="enableState" |
| | | > |
| | | <template #default="scope"> |
| | | |
| | | <el-tag :type="getTagType(scope.row.enableState)" @click="toggleStatus(scope.row)"> |
| | | {{ scope.row.enableState === 1 ? $t('reportWork.enable') : $t('reportWork.unenable') }} |
| | | </el-tag> |
| | | <el-tag type="success" >{{ scope.row.enableState==1? $t('reportWork.enable') : $t('reportWork.unenable')}}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" :label="$t('reportWork.operate')" align="center" width="200"> |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | |
| | | <!-- workstationId: '1', |
| | | workstationId: '1005', |
| | | flowCardId: '183.6', |
| | | totalquantity: '1991', |
| | | racksnumber:"1", |
| | | work_state: '待识别', --> |
| | | <div style="display: flex;" class="awatch"> |
| | | <div id="main-body"> |
| | | <Landingindication></Landingindication> |
| | | </div> |
| | | <div id="main-bodya"> |
| | | <Landingindicationtwo></Landingindicationtwo> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | |
| | | <el-dialog v-model="dialogFormVisiblea" top="21vh" width="40%" :title="$t('reportWork.bindingshelves')"> |
| | | <div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | |
| | | |
| | | |
| | | <el-dialog v-model="dialogFormVisiblea2" top="21vh" width="30%" :title="$t('reportWork.clearglass')"> |
| | | |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleclear"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | |
| | | <!-- workstationId: '1', |
| | | workstationId: '1005', |
| | | flowCardId: '183.6', |
| | | totalquantity: '1991', |
| | | racksnumber:"1", |
| | | work_state: '待识别', --> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <div id="main-body"> |
| | | <Landingindication></Landingindication> |
| | | </div> |
| | | <div id="main-bodya"> |
| | | <Landingindicationtwo></Landingindicationtwo> |
| | | </div></div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} |
| | | #dta { display:block; float:left;line-height: 20px;margin-left: 80%;} |
| | | #dialog-footer{ |
| | |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | #awatch{ |
| | | height: 450px; |
| | | .awatch{ |
| | | max-width: 100%; |
| | | } |
| | | #main-body{ |
| | | margin-top: -20px; |
| | | margin-left: 200px; |
| | | margin-top: -40px; |
| | | margin-left: 150px; |
| | | } |
| | | #main-bodya{ |
| | | margin-top: -10px; |
| | | margin-top: -40px; |
| | | margin-left: 100px; |
| | | } |
| | | </style> |
| | |
| | | </el-table> |
| | | </div> |
| | | <div id="center" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 750px;"> |
| | | <img src="../../assets/d1.png" alt="" style="margin-left: -30px; width: 110%;height: 100%;position: relative;"> |
| | | <img src="../../assets/d1a.png" alt="" style="margin-left: -10px; width: 100%;height: 100%;position: relative;"> |
| | | </div> |
| | | <div id="centerright" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 240px;background-color: #911005;"> |
| | | <el-table height="240" ref="table" width="340px" |
| | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author wu |
| | | * @since 2024-06-25 |
| | | */ |
| | | @Api(description = "报工信息") |
| | | @RestController |
| | | @RequestMapping("/damage") |
| | | public class DamageController { |
| | |
| | | @Autowired |
| | | private DamageService damageService; |
| | | @ApiOperation("报工数据查询") |
| | | @GetMapping("/selectDamage") |
| | | public Result selectDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedureId)); |
| | | @ResponseBody |
| | | @PostMapping("/selectDamage") |
| | | public Result selectDamage(@RequestBody Map map) { |
| | | String startTime=map.get("startTime").toString(); |
| | | String endTime=map.get("endTime").toString(); |
| | | int type =Integer.parseInt(map.get("type").toString()); |
| | | int status =Integer.parseInt(map.get("status").toString()); |
| | | int workingProcedure =Integer.parseInt(map.get("workingProcedure").toString()); |
| | | // String startTime , String endTime, int type, int status, int workingProcedure |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedure)); |
| | | } |
| | | |
| | | @ApiOperation("报工") |
| | | @GetMapping("/submitDamage") |
| | | @PostMapping("/submitDamage") |
| | | public Result submitDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | damageService.submitDamage(startTime,endTime,type,status,workingProcedureId); |
| | | return Result.build(200,"报工成功",1); |
| | | } |
| | | |
| | | @ApiOperation("报工数据修改") |
| | | @GetMapping("/updateDamage") |
| | | @PostMapping("/updateDamage") |
| | | public Result updateDamage(List<Damage> damageList) { |
| | | damageService.updateBatchById(damageList); |
| | | return Result.build(200,"修改成功",1); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | /** |
| | | * 生产时间 |
| | | */ |
| | | private LocalDateTime damageTime; |
| | | private Timestamp damageTime; |
| | | |
| | | /** |
| | | * 备注 |
| | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface DamageService extends IService<Damage> { |
| | | |
| | | List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | List<Damage> selectDamage(String startTime, String endTime, int type, int status, int workingProcedureId); |
| | | |
| | | void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | |
| | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | | import com.mes.damage.service.DamageService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | |
| | | * 查询报工信息 |
| | | */ |
| | | @Override |
| | | public List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId){ |
| | | public List<Damage> selectDamage(String startTime, String endTime, int type, int status, int workingProcedure){ |
| | | LambdaQueryWrapper<Damage> damageSelectWrapper =new LambdaQueryWrapper<>(); |
| | | damageSelectWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | |
| | | if (status!=0){ |
| | | damageSelectWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(workingProcedureId!=0){ |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedure,workingProcedureId); |
| | | if(workingProcedure!=0){ |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedure,workingProcedure); |
| | | } |
| | | return baseMapper.selectList(damageSelectWrapper); |
| | | } |
| | |
| | | damage.setProcessId(glassInfo.getFlowCardId()); |
| | | damage.setOrderNumber(glassInfo.getGlassType()); |
| | | damage.setTechnologyNumber(glassInfo.getLayer()); |
| | | damage.setDamageTime(LocalDateTime.now()); |
| | | damage.setDamageTime(Timestamp.valueOf(LocalDateTime.now())); |
| | | damage.setType(2); |
| | | baseMapper.insert(damage); |
| | | } |
| | |
| | | package com.mes.glassinfo.service; |
| | | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | int getGlassInfoCountByFlowCardId(String flowCardId,int layer); |
| | | |
| | | /** |
| | | * @return |
| | | * 查询所有工程状态不为300不同流程卡号 |
| | | * @return 查询所有工程状态不为300不同流程卡号 |
| | | */ |
| | | List<Map<String, Object>> getFlowCardId(); |
| | | |
| | |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @Service |
| | | @Slf4j |
| | | public class GlassInfoServiceImpl extends MPJBaseServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService { |
| | | @Autowired |
| | | @Resource |
| | | OptimizeProjectMapper optimizeProjectMapper; |
| | | |
| | | @Override |
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("pp") |
| | | @Mapper |
| | | public interface OptimizeDetailMapper extends MPJBaseMapper<OptimizeDetail> { |
| | | |
| | | } |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("pp") |
| | | @Mapper |
| | | public interface OptimizeLayoutMapper extends MPJBaseMapper<OptimizeLayout> { |
| | | |
| | | } |
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.entity.request.OptimizeRequest; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @Mapper |
| | | @DS("pp") |
| | | public interface OptimizeProjectMapper extends MPJBaseMapper<OptimizeProject> { |
| | | List<OptimizeProject> saveProject(OptimizeRequest optimizeRequest); |
| | |
| | | public void onOpen(Session session, @PathParam("username") String username) { |
| | | this.username = username; |
| | | this.session = session; |
| | | this.session.setMaxTextMessageBufferSize(12*1024*1024); |
| | | this.session.setMaxBinaryMessageBufferSize(12*1024*1024); |
| | | List<WebSocketServer> webSocketServers = sessionMap.get(username); |
| | | if (webSocketServers == null) { |
| | | ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>(); |
| | |
| | | * |
| | | * @param message 客户端发送过来的消息 |
| | | */ |
| | | @OnMessage |
| | | @OnMessage(maxMessageSize = 5242880) |
| | | public void onMessage(String message, Session session, @PathParam("username") String username) { |
| | | log.info("服务端收到用户username={}的消息:{}", username, message); |
| | | JSONObject obj = JSONUtil.parseObj(message); |
| | |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import com.mes.work_assignment.service.WorkAssignmentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | * @author wu |
| | | * @since 2024-07-01 |
| | | */ |
| | | @Api(description = "值班信息") |
| | | @RestController |
| | | @RequestMapping("/work_assignment/work-assignment") |
| | | @RequestMapping("/work_assignment") |
| | | public class WorkAssignmentController { |
| | | |
| | | @Autowired |
| | | private WorkAssignmentService workAssignmentService; |
| | | @ApiOperation("值班数据查询") |
| | | @GetMapping("/selectWorkAssignment") |
| | | @PostMapping("/selectWorkAssignment") |
| | | public Result selectWorkAssignment(int line,String workingProcedure) { |
| | | return Result.build(200,"查询成功",workAssignmentService.selectWorkAssignment(line,workingProcedure)); |
| | | } |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.menu.entity.SysMenu; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | |
| | | public interface SysMenuMapper extends MPJBaseMapper<SysMenu> { |
| | | |
| | | List<String> selectPermsByUserId(long parseLong); |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.role.entity.SysRole; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | public interface SysRoleMapper extends MPJBaseMapper<SysRole> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.role.entity.SysRoleMenu; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | |
| | | public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.userinfo.entity.SysUser; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | |
| | | public interface SysUserMapper extends MPJBaseMapper<SysUser> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.userinfo.entity.SysUserRole; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | |
| | | public interface SysUserRoleMapper extends MPJBaseMapper<SysUserRole> { |
| | | |
| | | } |
| | |
| | | */ |
| | | EdgStorageCage selectNearestEmpty(int currentSlot, boolean flag); |
| | | |
| | | /** |
| | | * 查询笼内空格 |
| | | * @return |
| | | */ |
| | | List<EdgStorageCage> selectCacheEmpty(); |
| | | |
| | | /** |
| | | * 查询笼内出片顺序详情 |
| | |
| | | |
| | | /** |
| | | * 修改理片笼信息 |
| | | * |
| | | * @param edgStorageCage |
| | | * @return |
| | | */ |
| | | boolean updateEdgStorageCage(EdgStorageCage edgStorageCage); |
| | | |
| | | /** |
| | | * 更新理片笼详情信息 |
| | | * |
| | | * @param edgStorageCageId |
| | | * @param edgStorageCageDetails |
| | | * @return |
| | | */ |
| | | boolean updateEdgStorageCageDetails(int edgStorageCageId, EdgStorageCageDetails edgStorageCageDetails); |
| | | |
| | | } |
| | |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Service |
| | | public class EdgStorageCageServiceImpl extends MPJBaseServiceImpl<EdgStorageCageMapper, EdgStorageCage> implements EdgStorageCageService { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | @Autowired |
| | | @Resource |
| | | UpPattenUsageMapper upPattenUsageMapper; |
| | | |
| | | @Override |
| | |
| | | .eq(EdgStorageCageDetails::getSlot, EdgStorageCage::getSlot) |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | .eq(EdgStorageCage::getEnableState, Const.SLOT_ON) |
| | | .last("order by abs(t.slot - " + currentSlot + ") asc limit 2") |
| | | ); |
| | | if (flag && CollectionUtil.isNotEmpty(emptyList)) { |
| | |
| | | return null; |
| | | } |
| | | return emptyList.get(0); |
| | | } |
| | | |
| | | /** |
| | | * 查询笼内空格 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<EdgStorageCage> selectCacheEmpty() { |
| | | return baseMapper.selectJoinList(EdgStorageCage.class, new MPJLambdaWrapper<EdgStorageCage>() |
| | | .selectAll(EdgStorageCage.class) |
| | | .leftJoin(EdgStorageCageDetails.class, on -> on |
| | | .eq(EdgStorageCageDetails::getSlot, EdgStorageCage::getSlot) |
| | | .eq(EdgStorageCageDetails::getState, "100")) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | .last("order by abs(t.slot - 4) asc") |
| | | ); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("本次任务结束时间:{},共耗时:{}ms", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | public void plcToHomeEdgTask() { |
| | | // log.info("推数据"); |
| | | // jsonObject.append("params", new short[] { 30, 40, }); |
| | | // ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home"); |
| | | // if (sendwServer != null) { |
| | | // for (WebSocketServer webserver : sendwServer) { |
| | | // webserver.sendMessage(jsonObject.toString()); |
| | | // if (webserver != null) { |
| | | // |
| | | // List<String> messages = webserver.getMessages(); |
| | | // |
| | | // if (!messages.isEmpty()) { |
| | | // // // 将最后一个消息转换为整数类型的列表 |
| | | // webserver.clearMessages(); |
| | | // } |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /** |
| | |
| | | MPJQueryWrapper<EdgStorageCageDetails> wrapper = new MPJQueryWrapper<>(); |
| | | wrapper.select("count(t.glass_id), t.width, t.height") |
| | | .eq("t.state", Const.GLASS_STATE_IN) |
| | | .inSql("t.slot", "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .groupBy("t.width, t.height"); |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | |
| | | glassList.add(resultDetails); |
| | | } |
| | | //获取笼内玻璃 |
| | | List<EdgStorageCageDetails> details = edgStorageCageDetailsService.list(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | List<EdgStorageCageDetails> details = edgStorageCageDetailsService.selectJoinList(EdgStorageCageDetails.class, new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class) |
| | | .leftJoin(EdgStorageCage.class, on -> on.eq(EdgStorageCage::getSlot, EdgStorageCageDetails::getSlot).eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .eq(EdgStorageCage::getEnableState, Const.SLOT_ON)); |
| | | glassList.addAll(details); |
| | | return glassList; |
| | | |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | private boolean queryMaxMinDiff(int threshold) { |
| | | public boolean queryMaxMinDiff(int threshold) { |
| | | //获取笼子内最大版图id和最小版图id插值,判断是否大于阈值,大于阈值直接出最小版图玻璃 |
| | | QueryWrapper<EdgStorageCageDetails> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.select("max(tempering_layout_id)-min(tempering_layout_id) as diff") |
| | | .eq("state", Const.GLASS_STATE_IN); |
| | | .eq("state", Const.GLASS_STATE_IN) |
| | | .inSql("slot", "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON); |
| | | List<Object> list = edgStorageCageDetailsService.listObjs(queryWrapper); |
| | | //获取笼内玻璃版图差值是否大于阈值 |
| | | if (CollectionUtil.isNotEmpty(list)) { |
| | | Long diff = (Long) list.get(0); |
| | | int diff = (int) list.get(0); |
| | | return diff > threshold; |
| | | } else { |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | .eq(EdgStorageCageDetails::getState, 100) |
| | | .eq(width != 0, EdgStorageCageDetails::getWidth, width) |
| | | .eq(height != 0, EdgStorageCageDetails::getHeight, height) |
| | | .inSql(EdgStorageCageDetails::getSlot, "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .last("limit 1")); |
| | |
| | | .eq("t.glass_id", taskCache.getGlassId()) |
| | | .ne("t1.glass_id", taskCache.getGlassId()) |
| | | .eq("t1.state", Const.GLASS_STATE_IN) |
| | | .inSql("t1.slot", "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .orderByAsc("t1.tempering_layout_id") |
| | | .orderBy(Boolean.TRUE, sequenceOrder, "t1.tempering_feed_sequence"); |
| | | List<EdgStorageCageDetails> details = edgStorageCageDetailsService.selectJoinList(EdgStorageCageDetails.class, mpjLambdaWrapper); |
| | |
| | | return null; |
| | | } |
| | | return edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId()) |
| | | // .inSql(EdgStorageCageDetails::getEngineerId, "select engineer_id from engineering where state = 1") |
| | | .inSql(EdgStorageCageDetails::getSlot, "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .last(" limit 1 ")); |
| | | } |
| | | |
| | |
| | | MPJQueryWrapper<EdgStorageCageDetails> wrapper = new MPJQueryWrapper<>(); |
| | | wrapper.select("count(t.glass_id) as count, t.width, t.height") |
| | | .eq("t.state", Const.GLASS_STATE_IN) |
| | | .inSql("t.slot", "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .groupBy("t.width, t.height"); |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | |
| | | private Integer slot; |
| | | |
| | | /** |
| | | * 栅格号 |
| | | */ |
| | | @ApiModelProperty(value = "最小厚度", position = 5) |
| | | private Integer minThickness; |
| | | /** |
| | | * 栅格号 |
| | | */ |
| | | @ApiModelProperty(value = "最大厚度", position = 6) |
| | | private Integer maxThickness; |
| | | |
| | | /** |
| | | * 启用状态 |
| | | */ |
| | | @ApiModelProperty(value = "启用状态", position = 5) |
| | | @ApiModelProperty(value = "启用状态", position = 7) |
| | | private Integer enableState; |
| | | |
| | | /** |
| | | * 剩余宽度 |
| | | */ |
| | | @ApiModelProperty(value = "剩余宽度", position = 6) |
| | | @ApiModelProperty(value = "剩余宽度", position = 8) |
| | | private Integer remainWidth; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO temperingIsAll(); |
| | | List<TemperingLayoutDTO> temperingIsAll(); |
| | | |
| | | /** |
| | | * 获取每个钢化版图占用的格子数量 |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO temperingIsAll(); |
| | | List<TemperingLayoutDTO> temperingIsAll(); |
| | | |
| | | /** |
| | | * 获取每个钢化版图占用的格子数量 |
| | |
| | | glassInfoWrapper.eq(GlassInfo::getGlassId,bigStorageCageFeedTask.getGlassId()); |
| | | GlassInfo glassInfo= glassInfoMapper.selectOne(glassInfoWrapper); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | bigStorageCageDetailsList.add(bigStorageCageDetails); |
| | | } |
| | | return bigStorageCageDetailsList; |
| | |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | return bigStorageDTO; |
| | | } |
| | | //todo:获取玻璃的厚度:重新选笼子需要按照笼子可放玻璃厚度进行选择 |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .gt(BigStorageCage::getMaxThickness, glassInfo.getThickness()) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | | .last("limit 1")); |
| | | Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃"); |
| | | bigStorageDTO = new BigStorageDTO(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public TemperingLayoutDTO temperingIsAll() { |
| | | public List<TemperingLayoutDTO> temperingIsAll() { |
| | | return baseMapper.temperingIsAll(); |
| | | } |
| | | |
| | |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(BigStorageCage.class).selectCollection(BigStorageCageDetails.class, BigStorageCage::getBigStorageCageDetails) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on.eq(BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL)); |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL)) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | | .orderByAsc(BigStorageCage::getSlot); |
| | | return bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<Map<String, Object>> selectBigStorageCageUsage() { |
| | | QueryWrapper<BigStorageCage> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("device_id,ROUND(1 - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) / COUNT(device_id), 2) AS percentage,COUNT(device_id) - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) AS count") |
| | | wrapper.select("device_id,ROUND(1 - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) / COUNT(device_id), 2) AS percentage,SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) AS count") |
| | | |
| | | .groupBy("device_id"); |
| | | List<Map<String, Object>> bigStorageCageUsages = baseMapper.selectMaps(wrapper); |
| | |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | private JSONObject jsonObject = new JSONObject(); |
| | | private JSONObject jsonObject1 = new JSONObject(); |
| | | public void queryDataSource1() throws InterruptedException { |
| | | List<Double> carPostion=new ArrayList<>(); |
| | | carPostion.add(0.25); |
| | | carPostion.add(0.5); |
| | | jsonObject.append("carPostion",carPostion); |
| | | //界面展示笼子信息 |
| | | jsonObject.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail()); |
| | | jsonObject1.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail()); |
| | | |
| | | //进片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1); |
| | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | jsonObject = new JSONObject(); |
| | | jsonObject1 = new JSONObject(); |
| | | try { |
| | | //查询使用数据源1查询数据 |
| | | queryDataSource1(); |
| | | //查询使用数据源2查询数据 |
| | | queryDataSource2(); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | webserver.sendMessage(jsonObject1.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | |
| | | return; |
| | | } |
| | | //钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | | TemperingLayoutDTO temperingLayoutDTO = bigStorageCageDetailsService.temperingIsAll(); |
| | | if (null != temperingLayoutDTO) { |
| | | //玻璃到齐 |
| | | List<TemperingLayoutDTO> temperingLayoutDTOList = bigStorageCageDetailsService.temperingIsAll(); |
| | | if (CollectionUtils.isNotEmpty(temperingLayoutDTOList)) { |
| | | //玻璃到齐包括已出片的 |
| | | //到齐,将玻璃小片数据存入钢化小片表,逻辑生成出片任务 结束 |
| | | for (TemperingLayoutDTO item : temperingLayoutDTOList) { |
| | | List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class) |
| | | .selectAll(GlassInfo.class) |
| | | .select("-1 as state") |
| | | .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot) |
| | | .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId) |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(GlassInfo::getTemperingLayoutId, temperingLayoutDTO.getTemperingLayoutId()) |
| | | .eq(GlassInfo::getEngineerId, temperingLayoutDTO.getEngineerId())); |
| | | .eq(GlassInfo::getTemperingLayoutId, item.getTemperingLayoutId()) |
| | | .eq(GlassInfo::getEngineerId, item.getEngineerId())); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE, mesToPLCAddress); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | //未到齐 执行内部调度任务 |
| | | TemperingLayoutDTO temperingOccupySlot = bigStorageCageDetailsService.queryTemperingOccupySlot(); |
| | |
| | | Boolean flag = Boolean.TRUE; |
| | | //2、获取卧转立 |
| | | Integer widthFirst = Math.max(edgGlassTaskInfoList.get(0).getWidth() / 10, edgGlassTaskInfoList.get(0).getHeight() / 10); |
| | | Integer heightFirst = Math.min(edgGlassTaskInfoList.get(0).getWidth() / 10, edgGlassTaskInfoList.get(0).getHeight() / 10); |
| | | if (edgGlassTaskInfoList.size() == 1) { |
| | | if (remainWidth >= widthFirst) { |
| | | if (glassCount < inCarMaxSize) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst); |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst, heightFirst); |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightFirst); |
| | | } |
| | | } else { |
| | | flag = Boolean.FALSE; |
| | | } |
| | | } else { |
| | | Integer widthSecond = Math.max(edgGlassTaskInfoList.get(1).getWidth() / 10, edgGlassTaskInfoList.get(1).getHeight() / 10); |
| | | Integer heightSecond = Math.min(edgGlassTaskInfoList.get(1).getWidth() / 10, edgGlassTaskInfoList.get(1).getHeight() / 10); |
| | | if (remainWidth >= widthFirst) { |
| | | if (remainWidth - widthFirst - glassGap >= widthSecond) { |
| | | if (glassCount < inCarMaxSize) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst); |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst, heightSecond); |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightSecond); |
| | | } |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightSecond); |
| | | } |
| | | } else { |
| | | flag = Boolean.FALSE; |
| | |
| | | /** |
| | | * 添加任务信息 |
| | | */ |
| | | private Boolean addFeedTask(String glassId, Integer line, Integer taskType, Integer width) { |
| | | private Boolean addFeedTask(String glassId, Integer line, Integer taskType, Integer width, Integer height) { |
| | | BigStorageCageFeedTask bigStorageCageFeedTask = new BigStorageCageFeedTask(); |
| | | bigStorageCageFeedTask.setGlassId(glassId); |
| | | bigStorageCageFeedTask.setTaskState(Const.BIG_STORAGE_IN_NEW); |
| | | bigStorageCageFeedTask.setLine(line); |
| | | bigStorageCageFeedTask.setTaskType(taskType); |
| | | bigStorageCageFeedTask.setWidth(width); |
| | | bigStorageCageFeedTask.setHeight(height); |
| | | bigStorageCageFeedTask.setCreateTime(new Date()); |
| | | return bigStorageCageFeedTaskService.save(bigStorageCageFeedTask); |
| | | } |
| | |
| | | public Boolean computeIsRun(int line, String glassId) { |
| | | //获取卧转立剩余宽度 |
| | | BigStorageDTO sitToUpRemainWidth = bigStorageCageFeedTaskService.querySitToUpRemainWidth(line); |
| | | if (sitToUpRemainWidth.getGlassCount() == 0) { |
| | | return Boolean.FALSE; |
| | | } |
| | | //获取玻璃信息 |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | return sitToUpRemainWidth.getWidth() < glassInfo.getWidth(); |
| | |
| | | |
| | | @Override |
| | | public boolean saveBatch(List<TemperingGlassInfo> list) { |
| | | log.info("需要钢化的玻璃为:{}", list); |
| | | return baseMapper.saveBatch(list); |
| | | } |
| | | |
| | |
| | | WHERE STATE in (100, 101, 102) |
| | | GROUP BY ENGINEER_ID, TEMPERING_LAYOUT_ID) T3 ON T2.ENGINEER_ID = T3.ENGINEER_ID |
| | | AND T2.TEMPERING_LAYOUT_ID = T3.TEMPERING_LAYOUT_ID |
| | | AND T2.COUNT = T3.COUNT LIMIT 1 |
| | | AND T2.COUNT = T3.COUNT |
| | | </select> |
| | | |
| | | <select id="queryTemperingOccupySlot" resultMap="temperingLayoutDTO"> |
| | |
| | | ELSE HEIGHT |
| | | END MAX_LENGTH |
| | | FROM BIG_STORAGE_CAGE_FEED_TASK |
| | | WHERE LINE = 2002 |
| | | WHERE LINE = #{line} |
| | | AND TASK_STATE IN (1, 2) |
| | | ) T |
| | | </select> |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | @Autowired |
| | | DamageService damageService; |
| | | |
| | | @Autowired |
| | | BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper; |
| | | |
| | | @Test |
| | | public void testInsertSlot() { |
| | | List<BigStorageCage> list = new ArrayList(); |
| | | for (int j = 1; j <= 5; j++) { |
| | | for (int i = 1 + (55 * (j - 1)); i <= 55 * j; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(j); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(4); |
| | | cage.setMaxThickness(6); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | } |
| | | for (int i = 276; i <= 300; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(6); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(8); |
| | | cage.setMaxThickness(12); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | for (int i = 301; i <= 330; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(7); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(8); |
| | | cage.setMaxThickness(12); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | for (int i = 331; i <= 355; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(8); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(8); |
| | | cage.setMaxThickness(12); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | for (int i = 356; i <= 380; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(9); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(15); |
| | | cage.setMaxThickness(19); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | bigStorageCageService.saveBatch(list); |
| | | } |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | | log.info("完整路径:{}", Arrays.asList("123")); |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.mes.loadposition.entity.LoadPosition;
|
| | |
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | |
|
| | | /**
|
| | | *
|
| | | *
|
| | |
| | | * @since 2024-07-09 14:51:27
|
| | | *
|
| | | */
|
| | | @Mapper
|
| | |
|
| | | public interface LoadPositionMapper extends BaseMapper<LoadPosition> {
|
| | |
|
| | | } |
| | |
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.mes.rawusage.entity.RawUsage;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | | /**
|
| | | *
|
| | | *
|
| | |
| | | * @since 2024-07-09 14:51:27
|
| | | *
|
| | | */
|
| | | @Mapper
|
| | |
|
| | | public interface RawUsageMapper extends BaseMapper<RawUsage> {
|
| | |
|
| | | } |
| | |
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | | /**
|
| | | *
|
| | | *
|
| | |
| | | * @since 2024-07-09 14:51:27
|
| | | *
|
| | | */
|
| | | @Mapper
|
| | |
|
| | | public interface ShelfRackMapper extends BaseMapper<ShelfRack> {
|
| | |
|
| | | } |
| | |
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | | /**
|
| | | *
|
| | | *
|
| | |
| | | * @since 2024-07-09 14:51:27
|
| | | *
|
| | | */
|
| | | @Mapper
|
| | |
|
| | | public interface StorageTaskMapper extends BaseMapper<StorageTask> {
|
| | |
|
| | | } |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | |
| | | public interface DownStorageCageDetailsMapper extends MPJBaseMapper<DownStorageCageDetails> { |
| | | |
| | | DownStorageCageDetails getGlassInfoMaxCount(); |
| | |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(DownStorageCageDetails::getSlot) |
| | | .eq(DownStorageCage::getEnableState, Const.SLOT_ON) |
| | | .last("order by abs(t.slot - " + currentSlot + ") asc limit 2") |
| | | ); |
| | | if (flag && CollectionUtil.isNotEmpty(emptyList)) { |
| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | |
| | | |
| | | @Repository |
| | | @InterceptorIgnore(tenantLine = "true") |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import org.mapstruct.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | |
| | | @DS("salve_hangzhoumes") |
| | | @Mapper |
| | | |
| | | public interface DownWorkstationTaskMapper extends BaseMapper<DownWorkstationTask> { |
| | | |
| | | List<DownWorkstationTask> selectList(); |
| | |
| | | if (CollectionUtils.isNotEmpty(workList)) { |
| | | List<DownWorkstation> downWorkstationList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getEnableState, Const.SLOT_ON).in(DownWorkstation::getWorkstationId, workList)); |
| | | log.info("架子被禁用,无法出片落架"); |
| | | // log.info("架子被禁用,无法出片落架"); |
| | | if (CollectionUtils.isEmpty(downWorkstationList)) { |
| | | log.info("笼子被禁用,无法走机械臂下片"); |
| | | //走人工下片 |
| | |
| | | //生成任务信息 |
| | | DownGlassInfo downGlassInfo = new DownGlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, downGlassInfo); |
| | | //todo:落架片序 |
| | | downGlassInfoService.save(downGlassInfo); |
| | | //生成任务信息 |
| | | GlassInfo glassInfo = new GlassInfo(); |