| | |
| | | import com.mes.bigstorage.entity.dto.BigStorageSummaryDTO; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageTask; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageTaskVO; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageTaskService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.largenscreen.entity.PieChartVO; |
| | | import com.mes.largenscreen.entity.RunTime; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.tools.WebSocketServer; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | private GlassInfoService glassInfoService; |
| | | @Resource |
| | | private BigStorageCageTaskService bigStorageCageTaskService; |
| | | @Resource |
| | | private BigStorageCageHistoryTaskService bigStorageCageHistoryTaskService; |
| | | |
| | | @Autowired(required = false) |
| | | MiloService miloService; |
| | |
| | | BigStorageTaskVO task = new BigStorageTaskVO(); |
| | | task.setGlassId(requestWord.getValue() + ""); |
| | | int isExistCount = bigStorageCageDetailsService.count(new LambdaQueryWrapper<BigStorageCageDetails>().in(BigStorageCageDetails::getGlassId, task.getGlassId()) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)); |
| | | if (isExistCount > 0 && "0".equals(targetSlotWord.getValue())) { |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | if (isExistCount > 0) { |
| | | task.setIsSame(1); |
| | | } else { |
| | | task.setIsSame(0); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void largenScreen() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //理片笼使用情况 |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen"); |
| | | if (sendwServer != null) { |
| | | List<Map<String, Object>> bigStorageCageUsage = bigStorageCageService.selectBigStorageCageUsage(); |
| | | jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); |
| | | List<PieChartVO> pieChartVOS = bigStorageCageService.queryPieChart(); |
| | | jsonObject.append("pieChartVOS", pieChartVOS); |
| | | List<RunTime> tempRunTimes = bigStorageCageHistoryTaskService.queryRunTimes(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | jsonObject.append("tempRunTimes", tempRunTimes); |
| | | 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"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |