From 7d7ad3200c9657b521abf54fef4eb0e8603ef4c1 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期一, 03 三月 2025 09:28:04 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject
---
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 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..ae005d6 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,14 @@
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.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 +34,9 @@
@Resource
private RawGlassStorageTaskService rawGlassStorageTaskService;
+ @Resource
+ private RawGlassStorageDetailsService rawGlassStorageDetailsService;
+
@Scheduled(fixedDelay = 2000)
public void sendRawGlassMessage() {
log.info("鍙戦�佷换鍔′俊鎭拰鏋跺瓙淇℃伅");
@@ -43,4 +53,24 @@
});
}
}
+
+ @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<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen");
+ if (CollectionUtil.isNotEmpty(sendwServer)) {
+ sendwServer.stream().forEach(e -> {
+ e.sendMessage(String.valueOf(jsonObject));
+ });
+ }
+ }
}
--
Gitblit v1.8.0