From 319e1d959ee33466a8a53c682a25af6b6cf50a95 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期二, 15 四月 2025 07:42:01 +0800 Subject: [PATCH] no message --- 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