From bc25523bd723e92e85f3463edca27f0fe18a7a71 Mon Sep 17 00:00:00 2001
From: DESKTOP-LMJ82IJ\Eno <creaycat@gmail.com>
Date: 星期日, 13 四月 2025 16:49:19 +0800
Subject: [PATCH] #修改 收货单据界面优化修改

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java |   38 ++++++++++++++++++++++++++++++++------
 1 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java
index b99f16b..3a91dc6 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java
@@ -98,14 +98,14 @@
     @Transactional(rollbackFor = Exception.class)
     public R update(@RequestBody Loc loc) {
         loc.setUpdateBy(getLoginUserId());
-
         String join = StringUtils.join(loc.getTypeIds(), ",");
         loc.setType(join);
-
+        if (Objects.isNull(loc.getTypeIds())) {
+            throw new CoolException("搴撲綅绫诲瀷涓嶈兘涓虹┖锛侊紒");
+        }
         if (!locService.updateById(loc)) {
             return R.error("Update Fail");
         }
-
         if (!locService.updateLoc(loc)) {
             throw new CoolException("搴撲綅绫诲瀷鍏宠仈鍏崇郴淇敼澶辫触!@锛�");
         }
@@ -166,6 +166,8 @@
         if (Objects.isNull(locs)) {
             throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
         }
+        locs.setCreateBy(getLoginUserId());
+        locs.setUpdateBy(getLoginUserId());
         return locService.batchBindLocs(locs);
     }
 
@@ -175,12 +177,36 @@
     @PostMapping("/loc/init")
     public R initLocInfo(@Valid @RequestBody LocMastInitParam param) {
         if (Objects.isNull(param)) {
-            throw new CoolException("鍒濆鍖栦俊鎭笉鑳戒负绌猴紒锛�");
+            return R.error("鍒濆鍖栦俊鎭笉鑳戒负绌猴紒锛�");
+        }
+        if (Objects.isNull(param.getTypeIds()) && param.getTypeIds().isEmpty()) {
+            return R.error("搴撲綅绫诲瀷涓嶈兘涓虹┖锛侊紒");
+        }
+        if (Objects.isNull(param.getWarehouseId())) {
+            return R.error("浠撳簱ID涓嶈兘涓虹┖锛侊紒");
         }
         if (Objects.isNull(param.getAreaId())) {
-            throw new CoolException("搴撳尯ID涓嶈兘涓虹┖锛侊紒");
+            return R.error("搴撳尯ID涓嶈兘涓虹┖锛侊紒");
         }
-        return locService.initLocs(param);
+        if (Objects.isNull(param.getStartRow())) {
+            return R.error("璧峰鎺掍笉鑳戒负绌猴紒锛�");
+        }
+        if (Objects.isNull(param.getEndRow())) {
+            return R.error("缁堟鎺掍笉鑳戒负绌猴紒锛�");
+        }
+        if (Objects.isNull(param.getStartBay())) {
+            return R.error("璧峰鍒椾笉鑳戒负绌猴紒锛�");
+        }
+        if (Objects.isNull(param.getEndBay())) {
+            return R.error("缁堟鍒椾笉鑳戒负绌猴紒锛�");
+        }
+        if (Objects.isNull(param.getStartLev())) {
+            return R.error("璧峰灞備笉鑳戒负绌猴紒锛�");
+        }
+        if (Objects.isNull(param.getEndLev())) {
+            return R.error("缁堟灞備笉鑳戒负绌猴紒锛�");
+        }
+        return locService.initLocs(param, getLoginUserId());
     }
 
 }

--
Gitblit v1.9.1