From ef476d06a8c0899717795305f8f203fbc3088dd5 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Thu, 16 Jan 2025 14:00:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E9=87=8D=E6=9E=84):=20=E9=9C=80=E6=B1=82=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=B8=AD=E6=97=A0=E6=89=80=E5=B1=9E=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E8=B0=83=E6=95=B4=E4=B8=BA=E5=85=B6=E4=BB=96=E9=9C=80?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联Issue:https://pm.gitlink.org.cn/Gitlink/projects/228/demand/124520 Signed-off-by: OTTO <731554297@qq.com> --- .../impl/PmsProductModuleServiceImpl.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductModuleServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductModuleServiceImpl.java index 0a8a03eea..505061e18 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductModuleServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductModuleServiceImpl.java @@ -59,7 +59,14 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService @Lazy private IPmsProjectTestsheetCasesService pmsProjectTestsheetCasesService; - private final static String NO_MODULE = "无所属模块"; + private static String NO_MODULE(int type) { + if (PmsConstants.PRODUCT_TAG_AND_MODULE_TYPE.equals(type)) { + return "其他需求"; + } + return "无所属模块"; + } + + ; private final static String ALL_MODULE = "全部模块"; /** @@ -169,10 +176,11 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService @Override public int updatePmsProductModule(PmsProductModule pmsProductModule) { - if (pmsProductModule.getId() == -1L || (pmsProductModule.getParentId() != null && pmsProductModule.getParentId() == -1L)) { - throw new ServiceException("[%s]不允许进行操作", NO_MODULE); - } PmsProductModule oldPmsProductModule = selectPmsProductModuleById(pmsProductModule.getId(), true); + if (pmsProductModule.getId() == -1L || (pmsProductModule.getParentId() != null && pmsProductModule.getParentId() == -1L)) { + throw new ServiceException("[%s]不允许进行操作", NO_MODULE(oldPmsProductModule.getType())); + } + if (oldPmsProductModule.getIsFixedModule()) { throw new ServiceException("固定模块不允许进行操作"); } @@ -335,7 +343,7 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService PmsProductModule noPmsProductModule = new PmsProductModule(); noPmsProductModule.setPmsProductIdentifier(pmsProductModule.getPmsProductIdentifier()); noPmsProductModule.setId(-1L); - noPmsProductModule.setModuleName(NO_MODULE); + noPmsProductModule.setModuleName(NO_MODULE(type)); noPmsProductModule.setParentId(0L); noPmsProductModule.setNodeDataCount(noModuleNodeDataCount); noPmsProductModule.setIsFixedModule(true);