Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
# Conflicts:
# hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java
版图识别回退上一版本提交
| | |
| | | labelType3: '成品标签3', |
| | | labelValue3:3, |
| | | printFlowCard: { |
| | | patch:'正品', |
| | | lackOf:'次品', |
| | | patch:'正', |
| | | lackOf:'次', |
| | | processingNote: (itemtextarea) => { |
| | | return `${itemtextarea.processing_note}` |
| | | }, |
| | |
| | | intofurnace:'进炉中', |
| | | beforefurnace:'进炉前', |
| | | outfurnace:'已出炉玻璃', |
| | | print:'拿走打印', |
| | | printing:'打印', |
| | | projectnumber:'请输入工程号', |
| | | inquire:'查询', |
| | | project:'工程号', |
| | | awayprocess:'拿走工序', |
| | | awayequipment:'拿走设备', |
| | | awayteam:'拿走班组', |
| | | flowcard:'流程卡', |
| | | layer:'层号', |
| | | temperinglayout:'炉号', |
| | | temperingfeed:'片序', |
| | | width:'宽', |
| | | height:'高', |
| | | thickness:'厚', |
| | | glasstakeout:'玻璃拿走清单', |
| | | }, |
| | | reportWork:{ |
| | | lowerbit:'下片位', |
| | |
| | | customerName: '客户名称', |
| | | project: '项目名称', |
| | | are: '面积', |
| | | quantity: '包装方式', |
| | | quantity: '数量', |
| | | warehousing: '状态', |
| | | deliveryDate: '送货时间', |
| | | notstocked: '未入库', |
| | |
| | | presponsibleequipment :'请选择责任设备', |
| | | remark :'备注', |
| | | premark :'请输入备注', |
| | | }, |
| | | } |
| | | } |
| | |
| | | @click="showDialog(rect.glass_id)" |
| | | :style="{ position: 'absolute', |
| | | top: `${rect.y_axis}px`, left: `${rect.x_axis}px`, width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: getRectColor(rect.glass_state) |
| | | backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor(rect.glass_state) |
| | | }" |
| | | > |
| | | <!-- 箭头 --> |
| | |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;"> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> |
| | | <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | |
| | | function showDialog(glassId: number) { |
| | | currentGlassId.value = glassId; |
| | | blind.value = true; |
| | | adjustedRects.value = adjustedRects.value.map(rect => |
| | | rect.glass_id === glassId ? { ...rect, isActive: true } : rect |
| | | ); |
| | | } |
| | | const handleDialogClose = () => { |
| | | adjustedRects.value = adjustedRects.value.map(rect => ({ |
| | | ...rect, |
| | | isActive: false |
| | | })); |
| | | } |
| | | // 破损 |
| | | const handleDamage = async () => { |
| | | try { |
| | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | webSocket = new WebSocket(socketUrl); |
| | | webSocket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | const scaleFactor = 1621.78/6000; |
| | | adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ |
| | | ...rect, |
| | | x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor, |
| | | y_axis: rect.y_axis * 0.17, |
| | | width: rect.width * scaleFactor , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height: rect.height * 0.165 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | const data = JSON.parse(event.data); |
| | | const scaleFactor = 1621.78 / 6000; |
| | | if (data.currentCutTerritory && data.currentCutTerritory.length > 0) { |
| | | const newRects = data.currentCutTerritory[0].map(rect => { |
| | | const existingRect = adjustedRects.value.find(r => r.glass_id === rect.glass_id); |
| | | |
| | | if (existingRect) { |
| | | return { |
| | | ...existingRect, |
| | | x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor, |
| | | y_axis: rect.y_axis * 0.17, |
| | | width: rect.width * scaleFactor, |
| | | height: rect.height * 0.165, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | glass_state: rect.glass_state, |
| | | // 保持 isActive 状态不变 |
| | | }; |
| | | } else { |
| | | // 如果不存在,则添加新矩形,默认 isActive 为 false |
| | | return { |
| | | ...rect, |
| | | x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor, |
| | | y_axis: rect.y_axis * 0.17, |
| | | width: rect.width * scaleFactor, |
| | | height: rect.height * 0.165, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | glass_state: rect.glass_state, |
| | | isActive: false, |
| | | glass_id: rect.glass_id, |
| | | }; |
| | | } |
| | | }); |
| | | adjustedRects.value = newRects; |
| | | } else if (data.currentCutTerritory == '') { |
| | | adjustedRects.value = []; |
| | | } |
| | | }; |
| | | webSocket.onerror = (error) => { |
| | | console.error('WebSocket Error:', error); |
| | | }; |
| | | webSocket.onclose = () => { |
| | | console.log('WebSocket Connection Closed'); |
| | | // 可以选择重新连接 |
| | | }; |
| | | } |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | // 初始时,如果输入框为空,则连接WebSocket |
| | | if (!inputValue.value) { |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | import { ref, onMounted, onBeforeUnmount,nextTick } 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' |
| | | import { useRouter } from 'vue-router' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const dialogFormVisible = ref(false) |
| | | const dialogFormVisiblea = ref(true) |
| | | const dialogFormVisibleb = ref(false) |
| | | const blind = ref(false) |
| | | const dialogFormVisiblec = ref(false) |
| | | const blind1 = ref(false) |
| | | const blind2 = ref(false) |
| | | const blinda = ref(false) |
| | | const blindb = ref(false) |
| | | const dialogVisible = ref(false) |
| | | const width = ref(); |
| | | const height = ref(); |
| | | const adjustedRects1 = ref([]); |
| | | const adjustedRects2 = ref([]); |
| | | const adjustedRectsa = ref([]); |
| | | const adjustedRectsb = ref([]); |
| | | const tableData = ref([]) |
| | | const engineerId = ref('') |
| | | const router = useRouter() |
| | | const currentGlassId = ref(null); |
| | | const currenttemperingFeedSequence = ref(null); |
| | | onMounted(async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/damage/selectDamagePrint', { |
| | | type: 9, |
| | | workingProcedure: '钢化', |
| | | }) |
| | | if (response.code === 200) { |
| | | tableData.value = response.data |
| | | console.log(response.data); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error fetching rects :', error); |
| | | } |
| | | }); |
| | | const selectReportData = async () => { |
| | | let postData = { |
| | | type: 9, |
| | | workingProcedure: '钢化', |
| | | ...(engineerId.value !== '' && { engineerId: engineerId.value }), |
| | | }; |
| | | const response = await request.post("/loadGlass/damage/selectDamagePrint", postData) |
| | | if (response.code === 200) { |
| | | tableData.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | const printing = async () => { |
| | | let postData = { |
| | | type: 9, |
| | | workingProcedure: '钢化', |
| | | ...(engineerId.value !== '' && { engineerId: engineerId.value }), |
| | | }; |
| | | console.log(engineerId.value); |
| | | |
| | | const response = await request.post("/loadGlass/damage/selectDamagePrintDetails", postData) |
| | | if (response.code === 200) { |
| | | dialogVisible.value = true; |
| | | tableData.value = response.data; |
| | | await nextTick(); |
| | | window.print(); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | const printTable = () => { |
| | | // 这里可以添加一些CSS样式来优化打印效果 |
| | | // 例如,可以添加一个隐藏的打印样式表 |
| | | window.print(); |
| | | }; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; |
| | | const handleMessage = (data) => { |
| | | // 进炉中 |
| | | if(data.intoGlass!=null){ |
| | | adjustedRects1.value = data.intoGlass[0].map(rect => { |
| | | const handleMessage = (data) => { |
| | | if (data.intoGlass2 && data.intoGlass2.length > 0) { |
| | | // 提取新的矩形ID |
| | | const newGlassIds = new Set(data.intoGlass2[0].map(rect => rect.glassId)); |
| | | // 过滤出已存在的矩形 |
| | | const existingRects = adjustedRects2.value.filter(rect => newGlassIds.has(rect.glassId)); |
| | | // 计算新的矩形 |
| | | const newRects = data.intoGlass2[0].map(rect => { |
| | | const scaleFactor = 794.67/5087; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | |
| | | height: adjustedHeight, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | }; |
| | | }); |
| | | }else{ |
| | | adjustedRects1.value = '' |
| | | } |
| | | if(data.intoGlass2!=null){ |
| | | adjustedRects2.value = data.intoGlass2[0].map(rect => { |
| | | }); |
| | | // 合并新旧矩形,并保留 isActive 状态 |
| | | adjustedRects2.value = existingRects.map(oldRect => { |
| | | const newRect = newRects.find(r => r.glassId === oldRect.glassId); |
| | | if (newRect) { |
| | | return { ...oldRect, ...newRect, isActive: oldRect.isActive }; |
| | | } |
| | | return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 |
| | | }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); |
| | | } |
| | | else if (data.intoGlass2 == null) { |
| | | adjustedRects2.value = [] |
| | | } |
| | | if (data.intoGlass && data.intoGlass.length > 0) { |
| | | // 提取新的矩形ID |
| | | const newGlassIds = new Set(data.intoGlass[0].map(rect => rect.glassId)); |
| | | // 过滤出已存在的矩形 |
| | | const existingRects = adjustedRects1.value.filter(rect => newGlassIds.has(rect.glassId)); |
| | | // 计算新的矩形 |
| | | const newRects = data.intoGlass[0].map(rect => { |
| | | const scaleFactor = 794.67/5087; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | |
| | | height: adjustedHeight, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | }; |
| | | }); |
| | | }else{ |
| | | adjustedRects2.value = '' |
| | | } |
| | | // 进炉前 |
| | | if(data.waitingGlass!=null){ |
| | | adjustedRectsa.value = data.waitingGlass[0].map(rect => { |
| | | }); |
| | | // 合并新旧矩形,并保留 isActive 状态 |
| | | adjustedRects1.value = existingRects.map(oldRect => { |
| | | const newRect = newRects.find(r => r.glassId === oldRect.glassId); |
| | | if (newRect) { |
| | | return { ...oldRect, ...newRect, isActive: oldRect.isActive }; |
| | | } |
| | | return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 |
| | | }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); |
| | | } |
| | | else if (data.overGlass == null) { |
| | | adjustedRects1.value = [] |
| | | } |
| | | if (data.waitingGlass && data.waitingGlass.length > 0) { |
| | | // 提取新的矩形ID |
| | | const newGlassIds = new Set(data.waitingGlass[0].map(rect => rect.glassId)); |
| | | // 过滤出已存在的矩形 |
| | | const existingRects = adjustedRectsa.value.filter(rect => newGlassIds.has(rect.glassId)); |
| | | // 计算新的矩形 |
| | | const newRects = data.waitingGlass[0].map(rect => { |
| | | const scaleFactor = 1621.78/5190; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | |
| | | height: adjustedHeight, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | }; |
| | | }); |
| | | }else{ |
| | | adjustedRectsa.value = '' |
| | | } |
| | | // 已出炉 |
| | | if(data.outGlass!=null){ |
| | | adjustedRectsb.value = data.outGlass[0].map(rect => { |
| | | } |
| | | }); |
| | | // 合并新旧矩形,并保留 isActive 状态 |
| | | adjustedRectsa.value = existingRects.map(oldRect => { |
| | | const newRect = newRects.find(r => r.glassId === oldRect.glassId); |
| | | if (newRect) { |
| | | return { ...oldRect, ...newRect, isActive: oldRect.isActive }; |
| | | } |
| | | return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 |
| | | }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); |
| | | } |
| | | else if (data.waitingGlass == null) { |
| | | adjustedRectsa.value = [] |
| | | } |
| | | if (data.outGlass && data.outGlass.length > 0) { |
| | | // 提取新的矩形ID |
| | | const newGlassIds = new Set(data.outGlass[0].map(rect => rect.glassId)); |
| | | // 过滤出已存在的矩形 |
| | | const existingRects = adjustedRectsb.value.filter(rect => newGlassIds.has(rect.glassId)); |
| | | // 计算新的矩形 |
| | | const newRects = data.outGlass[0].map(rect => { |
| | | const scaleFactor = 1621.78/5190; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | const scaleFactory = 550/2800; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta,newY; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * scaleFactor; |
| | | adjustedHeight = heighta * 0.16; |
| | | adjustedHeight = heighta * scaleFactory; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | // newX = 5190 - (rect.yCoordinate + widtha); |
| | | newY = 2800 - (rect.xCoordinate + heighta); |
| | | } else { |
| | | adjustedWidth = heighta * scaleFactor; |
| | | adjustedHeight = widtha * 0.16; |
| | | adjustedHeight = widtha * scaleFactory; |
| | | // adjustedWidtha = heighta; |
| | | // adjustedHeighta = widtha; |
| | | // newX = 5190 - (rect.yCoordinate + heighta); |
| | | newY = 2800 - (rect.xCoordinate + widtha); |
| | | } |
| | | return { |
| | | ...rect, // 复制原始对象的其他属性 |
| | | x: newX * scaleFactor, |
| | | y: rect.xCoordinate * 0.16, |
| | | y: newY * scaleFactory, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | }; |
| | | }); |
| | | }else{ |
| | | adjustedRectsb.value = '' |
| | | } |
| | | }; |
| | | } |
| | | }); |
| | | |
| | | // 合并新旧矩形,并保留 isActive 状态 |
| | | adjustedRectsb.value = existingRects.map(oldRect => { |
| | | const newRect = newRects.find(r => r.glassId === oldRect.glassId); |
| | | if (newRect) { |
| | | return { ...oldRect, ...newRect, isActive: oldRect.isActive }; |
| | | } |
| | | return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 |
| | | }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); |
| | | } |
| | | else if (data.outGlass == null) { |
| | | adjustedRectsb.value = [] |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | function updateRectColors() { |
| | | function updateRectColorsa() { |
| | | adjustedRectsa.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | | rect.state = 5; |
| | | rect.state = 8; |
| | | } |
| | | }); |
| | | } |
| | | function updateRectColorsb() { |
| | | adjustedRectsb.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | | rect.state = 8; |
| | | } |
| | | }); |
| | | } |
| | | function updateRectColors1() { |
| | | adjustedRects1.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | | rect.state = 8; |
| | | } |
| | | }); |
| | | } |
| | | function updateRectColors2() { |
| | | adjustedRects2.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | | rect.state = 8; |
| | | } |
| | | }); |
| | | } |
| | |
| | | return '#95d475'; |
| | | case -1: |
| | | return '#CDAF95'; |
| | | case 5: |
| | | case 8: |
| | | return '#911005'; |
| | | } |
| | | } |
| | |
| | | return '#eebe77'; |
| | | case 4: |
| | | return '#CD6090'; |
| | | case 5: |
| | | case 8: |
| | | return '#911005'; |
| | | } |
| | | } |
| | | // if (adjustedRectsb[0].engineerId != null) { |
| | | // engineerIdDisplayb = adjustedRectsb[0].engineerId |
| | | // } |
| | | // if (adjustedRectsa[0].engineerId != null) { |
| | | // engineerIdDisplaya = adjustedRectsa[0].engineerId |
| | | // } |
| | | // if (adjustedRects2[0].engineerId != null) { |
| | | // engineerIdDisplay2 = adjustedRects2[0].engineerId |
| | | // } |
| | | // if (adjustedRects[0].engineerId != null) { |
| | | // engineerIdDisplay = adjustedRects[0].engineerId |
| | | // } |
| | | function showDialog(rect) { |
| | | function showDialog1(rect) { |
| | | const index = adjustedRects1.value.findIndex(r => r.glassId === rect.glassId); |
| | | if (index !== -1) { |
| | | adjustedRects1.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | | blind.value = true; |
| | | } |
| | | blind1.value = true; |
| | | } |
| | | function showDialog2(rect) { |
| | | const index = adjustedRects2.value.findIndex(r => r.glassId === rect.glassId); |
| | | if (index !== -1) { |
| | | adjustedRects2.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | | blind2.value = true; |
| | | } |
| | | function showDialoga(rect) { |
| | | const index = adjustedRectsa.value.findIndex(r => r.glassId === rect.glassId); |
| | | if (index !== -1) { |
| | | adjustedRectsa.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | | blinda.value = true; |
| | | } |
| | | function showDialogb(rect) { |
| | | const index = adjustedRectsb.value.findIndex(r => r.glassId === rect.glassId); |
| | | if (index !== -1) { |
| | | adjustedRectsb.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | | blindb.value = true; |
| | | } |
| | | const handleDialogClose1 = () => { |
| | | adjustedRects1.value.forEach(rect => { |
| | | rect.isActive = false; |
| | | }); |
| | | blind1.value = false; |
| | | }; |
| | | const handleDialogClose2 = () => { |
| | | adjustedRects2.value.forEach(rect => { |
| | | rect.isActive = false; |
| | | }); |
| | | blind2.value = false; |
| | | }; |
| | | const handleDialogClosea = () => { |
| | | adjustedRectsa.value.forEach(rect => { |
| | | rect.isActive = false; |
| | | }); |
| | | blinda.value = false; |
| | | }; |
| | | const handleDialogCloseb = () => { |
| | | adjustedRectsb.value.forEach(rect => { |
| | | rect.isActive = false; |
| | | }); |
| | | blindb.value = false; |
| | | }; |
| | | // 破损 |
| | | const handleDamage = async () => { |
| | | const handleDamage1 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { |
| | | glassId: currentGlassId.value, |
| | | // temperingFeedSequence: currenttemperingFeedSequence.value, |
| | | line: 4001, |
| | | status: 2, |
| | | status: 8, |
| | | workingProcedure: '钢化', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blind.value = false; |
| | | updateRectColors(); |
| | | blind1.value = false; |
| | | updateRectColors1(); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleDamage2 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { |
| | | glassId: currentGlassId.value, |
| | | // temperingFeedSequence: currenttemperingFeedSequence.value, |
| | | line: 4001, |
| | | status: 8, |
| | | workingProcedure: '钢化', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blind2.value = false; |
| | | updateRectColors2(); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleDamagea = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { |
| | | glassId: currentGlassId.value, |
| | | // temperingFeedSequence: currenttemperingFeedSequence.value, |
| | | line: 4001, |
| | | status: 8, |
| | | workingProcedure: '钢化', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blinda.value = false; |
| | | updateRectColorsa(); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleDamageb = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { |
| | | glassId: currentGlassId.value, |
| | | // temperingFeedSequence: currenttemperingFeedSequence.value, |
| | | line: 4001, |
| | | status: 8, |
| | | workingProcedure: '钢化', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blindb.value = false; |
| | | updateRectColorsb(); |
| | | } 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="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> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;dialogFormVisiblec = false;" >{{ $t('processCard.beforefurnace') }}</el-button> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true;dialogFormVisiblea = false;dialogFormVisibleb = false;dialogFormVisiblec = false;">{{ $t('processCard.intofurnace') }}</el-button> |
| | | <el-button id="searchButton" type="success" @click="dialogFormVisibleb = true;dialogFormVisible = false;dialogFormVisiblea = false;dialogFormVisiblec = false;">{{ $t('processCard.outfurnace') }}</el-button> |
| | | <el-button id="searchButton" type="info" @click="dialogFormVisiblec = true;dialogFormVisibleb = false;dialogFormVisible = false;dialogFormVisiblea = false">{{ $t('processCard.print') }}</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;"> |
| | |
| | | <div |
| | | v-for="(rect, index) in adjustedRects1" |
| | | :key="index" |
| | | @click="showDialog(rect)" |
| | | @click="showDialog1(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 === 5 ? '#911005' : 'lightblue' }" |
| | | backgroundColor: rect.isActive ? '#ADFF2F' : rect.state === 8 ? '#911005' : 'lightblue' }" |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.glassId }}</div> |
| | | <div >{{ rect.flowCardId }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> |
| | | <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div |
| | | v-for="(rect, index) in adjustedRects2" |
| | | :key="index" |
| | | @click="showDialog(rect)" |
| | | @click="showDialog2(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 === 5 ? '#911005' : 'lightblue' }" |
| | | backgroundColor: rect.isActive ? '#ADFF2F' : rect.state === 8 ? '#911005' : 'lightblue' }" |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.glassId }}</div> |
| | | <div >{{ rect.flowCardId }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> |
| | | <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsa" |
| | | :key="index" |
| | | @click="showDialog(rect)" |
| | | @click="showDialoga(rect)" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.y}px`, left: `${rect.x}px`, |
| | | width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: getRectColora(rect.state) }"> |
| | | backgroundColor: rect.isActive ? '#ADFF2F' : getRectColora(rect.state) }"> |
| | | <div class="centered-text"> |
| | | <div>{{ rect.glassId }}</div> |
| | | <div >{{ rect.flowCardId }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> |
| | | <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsb" |
| | | :key="index" |
| | | @click="showDialog(rect)" |
| | | @click="showDialogb(rect)" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.y}px`, left: `${rect.x}px`, |
| | | width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: getRectColorb(rect.state) }"> |
| | | backgroundColor: rect.isActive ? '#ADFF2F' : getRectColorb(rect.state) }"> |
| | | <!-- backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }"> --> |
| | | <div class="centered-text"> |
| | | <div >{{ rect.glassId }}</div> |
| | | <div >{{ rect.flowCardId }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> |
| | | <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <div v-if="dialogFormVisiblec"> |
| | | <!-- 打印 --> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> |
| | | <div style="display: flex; flex-direction: row; align-items: center; margin-top: 5px;margin-left: 10px;"> |
| | | <el-input :placeholder="$t('processCard.projectnumber')" v-model="engineerId" autocomplete="off" style="width: 300px;"/> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('processCard.inquire') }}</el-button> |
| | | <el-button type="info" style="margin-left: 10px;" @click="printing()">{{ $t('processCard.printing') }}</el-button> |
| | | </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;"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table |
| | | height="350" |
| | | ref="table" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | :data="tableData" |
| | | > |
| | | <el-table-column prop="engineerId" :label="$t('processCard.project')" width="200" align="center"/> |
| | | <el-table-column prop="workingProcedure" :label="$t('processCard.awayprocess')" align="center"/> |
| | | <el-table-column prop="deviceName" :label="$t('processCard.awayequipment')" align="center"/> |
| | | <el-table-column prop="teamsGroupsName" :label="$t('processCard.awayteam')" align="center"/> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </el-card> |
| | | </div> |
| | | <el-dialog v-model="blind1" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose1"> |
| | | <el-button type="warning" plain :icon="Delete" @click="handleDamage1" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | <el-dialog v-model="blind2" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose2"> |
| | | <el-button type="warning" plain :icon="Delete" @click="handleDamage2" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | <el-dialog v-model="blinda" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClosea"> |
| | | <el-button type="warning" plain :icon="Delete" @click="handleDamagea" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | <el-dialog v-model="blindb" top="30vh" width="15%" style="text-align: center;" @close="handleDialogCloseb"> |
| | | <el-button type="warning" plain :icon="Delete" @click="handleDamageb" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | width="100%" |
| | | top="0vh" |
| | | :show-close="false" |
| | | > |
| | | <div class="custom-title" style="text-align: center; margin-bottom: 20px;"> |
| | | {{ $t('processCard.glasstakeout') }} |
| | | </div> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%;height: 760px" |
| | | > |
| | | <el-table-column prop="flowCardId" :label="$t('processCard.flowcard')" width="140" align="center"/> |
| | | <el-table-column prop="layer" :label="$t('processCard.layer')" align="center" width="52"/> |
| | | <el-table-column prop="engineerId" :label="$t('processCard.project')" align="center" width="110"/> |
| | | <el-table-column prop="temperingLayoutId" :label="$t('processCard.temperinglayout')" align="center" width="52"/> |
| | | <el-table-column prop="temperingFeedSequence" :label="$t('processCard.temperingfeed')" align="center" width="52"/> |
| | | <el-table-column prop="width" :label="$t('processCard.width')" align="center" width="80"/> |
| | | <el-table-column prop="height" :label="$t('processCard.height')" align="center" width="80"/> |
| | | <el-table-column prop="thickness" :label="$t('processCard.thickness')" align="center" width="52"/> |
| | | </el-table> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <style scoped> |
| | |
| | | } |
| | | #rect { |
| | | position: relative; /* 确保箭头可以相对于矩形定位 */ |
| | | /* 其他样式 */ |
| | | } |
| | | .centered-text { |
| | | /* 设置文字居中样式 */ |
| | |
| | | height: 100%; /* 确保div占据整个矩形的高度 */ |
| | | /* font-size: small; */ |
| | | } |
| | | .custom-title { |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | } |
| | | </style> |
| | |
| | | import {useRouter} from "vue-router" |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import request from "@/utils/request" |
| | | |
| | | |
| | | import { ref, onMounted, onBeforeUnmount,onUnmounted } 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) { |
| | | case 'edit' :{ |
| | |
| | | } |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | if(data.overGlass!=null){ |
| | | adjustedRects.value = data.overGlass[0].map(rect => { |
| | | const handleMessage = (data) => { |
| | | if (data.overGlass && data.overGlass.length > 0) { |
| | | // 提取新的矩形ID |
| | | const newGlassIds = new Set(data.overGlass[0].map(rect => rect.glassId)); |
| | | |
| | | // 过滤出已存在的矩形 |
| | | const existingRects = adjustedRects.value.filter(rect => newGlassIds.has(rect.glassId)); |
| | | |
| | | // 计算新的矩形 |
| | | const newRects = data.overGlass[0].map(rect => { |
| | | const scaleFactor = 1621.78/5190; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta; |
| | | let newX = rect.yCoordinate; |
| | | |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * scaleFactor; |
| | | adjustedHeight = heighta * 0.16; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | // newX = 5190 - (rect.yCoordinate + rect.width); |
| | | } else { |
| | | adjustedWidth = heighta * scaleFactor; |
| | | adjustedHeight = widtha * 0.16; |
| | | // adjustedWidtha = heighta; |
| | | // adjustedHeighta = widtha; |
| | | // newX = 5190 - (rect.yCoordinate + rect.height); |
| | | } |
| | | return { |
| | | ...rect, |
| | |
| | | height: adjustedHeight, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | }; |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 合并新旧矩形,并保留 isActive 状态 |
| | | adjustedRects.value = existingRects.map(oldRect => { |
| | | const newRect = newRects.find(r => r.glassId === oldRect.glassId); |
| | | if (newRect) { |
| | | return { ...oldRect, ...newRect, isActive: oldRect.isActive }; |
| | | } |
| | | return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 |
| | | }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); |
| | | } |
| | | else if (data.overGlass == null) { |
| | | adjustedRects.value = [] |
| | | } |
| | | }; |
| | | function updateRectColors() { |
| | |
| | | rect.state = 8; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | function getRectColora(state) { |
| | | switch (state) { |
| | | case 3: |
| | |
| | | return '#911005'; |
| | | } |
| | | } |
| | | function showDialog(rect) { |
| | | function showDialog(rect) { |
| | | const index = adjustedRects.value.findIndex(r => r.glassId === rect.glassId); |
| | | if (index !== -1) { |
| | | adjustedRects.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | | blind.value = true; |
| | | } |
| | | |
| | | const handleDialogClose = () => { |
| | | adjustedRects.value.forEach(rect => { |
| | | rect.isActive = false; |
| | | }); |
| | | blind.value = false; |
| | | }; |
| | | // 破损 |
| | | const handleDamage = async () => { |
| | | try { |
| | |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | |
| | | <template> |
| | | <div style="margin-top: 10px;"> |
| | | <div> |
| | |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, |
| | | width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: getRectColora(rect.state) }"> |
| | | backgroundColor: rect.isActive ? '#ADFF2F' : getRectColora(rect.state) |
| | | }"> |
| | | <div class="centered-text"> |
| | | <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 style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> |
| | | <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;"> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> |
| | | <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> |
| | | #boxa{ |
| | | border: 1px solid rgb(119, 116, 116); |
New file |
| | |
| | | <script setup> |
| | | import request from "@/utils/request" |
| | | import {ElDatePicker, ElMessage} from "element-plus" |
| | | import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue" |
| | | import {Search} from "@element-plus/icons-vue" |
| | | // import {useRouter} from 'vue-router' |
| | | // import {changeFilterEvent, filterChanged} from "@/hook" |
| | | // import {useI18n} from 'vue-i18n' |
| | | // import deepClone from "@/utils/deepClone"; |
| | | import companyInfo from "@/lang/companyInfo" |
| | | |
| | | const company = companyInfo() |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | // let router = useRouter() |
| | | let produceList = ref([]) |
| | | let labelList = ref([]) |
| | | let titleList = ref([]) |
| | | let dataList = ref([]) |
| | | let list = ref([]) |
| | | let lastList=ref([]) |
| | | |
| | | let filterData = ref({}) |
| | | |
| | | const data = ref({ |
| | | printList: [] |
| | | }) |
| | | |
| | | |
| | | // const {currentRoute} = useRouter() |
| | | // const route = currentRoute.value |
| | | // data.value.printList = JSON.parse(route.query.printList) |
| | | // const type = route.query.type |
| | | // const faceOrientation = route.query.faceOrientation |
| | | // const lableType = route.query.lableType |
| | | let props = defineProps({ |
| | | printFlowCardId: null, |
| | | printLayer: null, |
| | | }) |
| | | |
| | | onMounted(async () => { |
| | | console.log(props.printFlowCardId,props.printLayer) |
| | | const response = await request.post('/unLoadGlass/downGlassInfo/downGlassLabelPrint',{ |
| | | flowCardId:props.printFlowCardId, |
| | | layer:props.printLayer |
| | | }); |
| | | if (response.code == 200) { |
| | | console.log("lastList.value",response.data) |
| | | lastList.value=response.data; |
| | | |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | } |
| | | |
| | | ) |
| | | |
| | | |
| | | // // 打印方法 |
| | | // const printFlowCard = () => { |
| | | // // 需要打印的局部区域赋予"print-wrap"的id |
| | | // let el = document.getElementById("printFlowCard"); |
| | | // let doc = document; |
| | | // let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | // let printId = "print-" + Date.now(); |
| | | |
| | | // // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) |
| | | // let content = doc.createElement("div"); |
| | | // content.id = printId; |
| | | |
| | | // // 样式控制与打印无关的元素隐藏 |
| | | // let style = doc.createElement("style"); |
| | | // style.innerHTML = |
| | | // "body>#" + |
| | | // printId + |
| | | // "{display:none}@media print{" + |
| | | // "@page {" + |
| | | // " size: auto; " + |
| | | // " margin: 2mm 2mm 2mm 2mm; " + |
| | | // " }body>:not(#" + |
| | | // printId + |
| | | // "){display:none !important}body>#" + |
| | | // printId + |
| | | // "{display:block;padding-top:1px}}"; |
| | | // // |
| | | // content.innerHTML = el.outerHTML; |
| | | // // // console.log("el.outerHTML", el.outerHTML); |
| | | // body.appendChild(style); |
| | | |
| | | // // 与style元素设置的样式相配合 |
| | | // // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) |
| | | // body.appendChild(content); |
| | | // setTimeout(() => { |
| | | // window.print(); |
| | | // body.removeChild(content); |
| | | // body.removeChild(style); |
| | | // }, 20); |
| | | // } |
| | | </script> |
| | | |
| | | <template> |
| | | <!-- <el-button id="printButton" @click="printFlowCard();">打印</el-button> --> |
| | | <div id="printFlowCard" > |
| | | <template v-for="(item,index) in lastList"> |
| | | <div id="entirety" > |
| | | |
| | | <div class="row1"> |
| | | <div style="position: absolute;font-weight: bold;margin-left: 5px;" v-if="item.tempering_layout_id!=null">{{ item.tempering_layout_id }}/{{ item.tempering_feed_sequence }}</div> |
| | | <span>{{ item.customer_name }}</span> |
| | | <span>{{ item.order_id }}</span> |
| | | <span v-if="item.process.includes('夹胶')">胶片</span> |
| | | <span v-else-if="item.process.includes('中空')">中空</span> |
| | | <span v-else-if="item.process.includes('百叶')">百叶</span> |
| | | <span v-else></span> |
| | | <div style="position: absolute;font-weight: bold;margin-left: 210px;margin-top: -26px;" >{{ index+1 }}</div> |
| | | </div> |
| | | <div class="row2"> |
| | | <span>{{ item.project }}</span> |
| | | <span>{{ item.building_number }}</span> |
| | | </div> |
| | | <div class="row3" v-if="item.other_columns!=null&&(JSON.parse(item.other_columns).S02!=null)">{{JSON.parse(item.other_columns).S02}}={{item.quantity}}</div> |
| | | <div class="row3" v-else>{{Math.round(item.width)}}x{{Math.round(item.height)}}={{item.quantity}}</div> |
| | | <div class="row5"> |
| | | <span>{{item.glass_child }}</span> |
| | | <span>{{ item.processing_note }}</span> |
| | | </div> |
| | | </div> |
| | | <div style="width: 20px" v-if="index%2===0"></div> |
| | | <div class="print-page" v-else></div> |
| | | </template> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | * { |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | |
| | | #printButton { |
| | | /*margin-top: -20px;*/ |
| | | width: 100px; |
| | | } |
| | | |
| | | #printFlowCard { |
| | | display: flex; |
| | | justify-content: left; |
| | | flex-wrap: wrap; |
| | | width: 500px; |
| | | } |
| | | |
| | | #entirety{ |
| | | text-align: center; |
| | | width: 46%; |
| | | height: 170px; |
| | | border: black 1px; |
| | | word-wrap: break-word; |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | .row1 { |
| | | font-size: 12pt; |
| | | font-weight: bold; |
| | | height: 35px; |
| | | } |
| | | .row1 span { |
| | | font-size: 12pt; |
| | | } |
| | | |
| | | .row2 { |
| | | font-size: 14pt; |
| | | font-weight: bold; |
| | | height: 35px; |
| | | } |
| | | .row2 span { |
| | | font-size: 12pt; |
| | | } |
| | | span { |
| | | font-size: 12pt; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .row3 { |
| | | margin-top: -5px; |
| | | height: 35px; |
| | | font-size: 22pt; |
| | | font-weight: bolder; |
| | | line-height: 35px; |
| | | } |
| | | |
| | | .row5 { |
| | | height: 50px; |
| | | font-weight: bold; |
| | | font-size: 12pt; |
| | | /* margin-left: 20px; */ |
| | | } |
| | | .row5 span { |
| | | font-size: 12pt; |
| | | } |
| | | |
| | | .row6 { |
| | | height: 15px; |
| | | font-weight: bold; |
| | | font-size: 8pt; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @media print { |
| | | .print-page { |
| | | page-break-after: always; /* 添加分页符,在每个print-page div之后分页 */ |
| | | } |
| | | div { |
| | | page-break-inside: avoid; |
| | | } |
| | | @page { |
| | | size: auto; /* auto is the initial value */ |
| | | margin: 2mm 2mm 2mm 2mm; /* this affects the margin in the printer settings */ |
| | | |
| | | } |
| | | } |
| | | |
| | | </style> |
| | |
| | | for (let i = 0; i < produceList.value.length; i++) { |
| | | //数量 |
| | | let totalQuantity = 0; |
| | | //落架数量 |
| | | let totalQuantity1 = 0; |
| | | //面积 |
| | | let totalArea = 0; |
| | | //重量 |
| | |
| | | // 对每个集合中的 detailList 进行计算 |
| | | produceList.value[i].detailList.forEach(collection => { |
| | | totalQuantity += collection.quantity * 1; |
| | | totalQuantity1 += collection.quantity1 * 1; |
| | | //每个序号面积 |
| | | collection.total_area = parseFloat((collection.width * collection.height * collection.quantity / 1000000).toFixed(2)) |
| | | totalArea += collection.total_area * 1; |
| | |
| | | }); |
| | | // 输出每个集合中的总数量 |
| | | produceList.value[i].detail[0].quantity = totalQuantity |
| | | produceList.value[i].detail[0].quantity1 = totalQuantity |
| | | produceList.value[i].detail[0].gross_area = totalArea |
| | | produceList.value[i].detail[0].weight = totalWeight |
| | | } |
| | | } |
| | | |
| | | |
| | | // const printFlowCard = () => { |
| | | // // 需要打印的局部区域赋予"print-wrap"的id |
| | | // let el = document.getElementById("printFlowCard"); |
| | | // let doc = document; |
| | | // let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | // let printId = "print-" + Date.now(); |
| | | |
| | | // // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) |
| | | // let content = doc.createElement("div"); |
| | | // content.id = printId; |
| | | |
| | | // // 样式控制与打印无关的元素隐藏 |
| | | // let style = doc.createElement("style"); |
| | | // style.innerHTML = |
| | | // "body>#" + |
| | | // printId + |
| | | // "{display:none}@media print{" + |
| | | // "@page {" + |
| | | // " size: auto; " + |
| | | // " margin: 5mm 5mm 5mm 5mm; " + |
| | | // " }body>:not(#" + |
| | | // printId + |
| | | // "){display:none !important}body>#" + |
| | | // printId + |
| | | // "{display:block;padding-top:1px}}"; |
| | | // // |
| | | // content.innerHTML = el.outerHTML; |
| | | // // // console.log("el.outerHTML", el.outerHTML); |
| | | // body.appendChild(style); |
| | | |
| | | // // 与style元素设置的样式相配合 |
| | | // // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) |
| | | // body.appendChild(content); |
| | | // setTimeout(() => { |
| | | // window.print(); |
| | | // body.removeChild(content); |
| | | // body.removeChild(style); |
| | | // }, 20); |
| | | // } |
| | | |
| | | onMounted(async () => { |
| | | console.log(props.printFlowCardId,props.printLayer) |
| | |
| | | <table v-for="(item,id) in produceList" id="contentTable" :key="id"> |
| | | <thead> |
| | | <tr v-for="(itemFlow,index) in item.detail" :key="index"> |
| | | <td v-if="like='1'" colspan="26"> |
| | | <td colspan="29"> |
| | | <div style="float: left;"><input style="border: none;font-size: 28px;width: 70px;margin: 5px "/></div> |
| | | <div id="bj" style="float: right;font-size: 28px">{{ id + 1 }}</div> |
| | | <div>{{ company.companyName }}</div> |
| | | <div>生产流程卡</div> |
| | | <div v-if="itemFlow.technologyNumber!=''" style="text-align: right;font-weight: bolder">流程卡号: {{ |
| | | <div v-if="itemFlow.technologyNumberMerge!=''" style="text-align: right;font-weight: bolder"> |
| | | {{itemFlow.otherRemarks}} |
| | | 流程卡号: {{ |
| | | itemFlow.process_id |
| | | }}/{{ itemFlow.technologyNumber }} |
| | | }}/{{ itemFlow.technologyNumberMerge }} 共 {{ flowCardCount }} 架 |
| | | </div> |
| | | <div v-else style="text-align: right;font-weight: bolder">流程卡号: {{ |
| | | itemFlow.process_id |
| | | }}/{{ itemFlow.technologyNumber }} |
| | | </div> |
| | | </td> |
| | | <td v-else colspan="24"> |
| | | <div style="float: left;"><input style="border: none;font-size: 28px;width: 70px "/></div> |
| | | <div id="bj" style="float: right;font-size: 28px">{{ id + 1 }}</div> |
| | | <div>{{ company.companyName }}</div> |
| | | <div>生产流程卡</div> |
| | | <div v-if="itemFlow.technologyNumber!=''" style="text-align: right;font-weight: bolder">流程卡号: {{ |
| | | itemFlow.process_id |
| | | }}/{{ itemFlow.technologyNumber }} 共 {{ flowCardCount }} 架 |
| | | </div> |
| | | <div v-else style="text-align: right;font-weight: bolder">流程卡号: {{ |
| | | <div v-else style="text-align: right;font-weight: bolder"> |
| | | {{itemFlow.otherRemarks}} |
| | | 流程卡号: {{ |
| | | itemFlow.process_id |
| | | }}/{{ itemFlow.technologyNumber }} 共 {{ flowCardCount }} 架 |
| | | </div> |
| | |
| | | <td class="tdNowrap">项目名称:</td> |
| | | <td colspan="2">{{ items.project }}</td> |
| | | <td class="tdNowrap">工艺流程:</td> |
| | | <td colspan="19" v-if="like='1'" style="width: 500px">{{ items.process }}</td> |
| | | <td colspan="17" v-else style="width: 500px">{{ items.process }}</td> |
| | | <td colspan="22" style="width: 500px">{{ items.process }}</td> |
| | | </tr> |
| | | <tr v-for="(itemTr,index) in item.detail" :key="index"> |
| | | <td class="tdNowrap">磨边类型:</td> |
| | |
| | | <td class="tdNowrap">单片名称:</td> |
| | | <td colspan="2">{{ itemTr.glass_child }}</td> |
| | | <td class="tdNowrap">产品名称:</td> |
| | | <td v-if="like=='1'" colspan="19">{{ itemTr.product_name }}</td> |
| | | <td v-else colspan="17">{{ itemTr.product_name }}</td> |
| | | <td colspan="22">{{ itemTr.product_name }}</td> |
| | | </tr> |
| | | <tr> |
| | | <td rowspan='2'>序号</td> |
| | | <td rowspan='2'>编号</td> |
| | | <td v-if="like!=null" rowspan="2">小片顺序</td> |
| | | <td v-else style="display: none;" rowspan="2">小片顺序</td> |
| | | <td rowspan='2'>宽*高</td> |
| | | <!-- <td rowspan='2'>编号</td> --> |
| | | <td rowspan="2">小片顺序</td> |
| | | <td rowspan='2' style="width: 90px">宽*高</td> |
| | | <td rowspan='2'>数量</td> |
| | | <td rowspan='2'>落架</td> |
| | | <td rowspan='2'>面积</td> |
| | | <td rowspan='2'>周长</td> |
| | | <td rowspan='2'>半径</td> |
| | |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | |
| | | <tr v-for="(itemDatile,index) in item.detailList" :key="index"> |
| | | <td>{{ itemDatile.order_number }}</td> |
| | | <td>{{ itemDatile.s01Value }}</td> |
| | | <td v-if="like=='1'">{{ itemDatile.technology_number }}</td> |
| | | <td v-else style="display: none"></td> |
| | | <!-- <td>{{ itemDatile.s01Value }}</td> --> |
| | | <td>{{ itemDatile.technology_number }}</td> |
| | | <td>{{ itemDatile.child_width }}</td> |
| | | <td class="item" style="width: 5%;height: 100%;"> |
| | | <!-- <el-input v-model="itemDatile.quantity" style="border: none" @keyup="handleSummary()"></el-input> --> |
| | | {{ itemDatile.quantity }} |
| | | <!-- <input v-model="itemDatile.quantity" style="width: 100%;height: 100%" @keyup="handleSummary()"/> --> |
| | | </td> |
| | | <!-- <td class="item" style="width: 5%;height: 100%;"> |
| | | {{ itemDatile.quantity1 }} |
| | | </td> --> |
| | | <td>{{ itemDatile.quantity1 }}</td> |
| | | <td>{{ itemDatile.total_area }}</td> |
| | | <td>{{ itemDatile.perimeter }}</td> |
| | | <td>{{ itemDatile.bend_radius }}</td> |
| | |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | </tr> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr style="height: 14px"> |
| | | <td v-for="(itemsum,index) in item.detail" :key="index" colspan="26"> |
| | | <td v-for="(itemsum,index) in item.detail" :key="index" colspan="29"> |
| | | 数量: |
| | | <label>{{ itemsum.quantity }}</label> |
| | | 落加数量: |
| | | <label>{{ itemsum.quantity1 }}</label> |
| | | 面积: |
| | | <label>{{ parseFloat(itemsum.gross_area.toFixed(2)) }}</label> |
| | | 重量: |
| | |
| | | </td> |
| | | </tr> |
| | | <tr v-for="(itemtextarea,index) in item.detail" :key="index"> |
| | | <td v-if="like='1'" colspan="4" rowspan="6" style="width: 480px;height: 100px "> |
| | | <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 11px">{{itemtextarea.otherRemarks}}</textarea> |
| | | </div> |
| | | </td> |
| | | <td v-else colspan="6" rowspan="2" style="width: 480px;height: 100px "> |
| | | <!-- <div style="width: 100%;height: 100%"><textarea style="height: 99%;width: 99%;font-size: 11px">{{ itemtextarea.processing_note }}</textarea>--> |
| | | <!-- </div>--> |
| | | <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 11px">{{itemtextarea.otherRemarks}}</textarea> |
| | | </div> |
| | | </td> |
| | | <td colspan="2">完工签名</td> |
| | | |
| | | <td>完工签名</td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | |
| | | <td colspan="2"></td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2">生产日期</td> |
| | | <td>生产日期</td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | |
| | | <td colspan="2"></td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2">质检签名</td> |
| | | <td>质检签名</td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2">生产签名</td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | </tr> |
| | | <tr> |
| | | <td>原片箱号</td> |
| | | <td colspan="28"></td> |
| | | </tr> |
| | | <tr v-for="(qrCodeItem,index) in item.detail" :key="index"> |
| | | <td colspan="23"> |
| | | <td colspan="29"> |
| | | <span style="display: flex;"> |
| | | <span v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index" style="display: flex;width: 35%"> |
| | | <div class='qrCode' style="width: 80px;height: 80px;"> |
| | |
| | | </span> |
| | | </td> |
| | | |
| | | </tr> |
| | | <tr v-for="(itemtextareas,index) in item.detail" :key="index"> |
| | | <td colspan="29" rowspan="6" style="width: 480px;height: 150px "> |
| | | <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 12px;overflow: hidden;">{{itemtextareas.processing_note}}</textarea> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | |
| | | |
| | | #printFlowCard { |
| | | text-align: center; |
| | | font-weight: bolder; |
| | | height: 600px; |
| | | //font-weight: bolder; height: 600px; |
| | | } |
| | | |
| | | #contentTable { |
| | |
| | | } |
| | | |
| | | #contentTable tbody { |
| | | white-space: nowrap; |
| | | |
| | | } |
| | | |
| | | .tdNowrap { |
| | | white-space: nowrap; |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | input{ |
| | | font-weight: bolder; |
| | | border: none; |
| | | background: none; |
| | | } |
| | | |
| | | |
| | | @page { |
| | | size: auto; /* auto is the initial value */ |
| | | margin: 10mm 2mm 10mm 1mm; /* this affects the margin in the printer settings */ |
| | | |
| | | } |
| | | |
| | | @media print { |
| | | @page { |
| | | size: auto; |
| | | margin: 4mm 5mm 5mm 5mm |
| | | |
| | | } |
| | | |
| | | table { |
| | | page-break-before: always; |
| | | page-break-inside: auto; |
| | |
| | | height: 100%; |
| | | } |
| | | |
| | | |
| | | |
| | | </style> |
| | |
| | | import PrintFlow from "@/views/UnLoadGlass/PrintFlow.vue"; |
| | | import Landingindication from "./Landingindication.vue"; |
| | | import Landingindicationtwo from "./Landingindicationtwo.vue"; |
| | | import PrintLabel from "@/views/UnLoadGlass/PrintCustomLabelSemi1.vue"; |
| | | |
| | | const router = useRouter() |
| | | const {t} = useI18n() |
| | |
| | | const selectValuesa = reactive({}); |
| | | const selectOptionsa = ref([]); |
| | | const dialogTableVisible = ref(false) |
| | | const dialogTableVisible1 = ref(false) |
| | | const printFlowCardId = ref('') |
| | | const printLayer = ref('') |
| | | const now = new Date(); |
| | | const timeRange = ref([]) |
| | | const browser=ref(false) |
| | | |
| | | const handleChange = async () => { |
| | | console.log("触发开关") |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | |
| | | const confirmBrowser = () =>{ |
| | | if (/chrome|chromium/i.test(navigator.userAgent) && !/edg/i.test(navigator.userAgent)) { |
| | | browser.value=true |
| | | } else if (/edg/i.test(navigator.userAgent)) { |
| | | browser.value=false |
| | | } else { |
| | | browser.value=false |
| | | } |
| | | } |
| | | |
| | | const handleInputChangea = (value, rowId) => { |
| | | // 更新对应行的 select 值 |
| | |
| | | flowCardId: firstPart, |
| | | layer: twoPart |
| | | }); |
| | | console.log(response) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | console.log('绑定成功'); |
| | |
| | | |
| | | // 更新 tableData 的数据 |
| | | if (data.downGlassInfos != null) { |
| | | downGlass.value = data.downGlassInfos[0][1]; |
| | | downGlass.value = data.downGlassInfos[0]; |
| | | } |
| | | if (data.engineerIdList != null) { |
| | | selectOptionsa.value = data.engineerIdList[0] |
| | |
| | | autoPrint.value = data.autoPrint[0]; |
| | | } |
| | | |
| | | |
| | | if (fullFlowCard.value == ""&&autoPrint.value==true) { |
| | | //自动打印 |
| | | if (fullFlowCard.value == ""&&autoPrint.value==true&&browser.value==true) { |
| | | for (let i = 0; i < tableData.length; i++) { |
| | | if (tableData[i].totalQuantity != 0) { |
| | | if (tableData[i].totalQuantity == tableData[i].racksNumber + tableData[i].otherNumber && fullFlowCard.value != tableData[i].flowCardId) { |
| | |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | confirmBrowser();//获取浏览器 |
| | | fetchFlowCardId(); |
| | | fetchTableData(); // 获取数据 |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | |
| | | printLayer.value = row.layer |
| | | dialogTableVisible.value = true; |
| | | setTimeout(() => { |
| | | printFlowCard(); // 替换成你要执行的函数名 |
| | | printFlowCard(); |
| | | dialogTableVisible.value = false; |
| | | }, 1000); |
| | | ; |
| | | }, 2000); |
| | | } |
| | | const open1 = async (row) => { |
| | | |
| | | printFlowCardId.value = row.flowCardId; |
| | | printLayer.value = row.layer |
| | | dialogTableVisible1.value = true; |
| | | setTimeout(() => { |
| | | printFlowCard1(); |
| | | //dialogTableVisible1.value = false; |
| | | }, 1000); |
| | | } |
| | | |
| | | const printFlowCard = () => { |
| | | // 需要打印的局部区域赋予"print-wrap"的id |
| | | let el = document.getElementById("child"); |
| | | let doc = document; |
| | | let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | let printId = "print-" + Date.now(); |
| | | |
| | | // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) |
| | | let content = doc.createElement("div"); |
| | | content.id = printId; |
| | | |
| | | // alert(/Chrome/.test(userAgent) && !/Edge/.test(userAgent)); |
| | | |
| | | // 样式控制与打印无关的元素隐藏 |
| | | let style = doc.createElement("style"); |
| | | console.log("style1:"+style.innerHTML) |
| | | style.innerHTML = |
| | | "body>#" + |
| | | printId + |
| | | "{display:none;}@media print{" + |
| | | "@page {" + |
| | | " size: auto; " + |
| | | " margin: 10mm 5mm 10mm 5mm; " + |
| | | " }body>:not(#" + |
| | | printId + |
| | | "){display:none !important;}body>#" + |
| | | printId + |
| | | "{display:block;}#" + |
| | | printId + |
| | | "{display: block; padding: 0; margin: 0; width: 100%; position: absolute; top: 0; left: 0; height: 100vh; box-sizing: border-box;}} "; |
| | | |
| | | content.innerHTML = el.outerHTML; |
| | | // // console.log("el.outerHTML", el.outerHTML); |
| | | body.appendChild(style); |
| | | |
| | | // 与style元素设置的样式相配合 |
| | | // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) |
| | | body.appendChild(content); |
| | | setTimeout(() => { |
| | | window.print(); |
| | | body.removeChild(content); |
| | | body.removeChild(style); |
| | | }, 20); |
| | | } |
| | | |
| | | const printFlowCard1 = () => { |
| | | // 需要打印的局部区域赋予"print-wrap"的id |
| | | let el = document.getElementById("printFlowCard"); |
| | | let doc = document; |
| | | let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | let printId = "print-" + Date.now(); |
| | |
| | | "{display:none}@media print{" + |
| | | "@page {" + |
| | | " size: auto; " + |
| | | " margin: 10mm 2mm 10mm 1mm; " + |
| | | " margin: 2mm 2mm 2mm 2mm; " + |
| | | " }body>:not(#" + |
| | | printId + |
| | | "){display:none !important}body>#" + |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // beforeUnmount(() => { |
| | | // closeWebSocket(); |
| | | // }); |
| | |
| | | <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" |
| | | <el-table height="350px" 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')" |
| | |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" :label="$t('reportWork.operate')" align="center" width="200"> |
| | | <el-table-column fixed="right" :label="$t('reportWork.operate')" align="center" width="400"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain v-show="scope.row.enableState !== '已启用'" |
| | | @click="handleBindRack(scope.row)">{{ $t('reportWork.bindingshelves') }} |
| | | </el-button> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack2(scope.row)">{{ $t('reportWork.clear') |
| | | }}</el-button> |
| | | <el-button @click="open(scope.row)" :disabled="scope.row.flowCardId == null">打印</el-button> |
| | | <el-button @click="open(scope.row)" :disabled="scope.row.flowCardId == null">打印流程卡</el-button> |
| | | <el-button @click="open1(scope.row)" :disabled="scope.row.flowCardId == null">打印标签</el-button> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | |
| | | <el-option label="5" value="5"></el-option> |
| | | <el-option label="6" value="6"></el-option> |
| | | <el-option label="7" value="7"></el-option> |
| | | <el-option label="8" value="8"></el-option> |
| | | <el-option label="9" value="9"></el-option> |
| | | <el-option label="10" value="10"></el-option> |
| | | </el-select> |
| | | |
| | | <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('basicData.plselectproject')" clearable |
| | |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" destroy-on-close style="width: 75%;height:75% "> |
| | | <!-- <template #header="{ close, titleId, titleClass }"> |
| | | <el-button @click="printFlowCard" >打印</el-button> |
| | | </template> --> |
| | | <el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" destroy-on-close > |
| | | <print-flow id="child" :printFlowCardId="printFlowCardId" :printLayer="printLayer" |
| | | style="width: 100%;height: 100%"/> |
| | | </el-dialog> |
| | | <el-dialog id="sizePrintCalrd1" v-model="dialogTableVisible1" destroy-on-close > |
| | | <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer" |
| | | style=""/> |
| | | </el-dialog> |
| | | |
| | | </template> |
| | | <style scoped> |
| | |
| | | <el-button type="primary" style="margin-top: 10px;margin-left: 10px;" size="mini" id="searchButton" @click="add = true">{{ $t('delivery.addrole') }}</el-button> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="240" ref="table" |
| | | <el-table height="500" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="name" align="center" :label="$t('delivery.role')" min-width="180" /> |
| | |
| | | <el-button type="primary" style="margin-top: 10px;margin-left: 10px;" size="mini" id="searchButton" @click="add = true">{{ $t('productStock.addusers') }}</el-button> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="240" ref="table" |
| | | <el-table height="500" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="userName" align="center" :label="$t('productStock.username')" min-width="180" /> |
| | |
| | | <template> |
| | | <el-card style="flex: 1;margin-left: 1px;margin-top: 10px;margin-right: 1px;" v-loading="loading"> |
| | | <el-scrollbar height="600px"> |
| | | <el-scrollbar height="800px"> |
| | | <div id="top" style="height: 150px;display: flex;"> |
| | | <div class="echarts-container"> |
| | | <div v-for="(processData, index) in processesData" :key="index" class="echarts-item"> |
| | |
| | | <div class="moving-rect xiapianji5" v-show="xiapian5"></div> |
| | | <div class="moving-rect xiapianji6" v-show="xiapian6"></div> |
| | | </div> |
| | | <!-- <div class="parter" style="margin-top: 10px;margin-left: 150px; height: 240px;width: 1000px;"> |
| | | <img src="../../assets/dpxsa.png" style="margin-left: -10px; width: 100%;height: 100%;" alt="Your Image"> |
| | | <div class="moving-rect vertical"></div> |
| | | <div class="moving-rect all"></div> |
| | | <div class="moving-rect horizontal"></div> |
| | | <div class="moving-rect xiao"></div> |
| | | <div class="moving-rect zhan"></div> |
| | | <div class="moving-rect tu"></div> |
| | | <div class="moving-rect zi"></div> |
| | | <div class="moving-rect xia"></div> |
| | | <div class="moving-rect zan"></div> |
| | | <div class="moving-rect fa"></div> |
| | | <div class="moving-rect hua"></div> |
| | | <div class="moving-rect shui"></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" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="projectNo" align="center" :label="$t('large.projectnumber')" min-width="50" /> |
| | | <el-table-column prop="projectName" align="center" :label="$t('large.projectname')" min-width="50" /> |
| | | </el-table> |
| | | </div> --> |
| | | </div> |
| | | <div id="bottom" style="margin-top: 10px;height: 190px;background-color: #911005;"> |
| | | <el-table height="190" ref="table" |
| | | <div id="bottom" style="margin-top: 10px;height: 190px;"> |
| | | <el-table height="390" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="orderId" align="center" :label="$t('large.orderId')" min-width="50" /> |
| | |
| | | const socketUrl6 = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unLoadGlassIsRun`; |
| | | const handleMessage6 = (data) => { |
| | | const tasks = data.downWorkstation[0]; |
| | | if (tasks && tasks.length >= 6) { |
| | | xiapian.value = tasks.some(task => task.racksNumber!== 0); |
| | | const tasks1 = data.downGlassTask[0]; |
| | | xiapian.value = tasks1.some(task => task.thickness!== ''); |
| | | if (tasks && tasks.length >= 6) { |
| | | xiapian1.value = tasks[0].racksNumber !== 0; |
| | | xiapian2.value = tasks[1].racksNumber !== 0; |
| | | xiapian3.value = tasks[2].racksNumber !== 0; |
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" |
| | | } |
| | | ] |
| | | } |
New file |
| | |
| | | { |
| | | "plcAddressBegin": "DB11.0", |
| | | "plcAddressLenght": "94", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | |
| | | { |
| | | "codeId": "requestWord", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "requestID", |
| | | "addressIndex": "2", |
| | | "addressLenght": "30" |
| | | }, |
| | | { |
| | | "codeId": "currentCell", |
| | | "addressIndex": "32", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "glassStatus08", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "glassStatus06", |
| | | "addressIndex": "40", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "glassStatus11", |
| | | "addressIndex": "42", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "glassStatus13", |
| | | "addressIndex": "44", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04_error_status", |
| | | "addressIndex": "48", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05_error_status", |
| | | "addressIndex": "50", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06_error_status", |
| | | "addressIndex": "52", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "robot_error_status", |
| | | "addressIndex": "54", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08_error_status", |
| | | "addressIndex": "56", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09_error_status", |
| | | "addressIndex": "58", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10_error_status", |
| | | "addressIndex": "60", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11_error_status", |
| | | "addressIndex": "62", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "robot_error_status", |
| | | "addressIndex": "64", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13_error_status", |
| | | "addressIndex": "66", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "confirmationWord", |
| | | "addressIndex": "72", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06_prohibit_film_production", |
| | | "addressIndex": "74", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11_prohibit_film_production", |
| | | "addressIndex": "76", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13_prohibit_film_production", |
| | | "addressIndex": "78", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Glass_width", |
| | | "addressIndex": "80", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Glass_height", |
| | | "addressIndex": "82", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Glass_thickness", |
| | | "addressIndex": "84", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Start_cell", |
| | | "addressIndex": "86", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "End_cell", |
| | | "addressIndex": "88", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "task_type", |
| | | "addressIndex": "90", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "alarm_signal", |
| | | "addressIndex": "92", |
| | | "addressLenght": "2" |
| | | } |
| | | |
| | | ] |
| | | } |
| | |
| | | * 人工下片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_DAMAGE_TAKE = Arrays.asList(8, 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 static final List<Integer> G06_WORK_STATION = Arrays.asList(1, 2, 3); |
| | | public static final List<Integer> G11_WORK_STATION = Arrays.asList(4, 5, 6); |
| | | public static final int G13_WORK_STATION = 7; |
| | | public static final List<Integer> WORK_STATION_ALL = Arrays.asList(1, 2, 3, 4, 5, 6, 7); |
| | | |
| | | /** |
| | | * 启用 1 |
| | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.entity.DamagePrint; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | damageService.insertDamage(damage); |
| | | return Result.build(200,"新增成功",1); |
| | | } |
| | | @ApiOperation("拿走数据查询") |
| | | @PostMapping("/selectDamagePrint") |
| | | public Result selectDamagePrint(@RequestBody Damage damage) { |
| | | List<Damage> damage2=damageService.selectDamagePrint(damage); |
| | | return Result.build(200,"查询成功",damage2); |
| | | } |
| | | @ApiOperation("拿走打印查询") |
| | | @PostMapping("/selectDamagePrintDetails") |
| | | public Result selectDamagePrintDetails(@RequestBody Damage damage) { |
| | | List<DamagePrint> damage2=damageService.selectDamagePrintDetails(damage); |
| | | return Result.build(200,"查询成功",damage2); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.damage.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-25 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class DamagePrint implements Serializable { |
| | | |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | private String flowCardId; |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | /** |
| | | * 层号 |
| | | */ |
| | | private String layer; |
| | | |
| | | /** |
| | | * 版图id |
| | | */ |
| | | private String temperingLayoutId; |
| | | |
| | | /** |
| | | * 片序 |
| | | */ |
| | | private String temperingFeedSequence; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 宽度 |
| | | */ |
| | | private double width; |
| | | |
| | | /** |
| | | * 高度 |
| | | */ |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Integer thickness; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.damage.service; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.damage.entity.DamagePrint; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | void submitDamage(List<Damage> damageList); |
| | | |
| | | /** |
| | | * 单个破损 |
| | | * |
| | | * @param damage |
| | | */ |
| | | void insertDamage(Damage damage); |
| | | |
| | | /** |
| | | * 批量破损 |
| | | * |
| | | * @param damageList |
| | | */ |
| | | void batchInsertDamage(List<Damage> damageList); |
| | | |
| | | List<Damage> selectDamagePrint(Damage damage); |
| | | |
| | | List<DamagePrint> selectDamagePrintDetails(Damage damage); |
| | | } |
| | |
| | | package com.mes.damage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.entity.DamagePrint; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.pp.entity.ReportingWork; |
| | | import com.mes.work_assignment.entity.WorkAssignment; |
| | | import com.mes.work_assignment.mapper.WorkAssignmentMapper; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | GlassInfoMapper glassInfoMapper; |
| | | @Resource |
| | | WorkAssignmentMapper workAssignmentMapper; |
| | | @Autowired |
| | | private DamageMapper damageMapper; |
| | | |
| | | /** |
| | | * 查询报工信息 |
| | |
| | | damage.setOrderNumber(glassInfo.getGlassType()); |
| | | damage.setTechnologyNumber(glassInfo.getLayer()); |
| | | damage.setDamageTime(Timestamp.valueOf(LocalDateTime.now())); |
| | | damage.setType(2); |
| | | baseMapper.insert(damage); |
| | | } |
| | | |
| | | /** |
| | | * 添加报工信息 |
| | | */ |
| | | @Override |
| | | public void batchInsertDamage(List<Damage> damageList) { |
| | | WorkAssignment workAssignment = workAssignmentMapper.selectOne(new LambdaQueryWrapper<WorkAssignment>() |
| | | .eq(WorkAssignment::getLine, damageList.get(0).getLine()) |
| | | .eq(WorkAssignment::getWorkProcesses, damageList.get(0).getWorkingProcedure())); |
| | | |
| | | List<String> glassList = damageList.stream().map(Damage::getGlassId).collect(Collectors.toList()); |
| | | List<GlassInfo> glassInfoList = glassInfoMapper.selectList(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassList)); |
| | | Map<String, List<GlassInfo>> listMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId)); |
| | | for (Damage damage : damageList) { |
| | | GlassInfo glassInfo = listMap.get(damage.getGlassId()).get(0); |
| | | BeanUtils.copyProperties(glassInfo, damage); |
| | | if (workAssignment != null) { |
| | | damage.setTeamsGroupsName(workAssignment.getTeamsGroupsName()); |
| | | damage.setDeviceName(workAssignment.getDeviceName()); |
| | | } |
| | | damage.setProcessId(glassInfo.getFlowCardId()); |
| | | damage.setOrderNumber(glassInfo.getGlassType()); |
| | | damage.setTechnologyNumber(glassInfo.getLayer()); |
| | | damage.setDamageTime(Timestamp.valueOf(LocalDateTime.now())); |
| | | } |
| | | this.saveBatch(damageList); |
| | | } |
| | | |
| | | @Override |
| | | public List<Damage> selectDamagePrint(Damage damage) { |
| | | QueryWrapper<Damage> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("working_procedure,engineer_id,teams_groups_name,device_name,count(glass_id)as glass_id") |
| | | .eq("type",damage.getType()) |
| | | .eq("working_procedure",damage.getWorkingProcedure()) |
| | | .groupBy("working_procedure,engineer_id,teams_groups_name,device_name"); |
| | | if (damage.getEngineerId() != null) { |
| | | wrapper.eq("engineer_id", damage.getEngineerId()); |
| | | } |
| | | return this.list(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<DamagePrint> selectDamagePrintDetails(Damage damage) { |
| | | List<DamagePrint> listDamage=damageMapper.selectJoinList(DamagePrint.class,new MPJQueryWrapper<Damage>() |
| | | .select("b.flow_card_id,b.layer,t.engineer_id,b.tempering_layout_id,b.tempering_feed_sequence,t.glass_id,b.width,b.height,b.thickness") |
| | | .leftJoin("glass_info as b on t.glass_id=b.glass_id") |
| | | .eq("t.working_procedure",damage.getWorkingProcedure()) |
| | | .eq("t.type",damage.getType()) |
| | | .eq("t.engineer_id",damage.getEngineerId()) |
| | | ); |
| | | return listDamage; |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.pp.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/flow_card/flow-card") |
| | | public class FlowCardController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.pp.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class FlowCard implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * (工程号,2024.0302天机) |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 销售单号 |
| | | */ |
| | | private String orderId; |
| | | |
| | | /** |
| | | * 生产订单号 |
| | | */ |
| | | private String productionId; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String processId; |
| | | |
| | | /** |
| | | * 落架顺序 |
| | | */ |
| | | private String landingSequence; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | private Integer orderNumber; |
| | | |
| | | /** |
| | | * 工艺确认序号 |
| | | */ |
| | | private Integer technologyNumber; |
| | | |
| | | /** |
| | | * 分架数量 |
| | | */ |
| | | private Integer quantity; |
| | | |
| | | /** |
| | | * 以优化数量 |
| | | */ |
| | | private Integer optimizeQuantity; |
| | | |
| | | /** |
| | | * 排版状态(默认0,1允许排版2优化占用) |
| | | */ |
| | | private Integer layoutStatus; |
| | | |
| | | /** |
| | | * 补片数量 |
| | | */ |
| | | private Integer numberPatches; |
| | | |
| | | /** |
| | | * 最后工序报工 库存数量 |
| | | */ |
| | | private Integer inventoryQuantity; |
| | | |
| | | /** |
| | | * 已入数量 |
| | | */ |
| | | private Integer receivedQuantity; |
| | | |
| | | /** |
| | | * 补片编号 |
| | | */ |
| | | private String patchId; |
| | | |
| | | /** |
| | | * 工程占用状态,0为占用1占用 |
| | | */ |
| | | private Integer engineeringOccupancy; |
| | | |
| | | /** |
| | | * 工程号(2024.0302添加) |
| | | */ |
| | | private String projectNo; |
| | | |
| | | /** |
| | | * 包装前工序报工 库存数量 |
| | | */ |
| | | private Integer inventoryNumber; |
| | | |
| | | /** |
| | | * 入库时间 |
| | | */ |
| | | private LocalDateTime storageTime; |
| | | |
| | | /** |
| | | * 生产终止状态(默认0,1生产终止) |
| | | */ |
| | | private Integer terminationStatus; |
| | | |
| | | /** |
| | | * 打印状态 |
| | | */ |
| | | private Integer printStatus; |
| | | |
| | | /** |
| | | * 备用键 |
| | | */ |
| | | private Integer alternateKey; |
| | | |
| | | /** |
| | | * 分架员 |
| | | */ |
| | | private String founder; |
| | | |
| | | /** |
| | | * 分架时间 |
| | | */ |
| | | @TableField("splitFrame_time") |
| | | private LocalDateTime splitframeTime; |
| | | |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Integer layersNumber; |
| | | |
| | | /** |
| | | * 流程卡打印排序 |
| | | */ |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 建立时间 |
| | | */ |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.mes.pp.entity.FlowCard; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import feign.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-07 |
| | | */ |
| | | @DS("pp") |
| | | public interface FlowCardMapper extends BaseMapper<FlowCard> { |
| | | |
| | | List<Map<String, Object>> selectProject(@Param("processId") String processId,@Param("technologyNumber") Integer technologyNumber); |
| | | |
| | | List<Map<String, Object>> selectFlowCard(@Param("processId") String processId,@Param("technologyNumber") Integer technologyNumber); |
| | | |
| | | List<Map<String, Object>> selectLabel(@Param("processId") String processId,@Param("technologyNumber") Integer technologyNumber); |
| | | } |
New file |
| | |
| | | package com.mes.pp.service; |
| | | |
| | | import com.mes.pp.entity.FlowCard; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-07 |
| | | */ |
| | | public interface FlowCardService extends IService<FlowCard> { |
| | | |
| | | List<Map<String, Object>> selectProject(String processId, Integer technologyNumber); |
| | | |
| | | List<Map<String, Object>> selectFlowCard(String processId, Integer technologyNumber); |
| | | |
| | | List<Map<String, Object>> selectLabel(String processId, Integer technologyNumber); |
| | | } |
New file |
| | |
| | | package com.mes.pp.service.impl; |
| | | |
| | | import com.mes.pp.entity.FlowCard; |
| | | import com.mes.pp.mapper.FlowCardMapper; |
| | | import com.mes.pp.service.FlowCardService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Service |
| | | public class FlowCardServiceImpl extends ServiceImpl<FlowCardMapper, FlowCard> implements FlowCardService { |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectProject(String processId, Integer technologyNumber){ |
| | | return baseMapper.selectProject(processId,technologyNumber); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectFlowCard(String processId, Integer technologyNumber){ |
| | | return baseMapper.selectFlowCard(processId, technologyNumber); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectLabel(String processId, Integer technologyNumber){ |
| | | return baseMapper.selectLabel(processId, technologyNumber); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.mes.base.entity.BigStorageCageBaseInfo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | */ |
| | | @ApiModelProperty(value = "工程id", position = 17) |
| | | private String engineerId; |
| | | |
| | | @TableLogic |
| | | private int deleted; |
| | | } |
| | |
| | | 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; |
New file |
| | |
| | | package com.mes.tools; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | public class DateUtil { |
| | | public static Date getBeginDate(){ |
| | | Calendar now = Calendar.getInstance(); |
| | | Calendar startOfDay = (Calendar) now.clone(); |
| | | startOfDay.set(Calendar.HOUR_OF_DAY, 0); |
| | | startOfDay.set(Calendar.MINUTE, 0); |
| | | startOfDay.set(Calendar.SECOND, 0); |
| | | return startOfDay.getTime(); |
| | | } |
| | | |
| | | public static Date getEndDate(){ |
| | | Calendar now = Calendar.getInstance(); |
| | | Calendar endOfDay = (Calendar) now.clone(); |
| | | endOfDay.set(Calendar.HOUR_OF_DAY, 23); |
| | | endOfDay.set(Calendar.MINUTE, 59); |
| | | endOfDay.set(Calendar.SECOND, 59); |
| | | return endOfDay.getTime(); |
| | | } |
| | | } |
New file |
| | |
| | | mybatis-plus-join: |
| | | sub-table-logic: true |
| | | mybatis-plus: |
| | | global-config: |
| | | db-config: |
| | | logic-delete-field: deleted |
| | | logic-delete-value: 1 |
| | | logic-not-delete-value: 0 |
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.pp.mapper.FlowCardMapper"> |
| | | |
| | | |
| | | <select id="selectFlowCard" resultType="java.util.Map"> |
| | | select fc.order_number, |
| | | concat(round(ogd.child_width), "*", round(ogd.child_height)) as child_width, |
| | | od.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | od.bend_radius, |
| | | concat(IFNULL(od.processing_note,''), IFNULL(od.remarks,'')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | | round(ogd.child_height) as height, |
| | | pd.separation, |
| | | fc.technology_number |
| | | from pp.flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.product_detail as pd |
| | | on pd.prod_id = od.product_id and pd.glass_sort = ogd.technology_number |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | order by IF(sort != NULL || sort != '', sort, fc.order_number) |
| | | |
| | | </select> |
| | | |
| | | <select id="selectProject" resultType="java.util.Map"> |
| | | select o.customer_name, |
| | | o.project, |
| | | (select process from sd.order_glass_detail where order_id=fc.order_id and order_number=fc.order_number and technology_number=fc.technology_number) as process , |
| | | od.edging_type, |
| | | (select glass_child from sd.order_glass_detail where order_id=fc.order_id and order_number=fc.order_number and technology_number=fc.technology_number) as glass_child , |
| | | od.product_name, |
| | | o.processing_note, |
| | | fc.process_id, |
| | | SUM(od.quantity) as quantity, |
| | | round(SUM(ogd.total_area), 2) as gross_area, |
| | | sum(od.weight) as weight, |
| | | 1 as technologyNumber, |
| | | concat(fc.process_id, '/', 1) as processIdNumber, |
| | | concat('对应我司单号',o.batch) AS otherRemarks |
| | | from pp.flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.`order` as o on o.order_id = fc.order_id |
| | | left join sd.product as p on p.id = od.product_id |
| | | left join (select ogd.order_id, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | ogd.glass_child, |
| | | GROUP_CONCAT(glass_child SEPARATOR ' ') AS concatenated_glass_child |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.order_id = left(#{processId}, 10) |
| | | and position(ogd.technology_number in #{technologyNumber}) |
| | | GROUP BY order_id, order_number) as ogdc |
| | | on ogdc.order_id = ogd.order_id and ogdc.order_number = ogd.order_number and |
| | | ogdc.technology_number = ogd.technology_number |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | group by fc.process_id |
| | | </select> |
| | | |
| | | <select id="selectLabel" resultType="java.util.Map"> |
| | | select fc.process_id, |
| | | o.order_id, |
| | | o.project, |
| | | o.customer_id, |
| | | ogd.child_width as width, |
| | | ogd.child_height as height, |
| | | od.quantity, |
| | | od.order_number as orderNumber, |
| | | fc.technology_number as technologyNumber, |
| | | ogd.glass_child, |
| | | ogd.process, |
| | | c.customer_abbreviation as customer_name, |
| | | ifnull(od.processing_note, '') as processing_note, |
| | | bgt.type_name, |
| | | od.other_columns, |
| | | od.building_number, |
| | | od.bend_radius |
| | | from sd.order as o |
| | | left join sd.order_detail as od on o.order_id = od.order_id |
| | | left join sd.order_glass_detail as ogd |
| | | on ogd.order_id = od.order_id and ogd.order_number = od.order_number |
| | | left join pp.flow_card as fc on o.order_id = fc.order_id and |
| | | od.order_number = fc.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.product pt on pt.id = od.product_id |
| | | left join sd.customer c on c.id = o.customer_id |
| | | left join sd.basic_glass_type bgt on bgt.type_id = pt.type_id |
| | | where fc.process_id = #{processId} |
| | | and fc.technology_number = #{technologyNumber} |
| | | group by od.order_number, od.width, od.height |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | gateway: |
| | | discovery: |
| | | locator: |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: dev |
| | | application: |
| | | name: cacheVerticalGlass |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | mes: |
| | | sequence: |
| | | order: false |
| | | minCount: 20 |
| | | carWidth: 5000 #大车宽度 |
| | | slotWidth: 5000 #大车宽度 |
| | | inCarMaxSize: 3 #进片大车最大存放玻璃数量 |
| | | outCarMaxSize: 3 #出片大车最大存放玻璃数量 |
| | | inCarMaxSize: 1 #进片大车最大存放玻璃数量 |
| | | outCarMaxSize: 2 #出片大车最大存放玻璃数量 |
| | | glassGap: 350 #玻璃间距 |
| | | xMaxSize: 2850 |
| | | xMaxSize: 2800 |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | active: dev |
| | | application: |
| | | name: glassStorage |
| | | |
| | |
| | | @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"); |
| | | } |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("IsRun"); |
| | | //工位信息 |
| | | List<UpWorkstation> upWorkstations = upWorkstationService.list(); |
| | | jsonObject.append("list", upWorkstations); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlassIsRun"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | |
| | | port: 8083 |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: dev |
| | | application: |
| | | name: loadGlass |
| | | mybatis-plus: |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | @Scheduled(fixedDelay = 2000) |
| | | @Scheduled(fixedDelay = 10000) |
| | | public void screenHome() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | Reportingdamage reportingdamage = new Reportingdamage(); |
| | | reportingdamage.setReportingWorkTime("2024-05-11"); |
| | | //reportingdamage.setReportingWorkTime("2024-05-11"); |
| | | // 获取当前日期 |
| | | LocalDate today = LocalDate.now(); |
| | | // 计算最近七天的开始日期 |
| | | LocalDate startOfPeriod = today.minusDays(6); // 7天的范围包括今天,所以减去6天 |
| | | // 最近七天的结束日期就是今天 |
| | | LocalDate endOfPeriod = today; |
| | | // 格式化日期为字符串 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | String startOfPeriodStr = startOfPeriod.format(formatter); |
| | | String endOfPeriodStr = endOfPeriod.format(formatter); |
| | | // 设置为最近七天的时间范围 |
| | | reportingdamage.setReportingWorkTime("2024-05-11" + " to " + endOfPeriodStr); |
| | | //reportingdamage.setReportingWorkTime(startOfPeriodStr + " to " + endOfPeriodStr); |
| | | //扇形图各设备的加工破损数量 |
| | | List<Reportingdamage> device = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("device", device); |
| | | |
| | | //获取次破未补信息 |
| | | List<AwaitingRepair> awaitingRepairs = reportingWorkService.selectAwaitingRepair(); |
| | | jsonObject.append("awaitingRepairs", awaitingRepairs); |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.common.config.Const; |
| | | 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.tools.WebSocketServer; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author SNG-010 |
| | |
| | | |
| | | @Autowired |
| | | private TemperingGlassInfoService temperingAgoService; |
| | | @Autowired |
| | | private DamageService damageService; |
| | | |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void temperingGlassHome(){ |
| | | public void temperingGlassHome() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在等待进片的玻璃 |
| | | List<TemperingGlassInfo> waitingGlass = temperingAgoService.selectWaitingGlass(); |
| | | if(waitingGlass!=null){ |
| | | if (waitingGlass != null) { |
| | | jsonObject.append("waitingGlass", waitingGlass); |
| | | } |
| | | |
| | | //获取整在炉中的两个版图id |
| | | List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId(); |
| | | //进炉中的玻璃 |
| | | if(!layoutId.isEmpty()) { |
| | | if (!layoutId.isEmpty()) { |
| | | List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0)); |
| | | jsonObject.append("intoGlass", intoGlass); |
| | | //进炉中的第二个版图 |
| | |
| | | } |
| | | //出炉后的玻璃 |
| | | List<TemperingGlassInfo> outGlass = temperingAgoService.selectOutGlass(); |
| | | if(outGlass!=null){ |
| | | if (outGlass != null) { |
| | | jsonObject.append("outGlass", outGlass); |
| | | } |
| | | |
| | |
| | | if (outGlass != null) { |
| | | jsonObject.append("overGlass", overGlass); |
| | | } |
| | | //当前钢化工程的拿走数据 |
| | | LambdaQueryWrapper<TemperingGlassInfo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.select(TemperingGlassInfo::getEngineerId) |
| | | .lt(TemperingGlassInfo::getState, Const.TEMPERING_END) |
| | | .groupBy(TemperingGlassInfo::getEngineerId); |
| | | |
| | | List<String> engineerIds = temperingAgoService.list(queryWrapper) |
| | | .stream() |
| | | .map(TemperingGlassInfo::getEngineerId) |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | | |
| | | List<Damage> temperingTakeGlassInfos = damageService.list( |
| | | new LambdaQueryWrapper<Damage>() |
| | | .in(Damage::getEngineerId, engineerIds) |
| | | .eq(Damage::getType, Const.GLASS_STATE_TAKE) |
| | | .orderByAsc(Damage::getId) |
| | | ); |
| | | |
| | | |
| | | jsonObject.append("temperingTakeGlassInfos", temperingTakeGlassInfos); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); |
| | | if (sendwServer != null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void temperingIsRun(){ |
| | | public void temperingIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | List<TemperingGlassInfo>temperingTaskType=temperingAgoService.selectTaskType(); |
| | | List<TemperingGlassInfo> temperingTaskType = temperingAgoService.selectTaskType(); |
| | | jsonObject.append("temperingTaskType", temperingTaskType); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun"); |
| | | |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingIsRun"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | port: 8084 |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | active: dev |
| | | application: |
| | | name: temperingGlass |
| | | mybatis-plus: |
| | |
| | | return Result.build(200, "查询成功", downGlassInfoService.downGlassPrint(downGlassInfo)); |
| | | } |
| | | |
| | | @PostMapping("/downGlassLabelPrint") |
| | | public Result downGlassLabelPrint(@RequestBody DownGlassInfo downGlassInfo) { |
| | | return Result.build(200, "查询成功", downGlassInfoService.downGlassLabelPrint(downGlassInfo)); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Repository |
| | | public interface DownGlassInfoMapper extends BaseMapper<DownGlassInfo> { |
| | |
| | | * @return |
| | | */ |
| | | List<DownGlassInfoDTO> queryWorkStationFlowCard(@Param(value = "workList") List<Integer> workList); |
| | | |
| | | /** |
| | | * 获取下片信息 |
| | | * |
| | | * @param processId,technologyNumber |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> downGlassLabelPrint(@Param("processId") String processId, @Param("technologyNumber") Integer technologyNumber); |
| | | |
| | | } |
| | |
| | | */ |
| | | String setDownGlassInfoRequest(DownGlassInfoRequest request); |
| | | |
| | | /** |
| | | * 流程卡打印查询 |
| | | * |
| | | * @param downGlassInfo |
| | | * @return |
| | | */ |
| | | List<Map<String, List<Map<String, Object>>>> downGlassPrint(DownGlassInfo downGlassInfo); |
| | | |
| | | /** |
| | | * 工位是否满架查询 |
| | | * |
| | | * @return |
| | | */ |
| | | List<DownWorkstation> queryWorkStationIsFull(); |
| | | |
| | | |
| | | /** |
| | | * 标签打印查询 |
| | | * |
| | | * @param downGlassInfo |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> downGlassLabelPrint(DownGlassInfo downGlassInfo); |
| | | } |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: dev |
| | | application: |
| | | name: unLoadGlass |
| | | |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | mes: |
| | | maxWidth: 2500 #下片的最大宽度 |
| | |
| | | </foreach> |
| | | ORDER BY T.RACKS_NUMBER DESC |
| | | </select> |
| | | |
| | | <select id="selectFlowCard" resultType="java.util.Map"> |
| | | select fc.order_number, |
| | | concat(round(ogd.child_width), "*", round(ogd.child_height)) as child_width, |
| | | od.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | od.bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | | round(ogd.child_height) as height, |
| | | pd.separation, |
| | | fc.technology_number |
| | | from pp.flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.product_detail as pd |
| | | on pd.prod_id = od.product_id and pd.glass_sort = ogd.technology_number |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | order by IF(sort != NULL || sort != '', sort, fc.order_number) |
| | | |
| | | </select> |
| | | |
| | | <select id="selectProject" resultType="java.util.Map"> |
| | | select o.customer_name, |
| | | o.project, |
| | | (select process |
| | | from sd.order_glass_detail |
| | | where order_id = fc.order_id |
| | | and order_number = fc.order_number |
| | | and technology_number = fc.technology_number) as process, |
| | | od.edging_type, |
| | | (select glass_child |
| | | from sd.order_glass_detail |
| | | where order_id = fc.order_id |
| | | and order_number = fc.order_number |
| | | and technology_number = fc.technology_number) as glass_child, |
| | | od.product_name, |
| | | o.processing_note, |
| | | fc.process_id, |
| | | SUM(od.quantity) as quantity, |
| | | round(SUM(ogd.total_area), 2) as gross_area, |
| | | sum(od.weight) as weight, |
| | | 1 as technologyNumber, |
| | | concat(fc.process_id, '/', 1) as processIdNumber, |
| | | concat('对应我司单号', o.batch) AS otherRemarks |
| | | from pp.flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.`order` as o on o.order_id = fc.order_id |
| | | left join sd.product as p on p.id = od.product_id |
| | | left join (select ogd.order_id, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | ogd.glass_child, |
| | | GROUP_CONCAT(glass_child SEPARATOR ' ') AS concatenated_glass_child |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.order_id = left (#{processId} |
| | | , 10) |
| | | and position (ogd.technology_number in #{technologyNumber}) |
| | | GROUP BY order_id, order_number) as ogdc |
| | | on ogdc.order_id = ogd.order_id and ogdc.order_number = ogd.order_number and |
| | | ogdc.technology_number = ogd.technology_number |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | group by fc.process_id |
| | | </select> |
| | | |
| | | <select id="downGlassLabelPrint" resultType="java.util.Map"> |
| | | select a.flow_card_id, |
| | | a.layer, |
| | | a.width, |
| | | a.height, |
| | | a.filmsid, |
| | | a.thickness, |
| | | a.glass_type, |
| | | COUNT(*) AS quantity, |
| | | b.tempering_layout_id, |
| | | b.tempering_feed_sequence |
| | | from down_glass_info a |
| | | inner join glass_info b on a.glass_id = b.glass_id |
| | | where a.flow_card_id = #{processId} |
| | | and a.layer = #{technologyNumber} |
| | | group by a.flow_card_id, a.layer, a.width, a.height, a.filmsid, a.thickness, a.glass_type, a.id |
| | | order by a.id |
| | | </select> |
| | | |
| | | |
| | | </mapper> |