@@ -19,7 +19,7 @@ import org.springframework.statemachine.annotation.WithStateMachine; | |||||
*/ | */ | ||||
@Slf4j | @Slf4j | ||||
@WithStateMachine(id = ProjectDeclareStateMachineBuilderImpl.MACHINE_ID) | @WithStateMachine(id = ProjectDeclareStateMachineBuilderImpl.MACHINE_ID) | ||||
public class HzProjectDeclareAction { | |||||
public class ProjectDeclareAction { | |||||
private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | ||||
@@ -274,6 +274,29 @@ public class HzProjectDeclareAction { | |||||
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); | project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "TO_BE_PURCHASED", target = "ON_PURCHASING") | |||||
public void SUBMIT_PURCHASE_NOTICE(Message<ProjectStatusChangeEvent> 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<ProjectStatusChangeEvent> 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<ProjectStatusChangeEvent> 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<ProjectStatusChangeEvent> 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") | @OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") | ||||
public void FINAL_ACCEPTANCE_APPLICATION(Message<ProjectStatusChangeEvent> message) { | public void FINAL_ACCEPTANCE_APPLICATION(Message<ProjectStatusChangeEvent> message) { |
@@ -3,10 +3,8 @@ package com.hz.pm.api.common.statemachine.action; | |||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import cn.hutool.json.JSONUtil; | import cn.hutool.json.JSONUtil; | ||||
import com.baomidou.mybatisplus.core.toolkit.Assert; | 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.model.constant.StateMachineConst; | ||||
import com.hz.pm.api.common.enumeration.CommonEnum; | 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.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | ||||
import com.hz.pm.api.projectlib.model.entity.Project; | 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 | * @since 2023/02/07 22:31 | ||||
*/ | */ | ||||
@Slf4j | @Slf4j | ||||
public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, ProjectStatusChangeEvent> { | |||||
public class ProjectDeclareActionChoice implements Action<ProjectStatusEnum, ProjectStatusChangeEvent> { | |||||
private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | ||||
@@ -45,7 +43,7 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro | |||||
approvedAfterChoice(stateContext); | approvedAfterChoice(stateContext); | ||||
break; | break; | ||||
default: | default: | ||||
throw new IllegalStateException("Unexpected value: " + projectStatusEnum); | |||||
throw new IllegalStateException("不支持的项目状态:" + projectStatusEnum); | |||||
} | } | ||||
} | } | ||||
@@ -1,6 +1,6 @@ | |||||
package com.hz.pm.api.common.statemachine.builder.impl; | package com.hz.pm.api.common.statemachine.builder.impl; | ||||
import com.hz.pm.api.common.statemachine.action.ProjectDeclareChoiceAction; | |||||
import com.hz.pm.api.common.statemachine.action.ProjectDeclareActionChoice; | |||||
import com.hz.pm.api.common.statemachine.builder.ProjectDeclareStateMachineBuilder; | import com.hz.pm.api.common.statemachine.builder.ProjectDeclareStateMachineBuilder; | ||||
import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent; | import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.hz.pm.api.common.statemachine.factory.ProjectDeclareGuardFactory.PendingPreQualificationChoiceGuard; | import com.hz.pm.api.common.statemachine.factory.ProjectDeclareGuardFactory.PendingPreQualificationChoiceGuard; | ||||
@@ -98,8 +98,8 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat | |||||
// 待预审申报,从待预审选择->省级部门联审中,预审中,完成其中一种状态 | // 待预审申报,从待预审选择->省级部门联审中,预审中,完成其中一种状态 | ||||
.withChoice() | .withChoice() | ||||
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | .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() | .withExternal() | ||||
@@ -141,8 +141,8 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat | |||||
.withChoice() | .withChoice() | ||||
.source(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE) | .source(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE) | ||||
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS, new PendingPreQualificationChoiceGuard() | .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() | .withExternal() | ||||
.source(ProjectStatusEnum.PREQUALIFICATION_FAILED) | .source(ProjectStatusEnum.PREQUALIFICATION_FAILED) | ||||
@@ -151,8 +151,8 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat | |||||
// 预审不通过重新提交,从待预审选择->省级部门联审中,预审中,完成其中一种状态 | // 预审不通过重新提交,从待预审选择->省级部门联审中,预审中,完成其中一种状态 | ||||
.withChoice() | .withChoice() | ||||
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | .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() | .withExternal() | ||||
.source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) | .source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) | ||||
@@ -228,9 +228,23 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat | |||||
// 待采购采购备案,从待采购到实施中 | // 待采购采购备案,从待采购到实施中 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_PURCHASED) | .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() | .withExternal() | ||||
.source(ProjectStatusEnum.OPERATION) | .source(ProjectStatusEnum.OPERATION) | ||||
@@ -136,10 +136,21 @@ public enum ProjectStatusChangeEvent { | |||||
*/ | */ | ||||
REGISTER_APP(ProjectStatusEnum.TO_BE_APP_REGISTER.getCode(), null, null), | 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), | |||||
/** | /** | ||||
* 开工 到建设中 | * 开工 到建设中 | ||||
*/ | */ | ||||
@@ -9,12 +9,13 @@ import com.ningdatech.basic.exception.BizException; | |||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
import org.springframework.core.env.Environment; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import javax.servlet.ServletOutputStream; | import javax.servlet.ServletOutputStream; | ||||
import javax.servlet.http.HttpServletResponse; | 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; | import java.util.List; | ||||
/** | /** | ||||
@@ -30,6 +31,8 @@ import java.util.List; | |||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
public class MhFileClient { | public class MhFileClient { | ||||
private final Environment environment; | |||||
private static final int TIMEOUT_MILLS = 10000; | private static final int TIMEOUT_MILLS = 10000; | ||||
@Value("${mh.file.down-url:}") | @Value("${mh.file.down-url:}") | ||||
@@ -38,6 +41,11 @@ public class MhFileClient { | |||||
@Value("${mh.file.detail-url:}") | @Value("${mh.file.detail-url:}") | ||||
private String fileDetailUrl; | private String fileDetailUrl; | ||||
private boolean isProdEnv() { | |||||
String[] profiles = environment.getActiveProfiles(); | |||||
return Arrays.asList(profiles).contains("prod"); | |||||
} | |||||
public void download(String fileId, HttpServletResponse response) { | public void download(String fileId, HttpServletResponse response) { | ||||
String fileUrl = fileDownUrl + "/" + fileId; | String fileUrl = fileDownUrl + "/" + fileId; | ||||
try (ServletOutputStream stream = response.getOutputStream()) { | try (ServletOutputStream stream = response.getOutputStream()) { | ||||
@@ -45,7 +53,9 @@ public class MhFileClient { | |||||
log.info("下载文件:{},大小为:{}", fileId, size); | log.info("下载文件:{},大小为:{}", fileId, size); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
log.error("信创平台文件下载异常:{}", fileId, e); | log.error("信创平台文件下载异常:{}", fileId, e); | ||||
throw BizException.wrap("下载文件失败"); | |||||
if (isProdEnv()) { | |||||
throw BizException.wrap("下载文件失败"); | |||||
} | |||||
} | } | ||||
} | } | ||||
@@ -59,9 +69,14 @@ public class MhFileClient { | |||||
if (ret.isOk()) { | if (ret.isOk()) { | ||||
return ret.getData(); | return ret.getData(); | ||||
} | } | ||||
throw BizException.wrap("获取文件详情失败"); | |||||
throw BizException.wrap(ret.getMsg()); | |||||
} catch (Exception e) { | } catch (Exception e) { | ||||
throw BizException.wrap("获取文件详情失败"); | |||||
log.error("信创平台文件详情获取异常:{}", fileIds, e); | |||||
if (isProdEnv()) { | |||||
throw BizException.wrap("获取文件详情失败"); | |||||
} else { | |||||
return Collections.emptyList(); | |||||
} | |||||
} | } | ||||
} | } | ||||
@@ -44,8 +44,8 @@ public class FinalAcceptanceController { | |||||
@GetMapping("/export") | @GetMapping("/export") | ||||
@ApiOperation("待终验申报的项目导出") | @ApiOperation("待终验申报的项目导出") | ||||
@WebLog("待终验申报的项目导出") | @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 = "待终验申报的项目列表") | @ApiOperation(value = "待终验申报的项目列表", notes = "待终验申报的项目列表") | ||||
@@ -65,8 +65,9 @@ public class FinalAcceptanceController { | |||||
@ApiOperation(value = "终验申报重新提交", notes = "终验申报重新提交") | @ApiOperation(value = "终验申报重新提交", notes = "终验申报重新提交") | ||||
@WebLog("终验申报重新提交") | @WebLog("终验申报重新提交") | ||||
@PostMapping("/restart-process") | @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 + "】 成功"; | return "终验申报 【" + instanceId + "】 成功"; | ||||
} | } | ||||
} | } |
@@ -278,7 +278,7 @@ public class ConstructionManage { | |||||
VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!"); | 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())) | !ProjectStatusEnum.PROJECT_APPROVED.getCode().equals(project.getStage())) | ||||
.throwMessage("提交失败 该项目不是 建设中或者已立项阶段"); | .throwMessage("提交失败 该项目不是 建设中或者已立项阶段"); | ||||
@@ -571,8 +571,6 @@ public class ConstructionManage { | |||||
purchaseInst.setInstCode(instanceId); | purchaseInst.setInstCode(instanceId); | ||||
purchaseInst.setInstType(ProjectProcessStageEnum.XC_APPROVAL_PROCESS.getCode()); | purchaseInst.setInstType(ProjectProcessStageEnum.XC_APPROVAL_PROCESS.getCode()); | ||||
purchaseInst.setProjectId(req.getProjectId()); | purchaseInst.setProjectId(req.getProjectId()); | ||||
purchaseInst.setUpdateOn(LocalDateTime.now()); | |||||
purchaseInst.setCreatOn(projectInst.getUpdateOn()); | |||||
purchaseInstService.save(purchaseInst); | purchaseInstService.save(purchaseInst); | ||||
} | } | ||||
@@ -3,17 +3,22 @@ package com.hz.pm.api.projectdeclared.manage; | |||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import com.alibaba.excel.EasyExcel; | import com.alibaba.excel.EasyExcel; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 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.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.google.common.collect.Lists; | import com.google.common.collect.Lists; | ||||
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | ||||
import com.hz.pm.api.common.helper.UserInfoHelper; | import com.hz.pm.api.common.helper.UserInfoHelper; | ||||
import com.hz.pm.api.common.model.constant.BizConst; | 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.ExcelDownUtil; | ||||
import com.hz.pm.api.common.util.ExcelExportStyle; | 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.DeclaredProjectExportDTO; | ||||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | 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.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.req.SubmitFinallyInspectedReq; | ||||
import com.hz.pm.api.projectdeclared.model.vo.FinalAcceptanceVO; | import com.hz.pm.api.projectdeclared.model.vo.FinalAcceptanceVO; | ||||
import com.hz.pm.api.projectdeclared.service.IPurchaseInstService; | 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.apache.commons.lang3.StringUtils; | ||||
import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.transaction.annotation.Transactional; | |||||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
@@ -82,6 +88,8 @@ public class FinalAcceptanceManage { | |||||
private final DefaultDeclaredProjectManage declaredProjectManage; | private final DefaultDeclaredProjectManage declaredProjectManage; | ||||
private final NoticeManage noticeManage; | private final NoticeManage noticeManage; | ||||
private final ProjectLibManage projectLibManage; | 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) { | 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) | WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | ||||
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()) | .eq(WflowModels::getProcessType, ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()) | ||||
.last(BizConst.LIMIT_1)); | .last(BizConst.LIMIT_1)); | ||||
if (Objects.isNull(model)) { | if (Objects.isNull(model)) { | ||||
throw new BusinessException("找不到验收申报流程配置"); | throw new BusinessException("找不到验收申报流程配置"); | ||||
} | } | ||||
Project project = projectService.getNewProject(req.getProjectId()); | |||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | |||||
params.setUser(declaredProjectManage.buildUser(user.getUserId())); | |||||
params.setProcessUsers(Collections.emptyMap()); | |||||
// 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 | |||||
Map<String, OrgInfoDTO> 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<Purchase> purchases = purchaseService.listByProjectId(req.getProjectId()); | |||||
Map<Long, Purchase> 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(); | ProcessStartParamsVo params = new ProcessStartParamsVo(); | ||||
params.setUser(declaredProjectManage.buildUser(user.getUserId())); | params.setUser(declaredProjectManage.buildUser(user.getUserId())); | ||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | |||||
//把条件值给放入工作流 | |||||
declaredProjectManage.buildCondition(params, projectInfo, dto); | |||||
// 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 | // 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 | ||||
Map<String, OrgInfoDTO> 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<String, OrgInfoDTO> 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; | return instanceId; | ||||
} | } | ||||
} | } |
@@ -110,6 +110,9 @@ public class Purchase { | |||||
@ApiModelProperty("实际成效指标") | @ApiModelProperty("实际成效指标") | ||||
private String actualPerformanceIndicators; | private String actualPerformanceIndicators; | ||||
@ApiModelProperty("终验申报材料") | |||||
private String finalInspectionMaterials; | |||||
@ApiModelProperty("是否符合信创符合性要求") | @ApiModelProperty("是否符合信创符合性要求") | ||||
private Boolean matchXcfhx; | private Boolean matchXcfhx; | ||||
@@ -123,5 +126,4 @@ public class Purchase { | |||||
private String xcfhxReportFiles; | private String xcfhxReportFiles; | ||||
} | } |
@@ -1,8 +1,6 @@ | |||||
package com.hz.pm.api.projectdeclared.model.entity; | 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 io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Data; | import lombok.Data; | ||||
@@ -37,9 +35,11 @@ public class PurchaseInst { | |||||
private Integer instType; | private Integer instType; | ||||
@ApiModelProperty("创建时间") | @ApiModelProperty("创建时间") | ||||
@TableField(fill = FieldFill.INSERT) | |||||
private LocalDateTime creatOn; | private LocalDateTime creatOn; | ||||
@ApiModelProperty("修改时间") | |||||
private LocalDateTime updateOn; | |||||
@ApiModelProperty("创建人") | |||||
@TableField(fill = FieldFill.INSERT) | |||||
private Long createBy; | |||||
} | } |
@@ -28,10 +28,4 @@ public class SubmitFinallyInspectedReq { | |||||
@NotBlank(message = "请提交初验材料") | @NotBlank(message = "请提交初验材料") | ||||
private String inspectionMaterials; | private String inspectionMaterials; | ||||
@ApiModelProperty("是否完成日志数据归集") | |||||
private Boolean isCompletedLogCollection; | |||||
@ApiModelProperty("实际成效指标") | |||||
private String actualPerformanceIndicators; | |||||
} | } |
@@ -27,7 +27,6 @@ public class RestartProcessMapUtil { | |||||
ConstructionPlanManage constructionPlanManage, | ConstructionPlanManage constructionPlanManage, | ||||
PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage, | PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage, | ||||
ReviewByProvincialDeptManage provincialDeptManage, | ReviewByProvincialDeptManage provincialDeptManage, | ||||
FinalAcceptanceManage finalAcceptanceManage, | |||||
DeclaredRecordManage declaredRecordManage) { | DeclaredRecordManage declaredRecordManage) { | ||||
//重新项目申报 | //重新项目申报 | ||||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), | 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(), | RESTART_PROCESS_MAP.put(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | ||||
provincialDeptManage::restartTheProcess); | provincialDeptManage::restartTheProcess); | ||||
//终审 | |||||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode(), | |||||
finalAcceptanceManage::restartProcess); | |||||
// 立项备案重新提交 | // 立项备案重新提交 | ||||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode(), | RESTART_PROCESS_MAP.put(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode(), | ||||
declaredRecordManage::restartDeclaredRecord); | declaredRecordManage::restartDeclaredRecord); | ||||
@@ -75,7 +75,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { | |||||
// 根据采购备案的时间获取 | // 根据采购备案的时间获取 | ||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | ||||
.in(ProjectStatusChange::getProjectId, allVersionProjectIds) | .in(ProjectStatusChange::getProjectId, allVersionProjectIds) | ||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD.name()) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.SUBMIT_PURCHASE_NOTICE.name()) | |||||
.orderByDesc(ProjectStatusChange::getCreateOn) | .orderByDesc(ProjectStatusChange::getCreateOn) | ||||
.last(BizConst.LIMIT_1)); | .last(BizConst.LIMIT_1)); | ||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||