| | |
| | | import com.ycl.domain.entity.ProjectPlanExamineRecord; |
| | | import com.ycl.domain.entity.ProjectPlanInfo; |
| | | import com.ycl.domain.entity.ProjectPlanProgressReport; |
| | | import com.ycl.domain.vo.ProgressReportResponseVO; |
| | | import com.ycl.domain.form.ProgressReportResponseForm; |
| | | import com.ycl.framework.utils.PageUtil; |
| | | import com.ycl.mapper.FileMapper; |
| | | import com.ycl.mapper.ProjectPlanExamineRecordMapper; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public Result add(ProgressReportResponseVO form) { |
| | | |
| | | public Result add(ProgressReportResponseForm form) { |
| | | // 判断上报状态 |
| | | if (form.getProgressStatusInt() == 0) { // 未开始 上报进度 |
| | | ProjectPlanProgressReport projectPlanProgressReport = new ProjectPlanProgressReport(); |
| | | projectPlanProgressReport.setProjectPlanInfoId(form.getId().longValue()); |
| | | projectPlanProgressReport.setProjectPlanInfoId(form.getId()); |
| | | projectPlanProgressReport.setStartTime(form.getActualStartTime()); |
| | | projectPlanProgressReport.setEndTime(form.getActualEndTime()); |
| | | projectPlanProgressReport.setProgressStatus(form.getProgressStatusStr()); |
| | |
| | | baseMapper.insert(projectPlanProgressReport); |
| | | }else if (form.getProgressStatusInt() == 2) { // 已驳回 重新上报 |
| | | ProjectPlanProgressReport projectPlanProgressReport = baseMapper.selectById(form.getProgressReportId()); |
| | | projectPlanProgressReport.setProjectPlanInfoId(form.getId().longValue()); |
| | | projectPlanProgressReport.setProjectPlanInfoId(form.getId()); |
| | | projectPlanProgressReport.setStartTime(form.getActualStartTime()); |
| | | projectPlanProgressReport.setEndTime(form.getActualEndTime()); |
| | | projectPlanProgressReport.setProgressStatus(form.getProgressStatusStr()); |
| | |
| | | .eq(File::getType, FileTypeEnum.PROJECT_PROGRESS_INFO_REPORT.getType()) |
| | | .set(File::getDeleted,1) |
| | | .update(); |
| | | if (form.getFileList() != null && form.getFileList().size() > 0) { |
| | | if (!CollectionUtils.isEmpty(form.getFileList()) && form.getFileList().size() > 0) { |
| | | form.getFileList().stream() |
| | | .forEach(file -> { |
| | | file.setId(null); |
| | | file.setBusId(form.getId().longValue()); |
| | | file.setBusId(form.getId()); |
| | | file.setType(FileTypeEnum.PROJECT_PROGRESS_INFO_REPORT); |
| | | file.setGmtCreate(new Date()); |
| | | file.setGmtUpdate(new Date()); |
| | | file.setDeleted(0); |
| | | fileMapper.insert(file); |
| | | }); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(Integer id) { |
| | | ProgressReportResponseVO vo = baseMapper.getDetail(id); |
| | | public Result detail(Long id) { |
| | | ProgressReportResponseForm vo = baseMapper.getDetail(id); |
| | | if (vo != null) { |
| | | vo.setFileList(new LambdaQueryChainWrapper<>(fileMapper).eq(File::getBusId, id).eq(File::getType, FileTypeEnum.PROJECT_PROGRESS_INFO_REPORT).list()); |
| | | vo.setFileList(new LambdaQueryChainWrapper<>(fileMapper) |
| | | .eq(File::getBusId, id) |
| | | .eq(File::getType, FileTypeEnum.PROJECT_PROGRESS_INFO_REPORT) |
| | | .list()); |
| | | } |
| | | return Result.ok().data(vo); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result examine(ProgressReportResponseVO form) { |
| | | public Result examine(ProgressReportResponseForm form) { |
| | | // 获得审批记录副本 |
| | | ProjectPlanExamineRecord record = projectPlanExamineRecordMapper.selectById(form.getExamineRecordId()); |
| | | |
| | |
| | | newRecord.setManageExamine(form.getManageExamine()); |
| | | newRecord.setManageApproval(form.getManageApproval()); |
| | | newRecord.setEventType(2); |
| | | newRecord.setDeleted(0); |
| | | projectPlanExamineRecordMapper.insert(newRecord); |
| | | |
| | | // 判断审批结果 |