From fbd31387721424c65b173cbb23b03202f3e7dce6 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期一, 12 五月 2025 21:13:47 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java
index a3c0e25..b7e9966 100644
--- a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java
+++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java
@@ -2,7 +2,16 @@
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+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;
import com.mes.rawglassstation.service.RawGlassStorageStationService;
import com.mes.rawglasstask.entity.RawGlassStorageTask;
import com.mes.rawglasstask.service.RawGlassStorageTaskService;
@@ -27,6 +36,12 @@
@Resource
private RawGlassStorageTaskService rawGlassStorageTaskService;
+ @Resource
+ private RawGlassStorageDetailsService rawGlassStorageDetailsService;
+
+ @Resource
+ private OrdersService ordersService;
+
@Scheduled(fixedDelay = 2000)
public void sendRawGlassMessage() {
log.info("鍙戦�佷换鍔′俊鎭拰鏋跺瓙淇℃伅");
@@ -43,4 +58,28 @@
});
}
}
+
+ @Scheduled(fixedDelay = 1000)
+ public void largenScreen() {
+ log.info("鍙戦�佷换鍔′俊鎭拰鏋跺瓙淇℃伅");
+ JSONObject jsonObject = new JSONObject();
+ MPJLambdaWrapper<RawGlassStorageDetails> wrapper = new MPJLambdaWrapper<>();
+ wrapper.select(RawGlassStorageStation::getSlot)
+ .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 -> {
+ e.sendMessage(String.valueOf(jsonObject));
+ });
+ }
+ }
}
--
Gitblit v1.8.0