| | |
| | | @Override |
| | | public int deleteProjectManagementByIds(Long[] ids) { |
| | | // 校验 |
| | | // for (Long id : ids) { |
| | | // checkDataPer(id); |
| | | // } |
| | | if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()) ){ |
| | | throw new ServiceException("无权操作!"); |
| | | for (Long id : ids) { |
| | | checkDelData(id); |
| | | } |
| | | // if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()) ){ |
| | | // throw new ServiceException("无权操作!"); |
| | | // } |
| | | return projectManagementMapper.deleteProjectManagementByIds(ids); |
| | | } |
| | | |
| | |
| | | Long deptId = projectManagement.getDeptId(); |
| | | // 本部门审批? |
| | | if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()) && deptId.intValue() != SecurityUtils.getDeptId().intValue()){ |
| | | throw new ServiceException("非本部门数据,无权操作!"); |
| | | throw new ServiceException("非本处室数据,无权操作!"); |
| | | } |
| | | if (projectManagement.getState() == 4){ |
| | | throw new ServiceException("已结项,无权操作!"); |
| | |
| | | } |
| | | |
| | | |
| | | private void checkDelData(Long id){ |
| | | ProjectManagement projectManagement = checkData(id); |
| | | Long deptId = projectManagement.getDeptId(); |
| | | // 本部门审批? |
| | | if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()) && deptId.intValue() != SecurityUtils.getDeptId().intValue()){ |
| | | throw new ServiceException("非本处室数据,无权操作!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |