| | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.order.entity.dto.OrderDTO; |
| | | import com.mes.order.service.OrdersService; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.mes.rawglassstation.entity.RawGlassStorageStation; |
| | |
| | | @Resource |
| | | private RawGlassStorageDetailsService rawGlassStorageDetailsService; |
| | | |
| | | @Resource |
| | | private OrdersService ordersService; |
| | | |
| | | @Scheduled(fixedDelay = 2000) |
| | | public void sendRawGlassMessage() { |
| | | log.info("发送任务信息和架子信息"); |
| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | MPJLambdaWrapper<RawGlassStorageDetails> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.select(RawGlassStorageStation::getSlot) |
| | | .select(RawGlassStorageDetails::getRemainQuantity) |
| | | .select("ifnull(remain_quantity, 0) as remain_quantity") |
| | | .rightJoin(RawGlassStorageStation.class, on -> on.eq(RawGlassStorageStation::getSlot, RawGlassStorageDetails::getSlot) |
| | | .eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN)) |
| | | .orderByAsc(RawGlassStorageStation::getSlot); |
| | | List<RawGlassStorageDetails> rawGlassStorageDetailList = rawGlassStorageDetailsService.list(wrapper); |
| | | jsonObject.append("rawGlassStorageDetailList", rawGlassStorageDetailList); |
| | | |
| | | List<OrderDTO> orderDTOS = ordersService.selectOrderPercent(); |
| | | jsonObject.append("orderDTOS", orderDTOS); |
| | | |
| | | List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen"); |
| | | if (CollectionUtil.isNotEmpty(sendwServer)) { |
| | | sendwServer.stream().forEach(e -> { |