From fcc71e5d0f0eba3f192c581fad184cee0a43ce99 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期五, 10 四月 2026 16:37:18 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/timer/WmsDataTimer.java | 86 ++++++++++++++++++++++++++++++++++++++++---
1 files changed, 80 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/zy/asrs/timer/WmsDataTimer.java b/src/main/java/com/zy/asrs/timer/WmsDataTimer.java
index 4dc9bc0..2c1b88b 100644
--- a/src/main/java/com/zy/asrs/timer/WmsDataTimer.java
+++ b/src/main/java/com/zy/asrs/timer/WmsDataTimer.java
@@ -3,7 +3,8 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.core.common.Cools;
import com.zy.asrs.entity.BasStation;
import com.zy.asrs.entity.dto.*;
import com.zy.asrs.enums.RedisKeyType;
@@ -38,7 +39,7 @@
//WMS浠诲姟鏌ヨ鎺ュ彛
@Scheduled(cron = "0/3 * * * * ? ")
public synchronized void taskQuery() {
- Config wmsTaskQueryUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsTaskQueryUrl"));
+ Config wmsTaskQueryUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsTaskQueryUrl"));
if (wmsTaskQueryUrlConfig == null) {
return;
}
@@ -49,7 +50,7 @@
try {
HashMap<String, Object> requestParam = new HashMap<>();
- List<BasStation> basStations = basStationService.selectList(new EntityWrapper<BasStation>().eq("out_enable", "Y"));
+ List<BasStation> basStations = basStationService.list(new QueryWrapper<BasStation>().eq("out_enable", "Y"));
for (BasStation basStation : basStations) {
WcsStationDto wcsStationDto = stationUtils.stationMap.get(basStation.getStationId());
if (wcsStationDto == null) {
@@ -81,13 +82,86 @@
list.add(tvWrkDetlDto);
tvWrkDetlDto.setMatnr(wrkDetl.getString("matnr"));
+ tvWrkDetlDto.setOrderNo(wrkDetl.getString("orderNo"));
+ tvWrkDetlDto.setQty(wrkDetl.getDouble("units"));
tvWrkDetlDto.setMaktx(wrkDetl.getString("maktx"));
+ tvWrkDetlDto.setLocNo(wrkDetl.getString("boxType1"));
tvWrkDetlDto.setSpecs(wrkDetl.getString("specs"));
tvWrkDetlDto.setBatch(wrkDetl.getString("batch"));
tvWrkDetlDto.setAnfme(wrkDetl.getDouble("anfme"));
+ tvWrkDetlDto.setSource(wrkDetl.getInteger("source")!=1?"杞":"杞鎶よ偆鍖呰");
}
wcsStationDto.setIoType(data.getInteger("ioType"));
+ wcsStationDto.setWrkDetls(list);
+ stationUtils.stationMap.put(wcsStationDto.getStationId(), wcsStationDto);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ //WMS鍏ュ簱浠诲姟鏌ヨ鎺ュ彛
+ @Scheduled(cron = "0/3 * * * * ? ")
+ public synchronized void inTaskQuery() {
+ Config wmsCombQueryUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsCombQueryUrl"));
+ if (wmsCombQueryUrlConfig == null) {
+ return;
+ }
+
+ String wmsCombQueryUrl = wmsCombQueryUrlConfig.getValue();
+
+ String response = null;
+ try {
+ HashMap<String, Object> requestParam = new HashMap<>();
+
+ List<BasStation> basStations = basStationService.list(new QueryWrapper<BasStation>().eq("in_enable", "Y"));
+ for (BasStation basStation : basStations) {
+ WcsStationDto wcsStationDto = stationUtils.stationMap.get(basStation.getStationId());
+ if (wcsStationDto == null) {
+ continue;
+ }
+
+ if (wcsStationDto.getAuto() != 1
+ || wcsStationDto.getLoading() != 1
+ ) {
+ continue;
+ }
+
+ if (Cools.isEmpty(wcsStationDto.getBarcode())) {
+ continue;
+ }
+
+ requestParam.put("barcode", wcsStationDto.getBarcode());
+ response = new HttpHandler.Builder()
+ .setUri(wmsCombQueryUrl)
+ .setJson(JSON.toJSONString(requestParam))
+ .setTimeout(30, TimeUnit.SECONDS)
+ .build()
+ .doPost();
+ if (response != null) {
+ JSONObject jsonObject = JSON.parseObject(response);
+ JSONObject data = jsonObject.getJSONObject("data");
+
+ List<TvWrkDetlDto> list = new ArrayList<>();
+ for (Object o : data.getJSONArray("wrkDetls")) {
+ JSONObject wrkDetl = (JSONObject) o;
+ TvWrkDetlDto tvWrkDetlDto = new TvWrkDetlDto();
+ list.add(tvWrkDetlDto);
+
+ tvWrkDetlDto.setMatnr(wrkDetl.getString("matnr"));
+ tvWrkDetlDto.setOrderNo(wrkDetl.getString("orderNo"));
+ tvWrkDetlDto.setQty(wrkDetl.getDouble("anfme"));
+ tvWrkDetlDto.setMaktx(wrkDetl.getString("maktx"));
+ tvWrkDetlDto.setLocNo(wrkDetl.getString("locNo"));
+ tvWrkDetlDto.setSpecs(wrkDetl.getString("specs"));
+ tvWrkDetlDto.setBatch(wrkDetl.getString("batch"));
+ tvWrkDetlDto.setAnfme(wrkDetl.getDouble("anfme"));
+ tvWrkDetlDto.setSource(wrkDetl.getInteger("source")!=1?"杞":"杞鎶よ偆鍖呰");
+ }
+
+ wcsStationDto.setIoType(1);
wcsStationDto.setWrkDetls(list);
stationUtils.stationMap.put(wcsStationDto.getStationId(), wcsStationDto);
}
@@ -101,7 +175,7 @@
@Synchronized
@Scheduled(cron = "0/3 * * * * ? ")
public void locQuery() {
- Config wmsUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsLocQueryUrl"));
+ Config wmsUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsLocQueryUrl"));
if (wmsUrlConfig == null) {
return;
}
@@ -147,7 +221,7 @@
@Synchronized
@Scheduled(cron = "0/3 * * * * ? ")
public void inOutLineCharts() {
- Config wmsUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsInOutLineChartsQueryUrl"));
+ Config wmsUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsInOutLineChartsQueryUrl"));
if (wmsUrlConfig == null) {
return;
}
@@ -176,7 +250,7 @@
@Synchronized
@Scheduled(cron = "0/3 * * * * ? ")
public void locDetlStatistics() {
- Config wmsUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsLocDetlStatisticsQueryUrl"));
+ Config wmsUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsLocDetlStatisticsQueryUrl"));
if (wmsUrlConfig == null) {
return;
}
--
Gitblit v1.9.1