diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java index fb8b8b8..c7f37cd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java @@ -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; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java index 5779ac6..25cbdd1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java @@ -46,6 +46,8 @@ public class ConstructionPlanController { return "建设方案申报 【" + instanceId + "】 成功"; } + + @GetMapping("/export") @ApiOperation("可申报建设方案项目列表导出") @WebLog("可申报建设方案项目列表导出") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java index cfe790e..a4f9bbb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java @@ -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; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index 497dfa8..fe7bea6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -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; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java index d726b54..956116a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java @@ -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; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java index aead8bb..d2e15d5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java @@ -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; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java index 121e7d8..686c92e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java @@ -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; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java index 765e07d..c318a54 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java @@ -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; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java index 7083e68..b7f0271 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java @@ -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( diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java index 211df2f..4c62bc3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java @@ -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){ diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 03566a3..39044c9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -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; + /** *

* 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 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 processScheduleDetail(Long projectId) { List processDetailVOS = new ArrayList<>(); return processExecuteHandle.handle(projectId, processDetailVOS); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java index f151df2..175890d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java @@ -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; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 994889d..5f53f0b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -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; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java index 56ce4b5..77b6836 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java @@ -21,5 +21,7 @@ public interface IProjectService extends IService { Project getNewProject(Long projectId); + Project getNewConstructProject(Long projectId); + Project getProjectByCode(String projectCode); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java index fb995d4..c8d42c9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java @@ -65,6 +65,27 @@ public class ProjectServiceImpl extends ServiceImpl impl LambdaQueryWrapper 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 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); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/CcTaskListener.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/CcTaskListener.java index 988b307..43f9eed 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/CcTaskListener.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/CcTaskListener.java @@ -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; /** * 抄送事件 事件监听 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/ProcessEndListener.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/ProcessEndListener.java index 108e6d5..b13c87e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/ProcessEndListener.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/ProcessEndListener.java @@ -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; /** * 工作流开始 结束监听 自动审批的话 会漏掉 调用状态机 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java index 43efe19..a5ff193 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java @@ -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; /** *

diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NotifyManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NotifyManage.java index 6d0e5c2..0427335 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NotifyManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NotifyManage.java @@ -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); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterContant.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterConstant.java similarity index 51% rename from pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterContant.java rename to pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterConstant.java index ef8ce19..defaee8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterContant.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterConstant.java @@ -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 = "建设方案申请单"; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeContant.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeConstant.java similarity index 96% rename from pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeContant.java rename to pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeConstant.java index fe12e28..ececc27 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeContant.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeConstant.java @@ -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】被退回,请及时处理。"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java index c8b4abb..e62d91d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java @@ -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 finished = historyService.createHistoricActivityInstanceQuery() .processInstanceId(instance.getId()).finished() - .activityType(TodoCenterContant.Handler.ACTIVITY_APPROVAL) + .activityType(TodoCenterConstant.Handler.ACTIVITY_APPROVAL) .orderByHistoricActivityInstanceEndTime().asc().list(); List instances = finished.stream() .filter(a -> !HisProInsEndActId.WITHDRAW.equals(a.getDeleteReason())) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java index 58f197a..42d73cc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java @@ -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); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index ca4f85b..66456da 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -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; } //获取当前登录人的 待办中心统计数据 diff --git a/pmapi/src/main/resources/template/预审申请单.html b/pmapi/src/main/resources/template/区县-预审申请单.html similarity index 89% rename from pmapi/src/main/resources/template/预审申请单.html rename to pmapi/src/main/resources/template/区县-预审申请单.html index 1319e8b..a28aafa 100644 --- a/pmapi/src/main/resources/template/预审申请单.html +++ b/pmapi/src/main/resources/template/区县-预审申请单.html @@ -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; } @@ -243,42 +250,26 @@ 本级主管单位意见(盖章) +

+
+ #superOrgOpinion# +
-

- #superOrgOpinion# -

-

- #superOrgAuditDate# -

+ #superOrgAuditDate# +
上级主管单位意见(盖章) -
-

- #higherOrgOpinion# -

-

- #higherOrgAuditDate# -

+
+
+ #higherOrgOpinion#
- - - - - #bigDataBureauName# - 意见(盖章) - -
-

- #bigDataBureauOpinion# -

-

- #bigDataBureauAuditDate# -

+ #higherOrgAuditDate# +
diff --git a/pmapi/src/main/resources/template/市级-预审申请单.html b/pmapi/src/main/resources/template/市级-预审申请单.html new file mode 100644 index 0000000..38b34d5 --- /dev/null +++ b/pmapi/src/main/resources/template/市级-预审申请单.html @@ -0,0 +1,268 @@ + + + + + + Document + + + +
+

+ #title# +

+
+

+ + 项目编号: + #projectCode# + + #time# +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
项目基本信息
项目名称#projectName#
是否临时增补#isTemporaryAugment#是否一地创新全省共享项目#isInnovateWholeProvinceShare#
项目负责人#responsibleMan#负责人手机号#responsibleManMobile#
项目联系人#contactName#项目联系人手机号#contactPhone#
建设单位#buildOrgName#建设单位统一社会信用代码#orgCreditCode#
项目类型#projectType#是否首次新建#isFirst#
预算年度#projectYear#建设起止时间#beginAndEndTime#
四大体系#fourSystems#
是否数字化改革项目#isDigitalReform#综合业务领域#bizDomain#
立项依据#buildBasisList#
是否上云#isCloud#云类型#cloudType#
项目简介#projectIntroduction#
资金申报情况
申报金额#declareAmount#
自有资金#declareHaveAmount#政府投资-本级财政资金#declareGovOwnFinanceAmount#
政府投资-上级补助资金#declareGovSuperiorFinanceAmount#银行贷款#declareBankLendingAmount#
其他资金#declareOtherAmount#
本年计划投资(万元)#yearPlanInvest#
资金分配情况
软件开发#softwareDevelopmentAmount#云资源、硬件购置#cloudHardwarePurchaseAmount#
第三方服务#thirdPartyAmount#
年度支付计划
年度支付金额#annualPlanAmount#
自有资金#annualPlanHaveAmount#政府投资-本级财政资金#annualPlanGovOwnFinanceAmount#
政府投资-上级补助资金#annualPlanGovSuperiorFinanceAmount#银行贷款#annualPlanBankLendingAmount#
其他资金#annualPlanOtherAmount#
备注
备注#projectRemarks#
单位意见
本级主管单位意见(盖章) +
+
+ #superOrgOpinion# +
+
+ #superOrgAuditDate# +
+
+
+
+
+ + diff --git a/pmapi/src/main/resources/template/建设方案申请单.html b/pmapi/src/main/resources/template/建设方案申请单.html new file mode 100644 index 0000000..067476f --- /dev/null +++ b/pmapi/src/main/resources/template/建设方案申请单.html @@ -0,0 +1,268 @@ + + + + + + Document + + + +
+

+ #title# +

+
+

+ + 项目编号: + #projectCode# + + #time# +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
项目基本信息
项目名称#projectName#
是否临时增补#isTemporaryAugment#是否一地创新全省共享项目#isInnovateWholeProvinceShare#
项目负责人#responsibleMan#负责人手机号#responsibleManMobile#
项目联系人#contactName#项目联系人手机号#contactPhone#
建设单位#buildOrgName#建设单位统一社会信用代码#orgCreditCode#
项目类型#projectType#是否首次新建#isFirst#
预算年度#projectYear#建设起止时间#beginAndEndTime#
四大体系#fourSystems#
是否数字化改革项目#isDigitalReform#综合业务领域#bizDomain#
立项依据#buildBasisList#
是否上云#isCloud#云类型#cloudType#
项目简介#projectIntroduction#
资金申报情况
申报金额#declareAmount#
自有资金#declareHaveAmount#政府投资-本级财政资金#declareGovOwnFinanceAmount#
政府投资-上级补助资金#declareGovSuperiorFinanceAmount#银行贷款#declareBankLendingAmount#
其他资金#declareOtherAmount#
本年计划投资(万元)#yearPlanInvest#
资金分配情况
软件开发#softwareDevelopmentAmount#云资源、硬件购置#cloudHardwarePurchaseAmount#
第三方服务#thirdPartyAmount#
年度支付计划
年度支付金额#annualPlanAmount#
自有资金#annualPlanHaveAmount#政府投资-本级财政资金#annualPlanGovOwnFinanceAmount#
政府投资-上级补助资金#annualPlanGovSuperiorFinanceAmount#银行贷款#annualPlanBankLendingAmount#
其他资金#annualPlanOtherAmount#
备注
备注#projectRemarks#
单位意见
大数据局主管单位意见(盖章) +
+
+ #bigDataBureauOpinion# +
+
+ #bigDataBureauAuditDate# +
+
+
+
+
+ + diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/provincial/Test.java b/pmapi/src/test/java/com/ningdatech/pmapi/provincial/Test.java index 5819000..a28c090 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/provincial/Test.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/provincial/Test.java @@ -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; diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java index 0865e6c..a442ef9 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java @@ -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; /** * 待办中心测试