| | |
| | | import com.ycl.domain.vo.ProgressPlanInfoFlag; |
| | | import com.ycl.domain.vo.ProgressPlanInfoResponseVO; |
| | | import com.ycl.domain.vo.ProgressPlanVO; |
| | | import com.ycl.domain.vo.ProjectProgressFileListsRequest; |
| | | import com.ycl.domain.form.ProjectProgressFileListsForm; |
| | | import com.ycl.framework.utils.PageUtil; |
| | | import com.ycl.mapper.*; |
| | | import com.ycl.service.ProgressPlanService; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(Integer id) { |
| | | public Result detail(Long id) { |
| | | ProgressPlanInfoResponseVO vo = new ProgressPlanInfoResponseVO(); |
| | | List<ProgressPlanInfoFlag> monthProgress = new ArrayList<>(); |
| | | List<ProgressPlanInfoFlag> seasonProgress = new ArrayList<>(); |
| | |
| | | |
| | | // 查询月度计划项 |
| | | new LambdaQueryChainWrapper<>(projectPlanRecordMapper) |
| | | .eq(ProjectPlanRecord::getProjectInfoId, id) |
| | | .eq(ProjectPlanRecord::getPlanTimeFlag, 0) |
| | | .list() |
| | | .stream().forEach(record -> { |
| | | ProgressPlanInfoFlag progressPlanInfoFlag = new ProgressPlanInfoFlag(); |
| | | progressPlanInfoFlag.setPlanTime(record.getPlanTime()); |
| | | progressPlanInfoFlag.setPlanTimeFlag(record.getPlanTimeFlag()); |
| | | progressPlanInfoFlag.setPlanInfoList( |
| | | new LambdaQueryChainWrapper<>(projectPlanInfoMapper) |
| | | .eq(ProjectPlanInfo::getProjectPlanRecordId, record.getId()) |
| | | .eq(ProjectPlanInfo::getDeleted, 0) // 未删除 |
| | | .eq(ProjectPlanInfo::getPlanStatus, 2) // 计划项审批通过 |
| | | .list() |
| | | ); |
| | | monthProgress.add(progressPlanInfoFlag); |
| | | }); |
| | | .eq(ProjectPlanRecord::getProjectInfoId, id) |
| | | .eq(ProjectPlanRecord::getPlanTimeFlag, 0) |
| | | .list() |
| | | .stream().forEach(record -> { |
| | | ProgressPlanInfoFlag progressPlanInfoFlag = new ProgressPlanInfoFlag(); |
| | | progressPlanInfoFlag.setPlanTime(record.getPlanTime()); |
| | | progressPlanInfoFlag.setPlanTimeFlag(record.getPlanTimeFlag()); |
| | | progressPlanInfoFlag.setPlanInfoList( |
| | | new LambdaQueryChainWrapper<>(projectPlanInfoMapper) |
| | | .eq(ProjectPlanInfo::getProjectPlanRecordId, record.getId()) |
| | | .eq(ProjectPlanInfo::getDeleted, 0) // 未删除 |
| | | .eq(ProjectPlanInfo::getPlanStatus, 2) // 计划项审批通过 |
| | | .list() |
| | | ); |
| | | monthProgress.add(progressPlanInfoFlag); |
| | | }); |
| | | |
| | | // 查询季度计划项 |
| | | new LambdaQueryChainWrapper<>(projectPlanRecordMapper) |
| | | .eq(ProjectPlanRecord::getProjectInfoId, id) |
| | | .eq(ProjectPlanRecord::getPlanTimeFlag, 1) |
| | | .list() |
| | | .stream().forEach(record -> { |
| | | ProgressPlanInfoFlag progressPlanInfoFlag = new ProgressPlanInfoFlag(); |
| | | progressPlanInfoFlag.setPlanTime(record.getPlanTime()); |
| | | progressPlanInfoFlag.setPlanTimeFlag(record.getPlanTimeFlag()); |
| | | progressPlanInfoFlag.setPlanInfoList( |
| | | new LambdaQueryChainWrapper<>(projectPlanInfoMapper) |
| | | .eq(ProjectPlanInfo::getProjectPlanRecordId, record.getId()) |
| | | .eq(ProjectPlanInfo::getDeleted, 0) // 未删除 |
| | | .eq(ProjectPlanInfo::getPlanStatus, 2) // 计划项审批通过 |
| | | .list() |
| | | ); |
| | | seasonProgress.add(progressPlanInfoFlag); |
| | | }); |
| | | .eq(ProjectPlanRecord::getProjectInfoId, id) |
| | | .eq(ProjectPlanRecord::getPlanTimeFlag, 1) |
| | | .list() |
| | | .stream().forEach(record -> { |
| | | ProgressPlanInfoFlag progressPlanInfoFlag = new ProgressPlanInfoFlag(); |
| | | progressPlanInfoFlag.setPlanTime(record.getPlanTime()); |
| | | progressPlanInfoFlag.setPlanTimeFlag(record.getPlanTimeFlag()); |
| | | progressPlanInfoFlag.setPlanInfoList( |
| | | new LambdaQueryChainWrapper<>(projectPlanInfoMapper) |
| | | .eq(ProjectPlanInfo::getProjectPlanRecordId, record.getId()) |
| | | .eq(ProjectPlanInfo::getDeleted, 0) // 未删除 |
| | | .eq(ProjectPlanInfo::getPlanStatus, 2) // 计划项审批通过 |
| | | .list() |
| | | ); |
| | | seasonProgress.add(progressPlanInfoFlag); |
| | | }); |
| | | |
| | | // 查询年度计划项 |
| | | new LambdaQueryChainWrapper<>(projectPlanRecordMapper) |
| | | .eq(ProjectPlanRecord::getProjectInfoId, id) |
| | | .eq(ProjectPlanRecord::getPlanTimeFlag, 2) |
| | | .list() |
| | | .stream().forEach(record -> { |
| | | ProgressPlanInfoFlag progressPlanInfoFlag = new ProgressPlanInfoFlag(); |
| | | progressPlanInfoFlag.setPlanTime(record.getPlanTime()); |
| | | progressPlanInfoFlag.setPlanTimeFlag(record.getPlanTimeFlag()); |
| | | progressPlanInfoFlag.setPlanInfoList( |
| | | new LambdaQueryChainWrapper<>(projectPlanInfoMapper) |
| | | .eq(ProjectPlanInfo::getProjectPlanRecordId, record.getId()) |
| | | .eq(ProjectPlanInfo::getDeleted, 0) // 未删除 |
| | | .eq(ProjectPlanInfo::getPlanStatus, 2) // 计划项审批通过 |
| | | .list() |
| | | ); |
| | | yearProgress.add(progressPlanInfoFlag); |
| | | }); |
| | | .eq(ProjectPlanRecord::getProjectInfoId, id) |
| | | .eq(ProjectPlanRecord::getPlanTimeFlag, 2) |
| | | .list() |
| | | .stream().forEach(record -> { |
| | | ProgressPlanInfoFlag progressPlanInfoFlag = new ProgressPlanInfoFlag(); |
| | | progressPlanInfoFlag.setPlanTime(record.getPlanTime()); |
| | | progressPlanInfoFlag.setPlanTimeFlag(record.getPlanTimeFlag()); |
| | | progressPlanInfoFlag.setPlanInfoList( |
| | | new LambdaQueryChainWrapper<>(projectPlanInfoMapper) |
| | | .eq(ProjectPlanInfo::getProjectPlanRecordId, record.getId()) |
| | | .eq(ProjectPlanInfo::getDeleted, 0) // 未删除 |
| | | .eq(ProjectPlanInfo::getPlanStatus, 2) // 计划项审批通过 |
| | | .list() |
| | | ); |
| | | yearProgress.add(progressPlanInfoFlag); |
| | | }); |
| | | |
| | | vo.setMonthProgress(monthProgress); |
| | | vo.setSeasonProgress(seasonProgress); |
| | | vo.setYearProgress(yearProgress); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | |
| | | /** |
| | | * 列表 |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result saveProjectProgressFileLists(ProjectProgressFileListsRequest request) { |
| | | public Result saveProjectProgressFileLists(ProjectProgressFileListsForm form) { |
| | | new LambdaUpdateChainWrapper<>(fileMapper) |
| | | .eq(File::getBusId, request.getProjectReportId()) |
| | | .eq(File::getBusId, form.getProjectReportId()) |
| | | .eq(File::getType, FileTypeEnum.PROJECT_SITUATION_DESCRIPTION.getType()) |
| | | .set(File::getDeleted,1) |
| | | .update(); |
| | | .remove(); |
| | | |
| | | request.getSituationDescriptionFileList().stream() |
| | | form.getSituationDescriptionFileList().stream() |
| | | .forEach(file -> { |
| | | file.setId(null); |
| | | file.setBusId(request.getProjectReportId().longValue()); |
| | | file.setBusId(form.getProjectReportId()); |
| | | file.setType(FileTypeEnum.PROJECT_SITUATION_DESCRIPTION); |
| | | file.setGmtCreate(new Date()); |
| | | file.setGmtUpdate(new Date()); |
| | | file.setDeleted(0); |
| | | fileMapper.insert(file); |
| | | }); |
| | | |
| | | new LambdaUpdateChainWrapper<>(fileMapper) |
| | | .eq(File::getBusId, request.getProjectReportId()) |
| | | .eq(File::getBusId, form.getProjectReportId()) |
| | | .eq(File::getType, FileTypeEnum.PROJECT_COMPLETE_REPORT.getType()) |
| | | .set(File::getDeleted,1) |
| | | .update(); |
| | | .remove(); |
| | | |
| | | request.getCompletedReportFileList().stream() |
| | | form.getCompletedReportFileList().stream() |
| | | .forEach(file -> { |
| | | file.setId(null); |
| | | file.setBusId(request.getProjectReportId().longValue()); |
| | | file.setBusId(form.getProjectReportId()); |
| | | file.setType(FileTypeEnum.PROJECT_COMPLETE_REPORT); |
| | | file.setGmtCreate(new Date()); |
| | | file.setGmtUpdate(new Date()); |
| | | file.setDeleted(0); |
| | | fileMapper.insert(file); |
| | | }); |
| | | return Result.ok("保存成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result getProjectProgressForm(Integer id) { |
| | | ProjectProgressFileListsRequest result = new ProjectProgressFileListsRequest(); |
| | | public Result getProjectProgressForm(Long id) { |
| | | ProjectProgressFileListsForm result = new ProjectProgressFileListsForm(); |
| | | result.setProjectReportId(id); |
| | | result.setCompletedReportFileList(new LambdaQueryChainWrapper<>(fileMapper) |
| | | .eq(File::getBusId, id) |
| | | .eq(File::getType, FileTypeEnum.PROJECT_COMPLETE_REPORT) |
| | | .eq(File::getDeleted, 0) |
| | | .list()); |
| | | .eq(File::getBusId, id) |
| | | .eq(File::getType, FileTypeEnum.PROJECT_COMPLETE_REPORT) |
| | | .eq(File::getDeleted, 0) |
| | | .list()); |
| | | result.setSituationDescriptionFileList(new LambdaQueryChainWrapper<>(fileMapper) |
| | | .eq(File::getBusId, id) |
| | | .eq(File::getType, FileTypeEnum.PROJECT_SITUATION_DESCRIPTION) |
| | | .eq(File::getDeleted, 0) |
| | | .list()); |
| | | .eq(File::getBusId, id) |
| | | .eq(File::getType, FileTypeEnum.PROJECT_SITUATION_DESCRIPTION) |
| | | .eq(File::getDeleted, 0) |
| | | .list()); |
| | | return Result.ok().data(result); |
| | | } |
| | | } |