From cc77f0b5f8c5ee66415f13bce35859773f2f37d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B8=BF=E5=B1=95?= <18031053041@163.com> Date: Sat, 30 May 2026 00:33:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8=E7=B1=BB=E5=9E=8B=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E6=A0=A1=E9=AA=8C=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mhd/system/controller/SysDictTypeController.java | 8 ++++++-- .../mhd/system/service/impl/SysDictTypeServiceImpl.java | 2 +- .../main/resources/mapper/system/SysDictTypeMapper.xml | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/system/controller/SysDictTypeController.java b/mhd-modules/mhd-system/src/main/java/com/mhd/system/controller/SysDictTypeController.java index e9d4c29c6..6cf686ee9 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/system/controller/SysDictTypeController.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/system/controller/SysDictTypeController.java @@ -79,7 +79,7 @@ public class SysDictTypeController extends BaseController fillDictTypeOrganization(dict); if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { - return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型编码「" + dict.getDictType() + "」已存在(全局不可重复)"); + return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型编码「" + dict.getDictType() + "」在当前组织下已存在"); } dict.setCreateBy(SecurityUtils.getUsername()); return toAjax(dictTypeService.insertDictType(dict)); @@ -124,6 +124,10 @@ public class SysDictTypeController extends BaseController dict.setOrganizationName(userPo.getOrganizationName()); } } + if (dict.getOrganizationId() == null) + { + dict.setOrganizationId(0L); + } } /** @@ -137,7 +141,7 @@ public class SysDictTypeController extends BaseController fillDictTypeOrganization(dict); if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { - return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型编码「" + dict.getDictType() + "」已存在(全局不可重复)"); + return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型编码「" + dict.getDictType() + "」在当前组织下已存在"); } dict.setUpdateBy(SecurityUtils.getUsername()); return toAjax(dictTypeService.updateDictType(dict)); diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictTypeServiceImpl.java b/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictTypeServiceImpl.java index f9f6f237c..690d4b71c 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictTypeServiceImpl.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictTypeServiceImpl.java @@ -230,7 +230,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService } /** - * 校验字典类型称是否唯一 + * 校验字典类型在同一组织下是否唯一 * * @param dict 字典类型 * @return 结果 diff --git a/mhd-modules/mhd-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/mhd-modules/mhd-system/src/main/resources/mapper/system/SysDictTypeMapper.xml index bee4a97d0..f4a0834e5 100644 --- a/mhd-modules/mhd-system/src/main/resources/mapper/system/SysDictTypeMapper.xml +++ b/mhd-modules/mhd-system/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -69,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"