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);