| | |
| | | package com.ycl.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.ycl.common.base.Result; |
| | | import com.ycl.common.enums.business.FileTypeEnum; |
| | | import com.ycl.domain.entity.File; |
| | | 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.framework.utils.PageUtil; |
| | | import com.ycl.mapper.FileMapper; |
| | | import com.ycl.mapper.ProjectPlanExamineRecordMapper; |
| | | import com.ycl.mapper.ProjectPlanInfoMapper; |
| | | import com.ycl.mapper.ProjectPlanProgressReportMapper; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private final ProjectPlanExamineRecordMapper projectPlanExamineRecordMapper; |
| | | @Autowired |
| | | private ProjectPlanInfoMapper projectPlanInfoMapper; |
| | | @Autowired |
| | | private FileMapper fileMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public Result add(ProgressReportResponseVO form) { |
| | | |
| | | ProjectPlanProgressReport projectPlanProgressReport = new ProjectPlanProgressReport(); |
| | | projectPlanProgressReport.setProjectPlanInfoId(form.getId().longValue()); |
| | | projectPlanProgressReport.setStartTime(form.getActualStartTime()); |
| | |
| | | projectPlanProgressReport.setId(form.getProgressReportId()); |
| | | // baseMapper.updateOne(projectPlanProgressReport); |
| | | baseMapper.updateById(projectPlanProgressReport); |
| | | } |
| | | |
| | | // 文件上传 |
| | | new LambdaUpdateChainWrapper<>(fileMapper) |
| | | .eq(File::getBusId, form.getId()) |
| | | .eq(File::getType, FileTypeEnum.PROJECT_PROGRESS_INFO_REPORT.getType()) |
| | | .set(File::getDeleted,1) |
| | | .update(); |
| | | if (form.getFileList() != null && form.getFileList().size() > 0) { |
| | | form.getFileList().stream() |
| | | .forEach(file -> { |
| | | file.setId(null); |
| | | file.setBusId(form.getId().longValue()); |
| | | file.setType(FileTypeEnum.PROJECT_PROGRESS_INFO_REPORT); |
| | | file.setGmtCreate(new Date()); |
| | | file.setGmtUpdate(new Date()); |
| | | file.setDeleted(0); |
| | | fileMapper.insert(file); |
| | | }); |
| | | } |
| | | |
| | | // 更新上级批复 |
| | |
| | | @Override |
| | | public Result detail(Integer id) { |
| | | ProgressReportResponseVO 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()); |
| | | } |
| | | return Result.ok().data(vo); |
| | | } |
| | | |