Browse Source

建设方案申报、详情、盖章并通过修改

tags/24080901
CMM 1 year ago
parent
commit
7dac38ace5
29 changed files with 836 additions and 143 deletions
  1. +2
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java
  2. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java
  3. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java
  4. +3
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  5. +2
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java
  6. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java
  7. +4
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java
  8. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java
  9. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java
  10. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java
  11. +31
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  12. +9
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java
  13. +6
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java
  14. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java
  15. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java
  16. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/CcTaskListener.java
  17. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/ProcessEndListener.java
  18. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java
  19. +4
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NotifyManage.java
  20. +9
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterConstant.java
  21. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeConstant.java
  22. +3
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java
  23. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java
  24. +157
    -50
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  25. +21
    -30
      pmapi/src/main/resources/template/区县-预审申请单.html
  26. +268
    -0
      pmapi/src/main/resources/template/市级-预审申请单.html
  27. +268
    -0
      pmapi/src/main/resources/template/建设方案申请单.html
  28. +0
    -5
      pmapi/src/test/java/com/ningdatech/pmapi/provincial/Test.java
  29. +1
    -2
      pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java

+ 2
- 3
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java View File

@@ -47,7 +47,6 @@ import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectDelayApply;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
@@ -55,7 +54,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.sys.manage.NoticeManage;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.bean.entity.WflowModels;
@@ -285,7 +284,7 @@ public class ProjectFileManage {
projectLibManage.saveProjectByApplyBorrow(project, user, instanceId);

// 发送给第一个审批人消息
noticeManage.sendFirtUser(project, model.getFormName(), instanceId, WorkNoticeContant.PASS_MSG_TEMPLATE,
noticeManage.sendFirtUser(project, model.getFormName(), instanceId, WorkNoticeConstant.PASS_MSG_TEMPLATE,
MsgTypeEnum.PROJECT_REVIEW);

return instanceId;


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java View File

@@ -46,6 +46,8 @@ public class ConstructionPlanController {
return "建设方案申报 【" + instanceId + "】 成功";
}



@GetMapping("/export")
@ApiOperation("可申报建设方案项目列表导出")
@WebLog("可申报建设方案项目列表导出")


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java View File

@@ -31,7 +31,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.sys.manage.NoticeManage;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.bean.entity.WflowModels;
@@ -156,7 +156,7 @@ public class ConstructionPlanManage {

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,
WorkNoticeContant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;
}


+ 3
- 7
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java View File

@@ -23,7 +23,6 @@ import com.ningdatech.pmapi.projectdeclared.model.dto.*;
import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectDraft;
import com.ningdatech.pmapi.projectdeclared.model.vo.ProjectDraftVO;
import com.ningdatech.pmapi.projectdeclared.service.IProjectDraftService;
import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum;
import com.ningdatech.pmapi.projectlib.helper.ProjectHelper;
@@ -31,15 +30,12 @@ import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.sys.manage.NoticeManage;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.bean.entity.WflowModels;
@@ -171,7 +167,7 @@ public class DeclaredProjectManage {

//发送给第一个审批人消息
noticeManage.sendFirtUser(buildProject,model.getFormName(),instanceId,
WorkNoticeContant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;
}
@@ -252,7 +248,7 @@ public class DeclaredProjectManage {

//发送给第一个审批人消息
noticeManage.sendFirtUser(buildProject,model.getFormName(),instanceId,
WorkNoticeContant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;
}


+ 2
- 11
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java View File

@@ -2,10 +2,7 @@ package com.ningdatech.pmapi.projectdeclared.manage;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -17,22 +14,16 @@ import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.common.util.ExcelExportStyle;
import com.ningdatech.pmapi.projectdeclared.model.dto.DeclaredProjectExportDTO;
import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO;
import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO;
import com.ningdatech.pmapi.projectdeclared.model.entity.Contract;
import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan;
import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase;
import com.ningdatech.pmapi.projectdeclared.model.vo.DelayedApplyVO;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum;
import com.ningdatech.pmapi.projectlib.helper.ProjectHelper;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectDelayApply;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
@@ -43,7 +34,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.sys.manage.NoticeManage;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.bean.entity.WflowModels;
@@ -292,7 +283,7 @@ public class DelayedApplyManage {

//发送给第一个审批人消息
noticeManage.sendFirtUser(project,model.getFormName(),instanceId,
WorkNoticeContant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;
}


+ 3
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java View File

@@ -30,7 +30,7 @@ import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.sys.manage.NoticeManage;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.bean.entity.WflowModels;
@@ -242,7 +242,7 @@ public class FinalAcceptanceManage {

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,
WorkNoticeContant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;
}
@@ -302,7 +302,7 @@ public class FinalAcceptanceManage {

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,
WorkNoticeContant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;
}


+ 4
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java View File

@@ -32,8 +32,8 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.staging.service.IProjectStagingService;
import com.ningdatech.pmapi.sys.manage.NoticeManage;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterContant;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.bean.entity.WflowModels;
@@ -127,7 +127,7 @@ public class PrequalificationDeclaredProjectManage {
//保存一下 当前的主管单位发起人
projectInfo.setPreStartUserId(employeeCode);
//当前实例置为空
projectInfo.setInstCode(TodoCenterContant.Declared.NULL_INST_CODE);
projectInfo.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE);
if(projectStagingService.addByProject(projectInfo,"省级部门联审")
&& projectService.updateById(projectInfo)){
return "提交省级部门联审成功";
@@ -208,7 +208,7 @@ public class PrequalificationDeclaredProjectManage {

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,
WorkNoticeContant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return instanceId;
}


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java View File

@@ -12,7 +12,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.sys.manage.NoticeManage;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant;
import com.wflow.bean.entity.WflowModels;
import com.wflow.exception.BusinessException;
import com.wflow.workflow.bean.dto.OrgInfoDTO;
@@ -108,7 +108,7 @@ public class ReviewByDeptJointManage {

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,
WorkNoticeContant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

return Boolean.TRUE;
}


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java View File

@@ -14,7 +14,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.provincial.service.IJoinReviewProvincialBureauService;
import com.ningdatech.pmapi.staging.service.IProjectStagingService;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterContant;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.wflow.exception.BusinessException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -106,7 +106,7 @@ public class ReviewByProvincialDeptManage {
//保存一下 当前的主管单位发起人
p.setPreStartUserId(p.getSponsor());
//当前实例置为空
p.setInstCode(TodoCenterContant.Declared.NULL_INST_CODE);
p.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE);
declaringDTO.getProjectInfo().setId(p.getId());
projectService.updateById(p);
if(!joinReviewProvincialBureauService.pushImportProject(


+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java View File

@@ -58,6 +58,12 @@ public class ProjectLibController {
return projectLibManage.applicationList(req);
}

@GetMapping("/construct/{id}")
@ApiOperation("获取项目建设方案详情")
public ProjectDetailVO constructDetail (@PathVariable Long id){
return projectLibManage.getConstructProjectDetail(id);
}

@GetMapping("/{id}")
@ApiOperation("获取项目详情")
public ProjectDetailVO detail (@PathVariable Long id){


+ 31
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -74,6 +74,8 @@ import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

import static com.ningdatech.pmapi.irs.config.IrsSealPlatformProperties.projectId;

/**
* <p>
* ProjectLibManage
@@ -474,6 +476,8 @@ public class ProjectLibManage {
project.setInstCode(instanceId);
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
// 标识保存的项目信息是否为建设方案申报项目
project.setIsConstruct(Boolean.TRUE);
stateMachineUtils.pass(project);

if(projectService.save(project)){
@@ -519,7 +523,7 @@ public class ProjectLibManage {
* @since 2023/02/11 11:15
*/
public ProjectDetailVO getProjectDetail(Long projectId) {
// 查询项目申报信息
// 查询建设方案申报前最新的项目申报信息
Project projectInfo = projectService.getNewProject(projectId);
if (Objects.isNull(projectInfo)) {
return null;
@@ -599,6 +603,32 @@ public class ProjectLibManage {
return vo;
}

/**
* 获取建设方案申报项目详情
* @param projectId
* @return com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO
* @author CMM
* @since 2023/07/12 11:43
*/
public ProjectDetailVO getConstructProjectDetail(Long projectId) {
// 查询建设方案申报前最新的项目申报信息
Project projectInfo = projectService.getNewConstructProject(projectId);
if (Objects.isNull(projectInfo)) {
return null;
}
ProjectDetailVO vo = new ProjectDetailVO();
BeanUtils.copyProperties(projectInfo, vo);
vo.buildDynamicForm(projectInfo.getDynamicForm());
// 查询应用
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, vo.getId()));
Optional.ofNullable(applications).ifPresent(apps ->
vo.setProjectApplications(CollUtils.convert(apps,
ProjectHelper::convertVO)
));
return vo;
}

public List<ProcessDetailVO> processScheduleDetail(Long projectId) {
List<ProcessDetailVO> processDetailVOS = new ArrayList<>();
return processExecuteHandle.handle(projectId, processDetailVOS);


+ 9
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java View File

@@ -311,12 +311,17 @@ public class Project implements Serializable {
private Long updateBy;

@ApiModelProperty("项目预审申请单文件ID")

private Long pretrialFileId;

@ApiModelProperty("项目预审申请单文件名")
private String pretrialFileName;

@ApiModelProperty("项目建设方案申请单文件ID")
private Long constructFileId;

@ApiModelProperty("项目建设方案申请单文件名")
private String constructFileName;

@ApiModelProperty("21位项目编号")
private String projectCode;

@@ -358,4 +363,7 @@ public class Project implements Serializable {

@ApiModelProperty("申请延期理由")
private String applyDelayReason;

@ApiModelProperty("是否为建设方案申报")
private Boolean isConstruct;
}

+ 6
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java View File

@@ -312,7 +312,6 @@ public class ProjectDetailVO {

@ApiModelProperty("上级条线单位审核意见")
private String higherLineSuperOrgReviewComments;

private String projectTypeName;

@ApiModelProperty("项目预审申请单文件ID")
@@ -321,6 +320,12 @@ public class ProjectDetailVO {
@ApiModelProperty("项目预审申请单文件名")
private String pretrialFileName;

@ApiModelProperty("项目建设方案申请单文件ID")
private Long constructFileId;

@ApiModelProperty("项目建设方案申请单文件名")
private String constructFileName;

@ApiModelProperty("21位项目编号")
private String projectCode;



+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java View File

@@ -21,5 +21,7 @@ public interface IProjectService extends IService<Project> {

Project getNewProject(Long projectId);

Project getNewConstructProject(Long projectId);

Project getProjectByCode(String projectCode);
}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java View File

@@ -65,6 +65,27 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
LambdaQueryWrapper<Project> last = Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getProjectCode, projectCode)
.eq(Project::getIsConstruct, Boolean.FALSE)
.last(BizConst.LIMIT_1);
Project newest = getOne(last);

return newest;
}

@Override
public Project getNewConstructProject(Long projectId) {
Project project = getById(projectId);

if(Objects.isNull(project)){
return null;
}

String projectCode = project.getProjectCode();

LambdaQueryWrapper<Project> last = Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getProjectCode, projectCode)
.eq(Project::getIsConstruct, Boolean.TRUE)
.last(BizConst.LIMIT_1);
Project newest = getOne(last);



+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/CcTaskListener.java View File

@@ -26,7 +26,7 @@ import org.springframework.stereotype.Component;
import java.time.Duration;
import java.util.List;
import java.util.Objects;
import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant.CC_MSG_TEMPLATE;
import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant.CC_MSG_TEMPLATE;

/**
* 抄送事件 事件监听


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/ProcessEndListener.java View File

@@ -42,8 +42,8 @@ import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant.PASS_MSG_TEMPLATE;
import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant.PASS_MSG_TEMPLATE2;
import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant.PASS_MSG_TEMPLATE;
import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant.PASS_MSG_TEMPLATE2;

/**
* 工作流开始 结束监听 自动审批的话 会漏掉 调用状态机


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java View File

@@ -50,7 +50,7 @@ import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant.AUDIT_WORK_TITLE;
import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant.AUDIT_WORK_TITLE;

/**
* <p>


+ 4
- 4
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NotifyManage.java View File

@@ -12,7 +12,7 @@ import com.ningdatech.pmapi.sys.model.entity.Notify;
import com.ningdatech.pmapi.sys.model.req.NotifyListReq;
import com.ningdatech.pmapi.sys.model.vo.NotifyVO;
import com.ningdatech.pmapi.sys.service.INotifyService;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
@@ -56,9 +56,9 @@ public class NotifyManage {
String extraInfo = n.getExtraInfo();
if (StringUtils.isNotBlank(extraInfo)) {
JSONObject jsonObject = JSON.parseObject(extraInfo);
Long projectId = jsonObject.getLong(WorkNoticeContant.PROJECT_ID);
String instanceId = jsonObject.getString(WorkNoticeContant.INSTANCE_ID);
Long meetingId = jsonObject.getLong(WorkNoticeContant.MEETING_ID);
Long projectId = jsonObject.getLong(WorkNoticeConstant.PROJECT_ID);
String instanceId = jsonObject.getString(WorkNoticeConstant.INSTANCE_ID);
Long meetingId = jsonObject.getLong(WorkNoticeConstant.MEETING_ID);
notifyVo.setProjectId(projectId);
notifyVo.setInstanceId(instanceId);
notifyVo.setMeetingId(meetingId);


pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterContant.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterConstant.java View File

@@ -3,9 +3,9 @@ package com.ningdatech.pmapi.todocenter.constant;
* @author ZPF
* @since 2023/04/02 14:56
*/
public interface TodoCenterContant {
public interface TodoCenterConstant {

public class Handler {
class Handler {

public static final String ACTIVITY_APPROVAL = "userTask";

@@ -14,9 +14,15 @@ public interface TodoCenterContant {
public static final String TASKID_ERROR = "TASKID_ERROR";
}

public class Declared {
class Declared {

public static final String NULL_INST_CODE = "EMPTY";

}

class SealTemplate{
public static final String CITY_TEMPLATE = "市级-预审申请单";
public static final String COUNTRY_TEMPLATE = "区县-预审申请单";
public static final String CONSTRUCT_TEMPLATE = "建设方案申请单";
}
}

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeContant.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeConstant.java View File

@@ -4,7 +4,7 @@ package com.ningdatech.pmapi.todocenter.constant;
* @author CMM
* @since 2023/02/01 14:56
*/
public interface WorkNoticeContant {
public interface WorkNoticeConstant {
public final String PASS_MSG_TEMPLATE = "【%s】的【%s】需要您审核。";
public final String PASS_MSG_TEMPLATE2 = "【%s】已通过【%s】,请及时开始下一步操作。";
public final String BACK_MSG_TEMPLATE = "【%s】的【%s】被退回,请及时处理。";

+ 3
- 4
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java View File

@@ -2,12 +2,11 @@ package com.ningdatech.pmapi.todocenter.handle;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterContant;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
@@ -171,7 +170,7 @@ public class WithDrawHandle {
if(!isAndOr && CollUtil.isNotEmpty(beforeAndOr)) {
for (ProgressNode n : beforeAndOr) {
if (n.getUserId().equals(user.getEmployeeCode())
&& !TodoCenterContant.Handler.OR_SIGN_FLAG.equals(n.getWithdrawFlag())) {
&& !TodoCenterConstant.Handler.OR_SIGN_FLAG.equals(n.getWithdrawFlag())) {
beforeProgressNode = n;
//说明当前操作人 在上个会签或者或签节点
isAndOr = Boolean.TRUE;
@@ -329,7 +328,7 @@ public class WithDrawHandle {

List<HistoricActivityInstance> finished = historyService.createHistoricActivityInstanceQuery()
.processInstanceId(instance.getId()).finished()
.activityType(TodoCenterContant.Handler.ACTIVITY_APPROVAL)
.activityType(TodoCenterConstant.Handler.ACTIVITY_APPROVAL)
.orderByHistoricActivityInstanceEndTime().asc().list();
List<HistoricActivityInstance> instances = finished.stream()
.filter(a -> !HisProInsEndActId.WITHDRAW.equals(a.getDeleteReason()))


+ 3
- 3
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java View File

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.todocenter.manage;

import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant.*;
import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant.*;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@@ -50,7 +50,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.staging.service.IProjectStagingService;
import com.ningdatech.pmapi.sys.manage.NoticeManage;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterContant;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.contants.HisProInsEndActId;
import com.wflow.workflow.bean.process.ProgressNode;
@@ -430,7 +430,7 @@ public class HandlerManage {
stateMachineUtils.withDraw(declaredProject);
declaredProject.setUpdateOn(LocalDateTime.now());
declaredProject.setUpdateBy(userId);
declaredProject.setInstCode(TodoCenterContant.Declared.NULL_INST_CODE);
declaredProject.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE);
projectService.updateById(declaredProject);
}



+ 157
- 50
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -14,13 +14,16 @@ import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.projectlib.enumeration.*;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterContant;
import com.ningdatech.pmapi.sys.model.entity.Region;
import com.ningdatech.pmapi.sys.service.IRegionService;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.handle.PassHandle;
import com.ningdatech.pmapi.todocenter.handle.WithDrawHandle;
import com.ningdatech.pmapi.todocenter.model.dto.*;
import com.ningdatech.pmapi.todocenter.model.vo.TodoNumVO;
import com.wflow.contants.HisProInsEndActId;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.utils.ProcessTaskUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
@@ -31,7 +34,6 @@ import org.flowable.bpmn.model.FlowElementsContainer;
import org.flowable.bpmn.model.SubProcess;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.task.api.Task;
@@ -74,10 +76,6 @@ import com.ningdatech.pmapi.signature.entity.CompanySignature;
import com.ningdatech.pmapi.signature.service.ICompanySignatureService;
import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum;
import com.ningdatech.pmapi.todocenter.enumeration.IsOrNotEnum;
import com.ningdatech.pmapi.todocenter.model.dto.AdjustHandleDTO;
import com.ningdatech.pmapi.todocenter.model.dto.PdfGenerateDTO;
import com.ningdatech.pmapi.todocenter.model.dto.SealInfoDTO;
import com.ningdatech.pmapi.todocenter.model.dto.SignReqDTO;
import com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO;
import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq;
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedExportReq;
@@ -131,14 +129,11 @@ public class TodoCenterManage {
private final FileService fileService;
private final ICompanySignatureService companySignatureService;
private final StatisticsService statisticsService;

private final HandlerManage handlerManage;

private final WithDrawHandle withDrawHandle;

private final PassHandle passHandle;

private final RepositoryService repositoryService;
private final IRegionService regionService;

/**
* 待办中心待我处理项目列表查询
@@ -370,7 +365,7 @@ public class TodoCenterManage {
//前置判断前端传的taskId是否存在不存在的情况 有可能是 或签被别人审批掉了
Task task = taskService.createTaskQuery().taskId(param.getTaskId()).active().singleResult();
if (ObjectUtil.isNull(task)) {
return TodoCenterContant.Handler.TASKID_ERROR;
return TodoCenterConstant.Handler.TASKID_ERROR;
}
String nodeId = task.getTaskDefinitionKey();
// 通过该任务,流程到下一审核人处
@@ -384,7 +379,7 @@ public class TodoCenterManage {
//前置判断前端传的taskId是否存在不存在的情况 有可能是 或签被别人审批掉了
task = taskService.createTaskQuery().taskId(param.getTaskId()).active().singleResult();
if (ObjectUtil.isNull(task)) {
return TodoCenterContant.Handler.TASKID_ERROR;
return TodoCenterConstant.Handler.TASKID_ERROR;
}
nodeId = task.getTaskDefinitionKey();
// 驳回该任务,中止流程并使项目进入对应状态,给项目创建人、流程发起人发送浙政钉工作通知:
@@ -398,7 +393,7 @@ public class TodoCenterManage {
//前置判断前端传的taskId是否存在不存在的情况 有可能是 或签被别人审批掉了
task = taskService.createTaskQuery().taskId(param.getTaskId()).active().singleResult();
if (ObjectUtil.isNull(task)) {
return TodoCenterContant.Handler.TASKID_ERROR;
return TodoCenterConstant.Handler.TASKID_ERROR;
}
nodeId = task.getTaskDefinitionKey();
// 退回该任务
@@ -427,7 +422,7 @@ public class TodoCenterManage {
//前置判断前端传的taskId是否存在不存在的情况 有可能是 或签被别人审批掉了
HistoricTaskInstance taskInst = historyService.createHistoricTaskInstanceQuery().taskId(param.getTaskId()).finished().singleResult();
if (ObjectUtil.isNull(taskInst)) {
return TodoCenterContant.Handler.TASKID_ERROR;
return TodoCenterConstant.Handler.TASKID_ERROR;
}
nodeId = taskInst.getTaskDefinitionKey();

@@ -451,25 +446,19 @@ public class TodoCenterManage {

/**
* 调用IRS接口,获取盖章后的pdf文件,上传到OSS,并保存文件ID到项目库中
*
* @param req
* @param declaredProject
* @param templateName
* @param paramsMap
* @return void
* @author CMM
* @since 2023/03/16 21:34
*/
private Long getSealedPdf(SealInfoDTO req, Project declaredProject) {
private Long getSealedPdf(SealInfoDTO req, Project declaredProject, String templateName, JSONObject paramsMap) {
Long projectId = req.getProjectId();
// 设置pdf模板参数
JSONObject paramsMap = assemblyPdfParams(declaredProject);
// TODO 根据当前盖章单位设置对应的盖章意见与盖章日期
paramsMap.put("superOrgOpinion",null);
paramsMap.put("superOrgAuditDate",null);
paramsMap.put("higherOrgOpinion",null);
paramsMap.put("higherOrgAuditDate",null);
paramsMap.put("bigDataBureauOpinion",null);
paramsMap.put("bigDataBureauAuditDate",null);
// 再次获取装配了盖章意见和盖章日期参数的未盖章pdf文件
Long pretrialFileId = generateNotSealedPdf(projectId,paramsMap);
Long pretrialFileId = generateNotSealedPdf(projectId, templateName, paramsMap);
// 获取预审申请单文件,并转换为Base64
File pdfFile = fileService.getById(pretrialFileId);
InputStream fileInputStream = fileService.getFileInputStream(pdfFile);
@@ -523,9 +512,17 @@ public class TodoCenterManage {
// 上传OSS
FileResultVO resultVo = fileService.upload(multipartFile, "default");
// 将返回的文件ID更新到项目库中对应的项目下
declaredProject.setPretrialFileId(resultVo.getId());
declaredProject.setPretrialFileName(resultVo.getOriginalFileName());
declaredProject.setUpdateOn(LocalDateTime.now());
// 根据模版名称判断是预审申请单还是建设方案申请单
if (TodoCenterConstant.SealTemplate.CITY_TEMPLATE.equals(templateName) ||
TodoCenterConstant.SealTemplate.COUNTRY_TEMPLATE.equals(templateName)) {
declaredProject.setPretrialFileId(resultVo.getId());
declaredProject.setPretrialFileName(resultVo.getOriginalFileName());
declaredProject.setUpdateOn(LocalDateTime.now());
} else if (TodoCenterConstant.SealTemplate.CONSTRUCT_TEMPLATE.equals(templateName)) {
declaredProject.setConstructFileId(resultVo.getId());
declaredProject.setConstructFileName(resultVo.getOriginalFileName());
declaredProject.setUpdateOn(LocalDateTime.now());
}
projectService.updateById(declaredProject);
return resultVo.getId();
}
@@ -1045,35 +1042,88 @@ public class TodoCenterManage {
}

/**
* 获取未盖章的预审申请单pdf文件
* 获取未盖章的预审申请单/建设方案申请单pdf文件
* @param projectId
* @return java.lang.Long
* @author CMM
* @since 2023/03/16 22:46
*/
public Long getNotSealedPdf(Long projectId) {
// 判断项目盖章审批类型
Project project = projectService.getById(projectId);
Long pretrialFileId = project.getPretrialFileId();
// 如果项目关联的预审文件ID不为空,说明已经进行过盖章审核,直接返回盖章后的预审申请单文件ID
if (Objects.nonNull(pretrialFileId)){
return pretrialFileId;
String instanceId = project.getInstCode();
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getInstCode, instanceId));
Integer instType = projectInst.getInstType();
// 如果为预审申报审批
if (InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType)) {
// 再根据项目所属区域判断是市级预审还是区县预审
String areaCode = project.getAreaCode();
Long pretrialFileId = project.getPretrialFileId();
// 如果项目关联的预审文件ID不为空,说明已经进行过盖章审核,直接返回盖章后的预审申请单文件ID
if (Objects.nonNull(pretrialFileId)){
return pretrialFileId;
}
Region region = regionService.getOne(Wrappers.lambdaQuery(Region.class)
.eq(Region::getRegionCode, areaCode));
if (Objects.isNull(region)){
throw new BizException("项目所属区域不存在!");
}
Integer regionLevel = region.getRegionLevel();
switch (regionLevel) {
// 市级预审
case RegionConst.RL_CITY:
String cityTemplateName = TodoCenterConstant.SealTemplate.CITY_TEMPLATE;
// 设置pdf模板参数
JSONObject cityParamsMap = assemblyPdfParams(project,cityTemplateName);
// 本级主管单位意见
cityParamsMap.put("superOrgOpinion",null);
cityParamsMap.put("superOrgAuditDate",null);
return generateNotSealedPdf(projectId,cityTemplateName, cityParamsMap);
// 区县预审
case RegionConst.RL_COUNTY:
String countryTemplateName = TodoCenterConstant.SealTemplate.COUNTRY_TEMPLATE;
// 设置pdf模板参数
JSONObject countryParamsMap = assemblyPdfParams(project, countryTemplateName);
// 本级主管单位意见、上级主管单位意见
countryParamsMap.put("superOrgOpinion",null);
countryParamsMap.put("superOrgAuditDate",null);
countryParamsMap.put("higherOrgOpinion",null);
countryParamsMap.put("higherOrgAuditDate",null);
return generateNotSealedPdf(projectId,countryTemplateName, countryParamsMap);
default:
throw new IllegalStateException("Unexpected value: " + regionLevel);
}
}
// 如果为建设方案申报审批
else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)){
Long constructFileId = project.getConstructFileId();
// 如果项目关联的建设方案文件ID不为空,说明已经进行过盖章审核,直接返回盖章后的建设方案申请单文件ID
if (Objects.nonNull(constructFileId)){
return constructFileId;
}
// 设置pdf模板参数
String constructTemplateName = TodoCenterConstant.SealTemplate.CONSTRUCT_TEMPLATE;
JSONObject countryParamsMap = assemblyPdfParams(project, constructTemplateName);
// 本级主管单位意见、上级主管单位意见
countryParamsMap.put("bigDataBureauOpinion",null);
countryParamsMap.put("bigDataBureauAuditDate",null);
return generateNotSealedPdf(projectId,constructTemplateName, countryParamsMap);
}
// 设置pdf模板参数
JSONObject paramsMap = assemblyPdfParams(project);
paramsMap.put("superOrgOpinion",null);
paramsMap.put("superOrgAuditDate",null);
paramsMap.put("higherOrgOpinion",null);
paramsMap.put("higherOrgAuditDate",null);
paramsMap.put("bigDataBureauOpinion",null);
paramsMap.put("bigDataBureauAuditDate",null);
return generateNotSealedPdf(projectId, paramsMap);
return null;
}

private Long generateNotSealedPdf(Long projectId, JSONObject paramsMap) {
private Long generateNotSealedPdf(Long projectId, String templateName, JSONObject paramsMap) {
// 获取本地目录的pdf模板
String fileName = "预审申请单";
String fileName;
if (templateName.contains(StrPool.DASH)){
int index = templateName.indexOf(StrPool.DASH);
fileName = templateName.substring(index + 1);
}else {
fileName = templateName;
}
InputStream htmlInputStream =
this.getClass().getClassLoader().getResourceAsStream("template" + java.io.File.separator + fileName + ".html");
this.getClass().getClassLoader().getResourceAsStream("template" + java.io.File.separator + templateName + ".html");
// 生成pdf字节数组
byte[] pdf = pdfUtils.generatePdf(htmlInputStream, paramsMap);

@@ -1110,14 +1160,22 @@ public class TodoCenterManage {

/**
* 装配pdf模板参数
* @param project 申报项目ID
*
* @param project
* @param templateName
* @return com.alibaba.fastjson.JSONObject
* @author CMM
* @since 2023/03/16 22:28
*/
private JSONObject assemblyPdfParams(Project project) {
private JSONObject assemblyPdfParams(Project project, String templateName) {
// 获取本地目录的pdf模板
String fileName = "预审申请单";
String fileName;
if (templateName.contains(StrPool.DASH)){
int index = templateName.indexOf(StrPool.DASH);
fileName = templateName.substring(index + 1);
}else {
fileName = templateName;
}
Long projectId = project.getId();
// 获取表单数据
PdfGenerateDTO pdfGenerateDTO = new PdfGenerateDTO();
@@ -1229,7 +1287,56 @@ public class TodoCenterManage {
public Long getSealedPdf(SealInfoDTO req) {
Long projectId = req.getProjectId();
Project declaredProject = projectService.getById(projectId);
return getSealedPdf(req, declaredProject);
String instanceId = declaredProject.getInstCode();
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getInstCode, instanceId));
Integer instType = projectInst.getInstType();
// 如果为预审申报审批
if (InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType)) {
// 再根据项目所属区域判断是市级预审还是区县预审
String areaCode = declaredProject.getAreaCode();
Region region = regionService.getOne(Wrappers.lambdaQuery(Region.class)
.eq(Region::getRegionCode, areaCode));
if (Objects.isNull(region)){
throw new BizException("项目所属区域不存在!");
}
Integer regionLevel = region.getRegionLevel();
switch (regionLevel) {
// 市级预审
case RegionConst.RL_CITY:
String cityTemplateName = TodoCenterConstant.SealTemplate.CITY_TEMPLATE;
// 设置pdf模板参数
JSONObject cityParamsMap = assemblyPdfParams(declaredProject, cityTemplateName);
// TODO 根据当前盖章单位设置对应的盖章意见与盖章日期
cityParamsMap.put("superOrgOpinion",null);
cityParamsMap.put("superOrgAuditDate",null);
return getSealedPdf(req, declaredProject,cityTemplateName,cityParamsMap);
// 区县预审
case RegionConst.RL_COUNTY:
String countryTemplateName = TodoCenterConstant.SealTemplate.COUNTRY_TEMPLATE;
// 设置pdf模板参数
JSONObject countryParamsMap = assemblyPdfParams(declaredProject, countryTemplateName);
// TODO 根据当前盖章单位设置对应的盖章意见与盖章日期
countryParamsMap.put("superOrgOpinion",null);
countryParamsMap.put("superOrgAuditDate",null);
countryParamsMap.put("higherOrgOpinion",null);
countryParamsMap.put("higherOrgAuditDate",null);
return getSealedPdf(req, declaredProject,countryTemplateName, countryParamsMap);
default:
throw new IllegalStateException("Unexpected value: " + regionLevel);
}
}
// 如果为建设方案申报审批
else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)){
// 设置pdf模板参数
String constructTemplateName = TodoCenterConstant.SealTemplate.CONSTRUCT_TEMPLATE;
JSONObject constructParamsMap = assemblyPdfParams(declaredProject, constructTemplateName);
// 本级主管单位意见、上级主管单位意见
constructParamsMap.put("bigDataBureauOpinion",null);
constructParamsMap.put("bigDataBureauAuditDate",null);
return getSealedPdf(req, declaredProject,constructTemplateName, constructParamsMap);
}
return null;
}

//获取当前登录人的 待办中心统计数据


pmapi/src/main/resources/template/预审申请单.html → pmapi/src/main/resources/template/区县-预审申请单.html View File

@@ -79,9 +79,16 @@
.text {
min-height: 150px;
}
.content > .right {
float: right;
margin-right: 10px;
.textDiv{
display: flex;
align-items: center;
height: 100%;
position: relative;
}
.textDiv > .right {
position: absolute;
bottom: 4px;
right: 4px;
}
</style>
</head>
@@ -243,42 +250,26 @@
<tr>
<td class="label">本级主管单位意见(盖章)</td>
<td colspan="3" class="text content">
<div class="textDiv">
<div class="left">
<span>#superOrgOpinion#</span>
</div>
<div class="right">
<p>
<span>#superOrgOpinion#</span>
</p>
<p>
<span>#superOrgAuditDate#</span>
</p>
<span>#superOrgAuditDate#</span>
</div>
</div>
</td>
</tr>
<tr>
<td class="label">上级主管单位意见(盖章)</td>
<td colspan="3" class="text content">
<div class="right">
<p>
<span>#higherOrgOpinion#</span>
</p>
<p>
<span>#higherOrgAuditDate#</span>
</p>
<div class="textDiv">
<div class="left">
<span>#higherOrgOpinion#</span>
</div>
</td>
</tr>
<tr>
<td class="label">
<span>#bigDataBureauName#</span>
意见(盖章)
</td>
<td colspan="3" class="text content">
<div class="right">
<p>
<span>#bigDataBureauOpinion#</span>
</p>
<p>
<span>#bigDataBureauAuditDate#</span>
</p>
<span>#higherOrgAuditDate#</span>
</div>
</div>
</td>
</tr>

+ 268
- 0
pmapi/src/main/resources/template/市级-预审申请单.html View File

@@ -0,0 +1,268 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:font-family="http://www.w3.org/1999/xhtml"
>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
html,
body {
padding: 0;
margin: 0;
font-family: SimSun;
}
.pdf {
margin: 0 auto;
padding: 10px 0 30px;
text-align: center;
}
.title {
padding: 0 0 40px 0;
font-size: 34px;
margin: 40px 0 0 0;
font-family: SimSun;
word-break: break-all;
}
.tit {
word-break: break-all;
}
.tab {
padding: 0 20px;
}
.projectId {
color: #999999;
text-align: left;
margin-bottom: 8px;
}
.projectId > .time {
float: right;
}

table {
width: 100%;
border-collapse: collapse;
font-size: 16px;
table-layout: fixed;
word-break: break-all;
word-wrap: break-word;
text-align: left;
}
td {
padding: 15px 8px;
border: 1px solid;
}
.tabTit {
background-color: #eee;
}
.label {
width: 150px;
}
.sealTd {
height: 200px;
position: relative;
}
.seal {
position: absolute;
right: 20px;
bottom: 30px;
width: 150px;
}
.seal > .time {
text-align: right;
}
.content {
height: 150px;
}
.text {
min-height: 150px;
}
.textDiv{
display: flex;
align-items: center;
height: 100%;
position: relative;
}
.textDiv > .right {
position: absolute;
bottom: 4px;
right: 4px;
}
</style>
</head>
<body>
<div class="pdf">
<p class="title">
<span class="tit">#title#</span>
</p>
<div class="tab">
<p class="projectId">
<span>
项目编号:
<span>#projectCode#</span>
</span>
<span class="time">#time#</span>
</p>
<table>
<tbody>
<tr>
<td class="tabTit" colspan="4">项目基本信息</td>
</tr>
<tr>
<td class="label">项目名称</td>
<td colspan="3" align="center">#projectName#</td>
</tr>
<tr>
<td class="label">是否临时增补</td>
<td align="center">#isTemporaryAugment#</td>
<td class="label">是否一地创新全省共享项目</td>
<td align="center">#isInnovateWholeProvinceShare#</td>
</tr>
<tr>
<td class="label">项目负责人</td>
<td align="center">#responsibleMan#</td>
<td class="label">负责人手机号</td>
<td align="center">#responsibleManMobile#</td>
</tr>
<tr>
<td class="label">项目联系人</td>
<td align="center">#contactName#</td>
<td class="label">项目联系人手机号</td>
<td align="center">#contactPhone#</td>
</tr>
<tr>
<td class="label">建设单位</td>
<td align="center">#buildOrgName#</td>
<td class="label">建设单位统一社会信用代码</td>
<td align="center">#orgCreditCode#</td>
</tr>
<tr>
<td class="label">项目类型</td>
<td align="center">#projectType#</td>
<td class="label">是否首次新建</td>
<td align="center">#isFirst#</td>
</tr>
<tr>
<td class="label">预算年度</td>
<td align="center">#projectYear#</td>
<td class="label">建设起止时间</td>
<td align="center">#beginAndEndTime#</td>
</tr>
<tr>
<td class="label">四大体系</td>
<td colspan="3" align="center">#fourSystems#</td>
</tr>
<tr>
<td class="label">是否数字化改革项目</td>
<td align="center">#isDigitalReform#</td>
<td class="label">综合业务领域</td>
<td align="center">#bizDomain#</td>
</tr>
<tr>
<td class="label">立项依据</td>
<td colspan="3" align="center">#buildBasisList#</td>
</tr>
<tr>
<td class="label">是否上云</td>
<td align="center">#isCloud#</td>
<td class="label">云类型</td>
<td align="center">#cloudType#</td>
</tr>
<tr>
<td class="label">项目简介</td>
<td colspan="3" align="center">#projectIntroduction#</td>
</tr>
<tr>
<td class="tabTit" colspan="4">资金申报情况</td>
</tr>
<tr>
<td class="label">申报金额</td>
<td colspan="3" align="center">#declareAmount#</td>
</tr>
<tr>
<td class="label">自有资金</td>
<td align="center">#declareHaveAmount#</td>
<td class="label">政府投资-本级财政资金</td>
<td align="center">#declareGovOwnFinanceAmount#</td>
</tr>
<tr>
<td class="label">政府投资-上级补助资金</td>
<td align="center">#declareGovSuperiorFinanceAmount#</td>
<td class="label">银行贷款</td>
<td align="center">#declareBankLendingAmount#</td>
</tr>
<tr>
<td class="label">其他资金</td>
<td colspan="3" align="center">#declareOtherAmount#</td>
</tr>
<tr>
<td class="label">本年计划投资(万元)</td>
<td colspan="3" align="center">#yearPlanInvest#</td>
</tr>
<tr>
<td class="tabTit" colspan="4">资金分配情况</td>
</tr>
<tr>
<td class="label">软件开发</td>
<td align="center">#softwareDevelopmentAmount#</td>
<td class="label">云资源、硬件购置</td>
<td align="center">#cloudHardwarePurchaseAmount#</td>
</tr>
<tr>
<td class="label">第三方服务</td>
<td colspan="3" align="center">#thirdPartyAmount#</td>
</tr>
<tr>
<td class="tabTit" colspan="4">年度支付计划</td>
</tr>
<tr>
<td class="label">年度支付金额</td>
<td colspan="3" align="center">#annualPlanAmount#</td>
</tr>
<tr>
<td class="label">自有资金</td>
<td align="center">#annualPlanHaveAmount#</td>
<td class="label">政府投资-本级财政资金</td>
<td align="center">#annualPlanGovOwnFinanceAmount#</td>
</tr>
<tr>
<td class="label">政府投资-上级补助资金</td>
<td align="center">#annualPlanGovSuperiorFinanceAmount#</td>
<td class="label">银行贷款</td>
<td align="center">#annualPlanBankLendingAmount#</td>
</tr>
<tr>
<td class="label">其他资金</td>
<td colspan="3" align="center">#annualPlanOtherAmount#</td>
</tr>
<tr>
<td class="tabTit" colspan="4">备注</td>
</tr>
<tr>
<td class="label">备注</td>
<td colspan="3" align="center">#projectRemarks#</td>
</tr>
<tr>
<td class="tabTit" colspan="4">单位意见</td>
</tr>
<tr>
<td class="label">本级主管单位意见(盖章)</td>
<td colspan="3" class="text content">
<div class="textDiv">
<div class="left">
<span>#superOrgOpinion#</span>
</div>
<div class="right">
<span>#superOrgAuditDate#</span>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>

+ 268
- 0
pmapi/src/main/resources/template/建设方案申请单.html View File

@@ -0,0 +1,268 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:font-family="http://www.w3.org/1999/xhtml"
>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
html,
body {
padding: 0;
margin: 0;
font-family: SimSun;
}
.pdf {
margin: 0 auto;
padding: 10px 0 30px;
text-align: center;
}
.title {
padding: 0 0 40px 0;
font-size: 34px;
margin: 40px 0 0 0;
font-family: SimSun;
word-break: break-all;
}
.tit {
word-break: break-all;
}
.tab {
padding: 0 20px;
}
.projectId {
color: #999999;
text-align: left;
margin-bottom: 8px;
}
.projectId > .time {
float: right;
}

table {
width: 100%;
border-collapse: collapse;
font-size: 16px;
table-layout: fixed;
word-break: break-all;
word-wrap: break-word;
text-align: left;
}
td {
padding: 15px 8px;
border: 1px solid;
}
.tabTit {
background-color: #eee;
}
.label {
width: 150px;
}
.sealTd {
height: 200px;
position: relative;
}
.seal {
position: absolute;
right: 20px;
bottom: 30px;
width: 150px;
}
.seal > .time {
text-align: right;
}
.content {
height: 150px;
}
.text {
min-height: 150px;
}
.textDiv{
display: flex;
align-items: center;
height: 100%;
position: relative;
}
.textDiv > .right {
position: absolute;
bottom: 4px;
right: 4px;
}
</style>
</head>
<body>
<div class="pdf">
<p class="title">
<span class="tit">#title#</span>
</p>
<div class="tab">
<p class="projectId">
<span>
项目编号:
<span>#projectCode#</span>
</span>
<span class="time">#time#</span>
</p>
<table>
<tbody>
<tr>
<td class="tabTit" colspan="4">项目基本信息</td>
</tr>
<tr>
<td class="label">项目名称</td>
<td colspan="3" align="center">#projectName#</td>
</tr>
<tr>
<td class="label">是否临时增补</td>
<td align="center">#isTemporaryAugment#</td>
<td class="label">是否一地创新全省共享项目</td>
<td align="center">#isInnovateWholeProvinceShare#</td>
</tr>
<tr>
<td class="label">项目负责人</td>
<td align="center">#responsibleMan#</td>
<td class="label">负责人手机号</td>
<td align="center">#responsibleManMobile#</td>
</tr>
<tr>
<td class="label">项目联系人</td>
<td align="center">#contactName#</td>
<td class="label">项目联系人手机号</td>
<td align="center">#contactPhone#</td>
</tr>
<tr>
<td class="label">建设单位</td>
<td align="center">#buildOrgName#</td>
<td class="label">建设单位统一社会信用代码</td>
<td align="center">#orgCreditCode#</td>
</tr>
<tr>
<td class="label">项目类型</td>
<td align="center">#projectType#</td>
<td class="label">是否首次新建</td>
<td align="center">#isFirst#</td>
</tr>
<tr>
<td class="label">预算年度</td>
<td align="center">#projectYear#</td>
<td class="label">建设起止时间</td>
<td align="center">#beginAndEndTime#</td>
</tr>
<tr>
<td class="label">四大体系</td>
<td colspan="3" align="center">#fourSystems#</td>
</tr>
<tr>
<td class="label">是否数字化改革项目</td>
<td align="center">#isDigitalReform#</td>
<td class="label">综合业务领域</td>
<td align="center">#bizDomain#</td>
</tr>
<tr>
<td class="label">立项依据</td>
<td colspan="3" align="center">#buildBasisList#</td>
</tr>
<tr>
<td class="label">是否上云</td>
<td align="center">#isCloud#</td>
<td class="label">云类型</td>
<td align="center">#cloudType#</td>
</tr>
<tr>
<td class="label">项目简介</td>
<td colspan="3" align="center">#projectIntroduction#</td>
</tr>
<tr>
<td class="tabTit" colspan="4">资金申报情况</td>
</tr>
<tr>
<td class="label">申报金额</td>
<td colspan="3" align="center">#declareAmount#</td>
</tr>
<tr>
<td class="label">自有资金</td>
<td align="center">#declareHaveAmount#</td>
<td class="label">政府投资-本级财政资金</td>
<td align="center">#declareGovOwnFinanceAmount#</td>
</tr>
<tr>
<td class="label">政府投资-上级补助资金</td>
<td align="center">#declareGovSuperiorFinanceAmount#</td>
<td class="label">银行贷款</td>
<td align="center">#declareBankLendingAmount#</td>
</tr>
<tr>
<td class="label">其他资金</td>
<td colspan="3" align="center">#declareOtherAmount#</td>
</tr>
<tr>
<td class="label">本年计划投资(万元)</td>
<td colspan="3" align="center">#yearPlanInvest#</td>
</tr>
<tr>
<td class="tabTit" colspan="4">资金分配情况</td>
</tr>
<tr>
<td class="label">软件开发</td>
<td align="center">#softwareDevelopmentAmount#</td>
<td class="label">云资源、硬件购置</td>
<td align="center">#cloudHardwarePurchaseAmount#</td>
</tr>
<tr>
<td class="label">第三方服务</td>
<td colspan="3" align="center">#thirdPartyAmount#</td>
</tr>
<tr>
<td class="tabTit" colspan="4">年度支付计划</td>
</tr>
<tr>
<td class="label">年度支付金额</td>
<td colspan="3" align="center">#annualPlanAmount#</td>
</tr>
<tr>
<td class="label">自有资金</td>
<td align="center">#annualPlanHaveAmount#</td>
<td class="label">政府投资-本级财政资金</td>
<td align="center">#annualPlanGovOwnFinanceAmount#</td>
</tr>
<tr>
<td class="label">政府投资-上级补助资金</td>
<td align="center">#annualPlanGovSuperiorFinanceAmount#</td>
<td class="label">银行贷款</td>
<td align="center">#annualPlanBankLendingAmount#</td>
</tr>
<tr>
<td class="label">其他资金</td>
<td colspan="3" align="center">#annualPlanOtherAmount#</td>
</tr>
<tr>
<td class="tabTit" colspan="4">备注</td>
</tr>
<tr>
<td class="label">备注</td>
<td colspan="3" align="center">#projectRemarks#</td>
</tr>
<tr>
<td class="tabTit" colspan="4">单位意见</td>
</tr>
<tr>
<td class="label">大数据局主管单位意见(盖章)</td>
<td colspan="3" class="text content">
<div class="textDiv">
<div class="left">
<span>#bigDataBureauOpinion#</span>
</div>
<div class="right">
<span>#bigDataBureauAuditDate#</span>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>

+ 0
- 5
pmapi/src/test/java/com/ningdatech/pmapi/provincial/Test.java View File

@@ -1,6 +1,5 @@
package com.ningdatech.pmapi.provincial;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.crypto.SecureUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -19,15 +18,11 @@ import com.ningdatech.pmapi.provincial.service.IJoinReviewProvincialBureauServic
import com.ningdatech.pmapi.staging.contants.StagingContant;
import com.ningdatech.pmapi.staging.model.entity.ProjectStaging;
import com.ningdatech.pmapi.staging.service.IProjectStagingService;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterContant;
import com.wflow.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;


+ 1
- 2
pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java View File

@@ -15,7 +15,6 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.service.INdWorkNoticeStagingService;
import com.ningdatech.pmapi.sys.manage.NoticeManage;
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo;
import com.ningdatech.pmapi.todocenter.manage.HandlerManage;
import com.ningdatech.pmapi.todocenter.manage.TodoCenterManage;
import com.ningdatech.pmapi.todocenter.model.dto.PdfGenerateDTO;
import com.ningdatech.pmapi.todocenter.utils.PdfUtils;
@@ -39,7 +38,7 @@ import java.io.InputStream;
import java.time.LocalDateTime;
import java.util.List;
import java.util.concurrent.*;
import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant.PASS_MSG_TEMPLATE;
import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant.PASS_MSG_TEMPLATE;

/**
* 待办中心测试


Loading…
Cancel
Save