From ea09ba33fceccbb70ad1ad0621e739679a37dbb2 Mon Sep 17 00:00:00 2001
From: 野心家 <1051256694@qq.com>
Date: 星期三, 23 十月 2024 11:08:05 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/service/CommonService.java |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index d60e71b..1fdf82b 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -484,6 +484,22 @@
                         }
                         for (LocMast locMast2 : locMasts) {
                             if (locMast2.getLocSts().equals("O") ) {
+                                if (locMast == null){
+                                    locMast = locMast2;
+                                }
+                            }else if (locMast2.getLocSts().equals("F")){
+                                locMast = null;
+                            }
+                        }
+                    }
+                }
+                if(Cools.isEmpty(locMast)){
+                    List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
+                            .eq("lev1", 1)
+                            .orderBy("bay1",false));
+                    for (LocMast locMast2 : locMasts) {
+                        if (locMast2.getLocSts().equals("O") ) {
+                            if (locMast == null){
                                 locMast = locMast2;
                             }else if (locMast2.getLocSts().equals("F")){
                                 locMast = null;
@@ -492,12 +508,9 @@
                     }
                 }
             }else {
-                for (int i = 1; i<=4;i++){
+                for (int i = 1; i<=2;i++){
                     if (locMast != null){
                         break;
-                    }
-                    if (i == 2){
-                        continue;
                     }
                     List<LocMast> locMastsF = locMastService.selectList(new EntityWrapper<LocMast>()
                             .eq("lev1", i)
@@ -526,25 +539,27 @@
                     }
                     for (LocMast locmast3 : locMasts) {
                         if (locmast3.getLocSts().equals("O")){
-                            locMast = locmast3;
+                            if (locMast == null){
+                                locMast = locmast3;
+                            }
                         }else if (locmast3.getLocSts().equals("F")){
                             locMast = null;
                         }
                     }
                 }
-
             }
-
         }else {
             List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
-                    .eq("lev1", 2)
-                    .orderBy("bay1",false));
+                    .eq("lev1", 3)
+                    .orderBy("bay1",true));
             if (Cools.isEmpty(locMasts)){
                 throw new CoolException("鏁版嵁寮傚父锛岃鑱旂郴绠$悊鍛�===銆嬪簱浣嶆湭鐭�");
             }
             for (LocMast locmast : locMasts) {
                 if (locmast.getLocSts().equals("O") ) {
-                    locMast = locmast;
+                    if (locMast == null){
+                        locMast = locmast;
+                    }
                 }else if (locmast.getLocSts().equals("D")){
                     locMast = null;
                 }

--
Gitblit v1.9.1