From eb8ded2565e746a360985f702c556b26f750d35a Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 25 三月 2025 09:07:51 +0800
Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop

---
 rsf-server/src/main/java/com/vincent/rsf/server/system/controller/DictTypeController.java |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/system/controller/DictTypeController.java b/rsf-server/src/main/java/com/vincent/rsf/server/system/controller/DictTypeController.java
index 1e06e7c..a705dd9 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/system/controller/DictTypeController.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/system/controller/DictTypeController.java
@@ -61,13 +61,15 @@
         if (Objects.isNull(dictType.getName())) {
             throw new CoolException("瀛楀吀鍚嶇О涓嶈兘涓虹┖锛侊紒");
         }
-        if (Objects.isNull(dictType.getDescription())) {
-            throw new CoolException("瀛楀吀鎻忚堪涓嶈兘涓虹┖锛侊紒");
-        }
         if (Objects.isNull(dictType.getCode())) {
             throw new CoolException("瀛楀吀缂栫爜涓嶈兘涓虹┖锛侊紒");
         }
-
+        if (!dictTypeService.list(new LambdaQueryWrapper<DictType>().eq(DictType::getCode, dictType.getCode())).isEmpty()) {
+            throw new CoolException("缂栫爜涓嶈兘閲嶅锛侊紒");
+        }
+        if (!dictTypeService.list(new LambdaQueryWrapper<DictType>().eq(DictType::getName, dictType.getName())).isEmpty()) {
+            throw new CoolException("鍚嶇О涓嶈兘閲嶅锛侊紒");
+        }
         if (!dictTypeService.save(dictType)) {
             return R.error("Save Fail");
         }
@@ -78,8 +80,10 @@
     @OperationLog("Update 鏁版嵁瀛楀吀")
     @PostMapping("/dictType/update")
     public R update(@RequestBody DictType dictType) {
+        if (Objects.isNull(dictType)) {
+            throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+        }
         dictType.setUpdateBy(getLoginUserId());
-        dictType.setUpdateTime(new Date());
         if (!dictTypeService.updateById(dictType)) {
             return R.error("Update Fail");
         }

--
Gitblit v1.9.1