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 |   51 +++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 47 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 68468a9..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);
@@ -481,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) {
@@ -530,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;
@@ -562,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