| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.common.base.Result; |
| | |
| | | public boolean checkProjectNameAndIdIsUnique(ProjectInfo entity,Long updateId){ |
| | | QueryWrapper<ProjectInfo> queryWrapper = new QueryWrapper<ProjectInfo>(); |
| | | if (updateId == null) { |
| | | |
| | | queryWrapper.eq("project_name", entity.getProjectName()); |
| | | queryWrapper.eq("deleted",0); |
| | | if (StringUtils.isNotEmpty(entity.getProjectCode())) { |
| | | queryWrapper.eq("project_code", entity.getProjectCode()); |
| | | } |
| | | |
| | | List<ProjectInfo> project = projectInfoMapper.selectList(queryWrapper); |
| | | |
| | | return project == null || project.isEmpty(); |
| | | }else { |
| | | |
| | | List<ProjectInfo> project = projectInfoMapper.checkProjectNameAndIdIsUnique(updateId,entity.getProjectName(),entity.getProjectCode()); |
| | | |
| | | return project == null || project.isEmpty(); |
| | | List<ProjectInfo> list = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProjectInfo::getProjectName, entity.getProjectName()) |
| | | .eq(ProjectInfo::getProjectCode, entity.getProjectCode()) |
| | | .list(); |
| | | return list == null || list.isEmpty(); |
| | | } else { |
| | | List<ProjectInfo> list = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProjectInfo::getProjectName, entity.getProjectName()) |
| | | .eq(ProjectInfo::getProjectCode, entity.getProjectCode()) |
| | | .ne(ProjectInfo::getId, updateId) |
| | | .list(); |
| | | return list == null || list.isEmpty(); |
| | | } |
| | | |
| | | } |
| | |
| | | if (query.getProjectEndTime() != null) { |
| | | query.setProjectEndTime(DateUtils.getDayEnd(query.getProjectEndTime())); |
| | | } |
| | | if (YesOrNo.YES.getCode().equals(query.getCenter())) { |
| | | query.setProjectPhase("6"); |
| | | } |
| | | // 异常项目暂时返回空 |
| | | if (YesOrNo.YES.getCode().equals(query.getExe())) { |
| | | return Result.ok().data(new ArrayList<>()).total(0); |
| | |
| | | ProjectInfoVO.transform(vo); |
| | | ProjectVO projectVO = new ProjectVO(); |
| | | copyToProjectVO(vo, projectVO); |
| | | List<Long> departmentList = vo.getCompetentDepartmentList(); |
| | | projectVO.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (!CollectionUtils.isEmpty(departmentList) && departmentList.contains(SecurityUtils.getDeptId()))); |
| | | String competentDepartment = vo.getCompetentDepartment(); |
| | | projectVO.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (StringUtils.isNotEmpty(competentDepartment) && competentDepartment.equals(SecurityUtils.getDeptId()))); |
| | | // 翻译项目阶段 |
| | | String phase = ProjectCategoryEnum.getPhaseByProjectStatus(projectVO.getProjectPhase()); |
| | | projectVO.setProjectPhase(phase); |
| | |
| | | ProjectInfo entity = baseMapper.getById(id); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | ProjectInfoVO vo = ProjectInfoVO.getVoByEntity(entity, null); |
| | | List<Long> departmentList = vo.getCompetentDepartmentList(); |
| | | vo.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (!CollectionUtils.isEmpty(departmentList) && departmentList.contains(SecurityUtils.getDeptId()))); |
| | | String competentDepartment = vo.getCompetentDepartment(); |
| | | vo.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (StringUtils.isNotEmpty(competentDepartment) && competentDepartment.equals(SecurityUtils.getDeptId()))); |
| | | QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>(); |
| | | fileQueryWrapper.eq("type", FileTypeEnum.PROJECT_INFO.getType()); |
| | | fileQueryWrapper.eq("bus_id", vo.getId()); |
| | |
| | | finish.add(item); |
| | | } |
| | | |
| | | if (ImportanceTypeEnum.PROVINCIAL_KEY.getType().equals(item.getImportanceType())) { |
| | | province.add(item); |
| | | } else if (ImportanceTypeEnum.SUINING_KEY.getType().equals(item.getImportanceType())) { |
| | | city.add(item); |
| | | } else if (ImportanceTypeEnum.SHEHONG_KEY.getType().equals(item.getImportanceType())) { |
| | | county.add(item); |
| | | } else // if (ImportanceTypeEnum.NORMAL.getType().equals(item.getImportanceType())) |
| | | { |
| | | if (StringUtils.isBlank(item.getImportanceType())) { |
| | | normal.add(item); |
| | | // 使用contains,因为重点分类可多选,使用,分割存储的 |
| | | } else { |
| | | if (item.getImportanceType().contains(ImportanceTypeEnum.PROVINCIAL_KEY.getType())) { |
| | | province.add(item); |
| | | } |
| | | if (item.getImportanceType().contains(ImportanceTypeEnum.SUINING_KEY.getType())) { |
| | | city.add(item); |
| | | } |
| | | if (item.getImportanceType().contains(ImportanceTypeEnum.SHEHONG_KEY.getType())) { |
| | | county.add(item); |
| | | } |
| | | if (item.getImportanceType().contains(ImportanceTypeEnum.NORMAL.getType())) { |
| | | normal.add(item); |
| | | } |
| | | } |
| | | }); |
| | | //单位先默认为元 |