feat(项目管理产品需求重构): 完善产品需求规格逻辑

固定模块不允许编辑不允许删除

Signed-off-by: OTTO <731554297@qq.com>
This commit is contained in:
OTTO 2024-12-18 14:00:50 +08:00
parent 76f8f05147
commit 5ae947073b
2 changed files with 6 additions and 12 deletions

View File

@ -108,15 +108,4 @@ public class PmsProductModuleController extends BaseController
{
return toAjax(pmsProductModuleService.deletePmsProductModuleById(id));
}
/**
* 初始化固定模块
*/
@RequiresPermissions("pms:pmsProductModule:manage")
@Log(title = "产品模块", businessType = BusinessType.UPDATE)
@PutMapping("/{productIdentifier}/initModule")
@ApiOperation(value = "初始化固定模块")
public AjaxResult initProductModule(@PathVariable String productIdentifier) {
return toAjax(pmsProductModuleService.initProductModule(productIdentifier));
}
}

View File

@ -173,6 +173,9 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService
throw new ServiceException("[%s]不允许进行操作", NO_MODULE);
}
PmsProductModule oldPmsProductModule = selectPmsProductModuleById(pmsProductModule.getId(), true);
if (oldPmsProductModule.getIsFixedModule()) {
throw new ServiceException("固定模块不允许进行操作");
}
String name;
// 当type为1时则取产品需求数量为2时取测试用例数量
if (PmsConstants.PRODUCT_TAG_AND_MODULE_TYPE.equals(oldPmsProductModule.getType())) {
@ -221,7 +224,9 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService
public int deletePmsProductModuleById(Long id)
{
PmsProductModule oldPmsProductModule = selectPmsProductModuleById(id, true);
if (oldPmsProductModule.getIsFixedModule()) {
throw new ServiceException("固定模块不允许进行操作");
}
PmsProductModule pmsProductModuleSearch=new PmsProductModule();
pmsProductModuleSearch.setParentId(id);
List<PmsProductModule> pmsProductModuleChildList=pmsProductModuleMapper.selectPmsProductModuleList(pmsProductModuleSearch);