Merge branch 'master' of http://bore.pub:10439/r/HangZhouMes
# Conflicts:
# UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
# hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/controller/DownGlassInfoController.java
# hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/DownGlassInfoService.java
# hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/impl/DownGlassInfoServiceImpl.java
| | |
| | | { |
| | | "plcAddressBegin": "DB11.0", |
| | | "plcAddressLenght": "92", |
| | | "plcAddressLenght": "94", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | |
| | |
| | | "codeId": "task_type", |
| | | "addressIndex": "90", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "alarm_signal", |
| | | "addressIndex": "92", |
| | | "addressLenght": "2" |
| | | } |
| | | |
| | | ] |
| | |
| | | export default { |
| | | // serverUrl: "10.153.19.150:88/api", |
| | | serverUrl: "10.153.19.150:88/api", |
| | | // serverUrl: "192.168.1.199:88/api", |
| | | serverUrl: "127.0.0.1:88/api", |
| | | // serverUrl2: "10.153.19.150:88" |
| | | // serverUrl: "127.0.0.1:88/api", |
| | | serverUrl2: "10.153.19.150:88" |
| | | // serverUrl2: "192.168.1.199:88" |
| | | serverUrl2: "127.0.0.1:88" |
| | | // serverUrl2: "127.0.0.1:88" |
| | | |
| | | //serverUrl:"res.abeim.cn" |
| | | } |
| | |
| | | basic:'设备', |
| | | add:'确认保存', |
| | | cancel:'取消', |
| | | temperingtotal:'钢化炉数:', |
| | | glasstotal:'玻璃总数:', |
| | | }, |
| | | workOrder:{ |
| | | glassID:'玻璃ID', |
| | |
| | | // const { $i18n } = useI18n(); // 获取 i18n 实例 |
| | | const router = useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const user = userStore.user.userName |
| | | // const user = userStore.user.userName |
| | | |
| | | let userInfoStr = window.localStorage.getItem('userInfo') |
| | | console.log(userInfoStr); |
| | |
| | | // export const WebSocketHost = "192.168.1.199"; |
| | | // export const WebSocketHost = "10.153.19.150"; |
| | | export const WebSocketHost = "127.0.0.1"; |
| | | // export const WebSocketHost = "192.168.1.199"; |
| | | export const WebSocketHost = "10.153.19.150"; |
| | | // export const WebSocketHost = "127.0.0.1"; |
| | | export const host = "88"; |
| | |
| | | <div style="display: flex;"> |
| | | <el-input v-model="inputValue" style="margin-left: 15px;margin-top: 10px;width: 240px" placeholder="请输入工程号" @blur="handleBlur"/> |
| | | <el-pagination |
| | | v-model:current-page="currentPage3" |
| | | v-model:page-size="pageSize3" |
| | | v-model:current-page="currentPage" |
| | | :page-size="pageSize" |
| | | :size="size" |
| | | :disabled="disabled" |
| | | :background="background" |
| | | layout="prev, pager, next, jumper" |
| | | :total="1000" |
| | | @size-change="handleSizeChange" |
| | | :total="totalPages" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> |
| | | <el-scrollbar height="550px" > |
| | | <div id="app" style="margin-top: 20px;"> |
| | | <!-- <div |
| | | :style="{ width: `${olWidth}px`, height: `${olHeight}px`,position: 'relative',}" |
| | | > --> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> |
| | | <el-scrollbar height="550px" width="1200px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="rect.glass_id" |
| | |
| | | <!-- 箭头 --> |
| | | <!-- <div id="arrow"></div> |
| | | <div id="line"></div> --> |
| | | <!-- <div class="centered-text" >NG24030401B01</div> --> |
| | | <div class="centered-text"> |
| | | <div>{{ rect.process_id }}</div> |
| | | <div style="margin-top: 50px;margin-left: -85px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div>{{ rect.glass_id }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | <!-- 点击弹出 --> |
| | | </div> |
| | | </el-scrollbar> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;"> |
| | | <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | |
| | | <el-icon class="el-icon--right"><Upload /></el-icon> |
| | | {{ $t('order.Takeaway') }}</el-button> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- </div> --> |
| | | </el-scrollbar> |
| | | </el-card> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount,onUnmounted,watchEffect } from 'vue'; |
| | | import { ref, onMounted, onBeforeUnmount,onUnmounted, computed } from 'vue'; |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | |
| | | const blind = ref(false) |
| | | const olWidth = ref(); |
| | | const olHeight = ref(); |
| | | const process_id = ref(); // 用于存储process_id的响应式引用 |
| | | const glass_id = ref(); |
| | | const inputValue = ref(''); |
| | | const currentGlassId = ref(null); // 存储当前点击矩形的 glass_id |
| | | const adjustedRects = ref([]); |
| | | const raw = ref([]); |
| | | let webSocket: WebSocket | null = null; |
| | | const totalPages = ref(0); |
| | | const pageSize = ref(1); |
| | | const currentPage = ref(1); |
| | | const disabled = false; |
| | | const size = 'small'; |
| | | const rawData = ref([]); |
| | | // const handleBind = (row) => { |
| | | // blind.value = true; // 打开绑定架子对话框 |
| | | // }; |
| | |
| | | currentGlassId.value = glassId; |
| | | blind.value = true; |
| | | } |
| | | // onMounted(async () => { |
| | | // try { |
| | | // const response = await request.post('/cacheGlass/taskCache/currentCutTerritory'); // 替换为你的API端点 |
| | | // if (response.code === 200) { |
| | | // // const process_id = response.data[0].process_id |
| | | // const rawRects = response.data; // 设置矩形数据 |
| | | // console.log(response.data); |
| | | // const { olWidth: newolWidth, olHeight: newolHeight, process_id: newprocess_id ,glass_id:newglass_id } = response.data; // 获取尺寸 |
| | | // olWidth.value = newolWidth; // 设置容器宽度 |
| | | // olHeight.value = newolHeight; // 设置容器高度 |
| | | // process_id.value = newprocess_id; |
| | | // glass_id.value = newglass_id; |
| | | |
| | | // adjustedRects.value = rawRects.map(rect => ({ |
| | | // ...rect, // 复制原始对象的其他属性 |
| | | // x_axis: (rect.x_axis*100) * 0.003, // 将x值除以3 |
| | | // y_axis: (rect.y_axis*100) * 0.003, |
| | | // width: (rect.width*100) * 0.002 , |
| | | // widtha: rect.width , |
| | | // heighta: rect.height , |
| | | // height:( rect.height*100) * 0.002 , |
| | | // glass_state: rect.glass_state |
| | | // })); |
| | | // console.log(adjustedRects.value); |
| | | |
| | | |
| | | // // console.log( (rect.width*100) / 300 ); |
| | | // } else { |
| | | // // console.error('Failed to fetch rectangles from API.'); |
| | | // console.error('Failed to fetch rects from API.'); |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rectangles :', error); |
| | | // console.error('Error fetching rects :', error); |
| | | // } |
| | | // }); |
| | | // 破损 |
| | | const handleDamage = async () => { |
| | | try { |
| | |
| | | // const response = await request.post(url) |
| | | const response = await request.post('/cacheGlass/taskCache/identControls', { |
| | | identId: currentGlassId.value, |
| | | controlsId: 201, |
| | | controlsId: 8, |
| | | line: 1001, |
| | | machine: '识别', |
| | | }) |
| | |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | updateRectStatus(currentGlassId.value, 201); |
| | | updateRectStatus(currentGlassId.value, 8); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | |
| | | // const response = await request.post(url) |
| | | const response = await request.post('/cacheGlass/taskCache/identControls', { |
| | | identId: currentGlassId.value, |
| | | controlsId: 200, |
| | | controlsId: 9, |
| | | line: 1001, |
| | | machine: '识别', |
| | | }) |
| | |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | updateRectStatus(currentGlassId.value, 200); |
| | | updateRectStatus(currentGlassId.value, 9); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | |
| | | } |
| | | } |
| | | const handleBlur = async () => { |
| | | if (inputValue.value !== '') { |
| | | try { |
| | | var url="/cacheGlass/taskCache/cutTerritory?current="+inputValue.value; |
| | | const response = await request.post(url) |
| | | if (response.data && response.data.currentCutTerritory) { |
| | | // 假设返回的数据需要调整坐标和尺寸 |
| | | adjustedRects.value = response.data.currentCutTerritory.map(rect => ({ |
| | | ...rect, |
| | | x_axis: 1360 - (rect.x_axis + rect.width) * 0.37, |
| | | y_axis: (rect.y_axis * 100) * 0.003, |
| | | width: (rect.width * 100) * 0.002, |
| | | height: (rect.height * 100) * 0.002, |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | if (inputValue.value) { |
| | | var url="/cacheGlass/taskCache/cutTerritory?current="+inputValue.value; |
| | | const response = await request.post(url) |
| | | if (response.code === 200) { |
| | | console.log(response.data); |
| | | |
| | | const rawRects = response.data[0]; |
| | | rawData.value = response.data; |
| | | totalPages.value = rawData.value.length; |
| | | adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, |
| | | x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085, |
| | | y_axis: rect.y_axis * 0.17, |
| | | width: rect.width * 0.2 , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height: rect.height * 0.165 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | // 如果WebSocket已连接,则关闭 |
| | | if (webSocket) { |
| | | webSocket.close(); |
| | | webSocket = null; |
| | | } |
| | | } catch (error) { |
| | | console.error('请求数据失败:', error); |
| | | currentPage.value = 1; |
| | | } |
| | | } |
| | | }; |
| | | // const handleBlur = async () => { |
| | | // if (inputValue.value !=''){ |
| | | // try { |
| | | // var url="/cacheGlass/taskCache/cutTerritory?current="+inputValue.value; |
| | | // const response = await request.post(url) |
| | | // console.log(response.data.length); |
| | | // if (response.code == 200) { |
| | | // adjustedRects.value = response.data |
| | | // ElMessage.success(response.message); |
| | | // } else { |
| | | // ElMessage.error(response.msg); |
| | | // } |
| | | // } |
| | | } else{ |
| | | connectWebSocket(); |
| | | } |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | currentPage.value = val; |
| | | const page = currentPage.value - 1 |
| | | adjustedRects.value = rawData.value[page]?.map(rect => ({ |
| | | // adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, |
| | | x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085, |
| | | y_axis: rect.y_axis * 0.17, |
| | | width: rect.width * 0.2 , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height: rect.height * 0.165 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | }; |
| | | function getRectColor(state: number): string { |
| | | switch (state) { |
| | | case 0: |
| | |
| | | return '#b3e19d'; |
| | | case 120: |
| | | return '#f89898'; |
| | | case 200: |
| | | return 'lightblue'; |
| | | case 201: |
| | | case 8: |
| | | return '#911005'; |
| | | case 9: |
| | | return '#f3d19e'; |
| | | default: |
| | | return '#911005'; // 默认颜色 |
| | | // default: |
| | | // return '#911005'; // 默认颜色 |
| | | } |
| | | } |
| | | // 更新矩形状态 |
| | |
| | | } |
| | | }); |
| | | } |
| | | let socket = null; |
| | | const connectWebSocket = () => { |
| | | if (!webSocket) { |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | const handleMessage = (data) => { |
| | | // adjustedRects.value = data.currentCutTerritory[0] |
| | | adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ |
| | | webSocket = new WebSocket(socketUrl); |
| | | webSocket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ |
| | | ...rect, |
| | | x_axis: 1360 -(rect.x_axis + rect.width) * 0.37, |
| | | // x_axis: (rect.x_axis*100) * 0.003, |
| | | y_axis: (rect.y_axis*100) * 0.003, |
| | | width: (rect.width*100) * 0.002 , |
| | | x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085, |
| | | y_axis: rect.y_axis * 0.17, |
| | | width: rect.width * 0.2 , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height:( rect.height*100) * 0.002 , |
| | | height: rect.height * 0.165 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | }; |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | watchEffect(() => { |
| | | if (inputValue.value === '') { |
| | | handleMessage(); |
| | | })); |
| | | }; |
| | | webSocket.onerror = (error) => { |
| | | console.error('WebSocket Error:', error); |
| | | }; |
| | | webSocket.onclose = () => { |
| | | console.log('WebSocket Connection Closed'); |
| | | // 可以选择重新连接 |
| | | }; |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | // 初始时,如果输入框为空,则连接WebSocket |
| | | if (!inputValue.value) { |
| | | connectWebSocket(); |
| | | } |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | if (webSocket) { |
| | | webSocket.close(); |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | |
| | | } |
| | | .centered-text { |
| | | /* 设置文字居中样式 */ |
| | | display: flex; |
| | | /* display: flex; */ |
| | | justify-content: center; |
| | | align-items: center; |
| | | align-items: center; |
| | | height: 100%; /* 确保div占据整个矩形的高度 */ |
| | | } |
| | | font-size: small; |
| | | } |
| | | #rect { |
| | | position: relative; /* 确保箭头可以相对于矩形定位 */ |
| | | /* 其他样式 */ |
| | |
| | | .then((res) => { |
| | | if (res['code'] == 200) { |
| | | store.$patch({user: res.data}) |
| | | console.log(res.data) |
| | | |
| | | router.push('/main') |
| | | ElMessage.success(t('login.loginSuccessful')) |
| | | } else { |
| | | ElMessage.error(res['msg']) |
| | | // ElMessage.error(res['msg']) |
| | | store.$patch({ |
| | | user: null, |
| | | }) |
| | |
| | | function updateRectColors() { |
| | | adjustedRectsa.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | | rect.state = 5; |
| | | rect.state = 8; |
| | | } |
| | | }); |
| | | adjustedRectsb.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | | rect.state = 8; |
| | | } |
| | | }); |
| | | } |
| | | function getRectColora(state) { |
| | | switch (state) { |
| | |
| | | return '#95d475'; |
| | | case -1: |
| | | return '#CDAF95'; |
| | | case 5: |
| | | case 8: |
| | | return '#911005'; |
| | | } |
| | | } |
| | |
| | | return '#eebe77'; |
| | | case 4: |
| | | return '#CD6090'; |
| | | case 5: |
| | | case 8: |
| | | return '#911005'; |
| | | } |
| | | } |
| | |
| | | glassId: currentGlassId.value, |
| | | // temperingFeedSequence: currenttemperingFeedSequence.value, |
| | | line: 4001, |
| | | status: 2, |
| | | status: 8, |
| | | workingProcedure: '钢化', |
| | | }) |
| | | if (response.code == 200) { |
| | |
| | | left: `${rect.xcoordinate}px`, |
| | | width: `${rect.width}px`, |
| | | height: `${rect.height}px`, |
| | | backgroundColor: rect.state === 5 ? '#911005' : 'lightblue' }" |
| | | backgroundColor: rect.state === 8 ? '#911005' : 'lightblue' }" |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.glassId }}</div> |
| | |
| | | left: `${rect.xcoordinate}px`, |
| | | width: `${rect.width}px`, |
| | | height: `${rect.height}px`, |
| | | backgroundColor: rect.state === 5 ? '#911005' : 'lightblue' }" |
| | | backgroundColor: rect.state === 8 ? '#911005' : 'lightblue' }" |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.glassId }}</div> |
| | |
| | | } |
| | | }; |
| | | function updateRectColors() { |
| | | adjustedRectsa.value.forEach(rect => { |
| | | adjustedRects.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | | rect.state = 5; |
| | | rect.state = 8; |
| | | } |
| | | }); |
| | | } |
| | |
| | | return '#eebe77'; |
| | | case 4: |
| | | return '#CD6090'; |
| | | case 5: |
| | | case 8: |
| | | return '#911005'; |
| | | } |
| | | } |
| | |
| | | glassId: currentGlassId.value, |
| | | // temperingFeedSequence: currenttemperingFeedSequence.value, |
| | | line: 4001, |
| | | status: 2, |
| | | status: 8, |
| | | workingProcedure: '钢化', |
| | | }) |
| | | if (response.code == 200) { |
| | |
| | | const adjustedRectsh = ref([]); |
| | | const currentRow = reactive({}); // 当前行的数据 |
| | | const inputValuesa = reactive({}); |
| | | |
| | | const add = ref(false) |
| | | const flowCardId = ref(''); |
| | | const gap = ref(''); |
| | |
| | | const cell8=ref(true); |
| | | const cell9=ref(true); |
| | | const selectedRow = ref(null); // 存储选中的行数据 |
| | | |
| | | const temperingtotal = ref(0); |
| | | const glasstotal = ref(0); |
| | | // 当前页码和每页显示的条数 |
| | | const currentPage = ref(1); |
| | | const itemsPerPage = computed(() => { |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/damageBigStorageCageDetails?status="+0, row) |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/damageBigStorageCageDetails?status="+8, row) |
| | | if (response.code === 200) { |
| | | tableData.value = response.data; |
| | | ElMessage.success(response.message); |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/damageBigStorageCageDetails?status="+1, row) |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/damageBigStorageCageDetails?status="+9, row) |
| | | if (response.code === 200) { |
| | | tableData.value = response.data; |
| | | ElMessage.success(response.message); |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/cacheVerticalGlass/temperingGlassInfo/damageTemperingGlassInfo?status="+0, row) |
| | | const response = await request.post("/cacheVerticalGlass/temperingGlassInfo/damageTemperingGlassInfo?status="+8, row) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/cacheVerticalGlass/temperingGlassInfo/damageTemperingGlassInfo?status="+1, row) |
| | | const response = await request.post("/cacheVerticalGlass/temperingGlassInfo/damageTemperingGlassInfo?status="+9, row) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | tableDatagh.value = response.data |
| | | temperingtotal.value = response.data.length |
| | | let totalCount = 0; |
| | | response.data.forEach(item => { |
| | | totalCount += item.count || 0; |
| | | }); |
| | | glasstotal.value = totalCount; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | |
| | | if(data.bigStorageCageDetailsOutTask!=null){ |
| | | tableDatac.value = data.bigStorageCageDetailsOutTask[0] |
| | | adjusta.value = data.bigStorageCageDetailsOutTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | console.log(data.bigStorageCageDetailsOutTask[0]); |
| | | |
| | | } else { |
| | | tableDatac.value = '', |
| | | adjusta.value = '' |
| | |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <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.glassId" align="center" :label="$t('searchOrder.outputglassID')" min-width="140" /> |
| | | <el-table-column prop="bigStorageCageOutTask.startSlot" align="center" :label="$t('searchOrder.startposition')" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageOutTask.endSlot" align="center" :label="$t('searchOrder.targetlocation')" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageOutTask.trainNumber" align="center" :label="$t('searchOrder.trips')" min-width="120" /> |
| | |
| | | <el-table-column prop="id" align="center" :label="$t('searchOrder.tabid')" min-width="150"/> |
| | | <el-table-column prop="deviceId" align="center" :label="$t('searchOrder.tid')" min-width="100"/> |
| | | <el-table-column prop="slot" align="center" :label="$t('searchOrder.gridnumber')" min-width="100"/> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120"/> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="140"/> |
| | | <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="150"/> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="140"/> |
| | | <el-table-column prop="glassType" align="center" :label="$t('searchOrder.typeglass')" min-width="100"/> |
| | |
| | | <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-column prop="bigStorageCageFeedTask.glassId" align="center" :label="$t('searchOrder.intoglassid')" min-width="140" /> |
| | | <el-table-column prop="bigStorageCageFeedTask.targetSlot" align="center" :label="$t('searchOrder.targetlocation')" min-width="120" /> |
| | | <!-- <el-table-column prop="task_type" align="center" label="任务类型" min-width="120" />没有返回字段 --> |
| | | <el-table-column prop="bigStorageCageFeedTask.taskState" align="center" :label="$t('searchOrder.taskstatus')" min-width="120"> |
| | |
| | | <el-table-column prop="id" align="center" :label="$t('searchOrder.tabid')" min-width="150"/> |
| | | <el-table-column prop="deviceId" align="center" :label="$t('searchOrder.tid')" min-width="100"/> |
| | | <el-table-column prop="slot" align="center" :label="$t('searchOrder.gridnumber')" min-width="100"/> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120"/> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="140"/> |
| | | <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="150"/> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="140"/> |
| | | <el-table-column prop="glassType" align="center" :label="$t('searchOrder.typeglass')" min-width="100"/> |
| | |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisiblec" top="5vh" width="85%" :title="$t('searchOrder.temperingqueries')"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="4"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('searchOrder.temperingtotal')" style="width: 14vw"> |
| | | {{ temperingtotal }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('searchOrder.glasstotal')" style="width: 14vw"> |
| | | {{ glasstotal }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | <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"/> |
| | |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { |
| | | glassId: row.glass_id, |
| | | controlsId: 300, |
| | | controlsId: 8, |
| | | line: 2001, |
| | | machine: '冷加工', |
| | | }) |
| | |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { |
| | | glassId: row.glass_id, |
| | | controlsId: 301, |
| | | controlsId: 9, |
| | | line: 2001, |
| | | machine: '冷加工', |
| | | }) |
| | |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { |
| | | glassId: row.glass_id, |
| | | controlsId: 300, |
| | | controlsId: 8, |
| | | line: 2002, |
| | | machine: '冷加工', |
| | | }) |
| | |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { |
| | | glassId: row.glass_id, |
| | | controlsId: 301, |
| | | controlsId: 9, |
| | | line: 2002, |
| | | machine: '冷加工', |
| | | }) |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div id="center" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 750px;"> |
| | | <img src="../../assets/d1a.png" alt="" style="margin-left: -10px; width: 100%;height: 100%;position: relative;"> |
| | | <div id="parent" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 750px;"> |
| | | <img src="../../assets/dpxsa.png" alt="" style="margin-left: -10px; width: 100%;height: 100%;position: relative;"> |
| | | <div id="lipiana" v-show="woshia"></div> |
| | | <div id="lipianb" v-show="woshia"></div> |
| | | <div id="lipianc" v-show="woshic"></div> |
| | | <div id="lipiand" v-show="woshic"></div> |
| | | <div id="overlay" v-show="flake"></div> |
| | | <div id="overlayb" v-show="flakeb"></div> |
| | | <div id="overlayc" v-show="flakec"></div> |
| | | <div id="overlayd" v-show="flaked"></div> |
| | | <div id="longa" v-show="dalipiana"></div> |
| | | <div id="longb" v-show="dalipianb"></div> |
| | | <div id="shangpianji" v-show="shangpian"></div> |
| | | </div> |
| | | <div id="centerright" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 240px;background-color: #911005;"> |
| | | <el-table height="240" ref="table" width="340px" |
| | |
| | | const tableDatac = ref([]) |
| | | const adjustedRects = ref([]); |
| | | const chartRefs = ref([]); |
| | | const flake = ref(false) |
| | | const flakeb = ref(false) |
| | | const flakec = ref(false) |
| | | const flaked = ref(false) |
| | | const woshia = ref(false) |
| | | const woshic = ref(false) |
| | | const dalipiana = ref(false) |
| | | const dalipianb = ref(false) |
| | | const shangpian = ref(false) |
| | | |
| | | const thisProcess = ref(); // 用于存储process_id的响应式引用 |
| | | // 定义一个响应式引用来存储图表实例 |
| | | const chartDom = ref(null); |
| | |
| | | const handleBinda = (row) => { |
| | | blinda.value = true; |
| | | }; |
| | | const processesData = ref([ |
| | | |
| | | ]); |
| | | const processesData = ref([]); |
| | | function getStatusType(warehousing) { |
| | | switch (warehousing) { |
| | | case 0: |
| | |
| | | } |
| | | } |
| | | let socket = null; |
| | | let socket2 = null; |
| | | let socket3 = null; |
| | | let socket4 = null; |
| | | let socket5 = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | const handleMessage = (data) => { |
| | | tableData.value = data.awaitingRepairs[0] |
| | | tableDatab.value = data.DoingTask[0] |
| | | tableDatac.value = data.orders[0] |
| | | // adjustedRects.value = data.device[0].map(rect => ({ |
| | | // ...rect, |
| | | // completed: rect.completedQuantity, |
| | | // breakage: rect.breakageQuantity, |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | }; |
| | | // let socket; |
| | | // 设置图表 DOM 引用 |
| | | function setChartDom(index, el) { |
| | | if (!chartRefs.value[index]) { |
| | | chartRefs.value[index] = { dom: el, chart: null }; |
| | | } else { |
| | | chartRefs.value[index].dom = el; |
| | | } |
| | | } |
| | | onMounted(() => { |
| | | socket = new WebSocket(socketUrl); |
| | | socket.onmessage = (event) => { |
| | | socket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | processesData.value = data.device[0].map(rect => ({ |
| | | ...rect, |
| | |
| | | thisProcess: rect.thisProcess, |
| | | })); |
| | | renderPieCharts(); |
| | | console.log(processesData.value); |
| | | // updateCharts(); |
| | | } |
| | | }; |
| | | |
| | | // }; |
| | | }); |
| | | function setChartDom(index, el) { |
| | | if (!chartRefs.value[index]) { |
| | | chartRefs.value[index] = { dom: el, chart: null }; |
| | | } else { |
| | | chartRefs.value[index].dom = el; |
| | | } |
| | | } |
| | | const socketUrl2 = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingIsRun`; |
| | | const handleMessage2 = (data) => { |
| | | const tasks = data.temperingTaskType[0]; |
| | | if (tasks && tasks.length >= 4) { |
| | | flake.value = tasks[0].state === 1; |
| | | flakeb.value = tasks[1].state === 2; |
| | | flakec.value = tasks[2].state === 3; |
| | | flaked.value = tasks[3].state === 4; |
| | | } |
| | | }; |
| | | // 卧式理片 |
| | | const socketUrl3 = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlassIsRun`; |
| | | const handleMessage3 = (data) => { |
| | | const tasks = data.taskCaches[0]; |
| | | woshia.value = tasks.some(task => task.endCell == 2001 && task.glassId == 0); |
| | | woshic.value = tasks.some(task => task.endCell == 2002 && task.glassId == 0); |
| | | }; |
| | | // 大理片笼 |
| | | const socketUrl4 = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/isRun`; |
| | | const handleMessage4 = (data) => { |
| | | const tasks = data.bigStorageCageDetailsOutTask[0]; |
| | | const taskss = data.bigStorageCageDetailsFeedTask[0]; |
| | | dalipiana.value = tasks.some(task => task.slot !== null && task.slot !== undefined); |
| | | dalipianb.value = taskss.some(task => task.slot !== null && task.slot !== undefined); |
| | | }; |
| | | // 上片 |
| | | const socketUrl5 = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlassIsRun`; |
| | | const handleMessage5 = (data) => { |
| | | if(data.engineering.length !==0 ){ |
| | | shangpian.value = true; |
| | | } |
| | | }; |
| | | const renderPieCharts = () => { |
| | | processesData.value.forEach((data, index) => { |
| | | const chart = echarts.init(document.getElementById('pieChart_' + index)); |
| | |
| | | }; |
| | | |
| | | |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | // onUnmounted(() => { |
| | | // socket.close(); |
| | | // socket2.close(); |
| | | // }); |
| | | // onMounted(() => { |
| | | // socket = initializeWebSocket(socketUrl, handleMessage); |
| | | // // socket = new WebSocket(socketUrl); |
| | | // socket.onmessage = (event) => { |
| | | // const data = JSON.parse(event.data); |
| | | // processesData.value = data.device[0].map(rect => ({ |
| | | // ...rect, |
| | | // completedQuantity: rect.completedQuantity, |
| | | // breakageQuantity: rect.breakageQuantity, |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | // renderPieCharts(); |
| | | // console.log(processesData.value); |
| | | // // updateCharts(); |
| | | // socket2 = initializeWebSocket(socketUrl2, handleMessage2); |
| | | // // socket2 = new WebSocket(socketUrl2); |
| | | // // socket2.onmessage = (event) => { |
| | | // // const data = JSON.parse(event.data); |
| | | // // handleMessage2(data); |
| | | // // }; |
| | | // }; |
| | | // }); |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | socket2 = initializeWebSocket(socketUrl2, handleMessage2); |
| | | socket3 = initializeWebSocket(socketUrl3, handleMessage3); |
| | | socket4 = initializeWebSocket(socketUrl4, handleMessage4); |
| | | socket5 = initializeWebSocket(socketUrl5, handleMessage5); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | if (socket2) { |
| | | closeWebSocket2(socket2); |
| | | } |
| | | if (socket3) { |
| | | closeWebSocket3(socket3); |
| | | } |
| | | if (socket4) { |
| | | closeWebSocket4(socket4); |
| | | } |
| | | if (socket5) { |
| | | closeWebSocket5(socket5); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | closeWebSocket2(); |
| | | closeWebSocket3(); |
| | | closeWebSocket4(); |
| | | closeWebSocket5(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | |
| | | |
| | | .echarts-container { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 20px; |
| | | } |
| | | |
| | | .echarts-item { |
| | | width: 150px; |
| | | height: 150px; |
| | | margin: 20px; |
| | | } |
| | | |
| | | .pie-chart { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | #parent{ |
| | | position: relative; |
| | | width: 1500px; |
| | | margin-left: -300px |
| | | } |
| | | #overlay{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 29px; |
| | | height: 10px; |
| | | background-color: #529b2e; |
| | | margin-top: -34px; |
| | | margin-left: -8px; |
| | | } |
| | | #overlayb{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 15px; |
| | | height: 115px; |
| | | background-color: #529b2e; |
| | | margin-top: -197px; |
| | | margin-left: -3px; |
| | | } |
| | | #overlayc{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 14px; |
| | | height: 16px; |
| | | background-color: #529b2e; |
| | | margin-top: -243px; |
| | | margin-left: -2px; |
| | | } |
| | | #overlayd{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 28px; |
| | | height: 11px; |
| | | background-color: #529b2e; |
| | | margin-top: -239px; |
| | | margin-left: 40px; |
| | | } |
| | | #lipiana{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 65px; |
| | | height: 10px; |
| | | background-color: #529b2e; |
| | | margin-top: -57px; |
| | | margin-left: 240px; |
| | | } |
| | | #lipianb{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 16px; |
| | | height: 10px; |
| | | background-color: #529b2e; |
| | | margin-top: -72px; |
| | | margin-left: 323px; |
| | | } |
| | | #lipianc{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 65px; |
| | | height: 10px; |
| | | background-color: #529b2e; |
| | | margin-top: -32px; |
| | | margin-left: 270px; |
| | | } |
| | | #lipiand{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 21px; |
| | | height: 10px; |
| | | background-color: #529b2e; |
| | | margin-top: -48px; |
| | | margin-left: 354px; |
| | | } |
| | | #longa{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 29px; |
| | | height: 5px; |
| | | background-color: #529b2e; |
| | | margin-top: -20px; |
| | | margin-left: 80px; |
| | | } |
| | | #longb{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 29px; |
| | | height: 5px; |
| | | background-color: #529b2e; |
| | | margin-top: -20px; |
| | | margin-left: 150px; |
| | | } |
| | | #shangpianji{ |
| | | position: absolute; |
| | | z-index: 1; |
| | | width: 29px; |
| | | height: 10px; |
| | | background-color: #529b2e; |
| | | margin-top: -90px; |
| | | margin-left: 568px; |
| | | } |
| | | </style> |
| | |
| | | * 人工下片102 |
| | | * 出片中103 |
| | | * 调度中104 |
| | | * 拿走200 |
| | | * 破损201 |
| | | * 破损8 |
| | | * 拿走9 |
| | | */ |
| | | public static final Integer GLASS_STATE_NEW = 0; |
| | | public static final Integer GLASS_STATE_IN = 100; |
| | |
| | | public static final Integer GLASS_STATE_ARTIFICIAL = 102; |
| | | public static final Integer GLASS_STATE_OUT_ING = 103; |
| | | public static final Integer GLASS_STATE_SCHEDULE_ING = 104; |
| | | public static final Integer GLASS_STATE_TAKE = 200; |
| | | public static final Integer GLASS_STATE_DAMAGE = 201; |
| | | public static final Integer GLASS_STATE_DAMAGE = 8; |
| | | public static final Integer GLASS_STATE_TAKE = 9; |
| | | public static final List<Integer> GLASS_STATE_IN_ALL = Arrays.asList(100, 102, 103, 104); |
| | | public static final List<Integer> GLASS_STATE_IN_ALL_ZERO = Arrays.asList(0, 100, 102, 103, 104); |
| | | |
| | |
| | | * 2 卧转立进片完成 |
| | | * 3 大车进片完成 |
| | | * 4 大理片笼进片完成 |
| | | * 5 大理片笼进片失败 |
| | | * 6 大理片笼进片破损 |
| | | * 8 大理片笼进片破损 |
| | | * 9 大理片笼进片拿走 |
| | | */ |
| | | public static final Integer BIG_STORAGE_IN_NEW = 1; |
| | | public static final Integer BIG_STORAGE_IN_UP = 2; |
| | | public static final Integer BIG_STORAGE_IN_CAR = 3; |
| | | public static final Integer BIG_STORAGE_IN_SLOT = 4; |
| | | public static final Integer BIG_STORAGE_IN_ERROR = 5; |
| | | public static final Integer BIG_STORAGE_IN_DAMAGE = 6; |
| | | // public static final Integer BIG_STORAGE_IN_DAMAGE = 8; |
| | | // public static final Integer BIG_STORAGE_IN_ERROR = 9; |
| | | public static final List<Integer> BIG_STORAGE_IN_UP_ALL = Arrays.asList(1, 2); |
| | | /** |
| | | * 卧转立出片请求 |
| | | * 1 任务生成 |
| | | * 2 玻璃进大车完成 |
| | | * 3 大车出片完成 |
| | | * 4 大理片笼进片失败 |
| | | * 5 大理片笼进片破损 |
| | | * 8 大理片笼进片破损 |
| | | * 9 大理片笼进片拿走 |
| | | */ |
| | | public static final Integer BIG_STORAGE_OUT_NEW = 1; |
| | | public static final Integer BIG_STORAGE_OUT_CAR = 2; |
| | | 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 Integer BIG_STORAGE_OUT_DAMAGE = 8; |
| | | // public static final Integer BIG_STORAGE_OUT_ERROR = 9; |
| | | public static final List<Integer> BIG_STORAGE_OUT_ALL = Arrays.asList(2, 3); |
| | | |
| | | /** |
| | |
| | | * 2 进炉完成 |
| | | * 3 钢化完成 |
| | | * 4 出片完成 |
| | | * 5 破损 |
| | | * 6 拿走 |
| | | * 8 破损 |
| | | * 9 拿走 |
| | | */ |
| | | |
| | | public static final Integer TEMPERING_NEW = -1; |
| | |
| | | public static final Integer TEMPERING_START = 2; |
| | | public static final Integer TEMPERING_SUCCESS = 3; |
| | | public static final Integer TEMPERING_END = 4; |
| | | public static final Integer TEMPERING_DAMAGE = 5; |
| | | public static final Integer TEMPERING_TAKE = 6; |
| | | // public static final Integer TEMPERING_DAMAGE = 8; |
| | | // public static final Integer TEMPERING_TAKE = 9; |
| | | |
| | | /** |
| | | * 下片 |
| | |
| | | public Integer updateTemperingState(TemperingGlassInfo temperingGlassInfo) { |
| | | UpdateWrapper<TemperingGlassInfo> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("glass_id",temperingGlassInfo.getGlassId()) |
| | | .lt("state",5) |
| | | .lt("state",6) |
| | | .set("state", temperingGlassInfo.getState());; |
| | | if (temperingMapper.update(null,wrapper) > 0) { |
| | | return 200; |
| | |
| | | |
| | | if (temperingGlassInfo != null) { |
| | | if (status == 0) { |
| | | temperingGlassInfo.setState(Const.TEMPERING_DAMAGE); |
| | | temperingGlassInfo.setState(Const.GLASS_STATE_DAMAGE); |
| | | } else { |
| | | temperingGlassInfo.setState(Const.TEMPERING_TAKE); |
| | | temperingGlassInfo.setState(Const.GLASS_STATE_TAKE); |
| | | } |
| | | temperingGlassInfoMapper.updateById(temperingGlassInfo); |
| | | } |
| | |
| | | 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); |
| | | edgGlassTaskInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskInfo>() |
| | | .set(EdgGlassTaskInfo::getStatus, Const.EDG_GLASS_SUCCESS).eq(EdgGlassTaskInfo::getGlassId, d01Id)); |
| | | d01GlassId = d01Id; |
| | | } |
| | | } |
| | |
| | | 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); |
| | | edgGlassTaskInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskInfo>() |
| | | .set(EdgGlassTaskInfo::getStatus, Const.EDG_GLASS_SUCCESS).eq(EdgGlassTaskInfo::getGlassId, d04Id)); |
| | | d04GlassId = d04Id; |
| | | } |
| | | } |
| | |
| | | log.info("大理片笼破损玻璃清除任务开始执行时间:{}", startDate); |
| | | //获取进片任务表中状态为破损的数据 |
| | | List<BigStorageCageFeedTask> inDamageTaskInfoList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_DAMAGE)); |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.GLASS_STATE_DAMAGE)); |
| | | if (CollectionUtils.isNotEmpty(inDamageTaskInfoList)) { |
| | | log.info("获取进片任务表中破损的玻璃信息{}", inDamageTaskInfoList); |
| | | bigStorageCageFeedTaskService.remove(new LambdaQueryWrapper<BigStorageCageFeedTask>().eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_DAMAGE)); |
| | | bigStorageCageFeedTaskService.remove(new LambdaQueryWrapper<BigStorageCageFeedTask>().eq(BigStorageCageFeedTask::getTaskState, Const.GLASS_STATE_DAMAGE)); |
| | | //理片笼详情表数据状态更新 |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW).in(BigStorageCageDetails::getGlassId, inDamageTaskInfoList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()))); |
| | |
| | | } |
| | | //获取出片任务表中状态为破损的数据 |
| | | List<BigStorageCageOutTask> outDamageTaskInfoList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_DAMAGE)); |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE)); |
| | | if (CollectionUtils.isNotEmpty(outDamageTaskInfoList)) { |
| | | log.info("获取出片任务表中破损的玻璃信息{}", outDamageTaskInfoList); |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_DAMAGE)); |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE)); |
| | | List<String> glassIdList = outDamageTaskInfoList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | //移除钢化下片表数据 |
| | | temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().in(TemperingGlassInfo::getGlassId, glassIdList)); |
| | |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | @Scheduled(fixedDelay = 30000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcLoadGlassTask() throws InterruptedException { |
| | | try { |
| | | //获取联机状态 |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 30000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcLoadGlassReport() { |
| | | //获取是否有汇报 |
| | | String loadStatus = plcParameterObject.getPlcParameter("PlcStatus").getValue(); |
| | |
| | | public void loadGlassStatus() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | // String inkageStatus =plcParameterObject.getPlcParameter("InkageStatus").getValue(); |
| | | String inkageStatus ="1"; |
| | | String inkageStatus =plcParameterObject.getPlcParameter("InkageStatus").getValue(); |
| | | // String inkageStatus ="1"; |
| | | jsonObject.append("InkageStatus", inkageStatus); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); |
| | | if (sendwServer != null) { |
| | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void loadGlassIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //是否开始工程 |
| | | Engineering engineering = engineeringService.selectInitiate(1); |
| | | if (engineering != null){ |
| | | jsonObject.append("engineering", engineering); |
| | | }else { |
| | | jsonObject.append("engineering", "0"); |
| | | } |
| | | //工位信息 |
| | | List<UpWorkstation> upWorkstations = upWorkstationService.list(); |
| | | jsonObject.append("list", upWorkstations); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlassIsRun"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | |
| | | public Result <Integer> updateTemperingState(@RequestBody Damage damage) { |
| | | damageService.insertDamage(damage); |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | if(damage.getStatus()==2){ |
| | | temperingGlassInfo.setState(5); |
| | | |
| | | } |
| | | temperingGlassInfo.setState(damage.getStatus()); |
| | | temperingGlassInfo.setGlassId(damage.getGlassId()); |
| | | int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); |
| | | return Result.build(200, "破损成功", result); |
| | |
| | | package com.mes.downglassinfo.controller; |
| | | |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.request.DownGlassInfoRequest; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.utils.Result; |
| | |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | @PostMapping("/selectDownGlassInfo") |
| | | public Result setDownGlassInfoRequest(@RequestBody DownGlassInfoRequest request) { |
| | | downGlassInfoService.setDownGlassInfoRequest(request); |
| | | return Result.build(200,"查询成功",1); |
| | | public Result<String> setDownGlassInfoRequest(@RequestBody DownGlassInfoRequest request) { |
| | | return Result.success(downGlassInfoService.setDownGlassInfoRequest(request)); |
| | | } |
| | | |
| | | @PostMapping("/downGlassPrint") |
| | | public Result downGlassPrint(@RequestBody DownGlassInfo downGlassInfo) { |
| | | return Result.build(200,"查询成功",downGlassInfoService.downGlassPrint(downGlassInfo)); |
| | | } |
| | | } |
| | |
| | | * @param isDownload 是否获取未落架玻璃信息 True 已落架 false 未落架 |
| | | * @return |
| | | */ |
| | | List<DownGlassInfoDTO> queryWorkStationIsIn(@Param(value = "isDownload") Boolean isDownload); |
| | | List<DownGlassInfoDTO> queryWorkStationIsIn(@Param(value = "workList") List<Integer> workList, @Param(value = "isDownload") Boolean isDownload); |
| | | |
| | | /** |
| | | * 获取 |
| | | * |
| | | * @param workList |
| | | * @return |
| | | */ |
| | | List<DownGlassInfoDTO> queryWorkStationFlowCard(@Param(value = "workList") List<Integer> workList); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.request.DownGlassInfoRequest; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | |
| | | import java.util.List; |
| | |
| | | * @param isDownload true/false |
| | | * @return |
| | | */ |
| | | List<DownGlassInfoDTO> queryWorkStationIsIn(Boolean isDownload); |
| | | List<DownGlassInfoDTO> queryWorkStationIsIn(List<Integer> workList, Boolean isDownload); |
| | | |
| | | /** |
| | | * 获取指定架子已绑定流程卡的架子未落玻璃的数据信息 |
| | | * |
| | | * @param workList 指定的架子号 |
| | | * @return |
| | | */ |
| | | List<DownGlassInfoDTO> queryWorkStationFlowCard(List<Integer> workList); |
| | | |
| | | /** |
| | | * 生成出片任务 |
| | |
| | | */ |
| | | boolean generateOutGlassTask(String glassId); |
| | | |
| | | /** |
| | | * 设置架子定时任务查询条件 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | String setDownGlassInfoRequest(DownGlassInfoRequest request); |
| | | |
| | | List<Map<String, List<Map<String, Object>>>> downGlassPrint(DownGlassInfo downGlassInfo); |
| | | |
| | | List<DownWorkstation> queryWorkStationIsFull(); |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downglassinfo.service.impl; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.job.DownLoadCacheGlassTask; |
| | | import com.mes.pp.service.FlowCardService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.HashMap;import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class DownGlassInfoServiceImpl extends ServiceImpl<DownGlassInfoMapper, DownGlassInfo> implements DownGlassInfoService { |
| | |
| | | |
| | | @Autowired |
| | | DownStorageCageDetailsService downStorageCageDetailsService; |
| | | |
| | | |
| | | @Autowired |
| | | DownWorkstationService downWorkstationService; |
| | | |
| | | @Autowired |
| | | RedisUtil redisUtil; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DownGlassInfoDTO> queryWorkStationIsIn(Boolean isDownload) { |
| | | return baseMapper.queryWorkStationIsIn(isDownload); |
| | | public List<DownGlassInfoDTO> queryWorkStationIsIn(List<Integer> workList, Boolean isDownload) { |
| | | //按照要求获取已落架/未落架的玻璃信息 |
| | | return baseMapper.queryWorkStationIsIn(workList, isDownload); |
| | | } |
| | | |
| | | @Override |
| | | public List<DownGlassInfoDTO> queryWorkStationFlowCard(List<Integer> workList) { |
| | | //获取已绑定流程卡的架子未落玻璃的数据信息 |
| | | return baseMapper.queryWorkStationFlowCard(workList); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public List<DownWorkstation> queryWorkStationIsFull() { |
| | | //查询可以落架的玻璃信息且已绑定流程卡的工位信息 |
| | | List<DownWorkstation> list = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getEnableState, Const.SLOT_ON) |
| | | .isNotNull(DownWorkstation::getFlowCardId).ne(DownWorkstation::getFlowCardId, "")); |
| | | List<DownWorkstation> workstationFull = new ArrayList<>(); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | //都有玻璃的工位信息(包括绑定流程卡) |
| | | List<Integer> workstationList = list.stream().map(DownWorkstation::getWorkstationId).collect(Collectors.toList()); |
| | | //按照符合条件的工位获取未落架的流程卡玻璃,如果返回为空,则表明所有都已落架完成 |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = queryWorkStationIsIn(workstationList, Boolean.FALSE); |
| | | //获取工位上的未满的流程卡及层数 |
| | | List<String> flowCardIdList = downGlassInfoDTOList.stream().map(item -> item.getFlowCardId() + ":" + item.getLayer()).collect(Collectors.toList()); |
| | | //可以落架的玻璃信息且已绑定流程卡的所有的工位 - 玻璃未满流程卡及层数的工位 = 已满工位 |
| | | workstationFull = list.stream().filter(item -> !flowCardIdList.contains(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | //是否需要将已满的工位置为不可落架 |
| | | List<Integer> workstationIds = workstationFull.stream().map(DownWorkstation::getWorkstationId).collect(Collectors.toList()); |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getEnableState, Const.SLOT_OFF) |
| | | .in(DownWorkstation::getWorkstationId, workstationIds)); |
| | | |
| | | } |
| | | return workstationFull; |
| | | }@Override |
| | | public List<Map<String, List<Map<String, Object>>>> downGlassPrint(DownGlassInfo downGlassInfo){ |
| | | QueryWrapper<DownGlassInfo> queryWrapper = Wrappers.query(); |
| | | queryWrapper.eq("flow_card_id", "NG24080012A001") |
| | |
| | | listMap.add(result); |
| | | return listMap; |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | boolean DirectConnection(GlassInfo glassInfo); |
| | | |
| | | /** |
| | | * 获取当前非本架子可落架的玻璃信息 |
| | | * |
| | | * @param glassId |
| | | * @param workList G06/G11:传入G06实际获取的为可落架G11的玻璃 反之同理 |
| | | * @return |
| | | */ |
| | | String getGlassInfoMaxCount(String glassId, List<Integer> workList); |
| | | |
| | | /** |
| | | * @param glassId |
| | | * @param ControlsId |
| | | * @return 破损 |
| | | * @return 破损 |
| | | */ |
| | | boolean identWorn(String glassId, int ControlsId); |
| | | } |
| | |
| | | return Result.build(200, "更换成功", isSucess); |
| | | } |
| | | |
| | | @ApiOperation("关闭工位已满警报") |
| | | @PostMapping("/closeAlarmSignal") |
| | | @ResponseBody |
| | | public Result<String> closeAlarmSignal() { |
| | | return Result.build(200, "更换成功", downWorkstationService.closeAlarmSignal()); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | * @returnq 启用禁用 |
| | | */ |
| | | boolean updateDownWorkstationstate(DownWorkstation downWorkstation); |
| | | |
| | | String closeAlarmSignal(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String closeAlarmSignal() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("alarm_signal").getAddress(), 0); |
| | | return "success"; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcShelfFull() { |
| | | List<DownWorkstation> list = downGlassInfoService.queryWorkStationIsFull(); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | s7control.writeWord(plcMesObject.getPlcParameter("alarm_signal").getAddress(), 1); |
| | | } |
| | | } |
| | | |
| | | public void inTo(String glassId, String requestWord, String currentSlot) { |
| | | log.info("1、按照玻璃id:{}获取玻璃小片信息,当前格子为:{}", glassId, currentSlot); |
| | | //添加进片任务 查找空格 |
| | |
| | | } |
| | | if (!checkFlag) { |
| | | log.info("无空架子,获取已绑定架子的流程卡信息,查看玻璃信息是否可被对调"); |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationIsIn(Boolean.FALSE); |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationIsIn(Const.WORK_STATION_ALL, Boolean.FALSE); |
| | | log.info("获取架子上已绑定流程卡落架的数量及未落架的玻璃数据:{}", downGlassInfoDTOList); |
| | | if (CollectionUtils.isEmpty(downGlassInfoDTOList)) { |
| | | 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<DownStorageCageDetails> list = new ArrayList(); |
| | | //是否有空架子 true:有 false:无 |
| | |
| | | loop: |
| | | if (StringUtils.isBlank(tempGlassId)) { |
| | | //获取正在落架的绑定流程卡的信息(流程卡、层数、落架数量) |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationIsIn(Boolean.TRUE); |
| | | //todo:落架玻璃数为0,即使绑定了流程卡,也无法找到对应的架子信息,只能重新绑定 |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationFlowCard(workList); |
| | | List<String> downGlassFlowList = downGlassInfoDTOList.stream().map(item -> item.getFlowCardId() + ":" + item.getLayer()).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(downGlassFlowList)) { |
| | | //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃id,无 则返回扫描扫到的玻璃id进行出片 |
| | | tempGlassId = downStorageCageDetailsService.getGlassInfoMaxCount(glassId, offWorkStationList); |
| | | |
| | | isNeedBind = Boolean.TRUE; |
| | | break loop; |
| | | } |
| | |
| | | //落架片序 |
| | | downGlassInfo.setSequence(downGlassInfoService.queryMaxSequence(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer())); |
| | | downGlassInfo.setWorkStationId(endCell); |
| | | downGlassInfo.setGmtCreate(new Date()); |
| | | downGlassInfoService.save(downGlassInfo); |
| | | //生成任务信息 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | |
| | | AND T.LAYER = T1.LAYER |
| | | LEFT JOIN DOWN_GLASS_INFO T2 ON T1.GLASS_ID = T2.GLASS_ID |
| | | <where> |
| | | t.workstation_id in |
| | | <foreach collection="workList" item="item" open='(' close=')' separator=','> |
| | | #{item} |
| | | </foreach> |
| | | <if test="!isDownload"> |
| | | AND T2.GLASS_ID IS NULL |
| | | </if> |
| | | <if test="isDownload"> |
| | | AND T2.GLASS_ID IS not NULL |
| | | </if> |
| | | |
| | | </where> |
| | | ORDER BY |
| | | T.RACKS_NUMBER DESC, |
| | | T1.TEMPERING_LAYOUT_ID, |
| | | T1.TEMPERING_FEED_SEQUENCE DESC |
| | | </select> |
| | | <select id="queryWorkStationFlowCard" resultMap="downGlassInfo"> |
| | | SELECT |
| | | T.FLOW_CARD_ID, |
| | | T.LAYER, |
| | | T.RACKS_NUMBER |
| | | FROM |
| | | DOWN_WORKSTATION T |
| | | where |
| | | (t.flow_card_id is not null and t.flow_card_id != '') |
| | | and t.workstation_id in |
| | | <foreach collection="workList" item="item" open='(' close=')' separator=','> |
| | | #{item} |
| | | </foreach> |
| | | ORDER BY T.RACKS_NUMBER DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | FROM DOWN_STORAGE_CAGE_DETAILS |
| | | WHERE STATE = 100 |
| | | and (FLOW_CARD_ID, LAYER) not in ( |
| | | select FLOW_CARD_ID, LAYER from down_workstation where flow_card_id is not null and workstation_id not in |
| | | select FLOW_CARD_ID, LAYER from down_workstation where flow_card_id is not null and workstation_id in |
| | | <foreach collection="workList" item="item" open='(' close=')' separator=','> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | |
| | | GROUP BY FLOW_CARD_ID, LAYER |
| | | ORDER BY COUNT(FLOW_CARD_ID) DESC |
| | | LIMIT 1 ) |