Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
# Conflicts:
# hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageServiceImpl.java
94个文件已修改
1 文件已重命名
21个文件已添加
4个文件已删除
New file |
| | |
| | | { |
| | | "plcAddressBegin": "DB88.0", |
| | | "plcAddressLenght": "58", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | { |
| | | "codeId": "confirmationWord", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperingLayoutId", |
| | | "addressIndex": "2", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "filmsid", |
| | | "addressIndex": "4", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperingType", |
| | | "addressIndex": "6", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "thickness", |
| | | "addressIndex": "8", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "loadingRate", |
| | | "addressIndex": "10", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "areaDifference", |
| | | "addressIndex": "12", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "state", |
| | | "addressIndex": "22", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "deviceState", |
| | | "addressIndex": "24", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "resultState", |
| | | "addressIndex": "26", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "loadSpeed", |
| | | "addressIndex": "28", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "downSpeed", |
| | | "addressIndex": "30", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "load1", |
| | | "addressIndex": "32", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "heat1", |
| | | "addressIndex": "34", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "heat2", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "cool1", |
| | | "addressIndex": "38", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "cool2", |
| | | "addressIndex": "40", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "downId", |
| | | "addressIndex": "42", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "productionTime", |
| | | "addressIndex": "44", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "heatEnergy", |
| | | "addressIndex": "46", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "coolEnergy", |
| | | "addressIndex": "48", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperatureUp1", |
| | | "addressIndex": "50", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperatureDown1", |
| | | "addressIndex": "52", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperatureUp2", |
| | | "addressIndex": "54", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperatureDown2", |
| | | "addressIndex": "56", |
| | | "addressLenght": "2" |
| | | } |
| | | ] |
| | | } |
| | |
| | | updatanull:'该工程未保存到上片表!', |
| | | glassnull:'更新玻璃状态时发生错误', |
| | | deletemessage:'是否删除该条信息?', |
| | | layoutSequence:'序号', |
| | | }, |
| | | sorter:{ |
| | | gridnumber:'栅格号', |
| | |
| | | down:'下一页', |
| | | now:'当前页显示', |
| | | tit:'条数据', |
| | | temperingqueries:'钢化查询', |
| | | specifytempering:'指定钢化', |
| | | projectnumber:'工程号', |
| | | layoutnumber:'钢化版图号', |
| | | numberglasses:'玻璃数量', |
| | | specifytemperinga:'是否指定钢化该条信息?', |
| | | }, |
| | | workOrder:{ |
| | | glassID:'玻璃ID', |
| | |
| | | alt="" |
| | | style="max-width: 100%;max-height: 100%"> |
| | | <h3 style="margin: 1rem ;font-weight: bold;width: 33vw;"> {{ $t('main.titleFirst') }}{{ user }}{{ $t('main.titleLast') }}</h3> |
| | | <!-- <div class="header-left"> |
| | | <el-button :icon="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="toggleCollapse" |
| | | style="height:30px;"></el-button> |
| | | </div> --> |
| | | <span style="height: 70%;width: 78vw;margin-top: 1rem;"> |
| | | <!-- <el-button class="sys-quit" |
| | | @click="quit" |
| | |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 报工管理 ----------------*/ |
| | | { |
| | | path: 'reportWork', |
| | | name: 'reportWork', |
| | | component: () => import('../views/ReportWork/reportWork.vue'), |
| | | children:[ |
| | | { |
| | | path: '/ReportWork/reportWork', |
| | | name: 'reportWork', |
| | | component: () => import('../views/ReportWork/reportWork.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 管理系统 ----------------*/ |
| | | { |
| | | path: 'sys', |
| | |
| | | // WebSocketService.js
|
| | |
|
| | | let socket = null;
|
| | |
|
| | | let messages = '';
|
| | | export const initializeWebSocket = (socketUrl, messageHandler) => {
|
| | | if (typeof WebSocket === "undefined") {
|
| | | console.log("Your browser does not support WebSocket");
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | const obj = JSON.parse(msg.data);
|
| | | const isLastChunk = msg.data.endsWith('<END>');
|
| | | //是否为最后一块消息
|
| | | messages += msg.data;
|
| | | if(isLastChunk||msg.data.length<50000) {
|
| | | messages= messages.replace('<END>', '');
|
| | | const obj = JSON.parse(messages);
|
| | |
|
| | | // 调用消息处理函数,将数据传递给 Vue 组件
|
| | | if (messageHandler) {
|
| | | messageHandler(obj);
|
| | | }
|
| | | messages='';
|
| | | }
|
| | | |
| | | |
| | |
|
| | | |
| | | |
| | | };
|
| | |
|
| | | return socket;
|
New file |
| | |
| | | // src/services/api.js
|
| | | import request from 'request';
|
| | |
|
| | |
|
| | | export const findTasks = (id, newState) => {
|
| | | const url = `glassStorage/api/storageTask/findTasks`;
|
| | | const options = {
|
| | | method: 'POST',
|
| | | url,
|
| | | json: true,
|
| | | body: { id, enableState: newState }
|
| | | };
|
| | |
|
| | | return new Promise((resolve, reject) => {
|
| | | request(options, (error, response, body) => {
|
| | | if (error) {
|
| | | reject(new Error(error.message));
|
| | | } else {
|
| | | resolve(body);
|
| | | }
|
| | | });
|
| | | });
|
| | | };
|
| | |
| | | const toggleEnableState = async (row) => { |
| | | const newState = row.enable_state === 1 ? 0 : 1; |
| | | // 发送请求到后端更新状态(这里省略了实际的请求逻辑) |
| | | const response = await request.post('/unLoadGlass/downStorage/updateDownStorageCage', { id: row.id, enablestate: newState }); |
| | | const response = await request.post('/unLoadGlass/downStorage/updateDownStorageCage', { id: row.id, enableState: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | |
| | | } |
| | | row.enable_state = newState; |
| | | }; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`; |
| | | |
| | | |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/downcache`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | |
| | | <!-- <el-button type="success" size="mini" @click="addglass()">添加原片</el-button> -->
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | |
| | | </el-table>
|
| | | <el-pagination
|
| | | v-if="totalItems > 0"
|
| | | background
|
| | | layout="prev, pager, next"
|
| | | :total="totalItems"
|
| | | :page-size="pageSize"
|
| | | @current-change="handleCurrentChange"
|
| | | ></el-pagination>
|
| | |
|
| | |
|
| | | </el-dialog>
|
| | |
| | |
|
| | |
|
| | | const Hidden = ref(false)
|
| | |
|
| | |
|
| | | const totalItems = ref(0);
|
| | | totalItems.value = 10;
|
| | | const pageSize = 10;
|
| | | let currentPage = ref(1);
|
| | | const handleCurrentChange = (val) => {
|
| | |
|
| | | currentPage.value = val;
|
| | | |
| | | };
|
| | |
|
| | | const getTagType2 =(status) => {
|
| | | switch (status) {
|
| | |
| | | </script>
|
| | |
|
| | | <style scoped>
|
| | | html, body {
|
| | | height: 100%;
|
| | | margin: 0;
|
| | | padding: 0;
|
| | | overflow: hidden; /* 禁止出现滚动条 */
|
| | | }
|
| | |
|
| | | .app-container {
|
| | |
|
| | | flex-direction: column;
|
| | | height: 100vh; /* 使用视口高度 */
|
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
|
| | | #dta { display:block; float:left;line-height: 20px;margin-left: 80%;}
|
| | | #dialog-footer{
|
| | | text-align: center;
|
| | | margin-top: -15px;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | // controlsId: 201, |
| | | // }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blind.value = false; |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | // // 人工拿走 |
| | | // 人工拿走 |
| | | const handleManualTake = async () => { |
| | | try { |
| | | var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+200; |
| | |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const dialogFormVisible = ref(true) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisible = ref(false) |
| | | const dialogFormVisiblea = ref(true) |
| | | const dialogFormVisibleb = ref(false) |
| | | const blind = ref(false) |
| | | const width = ref(); |
| | | const height = ref(); |
| | | const adjustedRects = ref([]); |
| | | const adjustedRects2 = ref([]); |
| | | const adjustedRectsa = ref([]); |
| | | const adjustedRectsb = ref([]); |
| | | const currentGlassId = ref(null); |
| | | const currenttemperingFeedSequence = ref(null); |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; |
| | | const handleMessage = (data) => { |
| | | // 进炉中 |
| | | adjustedRects.value = data.intoGlass[0].map(rect => ({ |
| | | if(data.intoGlass!=null){ |
| | | adjustedRects.value = data.intoGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.height * 0.12; |
| | | adjustedHeight = rect.width * 0.1; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5087 - (rect.xCoordinate + rect.height); |
| | | } else { |
| | | adjustedWidth = rect.width * 0.12; |
| | | adjustedHeight = rect.height * 0.1; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5087 - (rect.xCoordinate + rect.width); |
| | | } |
| | | return { |
| | | ...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 => ({ |
| | | xcoordinate: newX * 0.12, |
| | | ycoordinate: rect.yCoordinate * 0.1, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | | heighta: adjustedHeighta, |
| | | }; |
| | | }); |
| | | } |
| | | if(data.intoGlass2!=null){ |
| | | adjustedRects2.value = data.intoGlass2[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.height * 0.12; |
| | | adjustedHeight = rect.width * 0.1; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5087 - (rect.xCoordinate + rect.height); |
| | | } else { |
| | | adjustedWidth = rect.width * 0.12; |
| | | adjustedHeight = rect.height * 0.1; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5087 - (rect.xCoordinate + rect.width); |
| | | } |
| | | return { |
| | | ...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]); |
| | | xcoordinate: newX * 0.12, |
| | | ycoordinate: rect.yCoordinate * 0.1, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | | heighta: adjustedHeighta, |
| | | }; |
| | | }); |
| | | } |
| | | // 进炉前 |
| | | adjustedRectsa.value = data.waitingGlass[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | 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 |
| | | })); |
| | | if(data.waitingGlass!=null){ |
| | | adjustedRectsa.value = data.waitingGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.width * 0.24; |
| | | adjustedHeight = rect.height * 0.16; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5190 - (rect.yCoordinate + rect.width); |
| | | } else { |
| | | adjustedWidth = rect.height * 0.24; |
| | | adjustedHeight = rect.width * 0.16; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5190 - (rect.yCoordinate + rect.height); |
| | | } |
| | | return { |
| | | ...rect, |
| | | x: newX * 0.24, |
| | | y: rect.xCoordinate * 0.16, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | | heighta: adjustedHeighta, |
| | | }; |
| | | }); |
| | | } |
| | | // 已出炉 |
| | | adjustedRectsb.value = data.outGlass[0].map(rect => ({ |
| | | if(data.outGlass!=null){ |
| | | adjustedRectsb.value = data.outGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.width * 0.24; |
| | | adjustedHeight = rect.height * 0.16; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5190 - (rect.yCoordinate + rect.width); |
| | | } else { |
| | | adjustedWidth = rect.height * 0.24; |
| | | adjustedHeight = rect.width * 0.16; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5190 - (rect.yCoordinate + rect.height); |
| | | } |
| | | return { |
| | | ...rect, // 复制原始对象的其他属性 |
| | | 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 |
| | | })); |
| | | x: newX * 0.24, |
| | | y: rect.xCoordinate * 0.16, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | | heighta: adjustedHeighta, |
| | | }; |
| | | }); |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | function updateRectColors() { |
| | | adjustedRectsa.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | | rect.state = 5; |
| | | } |
| | | }); |
| | | } |
| | | function getRectColora(state) { |
| | | switch (state) { |
| | | case 0: |
| | | return '#d1edc4'; |
| | | case 1: |
| | | return '#E6E6FA'; |
| | | case -1: |
| | | return '#dedfe0'; |
| | | case 5: |
| | | return '#911005'; |
| | | } |
| | | } |
| | | function getRectColorb(state) { |
| | | switch (state) { |
| | | case 3: |
| | | return '#f8e3c5'; |
| | | case 4: |
| | | return '#F0F8FF'; |
| | | case 5: |
| | | return '#911005'; |
| | | } |
| | | } |
| | | function showDialog(rect) { |
| | | currentGlassId.value = rect.glassId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | | blind.value = true; |
| | | } |
| | | // 破损 |
| | | const handleDamage = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { |
| | | glassId: currentGlassId.value, |
| | | // temperingFeedSequence: currenttemperingFeedSequence.value, |
| | | line: 4001, |
| | | status: 2, |
| | | workingProcedure: '钢化', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blind.value = false; |
| | | updateRectColors(); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | |
| | | </script> |
| | | <template> |
| | | <div style="margin-top: 10px;"> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true;dialogFormVisiblea = false;dialogFormVisibleb = false;">{{ $t('processCard.intofurnace') }}</el-button> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;" >{{ $t('processCard.beforefurnace') }}</el-button> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true;dialogFormVisiblea = false;dialogFormVisibleb = false;">{{ $t('processCard.intofurnace') }}</el-button> |
| | | <el-button id="searchButton" type="success" @click="dialogFormVisibleb = true;dialogFormVisible = false;dialogFormVisiblea = false">{{ $t('processCard.outfurnace') }}</el-button> |
| | | <div v-if="dialogFormVisible" > |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> |
| | | <div style="width: 49%;float: left;background-color: #f4f4f5;height: 550px;"> |
| | | <el-scrollbar height="630px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <div v-if="adjustedRects.length > 0"> |
| | | <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> |
| | | <el-scrollbar height="550px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;max-width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="index" |
| | | @click="showDialog(rect)" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }" |
| | | :style="{ position: 'absolute', |
| | | top: `${rect.ycoordinate}px`, |
| | | left: `${rect.xcoordinate}px`, |
| | | width: `${rect.width}px`, |
| | | height: `${rect.height}px`, |
| | | backgroundColor: rect.state === 5 ? '#911005' : 'lightblue' }" |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div >{{ rect.glassId }}</div> |
| | | <div >{{ rect.flowCardId }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | | </div> |
| | | <div style="width: 49%;float: right;background-color: #f4f4f5;height: 550px;"> |
| | | <el-scrollbar height="550px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <div v-if="adjustedRects2.length > 0"> |
| | | <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> |
| | | <el-scrollbar height="550px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;max-width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects2" |
| | | :key="index" |
| | | @click="showDialog(rect)" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }" |
| | | :style="{ position: 'absolute', |
| | | top: `${rect.ycoordinate}px`, |
| | | left: `${rect.xcoordinate}px`, |
| | | width: `${rect.width}px`, |
| | | height: `${rect.height}px`, |
| | | backgroundColor: rect.state === 5 ? '#911005' : 'lightblue' }" |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div >{{ rect.glassId }}</div> |
| | | <div >{{ rect.flowCardId }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | | </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="550px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> |
| | | <div v-if="adjustedRectsa.length > 0"> |
| | | <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> |
| | | <el-scrollbar height="550px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;max-width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsa" |
| | | :key="index" |
| | | @click="showDialog(rect)" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, |
| | | :style="{ position: 'absolute', top: `${rect.y}px`, left: `${rect.x}px`, |
| | | width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: rect.state === 0 ? '#dedfe0' : '#d1edc4' }"> |
| | | backgroundColor: getRectColora(rect.state) }"> |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div>{{ rect.glassId }}</div> |
| | | <div >{{ rect.flowCardId }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | | </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="550px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> |
| | | <div v-if="adjustedRectsb.length > 0"> |
| | | <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> |
| | | <el-scrollbar height="550px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;max-width: 1400px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsb" |
| | | :key="index" |
| | | @click="showDialog(rect)" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, |
| | | :style="{ position: 'absolute', top: `${rect.y}px`, left: `${rect.x}px`, |
| | | width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }"> |
| | | backgroundColor: getRectColorb(rect.state) }"> |
| | | <!-- 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 >{{ rect.glassId }}</div> |
| | | <div >{{ rect.flowCardId }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;"> |
| | | <el-button type="warning" plain :icon="Delete" @click="handleDamage" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <style scoped> |
| | |
| | | } |
| | | .centered-text { |
| | | /* 设置文字居中样式 */ |
| | | display: flex; |
| | | /* display: flex; */ |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 100%; /* 确保div占据整个矩形的高度 */ |
| | | /* font-size: small; */ |
| | | } |
| | | </style> |
| | |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import request from "@/utils/request" |
| | | |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | const adjustedRects = ref([]); |
| | | const currentGlassId = ref(null); |
| | | const currenttemperingFeedSequence = ref(null); |
| | | |
| | | const dialogFormVisible = ref(true) |
| | | const dialogFormVisiblea = ref(false) |
| | | const blind = ref(false) |
| | | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | adjustedRects.value = data.overGlass[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | xcoordinate: rect.xCoordinate * 0.5, // 将x值除以3 |
| | | ycoordinate: rect.ycoordinate * 0.5, |
| | | width: rect.width * 0.4, |
| | | height: rect.height * 0.4, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | })); |
| | | console.log(adjustedRects.value); |
| | | if(data.overGlass!=null){ |
| | | adjustedRects.value = data.overGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.width * 0.24; |
| | | adjustedHeight = rect.height * 0.16; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5190 - (rect.yCoordinate + rect.width); |
| | | } else { |
| | | adjustedWidth = rect.height * 0.24; |
| | | adjustedHeight = rect.width * 0.16; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5190 - (rect.yCoordinate + rect.height); |
| | | } |
| | | return { |
| | | ...rect, |
| | | xcoordinate: newX * 0.24, |
| | | ycoordinate: rect.xCoordinate * 0.16, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | | heighta: adjustedHeighta, |
| | | }; |
| | | }); |
| | | } |
| | | }; |
| | | function updateRectColors() { |
| | | adjustedRectsa.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | | rect.state = 5; |
| | | } |
| | | }); |
| | | } |
| | | function getRectColora(state) { |
| | | switch (state) { |
| | | case 3: |
| | | return '#f8e3c5'; |
| | | case 4: |
| | | return '#F0F8FF'; |
| | | case 5: |
| | | return '#911005'; |
| | | } |
| | | } |
| | | function showDialog(rect) { |
| | | currentGlassId.value = rect.glassId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | | blind.value = true; |
| | | } |
| | | // 破损 |
| | | const handleDamage = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { |
| | | glassId: currentGlassId.value, |
| | | // temperingFeedSequence: currenttemperingFeedSequence.value, |
| | | line: 4001, |
| | | status: 2, |
| | | workingProcedure: '钢化', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blind.value = false; |
| | | updateRectColors(); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | |
| | | <template> |
| | | <div style="margin-top: 10px;"> |
| | | <div> |
| | | <el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> |
| | | <el-scrollbar height="600px"> |
| | | <div style="position: relative;width: 1400px;"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> |
| | | <!-- <el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> --> |
| | | <div v-if="adjustedRects.length > 0"> |
| | | <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> |
| | | <el-scrollbar height="550px" width="1200px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="index" |
| | | @click="showDialog(rect)" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, |
| | | width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: rect.state === 4 ? '#d1edc4' : '#f8e3c5' }"> |
| | | backgroundColor: getRectColora(rect.state) }"> |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div >{{ rect.glassId }}</div> |
| | | <div >{{ rect.flowCardId }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <!-- <div style="margin-top: 25px;margin-left: -60px;">{{ rect.widtha }}*{{ rect.heighta }}</div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;"> |
| | | <el-button type="warning" plain :icon="Delete" @click="handleDamage" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | </template> |
| | |
| | | } |
| | | .centered-text { |
| | | /* 设置文字居中样式 */ |
| | | display: flex; |
| | | /* display: flex; */ |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 100%; /* 确保div占据整个矩形的高度 */ |
| | | font-size: small; |
| | | } |
| | | </style> |
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.workingProcedure" 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="teamsGroupsName" align="center" label="报工班组" min-width="120" /> |
| | | <el-table-column prop="deviceName" align="center" label="报工设备" min-width="120" /> |
| | | <el-table-column prop="line" align="center" label="线路" min-width="120" /> |
| | | <el-table-column prop="workingProcedure" align="center" label="工序" min-width="120" /> |
| | | <el-table-column prop="glassId" align="center" label="玻璃id" min-width="120" /> |
| | | <el-table-column prop="engineerId" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="temperingLayoutId" align="center" label="钢化版图id" min-width="120" /> |
| | | <el-table-column prop="damageTime" align="center" label="生产时间" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="类型" min-width="120" /> |
| | | <el-table-column prop="status" align="center" label="状态" min-width="120" /> |
| | | <el-table-column prop="processId" align="center" label="流程卡" min-width="120" /> |
| | | <el-table-column prop="orderNumber" align="center" label="序号" min-width="120" /> |
| | | <el-table-column prop="technologyNumber" align="center" label="层" min-width="120" /> |
| | | <el-table-column prop="breakageType" align="center" label="破损类型" min-width="120" /> |
| | | <el-table-column prop="breakageReason" align="center" label="破损原因" min-width="120" /> |
| | | <el-table-column prop="responsibleProcess" align="center" label="责任工序" min-width="120" /> |
| | | <el-table-column prop="responsiblePersonnel" align="center" label="责任人员" min-width="120" /> |
| | | <el-table-column prop="responsibleTeam" align="center" label="责任班组" min-width="120" /> |
| | | <el-table-column prop="responsibleEquipment" align="center" label="责任设备" min-width="120" /> |
| | | <el-table-column prop="remark" 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: '0', |
| | | status: '0', |
| | | workingProcedure: '0', |
| | | }); |
| | | const reportData = ref([]) |
| | | const timeRange = ref(["2022-01-01", "2022-01-01"]) |
| | | |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | const response = await request.post("/cacheVerticalGlass/damage/selectDamage", { |
| | | startTime: timeRange.value[0], |
| | | endTime: timeRange.value[1], |
| | | type: report.value.type, |
| | | status: report.value.status, |
| | | workingProcedure: report.value.workingProcedure |
| | | }) |
| | | if (response.code === 200) { |
| | | reportData.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | const responses = await request.post("/cacheVerticalGlass/damage/insertDamage", { |
| | | glassId:"P24060403|3|6", |
| | | line:"2001", |
| | | workingProcedure:"冷加工", |
| | | remark:"", |
| | | status:"2" |
| | | }) |
| | | }; |
| | | |
| | | 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 adda = ref(false) |
| | | const flake = ref(false) |
| | | const flakea = ref(false) |
| | | const flakeb = ref(false) |
| | | const flakec = ref(false) |
| | | const user = ref(''); |
| | | const projectNo = ref(''); |
| | | const workstationId = ref(''); |
| | | const id = ref(''); |
| | | const patternHeight = ref(''); |
| | | const patternWidth = ref(''); |
| | | const filmsId = ref(''); |
| | | const patternThickness = ref(''); |
| | | const number = ref(''); |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | const ida = ref(null); |
| | |
| | | // ElMessage.error('获取表格数据失败,请重试'); |
| | | } |
| | | }; |
| | | request.get("/loadGlass/LoadGlass/list").then((res) => { |
| | | window.localStorage.setItem('patternWidth', res.data.patternWidth) |
| | | window.localStorage.setItem('workstationId', res.data.workstationId) |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | tableDataa.value = res.data |
| | | console.log(res.data.patternWidth); |
| | | |
| | | let workstationId = window.localStorage.getItem('workstationId') |
| | | let patternWidth = window.localStorage.getItem('patternWidth') |
| | | if (patternWidth !== '' || workstationId == '1') { |
| | | flake.value = true |
| | | } else if (patternWidth !== '' || workstationId == '2') { |
| | | flakea.value = true |
| | | onMounted(() => { |
| | | list(''); |
| | | fetchOptions(''); |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onMounted(() => { |
| | | }); |
| | | const list = async () => { |
| | | try { |
| | | const response = await request.get('/loadGlass/LoadGlass/list'); |
| | | if (response.code == 200) { |
| | | tableDataa.value = response.data |
| | | if (tableDataa.value.length === 4) { |
| | | if (tableDataa.value[0].patternHeight > 0 && tableDataa.value[0].patternWidth > 0 && tableDataa.value[0].number > 0) { |
| | | flake.value = true; |
| | | } |
| | | if (tableDataa.value[1].patternHeight > 0 && tableDataa.value[1].patternWidth > 0 && tableDataa.value[1].number > 0) { |
| | | flakea.value = true; |
| | | } |
| | | if (tableDataa.value[2].patternHeight > 0 && tableDataa.value[2].patternWidth > 0 && tableDataa.value[2].number > 0) { |
| | | flakeb.value = true; |
| | | } |
| | | if (tableDataa.value[3].patternHeight > 0 && tableDataa.value[3].patternWidth > 0 && tableDataa.value[3].number > 0) { |
| | | flakec.value = true; |
| | | } |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | // router.push("/login") |
| | | ElMessage.warning(response.data); |
| | | } |
| | | }); |
| | | } catch (error) { |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | // 假设这是您的响应处理函数 |
| | | // request.get("/loadGlass/LoadGlass/list").then((res) => { |
| | | // if (res.code == 200) { |
| | | // tableDataa.value = res.data |
| | | // if (tableDataa.value.length === 4) { |
| | | // if (tableDataa.value[0].patternHeight > 0) { |
| | | // flake.value = true; |
| | | // } |
| | | // if (tableDataa.value[1].patternHeight > 0) { |
| | | // flakea.value = true; |
| | | // } |
| | | // if (tableDataa.value[2].patternHeight > 0) { |
| | | // flakeb.value = true; |
| | | // } |
| | | // if (tableDataa.value[3].patternHeight > 0) { |
| | | // flakec.value = true; |
| | | // } |
| | | // } |
| | | // } else { |
| | | // ElMessage.warning(res.message) |
| | | // // router.push("/login") |
| | | // } |
| | | // }); |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | |
| | | if(data.prioritylist!=null){ |
| | | tableData.splice(0, tableData.length, ...data.prioritylist[0]); |
| | | } |
| | | if(data.list!=null){ |
| | | tableDataa.value = data.list[0] |
| | | // console.log("更新后数据", tableData); |
| | | } |
| | | }; |
| | | const requestData = { |
| | | state: 100 |
| | |
| | | options.value = []; // 清空选项列表 |
| | | } |
| | | }; |
| | | // 初始化加载数据(如果需要) |
| | | onMounted(() => { |
| | | fetchOptions(''); |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | const user = ref(''); |
| | | const projectNo = ref(''); |
| | | const workstationId = ref(''); |
| | | const id = ref(''); |
| | | const patternHeight = ref(''); |
| | | const patternWidth = ref(''); |
| | | const filmsId = ref(''); |
| | | const patternThickness = ref(''); |
| | | const number = ref(''); |
| | | // 添加 |
| | | const handleBindRack = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | ida.value = row.id; |
| | | console.log(ida.value); |
| | | add.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 添加 |
| | | const handleConfirm = async () => { |
| | | console.log(ida.value); |
| | | // console.log('id.value:', id.value); |
| | | if ((ida.value === 2 || ida.value === 4) && (parseInt(patternHeight.value, 10) >= 2700 )) { |
| | | if ((ida.value === 2 || ida.value === 4) && (parseInt(selectedValuea.value, 10) >= 2700 )) { |
| | | try { |
| | | const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', { |
| | | id: workstationId.value, |
| | |
| | | patternThickness: selectedValuec.value, |
| | | number: number.value |
| | | }); |
| | | // window.localStorage.setItem('workstationId', workstationId.value) |
| | | // window.localStorage.setItem('patternHeight', selectedValuea.value) |
| | | // window.localStorage.setItem('patternWidth', selectedValue.value) |
| | | // window.localStorage.setItem('number', number.value) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | add.value = false; |
| | | tableDataa.value = response.data; |
| | | // let workstationId = window.localStorage.getItem('workstationId') |
| | | // let patternHeight = window.localStorage.getItem('patternHeight') |
| | | // let patternWidth = window.localStorage.getItem('patternWidth') |
| | | // let number = window.localStorage.getItem('number') |
| | | if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '1') { |
| | | flake.value = true |
| | | } else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '2'){ |
| | | flakea.value = true |
| | | }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '3'){ |
| | | flakeb.value = true |
| | | }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '4'){ |
| | | flakec.value = true |
| | | } |
| | | // if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '1') { |
| | | // flake.value = true |
| | | // } else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '2'){ |
| | | // flakea.value = true |
| | | // }else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '3'){ |
| | | // flakeb.value = true |
| | | // }else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '4'){ |
| | | // flakec.value = true |
| | | // } |
| | | selectedValuea.value = ''; |
| | | selectedValue.value = ''; |
| | | selectedValueb.value = ''; |
| | | selectedValuec.value = ''; |
| | | number.value = ''; |
| | | window.localStorage.setItem('workstationId', response.data.workstationId) |
| | | let workstationId = window.localStorage.getItem('workstationId') |
| | | if (workstationId == '1') { |
| | | flake.value = true |
| | | } else if (workstationId == '2'){ |
| | | flakea.value = true |
| | | } |
| | | list() |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求错误 |
| | | console.error(error); |
| | | alert('请求失败,请稍后再试!'); |
| | | } |
| | | } |
| | | else if( ida.value === 1 || ida.value === 3){ |
| | |
| | | // window.location.reload() |
| | | add.value = false; |
| | | tableDataa.value = response.data; |
| | | if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '1') { |
| | | flake.value = true |
| | | } else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '2'){ |
| | | flakea.value = true |
| | | }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '3'){ |
| | | flakeb.value = true |
| | | }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '4'){ |
| | | flakec.value = true |
| | | } |
| | | selectedValuea.value = ''; |
| | | selectedValue.value = ''; |
| | | selectedValueb.value = ''; |
| | | selectedValuec.value = ''; |
| | | number.value = ''; |
| | | window.localStorage.setItem('workstationId', response.data.workstationId) |
| | | let workstationId = window.localStorage.getItem('workstationId') |
| | | if (workstationId == '1') { |
| | | flake.value = true |
| | | } else if (workstationId == '2'){ |
| | | flakea.value = true |
| | | } |
| | | list() |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求错误 |
| | | console.error(error); |
| | | alert('请求失败,请稍后再试!'); |
| | | } |
| | | } |
| | | else { |
| | |
| | | ElMessage.success(response.message); |
| | | adda.value = false; |
| | | tableDataa.value = response.data; |
| | | window.localStorage.setItem('workstationId', response.data.workstationId) |
| | | let workstationId = window.localStorage.getItem('workstationId') |
| | | if (workstationId == '1') { |
| | | // window.localStorage.setItem('workstationId', response.data.workstationId) |
| | | // let workstationId = window.localStorage.getItem('workstationId') |
| | | if (workstationId.value == '1') { |
| | | flake.value = false |
| | | } else if (workstationId == '2'){ |
| | | } else if (workstationId.value == '2'){ |
| | | flakea.value = false |
| | | }else if (workstationId.value == '3'){ |
| | | flakeb.value = false |
| | | }else if (workstationId.value == '4'){ |
| | | flakec.value = false |
| | | } |
| | | list() |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | |
| | | const data = JSON.parse(event.data); // 解析消息为JSON |
| | | |
| | | if (data && Array.isArray(data.InkageStatus) && data.InkageStatus.length > 0) { |
| | | if(data.InkageStatus!=null){ |
| | | const status = data.InkageStatus[0]; |
| | | cuttingMachine.value = status; |
| | | upstatus.value = status === '1' ? t('basicData.machine') : t('basicData.machineaa'); |
| | | cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005'; |
| | | inKageWord.value = status === '1' ? 0 : 1; |
| | | } |
| | | } else { |
| | | // 处理错误情况或无效数据 |
| | | console.error('接收到的数据无效', data); |
| | |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | :data="tableData" |
| | | > |
| | | <el-table-column prop="layoutSequence" :label="$t('basicData.layoutSequence')" width="100" align="center"/> |
| | | <el-table-column prop="engineeringId" :label="$t('basicData.projectnumber')" width="200" align="center"/> |
| | | <el-table-column prop="width" :label="$t('basicData.glasswidth')" align="center"/> |
| | | <el-table-column prop="height" :label="$t('basicData.glassheight')" align="center"/> |
| | | <el-table-column prop="filmsId" :label="$t('basicData.coatingtypes')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('basicData.quantity')" align="center"/> |
| | | <el-table-column :label="$t('basicData.quantity')" align="center"> |
| | | <template #default="{ row }"> |
| | | <!-- 这里总是显示 1 --> |
| | | <span>{{ 1 }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="thickness" :label="$t('basicData.thickness')" align="center"/> |
| | | <!-- <el-table-column |
| | | align="center" |
| | |
| | | </template> |
| | | </el-dialog> --> |
| | | <div id="parent"> |
| | | <img src="../../assets/shangpianji.png" alt="" style="max-width: 20%;max-height: 20%;margin-top: 20px;margin-left: 500px;"> |
| | | <img src="../../assets/shangpian.png" alt="" style="max-width: 40%;max-height: 40%;margin-top: 20px;margin-left: 340px;"> |
| | | <div id="overlay" v-show="flake"></div> |
| | | <div id="overlaya" v-show="flakea"></div> |
| | | <div id="overlayb" v-show="flakeb"></div> |
| | | <div id="overlayc" v-show="flakec"></div> |
| | | </div> |
| | | <div style="margin-top: -350px;margin-left: 650px;"> |
| | | <div style="margin-top: -300px;margin-left: 680px;"> |
| | | <el-table :data="tableDataa" border style="width: 85%" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | |
| | | width: 1500px; |
| | | margin-left: -300px |
| | | } |
| | | #overlayb{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 228px; |
| | | height: 16px; |
| | | background-color: #529b2e; |
| | | margin-top: -303px; |
| | | margin-left: 355px; |
| | | } |
| | | #overlayc{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 228px; |
| | | height: 16px; |
| | | background-color: #529b2e; |
| | | margin-top: -303px; |
| | | margin-left:703px; |
| | | } |
| | | #overlay{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 212px; |
| | | height: 15px; |
| | | width: 228px; |
| | | height: 16px; |
| | | background-color: #529b2e; |
| | | margin-top: -404px; |
| | | margin-left: 542px; |
| | | margin-top: -45px; |
| | | margin-left: 355px; |
| | | } |
| | | #overlaya{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 212px; |
| | | height: 15px; |
| | | width: 228px; |
| | | height: 16px; |
| | | background-color: #529b2e; |
| | | margin-top: -38px; |
| | | margin-left: 537px; |
| | | margin-top: -45px; |
| | | margin-left: 703px; |
| | | } |
| | | |
| | | </style> |
| | |
| | | const dialogFormVisible = ref(false) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | | const dialogFormVisiblec = ref(false) |
| | | const tableData = ref([]) |
| | | const tableDatagh = ref([]) |
| | | const tableDatab = ref([]) |
| | | const tableDatac = ref([]) |
| | | const tableDatad = ref([]) |
| | |
| | | const cell9=ref(true); |
| | | const selectedRow = ref(null); // 存储选中的行数据 |
| | | |
| | | |
| | | onMounted(async () => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass'); |
| | | if (response.code === 200) { |
| | | tableDatagh.value = response.data |
| | | } else { |
| | | ElMessage.warning(response.msg) |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error fetching rects :', error); |
| | | } |
| | | }); |
| | | // 当前页码和每页显示的条数 |
| | | 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 { |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 指定钢化 |
| | | const brokee = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('searchOrder.specifytemperinga'), |
| | | t('searchOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('searchOrder.yes'), |
| | | cancelButtonText: t('searchOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/TemperingGlass",{ |
| | | engineerId: row.engineer_id, |
| | | temperingLayoutId: row.tempering_layout_id, |
| | | }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 出片队列拿走 |
| | | const brokeb = async(row) => { |
| | | try { |
| | |
| | | // 定义消息处理函数,更新 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(() => { |
| | |
| | | <div style="height: 600px;"> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">{{ $t('searchOrder.cageinformation') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="dialogFormVisiblec = true">{{ $t('searchOrder.temperingqueries') }}</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" /> |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisiblec" top="5vh" width="85%" :title="$t('searchOrder.temperingqueries')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 500px;" |
| | | :data="tableDatagh" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="engineer_id" fixed align="center" :label="$t('searchOrder.projectnumber')" min-width="150"/> |
| | | <el-table-column prop="tempering_layout_id" fixed align="center" :label="$t('searchOrder.layoutnumber')" min-width="120" /> |
| | | <el-table-column prop="count" align="center" :label="$t('searchOrder.numberglasses')" min-width="150" /> |
| | | <el-table-column fixed="right" :label="$t('searchOrder.operate')" align="center" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="brokee(scope.row)">{{ $t('searchOrder.specifytempering') }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | </template> |
| | | <style scoped> |
| | |
| | | } |
| | | |
| | | .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; // 打开绑定架子对话框 |
| | |
| | | console.log('清除成功'); |
| | | ElMessage.success(response.message); |
| | | dialogFormVisiblea2.value = false; |
| | | } else if (response.code === 400) { |
| | | } else if (response.code === 500) { |
| | | // 清除失败的逻辑 |
| | | console.log('清除失败'); |
| | | console.log(response.message); // 打印服务器返回的错误信息 |
| | |
| | | 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'; |
| | |
| | | |
| | | |
| | | const response = await request.post('unLoadGlass/downWorkStation/updateDownWorkstation', { |
| | | enableState: 1 - row.enableState |
| | | enableState: row.enableState, |
| | | id: row.id |
| | | |
| | | |
| | | }); |
| | | console.log('Updated row status:', response.data); |
| | |
| | | }; |
| | | |
| | | |
| | | </script> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 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="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="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="work_state" align="center" :label="$t('reportWork.state')" 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 |
| | | align="center" |
| | |
| | | </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" |
| | |
| | | */ |
| | | @ApiModelProperty(value = "宽") |
| | | private double width; |
| | | /** |
| | | * 宽 |
| | | */ |
| | | @ApiModelProperty(value = "高") |
| | | private double height; |
| | | |
| | | /** |
| | | * 格子号 |
| | |
| | | @ApiModelProperty(value = "玻璃id") |
| | | private Integer slot; |
| | | |
| | | /** |
| | | * x坐标 |
| | | */ |
| | | @ApiModelProperty(value = "x坐标", position = 13) |
| | | private Integer xCoordinate; |
| | | |
| | | /** |
| | | * y坐标 |
| | | */ |
| | | @ApiModelProperty(value = "y坐标", position = 14) |
| | | private Integer yCoordinate; |
| | | |
| | | } |
| | |
| | | * A09出片目标位置 d02卧转立 2001 |
| | | * A10出片目标位置 d05卧转立 2002 |
| | | */ |
| | | public static final Integer OUT_TARGET_POSITION_ZERO = 0; |
| | | public static final Integer A09_OUT_TARGET_POSITION = 2001; |
| | | public static final Integer A10_OUT_TARGET_POSITION = 2002; |
| | | |
| | |
| | | * 识别后成功状态100 |
| | | * 出片任务101 |
| | | * 人工下片102 |
| | | * 出片中103 |
| | | * 拿走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_OUT_ING = 103; |
| | | public static final Integer GLASS_STATE_TAKE = 200; |
| | | public static final Integer GLASS_STATE_DAMAGE = 201; |
| | | |
| | |
| | | public static final Integer BIG_STORAGE_OUT_SUCCESS = 3; |
| | | public static final Integer BIG_STORAGE_OUT_ERROR = 4; |
| | | public static final Integer BIG_STORAGE_OUT_DAMAGE = 5; |
| | | public static final List<Integer> BIG_STORAGE_OUT_ALL = Arrays.asList(2, 3); |
| | | |
| | | /** |
| | | * 卧转立出片请求 |
| | |
| | | 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") |
| | | @ResponseBody |
| | | 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)); |
| | | @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()); |
| | | String workingProcedure =map.get("workingProcedure").toString(); |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedure)); |
| | | } |
| | | |
| | | @ApiOperation("报工") |
| | | @GetMapping("/submitDamage") |
| | | public Result submitDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | damageService.submitDamage(startTime,endTime,type,status,workingProcedureId); |
| | | @PostMapping("/submitDamage") |
| | | public Result submitDamage(@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()); |
| | | String workingProcedure =map.get("workingProcedure").toString(); |
| | | damageService.submitDamage(startTime,endTime,type,status,workingProcedure); |
| | | return Result.build(200,"报工成功",1); |
| | | } |
| | | |
| | | @ApiOperation("报工数据修改") |
| | | @GetMapping("/updateDamage") |
| | | public Result updateDamage(List<Damage> damageList) { |
| | | @PostMapping("/updateDamage") |
| | | public Result updateDamage(@RequestBody List<Damage> damageList) { |
| | | damageService.updateBatchById(damageList); |
| | | return Result.build(200,"修改成功",1); |
| | | } |
| | | |
| | | @ApiOperation("报工数据新增") |
| | | @PostMapping("/insertDamage") |
| | | public Result insertDamage(@RequestBody Damage damage) { |
| | | damageService.insertDamage(damage); |
| | | 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; |
| | | |
| | | /** |
| | | * 备注 |
| | |
| | | package com.mes.damage.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | */ |
| | | @DS("hangzhoumes") |
| | | public interface DamageMapper extends BaseMapper<Damage> { |
| | | |
| | | } |
| | |
| | | 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, String workingProcedure); |
| | | |
| | | void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | void submitDamage(String startTime, String endTime, int type, int status, String workingProcedure); |
| | | |
| | | void insertDamage(Damage damage); |
| | | } |
| | |
| | | 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, String 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(!"0".equals(workingProcedure)){ |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedure,workingProcedure); |
| | | } |
| | | return baseMapper.selectList(damageSelectWrapper); |
| | | } |
| | |
| | | * 提交报工 |
| | | */ |
| | | @Override |
| | | public void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId){ |
| | | public void submitDamage(String startTime, String endTime, int type, int status, String workingProcedure){ |
| | | LambdaUpdateWrapper<Damage> damageUpdateWrapper=new LambdaUpdateWrapper<>(); |
| | | damageUpdateWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | |
| | | if (status!=0){ |
| | | damageUpdateWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(workingProcedureId!=0){ |
| | | damageUpdateWrapper.eq(Damage::getWorkingProcedure,workingProcedureId); |
| | | if(!"0".equals(workingProcedure)){ |
| | | damageUpdateWrapper.eq(Damage::getWorkingProcedure,workingProcedure); |
| | | } |
| | | Damage damage=new Damage(); |
| | | damage.setStatus(2); |
| | |
| | | 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.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | |
| | | * @author wu |
| | | * @since 2024-04-29 |
| | | */ |
| | | @DS("hangzhoumes") |
| | | public interface GlassInfoMapper extends MPJBaseMapper<GlassInfo> { |
| | | |
| | | } |
| | |
| | | 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); |
| | |
| | | private ReportingDamageMapper reportingDamageMapper; |
| | | @Autowired |
| | | private AwaitingRepairMapper awaitingRepairMapper; |
| | | |
| | | @Override |
| | | public List<Reportingdamage> selectDamage(Reportingdamage reportingdamage) { |
| | | QueryWrapper<Reportingdamage>queryWrapper=new QueryWrapper<>(); |
| | | queryWrapper.select("this_process,sum(completed_quantity)as completedQuantity,sum(breakage_quantity)as breakageQuantity,device_name ") |
| | | .eq("this_process",reportingdamage.getThisProcess()) |
| | | queryWrapper.select("this_process,sum(completed_quantity) as completedQuantity,sum(breakage_quantity) as breakageQuantity ") |
| | | //.eq("this_process", reportingdamage.getThisProcess()) |
| | | //.eq("device_name",reportingdamage.getDeviceName()) |
| | | .ge("reporting_work_time",reportingdamage.getReportingWorkTime()) |
| | | .groupBy("this_process"); |
| | |
| | | private Integer glassType; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | @ApiModelProperty(value = "高", position = 7) |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty(value = "厚度", position = 8) |
| | |
| | | private Integer temperingFeedSequence; |
| | | |
| | | /** |
| | | * x坐标 |
| | | */ |
| | | @ApiModelProperty(value = "x坐标", position = 13) |
| | | private Integer xCoordinate; |
| | | |
| | | /** |
| | | * y坐标 |
| | | */ |
| | | @ApiModelProperty(value = "y坐标", position = 14) |
| | | private Integer yCoordinate; |
| | | |
| | | /** |
| | | * 旋转角度(逆时针) |
| | | */ |
| | | @ApiModelProperty(value = "旋转角度(逆时针)", position = 15) |
| | |
| | | @ApiModelProperty(value = "状态", position = 16) |
| | | private Integer state; |
| | | |
| | | /** |
| | | * 工程id |
| | | */ |
| | | @ApiModelProperty(value = "工程id", position = 17) |
| | | private String engineerId; |
| | | } |
New file |
| | |
| | | package com.mes.temperingglass.service; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface TemperingGlassInfoService extends MPJBaseService<TemperingGlassInfo> { |
| | | /** |
| | | * 等待中的玻璃 |
| | | * @return |
| | | */ |
| | | List<TemperingGlassInfo> selectWaitingGlass(); |
| | | /** |
| | | * 进炉中的玻璃 |
| | | * @return |
| | | */ |
| | | List<TemperingGlassInfo> selectIntoGlass(TemperingGlassInfo temperingGlassInfo); |
| | | /** |
| | | * 出炉中的玻璃 |
| | | * @return |
| | | */ |
| | | List<TemperingGlassInfo> selectOutGlass(); |
| | | /** |
| | | * 钢化后的玻璃 |
| | | * @return |
| | | */ |
| | | List<TemperingGlassInfo> selectOverGlass(); |
| | | /** |
| | | * 查询钢化后的版图id |
| | | * @return |
| | | */ |
| | | List<TemperingGlassInfo> selectLayoutId(); |
| | | /** |
| | | * 查询钢化状态 |
| | | * @return |
| | | */ |
| | | List<TemperingGlassInfo> selectTaskType(); |
| | | /** |
| | | * 钢化模块破损 |
| | | * @return |
| | | */ |
| | | Integer updateTemperingState(TemperingGlassInfo temperingGlassInfo); |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.temperingglass.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Service |
| | | @DS("salve_hangzhoumes") |
| | | public class TemperingGlassInfoServiceImpl extends MPJBaseServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingGlassInfoService { |
| | | @Autowired |
| | | TemperingGlassInfoMapper temperingMapper; |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectWaitingGlass() { |
| | | //获取等待进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("Top 1 *").eq("state",1); |
| | | TemperingGlassInfo glass=temperingMapper.selectOne(wrapper); |
| | | QueryWrapper<TemperingGlassInfo> glassinfo = new QueryWrapper<>(); |
| | | glassinfo.eq("engineer_id",glass.getEngineerId()) |
| | | .eq("tempering_layout_id", glass.getTemperingLayoutId()); |
| | | return temperingMapper.selectList(glassinfo); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectIntoGlass(TemperingGlassInfo temperingGlassInfo) { |
| | | //获取进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("tempering_layout_id", temperingGlassInfo.getTemperingLayoutId()) |
| | | .eq("engineer_id", temperingGlassInfo.getEngineerId()) |
| | | .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectOutGlass() { |
| | | //获取出炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrap = new QueryWrapper<>(); |
| | | wrap.select("Top 1 *").eq("state",3); |
| | | TemperingGlassInfo glass=temperingMapper.selectOne(wrap); |
| | | //根据工程号和版图获取数据 |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.eq("engineer_id",glass.getEngineerId()) |
| | | .eq("tempering_layout_id", glass.getTemperingLayoutId()) |
| | | .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectOverGlass() { |
| | | //获取过旋转台最大的钢化版图id |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.select("Top 1 *").eq("state", 4) |
| | | .orderByDesc("tempering_layout_id,engineer_id"); |
| | | //根据最大的版图id显示钢化后的版图信息 |
| | | TemperingGlassInfo glassinfo= temperingMapper.selectOne(wapper); |
| | | if (glassinfo == null) { |
| | | return null; // 直接返回null,表示没有找到符合条件的记录 |
| | | } |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("tempering_layout_id",glassinfo.getTemperingLayoutId()) |
| | | .eq("engineer_id",glassinfo.getEngineerId()); |
| | | |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectLayoutId() { |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("distinct tempering_layout_id,engineer_id") |
| | | .eq("state",2) |
| | | .orderByAsc("tempering_layout_id"); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectTaskType() { |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("state") |
| | | .groupBy("state"); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateTemperingState(TemperingGlassInfo temperingGlassInfo) { |
| | | UpdateWrapper<TemperingGlassInfo> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("glass_id",temperingGlassInfo.getGlassId()) |
| | | .lt("state",5) |
| | | .set("state", temperingGlassInfo.getState());; |
| | | if (temperingMapper.update(null,wrapper) > 0) { |
| | | return 200; |
| | | }else { |
| | | return 100; |
| | | } |
| | | } |
| | | } |
| | |
| | | s7PLC.writeUInt16(address, data); |
| | | result = true; |
| | | } catch (Exception ex) { |
| | | System.out.println("向plc写命令过程中发生异常,原因为:" + ex.getMessage()); |
| | | reStartS7client(); |
| | | } finally { |
| | | tryCount -= 1; |
| | |
| | | public void sendMessage(String message) { |
| | | try { |
| | | // log.info("服务端给客户端[{}]发送消息{}", this.session.getId(), message); |
| | | if(this.session.isOpen()){ |
| | | int maxChunkSize = 50000; // 定义最大的分块大小 |
| | | int length = message.length(); |
| | | if(length>50000){ |
| | | int chunks = (int) Math.ceil((double) length / maxChunkSize); |
| | | //分块发送消息 |
| | | for (int i = 0; i < chunks; i++) { |
| | | int startIndex = i * maxChunkSize; |
| | | int endIndex = Math.min(startIndex + maxChunkSize, length); |
| | | String chunk = message.substring(startIndex, endIndex); |
| | | |
| | | // 判断是否是最后一块消息 |
| | | boolean isLastChunk = (i == chunks - 1); |
| | | if(isLastChunk==true){ |
| | | chunk+="<END>"; |
| | | } |
| | | // 发送分块消息,并传递是否是最后一块消息的标识 |
| | | this.session.getBasicRemote().sendText(chunk); |
| | | } |
| | | }else{ |
| | | this.session.getBasicRemote().sendText(message); |
| | | } |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("服务端发送消息给客户端失败", e); |
| | | log.error("发送消息给客户端失败:{}", e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.mes.work_assignment.controller; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import com.mes.work_assignment.entity.WorkAssignment; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @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)); |
| | | } |
| | | |
| | | @ApiOperation("值班数据修改") |
| | | @PostMapping("/updateWorkAssignment") |
| | | public Result updateWorkAssignment(@RequestBody List<WorkAssignment> workAssignmentList) { |
| | | workAssignmentService.saveOrUpdateBatch(workAssignmentList); |
| | | return Result.build(200,"修改成功",1); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.mes.work_assignment.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.mes.work_assignment.entity.WorkAssignment; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | |
| | | * @author wu |
| | | * @since 2024-07-01 |
| | | */ |
| | | @DS("hangzhoumes") |
| | | public interface WorkAssignmentMapper extends BaseMapper<WorkAssignment> { |
| | | |
| | | } |
| | |
| | | |
| | | 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); |
| | |
| | | @ApiOperation("新增角色及角色下的权限信息") |
| | | @PostMapping("/saveRole") |
| | | // @PreAuthorize("hasAuthority('sys:role:save')") |
| | | public Result<SysRole> saveRole(@Validated @RequestBody SysRoleVO sysRoleVO) { |
| | | return Result.success(sysRoleService.saveRole(sysRoleVO)); |
| | | public Result<SysRoleVO> saveRole(@Validated @RequestBody SysRoleVO sysRoleVO) { |
| | | //return Result.success(sysRoleService.saveRole(sysRoleVO)); |
| | | sysRoleService.saveRole(sysRoleVO); |
| | | return Result.build(200,"新增成功",sysRoleVO); |
| | | } |
| | | |
| | | @ApiOperation("编辑角色及角色下的权限信息") |
| | | @PostMapping("/updateRole") |
| | | // @PreAuthorize("hasAuthority('sys:role:save')") |
| | | public Result<String> updateRole(@Validated @RequestBody SysRoleVO sysRoleVO) { |
| | | return Result.success(sysRoleService.updateRole(sysRoleVO)); |
| | | public Result<SysRoleVO> updateRole(@Validated @RequestBody SysRoleVO sysRoleVO) { |
| | | // return Result.success(sysRoleService.updateRole(sysRoleVO)); |
| | | sysRoleService.updateRole(sysRoleVO); |
| | | return Result.build(200,"新增成功",sysRoleVO); |
| | | } |
| | | |
| | | @ApiOperation("查询角色及角色下的权限信息") |
| | |
| | | |
| | | 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> { |
| | | |
| | | } |
| | |
| | | roleMenu.setMenuId(menu.getId()); |
| | | return roleMenu; |
| | | }).collect(Collectors.toList()); |
| | | // 使用流处理菜单列表,提取 children 的 id,并设置到 SysRoleMenu 中 |
| | | List<SysRoleMenu> childrenList = menuList.stream() |
| | | .flatMap(menu -> menu.getChildren().stream()) // 扁平化处理 children 列表 |
| | | .map(child -> { |
| | | SysRoleMenu roleMenu = new SysRoleMenu(); |
| | | roleMenu.setRoleId(roleId); |
| | | roleMenu.setMenuId(child.getId()); // 设置 child 的 id 到 menuId |
| | | return roleMenu; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | log.info("清空角色权限表中该角色信息"); |
| | | // 先删除原来的记录,再保存新的 |
| | | sysRoleMenuService.remove(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getRoleId, roleId)); |
| | | sysRoleMenuService.saveBatch(roleMenuList); |
| | | sysRoleMenuService.saveBatch(childrenList); |
| | | // 删除缓存 |
| | | sysUserService.clearUserAuthorityInfoByRoleId(roleId); |
| | | return "success"; |
| | |
| | | |
| | | @ApiOperation("退出登录") |
| | | @PostMapping("/logout") |
| | | // @PreAuthorize("hasRole('ROLE_admin')") |
| | | @PreAuthorize("hasAuthority('xt:yh')") |
| | | public Result<String> logout() { |
| | | return Result.success(sysUserService.logout()); |
| | |
| | | @PostMapping("/updateUser") |
| | | // @PreAuthorize("hasAuthority('sys:user:update')") |
| | | public Result<List<SysUserVO>> updateUser(@Validated @RequestBody SysUserVO sysUser) { |
| | | //return Result.success(sysUserService.updateUser(sysUser)); |
| | | sysUserService.updateUser(sysUser); |
| | | GeneralRequest request=new GeneralRequest(); |
| | | request.setKey(""); |
| | | //request.setKey(""); |
| | | return Result.success(sysUserService.listByUserName(request)); |
| | | //更改了修改之后返回所有用户列表 |
| | | } |
| | |
| | | package com.mes.userinfo.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | 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 |
| | | @DS("hangzhoumes") |
| | | 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> { |
| | | |
| | | } |
| | |
| | | filters: |
| | | - StripPrefix=2 |
| | | |
| | | |
| | | - id: glassStorage |
| | | uri: lb://glassStorage |
| | | predicates: |
| | | - Path=/api/glassStorage/** |
| | | filters: |
| | | - StripPrefix=2 |
| | | |
| | | # - id: unLoadGlass |
| | | # uri: lb://unLoadGlass |
| | | # predicates: |
| | |
| | | */ |
| | | EdgStorageCage selectNearestEmpty(int currentSlot, boolean flag); |
| | | |
| | | /** |
| | | * 查询笼内空格 |
| | | * @return |
| | | */ |
| | | List<EdgStorageCage> selectCacheEmpty(); |
| | | |
| | | /** |
| | | * 查询笼内出片顺序详情 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 修改理片笼信息 |
| | | * |
| | | * @param edgStorageCage |
| | | * @return |
| | | */ |
| | | boolean updateEdgStorageCage(EdgStorageCage edgStorageCage); |
| | | |
| | | /** |
| | | * 更新理片笼详情信息 |
| | | * |
| | | * @param edgStorageCageId |
| | | * @param edgStorageCageDetails |
| | | * @return |
| | | */ |
| | | boolean updateEdgStorageCageDetails(int edgStorageCageId, EdgStorageCageDetails edgStorageCageDetails); |
| | | |
| | | } |
| | |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageMapper; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | |
| | | |
| | | @Autowired |
| | | EdgStorageCageMapper edgStorageCageMapper; |
| | | @Autowired |
| | | GlassInfoMapper glassInfoMapper; |
| | | |
| | | @Autowired |
| | | TaskCacheService taskCacheService; |
| | |
| | | log.info("前端传递数据不全:{}",arguments); |
| | | return false; |
| | | } |
| | | int state=controlsId==200?3:2; |
| | | int state; |
| | | if(controlsId==200||controlsId==201){ |
| | | state=controlsId==200?3:2; |
| | | }else if (controlsId==300||controlsId==301){ |
| | | state=controlsId==300?3:2; |
| | | }else{ |
| | | log.info("前端传递状态不合法:{}",arguments); |
| | | return false; |
| | | } |
| | | |
| | | List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | if (edgStorageCageDetails.size() == 1) { |
| | | EdgStorageCageDetails item = edgStorageCageDetails.get(0); |
| | | item.setState(controlsId); |
| | | List<GlassInfo> GlassInfos = glassInfoMapper.selectList(new MPJLambdaQueryWrapper<GlassInfo>() |
| | | .selectAll(GlassInfo.class) |
| | | .eq(GlassInfo::getGlassId, glassId)); |
| | | if (GlassInfos.size() == 1) { |
| | | Damage damage =new Damage(); |
| | | damage.setGlassId(glassId); |
| | | damage.setLine(line); |
| | |
| | | damage.setRemark(""); |
| | | damage.setStatus(state);//201破损,200拿走 =》破损表 2破损 3 拿走 |
| | | damageService.insertDamage(damage); |
| | | baseMapper.update(item, new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | return true; |
| | | }else{ |
| | | return false; |
| | | } |
| | | List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .selectAll(EdgStorageCageDetails.class) |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | if (edgStorageCageDetails.size() == 1) { |
| | | EdgStorageCageDetails item = edgStorageCageDetails.get(0); |
| | | item.setState(controlsId); |
| | | baseMapper.update(item, new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | } |
| | | |
| | | // Sql版本 |
| | | // List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | // if (edgStorageCageDetails.size() == 1) { |
| | |
| | | // baseMapper.update(edgStorageCageDetails.get(0), new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | // return true; |
| | | // } |
| | | return false; |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.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); |
| | | 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, " + |
| | |
| | | log.info("6、添加出片任务是否完成:{}", taskCacheStatus); |
| | | } else { |
| | | log.info("5、非直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | LambdaQueryWrapper<EdgStorageCageDetails> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(EdgStorageCageDetails::getGlassId, glassInfo.getGlassId()); |
| | | EdgStorageCageDetails updateDetail = new EdgStorageCageDetails(); |
| | | updateDetail.setState(Const.GLASS_STATE_OUT); |
| | | edgStorageCageDetailsService.update(updateDetail, wrapper); |
| | | LambdaUpdateWrapper<EdgStorageCageDetails> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.eq(EdgStorageCageDetails::getGlassId, glassInfo.getGlassId()).set(EdgStorageCageDetails::getState, Const.GLASS_STATE_OUT); |
| | | edgStorageCageDetailsService.update(wrapper); |
| | | log.info("5、更新出片玻璃的状态为{}", Const.GLASS_STATE_OUT); |
| | | |
| | | boolean taskCacheStatus = saveTaskCache(glassInfo.getGlassId(), glassInfo.getSlot(), endcell, Const.GLASS_CACHE_TYPE_OUT); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.mapper.TaskCacheMapper; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class TaskCacheServiceImpl extends ServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService { |
| | | |
| | |
| | | int serialNumber=1; |
| | | for(TaskCache taskCache1:taskCache){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | GlassInfo glassInfo=glassInfoMapper.selectOne(new MPJLambdaWrapper<GlassInfo>() |
| | | // GlassInfo glassInfo=glassInfoMapper.selectOne(new MPJLambdaWrapper<GlassInfo>() |
| | | // .selectAll(GlassInfo.class) |
| | | // .eq(GlassInfo::getGlassId,taskCache1.getGlassId())); |
| | | List<GlassInfo> glassInfos=glassInfoMapper.selectJoinList(GlassInfo.class, new MPJLambdaWrapper<GlassInfo>() |
| | | .selectAll(GlassInfo.class) |
| | | .eq(GlassInfo::getGlassId,taskCache1.getGlassId())); |
| | | if(glassInfo!=null){ |
| | | .innerJoin(EdgStorageCageDetails.class, on -> on |
| | | .eq(EdgStorageCageDetails::getGlassId, GlassInfo::getGlassId) |
| | | .eq(EdgStorageCageDetails::getEngineerId, GlassInfo::getEngineerId)) |
| | | .eq(GlassInfo::getGlassId,taskCache1.getGlassId()) |
| | | .eq(EdgStorageCageDetails::getState,Const.GLASS_STATE_IN) |
| | | ); |
| | | if(glassInfos.size()==1){ |
| | | GlassInfo glassInfo=glassInfos.get(0); |
| | | map.put("Line",line);//线路 2001 1线, 2002 2线 |
| | | map.put("Width",glassInfo.getWidth());//宽 |
| | | map.put("Height",glassInfo.getHeight());//高 |
| | |
| | | map.put("FilmsId",glassInfo.getFilmsid());//膜系 |
| | | map.put("SerialNumber",serialNumber);//出片顺序 |
| | | result.add(map); |
| | | }else if(glassInfos.size()>1){ |
| | | log.info("数据不符合逻辑--磨边队列glassId重复:",glassInfos); |
| | | return new ArrayList<>(); |
| | | } |
| | | serialNumber++; |
| | | } |
| | |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.mapper.TaskCacheMapper; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.taskcache.service.impl.TaskCacheServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | |
| | | GlassInfoService glassInfoService; |
| | | @Autowired |
| | | CacheGlassTask cacheGlassTask; |
| | | |
| | | @Autowired |
| | | TaskCacheService taskCacheService; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | |
| | | |
| | | @Test |
| | | public void testSelectCacheEmpty() { |
| | | List<EdgStorageCage> map = edgStorageCageService.selectCacheEmpty(); |
| | | log.info("笼内空格:{}", Arrays.asList(map)); |
| | | // List<EdgStorageCage> map = edgStorageCageService.selectCacheEmpty(); |
| | | // log.info("笼内空格:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | |
| | | @Test |
| | | public void testidentWorn() { |
| | | Map<String, String> arguments=new HashMap<>(); |
| | | arguments.put("glassId","P24060405|30|1");//玻璃ID |
| | | arguments.put("controlsId","200"); //拿走:200/破损:201 |
| | | arguments.put("line","1001"); //线路: |
| | | arguments.put("machine","识别"); //设备名称: |
| | | arguments.put("glassId","P24060403|3|6");//玻璃ID |
| | | arguments.put("controlsId","300"); //拿走:200/破损:201 |
| | | arguments.put("line","2001"); //线路: |
| | | arguments.put("machine","冷加工"); //设备名称: |
| | | edgStorageCageDetailsService.identWorn(arguments); |
| | | log.info("识别台【破损/拿走】:{}", 1); |
| | | } |
| | |
| | | log.info("出片任务:{}", Arrays.asList(edgStorageCageDetails)); |
| | | } |
| | | |
| | | @Test |
| | | public void testedgTask() { |
| | | List<Map<String,Object>> EdgTasks = taskCacheService.selectEdgInfo("2001"); |
| | | |
| | | log.info("磨边任务:{}", Arrays.asList(EdgTasks)); |
| | | } |
| | | |
| | | } |
| | |
| | | @PostMapping("/selectBigStorageCageDetails") |
| | | public Result selectBigStorageCageDetails(@RequestBody Map map) { |
| | | List<BigStorageCageDetails> bigStorageCageDetails=bigStorageCageDetailsService.selectBigStorageCageDetails(map.get("glassId").toString()); |
| | | if (bigStorageCageDetails.size()>0){ |
| | | return Result.build(200,"查询成功",bigStorageCageDetails); |
| | | }else{ |
| | | return Result.build(200,"查询失败,无此玻璃id",bigStorageCageDetails); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情添加") |
| | |
| | | @ApiOperation("理片笼任务出片") |
| | | @PostMapping("/outBigStorageCageDetails") |
| | | public Result outBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | |
| | | bigStorageCageDetailsService.outBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"出片添加成功",1); |
| | | } |
| | | |
| | | @ApiOperation("指定钢化") |
| | | @PostMapping("/TemperingGlass") |
| | | public Result TemperingGlass(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | boolean result=bigStorageCageDetailsService.TemperingGlass(bigStorageCageDetails.getTemperingLayoutId().toString(),bigStorageCageDetails.getEngineerId()); |
| | | if(result==true){ |
| | | return Result.build(200,"指定钢化成功",1); |
| | | }else { |
| | | return Result.build(200, "已存在钢化任务,请等待钢化完成再指定钢化", 1); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("钢化查询") |
| | | @PostMapping("/selectTemperingGlass") |
| | | public Result selectTemperingGlass() { |
| | | return Result.build(200,"查询成功",bigStorageCageDetailsService.selectTemperingGlass()); |
| | | } |
| | | } |
| | | |
| | |
| | | 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) |
| | |
| | | @ApiModelProperty(value = "玻璃类型", position = 8) |
| | | private Integer glassType; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | @ApiModelProperty(value = "高", position = 10) |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | |
| | | * 玻璃数量 |
| | | */ |
| | | private Integer glassCount; |
| | | |
| | | /** |
| | | * 笼子号 |
| | | */ |
| | | private Integer deviceId; |
| | | } |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO temperingIsAll(); |
| | | List<TemperingLayoutDTO> temperingIsAll(); |
| | | |
| | | /** |
| | | * 获取每个钢化版图占用的格子数量 |
| | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO temperingIsAll(); |
| | | List<TemperingLayoutDTO> temperingIsAll(); |
| | | |
| | | /** |
| | | * 获取每个钢化版图占用的格子数量 |
| | |
| | | * @return |
| | | */ |
| | | List<SlotSequenceDTO> queryGlassMaxAndMin(String engineerId, Integer temperingLayoutId); |
| | | |
| | | boolean TemperingGlass(String temperingLayoutId, String engineerId); |
| | | |
| | | List<Map<String, Object>> selectTemperingGlass(); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private GlassInfoMapper glassInfoMapper; |
| | | |
| | | @Resource |
| | | private DamageService damageService; |
| | | |
| | | @Value("${mes.minCount}") |
| | | private int minCount; |
| | |
| | | glassInfoWrapper.eq(GlassInfo::getGlassId,bigStorageCageFeedTask.getGlassId()); |
| | | GlassInfo glassInfo= glassInfoMapper.selectOne(glassInfoWrapper); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | bigStorageCageDetailsList.add(bigStorageCageDetails); |
| | | } |
| | | return bigStorageCageDetailsList; |
| | |
| | | temperingGlassInfoMapper.updateById(temperingGlassInfo); |
| | | } |
| | | if (status == 0) { |
| | | bigStorageCageDetails.setState(Const.GLASS_STATE_TAKE); |
| | | } else { |
| | | bigStorageCageDetails.setState(Const.GLASS_STATE_DAMAGE); |
| | | } else { |
| | | bigStorageCageDetails.setState(Const.GLASS_STATE_TAKE); |
| | | } |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | //todo:插入破损数据 |
| | | |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(bigStorageCageDetails.getGlassId()); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setRemark("大理片笼破损"); |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | |
| | | //查询玻璃信息 |
| | |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setState(1); |
| | | bigStorageCageDetails.setGap(glassGap); |
| | | } |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = new ArrayList<>(); |
| | | bigStorageCageDetailsList.add(bigStorageCageDetails); |
| | | return bigStorageCageDetailsList; |
| | | } else { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | //理片笼详情添加 |
| | |
| | | .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth()) |
| | | .gt(BigStorageCage::getRemainWidth, Math.max(glassInfo.getWidth(), glassInfo.getHeight())) |
| | | .last("limit 1"); |
| | | if (glassInfo.getTemperingLayoutId() == 0) { |
| | | wrapper.eq(BigStorageCageDetails::getWidth, glassInfo.getWidth()).eq(BigStorageCageDetails::getHeight, glassInfo.getHeight()); |
| | |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | return bigStorageDTO; |
| | | } |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | return bigStorageDTO; |
| | | } |
| | | |
| | | //获取玻璃的厚度:重新选笼子需要按照笼子可放玻璃厚度进行选择 |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .notInSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where state in (100,102,103)") |
| | | .ge(BigStorageCage::getMaxThickness, glassInfo.getThickness()) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | | .last("limit 1")); |
| | | if (null != bigStorageCage) { |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | return bigStorageDTO; |
| | | } |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .ge(BigStorageCage::getMaxThickness, glassInfo.getThickness()) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | | .last("limit 1")); |
| | | Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃"); |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | return bigStorageDTO; |
| | | } |
| | | |
| | | @Override |
| | | public TemperingLayoutDTO temperingIsAll() { |
| | | public List<TemperingLayoutDTO> temperingIsAll() { |
| | | return baseMapper.temperingIsAll(); |
| | | } |
| | | |
| | |
| | | public List<SlotSequenceDTO> queryGlassMaxAndMin(String engineerId, Integer temperingLayoutId) { |
| | | return baseMapper.queryGlassMaxAndMin(engineerId, temperingLayoutId); |
| | | } |
| | | |
| | | @Override |
| | | public boolean TemperingGlass(String temperingLayoutId, String engineerId) { |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoLambdaQueryWrapper |
| | | .eq(TemperingGlassInfo::getState,Const.TEMPERING_NEW); |
| | | List<TemperingGlassInfo> temperingGlassInfoList=temperingGlassInfoMapper.selectList(temperingGlassInfoLambdaQueryWrapper); |
| | | |
| | | if(temperingGlassInfoList.size()==0){ |
| | | LambdaQueryWrapper<BigStorageCageDetails> wrapper =new LambdaQueryWrapper<>(); |
| | | wrapper.eq(BigStorageCageDetails::getTemperingLayoutId,temperingLayoutId) |
| | | .eq(BigStorageCageDetails::getEngineerId,engineerId) |
| | | .in(BigStorageCageDetails::getState,Const.GLASS_STATE_IN,Const.GLASS_STATE_ARTIFICIAL); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList=baseMapper.selectList(wrapper); |
| | | |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | | ) { |
| | | TemperingGlassInfo temperingGlassInfo = new TemperingGlassInfo(); |
| | | LambdaQueryWrapper<GlassInfo> glassInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoLambdaQueryWrapper.eq(GlassInfo::getGlassId, bigStorageCageDetails.getGlassId()); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoLambdaQueryWrapper); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo); |
| | | temperingGlassInfo.setAngle((int) glassInfo.getAngle()); |
| | | temperingGlassInfo.setState(Const.TEMPERING_NEW); |
| | | temperingGlassInfo.setSlot(bigStorageCageDetails.getSlot()); |
| | | temperingGlassInfoMapper.insert(temperingGlassInfo); |
| | | } |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectTemperingGlass(){ |
| | | QueryWrapper<BigStorageCageDetails> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("engineer_id,tempering_layout_id,count(*) as count") |
| | | .groupBy("engineer_id,tempering_layout_id"); |
| | | List<Map<String, Object>> TemperingGlass = baseMapper.selectMaps(wrapper); |
| | | return TemperingGlass; |
| | | } |
| | | } |
| | |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private GlassInfoService glassInfoService; |
| | | |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | |
| | | //进片逻辑 |
| | | @Override |
| | |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper = new LambdaQueryWrapper(); |
| | | bigStorageCageDetailsWrapper |
| | | .eq(BigStorageCageDetails::getSlot, slot) |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL); |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL); |
| | | |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsMapper.selectList(bigStorageCageDetailsWrapper); |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | | ) { |
| | | double widths = bigStorageCageDetails.getWidth(); |
| | | double gap = bigStorageCageDetails.getGap(); |
| | | width -= widths + gap; |
| | | width = width - widths - glassGap; |
| | | } |
| | | //修改格子剩余宽度 |
| | | BigStorageCage bigStorageCage = new BigStorageCage(); |
| | |
| | | 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,Const.GLASS_STATE_OUT_ING)) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | | .orderByAsc(BigStorageCage::getSlot); |
| | | return bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | | } |
| | | |
| | |
| | | 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,Const.GLASS_STATE_OUT_ING)); |
| | | List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | | Map<Integer, List<BigStorageCage>> listMap = bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId())); |
| | | return listMap; |
| | |
| | | @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); |
| | |
| | | public BigStorageCageOutTask() { |
| | | } |
| | | |
| | | public BigStorageCageOutTask(String glassId, Integer startSlot, Integer endSlot, Integer width, Integer trainNumber, Integer serialNumber, Integer taskState) { |
| | | public BigStorageCageOutTask(String glassId, Integer startSlot, Integer endSlot, double width, double height, Integer trainNumber, Integer serialNumber, Integer taskState) { |
| | | this.glassId = glassId; |
| | | this.startSlot = startSlot; |
| | | this.endSlot = endSlot; |
| | | this.width = width; |
| | | this.height = height; |
| | | this.trainNumber = trainNumber; |
| | | this.serialNumber = serialNumber; |
| | | this.taskState = taskState; |
| | |
| | | */ |
| | | @ApiModelProperty(value = "目标位置", position = 5) |
| | | private Integer endSlot; |
| | | /** |
| | | * 目标位置 |
| | | */ |
| | | @ApiModelProperty(value = "目标位置", position = 5) |
| | | private double width; |
| | | /** |
| | | * 目标位置 |
| | | */ |
| | | @ApiModelProperty(value = "目标位置", position = 5) |
| | | private double height; |
| | | |
| | | /** |
| | | * 车次 |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼读取plc数据开始时间:{}", startDate); |
| | | byte[] getplcvlues = plccontrol.readByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength()); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼读取plc数据结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | log.info("大理片笼读取plc数据,开始时间:{},结束时间:{},共耗时:{}ms,结束扫码任务", startDate, endDate, endDate.getTime() - startDate.getTime()); |
| | | if (getplcvlues != null) { |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | log.info("大理片当前进卧转立确认字为d01:{},d04:{},进笼送片任务确认字为:d03:{},d05:{},出片任务确认字为{}", |
| | | PlcMesObject.getPlcParameter("MESToD01").getValue(), |
| | | PlcMesObject.getPlcParameter("MESToD04").getValue(), |
| | | PlcMesObject.getPlcParameter("MESToD03").getValue(), |
| | | PlcMesObject.getPlcParameter("MESToD05").getValue(), |
| | | PlcMesObject.getPlcParameter("MESToPLC").getValue()); |
| | | } |
| | | } |
| | | } |
| | |
| | | queryDataSource1(); |
| | | //查询使用数据源2查询数据 |
| | | queryDataSource2(); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | |
| | | @Value("${mes.xMaxSize}") |
| | | private Integer xMaxSize; |
| | | |
| | | |
| | | private String d01GlassId = ""; |
| | | private String d04GlassId = ""; |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgScan() { |
| | | Date startDate = new Date(); |
| | |
| | | } |
| | | //按照线路及玻璃id获取相邻两块玻璃 卧转立上的玻璃: 状态为0不操作(D01送片,0不操作,1允许送片),请求字为1, (02玻璃id为空或者卧转立未启动) |
| | | if (!REQUEST_WORD.equals(mesD01Value) && REQUEST_WORD.equals(d01ToMES) && (StringUtils.isBlank(d02State) || !REQUEST_WORD.equals(d03State))) { |
| | | if (!d01GlassId.equals(d01Id)) { |
| | | judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION, mesD01Address); |
| | | d01GlassId = d01Id; |
| | | } |
| | | } |
| | | // 状态为0不操作(D01送片,0不操作,1允许送片),请求字为1, 卧转立未启动 |
| | | if (!REQUEST_WORD.equals(mesD04Value) && REQUEST_WORD.equals(d04ToMES) && !REQUEST_WORD.equals(d05State)) { |
| | | if (!d04GlassId.equals(d04Id)) { |
| | | judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD04Address); |
| | | d04GlassId = d04Id; |
| | | } |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼扫码任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | |
| | | } |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> wrapper = new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getTaskType, Const.BIG_STORAGE_IN_RUN) |
| | | .and(e -> e.isNull(BigStorageCageFeedTask::getTargetSlot).or().eq(BigStorageCageFeedTask::getTargetSlot, Const.OUT_TARGET_POSITION_ZERO)) |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP); |
| | | //获取可以启动卧转立的任务线路 |
| | | List<BigStorageCageFeedTask> feedTaskList = bigStorageCageFeedTaskService.list(wrapper); |
| | |
| | | // log.info("两条线都存在进片任务,结束任务"); |
| | | // return; |
| | | // } |
| | | //获取两条线卧转立是否有玻璃,且任务状态都为2 |
| | | //获取两条线卧转立是否有玻璃,且任务状态为1/2 |
| | | List<Integer> lineList = bigStorageCageFeedTaskService.querySitToUpGlass(); |
| | | if (CollectionUtils.isEmpty(lineList)) { |
| | | Date endDate = new Date(); |
| | |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼空车进片任务开始执行时间:{}", startDate); |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | String e02State = plcMesObject.getPlcParameter("E02State").getAddress(); |
| | | if (REQUEST_WORD.equals(e02State)) { |
| | | log.info("出片忙碌,结束出片任务"); |
| | | return; |
| | | } |
| | | String mesToPLCAddress = plcMesObject.getPlcParameter("MESToPLC").getAddress(); |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW)); |
| | | Assert.isTrue(CollectionUtils.isEmpty(outingList), "有正在执行出片的任务,结束当前出片线程"); |
| | |
| | | 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(); |
| | |
| | | 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(), |
| | | slotWidth, 0, 0, 1)).collect(Collectors.toList()); |
| | | e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1)).collect(Collectors.toList()); |
| | | bigStorageCageOutTaskService.saveBatch(outTasks); |
| | | |
| | | //向plc写入确认字 |
| | | int returnData = 0; |
| | | int count = 1; |
| | | while (returnData == 0) { |
| | | log.info("已向plc第{}次送协议", count); |
| | | S7object.getinstance().plccontrol.writeWord(mesToPLCAddress, 1); |
| | | log.info("已向plc发送出片任务确认,地址为:{}", mesToPLCAddress); |
| | | returnData = S7object.getinstance().plccontrol.readWord(mesToPLCAddress, 1).get(0); |
| | | log.info("已向plc第{}次发送出片任务确认,地址为:{},写入的内容为{}", count++, mesToPLCAddress, returnData); |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void updateOutGlassStateTask() { |
| | | Date startDate = new Date(); |
| | | log.info("1、大理片笼出片完成后更新大理片笼数据任务开始执行时间:{}", startDate); |
| | | //因为大理片笼和出片任务是两个库的数据,所以要分开查找 |
| | | List<Object> list = bigStorageCageDetailsService.listObjs(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .select(BigStorageCageDetails::getGlassId).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT_ING)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("2、获取所有正在出片的玻璃信息id:{}", list); |
| | | List<String> glassIds = list.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | List<Object> outSuccessGlassIdsObj = bigStorageCageOutTaskService.listObjs(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .select(BigStorageCageOutTask::getGlassId).in(BigStorageCageOutTask::getGlassId, glassIds).in(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_ALL)); |
| | | List<String> outSuccessGlassIds = outSuccessGlassIdsObj.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(outSuccessGlassIds)) { |
| | | log.info("3、获取出片已完成的玻璃信息id:{}", outSuccessGlassIdsObj); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT).in(BigStorageCageDetails::getGlassId, outSuccessGlassIds)); |
| | | log.info("4、大理片笼出片状态已完成已完成的玻璃信息id:{}", outSuccessGlassIdsObj); |
| | | } |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("end:大理片笼出片完成后更新大理片笼数据任务结束时间:{},共耗时:{}ms,结束任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | List<BigStorageCageFeedTask> inDamageTaskInfoList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_DAMAGE)); |
| | | if (CollectionUtils.isNotEmpty(inDamageTaskInfoList)) { |
| | | log.info("获取进片任务表中破损的玻璃信息{}", inDamageTaskInfoList); |
| | | bigStorageCageFeedTaskService.remove(new LambdaQueryWrapper<BigStorageCageFeedTask>().eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_DAMAGE)); |
| | | //理片笼详情表数据状态更新 |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_DAMAGE).in(BigStorageCageDetails::getGlassId, inDamageTaskInfoList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()))); |
| | | //将破损信息新增入破损表 |
| | | for (BigStorageCageFeedTask bigStorageCageFeedTask : inDamageTaskInfoList) { |
| | | Damage damage = new Damage(); |
| | |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | log.info("进片任务执行完成"); |
| | | } |
| | | //获取出片任务表中状态为破损的数据 |
| | | List<BigStorageCageOutTask> outDamageTaskInfoList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_DAMAGE)); |
| | | if (CollectionUtils.isNotEmpty(outDamageTaskInfoList)) { |
| | | log.info("获取出片任务表中破损的玻璃信息{}", outDamageTaskInfoList); |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_IN_DAMAGE)); |
| | | List<String> glassIdList = outDamageTaskInfoList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | //移除钢化下片表数据 |
| | | temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().in(TemperingGlassInfo::getGlassId, glassIdList)); |
| | | //理片笼详情表数据状态更新 |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_DAMAGE).in(BigStorageCageDetails::getGlassId, glassIdList)); |
| | | |
| | | //将破损信息新增入破损表 |
| | | for (BigStorageCageOutTask bigStorageCageOutTask : outDamageTaskInfoList) { |
| | | Damage damage = new Damage(); |
| | |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | log.info("出片任务执行完成"); |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼破损玻璃清除任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | |
| | | 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; |
| | |
| | | } |
| | | //向plc发送进片确认 |
| | | if (flag) { |
| | | //向plc写入确认字 |
| | | int returnData = 0; |
| | | int count = 1; |
| | | while (returnData == 0) { |
| | | S7object.getinstance().plccontrol.writeWord(mesAddress, 1); |
| | | returnData = S7object.getinstance().plccontrol.readWord(mesAddress, 1).get(0); |
| | | log.info("进卧转立第{}次发送确认字完成,地址为:{},写入的内容为{}", count++, mesAddress, returnData); |
| | | |
| | | } |
| | | } |
| | | //记录无法放下玻璃,后续判断启动 |
| | | return flag; |
| | |
| | | /** |
| | | * 添加任务信息 |
| | | */ |
| | | 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 Integer getStartLine() { |
| | | List<BigStorageCageFeedTask> taskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .inSql(BigStorageCageFeedTask::getId, "select min(id) from big_storage_cage_feed_task where task_state = 2 group by line")); |
| | | .inSql(BigStorageCageFeedTask::getId, "select min(id) from big_storage_cage_feed_task where task_state = 2" + |
| | | "and (target_slot = 0 or target_slot is null) group by line")); |
| | | Assert.isFalse(CollectionUtils.isEmpty(taskList), "卧转立两条线都没有玻璃进片任务"); |
| | | Map<String, Integer> taskMap = taskList.stream().collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, |
| | | BigStorageCageFeedTask::getLine)); |
| | |
| | | //1、获取任务表中的所有玻璃(指定线路且已经进卧转立完成) |
| | | List<BigStorageCageFeedTask> taskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getLine, line) |
| | | .and(e -> e.isNull(BigStorageCageFeedTask::getTargetSlot).or().eq(BigStorageCageFeedTask::getTargetSlot, Const.OUT_TARGET_POSITION_ZERO)) |
| | | .in(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP_ALL) |
| | | .orderByAsc(BigStorageCageFeedTask::getId)); |
| | | //2、去笼子内查找是否可以继续存放的笼子 |
| | |
| | | //2、获取目标格子信息 |
| | | BigStorageDTO bigStorageDTO = bigStorageCageDetailsService.queryTargetSlotByTempering(info); |
| | | //3、更新大理片笼表剩余宽度 |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth() - info.getWidth()) |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth() - info.getWidth() - glassGap) |
| | | .eq(BigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | //4、更新进片任务表,目标格子及状态(状态改为2 电气扫到自行处理) 遇到问题:无法批量更新,批量更新无法走指定从库 |
| | | e.setTargetSlot(bigStorageDTO.getSlot()); |
| | |
| | | //5、将进片信息存入大理片笼详情表 |
| | | cageDetails.setSlot(bigStorageDTO.getSlot()); |
| | | cageDetails.setState(Const.GLASS_STATE_IN); |
| | | cageDetails.setDeviceId(bigStorageDTO.getDeviceId()); |
| | | cageDetails.setGap(glassGap); |
| | | bigStorageCageDetailsService.save(cageDetails); |
| | | } |
| | | sendTaskListToPLC(taskList, line); |
| | |
| | | s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), taskList.get(i - 1).getLine()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), taskList.get(i - 1).getTargetSlot()); |
| | | } |
| | | int returnData = 0; |
| | | int count = 1; |
| | | while (returnData == 0) { |
| | | s7control.writeWord(outLine, 2); |
| | | log.info("送片任务已发送完成,任务线路为:{},启动地址为{},确认字为{}", line, outLine, 2); |
| | | returnData = s7control.readWord(outLine, 1).get(0); |
| | | log.info("已向plc第{}次发送出片任务确认,地址为:{},写入的内容为{}", count++, outLine, returnData); |
| | | } |
| | | } |
| | | |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering, String mesToPLCAddress) { |
| | |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | | Integer remainWidth = carWidth; |
| | | int maxX = 0; |
| | | for (T e : list) { |
| | | if (bigStorageCageOutTaskList.size() > outCarMaxSize || e.getWidth() > remainWidth) { |
| | | if (bigStorageCageOutTaskList.size() >= outCarMaxSize || e.getWidth() > remainWidth) { |
| | | break; |
| | | } |
| | | remainWidth = remainWidth - (int) e.getWidth() - glassGap; |
| | | if (isTempering) { |
| | | int minLength = Math.min((int) e.getWidth(), (int) e.getHeight()); |
| | | if (maxX + minLength <= xMaxSize) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | (int) e.getWidth() * 10, 0, 0, 1)); |
| | | e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1)); |
| | | maxX = Math.max(maxX, e.getXCoordinate()); |
| | | } else { |
| | | break; |
| | | } |
| | | |
| | | } else { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.ARTIFICIAL_OUT_TARGET_POSITION, |
| | | (int) e.getWidth() * 10, 0, 0, 1)); |
| | | e.getWidth() * 10, e.getHeight(), 0, 0, 1)); |
| | | } |
| | | |
| | | } |
| | |
| | | List<String> glassIds = bigStorageCageOutTaskList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | log.info("将出片玻璃{}玻璃状态改为已出片", glassIds); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT_ING) |
| | | .in(BigStorageCageDetails::getGlassId, glassIds)); |
| | | //更新笼子内格子的剩余尺寸 |
| | | updateSlotRemain(list, glassIds); |
| | | |
| | | int returnData = 0; |
| | | int count = 1; |
| | | while (returnData == 0) { |
| | | S7object.getinstance().plccontrol.writeWord(mesToPLCAddress, 1); |
| | | log.info("已向plc发送出片任务确认,地址为:{}", mesToPLCAddress); |
| | | returnData = S7object.getinstance().plccontrol.readWord(mesToPLCAddress, 1).get(0); |
| | | log.info("已向plc第{}次发送出片任务确认,地址为:{},写入的内容为{}", count++, mesToPLCAddress, returnData); |
| | | } |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | /** |
| | | * 更新笼子内格子的剩余尺寸 |
| | | * |
| | | * @param list |
| | | * @param taskGlassIds |
| | | * @param list 笼内可以出笼的玻璃信息 |
| | | * @param taskGlassIds 本次任务出去的玻璃ids |
| | | * @param <T> |
| | | */ |
| | | public <T extends BigStorageCageBaseInfo> void updateSlotRemain(List<T> list, List<String> taskGlassIds) { |
| | | //获取需要出去(包括待出去的)的所有玻璃格子号 |
| | | List<Integer> slotList = list.stream().map(T::getSlot).distinct().collect(Collectors.toList()); |
| | | //获取待出去的玻璃信息(等下车出去的玻璃) |
| | | //获取待出去的玻璃信息(等待本次任务结束后下车出去的玻璃) |
| | | Map<Integer, Double> slotRemainMap = list.stream().filter(e -> !taskGlassIds.contains(e.getGlassId())) |
| | | .collect(Collectors.groupingBy(T::getSlot, Collectors.summingDouble(item -> item.getWidth() + glassGap))); |
| | | if (CollectionUtils.isNotEmpty(slotRemainMap)) { |
| | |
| | | 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(); |
| | | return sitToUpRemainWidth.getWidth() < Math.max(glassInfo.getWidth(), glassInfo.getHeight()); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public boolean saveBatch(List<TemperingGlassInfo> list) { |
| | | log.info("需要钢化的玻璃为:{}", list); |
| | | return baseMapper.saveBatch(list); |
| | | } |
| | | |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | active: cz |
| | | application: |
| | | name: cacheVerticalGlass |
| | | mybatis-plus: |
| | |
| | | minCount: 5 |
| | | carWidth: 5000 #大车宽度 |
| | | slotWidth: 5000 #大车宽度 |
| | | inCarMaxSize: 6 #进片大车最大存放玻璃数量 |
| | | outCarMaxSize: 1 #出片大车最大存放玻璃数量 |
| | | glassGap: 300 #玻璃间距 |
| | | inCarMaxSize: 2 #进片大车最大存放玻璃数量 |
| | | outCarMaxSize: 3 #出片大车最大存放玻璃数量 |
| | | glassGap: 1000 #玻璃间距 |
| | | xMaxSize: 2850 |
| | |
| | | ) T2 |
| | | INNER JOIN (SELECT ENGINEER_ID, TEMPERING_LAYOUT_ID, COUNT(TEMPERING_FEED_SEQUENCE) AS COUNT |
| | | FROM BIG_STORAGE_CAGE_DETAILS |
| | | WHERE STATE in (100, 101, 102) |
| | | WHERE STATE in (100, 101, 102, 103) |
| | | 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 (target_slot = 0 or target_slot is null) |
| | | 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 |
| | |
| | | BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @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() { |
| | |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | |
| | | @Test |
| | | public void updateOutGlassStateTask() { |
| | | plcStorageCageTask.updateOutGlassStateTask(); |
| | | } |
| | | |
| | | } |
| | |
| | | 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 org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | | *
|
| | |
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | |
|
| | | @ApiOperation(value = "架子表格查询",notes = "架子表格查询",produces = "application/json")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @GetMapping("/findshelfrack")
|
| | | public Result findshelfrack() {
|
| | | List<Map<String, Object>> result = shelfRackService.selectshelf_rack();
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | } |
| | |
| | | package com.mes.shelfrack.mapper;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.github.yulichang.base.MPJBaseMapper;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | | *
|
| | | *
|
| | |
| | | * @since 2024-07-09 14:51:27
|
| | | *
|
| | | */
|
| | | @Mapper
|
| | | public interface ShelfRackMapper extends BaseMapper<ShelfRack> {
|
| | |
|
| | | public interface ShelfRackMapper extends MPJBaseMapper<ShelfRack> {
|
| | |
|
| | |
|
| | | List<Map<String, Object>> selectshelf_rack();
|
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | |
| | |
|
| | | List<ShelfRack> findList(ShelfRack params);
|
| | |
|
| | |
|
| | | List<Map<String, Object>> selectshelf_rack();
|
| | |
|
| | | } |
| | |
| | | package com.mes.shelfrack.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.github.yulichang.toolkit.JoinWrappers;
|
| | | import com.mes.common.config.Const;
|
| | | import com.mes.rawusage.entity.RawUsage;
|
| | | import com.mes.shelfrack.mapper.ShelfRackMapper;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import com.mes.shelfrack.service.ShelfRackService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | | * @author system
|
| | |
| | | return shelfRackMapper.selectList(query);
|
| | | }
|
| | |
|
| | | //
|
| | | // public void yourMethodName() {
|
| | | // List<Map<String, Object>> resultList = shelfRackMapper.selectMaps(
|
| | | // new LambdaQueryWrapper<ShelfRack>()
|
| | | // .select(ShelfRack::getNumber, RawUsage::getRawType, RawUsage::getRawWidth,
|
| | | // RawUsage::getRawHeight, RawUsage::getRawThickness, ShelfRack::getModTime,
|
| | | // ShelfRack::getEnableState, RawUsage::getPieces, RawUsage::getLeftPieces,
|
| | | // "(datediff(now(), raw_usage.create_time)) as rukuTime",
|
| | | // "(concat(if(ROUND(raw_usage.left_pieces / #{param1} * 100, 0) < 20, 20, ROUND(raw_usage.left_pieces / #{param1} * 100, 0)), '%')) as bfb")
|
| | | // .leftJoin(RawUsage.class, RawUsage::getId, ShelfRack::getRawPackageId)
|
| | | // .orderByAsc(ShelfRack::getNumber)
|
| | | // );
|
| | | //
|
| | | // // Process resultList as needed
|
| | | // }
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> selectshelf_rack() {
|
| | | return baseMapper.selectshelf_rack();
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Optional;
|
| | |
|
| | | /**
|
| | | *
|
| | |
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | |
|
| | | @ApiOperation(value = "任务查询",notes = "任务查询",produces = "application/json")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @GetMapping("/findTasks")
|
| | | public Result findLatestTasks() {
|
| | | List<Map<String, Object>> result = storageTaskService.Tasks();
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | |
|
| | | } |
| | |
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | | *
|
| | | *
|
| | |
| | | * @since 2024-07-09 14:51:27
|
| | | *
|
| | | */
|
| | | @Mapper
|
| | | @Repository
|
| | | public interface StorageTaskMapper extends BaseMapper<StorageTask> {
|
| | |
|
| | |
|
| | | List<Map<String, Object>> selectTasks();
|
| | |
|
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Optional;
|
| | |
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | |
| | |
|
| | | List<StorageTask> findList(StorageTask params);
|
| | |
|
| | | Map<String, Optional<StorageTask>> findLatestTasks();
|
| | |
|
| | | List<Map<String, Object>> Tasks();
|
| | | } |
| | |
| | | import com.mes.storagetask.mapper.StorageTaskMapper;
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | import com.mes.storagetask.service.StorageTaskService;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Optional;
|
| | |
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @Service
|
| | | @Slf4j
|
| | | public class StorageTaskServiceImpl extends ServiceImpl<StorageTaskMapper, StorageTask> implements StorageTaskService {
|
| | |
|
| | | @Autowired
|
| | |
| | | }
|
| | |
|
| | |
|
| | | public Map<String, Optional<StorageTask>> findLatestTasks() {
|
| | | Map<String, Optional<StorageTask>> latestTasks = new HashMap<>();
|
| | |
|
| | | // 查询最新的已完成任务
|
| | | LambdaQueryWrapper<StorageTask> completedWrapper = new LambdaQueryWrapper<>();
|
| | | completedWrapper.eq(StorageTask::getTaskType, "已完成")
|
| | | .orderByDesc(StorageTask::getId)
|
| | | .last("LIMIT 1");
|
| | | Optional<StorageTask> latestCompletedTask = Optional.ofNullable(storageTaskMapper.selectOne(completedWrapper));
|
| | | latestTasks.put("已完成", latestCompletedTask);
|
| | |
|
| | | // 查询最新的等待中任务
|
| | | LambdaQueryWrapper<StorageTask> pendingWrapper = new LambdaQueryWrapper<>();
|
| | | pendingWrapper.eq(StorageTask::getTaskType, "等待中")
|
| | | .orderByDesc(StorageTask::getId);
|
| | | Optional<StorageTask> latestPendingTask = Optional.ofNullable(storageTaskMapper.selectOne(pendingWrapper));
|
| | | latestTasks.put("等待中", latestPendingTask);
|
| | | log.info(latestTasks+"");
|
| | | return latestTasks;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> Tasks() {
|
| | | return baseMapper.selectTasks();
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | } |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/yiwumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/yiwumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
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.shelfrack.mapper.ShelfRackMapper">
|
| | |
|
| | |
|
| | | <select id="selectshelf_rack" resultType="java.util.Map">
|
| | | <![CDATA[
|
| | | SELECT a.number, b.raw_type, b.raw_width, b.raw_height, b.raw_thickness, b.left_pieces, a.mod_time, a.enable_state, b.pieces,
|
| | | datediff(now(), b.create_time) as rukutime,
|
| | | concat(if(ROUND(b.left_pieces / b.pieces * 100, 0) < 20, 20, ROUND(b.left_pieces / b.pieces * 100, 0)), '%') as bfb
|
| | | FROM shelf_rack AS a
|
| | | LEFT JOIN raw_usage AS b ON a.raw_package_id = b.id
|
| | | ]]>
|
| | | </select>
|
| | |
|
| | | </mapper>
|
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.storagetask.mapper.StorageTaskMapper">
|
| | |
|
| | |
|
| | |
|
| | | <select id="selectTasks" resultType="java.util.Map">
|
| | | <![CDATA[
|
| | | SELECT d.*, g.raw_thickness, g.color
|
| | | FROM (
|
| | | (SELECT * FROM storage_task AS a WHERE a.task_state = '已完成' ORDER BY a.id DESC LIMIT 1)
|
| | | UNION ALL
|
| | | (SELECT * FROM storage_task AS c WHERE c.task_state = '正在工作')
|
| | | UNION ALL
|
| | | (SELECT * FROM storage_task AS b WHERE b.task_state = '等待中')
|
| | | ) AS d
|
| | | LEFT JOIN shelf_rack AS f ON f.id = d.shelf_rack
|
| | | LEFT JOIN raw_usage AS g ON g.id = f.raw_package_id
|
| | | ]]>
|
| | | </select>
|
| | |
|
| | | </mapper>
|
New file |
| | |
| | | package mes; |
| | | |
| | | import com.mes.GlassStorageApplication; |
| | | import com.mes.shelfrack.service.ShelfRackService; |
| | | import com.mes.storagetask.entity.StorageTask; |
| | | import com.mes.storagetask.service.StorageTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/3/27 16:37 |
| | | * @Description: |
| | | */ |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = GlassStorageApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | |
| | | public class GlassStorageModuleApplicationTest { |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private StorageTaskService storageTaskService; |
| | | @Autowired |
| | | private ShelfRackService shelfRackService; |
| | | |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | | log.info("完整路径:{}", Arrays.asList("123")); |
| | | } |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | | // storageTaskService.getBaseMapper().selectById(1); |
| | | //StorageTask storageTask=new StorageTask(); |
| | | // storageTask.setId(Long.valueOf("1")); |
| | | // storageTask.setTaskState("1"); |
| | | // storageTaskService.updateById(storageTask); |
| | | // storageTaskService.getBaseMapper().deleteById(1); |
| | | // storageTaskService.findList(storageTask); |
| | | ///storageTaskService.findLatestTasks(); |
| | | storageTaskService.Tasks(); |
| | | } |
| | | @Test |
| | | public void selectshelf_rack() { |
| | | |
| | | shelfRackService.selectshelf_rack(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | UpPattenUsage selectSequence(UpPattenUsage upPattenUsage); |
| | | |
| | | |
| | | /** |
| | | * 更改上片玻璃状态 |
| | | * @return UpPattenUsage |
| | | */ |
| | | Boolean updateGlassState(UpPattenUsage upPattenUsage); |
| | | |
| | | } |
| | | |
| | |
| | | List<OptimizeUpPattenUsage> upPattenUsageList = null; |
| | | if (engineeringId != null) { |
| | | upPattenUsageList = optimizeProjectMapper.selectJoinList(OptimizeUpPattenUsage.class, new MPJQueryWrapper<OptimizeProject>() |
| | | .select("t.project_no,t.glass_type,b.o_width as width,b.o_height as height ,REGEXP_REPLACE(t.glass_thickness,'\\D','')as glass_thickness,b.stock_number") |
| | | .leftJoin("optimize_detail b on t.project_no=b.project_no") |
| | | .select("t.project_no,t.glass_type,b.realwidth as width,b.realheight as height ,REGEXP_REPLACE(t.glass_thickness,'\\D','')as glass_thickness,b.stock_id") |
| | | .leftJoin("optimize_layout b on t.project_no=b.project_no") |
| | | .eq("b.project_no", engineeringId)); |
| | | } |
| | | // 创建一个 List 用于保存映射后的实体对象 |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.tools.InitUtil; |
| | | import com.mes.tools.S7control; |
| | | |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/9 15:13 |
| | | * @Description: |
| | | */ |
| | | public class S7object extends Thread { |
| | | public S7control plccontrol; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型 |
| | | private String ip = "192.168.20.202"; // plc ip地址 |
| | | private int port = 102; // plc 端口号 |
| | | |
| | | |
| | | public PlcParameterObject PlcMesObject; |
| | | private static volatile S7object instance = null; |
| | | |
| | | private S7object() { |
| | | if (plccontrol == null) { |
| | | plccontrol = new S7control(plcType, ip, port, 0, 0); |
| | | String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcTemperingGlass.json"; |
| | | PlcMesObject = InitUtil.initword(PlcLoadGlass); |
| | | } |
| | | } |
| | | |
| | | // 单例模式 获取类的唯一实例 |
| | | public static S7object getinstance() { |
| | | if (instance == null) { |
| | | synchronized (S7object.class) { |
| | | if (instance == null) { |
| | | instance = new S7object(); |
| | | } |
| | | } |
| | | } |
| | | return instance; |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | Thread.sleep(100); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | byte[] getplcvlues = plccontrol.readByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength()); |
| | | if (getplcvlues != null) { |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @Scheduled(fixedDelay = 2000) |
| | | public void screenHome(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在等待进片的玻璃 |
| | | Reportingdamage reportingdamage = new Reportingdamage(); |
| | | reportingdamage.setReportingWorkTime("2024-05-11"); |
| | | //获取切割信息 |
| | | reportingdamage.setThisProcess("切割"); |
| | | List<Reportingdamage> cutting = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("cutting", cutting); |
| | | //获取磨边信息 |
| | | reportingdamage.setThisProcess("磨边"); |
| | | List<Reportingdamage> edging = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("edging", edging); |
| | | //获取钢化信息 |
| | | reportingdamage.setThisProcess("钢化"); |
| | | List<Reportingdamage> tempering = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("tempering", tempering); |
| | | //获取夹胶信息 |
| | | reportingdamage.setThisProcess("夹胶"); |
| | | List<Reportingdamage> doubling = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("doubling", doubling); |
| | | //获取中空信息 |
| | | reportingdamage.setThisProcess("中空"); |
| | | List<Reportingdamage> hollow = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("hollow", hollow); |
| | | //获取包装信息 |
| | | reportingdamage.setThisProcess("包装"); |
| | | List<Reportingdamage> packaging = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("packaging", packaging); |
| | | //扇形图各设备的加工破损数量 |
| | | List<Reportingdamage> device = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("device", device); |
| | | //获取次破未补信息 |
| | | List<AwaitingRepair>awaitingRepairs = reportingWorkService.selectAwaitingRepair(); |
| | | jsonObject.append("awaitingRepairs", awaitingRepairs); |
| | |
| | | List<Orders>orders=ordersService.selectOrders(); |
| | | jsonObject.append("orders", orders); |
| | | |
| | | /*现场规划图显示*/ |
| | | |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("screen"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | |
| | | package com.mes.job; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | public class PlcTemperingGlassTask { |
| | | |
| | | @Autowired |
| | | private TemperingAgoService temperingAgoService; |
| | | private TemperingGlassInfoService temperingAgoService; |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | |
| | | //获取整在炉中的两个版图id |
| | | List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId(); |
| | | //进炉中的玻璃 |
| | | List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0).getTemperingLayoutId()); |
| | | if(!layoutId.isEmpty()) { |
| | | List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0)); |
| | | jsonObject.append("intoGlass", intoGlass); |
| | | //进炉中的第二个版图 |
| | | if (layoutId.size() > 1) { |
| | | List<TemperingGlassInfo> intoGlass2 = temperingAgoService.selectIntoGlass(layoutId.get(1).getTemperingLayoutId()); |
| | | List<TemperingGlassInfo> intoGlass2 = temperingAgoService.selectIntoGlass(layoutId.get(1)); |
| | | jsonObject.append("intoGlass2", intoGlass2); |
| | | } |
| | | } |
| | | //出炉后的玻璃 |
| | | List<TemperingGlassInfo> outGlass = temperingAgoService.selectOutGlass(); |
| | | jsonObject.append("outGlass", outGlass); |
| | | //过旋转台钢化后的玻璃 |
| | | List<TemperingGlassInfo> overGlass = temperingAgoService.selectOverGlass(); |
| | | |
| | | jsonObject.append("overGlass", overGlass); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); |
| | |
| | | } |
| | | } |
| | | } |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void temperingIsRun(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | List<TemperingGlassInfo>temperingTaskType=temperingAgoService.selectTaskType(); |
| | | jsonObject.append("temperingTaskType", temperingTaskType); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.temperingrecord.entity.TemperingRecord; |
| | | import com.mes.temperingrecord.service.TemperingRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/7/17 12:47 |
| | | * @Description: |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class TemperingTask { |
| | | |
| | | @Autowired |
| | | private TemperingRecordService temporalRecordService; |
| | | |
| | | @Autowired |
| | | private TemperingGlassInfoService temporaryGlassInfoService; |
| | | private static final String ALONE_STATE = "0"; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void temperingGlassBefore() { |
| | | Date startDate = new Date(); |
| | | log.info("本次任务开始执行时间:{}", startDate); |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String state = plcParameterObject.getPlcParameter("state").getValue(); |
| | | // 当前连线状态为 |
| | | if (ALONE_STATE.equals(state)) { |
| | | log.info("当前钢化炉连线模式为:{},不执行该任务", state); |
| | | return; |
| | | } |
| | | //将确认字置为0 |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("confirmationWord").getAddress(), 0); |
| | | |
| | | //todo:获取钢化版图中状态为2的(进炉完成的玻璃信息) 且不存在钢化记录表内的 |
| | | List<Object> temperRecordIdListObj = temporalRecordService.listObjs(new QueryWrapper<TemperingRecord>().select("distinct tempering_layout_id")); |
| | | |
| | | List<String> temperRecordIdList = temperRecordIdListObj.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | List<TemperingGlassInfo> list = temporaryGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_START).notIn(TemperingGlassInfo::getTemperingLayoutId, temperRecordIdList)); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | log.info("当前系统没有需要钢化的玻璃信息"); |
| | | return; |
| | | } |
| | | List<Integer> temperingLayoutIdList = list.stream().map(TemperingGlassInfo::getTemperingLayoutId).distinct().collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(temperRecordIdList)) { |
| | | temperingLayoutIdList.removeAll(temperRecordIdList); |
| | | } |
| | | if (CollectionUtils.isEmpty(temperingLayoutIdList)) { |
| | | log.info("当前玻璃有正在钢化的任务"); |
| | | } |
| | | // 获取钢化下片表状态为2的玻璃信息 |
| | | |
| | | //完成任务将确认字置为1 |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("confirmationWord").getAddress(), 1); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void temperingGlassAfter() { |
| | | |
| | | } |
| | | } |
| | |
| | | package com.mes.temperingglass.controller; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public class TemperingGlassInfoController { |
| | | |
| | | @Autowired |
| | | private TemperingAgoService temperingAgoService; |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | @Autowired |
| | | private DamageService damageService; |
| | | |
| | | @ApiOperation("查询钢化等片中的版图信息,状态为1的为已到,状态为0的为等待中") |
| | | @GetMapping("/selectWaitingGlass") // 查询钢化等片中的版图信息,状态为1的为已到,状态为0的为等待中 |
| | | public Result <List<TemperingGlassInfo>> selectWaitingGlass() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectWaitingGlass(); |
| | | List<TemperingGlassInfo> glass = temperingGlassInfoService.selectWaitingGlass(); |
| | | log.info("等待中的玻璃信息{}",glass); |
| | | return Result.build(200, "", glass); |
| | | } |
| | |
| | | @ApiOperation("//钢化后显示出炉的版图信息。") |
| | | @GetMapping("/selectOutGlass") //钢化后显示出炉的版图信息 |
| | | public Result <List<TemperingGlassInfo>> selectOutGlass() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectOutGlass(); |
| | | List<TemperingGlassInfo> glass = temperingGlassInfoService.selectOutGlass(); |
| | | log.info("钢化出炉后的玻璃信息{}",glass); |
| | | return Result.build(200, "", glass); |
| | | } |
| | | |
| | | @ApiOperation("//钢化破损") |
| | | @PostMapping("/updateTemperingState") //钢化后显示出炉的版图信息 |
| | | public Result <Integer> updateTemperingState(@RequestBody Damage damage) { |
| | | damageService.insertDamage(damage); |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | if(damage.getStatus()==2){ |
| | | temperingGlassInfo.setState(5); |
| | | |
| | | } |
| | | temperingGlassInfo.setGlassId(damage.getGlassId()); |
| | | int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); |
| | | return Result.build(200, "破损成功", result); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.temperingrecord.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-07-17 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/temperingRecord") |
| | | public class TemperingRecordController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.temperingrecord.entity; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-07-17 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class TemperingRecord implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 工程id |
| | | */ |
| | | private String engineerId; |
| | | /** |
| | | * 钢化版图 |
| | | */ |
| | | private Integer temperingLayoutId; |
| | | |
| | | /** |
| | | * 玻璃材质(膜系0.白玻1.单银2.双银3三银 4.超白5.热反射) |
| | | */ |
| | | private Integer glassType; |
| | | |
| | | /** |
| | | * 钢化类型(1.全钢:2.半钢) |
| | | */ |
| | | private Integer temperingType; |
| | | |
| | | /** |
| | | * 厚度(厚度*10) |
| | | */ |
| | | private Double thickness; |
| | | |
| | | /** |
| | | * 装载率 |
| | | */ |
| | | private Double loadingRate; |
| | | |
| | | /** |
| | | * 面积差 |
| | | */ |
| | | private Double areaDifference; |
| | | |
| | | /** |
| | | * 生产耗时 |
| | | */ |
| | | private String productionTime; |
| | | |
| | | /** |
| | | * 加热能耗 |
| | | */ |
| | | private String heatEnergy; |
| | | |
| | | /** |
| | | * 冷却能耗 |
| | | */ |
| | | private String coolEnergy; |
| | | |
| | | /** |
| | | * 是否完成(plc获取非1:参数不存在;2、匹配完成;3、匹配超时) |
| | | */ |
| | | private Integer state; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.temperingrecord.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.temperingrecord.entity.TemperingRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-07-17 |
| | | */ |
| | | public interface TemperingRecordMapper extends BaseMapper<TemperingRecord> { |
| | | |
| | | } |
File was renamed from hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/shelfrack/mapper/ShelfRackMapper.xml |
| | |
| | | <?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.shelfrack.mapper.ShelfRackMapper">
|
| | | <mapper namespace="com.mes.tempering_record.mapper.TemperingRecordMapper"> |
| | |
|
| | | </mapper>
|
New file |
| | |
| | | package com.mes.temperingrecord.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.temperingrecord.entity.TemperingRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-07-17 |
| | | */ |
| | | public interface TemperingRecordService extends IService<TemperingRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.temperingrecord.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.temperingrecord.entity.TemperingRecord; |
| | | import com.mes.temperingrecord.mapper.TemperingRecordMapper; |
| | | import com.mes.temperingrecord.service.TemperingRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-07-17 |
| | | */ |
| | | @Service |
| | | public class TemperingRecordServiceImpl extends ServiceImpl<TemperingRecordMapper, TemperingRecord> implements TemperingRecordService { |
| | | |
| | | } |
| | |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://192.168.20.24:1433;databasename=hangzhoumes |
| | | url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | # hangzhoumes: |
| | | # url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # salve_hangzhoumes: |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | # username: sa |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql:127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | sd: |
| | | url: jdbc:mysql://10.153.19.150:3306/sd?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/sd?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | primary: salve_hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | application: |
| | | name: temperingGlass |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
New file |
| | |
| | | { |
| | | "plcAddressBegin": "DB88.0", |
| | | "plcAddressLenght": "58", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | { |
| | | "codeId": "confirmationWord", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperingLayoutId", |
| | | "addressIndex": "2", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "filmsid", |
| | | "addressIndex": "4", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperingType", |
| | | "addressIndex": "6", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "thickness", |
| | | "addressIndex": "8", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "loadingRate", |
| | | "addressIndex": "10", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "areaDifference", |
| | | "addressIndex": "12", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "state", |
| | | "addressIndex": "22", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "deviceState", |
| | | "addressIndex": "24", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "resultState", |
| | | "addressIndex": "26", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "loadSpeed", |
| | | "addressIndex": "28", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "downSpeed", |
| | | "addressIndex": "30", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "load1", |
| | | "addressIndex": "32", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "heat1", |
| | | "addressIndex": "34", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "heat2", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "cool1", |
| | | "addressIndex": "38", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "cool2", |
| | | "addressIndex": "40", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "downId", |
| | | "addressIndex": "42", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "productionTime", |
| | | "addressIndex": "44", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "heatEnergy", |
| | | "addressIndex": "46", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "coolEnergy", |
| | | "addressIndex": "48", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperatureUp1", |
| | | "addressIndex": "50", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperatureDown1", |
| | | "addressIndex": "52", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperatureUp2", |
| | | "addressIndex": "54", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "temperatureDown2", |
| | | "addressIndex": "56", |
| | | "addressLenght": "2" |
| | | } |
| | | ] |
| | | } |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | |
| | | public class TemperingApplicationTest { |
| | | |
| | | @Autowired |
| | | private TemperingAgoService temperingAgoService; |
| | | private TemperingGlassInfoService temperingAgoService; |
| | | |
| | | |
| | | @Test |
| | | public void testFindPa() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectIntoGlass(12); |
| | | log.info("进炉中的玻璃:{}", Arrays.asList(glass)); |
| | | List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId(); |
| | | if(!layoutId.isEmpty()) { |
| | | List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0)); |
| | | log.info("已出中的玻璃:{}", Arrays.asList(intoGlass)); |
| | | //进炉中的第二个版图 |
| | | if (layoutId.size() > 1) { |
| | | List<TemperingGlassInfo> intoGlass2 = temperingAgoService.selectIntoGlass(layoutId.get(1)); |
| | | log.info("已出中的玻璃:{}", Arrays.asList(intoGlass2)); |
| | | } |
| | | } |
| | | } |
| | | @Test |
| | | public void testFindPa2() { |
| | |
| | | @Test |
| | | public void testFindPa4() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.selectOverGlass(); |
| | | log.info("等待中的玻璃:{}", Arrays.asList(glass)); |
| | | } |
| | | @Test |
| | | public void testFindPa5() { |
| | | List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId(); |
| | | //进炉中的玻璃 |
| | | log.info("版图id:{}", Arrays.asList(layoutId.get(0).getTemperingLayoutId())); |
| | | List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0).getTemperingLayoutId()); |
| | | log.info("玻璃版图id:{}", Arrays.asList(intoGlass)); |
| | | List<TemperingGlassInfo> intoGlass2 = temperingAgoService.selectIntoGlass(layoutId.get(1).getTemperingLayoutId()); |
| | | log.info("玻璃版图id:{}", Arrays.asList(intoGlass2)); |
| | | log.info("钢化后的玻璃:{}", Arrays.asList(glass)); |
| | | } |
| | | } |
| | |
| | | |
| | | 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)) { |
| | |
| | | @Override |
| | | public boolean updateDownStorageCage(DownStorageCage downStorageCage) { |
| | | DownStorageCage downItem = baseMapper.selectById(downStorageCage.getId()); |
| | | if (downItem != null) { |
| | | downItem.setEnableState(downStorageCage.getEnableState()); |
| | | baseMapper.updateById(downItem); |
| | | int rowsAffected = baseMapper.updateById(downItem); |
| | | if (rowsAffected > 0) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改理片笼信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | |
| | | |
| | | 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(); |
| | |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.entity.DownWorkstionAndDownGlassinfo; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public DownWorkstation selectByFlowCardId(String flowcardid) { |
| | | QueryWrapper<DownWorkstation> queryWrapper = new QueryWrapper<>(); |
| | |
| | | |
| | | @Override |
| | | public boolean updateDownWorkstationstate(DownWorkstation downWorkstation) { |
| | | |
| | | DownWorkstation downWork = baseMapper.selectById(downWorkstation.getId()); |
| | | |
| | | if (downWork != null) { |
| | | |
| | | downWork.setEnableState(downWorkstation.getEnableState()); |
| | | |
| | | baseMapper.updateById(downWork); |
| | | |
| | | return true; |
| | | } else { |
| | | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private Integer minHeight; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 3000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcHomeEdgTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String requestWord = plcParameterObject.getPlcParameter("requestWord").getValue(); |
| | |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("有空架子,将流程卡与架子好绑定,执行进片任务 结束"); |
| | | //绑定流程卡 |
| | | downWorkstationService.updateFlowCardIdAndCount(glassInfo.getFlowCardId(), glassInfo.getLayer(), list.get(0).getWorkstationId()); |
| | | downWorkstationService.updateFlowCardIdAndCount(glassInfo.getFlowCardId(), list.get(0).getWorkstationId(), glassInfo.getLayer()); |
| | | checkFlag = Boolean.TRUE; |
| | | } |
| | | } |
| | |
| | | return Boolean.FALSE; |
| | | } |
| | | Boolean flag08 = "1".equals(out08Glassstate) ? Boolean.TRUE : Boolean.FALSE; |
| | | if (!flag08) { |
| | | generateTaskByShelf(glassStatus06, glassStatus11, flag08, glassStatus13, tempList, cageDetails, glassId); |
| | | } else { |
| | | if (!generateTaskByShelf(glassStatus06, glassStatus11, flag08, glassStatus13, tempList, cageDetails, glassId)) { |
| | | return generateTaskByShelf(glassStatus06, glassStatus11, !flag08, glassStatus13, tempList, cageDetails, glassId); |
| | | } |
| | | } |
| | | |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | |
| | | 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("笼子被禁用,无法走机械臂下片"); |
| | | //走人工下片 |
| | |
| | | list = tempList.stream().filter(item -> item.getWidth() > maxWidth || item.getHeight() > maxHeight).collect(Collectors.toList()); |
| | | } |
| | | } else { |
| | | //获取可落架的的架子信息(包括空架子) |
| | | List<DownWorkstation> workstationsIsNotBind = downWorkstationList.stream().filter(item -> null == (item.getFlowCardId())).collect(Collectors.toList()); |
| | | Map<String, List<DownWorkstation>> listMap = downWorkstationList.stream().collect(Collectors.groupingBy(item -> item.getFlowCardId() + ":" + item.getLayer())); |
| | | //将架子的流程卡号及层数作为key |
| | | if (CollectionUtils.isEmpty(workstationsIsNotBind)) { |
| | | log.info("不存在未绑定流程卡架子"); |
| | | //筛选出对应架子已绑定流程卡可下片的玻璃 |
| | | Map<String, List<DownWorkstation>> listMap = downWorkstationList.stream() |
| | | .filter(item -> null != (item.getFlowCardId())).collect(Collectors.groupingBy(item -> item.getFlowCardId() + ":" + item.getLayer())); |
| | | list = tempList.stream().filter(item -> listMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | } else { |
| | | log.info("存在未绑定流程卡架子,直接获取笼内所有玻璃"); |
| | | log.info("存在未绑定流程卡架子,直接获取笼内所有玻璃,且未绑定架子的玻璃信息"); |
| | | //获取禁用架子的流程号,将笼内绑定架子且架子被禁用的流程卡信息 |
| | | List<Integer> workStationAll = Arrays.asList(1, 2, 3, 4, 5, 6); |
| | | List<Integer> offWorkStationList = workStationAll.stream().filter(e -> !workList.contains(e)).collect(Collectors.toList()); |
| | | List<DownWorkstation> downWorkstationOffList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .and(i -> i.in(DownWorkstation::getWorkstationId, offWorkStationList).or().eq(DownWorkstation::getEnableState, Const.SLOT_OFF))); |
| | | //获取被禁用的流程卡信息 |
| | | if (CollectionUtils.isEmpty(downWorkstationOffList)) { |
| | | list = tempList; |
| | | } else { |
| | | Map<String, List<DownWorkstation>> listOffMap = downWorkstationOffList.stream().filter(item -> null != (item.getFlowCardId())).collect(Collectors.groupingBy(item -> item.getFlowCardId() + ":" + item.getLayer())); |
| | | list = tempList.stream().filter(item -> !listOffMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | } |
| | | isEmptyShelf = Boolean.TRUE; |
| | | //todo:如果禁用架子已绑定流程卡,因为时间不确定,笼子内的玻璃可重新绑定新架子 |
| | | // list = tempList.stream().filter(item -> !listMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | list = tempList; |
| | | |
| | | } |
| | | } |
| | | } else { |
| | |
| | | break loop; |
| | | } |
| | | //将笼子内的玻璃进行过滤,仅获取无法落架的流程卡玻璃 |
| | | List<DownStorageCageDetails> noDownLoadList = list.stream().filter(item -> !downGlassFlowList.contains(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | List<DownStorageCageDetails> noDownLoadList = list.stream().filter(item -> !downGlassFlowList.contains(item.getFlowCardId() + ":" + item.getLayer())) |
| | | .collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(noDownLoadList)) { |
| | | //是否有空架子 |
| | | // List<DownWorkstation> emptyShelfList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | |
| | | } |
| | | |
| | | Integer endCell = null; |
| | | if (!isBind) { |
| | | if (isBind) { |
| | | //获取空架子信息,将空架子信息绑定流程卡 |
| | | DownWorkstation emptyDownWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNull(DownWorkstation::getFlowCardId).orderByDesc(DownWorkstation::getWorkstationId).last("limit 1")); |
| | | if (null != emptyDownWorkstation) { |
| | | log.info("获取到空架子信息,绑定流程卡"); |
| | | downWorkstationService.updateFlowCardIdAndCount(downStorageCageDetails.getFlowCardId(), downStorageCageDetails.getLayer(), emptyDownWorkstation.getWorkstationId()); |
| | | downWorkstationService.updateFlowCardIdAndCount(downStorageCageDetails.getFlowCardId(), emptyDownWorkstation.getWorkstationId(), downStorageCageDetails.getLayer()); |
| | | endCell = emptyDownWorkstation.getWorkstationId(); |
| | | //将下片玻璃存入笼子详情信息表中 |
| | | //将任务插入理片笼详情表 |
| | | downStorageCageDetails.setState(Const.GLASS_STATE_OUT); |
| | | downStorageCageDetailsService.save(downStorageCageDetails); |
| | | } else { |
| | | log.info("没有空架子信息,无法绑定流程卡"); |
| | | return Boolean.FALSE; |
| | |
| | | DownWorkstation workstation = downWorkstationService.getOne(new LambdaUpdateWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getFlowCardId, downStorageCageDetails.getFlowCardId()).eq(DownWorkstation::getLayer, downStorageCageDetails.getLayer())); |
| | | endCell = workstation.getWorkstationId(); |
| | | } |
| | | //更新详情表内的状态 |
| | | |
| | | if (downStorageCageDetailsService.update(new LambdaUpdateWrapper<DownStorageCageDetails>() |
| | | .set(DownStorageCageDetails::getState, Const.GLASS_STATE_OUT).eq(DownStorageCageDetails::getGlassId, glassId))) { |
| | | log.info("更新详情表内的状态成功"); |
| | | // return Boolean.TRUE; |
| | | } else { |
| | | log.info("更新详情表内的状态失败"); |
| | | return Boolean.FALSE; |
| | | } |
| | | } |
| | | //更新落架玻璃数量 |
| | | if (endCell == 7) { |
| | |
| | | //生成任务信息 |
| | | DownGlassInfo downGlassInfo = new DownGlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, downGlassInfo); |
| | | //todo:落架片序 |
| | | downGlassInfo.setSequence(downGlassInfoService.queryMaxSequence(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer())); |
| | | downGlassInfoService.save(downGlassInfo); |
| | | //生成任务信息 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | |
| | | order by count desc limit 1 |
| | | </select> |
| | | <select id="queryMaxSequence" resultType="java.lang.Integer"> |
| | | SELECT max(sequence) + 1 as sequence |
| | | SELECT COALESCE(max(sequence) + 1, 0) as sequence |
| | | FROM down_glass_info |
| | | WHERE flow_card_id = #{flowCardId} |
| | | AND layer = #{layer} |
| | |
| | | import com.mes.downstorage.service.impl.DownStorageCageDetailsServiceImpl; |
| | | import com.mes.downstorage.service.impl.DownStorageCageServiceImpl; |
| | | |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.impl.DownWorkstationServiceImpl; |
| | | import com.mes.glassinfo.service.impl.GlassInfoServiceImpl; |
| | |
| | | //downGlassTaskService.getUnloadingTaskState(); |
| | | } |
| | | |
| | | @Test |
| | | public void updateDownWorkstationstate() { |
| | | |
| | | DownWorkstation downWorkstation= new DownWorkstation(); |
| | | |
| | | downWorkstation.setId(1); |
| | | downWorkstation.setEnableState(0); |
| | | downWorkstationServiceImpl.updateDownWorkstationstate(downWorkstation); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void updateDownstate() { |
| | | |
| | | DownStorageCage downStorageCage= new DownStorageCage(); |
| | | |
| | | downStorageCage.setId(1); |
| | | downStorageCage.setEnableState(0); |
| | | downStorageCageServiceImpl.updateDownStorageCage(downStorageCage); |
| | | } |
| | | |
| | | |
| | | /* @Test |
| | | public void updateDownStorageCage() { |
| | | |