From 4a1724d674177968dfb5e03c2f3a87ff12788894 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期三, 14 一月 2026 12:50:44 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/utils/WmsOperateUtils.java | 46 +++++++++++++++++++++++++++++++---------------
1 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/src/main/java/com/zy/core/utils/WmsOperateUtils.java b/src/main/java/com/zy/core/utils/WmsOperateUtils.java
index 5cd16b3..79e7e1e 100644
--- a/src/main/java/com/zy/core/utils/WmsOperateUtils.java
+++ b/src/main/java/com/zy/core/utils/WmsOperateUtils.java
@@ -7,17 +7,21 @@
import com.core.exception.CoolException;
import com.zy.asrs.entity.BasCrnp;
import com.zy.asrs.entity.BasDualCrnp;
+import com.zy.asrs.entity.BasStation;
import com.zy.asrs.entity.HttpRequestLog;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.service.BasCrnpService;
import com.zy.asrs.service.BasDualCrnpService;
+import com.zy.asrs.service.BasStationService;
import com.zy.asrs.service.HttpRequestLogService;
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.utils.Utils;
import com.zy.common.entity.FindCrnNoResult;
import com.zy.common.service.CommonService;
import com.zy.common.utils.HttpHandler;
+import com.zy.common.utils.RedisUtil;
import com.zy.core.News;
+import com.zy.core.enums.RedisKeyType;
import com.zy.core.enums.SlaveType;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
@@ -45,27 +49,28 @@
private BasCrnpService basCrnpService;
@Autowired
private BasDualCrnpService basDualCrnpService;
+ @Autowired
+ private BasStationService basStationService;
+ @Autowired
+ private RedisUtil redisUtil;
//鐢宠鍏ュ簱浠诲姟
public synchronized String applyInTask(String barcode, Integer sourceStaNo, Integer locType1) {
- String wmsUrl = null;
- Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri"));
- if (wmsSystemUriConfig != null) {
- wmsUrl = wmsSystemUriConfig.getValue();
+ Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key);
+ if (systemConfigMapObj == null) {
+ News.error("绯荤粺Config缂撳瓨澶辨晥");
+ return null;
}
+ HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj;
+ String wmsUrl = systemConfigMap.get("wmsSystemUri");
if (wmsUrl == null) {
News.error("鏈厤缃甒MS绯荤粺URI锛岄厤缃枃浠禖ode缂栫爜锛歸msSystemUri");
return null;
}
- String wmsSystemInUrl = null;
- Config wmsSystemInUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemInUrl"));
- if (wmsSystemInUrlConfig != null) {
- wmsSystemInUrl = wmsSystemInUrlConfig.getValue();
- }
-
- if(wmsSystemInUrlConfig == null){
+ String wmsSystemInUrl = systemConfigMap.get("wmsSystemInUrl");
+ if(wmsSystemInUrl == null){
News.error("鏈厤缃甒MS鍏ュ簱鎺ュ彛鍦板潃锛岄厤缃枃浠禖ode缂栫爜锛歸msSystemInUrl");
return null;
}
@@ -74,8 +79,19 @@
String response = null;
int result = 0;
try {
+ BasStation basStation = basStationService.selectOne(new EntityWrapper<BasStation>().eq("station_id", sourceStaNo));
+ if(basStation == null){
+ News.error("绔欑偣{}涓嶅瓨鍦�", sourceStaNo);
+ return null;
+ }
+
+ String stationNo = String.valueOf(sourceStaNo);
+ if(!Cools.isEmpty(basStation.getStationAlias())){
+ stationNo = basStation.getStationAlias();
+ }
+
requestParam.put("barcode", barcode);
- requestParam.put("sourceStaNo", String.valueOf(sourceStaNo));
+ requestParam.put("sourceStaNo", stationNo);
requestParam.put("locType1", locType1);
requestParam.put("row", Utils.getInTaskEnableRow(sourceStaNo));
@@ -83,7 +99,7 @@
.setUri(wmsUrl)
.setPath(wmsSystemInUrl)
.setJson(JSON.toJSONString(requestParam))
- .setTimeout(360, TimeUnit.SECONDS)
+ .setTimeout(30, TimeUnit.SECONDS)
.build()
.doPost();
if (response != null) {
@@ -161,7 +177,7 @@
.setUri(wmsUrl)
.setPath(wmsSystemReassignInTaskUrl)
.setJson(JSON.toJSONString(requestParam))
- .setTimeout(360, TimeUnit.SECONDS)
+ .setTimeout(30, TimeUnit.SECONDS)
.build()
.doPost();
if (response != null) {
@@ -253,7 +269,7 @@
.setUri(wmsUrl)
.setPath(wmsSystemChangeLocNoUrl)
.setJson(JSON.toJSONString(requestParam))
- .setTimeout(360, TimeUnit.SECONDS)
+ .setTimeout(30, TimeUnit.SECONDS)
.build()
.doPost();
--
Gitblit v1.9.1