From e6ba82aab65fe3d2e868460ce827ccb8ec2303e5 Mon Sep 17 00:00:00 2001 From: liao Date: Mon, 18 Sep 2023 18:14:36 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=A0=87=E5=87=86=E6=B3=95=E8=A7=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/laws/common/constant/ResultCommon.java | 1 + .../common/service/impl/LawsCommonServiceImpl.java | 11 ++++++----- .../service/impl/LawsNodeRelationServiceImpl.java | 13 +++++++------ .../src/main/resources/i18n/messages.properties | 2 +- .../src/main/resources/i18n/messages_en.properties | 1 + .../src/main/resources/i18n/messages_zh.properties | 2 +- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/constant/ResultCommon.java b/laws-modules/src/main/java/com/jero/modules/laws/common/constant/ResultCommon.java index 3dae3b9f..cfc8f11c 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/common/constant/ResultCommon.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/constant/ResultCommon.java @@ -16,6 +16,7 @@ public class ResultCommon { public static final String EMPTY_STANDARD_NUMBER = "message.empty.standard.number"; // 标准编号不能为空 public static final String EMPTY_STANDARD_NAME = "message.empty.standard.name"; // 标准名称不能为空 public static final String EMPTY_COMMON = "message.empty.common"; // {0}不能为空 + public static final String EXIST_STANDARD_NUMBER = "message.exists.standard.number"; // 标准编号已经存在 public static final String RMR_SET_QUALITY_OVER_TEN = "es.rmr.setQuality.overTen"; // 请最多选择10条 diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java index 3ee48b88..4e14b993 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java @@ -295,6 +295,10 @@ public class LawsCommonServiceImpl implements ILawsCommonService { if (StringUtils.isBlank(standardNumber)) { throw new JeroBootException(ResultCommon.EMPTY_STANDARD_NUMBER); } + ManyStandardSelectionBox singleStandard = getSingleStandard(standardNumber); + if (!Objects.isNull(singleStandard)) { + throw new JeroBootException(ResultCommon.EXIST_STANDARD_NUMBER); + } // 标准名称不能为空 String standardName = (String) parameterMap.get(FieldCommon.STANDARD_NAME); if (StringUtils.isBlank(standardName)) { @@ -555,11 +559,8 @@ public class LawsCommonServiceImpl implements ILawsCommonService { } List idList = Arrays.asList(ids.split(",")); // 操作数据库进行删除操作 - int rowsDeleted = lawsCommonMapper.logicalDeleteByIdsAndModule(tableName, idList); - if (rowsDeleted > 0) { - return MessageUtils.getMessage(ResultCommon.OK); - } - return MessageUtils.getMessage(ResultCommon.ERROR); + lawsCommonMapper.logicalDeleteByIdsAndModule(tableName, idList); + return MessageUtils.getMessage(ResultCommon.OK); } @Override diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsNodeRelationServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsNodeRelationServiceImpl.java index e9cca759..5cd53199 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsNodeRelationServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsNodeRelationServiceImpl.java @@ -1,12 +1,11 @@ package com.jero.modules.laws.standard.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.jero.modules.laws.common.constant.FieldCommon; -import com.jero.modules.laws.standard.entity.LawsDomesticStandard; +import com.jero.modules.laws.common.service.ILawsCommonService; +import com.jero.modules.laws.common.vo.ManyStandardSelectionBox; import com.jero.modules.laws.standard.entity.LawsNodeRelation; import com.jero.modules.laws.standard.entity.LawsTreeNode; import com.jero.modules.laws.standard.mapper.LawsNodeRelationMapper; -import com.jero.modules.laws.standard.service.ILawsDomesticStandardService; import com.jero.modules.laws.standard.service.ILawsNodeRelationService; import com.jero.modules.laws.standard.service.ILawsTreeNodeService; import com.spire.ms.System.Collections.ArrayList; @@ -33,7 +32,7 @@ public class LawsNodeRelationServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(LawsDomesticStandard::getStandardNumber, standardNumber); + ManyStandardSelectionBox singleStandard = lawsCommonService.getSingleStandard(standardNumber); + String standardId = singleStandard.getId(); + + List nodeIdList = Arrays.asList(nodeIds.split(",")); } diff --git a/laws-single-startup/src/main/resources/i18n/messages.properties b/laws-single-startup/src/main/resources/i18n/messages.properties index 9018600d..b7381d38 100644 --- a/laws-single-startup/src/main/resources/i18n/messages.properties +++ b/laws-single-startup/src/main/resources/i18n/messages.properties @@ -12,7 +12,7 @@ message.empty.source=The source cannot be empty message.empty.common=The {0} cannot be empty message.empty.standard.number=The standard number cannot be empty message.empty.standard.name=The standard name cannot be empty - +message.exists.standard.number=standard number already exists successfully.cleared=successfully cleared successfully.deleted.in.bulk=successfully deleted in bulk diff --git a/laws-single-startup/src/main/resources/i18n/messages_en.properties b/laws-single-startup/src/main/resources/i18n/messages_en.properties index 914d821e..e0804f9c 100644 --- a/laws-single-startup/src/main/resources/i18n/messages_en.properties +++ b/laws-single-startup/src/main/resources/i18n/messages_en.properties @@ -11,6 +11,7 @@ message.empty.source=The source cannot be empty message.empty.common=The {0} cannot be empty message.empty.standard.number=The standard number cannot be empty message.empty.standard.name=The standard name cannot be empty +message.exists.standard.number=standard number already exists es.rmr.setQuality.overTen=Please select up to 10 diff --git a/laws-single-startup/src/main/resources/i18n/messages_zh.properties b/laws-single-startup/src/main/resources/i18n/messages_zh.properties index c63115cd..d6bb3e5a 100644 --- a/laws-single-startup/src/main/resources/i18n/messages_zh.properties +++ b/laws-single-startup/src/main/resources/i18n/messages_zh.properties @@ -12,7 +12,7 @@ message.empty.source=\u6765\u6E90\u4E0D\u80FD\u4E3A\u7A7A message.empty.common={0}\u4E0D\u80FD\u4E3A\u7A7A message.empty.standard.number=\u6807\u51C6\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A message.empty.standard.name=\u6807\u51C6\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A - +message.exists.standard.number=标准编号已经存在 successfully.cleared=\u6E05\u9664\u6210\u529F successfully.deleted.in.bulk=\u6279\u91CF\u5220\u9664\u6210\u529F