diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/HzProjectDeclareAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java similarity index 92% rename from hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/HzProjectDeclareAction.java rename to hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java index c54db61..00be560 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/HzProjectDeclareAction.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java @@ -19,7 +19,7 @@ import org.springframework.statemachine.annotation.WithStateMachine; */ @Slf4j @WithStateMachine(id = ProjectDeclareStateMachineBuilderImpl.MACHINE_ID) -public class HzProjectDeclareAction { +public class ProjectDeclareAction { private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; @@ -274,6 +274,29 @@ public class HzProjectDeclareAction { project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); } + @OnTransition(source = "TO_BE_PURCHASED", target = "ON_PURCHASING") + public void SUBMIT_PURCHASE_NOTICE(Message message) { + Project project = getProject(message); + project.setStatus(ProjectStatusEnum.ON_PURCHASING.getCode()); + } + + @OnTransition(source = "ON_PURCHASING", target = "TO_BE_FIRST_INSPECTED") + public void SUBMIT_OPERATION_PLAN(Message message) { + Project project = getProject(message); + project.setStatus(ProjectStatusEnum.TO_BE_FIRST_INSPECTED.getCode()); + } + + @OnTransition(source = "TO_BE_FIRST_INSPECTED", target = "ON_FIRST_INSPECTED") + public void SUBMIT_FIRST_INSPECTED_FILES(Message message) { + Project project = getProject(message); + project.setStatus(ProjectStatusEnum.ON_FIRST_INSPECTED.getCode()); + } + + @OnTransition(source = "ON_FIRST_INSPECTED", target = "TO_BE_FINALLY_INSPECTED") + public void FIRST_INSPECTED_PASSED(Message message) { + Project project = getProject(message); + project.setStatus(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); + } @OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") public void FINAL_ACCEPTANCE_APPLICATION(Message message) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareChoiceAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareActionChoice.java similarity index 93% rename from hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareChoiceAction.java rename to hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareActionChoice.java index c481265..5a830ba 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareChoiceAction.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareActionChoice.java @@ -3,10 +3,8 @@ package com.hz.pm.api.common.statemachine.action; import cn.hutool.core.collection.CollUtil; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.toolkit.Assert; -import com.hz.pm.api.common.model.constant.ProjectDeclareConst; import com.hz.pm.api.common.model.constant.StateMachineConst; import com.hz.pm.api.common.enumeration.CommonEnum; -import com.hz.pm.api.common.statemachine.util.StateMachineUtil; import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent; import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; import com.hz.pm.api.projectlib.model.entity.Project; @@ -26,7 +24,7 @@ import static com.hz.pm.api.common.model.constant.StateMachineConst.APPLICATION_ * @since 2023/02/07 22:31 */ @Slf4j -public class ProjectDeclareChoiceAction implements Action { +public class ProjectDeclareActionChoice implements Action { private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; @@ -45,7 +43,7 @@ public class ProjectDeclareChoiceAction implements Action省级部门联审中,预审中,完成其中一种状态 .withChoice() .source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) - .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, new PendingPreQualificationChoiceGuard(), new ProjectDeclareChoiceAction()) - .last(ProjectStatusEnum.PRE_APPLYING, new ProjectDeclareChoiceAction()).and() + .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, new PendingPreQualificationChoiceGuard(), new ProjectDeclareActionChoice()) + .last(ProjectStatusEnum.PRE_APPLYING, new ProjectDeclareActionChoice()).and() // 省级部门联审通过,从省级部门联审中到省级部门联审成功 .withExternal() @@ -141,8 +141,8 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat .withChoice() .source(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE) .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS, new PendingPreQualificationChoiceGuard() - , new ProjectDeclareChoiceAction()) - .last(ProjectStatusEnum.PENDING_PREQUALIFICATION, new ProjectDeclareChoiceAction()).and() + , new ProjectDeclareActionChoice()) + .last(ProjectStatusEnum.PENDING_PREQUALIFICATION, new ProjectDeclareActionChoice()).and() // 预审不通过重新提交,从预审不通过到待预审选择 .withExternal() .source(ProjectStatusEnum.PREQUALIFICATION_FAILED) @@ -151,8 +151,8 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat // 预审不通过重新提交,从待预审选择->省级部门联审中,预审中,完成其中一种状态 .withChoice() .source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) - .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, new PendingPreQualificationChoiceGuard(), new ProjectDeclareChoiceAction()) - .last(ProjectStatusEnum.PRE_APPLYING, new ProjectDeclareChoiceAction()).and() + .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS, new PendingPreQualificationChoiceGuard(), new ProjectDeclareActionChoice()) + .last(ProjectStatusEnum.PRE_APPLYING, new ProjectDeclareActionChoice()).and() // 部门联审通过,从部门联审中到年度计划中 .withExternal() .source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) @@ -228,9 +228,23 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat // 待采购采购备案,从待采购到实施中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.OPERATION) - .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() - + .target(ProjectStatusEnum.ON_PURCHASING) + .event(ProjectStatusChangeEvent.SUBMIT_PURCHASE_NOTICE).and() + // 填写试试计划 -> 待初验 + .withExternal() + .source(ProjectStatusEnum.ON_PURCHASING) + .target(ProjectStatusEnum.TO_BE_FIRST_INSPECTED) + .event(ProjectStatusChangeEvent.SUBMIT_OPERATION_PLAN).and() + // 上传初验材料 + .withExternal() + .source(ProjectStatusEnum.TO_BE_FIRST_INSPECTED) + .target(ProjectStatusEnum.ON_FIRST_INSPECTED) + .event(ProjectStatusChangeEvent.SUBMIT_FIRST_INSPECTED_FILES).and() + // 初验审批通过 + .withExternal() + .source(ProjectStatusEnum.ON_FIRST_INSPECTED) + .target(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED) + .event(ProjectStatusChangeEvent.FIRST_INSPECTED_PASSED).and() // 待开工 实施,从实施到建设中 .withExternal() .source(ProjectStatusEnum.OPERATION) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/event/ProjectStatusChangeEvent.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/event/ProjectStatusChangeEvent.java index 72d23ce..e88fdfe 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/event/ProjectStatusChangeEvent.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/event/ProjectStatusChangeEvent.java @@ -136,10 +136,21 @@ public enum ProjectStatusChangeEvent { */ REGISTER_APP(ProjectStatusEnum.TO_BE_APP_REGISTER.getCode(), null, null), /** - * 采购备案(项目状态变为:待开工) + * 发布采购公告 */ - PURCHASE_PUT_ON_RECORD(ProjectStatusEnum.TO_BE_PURCHASED.getCode(), null, null), - + SUBMIT_PURCHASE_NOTICE(ProjectStatusEnum.TO_BE_PURCHASED.getCode(), null, null), + /** + * 填写实施计划 + */ + SUBMIT_OPERATION_PLAN(ProjectStatusEnum.ON_PURCHASING.getCode(), null, null), + /** + * 上传初验材料 + */ + SUBMIT_FIRST_INSPECTED_FILES(ProjectStatusEnum.TO_BE_FIRST_INSPECTED.getCode(), null, null), + /** + * 初验通过 + */ + FIRST_INSPECTED_PASSED(ProjectStatusEnum.ON_FIRST_INSPECTED.getCode(), null, null), /** * 开工 到建设中 */ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/MhFileClient.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/MhFileClient.java index b145f2c..d2036fb 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/external/MhFileClient.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/MhFileClient.java @@ -9,12 +9,13 @@ import com.ningdatech.basic.exception.BizException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Collection; +import java.util.Arrays; +import java.util.Collections; import java.util.List; /** @@ -30,6 +31,8 @@ import java.util.List; @RequiredArgsConstructor public class MhFileClient { + private final Environment environment; + private static final int TIMEOUT_MILLS = 10000; @Value("${mh.file.down-url:}") @@ -38,6 +41,11 @@ public class MhFileClient { @Value("${mh.file.detail-url:}") private String fileDetailUrl; + private boolean isProdEnv() { + String[] profiles = environment.getActiveProfiles(); + return Arrays.asList(profiles).contains("prod"); + } + public void download(String fileId, HttpServletResponse response) { String fileUrl = fileDownUrl + "/" + fileId; try (ServletOutputStream stream = response.getOutputStream()) { @@ -45,7 +53,9 @@ public class MhFileClient { log.info("下载文件:{},大小为:{}", fileId, size); } catch (Exception e) { log.error("信创平台文件下载异常:{}", fileId, e); - throw BizException.wrap("下载文件失败"); + if (isProdEnv()) { + throw BizException.wrap("下载文件失败"); + } } } @@ -59,9 +69,14 @@ public class MhFileClient { if (ret.isOk()) { return ret.getData(); } - throw BizException.wrap("获取文件详情失败"); + throw BizException.wrap(ret.getMsg()); } catch (Exception e) { - throw BizException.wrap("获取文件详情失败"); + log.error("信创平台文件详情获取异常:{}", fileIds, e); + if (isProdEnv()) { + throw BizException.wrap("获取文件详情失败"); + } else { + return Collections.emptyList(); + } } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/FinalAcceptanceController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/FinalAcceptanceController.java index d4b006c..1fe20d0 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/FinalAcceptanceController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/FinalAcceptanceController.java @@ -44,8 +44,8 @@ public class FinalAcceptanceController { @GetMapping("/export") @ApiOperation("待终验申报的项目导出") @WebLog("待终验申报的项目导出") - public void exportList(ProjectListReq req, HttpServletResponse response){ - ExcelDownUtil.downXls(response,req,finalAcceptanceManage::exportList); + public void exportList(ProjectListReq req, HttpServletResponse response) { + ExcelDownUtil.downXls(response, req, finalAcceptanceManage::exportList); } @ApiOperation(value = "待终验申报的项目列表", notes = "待终验申报的项目列表") @@ -65,8 +65,9 @@ public class FinalAcceptanceController { @ApiOperation(value = "终验申报重新提交", notes = "终验申报重新提交") @WebLog("终验申报重新提交") @PostMapping("/restart-process") - public String restartTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) { - String instanceId = finalAcceptanceManage.restartProcess(dto); + public String restartTheProcess(@Validated @RequestBody SubmitFinallyInspectedReq req) { + String instanceId = finalAcceptanceManage.startProcess(req); return "终验申报 【" + instanceId + "】 成功"; } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java index 6f3e1b3..2490c65 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java @@ -278,7 +278,7 @@ public class ConstructionManage { VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!"); //首先要判断 项目当前状态 是不是 采购结果备案 - VUtils.isTrue(!ProjectStatusEnum.UNDER_CONSTRUCTION.getCode().equals(project.getStatus()) || + VUtils.isTrue(!ProjectStatusEnum.ON_PURCHASING.getCode().equals(project.getStatus()) || !ProjectStatusEnum.PROJECT_APPROVED.getCode().equals(project.getStage())) .throwMessage("提交失败 该项目不是 建设中或者已立项阶段"); @@ -571,8 +571,6 @@ public class ConstructionManage { purchaseInst.setInstCode(instanceId); purchaseInst.setInstType(ProjectProcessStageEnum.XC_APPROVAL_PROCESS.getCode()); purchaseInst.setProjectId(req.getProjectId()); - purchaseInst.setUpdateOn(LocalDateTime.now()); - purchaseInst.setCreatOn(projectInst.getUpdateOn()); purchaseInstService.save(purchaseInst); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java index 0a2058f..5ee69d9 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/FinalAcceptanceManage.java @@ -3,17 +3,22 @@ package com.hz.pm.api.projectdeclared.manage; import cn.hutool.core.collection.CollUtil; import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Assert; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; import com.hz.pm.api.common.helper.UserInfoHelper; import com.hz.pm.api.common.model.constant.BizConst; +import com.hz.pm.api.common.statemachine.util.StateMachineUtil; +import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil; import com.hz.pm.api.common.util.ExcelDownUtil; import com.hz.pm.api.common.util.ExcelExportStyle; +import com.hz.pm.api.common.util.StrUtils; import com.hz.pm.api.projectdeclared.model.dto.DeclaredProjectExportDTO; import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; import com.hz.pm.api.projectdeclared.model.entity.Purchase; +import com.hz.pm.api.projectdeclared.model.entity.PurchaseInst; import com.hz.pm.api.projectdeclared.model.req.SubmitFinallyInspectedReq; import com.hz.pm.api.projectdeclared.model.vo.FinalAcceptanceVO; import com.hz.pm.api.projectdeclared.service.IPurchaseInstService; @@ -49,6 +54,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; import java.time.LocalDateTime; @@ -82,6 +88,8 @@ public class FinalAcceptanceManage { private final DefaultDeclaredProjectManage declaredProjectManage; private final NoticeManage noticeManage; private final ProjectLibManage projectLibManage; + private final StateMachineUtil stateMachineUtil; + private final TenderStateMachineUtil tenderStateMachineUtil; /** * 待采购的-项目列表 @@ -196,83 +204,53 @@ public class FinalAcceptanceManage { /** * 开启流程 * - * @param req - * @return + * @param req \ + * @return \ */ + @Transactional(rollbackFor = Exception.class) public String startProcess(SubmitFinallyInspectedReq req) { - - Purchase purchase = purchaseService.getById(req.getBidId()); - if (!TenderStatusEnum.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY.eq(purchase.getStatus())) { - throw BizException.wrap("该标段不支持终验申报"); - } - UserInfoDetails user = LoginUserUtil.loginUserDetail(); - WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) .eq(WflowModels::getProcessType, ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()) .last(BizConst.LIMIT_1)); - if (Objects.isNull(model)) { throw new BusinessException("找不到验收申报流程配置"); } - Project project = projectService.getNewProject(req.getProjectId()); - - ProcessStartParamsVo params = new ProcessStartParamsVo(); - params.setUser(declaredProjectManage.buildUser(user.getUserId())); - params.setProcessUsers(Collections.emptyMap()); - // 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 - Map orgModelMap = declaredProjectManage.buildOrgModelMap(user.getUserId(), project); - String instanceId = processInstanceService.startProcessLs(model, params, orgModelMap); - log.info("终验方案项目申报成功 【{}】", instanceId); - //发送给第一个审批人消息 - return instanceId; - } - - /** - * 重新申报 - * - * @param dto - * @return - */ - public String restartProcess(DefaultDeclaredDTO dto) { - UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); - ProjectDTO projectDto = dto.getProjectInfo(); - VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("重新提交失败 缺少项目ID!"); - Project projectInfo = projectService.getNewProject(projectDto.getId()); - VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("重新提交失败 此项目不存在!"); - VUtils.isTrue(StringUtils.isBlank(projectDto.getFinalAcceptanceMaterials())).throwMessage("提交失败 请提交终验材料!"); - WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) - .eq(WflowModels::getProcessType, ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()) - .last(BizConst.LIMIT_1)); - - if (Objects.isNull(model)) { - throw new BusinessException("找不到验收申报流程配置"); + List purchases = purchaseService.listByProjectId(req.getProjectId()); + Map purchaseMap = CollUtils.listToMap(purchases, Purchase::getId); + Purchase purchase = purchaseMap.get(req.getBidId()); + Assert.notNull(purchase, "当前标段不存在"); + if (!TenderStatusEnum.TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY.eq(purchase.getStatus()) + && !TenderStatusEnum.FINALLY_INSPECTED_FAILED.eq(purchase.getStatus())) { + throw BizException.wrap("该标段不支持终验申报"); } + UserInfoDetails user = LoginUserUtil.loginUserDetail(); - //首先要判断 项目当前状态 是不是 方案待申报 - VUtils.isTrue((!ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode().equals(projectInfo.getStatus()) && - !ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode().equals(projectInfo.getStatus())) || - !ProjectStatusEnum.PROJECT_APPROVED.getCode().equals(projectInfo.getStage())) - .throwMessage("提交失败 该项目不是 待终验状态|不通过或者已立项阶段"); - + Project project = projectService.getNewProject(req.getProjectId()); ProcessStartParamsVo params = new ProcessStartParamsVo(); params.setUser(declaredProjectManage.buildUser(user.getUserId())); params.setProcessUsers(Collections.emptyMap()); - //放入条件判断的项目字段 - //把条件值给放入工作流 - declaredProjectManage.buildCondition(params, projectInfo, dto); // 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 - Map orgModelMap = declaredProjectManage.buildOrgModelMap(user.getUserId(), projectInfo); - String instanceId = processInstanceService.startProcessLs(model, params, orgModelMap); - log.info("终验方案项目重新申报成功 【{}】", instanceId); - - //保存终验项目 - //生成新版本 并且进入下一状态 - projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo, instanceId, projectDto, - InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(), Boolean.TRUE); + Map orgMap = declaredProjectManage.buildOrgModelMap(user.getUserId(), project); + String instanceId = processInstanceService.startProcessLs(model, params, orgMap); + log.info("终验方案项目申报成功 【{}】", instanceId); + tenderStateMachineUtil.pass(purchase); + purchase.setFinalInspectionMaterials(req.getInspectionMaterials()); + purchaseService.updateById(purchase); + PurchaseInst purchaseInst = new PurchaseInst(); + purchaseInst.setBidId(req.getBidId()); + purchaseInst.setInstCode(instanceId); + purchaseInst.setProjectId(req.getProjectId()); + purchaseInst.setInstType(ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()); + purchaseInstService.save(purchaseInst); + boolean allFinalInspected = purchases.stream().noneMatch(w -> StrUtils.isBlank(w.getFinalInspectionMaterials())); + if (allFinalInspected) { + stateMachineUtil.pass(project); + projectService.updateById(project); + } //发送给第一个审批人消息 - noticeManage.sendFirstUser(projectInfo, model.getFormName(), instanceId, PASS_MSG_TEMPLATE, PROJECT_REVIEW); return instanceId; } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java index b4ef654..7d782ea 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java @@ -110,6 +110,9 @@ public class Purchase { @ApiModelProperty("实际成效指标") private String actualPerformanceIndicators; + @ApiModelProperty("终验申报材料") + private String finalInspectionMaterials; + @ApiModelProperty("是否符合信创符合性要求") private Boolean matchXcfhx; @@ -123,5 +126,4 @@ public class Purchase { private String xcfhxReportFiles; - } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/PurchaseInst.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/PurchaseInst.java index 28f86ad..77b9556 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/PurchaseInst.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/PurchaseInst.java @@ -1,8 +1,6 @@ package com.hz.pm.api.projectdeclared.model.entity; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -37,9 +35,11 @@ public class PurchaseInst { private Integer instType; @ApiModelProperty("创建时间") + @TableField(fill = FieldFill.INSERT) private LocalDateTime creatOn; - @ApiModelProperty("修改时间") - private LocalDateTime updateOn; + @ApiModelProperty("创建人") + @TableField(fill = FieldFill.INSERT) + private Long createBy; } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitFinallyInspectedReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitFinallyInspectedReq.java index 84d662d..00ed899 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitFinallyInspectedReq.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitFinallyInspectedReq.java @@ -28,10 +28,4 @@ public class SubmitFinallyInspectedReq { @NotBlank(message = "请提交初验材料") private String inspectionMaterials; - @ApiModelProperty("是否完成日志数据归集") - private Boolean isCompletedLogCollection; - - @ApiModelProperty("实际成效指标") - private String actualPerformanceIndicators; - } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/RestartProcessMapUtil.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/RestartProcessMapUtil.java index a57cf72..83f46d0 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/RestartProcessMapUtil.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/RestartProcessMapUtil.java @@ -27,7 +27,6 @@ public class RestartProcessMapUtil { ConstructionPlanManage constructionPlanManage, PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage, ReviewByProvincialDeptManage provincialDeptManage, - FinalAcceptanceManage finalAcceptanceManage, DeclaredRecordManage declaredRecordManage) { //重新项目申报 RESTART_PROCESS_MAP.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), @@ -41,9 +40,6 @@ public class RestartProcessMapUtil { //省级联审 RESTART_PROCESS_MAP.put(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), provincialDeptManage::restartTheProcess); - //终审 - RESTART_PROCESS_MAP.put(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode(), - finalAcceptanceManage::restartProcess); // 立项备案重新提交 RESTART_PROCESS_MAP.put(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode(), declaredRecordManage::restartDeclaredRecord); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/TenderPurchaseHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/TenderPurchaseHandle.java index 91e7232..5ca5e08 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/TenderPurchaseHandle.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/TenderPurchaseHandle.java @@ -75,7 +75,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { // 根据采购备案的时间获取 ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectIds) - .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD.name()) + .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.SUBMIT_PURCHASE_NOTICE.name()) .orderByDesc(ProjectStatusChange::getCreateOn) .last(BizConst.LIMIT_1)); processDetailVO.setFinishTime(projectStatusChange.getCreateOn());