|
|
|
@ -109,9 +109,17 @@ public class RequirementTypeController extends JeecgController<RequirementType, |
|
|
|
|
@AutoLog(value = "需求类型-通过id删除") |
|
|
|
|
@ApiOperation(value="需求类型-通过id删除", notes="需求类型-通过id删除") |
|
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
|
|
|
|
requirementTypeService.removeById(id); |
|
|
|
|
return Result.OK("删除成功!"); |
|
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { |
|
|
|
|
RequirementType requirementType = new RequirementType(); |
|
|
|
|
QueryWrapper<RequirementType> queryWrapper = QueryGenerator.initQueryWrapper(requirementType, req.getParameterMap()); |
|
|
|
|
queryWrapper.eq("upper_id",id); |
|
|
|
|
List<RequirementType> list = requirementTypeService.list(queryWrapper); |
|
|
|
|
if(list.size()>0){ |
|
|
|
|
return Result.error("包含有下级需求类型,无法删除"); |
|
|
|
|
}else{ |
|
|
|
|
requirementTypeService.removeById(id); |
|
|
|
|
return Result.OK("删除成功!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|