Merge remote-tracking branch 'origin/master'
| | |
| | | export default { |
| | | // serverUrl: "10.153.19.150:88/api", |
| | | serverUrl: "10.153.19.150:88/api", |
| | | // serverUrl: "192.168.1.199:88/api", |
| | | serverUrl: "127.0.0.1:88/api", |
| | | // serverUrl2: "10.153.19.150:88" |
| | | // serverUrl: "127.0.0.1:88/api", |
| | | serverUrl2: "10.153.19.150:88" |
| | | // serverUrl2: "192.168.1.199:88" |
| | | serverUrl2: "127.0.0.1:88" |
| | | // serverUrl2: "127.0.0.1:88" |
| | | |
| | | //serverUrl:"res.abeim.cn" |
| | | } |
| | |
| | | presponsibleequipment :'请选择责任设备', |
| | | remark :'备注', |
| | | premark :'请输入备注', |
| | | } |
| | | }, |
| | | film:{ |
| | | mes:'原片仓储详情', |
| | | warehousing:'入库', |
| | | operate: '操作', |
| | | exit:'编辑', |
| | | delete:'删除', |
| | | outbound:'出库', |
| | | deviceid:'设备ID', |
| | | slot:'栅格号', |
| | | enablestatea:'启用标记', |
| | | disable:'禁用', |
| | | start:'启用', |
| | | startslot:'开始工位', |
| | | endslot:'目标工位', |
| | | slotid:'格子ID', |
| | | width:'原片宽', |
| | | widtha:'原片宽:', |
| | | inwidth:'请输入原片宽', |
| | | height:'原片高', |
| | | inheight:'请输入原片高', |
| | | heighta:'原片高:', |
| | | thickness:'原片厚度', |
| | | inthickness:'请输入原片厚度', |
| | | thicknessa:'原片厚度:', |
| | | films:'膜系', |
| | | infilms:'请输入膜系', |
| | | filmsa:'膜系:', |
| | | createtime:'创建时间', |
| | | remainquantity:'剩余数量', |
| | | thickremainquantity:'原片剩余数量(张):', |
| | | inquantity:'请输入数量', |
| | | quantitya:'数量:', |
| | | enableid:'任务ID', |
| | | originateslot:'起始格子', |
| | | endslot:'目标格子', |
| | | patternquantity:'原片数量', |
| | | enabletype:'任务类型', |
| | | enablestate:'工位状态', |
| | | finish:'已完成', |
| | | unfinish:'未完成', |
| | | dedelete:'是否删除该条内容?', |
| | | dedisable:'是否禁用该条内容?', |
| | | deoutbound:'是否出库该条内容?', |
| | | selectwarehousing:'请选择吊装位', |
| | | inwarehousing:'吊装位:', |
| | | warehousing1:'吊装位1', |
| | | warehousing2:'吊装位2', |
| | | starttime :'开始时间', |
| | | endtime :'结束时间', |
| | | taskstatus :'任务状态', |
| | | built :'新建', |
| | | execution :'执行中', |
| | | finish :'完成', |
| | | tasktype :'任务类型', |
| | | stocke :'入库', |
| | | outbound :'出库', |
| | | dispatch :'调度', |
| | | inquire :'查询', |
| | | station :'工位', |
| | | }, |
| | | } |
| | |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | { |
| | | /*----------- 仓储中心 ----------------*/ |
| | | { |
| | | path: 'GlassStorage', |
| | | name: 'GlassStorage', |
| | | component: () => import('../views/GlassStorage/MaterialRackManagement.vue'), |
| | | component: () => import('../views/GlassStorage/GlassStorage.vue'), |
| | | children:[ |
| | | { |
| | | path: '/GlassStorage/MaterialRackManagement', |
| | | name: 'MaterialRackManagement', |
| | | component: () => import('../views/GlassStorage/MaterialRackManagement.vue') |
| | | }, |
| | | { |
| | | path: '/GlassStorage/rawfilmstorage', |
| | | name: 'rawfilmstorage', |
| | | component: () => import('../views/GlassStorage/rawfilmstorage.vue') |
| | | } |
| | | ] |
| | | }, |
| | | }, |
| | | |
| | | /*----------- 可视化系统 ----------------*/ |
| | | { |
| | |
| | | // export const WebSocketHost = "192.168.1.199"; |
| | | // export const WebSocketHost = "10.153.19.150"; |
| | | export const WebSocketHost = "127.0.0.1"; |
| | | export const WebSocketHost = "10.153.19.150"; |
| | | // export const WebSocketHost = "127.0.0.1"; |
| | | export const host = "88"; |
| | |
| | | const dialogFormVisibleb = ref(false) |
| | | const dialogFormVisiblec = ref(false) |
| | | const timeRange = ref(["2022-01-01", "2025-01-01"]) |
| | | const selectValuesa = reactive([]); |
| | | let webSocket: WebSocket | null = null; |
| | | const value = ref('') |
| | | const options = [ |
| | |
| | | enableState: '', |
| | | }); |
| | | onMounted(() => { |
| | | connectWebSocket(); |
| | | // socket = initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (webSocket) { |
| | | webSocket.close(); |
| | | } |
| | | }); |
| | | // onUnmounted(() => { |
| | | // if (socket) { |
| | | // closeWebSocket(socket); |
| | | // } |
| | | // }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | let socket = null; |
| | | const connectWebSocket = () => { |
| | | if (!webSocket) { |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/glassStorage/api/talk/rawGlass`; |
| | | webSocket = new WebSocket(socketUrl); |
| | | webSocket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | if(data.tasks !=null){ |
| | | tableDataa.value = data.tasks[0] |
| | | console.log(data.tasks[0]); |
| | | |
| | | } |
| | | if(data.rack !=null){ |
| | | tableDatab.value = data.rack[0] |
| | | } |
| | | // const data = JSON.parse(event.data); |
| | | // const scaleFactor = 1621.78/6000; |
| | | // const scaleFactory = 750/3300; |
| | | // 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); |
| | | |
| | | |
| | | // }); |
| | | // adjustedRects.value = newRects; |
| | | // } |
| | | }; |
| | | } |
| | | }; |
| | | // const socketUrl = `ws://${WebSocketHost}:${host}/api/glassStorage/api/talk/rawGlass`; |
| | | // const handleMessage = (data) => { |
| | | // // if(data.tasks!=null){ |
| | | // // tableData.splice(0, tableData.length, ...data.prioritylist[0]); |
| | | // // } |
| | | // if(data.tasks !=null){ |
| | | // tableDataa.value = data.tasks[0] |
| | | // console.log(data.tasks[0]); |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/glassStorage/api/talk/rawGlass`; |
| | | const handleMessage = (data) => { |
| | | if(data.tasks !=null){ |
| | | tableDataa.value = data.tasks[0] |
| | | console.log(data.tasks[0]); |
| | | |
| | | // } |
| | | // if(data.rack !=null){ |
| | | // tableDatab.value = data.rack[0] |
| | | // } |
| | | // }; |
| | | } |
| | | if(data.rack !=null){ |
| | | tableDatab.value = data.rack[0] |
| | | } |
| | | }; |
| | | // 删除 |
| | | const opena = async(row) => { |
| | | try { |
| | |
| | | }; |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | let celllist=[] |
| | | let stateList=[] |
| | | if(selectValuesa[0]!=null&&selectValuesa[0]!='undefined'){ |
| | | if(selectValuesa[0]!=""){ |
| | | celllist=[selectValuesa[0]]; |
| | | } |
| | | } |
| | | if(selectValuesa[1]!=null&&selectValuesa[1]!='undefined'){ |
| | | if(selectValuesa[1]!=""){ |
| | | stateList=[selectValuesa[1]]; |
| | | } |
| | | } |
| | | const response = await request.post("/glassStorage/raw_glass_storage_task/selectRawglasstask", { |
| | | createTime: timeRange.value[0], |
| | | patternQuantity: timeRange.value[1], |
| | | enableType: report.value.enableType, |
| | | enableState: report.value.enableState |
| | | enableType: stateList, |
| | | enableState: celllist |
| | | }) |
| | | if (response.code === 200) { |
| | | tableDataa.value = response.data; |
| | | ElMessage.success(response.message); |
| | | if (webSocket) { |
| | | webSocket.close(); |
| | | webSocket = null; |
| | | } |
| | | } else { |
| | | connectWebSocket(); |
| | | } |
| | | else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求错误 |
| | | } catch (error) { |
| | | ElMessage.error(t('basicData.glassnull')); |
| | | } |
| | | }; |
| | |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('film.warehousing') }}</el-button> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" |
| | | :start-placeholder="$t('film.starttime')" :end-placeholder="$t('film.endtime')" :default-time="defaultTime" /> |
| | | <el-select v-model="report.enableType" clearable :placeholder="$t('film.taskstatus')" style="margin-left: 10px;" > |
| | | <el-select v-model="selectValuesa[0]" clearable :placeholder="$t('film.taskstatus')" style="margin-left: 10px;" > |
| | | <el-option :label="$t('film.built')" value="1"></el-option> |
| | | <el-option :label="$t('film.execution')" value="2"></el-option> |
| | | <el-option :label="$t('film.finish')" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.enableState" clearable :placeholder="$t('film.tasktype')" style="margin-left: 10px;" > |
| | | <el-select v-model="selectValuesa[1]" clearable :placeholder="$t('film.tasktype')" style="margin-left: 10px;" > |
| | | <el-option :label="$t('film.stocke')" value="1"></el-option> |
| | | <el-option :label="$t('film.outbound')" value="2"></el-option> |
| | | <el-option :label="$t('film.dispatch')" value="3"></el-option> |
| | |
| | | </div> |
| | | </el-scrollbar> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> |
| | | <el-button :disabled="currentGlassRect?.glass_state === 8" type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> |
| | | <el-button :disabled="currentGlassRect?.glass_state === 8 || currentGlassRect?.glass_state === 9" type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | <el-button :disabled="currentGlassRect?.glass_state === 9" type="danger" plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;"> |
| | | <el-button :disabled="currentGlassRect?.glass_state === 9 || currentGlassRect?.glass_state === 8" type="danger" plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;"> |
| | | <el-icon class="el-icon--right"><Upload /></el-icon> |
| | | {{ $t('order.takeaway') }}</el-button> |
| | | </el-dialog> |
| | |
| | | let webSocket: WebSocket | null = null; |
| | | const totalPages = ref(0); |
| | | const pageSize = ref(1); |
| | | const currentPage = ref(1); |
| | | const currentPage = ref(''); |
| | | const disabled = false; |
| | | const size = 'small'; |
| | | const rawData = ref([]); |
| | |
| | | // blind.value = true; // 打开绑定架子对话框 |
| | | // }; |
| | | // 显示对话框并设置当前 glass_id |
| | | const currentGlassRect = computed(() => { |
| | | const currentGlassRect = computed(() => { |
| | | return adjustedRects.value.find(rect => rect.glass_id === currentGlassId.value); |
| | | }); |
| | | function showDialog(glassId: number) { |
| | |
| | | // 破损 |
| | | const handleDamage = async () => { |
| | | try { |
| | | // var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+201; |
| | | // console.log(url); |
| | | // const response = await request.post(url) |
| | | const response = await request.post('/cacheGlass/taskCache/identControls', { |
| | | glassId: currentGlassId.value, |
| | | state: 8, |
| | |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | updateRectStatus(currentGlassId.value, 8); |
| | | } else { |
| | | findEngineering() |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | updateRectStatus(currentGlassId.value, 9); |
| | | findEngineering() |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleBlur = async () => { |
| | | const handleBlur = async () => { |
| | | if (inputValue.value) { |
| | | var url="/cacheGlass/taskCache/cutTerritory?current="+inputValue.value; |
| | | const response = await request.post(url) |
| | |
| | | webSocket.close(); |
| | | webSocket = null; |
| | | } |
| | | currentPage.value = 1; |
| | | currentPage.value = 1; |
| | | } |
| | | } else{ |
| | | connectWebSocket(); |
| | | } |
| | | }; |
| | | const findEngineering = async () => { |
| | | if (inputValue.value) { |
| | | var url="/cacheGlass/taskCache/cutTerritory?current="+inputValue.value; |
| | | const response = await request.post(url) |
| | | if (response.code === 200) { |
| | | rawData.value = response.data; |
| | | } |
| | | } else{ |
| | | } |
| | | }; |
| | | |
| | | const handleCurrentChange = (val: number) => { |
| | | currentPage.value = val; |
| | | // window.localStorage.setItem('pagenumber', currentPage.value). |
| | | const page = currentPage.value - 1 |
| | | const scaleFactor = 1621.78/6000; |
| | | const scaleFactory = 750/3300; |
| | |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | const responses = await request.post("/cacheVerticalGlass/damage/insertDamage", { |
| | | glassId:"P24060403|3|6", |
| | | line:"2001", |
| | | workingProcedure:"冷加工", |
| | | remark:"", |
| | | status:"2" |
| | | }) |
| | | // const responses = await request.post("/cacheVerticalGlass/damage/insertDamage", { |
| | | // glassId:"P24081502|1|1", |
| | | // line:"1001", |
| | | // workingProcedure:"切割", |
| | | // remark:"", |
| | | // status:"0" |
| | | // }) |
| | | }; |
| | | // 报工 |
| | | const handleConfirm = async () => { |
| | |
| | | }; |
| | | fetchTableData(); |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | const handleMessage = (data) => { |
| | | // const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | // const handleMessage = (data) => { |
| | | // adjustedRects.value = data.device[0].map(rect => ({ |
| | | // ...rect, |
| | | // completed: rect.completedQuantity, |
| | | // breakage: rect.breakageQuantity, |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | }; |
| | | // }; |
| | | // let socket; |
| | | onMounted(() => { |
| | | socket = new WebSocket(socketUrl); |
| | | socket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | // socket = new WebSocket(socketUrl); |
| | | // socket.onmessage = (event) => { |
| | | // const data = JSON.parse(event.data); |
| | | |
| | | // updateCharts(); |
| | | }; |
| | | // // updateCharts(); |
| | | // }; |
| | | // }; |
| | | }); |
| | | onUnmounted(() => { |
| | |
| | | }); |
| | | onMounted(() => { |
| | | fetchTableData(); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | // socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/edgTasks`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | |
| | | let totalQuantity1 = 0; |
| | | //面积 |
| | | let totalArea = 0; |
| | | //落架面积 |
| | | let totalArea1 = 0; |
| | | //重量 |
| | | let totalWeight = 0; |
| | | //落架重量 |
| | | let totalWeight1 = 0; |
| | | // 对每个集合中的 detailList 进行计算 |
| | | produceList.value[i].detailList.forEach(collection => { |
| | | totalQuantity += collection.quantity * 1; |
| | |
| | | //每个序号面积 |
| | | collection.total_area = parseFloat((collection.width * collection.height * collection.quantity / 1000000).toFixed(2)) |
| | | totalArea += collection.total_area * 1; |
| | | |
| | | collection.total_area1 = parseFloat((collection.width * collection.height * collection.quantity1 / 1000000).toFixed(2)) |
| | | totalArea1 += collection.total_area1 * 1; |
| | | |
| | | totalWeight += collection.width * collection.height * collection.quantity / 1000000 * collection.separation * 2.5 * 1; |
| | | totalWeight1 += collection.width * collection.height * collection.quantity1 / 1000000 * collection.separation * 2.5 * 1; |
| | | //每个序号周长 |
| | | collection.perimeter = parseFloat(((collection.width * 2 + collection.height * 2) * collection.quantity / 1000).toFixed(3)) |
| | | }); |
| | | // 输出每个集合中的总数量 |
| | | produceList.value[i].detail[0].quantity = totalQuantity |
| | | produceList.value[i].detail[0].quantity1 = totalQuantity |
| | | produceList.value[i].detail[0].quantity1 = totalQuantity1 |
| | | produceList.value[i].detail[0].gross_area = totalArea |
| | | produceList.value[i].detail[0].gross_area1 = totalArea1 |
| | | produceList.value[i].detail[0].weight = totalWeight |
| | | produceList.value[i].detail[0].weight1 = totalWeight1 |
| | | } |
| | | } |
| | | |
| | |
| | | <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> |
| | | 落架面积: |
| | | <label>{{ parseFloat(itemsum.gross_area1.toFixed(2)) }}</label> |
| | | 重量: |
| | | <label>{{ parseFloat(itemsum.weight.toFixed(2)) }}</label> |
| | | 落架重量: |
| | | <label>{{ parseFloat(itemsum.weight1.toFixed(2)) }}</label> |
| | | </td> |
| | | </tr> |
| | | <tr v-for="(itemtextarea,index) in item.detail" :key="index"> |
| | |
| | | autoPrint.value = data.autoPrint[0]; |
| | | } |
| | | if (data.takeGlass != null) { |
| | | |
| | | takeGlass.value = data.takeGlass[0]; |
| | | // takeGlass.value 是一个空对象 |
| | | let width = takeGlass.value.width; |
| | | let height = takeGlass.value.height; |
| | | if (width < height) { |
| | | takeGlass.value.width = height; |
| | | takeGlass.value.height = width; |
| | | } |
| | | |
| | | |
| | | } |
| | | if (data.scanGlass != null) { |
| | | scanGlass.value = data.scanGlass[0]; |
| | | let width = scanGlass.value.width; |
| | | let height = scanGlass.value.height; |
| | | if (width < height) { |
| | | scanGlass.value.width = height; |
| | | scanGlass.value.height = width; |
| | | } |
| | | } |
| | | |
| | | //自动打印 |
| | |
| | | </el-date-picker> |
| | | |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectDownGlassData()">{{ |
| | | $t('reportmanage.inquire') |
| | | }} |
| | | $t('reportmanage.inquire') |
| | | }} |
| | | </el-button> |
| | | <el-table height="200px" ref="table" @selection-change="handleSelectionChange" :data="downGlass" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleaDownGlasss" top="2vh" width="97%" :title="$t('人工下片信息')"> |
| | | <div style="display:flex;justify-content: space-around;"> |
| | | <el-card style="display: flex; justify-content: center; align-items: center; width:800px; height: 800px;position: relative;"> |
| | | <el-card |
| | | style="display: flex; justify-content: center; align-items: center; width:800px; height: 800px;position: relative;"> |
| | | <div |
| | | :style="{ width: takeGlass.width + 'px', height: takeGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (takeGlass.width > takeGlass.height ? takeGlass.width : takeGlass.height) + ')' }"> |
| | | |
| | | :style="{ width: takeGlass.width + 'px', height: takeGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (takeGlass.width > takeGlass.height ? takeGlass.width : takeGlass.height) + ')' }"> |
| | | |
| | | </div> |
| | | <div style="font-size: 50px; text-align: center;position: absolute;top:0px;left:200px;"> |
| | | <div>人工下片当前玻璃信息</div> |
| | | <div>{{ takeGlass.flowCardId }}</div> |
| | | <div>{{ takeGlass.layer }}</div> |
| | | <div>{{ takeGlass.glassId }}</div> |
| | | <div>{{ takeGlass.width }}</div> |
| | | <div>{{ takeGlass.height }}</div> |
| | | </div> |
| | | <div style="font-size: 50px; text-align: center;position: absolute;top:0px;left:170px;"> |
| | | <div>人工下片当前玻璃信息</div> |
| | | <div>{{ takeGlass.flowCardId }}</div> |
| | | <div>{{ takeGlass.layer }}</div> |
| | | <div>{{ takeGlass.glassId }}</div> |
| | | <div>{{ takeGlass.width }}</div> |
| | | <div>{{ takeGlass.height }}</div> |
| | | </div> |
| | | </el-card> |
| | | <el-card style="display: flex; justify-content: center; align-items: center; width: 800px; height: 800px;position: relative;"> |
| | | <el-card |
| | | style="display: flex; justify-content: center; align-items: center; width: 800px; height: 800px;position: relative;"> |
| | | <div |
| | | :style="{ width: scanGlass.width + 'px', height: scanGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (scanGlass.width > scanGlass.height ? scanGlass.width : scanGlass.height) + ')' }"> |
| | | |
| | | |
| | | </div> |
| | | <div style="font-size: 50px; text-align: center;position: absolute;top:0px;left:200px;"> |
| | | <div>扫码枪当前玻璃信息</div> |
| | | <div>{{ scanGlass.flowCardId }}</div> |
| | | <div>{{ scanGlass.layer }}</div> |
| | | <div>{{ scanGlass.glassId }}</div> |
| | | <div>{{ scanGlass.width }}</div> |
| | | <div>{{ scanGlass.height }}</div> |
| | | <div>扫码枪当前玻璃信息</div> |
| | | <div>{{ scanGlass.flowCardId }}</div> |
| | | <div>{{ scanGlass.layer }}</div> |
| | | <div>{{ scanGlass.glassId }}</div> |
| | | <div>{{ scanGlass.width }}</div> |
| | | <div>{{ scanGlass.height }}</div> |
| | | |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | package com.mes.damage.controller; |
| | | |
| | | |
| | | 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 org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | int type =Integer.parseInt(map.get("type").toString()); |
| | | int status =Integer.parseInt(map.get("status").toString()); |
| | | String workingProcedure =map.get("workingProcedure").toString(); |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedure)); |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type, workingProcedure)); |
| | | } |
| | | |
| | | @ApiOperation("报工") |
| | |
| | | package com.mes.damage.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.entity.DamagePrint; |
| | | import com.mes.pp.entity.ReportingWork; |
| | | import com.mes.pp.entity.ReportingWorkDetail; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface DamageService extends MPJBaseService<Damage> { |
| | | |
| | | List<Damage> selectDamage(String startTime, String endTime, int type, int status, String workingProcedure); |
| | | List<Damage> selectDamage(String startTime, String endTime, int type, String workingProcedure); |
| | | |
| | | void submitDamage(List<Damage> damageList); |
| | | |
| | | void submitReport(Damage damage); |
| | | |
| | | /** |
| | | * 单个破损 |
| | |
| | | List<DamagePrint> selectDamagePrintDetails(Damage damage); |
| | | |
| | | void deleteByGlassId(String glassId); |
| | | |
| | | void sendToERP(ReportingWork reportingWork, List<ReportingWorkDetail> reportingWorkDetails); |
| | | } |
| | |
| | | package com.mes.damage.service.impl; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.common.config.Const; |
| | |
| | | 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.pp.entity.ReportingWorkDetail; |
| | | 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.io.BufferedReader; |
| | | import java.io.InputStreamReader; |
| | | import java.io.OutputStream; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | GlassInfoMapper glassInfoMapper; |
| | | @Resource |
| | | WorkAssignmentMapper workAssignmentMapper; |
| | | @Autowired |
| | | private DamageMapper damageMapper; |
| | | |
| | | /** |
| | | * 查询报工信息 |
| | |
| | | public void submitDamage(List<Damage> damageList) { |
| | | Map<String, List<Damage>> firstMap = damageList.stream().collect(Collectors.groupingBy(e -> e.getProcessId() + ":" |
| | | + e.getWorkingProcedure() + ":" + e.getDeviceName() + ":" + e.getTeamsGroupsName())); |
| | | |
| | | for (Map.Entry<String, List<Damage>> entry : firstMap.entrySet()) { |
| | | ReportingWork reportingWork = new ReportingWork(); |
| | | List<ReportingWorkDetail> reportingWorkDetails = new ArrayList<>(); |
| | | String key = entry.getKey(); |
| | | List<Damage> damages = entry.getValue(); |
| | | for (Damage damage:damages |
| | | ) { |
| | | reportingWork.setOrderId(damage.getProcessId().substring(0, 10)); |
| | | reportingWork.setProductionId(damage.getProcessId().substring(0,11)); |
| | | reportingWork.setProcessId(damage.getProcessId()+"/"+damage.getTechnologyNumber()); |
| | | reportingWork.setDeviceName(damage.getDeviceName()); |
| | | reportingWork.setThisProcess(damage.getWorkingProcedure()); |
| | | reportingWork.setThisCompletedQuantity(1); |
| | | reportingWork.setThisWornQuantity(0); |
| | | reportingWork.setClasses("早班"); |
| | | reportingWork.setReportingWorkTime(LocalDateTime.now()); |
| | | reportingWork.setTeamsGroupsName(damage.getTeamsGroupsName()); |
| | | reportingWork.setCreator("auto"); |
| | | System.out.println("Key: " + key); |
| | | } |
| | | |
| | | System.out.println("Key: " + key); |
| | | |
| | | Map<String, List<Damage>> secondMap = damageList.stream().collect(Collectors.groupingBy(e -> e.getProcessId() + ":" |
| | | + e.getWorkingProcedure() + ":" + e.getDeviceName() + ":" + e.getTeamsGroupsName())); |
| | | |
| | | for (Map.Entry<String, List<Damage>> entrys : secondMap.entrySet()) { |
| | | List<Damage> damagesdetail = entrys.getValue(); |
| | | |
| | | |
| | | for (Damage damage:damagesdetail |
| | | ) { |
| | | ReportingWorkDetail reportingWorkDetail = new ReportingWorkDetail(); |
| | | reportingWorkDetail.setTechnologyNumber(damage.getTechnologyNumber()); |
| | | reportingWorkDetail.setOrderNumber(damage.getOrderNumber()); |
| | | reportingWorkDetail.setCompletedQuantity(1); |
| | | reportingWorkDetail.setBreakageQuantity(0); |
| | | reportingWorkDetails.add(reportingWorkDetail); |
| | | |
| | | } |
| | | } |
| | | sendToERP(reportingWork,reportingWorkDetails); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void submitReport(Damage damage) { |
| | | ReportingWork reportingWork = new ReportingWork(); |
| | | reportingWork.setOrderId(damage.getProcessId().substring(0, 10)); |
| | | reportingWork.setProductionId(damage.getProcessId().substring(0,11)); |
| | | reportingWork.setProcessId(damage.getProcessId()+"/"+damage.getTechnologyNumber()); |
| | | reportingWork.setDeviceName(damage.getDeviceName()); |
| | | reportingWork.setThisProcess(damage.getWorkingProcedure()); |
| | | // reportingWork.setNextProcess("磨边"); |
| | | reportingWork.setThisCompletedQuantity(1); |
| | | reportingWork.setThisWornQuantity(0); |
| | | reportingWork.setClasses("早班"); |
| | | reportingWork.setReportingWorkTime(LocalDateTime.now()); |
| | | reportingWork.setTeamsGroupsName(damage.getTeamsGroupsName()); |
| | | reportingWork.setCreator("auto"); |
| | | |
| | | List<ReportingWorkDetail> reportingWorkDetails = new ArrayList<>(); |
| | | ReportingWorkDetail reportingWorkDetail = new ReportingWorkDetail(); |
| | | reportingWorkDetail.setTechnologyNumber(damage.getTechnologyNumber()); |
| | | reportingWorkDetail.setOrderNumber(damage.getOrderNumber()); |
| | | reportingWorkDetail.setCompletedQuantity(1); |
| | | reportingWorkDetail.setBreakageQuantity(0); |
| | | reportingWorkDetails.add(reportingWorkDetail); |
| | | sendToERP(reportingWork,reportingWorkDetails); |
| | | } |
| | | |
| | | /** |
| | |
| | | damage.setOrderNumber(glassInfo.getGlassType()); |
| | | damage.setTechnologyNumber(glassInfo.getLayer()); |
| | | damage.setDamageTime(Timestamp.valueOf(LocalDateTime.now())); |
| | | if (damage.getType() == null) { |
| | | damage.setType(1); |
| | | } |
| | | if (damage.getType() == 1) { |
| | | damage.setStatus(2); |
| | | submitReport(damage); |
| | | } |
| | | baseMapper.insert(damage); |
| | | } |
| | | |
| | |
| | | if (damage.getEngineerId() != null) { |
| | | listDamage.eq("t.engineer_id", damage.getEngineerId()); |
| | | } |
| | | return damageMapper.selectJoinList(DamagePrint.class, listDamage); |
| | | return baseMapper.selectJoinList(DamagePrint.class, listDamage); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<DamagePrint> selectDamagePrintDetails(Damage damage) { |
| | | List<DamagePrint> listDamage = damageMapper.selectJoinList(DamagePrint.class, new MPJQueryWrapper<Damage>() |
| | | List<DamagePrint> listDamage = baseMapper.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()) |
| | |
| | | .in(Damage::getType, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | public void sendToERP(ReportingWork reportingWork, List<ReportingWorkDetail> reportingWorkDetails){ |
| | | try { |
| | | // 目标系统的API URL |
| | | String url = "http://192.168.3.119:8086/reportingWork/mesSaveReportingWorkWorn"; |
| | | URL obj = new URL(url); |
| | | HttpURLConnection con = (HttpURLConnection) obj.openConnection(); |
| | | |
| | | // 设置请求方法和请求头 |
| | | con.setRequestMethod("POST"); |
| | | con.setRequestProperty("Content-Type", "application/json; utf-8"); |
| | | con.setRequestProperty("Accept", "application/json"); |
| | | con.setDoOutput(true); |
| | | |
| | | // 创建 JSON 对象 |
| | | JSONObject result = new JSONObject(); |
| | | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | // 将 ReportingWork 转换为 JSONObject |
| | | JSONObject reportingWorkJson = new JSONObject(objectMapper.writeValueAsString(reportingWork)); |
| | | reportingWorkJson.put("reportingWorkTime", reportingWork.getReportingWorkTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); |
| | | // 将 ReportingWorkDetail 列表转换为 JSONArray |
| | | JSONArray detailsJsonArray = new JSONArray(objectMapper.writeValueAsString(reportingWorkDetails)); |
| | | |
| | | // 将 JSON 对象和数组添加到结果对象中 |
| | | result.put("title", reportingWorkJson); |
| | | result.put("detail", detailsJsonArray); |
| | | result.put("type", 0); |
| | | result.put("userId", "admin"); |
| | | result.put("userName", "admin"); |
| | | result.put("qualityInsStatus", 0); |
| | | |
| | | // 将 result 对象转换为字符串 |
| | | String jsonInputString = result.toString(); |
| | | System.out.println("jsonInputString : " + result); |
| | | // 发送请求 |
| | | try (OutputStream os = con.getOutputStream()) { |
| | | byte[] input = jsonInputString.getBytes("utf-8"); |
| | | os.write(input, 0, input.length); |
| | | } |
| | | |
| | | // 获取响应码 |
| | | int responseCode = con.getResponseCode(); |
| | | System.out.println("Response Code : " + responseCode); |
| | | |
| | | // 获取响应内容 |
| | | try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream(), "utf-8"))) { |
| | | StringBuilder response = new StringBuilder(); |
| | | String inputLine; |
| | | while ((inputLine = in.readLine()) != null) { |
| | | response.append(inputLine); |
| | | } |
| | | System.out.println("Response Body: " + response.toString()); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | /** |
| | | * 建立时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | |
| | | gc.setOutputDir("D:\\Documents\\hangzhoumesParent5\\"); |
| | | |
| | | gc.setServiceName("%sService"); //去掉Service接口的首字母I |
| | | gc.setAuthor("wu"); |
| | | gc.setAuthor("wf"); |
| | | gc.setOpen(false); |
| | | mpg.setGlobalConfig(gc); |
| | | |
| | | // 3、数据源配置 |
| | | DataSourceConfig dsc = new DataSourceConfig(); |
| | | dsc.setUrl("jdbc:mysql://localhost:3306/pp?serverTimezone=GMT%2b8"); |
| | | dsc.setUrl("jdbc:mysql://10.153.19.150:3306/yiwumes?serverTimezone=GMT%2b8"); |
| | | dsc.setDriverName("com.mysql.cj.jdbc.Driver"); |
| | | dsc.setUsername("root"); |
| | | dsc.setPassword("beibo.123/"); |
| | |
| | | // 4、包配置 |
| | | PackageConfig pc = new PackageConfig(); |
| | | pc.setParent("com.mes"); |
| | | pc.setModuleName("flow_card"); //模块名 |
| | | pc.setModuleName("raw_glass_storage_station"); //模块名 |
| | | pc.setController("controller"); |
| | | pc.setService("service"); |
| | | pc.setMapper("mapper"); |
| | |
| | | // 5、策略配置 |
| | | StrategyConfig strategy = new StrategyConfig(); |
| | | |
| | | strategy.setInclude("flow_card"); |
| | | // strategy.setInclude("raw_glass_storage_details"); |
| | | // strategy.setInclude("raw_glass_storage_station"); |
| | | strategy.setInclude("raw_glass_storage_station"); |
| | | |
| | | strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 |
| | | |
| | |
| | | |
| | | <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 |
| | | 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 |
| | | <if test="technologyNumber != 0"> |
| | | ,fc.technology_number |
| | | </if> |
| | | 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 |
| | | 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} |
| | | <if test="technologyNumber != 0"> |
| | | and a.layer = #{technologyNumber} |
| | | </if> |
| | | <if test="technologyNumber != 0"> |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | </if> |
| | | <if test="technologyNumber != 0"> |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | </if> |
| | | <if test="technologyNumber == 0"> |
| | | group by fc.process_id, fc.order_number |
| | | </if> |
| | | 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 , |
| | | (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 , |
| | | (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 |
| | | 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 |
| | |
| | | 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) |
| | | 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 |
| | |
| | | Map<String, Damage> damageMaps=damageMapper.selectList(new MPJLambdaQueryWrapper<Damage>() |
| | | .selectAll(Damage.class) |
| | | .eq(Damage::getEngineerId,upPattenUsage1.getEngineeringId()) |
| | | .and(wrapper->wrapper.eq(Damage::getType,8) |
| | | .or() |
| | | .eq(Damage::getType,9)) |
| | | ).stream().collect(Collectors.toMap(Damage::getGlassId,Damage->Damage,(V1,V2)->V2)); |
| | | |
| | | List<Map<String, Object>> resultCutTerritory=new ArrayList<>(); |
| | |
| | | Map<String, Damage> damageMaps=damageMapper.selectList(new MPJLambdaQueryWrapper<Damage>() |
| | | .selectAll(Damage.class) |
| | | .eq(Damage::getEngineerId,current) |
| | | .and(wrapper->wrapper.eq(Damage::getType,8) |
| | | .or() |
| | | .eq(Damage::getType,9)) |
| | | ).stream().collect(Collectors.toMap(Damage::getGlassId,Damage->Damage,(V1,V2)->V2)); |
| | | |
| | | for (Map<String, Object> item : cutTerritory) { |
| | |
| | | |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1); |
| | | log.info("7、发送确认字完成"); |
| | | |
| | | Damage damage=new Damage(); |
| | | damage.setGlassId(glassInfo.getGlassId()); |
| | | damage.setWorkingProcedure("切割"); |
| | | damage.setLine(1001); |
| | | damage.setType(1); |
| | | damage.setRemark("进卧式理片"); |
| | | damageService.insertDamage(damage); |
| | | |
| | | } |
| | | |
| | |
| | | log.info("7、添加出片玻璃尺寸信息到磨边前玻璃表是否完成:{}", glassSizeStatus); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1); |
| | | log.info("8、发送确认字已完成"); |
| | | Damage damage=new Damage(); |
| | | damage.setGlassId(glassInfo.getGlassId()); |
| | | damage.setWorkingProcedure("切割"); |
| | | damage.setLine(1001); |
| | | damage.setType(1); |
| | | damage.setRemark("进卧式理片"); |
| | | damageService.insertDamage(damage); |
| | | return Boolean.TRUE; |
| | | } |
| | | return Boolean.FALSE; |
| | |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | | //log.info("本次识别版图{},++++{}",engineerId,currentCutTerritorys); |
| | | //磨边信息 |
| | | List<EdgGlassTaskInfo> edgTasks = edgGlassTaskInfoService.selectEdgInfo(); |
| | | jsonObject.append("edgTasks", edgTasks); |
| | | |
| | | //卧室缓存笼内信息 |
| | | List<Map<String, Object>> EdgStorageCageinfos = edgStorageCageService.selectEdgStorageCages(); |
| | | jsonObject.append("EdgStorageCageinfos", EdgStorageCageinfos); |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void CacheGlassTaskss() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //log.info("本次识别版图{},++++{}",engineerId,currentCutTerritorys); |
| | | //磨边信息 |
| | | List<EdgGlassTaskInfo> edgTasks = edgGlassTaskInfoService.selectEdgInfo(); |
| | | jsonObject.append("edgTasks", edgTasks); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("edgTasks"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("edgTasks is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | damage.setGlassId(bigStorageCageDetails.getGlassId()); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setWorkingProcedure("钢化"); |
| | | damage.setLine(3001); |
| | | damage.setRemark("大理片笼破损"); |
| | | damage.setStatus(2); |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: dev |
| | | application: |
| | | name: cacheVerticalGlass |
| | | liquibase: |
| | | enabled: false |
| | | 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 |
| | |
| | | package com.mes; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | public void ca(){ |
| | | try { |
| | | // 目标系统的API URL |
| | | String url = "http://192.168.3.119:8086/reportingWork/mesSave"; |
| | | String url = "http://192.168.3.119:8086/reportingWork/mesSaveReportingWorkWorn"; |
| | | URL obj = new URL(url); |
| | | HttpURLConnection con = (HttpURLConnection) obj.openConnection(); |
| | | |
| | |
| | | con.setRequestProperty("Accept", "application/json"); |
| | | con.setDoOutput(true); |
| | | |
| | | // 创建消息体 |
| | | String jsonInputString = "小廖"; |
| | | ReportingWork reportingWork=new ReportingWork(); |
| | | // 创建 JSON 对象 |
| | | JSONObject result = new JSONObject(); |
| | | |
| | | ReportingWork reportingWork = new ReportingWork(); |
| | | reportingWork.setOrderId("NG24042301"); |
| | | reportingWork.setProductionId("NG24042301A"); |
| | | reportingWork.setProcessId("NG24042301A001"); |
| | |
| | | reportingWork.setTeamsGroupsName("小廖一号"); |
| | | reportingWork.setCreator("小廖"); |
| | | |
| | | ReportingWorkDetail reportingWorkDetail=new ReportingWorkDetail(); |
| | | List<ReportingWorkDetail> reportingWorkDetails = new ArrayList<>(); |
| | | ReportingWorkDetail reportingWorkDetail = new ReportingWorkDetail(); |
| | | reportingWorkDetail.setTechnologyNumber(1); |
| | | reportingWorkDetail.setOrderNumber(1); |
| | | reportingWorkDetail.setCompletedQuantity(1); |
| | | reportingWorkDetail.setBreakageQuantity(0); |
| | | reportingWorkDetails.add(reportingWorkDetail); |
| | | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | // 将 ReportingWork 转换为 JSONObject |
| | | JSONObject reportingWorkJson = new JSONObject(objectMapper.writeValueAsString(reportingWork)); |
| | | reportingWorkJson.put("reportingWorkTime", reportingWork.getReportingWorkTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); |
| | | // 将 ReportingWorkDetail 列表转换为 JSONArray |
| | | JSONArray detailsJsonArray = new JSONArray(objectMapper.writeValueAsString(reportingWorkDetails)); |
| | | |
| | | // 将 JSON 对象和数组添加到结果对象中 |
| | | result.put("title", reportingWorkJson); |
| | | result.put("detail", detailsJsonArray); |
| | | result.put("type", 0); |
| | | result.put("userId", "admin"); |
| | | result.put("userName", "admin"); |
| | | result.put("qualityInsStatus", 0); |
| | | |
| | | // 将 result 对象转换为字符串 |
| | | String jsonInputString = result.toString(); |
| | | System.out.println("jsonInputString : " + result); |
| | | // 发送请求 |
| | | try (OutputStream os = con.getOutputStream()) { |
| | | byte[] input = jsonInputString.getBytes("utf-8"); |
| | |
| | | // 获取响应码 |
| | | int responseCode = con.getResponseCode(); |
| | | System.out.println("Response Code : " + responseCode); |
| | | |
| | | // 获取响应内容 |
| | | try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream(), "utf-8"))) { |
| | | StringBuilder response = new StringBuilder(); |
| | |
| | | JSONObject jsonObject = new JSONObject();
|
| | | List<RawGlassStorageDetails> rack = rawGlassStorageDetailsService.list();
|
| | | List<RawGlassStorageStation> state = rawGlassStorageStationService.list();
|
| | | List<RawGlassStorageTask> tasks = rawGlassStorageTaskService.list();
|
| | |
|
| | | //List<RawGlassStorageTask> tasks = rawGlassStorageTaskService.list();
|
| | | List<RawGlassStorageTask> tasks = rawGlassStorageTaskService.findAll();
|
| | | jsonObject.append("rack",rack);
|
| | | jsonObject.append("state",state);
|
| | | jsonObject.append("tasks",tasks);
|
| | |
| | | package com.mes.rawglassdetails.controller; |
| | | |
| | | |
| | | import com.mes.entity.request.GeneralRequest; |
| | | import com.mes.menu.entity.SysMenu; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("新增入库") |
| | | @PostMapping("/save") |
| | | public Result save(@Validated @RequestBody RawGlassStorageDetails rawGlassStorageDetails) { |
| | | // rawGlassStorageDetailsService.save(rawGlassStorageDetails); |
| | | // GeneralRequest request=new GeneralRequest(); |
| | | return Result.success(); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.mes.rawglasstask.controller; |
| | | |
| | | |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.entity.request.RawGlassTaskRequest; |
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | private RawGlassStorageTaskService rwService; //这里是你定义调用的service,这个是报工的 |
| | | @ApiOperation("原片仓储数据查询") |
| | | @PostMapping("/selectRawglasstask") |
| | | public Result selectDamage(@RequestBody RawGlassStorageTask rw) { |
| | | return Result.build(200,"查询成功", rwService.selectTasking(rw)); |
| | | public Result selectDamage(@RequestBody RawGlassTaskRequest rw) { |
| | | return Result.build(200,"查询成功", rwService.setRawGlassTaskRequest(rw)); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.rawglasstask.entity.request; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class RawGlassTaskRequest { |
| | | |
| | | /** |
| | | * 任务类型 1 入库 2 出库 3 调度 |
| | | */ |
| | | private List<Integer> enableState; |
| | | /** |
| | | * 任务状态 1 新建 2 执行中 3 完成 |
| | | */ |
| | | private List<Integer> enableType; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date patternQuantity; |
| | | |
| | | } |
| | |
| | | package com.mes.rawglasstask.service; |
| | | |
| | | import com.mes.rawglassstation.entity.RawGlassStorageStation; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.entity.request.RawGlassTaskRequest; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wf |
| | | * @since 2024-09-10 |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | public interface RawGlassStorageTaskService extends IService<RawGlassStorageTask> { |
| | | List<RawGlassStorageTask> selectTasks(); |
| | | |
| | | List<RawGlassStorageTask> findAll(); |
| | | String setRawGlassTaskRequest(RawGlassTaskRequest request); |
| | | |
| | | List<RawGlassStorageTask> selectTask(); |
| | | List<RawGlassStorageTask> selectTasking(RawGlassStorageTask rawGlassStorageTask); |
| | | boolean updateRawGlassStorageTask(String originate_slot); |
| | | boolean deleteRawGlassStorageTask(String id); |
| | | boolean insertRawGlassStorageTask(RawGlassStorageTask rw); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.pp.entity.request.Reportingdamage; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.entity.request.RawGlassTaskRequest; |
| | | import com.mes.rawglasstask.mapper.RawGlassStorageTaskMapper; |
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Service |
| | | @Slf4j |
| | | public class RawGlassRawGlassStorageTaskServiceImpl extends ServiceImpl<RawGlassStorageTaskMapper, RawGlassStorageTask> implements RawGlassStorageTaskService { |
| | | |
| | | |
| | | @Autowired |
| | | RedisUtil redisUtil; |
| | | |
| | | @Override |
| | | public List<RawGlassStorageTask> findAll() { |
| | | RawGlassTaskRequest request = redisUtil.getCacheObject("rawGlassTaskRequest"); |
| | | if (null == request) { |
| | | request = new RawGlassTaskRequest(); |
| | | //设置默认时间 startDate:开始时间 endDate:结束时间 |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date startDate=null; |
| | | Date endDate=null; |
| | | try { |
| | | startDate= df.parse("2022-01-01"); |
| | | endDate= df.parse("2025-01-01"); |
| | | }catch (ParseException e){ |
| | | e.printStackTrace(); |
| | | } |
| | | request.setCreateTime(startDate);// |
| | | request.setPatternQuantity(endDate); |
| | | //return null; |
| | | } |
| | | |
| | | QueryWrapper<RawGlassStorageTask> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.ge("create_time", request.getCreateTime())//大于时间 |
| | | .le("create_time",request.getPatternQuantity());//小于时间 |
| | | // .orderByDesc("enable_id");//排序字段 |
| | | if(!request.getEnableType().isEmpty()&&request.getEnableType().size()>0){ |
| | | queryWrapper.eq("enable_type", request.getEnableType().get(0)); |
| | | }if(!request.getEnableState().isEmpty()&&request.getEnableState().size()>0){ |
| | | queryWrapper.eq("enable_state", request.getEnableState().get(0)); |
| | | } |
| | | |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public String setRawGlassTaskRequest(RawGlassTaskRequest request) { |
| | | if (request == null) { |
| | | redisUtil.deleteObject("rawGlassTaskRequest"); |
| | | } else { |
| | | redisUtil.setCacheObject("rawGlassTaskRequest", request); |
| | | } |
| | | log.info("前端传入参数:{}",request); |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public List<RawGlassStorageTask> selectTask() { |
| | | return list(); |
| | |
| | | import com.mes.GlassStorageApplication; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.entity.request.RawGlassTaskRequest; |
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService; |
| | | import com.mes.rawusage.entity.RawUsage; |
| | | import com.mes.rawusage.service.RawUsageService; |
| | | import com.mes.shelfrack.service.ShelfRackService; |
| | |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private RawUsageService rawUsageService; |
| | | @Autowired |
| | | private RawGlassStorageDetailsService rawGlassStorageDetailsService; |
| | | |
| | | private RawGlassStorageDetailsService rawGlassStorageDetailsService; |
| | | @Autowired |
| | | private RawGlassStorageTaskService rawGlassStorageTaskService; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | |
| | | shelfRackService.selectshelf_rack(); |
| | | } |
| | | |
| | | /** |
| | | * 测试 |
| | | */ |
| | | @Test |
| | | public void testWebSocket() { |
| | | List<RawGlassStorageTask> list=rawGlassStorageTaskService.findAll(); |
| | | log.info("返回内容:{}",list); |
| | | } |
| | | |
| | | /** |
| | | * 测试修改WebSocket 参数 |
| | | */ |
| | | @Test |
| | | public void testWebSocketArgument() { |
| | | RawGlassTaskRequest request=new RawGlassTaskRequest(); |
| | | //设置参数: |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date startDate=null; |
| | | Date endDate=null; |
| | | try { |
| | | startDate= df.parse("2022-01-01"); |
| | | endDate= df.parse("2025-01-01"); |
| | | }catch (ParseException e){ |
| | | e.printStackTrace(); |
| | | |
| | | request.setCreateTime(startDate);// |
| | | request.setPatternQuantity(endDate); |
| | | request.setEnableState(new ArrayList<Integer>()); |
| | | request.setEnableType(new ArrayList<Integer>()); |
| | | String list=rawGlassStorageTaskService.setRawGlassTaskRequest(request); |
| | | log.info("返回内容:{}",list); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Test |
| | |
| | | @ApiOperation("//钢化破损拿走放回") |
| | | @PostMapping("/updateTemperingState") //钢化后显示出炉的版图信息 |
| | | public Result <Integer> updateTemperingState(@RequestBody Damage damage) { |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | temperingGlassInfo.setState(damage.getStatus()); |
| | | temperingGlassInfo.setGlassId(damage.getGlassId()); |
| | | int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); |
| | | if(damage.getStatus()>5) { |
| | | damage.setType(damage.getStatus()); |
| | | damage.setStatus(1); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | temperingGlassInfo.setState(damage.getType()); |
| | | temperingGlassInfo.setGlassId(damage.getGlassId()); |
| | | int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); |
| | | return Result.build(200, "破损成功", result); |
| | | } |
| | | |
| | |
| | | port: 8084 |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | active: prod |
| | | application: |
| | | name: temperingGlass |
| | | liquibase: |
| | |
| | | |
| | | @Override |
| | | public List<DownWorkstation> queryWorkStationIsFull() { |
| | | |
| | | //查询可以落架的玻璃信息且已绑定流程卡的工位信息 |
| | | List<DownWorkstation> list = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getEnableState, Const.SLOT_ON) |
| | | .isNotNull(DownWorkstation::getFlowCardId).ne(DownWorkstation::getFlowCardId, "")); |
| | |
| | | //可以落架的玻璃信息且已绑定流程卡的所有的工位 - 玻璃未满流程卡及层数的工位 = 已满工位 |
| | | workstationFull = list.stream().filter(item -> !flowCardIdList.contains(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | //是否需要将已满的工位置为不可落架 |
| | | if (CollectionUtils.isNotEmpty(workstationFull)) { |
| | | List<Integer> workstationIds = workstationFull.stream().map(DownWorkstation::getWorkstationId).collect(Collectors.toList()); |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getEnableState, Const.SLOT_OFF) |
| | | .in(DownWorkstation::getWorkstationId, workstationIds)); |
| | | } |
| | | // if (CollectionUtils.isNotEmpty(workstationFull)) { |
| | | // List<Integer> workstationIds = workstationFull.stream().map(DownWorkstation::getWorkstationId).collect(Collectors.toList()); |
| | | // downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getEnableState, Const.SLOT_OFF) |
| | | // .in(DownWorkstation::getWorkstationId, workstationIds)); |
| | | // } |
| | | } |
| | | return workstationFull; |
| | | } |
| | |
| | | log.info("打印参数:{}", downGlassInfo); |
| | | QueryWrapper<DownGlassInfo> queryWrapper = Wrappers.query(); |
| | | queryWrapper.eq("flow_card_id", downGlassInfo.getFlowCardId()) |
| | | .eq("layer", downGlassInfo.getLayer()) |
| | | .select("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity") |
| | | .groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "id") |
| | | .orderByAsc("id"); |
| | | int printLayer = 1; |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | queryWrapper.select("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity"); |
| | | queryWrapper.groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "id"); |
| | | queryWrapper.eq("layer", downGlassInfo.getLayer()); |
| | | printLayer = downGlassInfo.getLayer(); |
| | | } else { |
| | | queryWrapper.select("flow_card_id", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity"); |
| | | queryWrapper.groupBy("flow_card_id", "width", "height", "filmsid", "thickness", "glass_type", "id"); |
| | | } |
| | | List<Map<String, Object>> resultList = baseMapper.selectMaps(queryWrapper); |
| | | |
| | | log.info("MES落架数据:{}", resultList); |
| | | |
| | | List<Map<String, Object>> projectInfo = flowCardService.selectProject(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | List<Map<String, Object>> projectInfo = flowCardService.selectProject(downGlassInfo.getFlowCardId(), printLayer); |
| | | log.info("流程卡头部数据:{}", projectInfo); |
| | | List<Map<String, Object>> flowCardInfo = flowCardService.selectFlowCard(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | log.info("流程卡玻璃数据:{}", flowCardInfo); |
| | | for (Map<String, Object> row : flowCardInfo) { |
| | | int order_number = (int) row.get("order_number"); |
| | | int technology_number = (int) row.get("technology_number"); |
| | | |
| | | int quantity1 = 0; |
| | | for (Map<String, Object> row1 : resultList) { |
| | | int glass_type = (int) row1.get("glass_type"); |
| | | int layer = (int) row1.get("layer"); |
| | | // String child_width = (String) row1.get("child_width"); |
| | | // Long quantity = (Long) row1.get("quantity"); |
| | | // BigDecimal total_area = (BigDecimal) row1.get("total_area"); |
| | | // String separation = (String) row1.get("separation"); |
| | | // String perimeter = (String) row1.get("perimeter"); |
| | | // BigDecimal width = (BigDecimal) row1.get("width"); |
| | | // String other_columns = (String) row1.get("other_columns"); |
| | | // String remarks = (String) row1.get("remarks"); |
| | | // BigDecimal height = (BigDecimal) row1.get("height"); |
| | | if (order_number == glass_type && technology_number == layer) { |
| | | quantity1 += 1; |
| | | // row.put("quantity", quantity); |
| | | // row.put("order_number", order_number); |
| | | // row.put("technology_number", technology_number); |
| | | // row.put("child_width", child_width); |
| | | // row.put("total_area", total_area); |
| | | // row.put("separation", separation); |
| | | // row.put("perimeter", perimeter); |
| | | // row.put("width", width); |
| | | // row.put("other_columns", other_columns); |
| | | // row.put("remarks", remarks); |
| | | // row.put("height", height); |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | int layer = (int) row1.get("layer"); |
| | | int technology_number = (int) row.get("technology_number"); |
| | | if (order_number == glass_type && technology_number == layer) { |
| | | quantity1 += 1; |
| | | } |
| | | } else { |
| | | if (order_number == glass_type) { |
| | | quantity1 += 1; |
| | | } |
| | | } |
| | | } |
| | | row.put("quantity1", quantity1); |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> downGlassLabelPrint(DownGlassInfo downGlassInfo) { |
| | | //获取下片玻璃的顺序 |
| | | // QueryWrapper<DownGlassInfo> queryWrapper = Wrappers.query(); |
| | | // queryWrapper |
| | | // .eq("flow_card_id", downGlassInfo.getFlowCardId()) |
| | | // .eq("layer", downGlassInfo.getLayer()) |
| | | // .select("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity") |
| | | // .groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "id") |
| | | // .orderByAsc("id"); |
| | | // List<Map<String, Object>> resultList = baseMapper.selectMaps(queryWrapper); |
| | | |
| | | List<Map<String, Object>> resultList = baseMapper.downGlassLabelPrint(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | log.info("MES落架数据:{}", resultList); |
| | | //获取ERP标签所需的信息 |
| | | List<Map<String, Object>> labelInfo = flowCardService.selectLabel(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | List<Map<String, Object>> labelInfo; |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | labelInfo = flowCardService.selectLabel(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | } else { |
| | | labelInfo = flowCardService.selectLabel(downGlassInfo.getFlowCardId(), 1); |
| | | } |
| | | log.info("标签数据:{}", labelInfo); |
| | | |
| | | for (Map<String, Object> row : resultList) { |
| | |
| | | for (Map<String, Object> row1 : labelInfo) { |
| | | int orderNumber = (int) row1.get("orderNumber"); |
| | | int technologyNumber = (int) row1.get("technologyNumber"); |
| | | if (orderNumber == glass_type && technologyNumber == layer) { |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | if (orderNumber == glass_type && technologyNumber == layer) { |
| | | |
| | | String order_id = (String) row1.get("order_id"); |
| | | String project = (String) row1.get("project"); |
| | | Long customer_id = (Long) row1.get("customer_id"); |
| | | BigDecimal width = (BigDecimal) row1.get("width"); |
| | | BigDecimal height = (BigDecimal) row1.get("height"); |
| | | Long quantity = (Long) row1.get("quantity"); |
| | | String glass_child = (String) row1.get("glass_child"); |
| | | String process = (String) row1.get("process"); |
| | | String customer_name = (String) row1.get("customer_name"); |
| | | String processing_note = (String) row1.get("processing_note"); |
| | | String other_colunmns = (String) row1.get("other_colunmns"); |
| | | String building_number = (String) row1.get("building_number"); |
| | | String bend_radius = (String) row1.get("bend_radius"); |
| | | String order_id = (String) row1.get("order_id"); |
| | | String project = (String) row1.get("project"); |
| | | Long customer_id = (Long) row1.get("customer_id"); |
| | | BigDecimal width = (BigDecimal) row1.get("width"); |
| | | BigDecimal height = (BigDecimal) row1.get("height"); |
| | | Long quantity = (Long) row1.get("quantity"); |
| | | String glass_child = (String) row1.get("glass_child"); |
| | | String process = (String) row1.get("process"); |
| | | String customer_name = (String) row1.get("customer_name"); |
| | | String processing_note = (String) row1.get("processing_note"); |
| | | String other_colunmns = (String) row1.get("other_colunmns"); |
| | | String building_number = (String) row1.get("building_number"); |
| | | String bend_radius = (String) row1.get("bend_radius"); |
| | | |
| | | row.put("orderNumber", orderNumber); |
| | | row.put("technology_number", technologyNumber); |
| | | row.put("order_id", order_id); |
| | | row.put("project", project); |
| | | row.put("customer_id", customer_id); |
| | | row.put("width", width); |
| | | row.put("height", height); |
| | | row.put("quantity", quantity); |
| | | row.put("glass_child", glass_child); |
| | | row.put("process", process); |
| | | row.put("customer_name", customer_name); |
| | | row.put("processing_note", processing_note); |
| | | row.put("other_colunmns", other_colunmns); |
| | | row.put("building_number", building_number); |
| | | row.put("bend_radius", bend_radius); |
| | | row.put("orderNumber", orderNumber); |
| | | row.put("technology_number", technologyNumber); |
| | | row.put("order_id", order_id); |
| | | row.put("project", project); |
| | | row.put("customer_id", customer_id); |
| | | row.put("width", width); |
| | | row.put("height", height); |
| | | row.put("quantity", quantity); |
| | | row.put("glass_child", glass_child); |
| | | row.put("process", process); |
| | | row.put("customer_name", customer_name); |
| | | row.put("processing_note", processing_note); |
| | | row.put("other_colunmns", other_colunmns); |
| | | row.put("building_number", building_number); |
| | | row.put("bend_radius", bend_radius); |
| | | } |
| | | } else { |
| | | if (orderNumber == glass_type) { |
| | | |
| | | String order_id = (String) row1.get("order_id"); |
| | | String project = (String) row1.get("project"); |
| | | Long customer_id = (Long) row1.get("customer_id"); |
| | | BigDecimal width = (BigDecimal) row1.get("width"); |
| | | BigDecimal height = (BigDecimal) row1.get("height"); |
| | | Long quantity = (Long) row1.get("quantity"); |
| | | String glass_child = (String) row1.get("glass_child"); |
| | | String process = (String) row1.get("process"); |
| | | String customer_name = (String) row1.get("customer_name"); |
| | | String processing_note = (String) row1.get("processing_note"); |
| | | String other_colunmns = (String) row1.get("other_colunmns"); |
| | | String building_number = (String) row1.get("building_number"); |
| | | String bend_radius = (String) row1.get("bend_radius"); |
| | | |
| | | row.put("orderNumber", orderNumber); |
| | | row.put("technology_number", technologyNumber); |
| | | row.put("order_id", order_id); |
| | | row.put("project", project); |
| | | row.put("customer_id", customer_id); |
| | | row.put("width", width); |
| | | row.put("height", height); |
| | | row.put("quantity", quantity); |
| | | row.put("glass_child", glass_child); |
| | | row.put("process", process); |
| | | row.put("customer_name", customer_name); |
| | | row.put("processing_note", processing_note); |
| | | row.put("other_colunmns", other_colunmns); |
| | | row.put("building_number", building_number); |
| | | row.put("bend_radius", bend_radius); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcShelfFull() { |
| | | List<DownWorkstation> list = downGlassInfoService.queryWorkStationIsFull(); |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | s7control.writeWord(plcMesObject.getPlcParameter("alarm_signal").getAddress(), 1); |
| | | }else{ |
| | | s7control.writeWord(plcMesObject.getPlcParameter("alarm_signal").getAddress(), 0); |
| | | } |
| | | } |
| | | |
| | |
| | | return Boolean.FALSE; |
| | | } |
| | | } else { |
| | | if (downStorageCageDetails.getWidth() > maxWidth || downStorageCageDetails.getHeight() > maxHeight) { |
| | | double firstLength = Math.max(downStorageCageDetails.getWidth(), downStorageCageDetails.getHeight()); |
| | | double secondLength = Math.min(downStorageCageDetails.getWidth(), downStorageCageDetails.getHeight()); |
| | | if (firstLength > maxWidth || secondLength > maxHeight) { |
| | | endCell = Const.G13_WORK_STATION; |
| | | } else { |
| | | DownWorkstation workstation; |
| | |
| | | .select("Top 1 *")
|
| | | .eq("end_cell", Const.G13_WORK_STATION)
|
| | | .lt("task_status", Const.UNLOAD_GLASS_DOWN)
|
| | | .orderByDesc("id")
|
| | | .orderByAsc("id")
|
| | | );
|
| | | jsonObject4.append("takeGlass", takeGlass);
|
| | | if(takeGlass!=null){
|
| | | jsonObject4.append("takeGlass", takeGlass);
|
| | | }
|
| | |
|
| | | ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (sendwServer4 != null) {
|