From bbddd048ae9016ae89136eb0f108b80ca38ed4f4 Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期五, 23 一月 2026 19:16:32 +0800
Subject: [PATCH] lsh#明细添加计划跟踪号、行号、批次
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java
index eb5e75e..f6ffb66 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java
@@ -1,5 +1,6 @@
package com.vincent.rsf.server.manager.schedules;
+import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -8,6 +9,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.cfg.CoercionAction;
import com.fasterxml.jackson.databind.cfg.CoercionInputShape;
+import com.vincent.rsf.framework.common.Cools;
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.framework.exception.CoolException;
import com.vincent.rsf.server.api.config.RemotesInfoProperties;
@@ -255,6 +257,10 @@
BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
.eq(BasStation::getStationName,
task.getTaskStatus().equals(TaskStsType.GENERATE_IN.id) ? task.getOrgSite() : task.getTargSite()));
+ if (Cools.isEmpty(station)){
+ log.info("闈炲厜鐢电珯鐐逛换鍔′笅鍙戯細绔欑偣淇℃伅寮傚父锛屼换鍔′俊鎭細"+ JSON.toJSONString(task));
+ continue;
+ }
if (station.getType().equals(StationTypeEnum.STATION_TYPE_MUTI.type)) {
continue;
}
@@ -270,7 +276,7 @@
* @description: 鍏夌數绔欑偣浠诲姟涓嬪彂
* @version 1.0
*/
-// @Scheduled(cron = "0/5 * * * * ? ")
+ @Scheduled(cron = "0/5 * * * * ? ")
@Transactional(rollbackFor = Exception.class)
public void taskToWCS() throws Exception {
Long loginUserId = SystemAuthUtils.getLoginUserId();
@@ -374,7 +380,44 @@
}
- /**鍒ゆ柇鏄惁鍏夌數绔欑偣锛岄潪鍏夊簵绔欑偣闇�绠℃帶绔欑偣鐘舵��*/
+ /**鍒ゆ柇鏄惁璧风偣绯荤粺绫诲瀷 闈炴爣鍑嗙▼搴�*/
+ Loc locStart = null;
+ if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type) ||
+ task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type)) {
+ locStart = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc()));
+ if (Objects.isNull(locStart)) {
+ throw new CoolException("婧愬簱浣嶄笉瀛樺湪锛侊紒");
+ }
+ }
+
+ if (!Objects.isNull(locStart)) {
+ taskParams.setSign(LocStsWcsOrOtherType.getApiType(locStart.getAreaId$()));
+ } else {
+ taskParams.setSign(LocStsWcsOrOtherType.LOC_STS_TYPE_RCS.type);
+ }
+
+
+ /**鍒ゆ柇鏄惁璧风偣绯荤粺绫诲瀷 闈炴爣鍑嗙▼搴�*/
+ if (locStart == null){
+ if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type) ||
+ task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type) ||
+ task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)
+ ) {
+ BasStation stationS = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite()));
+ if (Objects.isNull(stationS)) {
+ throw new CoolException("婧愬簱浣嶄笉瀛樺湪锛侊紒");
+ }
+
+ if (stationS.getType().equals(StationTypeEnum.STATION_TYPE_MUTI.type)) {
+ taskParams.setSign(LocStsWcsOrOtherType.LOC_STS_TYPE_WCS.type);
+ } else {
+ taskParams.setSign(LocStsWcsOrOtherType.LOC_STS_TYPE_RCS.type);
+ }
+ }
+ }
+
+
+ /**鍒ゆ柇鏄惁鍏夌數绔欑偣锛岄潪鍏夊簵绔欑偣闇�绠℃帶绔欑偣鐘舵��*/ //鐩爣绔欑偣
if (!Objects.isNull(station) && station.getType().equals(StationTypeEnum.STATION_TYPE_NORMAL.type)) {
if (task.getTaskType() <= TaskType.TASK_TYPE_CHECK_IN.type && !task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) {
// if (!station.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) {
@@ -452,7 +495,7 @@
ResponseEntity<String> exchange = restTemplate.exchange(pubTakUrl, HttpMethod.POST, httpEntity, String.class);
log.info("浠诲姟涓嬪彂鍚庯紝鍝嶅簲缁撴灉锛� {}", exchange);
if (Objects.isNull(exchange.getBody())) {
- throw new CoolException("浠诲姟涓嬪彂澶辫触锛侊紒");
+ throw new CoolException("浠诲姟涓嬪彂澶辫触锛侊紒锛岃繑鍥炲弬鏁颁负绌猴紒锛侊紒");
} else {
try {
ObjectMapper objectMapper = new ObjectMapper();
--
Gitblit v1.9.1