business/src/main/java/com/ycl/controller/ProjectPlanExamineRecordController.java
@@ -6,6 +6,7 @@ import com.ycl.common.group.Update; import com.ycl.domain.form.ProjectPlanExamineRecordForm; import com.ycl.domain.query.ProjectPlanExamineRecordQuery; import com.ycl.domain.vo.ProgressReportResponseVO; import com.ycl.service.ProjectPlanExamineRecordService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -108,4 +109,8 @@ return projectPlanExamineRecordService.todoList(getUserId(),query); } @PostMapping("/reply") public Result reply(@RequestBody ProgressReportResponseVO form) { return projectPlanExamineRecordService.reply(form); } } business/src/main/java/com/ycl/domain/vo/ProgressReportResponseVO.java
@@ -23,11 +23,12 @@ private Integer planTime; private Integer PlanTimeFlag; private String title; private Integer progressStatusInt; private Date startTime; private Date endTime; private Date actualStartTime; private Date actualEndTime; private String progressStatus; private String progressStatusStr; private BigDecimal actualInvest; private Integer departmentExamine; private String departmentApproval; business/src/main/java/com/ycl/domain/vo/ProjectPlanResponseVO.java
@@ -12,11 +12,11 @@ private String projectName; private Integer reportStatus; private String projectCode; private Integer projectType; private String projectType; private Integer projectPhase; private Integer monthStatus; private Integer seasonStatus; private Integer yearStatus; private Integer projectStatus; private Integer investType; private String projectStatus; private String investType; } business/src/main/java/com/ycl/service/ProjectPlanExamineRecordService.java
@@ -5,6 +5,8 @@ import com.ycl.common.base.Result; import com.ycl.domain.form.ProjectPlanExamineRecordForm; import com.ycl.domain.query.ProjectPlanExamineRecordQuery; import com.ycl.domain.vo.ProgressReportResponseVO; import java.util.List; /** @@ -92,4 +94,6 @@ Result saveExamine(ProjectPlanExamineRecordForm form); Result todoList(Long userId,ProjectPlanExamineRecordQuery query); Result reply(ProgressReportResponseVO form); } business/src/main/java/com/ycl/service/impl/ProgressPlanServiceImpl.java
@@ -129,6 +129,8 @@ progressPlanInfoFlag.setPlanInfoList( new LambdaQueryChainWrapper<>(projectPlanInfoMapper) .eq(ProjectPlanInfo::getProjectPlanRecordId, record.getId()) .eq(ProjectPlanInfo::getDeleted, 0) // 未删除 .eq(ProjectPlanInfo::getPlanStatus, 2) // 计划项审批通过 .list() ); monthProgress.add(progressPlanInfoFlag); @@ -146,6 +148,8 @@ progressPlanInfoFlag.setPlanInfoList( new LambdaQueryChainWrapper<>(projectPlanInfoMapper) .eq(ProjectPlanInfo::getProjectPlanRecordId, record.getId()) .eq(ProjectPlanInfo::getDeleted, 0) // 未删除 .eq(ProjectPlanInfo::getPlanStatus, 2) // 计划项审批通过 .list() ); seasonProgress.add(progressPlanInfoFlag); @@ -163,6 +167,8 @@ progressPlanInfoFlag.setPlanInfoList( new LambdaQueryChainWrapper<>(projectPlanInfoMapper) .eq(ProjectPlanInfo::getProjectPlanRecordId, record.getId()) .eq(ProjectPlanInfo::getDeleted, 0) // 未删除 .eq(ProjectPlanInfo::getPlanStatus, 2) // 计划项审批通过 .list() ); yearProgress.add(progressPlanInfoFlag); business/src/main/java/com/ycl/service/impl/ProjectPlanExamineRecordServiceImpl.java
@@ -7,6 +7,7 @@ import com.ycl.domain.entity.ProjectPlanInfo; import com.ycl.domain.entity.ProjectPlanRecord; import com.ycl.domain.vo.DepartmentApprovalResponseVO; import com.ycl.domain.vo.ProgressReportResponseVO; import com.ycl.domain.vo.ProjectProcessToDoVo; import com.ycl.mapper.ProjectPlanExamineRecordMapper; import com.ycl.mapper.ProjectPlanInfoMapper; @@ -202,4 +203,14 @@ baseMapper.todoList(page, query, userId); return Result.ok().data(page.getRecords()).total(page.getTotal()); } @Override public Result reply(ProgressReportResponseVO form) { new LambdaUpdateChainWrapper<>(baseMapper) .eq(ProjectPlanExamineRecord::getId, form.getExamineRecordId()) .set(ProjectPlanExamineRecord::getDepartmentApprovalReply, form.getDepartmentApprovalReply()) .set(ProjectPlanExamineRecord::getManageApprovalReply, form.getManageApprovalReply()) .update(); return Result.ok("回复成功"); } } business/src/main/java/com/ycl/service/impl/ProjectPlanProgressReportServiceImpl.java
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; import com.ycl.common.base.Result; import com.ycl.common.enums.business.FileTypeEnum; import com.ycl.common.utils.SecurityUtils; import com.ycl.domain.entity.File; import com.ycl.domain.entity.ProjectPlanExamineRecord; import com.ycl.domain.entity.ProjectPlanInfo; @@ -62,12 +63,15 @@ projectPlanProgressReport.setProjectPlanInfoId(form.getId().longValue()); projectPlanProgressReport.setStartTime(form.getActualStartTime()); projectPlanProgressReport.setEndTime(form.getActualEndTime()); projectPlanProgressReport.setProgressStatus(form.getProgressStatus()); projectPlanProgressReport.setProgressStatus(form.getProgressStatusStr()); projectPlanProgressReport.setActualInvest(form.getActualInvest()); if (form.getProgressReportId() == null) { baseMapper.insertOne(projectPlanProgressReport); }else { projectPlanProgressReport.setId(form.getProgressReportId()); // 判断上报状态 if (form.getProgressStatusInt() == 0) { // 未开始 上报进度 // 新增进度上报内容 baseMapper.insert(projectPlanProgressReport); }else if (form.getProgressStatusInt() == 2) { // 已驳回 重新上报 // 更新进度上报内容 baseMapper.updateById(projectPlanProgressReport); } @@ -89,15 +93,7 @@ fileMapper.insert(file); }); } // 更新上级批复 new LambdaUpdateChainWrapper<>(projectPlanExamineRecordMapper) .eq(ProjectPlanExamineRecord::getId, form.getExamineRecordId()) .set(ProjectPlanExamineRecord::getDepartmentApprovalReply, form.getDepartmentApprovalReply()) .set(ProjectPlanExamineRecord::getManageApprovalReply, form.getManageApprovalReply()) .update(); // 更新上报状态 // 更新计划项的进度状态为未审核 new LambdaUpdateChainWrapper<>(projectPlanInfoMapper) .eq(ProjectPlanInfo::getId, form.getId()) .set(ProjectPlanInfo::getProgressStatus, 1) @@ -184,29 +180,37 @@ @Override public Result examine(ProgressReportResponseVO form) { // 更新审批记录 ProjectPlanExamineRecord record = new ProjectPlanExamineRecord(); record.setId(form.getExamineRecordId().longValue()); record.setDepartmentExamine(form.getDepartmentExamine()); record.setDepartmentApproval(form.getDepartmentApproval()); record.setManageExamine(form.getManageExamine()); record.setManageApproval(form.getManageApproval()); projectPlanExamineRecordMapper.updateById(record); // 获得审批记录副本 ProjectPlanExamineRecord record = projectPlanExamineRecordMapper.selectById(form.getExamineRecordId()); // 更新计划项状态 if (form.getDepartmentExamine() == 0 && form.getManageExamine() == 0){ // 新增一条审批记录 ProjectPlanExamineRecord newRecord = new ProjectPlanExamineRecord();; newRecord.setProjectPlanRecordId(record.getProjectPlanRecordId()); newRecord.setProjectPlanInfoId(record.getProjectPlanInfoId()); newRecord.setDepartmentUserId(SecurityUtils.getUserId()); newRecord.setDepartmentExamine(form.getDepartmentExamine()); newRecord.setDepartmentApproval(form.getDepartmentApproval()); newRecord.setManagerUserId(SecurityUtils.getUserId()); newRecord.setManageExamine(form.getManageExamine()); newRecord.setManageApproval(form.getManageApproval()); newRecord.setEventType(2); newRecord.setDeleted(0); projectPlanExamineRecordMapper.insert(newRecord); // 判断审批结果 if (form.getDepartmentExamine() == 0 && form.getManageExamine() == 0) { // 审批通过 // 计划项进度状态更新为已完成 new LambdaUpdateChainWrapper<>(projectPlanInfoMapper) .eq(ProjectPlanInfo::getId, form.getId()) .set(ProjectPlanInfo::getProgressStatus, 3) .update(); }else { }else { // 审批不通过 // 计划项进度状态更新为已驳回 new LambdaUpdateChainWrapper<>(projectPlanInfoMapper) .eq(ProjectPlanInfo::getId, form.getId()) .set(ProjectPlanInfo::getProgressStatus, 2) .update(); } return Result.ok("审批成功"); } } business/src/main/resources/mapper/ProjectPlanProgressReportMapper.xml
@@ -76,11 +76,12 @@ ppr.plan_time, ppr.plan_time_flag, ppi.title, ppi.progress_status AS progress_status_int, ppi.start_time, ppi.end_time, pppr.start_time AS actual_start_time, pppr.end_time AS actual_end_time, pppr.progress_status, pppr.progress_status AS progress_status_str, pppr.actual_invest, pper.department_examine, pper.department_approval, @@ -91,8 +92,12 @@ FROM t_project_plan_info AS ppi INNER JOIN t_project_plan_record AS ppr ON ppi.project_plan_record_id = ppr.id LEFT JOIN t_project_plan_progress_report AS pppr ON pppr.project_plan_info_id = ppi.id RIGHT JOIN t_project_plan_examine_record AS pper ON pper.project_plan_info_id = ppi.id WHERE ppi.id = #{id} LEFT JOIN t_project_plan_examine_record AS pper ON pper.project_plan_info_id = ppi.id WHERE ppi.id = #{id} AND pper.event_type = 2 AND pper.deleted = 0 ORDER BY pper.gmt_create DESC LIMIT 1 </select> </mapper>