feat(产品需求重构): 需求规格模块中无所属模块调整为其他需求

关联Issue:https://pm.gitlink.org.cn/Gitlink/projects/228/demand/124520

Signed-off-by: OTTO <731554297@qq.com>
This commit is contained in:
OTTO 2025-01-16 14:00:24 +08:00
parent 01bf425689
commit ef476d06a8
1 changed files with 13 additions and 5 deletions

View File

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