@@ -0,0 +1,22 @@ | |||||
package com.ningdatech.pmapi.common.enums; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
import lombok.NoArgsConstructor; | |||||
@Getter | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
public enum ProjectProessStageEnum { | |||||
/** | |||||
* 项目流程配置 阶段枚举 | |||||
*/ | |||||
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,"验收申报审批流程"); | |||||
private Integer code; | |||||
private String desc; | |||||
} |
@@ -0,0 +1,218 @@ | |||||
package com.ningdatech.pmapi.common.model.entity; | |||||
import com.alibaba.excel.annotation.ExcelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import java.io.Serializable; | |||||
/** | |||||
* 待办中心待我处理项目列表导出实体 | |||||
* | |||||
* @author CMM | |||||
* @since 2023/01/19 16:42 | |||||
*/ | |||||
@Data | |||||
@NoArgsConstructor | |||||
@AllArgsConstructor | |||||
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; | |||||
@ExcelProperty("项目名称") | |||||
private String projectName; | |||||
@ExcelProperty("行政区划编码") | |||||
private String areaCode; | |||||
@ExcelProperty("行政区划名称") | |||||
private String area; | |||||
@ExcelProperty("项目负责人") | |||||
private String responsibleMan; | |||||
@ExcelProperty("项目负责人手机号") | |||||
private String responsibleManMobile; | |||||
@ExcelProperty("项目联系人") | |||||
private String contactName; | |||||
@ExcelProperty("项目联系人手机号") | |||||
private String contactPhone; | |||||
@ExcelProperty("上级业务主管单位") | |||||
private String higherSuperOrg; | |||||
@ExcelProperty("上级主管单位浙政钉ID") | |||||
private String higherSuperOrgCode; | |||||
@ExcelProperty("本级主管部门") | |||||
private String superOrg; | |||||
@ExcelProperty("本级主管部门浙政钉ID") | |||||
private String superOrgCode; | |||||
@ExcelProperty("建设单位名称") | |||||
private String buildOrgName; | |||||
@ExcelProperty("建设单位浙政钉ID") | |||||
private String buildOrgZheJiangGovDingId; | |||||
@ExcelProperty("建设单位统一信用代码") | |||||
private String buildOrgCode; | |||||
@ExcelProperty("项目类型") | |||||
private Integer projectType; | |||||
@ExcelProperty("是否首次新建") | |||||
private Integer isFirst; | |||||
@ExcelProperty("关联应用") | |||||
private Boolean includeApplication; | |||||
@ExcelProperty("关联应用IRS编码") | |||||
private Boolean includeApplicationIRSCode; | |||||
@ExcelProperty("申报金额(万元)") | |||||
private Boolean declareAmount; | |||||
@ExcelProperty("批复金额") | |||||
private Boolean approvedTotalInvestmentIncrease; | |||||
@ExcelProperty("预算来源") | |||||
private Boolean budgetSource; | |||||
@ExcelProperty("预算年度") | |||||
private Boolean budgetYear; | |||||
@ExcelProperty("项目简介") | |||||
private Boolean projectIntroduction; | |||||
@ExcelProperty("立项依据") | |||||
private Boolean buildBasis; | |||||
@ExcelProperty("建设层级") | |||||
private Boolean buildLevel; | |||||
@ExcelProperty("发改编码") | |||||
private Boolean developCode; | |||||
@ExcelProperty("财政编码") | |||||
private Boolean financialCode; | |||||
@ExcelProperty("信息是否有效") | |||||
private Boolean informationValidity; | |||||
@ExcelProperty("是否数字化改革项目") | |||||
private Boolean isDigitalReform; | |||||
@ExcelProperty("综合应用领域") | |||||
private Boolean bizDomain; | |||||
@ExcelProperty("是否上云") | |||||
private Boolean isCloud; | |||||
@ExcelProperty("云类型") | |||||
private Boolean cloudType; | |||||
@ExcelProperty("四大体系") | |||||
private Boolean fourSystems; | |||||
@ExcelProperty("是否临时增补") | |||||
private Boolean isTemporaryAugment; | |||||
@ExcelProperty("等保级别") | |||||
private Boolean protectionLevel; | |||||
@ExcelProperty("是否密评 0:否 1:是") | |||||
private Boolean isSecretComments; | |||||
@ExcelProperty("业务编号") | |||||
private Boolean businessNumber; | |||||
@ExcelProperty("业务名称") | |||||
private Boolean businessName; | |||||
@ExcelProperty("单位名称") | |||||
private Boolean unitName; | |||||
@ExcelProperty("软件开发(万元)") | |||||
private Boolean softwareDevelopmentAmount; | |||||
@ExcelProperty("云资源、硬件购置(万元)") | |||||
private Boolean cloudHardwarePurchaseAmount; | |||||
@ExcelProperty("第三方服务(万元)") | |||||
private Boolean thirdPartyAmount; | |||||
@ExcelProperty("投入项") | |||||
private Boolean safetyInputTitle; | |||||
@ExcelProperty("内容描述") | |||||
private Boolean safetyInputDescribe; | |||||
@ExcelProperty("金额(万元)") | |||||
private Boolean safetyInputAmount; | |||||
@ExcelProperty("年度支付金额(万元)") | |||||
private Boolean annualPlanAmount; | |||||
@ExcelProperty("自有资金(万元)") | |||||
private Boolean annualPlanHaveAmount; | |||||
@ExcelProperty("政府投资-本级财政资金(万元)") | |||||
private Boolean declareGovernmentOwnFinanceAmount; | |||||
@ExcelProperty("政府投资-上级补助资金(万元)") | |||||
private Boolean declareGovernmentSuperiorFinanceAmount; | |||||
@ExcelProperty("银行贷款(万元)") | |||||
private Boolean declareBankLendingAmount; | |||||
@ExcelProperty("其它资金(万元)") | |||||
private Boolean declareOtherAmount; | |||||
@ExcelProperty("第一季度") | |||||
private Boolean engineeringSpeedOne; | |||||
@ExcelProperty("第二季度") | |||||
private Boolean engineeringSpeedTwo; | |||||
@ExcelProperty("第三季度") | |||||
private Boolean engineeringSpeedThree; | |||||
@ExcelProperty("第四季度") | |||||
private Boolean engineeringSpeedFour; | |||||
@ExcelProperty("初步方案") | |||||
private Boolean preliminaryPlanFile; | |||||
@ExcelProperty("附件-佐证材料") | |||||
private Boolean supportingMaterialsFile; | |||||
@ExcelProperty("备注") | |||||
private Boolean projectRemarks; | |||||
} |
@@ -0,0 +1,65 @@ | |||||
package com.ningdatech.pmapi.common.model.entity; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import java.util.Collection; | |||||
import java.util.List; | |||||
/** | |||||
* 文件模板导出对象 | |||||
* @author CMM | |||||
* @since 2023/02/11 11:26 | |||||
*/ | |||||
@Data | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
public class ExcelExportWriter { | |||||
/** | |||||
* 文件名称 | |||||
*/ | |||||
private String fileName; | |||||
/** | |||||
* sheet 名称数组 | |||||
*/ | |||||
private List<String> sheets; | |||||
/** | |||||
* 是否启用 头部Excel属性。 | |||||
* 如果使用,则会读取 class对象注解 ExcelProperty 属性值。 | |||||
* 不启用:则会根据heads 动态对列名称去便利 | |||||
*/ | |||||
private Boolean headPropertyFlag; | |||||
/** | |||||
* 头部属性class | |||||
*/ | |||||
private Class headPropertyClass; | |||||
/** | |||||
* 动态列名称 | |||||
* 描述: | |||||
* 第一个List 代表:sheet 列表集合 | |||||
* 第二个List 代表:表体行数据(集合) | |||||
* 第三个list 代表:表体列数据(集合) | |||||
*/ | |||||
private List<List<List<String>>> heads; | |||||
/** | |||||
* 数据对象 | |||||
* 1、对象写:根据对象固定字段写(分为三层) | |||||
* 第二个List 代表:表体行数据(集合) | |||||
* 第三个对象(class) 对象 | |||||
* List<ActivityUserPrizeVO> | |||||
* | |||||
* 2、无对象写(动态表体数据) 分为三层 | |||||
* 第一个List 代表:表体行数据(集合) | |||||
* 第二个list 代表:表体列数据(集合) | |||||
* List<List<Object>> | |||||
*/ | |||||
private Collection<?> datas; | |||||
} |
@@ -28,126 +28,126 @@ public class ProjectDeclareAction { | |||||
@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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.TO_BE_DECLARED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | |||||
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | |||||
} | } | ||||
@OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS",target = "PRE_APPLYING") | @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS",target = "PRE_APPLYING") | ||||
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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode()); | |||||
} | } | ||||
@OnTransition(source = "PRE_APPLYING",target = "PENDING_PREQUALIFICATION_CHOICE") | @OnTransition(source = "PRE_APPLYING",target = "PENDING_PREQUALIFICATION_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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); | |||||
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); | |||||
project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.SCHEME_REVIEW_FAILED.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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | |||||
} | } | ||||
@@ -155,51 +155,51 @@ public class ProjectDeclareAction { | |||||
public void PROJECT_APPROVAL(Message<ProjectStatusChangeEvent> message){ | public void PROJECT_APPROVAL(Message<ProjectStatusChangeEvent> message){ | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
// 待立项批复批复后,项目一级状态变更为已立项 | // 待立项批复批复后,项目一级状态变更为已立项 | ||||
project.setProjectStatusFirst(ProjectStatusEnum.PROJECT_APPROVED.getCode()); | |||||
project.setProjectStatusSecond(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); | |||||
project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); | |||||
} | } | ||||
@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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | |||||
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); | |||||
} | } | ||||
@OnTransition(source = "TO_BE_PURCHASED",target = "UNDER_CONSTRUCTION") | @OnTransition(source = "TO_BE_PURCHASED",target = "UNDER_CONSTRUCTION") | ||||
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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
// 待采购状态撤回后,项目一级状态回退到未立项 | // 待采购状态撤回后,项目一级状态回退到未立项 | ||||
project.setProjectStatusFirst(ProjectStatusEnum.NOT_APPROVED.getCode()); | |||||
project.setProjectStatusSecond(ProjectStatusEnum.TO_BE_APPROVED.getCode()); | |||||
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode()); | |||||
} | } | ||||
@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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | |||||
project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | |||||
project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | |||||
} | } | ||||
@@ -207,18 +207,18 @@ public class ProjectDeclareAction { | |||||
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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
// 终验审核通过后,项目一级状态变更为已归档 | // 终验审核通过后,项目一级状态变更为已归档 | ||||
project.setProjectStatusFirst(ProjectStatusEnum.ARCHIVED.getCode()); | |||||
project.setProjectStatusSecond(ProjectStatusEnum.ARCHIVED.getCode()); | |||||
project.setStage(ProjectStatusEnum.ARCHIVED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.ARCHIVED.getCode()); | |||||
} | } | ||||
@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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode()); | |||||
} | } | ||||
@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW",target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") | @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW",target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") | ||||
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 = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setProjectStatusSecond(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); | |||||
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); | |||||
} | } | ||||
@@ -230,11 +230,11 @@ public class ProjectDeclareAction { | |||||
ProjectStatusEnum projectStatusEnum = 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); | Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | ||||
log.info("预审申报事件之前,项目的状态为:{}"+project.getProjectStatusSecond()); | |||||
log.info("预审申报事件之前,项目的状态为:{}"+project.getStatus()); | |||||
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){ | if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){ | ||||
project.setProjectStatusSecond(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()); | |||||
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()); | |||||
}else { | }else { | ||||
project.setProjectStatusSecond(ProjectStatusEnum.PRE_APPLYING.getCode()); | |||||
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -26,11 +26,11 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro | |||||
ProjectStatusEnum projectStatusEnum = 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); | Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | ||||
log.info("预审申报事件之前,项目的状态为:{}"+project.getProjectStatusSecond()); | |||||
log.info("预审申报事件之前,项目的状态为:{}"+project.getStatus()); | |||||
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){ | if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){ | ||||
project.setProjectStatusSecond(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()); | |||||
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()); | |||||
}else { | }else { | ||||
project.setProjectStatusSecond(ProjectStatusEnum.PRE_APPLYING.getCode()); | |||||
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -259,7 +259,7 @@ public class ProjectDeclareStateMachineBuilder { | |||||
@Override | @Override | ||||
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) { | public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) { | ||||
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValueByCode(contextObj.getProjectStatusSecond()), | |||||
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValueByCode(contextObj.getStatus()), | |||||
null, null, null, null, MACHINEID_TO); | null, null, null, null, MACHINEID_TO); | ||||
return result; | return result; | ||||
} | } | ||||
@@ -37,14 +37,14 @@ public class StateMachineUtils { | |||||
private StateMachinePersister projectDeclareStateMachinePersister; | private StateMachinePersister projectDeclareStateMachinePersister; | ||||
public void execute(Project project, ProjectStatusChangeEvent event) throws Exception{ | public void execute(Project project, ProjectStatusChangeEvent event) throws Exception{ | ||||
log.info("调用状态机前的项目状态为>>>>>>>>>>{}"+project.getProjectStatusSecond()); | |||||
log.info("调用状态机前的项目状态为>>>>>>>>>>{}"+project.getStatus()); | |||||
//获取TO状态机 | //获取TO状态机 | ||||
StateMachine<ProjectStatusEnum, ProjectStatusChangeEvent> stateMachine = projectDeclareStateMachineBuilder.build(); | StateMachine<ProjectStatusEnum, ProjectStatusChangeEvent> stateMachine = projectDeclareStateMachineBuilder.build(); | ||||
Message message = MessageBuilder.withPayload(event).setHeader(PROJECT_DECLARE, project).build(); | Message message = MessageBuilder.withPayload(event).setHeader(PROJECT_DECLARE, project).build(); | ||||
//初始化状态机 | //初始化状态机 | ||||
projectDeclareStateMachinePersister.restore(stateMachine,project); | projectDeclareStateMachinePersister.restore(stateMachine,project); | ||||
stateMachine.sendEvent(message); | stateMachine.sendEvent(message); | ||||
log.info("调用状态机后的项目状态为>>>>>>>>>>{}"+project.getProjectStatusSecond()); | |||||
log.info("调用状态机后的项目状态为>>>>>>>>>>{}"+project.getStatus()); | |||||
} | } | ||||
/** | /** | ||||
@@ -2,11 +2,21 @@ package com.ningdatech.pmapi.common.util; | |||||
import java.io.UnsupportedEncodingException; | import java.io.UnsupportedEncodingException; | ||||
import java.net.URLEncoder; | import java.net.URLEncoder; | ||||
import java.util.Collection; | |||||
import java.util.List; | |||||
import java.util.Objects; | |||||
import java.util.UUID; | import java.util.UUID; | ||||
import java.util.function.BiConsumer; | import java.util.function.BiConsumer; | ||||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
import com.alibaba.druid.wall.violation.ErrorCode; | |||||
import com.alibaba.excel.EasyExcel; | |||||
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 org.apache.commons.collections4.CollectionUtils; | |||||
import org.apache.http.HttpStatus; | import org.apache.http.HttpStatus; | ||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
@@ -68,4 +78,61 @@ public class ExcelDownUtil { | |||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + encodeName(fileName) + ".xls"); | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + encodeName(fileName) + ".xls"); | ||||
} | } | ||||
public static void excelExportFile(HttpServletResponse response, ExcelExportWriter excelExport) { | |||||
try { | |||||
if (Objects.isNull(excelExport)) { | |||||
throw new BizException("导出失败!"); | |||||
} | |||||
setExportResponseHeader(excelExport.getFileName(), response); | |||||
ExcelWriter writer = null; | |||||
//是否启用头部属性、头部属性类不能为空 | |||||
if (Objects.nonNull(excelExport.getHeadPropertyFlag()) && excelExport.getHeadPropertyFlag() && Objects.nonNull(excelExport.getHeadPropertyClass())) { | |||||
writer = EasyExcel.write(response.getOutputStream(), excelExport.getHeadPropertyClass()).build(); | |||||
}else { | |||||
writer = EasyExcel.write(response.getOutputStream()).build(); | |||||
} | |||||
int sheetNum = 0; | |||||
if (CollectionUtils.isNotEmpty(excelExport.getSheets())){ | |||||
sheetNum = excelExport.getSheets().size(); | |||||
}else if (CollectionUtils.isNotEmpty(excelExport.getHeads())) { | |||||
sheetNum = excelExport.getHeads().size(); | |||||
}else if (CollectionUtils.isNotEmpty(excelExport.getDatas())) { | |||||
sheetNum = excelExport.getDatas().size(); | |||||
} | |||||
if (sheetNum == 0){ | |||||
sheetNum = 1; | |||||
} | |||||
for (int i = 0; i < sheetNum; i++) { | |||||
WriteSheet sheet = EasyExcel.writerSheet(i).build(); | |||||
if (CollectionUtils.isNotEmpty(excelExport.getSheets())){ | |||||
sheet.setSheetName(excelExport.getSheets().get(i)); | |||||
} | |||||
if (CollectionUtils.isNotEmpty(excelExport.getHeads())){ | |||||
sheet.setHead(excelExport.getHeads().get(i)); | |||||
} | |||||
if (CollectionUtils.isNotEmpty(excelExport.getDatas())) { | |||||
writer.write((Collection<?>) ((List)excelExport.getDatas()).get(i), sheet); | |||||
}else { | |||||
writer.write((Collection<?>) null, sheet); | |||||
} | |||||
} | |||||
// 最后 finish | |||||
if (null != writer) { | |||||
writer.finish(); | |||||
} | |||||
}catch (Exception e){ | |||||
log.error("export file error!", e); | |||||
throw new BizException("导出失败!"); | |||||
} | |||||
} | |||||
public static void setExportResponseHeader(String fileName, HttpServletResponse response) throws UnsupportedEncodingException { | |||||
// 设置响应头和保存文件名 | |||||
response.setContentType(StrPool.CONTENT_TYPE); | |||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + encodeName(fileName) + ".xls"); | |||||
} | |||||
} | } |
@@ -0,0 +1,17 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.contants; | |||||
public interface DeclaredProjectContant { | |||||
class ProcessDef { | |||||
public static final String PROJECT_STAGE_1 = "单位内部审批流程"; | |||||
public static final String PROJECT_STAGE_2 = "项目预审审批流程"; | |||||
public static final String PROJECT_STAGE_3 = "部门联合审批流程"; | |||||
public static final String PROJECT_STAGE_4 = "建设方案审批流程"; | |||||
public static final String PROJECT_STAGE_5 = "验收申报审批流程"; | |||||
} | |||||
} |
@@ -404,9 +404,11 @@ public class ProjectDraft implements Serializable { | |||||
@ApiModelProperty("试点文件") | @ApiModelProperty("试点文件") | ||||
private String experimentsFile; | private String experimentsFile; | ||||
@ApiModelProperty("新增form内容") | |||||
private String formData; | |||||
@ApiModelProperty("项目应用") | |||||
private String projectApplicationList; | |||||
@ApiModelProperty("新增form内容") | |||||
private String dynamicForm; | |||||
private Long createBy; | private Long createBy; | ||||
private Long updateBy; | private Long updateBy; | ||||
@@ -1,5 +1,7 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.entity.dto; | package com.ningdatech.pmapi.projectdeclared.entity.dto; | ||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.google.common.collect.Maps; | |||||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDto; | import com.ningdatech.pmapi.projectlib.model.dto.ProjectDto; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | ||||
@@ -35,4 +37,12 @@ public class DeclaredProjectDto implements Serializable { | |||||
@NotNull | @NotNull | ||||
private ProcessInstanceUserDto user; | private ProcessInstanceUserDto user; | ||||
public Map<String,Object> getFormData(){ | |||||
if(CollUtil.isNotEmpty(this.formData)){ | |||||
this.formData = Maps.newHashMap(); | |||||
return this.formData; | |||||
} | |||||
return this.formData; | |||||
} | |||||
} | } |
@@ -22,9 +22,9 @@ public class DeclaredProjectListParamDto extends PagePo { | |||||
private Integer projectType; | private Integer projectType; | ||||
private Integer projectStatusFirst; | |||||
private Integer projectStage; | |||||
private Integer projectStatusSecond; | |||||
private Integer projectStatus; | |||||
private Integer projectYear; | private Integer projectYear; | ||||
@@ -0,0 +1,35 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.entity.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Builder; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import java.io.Serializable; | |||||
import java.math.BigDecimal; | |||||
/** | |||||
* @Classname DeclaredProjectDto | |||||
* @Description 申报项目 里的条件判断实体 | |||||
* @Date 2023/2/1 14:52 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Data | |||||
@Builder | |||||
@NoArgsConstructor | |||||
@AllArgsConstructor | |||||
public class ProjectConditionDto implements Serializable { | |||||
private Long projectId; | |||||
@ApiModelProperty("申报金额") | |||||
private BigDecimal declareAmount; | |||||
@ApiModelProperty("是否临时增补 0:否 1:是") | |||||
private Integer isTemporaryAugment; | |||||
@ApiModelProperty("是否数字化改革项目 0:否 1:是") | |||||
private Integer isDigitalReform; | |||||
} |
@@ -1,20 +1,24 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.manage; | package com.ningdatech.pmapi.projectdeclared.manage; | ||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
import com.alibaba.fastjson.TypeReference; | import com.alibaba.fastjson.TypeReference; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
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.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.pmapi.common.enums.ProjectProessStageEnum; | |||||
import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; | import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; | ||||
import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDto; | import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDto; | ||||
import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDto; | import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDto; | ||||
import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDto; | |||||
import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDto; | import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDto; | ||||
import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredDetailVO; | import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredDetailVO; | ||||
import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredListItemVO; | import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredListItemVO; | ||||
import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVo; | import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVo; | ||||
import com.ningdatech.pmapi.projectdeclared.service.IProjectDraftService; | import com.ningdatech.pmapi.projectdeclared.service.IProjectDraftService; | ||||
import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDto; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; | import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; | ||||
@@ -66,8 +70,8 @@ public class DeclaredProjectManage { | |||||
.le(Objects.nonNull(params.getEndTime()), Project::getCreateOn, params.getEndTime()) | .le(Objects.nonNull(params.getEndTime()), Project::getCreateOn, params.getEndTime()) | ||||
.eq(Objects.nonNull(params.getProjectType()), Project::getProjectType, params.getProjectType()) | .eq(Objects.nonNull(params.getProjectType()), Project::getProjectType, params.getProjectType()) | ||||
.eq(Objects.nonNull(params.getProjectYear()), Project::getProjectYear, params.getProjectYear()) | .eq(Objects.nonNull(params.getProjectYear()), Project::getProjectYear, params.getProjectYear()) | ||||
.eq(Objects.nonNull(params.getProjectStatusFirst()), Project::getProjectStatusFirst, params.getProjectStatusFirst()) | |||||
.eq(Objects.nonNull(params.getProjectStatusSecond()), Project::getProjectStatusSecond, params.getProjectStatusSecond()) | |||||
.eq(Objects.nonNull(params.getProjectStage()), Project::getStage, params.getProjectStage()) | |||||
.eq(Objects.nonNull(params.getProjectStatus()), Project::getStatus, params.getProjectStatus()) | |||||
.like(StringUtils.isNotBlank(params.getProjectName()), Project::getProjectName, params.getProjectName()) | .like(StringUtils.isNotBlank(params.getProjectName()), Project::getProjectName, params.getProjectName()) | ||||
.orderByDesc(Project::getUpdateOn); | .orderByDesc(Project::getUpdateOn); | ||||
projectService.page(page,wrapper); | projectService.page(page,wrapper); | ||||
@@ -99,8 +103,8 @@ public class DeclaredProjectManage { | |||||
.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()) | ||||
.eq(Objects.nonNull(params.getProjectYear()), ProjectDraft::getProjectYear, params.getProjectYear()) | .eq(Objects.nonNull(params.getProjectYear()), ProjectDraft::getProjectYear, params.getProjectYear()) | ||||
.eq(Objects.nonNull(params.getProjectStatusFirst()), ProjectDraft::getProjectStatusFirst, params.getProjectStatusFirst()) | |||||
.eq(Objects.nonNull(params.getProjectStatusSecond()), ProjectDraft::getProjectStatusSecond, params.getProjectStatusSecond()) | |||||
.eq(Objects.nonNull(params.getProjectStage()), ProjectDraft::getProjectStatusFirst, params.getProjectStage()) | |||||
.eq(Objects.nonNull(params.getProjectStatus()), ProjectDraft::getProjectStatusSecond, params.getProjectStatus()) | |||||
.like(StringUtils.isNotBlank(params.getProjectName()), ProjectDraft::getProjectName, params.getProjectName()) | .like(StringUtils.isNotBlank(params.getProjectName()), ProjectDraft::getProjectName, params.getProjectName()) | ||||
.orderByDesc(ProjectDraft::getUpdateOn); | .orderByDesc(ProjectDraft::getUpdateOn); | ||||
projectDraftService.page(page,wrapper); | projectDraftService.page(page,wrapper); | ||||
@@ -132,7 +136,7 @@ public class DeclaredProjectManage { | |||||
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | ||||
.eq(WflowModels::getRegionCode, regionCode) | .eq(WflowModels::getRegionCode, regionCode) | ||||
.eq(WflowModels::getFormName, "单位内部审批流程") | |||||
.eq(WflowModels::getFormName, ProjectProessStageEnum.ORG_INTERNAL_APPROVAL_PROCESS.getDesc()) | |||||
.last("limit 1")); | .last("limit 1")); | ||||
if(Objects.isNull(model)){ | if(Objects.isNull(model)){ | ||||
@@ -143,30 +147,55 @@ public class DeclaredProjectManage { | |||||
params.setUser(dto.getUser()); | params.setUser(dto.getUser()); | ||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | //放入条件判断的项目字段 | ||||
dto.getFormData().putAll( | |||||
JSON.parseObject(JSON.toJSONString(dto.getProjectInfo()), new TypeReference<Map<String, Object>>() { | |||||
})); | |||||
ProjectConditionDto conditionDto = new ProjectConditionDto(); | |||||
BeanUtils.copyProperties(dto.getProjectInfo(),conditionDto); | |||||
if(Objects.nonNull(conditionDto)){ | |||||
dto.getFormData().putAll( | |||||
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() {}) | |||||
); | |||||
} | |||||
params.setFormData(dto.getFormData()); | params.setFormData(dto.getFormData()); | ||||
String instanceId = processService.startProcess(model.getProcessDefId(), params); | |||||
String instanceId = processService.startProcess(model.getProcessDefId(), params); | |||||
log.info("申报项目成功 【{}】",instanceId); | log.info("申报项目成功 【{}】",instanceId); | ||||
//保存项目 | |||||
saveProject(dto.getProjectInfo(),instanceId,regionCode); | |||||
return instanceId; | |||||
} | |||||
/** | |||||
* 申报项目 时 新增项目到项目库 | |||||
* @param projectDto | |||||
* @param instanceId | |||||
*/ | |||||
private void saveProject(ProjectDto projectDto,String instanceId,String regionCode) { | |||||
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | ||||
try{ | try{ | ||||
//保存项目表信息 | |||||
Project project = new Project(); | Project project = new Project(); | ||||
BeanUtils.copyProperties(dto.getProjectInfo(),project); | |||||
BeanUtils.copyProperties(projectDto,project); | |||||
project.setCreateOn(LocalDateTime.now()); | project.setCreateOn(LocalDateTime.now()); | ||||
project.setUpdateOn(LocalDateTime.now()); | project.setUpdateOn(LocalDateTime.now()); | ||||
project.setAreaCode(regionCode); | project.setAreaCode(regionCode); | ||||
project.setProjectStatusFirst(ProjectStatusEnum.NOT_APPROVED.getCode()); | |||||
project.setProjectStatusSecond(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | |||||
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | |||||
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | |||||
project.setInstCode(instanceId); | project.setInstCode(instanceId); | ||||
projectService.save(project); | projectService.save(project); | ||||
//保存项目应用 | |||||
if(CollUtil.isNotEmpty(projectDto.getApplicationList())){ | |||||
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | |||||
ProjectApplication projectApplication = new ProjectApplication(); | |||||
BeanUtils.copyProperties(application, projectApplication); | |||||
projectApplication.setProjectId(project.getId()); | |||||
return projectApplication; | |||||
}).collect(Collectors.toList()); | |||||
projectApplicationService.saveBatch(applications); | |||||
} | |||||
}catch (Exception e){ | }catch (Exception e){ | ||||
log.error("项目信息入库错误 ",e); | log.error("项目信息入库错误 ",e); | ||||
throw new BusinessException("项目信息入库错误 请注意格式"); | |||||
throw new BusinessException("项目信息入库错误 :" + e.getMessage()); | |||||
} | } | ||||
return instanceId; | |||||
} | } | ||||
/** | /** | ||||
@@ -0,0 +1,21 @@ | |||||
package com.ningdatech.pmapi.projectlib.controller; | |||||
import io.swagger.annotations.Api; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
/** | |||||
* <p> | |||||
* AnnualPlanController | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 14:07 2023/2/11 | |||||
*/ | |||||
@RestController | |||||
@Api(tags = "年度计划库") | |||||
@RequestMapping("/api/v1/annualPlan") | |||||
public class AnnualPlanController { | |||||
} |
@@ -2,12 +2,16 @@ package com.ningdatech.pmapi.projectlib.controller; | |||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectLibListReq; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | ||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||
import org.springframework.web.bind.annotation.ModelAttribute; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
@@ -29,8 +33,14 @@ public class ProjectLibController { | |||||
@GetMapping("/list") | @GetMapping("/list") | ||||
@ApiOperation("项目库列表") | @ApiOperation("项目库列表") | ||||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectLibListReq req) { | |||||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | |||||
return projectLibManage.projectLibList(req); | return projectLibManage.projectLibList(req); | ||||
} | } | ||||
@GetMapping("/getProjectInfo") | |||||
@ApiOperation("获取申报项目信息") | |||||
private Project getProjectInfo (@Validated @ModelAttribute String processInstanceId){ | |||||
return projectLibManage.getProjectInfo(processInstanceId); | |||||
} | |||||
} | } |
@@ -0,0 +1,46 @@ | |||||
package com.ningdatech.pmapi.projectlib.helper; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||||
/** | |||||
* <p> | |||||
* ProjectHelper | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 14:15 2023/2/11 | |||||
*/ | |||||
public class ProjectHelper { | |||||
/** | |||||
* 通用项目查询 | |||||
* | |||||
* @param req 查询条件 | |||||
* @return / | |||||
**/ | |||||
public static LambdaQueryWrapper<Project> projectQuery(ProjectListReq req) { | |||||
LambdaQueryWrapper<Project> query = new LambdaQueryWrapper<>(); | |||||
query.eq(req.getRegionCode() != null, Project::getAreaCode, req.getRegionCode()); | |||||
query.eq(req.getUserId() != null, Project::getCreateBy, req.getUserId()); | |||||
query.like(req.getProjectName() != null, Project::getProjectName, req.getProjectName()); | |||||
query.eq(req.getProjectType() != null, Project::getProjectType, req.getProjectType()); | |||||
query.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()); | |||||
query.eq(req.getStage() != null, Project::getStage, req.getStage()); | |||||
query.eq(req.getStatus() != null, Project::getStatus, req.getStatus()); | |||||
// 申报金额 | |||||
query.ge(req.getDeclareAmountMin() != null, Project::getDeclareAmount, req.getDeclareAmountMin()); | |||||
query.le(req.getDeclareAmountMax() != null, Project::getDeclareAmount, req.getDeclareAmountMax()); | |||||
// 申报时间 | |||||
query.ge(req.getCreateOnMin() != null, Project::getCreateOn, req.getCreateOnMin()); | |||||
query.le(req.getCreateOnMax() != null, Project::getCreateOn, req.getCreateOnMax()); | |||||
// 批复金额 | |||||
query.ge(req.getApproveAmountMin() != null, Project::getApprovalAmount, req.getApproveAmountMin()); | |||||
query.le(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax()); | |||||
query.like(req.getBuildOrg() != null, Project::getBuildOrgName, req.getBuildOrg()); | |||||
return query; | |||||
} | |||||
} |
@@ -0,0 +1,25 @@ | |||||
package com.ningdatech.pmapi.projectlib.manage; | |||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
import lombok.AllArgsConstructor; | |||||
import org.springframework.stereotype.Component; | |||||
/** | |||||
* <p> | |||||
* AnnualPlanLibManage | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 14:09 2023/2/11 | |||||
*/ | |||||
@Component | |||||
@AllArgsConstructor | |||||
public class AnnualPlanLibManage { | |||||
private final IProjectService projectService; | |||||
public void annulPlanLibList() { | |||||
} | |||||
} |
@@ -5,8 +5,9 @@ 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.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectLibListReq; | |||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -14,9 +15,6 @@ import org.springframework.stereotype.Component; | |||||
import java.util.List; | import java.util.List; | ||||
import static com.ningdatech.pmapi.common.utils.BizUtils.notBlank; | |||||
import static com.ningdatech.pmapi.common.utils.BizUtils.notNull; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* ProjectLibManage | * ProjectLibManage | ||||
@@ -31,33 +29,8 @@ public class ProjectLibManage { | |||||
private final IProjectService projectService; | private final IProjectService projectService; | ||||
private LambdaQueryWrapper<Project> projectLibQuery(ProjectLibListReq req) { | |||||
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class); | |||||
notBlank(req.getProjectName(), w -> query.like(Project::getProjectName, w)); | |||||
notNull(req.getProjectType(), w -> query.eq(Project::getProjectType, w)); | |||||
notNull(req.getProjectYear(), w -> query.eq(Project::getProjectYear, w)); | |||||
// 申报金额 批复金额 | |||||
notNull(req.getApproveAmountMin(), w -> query.ge(Project::getApprovalAmount, w)); | |||||
notNull(req.getApproveAmountMax(), w -> query.le(Project::getApprovalAmount, w)); | |||||
notNull(req.getDeclareAmountMax(), w -> query.le(Project::getDeclareAmount, w)); | |||||
notNull(req.getDeclareAmountMin(), w -> query.ge(Project::getDeclareAmount, w)); | |||||
// 状态查询 | |||||
notNull(req.getStatus1st(), w -> query.ge(Project::getStage, w)); | |||||
notNull(req.getStatus2nd(), w -> query.ge(Project::getStatus, w)); | |||||
notNull(req.getCreateOnMin(), w -> query.ge(Project::getCreateOn, w)); | |||||
notNull(req.getCreateOnMax(), w -> query.le(Project::getCreateOn, w)); | |||||
notBlank(req.getBuildUnit(), w -> query.like(Project::getBuildUnitName, w)); | |||||
query.orderByDesc(Project::getUpdateOn, Project::getCreateOn); | |||||
// TODO 区域编码处理 | |||||
return query; | |||||
} | |||||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectLibListReq req) { | |||||
LambdaQueryWrapper<Project> query = projectLibQuery(req); | |||||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | |||||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | |||||
Page<Project> page = projectService.page(req.page(), query); | Page<Project> page = projectService.page(req.page(), query); | ||||
long total; | long total; | ||||
if ((total = page.getTotal()) == 0) { | if ((total = page.getTotal()) == 0) { | ||||
@@ -69,15 +42,28 @@ public class ProjectLibManage { | |||||
item.setProjectName(w.getProjectName()); | item.setProjectName(w.getProjectName()); | ||||
item.setCreateOn(w.getCreateOn()); | item.setCreateOn(w.getCreateOn()); | ||||
item.setDeclaredAmount(w.getDeclareAmount()); | item.setDeclaredAmount(w.getDeclareAmount()); | ||||
item.setStatus1st(w.getStage()); | |||||
item.setStatus2nd(w.getStatus()); | |||||
item.setStage(w.getStage()); | |||||
item.setStatus(w.getStatus()); | |||||
item.setProjectType(w.getProjectType()); | item.setProjectType(w.getProjectType()); | ||||
item.setProjectYear(w.getProjectYear()); | item.setProjectYear(w.getProjectYear()); | ||||
item.setBuildUnit(w.getBuildUnitName()); | |||||
item.setBuildOrg(w.getBuildOrgName()); | |||||
item.setBizDomain(w.getBizDomain()); | item.setBizDomain(w.getBizDomain()); | ||||
return item; | return item; | ||||
}); | }); | ||||
return PageVo.of(records, total); | return PageVo.of(records, total); | ||||
} | } | ||||
/** | |||||
* | |||||
* @param instanceCode 申报项目流程实例编号 | |||||
* @return com.ningdatech.pmapi.projectlib.model.entity.Project | |||||
* @author CMM | |||||
* @since 2023/02/11 11:15 | |||||
*/ | |||||
public Project getProjectInfo(String instanceCode) { | |||||
// 查询项目申报信息 | |||||
Project projectInfo = projectService.getOne(Wrappers.lambdaQuery(Project.class) | |||||
.eq(Project::getInstCode, instanceCode)); | |||||
return projectInfo; | |||||
} | |||||
} | } |
@@ -1,7 +1,5 @@ | |||||
package com.ningdatech.pmapi.projectlib.model.entity; | package com.ningdatech.pmapi.projectlib.model.entity; | ||||
import cn.hutool.core.io.FileUtil; | |||||
import cn.hutool.core.util.StrUtil; | |||||
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.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
@@ -11,15 +9,11 @@ import lombok.Data; | |||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.nio.charset.StandardCharsets; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.List; | |||||
import java.util.regex.Matcher; | |||||
import java.util.regex.Pattern; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* | |||||
* 项目b | |||||
* </p> | * </p> | ||||
* | * | ||||
* @author WendyYang | * @author WendyYang | ||||
@@ -67,13 +61,13 @@ public class Project implements Serializable { | |||||
private String contactPhone; | private String contactPhone; | ||||
@ApiModelProperty("建设单位名称") | @ApiModelProperty("建设单位名称") | ||||
private String buildUnitName; | |||||
private String buildOrgName; | |||||
@ApiModelProperty("建设单位统一社会信用代码") | @ApiModelProperty("建设单位统一社会信用代码") | ||||
private String buildUnitCode; | |||||
private String buildOrgCode; | |||||
@ApiModelProperty("建设单位浙政钉ID") | @ApiModelProperty("建设单位浙政钉ID") | ||||
private String buildUnitZheJiangGovernmentDingId; | |||||
private String buildOrgZheJiangGovDingId; | |||||
@ApiModelProperty("项目类型 1:建设 2:运维") | @ApiModelProperty("项目类型 1:建设 2:运维") | ||||
private Integer projectType; | private Integer projectType; | ||||
@@ -132,10 +126,10 @@ public class Project implements Serializable { | |||||
private BigDecimal declareHaveAmount; | private BigDecimal declareHaveAmount; | ||||
@ApiModelProperty("资金申报情况-政府投资-本级财政资金(万元)") | @ApiModelProperty("资金申报情况-政府投资-本级财政资金(万元)") | ||||
private BigDecimal declareGovernmentOwnFinanceAmount; | |||||
private BigDecimal declareGovOwnFinanceAmount; | |||||
@ApiModelProperty("资金申报情况-政府投资-上级补助资金(万元)") | @ApiModelProperty("资金申报情况-政府投资-上级补助资金(万元)") | ||||
private BigDecimal declareGovernmentSuperiorFinanceAmount; | |||||
private BigDecimal declareGovSuperiorFinanceAmount; | |||||
@ApiModelProperty("银行贷款(万元)") | @ApiModelProperty("银行贷款(万元)") | ||||
private BigDecimal declareBankLendingAmount; | private BigDecimal declareBankLendingAmount; | ||||
@@ -159,10 +153,10 @@ public class Project implements Serializable { | |||||
private BigDecimal annualPlanHaveAmount; | private BigDecimal annualPlanHaveAmount; | ||||
@ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") | @ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") | ||||
private BigDecimal annualPlanGovernmentOwnFinanceAmount; | |||||
private BigDecimal annualPlanGovOwnFinanceAmount; | |||||
@ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") | @ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") | ||||
private BigDecimal annualPlanGovernmentSuperiorFinanceAmount; | |||||
private BigDecimal annualPlanGovSuperiorFinanceAmount; | |||||
@ApiModelProperty("年度支付计划-银行贷款(万元)") | @ApiModelProperty("年度支付计划-银行贷款(万元)") | ||||
private BigDecimal annualPlanBankLendingAmount; | private BigDecimal annualPlanBankLendingAmount; | ||||
@@ -267,16 +261,16 @@ public class Project implements Serializable { | |||||
private BigDecimal approvedTotalInvestmentIncrease; | private BigDecimal approvedTotalInvestmentIncrease; | ||||
@ApiModelProperty("上级主管部门") | @ApiModelProperty("上级主管部门") | ||||
private String higherSuperUnit; | |||||
private String higherSuperOrg; | |||||
@ApiModelProperty("上级主管部门Code") | @ApiModelProperty("上级主管部门Code") | ||||
private String higherSuperUnitCode; | |||||
private String higherSuperOrgCode; | |||||
@ApiModelProperty("主管部门名称") | @ApiModelProperty("主管部门名称") | ||||
private String superUnit; | |||||
private String superOrg; | |||||
@ApiModelProperty("主管部门Code") | @ApiModelProperty("主管部门Code") | ||||
private String superUnitCode; | |||||
private String superOrgCode; | |||||
@ApiModelProperty("前端所需验证字段") | @ApiModelProperty("前端所需验证字段") | ||||
private Integer allApplicationsDone; | private Integer allApplicationsDone; | ||||
@@ -29,7 +29,7 @@ public class ProjectApplication implements Serializable { | |||||
private Long id; | private Long id; | ||||
@ApiModelProperty("项目ID") | @ApiModelProperty("项目ID") | ||||
private String projectId; | |||||
private Long projectId; | |||||
@ApiModelProperty("是否初次建设 0否 1是") | @ApiModelProperty("是否初次建设 0否 1是") | ||||
private Integer isFirst; | private Integer isFirst; | ||||
@@ -18,9 +18,9 @@ import java.time.LocalDateTime; | |||||
* @since 14:35 2023/2/1 | * @since 14:35 2023/2/1 | ||||
*/ | */ | ||||
@Data | @Data | ||||
@ApiModel("项目库列表查询") | |||||
@ApiModel("项目列表查询") | |||||
@EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
public class ProjectLibListReq extends PagePo { | |||||
public class ProjectListReq extends PagePo { | |||||
@ApiModelProperty("区域编码") | @ApiModelProperty("区域编码") | ||||
private String regionCode; | private String regionCode; | ||||
@@ -29,7 +29,7 @@ public class ProjectLibListReq extends PagePo { | |||||
private String projectName; | private String projectName; | ||||
@ApiModelProperty("申报单位") | @ApiModelProperty("申报单位") | ||||
private String buildUnit; | |||||
private String buildOrg; | |||||
@ApiModelProperty("项目类型") | @ApiModelProperty("项目类型") | ||||
private Integer projectType; | private Integer projectType; | ||||
@@ -37,11 +37,11 @@ public class ProjectLibListReq extends PagePo { | |||||
@ApiModelProperty("预算年度") | @ApiModelProperty("预算年度") | ||||
private Integer projectYear; | private Integer projectYear; | ||||
@ApiModelProperty("项目状态") | |||||
private Integer status1st; | |||||
@ApiModelProperty("项目阶段") | |||||
private Integer stage; | |||||
@ApiModelProperty("项目状态") | @ApiModelProperty("项目状态") | ||||
private Integer status2nd; | |||||
private Integer status; | |||||
@ApiModelProperty("申报金额") | @ApiModelProperty("申报金额") | ||||
private BigDecimal declareAmountMin; | private BigDecimal declareAmountMin; | ||||
@@ -61,4 +61,7 @@ public class ProjectLibListReq extends PagePo { | |||||
@ApiModelProperty("创建时间") | @ApiModelProperty("创建时间") | ||||
private LocalDateTime createOnMax; | private LocalDateTime createOnMax; | ||||
@ApiModelProperty("用户ID") | |||||
private Long userId; | |||||
} | } |
@@ -34,17 +34,17 @@ public class ProjectLibListItemVO { | |||||
@ApiModelProperty("项目类型") | @ApiModelProperty("项目类型") | ||||
private Integer projectType; | private Integer projectType; | ||||
@ApiModelProperty("项目状态") | |||||
private Integer status1st; | |||||
@ApiModelProperty("项目阶段") | |||||
private Integer stage; | |||||
@ApiModelProperty("项目状态") | @ApiModelProperty("项目状态") | ||||
private Integer status2nd; | |||||
private Integer status; | |||||
@ApiModelProperty("申报年度") | @ApiModelProperty("申报年度") | ||||
private Integer projectYear; | private Integer projectYear; | ||||
@ApiModelProperty("申报单位") | @ApiModelProperty("申报单位") | ||||
private String buildUnit; | |||||
private String buildOrg; | |||||
@ApiModelProperty("业务领域") | @ApiModelProperty("业务领域") | ||||
private String bizDomain; | private String bizDomain; | ||||
@@ -0,0 +1,197 @@ | |||||
package com.ningdatech.pmapi.todocenter.bean.entity; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
/** | |||||
* 导出选项实体类 | |||||
* | |||||
* @author CMM | |||||
* @since 2023/02/10 16:38 | |||||
*/ | |||||
@Data | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
public class ExportOption { | |||||
/** | |||||
* 导出选项 | |||||
*/ | |||||
@ApiModelProperty("项目ID") | |||||
private Boolean id; | |||||
@ApiModelProperty("项目名称") | |||||
private Boolean name; | |||||
@ApiModelProperty("行政区划编码") | |||||
private Boolean areaCode; | |||||
@ApiModelProperty("行政区划名称") | |||||
private Boolean area; | |||||
@ApiModelProperty("项目负责人") | |||||
private Boolean responsibleMan; | |||||
@ApiModelProperty("项目负责人手机号") | |||||
private Boolean responsibleManMobile; | |||||
@ApiModelProperty("项目联系人") | |||||
private Boolean contactName; | |||||
@ApiModelProperty("项目联系人手机号") | |||||
private Boolean contactPhone; | |||||
@ApiModelProperty("上级业务主管单位") | |||||
private Boolean higherSuperUnit; | |||||
@ApiModelProperty("上级主管单位浙政钉ID") | |||||
private Boolean higherSuperUnitCode; | |||||
@ApiModelProperty("本级主管部门") | |||||
private Boolean superUnit; | |||||
@ApiModelProperty("本级主管部门浙政钉ID") | |||||
private Boolean superUnitCode; | |||||
@ApiModelProperty("建设单位名称") | |||||
private Boolean constructionUnitName; | |||||
@ApiModelProperty("建设单位浙政钉ID") | |||||
private Boolean buildUnitZheJiangGovernmentDingId; | |||||
@ApiModelProperty("建设单位统一信用代码") | |||||
private Boolean buildUnitCode; | |||||
@ApiModelProperty("项目类型") | |||||
private Boolean projectType; | |||||
@ApiModelProperty("是否首次新建") | |||||
private Boolean isFirst; | |||||
@ApiModelProperty("关联应用") | |||||
private Boolean includeApplication; | |||||
@ApiModelProperty("关联应用IRS编码") | |||||
private Boolean includeApplicationIRSCode; | |||||
@ApiModelProperty("申报金额(万元)") | |||||
private Boolean declareAmount; | |||||
@ApiModelProperty("批复金额") | |||||
private Boolean approvedTotalInvestmentIncrease; | |||||
@ApiModelProperty("预算来源") | |||||
private Boolean budgetSource; | |||||
@ApiModelProperty("预算年度") | |||||
private Boolean budgetYear; | |||||
@ApiModelProperty("项目简介") | |||||
private Boolean projectIntroduction; | |||||
@ApiModelProperty("立项依据") | |||||
private Boolean buildBasis; | |||||
@ApiModelProperty("建设层级") | |||||
private Boolean buildLevel; | |||||
@ApiModelProperty("发改编码") | |||||
private Boolean developCode; | |||||
@ApiModelProperty("财政编码") | |||||
private Boolean financialCode; | |||||
@ApiModelProperty("信息是否有效") | |||||
private Boolean informationValidity; | |||||
@ApiModelProperty("是否数字化改革项目") | |||||
private Boolean isDigitalReform; | |||||
@ApiModelProperty("综合应用领域") | |||||
private Boolean bizDomain; | |||||
@ApiModelProperty("是否上云") | |||||
private Boolean isCloud; | |||||
@ApiModelProperty("云类型") | |||||
private Boolean cloudType; | |||||
@ApiModelProperty("四大体系") | |||||
private Boolean fourSystems; | |||||
@ApiModelProperty("是否临时增补") | |||||
private Boolean isTemporaryAugment; | |||||
@ApiModelProperty("等保级别") | |||||
private Boolean protectionLevel; | |||||
@ApiModelProperty("是否密评 0:否 1:是") | |||||
private Boolean isSecretComments; | |||||
@ApiModelProperty("业务编号") | |||||
private Boolean businessNumber; | |||||
@ApiModelProperty("业务名称") | |||||
private Boolean businessName; | |||||
@ApiModelProperty("单位名称") | |||||
private Boolean unitName; | |||||
@ApiModelProperty("软件开发(万元)") | |||||
private Boolean softwareDevelopmentAmount; | |||||
@ApiModelProperty("云资源、硬件购置(万元)") | |||||
private Boolean cloudHardwarePurchaseAmount; | |||||
@ApiModelProperty("第三方服务(万元)") | |||||
private Boolean thirdPartyAmount; | |||||
@ApiModelProperty("投入项") | |||||
private Boolean safetyInputTitle; | |||||
@ApiModelProperty("内容描述") | |||||
private Boolean safetyInputDescribe; | |||||
@ApiModelProperty("金额(万元)") | |||||
private Boolean safetyInputAmount; | |||||
@ApiModelProperty("年度支付金额(万元)") | |||||
private Boolean annualPlanAmount; | |||||
@ApiModelProperty("自有资金(万元)") | |||||
private Boolean annualPlanHaveAmount; | |||||
@ApiModelProperty("政府投资-本级财政资金(万元)") | |||||
private Boolean declareGovernmentOwnFinanceAmount; | |||||
@ApiModelProperty("政府投资-上级补助资金(万元)") | |||||
private Boolean declareGovernmentSuperiorFinanceAmount; | |||||
@ApiModelProperty("银行贷款(万元)") | |||||
private Boolean declareBankLendingAmount; | |||||
@ApiModelProperty("其它资金(万元)") | |||||
private Boolean declareOtherAmount; | |||||
@ApiModelProperty("第一季度") | |||||
private Boolean engineeringSpeedOne; | |||||
@ApiModelProperty("第二季度") | |||||
private Boolean engineeringSpeedTwo; | |||||
@ApiModelProperty("第三季度") | |||||
private Boolean engineeringSpeedThree; | |||||
@ApiModelProperty("第四季度") | |||||
private Boolean engineeringSpeedFour; | |||||
@ApiModelProperty("初步方案") | |||||
private Boolean preliminaryPlanFile; | |||||
@ApiModelProperty("附件-佐证材料") | |||||
private Boolean supportingMaterialsFile; | |||||
@ApiModelProperty("备注") | |||||
private Boolean projectRemarks; | |||||
} |
@@ -75,8 +75,4 @@ public class ProcessProgressDetailVo { | |||||
* 发起时间 | * 发起时间 | ||||
*/ | */ | ||||
private Date startTime; | private Date startTime; | ||||
/** | |||||
* 项目申报信息 | |||||
*/ | |||||
private Project declaredProjectInfo; | |||||
} | } |
@@ -56,7 +56,8 @@ public class TodoCenterController { | |||||
*/ | */ | ||||
@GetMapping("/exportPending") | @GetMapping("/exportPending") | ||||
public void exportPendingProjectList(ReqToBeProcessedDTO param, HttpServletResponse response){ | public void exportPendingProjectList(ReqToBeProcessedDTO param, HttpServletResponse response){ | ||||
ExcelDownUtil.downXlsx(response,param,todoCenterManage::exportPendingProjectList); | |||||
todoCenterManage.exportPendingProjectList(response,param); | |||||
// ExcelDownUtil.downXlsx(response,param,todoCenterManage::exportPendingProjectList); | |||||
} | } | ||||
/** | /** | ||||
@@ -19,12 +19,15 @@ import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.basic.util.NdDateUtils; | import com.ningdatech.basic.util.NdDateUtils; | ||||
import com.ningdatech.pmapi.common.constant.DingConstant; | import com.ningdatech.pmapi.common.constant.DingConstant; | ||||
import com.ningdatech.pmapi.common.model.entity.ExcelExportDTO; | |||||
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; | |||||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | ||||
import com.ningdatech.pmapi.common.util.ExcelDownUtil; | import com.ningdatech.pmapi.common.util.ExcelDownUtil; | ||||
import com.ningdatech.pmapi.common.util.ExcelExportStyle; | import com.ningdatech.pmapi.common.util.ExcelExportStyle; | ||||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.ningdatech.pmapi.todocenter.bean.entity.ExportOption; | |||||
import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment; | import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment; | ||||
import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode; | import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode; | ||||
import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo; | import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo; | ||||
@@ -58,10 +61,8 @@ import com.wflow.workflow.bean.process.enums.ApprovalModeEnum; | |||||
import com.wflow.workflow.bean.process.enums.NodeTypeEnum; | import com.wflow.workflow.bean.process.enums.NodeTypeEnum; | ||||
import com.wflow.workflow.bean.process.form.Form; | import com.wflow.workflow.bean.process.form.Form; | ||||
import com.wflow.workflow.bean.process.props.ApprovalProps; | import com.wflow.workflow.bean.process.props.ApprovalProps; | ||||
import com.wflow.workflow.bean.vo.ProcessHandlerParamsVo; | |||||
import com.wflow.workflow.bean.vo.ProcessInstanceVo; | import com.wflow.workflow.bean.vo.ProcessInstanceVo; | ||||
import com.wflow.workflow.bean.vo.ProcessTaskVo; | import com.wflow.workflow.bean.vo.ProcessTaskVo; | ||||
import com.wflow.workflow.bean.vo.TaskCommentVo; | |||||
import com.wflow.workflow.config.WflowGlobalVarDef; | import com.wflow.workflow.config.WflowGlobalVarDef; | ||||
import com.wflow.workflow.enums.ProcessHandlerEnum; | import com.wflow.workflow.enums.ProcessHandlerEnum; | ||||
import com.wflow.workflow.service.FormService; | import com.wflow.workflow.service.FormService; | ||||
@@ -69,7 +70,6 @@ import com.wflow.workflow.service.*; | |||||
import com.wflow.workflow.utils.Executor; | import com.wflow.workflow.utils.Executor; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import net.sf.jsqlparser.statement.select.Distinct; | |||||
import org.assertj.core.util.Maps; | import org.assertj.core.util.Maps; | ||||
import org.flowable.bpmn.model.*; | import org.flowable.bpmn.model.*; | ||||
import org.flowable.bpmn.model.Process; | import org.flowable.bpmn.model.Process; | ||||
@@ -86,7 +86,6 @@ import org.flowable.task.api.TaskQuery; | |||||
import org.flowable.task.api.history.HistoricTaskInstance; | import org.flowable.task.api.history.HistoricTaskInstance; | ||||
import org.flowable.task.service.history.NativeHistoricTaskInstanceQuery; | import org.flowable.task.service.history.NativeHistoricTaskInstanceQuery; | ||||
import org.flowable.variable.api.history.HistoricVariableInstance; | import org.flowable.variable.api.history.HistoricVariableInstance; | ||||
import org.flowable.variable.api.history.NativeHistoricVariableInstanceQuery; | |||||
import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
@@ -154,7 +153,7 @@ public class TodoCenterManage { | |||||
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class); | LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class); | ||||
wrapper.like(StrUtil.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) | wrapper.like(StrUtil.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) | ||||
.like(StrUtil.isNotBlank(param.getBuildUnitName()),Project::getBuildUnitName,param.getBuildUnitName()) | |||||
.like(StrUtil.isNotBlank(param.getBuildUnitName()),Project::getBuildOrgName,param.getBuildUnitName()) | |||||
.eq(Objects.nonNull(param.getProjectYear()),Project::getProjectYear,param.getProjectYear()) | .eq(Objects.nonNull(param.getProjectYear()),Project::getProjectYear,param.getProjectYear()) | ||||
.eq(Objects.nonNull(param.getIsSupplement()),Project::getIsTemporaryAugment,param.getIsSupplement()) | .eq(Objects.nonNull(param.getIsSupplement()),Project::getIsTemporaryAugment,param.getIsSupplement()) | ||||
.ge(Objects.nonNull(param.getProcessLaunchStartTime()),Project::getBeginTime,param.getProcessLaunchStartTime()) | .ge(Objects.nonNull(param.getProcessLaunchStartTime()),Project::getBeginTime,param.getProcessLaunchStartTime()) | ||||
@@ -222,25 +221,55 @@ public class TodoCenterManage { | |||||
* @since 2023/02/01 17:44 | * @since 2023/02/01 17:44 | ||||
*/ | */ | ||||
public void exportPendingProjectList(HttpServletResponse response, ReqToBeProcessedDTO param) { | public void exportPendingProjectList(HttpServletResponse response, ReqToBeProcessedDTO param) { | ||||
PageVo<ResToBeProcessedDTO> page = queryPendingProjectList(param); | |||||
List<ResToBeProcessedDTO> collect = (List<ResToBeProcessedDTO>) page.getRecords(); | |||||
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()) | |||||
.eq(Objects.nonNull(param.getProjectYear()),Project::getProjectYear,param.getProjectYear()) | |||||
.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(); | |||||
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); | |||||
String fileName = null; | String fileName = null; | ||||
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsSupplement())){ | if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsSupplement())){ | ||||
fileName = "待办中心_待我处理_增补项目列表"; | fileName = "待办中心_待我处理_增补项目列表"; | ||||
}else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsSupplement())){ | }else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsSupplement())){ | ||||
fileName = "待办中心_待我处理_非增补项目列表"; | fileName = "待办中心_待我处理_非增补项目列表"; | ||||
} | } | ||||
ExcelDownUtil.setFileName(fileName,response); | |||||
//数据导出处理函数 | |||||
try { | |||||
EasyExcel.write(response.getOutputStream(), ResToBeExportDTO.class) | |||||
.autoCloseStream(false) | |||||
.registerWriteHandler(ExcelExportStyle.formalStyle()) | |||||
.sheet(fileName) | |||||
.doWrite(collect); | |||||
} catch (IOException e) { | |||||
throw new BizException("导出失败!"); | |||||
} | |||||
excelExportWriter.setFileName(fileName); | |||||
List<String> sheetsName = new ArrayList<>(); | |||||
sheetsName.add("sheet1"); | |||||
// 表体列数据集合 | |||||
List<String> columnList = new ArrayList<>(); | |||||
// 表体行数据集合 | |||||
List<List<String>> rowList = new ArrayList<>(); | |||||
// sheet列表集合 | |||||
List<List<List<String>>> sheets = new ArrayList<>(); | |||||
ExportOption exportOption = param.getExportOption(); | |||||
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.setHeadPropertyFlag(Boolean.FALSE); | |||||
ExcelDownUtil.excelExportFile(response,excelExportWriter); | |||||
} | } | ||||
/** | /** | ||||
* 流程处理相关操作 | * 流程处理相关操作 | ||||
@@ -336,7 +365,7 @@ public class TodoCenterManage { | |||||
Project declaredProject = projectService.getOne(Wrappers.lambdaQuery(Project.class) | Project declaredProject = projectService.getOne(Wrappers.lambdaQuery(Project.class) | ||||
.eq(Project::getInstCode, task.getProcessInstanceId())); | .eq(Project::getInstCode, task.getProcessInstanceId())); | ||||
// 获取当前流程项目状态 | // 获取当前流程项目状态 | ||||
Integer projectStatusSecond = declaredProject.getProjectStatusSecond(); | |||||
Integer projectStatusSecond = declaredProject.getStatus(); | |||||
// 根据当前状态获取对应的通过事件 | // 根据当前状态获取对应的通过事件 | ||||
ProjectStatusChangeEvent event = stateMachineUtils.getProjectStatusRejectEvent(projectStatusSecond); | ProjectStatusChangeEvent event = stateMachineUtils.getProjectStatusRejectEvent(projectStatusSecond); | ||||
try { | try { | ||||
@@ -447,7 +476,7 @@ public class TodoCenterManage { | |||||
*/ | */ | ||||
private void updatePassProjectStatus(Task task, Long userId, Project declaredProject) { | private void updatePassProjectStatus(Task task, Long userId, Project declaredProject) { | ||||
// 获取当前流程项目状态 | // 获取当前流程项目状态 | ||||
Integer projectStatusSecond = declaredProject.getProjectStatusSecond(); | |||||
Integer projectStatusSecond = declaredProject.getStatus(); | |||||
// 根据当前状态获取对应的通过事件 | // 根据当前状态获取对应的通过事件 | ||||
ProjectStatusChangeEvent event = stateMachineUtils.getProjectStatusPassEvent(projectStatusSecond); | ProjectStatusChangeEvent event = stateMachineUtils.getProjectStatusPassEvent(projectStatusSecond); | ||||
try { | try { | ||||
@@ -658,7 +687,7 @@ public class TodoCenterManage { | |||||
Project declaredProject = projectService.getOne(Wrappers.lambdaQuery(Project.class) | Project declaredProject = projectService.getOne(Wrappers.lambdaQuery(Project.class) | ||||
.eq(Project::getInstCode, task.getProcessInstanceId())); | .eq(Project::getInstCode, task.getProcessInstanceId())); | ||||
// 获取当前流程项目状态 | // 获取当前流程项目状态 | ||||
Integer projectStatusSecond = declaredProject.getProjectStatusSecond(); | |||||
Integer projectStatusSecond = declaredProject.getStatus(); | |||||
// 根据当前状态获取对应的撤回事件 | // 根据当前状态获取对应的撤回事件 | ||||
ProjectStatusChangeEvent event = stateMachineUtils.getProjectStatusWithdrawEvent(projectStatusSecond); | ProjectStatusChangeEvent event = stateMachineUtils.getProjectStatusWithdrawEvent(projectStatusSecond); | ||||
try { | try { | ||||
@@ -775,10 +804,6 @@ public class TodoCenterManage { | |||||
} else if (HisProInsEndActId.END.equals(instance.getEndActivityId())) { | } else if (HisProInsEndActId.END.equals(instance.getEndActivityId())) { | ||||
res.setStatus(ProcessStatusEnum.APPROVED.name()); | res.setStatus(ProcessStatusEnum.APPROVED.name()); | ||||
} | } | ||||
// 查询项目申报信息 | |||||
Project projectInfo = projectService.getOne(Wrappers.lambdaQuery(Project.class) | |||||
.eq(Project::getInstCode, instanceId)); | |||||
res.setDeclaredProjectInfo(projectInfo); | |||||
return res; | return res; | ||||
} | } | ||||
@@ -918,7 +943,7 @@ public class TodoCenterManage { | |||||
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class); | LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class); | ||||
wrapper.like(StrUtil.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) | wrapper.like(StrUtil.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) | ||||
.like(StrUtil.isNotBlank(param.getBuildUnitName()),Project::getBuildUnitName,param.getBuildUnitName()) | |||||
.like(StrUtil.isNotBlank(param.getBuildUnitName()),Project::getBuildOrgName,param.getBuildUnitName()) | |||||
.eq(Objects.nonNull(param.getProjectYear()),Project::getProjectYear,param.getProjectYear()) | .eq(Objects.nonNull(param.getProjectYear()),Project::getProjectYear,param.getProjectYear()) | ||||
.eq(Objects.nonNull(param.getIsSupplement()),Project::getIsTemporaryAugment,param.getIsSupplement()) | .eq(Objects.nonNull(param.getIsSupplement()),Project::getIsTemporaryAugment,param.getIsSupplement()) | ||||
.ge(Objects.nonNull(param.getProcessLaunchStartTime()),Project::getBeginTime,param.getProcessLaunchStartTime()) | .ge(Objects.nonNull(param.getProcessLaunchStartTime()),Project::getBeginTime,param.getProcessLaunchStartTime()) | ||||
@@ -1038,7 +1063,7 @@ public class TodoCenterManage { | |||||
Set<String> historicProcessInstanceIds = historicProcessInstances.stream().map(h -> h.getId()).collect(Collectors.toSet()); | Set<String> historicProcessInstanceIds = historicProcessInstances.stream().map(h -> h.getId()).collect(Collectors.toSet()); | ||||
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class); | LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class); | ||||
wrapper.like(StrUtil.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) | wrapper.like(StrUtil.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) | ||||
.like(StrUtil.isNotBlank(param.getBuildUnitName()),Project::getBuildUnitName,param.getBuildUnitName()) | |||||
.like(StrUtil.isNotBlank(param.getBuildUnitName()),Project::getBuildOrgName,param.getBuildUnitName()) | |||||
.eq(Objects.nonNull(param.getProjectYear()),Project::getProjectYear,param.getProjectYear()) | .eq(Objects.nonNull(param.getProjectYear()),Project::getProjectYear,param.getProjectYear()) | ||||
.eq(Objects.nonNull(param.getIsSupplement()),Project::getIsTemporaryAugment,param.getIsSupplement()) | .eq(Objects.nonNull(param.getIsSupplement()),Project::getIsTemporaryAugment,param.getIsSupplement()) | ||||
.ge(Objects.nonNull(param.getProcessLaunchStartTime()),Project::getBeginTime,param.getProcessLaunchStartTime()) | .ge(Objects.nonNull(param.getProcessLaunchStartTime()),Project::getBeginTime,param.getProcessLaunchStartTime()) | ||||
@@ -1170,7 +1195,7 @@ public class TodoCenterManage { | |||||
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class); | LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class); | ||||
wrapper.like(StrUtil.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) | wrapper.like(StrUtil.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) | ||||
.like(StrUtil.isNotBlank(param.getBuildUnitName()),Project::getBuildUnitName,param.getBuildUnitName()) | |||||
.like(StrUtil.isNotBlank(param.getBuildUnitName()),Project::getBuildOrgName,param.getBuildUnitName()) | |||||
.eq(Objects.nonNull(param.getProjectYear()),Project::getProjectYear,param.getProjectYear()) | .eq(Objects.nonNull(param.getProjectYear()),Project::getProjectYear,param.getProjectYear()) | ||||
.eq(Objects.nonNull(param.getIsSupplement()),Project::getIsTemporaryAugment,param.getIsSupplement()) | .eq(Objects.nonNull(param.getIsSupplement()),Project::getIsTemporaryAugment,param.getIsSupplement()) | ||||
.ge(Objects.nonNull(param.getProcessLaunchStartTime()),Project::getBeginTime,param.getProcessLaunchStartTime()) | .ge(Objects.nonNull(param.getProcessLaunchStartTime()),Project::getBeginTime,param.getProcessLaunchStartTime()) | ||||
@@ -1,10 +1,16 @@ | |||||
package com.ningdatech.pmapi.todocenter.model.dto.req; | package com.ningdatech.pmapi.todocenter.model.dto.req; | ||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.math.BigDecimal; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.List; | |||||
import java.util.Map; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.ningdatech.basic.model.PagePo; | import com.ningdatech.basic.model.PagePo; | ||||
import com.ningdatech.pmapi.todocenter.bean.entity.ExportOption; | |||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.Data; | import lombok.Data; | ||||
@@ -43,5 +49,7 @@ public class ReqToBeProcessedDTO extends PagePo implements Serializable { | |||||
@NotNull(message = "是否增补字段不能为空!") | @NotNull(message = "是否增补字段不能为空!") | ||||
private Integer isSupplement; | private Integer isSupplement; | ||||
@ApiModelProperty("导出选项") | |||||
private ExportOption exportOption; | |||||
} | } |
@@ -1,42 +0,0 @@ | |||||
package com.ningdatech.pmapi.todocenter.model.dto.res; | |||||
import com.alibaba.excel.annotation.ExcelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import org.springframework.format.annotation.DateTimeFormat; | |||||
import java.io.Serializable; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* 待办中心待我处理项目列表导出实体 | |||||
* | |||||
* @author CMM | |||||
* @since 2023/01/19 16:42 | |||||
*/ | |||||
@Data | |||||
@NoArgsConstructor | |||||
@AllArgsConstructor | |||||
public class ResToBeExportDTO 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; | |||||
} |