From c3bd7262ff89c7594ec368f76ea910e6212769af Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 29 四月 2025 13:53:03 +0800
Subject: [PATCH] 1. 出库单新增修改优化

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
index 4312407..07f3f46 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
@@ -21,13 +21,16 @@
      * @return
      * @time 2025/3/31 08:50
      */
-    public static String getTargetLoc() {
+    public static String getTargetLoc(Long areaId) {
         //TODO 搴撲綅绛栫暐鍚庣画鎺掓湡
         LocService locService = SpringUtils.getBean(LocService.class);
 
-        Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type), false);
+        Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>()
+                .eq(Loc::getAreaId, areaId)
+                .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type), false
+        );
 
-        return Objects.isNull(loc) ? loc.getCode() : null;
+        return !Objects.isNull(loc) ? loc.getCode() : null;
     }
 
 
@@ -42,6 +45,6 @@
         //TODO 绔欑偣绛栫暐鍚庣画鎺掓湡
         DeviceSiteService deviceSite = SpringUtils.getBean(DeviceSiteService.class);
         DeviceSite loc = deviceSite.getOne(new LambdaQueryWrapper<DeviceSite>().eq(DeviceSite::getStatus, 1), false);
-        return Objects.isNull(loc) ? loc.getSite() : null;
+        return !Objects.isNull(loc) ? loc.getSite() : null;
     }
 }

--
Gitblit v1.9.1