UI-Project/src/lang/zh.js
@@ -205,6 +205,12 @@ down:'下一页', now:'当前页显示', tit:'条数据', temperingqueries:'钢化查询', specifytempering:'指定钢化', projectnumber:'工程号', layoutnumber:'钢化版图号', numberglasses:'玻璃数量', specifytemperinga:'是否指定钢化该条信息?', }, workOrder:{ glassID:'玻璃ID', UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -12,6 +12,7 @@ const dialogFormVisible = ref(false) const dialogFormVisiblea = ref(true) const dialogFormVisibleb = ref(false) const blind = ref(false) const width = ref(); const height = ref(); const adjustedRects = ref([]); @@ -21,51 +22,137 @@ const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; const handleMessage = (data) => { // 进炉中 adjustedRects.value = data.intoGlass[0].map(rect => ({ if(data.intoGlass!=null){ adjustedRects.value = data.intoGlass[0].map(rect => { let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; let newX = rect.yCoordinate; if (rect.angle === 0) { adjustedWidth = rect.height * 0.12; adjustedHeight = rect.width * 0.1; adjustedWidtha = rect.height; adjustedHeighta = rect.width; newX = 5087 - (rect.xCoordinate + rect.height); } else { adjustedWidth = rect.width * 0.12; adjustedHeight = rect.height * 0.1; adjustedWidtha = rect.width; adjustedHeighta = rect.height; newX = 5087 - (rect.xCoordinate + rect.width); } return { ...rect, xcoordinate: rect.xCoordinate * 0.3, ycoordinate: rect.ycoordinate * 0.3, width: rect.width * 0.2, height: rect.height * 0.2, widtha: rect.width, heighta: rect.height, })); adjustedRects2.value = data.intoGlass2[0].map(rect => ({ xcoordinate: newX * 0.12, ycoordinate: rect.yCoordinate * 0.1, width: adjustedWidth, height: adjustedHeight, widtha: adjustedWidtha, heighta: adjustedHeighta, }; }); } if(data.intoGlass2!=null){ adjustedRects2.value = data.intoGlass2[0].map(rect => { let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; let newX = rect.yCoordinate; if (rect.angle === 0) { adjustedWidth = rect.height * 0.12; adjustedHeight = rect.width * 0.1; adjustedWidtha = rect.height; adjustedHeighta = rect.width; newX = 5087 - (rect.xCoordinate + rect.height); } else { adjustedWidth = rect.width * 0.12; adjustedHeight = rect.height * 0.1; adjustedWidtha = rect.width; adjustedHeighta = rect.height; newX = 5087 - (rect.xCoordinate + rect.width); } return { ...rect, xcoordinate: rect.xCoordinate * 0.3, ycoordinate: rect.ycoordinate * 0.3, width: rect.width * 0.2, height: rect.height * 0.2, widtha: rect.width, heighta: rect.height, })); console.log(data.intoGlass[0]); xcoordinate: newX * 0.12, ycoordinate: rect.yCoordinate * 0.1, width: adjustedWidth, height: adjustedHeight, widtha: adjustedWidtha, heighta: adjustedHeighta, }; }); } // 进炉前 adjustedRectsa.value = data.waitingGlass[0].map(rect => ({ ...rect, // 复制原始对象的其他属性 xcoordinate: rect.xCoordinate * 0.5, ycoordinate: rect.ycoordinate * 0.5, width: rect.width * 0.4, height: rect.height * 0.4, widtha: rect.width, heighta: rect.height, state: rect.state })); if(data.waitingGlass!=null){ adjustedRectsa.value = data.waitingGlass[0].map(rect => { let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; let newX = rect.yCoordinate; if (rect.angle === 0) { adjustedWidth = rect.width * 0.24; adjustedHeight = rect.height * 0.16; adjustedWidtha = rect.width; adjustedHeighta = rect.height; newX = 5190 - (rect.yCoordinate + rect.width); } else { adjustedWidth = rect.height * 0.24; adjustedHeight = rect.width * 0.16; adjustedWidtha = rect.height; adjustedHeighta = rect.width; newX = 5190 - (rect.yCoordinate + rect.height); } return { ...rect, x: newX * 0.24, y: rect.xCoordinate * 0.16, width: adjustedWidth, height: adjustedHeight, widtha: adjustedWidtha, heighta: adjustedHeighta, }; }); } // 已出炉 adjustedRectsb.value = data.outGlass[0].map(rect => ({ if(data.outGlass!=null){ adjustedRectsb.value = data.outGlass[0].map(rect => { let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; let newX = rect.yCoordinate; if (rect.angle === 0) { adjustedWidth = rect.width * 0.24; adjustedHeight = rect.height * 0.16; adjustedWidtha = rect.width; adjustedHeighta = rect.height; newX = 5190 - (rect.yCoordinate + rect.width); } else { adjustedWidth = rect.height * 0.24; adjustedHeight = rect.width * 0.16; adjustedWidtha = rect.height; adjustedHeighta = rect.width; newX = 5190 - (rect.yCoordinate + rect.height); } return { ...rect, // 复制原始对象的其他属性 xcoordinate: rect.xCoordinate * 0.5, ycoordinate: rect.ycoordinate * 0.5, width: rect.width * 0.4, height: rect.height * 0.4, widtha: rect.width, heighta: rect.height, state: rect.state })); x: newX * 0.24, y: rect.xCoordinate * 0.16, width: adjustedWidth, height: adjustedHeight, widtha: adjustedWidtha, heighta: adjustedHeighta, }; }); } }; onMounted(() => { initializeWebSocket(socketUrl, handleMessage); }); function getRectColor(state) { switch (state) { case 0: return '#f8e3c5'; case 1: return '#d1edc4'; case -1: return '#dedfe0'; } } function showDialog(row) { blind.value = true; } onBeforeUnmount(() => { console.log("关闭了") closeWebSocket(); @@ -79,8 +166,10 @@ <div v-if="dialogFormVisible" > <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> <div style="width: 49%;float: left;background-color: #f4f4f5;height: 550px;"> <el-scrollbar height="630px"> <div style="position: relative;width: 1400px;"> <div v-if="adjustedRects.length > 0"> <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> <el-scrollbar height="550px" style="background-color: #e9e9eb;"> <div style="position: relative;max-width: 1400px;"> <div v-for="(rect, index) in adjustedRects" :key="index" @@ -88,16 +177,20 @@ :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }" > <div class="centered-text"> <div >{{ rect.flowcardId }}</div> <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> <div >{{ rect.glassId }}</div> <div >{{ rect.flowCardId }}</div> <div>{{ rect.widtha }}*{{ rect.heighta }}</div> </div> </div> </div> </el-scrollbar> </div> </div> <div style="width: 49%;float: right;background-color: #f4f4f5;height: 550px;"> <el-scrollbar height="550px"> <div style="position: relative;width: 1400px;"> <div v-if="adjustedRects2.length > 0"> <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> <el-scrollbar height="550px" style="background-color: #e9e9eb;"> <div style="position: relative;max-width: 1400px;"> <div v-for="(rect, index) in adjustedRects2" :key="index" @@ -105,57 +198,75 @@ :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }" > <div class="centered-text"> <div >{{ rect.flowcardId }}</div> <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> <div >{{ rect.glassId }}</div> <div >{{ rect.flowCardId }}</div> <div>{{ rect.widtha }}*{{ rect.heighta }}</div> </div> </div> </div> </el-scrollbar> </div> </div> </el-card> </div> <div v-if="dialogFormVisiblea"> <!-- 进炉前 --> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> <el-scrollbar height="550px"> <div style="position: relative;width: 1400px;"> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> <div v-if="adjustedRectsa.length > 0"> <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> <!-- <div style="text-align: center;">流程卡: {{ adjustedRectsa[0].flowCardId }}</div> --> <el-scrollbar height="550px" style="background-color: #e9e9eb;"> <div style="position: relative;max-width: 1400px;"> <div v-for="(rect, index) in adjustedRectsa" :key="index" @click="showDialog" class="rect" :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, :style="{ position: 'absolute', top: `${rect.y}px`, left: `${rect.x}px`, width: `${rect.width}px`, height: `${rect.height}px`, backgroundColor: rect.state === 0 ? '#dedfe0' : '#d1edc4' }"> <div class="centered-text"> <div >{{ rect.flowcardId }}</div> <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> backgroundColor: getRectColor(rect.state) }"> <div class="centered-text"> <div>{{ rect.glassId }}</div> <div >{{ rect.flowCardId }}</div> <div>{{ rect.widtha }}*{{ rect.heighta }}</div> </div> </div> </div> </el-scrollbar> </div> </el-card> </div> <div v-if="dialogFormVisibleb"> <!-- 已出炉 --> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> <el-scrollbar height="550px"> <div style="position: relative;width: 1400px;"> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> <div v-if="adjustedRectsb.length > 0"> <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> <el-scrollbar height="550px" style="background-color: #e9e9eb;"> <div style="position: relative;max-width: 1400px;"> <div v-for="(rect, index) in adjustedRectsb" :key="index" class="rect" :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, :style="{ position: 'absolute', top: `${rect.y}px`, left: `${rect.x}px`, width: `${rect.width}px`, height: `${rect.height}px`, backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }"> <div class="centered-text"> <div >{{ rect.flowcardId }}</div> <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> <div >{{ rect.glassId }}</div> <div >{{ rect.flowCardId }}</div> <div>{{ rect.widtha }}*{{ rect.heighta }}</div> </div> </div> </div> </el-scrollbar> </div> </el-card> </div> <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;"> <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> {{ $t('order.dilapidation') }} </el-button> </el-dialog> </div> </template> <style scoped> @@ -233,9 +344,10 @@ } .centered-text { /* 设置文字居中样式 */ display: flex; /* display: flex; */ justify-content: center; align-items: center; align-items: center; height: 100%; /* 确保div占据整个矩形的高度 */ font-size: small; } </style> UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
@@ -25,20 +25,38 @@ } } const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; // 定义消息处理函数,更新 receivedData 变量 const handleMessage = (data) => { // 更新 tableData 的数据 adjustedRects.value = data.overGlass[0].map(rect => ({ ...rect, // 复制原始对象的其他属性 xcoordinate: rect.xCoordinate * 0.5, // 将x值除以3 ycoordinate: rect.ycoordinate * 0.5, width: rect.width * 0.4, height: rect.height * 0.4, widtha: rect.width, heighta: rect.height, })); console.log(adjustedRects.value); if(data.overGlass!=null){ adjustedRects.value = data.overGlass[0].map(rect => { let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; let newX = rect.yCoordinate; if (rect.angle === 0) { adjustedWidth = rect.width * 0.24; adjustedHeight = rect.height * 0.16; adjustedWidtha = rect.width; adjustedHeighta = rect.height; newX = 5190 - (rect.yCoordinate + rect.width); } else { adjustedWidth = rect.height * 0.24; adjustedHeight = rect.width * 0.16; adjustedWidtha = rect.height; adjustedHeighta = rect.width; newX = 5190 - (rect.yCoordinate + rect.height); } return { ...rect, xcoordinate: newX * 0.24, ycoordinate: rect.xCoordinate * 0.16, width: adjustedWidth, height: adjustedHeight, widtha: adjustedWidtha, heighta: adjustedHeighta, }; }); } }; onMounted(() => { // fetchFlowCardId(); @@ -55,9 +73,12 @@ <template> <div style="margin-top: 10px;"> <div> <el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> <el-scrollbar height="600px"> <div style="position: relative;width: 1400px;"> <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> <!-- <el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> --> <div v-if="adjustedRects.length > 0"> <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> <el-scrollbar height="550px" width="1200px" style="background-color: #e9e9eb;"> <div style="position: relative;"> <div v-for="(rect, index) in adjustedRects" :key="index" @@ -66,12 +87,15 @@ width: `${rect.width}px`, height: `${rect.height}px`, backgroundColor: rect.state === 4 ? '#d1edc4' : '#f8e3c5' }"> <div class="centered-text"> <div >{{ rect.flowcardId }}</div> <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> <div >{{ rect.glassId }}</div> <div >{{ rect.flowCardId }}</div> <div>{{ rect.widtha }}*{{ rect.heighta }}</div> <!-- <div style="margin-top: 25px;margin-left: -60px;">{{ rect.widtha }}*{{ rect.heighta }}</div> --> </div> </div> </div> </el-scrollbar> </div> </el-card> </div> </div> @@ -94,9 +118,10 @@ } .centered-text { /* 设置文字居中样式 */ display: flex; /* display: flex; */ justify-content: center; align-items: center; align-items: center; height: 100%; /* 确保div占据整个矩形的高度 */ font-size: small; } </style> UI-Project/src/views/Slicecage/slicecage.vue
@@ -14,7 +14,9 @@ const dialogFormVisible = ref(false) const dialogFormVisiblea = ref(false) const dialogFormVisibleb = ref(false) const dialogFormVisiblec = ref(false) const tableData = ref([]) const tableDatagh = ref([]) const tableDatab = ref([]) const tableDatac = ref([]) const tableDatad = ref([]) @@ -70,7 +72,18 @@ const cell9=ref(true); const selectedRow = ref(null); // 存储选中的行数据 onMounted(async () => { try { const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass'); if (response.code === 200) { tableDatagh.value = response.data } else { ElMessage.warning(response.msg) } } catch (error) { // console.error('Error fetching rects :', error); } }); // 当前页码和每页显示的条数 const currentPage = ref(1); const itemsPerPage = computed(() => { @@ -349,6 +362,33 @@ console.error('发生错误:', error); } }; // 指定钢化 const brokee = async(row) => { try { const confirmResult = await ElMessageBox.confirm( t('searchOrder.specifytemperinga'), t('searchOrder.prompt'), { confirmButtonText: t('searchOrder.yes'), cancelButtonText: t('searchOrder.cancel'), type: 'warning', } ); if (confirmResult === 'confirm') { const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/TemperingGlass",{ engineerId: row.engineer_id, temperingLayoutId: row.tempering_layout_id, }); if (response.code === 200) { ElMessage.success(response.message); } else { ElMessage.error(response.message); } } } catch (error) { console.error('发生错误:', error); } }; // 出片队列拿走 const brokeb = async(row) => { try { @@ -617,6 +657,7 @@ <div style="height: 600px;"> <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">{{ $t('searchOrder.cageinformation') }}</el-button> <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button> <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="dialogFormVisiblec = true">{{ $t('searchOrder.temperingqueries') }}</el-button> <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading"> <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> <el-table height="100px" ref="table" @@ -1239,6 +1280,19 @@ </el-table-column> </el-table> </el-dialog> <el-dialog v-model="dialogFormVisiblec" top="5vh" width="85%" :title="$t('searchOrder.temperingqueries')"> <el-table ref="table" style="margin-top: 20px;height: 500px;" :data="tableDatagh" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column prop="engineer_id" fixed align="center" :label="$t('searchOrder.projectnumber')" min-width="150"/> <el-table-column prop="tempering_layout_id" fixed align="center" :label="$t('searchOrder.layoutnumber')" min-width="120" /> <el-table-column prop="count" align="center" :label="$t('searchOrder.numberglasses')" min-width="150" /> <el-table-column fixed="right" :label="$t('searchOrder.operate')" align="center" width="150"> <template #default="scope"> <el-button size="mini" type="text" plain @click="brokee(scope.row)">{{ $t('searchOrder.specifytempering') }}</el-button> </template> </el-table-column> </el-table> </el-dialog> </template> <style scoped> hangzhoumesParent/common/servicebase/src/main/java/com/mes/damage/mapper/DamageMapper.java
@@ -1,5 +1,6 @@ package com.mes.damage.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.mes.damage.entity.Damage; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -11,6 +12,7 @@ * @author wu * @since 2024-06-13 */ @DS("hangzhoumes") public interface DamageMapper extends BaseMapper<Damage> { } hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java
@@ -1,5 +1,6 @@ package com.mes.glassinfo.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.github.yulichang.base.MPJBaseMapper; import com.mes.glassinfo.entity.GlassInfo; @@ -11,6 +12,7 @@ * @author wu * @since 2024-04-29 */ @DS("hangzhoumes") public interface GlassInfoMapper extends MPJBaseMapper<GlassInfo> { } hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/TemperingGlassInfoService.java
@@ -24,4 +24,7 @@ List<TemperingGlassInfo> selectLayoutId(); List<TemperingGlassInfo> selectTaskType(); Integer updateTemperingState(TemperingGlassInfo temperingGlassInfo); } hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java
@@ -30,7 +30,7 @@ //获取等待进炉中的玻璃信息 QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); //wrapper.eq("state",1); wrapper.in("state",1,0); wrapper.in("state",1,0,-1); return temperingMapper.selectList(wrapper); } @@ -86,4 +86,16 @@ .groupBy("state"); return temperingMapper.selectList(wrapper); } @Override public Integer updateTemperingState(TemperingGlassInfo temperingGlassInfo) { QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); wrapper.eq("glass_id",temperingGlassInfo.getGlassId()) .lt("state",5); if (temperingMapper.update(temperingGlassInfo,wrapper) > 0) { return 200; }else { return 100; } } } hangzhoumesParent/common/servicebase/src/main/java/com/mes/work_assignment/mapper/WorkAssignmentMapper.java
@@ -1,5 +1,6 @@ package com.mes.work_assignment.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.mes.work_assignment.entity.WorkAssignment; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -11,6 +12,7 @@ * @author wu * @since 2024-07-01 */ @DS("hangzhoumes") public interface WorkAssignmentMapper extends BaseMapper<WorkAssignment> { } hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java
@@ -121,8 +121,8 @@ @Test public void testSelectCacheEmpty() { List<EdgStorageCage> map = edgStorageCageService.selectCacheEmpty(); log.info("笼内空格:{}", Arrays.asList(map)); // List<EdgStorageCage> map = edgStorageCageService.selectCacheEmpty(); // log.info("笼内空格:{}", Arrays.asList(map)); } @Test hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
@@ -66,7 +66,7 @@ List<OptimizeUpPattenUsage> upPattenUsageList = null; if (engineeringId != null) { upPattenUsageList = optimizeProjectMapper.selectJoinList(OptimizeUpPattenUsage.class, new MPJQueryWrapper<OptimizeProject>() .select("t.project_no,t.glass_type,b.width,b.height ,REGEXP_REPLACE(t.glass_thickness,'\\D','')as glass_thickness,b.count") .select("t.project_no,t.glass_type,b.width,b.height ,REGEXP_REPLACE(t.glass_thickness,'\\D','')as glass_thickness,b.count as stockId") .leftJoin("optimize_layout b on t.project_no=b.project_no") .eq("b.project_no", engineeringId)); } hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcScreenTask.java
@@ -25,7 +25,7 @@ @Autowired private ReportingWorkService reportingWorkService; @Autowired private OptimizeProjectService optimizeProjectService; private OptimizeProjectService optimizeProjectService; @Autowired private OrdersService ordersService; /** @@ -34,45 +34,26 @@ */ @Scheduled(fixedDelay = 2000) public void screenHome(){ public void screenHome() { JSONObject jsonObject = new JSONObject(); //正在等待进片的玻璃 Reportingdamage reportingdamage = new Reportingdamage(); reportingdamage.setReportingWorkTime("2024-05-11"); //获取切割信息 reportingdamage.setThisProcess("切割"); List<Reportingdamage> cutting = reportingWorkService.selectDamage(reportingdamage); jsonObject.append("cutting", cutting); //获取磨边信息 reportingdamage.setThisProcess("磨边"); List<Reportingdamage> edging = reportingWorkService.selectDamage(reportingdamage); jsonObject.append("edging", edging); //获取钢化信息 reportingdamage.setThisProcess("钢化"); List<Reportingdamage> tempering = reportingWorkService.selectDamage(reportingdamage); jsonObject.append("tempering", tempering); //获取夹胶信息 reportingdamage.setThisProcess("夹胶"); List<Reportingdamage> doubling = reportingWorkService.selectDamage(reportingdamage); jsonObject.append("doubling", doubling); //获取中空信息 reportingdamage.setThisProcess("中空"); List<Reportingdamage> hollow = reportingWorkService.selectDamage(reportingdamage); jsonObject.append("hollow", hollow); //获取包装信息 reportingdamage.setThisProcess("包装"); List<Reportingdamage> packaging = reportingWorkService.selectDamage(reportingdamage); jsonObject.append("packaging", packaging); //扇形图各设备的加工破损数量 List<Reportingdamage> device = reportingWorkService.selectDamage(reportingdamage); jsonObject.append("device", device); //获取次破未补信息 List<AwaitingRepair>awaitingRepairs = reportingWorkService.selectAwaitingRepair(); List<AwaitingRepair> awaitingRepairs = reportingWorkService.selectAwaitingRepair(); jsonObject.append("awaitingRepairs", awaitingRepairs); //获取正在进行的工程 List<OptimizeProject>optimizeProjects= optimizeProjectService.getDoingTask(); List<OptimizeProject> optimizeProjects = optimizeProjectService.getDoingTask(); jsonObject.append("DoingTask", optimizeProjects); //获取当前订单 List<Orders>orders=ordersService.selectOrders(); List<Orders> orders = ordersService.selectOrders(); jsonObject.append("orders", orders); /*现场规划图显示*/ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("screen"); if (sendwServer != null) { for (WebSocketServer webserver : sendwServer) { hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
@@ -25,7 +25,7 @@ * fixedDelay : 上一个调用结束后再次调用的延时 */ @Scheduled(fixedDelay = 2000) @Scheduled(fixedDelay = 1000) public void temperingGlassHome(){ JSONObject jsonObject = new JSONObject(); //正在等待进片的玻璃 @@ -34,12 +34,14 @@ //获取整在炉中的两个版图id List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId(); //进炉中的玻璃 List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0).getTemperingLayoutId()); jsonObject.append("intoGlass", intoGlass); //进炉中的第二个版图 if (layoutId.size() > 1) { List<TemperingGlassInfo> intoGlass2 = temperingAgoService.selectIntoGlass(layoutId.get(1).getTemperingLayoutId()); jsonObject.append("intoGlass2", intoGlass2); if(!layoutId.isEmpty()) { List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0).getTemperingLayoutId()); jsonObject.append("intoGlass", intoGlass); //进炉中的第二个版图 if (layoutId.size() > 1) { List<TemperingGlassInfo> intoGlass2 = temperingAgoService.selectIntoGlass(layoutId.get(1).getTemperingLayoutId()); jsonObject.append("intoGlass2", intoGlass2); } } //出炉后的玻璃 List<TemperingGlassInfo> outGlass = temperingAgoService.selectOutGlass(); @@ -60,5 +62,23 @@ } } } @Scheduled(fixedDelay = 1000) public void temperingIsRun(){ JSONObject jsonObject = new JSONObject(); //正在进行的任务 List<TemperingGlassInfo>temperingTaskType=temperingAgoService.selectTaskType(); jsonObject.append("temperingTaskType", temperingTaskType); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun"); if (sendwServer != null) { for (WebSocketServer webserver : sendwServer) { if (webserver != null) { webserver.sendMessage(jsonObject.toString()); } else { log.info("Home is closed"); } } } } } hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java
@@ -1,13 +1,13 @@ package com.mes.temperingglass.controller; import com.mes.damage.entity.Damage; import com.mes.damage.service.DamageService; import com.mes.temperingglass.service.TemperingGlassInfoService; import com.mes.temperingglass.entity.TemperingGlassInfo; import com.mes.utils.Result; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -22,12 +22,14 @@ public class TemperingGlassInfoController { @Autowired private TemperingGlassInfoService temperingAgoService; private TemperingGlassInfoService temperingGlassInfoService; @Autowired private DamageService damageService; @ApiOperation("查询钢化等片中的版图信息,状态为1的为已到,状态为0的为等待中") @GetMapping("/selectWaitingGlass") // 查询钢化等片中的版图信息,状态为1的为已到,状态为0的为等待中 public Result <List<TemperingGlassInfo>> selectWaitingGlass() { List<TemperingGlassInfo> glass = temperingAgoService.selectWaitingGlass(); List<TemperingGlassInfo> glass = temperingGlassInfoService.selectWaitingGlass(); log.info("等待中的玻璃信息{}",glass); return Result.build(200, "", glass); } @@ -41,10 +43,24 @@ @ApiOperation("//钢化后显示出炉的版图信息。") @GetMapping("/selectOutGlass") //钢化后显示出炉的版图信息 public Result <List<TemperingGlassInfo>> selectOutGlass() { List<TemperingGlassInfo> glass = temperingAgoService.selectOutGlass(); List<TemperingGlassInfo> glass = temperingGlassInfoService.selectOutGlass(); log.info("钢化出炉后的玻璃信息{}",glass); return Result.build(200, "", glass); } @ApiOperation("//钢化破损") @PostMapping("/updateTemperingState") //钢化后显示出炉的版图信息 public Result <Integer> updateTemperingState(@RequestBody Damage damage) { damageService.insertDamage(damage); TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); if(damage.getStatus()==2){ temperingGlassInfo.setState(5); } temperingGlassInfo.setGlassId(damage.getGlassId()); int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); return Result.build(200, "破损成功", result); } }