From 250bf364710321e064cbc06e310965a79a619983 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 07 四月 2026 13:17:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master-jxthTV
---
src/main/java/com/zy/asrs/timer/WmsDataTimer.java | 49 ++++++++++++++++++++++++++++++++++---------------
1 files changed, 34 insertions(+), 15 deletions(-)
diff --git a/src/main/java/com/zy/asrs/timer/WmsDataTimer.java b/src/main/java/com/zy/asrs/timer/WmsDataTimer.java
index be1dd03..84bf20f 100644
--- a/src/main/java/com/zy/asrs/timer/WmsDataTimer.java
+++ b/src/main/java/com/zy/asrs/timer/WmsDataTimer.java
@@ -3,7 +3,7 @@
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.*;
@@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
+import java.util.Objects;
import java.util.concurrent.TimeUnit;
@Component
@@ -39,7 +40,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;
}
@@ -50,10 +51,13 @@
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) {
+ continue;
+ }
+ if(Cools.isEmpty(wcsStationDto.getTaskNo())){
continue;
}
@@ -79,16 +83,23 @@
for (Object o : data.getJSONArray("wrkDetls")) {
JSONObject wrkDetl = (JSONObject) o;
TvWrkDetlDto tvWrkDetlDto = new TvWrkDetlDto();
- list.add(tvWrkDetlDto);
+// list.add(tvWrkDetlDto);
tvWrkDetlDto.setMatnr(wrkDetl.getString("matnr"));
tvWrkDetlDto.setMaktx(wrkDetl.getString("maktx"));
tvWrkDetlDto.setSpecs(wrkDetl.getString("specs"));
tvWrkDetlDto.setBatch(wrkDetl.getString("batch"));
tvWrkDetlDto.setAnfme(wrkDetl.getDouble("anfme"));
+ tvWrkDetlDto.setBarcode(wrkDetl.getString("zpallet"));
+ wcsStationDto.setBarcode(wrkDetl.getString("zpallet"));
+ tvWrkDetlDto.setOutboundSeq(wrkDetl.getString("supp"));
+ tvWrkDetlDto.setOrderNo(wrkDetl.getString("orderNo"));
+ wcsStationDto.setOrderNo(wrkDetl.getString("orderNo"));
+ list.add(tvWrkDetlDto);
}
wcsStationDto.setIoType(data.getInteger("ioType"));
+
wcsStationDto.setWrkDetls(list);
stationUtils.stationMap.put(wcsStationDto.getStationId(), wcsStationDto);
}
@@ -101,7 +112,7 @@
//WMS鍏ュ簱浠诲姟鏌ヨ鎺ュ彛
@Scheduled(cron = "0/3 * * * * ? ")
public synchronized void inTaskQuery() {
- Config wmsCombQueryUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsCombQueryUrl"));
+ Config wmsCombQueryUrlConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsCombQueryUrl"));
if (wmsCombQueryUrlConfig == null) {
return;
}
@@ -112,7 +123,7 @@
try {
HashMap<String, Object> requestParam = new HashMap<>();
- List<BasStation> basStations = basStationService.selectList(new EntityWrapper<BasStation>().eq("in_enable", "Y"));
+ 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) {
@@ -128,8 +139,12 @@
if (Cools.isEmpty(wcsStationDto.getBarcode())) {
continue;
}
-
- requestParam.put("barcode", wcsStationDto.getBarcode());
+ String[] split = wcsStationDto.getBarcode().split(",");
+ String barcode = split[0];
+ if(Objects.equals(barcode, "NoRead")){
+ continue;
+ }
+ requestParam.put("taskNo", wcsStationDto.getTaskNo());
response = new HttpHandler.Builder()
.setUri(wmsCombQueryUrl)
.setJson(JSON.toJSONString(requestParam))
@@ -139,22 +154,26 @@
if (response != null) {
JSONObject jsonObject = JSON.parseObject(response);
JSONObject data = jsonObject.getJSONObject("data");
-
+ if(data == null){
+ continue;
+ }
List<TvWrkDetlDto> list = new ArrayList<>();
- for (Object o : data.getJSONArray("combDetls")) {
+ for (Object o : data.getJSONArray("wrkDetls")) {
JSONObject wrkDetl = (JSONObject) o;
TvWrkDetlDto tvWrkDetlDto = new TvWrkDetlDto();
- list.add(tvWrkDetlDto);
+// list.add(tvWrkDetlDto);
tvWrkDetlDto.setMatnr(wrkDetl.getString("matnr"));
tvWrkDetlDto.setMaktx(wrkDetl.getString("maktx"));
tvWrkDetlDto.setSpecs(wrkDetl.getString("specs"));
tvWrkDetlDto.setBatch(wrkDetl.getString("batch"));
tvWrkDetlDto.setAnfme(wrkDetl.getDouble("anfme"));
+ list.add(tvWrkDetlDto);
}
-
wcsStationDto.setIoType(1);
+ wcsStationDto.setBarcode(barcode);
wcsStationDto.setWrkDetls(list);
+ System.out.println(wcsStationDto);
stationUtils.stationMap.put(wcsStationDto.getStationId(), wcsStationDto);
}
}
@@ -167,7 +186,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;
}
@@ -213,7 +232,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;
}
@@ -242,7 +261,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