From a2a5f1b9b70be48687ac7f84ebf6aa132c3721e9 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期六, 21 三月 2026 21:18:12 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/service/CommonService.java | 78 +++++++++++++++++++++++++++++++++++++--
1 files changed, 74 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 10b671c..771bdeb 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -21,6 +21,7 @@
import org.springframework.stereotype.Service;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Random;
@@ -59,8 +60,8 @@
}
int workNo = wrkLastno.getWrkNo();
- int sNo = wrkLastno.getSNo();
- int eNo = wrkLastno.getENo();
+ int sNo = wrkLastno.getsNo();
+ int eNo = wrkLastno.geteNo();
workNo = workNo>=eNo ? sNo : workNo+1;
while (true) {
WrkMast wrkMast = wrkMastService.selectByWorkNo(workNo);
@@ -147,6 +148,33 @@
}
wrkMast.setMk("taskCancel");
+ wrkMast.setModiTime(new Date());
+ wrkMastService.updateById(wrkMast);
+ return true;
+ }
+
+ public boolean updateTaskPriorityAndBatchSeq(UpdateTaskPriorityAndBatchSeqParam param) {
+ if (param == null) {
+ throw new CoolException("鍙傛暟涓嶈兘涓虹┖");
+ }
+ if (Cools.isEmpty(param.getTaskNo())) {
+ throw new CoolException("WMS浠诲姟鍙蜂笉鑳戒负绌�");
+ }
+ if (param.getTaskPri() == null && param.getBatchSeq() == null) {
+ throw new CoolException("浠诲姟浼樺厛绾у拰鎵规搴忓彿涓嶈兘鍚屾椂涓虹┖");
+ }
+
+ WrkMast wrkMast = wrkMastService.getOne(new QueryWrapper<WrkMast>().eq("wms_wrk_no", param.getTaskNo()));
+ if (wrkMast == null) {
+ throw new CoolException("浠诲姟涓嶅瓨鍦�");
+ }
+
+ if (param.getTaskPri() != null) {
+ wrkMast.setIoPri(param.getTaskPri().doubleValue());
+ }
+ if (param.getBatchSeq() != null) {
+ wrkMast.setBatchSeq(param.getBatchSeq());
+ }
wrkMast.setModiTime(new Date());
wrkMastService.updateById(wrkMast);
return true;
@@ -454,6 +482,48 @@
return true;
}
+ public boolean createOutTaskBatch(CreateOutTaskBatchParam param) {
+ if (param == null) {
+ throw new CoolException("鍙傛暟涓嶈兘涓虹┖");
+ }
+
+ List<CreateOutTaskParam> taskList = param.getTaskList();
+ if (taskList == null || taskList.isEmpty()) {
+ throw new CoolException("浠诲姟鍒楄〃涓嶈兘涓虹┖");
+ }
+
+ List<CreateOutTaskParam> sortedTaskList = new ArrayList<>(taskList);
+ sortedTaskList.sort(Comparator.nullsLast(Comparator
+ .comparing(this::getSortableBatch, Comparator.nullsLast(String::compareTo))
+ .thenComparing(this::getSortableBatchSeq, Comparator.nullsLast(Integer::compareTo))));
+
+ for (CreateOutTaskParam createOutTaskParam : sortedTaskList) {
+ if (createOutTaskParam == null) {
+ throw new CoolException("浠诲姟鍙傛暟涓嶈兘涓虹┖");
+ }
+ createOutTask(createOutTaskParam);
+ }
+ return true;
+ }
+
+ private String getSortableBatch(CreateOutTaskParam param) {
+ if (param == null) {
+ return null;
+ }
+ String batch = param.getBatch();
+ if (batch == null || batch.trim().isEmpty()) {
+ return null;
+ }
+ return batch;
+ }
+
+ private Integer getSortableBatchSeq(CreateOutTaskParam param) {
+ if (param == null) {
+ return null;
+ }
+ return param.getBatchSeq();
+ }
+
public FindCrnNoResult findCrnNoByLocNo(String locNo) {
List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>());
for (BasCrnp basCrnp : basCrnps) {
@@ -503,7 +573,7 @@
Integer targetStationId = null;
for (StationObjModel stationObjModel : stationList) {
try {
- List<NavigateNode> navigateNodes = navigateUtils.calcByStationId(sourceStationId, stationObjModel.getStationId());
+ List<NavigateNode> navigateNodes = navigateUtils.calcReachablePathByStationId(sourceStationId, stationObjModel.getStationId());
if(!navigateNodes.isEmpty()) {
targetStationId = stationObjModel.getStationId();
break;
@@ -535,7 +605,7 @@
Integer finalSourceStationId = null;
for (StationObjModel stationObjModel : stationList) {
try {
- List<NavigateNode> navigateNodes = navigateUtils.calcByStationId(stationObjModel.getStationId(), targetStationId);
+ List<NavigateNode> navigateNodes = navigateUtils.calcReachablePathByStationId(stationObjModel.getStationId(), targetStationId);
if(!navigateNodes.isEmpty()) {
finalSourceStationId = stationObjModel.getStationId();
break;
--
Gitblit v1.9.1