| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private void setAdCode(ProjectSearchDTO dto) { |
| | | String deptId = AuthUtil.getDeptId(); |
| | | Long roleId = sgProgressReportService.getRoleId(); |
| | | if(!roleId.equals(1811657352658042882L)){ |
| | | if(roleId.equals(1811657352658042882L)){ |
| | | dto.setAdCode(deptId); |
| | | } |
| | | } |
| | |
| | | return page.setRecords(baseMapper.resList(page,dto)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void delete(String ids) { |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | list.forEach(id->{ |
| | | List<SgProgressReportDO> reportDOS = new LambdaQueryChainWrapper<>(sgProgressReportMapper).eq(SgProgressReportDO::getProframId, id).list(); |
| | | if (CollectionUtils.isNotEmpty(reportDOS)){ |
| | | SgProjectInfoDO sgProjectInfoDO = sgProjectInfoMapper.selectById(id); |
| | | throw new ServiceException(sgProjectInfoDO.getProjectName() + "存在施工审批,无法删除!"); |
| | | } |
| | | sgProjectInfoMapper.deleteById(id); |
| | | }); |
| | | } |
| | | |
| | | } |