@@ -2,28 +2,36 @@ package com.hz.pm.api.common.enumeration; | |||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.Getter; | import lombok.Getter; | ||||
import lombok.NoArgsConstructor; | |||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
/** | |||||
* <p> | |||||
* ProjectProcessStageEnum | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 14:25 2024/2/2 | |||||
*/ | |||||
@Getter | @Getter | ||||
@AllArgsConstructor | @AllArgsConstructor | ||||
@NoArgsConstructor | |||||
public enum ProjectProcessStageEnum { | public enum ProjectProcessStageEnum { | ||||
/** | /** | ||||
* 项目流程配置 阶段枚举 | * 项目流程配置 阶段枚举 | ||||
*/ | */ | ||||
ORG_INTERNAL_APPROVAL_PROCESS(1,"单位内部审批流程"), | |||||
PROJECT_PREQUALIFICATION_APPROVAL_PROCESS(2,"项目预审审批流程"), | |||||
DEPARTMENT_JOINT_APPROVAL_PROCESS(3,"部门联合审批流程"), | |||||
CONSTRUCTION_PROJECT_APPROVAL_PROCESS(4,"建设方案审批流程"), | |||||
ACCEPTANCE_DECLARATION_APPROVAL_PROCESS(5,"验收申报审批流程"), | |||||
APPLY_DELAY(6,"申请延期审批流程"), | |||||
APPLY_BORROW(7,"申请借阅审批流程"); | |||||
ORG_INTERNAL_APPROVAL_PROCESS(1, "单位内部审批流程"), | |||||
PROJECT_PREQUALIFICATION_APPROVAL_PROCESS(2, "项目预审审批流程"), | |||||
DEPARTMENT_JOINT_APPROVAL_PROCESS(3, "部门联合审批流程"), | |||||
CONSTRUCTION_PROJECT_APPROVAL_PROCESS(4, "建设方案审批流程"), | |||||
PROJECT_RECORD_APPROVAL_PROCESS(8, "立项备案审批流程"), | |||||
ACCEPTANCE_DECLARATION_APPROVAL_PROCESS(5, "验收申报审批流程"), | |||||
APPLY_DELAY(6, "申请延期审批流程"), | |||||
APPLY_BORROW(7, "申请借阅审批流程"); | |||||
private Integer code; | |||||
private String desc; | |||||
private final Integer code; | |||||
private final String desc; | |||||
public static String getDesc(Integer code) { | public static String getDesc(Integer code) { | ||||
if (Objects.isNull(code)) { | if (Objects.isNull(code)) { | ||||
@@ -36,4 +44,5 @@ public enum ProjectProcessStageEnum { | |||||
} | } | ||||
return StringUtils.EMPTY; | return StringUtils.EMPTY; | ||||
} | } | ||||
} | } |
@@ -1,10 +1,11 @@ | |||||
package com.hz.pm.api.common.statemachine.action; | package com.hz.pm.api.common.statemachine.action; | ||||
import cn.hutool.core.lang.Assert; | |||||
import com.hz.pm.api.common.model.constant.StateMachineConst; | import com.hz.pm.api.common.model.constant.StateMachineConst; | ||||
import com.hz.pm.api.common.statemachine.builder.ProjectDeclareStateMachineBuilderImpl; | |||||
import com.hz.pm.api.common.statemachine.builder.impl.ProjectDeclareStateMachineBuilderImpl; | |||||
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.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.messaging.Message; | import org.springframework.messaging.Message; | ||||
import org.springframework.statemachine.annotation.OnTransition; | import org.springframework.statemachine.annotation.OnTransition; | ||||
@@ -12,7 +13,7 @@ import org.springframework.statemachine.annotation.WithStateMachine; | |||||
/** | /** | ||||
* 项目申报状态机action集合类 | * 项目申报状态机action集合类 | ||||
* 市本级 | |||||
* | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/08 13:48 | * @since 2023/02/08 13:48 | ||||
*/ | */ | ||||
@@ -22,177 +23,213 @@ public class HzProjectDeclareAction { | |||||
private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | ||||
private Project getProject(Message<ProjectStatusChangeEvent> message) { | |||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Assert.notNull(project, "未获取到需要状态变更的项目信息"); | |||||
return project; | |||||
} | |||||
@OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION") | @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION") | ||||
public void UNDER_INTERNAL_PASS(Message<ProjectStatusChangeEvent> message) { | public void UNDER_INTERNAL_PASS(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | ||||
} | } | ||||
@OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "UNDER_INTERNAL_AUDIT_NOT_PASS") | @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "UNDER_INTERNAL_AUDIT_NOT_PASS") | ||||
public void UNDER_INTERNAL_REJECT(Message<ProjectStatusChangeEvent> message) { | public void UNDER_INTERNAL_REJECT(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode()); | project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode()); | ||||
} | } | ||||
@OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "TO_BE_DECLARED") | @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "TO_BE_DECLARED") | ||||
public void UNDER_INTERNAL_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void UNDER_INTERNAL_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode()); | project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "UNDER_INTERNAL_AUDIT_NOT_PASS", target = "UNDER_INTERNAL_AUDIT") | @OnTransition(source = "UNDER_INTERNAL_AUDIT_NOT_PASS", target = "UNDER_INTERNAL_AUDIT") | ||||
public void UNDER_INTERNAL_REJECT_RESUBMIT(Message<ProjectStatusChangeEvent> message) { | public void UNDER_INTERNAL_REJECT_RESUBMIT(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | ||||
} | } | ||||
@OnTransition(source = "PENDING_PREQUALIFICATION", target = "PENDING_PREQUALIFICATION_CHOICE") | @OnTransition(source = "PENDING_PREQUALIFICATION", target = "PENDING_PREQUALIFICATION_CHOICE") | ||||
public void PRELIMINARY_REVIEW_DECLARE(Message<ProjectStatusChangeEvent> message) { | public void PRELIMINARY_REVIEW_DECLARE(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); | project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); | ||||
} | } | ||||
@OnTransition(source = "PENDING_PREQUALIFICATION", target = "UNDER_INTERNAL_AUDIT") | @OnTransition(source = "PENDING_PREQUALIFICATION", target = "UNDER_INTERNAL_AUDIT") | ||||
public void PENDING_PREQUALIFICATION_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void PENDING_PREQUALIFICATION_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | ||||
} | } | ||||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS") | @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS") | ||||
public void PROVINCIAL_DEPARTMENT_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | public void PROVINCIAL_DEPARTMENT_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()); | project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()); | ||||
} | } | ||||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS", target = "PRE_APPLYING") | @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS", target = "PRE_APPLYING") | ||||
public void PROVINCIAL_PASS_TO_PRELIMINARY_REVIEW(Message<ProjectStatusChangeEvent> message) { | public void PROVINCIAL_PASS_TO_PRELIMINARY_REVIEW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | ||||
} | } | ||||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED") | @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED") | ||||
public void PROVINCIAL_DEPARTMENT_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | public void PROVINCIAL_DEPARTMENT_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()); | project.setStatus(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "PENDING_PREQUALIFICATION") | @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "PENDING_PREQUALIFICATION") | ||||
public void JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | ||||
} | } | ||||
@OnTransition(source = "PRE_APPLYING", target = "DEPARTMENT_JOINT_REVIEW") | @OnTransition(source = "PRE_APPLYING", target = "DEPARTMENT_JOINT_REVIEW") | ||||
public void PRELIMINARY_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | public void PRELIMINARY_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()); | project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()); | ||||
} | } | ||||
@OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_FAILED") | @OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_FAILED") | ||||
public void PRELIMINARY_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | public void PRELIMINARY_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode()); | project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "PREQUALIFICATION_FAILED", target = "PENDING_PREQUALIFICATION_CHOICE") | @OnTransition(source = "PREQUALIFICATION_FAILED", target = "PENDING_PREQUALIFICATION_CHOICE") | ||||
public void PRELIMINARY_REVIEW_REJECT_RESUBMIT(Message<ProjectStatusChangeEvent> message) { | public void PRELIMINARY_REVIEW_REJECT_RESUBMIT(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); | project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); | ||||
} | } | ||||
@OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_WITHDRAW_CHOICE") | @OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_WITHDRAW_CHOICE") | ||||
public void PRE_APPLYING_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void PRE_APPLYING_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE.getCode()); | project.setStatus(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE.getCode()); | ||||
} | } | ||||
@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "IN_THE_ANNUAL_PLAN") | @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "IN_THE_ANNUAL_PLAN") | ||||
public void DEPARTMENT_UNITED_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | public void DEPARTMENT_UNITED_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); | project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); | ||||
} | } | ||||
@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "DEPARTMENT_JOINT_REVIEW_FAILED") | @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "DEPARTMENT_JOINT_REVIEW_FAILED") | ||||
public void DEPARTMENT_UNITED_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | public void DEPARTMENT_UNITED_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED.getCode()); | project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "PRE_APPLYING") | @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "PRE_APPLYING") | ||||
public void DEPARTMENT_JOINT_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void DEPARTMENT_JOINT_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | ||||
} | } | ||||
@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "PLAN_TO_BE_DECLARED") | @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "PLAN_TO_BE_DECLARED") | ||||
public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message<ProjectStatusChangeEvent> message) { | public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "BE_SUSPENDED") | @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "BE_SUSPENDED") | ||||
public void ANNUAL_PLAN_SUSPEND(Message<ProjectStatusChangeEvent> message) { | public void ANNUAL_PLAN_SUSPEND(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.BE_SUSPENDED.getCode()); | project.setStatus(ProjectStatusEnum.BE_SUSPENDED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "DEPARTMENT_JOINT_REVIEW") | @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "DEPARTMENT_JOINT_REVIEW") | ||||
public void IN_THE_ANNUAL_PLAN_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void IN_THE_ANNUAL_PLAN_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()); | project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()); | ||||
} | } | ||||
@OnTransition(source = "PLAN_TO_BE_DECLARED", target = "SCHEME_UNDER_REVIEW") | @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "SCHEME_UNDER_REVIEW") | ||||
public void DECLARE_PLAN(Message<ProjectStatusChangeEvent> message) { | public void DECLARE_PLAN(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | ||||
} | } | ||||
@OnTransition(source = "PLAN_TO_BE_DECLARED", target = "IN_THE_ANNUAL_PLAN") | @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "IN_THE_ANNUAL_PLAN") | ||||
public void PLAN_TO_DECLARE_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void PLAN_TO_DECLARE_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); | project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); | ||||
} | } | ||||
@OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW") | @OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW") | ||||
public void DECLARE_PLAN_RESUBMIT(Message<ProjectStatusChangeEvent> message) { | public void DECLARE_PLAN_RESUBMIT(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | ||||
} | } | ||||
@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED") | @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED") | ||||
public void PLAN_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | public void PLAN_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode()); | project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "SCHEME_REVIEW_FAILED") | @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "SCHEME_REVIEW_FAILED") | ||||
public void PLAN_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | public void PLAN_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode()); | project.setStatus(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW") | @OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW") | ||||
public void PLAN_REVIEW_REJECT_RESUBMIT(Message<ProjectStatusChangeEvent> message) { | public void PLAN_REVIEW_REJECT_RESUBMIT(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | ||||
} | } | ||||
@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "PLAN_TO_BE_DECLARED") | @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "PLAN_TO_BE_DECLARED") | ||||
public void SCHEME_UNDER_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void SCHEME_UNDER_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | ||||
} | } | ||||
//================================================================================================================== | |||||
@OnTransition(source = "DECLARED_APPROVED_TO_BE_RECORD", target = "DECLARED_APPROVED_RECORD_AUDITING") | |||||
public void DECLARED_RECORD_SUBMIT(Message<ProjectStatusChangeEvent> message) { | |||||
Project project = getProject(message); | |||||
// 待立项批复批复后,项目一级状态变更为已立项 | |||||
project.setStatus(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.getCode()); | |||||
} | |||||
@OnTransition(source = "DECLARED_APPROVED_RECORD_FAILED", target = "DECLARED_APPROVED_RECORD_AUDITING") | |||||
public void DECLARED_RECORD_RESUBMIT(Message<ProjectStatusChangeEvent> message) { | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.getCode()); | |||||
} | |||||
@OnTransition(source = "DECLARED_APPROVED_RECORD_AUDITING", target = "TO_BE_PURCHASED") | |||||
public void DECLARED_RECORD_PASS(Message<ProjectStatusChangeEvent> message) { | |||||
Project project = getProject(message); | |||||
// 待立项批复批复后,项目一级状态变更为已立项 | |||||
project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); | |||||
} | |||||
@OnTransition(source = "DECLARED_APPROVED_RECORD_AUDITING", target = "DECLARED_APPROVED_RECORD_FAILED") | |||||
public void DECLARED_RECORD_FAILED(Message<ProjectStatusChangeEvent> message) { | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode()); | |||||
} | |||||
//================================================================================================================== | |||||
@OnTransition(source = "TO_BE_APPROVED", target = "TO_BE_PURCHASED") | @OnTransition(source = "TO_BE_APPROVED", target = "TO_BE_PURCHASED") | ||||
public void PROJECT_APPROVAL(Message<ProjectStatusChangeEvent> message) { | public void PROJECT_APPROVAL(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
// 待立项批复批复后,项目一级状态变更为已立项 | // 待立项批复批复后,项目一级状态变更为已立项 | ||||
project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode()); | project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode()); | ||||
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); | project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); | ||||
@@ -200,25 +237,25 @@ public class HzProjectDeclareAction { | |||||
@OnTransition(source = "TO_BE_APPROVED", target = "SCHEME_UNDER_REVIEW") | @OnTransition(source = "TO_BE_APPROVED", target = "SCHEME_UNDER_REVIEW") | ||||
public void TO_BE_APPROVED_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void TO_BE_APPROVED_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | ||||
} | } | ||||
@OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") | @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION") | ||||
public void PURCHASE_PUT_ON_RECORD(Message<ProjectStatusChangeEvent> message) { | public void PURCHASE_PUT_ON_RECORD(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.OPERATION.getCode()); | project.setStatus(ProjectStatusEnum.OPERATION.getCode()); | ||||
} | } | ||||
@OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") | @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") | ||||
public void START_TO_WORK(Message<ProjectStatusChangeEvent> message) { | public void START_TO_WORK(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | ||||
} | } | ||||
@OnTransition(source = "TO_BE_PURCHASED", target = "TO_BE_APPROVED") | @OnTransition(source = "TO_BE_PURCHASED", target = "TO_BE_APPROVED") | ||||
public void TO_BE_PURCHASED_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void TO_BE_PURCHASED_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
// 待采购状态撤回后,项目一级状态回退到未立项 | // 待采购状态撤回后,项目一级状态回退到未立项 | ||||
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | ||||
project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode()); | project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode()); | ||||
@@ -227,33 +264,33 @@ public class HzProjectDeclareAction { | |||||
@OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_FINALLY_INSPECTED") | @OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_FINALLY_INSPECTED") | ||||
public void PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(Message<ProjectStatusChangeEvent> message) { | public void PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); | project.setStatus(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_PURCHASED") | @OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_PURCHASED") | ||||
public void UNDER_CONSTRUCTION_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void UNDER_CONSTRUCTION_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); | project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.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) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); | project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); | ||||
} | } | ||||
@OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "UNDER_CONSTRUCTION") | @OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "UNDER_CONSTRUCTION") | ||||
public void TO_BE_FINALLY_INSPECTED_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void TO_BE_FINALLY_INSPECTED_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | ||||
} | } | ||||
@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "ARCHIVED") | @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "ARCHIVED") | ||||
public void FINAL_ACCEPTANCE_PASS(Message<ProjectStatusChangeEvent> message) { | public void FINAL_ACCEPTANCE_PASS(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
// 终验审核通过后,项目一级状态变更为已归档 | // 终验审核通过后,项目一级状态变更为已归档 | ||||
project.setStage(ProjectStatusEnum.ARCHIVED.getCode()); | project.setStage(ProjectStatusEnum.ARCHIVED.getCode()); | ||||
project.setStatus(ProjectStatusEnum.ACCEPTED.getCode()); | project.setStatus(ProjectStatusEnum.ACCEPTED.getCode()); | ||||
@@ -261,19 +298,20 @@ public class HzProjectDeclareAction { | |||||
@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_REVIEW_FAILED") | @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_REVIEW_FAILED") | ||||
public void FINAL_ACCEPTANCE_REJECT(Message<ProjectStatusChangeEvent> message) { | public void FINAL_ACCEPTANCE_REJECT(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode()); | project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "TO_BE_FINALLY_INSPECTED") | @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "TO_BE_FINALLY_INSPECTED") | ||||
public void FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | public void FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); | project.setStatus(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); | ||||
} | } | ||||
@OnTransition(source = "FINAL_ACCEPTANCE_REVIEW_FAILED", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") | @OnTransition(source = "FINAL_ACCEPTANCE_REVIEW_FAILED", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") | ||||
public void FINAL_RE_ACCEPTANCE_APPLICATION(Message<ProjectStatusChangeEvent> message) { | public void FINAL_RE_ACCEPTANCE_APPLICATION(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||||
Project project = getProject(message); | |||||
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); | project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); | ||||
} | } | ||||
} | } |
@@ -1,6 +1,7 @@ | |||||
package com.hz.pm.api.common.statemachine.builder; | |||||
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.ProjectDeclareChoiceAction; | ||||
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; | ||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
@@ -89,7 +90,6 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat | |||||
.source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS) | .source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS) | ||||
.target(ProjectStatusEnum.UNDER_INTERNAL_AUDIT) | .target(ProjectStatusEnum.UNDER_INTERNAL_AUDIT) | ||||
.event(ProjectStatusChangeEvent.UNDER_INTERNAL_REJECT_RESUBMIT).and() | .event(ProjectStatusChangeEvent.UNDER_INTERNAL_REJECT_RESUBMIT).and() | ||||
// 待预审预审申报,从待预审到待预审选择 | // 待预审预审申报,从待预审到待预审选择 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION) | .source(ProjectStatusEnum.PENDING_PREQUALIFICATION) | ||||
@@ -203,6 +203,23 @@ public class ProjectDeclareStateMachineBuilderImpl implements ProjectDeclareStat | |||||
.source(ProjectStatusEnum.SCHEME_REVIEW_FAILED) | .source(ProjectStatusEnum.SCHEME_REVIEW_FAILED) | ||||
.target(ProjectStatusEnum.SCHEME_UNDER_REVIEW) | .target(ProjectStatusEnum.SCHEME_UNDER_REVIEW) | ||||
.event(ProjectStatusChangeEvent.PLAN_REVIEW_REJECT_RESUBMIT).and() | .event(ProjectStatusChangeEvent.PLAN_REVIEW_REJECT_RESUBMIT).and() | ||||
// 立项备案 | |||||
.withExternal() | |||||
.source(ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD) | |||||
.target(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING) | |||||
.event(ProjectStatusChangeEvent.DECLARED_RECORD_SUBMIT).and() | |||||
.withExternal() | |||||
.source(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED) | |||||
.target(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING) | |||||
.event(ProjectStatusChangeEvent.DECLARED_RECORD_RESUBMIT).and() | |||||
.withExternal() | |||||
.source(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING) | |||||
.target(ProjectStatusEnum.TO_BE_PURCHASED) | |||||
.event(ProjectStatusChangeEvent.DECLARED_RECORD_PASS).and() | |||||
.withExternal() | |||||
.source(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING) | |||||
.source(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED) | |||||
.event(ProjectStatusChangeEvent.DECLARED_RECORD_FAILED).and() | |||||
// 待立项批复批复,从待立项批复到待采购 | // 待立项批复批复,从待立项批复到待采购 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.TO_BE_APPROVED) | .source(ProjectStatusEnum.TO_BE_APPROVED) |
@@ -26,7 +26,7 @@ public enum ProjectStatusChangeEvent { | |||||
/** | /** | ||||
* 项目申报提交(项目状态进入:单位内部审核中) | * 项目申报提交(项目状态进入:单位内部审核中) | ||||
*/ | */ | ||||
PROJECT_APPLICATION_SUBMIT( ProjectStatusEnum.TO_BE_DECLARED.getCode(), null, null), | |||||
PROJECT_APPLICATION_SUBMIT(ProjectStatusEnum.TO_BE_DECLARED.getCode(), null, null), | |||||
/** | /** | ||||
* 单位内部审核驳回(项目状态进入:单位内部审核不通过) | * 单位内部审核驳回(项目状态进入:单位内部审核不通过) | ||||
*/ | */ | ||||
@@ -38,7 +38,7 @@ public enum ProjectStatusChangeEvent { | |||||
/** | /** | ||||
* 单位内部审核不通过重新提交(项目状态进入:单位内部审核中) | * 单位内部审核不通过重新提交(项目状态进入:单位内部审核中) | ||||
*/ | */ | ||||
UNDER_INTERNAL_REJECT_RESUBMIT(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(),null,null), | |||||
UNDER_INTERNAL_REJECT_RESUBMIT(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), null, null), | |||||
/** | /** | ||||
* 预审申报(项目状态进入:待预审选择,有判断条件:市级项目且申报金额大于1000万项目状态变为:省级部门联审中;否则项目状态变为:预审中) | * 预审申报(项目状态进入:待预审选择,有判断条件:市级项目且申报金额大于1000万项目状态变为:省级部门联审中;否则项目状态变为:预审中) | ||||
@@ -64,7 +64,7 @@ public enum ProjectStatusChangeEvent { | |||||
/** | /** | ||||
* 预审不通过重新提交(项目状态变为:待预审选择) | * 预审不通过重新提交(项目状态变为:待预审选择) | ||||
*/ | */ | ||||
PRELIMINARY_REVIEW_REJECT_RESUBMIT(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(),null,null), | |||||
PRELIMINARY_REVIEW_REJECT_RESUBMIT(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), null, null), | |||||
/** | /** | ||||
* 预审通过(项目状态变为:部门联审中) | * 预审通过(项目状态变为:部门联审中) | ||||
*/ | */ | ||||
@@ -88,7 +88,7 @@ public enum ProjectStatusChangeEvent { | |||||
/** | /** | ||||
* 申报方案(项目状态变为:方案评审中) | * 申报方案(项目状态变为:方案评审中) | ||||
*/ | */ | ||||
DECLARE_PLAN( ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode(), null, null), | |||||
DECLARE_PLAN(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode(), null, null), | |||||
/** | /** | ||||
* 方案评审驳回(项目状态变为:方案评审不通过) | * 方案评审驳回(项目状态变为:方案评审不通过) | ||||
*/ | */ | ||||
@@ -96,11 +96,36 @@ public enum ProjectStatusChangeEvent { | |||||
/** | /** | ||||
* 方案评审不通过重新提交(项目状态变为:方案评审中) | * 方案评审不通过重新提交(项目状态变为:方案评审中) | ||||
*/ | */ | ||||
PLAN_REVIEW_REJECT_RESUBMIT(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(),null,null), | |||||
PLAN_REVIEW_REJECT_RESUBMIT(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(), null, null), | |||||
/** | /** | ||||
* 方案评审通过(项目状态变为:待立项批复) | * 方案评审通过(项目状态变为:待立项批复) | ||||
*/ | */ | ||||
PLAN_REVIEW_PASS(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode(), null, null), | PLAN_REVIEW_PASS(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode(), null, null), | ||||
//立项备案=========================================================================================================== | |||||
/** | |||||
* 立项备案提交 | |||||
*/ | |||||
DECLARED_RECORD_SUBMIT(ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode(), null, null), | |||||
/** | |||||
* 立项备案重新提交 | |||||
*/ | |||||
DECLARED_RECORD_RESUBMIT(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode(), null, null), | |||||
/** | |||||
* 立项备案通过 | |||||
*/ | |||||
DECLARED_RECORD_PASS(ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.getCode(), null, null), | |||||
/** | |||||
* 立项备案不通过 | |||||
*/ | |||||
DECLARED_RECORD_FAILED(null, ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode(), null), | |||||
//================================================================================================================== | |||||
/** | /** | ||||
* 立项批复(项目状态变为:已立项-待采购) | * 立项批复(项目状态变为:已立项-待采购) | ||||
*/ | */ | ||||
@@ -118,7 +143,7 @@ public enum ProjectStatusChangeEvent { | |||||
/** | /** | ||||
* 开工 到建设中 | * 开工 到建设中 | ||||
*/ | */ | ||||
START_TO_WORK(ProjectStatusEnum.OPERATION.getCode(), null,null), | |||||
START_TO_WORK(ProjectStatusEnum.OPERATION.getCode(), null, null), | |||||
/** | /** | ||||
* 初验备案(项目状态变为:待终验) | * 初验备案(项目状态变为:待终验) | ||||
*/ | */ | ||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray; | |||||
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | ||||
import com.ningdatech.basic.util.StrPool; | import com.ningdatech.basic.util.StrPool; | ||||
import com.ningdatech.file.entity.vo.result.FileResultVO; | import com.ningdatech.file.entity.vo.result.FileResultVO; | ||||
import liquibase.pro.packaged.O; | |||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
import org.springframework.util.NumberUtils; | import org.springframework.util.NumberUtils; | ||||
@@ -0,0 +1,81 @@ | |||||
package com.hz.pm.api.common.util; | |||||
import cn.hutool.core.collection.CollUtil; | |||||
import cn.hutool.core.util.ArrayUtil; | |||||
import java.math.BigDecimal; | |||||
import java.math.RoundingMode; | |||||
import java.util.Arrays; | |||||
import java.util.Collection; | |||||
import java.util.Comparator; | |||||
import java.util.function.Function; | |||||
/** | |||||
* <p> | |||||
* DecimalUtil | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 18:53 2024/2/21 | |||||
*/ | |||||
public class DecimalUtil { | |||||
private DecimalUtil() { | |||||
} | |||||
@SafeVarargs | |||||
public static <T> BigDecimal sum(Collection<T> objs, Function<T, BigDecimal>... functions) { | |||||
if (CollUtil.isEmpty(objs) || ArrayUtil.isEmpty(functions)) { | |||||
return BigDecimal.ZERO; | |||||
} | |||||
return objs.stream() | |||||
.map(w -> Arrays.stream(functions) | |||||
.map(f -> f.apply(w)) | |||||
.reduce(BigDecimal::add) | |||||
.orElse(BigDecimal.ZERO)) | |||||
.reduce(BigDecimal::add) | |||||
.orElse(BigDecimal.ZERO); | |||||
} | |||||
public static <T> BigDecimal avg(Collection<T> objs, Function<T, BigDecimal> function) { | |||||
if (CollUtil.isEmpty(objs)) { | |||||
return BigDecimal.ZERO; | |||||
} | |||||
BigDecimal size = BigDecimal.valueOf(objs.size()); | |||||
return objs.stream() | |||||
.map(function) | |||||
.reduce(BigDecimal::add) | |||||
.orElse(BigDecimal.ZERO) | |||||
.divide(size, RoundingMode.HALF_UP); | |||||
} | |||||
public static <T> BigDecimal max(Collection<T> objs, Function<T, BigDecimal> function) { | |||||
if (CollUtil.isEmpty(objs)) { | |||||
return BigDecimal.ZERO; | |||||
} | |||||
return objs.stream().map(function).max(BigDecimal::compareTo).orElse(BigDecimal.ZERO); | |||||
} | |||||
public static <T> BigDecimal min(Collection<T> objs, Function<T, BigDecimal> function) { | |||||
if (CollUtil.isEmpty(objs)) { | |||||
return BigDecimal.ZERO; | |||||
} | |||||
return objs.stream().map(function).min(BigDecimal::compareTo).orElse(BigDecimal.ZERO); | |||||
} | |||||
public static <T> T objByMax(Collection<T> objs, Function<T, BigDecimal> function) { | |||||
if (CollUtil.isEmpty(objs)) { | |||||
return null; | |||||
} | |||||
return objs.stream().max(Comparator.comparing(function)).orElse(null); | |||||
} | |||||
public static <T> T objByMin(Collection<T> objs, Function<T, BigDecimal> function) { | |||||
if (CollUtil.isEmpty(objs)) { | |||||
return null; | |||||
} | |||||
return objs.stream().min(Comparator.comparing(function)).orElse(null); | |||||
} | |||||
} |
@@ -10,9 +10,9 @@ import java.util.List; | |||||
* @author liuxinxin | * @author liuxinxin | ||||
* @date 2022/7/28 下午2:14 | * @date 2022/7/28 下午2:14 | ||||
*/ | */ | ||||
public class DictUtils { | |||||
public class DictUtil { | |||||
private DictUtils() { | |||||
private DictUtil() { | |||||
} | } | ||||
public static Boolean isValueEquals(List<DictFieldInfoDTO> list1, List<DictFieldInfoDTO> list2) { | public static Boolean isValueEquals(List<DictFieldInfoDTO> list1, List<DictFieldInfoDTO> list2) { |
@@ -0,0 +1,65 @@ | |||||
package com.hz.pm.api.common.util; | |||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.hz.pm.api.common.model.ExpertRegionModifyDiffBO; | |||||
import com.hz.pm.api.expert.model.RegionDtoMapKey; | |||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | |||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import java.util.stream.Collectors; | |||||
/** | |||||
* @author liuxinxin | |||||
* @since 2022/7/28 下午4:33 | |||||
*/ | |||||
public class ExpertRegionInfoUtil { | |||||
private ExpertRegionInfoUtil() { | |||||
} | |||||
public static ExpertRegionModifyDiffBO diff(List<ExpertRegionInfo> preRegions, List<ExpertRegionInfo> currRegions) { | |||||
ExpertRegionModifyDiffBO diff = new ExpertRegionModifyDiffBO(); | |||||
List<ExpertRegionInfo> addList = new ArrayList<>(); | |||||
List<ExpertRegionInfo> removeList = new ArrayList<>(); | |||||
if (CollUtil.isEmpty(preRegions) && CollUtil.isEmpty(currRegions)) { | |||||
diff.setAddList(addList); | |||||
diff.setRemoveList(removeList); | |||||
} else if (CollUtil.isEmpty(preRegions)) { | |||||
diff.setAddList(currRegions); | |||||
diff.setRemoveList(removeList); | |||||
} else if (CollUtil.isEmpty(currRegions)) { | |||||
diff.setAddList(addList); | |||||
diff.setRemoveList(preRegions); | |||||
} else { | |||||
List<RegionDtoMapKey> preRegionMapKey = convert(preRegions); | |||||
List<RegionDtoMapKey> currRegionMapKey = convert(currRegions); | |||||
removeList.addAll(notContains(currRegionMapKey, preRegionMapKey)); | |||||
addList.addAll(notContains(preRegionMapKey, currRegionMapKey)); | |||||
diff.setAddList(addList); | |||||
diff.setRemoveList(removeList); | |||||
} | |||||
return diff; | |||||
} | |||||
private static List<ExpertRegionInfo> notContains(List<RegionDtoMapKey> source, List<RegionDtoMapKey> target) { | |||||
return target.stream().filter(w -> !source.contains(w)).map(key -> { | |||||
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); | |||||
expertRegionInfo.setRegionCode(key.getRegionCode()); | |||||
expertRegionInfo.setRegionLevel(key.getRegionLevel()); | |||||
return expertRegionInfo; | |||||
}).collect(Collectors.toList()); | |||||
} | |||||
private static List<RegionDtoMapKey> convert(List<ExpertRegionInfo> regionInfos) { | |||||
return regionInfos.stream().map(r -> { | |||||
RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); | |||||
regionDtoMapKey.setRegionLevel(r.getRegionLevel()); | |||||
regionDtoMapKey.setRegionCode(r.getRegionCode()); | |||||
return regionDtoMapKey; | |||||
}).collect(Collectors.toList()); | |||||
} | |||||
} |
@@ -1,73 +0,0 @@ | |||||
package com.hz.pm.api.common.util; | |||||
import com.hz.pm.api.common.model.ExpertRegionModifyDiffBO; | |||||
import com.hz.pm.api.expert.model.RegionDtoMapKey; | |||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | |||||
import org.apache.commons.collections4.CollectionUtils; | |||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import java.util.stream.Collectors; | |||||
/** | |||||
* @author liuxinxin | |||||
* @date 2022/7/28 下午4:33 | |||||
*/ | |||||
public class ExpertRegionInfoUtils { | |||||
public static ExpertRegionModifyDiffBO modifyDiff(List<ExpertRegionInfo> beforeList, List<ExpertRegionInfo> afterList) { | |||||
ExpertRegionModifyDiffBO expertRegionModifyDiffBO = new ExpertRegionModifyDiffBO(); | |||||
List<ExpertRegionInfo> addList = new ArrayList<>(); | |||||
List<ExpertRegionInfo> removeList = new ArrayList<>(); | |||||
if (CollectionUtils.isEmpty(beforeList) && CollectionUtils.isEmpty(afterList)) { | |||||
expertRegionModifyDiffBO.setAddList(addList); | |||||
expertRegionModifyDiffBO.setRemoveList(removeList); | |||||
return expertRegionModifyDiffBO; | |||||
} else if (CollectionUtils.isEmpty(beforeList)) { | |||||
expertRegionModifyDiffBO.setAddList(afterList); | |||||
expertRegionModifyDiffBO.setRemoveList(removeList); | |||||
return expertRegionModifyDiffBO; | |||||
} else if (CollectionUtils.isEmpty(afterList)) { | |||||
expertRegionModifyDiffBO.setAddList(addList); | |||||
expertRegionModifyDiffBO.setRemoveList(beforeList); | |||||
return expertRegionModifyDiffBO; | |||||
} | |||||
List<RegionDtoMapKey> beforeRegionDtoMapKeyList = beforeList.stream().map(r -> { | |||||
RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); | |||||
regionDtoMapKey.setRegionLevel(r.getRegionLevel()); | |||||
regionDtoMapKey.setRegionCode(r.getRegionCode()); | |||||
return regionDtoMapKey; | |||||
}).collect(Collectors.toList()); | |||||
List<RegionDtoMapKey> afterRegionDtoMapKeyList = afterList.stream().map(r -> { | |||||
RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); | |||||
regionDtoMapKey.setRegionLevel(r.getRegionLevel()); | |||||
regionDtoMapKey.setRegionCode(r.getRegionCode()); | |||||
return regionDtoMapKey; | |||||
}).collect(Collectors.toList()); | |||||
for (RegionDtoMapKey key : beforeRegionDtoMapKeyList) { | |||||
if (!afterRegionDtoMapKeyList.contains(key)) { | |||||
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); | |||||
expertRegionInfo.setRegionCode(key.getRegionCode()); | |||||
expertRegionInfo.setRegionLevel(key.getRegionLevel()); | |||||
removeList.add(expertRegionInfo); | |||||
} | |||||
} | |||||
for (RegionDtoMapKey key : afterRegionDtoMapKeyList) { | |||||
if (!beforeRegionDtoMapKeyList.contains(key)) { | |||||
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); | |||||
expertRegionInfo.setRegionCode(key.getRegionCode()); | |||||
expertRegionInfo.setRegionLevel(key.getRegionLevel()); | |||||
addList.add(expertRegionInfo); | |||||
} | |||||
} | |||||
expertRegionModifyDiffBO.setAddList(addList); | |||||
expertRegionModifyDiffBO.setRemoveList(removeList); | |||||
return expertRegionModifyDiffBO; | |||||
} | |||||
} |
@@ -1,268 +0,0 @@ | |||||
package com.hz.pm.api.common.util; | |||||
import cn.hutool.core.bean.BeanUtil; | |||||
import cn.hutool.core.map.MapUtil; | |||||
import cn.hutool.json.JSONUtil; | |||||
import cn.hutool.poi.excel.ExcelReader; | |||||
import cn.hutool.poi.excel.ExcelUtil; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.hz.pm.api.common.helper.RegionCacheHelper; | |||||
import com.hz.pm.api.expert.controller.ExpertController; | |||||
import com.hz.pm.api.expert.model.*; | |||||
import com.hz.pm.api.expert.model.req.ExpertRegistrationRequest; | |||||
import com.hz.pm.api.meta.constant.DictTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertTagEnum; | |||||
import com.hz.pm.api.meta.helper.DictionaryCache; | |||||
import com.hz.pm.api.meta.helper.TagCache; | |||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | |||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.TagDTO; | |||||
import com.hz.pm.api.organization.model.entity.DingOrganization; | |||||
import com.hz.pm.api.organization.service.IDingOrganizationService; | |||||
import com.hz.pm.api.sys.model.dto.RegionDTO; | |||||
import java.io.File; | |||||
import java.time.LocalDate; | |||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
/** | |||||
* <p> | |||||
* ExpertRegisterUtil | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 10:03 2023/11/21 | |||||
*/ | |||||
public class ExpertRegisterUtil { | |||||
private ExpertRegisterUtil() { | |||||
} | |||||
private static final String SEPARATOR = ",|,|\\n"; | |||||
public static RegionCacheHelper regionCacheHelper; | |||||
public static DictionaryCache dictionaryCache; | |||||
public static IDingOrganizationService organizationService; | |||||
public static TagCache tagCache; | |||||
public static ExpertController expertController; | |||||
public static void registerExpertBatch(String path) { | |||||
ExcelReader reader = ExcelUtil.getReader(new File(path)); | |||||
List<Map<String, Object>> experts = reader.readAll(); | |||||
experts.forEach(w -> { | |||||
ExpertRegistrationRequest request = new ExpertRegistrationRequest(); | |||||
ExpertBasicInfo basic = new ExpertBasicInfo(); | |||||
basic.setBank(MapUtil.getStr(w, "开户行")); | |||||
basic.setBankNo(MapUtil.getStr(w, "银行卡号")); | |||||
basic.setName(MapUtil.getStr(w, "*姓名")); | |||||
basic.setPhoneNo(MapUtil.getStr(w, "*手机")); | |||||
basic.setGender("男".equals(MapUtil.getStr(w, "性别")) ? "1" : "0"); | |||||
// 政治面貌 | |||||
basic.setPolitical(new ArrayList<>()); | |||||
String political = MapUtil.getStr(w, "政治面貌"); | |||||
List<DictionaryDTO> politicalDicts = dictionaryCache.listDictByDictType(DictTypeEnum.POLITICAL.getKey()); | |||||
if (!politicalDicts.isEmpty()) { | |||||
politicalDicts.stream() | |||||
.filter(dict -> dict.getName().equals(political)) | |||||
.findFirst().ifPresent(dictionary -> { | |||||
DictFieldInfoDTO dict = new DictFieldInfoDTO(); | |||||
dict.setDictionaryName(dictionary.getName()); | |||||
dict.setDictionaryCode(dictionary.getDictionaryCode()); | |||||
dict.setDictionaryFieldName(dictionary.getDictionaryType()); | |||||
basic.getPolitical().add(dict); | |||||
}); | |||||
} | |||||
ExpertEduInfo eduInfo = new ExpertEduInfo(); | |||||
eduInfo.setSchool("暂无"); | |||||
eduInfo.setAcademicTitle("暂无"); | |||||
eduInfo.setGraduatedAt(LocalDate.now()); | |||||
eduInfo.setEdu(new ArrayList<>()); | |||||
eduInfo.setDegree(new ArrayList<>()); | |||||
// 学历 | |||||
String eduStr = MapUtil.getStr(w, "学历"); | |||||
List<DictionaryDTO> eduDicts = dictionaryCache.listDictByDictType(DictTypeEnum.EDU.getKey()); | |||||
if (!eduDicts.isEmpty()) { | |||||
eduDicts.stream() | |||||
.filter(dict -> dict.getName().equals(eduStr)) | |||||
.findFirst().ifPresent(dictionary -> { | |||||
DictFieldInfoDTO dict = new DictFieldInfoDTO(); | |||||
dict.setDictionaryName(dictionary.getName()); | |||||
dict.setDictionaryCode(dictionary.getDictionaryCode()); | |||||
dict.setDictionaryFieldName(dictionary.getDictionaryType()); | |||||
eduInfo.getEdu().add(dict); | |||||
}); | |||||
} | |||||
// 学位 | |||||
String degreeStr = MapUtil.getStr(w, "学位"); | |||||
List<DictionaryDTO> degreeDicts = dictionaryCache.listDictByDictType(DictTypeEnum.DEGREE.getKey()); | |||||
if (!degreeDicts.isEmpty()) { | |||||
degreeDicts.stream() | |||||
.filter(dict -> dict.getName().equals(degreeStr)) | |||||
.findFirst().ifPresent(dictionary -> { | |||||
DictFieldInfoDTO dict = new DictFieldInfoDTO(); | |||||
dict.setDictionaryName(dictionary.getName()); | |||||
dict.setDictionaryCode(dictionary.getDictionaryCode()); | |||||
dict.setDictionaryFieldName(dictionary.getDictionaryType()); | |||||
eduInfo.getDegree().add(dict); | |||||
}); | |||||
} | |||||
request.setEduInfo(eduInfo); | |||||
// 专家层级 | |||||
String expertRegionStr = MapUtil.getStr(w, "*专家层级").replace("景宁县", "景宁畲族自治县"); | |||||
RegionDTO expertRegion = regionCacheHelper.getByRegionName(expertRegionStr); | |||||
if (expertRegion != null) { | |||||
basic.setExpertRegionInfo(BeanUtil.copyProperties(expertRegion, ExpertRegionInfo.class)); | |||||
} | |||||
// 履职意向 | |||||
String intentionRegions = MapUtil.getStr(w, "*履职意向").replace("景宁县", "景宁畲族自治县"); | |||||
basic.setExpertIntentionWorkRegions(new ArrayList<>()); | |||||
for (String intentionRegionStr : intentionRegions.split("")) { | |||||
RegionDTO currRegion = regionCacheHelper.getByRegionName(intentionRegionStr); | |||||
if (currRegion != null) { | |||||
basic.getExpertIntentionWorkRegions().add(BeanUtil.copyProperties(currRegion, ExpertRegionInfo.class)); | |||||
} | |||||
} | |||||
request.setBasicInfo(basic); | |||||
// 职业信息 | |||||
ExpertJobInfo jobInfo = new ExpertJobInfo(); | |||||
jobInfo.setAddress("暂无"); | |||||
jobInfo.setExperience("暂无"); | |||||
jobInfo.setJobStatus(new ArrayList<>()); | |||||
jobInfo.setCompany(MapUtil.getStr(w, "*工作单位")); | |||||
List<DingOrganization> organizations = organizationService.list(Wrappers.lambdaQuery(DingOrganization.class) | |||||
.eq(DingOrganization::getOrganizationName, jobInfo.getCompany())); | |||||
if (organizations.size() == 1) { | |||||
jobInfo.setCompanyUniqCode(organizations.get(0).getOrganizationCode()); | |||||
} | |||||
jobInfo.setAdministrativeDuties(MapUtil.getStr(w, "行政职务")); | |||||
jobInfo.setAdministrativeRank(new ArrayList<>()); | |||||
String administrativeRankStr = MapUtil.getStr(w, "行政职级"); | |||||
List<DictionaryDTO> administrativeRankDicts = dictionaryCache.listDictByDictType(DictTypeEnum.ADMINISTRATIVE_RANK.getKey()); | |||||
if (!administrativeRankDicts.isEmpty()) { | |||||
administrativeRankDicts.stream() | |||||
.filter(dict -> dict.getName().equals(administrativeRankStr)) | |||||
.findFirst().ifPresent(dictionary -> { | |||||
DictFieldInfoDTO dict = new DictFieldInfoDTO(); | |||||
dict.setDictionaryName(dictionary.getName()); | |||||
dict.setDictionaryCode(dictionary.getDictionaryCode()); | |||||
dict.setDictionaryFieldName(dictionary.getDictionaryType()); | |||||
jobInfo.getAdministrativeRank().add(dict); | |||||
}); | |||||
} | |||||
jobInfo.setCompanyAttribute(new ArrayList<>()); | |||||
String companyTypeStr = MapUtil.getStr(w, "*单位类型"); | |||||
List<DictionaryDTO> companyTypeDicts = dictionaryCache.listDictByDictType(DictTypeEnum.COMPANY_ATTRIBUTE.getKey()); | |||||
if (!companyTypeDicts.isEmpty()) { | |||||
companyTypeDicts.stream() | |||||
.filter(dict -> dict.getName().equals(companyTypeStr)) | |||||
.findFirst().ifPresent(dictionary -> { | |||||
DictFieldInfoDTO dict = new DictFieldInfoDTO(); | |||||
dict.setDictionaryName(dictionary.getName()); | |||||
dict.setDictionaryCode(dictionary.getDictionaryCode()); | |||||
dict.setDictionaryFieldName(dictionary.getDictionaryType()); | |||||
jobInfo.getCompanyAttribute().add(dict); | |||||
}); | |||||
} | |||||
request.setJobInfo(jobInfo); | |||||
ExpertProfessionalInfo professionalInfo = new ExpertProfessionalInfo(); | |||||
professionalInfo.setAwards("暂无"); | |||||
professionalInfo.setIndustrySector(new ArrayList<>()); | |||||
professionalInfo.setOther(new ArrayList<>()); | |||||
Map<String, TagDTO> tagMap = tagCache.getNameTagMap(); | |||||
String otherTagStr = MapUtil.getStr(w, "其他标签"); | |||||
if (StrUtils.isNotBlank(otherTagStr)) { | |||||
for (String othTag : otherTagStr.split(SEPARATOR)) { | |||||
tagMap.entrySet().stream() | |||||
.filter(tag -> tag.getValue().getParentCode().equals(ExpertTagEnum.OTHER.getKey()) | |||||
&& tag.getValue().getTagName().equals(othTag)) | |||||
.forEach(tag -> { | |||||
TagFieldInfo expertTag = new TagFieldInfo(); | |||||
expertTag.setTagCode(tag.getValue().getTagCode()); | |||||
expertTag.setTagFieldName(tag.getValue().getParentCode()); | |||||
expertTag.setTagName(tag.getValue().getTagName()); | |||||
professionalInfo.getOther().add(expertTag); | |||||
}); | |||||
} | |||||
} | |||||
String avoidCompanyStr = MapUtil.getStr(w, "*回避单位"); | |||||
professionalInfo.setAvoidCompanyList(new ArrayList<>()); | |||||
List<DingOrganization> avoidOrges = organizationService.list(Wrappers.lambdaQuery(DingOrganization.class) | |||||
.in(DingOrganization::getOrganizationName, avoidCompanyStr.split(SEPARATOR))); | |||||
if (!avoidOrges.isEmpty()) { | |||||
avoidOrges.forEach(org -> { | |||||
ExpertAvoidCompanyInfo companyInfo = new ExpertAvoidCompanyInfo(); | |||||
companyInfo.setCompanyName(org.getOrganizationName()); | |||||
companyInfo.setCompanyUniqCode(org.getOrganizationCode()); | |||||
professionalInfo.getAvoidCompanyList().add(companyInfo); | |||||
}); | |||||
} | |||||
professionalInfo.setGoodAt(new ArrayList<>()); | |||||
String goodAtStr = MapUtil.getStr(w, "*擅长方向"); | |||||
for (String othTag : goodAtStr.split(SEPARATOR)) { | |||||
tagMap.entrySet().stream() | |||||
.filter(tag -> tag.getValue().getTagName().equals(othTag)) | |||||
.forEach(tag -> { | |||||
TagFieldInfo expertTag = new TagFieldInfo(); | |||||
expertTag.setTagCode(tag.getValue().getTagCode()); | |||||
expertTag.setTagFieldName(ExpertTagEnum.GOOD_AT.getKey()); | |||||
expertTag.setTagName(tag.getValue().getTagName()); | |||||
professionalInfo.getGoodAt().add(expertTag); | |||||
}); | |||||
} | |||||
String industrySectorStr = MapUtil.getStr(w, "行业领域"); | |||||
for (String othTag : industrySectorStr.split(SEPARATOR)) { | |||||
tagMap.entrySet().stream() | |||||
.filter(tag -> tag.getValue().getTagName().equals(othTag)) | |||||
.forEach(tag -> { | |||||
TagFieldInfo expertTag = new TagFieldInfo(); | |||||
expertTag.setTagCode(tag.getValue().getTagCode()); | |||||
expertTag.setTagFieldName(ExpertTagEnum.INDUSTRY_SECTOR.getKey()); | |||||
expertTag.setTagName(tag.getValue().getTagName()); | |||||
professionalInfo.getIndustrySector().add(expertTag); | |||||
}); | |||||
} | |||||
professionalInfo.setTechnicalExpertise(new ArrayList<>()); | |||||
String techStr = MapUtil.getStr(w, "技术专长"); | |||||
for (String othTag : techStr.split(SEPARATOR)) { | |||||
tagMap.entrySet().stream() | |||||
.filter(tag -> tag.getValue().getTagName().equals(othTag)) | |||||
.forEach(tag -> { | |||||
TagFieldInfo expertTag = new TagFieldInfo(); | |||||
expertTag.setTagCode(tag.getValue().getTagCode()); | |||||
expertTag.setTagFieldName(ExpertTagEnum.TECHNICAL_EXPERTISE.getKey()); | |||||
expertTag.setTagName(tag.getValue().getTagName()); | |||||
professionalInfo.getTechnicalExpertise().add(expertTag); | |||||
}); | |||||
} | |||||
professionalInfo.setTitleLevel(new ArrayList<>()); | |||||
String titleLevel = MapUtil.getStr(w, "*职称级别"); | |||||
List<DictionaryDTO> titleLevelDicts = dictionaryCache.listDictByDictType(DictTypeEnum.TITLE_LEVEL.getKey()); | |||||
if (!titleLevelDicts.isEmpty()) { | |||||
titleLevelDicts.stream() | |||||
.filter(dict -> dict.getName().equals(titleLevel)) | |||||
.findFirst().ifPresent(dictionary -> { | |||||
DictFieldInfoDTO dict = new DictFieldInfoDTO(); | |||||
dict.setDictionaryName(dictionary.getName()); | |||||
dict.setDictionaryCode(dictionary.getDictionaryCode()); | |||||
dict.setDictionaryFieldName(dictionary.getDictionaryType()); | |||||
professionalInfo.getTitleLevel().add(dict); | |||||
}); | |||||
} | |||||
professionalInfo.setTechnicalTitles(MapUtil.getStr(w, "技术职称")); | |||||
request.setProfessionalInfo(professionalInfo); | |||||
ExpertRecommendInfo recommendInfo = new ExpertRecommendInfo(); | |||||
recommendInfo.setRecommendedWay(new ArrayList<>()); | |||||
request.setRecommendInfo(recommendInfo); | |||||
try { | |||||
expertController.expertBasicInfoSubmit(request); | |||||
} catch (Exception e) { | |||||
System.out.println(JSONUtil.toJsonStr(request)); | |||||
} | |||||
}); | |||||
} | |||||
} |
@@ -6,12 +6,20 @@ import org.slf4j.LoggerFactory; | |||||
import java.nio.charset.StandardCharsets; | import java.nio.charset.StandardCharsets; | ||||
import java.security.MessageDigest; | import java.security.MessageDigest; | ||||
public class Md5Utils { | |||||
/** | |||||
* <p> | |||||
* Md5Utils | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 19:21 2024/2/21 | |||||
*/ | |||||
public class Md5Util { | |||||
private Md5Utils() { | |||||
private Md5Util() { | |||||
} | } | ||||
private static final Logger LOGGER = LoggerFactory.getLogger(Md5Utils.class); | |||||
private static final Logger LOGGER = LoggerFactory.getLogger(Md5Util.class); | |||||
public static byte[] md5(String s) { | public static byte[] md5(String s) { | ||||
MessageDigest algorithm; | MessageDigest algorithm; |
@@ -24,7 +24,7 @@ public class RefreshKeyUtil { | |||||
// 刷新秘钥 | // 刷新秘钥 | ||||
HttpUtil httpUtil = HttpUtil.getInstance(); | HttpUtil httpUtil = HttpUtil.getInstance(); | ||||
log.info("请求密钥" + appSecret); | log.info("请求密钥" + appSecret); | ||||
String sign = Md5Utils.hash (appKey + appSecret + requestTime); | |||||
String sign = Md5Util.hash (appKey + appSecret + requestTime); | |||||
String refreshUrl = "http://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm"; | String refreshUrl = "http://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm"; | ||||
log.info(refreshUrl); | log.info(refreshUrl); | ||||
Map<String,String> map = new HashMap<>(); | Map<String,String> map = new HashMap<>(); | ||||
@@ -44,7 +44,7 @@ public class RefreshKeyUtil { | |||||
// 刷新秘钥 | // 刷新秘钥 | ||||
HttpUtil httpUtil = HttpUtil.getInstance(); | HttpUtil httpUtil = HttpUtil.getInstance(); | ||||
log.info("刷新密钥" + refreshSecret); | log.info("刷新密钥" + refreshSecret); | ||||
String refreshSign = Md5Utils.hash (appKey + refreshSecret + requestTime); | |||||
String refreshSign = Md5Util.hash (appKey + refreshSecret + requestTime); | |||||
String refreshUrl = "http://interface.zjzwfw.gov.cn/gateway/app/refreshTokenBySec.htm"; | String refreshUrl = "http://interface.zjzwfw.gov.cn/gateway/app/refreshTokenBySec.htm"; | ||||
log.info(refreshUrl); | log.info(refreshUrl); | ||||
Map<String,String> map = new HashMap<>(); | Map<String,String> map = new HashMap<>(); | ||||
@@ -8,11 +8,11 @@ import java.util.List; | |||||
/** | /** | ||||
* @author liuxinxin | * @author liuxinxin | ||||
* @date 2022/7/28 下午2:27 | |||||
* @since 2022/7/28 下午2:27 | |||||
*/ | */ | ||||
public class RegionUtils { | |||||
public class RegionUtil { | |||||
private RegionUtils() { | |||||
private RegionUtil() { | |||||
} | } | ||||
public static Boolean isValueEquals(ExpertRegionInfo regionInfo1, ExpertRegionInfo regionInfo2) { | public static Boolean isValueEquals(ExpertRegionInfo regionInfo1, ExpertRegionInfo regionInfo2) { |
@@ -1,73 +0,0 @@ | |||||
package com.hz.pm.api.common.util; | |||||
import com.hz.pm.api.todocenter.bean.entity.WorkNoticeInfo; | |||||
import com.ningdatech.basic.model.GenericResult; | |||||
import com.ningdatech.zwdd.client.ZwddClient; | |||||
import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |||||
import org.springframework.stereotype.Component; | |||||
import java.util.concurrent.CompletableFuture; | |||||
import java.util.concurrent.ExecutionException; | |||||
import java.util.concurrent.ThreadPoolExecutor; | |||||
/** | |||||
* 异步发送工作通知工具类 | |||||
* | |||||
* @author CMM | |||||
* @since 2023/02/23 13:50 | |||||
*/ | |||||
@Slf4j | |||||
@Component | |||||
@RequiredArgsConstructor | |||||
public class SendWorkNoticeUtil { | |||||
private final ZwddClient zwddClient; | |||||
/** | |||||
* 初始化线程池 | |||||
*/ | |||||
public static final ThreadPoolTaskExecutor EXECUTOR; | |||||
static { | |||||
EXECUTOR = new ThreadPoolTaskExecutor(); | |||||
EXECUTOR.setCorePoolSize(2); | |||||
EXECUTOR.setMaxPoolSize(4); | |||||
EXECUTOR.setQueueCapacity(200); | |||||
EXECUTOR.setKeepAliveSeconds(120); | |||||
EXECUTOR.setThreadNamePrefix("sendWorkNotice-"); | |||||
EXECUTOR.setWaitForTasksToCompleteOnShutdown(true); | |||||
EXECUTOR.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy()); | |||||
EXECUTOR.initialize(); | |||||
} | |||||
public Boolean sendWorkNotice(WorkNoticeInfo workNoticeInfo) { | |||||
// 将发送工作通知交给异步任务Future | |||||
String msg = workNoticeInfo.getMsg(); | |||||
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> { | |||||
// 调用浙政钉的接口发送工作通知 | |||||
long startTime = System.currentTimeMillis(); | |||||
GenericResult<Void> result = | |||||
zwddClient.sendWorkNotice(workNoticeInfo.getReceiverUserId(), workNoticeInfo.getBizMsgId(), msg); | |||||
String resultMsg = result.getMsg(); | |||||
if ("success".equals(resultMsg)) { | |||||
log.info("异步任务执行完成, " + workNoticeInfo.getBizMsgId() + " 当前线程:" + Thread.currentThread().getName()); | |||||
long endTime = System.currentTimeMillis(); | |||||
log.info("方法执行完成返回,耗时:" + (endTime - startTime)); | |||||
} else { | |||||
return "发送工作通知失败!"; | |||||
} | |||||
return "发送工作通知成功!"; | |||||
}, EXECUTOR); | |||||
try { | |||||
future.get(); | |||||
} catch (InterruptedException | ExecutionException e) { | |||||
log.error("获取异步线程处理结果失败!", e); | |||||
Thread.currentThread().interrupt(); | |||||
} | |||||
return Boolean.TRUE; | |||||
} | |||||
} |
@@ -0,0 +1,46 @@ | |||||
package com.hz.pm.api.common.util; | |||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.hz.pm.api.expert.model.TagFieldInfo; | |||||
import org.apache.commons.collections4.CollectionUtils; | |||||
import java.util.Comparator; | |||||
import java.util.List; | |||||
/** | |||||
* @author liuxinxin | |||||
* @since 2022/7/28 下午2:14 | |||||
*/ | |||||
public class TagUtil { | |||||
private TagUtil() { | |||||
} | |||||
private static final Comparator<TagFieldInfo> COMPARATOR = Comparator.comparing(TagFieldInfo::getTagFieldName) | |||||
.thenComparing(TagFieldInfo::getTagCode); | |||||
public static Boolean isValEq(List<TagFieldInfo> list1, List<TagFieldInfo> list2) { | |||||
if (CollUtil.isEmpty(list1) && CollUtil.isEmpty(list2)) { | |||||
return true; | |||||
} | |||||
boolean collStatusNotEq = (CollUtil.isEmpty(list1) && CollUtil.isNotEmpty(list2)) | |||||
|| (CollUtil.isEmpty(list2) && CollUtil.isNotEmpty(list1)); | |||||
if (collStatusNotEq) { | |||||
return false; | |||||
} | |||||
if (list1.size() != list2.size()) { | |||||
return false; | |||||
} | |||||
list1.sort(COMPARATOR); | |||||
list2.sort(COMPARATOR); | |||||
for (int i = 0; i < list1.size(); i++) { | |||||
if (!StrUtils.trimEquals(list1.get(i).getTagFieldName(), list2.get(i).getTagFieldName()) | |||||
|| !StrUtils.trimEquals(list1.get(i).getTagCode(), list2.get(i).getTagCode())) { | |||||
return false; | |||||
} | |||||
} | |||||
return true; | |||||
} | |||||
} |
@@ -1,42 +0,0 @@ | |||||
package com.hz.pm.api.common.util; | |||||
import com.hz.pm.api.expert.model.TagFieldInfo; | |||||
import org.apache.commons.collections4.CollectionUtils; | |||||
import java.util.Comparator; | |||||
import java.util.List; | |||||
/** | |||||
* @author liuxinxin | |||||
* @date 2022/7/28 下午2:14 | |||||
*/ | |||||
public class TagUtils { | |||||
private TagUtils() { | |||||
} | |||||
public static Boolean isValueEquals(List<TagFieldInfo> list1, List<TagFieldInfo> list2) { | |||||
if (CollectionUtils.isEmpty(list1) && CollectionUtils.isEmpty(list2)) { | |||||
return true; | |||||
} | |||||
boolean collectionStatusNotEquals = (CollectionUtils.isEmpty(list1) && CollectionUtils.isNotEmpty(list2)) | |||||
|| (CollectionUtils.isEmpty(list2) && CollectionUtils.isNotEmpty(list1)); | |||||
if (collectionStatusNotEquals) { | |||||
return false; | |||||
} | |||||
if (list1.size() != list2.size()) { | |||||
return false; | |||||
} | |||||
list1.sort(Comparator.comparing(TagFieldInfo::getTagFieldName).thenComparing(TagFieldInfo::getTagCode)); | |||||
list2.sort(Comparator.comparing(TagFieldInfo::getTagFieldName).thenComparing(TagFieldInfo::getTagCode)); | |||||
for (int i = 0; i < list1.size(); i++) { | |||||
if (!StrUtils.trimEquals(list1.get(i).getTagFieldName(), list2.get(i).getTagFieldName()) | |||||
|| !StrUtils.trimEquals(list1.get(i).getTagCode(), list2.get(i).getTagCode())) { | |||||
return false; | |||||
} | |||||
} | |||||
return true; | |||||
} | |||||
} |
@@ -1,10 +1,10 @@ | |||||
package com.hz.pm.api.expert.model; | package com.hz.pm.api.expert.model; | ||||
import com.hz.pm.api.common.util.DictUtils; | |||||
import com.hz.pm.api.common.util.RegionUtils; | |||||
import com.hz.pm.api.common.util.DictUtil; | |||||
import com.hz.pm.api.common.util.RegionUtil; | |||||
import com.hz.pm.api.common.util.StrUtils; | import com.hz.pm.api.common.util.StrUtils; | ||||
import com.hz.pm.api.common.util.TagUtils; | |||||
import com.hz.pm.api.common.util.TagUtil; | |||||
import com.hz.pm.api.expert.constant.ExpertSensitiveFieldTypeEnum; | import com.hz.pm.api.expert.constant.ExpertSensitiveFieldTypeEnum; | ||||
import com.hz.pm.api.expert.constant.ExpertUserInfoSensitiveFieldEnum; | import com.hz.pm.api.expert.constant.ExpertUserInfoSensitiveFieldEnum; | ||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | import com.hz.pm.api.meta.model.ExpertRegionInfo; | ||||
@@ -55,19 +55,19 @@ public class SensitiveModifySegment { | |||||
} | } | ||||
case administrative_rank: | case administrative_rank: | ||||
case title_level: { | case title_level: { | ||||
return DictUtils.isValueEquals((List<DictFieldInfoDTO>) this.original | |||||
return DictUtil.isValueEquals((List<DictFieldInfoDTO>) this.original | |||||
, (List<DictFieldInfoDTO>) this.apply); | , (List<DictFieldInfoDTO>) this.apply); | ||||
} | } | ||||
case good_at: | case good_at: | ||||
case technical_expertise: | case technical_expertise: | ||||
case industry_sector: | case industry_sector: | ||||
case other: { | case other: { | ||||
return TagUtils.isValueEquals((List<TagFieldInfo>) this.original, (List<TagFieldInfo>) this.apply); | |||||
return TagUtil.isValEq((List<TagFieldInfo>) this.original, (List<TagFieldInfo>) this.apply); | |||||
} | } | ||||
case expert_region: | case expert_region: | ||||
return RegionUtils.isValueEquals((ExpertRegionInfo) this.original, (ExpertRegionInfo) this.apply); | |||||
return RegionUtil.isValueEquals((ExpertRegionInfo) this.original, (ExpertRegionInfo) this.apply); | |||||
case expert_intention_work_region: | case expert_intention_work_region: | ||||
return RegionUtils.isValueEquals((List<ExpertRegionInfo>) this.original, (List<ExpertRegionInfo>) this.apply); | |||||
return RegionUtil.isValueEquals((List<ExpertRegionInfo>) this.original, (List<ExpertRegionInfo>) this.apply); | |||||
default: | default: | ||||
return Objects.equals(this.original, this.apply); | return Objects.equals(this.original, this.apply); | ||||
} | } | ||||
@@ -2,6 +2,7 @@ package com.hz.pm.api.expert.service.impl; | |||||
import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import cn.hutool.core.util.ObjectUtil; | |||||
import cn.hutool.core.util.PhoneUtil; | import cn.hutool.core.util.PhoneUtil; | ||||
import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
@@ -9,7 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.hz.pm.api.common.enumeration.BoolDisplayEnum; | import com.hz.pm.api.common.enumeration.BoolDisplayEnum; | ||||
import com.hz.pm.api.common.model.ExpertRegionModifyDiffBO; | import com.hz.pm.api.common.model.ExpertRegionModifyDiffBO; | ||||
import com.hz.pm.api.common.util.ExpertRegionInfoUtils; | |||||
import com.hz.pm.api.common.util.ExpertRegionInfoUtil; | |||||
import com.hz.pm.api.common.util.GzipUtil; | import com.hz.pm.api.common.util.GzipUtil; | ||||
import com.hz.pm.api.expert.assembler.ExpertUserInfoAssembler; | import com.hz.pm.api.expert.assembler.ExpertUserInfoAssembler; | ||||
import com.hz.pm.api.expert.constant.ExpertApplyStatusEnum; | import com.hz.pm.api.expert.constant.ExpertApplyStatusEnum; | ||||
@@ -543,7 +544,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||||
SensitiveModifySegment segment = expertIntentionFieldSegmentList.get(0); | SensitiveModifySegment segment = expertIntentionFieldSegmentList.get(0); | ||||
List<ExpertRegionInfo> apply = (List<ExpertRegionInfo>) segment.getApply(); | List<ExpertRegionInfo> apply = (List<ExpertRegionInfo>) segment.getApply(); | ||||
List<ExpertRegionInfo> original = (List<ExpertRegionInfo>) segment.getOriginal(); | List<ExpertRegionInfo> original = (List<ExpertRegionInfo>) segment.getOriginal(); | ||||
ExpertRegionModifyDiffBO expertRegionModifyDiffBO = ExpertRegionInfoUtils.modifyDiff(original, apply); | |||||
ExpertRegionModifyDiffBO expertRegionModifyDiffBO = ExpertRegionInfoUtil.diff(original, apply); | |||||
List<ExpertRegionInfo> addList = expertRegionModifyDiffBO.getAddList(); | List<ExpertRegionInfo> addList = expertRegionModifyDiffBO.getAddList(); | ||||
List<ExpertRegionInfo> removeList = expertRegionModifyDiffBO.getRemoveList(); | List<ExpertRegionInfo> removeList = expertRegionModifyDiffBO.getRemoveList(); | ||||
@@ -571,7 +572,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public Long createExpertInfoModifyApply(List<SensitiveModifySegment> expertSensitiveInfoFieldSegmentList | public Long createExpertInfoModifyApply(List<SensitiveModifySegment> expertSensitiveInfoFieldSegmentList | ||||
, ExpertUserFullInfo originalExpertUserFullInfo, ModifyApplyExtraInfoDTO modifyApplyExtraInfo) { | , ExpertUserFullInfo originalExpertUserFullInfo, ModifyApplyExtraInfoDTO modifyApplyExtraInfo) { | ||||
expertSensitiveInfoFieldSegmentList = expertSensitiveInfoFieldSegmentList.stream().filter(r -> !r.isValueEquals()).collect(Collectors.toList()); | |||||
expertSensitiveInfoFieldSegmentList.removeIf(SensitiveModifySegment::isValueEquals); | |||||
String compressedModifyJsonStr = GzipUtil.zip(JSONObject.toJSONString(expertSensitiveInfoFieldSegmentList)); | String compressedModifyJsonStr = GzipUtil.zip(JSONObject.toJSONString(expertSensitiveInfoFieldSegmentList)); | ||||
ExpertMetaApply expertMetaApply = new ExpertMetaApply(); | ExpertMetaApply expertMetaApply = new ExpertMetaApply(); | ||||
@@ -629,9 +630,9 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||||
/** | /** | ||||
* 创建层级变更审核 | * 创建层级变更审核 | ||||
* | * | ||||
* @param expertRegionFieldSegmentList | |||||
* @param originalExpertUserFullInfo | |||||
* @param modifyApplyExtraInfo | |||||
* @param expertRegionFieldSegmentList \ | |||||
* @param originalExpertUserFullInfo \ | |||||
* @param modifyApplyExtraInfo \ | |||||
*/ | */ | ||||
private Long createExpertRegionModifyApply(List<SensitiveModifySegment> expertRegionFieldSegmentList | private Long createExpertRegionModifyApply(List<SensitiveModifySegment> expertRegionFieldSegmentList | ||||
, ExpertUserFullInfo originalExpertUserFullInfo, ModifyApplyExtraInfoDTO modifyApplyExtraInfo) { | , ExpertUserFullInfo originalExpertUserFullInfo, ModifyApplyExtraInfoDTO modifyApplyExtraInfo) { | ||||
@@ -30,7 +30,7 @@ import java.util.List; | |||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
public class MhFileClient { | public class MhFileClient { | ||||
private static final int TIMEOUT_MILLS = 5000; | |||||
private static final int TIMEOUT_MILLS = 10000; | |||||
@Value("${mh.file.down-url:}") | @Value("${mh.file.down-url:}") | ||||
private String fileDownUrl; | private String fileDownUrl; | ||||
@@ -43,7 +43,7 @@ public class MhFileClient { | |||||
try (ServletOutputStream stream = response.getOutputStream()) { | try (ServletOutputStream stream = response.getOutputStream()) { | ||||
long size = HttpUtil.download(fileUrl, stream, true); | long size = HttpUtil.download(fileUrl, stream, true); | ||||
log.info("下载文件:{},大小为:{}", fileId, size); | log.info("下载文件:{},大小为:{}", fileId, size); | ||||
} catch (IOException e) { | |||||
} catch (Exception e) { | |||||
log.error("信创平台文件下载异常:{}", fileId, e); | log.error("信创平台文件下载异常:{}", fileId, e); | ||||
throw BizException.wrap("下载文件失败"); | throw BizException.wrap("下载文件失败"); | ||||
} | } | ||||
@@ -51,14 +51,18 @@ public class MhFileClient { | |||||
public List<MhFileInfoDTO> listFileInfo(String fileIds) { | public List<MhFileInfoDTO> listFileInfo(String fileIds) { | ||||
String url = fileDetailUrl + "?ids=" + fileIds; | String url = fileDetailUrl + "?ids=" + fileIds; | ||||
String body = HttpUtil.get(url, TIMEOUT_MILLS); | |||||
MhRetDTO<List<MhFileInfoDTO>> ret = JSONUtil.toBean(body, | |||||
new TypeReference<MhRetDTO<List<MhFileInfoDTO>>>() { | |||||
}, false); | |||||
if (ret.isOk()) { | |||||
return ret.getData(); | |||||
try { | |||||
String body = HttpUtil.get(url, TIMEOUT_MILLS); | |||||
MhRetDTO<List<MhFileInfoDTO>> ret = JSONUtil.toBean(body, | |||||
new TypeReference<MhRetDTO<List<MhFileInfoDTO>>>() { | |||||
}, false); | |||||
if (ret.isOk()) { | |||||
return ret.getData(); | |||||
} | |||||
throw BizException.wrap("获取文件详情失败"); | |||||
} catch (Exception e) { | |||||
throw BizException.wrap("获取文件详情失败"); | |||||
} | } | ||||
throw BizException.wrap("获取文件详情"); | |||||
} | } | ||||
} | } |
@@ -50,7 +50,7 @@ import com.hz.pm.api.projectlib.service.IProjectInstService; | |||||
import com.hz.pm.api.projectlib.service.IProjectService; | import com.hz.pm.api.projectlib.service.IProjectService; | ||||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | import com.hz.pm.api.staging.enums.MsgTypeEnum; | ||||
import com.hz.pm.api.sys.manage.NoticeManage; | import com.hz.pm.api.sys.manage.NoticeManage; | ||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConstant; | |||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConst; | |||||
import com.hz.pm.api.user.helper.MhUnitCache; | import com.hz.pm.api.user.helper.MhUnitCache; | ||||
import com.hz.pm.api.user.model.dto.UnitDTO; | import com.hz.pm.api.user.model.dto.UnitDTO; | ||||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | import com.hz.pm.api.user.security.model.UserFullInfoDTO; | ||||
@@ -230,7 +230,7 @@ public class ProjectFileManage { | |||||
List<ProcessDetailVO> processDetailVos = projectLibManage.processScheduleDetail(projectId); | List<ProcessDetailVO> processDetailVos = projectLibManage.processScheduleDetail(projectId); | ||||
ProjectReviewDetailVO projectReviewDetailVo = expertReviewManage.projectExpertReviewDetail(projectCode); | ProjectReviewDetailVO projectReviewDetailVo = expertReviewManage.projectExpertReviewDetail(projectCode); | ||||
List<PurchaseVO> purchaseVos = purchaseManage.detailByProjectId(projectId); | List<PurchaseVO> purchaseVos = purchaseManage.detailByProjectId(projectId); | ||||
ContractVO contractVo = constructionManage.detailContractByProjectId(projectId); | |||||
List<ContractVO> contractVos = constructionManage.detailContractByProjectId(projectId); | |||||
PreInsVO preInsVo = constructionManage.detailPreInsByProjectId(projectId); | PreInsVO preInsVo = constructionManage.detailPreInsByProjectId(projectId); | ||||
FinalAcceptanceVO finalAcceptanceVo = finalAcceptanceManage.detailByProjectId(projectId); | FinalAcceptanceVO finalAcceptanceVo = finalAcceptanceManage.detailByProjectId(projectId); | ||||
@@ -238,7 +238,7 @@ public class ProjectFileManage { | |||||
projectFileVo.setProcessDetailVos(processDetailVos); | projectFileVo.setProcessDetailVos(processDetailVos); | ||||
projectFileVo.setProjectReviewDetailVo(projectReviewDetailVo); | projectFileVo.setProjectReviewDetailVo(projectReviewDetailVo); | ||||
projectFileVo.setPurchaseVos(purchaseVos); | projectFileVo.setPurchaseVos(purchaseVos); | ||||
projectFileVo.setContractVo(contractVo); | |||||
projectFileVo.setContractVos(contractVos); | |||||
projectFileVo.setPreInsVo(preInsVo); | projectFileVo.setPreInsVo(preInsVo); | ||||
projectFileVo.setFinalAcceptanceVo(finalAcceptanceVo); | projectFileVo.setFinalAcceptanceVo(finalAcceptanceVo); | ||||
@@ -277,7 +277,7 @@ public class ProjectFileManage { | |||||
projectLibManage.saveProjectByApplyBorrow(project, user, instanceId); | projectLibManage.saveProjectByApplyBorrow(project, user, instanceId); | ||||
// 发送给第一个审批人消息 | // 发送给第一个审批人消息 | ||||
noticeManage.sendFirstUser(project, model.getFormName(), instanceId, WorkNoticeConstant.PASS_MSG_TEMPLATE, | |||||
noticeManage.sendFirstUser(project, model.getFormName(), instanceId, WorkNoticeConst.PASS_MSG_TEMPLATE, | |||||
MsgTypeEnum.PROJECT_REVIEW); | MsgTypeEnum.PROJECT_REVIEW); | ||||
return instanceId; | return instanceId; | ||||
@@ -36,7 +36,7 @@ public class ProjectFileVO { | |||||
private List<PurchaseVO> purchaseVos; | private List<PurchaseVO> purchaseVos; | ||||
@ApiModelProperty("合同登记详情") | @ApiModelProperty("合同登记详情") | ||||
private ContractVO contractVo; | |||||
private List<ContractVO> contractVos; | |||||
@ApiModelProperty("初验登记详情") | @ApiModelProperty("初验登记详情") | ||||
private PreInsVO preInsVo; | private PreInsVO preInsVo; | ||||
@@ -307,14 +307,6 @@ public class ProjectConvertUtil { | |||||
//转化采购信息 | //转化采购信息 | ||||
private static List<GovBizProjectProcureVO> buildProcure(ProjectDetailVO project) { | private static List<GovBizProjectProcureVO> buildProcure(ProjectDetailVO project) { | ||||
List<PurchaseVO> purchases = project.getPurchases(); | List<PurchaseVO> purchases = project.getPurchases(); | ||||
ContractVO contract = project.getContract(); | |||||
final BigDecimal[] paymentTotal = {BigDecimal.ZERO}; | |||||
if (Objects.nonNull(contract)) { | |||||
List<PaymentPlanVO> payments = contract.getPayments(); | |||||
payments.stream().map(PaymentPlanVO::getPaymentAmount) | |||||
.reduce(BigDecimal::add) | |||||
.ifPresent(b -> paymentTotal[0] = b); | |||||
} | |||||
if (CollUtil.isNotEmpty(purchases)) { | if (CollUtil.isNotEmpty(purchases)) { | ||||
return purchases.stream().map(p -> { | return purchases.stream().map(p -> { | ||||
GovBizProjectProcureVO purchase = new GovBizProjectProcureVO(); | GovBizProjectProcureVO purchase = new GovBizProjectProcureVO(); | ||||
@@ -332,10 +324,6 @@ public class ProjectConvertUtil { | |||||
purchase.setBasePurchaseCode(p.getBudgetExecConfirmNo()); | purchase.setBasePurchaseCode(p.getBudgetExecConfirmNo()); | ||||
purchase.setBaseWinningBidTime(p.getTransactionTime()); | purchase.setBaseWinningBidTime(p.getTransactionTime()); | ||||
purchase.setBiddingFile(p.getAcceptanceLetter()); | purchase.setBiddingFile(p.getAcceptanceLetter()); | ||||
purchase.setPaymentProgress(paymentTotal[0]); | |||||
if (Objects.nonNull(contract)) { | |||||
purchase.setPurchaseContract(contract.getAttachment()); | |||||
} | |||||
purchase.setSetProjCodeFinan(project.getFinancialCode()); | purchase.setSetProjCodeFinan(project.getFinancialCode()); | ||||
purchase.setPurchaseFile(p.getBidDoc()); | purchase.setPurchaseFile(p.getBidDoc()); | ||||
return purchase; | return purchase; | ||||
@@ -2,9 +2,9 @@ package com.hz.pm.api.projectdeclared.controller; | |||||
import com.hz.pm.api.common.util.ExcelDownUtil; | import com.hz.pm.api.common.util.ExcelDownUtil; | ||||
import com.hz.pm.api.projectdeclared.manage.ConstructionManage; | import com.hz.pm.api.projectdeclared.manage.ConstructionManage; | ||||
import com.hz.pm.api.projectdeclared.model.dto.ContractSaveDTO; | |||||
import com.hz.pm.api.projectdeclared.model.dto.PaymentPlanSupplementDTO; | import com.hz.pm.api.projectdeclared.model.dto.PaymentPlanSupplementDTO; | ||||
import com.hz.pm.api.projectdeclared.model.dto.PreInsSaveDTO; | import com.hz.pm.api.projectdeclared.model.dto.PreInsSaveDTO; | ||||
import com.hz.pm.api.projectdeclared.model.req.SubmitConstructionReq; | |||||
import com.hz.pm.api.projectdeclared.model.vo.ContractVO; | import com.hz.pm.api.projectdeclared.model.vo.ContractVO; | ||||
import com.hz.pm.api.projectdeclared.model.vo.PreInsVO; | import com.hz.pm.api.projectdeclared.model.vo.PreInsVO; | ||||
import com.hz.pm.api.projectdeclared.model.vo.ProjectContractListVO; | import com.hz.pm.api.projectdeclared.model.vo.ProjectContractListVO; | ||||
@@ -56,17 +56,17 @@ public class ConstructionController { | |||||
ExcelDownUtil.downXls(response, req, constructionManage::exportList); | ExcelDownUtil.downXls(response, req, constructionManage::exportList); | ||||
} | } | ||||
@ApiOperation(value = "合同备案的详情-通过项目ID", notes = "合同备案的详情-通过项目ID") | |||||
@ApiOperation(value = "合同备案的详情") | |||||
@GetMapping("/contract/detail/{projectId}") | @GetMapping("/contract/detail/{projectId}") | ||||
public ContractVO detailContractByProjectId(@PathVariable Long projectId) { | |||||
public List<ContractVO> detailContractByProjectId(@PathVariable Long projectId) { | |||||
return constructionManage.detailContractByProjectId(projectId); | return constructionManage.detailContractByProjectId(projectId); | ||||
} | } | ||||
@ApiOperation(value = "填写合同信息", notes = "填写合同信息") | |||||
@ApiOperation(value = "填写合同信息") | |||||
@WebLog("填写合同信息") | @WebLog("填写合同信息") | ||||
@PostMapping("/submit-contract") | @PostMapping("/submit-contract") | ||||
public String submitContract(@Validated @RequestBody ContractSaveDTO dto) { | |||||
return constructionManage.submitContract(dto); | |||||
public String submitContract(@Validated @RequestBody SubmitConstructionReq req) { | |||||
return constructionManage.submitPurchaseContract(req); | |||||
} | } | ||||
@ApiOperation(value = "补充实际支付金额", notes = "补充实际支付金额") | @ApiOperation(value = "补充实际支付金额", notes = "补充实际支付金额") | ||||
@@ -2,6 +2,7 @@ package com.hz.pm.api.projectdeclared.controller; | |||||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
import com.hz.pm.api.projectdeclared.model.enumerization.ProjectDraftTypeEnum; | |||||
import com.ningdatech.log.annotation.WebLog; | import com.ningdatech.log.annotation.WebLog; | ||||
import com.hz.pm.api.gov.manage.GovProjectCollectionManage; | import com.hz.pm.api.gov.manage.GovProjectCollectionManage; | ||||
import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||
@@ -52,13 +53,19 @@ public class DeclaredProjectController { | |||||
@RequestParam(required = false) Integer pageSize, | @RequestParam(required = false) Integer pageSize, | ||||
@RequestParam(required = false) Integer pageNumber, | @RequestParam(required = false) Integer pageNumber, | ||||
@RequestParam(required = false) String orgCode) { | @RequestParam(required = false) String orgCode) { | ||||
return declaredProjectManage.bizList(businessName,pageSize,pageNumber,orgCode); | |||||
return declaredProjectManage.bizList(businessName, pageSize, pageNumber, orgCode); | |||||
} | } | ||||
@ApiOperation(value = "申报项目草稿箱列表", notes = "申报项目草稿箱列表") | @ApiOperation(value = "申报项目草稿箱列表", notes = "申报项目草稿箱列表") | ||||
@GetMapping("/draft") | @GetMapping("/draft") | ||||
public PageVo<ProjectDraftVO> draft(@ModelAttribute DeclaredProjectListParamDTO params) { | public PageVo<ProjectDraftVO> draft(@ModelAttribute DeclaredProjectListParamDTO params) { | ||||
return declaredProjectManage.pageDraft(params); | |||||
return declaredProjectManage.pageDraft(params, ProjectDraftTypeEnum.PROJECT_DECLARED.getCode()); | |||||
} | |||||
@ApiOperation(value = "立项备案草稿箱列表", notes = "立项备案草稿箱列表") | |||||
@GetMapping("/declaredRecord/draft") | |||||
public PageVo<ProjectDraftVO> declaredRecordDraft(@ModelAttribute DeclaredProjectListParamDTO params) { | |||||
return declaredProjectManage.pageDraft(params, ProjectDraftTypeEnum.DECLARED_RECORD.getCode()); | |||||
} | } | ||||
@ApiOperation(value = "申报项目草稿箱详情", notes = "申报项目草稿箱详情") | @ApiOperation(value = "申报项目草稿箱详情", notes = "申报项目草稿箱详情") | ||||
@@ -71,7 +78,14 @@ public class DeclaredProjectController { | |||||
@WebLog("申报项目保存至草稿箱") | @WebLog("申报项目保存至草稿箱") | ||||
@PostMapping("/save-to-draft") | @PostMapping("/save-to-draft") | ||||
public Object saveToDraft(@Validated @RequestBody ProjectDraftSaveDTO dto) { | public Object saveToDraft(@Validated @RequestBody ProjectDraftSaveDTO dto) { | ||||
return declaredProjectManage.saveToDraft(dto); | |||||
return declaredProjectManage.saveToDraft(dto, ProjectDraftTypeEnum.PROJECT_DECLARED.getCode()); | |||||
} | |||||
@ApiOperation(value = "立项备案保存至草稿箱", notes = "立项备案保存至草稿箱") | |||||
@WebLog("立项备案保存至草稿箱") | |||||
@PostMapping("/declaredRecord/save-to-draft") | |||||
public Object declaredRecordSaveToDraft(@Validated @RequestBody ProjectDraftSaveDTO dto) { | |||||
return declaredProjectManage.saveToDraft(dto, ProjectDraftTypeEnum.DECLARED_RECORD.getCode()); | |||||
} | } | ||||
@ApiOperation(value = "申报项目", notes = "申报项目") | @ApiOperation(value = "申报项目", notes = "申报项目") | ||||
@@ -92,14 +106,14 @@ public class DeclaredProjectController { | |||||
@GetMapping("/export") | @GetMapping("/export") | ||||
@ApiOperation("申报项目列表导出") | @ApiOperation("申报项目列表导出") | ||||
@WebLog("申报项目列表导出") | @WebLog("申报项目列表导出") | ||||
public void exportList(ProjectListReq req, HttpServletResponse response){ | |||||
ExcelDownUtil.downXls(response,req,declaredProjectManage::exportList); | |||||
public void exportList(ProjectListReq req, HttpServletResponse response) { | |||||
ExcelDownUtil.downXls(response, req, declaredProjectManage::exportList); | |||||
} | } | ||||
@PostMapping("/remove/{projectCode}") | @PostMapping("/remove/{projectCode}") | ||||
@ApiOperation("申报项目删除-预审失败") | @ApiOperation("申报项目删除-预审失败") | ||||
@WebLog("申报项目删除-预审失败") | @WebLog("申报项目删除-预审失败") | ||||
public String remove(@PathVariable String projectCode){ | |||||
public String remove(@PathVariable String projectCode) { | |||||
return declaredProjectManage.removeProject(projectCode); | return declaredProjectManage.removeProject(projectCode); | ||||
} | } | ||||
} | } |
@@ -1,8 +1,8 @@ | |||||
package com.hz.pm.api.projectdeclared.controller; | package com.hz.pm.api.projectdeclared.controller; | ||||
import com.hz.pm.api.projectdeclared.model.dto.OperationReq; | |||||
import com.ningdatech.log.annotation.WebLog; | import com.ningdatech.log.annotation.WebLog; | ||||
import com.hz.pm.api.projectdeclared.manage.OperationManage; | import com.hz.pm.api.projectdeclared.manage.OperationManage; | ||||
import com.hz.pm.api.projectdeclared.model.dto.OperationDTO; | |||||
import com.hz.pm.api.projectdeclared.model.vo.OperationVO; | import com.hz.pm.api.projectdeclared.model.vo.OperationVO; | ||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
@@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import java.util.List; | |||||
/** | /** | ||||
* @Classname OperationController | * @Classname OperationController | ||||
* @Description 申报项目-实施 | * @Description 申报项目-实施 | ||||
@@ -28,14 +30,14 @@ public class OperationController { | |||||
@ApiOperation(value = "实施详情", notes = "实施详情") | @ApiOperation(value = "实施详情", notes = "实施详情") | ||||
@GetMapping("/detail/{projectId}") | @GetMapping("/detail/{projectId}") | ||||
public OperationVO detail(@PathVariable Long projectId) { | |||||
public List<OperationVO> detail(@PathVariable Long projectId) { | |||||
return operationManage.detail(projectId); | return operationManage.detail(projectId); | ||||
} | } | ||||
@PostMapping("/push-operation") | @PostMapping("/push-operation") | ||||
@ApiOperation("填写实施计划") | @ApiOperation("填写实施计划") | ||||
@WebLog("填写实施计划") | @WebLog("填写实施计划") | ||||
public String pushOperation(@RequestBody OperationDTO operation) { | |||||
public String pushOperation(@RequestBody OperationReq operation) { | |||||
return operationManage.pushOperation(operation); | return operationManage.pushOperation(operation); | ||||
} | } | ||||
@@ -1,5 +1,6 @@ | |||||
package com.hz.pm.api.projectdeclared.controller; | package com.hz.pm.api.projectdeclared.controller; | ||||
import cn.hutool.core.io.FileUtil; | |||||
import com.hz.pm.api.common.util.ExcelDownUtil; | import com.hz.pm.api.common.util.ExcelDownUtil; | ||||
import com.hz.pm.api.projectdeclared.manage.ProjectAdjustmentManage; | import com.hz.pm.api.projectdeclared.manage.ProjectAdjustmentManage; | ||||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | ||||
@@ -15,6 +16,9 @@ import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
import java.io.File; | |||||
import java.util.Comparator; | |||||
import java.util.List; | |||||
/** | /** | ||||
* @Classname ConstructionPlanController | * @Classname ConstructionPlanController | ||||
@@ -52,4 +56,5 @@ public class ProjectAdjustmentController { | |||||
public void exportList(AdjustmentListReq preReq, HttpServletResponse response){ | public void exportList(AdjustmentListReq preReq, HttpServletResponse response){ | ||||
ExcelDownUtil.downXls(response,preReq,projectAdjustmentManage::exportList); | ExcelDownUtil.downXls(response,preReq,projectAdjustmentManage::exportList); | ||||
} | } | ||||
} | } |
@@ -1,14 +1,15 @@ | |||||
package com.hz.pm.api.projectdeclared.controller; | package com.hz.pm.api.projectdeclared.controller; | ||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.log.annotation.WebLog; | |||||
import com.hz.pm.api.common.util.ExcelDownUtil; | import com.hz.pm.api.common.util.ExcelDownUtil; | ||||
import com.hz.pm.api.projectdeclared.manage.ProjectAdjustmentManage; | |||||
import com.hz.pm.api.projectdeclared.manage.PurchaseManage; | import com.hz.pm.api.projectdeclared.manage.PurchaseManage; | ||||
import com.hz.pm.api.projectdeclared.model.dto.PurchaseSaveDTO; | import com.hz.pm.api.projectdeclared.model.dto.PurchaseSaveDTO; | ||||
import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseRecordReq; | |||||
import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseNoticeReq; | |||||
import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO; | import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO; | ||||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | import com.hz.pm.api.projectlib.model.req.ProjectListReq; | ||||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | ||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.log.annotation.WebLog; | |||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -34,8 +35,6 @@ import java.util.List; | |||||
public class PurchaseController { | public class PurchaseController { | ||||
private final PurchaseManage purchaseManage; | private final PurchaseManage purchaseManage; | ||||
private final ProjectAdjustmentManage projectAdjustmentManage; | |||||
@ApiOperation(value = "待采购结果备案列表", notes = "待采购结果备案列表") | @ApiOperation(value = "待采购结果备案列表", notes = "待采购结果备案列表") | ||||
@GetMapping("/project-list") | @GetMapping("/project-list") | ||||
public PageVo<ProjectLibListItemVO> projectlist(@ModelAttribute ProjectListReq req) { | public PageVo<ProjectLibListItemVO> projectlist(@ModelAttribute ProjectListReq req) { | ||||
@@ -62,4 +61,18 @@ public class PurchaseController { | |||||
return purchaseManage.submitResult(dto); | return purchaseManage.submitResult(dto); | ||||
} | } | ||||
@ApiOperation("发布采购公告") | |||||
@WebLog("发布采购公告") | |||||
@PostMapping("/notice/submit") | |||||
public void submitPurchaseNotice(@RequestBody SubmitPurchaseNoticeReq req) { | |||||
purchaseManage.submitPurchaseNotice(req); | |||||
} | |||||
@ApiOperation("采购信息备案") | |||||
@WebLog("采购信息备案") | |||||
@PostMapping("/record/submit") | |||||
public void submitPurchaseRecord(@RequestBody SubmitPurchaseRecordReq req) { | |||||
purchaseManage.submitPurchaseRecord(req); | |||||
} | |||||
} | } |
@@ -43,7 +43,8 @@ public class ApplicationConverter { | |||||
.projectId(projectInfo.getProjectCode()) | .projectId(projectInfo.getProjectCode()) | ||||
.projectType(convertProjectType(projectInfo.getProjectType())) | .projectType(convertProjectType(projectInfo.getProjectType())) | ||||
.totalMoney(projectInfo.getDeclareAmount()) | .totalMoney(projectInfo.getDeclareAmount()) | ||||
.yearBudget(projectInfo.getAnnualPlanAmount()) | |||||
// TODO | |||||
.yearBudget(BigDecimal.ZERO) | |||||
.budgetFrom(checkAddBudget(projectInfo.getDeclareHaveAmount() | .budgetFrom(checkAddBudget(projectInfo.getDeclareHaveAmount() | ||||
, projectInfo.getDeclareGovOwnFinanceAmount(), | , projectInfo.getDeclareGovOwnFinanceAmount(), | ||||
projectInfo.getDeclareGovSuperiorFinanceAmount(), | projectInfo.getDeclareGovSuperiorFinanceAmount(), | ||||
@@ -10,6 +10,7 @@ import com.google.common.collect.Lists; | |||||
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.StateMachineUtil; | ||||
import com.hz.pm.api.common.util.DecimalUtil; | |||||
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.projectdeclared.model.dto.ContractSaveDTO; | import com.hz.pm.api.projectdeclared.model.dto.ContractSaveDTO; | ||||
@@ -20,6 +21,7 @@ import com.hz.pm.api.projectdeclared.model.entity.Contract; | |||||
import com.hz.pm.api.projectdeclared.model.entity.PaymentPlan; | import com.hz.pm.api.projectdeclared.model.entity.PaymentPlan; | ||||
import com.hz.pm.api.projectdeclared.model.entity.PreInsAcceptancePerson; | import com.hz.pm.api.projectdeclared.model.entity.PreInsAcceptancePerson; | ||||
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.req.SubmitConstructionReq; | |||||
import com.hz.pm.api.projectdeclared.model.vo.*; | import com.hz.pm.api.projectdeclared.model.vo.*; | ||||
import com.hz.pm.api.projectdeclared.service.IContractService; | import com.hz.pm.api.projectdeclared.service.IContractService; | ||||
import com.hz.pm.api.projectdeclared.service.IPaymentPlanService; | import com.hz.pm.api.projectdeclared.service.IPaymentPlanService; | ||||
@@ -27,10 +29,12 @@ import com.hz.pm.api.projectdeclared.service.IPreInsAcceptancePersonService; | |||||
import com.hz.pm.api.projectdeclared.service.IPurchaseService; | import com.hz.pm.api.projectdeclared.service.IPurchaseService; | ||||
import com.hz.pm.api.projectlib.helper.ProjectHelper; | import com.hz.pm.api.projectlib.helper.ProjectHelper; | ||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan; | |||||
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.enumeration.ProjectTypeNewEnum; | import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | ||||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | import com.hz.pm.api.projectlib.model.req.ProjectListReq; | ||||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | ||||
import com.hz.pm.api.projectlib.service.IProjectPaymentPlanService; | |||||
import com.hz.pm.api.projectlib.service.IProjectService; | import com.hz.pm.api.projectlib.service.IProjectService; | ||||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | import com.hz.pm.api.user.security.model.UserFullInfoDTO; | ||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | import com.hz.pm.api.user.security.model.UserInfoDetails; | ||||
@@ -45,16 +49,14 @@ 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.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.math.RoundingMode; | import java.math.RoundingMode; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.time.format.DateTimeFormatter; | import java.time.format.DateTimeFormatter; | ||||
import java.util.Collections; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
import java.util.Objects; | |||||
import java.util.*; | |||||
import java.util.concurrent.atomic.AtomicInteger; | import java.util.concurrent.atomic.AtomicInteger; | ||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
@@ -81,6 +83,7 @@ public class ConstructionManage { | |||||
private final IPreInsAcceptancePersonService acceptancePersonService; | private final IPreInsAcceptancePersonService acceptancePersonService; | ||||
private final StateMachineUtil stateMachineUtil; | private final StateMachineUtil stateMachineUtil; | ||||
private final IProjectPaymentPlanService projectPaymentPlanService; | |||||
/** | /** | ||||
* 待采购的-项目列表 | * 待采购的-项目列表 | ||||
@@ -246,51 +249,29 @@ public class ConstructionManage { | |||||
/** | /** | ||||
* 获取合同备案详情 | * 获取合同备案详情 | ||||
* | * | ||||
* @param projectId | |||||
* @return | |||||
* @param projectId \ | |||||
* @return \ | |||||
*/ | */ | ||||
public ContractVO detailContractByProjectId(Long projectId) { | |||||
public List<ContractVO> detailContractByProjectId(Long projectId) { | |||||
Project project = projectService.getNewProject(projectId); | Project project = projectService.getNewProject(projectId); | ||||
if (Objects.isNull(project)) { | if (Objects.isNull(project)) { | ||||
return null; | |||||
} | |||||
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) | |||||
.eq(Contract::getProjectCode, project.getProjectCode()) | |||||
.last(BizConst.LIMIT_1)); | |||||
ContractVO vo = BeanUtil.copyProperties(contract, ContractVO.class); | |||||
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) | |||||
.eq(PaymentPlan::getProjectCode, project.getProjectCode()) | |||||
.orderByAsc(PaymentPlan::getPaymentTime)); | |||||
if (CollUtil.isNotEmpty(payments)) { | |||||
vo.setPayments(convertPayments(payments, contract.getTotalAmount())); | |||||
} | |||||
return vo; | |||||
} | |||||
private List<PaymentPlanVO> convertPayments(List<PaymentPlan> payments, BigDecimal totalAmount) { | |||||
if (CollUtil.isEmpty(payments)) { | |||||
return Collections.emptyList(); | return Collections.emptyList(); | ||||
} | } | ||||
return payments.stream().map(p -> { | |||||
PaymentPlanVO vo = BeanUtil.copyProperties(p, PaymentPlanVO.class); | |||||
vo.setRatio((Objects.isNull(totalAmount) || totalAmount.compareTo(BigDecimal.ZERO) == 0) ? "0%" | |||||
: p.getPaymentAmount().multiply(BigDecimal.valueOf(100)) | |||||
.divide(totalAmount, BigDecimal.ROUND_CEILING, RoundingMode.CEILING) + "%"); | |||||
return vo; | |||||
}) | |||||
.collect(Collectors.toList()); | |||||
List<Contract> contracts = contractService.list(Wrappers.lambdaQuery(Contract.class) | |||||
.eq(Contract::getProjectCode, project.getProjectCode())); | |||||
return BeanUtil.copyToList(contracts, ContractVO.class); | |||||
} | } | ||||
/** | /** | ||||
* 填写合同信息 | * 填写合同信息 | ||||
* | * | ||||
* @param dto | |||||
* @return | |||||
* @param dto \ | |||||
* @return \ | |||||
* @deprecated 弃用 | |||||
*/ | */ | ||||
@Deprecated | |||||
@Transactional(rollbackFor = Exception.class) | |||||
public String submitContract(ContractSaveDTO dto) { | public String submitContract(ContractSaveDTO dto) { | ||||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | ||||
Long projectId = dto.getProjectId(); | Long projectId = dto.getProjectId(); | ||||
@@ -317,27 +298,25 @@ public class ConstructionManage { | |||||
} | } | ||||
contractEntity.setProjectId(projectId); | contractEntity.setProjectId(projectId); | ||||
contractEntity.setProjectCode(project.getProjectCode()); | contractEntity.setProjectCode(project.getProjectCode()); | ||||
if (contractService.saveOrUpdate(contractEntity)) { | |||||
//存 付款计划信心 | |||||
if (Objects.nonNull(dto.getPayments())) { | |||||
//先删除 | |||||
paymentPlanService.remove(Wrappers.lambdaQuery(PaymentPlan.class) | |||||
.eq(PaymentPlan::getProjectId, projectId)); | |||||
if (CollUtil.isNotEmpty(dto.getPayments())) { | |||||
List<PaymentPlan> payments = dto.getPayments().stream().map(d -> { | |||||
PaymentPlan plan = BeanUtil.copyProperties(d, PaymentPlan.class); | |||||
plan.setProjectId(projectId); | |||||
plan.setProjectCode(project.getProjectCode()); | |||||
plan.setCreateOn(LocalDateTime.now()); | |||||
plan.setUpdateOn(LocalDateTime.now()); | |||||
plan.setCreateBy(user.getUserIdStr()); | |||||
plan.setUpdateBy(user.getUserIdStr()); | |||||
return plan; | |||||
}).collect(Collectors.toList()); | |||||
paymentPlanService.saveBatch(payments); | |||||
} | |||||
if (contractService.saveOrUpdate(contractEntity) && (Objects.nonNull(dto.getPayments()))) { | |||||
//先删除 | |||||
paymentPlanService.remove(Wrappers.lambdaQuery(PaymentPlan.class) | |||||
.eq(PaymentPlan::getProjectId, projectId)); | |||||
if (CollUtil.isNotEmpty(dto.getPayments())) { | |||||
List<PaymentPlan> payments = dto.getPayments().stream().map(d -> { | |||||
PaymentPlan plan = BeanUtil.copyProperties(d, PaymentPlan.class); | |||||
plan.setProjectId(projectId); | |||||
plan.setProjectCode(project.getProjectCode()); | |||||
plan.setCreateOn(LocalDateTime.now()); | |||||
plan.setUpdateOn(LocalDateTime.now()); | |||||
plan.setCreateBy(user.getUserIdStr()); | |||||
plan.setUpdateBy(user.getUserIdStr()); | |||||
return plan; | |||||
}).collect(Collectors.toList()); | |||||
paymentPlanService.saveBatch(payments); | |||||
} | } | ||||
} | } | ||||
//判断下 如果和初验都完成了 才进入下一阶段 | //判断下 如果和初验都完成了 才进入下一阶段 | ||||
@@ -357,6 +336,47 @@ public class ConstructionManage { | |||||
return "填写成功"; | return "填写成功"; | ||||
} | } | ||||
@Transactional(rollbackFor = Exception.class) | |||||
public String submitPurchaseContract(SubmitConstructionReq req) { | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
Long projectId = req.getProjectId(); | |||||
Project project = projectService.getNewProject(req.getProjectId()); | |||||
VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!"); | |||||
//首先要判断 项目当前状态 是不是 采购结果备案 | |||||
VUtils.isTrue(!ProjectStatusEnum.UNDER_CONSTRUCTION.getCode().equals(project.getStatus()) || | |||||
!ProjectStatusEnum.PROJECT_APPROVED.getCode().equals(project.getStage())) | |||||
.throwMessage("提交失败 该项目不是 建设中或者已立项阶段"); | |||||
LocalDateTime now = LocalDateTime.now(); | |||||
Contract contract = new Contract(); | |||||
contract.setContractTime(req.getContractTime()); | |||||
contract.setAttachment(req.getAttachment()); | |||||
contract.setName(req.getName()); | |||||
contract.setProjectId(projectId); | |||||
contract.setProjectCode(project.getProjectCode()); | |||||
contract.setBidId(req.getBidId()); | |||||
contract.setId(req.getConstructionId()); | |||||
contract.setCreateBy(user.getUserIdStr()); | |||||
contract.setUpdateBy(user.getUserIdStr()); | |||||
contract.setCreateOn(now); | |||||
contract.setUpdateOn(now); | |||||
contract.setTotalAmount(req.getTotalAmount()); | |||||
contract.setConstructionNo(req.getConstructionNo()); | |||||
contract.setSupplierContact(req.getSupplierContact()); | |||||
contract.setSupplierContactInfo(req.getSupplierContactInfo()); | |||||
contractService.saveOrUpdate(contract); | |||||
LambdaQueryWrapper<Contract> query = Wrappers.lambdaQuery(Contract.class) | |||||
.eq(Contract::getProjectId, projectId); | |||||
List<Contract> allContracts = contractService.list(query); | |||||
BigDecimal totalAmount = DecimalUtil.sum(allContracts, Contract::getTotalAmount); | |||||
project.setUpdateOn(now); | |||||
project.setContractAmount(totalAmount); | |||||
projectService.updateById(project); | |||||
return "填写成功"; | |||||
} | |||||
/** | /** | ||||
* 待初验项目列表 | * 待初验项目列表 | ||||
* | * | ||||
@@ -381,6 +401,16 @@ public class ConstructionManage { | |||||
if ((total = page.getTotal()) == 0) { | if ((total = page.getTotal()) == 0) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
Set<String> projectCodes = new HashSet<>(); | |||||
List<Long> projectIds = new ArrayList<>(); | |||||
for (Project project : page.getRecords()) { | |||||
projectIds.add(project.getId()); | |||||
projectCodes.add(project.getProjectCode()); | |||||
} | |||||
Map<Long, List<ProjectPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds); | |||||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | ||||
ProjectLibListItemVO item = new ProjectLibListItemVO(); | ProjectLibListItemVO item = new ProjectLibListItemVO(); | ||||
item.setId(w.getId()); | item.setId(w.getId()); | ||||
@@ -400,7 +430,11 @@ public class ConstructionManage { | |||||
item.setApprovalDate(w.getApprovalDate()); | item.setApprovalDate(w.getApprovalDate()); | ||||
item.setDeliveryTime(w.getDeliveryTime()); | item.setDeliveryTime(w.getDeliveryTime()); | ||||
item.setContractAmount(w.getContractAmount()); | item.setContractAmount(w.getContractAmount()); | ||||
item.setAnnualPlanAmount(w.getAnnualPlanAmount()); | |||||
List<ProjectPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList()); | |||||
BigDecimal totalAnnualAmount = paymentPlans.stream() | |||||
.map(ProjectPaymentPlan::getAnnualPlanAmount) | |||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO); | |||||
item.setAnnualPlanAmount(totalAnnualAmount); | |||||
item.setTransactionTime(w.getTransactionTime()); | item.setTransactionTime(w.getTransactionTime()); | ||||
item.setTransactionAmount(w.getTransactionAmount()); | item.setTransactionAmount(w.getTransactionAmount()); | ||||
return item; | return item; | ||||
@@ -425,6 +459,13 @@ public class ConstructionManage { | |||||
List<DeclaredProjectExportDTO> collect = Lists.newArrayList(); | List<DeclaredProjectExportDTO> collect = Lists.newArrayList(); | ||||
if (CollUtil.isNotEmpty(records)) { | if (CollUtil.isNotEmpty(records)) { | ||||
List<Long> projectIds = new ArrayList<>(); | |||||
for (Project project : records) { | |||||
projectIds.add(project.getId()); | |||||
} | |||||
Map<Long, List<ProjectPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds); | |||||
AtomicInteger serialNumber = new AtomicInteger(0); | AtomicInteger serialNumber = new AtomicInteger(0); | ||||
collect = records.stream().map(r -> { | collect = records.stream().map(r -> { | ||||
DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO(); | DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO(); | ||||
@@ -436,7 +477,13 @@ public class ConstructionManage { | |||||
exportDTO.setSerialNumber(serialNumber.incrementAndGet()); | exportDTO.setSerialNumber(serialNumber.incrementAndGet()); | ||||
exportDTO.setDeliveryTime(r.getDeliveryTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); | exportDTO.setDeliveryTime(r.getDeliveryTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); | ||||
exportDTO.setContractAmount(r.getContractAmount()); | exportDTO.setContractAmount(r.getContractAmount()); | ||||
exportDTO.setAnnualPlanAmount(r.getAnnualPlanAmount()); | |||||
List<ProjectPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(r.getId(), Collections.emptyList()); | |||||
BigDecimal totalAnnualAmount = paymentPlans.stream() | |||||
.map(ProjectPaymentPlan::getAnnualPlanAmount) | |||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO); | |||||
exportDTO.setAnnualPlanAmount(totalAnnualAmount); | |||||
if (Objects.nonNull(r.getTransactionTime())) { | if (Objects.nonNull(r.getTransactionTime())) { | ||||
exportDTO.setTransactionTime(r.getTransactionTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); | exportDTO.setTransactionTime(r.getTransactionTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); | ||||
} | } | ||||
@@ -445,7 +492,7 @@ public class ConstructionManage { | |||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
} | } | ||||
String fileName = "合同备案项目列表"; | |||||
final String fileName = "合同备案项目列表"; | |||||
ExcelDownUtil.setFileName(fileName, response); | ExcelDownUtil.setFileName(fileName, response); | ||||
//数据导出处理函数 | //数据导出处理函数 | ||||
try { | try { | ||||
@@ -538,15 +585,14 @@ public class ConstructionManage { | |||||
project.setIsCompletedLogCollection(dto.getIsCompletedLogCollection()); | project.setIsCompletedLogCollection(dto.getIsCompletedLogCollection()); | ||||
project.setActualPerformanceIndicators(dto.getActualPerformanceIndicators()); | project.setActualPerformanceIndicators(dto.getActualPerformanceIndicators()); | ||||
projectService.updateById(project); | projectService.updateById(project); | ||||
return "填写成功"; | return "填写成功"; | ||||
} | } | ||||
/** | /** | ||||
* 补充项目 合同 实际支付信息 | * 补充项目 合同 实际支付信息 | ||||
* | * | ||||
* @param plans | |||||
* @return | |||||
* @param plans \ | |||||
* @return \ | |||||
*/ | */ | ||||
public String supplement(List<PaymentPlanSupplementDTO> plans) { | public String supplement(List<PaymentPlanSupplementDTO> plans) { | ||||
if (CollUtil.isEmpty(plans)) { | if (CollUtil.isEmpty(plans)) { | ||||
@@ -33,7 +33,7 @@ import com.hz.pm.api.projectlib.service.IProjectInstService; | |||||
import com.hz.pm.api.projectlib.service.IProjectService; | import com.hz.pm.api.projectlib.service.IProjectService; | ||||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | import com.hz.pm.api.staging.enums.MsgTypeEnum; | ||||
import com.hz.pm.api.sys.manage.NoticeManage; | import com.hz.pm.api.sys.manage.NoticeManage; | ||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConstant; | |||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConst; | |||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | import com.hz.pm.api.user.security.model.UserInfoDetails; | ||||
import com.hz.pm.api.user.util.LoginUserUtil; | import com.hz.pm.api.user.util.LoginUserUtil; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
@@ -169,7 +169,7 @@ public class ConstructionPlanManage { | |||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId, | noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId, | ||||
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
WorkNoticeConst.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
return instanceId; | return instanceId; | ||||
} | } | ||||
@@ -2,6 +2,8 @@ package com.hz.pm.api.projectdeclared.manage; | |||||
import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import cn.hutool.core.util.StrUtil; | |||||
import cn.hutool.json.JSONUtil; | |||||
import com.alibaba.excel.EasyExcel; | import com.alibaba.excel.EasyExcel; | ||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
@@ -12,6 +14,7 @@ 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.projectlib.model.dto.ProjectPaymentPlanDTO; | |||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.basic.function.VUtils; | import com.ningdatech.basic.function.VUtils; | ||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
@@ -44,7 +47,7 @@ import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | |||||
import com.hz.pm.api.projectlib.service.IProjectService; | import com.hz.pm.api.projectlib.service.IProjectService; | ||||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | import com.hz.pm.api.staging.enums.MsgTypeEnum; | ||||
import com.hz.pm.api.sys.manage.NoticeManage; | import com.hz.pm.api.sys.manage.NoticeManage; | ||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConstant; | |||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConst; | |||||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | import com.hz.pm.api.user.security.model.UserFullInfoDTO; | ||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | import com.hz.pm.api.user.security.model.UserInfoDetails; | ||||
import com.hz.pm.api.user.util.LoginUserUtil; | import com.hz.pm.api.user.util.LoginUserUtil; | ||||
@@ -177,7 +180,7 @@ public class DeclaredProjectManage { | |||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId, | noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId, | ||||
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
WorkNoticeConst.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
return instanceId; | return instanceId; | ||||
} | } | ||||
@@ -191,7 +194,7 @@ public class DeclaredProjectManage { | |||||
*/ | */ | ||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public String reStartTheProcess(DefaultDeclaredDTO dto) { | public String reStartTheProcess(DefaultDeclaredDTO dto) { | ||||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
projectDto.setBuildOrgCode(user.getMhUnitIdStr()); | projectDto.setBuildOrgCode(user.getMhUnitIdStr()); | ||||
projectDto.setBuildOrgName(user.getMhUnitName()); | projectDto.setBuildOrgName(user.getMhUnitName()); | ||||
@@ -254,16 +257,17 @@ public class DeclaredProjectManage { | |||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId, | noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId, | ||||
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
WorkNoticeConst.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
return instanceId; | return instanceId; | ||||
} | } | ||||
public PageVo<ProjectDraftVO> pageDraft(DeclaredProjectListParamDTO params) { | |||||
public PageVo<ProjectDraftVO> pageDraft(DeclaredProjectListParamDTO params, Integer draftType) { | |||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
Page<ProjectDraft> page = params.page(); | Page<ProjectDraft> page = params.page(); | ||||
LambdaQueryWrapper<ProjectDraft> wrapper = Wrappers.lambdaQuery(ProjectDraft.class) | LambdaQueryWrapper<ProjectDraft> wrapper = Wrappers.lambdaQuery(ProjectDraft.class) | ||||
.eq(ProjectDraft::getUserId, userId) | .eq(ProjectDraft::getUserId, userId) | ||||
.eq(ProjectDraft::getDraftType, draftType) | |||||
.ge(Objects.nonNull(params.getStartTime()), ProjectDraft::getCreateOn, params.getStartTime()) | .ge(Objects.nonNull(params.getStartTime()), ProjectDraft::getCreateOn, params.getStartTime()) | ||||
.le(Objects.nonNull(params.getEndTime()), ProjectDraft::getCreateOn, params.getEndTime()) | .le(Objects.nonNull(params.getEndTime()), ProjectDraft::getCreateOn, params.getEndTime()) | ||||
.eq(Objects.nonNull(params.getProjectType()), ProjectDraft::getProjectType, params.getProjectType()) | .eq(Objects.nonNull(params.getProjectType()), ProjectDraft::getProjectType, params.getProjectType()) | ||||
@@ -290,10 +294,13 @@ public class DeclaredProjectManage { | |||||
ProjectDraftVO vo = new ProjectDraftVO(); | ProjectDraftVO vo = new ProjectDraftVO(); | ||||
BeanUtils.copyProperties(draft, vo); | BeanUtils.copyProperties(draft, vo); | ||||
vo.setBizDomain(Objects.nonNull(draft.getBizDomain()) ? String.valueOf(draft.getBizDomain()) : StringUtils.EMPTY); | vo.setBizDomain(Objects.nonNull(draft.getBizDomain()) ? String.valueOf(draft.getBizDomain()) : StringUtils.EMPTY); | ||||
if (StringUtils.isNotBlank(draft.getProjectApplicationList())) { | |||||
if (StrUtil.isNotBlank(draft.getProjectApplicationList())) { | |||||
vo.setApplicationList(JSON.parseArray(draft.getProjectApplicationList(), ProjectApplication.class)); | vo.setApplicationList(JSON.parseArray(draft.getProjectApplicationList(), ProjectApplication.class)); | ||||
} | } | ||||
if (StringUtils.isNotBlank(draft.getDynamicForm())) { | |||||
if (StrUtil.isNotBlank(draft.getPaymentPlans())) { | |||||
vo.setPaymentPlanList(JSONUtil.toList(draft.getPaymentPlans(), ProjectPaymentPlanDTO.class)); | |||||
} | |||||
if (StrUtil.isNotBlank(draft.getDynamicForm())) { | |||||
vo.setDynamicForm(JSON.parseObject(draft.getDynamicForm(), Map.class)); | vo.setDynamicForm(JSON.parseObject(draft.getDynamicForm(), Map.class)); | ||||
} | } | ||||
return vo; | return vo; | ||||
@@ -302,10 +309,10 @@ public class DeclaredProjectManage { | |||||
/** | /** | ||||
* 保存至草稿箱 | * 保存至草稿箱 | ||||
* | * | ||||
* @param dto | |||||
* @return | |||||
* @param dto \ | |||||
* @return \ | |||||
*/ | */ | ||||
public Long saveToDraft(ProjectDraftSaveDTO dto) { | |||||
public Long saveToDraft(ProjectDraftSaveDTO dto, Integer draftType) { | |||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | ||||
@@ -322,6 +329,9 @@ public class DeclaredProjectManage { | |||||
if (CollUtil.isNotEmpty(projectInfo.getDynamicForm())) { | if (CollUtil.isNotEmpty(projectInfo.getDynamicForm())) { | ||||
draft.setDynamicForm(JSON.toJSONString(projectInfo.getDynamicForm())); | draft.setDynamicForm(JSON.toJSONString(projectInfo.getDynamicForm())); | ||||
} | } | ||||
if (CollUtil.isNotEmpty(projectInfo.getPaymentPlanList())) { | |||||
draft.setPaymentPlans(JSON.toJSONString(projectInfo.getPaymentPlanList())); | |||||
} | |||||
if (CollUtil.isNotEmpty(projectInfo.getApplicationList())) { | if (CollUtil.isNotEmpty(projectInfo.getApplicationList())) { | ||||
draft.setProjectApplicationList(JSON.toJSONString(projectInfo.getApplicationList())); | draft.setProjectApplicationList(JSON.toJSONString(projectInfo.getApplicationList())); | ||||
} | } | ||||
@@ -333,6 +343,7 @@ public class DeclaredProjectManage { | |||||
draft.setCreateOn(LocalDateTime.now()); | draft.setCreateOn(LocalDateTime.now()); | ||||
} | } | ||||
} | } | ||||
draft.setDraftType(draftType); | |||||
draft.setUpdateOn(LocalDateTime.now()); | draft.setUpdateOn(LocalDateTime.now()); | ||||
draft.setUserId(String.valueOf(userId)); | draft.setUserId(String.valueOf(userId)); | ||||
projectDraftService.saveOrUpdate(draft); | projectDraftService.saveOrUpdate(draft); | ||||
@@ -1,5 +1,6 @@ | |||||
package com.hz.pm.api.projectdeclared.manage; | package com.hz.pm.api.projectdeclared.manage; | ||||
import cn.hutool.core.collection.CollUtil; | |||||
import cn.hutool.core.lang.Assert; | import cn.hutool.core.lang.Assert; | ||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
import com.alibaba.fastjson.TypeReference; | import com.alibaba.fastjson.TypeReference; | ||||
@@ -14,6 +15,7 @@ import com.hz.pm.api.projectdeclared.model.dto.ProjectConditionDTO; | |||||
import com.hz.pm.api.projectdeclared.model.po.DeclaredProjectStatisticsPO; | import com.hz.pm.api.projectdeclared.model.po.DeclaredProjectStatisticsPO; | ||||
import com.hz.pm.api.projectdeclared.service.IDeclaredStatisticsService; | import com.hz.pm.api.projectdeclared.service.IDeclaredStatisticsService; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO; | |||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.service.IProjectService; | import com.hz.pm.api.projectlib.service.IProjectService; | ||||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | import com.hz.pm.api.user.security.model.UserFullInfoDTO; | ||||
@@ -107,23 +109,23 @@ public class DefaultDeclaredProjectManage { | |||||
.throwMessage(String.format("申报失败! 申报总金额【%s】 不等于其它申报金额 【%s】", declareAmount, totalAmount)); | .throwMessage(String.format("申报失败! 申报总金额【%s】 不等于其它申报金额 【%s】", declareAmount, totalAmount)); | ||||
//判断 年度计划金额 如果开着的话 | //判断 年度计划金额 如果开着的话 | ||||
if (Objects.nonNull(projectInfo.getAnnualPlanAmount())) { | |||||
BigDecimal annualPlanAmount = projectInfo.getAnnualPlanAmount(); | |||||
VUtils.isTrue(annualPlanAmount.compareTo(BigDecimal.ZERO) <= 0) | |||||
.throwMessage(String.format("申报失败! 年度支付总金额【%s】 不能小于等于0", annualPlanAmount)); | |||||
VUtils.isTrue(annualPlanAmount.compareTo(declareAmount) > 0) | |||||
.throwMessage(String.format("申报失败! 年度支付总金额【%s】 不能大于申报金额 【%s】", annualPlanAmount, declareAmount)); | |||||
BigDecimal annualGovSuperAmount = projectInfo.getAnnualPlanGovSuperiorFinanceAmount(); | |||||
BigDecimal annualOwnSuperAmount = projectInfo.getAnnualPlanGovOwnFinanceAmount(); | |||||
BigDecimal annualBankLendingAmount = projectInfo.getAnnualPlanBankLendingAmount(); | |||||
BigDecimal annualHaveAmount = projectInfo.getAnnualPlanHaveAmount(); | |||||
BigDecimal anualOtherAmount = projectInfo.getAnnualPlanOtherAmount(); | |||||
BigDecimal totalAnnual = annualGovSuperAmount | |||||
.add(annualOwnSuperAmount).add(annualBankLendingAmount).add(annualHaveAmount).add(anualOtherAmount); | |||||
VUtils.isTrue(annualPlanAmount.compareTo(totalAnnual) != 0) | |||||
.throwMessage(String.format("申报失败! 年度支付总金额【%s】 不等于其它年度支付金额 【%s】", annualPlanAmount, totalAnnual)); | |||||
if (CollUtil.isNotEmpty(projectInfo.getPaymentPlanList())) { | |||||
for (ProjectPaymentPlanDTO paymentPlan : projectInfo.getPaymentPlanList()) { | |||||
BigDecimal annualPlanAmount = paymentPlan.getAnnualPlanAmount(); | |||||
VUtils.isTrue(annualPlanAmount.compareTo(BigDecimal.ZERO) <= 0) | |||||
.throwMessage(String.format("申报失败! 年度支付总金额【%s】 不能小于等于0", annualPlanAmount)); | |||||
VUtils.isTrue(annualPlanAmount.compareTo(declareAmount) > 0) | |||||
.throwMessage(String.format("申报失败! 年度支付总金额【%s】 不能大于申报金额 【%s】", annualPlanAmount, declareAmount)); | |||||
BigDecimal annualGovSuperAmount = paymentPlan.getAnnualPlanGovSuperiorFinanceAmount(); | |||||
BigDecimal annualOwnSuperAmount = paymentPlan.getAnnualPlanGovOwnFinanceAmount(); | |||||
BigDecimal annualHaveAmount = paymentPlan.getAnnualPlanHaveAmount(); | |||||
BigDecimal totalAnnual = annualGovSuperAmount.add(annualOwnSuperAmount).add(annualHaveAmount); | |||||
VUtils.isTrue(annualPlanAmount.compareTo(totalAnnual) != 0) | |||||
.throwMessage(String.format("申报失败! 年度支付总金额【%s】 不等于其它年度支付金额 【%s】", annualPlanAmount, totalAnnual)); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -31,7 +31,7 @@ import com.hz.pm.api.projectlib.service.IProjectInstService; | |||||
import com.hz.pm.api.projectlib.service.IProjectService; | import com.hz.pm.api.projectlib.service.IProjectService; | ||||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | import com.hz.pm.api.staging.enums.MsgTypeEnum; | ||||
import com.hz.pm.api.sys.manage.NoticeManage; | import com.hz.pm.api.sys.manage.NoticeManage; | ||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConstant; | |||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConst; | |||||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | import com.hz.pm.api.user.security.model.UserFullInfoDTO; | ||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | import com.hz.pm.api.user.security.model.UserInfoDetails; | ||||
import com.hz.pm.api.user.util.LoginUserUtil; | import com.hz.pm.api.user.util.LoginUserUtil; | ||||
@@ -280,7 +280,7 @@ public class DelayedApplyManage { | |||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
noticeManage.sendFirstUser(project, model.getFormName(), instanceId, | noticeManage.sendFirstUser(project, model.getFormName(), instanceId, | ||||
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
WorkNoticeConst.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
return instanceId; | return instanceId; | ||||
} | } | ||||
@@ -54,7 +54,7 @@ import java.util.concurrent.atomic.AtomicInteger; | |||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
import static com.hz.pm.api.staging.enums.MsgTypeEnum.PROJECT_REVIEW; | import static com.hz.pm.api.staging.enums.MsgTypeEnum.PROJECT_REVIEW; | ||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.PASS_MSG_TEMPLATE; | |||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.PASS_MSG_TEMPLATE; | |||||
/** | /** | ||||
* @Classname FinalAcceptanceManage | * @Classname FinalAcceptanceManage | ||||
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Assert; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
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.StateMachineUtil; | ||||
import com.hz.pm.api.projectdeclared.model.dto.OperationDTO; | |||||
import com.hz.pm.api.projectdeclared.model.dto.OperationReq; | |||||
import com.hz.pm.api.projectdeclared.model.entity.Operation; | import com.hz.pm.api.projectdeclared.model.entity.Operation; | ||||
import com.hz.pm.api.projectdeclared.model.vo.OperationVO; | import com.hz.pm.api.projectdeclared.model.vo.OperationVO; | ||||
import com.hz.pm.api.projectdeclared.service.IOperationService; | import com.hz.pm.api.projectdeclared.service.IOperationService; | ||||
@@ -15,11 +15,14 @@ import com.hz.pm.api.projectlib.service.IProjectService; | |||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | import com.hz.pm.api.user.security.model.UserInfoDetails; | ||||
import com.hz.pm.api.user.util.LoginUserUtil; | import com.hz.pm.api.user.util.LoginUserUtil; | ||||
import com.ningdatech.basic.function.VUtils; | import com.ningdatech.basic.function.VUtils; | ||||
import com.ningdatech.basic.util.CollUtils; | |||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.List; | |||||
import java.util.Objects; | import java.util.Objects; | ||||
/** | /** | ||||
@@ -42,24 +45,24 @@ public class OperationManage { | |||||
/** | /** | ||||
* 获取实施详情 | * 获取实施详情 | ||||
* | * | ||||
* @param projectId | |||||
* @return | |||||
* @param projectId \ | |||||
* @return \ | |||||
*/ | */ | ||||
public OperationVO detail(Long projectId) { | |||||
public List<OperationVO> detail(Long projectId) { | |||||
Project project = projectService.getNewProject(projectId); | Project project = projectService.getNewProject(projectId); | ||||
Assert.notNull(project, "项目不存在!"); | Assert.notNull(project, "项目不存在!"); | ||||
Operation operation = operationService.getOne(Wrappers.lambdaQuery(Operation.class) | |||||
.eq(Operation::getProjectCode, project.getProjectCode()) | |||||
.last(BizConst.LIMIT_1)); | |||||
List<Operation> operations = operationService.list(Wrappers.lambdaQuery(Operation.class) | |||||
.eq(Operation::getProjectCode, project.getProjectCode())); | |||||
return BeanUtil.copyProperties(operation, OperationVO.class); | |||||
return CollUtils.convert(operations, w -> BeanUtil.copyProperties(w, OperationVO.class)); | |||||
} | } | ||||
public String pushOperation(OperationDTO operation) { | |||||
@Transactional(rollbackFor = Exception.class) | |||||
public String pushOperation(OperationReq req) { | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | UserInfoDetails user = LoginUserUtil.loginUserDetail(); | ||||
Project project = projectService.getNewProject(operation.getProjectId()); | |||||
Project project = projectService.getNewProject(req.getProjectId()); | |||||
Assert.notNull(project, "项目不存在!"); | Assert.notNull(project, "项目不存在!"); | ||||
//首先要判断 项目当前状态 是不是 待开工状态 | //首先要判断 项目当前状态 是不是 待开工状态 | ||||
@@ -67,28 +70,23 @@ public class OperationManage { | |||||
!ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage())) | !ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage())) | ||||
.throwMessage("提交失败 该项目不是 待开工或者已立项阶段"); | .throwMessage("提交失败 该项目不是 待开工或者已立项阶段"); | ||||
Operation old = operationService.getOne(Wrappers.lambdaQuery(Operation.class) | |||||
Operation pre = operationService.getOne(Wrappers.lambdaQuery(Operation.class) | |||||
.eq(Operation::getProjectCode, project.getProjectCode()) | .eq(Operation::getProjectCode, project.getProjectCode()) | ||||
.eq(Operation::getBidId, req.getBidId()) | |||||
.last(BizConst.LIMIT_1)); | .last(BizConst.LIMIT_1)); | ||||
Operation entity = BeanUtil.copyProperties(operation, Operation.class); | |||||
if (Objects.nonNull(old)) { | |||||
entity.setId(old.getId()); | |||||
LocalDateTime now = LocalDateTime.now(); | |||||
Operation curr = BeanUtil.copyProperties(req, Operation.class); | |||||
if (Objects.nonNull(pre)) { | |||||
curr.setId(pre.getId()); | |||||
} else { | } else { | ||||
entity.setCreateOn(LocalDateTime.now()); | |||||
entity.setCreateBy(user.getUsername()); | |||||
curr.setCreateOn(now); | |||||
curr.setCreateBy(user.getUsername()); | |||||
} | } | ||||
entity.setProjectCode(project.getProjectCode()); | |||||
entity.setUpdateOn(LocalDateTime.now()); | |||||
entity.setUpdateBy(user.getUsername()); | |||||
//强制放入 计划终验时间 | |||||
entity.setFinalInspectionDate(project.getPlanAcceptanceTime()); | |||||
if (operationService.saveOrUpdate(entity)) { | |||||
stateMachineUtil.pass(project); | |||||
project.setUpdateOn(LocalDateTime.now()); | |||||
projectService.updateById(project); | |||||
} | |||||
return entity.getProjectCode(); | |||||
curr.setProjectCode(project.getProjectCode()); | |||||
curr.setUpdateOn(now); | |||||
curr.setUpdateBy(user.getUsername()); | |||||
operationService.saveOrUpdate(curr); | |||||
return curr.getProjectCode(); | |||||
} | } | ||||
} | } |
@@ -29,7 +29,7 @@ import com.hz.pm.api.staging.enums.MsgTypeEnum; | |||||
import com.hz.pm.api.staging.service.IProjectStagingService; | import com.hz.pm.api.staging.service.IProjectStagingService; | ||||
import com.hz.pm.api.sys.manage.NoticeManage; | import com.hz.pm.api.sys.manage.NoticeManage; | ||||
import com.hz.pm.api.todocenter.constant.TodoCenterConst; | import com.hz.pm.api.todocenter.constant.TodoCenterConst; | ||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConstant; | |||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConst; | |||||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | import com.hz.pm.api.user.security.model.UserFullInfoDTO; | ||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | import com.hz.pm.api.user.security.model.UserInfoDetails; | ||||
import com.hz.pm.api.user.util.LoginUserUtil; | import com.hz.pm.api.user.util.LoginUserUtil; | ||||
@@ -204,7 +204,7 @@ public class PrequalificationDeclaredProjectManage { | |||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
noticeManage.sendFirstUser(projectInfo, model.getFormName(), instanceId, | noticeManage.sendFirstUser(projectInfo, model.getFormName(), instanceId, | ||||
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
WorkNoticeConst.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
return instanceId; | return instanceId; | ||||
} | } | ||||
@@ -13,6 +13,8 @@ import com.hz.pm.api.common.util.ExcelExportStyle; | |||||
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.PurchaseSaveDTO; | import com.hz.pm.api.projectdeclared.model.dto.PurchaseSaveDTO; | ||||
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.req.SubmitPurchaseNoticeReq; | |||||
import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseRecordReq; | |||||
import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO; | import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO; | ||||
import com.hz.pm.api.projectdeclared.service.IPurchaseService; | import com.hz.pm.api.projectdeclared.service.IPurchaseService; | ||||
import com.hz.pm.api.projectlib.helper.ProjectHelper; | import com.hz.pm.api.projectlib.helper.ProjectHelper; | ||||
@@ -23,6 +25,7 @@ import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | ||||
import com.hz.pm.api.projectlib.service.IProjectService; | import com.hz.pm.api.projectlib.service.IProjectService; | ||||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | import com.hz.pm.api.user.security.model.UserFullInfoDTO; | ||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | |||||
import com.hz.pm.api.user.util.LoginUserUtil; | import com.hz.pm.api.user.util.LoginUserUtil; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.basic.function.VUtils; | import com.ningdatech.basic.function.VUtils; | ||||
@@ -215,4 +218,51 @@ public class PurchaseManage { | |||||
return "保存失败"; | return "保存失败"; | ||||
} | } | ||||
public void submitPurchaseNotice(SubmitPurchaseNoticeReq req) { | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
Long projectId = req.getProjectId(); | |||||
Project project = projectService.getNewProject(projectId); | |||||
Assert.notNull(project, "提交失败 此项目不存在!"); | |||||
//首先要判断 项目当前状态 是不是 采购结果备案 | |||||
VUtils.isTrue(!ProjectStatusEnum.TO_BE_PURCHASED.eq(project.getStatus()) | |||||
|| !ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage())) | |||||
.throwMessage("提交失败,该项目不是待采购备案状态或者已立项阶段"); | |||||
Purchase purchase = new Purchase(); | |||||
purchase.setPurchaseMethod(req.getPurchaseMethod()); | |||||
purchase.setBizAddress(req.getBidAddress()); | |||||
purchase.setBidName(req.getBidName()); | |||||
purchase.setBizBudget(req.getBidBudget()); | |||||
purchase.setBidDoc(req.getBidDoc()); | |||||
purchase.setBidStartTime(req.getBidStartTime()); | |||||
purchase.setBidEndTime(req.getBidEndTime()); | |||||
purchase.setId(req.getBidId()); | |||||
purchase.setProjectId(projectId); | |||||
if (purchase.getId() == null) { | |||||
purchase.setCreateBy(user.getUserIdStr()); | |||||
} | |||||
purchaseService.saveOrUpdate(purchase); | |||||
} | |||||
public void submitPurchaseRecord(SubmitPurchaseRecordReq req) { | |||||
Long projectId = req.getProjectId(); | |||||
Project project = projectService.getNewProject(projectId); | |||||
Assert.notNull(project, "提交失败 此项目不存在!"); | |||||
//首先要判断 项目当前状态 是不是 采购结果备案 | |||||
VUtils.isTrue(!ProjectStatusEnum.TO_BE_PURCHASED.eq(project.getStatus()) | |||||
|| !ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage())) | |||||
.throwMessage("提交失败,该项目不是待采购备案状态或者已立项阶段"); | |||||
Purchase purchase = new Purchase(); | |||||
purchase.setId(req.getBidId()); | |||||
purchase.setAcceptanceLetter(req.getAcceptanceLetter()); | |||||
purchase.setBidBuildContent(req.getBidBuildContent()); | |||||
purchase.setBiddingDoc(req.getBiddingDoc()); | |||||
purchase.setSupplier(req.getSupplier()); | |||||
purchase.setSupplierSocialCreditCode(req.getSupplierSocialCreditCode()); | |||||
purchase.setBidType(req.getBidType()); | |||||
purchaseService.saveOrUpdate(purchase); | |||||
} | |||||
} | } |
@@ -9,7 +9,7 @@ import com.hz.pm.api.projectlib.service.IProjectInstService; | |||||
import com.hz.pm.api.projectlib.service.IProjectService; | import com.hz.pm.api.projectlib.service.IProjectService; | ||||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | import com.hz.pm.api.staging.enums.MsgTypeEnum; | ||||
import com.hz.pm.api.sys.manage.NoticeManage; | import com.hz.pm.api.sys.manage.NoticeManage; | ||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConstant; | |||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConst; | |||||
import com.ningdatech.basic.function.VUtils; | import com.ningdatech.basic.function.VUtils; | ||||
import com.wflow.bean.entity.WflowModels; | import com.wflow.bean.entity.WflowModels; | ||||
import com.wflow.exception.BusinessException; | import com.wflow.exception.BusinessException; | ||||
@@ -97,7 +97,7 @@ public class ReviewByDeptJointManage { | |||||
projectInfo = projectLibManage.saveProjectWithVersion(projectInfo, instanceId, ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode()); | projectInfo = projectLibManage.saveProjectWithVersion(projectInfo, instanceId, ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode()); | ||||
//发送给第一个审批人消息 | //发送给第一个审批人消息 | ||||
noticeManage.sendFirstUser(projectInfo, model.getFormName(), instanceId, WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
noticeManage.sendFirstUser(projectInfo, model.getFormName(), instanceId, WorkNoticeConst.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
@@ -121,7 +121,7 @@ public class ReviewChecklistManage { | |||||
item.setProcessStatus(w.getProcessStatus()); | item.setProcessStatus(w.getProcessStatus()); | ||||
item.setInstCode(w.getInstCode()); | item.setInstCode(w.getInstCode()); | ||||
item.setApprovedAmount(w.getApprovalAmount()); | item.setApprovedAmount(w.getApprovalAmount()); | ||||
item.setAnnualPlanAmount(w.getAnnualPlanAmount()); | |||||
// item.setAnnualPlanAmount(w.getAnnualPlanAmount()); | |||||
// 审查人员情况 | // 审查人员情况 | ||||
item.setVerifiedHumans(computeVerify(item, approveMap.get(w.getProjectCode()), userMap, user)); | item.setVerifiedHumans(computeVerify(item, approveMap.get(w.getProjectCode()), userMap, user)); | ||||
item.setReviewCheckFinish(w.getReviewCheckFinish()); | item.setReviewCheckFinish(w.getReviewCheckFinish()); | ||||
@@ -2,24 +2,28 @@ package com.hz.pm.api.projectdeclared.model.dto; | |||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | import lombok.Data; | ||||
import lombok.NoArgsConstructor; | |||||
import javax.validation.constraints.NotNull; | import javax.validation.constraints.NotNull; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
/** | /** | ||||
* @Classname OperationDTO | |||||
* @Description | |||||
* @Date 2023/5/29 10:00 | |||||
* @Author PoffyZhang | |||||
* <p> | |||||
* 实施计划参数类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 09:25 2024/2/23 | |||||
*/ | */ | ||||
@ApiModel(value = "实施对象DTO", description = "实施对象DTO") | |||||
@Data | @Data | ||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
public class OperationDTO { | |||||
@ApiModel(value = "实施对象DTO") | |||||
public class OperationReq { | |||||
@ApiModelProperty("实施计划ID") | |||||
private Long operationId; | |||||
@ApiModelProperty("标段ID") | |||||
private Long bidId; | |||||
@ApiModelProperty("项目ID") | @ApiModelProperty("项目ID") | ||||
@NotNull(message = "项目ID不能为空") | @NotNull(message = "项目ID不能为空") | ||||
@@ -41,6 +45,9 @@ public class OperationDTO { | |||||
private LocalDateTime finalInspectionDate; | private LocalDateTime finalInspectionDate; | ||||
@ApiModelProperty("开始实施时间") | @ApiModelProperty("开始实施时间") | ||||
@NotNull(message = "开始实施时间不能为空") | |||||
private LocalDateTime startTrialOperationDate; | private LocalDateTime startTrialOperationDate; | ||||
@ApiModelProperty("试运行开始时间") | |||||
private LocalDateTime pilotRunStartDate; | |||||
} | } |
@@ -16,7 +16,7 @@ import java.io.Serializable; | |||||
* @author zpf | * @author zpf | ||||
* @since 2023-02-06 | * @since 2023-02-06 | ||||
*/ | */ | ||||
@ApiModel(value = "NdProjectDraftDto", description = "") | |||||
@ApiModel(value = "NdProjectDraftDto") | |||||
@Data | @Data | ||||
@Builder | @Builder | ||||
@NoArgsConstructor | @NoArgsConstructor | ||||
@@ -70,4 +70,16 @@ public class Contract { | |||||
@ApiModelProperty("项目编号") | @ApiModelProperty("项目编号") | ||||
private String projectCode; | private String projectCode; | ||||
@ApiModelProperty("标段ID") | |||||
private Long bidId; | |||||
@ApiModelProperty("合同编号") | |||||
private String constructionNo; | |||||
@ApiModelProperty("供应商联系人") | |||||
private String supplierContact; | |||||
@ApiModelProperty("供应商联系方式") | |||||
private String supplierContactInfo; | |||||
} | } |
@@ -5,28 +5,33 @@ import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.Data; | import lombok.Data; | ||||
import lombok.NoArgsConstructor; | import lombok.NoArgsConstructor; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
/** | /** | ||||
* @Classname Operation | |||||
* @Description | |||||
* @Date 2023/5/29 10:00 | |||||
* @Author PoffyZhang | |||||
* <p> | |||||
* Operation | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 09:36 2024/2/23 | |||||
*/ | */ | ||||
@TableName("nd_project_operation") | |||||
@ApiModel(value = "实施对象", description = "实施对象") | |||||
@Data | @Data | ||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
@TableName("nd_project_operation") | |||||
@ApiModel(value = "实施对象") | |||||
public class Operation { | public class Operation { | ||||
@TableId(type = IdType.AUTO) | @TableId(type = IdType.AUTO) | ||||
@ApiModelProperty("id") | @ApiModelProperty("id") | ||||
private Long id; | private Long id; | ||||
@ApiModelProperty("标段ID") | |||||
private Long bidId; | |||||
@ApiModelProperty("项目ID") | @ApiModelProperty("项目ID") | ||||
private Long projectId; | private Long projectId; | ||||
@@ -39,10 +44,10 @@ public class Operation { | |||||
@ApiModelProperty("修改时间") | @ApiModelProperty("修改时间") | ||||
private LocalDateTime updateOn; | private LocalDateTime updateOn; | ||||
@ApiModelProperty("创建人 工号") | |||||
@ApiModelProperty("创建人ID") | |||||
private String createBy; | private String createBy; | ||||
@ApiModelProperty("修改人 工号") | |||||
@ApiModelProperty("修改人ID") | |||||
private String updateBy; | private String updateBy; | ||||
@ApiModelProperty("项目开工时间") | @ApiModelProperty("项目开工时间") | ||||
@@ -56,4 +61,8 @@ public class Operation { | |||||
@ApiModelProperty("开始实施时间") | @ApiModelProperty("开始实施时间") | ||||
private LocalDateTime startTrialOperationDate; | private LocalDateTime startTrialOperationDate; | ||||
@ApiModelProperty("试运行开始时间") | |||||
private LocalDateTime pilotRunStartDate; | |||||
} | } |
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | import com.baomidou.mybatisplus.annotation.TableId; | ||||
import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
import com.hz.pm.api.common.compare.Compare; | import com.hz.pm.api.common.compare.Compare; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO; | |||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
@@ -14,6 +15,7 @@ import lombok.NoArgsConstructor; | |||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -181,23 +183,8 @@ public class ProjectDraft implements Serializable { | |||||
@ApiModelProperty("资金分配情况-第三方服务(万元)") | @ApiModelProperty("资金分配情况-第三方服务(万元)") | ||||
private BigDecimal thirdPartyAmount; | private BigDecimal thirdPartyAmount; | ||||
@ApiModelProperty("年度支付计划-年度支付计划(万元)") | |||||
private BigDecimal annualPlanAmount; | |||||
@ApiModelProperty("年度支付计划-自有金额(万元)") | |||||
private BigDecimal annualPlanHaveAmount; | |||||
@ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") | |||||
private BigDecimal annualPlanGovOwnFinanceAmount; | |||||
@ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") | |||||
private BigDecimal annualPlanGovSuperiorFinanceAmount; | |||||
@ApiModelProperty("年度支付计划-银行贷款(万元)") | |||||
private BigDecimal annualPlanBankLendingAmount; | |||||
@ApiModelProperty("年度支付计划-其它资金(万元)") | |||||
private BigDecimal annualPlanOtherAmount; | |||||
@ApiModelProperty("年度支付计划") | |||||
private String paymentPlans; | |||||
@ApiModelProperty("立项批复资金(万元)") | @ApiModelProperty("立项批复资金(万元)") | ||||
private BigDecimal approvalAmount; | private BigDecimal approvalAmount; | ||||
@@ -367,4 +354,8 @@ public class ProjectDraft implements Serializable { | |||||
@ApiModelProperty("立项依据证明材料") | @ApiModelProperty("立项依据证明材料") | ||||
private String baseProjBasisFile; | private String baseProjBasisFile; | ||||
@ApiModelProperty("暂存类型:1 项目申报、2 立项备案") | |||||
private Integer draftType; | |||||
} | } |
@@ -50,12 +50,6 @@ public class Purchase { | |||||
@ApiModelProperty("供应商") | @ApiModelProperty("供应商") | ||||
private String supplier; | private String supplier; | ||||
@ApiModelProperty("供应商联系人") | |||||
private String supplierContact; | |||||
@ApiModelProperty("供应商联系方式") | |||||
private String supplierContactInfo; | |||||
@ApiModelProperty("供应商社会信用代码") | @ApiModelProperty("供应商社会信用代码") | ||||
private String supplierSocialCreditCode; | private String supplierSocialCreditCode; | ||||
@@ -71,18 +65,37 @@ public class Purchase { | |||||
@ApiModelProperty("代理机构") | @ApiModelProperty("代理机构") | ||||
private String agency; | private String agency; | ||||
@ApiModelProperty("代理机构社会统一信用代码") | |||||
private String purchaseSocialCreditCode; | |||||
@ApiModelProperty("标段类型") | |||||
private Integer bidType; | |||||
@ApiModelProperty("投标文件") | @ApiModelProperty("投标文件") | ||||
private String biddingDoc; | private String biddingDoc; | ||||
@ApiModelProperty("招标文件") | |||||
private String bidDoc; | |||||
@ApiModelProperty("中标通知书") | @ApiModelProperty("中标通知书") | ||||
private String acceptanceLetter; | private String acceptanceLetter; | ||||
@ApiModelProperty("标段建设内容") | |||||
private String bidBuildContent; | |||||
@ApiModelProperty("代理机构社会统一信用代码") | |||||
private String purchaseSocialCreditCode; | |||||
@ApiModelProperty("招标文件") | |||||
private String bidDoc; | |||||
@ApiModelProperty("预算执行确认书编号") | @ApiModelProperty("预算执行确认书编号") | ||||
private String budgetExecConfirmNo; | private String budgetExecConfirmNo; | ||||
@ApiModelProperty("投标地址") | |||||
private String bizAddress; | |||||
@ApiModelProperty("标项预算") | |||||
private BigDecimal bizBudget; | |||||
@ApiModelProperty("开标时间") | |||||
private LocalDateTime bidStartTime; | |||||
@ApiModelProperty("投标截止时间") | |||||
private LocalDateTime bidEndTime; | |||||
} | } |
@@ -0,0 +1,24 @@ | |||||
package com.hz.pm.api.projectdeclared.model.enumerization; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
/** | |||||
* <p> | |||||
* ProjectDraftTypeEnum | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 09:57 2024/2/20 | |||||
*/ | |||||
@Getter | |||||
@AllArgsConstructor | |||||
public enum ProjectDraftTypeEnum { | |||||
PROJECT_DECLARED(1, "项目申报"), | |||||
DECLARED_RECORD(2, "立项备案"); | |||||
private final Integer code; | |||||
private final String val; | |||||
} |
@@ -0,0 +1,56 @@ | |||||
package com.hz.pm.api.projectdeclared.model.req; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.math.BigDecimal; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* <p> | |||||
* SubmitConstructionReq | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 00:14 2024/2/23 | |||||
*/ | |||||
@Data | |||||
@ApiModel(value = "合同对象") | |||||
public class SubmitConstructionReq { | |||||
@ApiModelProperty("项目ID") | |||||
@NotNull(message = "项目ID不能为空") | |||||
private Long projectId; | |||||
@ApiModelProperty("合同ID") | |||||
private Long constructionId; | |||||
@ApiModelProperty("标段ID") | |||||
private Long bidId; | |||||
@ApiModelProperty("合同名称") | |||||
private String name; | |||||
@ApiModelProperty("合同总金额") | |||||
private BigDecimal totalAmount; | |||||
@ApiModelProperty("合同编号") | |||||
private String constructionNo; | |||||
@ApiModelProperty("合同完成时间") | |||||
@JsonFormat(pattern = "yyyy-MM-dd") | |||||
private LocalDateTime contractTime; | |||||
@ApiModelProperty("附件") | |||||
private String attachment; | |||||
@ApiModelProperty("供应商联系人") | |||||
private String supplierContact; | |||||
@ApiModelProperty("供应商联系方式") | |||||
private String supplierContactInfo; | |||||
} |
@@ -0,0 +1,57 @@ | |||||
package com.hz.pm.api.projectdeclared.model.req; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.math.BigDecimal; | |||||
import java.time.LocalDateTime; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* SubmitPurchaseNoticeReq | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 11:34 2024/2/22 | |||||
*/ | |||||
@Data | |||||
@AllArgsConstructor | |||||
public class SubmitPurchaseNoticeReq { | |||||
@ApiModelProperty("项目ID") | |||||
@NotNull(message = "请传项目ID") | |||||
private Long projectId; | |||||
@ApiModelProperty("标段ID") | |||||
private Long bidId; | |||||
@ApiModelProperty("标段名称") | |||||
private String bidName; | |||||
@ApiModelProperty("标段预算") | |||||
private BigDecimal bidBudget; | |||||
@ApiModelProperty("开标时间") | |||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") | |||||
private LocalDateTime bidStartTime; | |||||
@ApiModelProperty("投标截止时间") | |||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") | |||||
private LocalDateTime bidEndTime; | |||||
@ApiModelProperty("投标地址") | |||||
private String bidAddress; | |||||
@ApiModelProperty("采购方式") | |||||
private String purchaseMethod; | |||||
@ApiModelProperty("招标文件") | |||||
private String bidDoc; | |||||
} |
@@ -0,0 +1,48 @@ | |||||
package com.hz.pm.api.projectdeclared.model.req; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* 采购信息备案提交参数类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 11:34 2024/2/22 | |||||
*/ | |||||
@Data | |||||
@AllArgsConstructor | |||||
public class SubmitPurchaseRecordReq { | |||||
@ApiModelProperty("项目ID") | |||||
@NotNull(message = "请传项目ID") | |||||
private Long projectId; | |||||
@ApiModelProperty("标段ID") | |||||
private Long bidId; | |||||
@ApiModelProperty("标段类型") | |||||
private Integer bidType; | |||||
@ApiModelProperty("供应商") | |||||
private String supplier; | |||||
@ApiModelProperty("供应商社会信用代码") | |||||
private String supplierSocialCreditCode; | |||||
@ApiModelProperty("投标文件") | |||||
private String biddingDoc; | |||||
@ApiModelProperty("中标通知书") | |||||
private String acceptanceLetter; | |||||
@ApiModelProperty("标段建设内容") | |||||
private String bidBuildContent; | |||||
} |
@@ -9,7 +9,6 @@ import lombok.Data; | |||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.List; | |||||
/** | /** | ||||
* @Classname Contract | * @Classname Contract | ||||
@@ -18,11 +17,9 @@ import java.util.List; | |||||
* @Author PoffyZhang | * @Author PoffyZhang | ||||
*/ | */ | ||||
@Data | @Data | ||||
@ApiModel(value = "ContractVO", description = "") | |||||
@ApiModel(value = "ContractVO") | |||||
public class ContractVO { | public class ContractVO { | ||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty("主键") | @ApiModelProperty("主键") | ||||
private Long id; | private Long id; | ||||
@@ -75,6 +72,16 @@ public class ContractVO { | |||||
@ApiModelProperty("项目编号") | @ApiModelProperty("项目编号") | ||||
private String projectCode; | private String projectCode; | ||||
@ApiModelProperty("支付计划") | |||||
private List<PaymentPlanVO> payments; | |||||
@ApiModelProperty("供应商联系人") | |||||
private String supplierContact; | |||||
@ApiModelProperty("供应商联系方式") | |||||
private String supplierContactInfo; | |||||
@ApiModelProperty("标段ID") | |||||
private Long bidId; | |||||
@ApiModelProperty("合同编号") | |||||
private String constructionNo; | |||||
} | } |
@@ -9,15 +9,15 @@ import lombok.NoArgsConstructor; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
/** | /** | ||||
* @Classname Operation | |||||
* @Description | |||||
* @Date 2023/5/29 10:00 | |||||
* @Author PoffyZhang | |||||
* <p> | |||||
* OperationVO | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 09:28 2024/2/23 | |||||
*/ | */ | ||||
@ApiModel(value = "实施对象", description = "实施对象") | |||||
@Data | @Data | ||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
@ApiModel(value = "实施对象") | |||||
public class OperationVO { | public class OperationVO { | ||||
@ApiModelProperty("id") | @ApiModelProperty("id") | ||||
@@ -50,6 +50,13 @@ public class OperationVO { | |||||
@ApiModelProperty("终验时间") | @ApiModelProperty("终验时间") | ||||
private LocalDateTime finalInspectionDate; | private LocalDateTime finalInspectionDate; | ||||
@ApiModelProperty("标段ID") | |||||
private Long bidId; | |||||
@ApiModelProperty("试运行开始时间") | |||||
private LocalDateTime pilotRunStartDate; | |||||
@ApiModelProperty("开始实施时间") | @ApiModelProperty("开始实施时间") | ||||
private LocalDateTime startTrialOperationDate; | private LocalDateTime startTrialOperationDate; | ||||
} | } |
@@ -3,6 +3,7 @@ package com.hz.pm.api.projectdeclared.model.vo; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | import com.baomidou.mybatisplus.annotation.IdType; | ||||
import com.baomidou.mybatisplus.annotation.TableId; | import com.baomidou.mybatisplus.annotation.TableId; | ||||
import com.hz.pm.api.common.compare.Compare; | import com.hz.pm.api.common.compare.Compare; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO; | |||||
import com.hz.pm.api.projectlib.model.entity.ProjectApplication; | import com.hz.pm.api.projectlib.model.entity.ProjectApplication; | ||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
@@ -356,7 +357,11 @@ public class ProjectDraftVO implements Serializable { | |||||
@ApiModelProperty("评审清单") | @ApiModelProperty("评审清单") | ||||
private String reviewChecklist; | private String reviewChecklist; | ||||
@ApiModelProperty("支付计划") | |||||
private List<ProjectPaymentPlanDTO> paymentPlanList; | |||||
private Long createBy; | private Long createBy; | ||||
private Long updateBy; | private Long updateBy; | ||||
@ApiModelProperty("是否推送省里") | @ApiModelProperty("是否推送省里") | ||||
@@ -370,4 +375,7 @@ public class ProjectDraftVO implements Serializable { | |||||
@ApiModelProperty("立项依据证明材料") | @ApiModelProperty("立项依据证明材料") | ||||
private String baseProjBasisFile; | private String baseProjBasisFile; | ||||
@ApiModelProperty("草稿箱类型:1 项目申报、2 立项备案") | |||||
private Integer draftType; | |||||
} | } |
@@ -3,6 +3,7 @@ package com.hz.pm.api.projectdeclared.utils; | |||||
import com.google.common.collect.Maps; | import com.google.common.collect.Maps; | ||||
import com.hz.pm.api.projectdeclared.manage.*; | import com.hz.pm.api.projectdeclared.manage.*; | ||||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | ||||
import com.hz.pm.api.projectlib.manage.DeclaredRecordManage; | |||||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
@@ -26,7 +27,8 @@ public class RestartProcessMapUtil { | |||||
ConstructionPlanManage constructionPlanManage, | ConstructionPlanManage constructionPlanManage, | ||||
PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage, | PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage, | ||||
ReviewByProvincialDeptManage provincialDeptManage, | ReviewByProvincialDeptManage provincialDeptManage, | ||||
FinalAcceptanceManage finalAcceptanceManage) { | |||||
FinalAcceptanceManage finalAcceptanceManage, | |||||
DeclaredRecordManage declaredRecordManage) { | |||||
//重新项目申报 | //重新项目申报 | ||||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), | RESTART_PROCESS_MAP.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), | ||||
declaredProjectManage::reStartTheProcess); | declaredProjectManage::reStartTheProcess); | ||||
@@ -42,6 +44,9 @@ public class RestartProcessMapUtil { | |||||
//终审 | //终审 | ||||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode(), | RESTART_PROCESS_MAP.put(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode(), | ||||
finalAcceptanceManage::restartProcess); | finalAcceptanceManage::restartProcess); | ||||
// 立项备案重新提交 | |||||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.getCode(), | |||||
declaredRecordManage::restartDeclaredRecord); | |||||
} | } | ||||
public static Function<DefaultDeclaredDTO, String> getRestartFunction(Integer status) { | public static Function<DefaultDeclaredDTO, String> getRestartFunction(Integer status) { | ||||
@@ -1,6 +1,7 @@ | |||||
package com.hz.pm.api.projectlib.controller; | package com.hz.pm.api.projectlib.controller; | ||||
import com.hz.pm.api.projectlib.manage.MhProjectManage; | |||||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | |||||
import com.hz.pm.api.projectlib.manage.DeclaredRecordManage; | |||||
import com.hz.pm.api.projectlib.model.req.DeclaredProjectListReq; | import com.hz.pm.api.projectlib.model.req.DeclaredProjectListReq; | ||||
import com.hz.pm.api.projectlib.model.vo.DeclaredProjectListVO; | import com.hz.pm.api.projectlib.model.vo.DeclaredProjectListVO; | ||||
import com.hz.pm.api.projectlib.model.vo.MhProjectBaseInfoVO; | import com.hz.pm.api.projectlib.model.vo.MhProjectBaseInfoVO; | ||||
@@ -8,10 +9,9 @@ import com.ningdatech.basic.model.PageVo; | |||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import org.springframework.web.bind.annotation.GetMapping; | |||||
import org.springframework.web.bind.annotation.PathVariable; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import org.springframework.web.bind.annotation.*; | |||||
import javax.validation.Valid; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -21,24 +21,36 @@ import org.springframework.web.bind.annotation.RestController; | |||||
* @author WendyYang | * @author WendyYang | ||||
* @since 2024-01-30 | * @since 2024-01-30 | ||||
*/ | */ | ||||
@Api(tags = "信产项目(立项备案)列表") | |||||
@Api(tags = "信产项目(立项备案)相关接口") | |||||
@RestController | @RestController | ||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
@RequestMapping("/api/v1/mh/project") | |||||
@RequestMapping("/api/v1/declared/record") | |||||
public class MhProjectController { | public class MhProjectController { | ||||
private final MhProjectManage mhProjectManage; | |||||
private final DeclaredRecordManage declaredRecordManage; | |||||
@ApiOperation("立项备案列表") | @ApiOperation("立项备案列表") | ||||
@GetMapping("/pageDeclaredProject") | @GetMapping("/pageDeclaredProject") | ||||
public PageVo<DeclaredProjectListVO> pageDeclaredProject(DeclaredProjectListReq req) { | public PageVo<DeclaredProjectListVO> pageDeclaredProject(DeclaredProjectListReq req) { | ||||
return mhProjectManage.pageDeclaredProject(req); | |||||
return declaredRecordManage.pageDeclaredProject(req); | |||||
} | } | ||||
@ApiOperation("信产项目基本信息") | @ApiOperation("信产项目基本信息") | ||||
@GetMapping("/baseInfo/{mhProjectId}") | @GetMapping("/baseInfo/{mhProjectId}") | ||||
public MhProjectBaseInfoVO projectBaseInfo(@PathVariable Long mhProjectId) { | public MhProjectBaseInfoVO projectBaseInfo(@PathVariable Long mhProjectId) { | ||||
return mhProjectManage.getProjectBaseInfo(mhProjectId); | |||||
return declaredRecordManage.getProjectBaseInfo(mhProjectId); | |||||
} | |||||
@ApiOperation("立项备案提交") | |||||
@PostMapping("/submit") | |||||
public void submit(@Valid @RequestBody DefaultDeclaredDTO req) { | |||||
declaredRecordManage.startDeclaredRecord(req); | |||||
} | |||||
@ApiOperation("立项备案重新提交") | |||||
@PostMapping("/resubmit") | |||||
public void resubmit(@Valid @RequestBody DefaultDeclaredDTO req) { | |||||
declaredRecordManage.restartDeclaredRecord(req); | |||||
} | } | ||||
@@ -0,0 +1,18 @@ | |||||
package com.hz.pm.api.projectlib.controller; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.stereotype.Controller; | |||||
/** | |||||
* <p> | |||||
* 前端控制器 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-02-21 | |||||
*/ | |||||
@Controller | |||||
@RequestMapping("/api.projectlib/ndProjectPaymentPlan") | |||||
public class NdProjectPaymentPlanController { | |||||
} |
@@ -344,7 +344,8 @@ public class AnnualPlanLibManage { | |||||
project.setBeginTime(dataArr[0].trim()); | project.setBeginTime(dataArr[0].trim()); | ||||
project.setEndTime(dataArr[1].trim()); | project.setEndTime(dataArr[1].trim()); | ||||
project.setDeclareAmount(data.getDeclaredAmount()); | project.setDeclareAmount(data.getDeclaredAmount()); | ||||
project.setAnnualPlanAmount(data.getAnnualPlanAmount()); | |||||
// TODO 年度计划 | |||||
// project.setAnnualPlanAmount(data.getAnnualPlanAmount()); | |||||
project.setDeclareHaveAmount(data.getDeclareHaveAmount()); | project.setDeclareHaveAmount(data.getDeclareHaveAmount()); | ||||
project.setDeclareGovOwnFinanceAmount(data.getDeclareGovOwnFinanceAmount()); | project.setDeclareGovOwnFinanceAmount(data.getDeclareGovOwnFinanceAmount()); | ||||
project.setDeclareGovSuperiorFinanceAmount(data.getDeclareGovSuperiorFinanceAmount()); | project.setDeclareGovSuperiorFinanceAmount(data.getDeclareGovSuperiorFinanceAmount()); | ||||
@@ -0,0 +1,301 @@ | |||||
package com.hz.pm.api.projectlib.manage; | |||||
import cn.hutool.core.lang.Assert; | |||||
import cn.hutool.core.util.StrUtil; | |||||
import com.alibaba.fastjson.JSON; | |||||
import com.alibaba.fastjson.TypeReference; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.hz.pm.api.common.enumeration.CommonEnum; | |||||
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | |||||
import com.hz.pm.api.common.model.constant.BizConst; | |||||
import com.hz.pm.api.projectdeclared.manage.DefaultDeclaredProjectManage; | |||||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | |||||
import com.hz.pm.api.projectdeclared.model.dto.ProjectConditionDTO; | |||||
import com.hz.pm.api.projectdeclared.service.IProjectDraftService; | |||||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | |||||
import com.hz.pm.api.projectlib.model.entity.MhProject; | |||||
import com.hz.pm.api.projectlib.model.entity.MhProjectSchemaTargetData; | |||||
import com.hz.pm.api.projectlib.model.entity.Project; | |||||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||||
import com.hz.pm.api.projectlib.model.req.DeclaredProjectListReq; | |||||
import com.hz.pm.api.projectlib.model.vo.DeclaredProjectListVO; | |||||
import com.hz.pm.api.projectlib.model.vo.MhProjectBaseInfoVO; | |||||
import com.hz.pm.api.projectlib.service.IMhProjectSchemaTargetDataService; | |||||
import com.hz.pm.api.projectlib.service.IMhProjectService; | |||||
import com.hz.pm.api.projectlib.service.IProjectService; | |||||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | |||||
import com.hz.pm.api.sys.manage.NoticeManage; | |||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConst; | |||||
import com.hz.pm.api.user.helper.MhUnitCache; | |||||
import com.hz.pm.api.user.model.dto.UnitDTO; | |||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | |||||
import com.hz.pm.api.user.util.LoginUserUtil; | |||||
import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.function.VUtils; | |||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.basic.util.CollUtils; | |||||
import com.wflow.bean.entity.WflowModels; | |||||
import com.wflow.workflow.bean.dto.OrgInfoDTO; | |||||
import com.wflow.workflow.bean.vo.ProcessStartParamsVo; | |||||
import com.wflow.workflow.service.ProcessInstanceService; | |||||
import com.wflow.workflow.service.ProcessModelService; | |||||
import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.BeanUtils; | |||||
import org.springframework.stereotype.Component; | |||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.util.Collections; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
import java.util.Objects; | |||||
import java.util.stream.Collectors; | |||||
/** | |||||
* <p> | |||||
* MhProjectManage | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 19:06 2024/1/30 | |||||
*/ | |||||
@Slf4j | |||||
@Component | |||||
@RequiredArgsConstructor | |||||
public class DeclaredRecordManage { | |||||
private final IMhProjectService mhProjectService; | |||||
private final IMhProjectSchemaTargetDataService mhProjectSchemaTargetDataService; | |||||
private final IProjectService projectService; | |||||
private final MhUnitCache mhUnitCache; | |||||
private final NoticeManage noticeManage; | |||||
private final IProjectDraftService projectDraftService; | |||||
private final ProcessModelService processModelService; | |||||
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; | |||||
private final ProcessInstanceService processInstanceService; | |||||
private final ProjectLibManage projectLibManage; | |||||
private LambdaQueryWrapper<MhProject> buildQuery(DeclaredProjectListReq req) { | |||||
LambdaQueryWrapper<MhProject> query = Wrappers.lambdaQuery(MhProject.class) | |||||
.like(StrUtil.isNotBlank(req.getProjectName()), MhProject::getProjectName, req.getProjectName()) | |||||
.like(StrUtil.isNotBlank(req.getDeclaredUnit()), MhProject::getUnitName, req.getDeclaredUnit()); | |||||
if (req.getCreateDateMin() != null) { | |||||
query.ge(MhProject::getCreateTime, req.getCreateDateMin()); | |||||
} | |||||
if (req.getCreateDateMax() != null) { | |||||
query.lt(MhProject::getCreateTime, req.getCreateDateMax().minusDays(1)); | |||||
} | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
if (!user.getSuperAdmin() && !user.getRegionAdmin()) { | |||||
query.eq(MhProject::getUnitId, user.getMhUnitId()); | |||||
} | |||||
return query; | |||||
} | |||||
public PageVo<DeclaredProjectListVO> pageDeclaredProject(DeclaredProjectListReq req) { | |||||
LambdaQueryWrapper<MhProject> query = buildQuery(req); | |||||
Page<MhProject> page = mhProjectService.page(req.page(), query); | |||||
if (page.getTotal() == 0) { | |||||
return PageVo.empty(); | |||||
} | |||||
List<MhProject> records = page.getRecords(); | |||||
List<String> projectCodes = CollUtils.fieldList(records, MhProject::getProjectCode); | |||||
Map<String, Project> projectMap; | |||||
if (!projectCodes.isEmpty()) { | |||||
List<Project> projects = projectService.listNewestByProjectCodes(projectCodes); | |||||
projectMap = CollUtils.listToMap(projects, Project::getProjectCode); | |||||
} else { | |||||
projectMap = Collections.emptyMap(); | |||||
} | |||||
List<DeclaredProjectListVO> data = records.stream().map(w -> { | |||||
DeclaredProjectListVO item = new DeclaredProjectListVO(); | |||||
item.setMhProjectId(w.getId()); | |||||
Project project = projectMap.get(w.getProjectCode()); | |||||
if (project == null) { | |||||
item.setStatus(null); | |||||
item.setStage(null); | |||||
} else { | |||||
item.setStatus(project.getStatus()); | |||||
item.setStage(project.getStage()); | |||||
} | |||||
item.setProjectCode(w.getProjectCode()); | |||||
item.setProjectName(w.getProjectName()); | |||||
item.setDeclaredAmount(w.getTotalMoney()); | |||||
item.setCreateTime(w.getCreateTime()); | |||||
return item; | |||||
}).collect(Collectors.toList()); | |||||
return PageVo.of(data, page.getTotal()); | |||||
} | |||||
public MhProjectBaseInfoVO getProjectBaseInfo(Long mhProjectId) { | |||||
MhProject mhProject = mhProjectService.getById(mhProjectId); | |||||
if (mhProject == null) { | |||||
throw BizException.wrap("项目不存在"); | |||||
} | |||||
MhProjectBaseInfoVO detail = new MhProjectBaseInfoVO(); | |||||
detail.setMhProjectId(mhProject.getId()); | |||||
detail.setProjectName(mhProject.getProjectName()); | |||||
detail.setDeclaredUnit(mhProject.getUnitName()); | |||||
detail.setDeclaredUnitId(mhProject.getUnitId()); | |||||
detail.setTotalInvestAmount(mhProject.getTotalMoney()); | |||||
detail.setReviewInvestAmount(mhProject.getMoney()); | |||||
MhProjectSchemaTargetData schemaTargetData = mhProjectSchemaTargetDataService.getByMhProjectId(mhProjectId); | |||||
if (schemaTargetData != null) { | |||||
detail.setTotalInvestBudgetAmount(schemaTargetData.getMoney()); | |||||
} | |||||
UnitDTO unit = mhUnitCache.getById(mhProject.getId()); | |||||
if (unit != null) { | |||||
detail.setDeclaredUnitUnifiedSocialCreditCode(unit.getUnifiedSocialCreditCode()); | |||||
} | |||||
return detail; | |||||
} | |||||
public String startDeclaredRecord(DefaultDeclaredDTO req) { | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
ProjectDTO projectInfo = req.getProjectInfo(); | |||||
projectInfo.setBuildOrgCode(user.getMhUnitIdStr()); | |||||
projectInfo.setBuildOrgName(user.getMhUnitName()); | |||||
// 项目名称去重 | |||||
defaultDeclaredProjectManage.checkDuplication(projectInfo); | |||||
// 判断申报金额 是否等于总的 判断年度支付金额 是否等于总金额 | |||||
defaultDeclaredProjectManage.checkAmount(projectInfo); | |||||
// 写死 是否有主管单位 | |||||
projectInfo.setIsHigherSuperOrg(CommonEnum.YES.getCode()); | |||||
projectInfo.setIsSuperOrg(CommonEnum.YES.getCode()); | |||||
//如果主管单位没有 那么主管单位就是自己 | |||||
if (CommonEnum.NO.getCode().equals(projectInfo.getIsSuperOrg())) { | |||||
projectInfo.setSuperOrgCode(user.getMhUnitIdStr()); | |||||
projectInfo.setSuperOrg(user.getMhUnitName()); | |||||
} | |||||
//如果是重新提交的话 判断下 项目是否存在 | |||||
if (Objects.nonNull(projectInfo.getId())) { | |||||
//新申报的项目不允许带项目id | |||||
projectInfo.setId(null); | |||||
} | |||||
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | |||||
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.PROJECT_RECORD_APPROVAL_PROCESS.getCode()) | |||||
.last(BizConst.LIMIT_1)); | |||||
if (Objects.isNull(model)) { | |||||
throw BizException.wrap("找不到立项备案审批流程配置"); | |||||
} | |||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | |||||
params.setUser(defaultDeclaredProjectManage.buildUser(user.getUserId())); | |||||
params.setProcessUsers(Collections.emptyMap()); | |||||
//放入条件判断的项目字段 | |||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | |||||
BeanUtils.copyProperties(req.getProjectInfo(), conditionDto); | |||||
req.getFormData().putAll( | |||||
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() { | |||||
}) | |||||
); | |||||
params.setFormData(req.getFormData()); | |||||
//开始申报 | |||||
// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | |||||
Project project = new Project(); | |||||
BeanUtils.copyProperties(projectInfo, project); | |||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(user.getUserId(), project); | |||||
String instanceId = processInstanceService.startProcessLs(model, params, orgModelMap); | |||||
log.info("申报项目成功 【{}】", instanceId); | |||||
//如果是重新提交的话 判断下 项目是否存在 | |||||
//保存项目相关 | |||||
Project buildProject = projectLibManage.saveProjectInDeclared(projectInfo, instanceId, user.getUserId(), | |||||
ProjectStatusEnum.NOT_APPROVED, ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING, | |||||
ProjectProcessStageEnum.PROJECT_RECORD_APPROVAL_PROCESS); | |||||
if (Objects.nonNull(projectInfo.getDraftId())) { | |||||
//如果是草稿箱提交 删除对应的草稿箱 | |||||
projectDraftService.removeById(projectInfo.getDraftId()); | |||||
} | |||||
//发送给第一个审批人消息 | |||||
noticeManage.sendFirstUser(buildProject, model.getFormName(), instanceId, | |||||
WorkNoticeConst.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
return instanceId; | |||||
} | |||||
@Transactional(rollbackFor = Exception.class) | |||||
public String restartDeclaredRecord(DefaultDeclaredDTO req) { | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
ProjectDTO reqProj = req.getProjectInfo(); | |||||
Assert.notNull(reqProj.getId(), "提交失败,缺少项目ID!"); | |||||
reqProj.setBuildOrgCode(user.getMhUnitIdStr()); | |||||
reqProj.setBuildOrgName(user.getMhUnitName()); | |||||
Project oldProj = projectService.getById(reqProj.getId()); | |||||
Assert.notNull(oldProj, "提交失败,此项目不存在!"); | |||||
//项目名称去重 | |||||
if (StrUtil.isNotBlank(reqProj.getProjectName()) && | |||||
!reqProj.getProjectName().equals(oldProj.getProjectName())) { | |||||
reqProj.setProjectCode(oldProj.getProjectCode()); | |||||
defaultDeclaredProjectManage.checkDuplication(reqProj); | |||||
} | |||||
// 写死 是否有主管单位 | |||||
oldProj.setIsHigherSuperOrg(CommonEnum.YES.getCode()); | |||||
oldProj.setIsSuperOrg(CommonEnum.YES.getCode()); | |||||
//如果主管单位没有 那么主管单位就是自己 | |||||
if (CommonEnum.NO.getCode().equals(reqProj.getIsSuperOrg())) { | |||||
oldProj.setSuperOrgCode(user.getMhUnitIdStr()); | |||||
oldProj.setSuperOrg(user.getMhUnitName()); | |||||
reqProj.setSuperOrgCode(user.getMhUnitIdStr()); | |||||
reqProj.setSuperOrg(user.getMhUnitName()); | |||||
} | |||||
//判断申报金额 是否等于总的 判断年度支付金额 是否等于总金额 | |||||
defaultDeclaredProjectManage.checkAmount(reqProj); | |||||
ProjectProcessStageEnum processStageEnum = ProjectProcessStageEnum.PROJECT_RECORD_APPROVAL_PROCESS; | |||||
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | |||||
.eq(WflowModels::getProcessType, processStageEnum.getCode()) | |||||
.last(BizConst.LIMIT_1)); | |||||
if (Objects.isNull(model)) { | |||||
throw BizException.wrap("%s不存在", processStageEnum.getDesc()); | |||||
} | |||||
//首先要判断 项目当前状态 是不是 单位内部拒绝 | |||||
VUtils.isTrue(!ProjectStatusEnum.DECLARED_APPROVED_RECORD_FAILED.eq(oldProj.getStatus()) || | |||||
!ProjectStatusEnum.NOT_APPROVED.eq(oldProj.getStage())) | |||||
.throwMessage("提交失败,该项目不是立项备案审核不通过状态或者未立项阶段"); | |||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | |||||
params.setUser(defaultDeclaredProjectManage.buildUser(user.getUserId())); | |||||
params.setProcessUsers(Collections.emptyMap()); | |||||
//把条件值给放入工作流 | |||||
defaultDeclaredProjectManage.buildCondition(params, req); | |||||
// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | |||||
Project project = new Project(); | |||||
BeanUtils.copyProperties(reqProj, project); | |||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(user.getUserId(), project); | |||||
String instId = processInstanceService.startProcessLs(model, params, orgModelMap); | |||||
log.info("立项备案重新提交 【{}】", instId); | |||||
//保存项目相关 | |||||
Project newProj = projectLibManage.saveProjectInDeclared(reqProj, instId, user.getUserId(), | |||||
ProjectStatusEnum.NOT_APPROVED, | |||||
ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING, | |||||
processStageEnum); | |||||
//发送给第一个审批人消息 | |||||
noticeManage.sendFirstUser(newProj, model.getFormName(), instId, | |||||
WorkNoticeConst.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||||
return instId; | |||||
} | |||||
} |
@@ -1,124 +0,0 @@ | |||||
package com.hz.pm.api.projectlib.manage; | |||||
import cn.hutool.core.util.StrUtil; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.hz.pm.api.projectlib.model.entity.MhProject; | |||||
import com.hz.pm.api.projectlib.model.entity.MhProjectSchemaTargetData; | |||||
import com.hz.pm.api.projectlib.model.entity.Project; | |||||
import com.hz.pm.api.projectlib.model.req.DeclaredProjectListReq; | |||||
import com.hz.pm.api.projectlib.model.vo.DeclaredProjectListVO; | |||||
import com.hz.pm.api.projectlib.model.vo.MhProjectBaseInfoVO; | |||||
import com.hz.pm.api.projectlib.service.IMhProjectSchemaTargetDataService; | |||||
import com.hz.pm.api.projectlib.service.IMhProjectService; | |||||
import com.hz.pm.api.projectlib.service.IProjectService; | |||||
import com.hz.pm.api.user.helper.MhUnitCache; | |||||
import com.hz.pm.api.user.model.dto.UnitDTO; | |||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | |||||
import com.hz.pm.api.user.util.LoginUserUtil; | |||||
import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.basic.util.CollUtils; | |||||
import lombok.RequiredArgsConstructor; | |||||
import org.springframework.stereotype.Component; | |||||
import java.util.Collections; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
import java.util.stream.Collectors; | |||||
/** | |||||
* <p> | |||||
* MhProjectManage | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 19:06 2024/1/30 | |||||
*/ | |||||
@Component | |||||
@RequiredArgsConstructor | |||||
public class MhProjectManage { | |||||
private final IMhProjectService mhProjectService; | |||||
private final IMhProjectSchemaTargetDataService mhProjectSchemaTargetDataService; | |||||
private final IProjectService projectService; | |||||
private final MhUnitCache mhUnitCache; | |||||
private LambdaQueryWrapper<MhProject> buildQuery(DeclaredProjectListReq req) { | |||||
LambdaQueryWrapper<MhProject> query = Wrappers.lambdaQuery(MhProject.class) | |||||
.like(StrUtil.isNotBlank(req.getProjectName()), MhProject::getProjectName, req.getProjectName()) | |||||
.like(StrUtil.isNotBlank(req.getDeclaredUnit()), MhProject::getUnitName, req.getDeclaredUnit()); | |||||
if (req.getCreateDateMin() != null) { | |||||
query.ge(MhProject::getCreateTime, req.getCreateDateMin()); | |||||
} | |||||
if (req.getCreateDateMax() != null) { | |||||
query.lt(MhProject::getCreateTime, req.getCreateDateMax().minusDays(1)); | |||||
} | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
if (!user.getSuperAdmin() && !user.getRegionAdmin()) { | |||||
query.eq(MhProject::getUnitId, user.getMhUnitId()); | |||||
} | |||||
return query; | |||||
} | |||||
public PageVo<DeclaredProjectListVO> pageDeclaredProject(DeclaredProjectListReq req) { | |||||
LambdaQueryWrapper<MhProject> query = buildQuery(req); | |||||
Page<MhProject> page = mhProjectService.page(req.page(), query); | |||||
if (page.getTotal() == 0) { | |||||
return PageVo.empty(); | |||||
} | |||||
List<MhProject> records = page.getRecords(); | |||||
List<String> projectCodes = CollUtils.fieldList(records, MhProject::getProjectCode); | |||||
Map<String, Project> projectMap; | |||||
if (!projectCodes.isEmpty()) { | |||||
List<Project> projects = projectService.listNewestByProjectCodes(projectCodes); | |||||
projectMap = CollUtils.listToMap(projects, Project::getProjectCode); | |||||
} else { | |||||
projectMap = Collections.emptyMap(); | |||||
} | |||||
List<DeclaredProjectListVO> data = records.stream().map(w -> { | |||||
DeclaredProjectListVO item = new DeclaredProjectListVO(); | |||||
item.setMhProjectId(w.getId()); | |||||
Project project = projectMap.get(w.getProjectCode()); | |||||
if (project == null) { | |||||
item.setStatus(null); | |||||
item.setStage(null); | |||||
} else { | |||||
item.setStatus(project.getStatus()); | |||||
item.setStage(project.getStage()); | |||||
} | |||||
item.setProjectCode(w.getProjectCode()); | |||||
item.setProjectName(w.getProjectName()); | |||||
item.setDeclaredAmount(w.getTotalMoney()); | |||||
item.setCreateTime(w.getCreateTime()); | |||||
return item; | |||||
}).collect(Collectors.toList()); | |||||
return PageVo.of(data, page.getTotal()); | |||||
} | |||||
public MhProjectBaseInfoVO getProjectBaseInfo(Long mhProjectId) { | |||||
MhProject mhProject = mhProjectService.getById(mhProjectId); | |||||
if (mhProject == null) { | |||||
throw BizException.wrap("项目不存在"); | |||||
} | |||||
MhProjectBaseInfoVO detail = new MhProjectBaseInfoVO(); | |||||
detail.setMhProjectId(mhProject.getId()); | |||||
detail.setProjectName(mhProject.getProjectName()); | |||||
detail.setDeclaredUnit(mhProject.getUnitName()); | |||||
detail.setDeclaredUnitId(mhProject.getUnitId()); | |||||
detail.setTotalInvestAmount(mhProject.getTotalMoney()); | |||||
detail.setReviewInvestAmount(mhProject.getMoney()); | |||||
MhProjectSchemaTargetData schemaTargetData = mhProjectSchemaTargetDataService.getByMhProjectId(mhProjectId); | |||||
if (schemaTargetData != null) { | |||||
detail.setTotalInvestBudgetAmount(schemaTargetData.getMoney()); | |||||
} | |||||
UnitDTO unit = mhUnitCache.getById(mhProject.getId()); | |||||
if (unit != null) { | |||||
detail.setDeclaredUnitUnifiedSocialCreditCode(unit.getUnifiedSocialCreditCode()); | |||||
} | |||||
return detail; | |||||
} | |||||
} |
@@ -40,8 +40,12 @@ import com.hz.pm.api.portrait.model.entity.Tag; | |||||
import com.hz.pm.api.portrait.model.vo.TagVO; | import com.hz.pm.api.portrait.model.vo.TagVO; | ||||
import com.hz.pm.api.portrait.service.IProjectTagService; | import com.hz.pm.api.portrait.service.IProjectTagService; | ||||
import com.hz.pm.api.portrait.service.ITagService; | import com.hz.pm.api.portrait.service.ITagService; | ||||
import com.hz.pm.api.projectdeclared.manage.ConstructionManage; | |||||
import com.hz.pm.api.projectdeclared.model.dto.DelayedApplyDTO; | import com.hz.pm.api.projectdeclared.model.dto.DelayedApplyDTO; | ||||
import com.hz.pm.api.projectdeclared.model.entity.*; | |||||
import com.hz.pm.api.projectdeclared.model.entity.Operation; | |||||
import com.hz.pm.api.projectdeclared.model.entity.PaymentPlan; | |||||
import com.hz.pm.api.projectdeclared.model.entity.PreInsAcceptancePerson; | |||||
import com.hz.pm.api.projectdeclared.model.entity.Purchase; | |||||
import com.hz.pm.api.projectdeclared.model.vo.*; | import com.hz.pm.api.projectdeclared.model.vo.*; | ||||
import com.hz.pm.api.projectdeclared.service.*; | import com.hz.pm.api.projectdeclared.service.*; | ||||
import com.hz.pm.api.projectdeclared.utils.GenerateProjectCodeUtil; | import com.hz.pm.api.projectdeclared.utils.GenerateProjectCodeUtil; | ||||
@@ -49,6 +53,7 @@ import com.hz.pm.api.projectlib.handle.ProcessExecuteChainHandle; | |||||
import com.hz.pm.api.projectlib.helper.ProjectHelper; | import com.hz.pm.api.projectlib.helper.ProjectHelper; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectConstant; | import com.hz.pm.api.projectlib.model.constant.ProjectConstant; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO; | |||||
import com.hz.pm.api.projectlib.model.entity.*; | import com.hz.pm.api.projectlib.model.entity.*; | ||||
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; | import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; | ||||
import com.hz.pm.api.projectlib.model.enumeration.ProjectRenewalApprovalStatusEnum; | import com.hz.pm.api.projectlib.model.enumeration.ProjectRenewalApprovalStatusEnum; | ||||
@@ -126,23 +131,17 @@ public class ProjectLibManage { | |||||
private final IPaymentPlanService paymentPlanService; | private final IPaymentPlanService paymentPlanService; | ||||
private final ITodoService todoService; | private final ITodoService todoService; | ||||
private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; | private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; | ||||
private final IProjectPaymentPlanService projectPaymentPlanService; | |||||
private final IOperationService operationService; | private final IOperationService operationService; | ||||
private final IProjectTagService projectTagService; | private final IProjectTagService projectTagService; | ||||
private final ITagService tagService; | private final ITagService tagService; | ||||
private final ISupplierSafetyQualificationService supplierSafetyQualificationService; | private final ISupplierSafetyQualificationService supplierSafetyQualificationService; | ||||
private final IPersonSafetyInfoService personSafetyInfoService; | private final IPersonSafetyInfoService personSafetyInfoService; | ||||
private final ApplicationHandler applicationHandler; | private final ApplicationHandler applicationHandler; | ||||
private final TaskService taskService; | private final TaskService taskService; | ||||
private final UserInfoHelper userInfoHelper; | private final UserInfoHelper userInfoHelper; | ||||
private final IExpertReviewService expertReviewService; | private final IExpertReviewService expertReviewService; | ||||
private final ConstructionManage constructionManage; | |||||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | ||||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | ||||
@@ -152,10 +151,14 @@ public class ProjectLibManage { | |||||
if (CollUtil.isEmpty(page.getRecords())) { | if (CollUtil.isEmpty(page.getRecords())) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<String> projectCodes = page.getRecords().stream() | |||||
.map(Project::getProjectCode).collect(Collectors.toList()); | |||||
Set<String> projectCodes = new HashSet<>(); | |||||
List<Long> projectIds = new ArrayList<>(); | |||||
for (Project project : page.getRecords()) { | |||||
projectIds.add(project.getId()); | |||||
projectCodes.add(project.getProjectCode()); | |||||
} | |||||
Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap = listRenewDeclarations(projectCodes); | Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap = listRenewDeclarations(projectCodes); | ||||
Map<Long, List<ProjectPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds); | |||||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | ||||
ProjectLibListItemVO item = new ProjectLibListItemVO(); | ProjectLibListItemVO item = new ProjectLibListItemVO(); | ||||
@@ -175,13 +178,18 @@ public class ProjectLibManage { | |||||
item.setProcessStatus(w.getProcessStatus()); | item.setProcessStatus(w.getProcessStatus()); | ||||
item.setInstCode(w.getInstCode()); | item.setInstCode(w.getInstCode()); | ||||
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); | item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); | ||||
List<ProjectPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList()); | |||||
BigDecimal totalAnnualPaymentAmount = paymentPlans.stream() | |||||
.map(ProjectPaymentPlan::getAnnualPlanAmount) | |||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO); | |||||
List<ProjectRenewalFundDeclaration> fundDeclarations = renewalMap.get(w.getId()); | List<ProjectRenewalFundDeclaration> fundDeclarations = renewalMap.get(w.getId()); | ||||
if (fundDeclarations != null) { | if (fundDeclarations != null) { | ||||
item.setAnnualAccumulateAmount(computeAmount(w.getAnnualPlanAmount(), fundDeclarations)); | |||||
item.setAnnualAccumulateAmountList(convertAccmulate(w, fundDeclarations)); | |||||
item.setAnnualAccumulateAmount(computeAmount(totalAnnualPaymentAmount, fundDeclarations)); | |||||
item.setAnnualAccumulateAmountList(convertAccmulate(w, totalAnnualPaymentAmount, fundDeclarations)); | |||||
} else { | } else { | ||||
item.setAnnualAccumulateAmount(w.getAnnualPlanAmount()); | |||||
item.setAnnualAccumulateAmountList(convertAccmulate(w, Collections.emptyList())); | |||||
item.setAnnualAccumulateAmount(totalAnnualPaymentAmount); | |||||
item.setAnnualAccumulateAmountList(convertAccmulate(w, totalAnnualPaymentAmount, Collections.emptyList())); | |||||
} | } | ||||
return item; | return item; | ||||
}); | }); | ||||
@@ -199,10 +207,14 @@ public class ProjectLibManage { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
UserFullInfoDTO finalUser = user; | UserFullInfoDTO finalUser = user; | ||||
Set<String> projectCodes = page.getRecords().stream() | |||||
.map(Project::getProjectCode).collect(Collectors.toSet()); | |||||
Set<String> projectCodes = new HashSet<>(); | |||||
List<Long> projectIds = new ArrayList<>(); | |||||
for (Project project : page.getRecords()) { | |||||
projectIds.add(project.getId()); | |||||
projectCodes.add(project.getProjectCode()); | |||||
} | |||||
Map<String, List<TagVO>> projectTagMap = getProjectTags(projectCodes); | Map<String, List<TagVO>> projectTagMap = getProjectTags(projectCodes); | ||||
Map<Long, List<ProjectPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds); | |||||
Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap = listRenewDeclarations(projectCodes); | Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap = listRenewDeclarations(projectCodes); | ||||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { | ||||
@@ -229,16 +241,20 @@ public class ProjectLibManage { | |||||
item.setCanPreDeclared(Boolean.TRUE); | item.setCanPreDeclared(Boolean.TRUE); | ||||
} | } | ||||
item.setApprovedAmount(w.getApprovalAmount()); | item.setApprovedAmount(w.getApprovalAmount()); | ||||
item.setAnnualPlanAmount(w.getAnnualPlanAmount()); | |||||
List<ProjectPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList()); | |||||
BigDecimal totalAnnualPaymentAmount = paymentPlans.stream() | |||||
.map(ProjectPaymentPlan::getAnnualPlanAmount) | |||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO); | |||||
item.setAnnualPlanAmount(totalAnnualPaymentAmount); | |||||
item.setPrePlanProjectId(w.getPrePlanProjectId()); | item.setPrePlanProjectId(w.getPrePlanProjectId()); | ||||
item.setTags(projectTagMap.get(w.getProjectCode())); | item.setTags(projectTagMap.get(w.getProjectCode())); | ||||
List<ProjectRenewalFundDeclaration> fundDeclarations = renewalMap.get(w.getId()); | List<ProjectRenewalFundDeclaration> fundDeclarations = renewalMap.get(w.getId()); | ||||
if (fundDeclarations != null) { | if (fundDeclarations != null) { | ||||
item.setAnnualAccumulateAmount(computeAmount(w.getAnnualPlanAmount(), fundDeclarations)); | |||||
item.setAnnualAccumulateAmountList(convertAccmulate(w, fundDeclarations)); | |||||
item.setAnnualAccumulateAmount(computeAmount(totalAnnualPaymentAmount, fundDeclarations)); | |||||
item.setAnnualAccumulateAmountList(convertAccmulate(w, totalAnnualPaymentAmount, fundDeclarations)); | |||||
} else { | } else { | ||||
item.setAnnualAccumulateAmount(w.getAnnualPlanAmount()); | |||||
item.setAnnualAccumulateAmountList(convertAccmulate(w, Collections.emptyList())); | |||||
item.setAnnualAccumulateAmount(totalAnnualPaymentAmount); | |||||
item.setAnnualAccumulateAmountList(convertAccmulate(w, totalAnnualPaymentAmount, Collections.emptyList())); | |||||
} | } | ||||
return item; | return item; | ||||
}); | }); | ||||
@@ -304,7 +320,7 @@ public class ProjectLibManage { | |||||
item.setCanPreDeclared(Boolean.TRUE); | item.setCanPreDeclared(Boolean.TRUE); | ||||
} | } | ||||
item.setApprovedAmount(w.getApprovalAmount()); | item.setApprovedAmount(w.getApprovalAmount()); | ||||
item.setAnnualPlanAmount(w.getAnnualPlanAmount()); | |||||
// item.setAnnualPlanAmount(w.getAnnualPlanAmount()); | |||||
item.setPrePlanProjectId(w.getPrePlanProjectId()); | item.setPrePlanProjectId(w.getPrePlanProjectId()); | ||||
records.add(item); | records.add(item); | ||||
} | } | ||||
@@ -578,12 +594,12 @@ public class ProjectLibManage { | |||||
return annualAmounts; | return annualAmounts; | ||||
} | } | ||||
public static List<AnnualAmountVO> convertAccmulate(Project project, List<ProjectRenewalFundDeclaration> prfs) { | |||||
public static List<AnnualAmountVO> convertAccmulate(Project project, BigDecimal totalAnnualPlanAmount, List<ProjectRenewalFundDeclaration> prfs) { | |||||
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | ||||
annualAmounts.add(AnnualAmountVO.builder() | annualAmounts.add(AnnualAmountVO.builder() | ||||
.projectId(project.getId()) | .projectId(project.getId()) | ||||
.projectYear(project.getProjectYear()) | .projectYear(project.getProjectYear()) | ||||
.annualAmount(project.getAnnualPlanAmount()) | |||||
.annualAmount(totalAnnualPlanAmount) | |||||
.build()); | .build()); | ||||
for (ProjectRenewalFundDeclaration prf : prfs) { | for (ProjectRenewalFundDeclaration prf : prfs) { | ||||
annualAmounts.add(AnnualAmountVO.builder() | annualAmounts.add(AnnualAmountVO.builder() | ||||
@@ -676,17 +692,8 @@ public class ProjectLibManage { | |||||
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); | vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); | ||||
//查询合同备案 | //查询合同备案 | ||||
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) | |||||
.eq(Contract::getProjectCode, projectInfo.getProjectCode()) | |||||
.last(BizConst.LIMIT_1)); | |||||
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class); | |||||
vo.setContract(contractVO); | |||||
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) | |||||
.eq(PaymentPlan::getProjectCode, projectInfo.getProjectCode()) | |||||
.orderByAsc(PaymentPlan::getPaymentTime)); | |||||
if (Objects.nonNull(contractVO)) { | |||||
contractVO.setPayments(convertPayments(payments, contractVO.getTotalAmount())); | |||||
} | |||||
List<ContractVO> contracts = constructionManage.detailContractByProjectId(projectInfo.getId()); | |||||
vo.setContract(contracts); | |||||
//查询实施信息 | //查询实施信息 | ||||
Operation operation = operationService.getOne(Wrappers.lambdaQuery(Operation.class) | Operation operation = operationService.getOne(Wrappers.lambdaQuery(Operation.class) | ||||
@@ -725,11 +732,15 @@ public class ProjectLibManage { | |||||
//查询年度投资金额 要是已验收的项目 | //查询年度投资金额 要是已验收的项目 | ||||
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { | if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { | ||||
List<ProjectPaymentPlan> paymentPlans = projectPaymentPlanService.listByProjectId(projectInfo.getId()); | |||||
BigDecimal totalAnnualAmount = paymentPlans.stream() | |||||
.map(ProjectPaymentPlan::getAnnualPlanAmount) | |||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO); | |||||
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | ||||
annualAmounts.add(AnnualAmountVO.builder() | annualAmounts.add(AnnualAmountVO.builder() | ||||
.projectId(projectInfo.getId()) | .projectId(projectInfo.getId()) | ||||
.projectYear(projectInfo.getProjectYear()) | .projectYear(projectInfo.getProjectYear()) | ||||
.annualAmount(projectInfo.getAnnualPlanAmount()) | |||||
.annualAmount(totalAnnualAmount) | |||||
.build()); | .build()); | ||||
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) | List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) | ||||
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) | .eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) | ||||
@@ -787,6 +798,28 @@ public class ProjectLibManage { | |||||
return project; | return project; | ||||
} | } | ||||
/** | |||||
* 申报新项目时 保存项目信息和其它相关联的信息 | |||||
* | |||||
* @param projectDto \ | |||||
* @param instanceId \ | |||||
* @return \ | |||||
*/ | |||||
public Project saveProjectInDeclared(ProjectDTO projectDto, String instanceId, Long userId, | |||||
ProjectStatusEnum stage, ProjectStatusEnum status, | |||||
ProjectProcessStageEnum processStage) { | |||||
Project project = saveProjectNewVersion(projectDto, instanceId, userId, Boolean.FALSE, stage, status); | |||||
//保存项目和实例的关系 | |||||
ProjectInst projectInst = new ProjectInst(); | |||||
projectInst.setProjectId(project.getId()); | |||||
projectInst.setInstCode(instanceId); | |||||
projectInst.setCreatOn(LocalDateTime.now()); | |||||
projectInst.setUpdateOn(LocalDateTime.now()); | |||||
projectInst.setInstType(processStage.getCode()); | |||||
projectInstService.save(projectInst); | |||||
return project; | |||||
} | |||||
/** | /** | ||||
* 建设方案申报项目时 保存项目信息和其它相关联的信息 | * 建设方案申报项目时 保存项目信息和其它相关联的信息 | ||||
@@ -828,6 +861,14 @@ public class ProjectLibManage { | |||||
public Project saveProjectNewVersion(ProjectDTO projectDto, String instanceId, | public Project saveProjectNewVersion(ProjectDTO projectDto, String instanceId, | ||||
Long userId, Boolean isContruct) { | Long userId, Boolean isContruct) { | ||||
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | ||||
return saveProjectNewVersion(projectDto, instanceId, userId, isContruct, ProjectStatusEnum.NOT_APPROVED, ProjectStatusEnum.UNDER_INTERNAL_AUDIT); | |||||
} | |||||
public Project saveProjectNewVersion(ProjectDTO projectDto, String instanceId, | |||||
Long userId, Boolean isContruct, | |||||
ProjectStatusEnum stage, | |||||
ProjectStatusEnum status) { | |||||
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | |||||
try { | try { | ||||
Project project = new Project(); | Project project = new Project(); | ||||
//为空 代表是新申报的 | //为空 代表是新申报的 | ||||
@@ -835,14 +876,15 @@ public class ProjectLibManage { | |||||
BeanUtils.copyProperties(projectDto, project); | BeanUtils.copyProperties(projectDto, project); | ||||
project.setCreateOn(LocalDateTime.now()); | project.setCreateOn(LocalDateTime.now()); | ||||
project.setUpdateOn(LocalDateTime.now()); | project.setUpdateOn(LocalDateTime.now()); | ||||
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | |||||
project.setStage(stage.getCode()); | |||||
project.setStatus(status.getCode()); | |||||
project.setInstCode(instanceId); | project.setInstCode(instanceId); | ||||
project.setSponsor(String.valueOf(userId)); | project.setSponsor(String.valueOf(userId)); | ||||
String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); | String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); | ||||
project.setProjectCode(projectCode); | project.setProjectCode(projectCode); | ||||
if (projectService.save(project)) { | if (projectService.save(project)) { | ||||
saveApplication(projectDto, project, null); | saveApplication(projectDto, project, null); | ||||
savePaymentPlans(project, projectDto.getPaymentPlanList()); | |||||
} | } | ||||
} else { | } else { | ||||
//否则是重新提交的 新生成一个新版本的项目 | //否则是重新提交的 新生成一个新版本的项目 | ||||
@@ -860,6 +902,18 @@ public class ProjectLibManage { | |||||
} | } | ||||
} | } | ||||
private void savePaymentPlans(Project project, List<ProjectPaymentPlanDTO> paymentPlans) { | |||||
Integer version = Objects.nonNull(project.getVersion()) ? project.getVersion() : 1; | |||||
projectPaymentPlanService.remove(project.getProjectCode(), version); | |||||
List<ProjectPaymentPlan> plans = paymentPlans.stream().map(w -> { | |||||
ProjectPaymentPlan plan = BeanUtil.copyProperties(w, ProjectPaymentPlan.class); | |||||
plan.setProjectCode(project.getProjectCode()); | |||||
plan.setProjectVersion(version); | |||||
return plan; | |||||
}).collect(Collectors.toList()); | |||||
projectPaymentPlanService.saveBatch(plans); | |||||
} | |||||
/** | /** | ||||
* 建设方案申报项目时 保存项目信息和其它相关联的信息 | * 建设方案申报项目时 保存项目信息和其它相关联的信息 | ||||
* | * | ||||
@@ -962,7 +1016,7 @@ public class ProjectLibManage { | |||||
projectService.updateById(oldProject); | projectService.updateById(oldProject); | ||||
projectService.reverseNewest(project.getProjectCode(), project.getId()); | projectService.reverseNewest(project.getProjectCode(), project.getId()); | ||||
saveApplication(projecDto, project, isContruct); | saveApplication(projecDto, project, isContruct); | ||||
savePaymentPlans(project, projecDto.getPaymentPlanList()); | |||||
return project; | return project; | ||||
} | } | ||||
@@ -1513,29 +1567,21 @@ public class ProjectLibManage { | |||||
//采取批量删除 批量添加的方式 | //采取批量删除 批量添加的方式 | ||||
Integer version = Objects.nonNull(project.getVersion()) ? project.getVersion() : 1; | Integer version = Objects.nonNull(project.getVersion()) ? project.getVersion() : 1; | ||||
//删除当前版本的app 一般情况是没有 保险起见 | //删除当前版本的app 一般情况是没有 保险起见 | ||||
List<ProjectApplication> applications = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion, version)); | |||||
if (CollUtil.isNotEmpty(applications)) { | |||||
projectApplicationService.removeBatchByIds(applications); | |||||
} | |||||
projectApplicationService.remove(project.getProjectCode(), version); | |||||
if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | ||||
Project finalProject = project; | |||||
projectDto.getApplicationList().forEach(application -> { | projectDto.getApplicationList().forEach(application -> { | ||||
ProjectApplication projectApplication = new ProjectApplication(); | ProjectApplication projectApplication = new ProjectApplication(); | ||||
BeanUtils.copyProperties(application, projectApplication); | BeanUtils.copyProperties(application, projectApplication); | ||||
projectApplication.setId(null); | projectApplication.setId(null); | ||||
projectApplication.setProjectId(finalProject.getId()); | |||||
projectApplication.setProjectCode(finalProject.getProjectCode()); | |||||
projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); | |||||
projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); | |||||
projectApplication.setProjectId(project.getId()); | |||||
projectApplication.setProjectCode(project.getProjectCode()); | |||||
projectApplication.setBuildOrgCode(project.getBuildOrgCode()); | |||||
projectApplication.setBuildOrgName(project.getBuildOrgName()); | |||||
projectApplication.setProjectVersion(version); | projectApplication.setProjectVersion(version); | ||||
projectApplication.setIsConstruct(isConstruct); | projectApplication.setIsConstruct(isConstruct); | ||||
if (StringUtils.isNotBlank(application.getRelatedExistsApplication())) { | if (StringUtils.isNotBlank(application.getRelatedExistsApplication())) { | ||||
projectApplication.setApplicationName(null); | projectApplication.setApplicationName(null); | ||||
} | } | ||||
boolean result = projectApplicationService.save(projectApplication); | boolean result = projectApplicationService.save(projectApplication); | ||||
// 保存应用关联的核心业务 | // 保存应用关联的核心业务 | ||||
List<ProjectCoreBusinessDTO> coreBusinessList = application.getCoreBusinessList(); | List<ProjectCoreBusinessDTO> coreBusinessList = application.getCoreBusinessList(); | ||||
@@ -1558,8 +1604,8 @@ public class ProjectLibManage { | |||||
/** | /** | ||||
* 申报项目转化为 项目归集 | * 申报项目转化为 项目归集 | ||||
* | * | ||||
* @param projectCode | |||||
* @return | |||||
* @param projectCode \ | |||||
* @return \ | |||||
*/ | */ | ||||
public GovBizProjectDetailVO convertToCollection(String projectCode) { | public GovBizProjectDetailVO convertToCollection(String projectCode) { | ||||
ProjectDetailVO projectDetailVO = this.detailProjectCode(projectCode); | ProjectDetailVO projectDetailVO = this.detailProjectCode(projectCode); | ||||
@@ -9,6 +9,8 @@ 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.google.common.collect.Maps; | import com.google.common.collect.Maps; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan; | |||||
import com.hz.pm.api.projectlib.service.IProjectPaymentPlanService; | |||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | import com.hz.pm.api.user.security.model.UserInfoDetails; | ||||
import com.hz.pm.api.user.util.LoginUserUtil; | import com.hz.pm.api.user.util.LoginUserUtil; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
@@ -91,9 +93,8 @@ public class ProjectRenewalFundManage { | |||||
private final IGovBizProjectApproveService approveService; | private final IGovBizProjectApproveService approveService; | ||||
private final RegionCacheHelper regionCacheHelper; | |||||
private final IPaymentPlanService paymentPlanService; | private final IPaymentPlanService paymentPlanService; | ||||
private final IProjectPaymentPlanService projectPaymentPlanService; | |||||
/** | /** | ||||
* 项目续建资金库列表 分页 | * 项目续建资金库列表 分页 | ||||
@@ -131,7 +132,14 @@ public class ProjectRenewalFundManage { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<String> projectCodes = CollUtils.fieldList(page.getRecords(), Project::getProjectCode); | |||||
Set<String> projectCodes = new HashSet<>(); | |||||
List<Long> projectIds = new ArrayList<>(); | |||||
for (Project project : page.getRecords()) { | |||||
projectIds.add(project.getId()); | |||||
projectCodes.add(project.getProjectCode()); | |||||
} | |||||
Map<Long, List<ProjectPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds); | |||||
Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap; | Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap; | ||||
if (CollUtil.isNotEmpty(projectCodes)) { | if (CollUtil.isNotEmpty(projectCodes)) { | ||||
@@ -172,15 +180,20 @@ public class ProjectRenewalFundManage { | |||||
item.setCanPreDeclared(Boolean.TRUE); | item.setCanPreDeclared(Boolean.TRUE); | ||||
} | } | ||||
item.setApprovedAmount(w.getApprovalAmount()); | item.setApprovedAmount(w.getApprovalAmount()); | ||||
item.setAnnualPlanAmount(w.getAnnualPlanAmount()); | |||||
List<ProjectPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList()); | |||||
BigDecimal totalAnnualPaymentAmount = paymentPlans.stream() | |||||
.map(ProjectPaymentPlan::getAnnualPlanAmount) | |||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO); | |||||
item.setAnnualPlanAmount(totalAnnualPaymentAmount); | |||||
item.setPrePlanProjectId(w.getPrePlanProjectId()); | item.setPrePlanProjectId(w.getPrePlanProjectId()); | ||||
if (finalRenewalMap.containsKey(item.getId())) { | if (finalRenewalMap.containsKey(item.getId())) { | ||||
List<ProjectRenewalFundDeclaration> prfs = finalRenewalMap.get(item.getId()); | List<ProjectRenewalFundDeclaration> prfs = finalRenewalMap.get(item.getId()); | ||||
item.setAnnualAccumulateAmount(ProjectLibManage.computeAmount(w.getAnnualPlanAmount(), prfs)); | |||||
item.setAnnualAccumulateAmountList(ProjectLibManage.convertAccmulate(w, prfs)); | |||||
item.setAnnualAccumulateAmount(ProjectLibManage.computeAmount(totalAnnualPaymentAmount, prfs)); | |||||
item.setAnnualAccumulateAmountList(ProjectLibManage.convertAccmulate(w, totalAnnualPaymentAmount, prfs)); | |||||
} else { | } else { | ||||
item.setAnnualAccumulateAmount(w.getAnnualPlanAmount()); | |||||
item.setAnnualAccumulateAmountList(ProjectLibManage.convertAccmulate(w, Collections.emptyList())); | |||||
item.setAnnualAccumulateAmount(totalAnnualPaymentAmount); | |||||
item.setAnnualAccumulateAmountList(ProjectLibManage.convertAccmulate(w, totalAnnualPaymentAmount, Collections.emptyList())); | |||||
} | } | ||||
return item; | return item; | ||||
}); | }); | ||||
@@ -223,11 +236,18 @@ public class ProjectRenewalFundManage { | |||||
vo.setBuildOrgName(project.getBuildOrgName()); | vo.setBuildOrgName(project.getBuildOrgName()); | ||||
vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount()); | vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount()); | ||||
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | ||||
List<ProjectPaymentPlan> paymentPlans = projectPaymentPlanService.listByProjectId(project.getId()); | |||||
BigDecimal totalAnnualPaymentAmount = paymentPlans.stream() | |||||
.map(ProjectPaymentPlan::getAnnualPlanAmount) | |||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO); | |||||
annualAmounts.add(AnnualAmountVO.builder() | annualAmounts.add(AnnualAmountVO.builder() | ||||
.projectId(project.getId()) | .projectId(project.getId()) | ||||
.projectCode(project.getProjectCode()) | .projectCode(project.getProjectCode()) | ||||
.projectYear(project.getProjectYear()) | .projectYear(project.getProjectYear()) | ||||
.annualAmount(project.getAnnualPlanAmount()) | |||||
.annualAmount(totalAnnualPaymentAmount) | |||||
.build()); | .build()); | ||||
List<ProjectRenewalFundDeclaration> renewalDeclarations = projectRenewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) | List<ProjectRenewalFundDeclaration> renewalDeclarations = projectRenewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) | ||||
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getProjectId()) | .eq(ProjectRenewalFundDeclaration::getProjectId, vo.getProjectId()) | ||||
@@ -18,7 +18,6 @@ | |||||
approval_amount, | approval_amount, | ||||
stage, | stage, | ||||
status, | status, | ||||
annual_plan_amount, | |||||
biz_domain, | biz_domain, | ||||
inst_code, | inst_code, | ||||
is_higher_super_org, | is_higher_super_org, | ||||
@@ -41,7 +40,6 @@ | |||||
approval_amount, | approval_amount, | ||||
stage, | stage, | ||||
status, | status, | ||||
annual_plan_amount, | |||||
biz_domain, | biz_domain, | ||||
inst_code, | inst_code, | ||||
is_higher_super_org, | is_higher_super_org, | ||||
@@ -297,7 +295,6 @@ | |||||
approval_amount, | approval_amount, | ||||
stage, | stage, | ||||
status, | status, | ||||
annual_plan_amount, | |||||
biz_domain, | biz_domain, | ||||
inst_code, | inst_code, | ||||
is_higher_super_org, | is_higher_super_org, | ||||
@@ -320,7 +317,6 @@ | |||||
approval_amount, | approval_amount, | ||||
stage, | stage, | ||||
status, | status, | ||||
annual_plan_amount, | |||||
biz_domain, | biz_domain, | ||||
inst_code, | inst_code, | ||||
is_higher_super_org, | is_higher_super_org, | ||||
@@ -0,0 +1,16 @@ | |||||
package com.hz.pm.api.projectlib.mapper; | |||||
import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-02-21 | |||||
*/ | |||||
public interface ProjectPaymentPlanMapper extends BaseMapper<ProjectPaymentPlan> { | |||||
} |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.hz.pm.api.projectlib.mapper.ProjectPaymentPlanMapper"> | |||||
</mapper> |
@@ -21,7 +21,7 @@ import java.util.Map; | |||||
* @since 2023-02-03 | * @since 2023-02-03 | ||||
*/ | */ | ||||
@Data | @Data | ||||
@ApiModel(value = "NdProjectDto", description = "") | |||||
@ApiModel(value = "NdProjectDto") | |||||
public class ProjectDTO implements Serializable { | public class ProjectDTO implements Serializable { | ||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
@@ -176,28 +176,13 @@ public class ProjectDTO implements Serializable { | |||||
@ApiModelProperty("资金分配情况-第三方服务(万元)") | @ApiModelProperty("资金分配情况-第三方服务(万元)") | ||||
private BigDecimal thirdPartyAmount; | private BigDecimal thirdPartyAmount; | ||||
@ApiModelProperty("年度支付计划-年度支付计划(万元)") | |||||
private BigDecimal annualPlanAmount; | |||||
@ApiModelProperty("年度支付计划-自有金额(万元)") | |||||
private BigDecimal annualPlanHaveAmount; | |||||
@ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") | |||||
private BigDecimal annualPlanGovOwnFinanceAmount; | |||||
@ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") | |||||
private BigDecimal annualPlanGovSuperiorFinanceAmount; | |||||
@ApiModelProperty("年度支付计划-银行贷款(万元)") | |||||
private BigDecimal annualPlanBankLendingAmount; | |||||
@ApiModelProperty("年度支付计划-其它资金(万元)") | |||||
private BigDecimal annualPlanOtherAmount; | |||||
@ApiModelProperty("年度支付计划") | |||||
private List<ProjectPaymentPlanDTO> paymentPlanList; | |||||
@ApiModelProperty("立项批复资金(万元)") | @ApiModelProperty("立项批复资金(万元)") | ||||
private BigDecimal approvalAmount; | private BigDecimal approvalAmount; | ||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") | |||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") | |||||
private LocalDateTime annualPlanAddTime; | private LocalDateTime annualPlanAddTime; | ||||
@ApiModelProperty("核心业务-核心业务模块") | @ApiModelProperty("核心业务-核心业务模块") | ||||
@@ -326,7 +311,7 @@ public class ProjectDTO implements Serializable { | |||||
@ApiModelProperty("终验材料") | @ApiModelProperty("终验材料") | ||||
private String finalAcceptanceMaterials; | private String finalAcceptanceMaterials; | ||||
private Map<String,Object> dynamicForm; | |||||
private Map<String, Object> dynamicForm; | |||||
//P省级,M市级,C县(市、区)级,T乡镇(街道、办事处)级,V村(社区)级 | //P省级,M市级,C县(市、区)级,T乡镇(街道、办事处)级,V村(社区)级 | ||||
private String baseLowestLevel; | private String baseLowestLevel; | ||||
@@ -349,6 +334,9 @@ public class ProjectDTO implements Serializable { | |||||
@ApiModelProperty("可研报告") | @ApiModelProperty("可研报告") | ||||
private String baseResearchReportFile; | private String baseResearchReportFile; | ||||
@ApiModelProperty("可研批复文件") | |||||
private String baseResearchReportApprovalFile; | |||||
@ApiModelProperty("其他附件") | @ApiModelProperty("其他附件") | ||||
private String baseProjOtherFile; | private String baseProjOtherFile; | ||||
@@ -0,0 +1,37 @@ | |||||
package com.hz.pm.api.projectlib.model.dto; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.math.BigDecimal; | |||||
/** | |||||
* <p> | |||||
* ProjectPaymentPlanDTO | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 11:36 2024/2/21 | |||||
*/ | |||||
@Data | |||||
@ApiModel("年度支付计划") | |||||
public class ProjectPaymentPlanDTO { | |||||
@ApiModelProperty("支付年度") | |||||
private Integer paymentYear; | |||||
@ApiModelProperty("年度支付计划-年度支付计划(万元)") | |||||
private BigDecimal annualPlanAmount; | |||||
@ApiModelProperty("年度支付计划-自有金额(万元)") | |||||
private BigDecimal annualPlanHaveAmount; | |||||
@ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") | |||||
private BigDecimal annualPlanGovOwnFinanceAmount; | |||||
@ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") | |||||
private BigDecimal annualPlanGovSuperiorFinanceAmount; | |||||
} |
@@ -209,30 +209,6 @@ public class Project implements Serializable { | |||||
@Compare("资金分配情况-第三方服务") | @Compare("资金分配情况-第三方服务") | ||||
private BigDecimal thirdPartyAmount; | private BigDecimal thirdPartyAmount; | ||||
@ApiModelProperty("年度支付计划-年度支付计划(万元)") | |||||
@Compare("年度支付计划-年度支付计划") | |||||
private BigDecimal annualPlanAmount; | |||||
@ApiModelProperty("年度支付计划-自有金额(万元)") | |||||
@Compare("年度支付计划-自有金额") | |||||
private BigDecimal annualPlanHaveAmount; | |||||
@ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") | |||||
@Compare("年度支付计划-政府投资-本级财政资金") | |||||
private BigDecimal annualPlanGovOwnFinanceAmount; | |||||
@ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") | |||||
@Compare("年度支付计划-政府投资-上级补助资金") | |||||
private BigDecimal annualPlanGovSuperiorFinanceAmount; | |||||
@ApiModelProperty("年度支付计划-银行贷款(万元)") | |||||
@Compare("年度支付计划-银行贷款") | |||||
private BigDecimal annualPlanBankLendingAmount; | |||||
@ApiModelProperty("年度支付计划-其它资金(万元)") | |||||
@Compare("年度支付计划-其它资金") | |||||
private BigDecimal annualPlanOtherAmount; | |||||
@ApiModelProperty("立项批复总投资(万元)") | @ApiModelProperty("立项批复总投资(万元)") | ||||
@Compare("立项批复总投资") | @Compare("立项批复总投资") | ||||
private BigDecimal approvalAmount; | private BigDecimal approvalAmount; | ||||
@@ -535,6 +511,9 @@ public class Project implements Serializable { | |||||
@ApiModelProperty("可研报告") | @ApiModelProperty("可研报告") | ||||
private String baseResearchReportFile; | private String baseResearchReportFile; | ||||
@ApiModelProperty("可研批复文件") | |||||
private String baseResearchReportApprovalFile; | |||||
@ApiModelProperty("其他附件") | @ApiModelProperty("其他附件") | ||||
private String baseProjOtherFile; | private String baseProjOtherFile; | ||||
@@ -0,0 +1,50 @@ | |||||
package com.hz.pm.api.projectlib.model.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
import java.math.BigDecimal; | |||||
/** | |||||
* <p> | |||||
* 项目年度支付计划 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-02-21 | |||||
*/ | |||||
@Data | |||||
@TableName("ND_PROJECT_PAYMENT_PLAN") | |||||
@ApiModel(value = "NdProjectPaymentPlan对象") | |||||
public class ProjectPaymentPlan implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@TableId(value = "ID", type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty("支付年度") | |||||
private Integer paymentYear; | |||||
private BigDecimal annualPlanAmount; | |||||
private BigDecimal annualPlanHaveAmount; | |||||
private BigDecimal annualPlanGovOwnFinanceAmount; | |||||
private BigDecimal annualPlanGovSuperiorFinanceAmount; | |||||
private Long projectId; | |||||
@ApiModelProperty("项目编码") | |||||
private String projectCode; | |||||
@ApiModelProperty("项目版本") | |||||
private Integer projectVersion; | |||||
} |
@@ -5,6 +5,7 @@ import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | import lombok.Getter; | ||||
import lombok.NoArgsConstructor; | import lombok.NoArgsConstructor; | ||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
/** | /** | ||||
@@ -22,44 +23,50 @@ public enum ProjectStatusEnum { | |||||
/** | /** | ||||
* 项目阶段:未立项 | * 项目阶段:未立项 | ||||
*/ | */ | ||||
NOT_APPROVED(10000, "未立项",null), | |||||
UNDER_INTERNAL_AUDIT(10001, "单位内部审核中",null), | |||||
UNDER_INTERNAL_AUDIT_NOT_PASS(10002, "单位内部审核不通过",null), | |||||
PENDING_PREQUALIFICATION(10003, "待预审",null), | |||||
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS(10004, "省级部门联审中",null), | |||||
NOT_APPROVED(10000, "未立项", null), | |||||
UNDER_INTERNAL_AUDIT(10001, "单位内部审核中", null), | |||||
UNDER_INTERNAL_AUDIT_NOT_PASS(10002, "单位内部审核不通过", null), | |||||
PENDING_PREQUALIFICATION(10003, "待预审", null), | |||||
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS(10004, "省级部门联审中", null), | |||||
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS(10018, "省级部门联审通过",null), | |||||
THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED(10005, "省级部门联审不通过",null), | |||||
PRE_APPLYING(10006, "预审中",null), | |||||
PREQUALIFICATION_FAILED(10007, "预审不通过",null), | |||||
DEPARTMENT_JOINT_REVIEW(10008, "部门联审中",null), | |||||
DEPARTMENT_JOINT_REVIEW_FAILED(10009, "部门联审不通过",null), | |||||
IN_THE_ANNUAL_PLAN(10010, "年度计划中",null), | |||||
BE_SUSPENDED(10011, "被暂缓",null), | |||||
SCHEME_UNDER_REVIEW(10012, "方案评审中",GovProjectStatusEnum.APPROVAL), | |||||
SCHEME_REVIEW_FAILED(10013, "方案评审不通过",null), | |||||
TO_BE_APPROVED(10014, "待立项批复",GovProjectStatusEnum.PENDING), | |||||
TO_BE_DECLARED(10015, "待申报",null), | |||||
PLAN_TO_BE_DECLARED(10016, "方案待申报",null), | |||||
PENDING_PREQUALIFICATION_CHOICE(10017, "待预审选择态",null), | |||||
PREQUALIFICATION_WITHDRAW_CHOICE(10019, "预审中撤回选择态",null), | |||||
APPROVED_AFTER_CHOICE(10020, "立项批复后选择态",null), | |||||
TO_BE_APP_REGISTER(10021, "待应用注册",null), | |||||
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS(10018, "省级部门联审通过", null), | |||||
THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED(10005, "省级部门联审不通过", null), | |||||
PRE_APPLYING(10006, "预审中", null), | |||||
PREQUALIFICATION_FAILED(10007, "预审不通过", null), | |||||
DEPARTMENT_JOINT_REVIEW(10008, "部门联审中", null), | |||||
DEPARTMENT_JOINT_REVIEW_FAILED(10009, "部门联审不通过", null), | |||||
IN_THE_ANNUAL_PLAN(10010, "年度计划中", null), | |||||
BE_SUSPENDED(10011, "被暂缓", null), | |||||
SCHEME_UNDER_REVIEW(10012, "方案评审中", GovProjectStatusEnum.APPROVAL), | |||||
SCHEME_REVIEW_FAILED(10013, "方案评审不通过", null), | |||||
TO_BE_APPROVED(10014, "待立项批复", GovProjectStatusEnum.PENDING), | |||||
TO_BE_DECLARED(10015, "待申报", null), | |||||
PLAN_TO_BE_DECLARED(10016, "方案待申报", null), | |||||
PENDING_PREQUALIFICATION_CHOICE(10017, "待预审选择态", null), | |||||
PREQUALIFICATION_WITHDRAW_CHOICE(10019, "预审中撤回选择态", null), | |||||
APPROVED_AFTER_CHOICE(10020, "立项批复后选择态", null), | |||||
TO_BE_APP_REGISTER(10021, "待应用注册", null), | |||||
/** | |||||
* 信产项目备案 | |||||
*/ | |||||
DECLARED_APPROVED_TO_BE_RECORD(10022, "待立项备案", null), | |||||
DECLARED_APPROVED_RECORD_AUDITING(10022, "立项备案审核中", null), | |||||
DECLARED_APPROVED_RECORD_FAILED(10023, "立项备案审核不通过", null), | |||||
/** | /** | ||||
* 项目阶段:已立项 | * 项目阶段:已立项 | ||||
*/ | */ | ||||
PROJECT_APPROVED(20000, "已立项",null), | |||||
TO_BE_PURCHASED(20001, "待采购",GovProjectStatusEnum.APPROVED), | |||||
UNDER_CONSTRUCTION(20002, "建设中",null), | |||||
TO_BE_FINALLY_INSPECTED(20003, "待终验",GovProjectStatusEnum.HAS_PRE_INS), | |||||
FINAL_ACCEPTANCE_IS_UNDER_REVIEW(20004, "终验审核中",null), | |||||
FINAL_ACCEPTANCE_REVIEW_FAILED(20005, "终验审核不通过",null), | |||||
OPERATION(20006, "待开工",GovProjectStatusEnum.PURCHASED), | |||||
PROJECT_APPROVED(20000, "已立项", null), | |||||
TO_BE_PURCHASED(20001, "待采购", GovProjectStatusEnum.APPROVED), | |||||
UNDER_CONSTRUCTION(20002, "建设中", null), | |||||
TO_BE_FINALLY_INSPECTED(20003, "待终验", GovProjectStatusEnum.HAS_PRE_INS), | |||||
FINAL_ACCEPTANCE_IS_UNDER_REVIEW(20004, "终验审核中", null), | |||||
FINAL_ACCEPTANCE_REVIEW_FAILED(20005, "终验审核不通过", null), | |||||
OPERATION(20006, "待开工", GovProjectStatusEnum.PURCHASED), | |||||
/** | /** | ||||
* 项目阶段:已归档 | * 项目阶段:已归档 | ||||
*/ | */ | ||||
ARCHIVED(30000, "已归档",null), | |||||
ACCEPTED(30001, "已验收",GovProjectStatusEnum.HAS_FINAL_INS); | |||||
ARCHIVED(30000, "已归档", null), | |||||
ACCEPTED(30001, "已验收", GovProjectStatusEnum.HAS_FINAL_INS); | |||||
private Integer code; | private Integer code; | ||||
private String desc; | private String desc; | ||||
@@ -35,7 +35,7 @@ public class DeclaredProjectListVO { | |||||
@ApiModelProperty("创建时间") | @ApiModelProperty("创建时间") | ||||
private LocalDateTime createTime; | private LocalDateTime createTime; | ||||
@ApiModelProperty("项目名称") | |||||
@ApiModelProperty("项目编码") | |||||
private String projectCode; | private String projectCode; | ||||
@ApiModelProperty("ID") | @ApiModelProperty("ID") | ||||
@@ -402,7 +402,7 @@ public class ProjectDetailVO { | |||||
private BigDecimal contractAmount; | private BigDecimal contractAmount; | ||||
@ApiModelProperty("合同信息") | @ApiModelProperty("合同信息") | ||||
private ContractVO contract; | |||||
private List<ContractVO> contract; | |||||
@ApiModelProperty("采购信息") | @ApiModelProperty("采购信息") | ||||
private List<PurchaseVO> purchases; | private List<PurchaseVO> purchases; | ||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectApplication; | import com.hz.pm.api.projectlib.model.entity.ProjectApplication; | ||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan; | |||||
import java.util.List; | import java.util.List; | ||||
@@ -26,4 +27,10 @@ public interface IProjectApplicationService extends IService<ProjectApplication> | |||||
.eq(ProjectApplication::getProjectId, projectId)); | .eq(ProjectApplication::getProjectId, projectId)); | ||||
} | } | ||||
default void remove(String projectCode, Integer projectVersion) { | |||||
remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, projectCode) | |||||
.eq(ProjectApplication::getProjectVersion, projectVersion)); | |||||
} | |||||
} | } |
@@ -0,0 +1,44 @@ | |||||
package com.hz.pm.api.projectlib.service; | |||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan; | |||||
import com.ningdatech.basic.util.CollUtils; | |||||
import java.util.Collection; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
/** | |||||
* <p> | |||||
* 服务类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-02-21 | |||||
*/ | |||||
public interface IProjectPaymentPlanService extends IService<ProjectPaymentPlan> { | |||||
default void remove(String projectCode, Integer projectVersion) { | |||||
remove(Wrappers.lambdaQuery(ProjectPaymentPlan.class) | |||||
.eq(ProjectPaymentPlan::getProjectCode, projectCode) | |||||
.eq(ProjectPaymentPlan::getProjectVersion, projectVersion)); | |||||
} | |||||
default Map<Long, List<ProjectPaymentPlan>> listByProjectIds(Collection<Long> projectIds) { | |||||
LambdaQueryWrapper<ProjectPaymentPlan> query = Wrappers.lambdaQuery(ProjectPaymentPlan.class) | |||||
.in(ProjectPaymentPlan::getProjectId, projectIds) | |||||
.orderByAsc(ProjectPaymentPlan::getPaymentYear); | |||||
return CollUtils.group(list(query), ProjectPaymentPlan::getProjectId); | |||||
} | |||||
default List<ProjectPaymentPlan> listByProjectId(Long projectId) { | |||||
LambdaQueryWrapper<ProjectPaymentPlan> query = Wrappers.lambdaQuery(ProjectPaymentPlan.class) | |||||
.eq(ProjectPaymentPlan::getProjectId, projectId) | |||||
.orderByAsc(ProjectPaymentPlan::getPaymentYear); | |||||
return list(query); | |||||
} | |||||
} |
@@ -0,0 +1,20 @@ | |||||
package com.hz.pm.api.projectlib.service.impl; | |||||
import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan; | |||||
import com.hz.pm.api.projectlib.mapper.ProjectPaymentPlanMapper; | |||||
import com.hz.pm.api.projectlib.service.IProjectPaymentPlanService; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import org.springframework.stereotype.Service; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-02-21 | |||||
*/ | |||||
@Service | |||||
public class ProjectPaymentPlanServiceImpl extends ServiceImpl<ProjectPaymentPlanMapper, ProjectPaymentPlan> implements IProjectPaymentPlanService { | |||||
} |
@@ -28,7 +28,7 @@ import java.time.Duration; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.CC_MSG_TEMPLATE; | |||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.CC_MSG_TEMPLATE; | |||||
/** | /** | ||||
* 抄送事件 事件监听 | * 抄送事件 事件监听 | ||||
@@ -40,8 +40,8 @@ import java.util.List; | |||||
import java.util.Objects; | import java.util.Objects; | ||||
import java.util.Set; | import java.util.Set; | ||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.PASS_MSG_TEMPLATE; | |||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.PASS_MSG_TEMPLATE2; | |||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.PASS_MSG_TEMPLATE; | |||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.PASS_MSG_TEMPLATE2; | |||||
/** | /** | ||||
* 工作流开始 结束监听 自动审批的话 会漏掉 调用状态机 | * 工作流开始 结束监听 自动审批的话 会漏掉 调用状态机 | ||||
@@ -55,7 +55,7 @@ import java.util.Map; | |||||
import java.util.Objects; | import java.util.Objects; | ||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.AUDIT_WORK_TITLE; | |||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.AUDIT_WORK_TITLE; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -7,13 +7,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Assert; | 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.ningdatech.basic.function.VUtils; | |||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.hz.pm.api.sys.model.entity.Notify; | import com.hz.pm.api.sys.model.entity.Notify; | ||||
import com.hz.pm.api.sys.model.req.NotifyListReq; | import com.hz.pm.api.sys.model.req.NotifyListReq; | ||||
import com.hz.pm.api.sys.model.vo.NotifyVO; | import com.hz.pm.api.sys.model.vo.NotifyVO; | ||||
import com.hz.pm.api.sys.service.INotifyService; | import com.hz.pm.api.sys.service.INotifyService; | ||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConstant; | |||||
import com.hz.pm.api.todocenter.constant.WorkNoticeConst; | |||||
import com.hz.pm.api.user.util.LoginUserUtil; | import com.hz.pm.api.user.util.LoginUserUtil; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
@@ -57,9 +56,9 @@ public class NotifyManage { | |||||
String extraInfo = n.getExtraInfo(); | String extraInfo = n.getExtraInfo(); | ||||
if (StringUtils.isNotBlank(extraInfo)) { | if (StringUtils.isNotBlank(extraInfo)) { | ||||
JSONObject jsonObject = JSON.parseObject(extraInfo); | JSONObject jsonObject = JSON.parseObject(extraInfo); | ||||
Long projectId = jsonObject.getLong(WorkNoticeConstant.PROJECT_ID); | |||||
String instanceId = jsonObject.getString(WorkNoticeConstant.INSTANCE_ID); | |||||
Long meetingId = jsonObject.getLong(WorkNoticeConstant.MEETING_ID); | |||||
Long projectId = jsonObject.getLong(WorkNoticeConst.PROJECT_ID); | |||||
String instanceId = jsonObject.getString(WorkNoticeConst.INSTANCE_ID); | |||||
Long meetingId = jsonObject.getLong(WorkNoticeConst.MEETING_ID); | |||||
notifyVo.setProjectId(projectId); | notifyVo.setProjectId(projectId); | ||||
notifyVo.setInstanceId(instanceId); | notifyVo.setInstanceId(instanceId); | ||||
notifyVo.setMeetingId(meetingId); | notifyVo.setMeetingId(meetingId); | ||||
@@ -4,9 +4,9 @@ package com.hz.pm.api.todocenter.constant; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/01 14:56 | * @since 2023/02/01 14:56 | ||||
*/ | */ | ||||
public class WorkNoticeConstant { | |||||
public class WorkNoticeConst { | |||||
private WorkNoticeConstant() { | |||||
private WorkNoticeConst() { | |||||
} | } | ||||
public static final String PASS_MSG_TEMPLATE = "【%s】的【%s】需要您审核。"; | public static final String PASS_MSG_TEMPLATE = "【%s】的【%s】需要您审核。"; |
@@ -16,6 +16,7 @@ import com.hz.pm.api.filemanage.service.INdProjectApplyBorrowService; | |||||
import com.hz.pm.api.projectdeclared.manage.DeclaredProjectManage; | import com.hz.pm.api.projectdeclared.manage.DeclaredProjectManage; | ||||
import com.hz.pm.api.projectdeclared.model.dto.ProjectDraftSaveDTO; | import com.hz.pm.api.projectdeclared.model.dto.ProjectDraftSaveDTO; | ||||
import com.hz.pm.api.projectdeclared.model.entity.ProjectConstructionSuggestions; | import com.hz.pm.api.projectdeclared.model.entity.ProjectConstructionSuggestions; | ||||
import com.hz.pm.api.projectdeclared.model.enumerization.ProjectDraftTypeEnum; | |||||
import com.hz.pm.api.projectdeclared.service.IConstructionSuggestionsService; | import com.hz.pm.api.projectdeclared.service.IConstructionSuggestionsService; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectApplicationDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectApplicationDTO; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | ||||
@@ -25,10 +26,7 @@ import com.hz.pm.api.projectlib.model.entity.ProjectDelayApply; | |||||
import com.hz.pm.api.projectlib.model.entity.ProjectInst; | import com.hz.pm.api.projectlib.model.entity.ProjectInst; | ||||
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; | import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; | ||||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | ||||
import com.hz.pm.api.projectlib.service.INdProjectDelayApplyService; | |||||
import com.hz.pm.api.projectlib.service.IProjectApplicationService; | |||||
import com.hz.pm.api.projectlib.service.IProjectInstService; | |||||
import com.hz.pm.api.projectlib.service.IProjectService; | |||||
import com.hz.pm.api.projectlib.service.*; | |||||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | import com.hz.pm.api.staging.enums.MsgTypeEnum; | ||||
import com.hz.pm.api.staging.service.IProjectStagingService; | import com.hz.pm.api.staging.service.IProjectStagingService; | ||||
import com.hz.pm.api.sys.manage.NoticeManage; | import com.hz.pm.api.sys.manage.NoticeManage; | ||||
@@ -60,7 +58,7 @@ import java.time.format.DateTimeFormatter; | |||||
import java.util.*; | import java.util.*; | ||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.*; | |||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.*; | |||||
/** | /** | ||||
* @Classname HandlerManage | * @Classname HandlerManage | ||||
@@ -329,7 +327,7 @@ public class HandlerManage { | |||||
}); | }); | ||||
projectInfo.setDynamicForm(dynamicMap); | projectInfo.setDynamicForm(dynamicMap); | ||||
draftSaveDto.setProjectInfo(projectInfo); | draftSaveDto.setProjectInfo(projectInfo); | ||||
declaredProjectManage.saveToDraft(draftSaveDto); | |||||
declaredProjectManage.saveToDraft(draftSaveDto, ProjectDraftTypeEnum.PROJECT_DECLARED.getCode()); | |||||
} | } | ||||
/** | /** | ||||
@@ -1414,8 +1414,8 @@ public class TodoCenterManage { | |||||
paramsMap.put("cloudType", cloudTypeName); | paramsMap.put("cloudType", cloudTypeName); | ||||
} | } | ||||
// 获取本年计划投资金额 | // 获取本年计划投资金额 | ||||
BigDecimal yearPlanInvest = project.getAnnualPlanAmount(); | |||||
paramsMap.put("yearPlanInvest", yearPlanInvest); | |||||
// BigDecimal yearPlanInvest = project.getAnnualPlanAmount(); | |||||
paramsMap.put("yearPlanInvest", BigDecimal.ZERO); | |||||
// 根据地区编码获取当地大数据局(中心)的名称 | // 根据地区编码获取当地大数据局(中心)的名称 | ||||
paramsMap.put("bigDataBureauName", null); | paramsMap.put("bigDataBureauName", null); | ||||
// 备注模块如果为空 | // 备注模块如果为空 | ||||
@@ -51,9 +51,9 @@ spring: | |||||
# 是客户端等待连接池连接的最大毫秒数 | # 是客户端等待连接池连接的最大毫秒数 | ||||
connection-timeout: 30000 | connection-timeout: 30000 | ||||
# 是允许连接在连接池中空闲的最长时间 | # 是允许连接在连接池中空闲的最长时间 | ||||
minimum-idle: 5 | |||||
minimum-idle: 10 | |||||
# 配置最大池大小 | # 配置最大池大小 | ||||
maximum-pool-size: 300 | |||||
maximum-pool-size: 20 | |||||
# 是允许连接在连接池中空闲的最长时间(以毫秒为单位) | # 是允许连接在连接池中空闲的最长时间(以毫秒为单位) | ||||
idle-timeout: 60000 | idle-timeout: 60000 | ||||
# 池中连接关闭后的最长生命周期(以毫秒为单位) | # 池中连接关闭后的最长生命周期(以毫秒为单位) | ||||
@@ -61,7 +61,7 @@ spring: | |||||
# 配置从池返回的连接的默认自动提交行为。默认值为true。 | # 配置从池返回的连接的默认自动提交行为。默认值为true。 | ||||
auto-commit: true | auto-commit: true | ||||
# 开启连接监测泄露 | # 开启连接监测泄露 | ||||
leak-detection-threshold: 5000 | |||||
leak-detection-threshold: 6000 | |||||
# 测试连接数据库 | # 测试连接数据库 | ||||
connection-test-query: SELECT 1 | connection-test-query: SELECT 1 | ||||
#设置上传 单个文件的大小 | #设置上传 单个文件的大小 | ||||
@@ -253,8 +253,8 @@ mh: | |||||
api-host: https://hzszxc.hzswb.cn:8443/test/mh-gateway/auth-single | api-host: https://hzszxc.hzswb.cn:8443/test/mh-gateway/auth-single | ||||
expert-qr-code-url: https://jiema.wwei.cn/uploads/2023/12/28/658d7a3f15f06.jpg | expert-qr-code-url: https://jiema.wwei.cn/uploads/2023/12/28/658d7a3f15f06.jpg | ||||
file: | file: | ||||
down-url: https://weixin.hzszxc.hzswb.cn:8443/mh-gateway/oss/oss/previewFileLogin | |||||
detail-url: https://weixin.hzszxc.hzswb.cn:8443/mh-gateway/oss/ossfile/getFileInfoList | |||||
down-url: https://weixin.hzszxc.hzswb.cn:8443/test/mh-gateway/oss/oss/previewFileLogin | |||||
detail-url: https://weixin.hzszxc.hzswb.cn:8443/test/mh-gateway/oss/ossfile/getFileInfoList | |||||
auth-code: | auth-code: | ||||
secret-key: nqkmzqojg5j4eiypr3rb8s7nb4noa8b2 | secret-key: nqkmzqojg5j4eiypr3rb8s7nb4noa8b2 | ||||
agent-login: | agent-login: | ||||
@@ -1,19 +1,13 @@ | |||||
package com.hz.pm.api.irs; | package com.hz.pm.api.irs; | ||||
import com.alibaba.fastjson.JSONObject; | |||||
import com.google.common.collect.Maps; | import com.google.common.collect.Maps; | ||||
import com.ningdatech.irs.service.IRefreshTokenService; | import com.ningdatech.irs.service.IRefreshTokenService; | ||||
import com.hz.pm.api.AppTests; | |||||
import com.hz.pm.api.common.util.CryptUtils; | |||||
import com.hz.pm.api.common.util.HttpUtil; | import com.hz.pm.api.common.util.HttpUtil; | ||||
import com.hz.pm.api.common.util.Md5Utils; | |||||
import com.hz.pm.api.common.util.RefreshKeyUtil; | |||||
import com.hz.pm.api.gov.model.req.ProjectPushReq; | |||||
import com.hz.pm.api.common.util.Md5Util; | |||||
import com.hz.pm.api.irs.model.dto.ForwardDTO; | import com.hz.pm.api.irs.model.dto.ForwardDTO; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.springframework.beans.factory.annotation.Value; | |||||
import org.springframework.http.*; | import org.springframework.http.*; | ||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; | import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; | ||||
import org.springframework.web.client.RestTemplate; | import org.springframework.web.client.RestTemplate; | ||||
@@ -87,7 +81,7 @@ public class CoreTest {//extends AppTests | |||||
dto.setAppKey(appKey); | dto.setAppKey(appKey); | ||||
dto.setSecret(secret); | dto.setSecret(secret); | ||||
dto.setRequestTime(requestTime); | dto.setRequestTime(requestTime); | ||||
String sign = Md5Utils.hash(appKey + secret + requestTime); | |||||
String sign = Md5Util.hash(appKey + secret + requestTime); | |||||
dto.setSign(sign); | dto.setSign(sign); | ||||
HttpHeaders headers = new HttpHeaders(); | HttpHeaders headers = new HttpHeaders(); | ||||
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); | MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); | ||||
@@ -38,7 +38,7 @@ import java.io.InputStream; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.concurrent.*; | import java.util.concurrent.*; | ||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.PASS_MSG_TEMPLATE; | |||||
import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.PASS_MSG_TEMPLATE; | |||||
/** | /** | ||||
* 待办中心测试 | * 待办中心测试 | ||||
@@ -55,7 +55,7 @@ public class CodeGen { | |||||
} | } | ||||
public static void main(String[] args) { | public static void main(String[] args) { | ||||
generate("WendyYang", "projectlib", PATH_YYD, "mh_project_schema_target_data"); | |||||
generate("WendyYang", "projectlib", PATH_YYD, "nd_project_payment_plan"); | |||||
} | } | ||||
} | } |