@@ -56,7 +56,7 @@ public class GeneratorCodeKingbaseConfig { | |||
} | |||
public static void main(String[] args) { | |||
generate("Lierbao", "signature", PATH_LXX, "nd_company_signature"); | |||
generate("Lierbao", "organization", PATH_LXX, "ding_employee_info"); | |||
} | |||
} |
@@ -6,6 +6,7 @@ import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
/** | |||
* 待办中心待我处理项目列表导出实体 | |||
@@ -20,25 +21,6 @@ import java.io.Serializable; | |||
public class ExcelExportDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
//@ExcelProperty("项目名称") | |||
//private String projectName; | |||
// | |||
//@ExcelProperty("申报单位") | |||
//private String buildUnitName; | |||
// | |||
//@ExcelProperty("申报金额") | |||
//private Integer declareAmount; | |||
// | |||
//@ExcelProperty("预算年度") | |||
//private Integer projectYear; | |||
// | |||
//@ExcelProperty("流程状态") | |||
//private String processStatusName; | |||
// | |||
//@ExcelProperty("发起时间") | |||
//@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") | |||
//private LocalDateTime processLaunchTime; | |||
@ExcelProperty("项目ID") | |||
private Long id; | |||
@@ -91,128 +73,128 @@ public class ExcelExportDTO implements Serializable { | |||
private Integer isFirst; | |||
@ExcelProperty("关联应用") | |||
private Boolean includeApplication; | |||
private String relatedExistsApplication; | |||
@ExcelProperty("关联应用IRS编码") | |||
private Boolean includeApplicationIRSCode; | |||
private String relatedExistsApplicationCode; | |||
@ExcelProperty("申报金额(万元)") | |||
private Boolean declareAmount; | |||
private BigDecimal declareAmount; | |||
@ExcelProperty("批复金额") | |||
private Boolean approvedTotalInvestmentIncrease; | |||
private BigDecimal approvedTotalInvestmentIncrease; | |||
@ExcelProperty("预算来源") | |||
private Boolean budgetSource; | |||
private String budgetSource; | |||
@ExcelProperty("预算年度") | |||
private Boolean budgetYear; | |||
private Integer projectYear; | |||
@ExcelProperty("项目简介") | |||
private Boolean projectIntroduction; | |||
private String projectIntroduction; | |||
@ExcelProperty("立项依据") | |||
private Boolean buildBasis; | |||
private String buildBasis; | |||
@ExcelProperty("建设层级") | |||
private Boolean buildLevel; | |||
private Integer buildLevel; | |||
@ExcelProperty("发改编码") | |||
private Boolean developCode; | |||
private String developCode; | |||
@ExcelProperty("财政编码") | |||
private Boolean financialCode; | |||
private String financialCode; | |||
@ExcelProperty("信息是否有效") | |||
private Boolean informationValidity; | |||
@ExcelProperty("是否数字化改革项目") | |||
private Boolean isDigitalReform; | |||
private Integer isDigitalReform; | |||
@ExcelProperty("综合应用领域") | |||
private Boolean bizDomain; | |||
private String bizDomain; | |||
@ExcelProperty("是否上云") | |||
private Boolean isCloud; | |||
private Integer isCloud; | |||
@ExcelProperty("云类型") | |||
private Boolean cloudType; | |||
private String cloudType; | |||
@ExcelProperty("四大体系") | |||
private Boolean fourSystems; | |||
private Integer fourSystems; | |||
@ExcelProperty("是否临时增补") | |||
private Boolean isTemporaryAugment; | |||
private Integer isTemporaryAugment; | |||
@ExcelProperty("等保级别") | |||
private Boolean protectionLevel; | |||
private Integer protectionLevel; | |||
@ExcelProperty("是否密评 0:否 1:是") | |||
private Boolean isSecretComments; | |||
private Integer isSecretComments; | |||
@ExcelProperty("业务编号") | |||
private Boolean businessNumber; | |||
private String businessNumber; | |||
@ExcelProperty("业务名称") | |||
private Boolean businessName; | |||
private String businessName; | |||
@ExcelProperty("单位名称") | |||
private Boolean unitName; | |||
private String orgName; | |||
@ExcelProperty("软件开发(万元)") | |||
private Boolean softwareDevelopmentAmount; | |||
private BigDecimal softwareDevelopmentAmount; | |||
@ExcelProperty("云资源、硬件购置(万元)") | |||
private Boolean cloudHardwarePurchaseAmount; | |||
private BigDecimal cloudHardwarePurchaseAmount; | |||
@ExcelProperty("第三方服务(万元)") | |||
private Boolean thirdPartyAmount; | |||
private BigDecimal thirdPartyAmount; | |||
@ExcelProperty("投入项") | |||
private Boolean safetyInputTitle; | |||
private String safetyInputTitle; | |||
@ExcelProperty("内容描述") | |||
private Boolean safetyInputDescribe; | |||
private String safetyInputDescribe; | |||
@ExcelProperty("金额(万元)") | |||
private Boolean safetyInputAmount; | |||
private BigDecimal safetyInputAmount; | |||
@ExcelProperty("年度支付金额(万元)") | |||
private Boolean annualPlanAmount; | |||
private BigDecimal annualPlanAmount; | |||
@ExcelProperty("自有资金(万元)") | |||
private Boolean annualPlanHaveAmount; | |||
private BigDecimal annualPlanHaveAmount; | |||
@ExcelProperty("政府投资-本级财政资金(万元)") | |||
private Boolean declareGovernmentOwnFinanceAmount; | |||
private BigDecimal declareGovOwnFinanceAmount; | |||
@ExcelProperty("政府投资-上级补助资金(万元)") | |||
private Boolean declareGovernmentSuperiorFinanceAmount; | |||
private BigDecimal declareGovSuperiorFinanceAmount; | |||
@ExcelProperty("银行贷款(万元)") | |||
private Boolean declareBankLendingAmount; | |||
private BigDecimal declareBankLendingAmount; | |||
@ExcelProperty("其它资金(万元)") | |||
private Boolean declareOtherAmount; | |||
private BigDecimal declareOtherAmount; | |||
@ExcelProperty("第一季度") | |||
private Boolean engineeringSpeedOne; | |||
private String engineeringSpeedOne; | |||
@ExcelProperty("第二季度") | |||
private Boolean engineeringSpeedTwo; | |||
private String engineeringSpeedTwo; | |||
@ExcelProperty("第三季度") | |||
private Boolean engineeringSpeedThree; | |||
private String engineeringSpeedThree; | |||
@ExcelProperty("第四季度") | |||
private Boolean engineeringSpeedFour; | |||
private String engineeringSpeedFour; | |||
@ExcelProperty("初步方案") | |||
private Boolean preliminaryPlanFile; | |||
private String preliminaryPlanFile; | |||
@ExcelProperty("附件-佐证材料") | |||
private Boolean supportingMaterialsFile; | |||
private String supportingMaterialsFile; | |||
@ExcelProperty("备注") | |||
private Boolean projectRemarks; | |||
private String projectRemarks; | |||
} |
@@ -4,7 +4,7 @@ import com.ningdatech.pmapi.common.constant.StateMachineHeaderNameConstants; | |||
import com.ningdatech.pmapi.common.statemachine.builder.ProjectDeclareStateMachineBuilder; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.messaging.Message; | |||
@@ -25,153 +25,169 @@ public class ProjectDeclareAction { | |||
private static final String PROJECT_DECLARE = StateMachineHeaderNameConstants.PROJECT_DECLARE; | |||
@OnTransition(source = "UNDER_INTERNAL_AUDIT",target = "PENDING_PREQUALIFICATION") | |||
public void UNDER_INTERNAL_PASS(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION") | |||
public void UNDER_INTERNAL_PASS(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | |||
} | |||
@OnTransition(source = "UNDER_INTERNAL_AUDIT",target = "UNDER_INTERNAL_AUDIT_NOT_PASS") | |||
public void UNDER_INTERNAL_REJECT(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "UNDER_INTERNAL_AUDIT_NOT_PASS") | |||
public void UNDER_INTERNAL_REJECT(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode()); | |||
} | |||
@OnTransition(source = "UNDER_INTERNAL_AUDIT",target = "TO_BE_DECLARED") | |||
public void UNDER_INTERNAL_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "TO_BE_DECLARED") | |||
public void UNDER_INTERNAL_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode()); | |||
} | |||
@OnTransition(source = "PENDING_PREQUALIFICATION",target = "PENDING_PREQUALIFICATION_CHOICE") | |||
public void PRELIMINARY_REVIEW_DECLARE(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "PENDING_PREQUALIFICATION", target = "PENDING_PREQUALIFICATION_CHOICE") | |||
public void PRELIMINARY_REVIEW_DECLARE(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); | |||
} | |||
@OnTransition(source = "PENDING_PREQUALIFICATION",target = "UNDER_INTERNAL_AUDIT") | |||
public void PENDING_PREQUALIFICATION_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "PENDING_PREQUALIFICATION", target = "UNDER_INTERNAL_AUDIT") | |||
public void PENDING_PREQUALIFICATION_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | |||
} | |||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS",target = "PRE_APPLYING") | |||
public void PROVINCIAL_DEPARTMENT_REVIEW_PASS(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "PRE_APPLYING") | |||
public void PROVINCIAL_DEPARTMENT_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | |||
} | |||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS",target = "THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED") | |||
public void PROVINCIAL_DEPARTMENT_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED") | |||
public void PROVINCIAL_DEPARTMENT_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()); | |||
} | |||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS",target = "PENDING_PREQUALIFICATION") | |||
public void JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "PENDING_PREQUALIFICATION") | |||
public void JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | |||
} | |||
@OnTransition(source = "PRE_APPLYING",target = "DEPARTMENT_JOINT_REVIEW") | |||
public void PRELIMINARY_REVIEW_PASS(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "PRE_APPLYING", target = "DEPARTMENT_JOINT_REVIEW") | |||
public void PRELIMINARY_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()); | |||
} | |||
@OnTransition(source = "PRE_APPLYING",target = "PREQUALIFICATION_FAILED") | |||
public void PRELIMINARY_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_FAILED") | |||
public void PRELIMINARY_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode()); | |||
} | |||
@OnTransition(source = "PRE_APPLYING",target = "PENDING_PREQUALIFICATION_CHOICE") | |||
public void PRE_APPLYING_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "PRE_APPLYING", target = "PENDING_PREQUALIFICATION_CHOICE") | |||
public void PRE_APPLYING_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); | |||
} | |||
@OnTransition(source = "DEPARTMENT_JOINT_REVIEW",target = "IN_THE_ANNUAL_PLAN") | |||
public void DEPARTMENT_UNITED_REVIEW_PASS(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "IN_THE_ANNUAL_PLAN") | |||
public void DEPARTMENT_UNITED_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); | |||
} | |||
@OnTransition(source = "DEPARTMENT_JOINT_REVIEW",target = "DEPARTMENT_JOINT_REVIEW_FAILED") | |||
public void DEPARTMENT_UNITED_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "DEPARTMENT_JOINT_REVIEW_FAILED") | |||
public void DEPARTMENT_UNITED_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED.getCode()); | |||
} | |||
@OnTransition(source = "DEPARTMENT_JOINT_REVIEW",target = "PRE_APPLYING") | |||
public void DEPARTMENT_JOINT_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "PRE_APPLYING") | |||
public void DEPARTMENT_JOINT_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | |||
} | |||
@OnTransition(source = "IN_THE_ANNUAL_PLAN",target = "PLAN_TO_BE_DECLARED") | |||
public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "PLAN_TO_BE_DECLARED") | |||
public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | |||
} | |||
@OnTransition(source = "IN_THE_ANNUAL_PLAN",target = "BE_SUSPENDED") | |||
public void ANNUAL_PLAN_SUSPEND(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "BE_SUSPENDED") | |||
public void ANNUAL_PLAN_SUSPEND(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.BE_SUSPENDED.getCode()); | |||
} | |||
@OnTransition(source = "IN_THE_ANNUAL_PLAN",target = "DEPARTMENT_JOINT_REVIEW") | |||
public void IN_THE_ANNUAL_PLAN_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "DEPARTMENT_JOINT_REVIEW") | |||
public void IN_THE_ANNUAL_PLAN_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()); | |||
} | |||
@OnTransition(source = "PLAN_TO_BE_DECLARED",target = "SCHEME_UNDER_REVIEW") | |||
public void DECLARE_PLAN(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "PLAN_TO_BE_DECLARED", target = "SCHEME_UNDER_REVIEW") | |||
public void DECLARE_PLAN(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | |||
} | |||
@OnTransition(source = "PLAN_TO_BE_DECLARED",target = "IN_THE_ANNUAL_PLAN") | |||
public void PLAN_TO_DECLARE_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "PLAN_TO_BE_DECLARED", target = "IN_THE_ANNUAL_PLAN") | |||
public void PLAN_TO_DECLARE_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); | |||
} | |||
@OnTransition(source = "SCHEME_UNDER_REVIEW",target = "TO_BE_APPROVED") | |||
public void PLAN_REVIEW_PASS(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED") | |||
public void PLAN_REVIEW_PASS(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode()); | |||
} | |||
@OnTransition(source = "SCHEME_UNDER_REVIEW",target = "SCHEME_REVIEW_FAILED") | |||
public void PLAN_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "SCHEME_REVIEW_FAILED") | |||
public void PLAN_REVIEW_REJECT(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode()); | |||
} | |||
@OnTransition(source = "SCHEME_UNDER_REVIEW",target = "PLAN_TO_BE_DECLARED") | |||
public void SCHEME_UNDER_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "SCHEME_UNDER_REVIEW", target = "PLAN_TO_BE_DECLARED") | |||
public void SCHEME_UNDER_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | |||
} | |||
@OnTransition(source = "TO_BE_APPROVED",target = "TO_BE_PURCHASED") | |||
public void PROJECT_APPROVAL(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "TO_BE_APPROVED", target = "TO_BE_PURCHASED") | |||
public void PROJECT_APPROVAL(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
// 待立项批复批复后,项目一级状态变更为已立项 | |||
project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode()); | |||
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); | |||
} | |||
@OnTransition(source = "TO_BE_APPROVED",target = "SCHEME_UNDER_REVIEW") | |||
public void TO_BE_APPROVED_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "TO_BE_APPROVED", target = "SCHEME_UNDER_REVIEW") | |||
public void TO_BE_APPROVED_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | |||
} | |||
@OnTransition(source = "TO_BE_PURCHASED",target = "UNDER_CONSTRUCTION") | |||
public void PURCHASE_PUT_ON_RECORD(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "TO_BE_PURCHASED", target = "UNDER_CONSTRUCTION") | |||
public void PURCHASE_PUT_ON_RECORD(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | |||
} | |||
@OnTransition(source = "TO_BE_PURCHASED",target = "TO_BE_APPROVED") | |||
public void TO_BE_PURCHASED_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "TO_BE_PURCHASED", target = "TO_BE_APPROVED") | |||
public void TO_BE_PURCHASED_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
// 待采购状态撤回后,项目一级状态回退到未立项 | |||
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | |||
@@ -179,44 +195,48 @@ public class ProjectDeclareAction { | |||
} | |||
@OnTransition(source = "UNDER_CONSTRUCTION",target = "TO_BE_FINALLY_INSPECTED") | |||
public void PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_FINALLY_INSPECTED") | |||
public void PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | |||
} | |||
@OnTransition(source = "UNDER_CONSTRUCTION",target = "TO_BE_PURCHASED") | |||
public void UNDER_CONSTRUCTION_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_PURCHASED") | |||
public void UNDER_CONSTRUCTION_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); | |||
} | |||
@OnTransition(source = "TO_BE_FINALLY_INSPECTED",target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") | |||
public void FINAL_ACCEPTANCE_APPLICATION(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") | |||
public void FINAL_ACCEPTANCE_APPLICATION(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); | |||
} | |||
@OnTransition(source = "TO_BE_FINALLY_INSPECTED",target = "UNDER_CONSTRUCTION") | |||
public void TO_BE_FINALLY_INSPECTED_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "UNDER_CONSTRUCTION") | |||
public void TO_BE_FINALLY_INSPECTED_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | |||
} | |||
@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW",target = "ARCHIVED") | |||
public void FINAL_ACCEPTANCE_PASS(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "ARCHIVED") | |||
public void FINAL_ACCEPTANCE_PASS(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
// 终验审核通过后,项目一级状态变更为已归档 | |||
project.setStage(ProjectStatusEnum.ARCHIVED.getCode()); | |||
project.setStatus(ProjectStatusEnum.ARCHIVED.getCode()); | |||
} | |||
@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW",target = "FINAL_ACCEPTANCE_REVIEW_FAILED") | |||
public void FINAL_ACCEPTANCE_REJECT(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_REVIEW_FAILED") | |||
public void FINAL_ACCEPTANCE_REJECT(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode()); | |||
} | |||
@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW",target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") | |||
public void FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message){ | |||
@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") | |||
public void FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | |||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | |||
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); | |||
} | |||
@@ -228,12 +248,12 @@ public class ProjectDeclareAction { | |||
public void execute(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | |||
log.info(String.valueOf(stateContext.getTarget().getId())); | |||
ProjectStatusEnum projectStatusEnum = stateContext.getTarget().getId(); | |||
if (projectStatusEnum.equals(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)){ | |||
if (projectStatusEnum.equals(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)) { | |||
Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | |||
log.info("预审申报事件之前,项目的状态为:{}"+project.getStatus()); | |||
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){ | |||
log.info("预审申报事件之前,项目的状态为:{}" + project.getStatus()); | |||
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)) { | |||
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()); | |||
}else { | |||
} else { | |||
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | |||
} | |||
} | |||
@@ -3,7 +3,7 @@ package com.ningdatech.pmapi.common.statemachine.action; | |||
import com.ningdatech.pmapi.common.constant.StateMachineHeaderNameConstants; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.statemachine.StateContext; | |||
@@ -4,7 +4,7 @@ import com.ningdatech.pmapi.common.statemachine.action.ProjectDeclareChoiceActio | |||
import com.ningdatech.pmapi.common.statemachine.action.ProjectDeclareAction; | |||
import com.ningdatech.pmapi.common.statemachine.factory.ProjectDeclareGuardFactory; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import lombok.RequiredArgsConstructor; | |||
import org.slf4j.Logger; | |||
@@ -259,7 +259,7 @@ public class ProjectDeclareStateMachineBuilder { | |||
@Override | |||
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) { | |||
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValueByCode(contextObj.getStatus()), | |||
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()), | |||
null, null, null, null, MACHINEID_TO); | |||
return result; | |||
} | |||
@@ -1,17 +1,16 @@ | |||
package com.ningdatech.pmapi.common.statemachine.event; | |||
import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import lombok.NoArgsConstructor; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.Objects; | |||
/** | |||
* 项目状态改变事件 | |||
* @return | |||
* 项目状态改变事件 | |||
* | |||
* @author CMM | |||
* @return | |||
* @since 2023/02/07 9:22 | |||
*/ | |||
@Getter | |||
@@ -22,153 +21,153 @@ public enum ProjectStatusChangeEvent { | |||
/** | |||
* 项目申报暂存(项目状态进入:待申报) | |||
*/ | |||
PROJECT_APPLICATION_HOLD(null,null,null), | |||
PROJECT_APPLICATION_HOLD(null, null, null), | |||
/** | |||
* 项目申报提交(项目状态进入:单位内部审核中) | |||
*/ | |||
PROJECT_APPLICATION_SUBMIT(10015,null,null), | |||
PROJECT_APPLICATION_SUBMIT(10015, null, null), | |||
/** | |||
* 单位内部审核驳回(项目状态进入:单位内部审核不通过) | |||
*/ | |||
UNDER_INTERNAL_REJECT(null,10001,null), | |||
UNDER_INTERNAL_REJECT(null, 10001, null), | |||
/** | |||
* 单位内部审核通过(项目状态进入:待预审) | |||
*/ | |||
UNDER_INTERNAL_PASS(10001,null,null), | |||
UNDER_INTERNAL_PASS(10001, null, null), | |||
/** | |||
* 预审申报(项目状态进入:待预审选择,有判断条件:市级项目且申报金额大于1000万项目状态变为:省级部门联审中;否则项目状态变为:预审中) | |||
*/ | |||
PRELIMINARY_REVIEW_DECLARE(10003,null,null), | |||
PRELIMINARY_REVIEW_DECLARE(10003, null, null), | |||
/** | |||
* 省级部门联审不通过(项目状态变为:省级部门联审不通过) | |||
*/ | |||
PROVINCIAL_DEPARTMENT_REVIEW_REJECT(null,10004,null), | |||
PROVINCIAL_DEPARTMENT_REVIEW_REJECT(null, 10004, null), | |||
/** | |||
* 省级部门联审通过(项目状态变为:预审中) | |||
*/ | |||
PROVINCIAL_DEPARTMENT_REVIEW_PASS(10004,null,null), | |||
PROVINCIAL_DEPARTMENT_REVIEW_PASS(10004, null, null), | |||
/** | |||
* 预审驳回(项目状态变为:预审不通过) | |||
*/ | |||
PRELIMINARY_REVIEW_REJECT(null,10006,null), | |||
PRELIMINARY_REVIEW_REJECT(null, 10006, null), | |||
/** | |||
* 预审通过(项目状态变为:部门联审中) | |||
*/ | |||
PRELIMINARY_REVIEW_PASS(10006,null,null), | |||
PRELIMINARY_REVIEW_PASS(10006, null, null), | |||
/** | |||
* 部门联审驳回(项目状态变为:部门联审不通过) | |||
*/ | |||
DEPARTMENT_UNITED_REVIEW_REJECT(null,10008,null), | |||
DEPARTMENT_UNITED_REVIEW_REJECT(null, 10008, null), | |||
/** | |||
* 部门联审通过(项目状态变为:年度计划中) | |||
*/ | |||
DEPARTMENT_UNITED_REVIEW_PASS(10008,null,null), | |||
DEPARTMENT_UNITED_REVIEW_PASS(10008, null, null), | |||
/** | |||
* 年度计划暂缓(项目状态变为:被暂缓) | |||
*/ | |||
ANNUAL_PLAN_SUSPEND(null,10010,null), | |||
ANNUAL_PLAN_SUSPEND(null, 10010, null), | |||
/** | |||
* 年度计划项目开启方案申报(项目状态变为:方案待申报) | |||
*/ | |||
ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(10010,null,null), | |||
ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(10010, null, null), | |||
/** | |||
* 申报方案(项目状态变为:方案评审中) | |||
*/ | |||
DECLARE_PLAN(10016,null,null), | |||
DECLARE_PLAN(10016, null, null), | |||
/** | |||
* 方案评审驳回(项目状态变为:方案评审不通过) | |||
*/ | |||
PLAN_REVIEW_REJECT(null,10012,null), | |||
PLAN_REVIEW_REJECT(null, 10012, null), | |||
/** | |||
* 方案评审通过(项目状态变为:待立项批复) | |||
*/ | |||
PLAN_REVIEW_PASS(10012,null,null), | |||
PLAN_REVIEW_PASS(10012, null, null), | |||
/** | |||
* 立项批复(项目状态变为:已立项-待采购) | |||
*/ | |||
PROJECT_APPROVAL(10014,null,null), | |||
PROJECT_APPROVAL(10014, null, null), | |||
/** | |||
* 采购备案(项目状态变为:建设中) | |||
*/ | |||
PURCHASE_PUT_ON_RECORD(20001,null,null), | |||
PURCHASE_PUT_ON_RECORD(20001, null, null), | |||
/** | |||
* 初验备案(项目状态变为:待终验) | |||
*/ | |||
PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(20002,null,null), | |||
PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(20002, null, null), | |||
/** | |||
* 终验申请(项目状态变为:终验审核中) | |||
*/ | |||
FINAL_ACCEPTANCE_APPLICATION(20003,null,null), | |||
FINAL_ACCEPTANCE_APPLICATION(20003, null, null), | |||
/** | |||
* 终验审核不通过(项目状态变为:终验审核不通过) | |||
*/ | |||
FINAL_ACCEPTANCE_REJECT(null,20004,null), | |||
FINAL_ACCEPTANCE_REJECT(null, 20004, null), | |||
/** | |||
* 终验审核通过(项目状态变为:已归档) | |||
*/ | |||
FINAL_ACCEPTANCE_PASS(null,null,null), | |||
FINAL_ACCEPTANCE_PASS(null, null, null), | |||
// 下个节点还未提交审核意见时,流程发起人和前一个审核人可以点击撤回 | |||
/** | |||
* 单位内部审核中时被撤回(项目状态进入:待申报) | |||
*/ | |||
UNDER_INTERNAL_WITHDRAW(null,null,10001), | |||
UNDER_INTERNAL_WITHDRAW(null, null, 10001), | |||
/** | |||
* 待预审时被撤回(项目状态进入:单位内部审核中) | |||
*/ | |||
PENDING_PREQUALIFICATION_WITHDRAW(null,null,10003), | |||
PENDING_PREQUALIFICATION_WITHDRAW(null, null, 10003), | |||
/** | |||
* 省级部门联审中时被撤回(项目状态进入:待预审) | |||
*/ | |||
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(null,null,10004), | |||
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(null, null, 10004), | |||
/** | |||
* 预审中时被撤回(项目状态进入:待预审选择,,有判断条件:市级项目且申报金额大于1000万项目状态变为:省级部门联审中;否则项目状态变为:预审中) | |||
* 预审中时被撤回(项目状态进入:待预审选择,,有判断条件:市级项目且申报金额大于1000万项目状态变为:省级部门联审中;否则项目状态变为:预审中) | |||
*/ | |||
PRE_APPLYING_WITHDRAW(null,null,10006), | |||
PRE_APPLYING_WITHDRAW(null, null, 10006), | |||
/** | |||
* 部门联审中时被撤回(项目状态进入:预审中) | |||
* 部门联审中时被撤回(项目状态进入:预审中) | |||
*/ | |||
DEPARTMENT_JOINT_REVIEW_WITHDRAW(null,null,10008), | |||
DEPARTMENT_JOINT_REVIEW_WITHDRAW(null, null, 10008), | |||
/** | |||
* 年度计划中时被撤回(项目状态进入:部门联审中) | |||
* 年度计划中时被撤回(项目状态进入:部门联审中) | |||
*/ | |||
IN_THE_ANNUAL_PLAN_WITHDRAW(null,null,10010), | |||
IN_THE_ANNUAL_PLAN_WITHDRAW(null, null, 10010), | |||
/** | |||
* 方案待申报时被撤回(项目状态进入:年度计划中) | |||
*/ | |||
PLAN_TO_DECLARE_WITHDRAW(null,null,10016), | |||
PLAN_TO_DECLARE_WITHDRAW(null, null, 10016), | |||
/** | |||
* 方案评审中时被撤回(项目状态进入:方案待申报) | |||
*/ | |||
SCHEME_UNDER_REVIEW_WITHDRAW(null,null,10012), | |||
SCHEME_UNDER_REVIEW_WITHDRAW(null, null, 10012), | |||
/** | |||
* 待立项批复时被撤回(项目状态进入:方案评审中) | |||
*/ | |||
TO_BE_APPROVED_WITHDRAW(null,null,10014), | |||
TO_BE_APPROVED_WITHDRAW(null, null, 10014), | |||
/** | |||
* 待采购时被撤回(项目状态进入:待立项批复) | |||
*/ | |||
TO_BE_PURCHASED_WITHDRAW(null,null,20001), | |||
TO_BE_PURCHASED_WITHDRAW(null, null, 20001), | |||
/** | |||
* 建设中时被撤回(项目状态进入:待采购) | |||
* 建设中时被撤回(项目状态进入:待采购) | |||
*/ | |||
UNDER_CONSTRUCTION_WITHDRAW(null,null,20002), | |||
UNDER_CONSTRUCTION_WITHDRAW(null, null, 20002), | |||
/** | |||
* 待终验时被撤回(项目状态进入:建设中) | |||
*/ | |||
TO_BE_FINALLY_INSPECTED_WITHDRAW(null,null,20003), | |||
TO_BE_FINALLY_INSPECTED_WITHDRAW(null, null, 20003), | |||
/** | |||
* 终验审核中时被撤回(项目状态进入:待终验) | |||
* 终验审核中时被撤回(项目状态进入:待终验) | |||
*/ | |||
FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(null,null,20004); | |||
FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(null, null, 20004); | |||
private Integer passProjectStatusCode; | |||
private Integer rejectProjectStatusCode; | |||
private Integer withdrawProjectStatusCode; | |||
public static ProjectStatusChangeEvent getPassValueByCode(Integer code) { | |||
if(Objects.isNull(code)){ | |||
if (Objects.isNull(code)) { | |||
return null; | |||
} | |||
for (ProjectStatusChangeEvent t : ProjectStatusChangeEvent.values()) { | |||
@@ -180,7 +179,7 @@ public enum ProjectStatusChangeEvent { | |||
} | |||
public static ProjectStatusChangeEvent getRejectValueByCode(Integer code) { | |||
if(Objects.isNull(code)){ | |||
if (Objects.isNull(code)) { | |||
return null; | |||
} | |||
for (ProjectStatusChangeEvent t : ProjectStatusChangeEvent.values()) { | |||
@@ -192,7 +191,7 @@ public enum ProjectStatusChangeEvent { | |||
} | |||
public static ProjectStatusChangeEvent getWithdrawValueByCode(Integer code) { | |||
if(Objects.isNull(code)){ | |||
if (Objects.isNull(code)) { | |||
return null; | |||
} | |||
for (ProjectStatusChangeEvent t : ProjectStatusChangeEvent.values()) { | |||
@@ -3,7 +3,7 @@ package com.ningdatech.pmapi.common.statemachine.factory; | |||
import com.ningdatech.pmapi.common.constant.StateMachineHeaderNameConstants; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import org.springframework.statemachine.StateContext; | |||
import org.springframework.statemachine.guard.Guard; | |||
@@ -5,7 +5,7 @@ import com.ningdatech.pmapi.common.constant.ProjectDeclareConstants; | |||
import com.ningdatech.pmapi.common.constant.StateMachineHeaderNameConstants; | |||
import com.ningdatech.pmapi.common.statemachine.builder.ProjectDeclareStateMachineBuilder; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
@@ -36,19 +36,20 @@ public class StateMachineUtils { | |||
@Resource(name = "projectDeclareStateMachinePersister") | |||
private StateMachinePersister projectDeclareStateMachinePersister; | |||
public void execute(Project project, ProjectStatusChangeEvent event) throws Exception{ | |||
log.info("调用状态机前的项目状态为>>>>>>>>>>{}"+project.getStatus()); | |||
public void execute(Project project, ProjectStatusChangeEvent event) throws Exception { | |||
log.info("调用状态机前的项目状态为>>>>>>>>>>{}" + project.getStatus()); | |||
//获取TO状态机 | |||
StateMachine<ProjectStatusEnum, ProjectStatusChangeEvent> stateMachine = projectDeclareStateMachineBuilder.build(); | |||
Message message = MessageBuilder.withPayload(event).setHeader(PROJECT_DECLARE, project).build(); | |||
//初始化状态机 | |||
projectDeclareStateMachinePersister.restore(stateMachine,project); | |||
projectDeclareStateMachinePersister.restore(stateMachine, project); | |||
stateMachine.sendEvent(message); | |||
log.info("调用状态机后的项目状态为>>>>>>>>>>{}"+project.getStatus()); | |||
log.info("调用状态机后的项目状态为>>>>>>>>>>{}" + project.getStatus()); | |||
} | |||
/** | |||
* 判断项目申报金额是否大于1000万元 | |||
* | |||
* @param project | |||
* @return boolean | |||
* @author CMM | |||
@@ -56,7 +57,7 @@ public class StateMachineUtils { | |||
*/ | |||
public static boolean judgeDeclareAmount(Project project) { | |||
int flag = project.getDeclareAmount().compareTo(ProjectDeclareConstants.Number.DECLARE_AMOUNT_JUDGEMENT); | |||
if (flag > 0 || flag == 0){ | |||
if (flag > 0 || flag == 0) { | |||
return true; | |||
} | |||
return false; | |||
@@ -64,6 +65,7 @@ public class StateMachineUtils { | |||
/** | |||
* 判断项目建设层级是否为市级项目 | |||
* | |||
* @param project | |||
* @return boolean | |||
* @author CMM | |||
@@ -71,7 +73,7 @@ public class StateMachineUtils { | |||
*/ | |||
public static boolean isCityProject(Project project) { | |||
if (ProjectDeclareConstants.Number.CITY_BUILD_LEVEL.equals(project.getBuildLevel()) || | |||
ProjectDeclareConstants.Number.CITY_SELF_BUILD_LEVEL.equals(project.getBuildLevel())){ | |||
ProjectDeclareConstants.Number.CITY_SELF_BUILD_LEVEL.equals(project.getBuildLevel())) { | |||
return true; | |||
} | |||
return false; | |||
@@ -79,7 +81,7 @@ public class StateMachineUtils { | |||
public ProjectStatusChangeEvent getProjectStatusPassEvent(Integer projectStatusSecond) { | |||
ProjectStatusChangeEvent event = ProjectStatusChangeEvent.getPassValueByCode(projectStatusSecond); | |||
if (Objects.isNull(event)){ | |||
if (Objects.isNull(event)) { | |||
throw new BizException("该状态下没有对应的通过操作!"); | |||
} | |||
return event; | |||
@@ -87,7 +89,7 @@ public class StateMachineUtils { | |||
public ProjectStatusChangeEvent getProjectStatusRejectEvent(Integer projectStatusSecond) { | |||
ProjectStatusChangeEvent event = ProjectStatusChangeEvent.getRejectValueByCode(projectStatusSecond); | |||
if (Objects.isNull(event)){ | |||
if (Objects.isNull(event)) { | |||
throw new BizException("该状态下没有对应的驳回操作!"); | |||
} | |||
return event; | |||
@@ -95,7 +97,7 @@ public class StateMachineUtils { | |||
public ProjectStatusChangeEvent getProjectStatusWithdrawEvent(Integer projectStatusSecond) { | |||
ProjectStatusChangeEvent event = ProjectStatusChangeEvent.getWithdrawValueByCode(projectStatusSecond); | |||
if (Objects.isNull(event)){ | |||
if (Objects.isNull(event)) { | |||
throw new BizException("该状态下没有对应的撤回操作!"); | |||
} | |||
return event; | |||
@@ -16,6 +16,7 @@ import com.alibaba.excel.ExcelWriter; | |||
import com.alibaba.excel.write.metadata.WriteSheet; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; | |||
import com.ningdatech.pmapi.todocenter.bean.entity.ExportOption; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import org.apache.http.HttpStatus; | |||
@@ -135,4 +136,5 @@ public class ExcelDownUtil { | |||
response.setContentType(StrPool.CONTENT_TYPE); | |||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + encodeName(fileName) + ".xls"); | |||
} | |||
} |
@@ -10,6 +10,7 @@ import com.ningdatech.zwdd.model.Page; | |||
import com.ningdatech.zwdd.model.query.PageOrganizationEmployeePositionsQuery; | |||
import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import java.util.ArrayList; | |||
@@ -20,6 +21,7 @@ import java.util.List; | |||
* @date 2023/2/10 上午9:52 | |||
*/ | |||
@Component | |||
public class EmployeeBatchGetTask { | |||
private final static Integer PAGE_SIZE = 20; | |||
@@ -48,27 +50,23 @@ public class EmployeeBatchGetTask { | |||
GenericResult<Page<OrganizationEmployeePosition>> firstPageGenericResult = zwddClient.pageOrganizationEmployeePositions(query); | |||
Page<OrganizationEmployeePosition> data = firstPageGenericResult.getData(); | |||
if (CollUtil.isNotEmpty(data.getData())) { | |||
allOrganizationEmployeePositionList.addAll(data.getData()); | |||
} | |||
Long totalSize = data.getTotalSize(); | |||
if (totalSize > PAGE_SIZE) { | |||
int maxPageNo = (int) Math.ceil(totalSize / PAGE_SIZE); | |||
for (pageNo = 2; pageNo <= maxPageNo; pageNo++) { | |||
query.setPageNo(maxPageNo); | |||
GenericResult<Page<OrganizationEmployeePosition>> pageGenericResult = zwddClient.pageOrganizationEmployeePositions(query); | |||
if (CollUtil.isNotEmpty(pageGenericResult.getData().getData())) { | |||
allOrganizationEmployeePositionList.addAll(pageGenericResult.getData().getData()); | |||
} | |||
} | |||
} else { | |||
} | |||
} | |||
// zwddClient.pageOrganizationEmployeePositions(query); | |||
@@ -0,0 +1,20 @@ | |||
package com.ningdatech.pmapi.organization.controller; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.stereotype.Controller; | |||
/** | |||
* <p> | |||
* 前端控制器 | |||
* </p> | |||
* | |||
* @author Lierbao | |||
* @since 2023-02-11 | |||
*/ | |||
@Controller | |||
@RequestMapping("/pmapi.organization/ding-employee-info") | |||
public class DingEmployeeInfoController { | |||
} |
@@ -0,0 +1,71 @@ | |||
package com.ningdatech.pmapi.organization.entity; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* <p> | |||
* | |||
* </p> | |||
* | |||
* @author Lierbao | |||
* @since 2023-02-11 | |||
*/ | |||
@TableName("ding_employee_info") | |||
@Data | |||
@ApiModel(value = "DingEmployeeInfo对象", description = "") | |||
public class DingEmployeeInfo implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
private Long id; | |||
private LocalDateTime createOn; | |||
private LocalDateTime updateOn; | |||
private Long createBy; | |||
private Long updateBy; | |||
private String emplyeeName; | |||
private String gmtCreate; | |||
private String empGender; | |||
private String empPoliticalStatusCode; | |||
private String empJobLevelCode; | |||
private String empBudgetedPostCode; | |||
private String status; | |||
private String posJobRankCode; | |||
private String orderInOrganization; | |||
private String mainJob; | |||
private String empPosUnitCode; | |||
private String empPosEmployeeRoleCode; | |||
private String empPosInnerInstitutionCode; | |||
private String employeeCode; | |||
private String jobAttributesCode; | |||
private String organizationCode; | |||
private String empPosVirtualOrganizationCode; | |||
private String empStatus; | |||
} |
@@ -0,0 +1,16 @@ | |||
package com.ningdatech.pmapi.organization.mapper; | |||
import com.ningdatech.pmapi.organization.entity.DingEmployeeInfo; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
/** | |||
* <p> | |||
* Mapper 接口 | |||
* </p> | |||
* | |||
* @author Lierbao | |||
* @since 2023-02-11 | |||
*/ | |||
public interface DingEmployeeInfoMapper extends BaseMapper<DingEmployeeInfo> { | |||
} |
@@ -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.ningdatech.pmapi.organization.mapper.DingEmployeeInfoMapper"> | |||
</mapper> |
@@ -0,0 +1,16 @@ | |||
package com.ningdatech.pmapi.organization.service; | |||
import com.ningdatech.pmapi.organization.entity.DingEmployeeInfo; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
/** | |||
* <p> | |||
* 服务类 | |||
* </p> | |||
* | |||
* @author Lierbao | |||
* @since 2023-02-11 | |||
*/ | |||
public interface IDingEmployeeInfoService extends IService<DingEmployeeInfo> { | |||
} |
@@ -0,0 +1,20 @@ | |||
package com.ningdatech.pmapi.organization.service.impl; | |||
import com.ningdatech.pmapi.organization.entity.DingEmployeeInfo; | |||
import com.ningdatech.pmapi.organization.mapper.DingEmployeeInfoMapper; | |||
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* <p> | |||
* 服务实现类 | |||
* </p> | |||
* | |||
* @author Lierbao | |||
* @since 2023-02-11 | |||
*/ | |||
@Service | |||
public class DingEmployeeInfoServiceImpl extends ServiceImpl<DingEmployeeInfoMapper, DingEmployeeInfo> implements IDingEmployeeInfoService { | |||
} |
@@ -17,7 +17,7 @@ import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredDetailVO; | |||
import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredListItemVO; | |||
import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVo; | |||
import com.ningdatech.pmapi.projectdeclared.service.IProjectDraftService; | |||
import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDto; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; | |||
@@ -25,7 +25,6 @@ import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
import com.wflow.bean.entity.WflowModels; | |||
import com.wflow.exception.BusinessException; | |||
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | |||
import com.wflow.workflow.bean.vo.ProcessStartParamsVo; | |||
import com.wflow.workflow.service.ProcessInstanceService; | |||
import com.wflow.workflow.service.ProcessModelService; | |||
@@ -74,8 +73,8 @@ public class DeclaredProjectManage { | |||
.eq(Objects.nonNull(params.getProjectStatus()), Project::getStatus, params.getProjectStatus()) | |||
.like(StringUtils.isNotBlank(params.getProjectName()), Project::getProjectName, params.getProjectName()) | |||
.orderByDesc(Project::getUpdateOn); | |||
projectService.page(page,wrapper); | |||
if(0L == page.getTotal()){ | |||
projectService.page(page, wrapper); | |||
if (0L == page.getTotal()) { | |||
return PageVo.empty(); | |||
} | |||
List<ProjectDeclaredListItemVO> res = page.getRecords().stream().map(record -> { | |||
@@ -83,7 +82,7 @@ public class DeclaredProjectManage { | |||
BeanUtils.copyProperties(record, vo); | |||
return vo; | |||
}).collect(Collectors.toList()); | |||
return PageVo.of(res,page.getTotal()); | |||
return PageVo.of(res, page.getTotal()); | |||
} | |||
public ProjectDeclaredDetailVO detail(Long id) { | |||
@@ -107,8 +106,8 @@ public class DeclaredProjectManage { | |||
.eq(Objects.nonNull(params.getProjectStatus()), ProjectDraft::getProjectStatusSecond, params.getProjectStatus()) | |||
.like(StringUtils.isNotBlank(params.getProjectName()), ProjectDraft::getProjectName, params.getProjectName()) | |||
.orderByDesc(ProjectDraft::getUpdateOn); | |||
projectDraftService.page(page,wrapper); | |||
if(0L == page.getTotal()){ | |||
projectDraftService.page(page, wrapper); | |||
if (0L == page.getTotal()) { | |||
return PageVo.empty(); | |||
} | |||
List<ProjectDraftVo> res = page.getRecords().stream().map(record -> { | |||
@@ -116,7 +115,7 @@ public class DeclaredProjectManage { | |||
BeanUtils.copyProperties(record, vo); | |||
return vo; | |||
}).collect(Collectors.toList()); | |||
return PageVo.of(res,page.getTotal()); | |||
return PageVo.of(res, page.getTotal()); | |||
} | |||
public ProjectDraftVo draftDatail(Long id) { | |||
@@ -128,6 +127,7 @@ public class DeclaredProjectManage { | |||
/** | |||
* 启动实例 | |||
* | |||
* @param dto | |||
* @return | |||
*/ | |||
@@ -139,8 +139,8 @@ public class DeclaredProjectManage { | |||
.eq(WflowModels::getFormName, ProjectProessStageEnum.ORG_INTERNAL_APPROVAL_PROCESS.getDesc()) | |||
.last("limit 1")); | |||
if(Objects.isNull(model)){ | |||
throw new BusinessException(String.format("此 【%s】区域找不到流程配置",regionCode)); | |||
if (Objects.isNull(model)) { | |||
throw new BusinessException(String.format("此 【%s】区域找不到流程配置", regionCode)); | |||
} | |||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | |||
@@ -148,33 +148,35 @@ public class DeclaredProjectManage { | |||
params.setProcessUsers(Collections.emptyMap()); | |||
//放入条件判断的项目字段 | |||
ProjectConditionDto conditionDto = new ProjectConditionDto(); | |||
BeanUtils.copyProperties(dto.getProjectInfo(),conditionDto); | |||
if(Objects.nonNull(conditionDto)){ | |||
BeanUtils.copyProperties(dto.getProjectInfo(), conditionDto); | |||
if (Objects.nonNull(conditionDto)) { | |||
dto.getFormData().putAll( | |||
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() {}) | |||
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() { | |||
}) | |||
); | |||
} | |||
params.setFormData(dto.getFormData()); | |||
String instanceId = processService.startProcess(model.getProcessDefId(), params); | |||
log.info("申报项目成功 【{}】",instanceId); | |||
log.info("申报项目成功 【{}】", instanceId); | |||
//保存项目 | |||
saveProject(dto.getProjectInfo(),instanceId,regionCode); | |||
saveProject(dto.getProjectInfo(), instanceId, regionCode); | |||
return instanceId; | |||
} | |||
/** | |||
* 申报项目 时 新增项目到项目库 | |||
* | |||
* @param projectDto | |||
* @param instanceId | |||
*/ | |||
private void saveProject(ProjectDto projectDto,String instanceId,String regionCode) { | |||
private void saveProject(ProjectDto projectDto, String instanceId, String regionCode) { | |||
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | |||
try{ | |||
try { | |||
//保存项目表信息 | |||
Project project = new Project(); | |||
BeanUtils.copyProperties(projectDto,project); | |||
BeanUtils.copyProperties(projectDto, project); | |||
project.setCreateOn(LocalDateTime.now()); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
project.setAreaCode(regionCode); | |||
@@ -183,7 +185,7 @@ public class DeclaredProjectManage { | |||
project.setInstCode(instanceId); | |||
projectService.save(project); | |||
//保存项目应用 | |||
if(CollUtil.isNotEmpty(projectDto.getApplicationList())){ | |||
if (CollUtil.isNotEmpty(projectDto.getApplicationList())) { | |||
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | |||
ProjectApplication projectApplication = new ProjectApplication(); | |||
BeanUtils.copyProperties(application, projectApplication); | |||
@@ -192,21 +194,22 @@ public class DeclaredProjectManage { | |||
}).collect(Collectors.toList()); | |||
projectApplicationService.saveBatch(applications); | |||
} | |||
}catch (Exception e){ | |||
log.error("项目信息入库错误 ",e); | |||
} catch (Exception e) { | |||
log.error("项目信息入库错误 ", e); | |||
throw new BusinessException("项目信息入库错误 :" + e.getMessage()); | |||
} | |||
} | |||
/** | |||
* 保存至草稿箱 | |||
* | |||
* @param dto | |||
* @return | |||
*/ | |||
public Long saveToDraft(ProjectDraftSaveDto dto) { | |||
ProjectDraft draft = new ProjectDraft(); | |||
BeanUtils.copyProperties(dto,draft); | |||
if(Objects.isNull(draft.getId())){ | |||
BeanUtils.copyProperties(dto, draft); | |||
if (Objects.isNull(draft.getId())) { | |||
draft.setCreateOn(LocalDateTime.now()); | |||
} | |||
draft.setUpdateOn(LocalDateTime.now()); | |||
@@ -1,6 +1,13 @@ | |||
package com.ningdatech.pmapi.projectlib.controller; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.AllArgsConstructor; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
@@ -13,9 +20,17 @@ import org.springframework.web.bind.annotation.RestController; | |||
* @since 14:07 2023/2/11 | |||
*/ | |||
@RestController | |||
@AllArgsConstructor | |||
@Api(tags = "年度计划库") | |||
@RequestMapping("/api/v1/annualPlan") | |||
public class AnnualPlanController { | |||
private final AnnualPlanLibManage annualPlanLibManage; | |||
@GetMapping("/list") | |||
@ApiOperation("年段计划库列表") | |||
public PageVo<AnnualPlanListItemVO> annualPlanLibList(ProjectListReq req) { | |||
return annualPlanLibManage.annulPlanLibList(req); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
package com.ningdatech.pmapi.projectlib.enumeration; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import lombok.NoArgsConstructor; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.Arrays; | |||
import java.util.Objects; | |||
import java.util.stream.Collectors; | |||
/** | |||
* <p> | |||
* ProjectStatusEnum | |||
* </p> | |||
* | |||
* @author Poffy | |||
* @since 16:54 2023/2/11 | |||
*/ | |||
@Getter | |||
@AllArgsConstructor | |||
@NoArgsConstructor | |||
public enum ProjectStatusEnum { | |||
/** | |||
* 项目阶段:未立项 | |||
*/ | |||
NOT_APPROVED(10000, "未立项"), | |||
UNDER_INTERNAL_AUDIT(10001, "单位内部审核中"), | |||
UNDER_INTERNAL_AUDIT_NOT_PASS(10002, "单位内部审核不通过"), | |||
PENDING_PREQUALIFICATION(10003, "待预审"), | |||
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS(10004, "省级部门联审中"), | |||
THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED(10005, "省级部门联审不通过"), | |||
PRE_APPLYING(10006, "预审中"), | |||
PREQUALIFICATION_FAILED(10007, "预审不通过"), | |||
DEPARTMENT_JOINT_REVIEW(10008, "部门联审中"), | |||
DEPARTMENT_JOINT_REVIEW_FAILED(10009, "部门联审不通过"), | |||
IN_THE_ANNUAL_PLAN(10010, "年度计划中"), | |||
BE_SUSPENDED(10011, "被暂缓"), | |||
SCHEME_UNDER_REVIEW(10012, "方案评审中"), | |||
SCHEME_REVIEW_FAILED(10013, "方案评审不通过"), | |||
TO_BE_APPROVED(10014, "待立项批复"), | |||
TO_BE_DECLARED(10015, "待申报"), | |||
PLAN_TO_BE_DECLARED(10016, "方案待申报"), | |||
PENDING_PREQUALIFICATION_CHOICE(10017, "待预审选择态"), | |||
/** | |||
* 项目阶段:已立项 | |||
*/ | |||
PROJECT_APPROVED(20000, "已立项"), | |||
TO_BE_PURCHASED(20001, "待采购"), | |||
UNDER_CONSTRUCTION(20002, "建设中"), | |||
TO_BE_FINALLY_INSPECTED(20003, "待终验"), | |||
FINAL_ACCEPTANCE_IS_UNDER_REVIEW(20004, "终验审核中"), | |||
FINAL_ACCEPTANCE_REVIEW_FAILED(20005, "终验审核不通过"), | |||
/** | |||
* 项目阶段:已归档 | |||
*/ | |||
ARCHIVED(30000, "已归档"); | |||
public static void main(String[] args) { | |||
System.out.println(Arrays.stream(ProjectStatusEnum.values()).filter(w -> w.getCode() >= 10010).collect(Collectors.toList())); | |||
} | |||
private Integer code; | |||
private String desc; | |||
public static String getDesc(Integer code) { | |||
if (Objects.isNull(code)) { | |||
return StringUtils.EMPTY; | |||
} | |||
for (ProjectStatusEnum t : ProjectStatusEnum.values()) { | |||
if (code.equals(t.getCode())) { | |||
return t.desc; | |||
} | |||
} | |||
return StringUtils.EMPTY; | |||
} | |||
public static ProjectStatusEnum getValue(Integer code) { | |||
if (Objects.isNull(code)) { | |||
return null; | |||
} | |||
for (ProjectStatusEnum t : ProjectStatusEnum.values()) { | |||
if (code.equals(t.getCode())) { | |||
return t; | |||
} | |||
} | |||
return null; | |||
} | |||
} |
@@ -1,4 +1,4 @@ | |||
package com.ningdatech.pmapi.projectlib.enums; | |||
package com.ningdatech.pmapi.projectlib.enumeration; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
@@ -7,6 +7,14 @@ import org.apache.commons.lang3.StringUtils; | |||
import java.util.Objects; | |||
/** | |||
* <p> | |||
* ProjectTypeEnum | |||
* </p> | |||
* | |||
* @author Poffy | |||
* @since 16:56 2023/2/11 | |||
*/ | |||
@Getter | |||
@AllArgsConstructor | |||
@NoArgsConstructor | |||
@@ -14,14 +22,14 @@ public enum ProjectTypeEnum { | |||
/** | |||
* 项目类型 | |||
*/ | |||
BUILD (1,"建设"), | |||
DEV_OPS (2,"运维"); | |||
BUILD(1, "建设"), | |||
DEV_OPS(2, "运维"); | |||
private Integer code; | |||
private String desc; | |||
public static String getDescByCode(Integer code) { | |||
if(Objects.isNull(code)){ | |||
public static String getDesc(Integer code) { | |||
if (Objects.isNull(code)) { | |||
return StringUtils.EMPTY; | |||
} | |||
for (ProjectTypeEnum t : ProjectTypeEnum.values()) { |
@@ -1,70 +0,0 @@ | |||
package com.ningdatech.pmapi.projectlib.enums; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import lombok.NoArgsConstructor; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.Objects; | |||
@Getter | |||
@AllArgsConstructor | |||
@NoArgsConstructor | |||
public enum ProjectStatusEnum { | |||
/** | |||
* 项目状态 | |||
*/ | |||
NOT_APPROVED (10000,"未立项"), | |||
UNDER_INTERNAL_AUDIT (10001,"单位内部审核中"), | |||
UNDER_INTERNAL_AUDIT_NOT_PASS (10002,"单位内部审核不通过"), | |||
PENDING_PREQUALIFICATION (10003,"待预审"), | |||
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS (10004,"省级部门联审中"), | |||
THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED (10005,"省级部门联审不通过"), | |||
PRE_APPLYING (10006,"预审中"), | |||
PREQUALIFICATION_FAILED (10007,"预审不通过"), | |||
DEPARTMENT_JOINT_REVIEW (10008,"部门联审中"), | |||
DEPARTMENT_JOINT_REVIEW_FAILED (10009,"部门联审不通过"), | |||
IN_THE_ANNUAL_PLAN (10010,"年度计划中"), | |||
BE_SUSPENDED (10011,"被暂缓"), | |||
SCHEME_UNDER_REVIEW (10012,"方案评审中"), | |||
SCHEME_REVIEW_FAILED (10013,"方案评审不通过"), | |||
TO_BE_APPROVED (10014,"待立项批复"), | |||
TO_BE_DECLARED (10015,"待申报"), | |||
PLAN_TO_BE_DECLARED (10016,"方案待申报"), | |||
PENDING_PREQUALIFICATION_CHOICE (10017,"待预审选择态"), | |||
PROJECT_APPROVED (20000,"已立项"), | |||
TO_BE_PURCHASED (20001,"待采购"), | |||
UNDER_CONSTRUCTION (20002,"建设中"), | |||
TO_BE_FINALLY_INSPECTED (20003,"待终验"), | |||
FINAL_ACCEPTANCE_IS_UNDER_REVIEW (20004,"终验审核中"), | |||
FINAL_ACCEPTANCE_REVIEW_FAILED (20005,"终验审核不通过"), | |||
ARCHIVED (30000,"已归档"); | |||
private Integer code; | |||
private String desc; | |||
public static String getDescByCode(Integer code) { | |||
if(Objects.isNull(code)){ | |||
return StringUtils.EMPTY; | |||
} | |||
for (ProjectStatusEnum t : ProjectStatusEnum.values()) { | |||
if (code.equals(t.getCode())) { | |||
return t.desc; | |||
} | |||
} | |||
return StringUtils.EMPTY; | |||
} | |||
public static ProjectStatusEnum getValueByCode(Integer code) { | |||
if(Objects.isNull(code)){ | |||
return null; | |||
} | |||
for (ProjectStatusEnum t : ProjectStatusEnum.values()) { | |||
if (code.equals(t.getCode())) { | |||
return t; | |||
} | |||
} | |||
return null; | |||
} | |||
} |
@@ -1,9 +1,24 @@ | |||
package com.ningdatech.pmapi.projectlib.manage; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
import lombok.AllArgsConstructor; | |||
import org.springframework.stereotype.Component; | |||
import java.util.ArrayList; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; | |||
/** | |||
* <p> | |||
* AnnualPlanLibManage | |||
@@ -18,8 +33,54 @@ public class AnnualPlanLibManage { | |||
private final IProjectService projectService; | |||
public void annulPlanLibList() { | |||
/** | |||
* 年度计划查询状态 | |||
*/ | |||
private static final List<ProjectStatusEnum> ANNUAL_PLAN_LIST_STATUS = Arrays.asList( | |||
IN_THE_ANNUAL_PLAN, | |||
BE_SUSPENDED, | |||
SCHEME_UNDER_REVIEW, | |||
SCHEME_REVIEW_FAILED, | |||
TO_BE_APPROVED, | |||
TO_BE_DECLARED, | |||
PLAN_TO_BE_DECLARED, | |||
PENDING_PREQUALIFICATION_CHOICE, | |||
PROJECT_APPROVED, | |||
TO_BE_PURCHASED, | |||
UNDER_CONSTRUCTION, | |||
TO_BE_FINALLY_INSPECTED, | |||
FINAL_ACCEPTANCE_IS_UNDER_REVIEW, | |||
FINAL_ACCEPTANCE_REVIEW_FAILED, | |||
ARCHIVED | |||
); | |||
public PageVo<AnnualPlanListItemVO> annulPlanLibList(ProjectListReq req) { | |||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | |||
query.orderByDesc(Project::getAnnualPlanAddTime); | |||
query.in(Project::getStatus, CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatusEnum::getCode)); | |||
Page<Project> page = projectService.page(req.page(), query); | |||
long total; | |||
if ((total = page.getTotal()) == 0) { | |||
return PageVo.empty(); | |||
} | |||
PageVo<AnnualPlanListItemVO> result = PageVo.of(new ArrayList<>(), total); | |||
page.getRecords().forEach(w -> { | |||
AnnualPlanListItemVO item = new AnnualPlanListItemVO(); | |||
item.setProjectId(w.getId()); | |||
item.setProjectName(w.getProjectName()); | |||
item.setStage(w.getStage()); | |||
item.setStatus(w.getStatus()); | |||
item.setProjectYear(w.getProjectYear()); | |||
item.setProjectType(w.getProjectType()); | |||
item.setDeclaredAmount(w.getDeclareAmount()); | |||
item.setBuildOrg(w.getBuildOrgName()); | |||
item.setCreateOn(w.getCreateOn()); | |||
// TODO 是否开启项目申报 | |||
item.setIsStartDeclaredProject(true); | |||
result.getRecords().add(item); | |||
}); | |||
return result; | |||
} | |||
} |
@@ -0,0 +1,50 @@ | |||
package com.ningdatech.pmapi.projectlib.model.vo; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
/** | |||
* <p> | |||
* AnnualPlanListItemVO | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 15:19 2023/2/11 | |||
*/ | |||
@Data | |||
public class AnnualPlanListItemVO { | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
@ApiModelProperty("建设单位") | |||
private String buildOrg; | |||
@ApiModelProperty("项目类型") | |||
private Integer projectType; | |||
@ApiModelProperty("申报金额") | |||
private BigDecimal declaredAmount; | |||
@ApiModelProperty("预算年度") | |||
private Integer projectYear; | |||
@ApiModelProperty("项目是否开起方案申报") | |||
private Boolean isStartDeclaredProject; | |||
@ApiModelProperty("项目阶段") | |||
private Integer stage; | |||
@ApiModelProperty("项目状态") | |||
private Integer status; | |||
@ApiModelProperty("项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("创建时间") | |||
private LocalDateTime createOn; | |||
} |
@@ -5,6 +5,8 @@ import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
/** | |||
* 导出选项实体类 | |||
* | |||
@@ -22,7 +24,7 @@ public class ExportOption { | |||
private Boolean id; | |||
@ApiModelProperty("项目名称") | |||
private Boolean name; | |||
private Boolean projectName; | |||
@ApiModelProperty("行政区划编码") | |||
private Boolean areaCode; | |||
@@ -43,25 +45,25 @@ public class ExportOption { | |||
private Boolean contactPhone; | |||
@ApiModelProperty("上级业务主管单位") | |||
private Boolean higherSuperUnit; | |||
private Boolean higherSuperOrg; | |||
@ApiModelProperty("上级主管单位浙政钉ID") | |||
private Boolean higherSuperUnitCode; | |||
private Boolean higherSuperOrgCode; | |||
@ApiModelProperty("本级主管部门") | |||
private Boolean superUnit; | |||
private Boolean superOrg; | |||
@ApiModelProperty("本级主管部门浙政钉ID") | |||
private Boolean superUnitCode; | |||
private Boolean superOrgCode; | |||
@ApiModelProperty("建设单位名称") | |||
private Boolean constructionUnitName; | |||
private Boolean buildOrgName; | |||
@ApiModelProperty("建设单位浙政钉ID") | |||
private Boolean buildUnitZheJiangGovernmentDingId; | |||
private Boolean buildOrgZheJiangGovDingId; | |||
@ApiModelProperty("建设单位统一信用代码") | |||
private Boolean buildUnitCode; | |||
private Boolean buildOrgCode; | |||
@ApiModelProperty("项目类型") | |||
private Boolean projectType; | |||
@@ -70,10 +72,10 @@ public class ExportOption { | |||
private Boolean isFirst; | |||
@ApiModelProperty("关联应用") | |||
private Boolean includeApplication; | |||
private Boolean relatedExistsApplication; | |||
@ApiModelProperty("关联应用IRS编码") | |||
private Boolean includeApplicationIRSCode; | |||
private Boolean relatedExistsApplicationCode; | |||
@ApiModelProperty("申报金额(万元)") | |||
private Boolean declareAmount; | |||
@@ -85,7 +87,7 @@ public class ExportOption { | |||
private Boolean budgetSource; | |||
@ApiModelProperty("预算年度") | |||
private Boolean budgetYear; | |||
private Boolean projectYear; | |||
@ApiModelProperty("项目简介") | |||
private Boolean projectIntroduction; | |||
@@ -136,7 +138,7 @@ public class ExportOption { | |||
private Boolean businessName; | |||
@ApiModelProperty("单位名称") | |||
private Boolean unitName; | |||
private Boolean orgName; | |||
@ApiModelProperty("软件开发(万元)") | |||
private Boolean softwareDevelopmentAmount; | |||
@@ -163,10 +165,10 @@ public class ExportOption { | |||
private Boolean annualPlanHaveAmount; | |||
@ApiModelProperty("政府投资-本级财政资金(万元)") | |||
private Boolean declareGovernmentOwnFinanceAmount; | |||
private Boolean declareGovOwnFinanceAmount; | |||
@ApiModelProperty("政府投资-上级补助资金(万元)") | |||
private Boolean declareGovernmentSuperiorFinanceAmount; | |||
private Boolean declareGovSuperiorFinanceAmount; | |||
@ApiModelProperty("银行贷款(万元)") | |||
private Boolean declareBankLendingAmount; | |||
@@ -54,8 +54,8 @@ public class TodoCenterController { | |||
* @param response | |||
* @return void | |||
*/ | |||
@GetMapping("/exportPending") | |||
public void exportPendingProjectList(ReqToBeProcessedDTO param, HttpServletResponse response){ | |||
@PostMapping("/exportPending") | |||
public void exportPendingProjectList(@Valid @RequestBody ReqToBeProcessedDTO param, HttpServletResponse response){ | |||
todoCenterManage.exportPendingProjectList(response,param); | |||
// ExcelDownUtil.downXlsx(response,param,todoCenterManage::exportPendingProjectList); | |||
} | |||
@@ -4,7 +4,9 @@ import cn.hutool.core.collection.CollectionUtil; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import cn.hutool.core.util.StrUtil; | |||
import cn.hutool.json.JSONUtil; | |||
import com.alibaba.druid.support.json.JSONUtils; | |||
import com.alibaba.excel.EasyExcel; | |||
import com.alibaba.fastjson.JSON; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.alibaba.xxpt.gateway.shared.api.request.OapiMessageWorkNotificationRequest; | |||
import com.alibaba.xxpt.gateway.shared.api.response.OapiMessageWorkNotificationResponse; | |||
@@ -221,8 +223,6 @@ public class TodoCenterManage { | |||
* @since 2023/02/01 17:44 | |||
*/ | |||
public void exportPendingProjectList(HttpServletResponse response, ReqToBeProcessedDTO param) { | |||
Page<Project> page = param.page(); | |||
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class); | |||
wrapper.like(StrUtil.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) | |||
.like(StrUtil.isNotBlank(param.getBuildUnitName()),Project::getBuildOrgName,param.getBuildUnitName()) | |||
@@ -230,9 +230,7 @@ public class TodoCenterManage { | |||
.eq(Objects.nonNull(param.getIsSupplement()),Project::getIsTemporaryAugment,param.getIsSupplement()) | |||
.ge(Objects.nonNull(param.getProcessLaunchStartTime()),Project::getBeginTime,param.getProcessLaunchStartTime()) | |||
.le(Objects.nonNull(param.getProcessLaunchEndTime()),Project::getEndTime,param.getProcessLaunchEndTime()); | |||
projectService.page(page,wrapper); | |||
List<Project> records = page.getRecords(); | |||
List<Project> records = projectService.list(wrapper); | |||
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); | |||
@@ -244,31 +242,32 @@ public class TodoCenterManage { | |||
} | |||
excelExportWriter.setFileName(fileName); | |||
List<String> sheetsName = new ArrayList<>(); | |||
sheetsName.add("sheet1"); | |||
List<String> sheetsNames = new ArrayList<>(); | |||
sheetsNames.add(fileName); | |||
// 表体列数据集合 | |||
List<String> columnList = new ArrayList<>(); | |||
List<List<String>> columnList = new ArrayList<>(); | |||
// 表体行数据集合 | |||
List<List<String>> rowList = new ArrayList<>(); | |||
List<String> rowList = param.getExportOptionList(); | |||
records.stream().forEach(record -> { | |||
List<String> rowValues = new ArrayList<>(); | |||
rowList.stream().forEach(c -> { | |||
String s = JSON.toJSONString(record); | |||
JSONObject jsonObject = JSON.parseObject(s); | |||
String rowValue = String.valueOf(jsonObject.get(c)); | |||
rowValues.add(rowValue); | |||
}); | |||
columnList.add(rowValues); | |||
}); | |||
// sheet列表集合 | |||
List<List<List<String>>> sheets = new ArrayList<>(); | |||
ExportOption exportOption = param.getExportOption(); | |||
sheets.add(columnList); | |||
excelExportWriter.setHeads(sheets); | |||
List<ExcelExportDTO> data = records.stream().map(r -> { | |||
ExcelExportDTO res = new ExcelExportDTO(); | |||
BeanUtils.copyProperties(r, res); | |||
return res; | |||
}).collect(Collectors.toList()); | |||
excelExportWriter.setDatas(data); | |||
excelExportWriter.setSheets(sheetsName); | |||
excelExportWriter.setHeadPropertyClass(ExcelExportDTO.class); | |||
excelExportWriter.setDatas(columnList); | |||
excelExportWriter.setSheets(sheetsNames); | |||
excelExportWriter.setHeadPropertyClass(List.class); | |||
excelExportWriter.setHeadPropertyFlag(Boolean.FALSE); | |||
ExcelDownUtil.excelExportFile(response,excelExportWriter); | |||
} | |||
/** | |||
@@ -50,6 +50,6 @@ public class ReqToBeProcessedDTO extends PagePo implements Serializable { | |||
private Integer isSupplement; | |||
@ApiModelProperty("导出选项") | |||
private ExportOption exportOption; | |||
private List<String> exportOptionList; | |||
} |
@@ -3,7 +3,7 @@ package com.ningdatech.pmapi.statemachine; | |||
import com.ningdatech.pmapi.AppTests; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import org.junit.Test; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
@@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSON; | |||
import com.ningdatech.pmapi.AppTests; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
import org.junit.Test; | |||