hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
@@ -57,7 +57,7 @@ */ public static final Integer TEMPERING_OUT_TARGET_POSITION = 930; public static final Integer ARTIFICIAL_OUT_TARGET_POSITION = 931; public static final List<Integer> OUT_TARGET_POSITION_ALL = Arrays.asList(930, 931); public static final List<Integer> OUT_TARGET_POSITION_ALL = Arrays.asList(930, 931, 932); /** * 卧式理片笼详情表玻璃状态 hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java
@@ -16,6 +16,7 @@ import com.mes.rawglasstask.entity.RawGlassStorageTask; import com.mes.rawglasstask.service.RawGlassStorageTaskService; import com.mes.tools.WebSocketServer; import com.mes.tools.WebSocketUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -42,6 +43,9 @@ @Resource private OrdersService ordersService; @Resource private WebSocketUtils webSocketUtils; @Scheduled(fixedDelay = 2000) public void sendRawGlassMessage() { log.info("发送任务信息和架子信息"); @@ -51,12 +55,7 @@ List<RawGlassStorageTask> tasks = rawGlassStorageTaskService.listRawGlassTask(); jsonObject.append("rawStationDetailsList", rawStationDetailsList); jsonObject.append("tasks", tasks); List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("rawGlass"); if (CollectionUtil.isNotEmpty(sendwServer)) { sendwServer.stream().forEach(e -> { e.sendMessage(String.valueOf(jsonObject)); }); } webSocketUtils.sendToWeb("rawGlass", jsonObject); } @Scheduled(fixedDelay = 1000) @@ -74,12 +73,6 @@ List<OrderDTO> orderDTOS = ordersService.selectOrderPercent(); jsonObject.append("orderDTOS", orderDTOS); List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen"); if (CollectionUtil.isNotEmpty(sendwServer)) { sendwServer.stream().forEach(e -> { e.sendMessage(String.valueOf(jsonObject)); }); } webSocketUtils.sendToWeb("largenScreen", jsonObject); } } hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
@@ -11,13 +11,14 @@ import com.mes.s7.entity.S7DataGHTwo; import com.mes.temperingglass.entity.TemperingGlassInfo; import com.mes.temperingglass.service.TemperingGlassInfoService; import com.mes.tools.WebSocketServer; import com.mes.tools.WebSocketUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.time.LocalDate; import java.time.ZoneId; import java.util.ArrayList; @@ -40,6 +41,8 @@ @Autowired @Qualifier("s7SerializerGHTwo") private S7Serializer s7SerializerGHTwo; @Resource private WebSocketUtils webSocketUtils; @Scheduled(fixedDelay = 1000) @@ -81,18 +84,8 @@ } catch (Exception e) { log.info("钢化前获取异常:{}", e.getMessage()); } webSocketUtils.sendToWeb("temperingGlass", jsonObject); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); if (sendwServer != null) { for (WebSocketServer webserver : sendwServer) { if (webserver != null) { webserver.sendMessage(jsonObject.toString()); } else { log.info("Home is closed"); } } } } @Scheduled(fixedDelay = 1000) @@ -101,19 +94,7 @@ //正在进行的任务 List<TemperingGlassInfo> temperingTaskType = temperingGlassInfoService.selectTaskType(); jsonObject.append("temperingTaskType", temperingTaskType); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingIsRun"); if (sendwServer != null) { for (WebSocketServer webserver : sendwServer) { if (webserver != null) { webserver.sendMessage(jsonObject.toString()); } else { log.info("Home is closed"); } } } webSocketUtils.sendToWeb("temperingIsRun", jsonObject); } @Scheduled(fixedDelay = 1000) @@ -148,21 +129,7 @@ //钢化饼图数据 List<PieChartVO> pieChartVOS = temperingGlassInfoService.queryPieChart(); jsonObject.append("pieChartVOS", pieChartVOS); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen"); 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("largenScreen is closed"); } } } webSocketUtils.sendToWeb("largenScreen", jsonObject); } hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -324,14 +324,37 @@ ), glass_info_temp AS ( SELECT gi.id, gi.glass_id, flow_card_id, engineer_id FROM ( SELECT gi.flow_card_id, gi.layer, gi.thickness, gi.filmsId FROM hollow_flow_temp hft gi.engineer_id, ROW_NUMBER() OVER ( PARTITION BY gi.flow_card_id ,gi.layer ORDER BY COUNT( gi.glass_id ) DESC ) AS rn FROM hollow_flow_temp hft INNER JOIN glass_info gi ON hft.flow_card_id = gi.flow_card_id GROUP BY gi.flow_card_id, gi.engineer_id , gi.layer ) t WHERE rn = 1 ), glass_result AS ( SELECT t1.id, t1.glass_id, t1.flow_card_id, t1.layer, t1.thickness, t1.filmsId FROM glass_info_temp t INNER JOIN glass_info t1 ON t.engineer_id = t1.engineer_id AND t.flow_card_id = t1.flow_card_id ), damage_ranked AS ( SELECT @@ -360,7 +383,7 @@ COUNT(DISTINCT t1.glass_id) as real_count, COUNT(DISTINCT t.id) - COUNT(DISTINCT t1.glass_id) as lack_count, COUNT(DISTINCT CASE WHEN t2.type IN (8,9) AND t2.status = 1 THEN t.glass_id END) as damage_count FROM glass_info_temp t FROM glass_result t LEFT JOIN hollow_details_temp t1 ON t.glass_id = t1.glass_id LEFT JOIN damage_latest t2 ON t.glass_id = t2.glass_id GROUP BY t.flow_card_id, t.layer, t.thickness, t.filmsId