子模块删除接口
Some checks failed
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head There was a failure building this commit
Some checks failed
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head There was a failure building this commit
This commit is contained in:
parent
ef85c9fb60
commit
5ccc846ab9
|
@ -26,4 +26,7 @@ public interface ModuleMapper {
|
|||
|
||||
@Delete("DELETE FROM organize_oa.oa_project_work WHERE id = #{id}")
|
||||
void deleteMoudule(Long id);
|
||||
|
||||
@Select("select * from organize_oa.oa_project_work where pid=#{id} and is_delete=0 and type=1 ")
|
||||
List<ProjectWorkDO> getAllMoudleByPid(Long id);
|
||||
}
|
||||
|
|
|
@ -61,15 +61,30 @@ public class ModuleServiceImpl implements ModuleService {
|
|||
return ResultUtil.success(projectWorkDOList);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BaseResponse deleteById(HttpServletRequest request, Long id) {
|
||||
|
||||
// 检测是否为管理员
|
||||
if(!Processing.checkUserIsAdmin(request,roleMapper)){
|
||||
return ResultUtil.error(ErrorCode.NOT_PERMISSION);
|
||||
}
|
||||
|
||||
moduleMapper.deleteMoudule(id);
|
||||
deleteMoudule(id);
|
||||
|
||||
return ResultUtil.success("删除成功");
|
||||
}
|
||||
|
||||
// 删除子模块方法
|
||||
public void deleteMoudule(Long id){
|
||||
//获取所有父Id=id的子模块
|
||||
List<ProjectWorkDO> projectWorkDOS = moduleMapper.getAllMoudleByPid(id);
|
||||
|
||||
for(ProjectWorkDO workDO: projectWorkDOS){
|
||||
deleteMoudule(workDO.getId());
|
||||
}
|
||||
|
||||
moduleMapper.deleteMoudule(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user