From 3dcdc5f1f17a2829c0c496d9f1d446001bf0d88c Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sat, 13 Apr 2024 15:13:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BE=9D=E8=B5=96=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hz-pm-api/pom.xml | 21 +- .../pm/api/common/config/CustomFlowableConfig.java | 2 +- .../action/ProjectDeclareActionChoice.java | 5 +- .../action/ProjectStateChangeAction.java | 31 - .../impl/ProjectStateMachineBuilderImpl.java | 26 - .../event/ProjectStateChangeEvent.java | 25 +- .../hz/pm/api/meeting/manage/MeetingManage.java | 2 +- .../controller/ConstructionPlanController.java | 9 - .../converter/ApplicationConverter.java | 183 +--- .../manage/ConstructionPlanManage.java | 148 +--- .../manage/ProjectAdjustmentManage.java | 42 +- .../manage/ReviewByProvincialDeptManage.java | 118 --- .../manage/ReviewChecklistManage.java | 2 +- .../utils/RestartProcessMapUtil.java | 11 +- .../controller/AnnualPlanController.java | 20 +- .../controller/ProjectApplicationController.java | 11 +- .../handle/stage/ProjectApprovalHandle.java | 4 +- .../api/projectlib/manage/AnnualPlanLibManage.java | 245 +----- .../api/projectlib/manage/ApplicationManage.java | 57 -- .../pm/api/projectlib/manage/ProjectLibManage.java | 94 +-- .../projectlib/model/dto/AnnualLibExportDTO.java | 102 --- .../projectlib/model/dto/AnnualLibImportDTO.java | 121 --- .../model/enumeration/status/ProjectStatus.java | 3 - .../api/provincial/contants/ProvincialContant.java | 15 - .../api/provincial/controller/TestController.java | 62 -- .../ProjectProvincialAuditStatusEnum.java | 30 - .../pm/api/provincial/manage/ProvincialManage.java | 56 -- .../hz/pm/api/provincial/model/dto/FileDTO.java | 23 - .../provincial/model/dto/ProcessCommentDTO.java | 36 - .../provincial/model/dto/ProvinceApiResponse.java | 121 --- .../model/dto/ProvincialApplicationDTO.java | 103 --- .../provincial/model/dto/ProvincialProjectDTO.java | 134 --- .../hz/pm/api/provincial/model/res/OssApiData.java | 31 - .../api/provincial/model/res/OssApiResponse.java | 120 --- .../provincial/model/res/ProcessCommentRes.java | 43 - .../model/res/ProvincialApplicationRes.java | 108 --- .../provincial/model/res/ProvincialProjectRes.java | 130 --- .../pm/api/provincial/model/res/SjApiResponse.java | 120 --- .../IJoinReviewProvincialBureauService.java | 29 - .../JoinReviewProvincialBureauServiceImpl.java | 141 ---- .../api/scheduler/listener/ProcessEndListener.java | 3 - .../scheduler/task/CockpitStatsStatisticsTask.java | 926 --------------------- .../api/scheduler/task/ProjectStatusFlowTask.java | 88 -- .../staging/utils/ProjectStatusFlowMapUtil.java | 44 - .../pm/api/todocenter/handle/WithDrawHandle.java | 2 +- .../hz/pm/api/todocenter/manage/HandlerManage.java | 8 - .../workbench/converter/WorkbenchConverter.java | 10 +- pom.xml | 17 +- 48 files changed, 43 insertions(+), 3639 deletions(-) delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/AnnualLibExportDTO.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/AnnualLibImportDTO.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/contants/ProvincialContant.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/controller/TestController.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/enumeration/ProjectProvincialAuditStatusEnum.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/manage/ProvincialManage.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/FileDTO.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProcessCommentDTO.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvinceApiResponse.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialApplicationDTO.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialProjectDTO.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/OssApiData.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/OssApiResponse.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProcessCommentRes.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialApplicationRes.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialProjectRes.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/SjApiResponse.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/service/IJoinReviewProvincialBureauService.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/provincial/service/impl/JoinReviewProvincialBureauServiceImpl.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/CockpitStatsStatisticsTask.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/ProjectStatusFlowTask.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java diff --git a/hz-pm-api/pom.xml b/hz-pm-api/pom.xml index c5869be..ecd4e83 100644 --- a/hz-pm-api/pom.xml +++ b/hz-pm-api/pom.xml @@ -83,8 +83,7 @@ org.springframework.boot spring-boot-devtools - true - true + runtime org.springframework.boot @@ -100,14 +99,6 @@ httpclient - org.apache.poi - poi - - - org.apache.poi - poi-ooxml - - junit junit test @@ -120,6 +111,11 @@ org.springframework.boot spring-boot-starter-test + test + + + org.springframework + spring-test org.springframework.boot @@ -198,11 +194,6 @@ org.springframework.statemachine spring-statemachine-core - - - cn.afterturn - easypoi-base - com.github.oshi oshi-core diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/config/CustomFlowableConfig.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/config/CustomFlowableConfig.java index 05905d0..c430398 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/config/CustomFlowableConfig.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/config/CustomFlowableConfig.java @@ -1,8 +1,8 @@ package com.hz.pm.api.common.config; +import com.google.common.collect.Lists; import com.hz.pm.api.scheduler.listener.TaskCreatedListener; import lombok.RequiredArgsConstructor; -import org.assertj.core.util.Lists; import org.flowable.common.engine.api.delegate.event.FlowableEventListener; import org.flowable.spring.SpringProcessEngineConfiguration; import org.flowable.spring.boot.EngineConfigurationConfigurer; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareActionChoice.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareActionChoice.java index d57e0de..9501e78 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareActionChoice.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareActionChoice.java @@ -3,12 +3,12 @@ package com.hz.pm.api.common.statemachine.action; import cn.hutool.core.collection.CollUtil; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.toolkit.Assert; -import com.hz.pm.api.common.model.constant.StateMachineConst; import com.hz.pm.api.common.enumeration.CommonEnum; +import com.hz.pm.api.common.model.constant.StateMachineConst; import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent; -import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.entity.ProjectApplication; +import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; import lombok.extern.slf4j.Slf4j; import org.springframework.statemachine.StateContext; import org.springframework.statemachine.action.Action; @@ -65,7 +65,6 @@ public class ProjectDeclareActionChoice implements Action message) { - Project project = getProject(message); - project.setStatus(ProjectStatus.SCHEME_UNDER_REVIEW.getCode()); - } - @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "IN_THE_ANNUAL_PLAN") public void PLAN_TO_DECLARE_WITHDRAW(Message message) { Project project = getProject(message); project.setStatus(ProjectStatus.IN_THE_ANNUAL_PLAN.getCode()); } - @OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW") - public void DECLARE_PLAN_RESUBMIT(Message message) { - Project project = getProject(message); - project.setStatus(ProjectStatus.SCHEME_UNDER_REVIEW.getCode()); - } - @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED") public void PLAN_REVIEW_PASS(Message message) { Project project = getProject(message); project.setStatus(ProjectStatus.TO_BE_APPROVED.getCode()); } - @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "SCHEME_REVIEW_FAILED") - public void PLAN_REVIEW_REJECT(Message message) { - Project project = getProject(message); - project.setStatus(ProjectStatus.SCHEME_REVIEW_FAILED.getCode()); - } - - @OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW") - public void PLAN_REVIEW_REJECT_RESUBMIT(Message message) { - Project project = getProject(message); - project.setStatus(ProjectStatus.SCHEME_UNDER_REVIEW.getCode()); - } - @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "PLAN_TO_BE_DECLARED") public void SCHEME_UNDER_REVIEW_WITHDRAW(Message message) { Project project = getProject(message); @@ -235,12 +210,6 @@ public class ProjectStateChangeAction { project.setStatus(ProjectStatus.TO_BE_PURCHASED.getCode()); } - @OnTransition(source = "TO_BE_APPROVED", target = "SCHEME_UNDER_REVIEW") - public void TO_BE_APPROVED_WITHDRAW(Message message) { - Project project = getProject(message); - project.setStatus(ProjectStatus.SCHEME_UNDER_REVIEW.getCode()); - } - @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION") public void START_TO_WORK(Message message) { Project project = getProject(message); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/ProjectStateMachineBuilderImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/ProjectStateMachineBuilderImpl.java index 72bca96..bc506d6 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/ProjectStateMachineBuilderImpl.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/ProjectStateMachineBuilderImpl.java @@ -6,7 +6,6 @@ import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent; import com.hz.pm.api.common.statemachine.factory.ProjectDeclareGuardFactory.PendingPreQualificationChoiceGuard; import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; -import com.ningdatech.basic.exception.BizException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.BeanFactory; @@ -187,31 +186,6 @@ public class ProjectStateMachineBuilderImpl implements BaseStateMachineBuilder

applications, - FileService fileService, String active) { - return ProvincialProjectDTO.builder() - //暂时先写死 - .operationManageUnit(StringUtils.isBlank(active) || BizConst.DEV.equals(active) ? - "GO_a1479720291640b4982158fe3035a2d0" : projectInfo.getHigherSuperOrgCode()) - .digitalReform(String.valueOf(projectInfo.getBizDomain())) - .regionCode(projectInfo.getAreaCode()) - .regionName(projectInfo.getArea()) - .projectName(projectInfo.getProjectName()) - .projectId(projectInfo.getProjectCode()) - .projectType(convertProjectType(projectInfo.getProjectType())) - .totalMoney(projectInfo.getDeclareAmount()) - // TODO - .yearBudget(BigDecimal.ZERO) - .budgetFrom(checkAddBudget(projectInfo.getDeclareHaveAmount() - , projectInfo.getDeclareGovOwnFinanceAmount(), - projectInfo.getDeclareGovSuperiorFinanceAmount(), - projectInfo.getDeclareBankLendingAmount(), - projectInfo.getDeclareOtherAmount())) - .year(String.valueOf(projectInfo.getProjectYear())) - .financialCode(projectInfo.getFinancialCode()) - .developCode(projectInfo.getDevelopCode()) - .beginTime(projectInfo.getBeginTime()) - .endTime(projectInfo.getEndTime()) - .buildBasis("立项依据") - .buildBasisFile(convertBasicFile(projectInfo.getBuildBasis(), fileService)) - .projectSummary(projectInfo.getProjectIntroduction()) - .responsibleMan(projectInfo.getResponsibleMan()) - .responsibleManPhone(projectInfo.getResponsibleManMobile()) - .contactName(projectInfo.getContactName()) - .contactPhone(projectInfo.getContactPhone()) - .buildUnit(projectInfo.getBuildOrgName()) - .buildUnitCode(StringUtils.isBlank(active) || BizConst.DEV.equals(active) ? - "GO_a1479720291640b4982158fe3035a2d0" : projectInfo.getBuildOrgCode()) - .superUnit(projectInfo.getSuperOrg()) - .superUnitCode(StringUtils.isBlank(active) || BizConst.DEV.equals(active) ? - "GO_a1479720291640b4982158fe3035a2d0" : projectInfo.getSuperOrgCode()) - .projectEstimateFile(convertFile(projectInfo.getCalculationTotalInvestmentFile(), fileService)) - .unitThreePlan(convertFile(projectInfo.getMainResponsibilitiesApplicantFile(), fileService)) - .otherFile(convertFile(projectInfo.getPreliminaryPlanFile(), fileService)) - .projectRemark(projectInfo.getProjectRemarks()) - .includeApplication(projectInfo.getIncludeApplication()) - .isEffective(1) - .projectApplyFile(convertFile(projectInfo.getProjectApplicationForm(), fileService)) - .researchReport(convertFile(projectInfo.getPreliminaryPlanFile(), fileService)) - .applicationInfo(convertApplications(applications, fileService)) - .build(); + private ApplicationConverter() { + } private static Integer convertProjectType(String projectType) { - if(StringUtils.isBlank(projectType)){ + if (StringUtils.isBlank(projectType)) { return null; } - if(Lists.newArrayList(ProjectTypeNewEnum.FIRST_BUILD.getCode(), - ProjectTypeNewEnum.SJ_BUILD.getCode(),ProjectTypeNewEnum.SZ_BUILD.getCode()).contains(projectType)){ + if (Lists.newArrayList(ProjectTypeNewEnum.FIRST_BUILD.getCode(), + ProjectTypeNewEnum.SJ_BUILD.getCode(), ProjectTypeNewEnum.SZ_BUILD.getCode()).contains(projectType)) { return ProjectTypeEnum.RECONSTRUCTION.getCode(); - }else if(Lists.newArrayList(ProjectTypeNewEnum.NEW_OPERA.getCode(), - ProjectTypeNewEnum.XU_OPERA.getCode()).contains(projectType)){ + } else if (Lists.newArrayList(ProjectTypeNewEnum.NEW_OPERA.getCode(), + ProjectTypeNewEnum.XU_OPERA.getCode()).contains(projectType)) { return ProjectTypeEnum.COMPREHENSIVE_INTEGRATION.getCode(); } return null; @@ -118,77 +60,6 @@ public class ApplicationConverter { return sb.toString(); } - //放入项目 app - private static List convertApplications(List applications, - FileService fileService) { - if (CollUtil.isEmpty(applications)) { - return Collections.emptyList(); - } - return applications.stream().map(app -> convertApp(app, fileService)).collect(Collectors.toList()); - } - - private static ProvincialApplicationDTO convertApp(ProjectApplication projectApplication, FileService fileService) { - return ProvincialApplicationDTO.builder() - .clouds(convertCloud(projectApplication)) - .isFirst(projectApplication.getIsFirst()) - .applicationName((projectApplication.getApplicationName())) - .applicationCode(StringUtils.isNotBlank(projectApplication.getAppCode()) ? - projectApplication.getAppCode() : projectApplication.getRelatedExistsApplicationCode()) - .relatedExistsApplication(projectApplication.getRelatedExistsApplication()) - .applicationType(2) - .buildLevel(projectApplication.getBuildLevel()) - .isUniteBuild(projectApplication.getIsUniteBuild()) - .unionBuildKind(projectApplication.getUnionBuildKind()) - .applicationSummary(projectApplication.getApplicationSummary()) - .applicationRemark(projectApplication.getApplicationRemark()) - .isFiveDomain(projectApplication.getIsDigitalModification()) - .fiveDomain(projectApplication.getDigitalModification()) - .bizDomain(projectApplication.getBizDomain()) - .isBizCooperate(projectApplication.getIsBizCooperate()) - .userRange(projectApplication.getUsesRangeRemark()) - .useGovCloud(projectApplication.getUseGovCloud()) - .nationalITSpec(projectApplication.getNationalItSpec()) - .netEnv(String.valueOf(projectApplication.getNetEnv())) - .secrecyGrade(projectApplication.getSecrecyGrade()) - .passwordGrade(projectApplication.getPasswordGrade()) - .accountAppName(projectApplication.getAccountAppName()) - .brainAccountAppName(projectApplication.getDomainBrainAccount()) - .useCommonData(projectApplication.getUseCommonData()) - .dataName(projectApplication.getDataName()) - .commonComponents(projectApplication.getCommonComponents()) - .useCommonComponent(projectApplication.getUseCommonComponent()) - .isProduceCommonComponent(projectApplication.getProduceCommonComponent()) - .produceCommonComponent(projectApplication.getProduceCommonComponents()) - .publishSide(projectApplication.getPublishSide()) - .isS2(projectApplication.getIsAccountAppName()) - .accountAppName(projectApplication.getAccountAppName()) - .applicationEstimateFile(convertFile(projectApplication.getApplicationEstimateFile(), fileService)) - .cooperativeUnit(projectApplication.getBizCooperateInfo()) - .build(); - } - - private static String convertFile(String applicationEstimateFile, FileService fileService) { - try { - JSONArray jsonArrays = JSON.parseArray(applicationEstimateFile); - List files = jsonArrays.stream().map(json -> { - JSONObject fileJson = (JSONObject) JSON.toJSON(json); - Long fileId = fileJson.getLong("id"); - String fileName = fileJson.getString("originalFileName"); - Map fileMap = fileService.findUrlById(Arrays.asList(fileId)); - String url = fileMap.get(fileId); - url = removeExpire(url); - FileDTO file = new FileDTO(); - file.setFileId(String.valueOf(fileId)); - file.setFileName(fileName); - file.setAccessUrl(url); - return file; - }).collect(Collectors.toList()); - return JSON.toJSONString(files); - } catch (Exception e) { - log.info("转换省局上传 文件出错 {}", e.getMessage()); - } - return null; - } /** * 去除掉 oss链接的超时时间 @@ -204,42 +75,4 @@ public class ApplicationConverter { return StringUtils.EMPTY; } - //立项依据的文件格式不一样 - private static String convertBasicFile(String applicationEstimateFile, FileService fileService) { - try { - List files = Lists.newArrayList(); - JSONArray jsonArrays = JSON.parseArray(applicationEstimateFile); - jsonArrays.forEach(json -> { - JSONObject fileJson = (JSONObject) JSON.toJSON(json); - JSONArray fileList = fileJson.getJSONArray("fileList"); - fileList.forEach(f -> { - JSONObject fJson = (JSONObject) JSON.toJSON(f); - Long fileId = fJson.getLong("id"); - String fileName = fJson.getString("originalFileName"); - Map fileMap = fileService.findUrlById(Lists.newArrayList(fileId)); - String url = fileMap.get(fileId); - url = removeExpire(url); - FileDTO file = new FileDTO(); - file.setFileId(String.valueOf(fileId)); - file.setFileName(fileName); - file.setAccessUrl(url); - files.add(file); - }); - }); - return JSON.toJSONString(files); - } catch (Exception e) { - log.info("转换省局上传 basic文件出错 {}", e.getMessage()); - } - return null; - } - - private static List convertCloud(ProjectApplication projectApplication) { - return Lists.newArrayList(ProvincialApplicationDTO.Cloud.builder() - .cloudType(projectApplication.getCloudsType()) - .cloudNums(projectApplication.getCloudsNumber()) - .cloudBasicSpec(projectApplication.getCloudsFoundationSpecifications()) - .cloudUseDescription(projectApplication.getCloudsDescription()) - .build()); - } - } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java index f29db5d..f0a78aa 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java @@ -5,8 +5,6 @@ import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.hz.pm.api.common.enumeration.CommonEnum; -import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; import com.hz.pm.api.common.model.constant.BizConst; import com.hz.pm.api.common.model.constant.CommonConst; import com.hz.pm.api.common.statemachine.util.ProjectStateMachineUtil; @@ -14,50 +12,35 @@ import com.hz.pm.api.common.util.ExcelDownUtil; import com.hz.pm.api.common.util.ExcelExportStyle; import com.hz.pm.api.projectdeclared.model.dto.ConstructionPlanExportDTO; import com.hz.pm.api.projectdeclared.model.dto.ContructionSuggestionsDTO; -import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; import com.hz.pm.api.projectdeclared.model.entity.ProjectConstructionSuggestions; import com.hz.pm.api.projectdeclared.model.req.ConstrctionPlanListReq; import com.hz.pm.api.projectdeclared.service.IConstructionSuggestionsService; import com.hz.pm.api.projectlib.helper.ProjectHelper; import com.hz.pm.api.projectlib.manage.ProjectLibManage; -import com.hz.pm.api.projectlib.model.dto.ProjectDTO; import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.entity.ProjectInst; import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; -import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; +import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; import com.hz.pm.api.projectlib.model.req.ProjectListReq; import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; import com.hz.pm.api.projectlib.service.IProjectInstService; import com.hz.pm.api.projectlib.service.IProjectService; -import com.hz.pm.api.staging.enums.MsgTypeEnum; -import com.hz.pm.api.sys.manage.NoticeManage; -import com.hz.pm.api.sys.manage.ProcessModelManage; -import com.hz.pm.api.todocenter.constant.WorkNoticeConst; import com.hz.pm.api.user.security.model.UserInfoDetails; import com.hz.pm.api.user.util.LoginUserUtil; import com.ningdatech.basic.exception.BizException; -import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.NdDateUtils; -import com.wflow.bean.entity.WflowModels; import com.wflow.exception.BusinessException; -import com.wflow.workflow.bean.dto.OrgInfoDTO; -import com.wflow.workflow.bean.vo.ProcessStartParamsVo; -import com.wflow.workflow.service.ProcessInstanceService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.time.LocalDateTime; -import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -72,142 +55,13 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class ConstructionPlanManage { - private final ProcessModelManage processModelManage; private final IProjectService projectService; - private final ProcessInstanceService processService; private final ProjectStateMachineUtil projectStateMachineUtil; private final IProjectInstService projectInstService; private final ProjectLibManage projectLibManage; - private final DefaultDeclaredProjectManage declaredProjectManage; - private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; - private final NoticeManage noticeManage; private final IConstructionSuggestionsService constructionSuggestionsService; /** - * 建设方案 - * - * @param req \ - * @return \ - */ - @Transactional(rollbackFor = Exception.class) - public synchronized String startTheProcess(DefaultDeclaredDTO req) { - UserInfoDetails user = LoginUserUtil.loginUserDetail(); - Long userId = user.getUserId(); - ProjectDTO projectInfo = req.getProjectInfo(); - Long projectInfoId = projectInfo.getId(); - VUtils.isTrue(Objects.isNull(projectInfoId)).throwMessage("提交失败,缺少项目ID!"); - Project oldProject = projectService.getById(projectInfoId); - VUtils.isTrue(StringUtils.isBlank(projectInfo.getConstructionPlanFile())).throwMessage("提交失败,请提交建设方案!"); - - // 判断 项目当前状态 是不是 方案待申报 - VUtils.isTrue(!ProjectStatus.PLAN_TO_BE_DECLARED.eq(oldProject.getStatus()) || - !ProjectStatus.NOT_APPROVED.eq(oldProject.getStage())) - .throwMessage("提交失败 该项目不是 方案待申报状态或者未立项阶段"); - - projectInfo.setBuildOrgCode(user.getMhUnitIdStr()); - projectInfo.setBuildOrgName(user.getMhUnitName()); - - // 项目名称去重 - if (StringUtils.isNotBlank(projectInfo.getProjectName()) && !projectInfo.getProjectName() - .equals(oldProject.getProjectName())) { - projectInfo.setProjectCode(oldProject.getProjectCode()); - defaultDeclaredProjectManage.checkDuplication(projectInfo); - } - //判断申报金额 是否等于总的 判断年度支付金额 是否等于总金额 - defaultDeclaredProjectManage.checkAmount(projectInfo); - - //如果主管单位没有 那么主管单位就是自己 - if (CommonEnum.NO.getCode().equals(projectInfo.getIsSuperOrg())) { - projectInfo.setSuperOrgCode(user.getMhUnitIdStr()); - projectInfo.setSuperOrg(user.getMhUnitName()); - } - - Project constructProject = new Project(); - BeanUtils.copyProperties(projectInfo, constructProject); - constructProject.setStatus(oldProject.getStatus()); - constructProject.setStage(oldProject.getStage()); - ProjectProcessStageEnum instType = ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS; - WflowModels wflowModels = processModelManage.getWflowModels(instType, user.getMhUnitId()); - if (Objects.isNull(wflowModels)) { - throw BizException.wrap("找不到建设申报流程配置"); - } - //如果被禁用了的话 直接跳过 进入到下一个状态 - if (Boolean.TRUE.equals(wflowModels.getIsStop())) { - //被禁用了 调2次状态机 - projectStateMachineUtil.pass(constructProject); - projectStateMachineUtil.pass(constructProject); - constructProject.setUpdateOn(LocalDateTime.now()); - projectService.updateById(constructProject); - return "因为建设方案流程被禁用了 直接跳过!"; - } - - ProcessStartParamsVo params = new ProcessStartParamsVo(); - params.setUser(declaredProjectManage.buildUser(userId)); - params.setProcessUsers(Collections.emptyMap()); - //放入条件判断的项目字段 - //把条件值给放入工作流 - defaultDeclaredProjectManage.buildCondition(params, oldProject, req); - // 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 - Map orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(userId, constructProject); - String instanceId = processService.startProcessLs(wflowModels, params, orgModelMap); - log.info("建设方案项目申报成功 【{}】", instanceId); - - // 保存建设项目相关 - Project buildProject; - if (Boolean.TRUE.equals(req.getRestart())) { - //如果是重新提交 不用生成新版本 前面已经生成过了 - buildProject = contructionPlanModifyProject(oldProject, instanceId); - } else { - buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo, instanceId, userId, oldProject); - } - - //发送给第一个审批人消息 - noticeManage.sendFirstUser(buildProject, wflowModels.getFormName(), instanceId, - WorkNoticeConst.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); - - return instanceId; - } - - private Project contructionPlanModifyProject(Project project, String instanceId) { - projectStateMachineUtil.pass(project); - project.setUpdateOn(LocalDateTime.now()); - project.setInstCode(instanceId); - projectService.updateById(project); - - //保存项目和实例的关系 - ProjectInst projectInst = new ProjectInst(); - projectInst.setProjectId(project.getId()); - projectInst.setInstCode(instanceId); - projectInst.setCreateOn(LocalDateTime.now()); - projectInst.setUpdateOn(LocalDateTime.now()); - projectInst.setInstType(ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS); - projectInstService.save(projectInst); - - return project; - } - - /** - * 驳回 重新提交建设方案 - * - * @param dto - * @return - */ - @Transactional(rollbackFor = Exception.class) - public String restartTheProcess(DefaultDeclaredDTO dto) { - ProjectDTO projectDto = dto.getProjectInfo(); - VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); - Project projectInfo = projectService.getById(projectDto.getId()); - VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); - VUtils.isTrue(StringUtils.isBlank(projectDto.getConstructionPlanFile())).throwMessage("提交失败 请提交建设方案!"); - //直接先到待方案审批 - Project project = projectLibManage.saveProjectWithVersionAndStatus(projectDto, null, - ProjectStatus.PLAN_TO_BE_DECLARED.getCode(), Boolean.TRUE); - dto.getProjectInfo().setId(project.getId()); - dto.setRestart(Boolean.TRUE); - return startTheProcess(dto); - } - - /** * 提交建设方案项目 时 更新信息 * * @param project diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java index eedda81..ffa599a 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java @@ -1,9 +1,7 @@ package com.hz.pm.api.projectdeclared.manage; -import cn.hutool.core.collection.CollUtil; import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hz.pm.api.common.helper.UserInfoHelper; import com.hz.pm.api.common.util.ExcelDownUtil; import com.hz.pm.api.common.util.ExcelExportStyle; @@ -15,12 +13,10 @@ import com.hz.pm.api.projectlib.helper.ProjectHelper; import com.hz.pm.api.projectlib.manage.ProjectLibManage; import com.hz.pm.api.projectlib.model.dto.ProjectDTO; import com.hz.pm.api.projectlib.model.entity.Project; -import com.hz.pm.api.projectlib.model.entity.ProjectApplication; -import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; +import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; import com.hz.pm.api.projectlib.model.req.ProjectListReq; import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; -import com.hz.pm.api.projectlib.service.IProjectApplicationService; import com.hz.pm.api.projectlib.service.IProjectService; import com.hz.pm.api.user.security.model.UserFullInfoDTO; import com.hz.pm.api.user.util.LoginUserUtil; @@ -28,7 +24,6 @@ import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.NdDateUtils; -import com.wflow.exception.BusinessException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -38,7 +33,6 @@ import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.time.LocalDateTime; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -60,10 +54,6 @@ public class ProjectAdjustmentManage { private final IProjectService projectService; - private final IProjectApplicationService projectApplicationService; - - private final RestartProcessMapUtil reStartProcessMapUtil; - private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; private final ProjectLibManage projectLibManage; @@ -102,38 +92,10 @@ public class ProjectAdjustmentManage { return declaredFunction.apply(dto); } - private Boolean modifyProject(ProjectDTO projectDto) { - //先修改项目信息 - Project project = new Project(); - BeanUtils.copyProperties(projectDto, project); - project.setUpdateOn(LocalDateTime.now()); - if (!projectService.updateById(project)) { - throw new BusinessException("项目调整失败"); - } - //再修改应用信息 - if (CollUtil.isNotEmpty(projectDto.getApplicationList())) { - //采取批量删除 批量添加的方式 - projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectId, project.getId())); - //批量添加 - List applications = projectDto.getApplicationList().stream().map(application -> { - ProjectApplication projectApplication = new ProjectApplication(); - BeanUtils.copyProperties(application, projectApplication); - projectApplication.setProjectId(project.getId()); - projectApplication.setProjectCode(project.getProjectCode()); - projectApplication.setProjectVersion(project.getVersion()); - return projectApplication; - }).collect(Collectors.toList()); - projectApplicationService.saveBatch(applications); - } - return Boolean.TRUE; - } - private static final List PROJECT_STATUS = Arrays.asList( ProjectStatus.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), ProjectStatus.PREQUALIFICATION_FAILED.getCode(), - ProjectStatus.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), - ProjectStatus.SCHEME_REVIEW_FAILED.getCode()); + ProjectStatus.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()); /** * 项目库 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java deleted file mode 100644 index ed74f8a..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.hz.pm.api.projectdeclared.manage; - -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.hz.pm.api.projectdeclared.converter.ApplicationConverter; -import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; -import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; -import com.hz.pm.api.projectlib.manage.ProjectLibManage; -import com.hz.pm.api.projectlib.model.dto.ProjectDTO; -import com.hz.pm.api.projectlib.model.entity.Project; -import com.hz.pm.api.projectlib.model.entity.ProjectApplication; -import com.hz.pm.api.projectlib.service.IProjectApplicationService; -import com.hz.pm.api.projectlib.service.IProjectService; -import com.hz.pm.api.provincial.service.IJoinReviewProvincialBureauService; -import com.hz.pm.api.todocenter.constant.TodoCenterConst; -import com.ningdatech.basic.function.VUtils; -import com.ningdatech.file.service.FileService; -import com.wflow.exception.BusinessException; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Objects; - -/** - * @Classname ReviewByProvincialDeptManage - * @Description 省级部门联审 - * @Date 2023/2/17 14:48 - * @Author PoffyZhang - */ -@Component -@Slf4j -@RequiredArgsConstructor -public class ReviewByProvincialDeptManage { - - private final IProjectService projectService; - - private final FileService fileService; - - private final IJoinReviewProvincialBureauService joinReviewProvincialBureauService; - - private final IProjectApplicationService applicationService; - - private final ProjectLibManage projectLibManage; - - @Value("${spring.profiles.active}") - private String active; - - /** - * 省级部门联审 - * - * @param project - * @return - */ - @Transactional(rollbackFor = Exception.class) - public Boolean startTheProcess(Project project) { - VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!"); - Project projectInfo = projectService.getById(project.getId()); - VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); - - //首先要判断 项目当前状态 是不是 省级部门联审 - VUtils.isTrue(!ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals(projectInfo.getStatus()) || - !ProjectStatus.NOT_APPROVED.getCode().equals(projectInfo.getStage())) - .throwMessage("提交失败 该项目不是 省级部门联审状态状态或者未立项阶段"); - - // 对接省级联审的接口 - List applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectId, projectInfo.getId())); - if (joinReviewProvincialBureauService.pushImportProject(ApplicationConverter.convertProject(projectInfo, applications, fileService, active))) { - return Boolean.TRUE; - } - return Boolean.FALSE; - } - - /** - * 省级部门联审 重新提交 - * - * @param declaringDTO \ - * @return \ - */ - @Transactional(rollbackFor = Exception.class) - public String restartTheProcess(DefaultDeclaredDTO declaringDTO) { - ProjectDTO project = declaringDTO.getProjectInfo(); - VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!"); - Project projectInfo = projectService.getNewProject(project.getId()); - VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); - - //首先要判断 项目当前状态 是不是 省级部门联审不通过 - VUtils.isTrue(!ProjectStatus.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode().equals(projectInfo.getStatus()) || - !ProjectStatus.NOT_APPROVED.getCode().equals(projectInfo.getStage())) - .throwMessage("提交失败 该项目不是 省级部门联审不通过状态或者未立项阶段"); - - // 对接省级联审的接口 - Project p = projectLibManage.saveProjectWithVersionAndStatus(project, null, - ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), Boolean.FALSE); - - List applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectId, p.getId())); - - //入库暂存表 后续处理 对接外部接口 - p.setUpdateOn(LocalDateTime.now()); - //保存一下 当前的主管单位发起人 - p.setPreStartUserId(p.getSponsor()); - //当前实例置为空 - p.setInstCode(TodoCenterConst.Declared.NULL_INST_CODE); - declaringDTO.getProjectInfo().setId(p.getId()); - projectService.updateById(p); - if (!joinReviewProvincialBureauService.pushImportProject( - ApplicationConverter.convertProject(p, applications, fileService, active))) { - throw new BusinessException("提交省级部门联审失败"); - } - - return String.valueOf(p.getId()); - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java index a47ea5a..71d1e20 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java @@ -69,7 +69,7 @@ public class ReviewChecklistManage { //项目查最新 query.eq(Project::getNewest, Boolean.TRUE); //建设方案提交后的状态 - query.ge(Project::getStatus, ProjectStatus.SCHEME_UNDER_REVIEW.getCode()) + query.ge(Project::getStatus, null) .ne(Project::getStatus, ProjectStatus.PLAN_TO_BE_DECLARED.getCode()); UserInfoDetails user = LoginUserUtil.loginUserDetail(); buildReviewCheckPermission(query, user); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/RestartProcessMapUtil.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/RestartProcessMapUtil.java index 290d2b8..55f8b46 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/RestartProcessMapUtil.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/RestartProcessMapUtil.java @@ -1,7 +1,8 @@ package com.hz.pm.api.projectdeclared.utils; import com.google.common.collect.Maps; -import com.hz.pm.api.projectdeclared.manage.*; +import com.hz.pm.api.projectdeclared.manage.DeclaredProjectManage; +import com.hz.pm.api.projectdeclared.manage.PrequalificationDeclaredProjectManage; import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; import com.hz.pm.api.projectlib.manage.DeclaredRecordManage; import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; @@ -24,22 +25,14 @@ public class RestartProcessMapUtil { private static final Map> RESTART_PROCESS_MAP = Maps.newHashMap(); public RestartProcessMapUtil(DeclaredProjectManage declaredProjectManage, - ConstructionPlanManage constructionPlanManage, PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage, - ReviewByProvincialDeptManage provincialDeptManage, DeclaredRecordManage declaredRecordManage) { //重新项目申报 RESTART_PROCESS_MAP.put(ProjectStatus.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), declaredProjectManage::reStartTheProcess); - //建设方案 - RESTART_PROCESS_MAP.put(ProjectStatus.SCHEME_REVIEW_FAILED.getCode(), - constructionPlanManage::restartTheProcess); //预审方案 RESTART_PROCESS_MAP.put(ProjectStatus.PREQUALIFICATION_FAILED.getCode(), prequalificationDeclaredProjectManage::restartTheProcess); - //省级联审 - RESTART_PROCESS_MAP.put(ProjectStatus.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), - provincialDeptManage::restartTheProcess); // 立项备案重新提交 RESTART_PROCESS_MAP.put(ProjectStatus.DECLARED_APPROVED_RECORD_FAILED.getCode(), declaredRecordManage::restartDeclaredRecord); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/AnnualPlanController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/AnnualPlanController.java index 7826ba1..091638f 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/AnnualPlanController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/AnnualPlanController.java @@ -1,8 +1,5 @@ package com.hz.pm.api.projectlib.controller; -import com.ningdatech.basic.model.PageVo; -import com.ningdatech.log.annotation.WebLog; -import com.hz.pm.api.projectlib.model.enumeration.ProjectLibFlagEnum; import com.hz.pm.api.projectlib.manage.AnnualPlanLibManage; import com.hz.pm.api.projectlib.model.dto.ProjectDTO; import com.hz.pm.api.projectlib.model.req.ProjectApprovedReq; @@ -10,11 +7,12 @@ import com.hz.pm.api.projectlib.model.req.ProjectIdReq; import com.hz.pm.api.projectlib.model.req.ProjectListReq; import com.hz.pm.api.projectlib.model.req.StartProjectDeclareReq; import com.hz.pm.api.projectlib.model.vo.AnnualPlanListItemVO; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; @@ -62,13 +60,6 @@ public class AnnualPlanController { annualPlanLibManage.suspendAnnualPlan(req); } - @PostMapping("/importAnnualPlan") - @ApiOperation("导入年度计划") - @WebLog("导入年度计划") - public void importAnnualPlan(@RequestParam("importFlag") ProjectLibFlagEnum importFlag, MultipartFile file) { - annualPlanLibManage.importAnnualPlan(importFlag,file); - } - @PostMapping("/modify") @ApiOperation("年度计划编辑") @WebLog("年度计划编辑") @@ -83,11 +74,4 @@ public class AnnualPlanController { annualPlanLibManage.exportList(param, response); } - @PostMapping("/exportModifyList") - @ApiOperation("项目(增补)库编辑表导出") - @WebLog("项目(增补)库编辑表导出") - public void exportModifyList(@Valid @RequestBody ProjectListReq param, HttpServletResponse response) { - annualPlanLibManage.exportModifyList(param, response); - } - } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectApplicationController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectApplicationController.java index b6af4d1..5dd918e 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectApplicationController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectApplicationController.java @@ -1,15 +1,13 @@ package com.hz.pm.api.projectlib.controller; -import com.ningdatech.basic.model.PageVo; -import com.ningdatech.log.annotation.WebLog; import com.hz.pm.api.projectlib.manage.ApplicationManage; import com.hz.pm.api.projectlib.model.dto.ApplicationAppCodeSaveDTO; -import com.hz.pm.api.projectlib.model.req.ProjectListReq; -import com.hz.pm.api.projectlib.model.vo.ProjectDetailVO; +import com.ningdatech.log.annotation.WebLog; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; + import javax.validation.Valid; /** @@ -40,9 +38,4 @@ public class ProjectApplicationController { return applicationManage.saveAppCode(dto); } - @GetMapping("/to-register-app-project-list") - @ApiOperation("待应用预注册的项目应用列表") - public PageVo toRegisterAppProjectLibList(ProjectListReq req) { - return applicationManage.toRegisterAppProjectLibList(req); - } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectApprovalHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectApprovalHandle.java index 1b1926d..2b07e70 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectApprovalHandle.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectApprovalHandle.java @@ -63,7 +63,7 @@ public class ProjectApprovalHandle extends AbstractProcessHandle { || ProjectStatus.DECLARED_APPROVED_TO_BE_RECORD.eq(status) || ProjectStatus.DECLARED_APPROVED_RECORD_AUDITING.eq(status)) { // 根据建设方案评审通过的时间获取 - final List events = Arrays.asList(ProjectStateChangeEvent.PLAN_REVIEW_PASS, + final List events = Arrays.asList( ProjectStateChangeEvent.DECLARED_RECORD_SUBMIT, ProjectStateChangeEvent.DECLARED_RECORD_RESUBMIT); ProjectStatusChange projectStatusChange = projectStatusChangeService.getLastOne(projectIds, events); @@ -73,7 +73,7 @@ public class ProjectApprovalHandle extends AbstractProcessHandle { detail.setStepStatus(StepStatusEnum.ON_GOING); } else { // 取 状态机 改变状态时间 - final List events = Arrays.asList(ProjectStateChangeEvent.PLAN_REVIEW_PASS, + final List events = Arrays.asList( ProjectStateChangeEvent.DECLARED_RECORD_FAILED, ProjectStateChangeEvent.DECLARED_RECORD_PASS); ProjectStatusChange projectStatusChange = projectStatusChangeService.getLastOne(projectIds, events); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AnnualPlanLibManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AnnualPlanLibManage.java index 14117fd..447aaac 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AnnualPlanLibManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AnnualPlanLibManage.java @@ -1,18 +1,8 @@ package com.hz.pm.api.projectlib.manage; -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.ExcelImportUtil; -import cn.afterturn.easypoi.excel.entity.ImportParams; -import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollUtil; -import cn.hutool.poi.excel.ExcelUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Assert; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.google.common.collect.Lists; import com.hz.pm.api.common.enumeration.CommonEnum; import com.hz.pm.api.common.helper.UserInfoHelper; import com.hz.pm.api.common.model.constant.CommonConst; @@ -23,13 +13,8 @@ import com.hz.pm.api.common.util.ExcelDownUtil; import com.hz.pm.api.datascope.model.DataScopeDTO; import com.hz.pm.api.datascope.utils.DataScopeUtil; import com.hz.pm.api.projectlib.helper.ProjectHelper; -import com.hz.pm.api.projectlib.model.dto.AnnualLibExportDTO; -import com.hz.pm.api.projectlib.model.dto.AnnualLibImportDTO; import com.hz.pm.api.projectlib.model.dto.ProjectDTO; import com.hz.pm.api.projectlib.model.entity.Project; -import com.hz.pm.api.projectlib.model.entity.ProjectRenewalFundDeclaration; -import com.hz.pm.api.projectlib.model.enumeration.ProjectLibFlagEnum; -import com.hz.pm.api.projectlib.model.enumeration.ProjectRenewalApprovalStatusEnum; import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; import com.hz.pm.api.projectlib.model.req.ProjectApprovedReq; import com.hz.pm.api.projectlib.model.req.ProjectIdReq; @@ -46,23 +31,14 @@ import com.hz.pm.api.user.util.LoginUserUtil; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.basic.util.StrPool; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.CollectionUtils; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; import java.util.*; -import java.util.stream.Collectors; import static com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus.*; @@ -90,7 +66,7 @@ public class AnnualPlanLibManage { * 年度计划查询状态 */ private static final List ANNUAL_PLAN_LIST_STATUS = - Arrays.asList(IN_THE_ANNUAL_PLAN, SCHEME_UNDER_REVIEW, SCHEME_REVIEW_FAILED, TO_BE_APPROVED, TO_BE_DECLARED, + Arrays.asList(IN_THE_ANNUAL_PLAN, TO_BE_APPROVED, TO_BE_DECLARED, PLAN_TO_BE_DECLARED, PENDING_PREQUALIFICATION_CHOICE, PROJECT_APPROVED, TO_BE_PURCHASED, UNDER_CONSTRUCTION, ON_PILOT_RUNNING, ARCHIVED); @@ -277,223 +253,4 @@ public class AnnualPlanLibManage { } - @Transactional(rollbackFor = Exception.class) - public void importAnnualPlan(ProjectLibFlagEnum importFlag, MultipartFile file) { - Long userId = LoginUserUtil.getUserId(); - ImportParams params = new ImportParams(); - // 标题行数 - params.setTitleRows(2); - // 从第几行开始,因为第一、二个大标题被上面的参数给占了,所以不是5 - params.setHeadRows(3); - // 表格数量 - params.setSheetNum(2); - List list = null; - try { - list = ExcelImportUtil.importExcel(file.getInputStream(), AnnualLibImportDTO.class, params); - } catch (Exception e) { - throw new BizException(e.getMessage()); - } - // 筛选出导入的新建项目 - List newList = - list.stream().filter(d -> CommonConst.NEW_CONSTRUCTION.equals(d.getIsFirst())).collect(Collectors.toList()); - List projectList = newList.stream().map(n -> { - Project project = new Project(); - assemblyProjectInfo(n, project); - // 根据传入标志判断是否临时增补 - if (ProjectLibFlagEnum.ANNUAL_PLAN.equals(importFlag)) { - project.setIsTemporaryAugment(CommonEnum.NO.getCode()); - } else if (ProjectLibFlagEnum.ANNUAL_PLAN_SUPPLEMENT.equals(importFlag)) { - project.setIsTemporaryAugment(CommonEnum.YES.getCode()); - } - project.setCreateBy(userId); - project.setUpdateBy(userId); - project.setCreateOn(LocalDateTime.now()); - project.setUpdateOn(LocalDateTime.now()); - return project; - }).collect(Collectors.toList()); - // 保存到项目库中 - projectService.saveOrUpdateBatch(projectList); - - // 筛选出导入的续建项目 - List continuedList = list.stream() - .filter(d -> CommonConst.CONTINUED_CONSTRUCTION.equals(d.getIsFirst())).collect(Collectors.toList()); - List renewalFundDeclarationList = continuedList.stream().map(c -> { - ProjectRenewalFundDeclaration renewalFundDeclaration = new ProjectRenewalFundDeclaration(); - BeanUtils.copyProperties(c, renewalFundDeclaration); - renewalFundDeclaration.setAnnualPaymentAmount(c.getAnnualPlanAmount()); - renewalFundDeclaration.setOtherAmount(c.getDeclareOtherAmount()); - renewalFundDeclaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name()); - renewalFundDeclaration.setCreateOn(LocalDateTime.now()); - renewalFundDeclaration.setUpdateOn(LocalDateTime.now()); - return renewalFundDeclaration; - }).collect(Collectors.toList()); - // 保存到续建项目资金库中 - projectRenewalFundDeclarationService.saveBatch(renewalFundDeclarationList); - } - - private void assemblyProjectInfo(AnnualLibImportDTO data, Project project) { - Long projectId = data.getProjectId(); - // 从项目库中先查询出对应的项目ID的项目 - Project projectInfo = projectService.getById(projectId); - if (Objects.nonNull(projectInfo)) { - BeanUtils.copyProperties(projectInfo, project); - } else { - // 新增的年度计划库项目 - throw new BizException("项目库中不存在项目ID为:" + projectId + "的项目"); - } - project.setId(data.getProjectId()); - project.setProjectName(data.getProjectName()); - project.setProjectIntroduction(data.getProjectIntroduction()); - // 建设依据忽略 - project.setIsFirst(CommonConst.NEW_CONSTRUCTION.equals(data.getIsFirst()) ? 1 : 0); - String[] dataArr = data.getBuildCycle().split(CommonConst.ZHI); - if (CollectionUtils.isEmpty(Arrays.asList(dataArr))) { - throw new BizException("项目ID为:" + data.getProjectId() + "的建设起止年限格式不正确,请按照xx年xx月至xx年xx月的格式输入!"); - } - project.setBeginTime(dataArr[0].trim()); - project.setEndTime(dataArr[1].trim()); - project.setDeclareAmount(data.getDeclaredAmount()); - // TODO 年度计划 - // project.setAnnualPlanAmount(data.getAnnualPlanAmount()); - project.setDeclareHaveAmount(data.getDeclareHaveAmount()); - project.setDeclareGovOwnFinanceAmount(data.getDeclareGovOwnFinanceAmount()); - project.setDeclareGovSuperiorFinanceAmount(data.getDeclareGovSuperiorFinanceAmount()); - project.setDeclareBankLendingAmount(data.getDeclareBankLendingAmount()); - project.setDeclareOtherAmount(data.getDeclareOtherAmount()); - project.setEngineeringSpeedOne(data.getFirstQuarter()); - project.setEngineeringSpeedTwo(data.getSecondQuarter()); - project.setEngineeringSpeedThree(data.getThirdQuarter()); - project.setEngineeringSpeedFour(data.getFourthQuarter()); - project.setBuildOrgName(data.getBuildUnitName()); - project.setContactName(data.getContactName()); - project.setResponsibleMan(data.getResponsibleMan()); - project.setProjectRemarks(data.getProjectRemarks()); - } - - public void exportModifyList(ProjectListReq param, HttpServletResponse response) { - int year = LocalDateTime.now().getYear(); - Integer isTemporaryAugment = param.getIsTemporaryAugment(); - Assert.notNull(isTemporaryAugment, "请传入是否临时增补标志"); - param.setIsTemporaryAugment(isTemporaryAugment); - String fileName; - // 设置excel的文件名称和是否增补 - if (CommonEnum.NO.getCode().equals(isTemporaryAugment)) { - fileName = "杭州市" + year + "年数字化项目年度计划库编辑表"; - } else if (CommonEnum.YES.getCode().equals(isTemporaryAugment)) { - fileName = "杭州市" + year + "年数字化项目年度计划增补库编辑表"; - } else { - throw BizException.wrap("是否临时增补标志无效"); - } - LambdaQueryWrapper query = ProjectHelper.projectQuery(param); - query.eq(Project::getNewest, Boolean.TRUE); - query.eq(Project::getIsTemporaryAugment, isTemporaryAugment); - query.orderByDesc(Project::getAnnualPlanAddTime); - query.in(Project::getStatus, CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatus::getCode)); - // 数据权限 - if (!buildProjectLibPermission(query)) { - throw BizException.wrap("暂无年度计划导出权限"); - } - List projects = projectService.list(query); - List list = projects.stream().map(p -> { - AnnualLibExportDTO dto = new AnnualLibExportDTO(); - BeanUtils.copyProperties(p, dto); - String beginTime = p.getBeginTime(); - String begin = beginTime.replace(StrPool.DASH, CommonConst.YEAR); - begin = begin + CommonConst.MONTH; - String endTime = p.getEndTime(); - String end = endTime.replace(StrPool.DASH, CommonConst.YEAR); - end = end + CommonConst.MONTH; - String buildCycle = begin + CommonConst.ZHI + end; - dto.setBuildCycle(buildCycle); - dto.setProjectId(p.getId()); - dto.setDeclaredAmount(p.getDeclareAmount()); - dto.setBuildUnitName(p.getBuildOrgName()); - String buildBasis = p.getBuildBasis(); - List fileArray = JSON.parseArray(buildBasis, JSONObject.class); - List nameList = CollUtils.fieldList(fileArray, w -> w.getString(CommonConst.TITLE) - + StrPool.LEFT_BRACKET + w.getString(CommonConst.BASIS_FILE_NAME) + StrPool.RIGHT_BRACKET); - String basis = String.join(StrPool.COMMA, nameList); - dto.setBuildBasis(basis); - if (CommonEnum.YES.getCode().equals(p.getIsFirst())) { - dto.setIsFirst(CommonConst.NEW_CONSTRUCTION); - } else if (CommonEnum.NO.getCode().equals(p.getIsFirst())) { - dto.setIsFirst(CommonConst.CONTINUED_CONSTRUCTION); - } - dto.setFirstQuarter(p.getEngineeringSpeedOne()); - dto.setSecondQuarter(p.getEngineeringSpeedTwo()); - dto.setThirdQuarter(p.getEngineeringSpeedThree()); - dto.setFourthQuarter(p.getEngineeringSpeedFour()); - return dto; - }).collect(Collectors.toList()); - - int count = 0; - for (AnnualLibExportDTO annualLibExportDTO : list) { - count++; - annualLibExportDTO.setSerialNumber(count); - } - - // 获取本地目录的年度计划编辑表Excel模板 - File directory = new File(""); - String templateName = "丽水市" + year + "年数字化项目年度计划编辑表"; - String templatePath = - directory.getAbsolutePath() + File.separator + "template" + File.separator + templateName + ".xls"; - TemplateExportParams temp = new TemplateExportParams(templatePath); - temp.setSheetNum(new Integer[]{0, 1}); - temp.setSheetName(new String[]{"实施类(新建)", "实施类(续建)"}); - Map map = new HashMap<>(4); - map.put("mapList", list); - map.put("mapList1", Lists.newArrayList()); - Workbook workbook = ExcelExportUtil.exportExcel(temp, map); - if (CollUtil.isEmpty(list)) { - // 输出空模板 - // 获取本地目录的年度计划编辑表空Excel模板 - String emptyTemplate = "丽水市" + year + "年数字化项目年度计划编辑表(空)"; - String emptyTemplatePath = "template" + File.separator + emptyTemplate + ".xls"; - try (InputStream templateInputStream = this.getClass().getClassLoader().getResourceAsStream(emptyTemplatePath); - OutputStream outputStream = response.getOutputStream()) { - if (templateInputStream == null) { - throw new BizException("读取模板失败!"); - } - // 设置要下载的文件的名称 - response.setHeader("Content-disposition", "attachment;fileName=" + new String(templateName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1)); - // 设置文件的MIME类型 - response.setContentType("application/vnd.ms-excel;charset=UTF-8"); - - byte[] b = new byte[2048]; - int len; - while ((len = templateInputStream.read(b)) != -1) { - outputStream.write(b, 0, len); - } - outputStream.flush(); - } catch (IOException e) { - throw new BizException("读取模板失败!"); - } - return; - } - if (workbook == null) { - throw new BizException("读取编辑表模板失败!"); - } - // 重置响应对象 - response.reset(); - try { - response.setHeader("Content-disposition", - "attachment;filename*=utf-8''" + URLEncoder.encode(Objects.requireNonNull(fileName), "UTF-8") + ".xls"); - } catch (UnsupportedEncodingException e) { - log.error("年度计划导出异常:", e); - throw BizException.wrap("年度计划导出异常"); - } - response.setContentType(ExcelUtil.XLS_CONTENT_TYPE); - response.setHeader("Pragma", "no-cache"); - response.setHeader("Cache-Control", "no-cache"); - response.setDateHeader("Expires", 0); - // 写出数据输出流到页面 - try (OutputStream output = response.getOutputStream(); - BufferedOutputStream bos = new BufferedOutputStream(output)) { - workbook.write(bos); - bos.flush(); - } catch (IOException e) { - log.error("年度计划导出异常:", e); - throw BizException.wrap("年度计划导出异常"); - } - } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java index 16d6347..a585b64 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java @@ -1,29 +1,19 @@ package com.hz.pm.api.projectlib.manage; -import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.Assert; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hz.pm.api.common.model.constant.BizConst; import com.hz.pm.api.common.util.HmacAuthUtil; import com.hz.pm.api.projectlib.model.dto.ApplicationAppCodeSaveDTO; -import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.entity.ProjectApplication; -import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; -import com.hz.pm.api.projectlib.model.req.ProjectListReq; -import com.hz.pm.api.projectlib.model.vo.ProjectApplicationVO; -import com.hz.pm.api.projectlib.model.vo.ProjectDetailVO; import com.hz.pm.api.projectlib.service.IProjectApplicationService; import com.hz.pm.api.projectlib.service.IProjectService; -import com.hz.pm.api.user.security.model.UserInfoDetails; import com.hz.pm.api.user.util.LoginUserUtil; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.model.ApiResponse; -import com.ningdatech.basic.model.PageVo; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -34,11 +24,8 @@ import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; import java.time.LocalDateTime; -import java.util.Collections; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Collectors; /** *

@@ -133,48 +120,4 @@ public class ApplicationManage { throw new BizException("获取报告失败!"); } - /** - * 查询 待注册的 - * - * @param req - * @return - */ - public PageVo toRegisterAppProjectLibList(ProjectListReq req) { - UserInfoDetails user = LoginUserUtil.loginUserDetail(); - //建设单位 就是当前人的单位 - Page page = req.page(); - projectService.page(page, Wrappers.lambdaQuery(Project.class) - .eq(Project::getStage, ProjectStatus.NOT_APPROVED.getCode()) - .eq(Project::getStatus, ProjectStatus.TO_BE_APP_REGISTER.getCode()) - .eq(Project::getBuildOrgCode, user.getMhUnitIdStr())); - if (CollUtil.isEmpty(page.getRecords())) { - return PageVo.empty(); - } - - List projectCodes = page.getRecords().stream().map(Project::getProjectCode).collect(Collectors.toList()); - //要去查询应用 此阶段 必定是 建设方案后的 所以直接查 建设方案的应用 - List apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) - .in(ProjectApplication::getProjectCode, projectCodes) - .eq(ProjectApplication::getIsConstruct, Boolean.TRUE)); - Map> appMap = apps.stream().collect(Collectors.groupingBy(ProjectApplication::getProjectCode)); - List res = page.getRecords().stream().map(p -> { - ProjectDetailVO vo = BeanUtil.copyProperties(p, ProjectDetailVO.class); - if (appMap.containsKey(p.getProjectCode())) { - List projectApplications = appMap.get(p.getProjectCode()); - vo.setProjectApplications(convert(projectApplications)); - } - return vo; - }).collect(Collectors.toList()); - - return PageVo.of(res, page.getTotal()); - } - - private List convert(List projectApplications) { - if (CollUtil.isNotEmpty(projectApplications)) { - return projectApplications.stream() - .map(a -> BeanUtil.copyProperties(a, ProjectApplicationVO.class)) - .collect(Collectors.toList()); - } - return Collections.emptyList(); - } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java index a25c2b0..92cc0da 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java @@ -8,7 +8,6 @@ import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.xiaoymin.knife4j.core.util.StrUtil; @@ -851,36 +850,7 @@ public class ProjectLibManage { projectInstService.save(projectInst); return project; } - - - /** - * 建设方案申报项目时 保存项目信息和其它相关联的信息 - * - * @param projectDto \ - * @param instanceId \ - * @param userId \ - * @param oldProject \ - * @return \ - */ - public Project saveConstructProjectInDeclared(ProjectDTO projectDto, String instanceId, - Long userId, Project oldProject) { - - Project project = saveConstructProjectNewVersion(projectDto, instanceId, userId, oldProject); - // 将旧的项目状态、阶段置为null,防止项目还会出现在待申报列表 - LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(Project.class); - updateWrapper.set(Project::getStage, null) - .set(Project::getStatus, null) - .eq(Project::getId, oldProject.getId()); - projectService.update(updateWrapper); - //保存项目和实例的关系 - ProjectInst projectInst = new ProjectInst(); - projectInst.setProjectId(project.getId()); - projectInst.setInstCode(instanceId); - projectInst.setInstType(ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS); - projectInstService.save(projectInst); - return project; - } - + /** * 申报新项目时 保存项目信息和其它相关联的信息 * @@ -950,68 +920,6 @@ public class ProjectLibManage { } /** - * 建设方案申报项目时 保存项目信息和其它相关联的信息 - * - * @param projectDto \ - * @param instanceId \ - * @param userId \ - * @param oldProject \ - * @return \ - */ - public Project saveConstructProjectNewVersion(ProjectDTO projectDto, String instanceId, - Long userId, Project oldProject) { - //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 - try { - Project project; - //为空 代表是新申报的 - if (Objects.isNull(projectDto.getId())) { - project = new Project(); - BeanUtils.copyProperties(projectDto, project); - // 被撤回重新申报的项目,项目ID要置空 - project.setId(null); - project.setCreateOn(LocalDateTime.now()); - project.setUpdateOn(LocalDateTime.now()); - project.setStage(ProjectStatus.NOT_APPROVED.getCode()); - project.setStatus(ProjectStatus.SCHEME_UNDER_REVIEW.getCode()); - project.setInstCode(instanceId); - project.setSponsor(String.valueOf(userId)); - // 项目编号不变,版本号加1 - project.setProjectCode(oldProject.getProjectCode()); - project.setVersion(oldProject.getVersion() + 1); - // 标记为建设方案申报 - project.setIsConstruct(Boolean.TRUE); - project.setIsBackReject(Boolean.FALSE); - // 保存初步方案项目ID - if (Boolean.TRUE.equals(oldProject.getIsConstruct())) { - // 重新提交 - project.setPrePlanProjectId(oldProject.getPrePlanProjectId()); - } else { - project.setPrePlanProjectId(oldProject.getId()); - } - if (projectService.save(project)) { - saveApplication(projectDto, project, Boolean.TRUE); - // 将旧的项目版本置为不是最新 - projectService.reverseNewest(project.getProjectCode(), project.getId()); - } - - } else { - //否则是被驳回,重新提交的 新生成一个新版本的项目 - project = newProjectWithVersion(projectDto, Boolean.TRUE); - if (Objects.nonNull(project)) { - project.setInstCode(instanceId); - project.setSponsor(String.valueOf(userId)); - projectService.updateById(project); - } - } - return project; - } catch (Exception e) { - log.error("项目信息入库错误 " + e); - throw new BusinessException("项目信息入库错误 :" + e); - } - } - - - /** * 在其它项目阶段 保存项目信息和其它相关联的信息 * * @param projectDto \ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/AnnualLibExportDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/AnnualLibExportDTO.java deleted file mode 100644 index 54dfb70..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/AnnualLibExportDTO.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.hz.pm.api.projectlib.model.dto; - -import java.math.BigDecimal; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -/** - *

- * AnnualLibImportDTO - *

- * - * @author WendyYang - * @since 13:46 2023/2/13 - */ -@Data -public class AnnualLibExportDTO { - - @NotNull(message = "年度投资额不能为空") - @Excel(name = "年度投资额",groupName = "2023年计划") - private BigDecimal annualPlanAmount; - - @NotNull(message = "自由资金不能为空") - @Excel(name = "自有资金",groupName = "资金来源") - private BigDecimal declareHaveAmount; - @Excel(name = "政府投资-本级财政资金") - @NotNull(message = "政府投资-本级财政不能为空") - private BigDecimal declareGovOwnFinanceAmount; - @Excel(name = "政府投资-上级补助资金") - @NotNull(message = "政府投资-上级补助资金不能为空") - private BigDecimal declareGovSuperiorFinanceAmount; - @Excel(name = "银行贷款") - @NotNull(message = "银行贷款不能为空") - private BigDecimal declareBankLendingAmount; - @Excel(name = "其他") - @NotNull(message = "其他不能为空") - private BigDecimal declareOtherAmount; - - @Excel(name = "一季度",groupName = "进度和支付计划") - @NotBlank(message = "一季度不能为空") - private String firstQuarter; - @Excel(name = "二季度") - @NotBlank(message = "二季度不能为空") - private String secondQuarter; - @Excel(name = "三季度") - @NotBlank(message = "三季度不能为空") - private String thirdQuarter; - @Excel(name = "四季度") - @NotBlank(message = "四季度不能为空") - private String fourthQuarter; - - @NotNull(message = "序号不能为空") - @Excel(name = "序号") - private Integer serialNumber; - - @Excel(name = "项目id") - @NotNull(message = "项目ID不能为空") - private Long projectId; - - @Excel(name = "项目名称") - @NotBlank(message = "项目名称不能为空") - private String projectName; - - @NotBlank(message = "建设内容不能为空") - @Excel(name = "建设内容") - private String projectIntroduction; - - @NotBlank(message = "建设依据不能为空") - @Excel(name = "建设依据") - private String buildBasis; - - @Excel(name = "建设性质") - @NotBlank(message = "建设性质不能为空") - private String isFirst; - - @Excel(name = "建设起止年限(填写到月)") - @NotBlank(message = "建设起止年限不能为空") - private String buildCycle; - - @NotBlank(message = "总投资不能为空") - @Excel(name = "总投资") - private BigDecimal declaredAmount; - - @Excel(name = "建设单位") - @NotBlank(message = "建设单位不能为空") - private String buildUnitName; - - @Excel(name = "项目联系人") - @NotBlank(message = "项目联系人不能为空") - private String contactName; - - @Excel(name = "项目分管领导") - @NotBlank(message = "项目分管领导不能为空") - private String responsibleMan; - - @Excel(name = "备注") - private String projectRemarks; - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/AnnualLibImportDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/AnnualLibImportDTO.java deleted file mode 100644 index a6f669c..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/AnnualLibImportDTO.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.hz.pm.api.projectlib.model.dto; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; - -/** - *

- * AnnualLibImportDTO - *

- * - * @author WendyYang - * @since 13:46 2023/2/13 - */ -@Data -public class AnnualLibImportDTO { - - @Excel(name = "项目进展",groupName = "到2022年底完成情况") - @NotNull(message = "项目进展不能为空") - private String projectProgress; - @Excel(name = "累计投资") - @NotNull(message = "累计投资不能为空") - private BigDecimal cumulativeInvest; - - @NotNull(message = "年度投资额不能为空") - @Excel(name = "年度投资额",groupName = "2023年计划") - private BigDecimal annualPlanAmount; - - @NotNull(message = "自由资金不能为空") - @Excel(name = "自有资金",groupName = "资金来源") - private BigDecimal declareHaveAmount; - @Excel(name = "政府投资-本级财政资金") - @NotNull(message = "政府投资-本级财政不能为空") - private BigDecimal declareGovOwnFinanceAmount; - @Excel(name = "政府投资-上级补助资金") - @NotNull(message = "政府投资-上级补助资金不能为空") - private BigDecimal declareGovSuperiorFinanceAmount; - @Excel(name = "银行贷款") - @NotNull(message = "银行贷款不能为空") - private BigDecimal declareBankLendingAmount; - @Excel(name = "国家、省补助",groupName = "资金来源") - @NotNull(message = "国家、省补助不能为空") - private BigDecimal govSuperiorFinanceAmount; - @Excel(name = "地方财政统筹") - @NotNull(message = "地方财政统筹不能为空") - private BigDecimal govOwnFinanceAmount; - @Excel(name = "建设单位自筹") - @NotNull(message = "建设单位自筹不能为空") - private BigDecimal haveAmount; - @Excel(name = "其他") - @NotNull(message = "其他不能为空") - private BigDecimal declareOtherAmount; - - @Excel(name = "一季度",groupName = "进度和支付计划") - @NotBlank(message = "一季度不能为空") - private String firstQuarter; - @Excel(name = "二季度") - @NotBlank(message = "二季度不能为空") - private String secondQuarter; - @Excel(name = "三季度") - @NotBlank(message = "三季度不能为空") - private String thirdQuarter; - @Excel(name = "四季度") - @NotBlank(message = "四季度不能为空") - private String fourthQuarter; - - @NotNull(message = "序号不能为空") - @Excel(name = "序号") - private Integer serialNumber; - - @Excel(name = "项目id") - @NotNull(message = "项目ID不能为空") - private Long projectId; - - @Excel(name = "项目名称") - @NotBlank(message = "项目名称不能为空") - private String projectName; - - @NotBlank(message = "建设内容不能为空") - @Excel(name = "建设内容") - private String projectIntroduction; - - @NotBlank(message = "建设依据不能为空") - @Excel(name = "建设依据") - private String buildBasis; - - @Excel(name = "建设性质") - @NotBlank(message = "建设性质不能为空") - private String isFirst; - - @Excel(name = "建设周期") - @NotBlank(message = "建设周期不能为空") - private String constructionCycle; - - @Excel(name = "建设起止年限(填写到月)") - @NotBlank(message = "建设起止年限不能为空") - private String buildCycle; - - @NotBlank(message = "总投资不能为空") - @Excel(name = "总投资") - private BigDecimal declaredAmount; - - @Excel(name = "建设单位") - @NotBlank(message = "建设单位不能为空") - private String buildUnitName; - - @Excel(name = "项目联系人") - @NotBlank(message = "项目联系人不能为空") - private String contactName; - - @Excel(name = "项目分管领导") - @NotBlank(message = "项目分管领导不能为空") - private String responsibleMan; - - @Excel(name = "备注") - private String projectRemarks; - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java index 9ad9481..0b673ce 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java @@ -37,15 +37,12 @@ public enum ProjectStatus implements IStatus { DEPARTMENT_JOINT_REVIEW_FAILED(10009, "部门联审不通过", null), IN_THE_ANNUAL_PLAN(10010, "年度计划中", null), BE_SUSPENDED(10011, "被暂缓", null), - SCHEME_UNDER_REVIEW(10012, "方案评审中", GovProjectStatusEnum.APPROVAL), - SCHEME_REVIEW_FAILED(10013, "方案评审不通过", null), TO_BE_APPROVED(10014, "待立项批复", GovProjectStatusEnum.PENDING), TO_BE_DECLARED(10015, "待申报", null), PLAN_TO_BE_DECLARED(10016, "方案待申报", null), PENDING_PREQUALIFICATION_CHOICE(10017, "待预审选择态", null), PREQUALIFICATION_WITHDRAW_CHOICE(10019, "预审中撤回选择态", null), APPROVED_AFTER_CHOICE(10020, "立项批复后选择态", null), - TO_BE_APP_REGISTER(10021, "待应用注册", null), /** * 信产项目备案 */ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/contants/ProvincialContant.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/contants/ProvincialContant.java deleted file mode 100644 index 4b41855..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/contants/ProvincialContant.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.hz.pm.api.provincial.contants; - -/** - * @Classname ProvincialContant - * @Description - * @Date 2023/9/6 9:16 - * @Author PoffyZhang - */ -public interface ProvincialContant { - - class OssUpload { - public static final String OSS_UPLOAD_URL = "https://pms.zj.gov.cn/prometheus-zhejiang_file_service/api/v1/file/uploadFile"; - public static final String MEDIA_TYPE = "multipart/form-data"; - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/controller/TestController.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/controller/TestController.java deleted file mode 100644 index 4a0d75c..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/controller/TestController.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.hz.pm.api.provincial.controller; - -import com.hz.pm.api.projectdeclared.manage.ReviewByProvincialDeptManage; -import com.hz.pm.api.projectlib.model.entity.Project; -import com.hz.pm.api.provincial.model.res.SjApiResponse; -import com.hz.pm.api.provincial.service.IJoinReviewProvincialBureauService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.validation.Valid; -import java.io.IOException; -import java.io.InputStream; - -/** - * @Classname TestController - * @Description - * @Date 2023/3/2 15:08 - * @Author PoffyZhang - */ -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/v1/test") -@Api(tags = "测试省局接口") -public class TestController { - - private final IJoinReviewProvincialBureauService joinReviewProvincialBureauService; - private final ReviewByProvincialDeptManage provincialDeptManage; - - @GetMapping("/push") - @ApiOperation("测试推送") - public Boolean push(@Valid @RequestParam Long projectId) { - Project project = new Project(); - project.setId(projectId); - return provincialDeptManage.startTheProcess(project); - } - - @GetMapping("/detail") - @ApiOperation("测试获取详情") - public SjApiResponse detail(@RequestParam String projectId) { - return joinReviewProvincialBureauService.processInfo(projectId); - } - - @GetMapping("/path") - @ApiOperation("测试获取详情") - public String path() throws IOException { - InputStream in = this.getClass().getResourceAsStream("/template/simsun.ttc"); - StringBuilder sb = new StringBuilder(); - int n; - while ((n = in.read()) != -1) { - sb.append((char) n); - } - - return sb.toString(); - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/enumeration/ProjectProvincialAuditStatusEnum.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/enumeration/ProjectProvincialAuditStatusEnum.java deleted file mode 100644 index 7bb30f7..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/enumeration/ProjectProvincialAuditStatusEnum.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.hz.pm.api.provincial.enumeration; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.Getter; -import lombok.NoArgsConstructor; - -/** - * @Classname ProjectProvincialAuditStatusEnum - * @Description - * @Date 2023/3/16 11:04 - * @Author PoffyZhang - */ -@Getter -@NoArgsConstructor -@AllArgsConstructor -public enum ProjectProvincialAuditStatusEnum { - /** - * 省级联审的状态 - */ - NOT_AUDIT(0,"未审核"), - AUDITING(1,"审核中"), - SUCCESS(2,"审核通过"), - FAIL(3,"审核不通过"), - WITHDRAW(4,"被撤回"), - BACK(5,"退回地市"); - - private Integer code; - private String desc; -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/manage/ProvincialManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/manage/ProvincialManage.java deleted file mode 100644 index 43c3e31..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/manage/ProvincialManage.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.hz.pm.api.provincial.manage; - -import com.alibaba.fastjson.JSON; -import com.ningdatech.basic.exception.BizException; -import com.hz.pm.api.common.util.CommonInputStreamResource; -import com.hz.pm.api.provincial.contants.ProvincialContant; -import com.hz.pm.api.provincial.model.res.OssApiData; -import com.hz.pm.api.provincial.model.res.OssApiResponse; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.*; -import org.springframework.stereotype.Component; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestTemplate; -import java.io.ByteArrayInputStream; -import java.util.Objects; - -/** - * @Classname ProvincialManage - * @Description - * @Date 2023/9/6 9:08 - * @Author PoffyZhang - */ -@Component -@RequiredArgsConstructor -@Slf4j -public class ProvincialManage { - - public static String uploadToOss(byte[] fileBytes,String fileName) { - String url = ProvincialContant.OssUpload.OSS_UPLOAD_URL; - MultiValueMap params = new LinkedMultiValueMap<>(); - ByteArrayInputStream inputStream = new ByteArrayInputStream(fileBytes); - CommonInputStreamResource commonInputStreamResource = new CommonInputStreamResource(inputStream, fileBytes.length, fileName); - params.add("file", commonInputStreamResource); - RestTemplate restTemplate = new RestTemplate(); - HttpHeaders headers = new HttpHeaders(); - MediaType type = MediaType.parseMediaType(ProvincialContant.OssUpload.MEDIA_TYPE); - headers.setContentType(type); - HttpEntity formEntity = new HttpEntity(params, headers); - ResponseEntity res = restTemplate.postForEntity(url, formEntity, OssApiResponse.class); - log.info("oss res :{}", res); - OssApiResponse body = res.getBody(); - if(Objects.isNull(body)){ - throw new BizException("上传省局oss请求失败"); - } - - if(HttpStatus.OK.value() != body.getRespCode()){ - throw new BizException("上传省局oss失败:" + body.getRespMsg()); - } - - OssApiData ossApiData = JSON.parseObject(JSON.toJSONString(body.getData()), OssApiData.class); - - return ossApiData.getAccessUrl(); - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/FileDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/FileDTO.java deleted file mode 100644 index c6a55cc..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/FileDTO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.hz.pm.api.provincial.model.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @Classname FileDTO - * @Description - * @Date 2023/4/13 9:55 - * @Author PoffyZhang - */ -@Data -public class FileDTO { - - @ApiModelProperty("文件id") - private String fileId; - - @ApiModelProperty("文件名") - private String fileName; - - @ApiModelProperty("url") - private String accessUrl; -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProcessCommentDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProcessCommentDTO.java deleted file mode 100644 index b6b4ef1..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProcessCommentDTO.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.hz.pm.api.provincial.model.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Builder; -import lombok.Data; - -/** - * @Classname ProcessCommentDTO - * @Description - * @Date 2023/3/2 15:25 - * @Author PoffyZhang - */ -@Data -@Builder -@ApiModel(value = "ProcessCommentDTO", description = "省局返回流程审核详情") -public class ProcessCommentDTO { - - @ApiModelProperty("任务id") - private String taskId; - - @ApiModelProperty("comment") - private String comment; - - @ApiModelProperty("流程步骤") - private String stepName; - - @ApiModelProperty("审批状态") - private String status; - - @ApiModelProperty("审批人") - private String label; - - @ApiModelProperty("时间") - private String approverTime; -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvinceApiResponse.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvinceApiResponse.java deleted file mode 100644 index e2716ee..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvinceApiResponse.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.hz.pm.api.provincial.model.dto; - -import com.ningdatech.basic.enumeration.Status; -import com.ningdatech.basic.model.ApiStatus; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - *

- * ApiResponse - 统一的接口返回值封装 - *

- * - * @author WendyYang - * @since 14:29 2022/9/29 - */ -@Data -@NoArgsConstructor -public class ProvinceApiResponse implements Serializable { - private static final long serialVersionUID = 532384723325394156L; - - public static final int SUCCESS_CODE = 200; - - public static final String SUCCESS_MSG = "success"; - - public static final int ERROR_CODE = 500; - - public static final String ERROR_MSG = "Internal server error"; - - /** - * 状态码 - */ - private Integer code; - - /** - * 返回内容 - */ - private String message; - private String msg; - - /** - * 返回数据 - */ - private T data; - - /** - * 全参构造函数 - * - * @param code 状态码 - * @param message 返回内容 - * @param data 返回数据 - */ - private ProvinceApiResponse(Integer code, String message, T data) { - this.code = code; - this.message = message; - this.data = data; - } - - /** - * 构造一个自定义的API返回 - * - * @param code 状态码 - * @param message 返回内容 - * @param data 返回数据 - * @return ApiResponse - */ - public static ProvinceApiResponse of(Integer code, String message, T data) { - return new ProvinceApiResponse<>(code, message, data); - } - - /** - * 构造一个成功且不带数据的API返回 - * - * @return ApiResponse - */ - public static ProvinceApiResponse ofSuccess() { - return ofSuccess(null); - } - - /** - * 构造一个成功且带数据的API返回 - * - * @param data 返回数据 - * @return ApiResponse - */ - public static ProvinceApiResponse ofSuccess(T data) { - return ofStatus(Status.OK, data); - } - - /** - * 构造一个成功且自定义消息的API返回 - * - * @param message 返回内容 - * @return ApiResponse - */ - public static ProvinceApiResponse ofMessage(String message) { - return of(Status.OK.getCode(), message, null); - } - - /** - * 构造一个有状态的API返回 - * - * @param status 状态 {@link Status} - * @return ApiResponse - */ - public static ProvinceApiResponse ofStatus(ApiStatus status) { - return ofStatus(status, null); - } - - /** - * 构造一个有状态且带数据的API返回 - * - * @param status 状态 {@link Status} - * @param data 返回数据 - * @return ApiResponse - */ - public static ProvinceApiResponse ofStatus(ApiStatus status, T data) { - return of(status.getCode(), status.getReasonPhrase(), data); - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialApplicationDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialApplicationDTO.java deleted file mode 100644 index 02aa5cd..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialApplicationDTO.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.hz.pm.api.provincial.model.dto; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import io.swagger.annotations.ApiModel; -import lombok.Builder; -import lombok.Data; - -import java.io.Serializable; -import java.util.List; - -/** - * @Classname ProvincialApplicationDTO - * @Description - * @Date 2023/3/2 10:06 - * @Author PoffyZhang - */ -@Data -@Builder -@ApiModel(value = "ProvincialApplicationDTO") -public class ProvincialApplicationDTO implements Serializable { - - - //云 信息 - private List clouds; - //是否初次建设 1是 2不是 - private Integer isFirst; - //应用名称 - private String applicationName; - //关联 关联的IRS应用code - private String applicationCode; - //关联的IRS应用name - private String relatedExistsApplication; - //1: '办公类系统',2: '业务应用类系统',3: '门户网站',4: '宣传微博/微信公众号',5: '硬件类系统',6: '工具类系统',99: '其他' - private Integer applicationType; - //建设层级 1:国家 2:省级 3:市级 4:县(市、区) - private Integer buildLevel; - //是否统建 0:否 1:是 - private Integer isUniteBuild; - //统建类型 1:全省统建 2:全市统建 - private Integer unionBuildKind; - //应用简介 - private String applicationSummary; - //应用备注 - private String applicationRemark; - //应用总投资测算明细 - private String applicationEstimateFile; - //是否数改系统 0:否 1:是 - private Integer isFiveDomain; - //1: '党政机关整体智治',2: '数字政府',3: '数字经济',4: '数字社会',7: '数字文化',5: '数字法治',6: '一体化智能化公共数据平台', 8: '基层智治' 多个用英文,分隔 - private String fiveDomain; - //业务领域 - private String bizDomain; - //否涉及业务协同 0:否 1:是 - private Integer isBizCooperate; - //协同单位111111 - private String cooperativeUnit; - //用户范围 0: '机关事业单位人员','0-1': '跨部门跨系统','0-2': '系统内地方各级','0-3': '本部门本级','0-4': '处室内部','0-6': '主管处室内部','0-5': '其他',1: '企业', 2: '社会公众',3: '其他' 多个用英文,分隔 - private String userRange; - //是否使用政务云资源 1使用 - private Integer useGovCloud; - //是否符合国家信息技术应用创新相关规范 0:否 1:是 - private Integer nationalITSpec; - //网络环境 1:政务内网 2:政务外网 3:互联网 4:业务专网 5:单机 - private String netEnv; - //等保级别 1:一级 2:二级 3:三级 4:四级 5:五级 - private Integer secrecyGrade; - //密码测评级别 1:一级 2:二级 3:三级 4:四级 5:五级 - private Integer passwordGrade; - //是否是S2 0:否 1:是 - private Integer isS2; - //一本账应用名称 - private String accountAppName; - //领域”大脑”一本帐名称 - private String brainAccountAppName; - //是否使用公共数据 - private Integer useCommonData; - //使用的公共数据名称 - private String dataName; - //使用公共组件的名称 - private String commonComponents; - //是否使用公共组件 - private Integer useCommonComponent; - //是否产生公共组件 - private Integer isProduceCommonComponent; - //产生的组件名称 - private String produceCommonComponent; - //发布端 '浙里办','浙政钉','数字化改革门户','支付宝','微信','网页','PC客户端','APP端' - private String publishSide; - - @Builder - @Data - @JsonIgnoreProperties(value = {"handler"}) - public static class Cloud implements Serializable { - //云资源台数 11 - private Integer cloudNums; - //云资源类型 云服务器(ECS) - private String cloudType; - //云资源规格 1核8G - private String cloudBasicSpec; - //云资源描述 - private String cloudUseDescription; - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialProjectDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialProjectDTO.java deleted file mode 100644 index bdc1cf3..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialProjectDTO.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.hz.pm.api.provincial.model.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.List; - -/** - * @Classname ProvincialProjectDTO - * @Description - * @Date 2023/3/2 10:06 - * @Author PoffyZhang - */ -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -@ApiModel(value = "ProvincialProjectDTO", description = "") -public class ProvincialProjectDTO implements Serializable { - - @ApiModelProperty("区域code") - private String regionCode; - - @ApiModelProperty("区域名称") - private String regionName; - - @ApiModelProperty("数字化改革系统 可以多选 1: '党政机关整体智治',2: '数字政府',3: '数字经济',4: '数字社会',7: '数字文化',5: '数字法治',6: '一体化智能化公共数据平台',8: '基层智治'") - private String digitalReform; - - @ApiModelProperty("业务主管单位浙政钉code,多个单位用英文;组成字符串。数据通过接口-查询省本级业务主管单位获取对应数据") - private String operationManageUnit; - - @ApiModelProperty("重大项目名称") - private String projectName; - - @ApiModelProperty("重大项目code 21位") - private String projectId; - - @ApiModelProperty("项目类型 1新建 2续建") - private Integer projectType; - - @ApiModelProperty("项目总投资(万元)") - private BigDecimal totalMoney; - - @ApiModelProperty("项目年度预算(万元)") - private BigDecimal yearBudget; - - @ApiModelProperty("自有资金,政府投资-本级财政资金,政府投资-上级补助资金") - private String budgetFrom; - - @ApiModelProperty("预算年度 2023") - private String year; - - @ApiModelProperty("财政code 32") - private String financialCode; - - @ApiModelProperty("发改code 23") - private String developCode; - - @ApiModelProperty("开始时间 比如2022-11-18") - private String beginTime; - - @ApiModelProperty("结束时间 比如2022-12-13") - private String endTime; - - @ApiModelProperty("立项依据1111") - private String buildBasis; - - @ApiModelProperty("立项依据材料 [{\"fileId\":\"\"}]") - private String buildBasisFile; - - @ApiModelProperty("项目概述") - private String projectSummary; - - @ApiModelProperty("负责人") - private String responsibleMan; - - @ApiModelProperty("联系人联系方式") - private String responsibleManPhone; - - @ApiModelProperty("联系人") - private String contactName; - - @ApiModelProperty("联系人联系方式") - private String contactPhone; - - @ApiModelProperty("建设单位 比如财政局") - private String buildUnit; - - @ApiModelProperty("建设单位浙政钉code") - private String buildUnitCode; - - @ApiModelProperty("主管单位") - private String superUnit; - - @ApiModelProperty("主管单位浙政钉code") - private String superUnitCode; - - @ApiModelProperty("可研报告文件") - private String researchReport; - - @ApiModelProperty("项目申报书") - private String projectApplyFile; - - @ApiModelProperty("项目总投资测算明细") - private String projectEstimateFile; - - @ApiModelProperty("申报单位主要职责") - private String unitThreePlan; - - @ApiModelProperty("其他附件") - private String otherFile; - - @ApiModelProperty("项目备注111") - private String projectRemark; - - @ApiModelProperty("是否有效 1有效 2无效 3撤回") - private Integer isEffective; - - @ApiModelProperty("是否包含应用 1包含") - private Integer includeApplication; - - @ApiModelProperty("app信息") - private List applicationInfo; - - @ApiModelProperty("条线单位 先写死") - private String lineManageUnit; -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/OssApiData.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/OssApiData.java deleted file mode 100644 index dd94e92..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/OssApiData.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.hz.pm.api.provincial.model.res; - -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - *

- * OssApiResponse - - *

- * - * @author ZPF - * @since 14:29 2022/9/29 - */ -@Data -@NoArgsConstructor -public class OssApiData implements Serializable { - - private String fileId; - - private String fileName; - - private String accessUrl; - - private Long fileSize; - - private String uploadUserCode; - - private String ossObject; -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/OssApiResponse.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/OssApiResponse.java deleted file mode 100644 index 33f9ca9..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/OssApiResponse.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.hz.pm.api.provincial.model.res; - -import com.ningdatech.basic.enumeration.Status; -import com.ningdatech.basic.model.ApiStatus; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - *

- * OssApiResponse - - *

- * - * @author ZPF - * @since 14:29 2022/9/29 - */ -@Data -@NoArgsConstructor -public class OssApiResponse implements Serializable { - private static final long serialVersionUID = 1L; - - public static final int SUCCESS_CODE = 200; - - public static final String SUCCESS_MSG = "成功"; - - public static final int ERROR_CODE = 500; - - public static final String ERROR_MSG = "Internal server error"; - - /** - * 状态码 - */ - private Integer respCode; - - /** - * 返回描述 - */ - private String respMsg; - - /** - * 返回数据 - */ - private T data; - - /** - * 全参构造函数 - * - * @param respCode 状态码 - * @param respMsg 返回内容 - * @param data 返回数据 - */ - private OssApiResponse(Integer respCode, String respMsg, T data) { - this.respCode = respCode; - this.respMsg = respMsg; - this.data = data; - } - - /** - * 构造一个自定义的API返回 - * - * @param respCode 状态码 - * @param respMsg 返回内容 - * @param data 返回数据 - * @return ApiResponse - */ - public static OssApiResponse of(Integer respCode, String respMsg, T data) { - return new OssApiResponse<>(respCode, respMsg, data); - } - - /** - * 构造一个成功且不带数据的API返回 - * - * @return ApiResponse - */ - public static OssApiResponse ofSuccess() { - return ofSuccess(null); - } - - /** - * 构造一个成功且带数据的API返回 - * - * @param data 返回数据 - * @return ApiResponse - */ - public static OssApiResponse ofSuccess(T data) { - return ofStatus(Status.OK, data); - } - - /** - * 构造一个成功且自定义消息的API返回 - * - * @param msg 返回内容 - * @return ApiResponse - */ - public static OssApiResponse ofMessage(String msg) { - return of(Status.OK.getCode(), msg, null); - } - - /** - * 构造一个有状态的API返回 - * - * @param status 状态 {@link Status} - * @return ApiResponse - */ - public static OssApiResponse ofStatus(ApiStatus status) { - return ofStatus(status, null); - } - - /** - * 构造一个有状态且带数据的API返回 - * - * @param status 状态 {@link Status} - * @param data 返回数据 - * @return ApiResponse - */ - public static OssApiResponse ofStatus(ApiStatus status, T data) { - return of(status.getCode(), status.getReasonPhrase(), data); - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProcessCommentRes.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProcessCommentRes.java deleted file mode 100644 index c4e9fb5..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProcessCommentRes.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.hz.pm.api.provincial.model.res; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Classname ProcessCommentDTO - * @Description - * @Date 2023/3/2 15:25 - * @Author PoffyZhang - */ -@Data -@Builder -@ApiModel(value = "ProcessCommentRes", description = "省局返回流程审核详情") -@AllArgsConstructor -@NoArgsConstructor -public class ProcessCommentRes { - - @ApiModelProperty("任务id") - private String taskId; - - @ApiModelProperty("comment") - private String comment; - - @ApiModelProperty("流程步骤") - private String stepName; - - @ApiModelProperty("节点ID") - private String nodeId; - - @ApiModelProperty("审批状态") - private String status; - - @ApiModelProperty("审批人") - private String label; - - @ApiModelProperty("时间") - private String approverTime; -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialApplicationRes.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialApplicationRes.java deleted file mode 100644 index d82bd4c..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialApplicationRes.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.hz.pm.api.provincial.model.res; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; -import java.util.List; - -/** - * @Classname ProvincialApplicationDTO - * @Description - * @Date 2023/3/2 10:06 - * @Author PoffyZhang - */ -@Data -@Builder -@ApiModel(value = "ProvincialApplicationRes", description = "") -@NoArgsConstructor -@AllArgsConstructor -public class ProvincialApplicationRes implements Serializable { - - - //云 信息 - private List clouds; - //是否初次建设 1是 2不是 - private Integer isFirst; - //应用名称 - private String applicationName; - //关联 关联的IRS应用code - private String applicationCode; - //关联的IRS应用name - private String relatedExistsApplication; - //1: '办公类系统',2: '业务应用类系统',3: '门户网站',4: '宣传微博/微信公众号',5: '硬件类系统',6: '工具类系统',99: '其他' - private Integer applicationType; - //建设层级 1:国家 2:省级 3:市级 4:县(市、区) - private Integer buildLevel; - //是否统建 0:否 1:是 - private Integer isUniteBuild; - //统建类型 1:全省统建 2:全市统建 - private Integer unionBuildKind; - //应用简介 - private String applicationSummary; - //应用备注 - private String applicationRemark; - //应用总投资测算明细 - private String applicationEstimateFile; - //是否数改系统 0:否 1:是 - private Integer isFiveDomain; - //1: '党政机关整体智治',2: '数字政府',3: '数字经济',4: '数字社会',7: '数字文化',5: '数字法治',6: '一体化智能化公共数据平台', 8: '基层智治' 多个用英文,分隔 - private String fiveDomain; - //业务领域 - private String bizDomain; - //否涉及业务协同 0:否 1:是 - private Integer isBizCooperate; - //协同单位111111 - private String cooperativeUnit; - //用户范围 0: '机关事业单位人员','0-1': '跨部门跨系统','0-2': '系统内地方各级','0-3': '本部门本级','0-4': '处室内部','0-6': '主管处室内部','0-5': '其他',1: '企业', 2: '社会公众',3: '其他' 多个用英文,分隔 - private String userRange; - //是否使用政务云资源 1使用 - private Integer useGovCloud; - //是否符合国家信息技术应用创新相关规范 0:否 1:是 - private Integer nationalITSpec; - //网络环境 1:政务内网 2:政务外网 3:互联网 4:业务专网 5:单机 - private String netEnv; - //等保级别 1:一级 2:二级 3:三级 4:四级 5:五级 - private Integer secrecyGrade; - //密码测评级别 1:一级 2:二级 3:三级 4:四级 5:五级 - private Integer passwordGrade; - //是否是S2 0:否 1:是 - private Integer isS2; - //一本账应用名称 - private String accountAppName; - //领域”大脑”一本帐名称 - private String brainAccountAppName; - //是否使用公共数据 - private Integer useCommonData; - //使用的公共数据名称 - private String dataName; - //使用公共组件的名称 - private String commonComponents; - //是否使用公共组件 - private Integer useCommonComponent; - //是否产生公共组件 - private Integer isProduceCommonComponent; - //产生的组件名称 - private String produceCommonComponent; - //发布端 '浙里办','浙政钉','数字化改革门户','支付宝','微信','网页','PC客户端','APP端' - private String publishSide; - - @Builder - @JsonIgnoreProperties(value = { "handler"}) - @NoArgsConstructor - @AllArgsConstructor - public static class Cloud implements Serializable { - //云资源台数 11 - private Integer cloudNums; - //云资源类型 云服务器(ECS) - private String cloudType; - //云资源规格 1核8G - private String cloudBasicSpec; - //云资源描述 - private String cloudUseDescription; - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialProjectRes.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialProjectRes.java deleted file mode 100644 index 600dcfe..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialProjectRes.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.hz.pm.api.provincial.model.res; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; -import java.util.List; - -/** - * @Classname ProvincialProjectDTO - * @Description - * @Date 2023/3/2 10:06 - * @Author PoffyZhang - */ -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -@ApiModel(value = "ProvincialProjectDTO") -public class ProvincialProjectRes { - - @ApiModelProperty("项目审核结果 1审核中 2审核通过 3审核不通过") - private Integer projectStatus; - - @ApiModelProperty("区域code") - private String regionCode; - - @ApiModelProperty("区域名称") - private String regionName; - - @ApiModelProperty("重大项目名称") - private String projectName; - - @ApiModelProperty("重大项目code 21位") - private String projectId; - - @ApiModelProperty("项目类型 1新建 2续建") - private Integer projectType; - - @ApiModelProperty("项目总投资(万元)") - private BigDecimal totalMoney; - - @ApiModelProperty("项目年度预算(万元)") - private BigDecimal yearBudget; - - @ApiModelProperty("自有资金,政府投资-本级财政资金,政府投资-上级补助资金") - private String budgetFrom; - - @ApiModelProperty("预算年度 2023") - private String year; - - @ApiModelProperty("财政code 32") - private String financialCode; - - @ApiModelProperty("发改code 23") - private String developCode; - - @ApiModelProperty("开始时间 比如2022-11-18") - private String beginTime; - - @ApiModelProperty("结束时间 比如2022-12-13") - private String endTime; - - @ApiModelProperty("立项依据1111") - private String buildBasis; - - @ApiModelProperty("立项依据材料 [{\"fileId\":\"\"}]") - private String buildBasisFile; - - @ApiModelProperty("项目概述") - private String projectSummary; - - @ApiModelProperty("负责人") - private String responsibleMan; - - @ApiModelProperty("联系人联系方式") - private String responsibleManPhone; - - @ApiModelProperty("联系人") - private String contactName; - - @ApiModelProperty("联系人联系方式") - private String contactPhone; - - @ApiModelProperty("建设单位 比如财政局") - private String buildUnit; - - @ApiModelProperty("建设单位浙政钉code") - private String buildUnitCode; - - @ApiModelProperty("主管单位") - private String superUnit; - - @ApiModelProperty("主管单位浙政钉code") - private String superUnitCode; - - @ApiModelProperty("可研报告文件") - private String researchReport; - - @ApiModelProperty("项目申报书") - private String projectApplyFile; - - @ApiModelProperty("项目总投资测算明细") - private String projectEstimateFile; - - @ApiModelProperty("申报单位主要职责") - private String unitThreePlan; - - @ApiModelProperty("其他附件") - private String otherFile; - - @ApiModelProperty("项目备注111") - private String projectRemark; - - @ApiModelProperty("是否有效 1有效 2无效 3撤回") - private Integer isEffective; - - @ApiModelProperty("是否包含应用 1包含") - private Integer includeApplication; - - @ApiModelProperty("app信息") - private List applicationInfo; - - @ApiModelProperty("审核信息") - private List processComment; -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/SjApiResponse.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/SjApiResponse.java deleted file mode 100644 index 414d1c4..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/SjApiResponse.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.hz.pm.api.provincial.model.res; - -import com.ningdatech.basic.enumeration.Status; -import com.ningdatech.basic.model.ApiStatus; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - *

- * ApiResponse - 省局统一的接口返回值封装 - *

- * - * @author ZPF - * @since 14:29 2022/9/29 - */ -@Data -@NoArgsConstructor -public class SjApiResponse implements Serializable { - private static final long serialVersionUID = 532384723325394156L; - - public static final int SUCCESS_CODE = 200; - - public static final String SUCCESS_MSG = "success"; - - public static final int ERROR_CODE = 500; - - public static final String ERROR_MSG = "Internal server error"; - - /** - * 状态码 - */ - private Integer code; - - /** - * 返回内容 - */ - private String msg; - - /** - * 返回数据 - */ - private T data; - - /** - * 全参构造函数 - * - * @param code 状态码 - * @param msg 返回内容 - * @param data 返回数据 - */ - private SjApiResponse(Integer code, String msg, T data) { - this.code = code; - this.msg = msg; - this.data = data; - } - - /** - * 构造一个自定义的API返回 - * - * @param code 状态码 - * @param msg 返回内容 - * @param data 返回数据 - * @return ApiResponse - */ - public static SjApiResponse of(Integer code, String msg, T data) { - return new SjApiResponse<>(code, msg, data); - } - - /** - * 构造一个成功且不带数据的API返回 - * - * @return ApiResponse - */ - public static SjApiResponse ofSuccess() { - return ofSuccess(null); - } - - /** - * 构造一个成功且带数据的API返回 - * - * @param data 返回数据 - * @return ApiResponse - */ - public static SjApiResponse ofSuccess(T data) { - return ofStatus(Status.OK, data); - } - - /** - * 构造一个成功且自定义消息的API返回 - * - * @param msg 返回内容 - * @return ApiResponse - */ - public static SjApiResponse ofMessage(String msg) { - return of(Status.OK.getCode(), msg, null); - } - - /** - * 构造一个有状态的API返回 - * - * @param status 状态 {@link Status} - * @return ApiResponse - */ - public static SjApiResponse ofStatus(ApiStatus status) { - return ofStatus(status, null); - } - - /** - * 构造一个有状态且带数据的API返回 - * - * @param status 状态 {@link Status} - * @param data 返回数据 - * @return ApiResponse - */ - public static SjApiResponse ofStatus(ApiStatus status, T data) { - return of(status.getCode(), status.getReasonPhrase(), data); - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/service/IJoinReviewProvincialBureauService.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/service/IJoinReviewProvincialBureauService.java deleted file mode 100644 index 4f9595d..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/service/IJoinReviewProvincialBureauService.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hz.pm.api.provincial.service; - -import com.hz.pm.api.provincial.model.dto.ProvincialProjectDTO; -import com.hz.pm.api.provincial.model.res.SjApiResponse; - -/** - * @Classname JointReviewProvincialBureauService - * @Description 省局联审接口 - * @Date 2023/3/2 9:29 - * @Author PoffyZhang - */ -public interface IJoinReviewProvincialBureauService { - - /** - * 推送/保存 重大接口到 省局联审 - * - * @return \ - */ - Boolean pushImportProject(ProvincialProjectDTO project); - - - /** - * 查看 本区域 省局联审 的项目审核详情 - * - * @return \ - */ - SjApiResponse processInfo(String projectId); - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/service/impl/JoinReviewProvincialBureauServiceImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/service/impl/JoinReviewProvincialBureauServiceImpl.java deleted file mode 100644 index 79f974f..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/service/impl/JoinReviewProvincialBureauServiceImpl.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.hz.pm.api.provincial.service.impl; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.crypto.SecureUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.hz.pm.api.common.config.ProvincialProperties; -import com.hz.pm.api.provincial.model.dto.ProvinceApiResponse; -import com.hz.pm.api.provincial.model.dto.ProvincialProjectDTO; -import com.hz.pm.api.provincial.model.res.SjApiResponse; -import com.hz.pm.api.provincial.service.IJoinReviewProvincialBureauService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.http.RequestEntity; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -/** - * @Classname JointReviewProvincialBureauService - * @Description 省局联审接口 - * @Date 2023/3/2 9:29 - * @Author PoffyZhang - */ -@Service -@Slf4j -public class JoinReviewProvincialBureauServiceImpl implements IJoinReviewProvincialBureauService { - - @Autowired - private ProvincialProperties provincialProperties; - @Autowired - private RestTemplate restTemplate; - @Value("${irs.interface-refresh.request-token-url:}") - private String govRequestTokenUrl; - @Value("${irs.interface-refresh.refresh-token-url:}") - private String govRefreshTokenUrl; - - @Value("${irs.province-gov.url:}") - private String govUrl; - - @Value("${irs.province-gov.appSecret:}") - private String govAppSecret; - - @Value("${irs.province-gov.appKey:}") - private String govAppKey; - - @Value("${irs.province-gov.interfaceName:}") - private String interfaceName; - - /** - * 推送/保存 重大接口到 省局联审 - * - * @return - */ - @Override - public Boolean pushImportProject(ProvincialProjectDTO project) { - Long timeStamp = System.currentTimeMillis() / 1000; - String url = provincialProperties.getHost() + provincialProperties.getPushUrl() + "?timestamp=" + timeStamp; - log.info("省局推送联审url {}", url); - ResponseEntity responseEntity; - - String signature = getSha256(timeStamp, provincialProperties.getPushUrl(), - HttpMethod.POST.name(), provincialProperties.getKey(), provincialProperties.getSecret()); - - //发送post请求 - RequestEntity requestEntity = RequestEntity - .post(url) - .header("Accept", MediaType.APPLICATION_JSON.toString()) - .header("X-Hmac-Auth-Key", provincialProperties.getKey()) - .header("X-Hmac-Auth-Signature", signature) - .contentType(MediaType.APPLICATION_JSON) - .accept(MediaType.APPLICATION_JSON) - .body(project); - - log.info("省局联审 提交 :{}", requestEntity); - log.info("省局联审 提交body :{}", JSON.toJSONString(requestEntity.getBody())); - try { - responseEntity = restTemplate.exchange(requestEntity, ProvinceApiResponse.class); - log.info("省局联审 响应 :{}", responseEntity); - if (responseEntity.getBody().getCode().equals(200)) { - return Boolean.TRUE; - } - } catch (Exception e) { - log.error("[省局联审] http request error", e); - } - - return Boolean.FALSE; - } - - /** - * 获取流程审批详情 - * - * @param projectId - * @return - */ - @Override - public SjApiResponse processInfo(String projectId) { - Long timeStamp = System.currentTimeMillis() / 1000; - String url = provincialProperties.getHost() + provincialProperties.getDetailUrl() - + "?timestamp=" + timeStamp; - - log.info("省局获取审核详情 url {}", url); - ResponseEntity responseEntity = null; - - String signature = getSha256(timeStamp, provincialProperties.getDetailUrl(), - HttpMethod.POST.name(), provincialProperties.getKey(), provincialProperties.getSecret()); - - JSONObject jsonBaby = new JSONObject(); - jsonBaby.put("projectId", projectId); - log.info("请求体 :{}", jsonBaby); - //发送post请求 - RequestEntity requestEntity = RequestEntity - .post(url) - .header("Accept", MediaType.APPLICATION_JSON.toString()) - .header("X-Hmac-Auth-Key", provincialProperties.getKey()) - .header("X-Hmac-Auth-Signature", signature) - .contentType(MediaType.APPLICATION_JSON) - .accept(MediaType.APPLICATION_JSON) - .body(jsonBaby); //也可以是DTO - - try { - responseEntity = restTemplate.exchange(requestEntity, SjApiResponse.class); - log.info("获取审批详情 响应 :{}", responseEntity); - } catch (Exception e) { - log.error("[省局获取审核详情] http request error", e); - } - - return responseEntity.getBody(); - } - - private static String getSha256(Long timeStamp, String url, String method, String key, String secret) { - String bytesToSign = method + StrUtil.LF + url + StrUtil.LF + timeStamp + StrUtil.LF + key; - log.info("加密message :{}", bytesToSign); - String res = SecureUtil.hmacSha256(secret).digestBase64(bytesToSign, false); - log.info("加密结果 :{}", res); - return res; - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessEndListener.java b/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessEndListener.java index 65210f3..518aba8 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessEndListener.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessEndListener.java @@ -37,7 +37,6 @@ import java.util.List; import java.util.Objects; import java.util.Set; -import static com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus.PRE_APPLYING; import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.PASS_MSG_TEMPLATE; import static com.hz.pm.api.todocenter.constant.WorkNoticeConst.PASS_MSG_TEMPLATE2; @@ -185,8 +184,6 @@ public class ProcessEndListener { case UNDER_INTERNAL_AUDIT: // 当前项目状态是部门联审中 case DEPARTMENT_JOINT_REVIEW: - // 当前项目状态是方案评审中 - case SCHEME_UNDER_REVIEW: handlerManage.updatePassProjectStatus(0L, project); break; default: diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/CockpitStatsStatisticsTask.java b/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/CockpitStatsStatisticsTask.java deleted file mode 100644 index 7651f72..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/CockpitStatsStatisticsTask.java +++ /dev/null @@ -1,926 +0,0 @@ -package com.hz.pm.api.scheduler.task; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.date.StopWatch; -import cn.hutool.core.util.ObjectUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.google.common.collect.Lists; -import com.hz.pm.api.common.helper.RegionCacheHelper; -import com.hz.pm.api.common.model.constant.BizConst; -import com.hz.pm.api.common.model.constant.RegionConst; -import com.hz.pm.api.common.util.BizUtils; -import com.hz.pm.api.dashboard.constant.DashboardConstant; -import com.hz.pm.api.dashboard.model.entity.CockpitStats; -import com.hz.pm.api.dashboard.model.po.SecrecyPasswordGradePO; -import com.hz.pm.api.dashboard.service.ICockpitStatsService; -import com.hz.pm.api.expert.entity.ExpertIntentionWorkRegion; -import com.hz.pm.api.expert.entity.ExpertUserFullInfo; -import com.hz.pm.api.expert.service.IExpertIntentionWorkRegionService; -import com.hz.pm.api.expert.service.IExpertUserFullInfoService; -import com.hz.pm.api.gov.enumeration.GovProjectStatusEnum; -import com.hz.pm.api.gov.model.entity.*; -import com.hz.pm.api.gov.service.*; -import com.hz.pm.api.meta.model.entity.ExpertTag; -import com.hz.pm.api.meta.service.IExpertTagService; -import com.hz.pm.api.performance.model.entity.PerformanceAppraisalProject; -import com.hz.pm.api.performance.service.IPerformanceAppraisalProjectService; -import com.hz.pm.api.projectlib.model.entity.Project; -import com.hz.pm.api.projectlib.model.entity.ProjectInst; -import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; -import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; -import com.hz.pm.api.projectlib.service.IProjectInstService; -import com.hz.pm.api.projectlib.service.IProjectService; -import com.hz.pm.api.sys.model.dto.RegionDTO; -import com.hz.pm.api.sys.model.entity.WflowEarlyWarningRecords; -import com.hz.pm.api.sys.service.IEarlyWarningRecordsService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.flowable.engine.HistoryService; -import org.flowable.engine.history.HistoricActivityInstance; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.math.BigDecimal; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -/** - * @author ZPF - * @Class CockpitStatsStatisticsTask - * 驾驶舱 统计 每日任务 - * @since 2023/08/31 18:16 - */ -@Component -@Slf4j -@RequiredArgsConstructor -public class CockpitStatsStatisticsTask { - - @Value("${hostname:}") - public String HOST; - - @Value("${spring.profiles.active}") - public String active; - - private final ICockpitStatsService cockpitStatsService; - private final RegionCacheHelper regionCacheHelper; - private final IProjectService projectService; - private final IProjectInstService projectInstService; - private final IExpertUserFullInfoService expertUserFullInfoService; - private final IPerformanceAppraisalProjectService performanceAppraisalProjectService; - private final IGovBizProjectBaseinfoService baseinfoService; - private final IGovBizProjectApplyService applyService; - private final HistoryService historyService; - private final IGovBizProjectApproveService approveService; - private final IGovBizProjectProcureService procureService; - private final IGovBizProjectCimplementService cimplementService; - private final IEarlyWarningRecordsService earlyWarningRecordsService; - private final IExpertIntentionWorkRegionService expertIntentionWorkRegionService; - private final IExpertTagService expertTagService; - - private List years = Lists.newArrayList(2021, 2022, 2023, 2024, 2025); - - - /** - * 定义统计 驾驶舱数据 每天3点开始执行一次 - */ - @Scheduled(cron = "0 0 3 * * ?") - public void doTask() throws UnknownHostException { - if (!HOST.equals(InetAddress.getLocalHost().getHostName())) { - log.info("定时器没开启或者host不对! {}:{}", - HOST, InetAddress.getLocalHost().getHostName()); - return; - } - if (BizConst.PRE.equals(active)) { - log.info("预发环境不用同步!"); - return; - } - - log.info("驾驶舱数据统计任务开始====="); - - StopWatch stopWatch = new StopWatch(); - stopWatch.start(); - - List res = Lists.newArrayList(); - //1.根据2个维度来统计 区域和分年 - //1.总的 - res.add(statisticsData(DashboardConstant.CockpitStats.TOTAL, - DashboardConstant.CockpitStats.TOTAL, DashboardConstant.CockpitStats.NONE_YEAR)); - for (Integer year : years) { - res.add(statisticsData(DashboardConstant.CockpitStats.TOTAL, - DashboardConstant.CockpitStats.TOTAL, year)); - } - - List regions = regionCacheHelper.listChildren(RegionConst.RC_HZ, RegionConst.RL_CITY); - regions = regions.stream().filter(r -> r.getRegionLevel() != RegionConst.RL_CITY).collect(Collectors.toList()); - for (RegionDTO regionDto : regions) { - res.add(statisticsData(regionDto.getRegionCode(), regionDto.getRegionName(), - DashboardConstant.CockpitStats.NONE_YEAR)); - for (Integer year : years) { - res.add(statisticsData(regionDto.getRegionCode(), regionDto.getRegionName(), year)); - } - } - - //如果结果不为空 就删除之前的 插入最新的数据 - if (CollUtil.isNotEmpty(res)) { - //计算增长率 - computeRates(res); - List list = cockpitStatsService.list(); - List ids = list.stream().map(CockpitStats::getId).collect(Collectors.toList()); - cockpitStatsService.removeByIds(ids); - cockpitStatsService.saveBatch(res); - } - - stopWatch.stop(); - log.info("驾驶舱数据统计任务结束====={}s", stopWatch.getTotalTimeSeconds()); - } - - private void computeRates(List res) { - Map map = res.stream().collect(Collectors.toMap(r -> r.getRegionCode() + r.getYear(), r -> r)); - for (CockpitStats cockpitStats : res) { - if (Objects.isNull(cockpitStats.getYear())) { - continue; - } - //算增长率 - //去年的数据 用于算 增长比例 - if (cockpitStats.getYear().equals(DashboardConstant.CockpitStats.NONE_YEAR)) { - int thisYear = LocalDateTime.now().getYear(); - CockpitStats thisYearData = map.get(cockpitStats.getRegionCode() + thisYear); - CockpitStats lastYearData = map.get(cockpitStats.getRegionCode() + (thisYear - 1)); - buildMonitorRise(cockpitStats, thisYearData, lastYearData); - } else { - CockpitStats lastYearData = map.get(cockpitStats.getRegionCode() + (cockpitStats.getYear() - 1)); - buildMonitorRise(cockpitStats, cockpitStats, lastYearData); - } - } - - } - - /** - * 统计的具体逻辑 - * - * @param regionCode - * @param regionName - * @param year - * @return - */ - private CockpitStats statisticsData(String regionCode, String regionName, Integer year) { - CockpitStats cockpitStats = new CockpitStats(); - cockpitStats.setRegionCode(regionCode); - cockpitStats.setRegionName(regionName); - cockpitStats.setYear(year); - - //申报项目 - boolean condition = Objects.nonNull(year) && !year.equals(DashboardConstant.CockpitStats.NONE_YEAR); - boolean condition1 = Objects.isNull(year) || year.equals(DashboardConstant.CockpitStats.NONE_YEAR); - List projects = projectService.list(Wrappers.lambdaQuery(Project.class) - .eq(Project::getNewest, Boolean.TRUE) - .eq(StringUtils.isNotBlank(regionCode) && !DashboardConstant.CockpitStats.TOTAL.equals(regionCode), - Project::getAreaCode, regionCode) - .eq(condition, Project::getProjectYear, year) - .in(condition1, Project::getProjectYear, years)); - - //项目归集 - List applieYears = applyService.list(Wrappers.lambdaQuery(GovBizProjectApply.class) - .eq(condition, - GovBizProjectApply::getBaseProjSetYear, year) - .in(condition1, - GovBizProjectApply::getBaseProjSetYear, years)); - List yearProjIds = applieYears.stream().map(GovBizProjectApply::getBaseProjId) - .collect(Collectors.toList()); - - List baseInfos = Lists.newArrayList(); - if (CollUtil.isNotEmpty(yearProjIds)) { - baseInfos = baseinfoService.list(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class) - .eq(GovBizProjectBaseinfo::getDeleted, Boolean.FALSE) - .in(GovBizProjectBaseinfo::getBaseProjId, yearProjIds)); - } - - List approves = Lists.newArrayList(); - List applies = Lists.newArrayList(); - List procures = Lists.newArrayList(); - List cimplements = Lists.newArrayList(); - if (CollUtil.isNotEmpty(baseInfos)) { - List baseProjIds = baseInfos.stream().map(GovBizProjectBaseinfo::getBaseProjId).collect(Collectors.toList()); - approves = approveService.list(Wrappers.lambdaQuery(GovBizProjectApprove.class) - .in(GovBizProjectApprove::getBaseProjId, baseProjIds)); - - applies = applyService.list(Wrappers.lambdaQuery(GovBizProjectApply.class) - .in(GovBizProjectApply::getBaseProjId, baseProjIds)); - - procures = procureService.list(Wrappers.lambdaQuery(GovBizProjectProcure.class) - .in(GovBizProjectProcure::getBaseProjId, baseProjIds)); - - cimplements = cimplementService.list(Wrappers.lambdaQuery(GovBizProjectCimplement.class) - .in(GovBizProjectCimplement::getBaseProjId, baseProjIds)); - } - - //1.项目监测 - //1.1 超期在建项目 - Integer overdueConstructionProjectsNum = (int) projects.stream().filter(p -> { - if (Objects.nonNull(p.getPlanAcceptanceTime()) && - p.getPlanAcceptanceTime().compareTo(LocalDateTime.now()) < 0 && - Objects.nonNull(p.getStatus()) && p.getStatus().compareTo(ProjectStatus.ACCEPTED.getCode()) < 0) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - cockpitStats.setMonitorOverdueConstructionProjectsNum(overdueConstructionProjectsNum); - //1.2 环节滞后项目 - cockpitStats.setMonitorLaggingProjectsNum(computeLagging(projects)); - - //1.3预审驳回项目 - Integer preFailed = (int) projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - p.getStatus().equals(ProjectStatus.PREQUALIFICATION_FAILED.getCode())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - cockpitStats.setMonitorRejectedPreReviewProjectsNum(preFailed); - - //1.4 建设方案评审失败 - Integer constructionFailed = (int) projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && p.getStatus().equals(ProjectStatus.SCHEME_REVIEW_FAILED.getCode())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - cockpitStats.setMonitorRejectedApproveProjectsNum(constructionFailed); - //1.5 验收不达标 - cockpitStats.setMonitorAcceptConditionsNotStandardsNum(0); - - //1.6 总申报金额 - double totalDeclaredAmount = projects.stream().mapToDouble(p -> Objects.nonNull(p.getDeclareAmount()) ? p.getDeclareAmount().doubleValue() : 0.0).sum(); - cockpitStats.setMonitorDeclaredAmount(BigDecimal.valueOf(totalDeclaredAmount)); - //1.7 总安全投入 - double totalSafetyAmount = projects.stream().mapToDouble(p -> { - if (Objects.nonNull(p.getSafetyInputDescribe())) { - final Double[] total = {0.0}; - try { - JSONArray array = JSON.parseArray(p.getSafetyInputDescribe()); - array.forEach(j -> { - JSONObject json = JSON.parseObject(JSON.toJSONString(j)); - Double safetyInputAmount = json.getDouble(DashboardConstant.Protrait.FEILD_SAFETYMONEY); - total[0] += safetyInputAmount; - }); - } catch (Exception e) { - - } - return total[0]; - } - return 0.0; - }).sum(); - cockpitStats.setMonitorSafetyInputAmount(BigDecimal.valueOf(totalSafetyAmount)); - - //1.8等保密评 - SecrecyPasswordGradePO secrecyPasswordGradePo = cockpitStatsService.getSecrecyPasswordGrade(regionCode, year); - - Integer guijiSecerecyGrade1 = 0; - Integer guijiSecerecyGrade2 = 0; - Integer guijiSecerecyGrade3 = 0; - Integer guijiSecerecyGrade4 = 0; - Integer guijiSecerecyGrade5 = 0; - //项目归集 评审信息 - for (GovBizProjectApprove approve : approves) { - String equalProtectionLevel = approve.getEqualProtectionLevel(); - if (StringUtils.isNotBlank(equalProtectionLevel)) { - switch (equalProtectionLevel) { - case "01": - guijiSecerecyGrade1++; - break; - case "02": - guijiSecerecyGrade2++; - break; - case "03": - guijiSecerecyGrade3++; - break; - case "04": - guijiSecerecyGrade4++; - break; - case "05": - guijiSecerecyGrade5++; - break; - default: - break; - } - } - } - - Integer passwordGradeNumGov = 0; - for (GovBizProjectCimplement cimplement : cimplements) { - if (StringUtils.isNotBlank(cimplement.getBaseInforLevelFile())) { - passwordGradeNumGov++; - } - } - - if (Objects.nonNull(secrecyPasswordGradePo)) { - cockpitStats.setMonitorSecrecyGrade1Num(secrecyPasswordGradePo.getMonitorSecrecyGrade1Num() + guijiSecerecyGrade1); - cockpitStats.setMonitorSecrecyGrade2Num(secrecyPasswordGradePo.getMonitorSecrecyGrade2Num() + guijiSecerecyGrade2); - cockpitStats.setMonitorSecrecyGrade3Num(secrecyPasswordGradePo.getMonitorSecrecyGrade3Num() + guijiSecerecyGrade3); - cockpitStats.setMonitorSecrecyGrade4Num(secrecyPasswordGradePo.getMonitorSecrecyGrade4Num() + guijiSecerecyGrade4); - cockpitStats.setMonitorSecrecyGrade5Num(secrecyPasswordGradePo.getMonitorSecrecyGrade5Num() + guijiSecerecyGrade5); - cockpitStats.setMonitorPasswordGrade1Num(secrecyPasswordGradePo.getMonitorPasswordGrade1Num() + passwordGradeNumGov); - cockpitStats.setMonitorPasswordGrade2Num(secrecyPasswordGradePo.getMonitorPasswordGrade2Num()); - cockpitStats.setMonitorPasswordGrade3Num(secrecyPasswordGradePo.getMonitorPasswordGrade3Num()); - cockpitStats.setMonitorPasswordGrade4Num(secrecyPasswordGradePo.getMonitorPasswordGrade4Num()); - cockpitStats.setMonitorPasswordGrade5Num(secrecyPasswordGradePo.getMonitorPasswordGrade5Num()); - } else { - cockpitStats.setMonitorSecrecyGrade1Num(guijiSecerecyGrade1); - cockpitStats.setMonitorSecrecyGrade2Num(guijiSecerecyGrade2); - cockpitStats.setMonitorSecrecyGrade3Num(guijiSecerecyGrade3); - cockpitStats.setMonitorSecrecyGrade4Num(guijiSecerecyGrade4); - cockpitStats.setMonitorSecrecyGrade5Num(guijiSecerecyGrade5); - cockpitStats.setMonitorPasswordGrade1Num(passwordGradeNumGov); - } - - //2.专家统计 - List lsRegionCodes = RegionConst.LS_ARR; - List intentions = expertIntentionWorkRegionService.list(Wrappers.lambdaQuery(ExpertIntentionWorkRegion.class) - .eq(StringUtils.isNotBlank(regionCode) && !DashboardConstant.CockpitStats.TOTAL.equals(regionCode), - ExpertIntentionWorkRegion::getRegionCode, regionCode) - .in(StringUtils.isBlank(regionCode) || DashboardConstant.CockpitStats.TOTAL.equals(regionCode), - ExpertIntentionWorkRegion::getRegionCode, lsRegionCodes)); - - List experts = Lists.newArrayList(); - if (CollUtil.isNotEmpty(intentions)) { - List userIds = intentions.stream().map(ExpertIntentionWorkRegion::getUserId) - .collect(Collectors.toList()); - experts = expertUserFullInfoService.list(Wrappers.lambdaQuery(ExpertUserFullInfo.class) - .in(ExpertUserFullInfo::getUserId, userIds)); - } - - List goodAt = expertTagService.list(Wrappers.lambdaQuery(ExpertTag.class)); - Map> tagMap = goodAt.stream() - .collect(Collectors.groupingBy(ExpertTag::getUserId)); - - String networkCode = DashboardConstant.Expert.NETWORK_CODE; - String xinchuangCode = DashboardConstant.Expert.XINCHUANG_CODE; - String fanganCode = DashboardConstant.Expert.FANGAN_CODE; - String jishuCode = DashboardConstant.Expert.JISHU_CODE; - String dangzhengCode = DashboardConstant.Expert.DANGZHENG_CODE; - String ruanyingCode = DashboardConstant.Expert.RUANYING_CODE; - String caiwuCode = DashboardConstant.Expert.CAIWU_CODE; - List specialTags = Lists.newArrayList(networkCode, xinchuangCode, fanganCode, jishuCode, - dangzhengCode, ruanyingCode, caiwuCode); - - cockpitStats.setExpertTotalNum(experts.size()); - Integer financialNum = 0; - Integer networkSecurityNum = 0; - Integer xinchuangNum = 0; - Integer planRationalityNum = 0; - Integer promotionInfoTechnologyNum = 0; - Integer partyGovInfoNum = 0; - Integer softHardPricingNum = 0; - Integer technicalFeasibilityAssessmentNum = 0; - Integer specialExpertNum = 0; - for (ExpertUserFullInfo e : experts) { - if (tagMap.containsKey(e.getUserId())) { - List expertTags = tagMap.get(e.getUserId()); - boolean isContain = Boolean.FALSE; - for (ExpertTag expertTag : expertTags) { - if (expertTag.getTagCode().equals(networkCode)) { - networkSecurityNum++; - } - if (expertTag.getTagCode().equals(caiwuCode)) { - financialNum++; - } - if (expertTag.getTagCode().equals(xinchuangCode)) { - xinchuangNum++; - } - if (expertTag.getTagCode().equals(fanganCode)) { - planRationalityNum++; - } - if (expertTag.getTagCode().equals(jishuCode)) { - technicalFeasibilityAssessmentNum++; - } - if (expertTag.getTagCode().equals(dangzhengCode)) { - partyGovInfoNum++; - } - if (expertTag.getTagCode().equals(ruanyingCode)) { - softHardPricingNum++; - } - if (specialTags.contains(expertTag.getTagCode())) { - isContain = Boolean.TRUE; - } - } - if (isContain) { - specialExpertNum++; - } - } - } - //财务专家 - cockpitStats.setExpertFinancialNum(financialNum); - //网络安全 - cockpitStats.setExpertNetworkSecurityNum(networkSecurityNum); - cockpitStats.setExpertXinchuangNum(xinchuangNum); - cockpitStats.setExpertPlanRationalityNum(planRationalityNum); - cockpitStats.setExpertPromotionInfoTechnologyNum(promotionInfoTechnologyNum); - cockpitStats.setExpertPartyGovInfoNum(partyGovInfoNum); - cockpitStats.setExpertSoftHardPricingNum(softHardPricingNum); - cockpitStats.setExpertTechnicalFeasibilityAssessmentNum(technicalFeasibilityAssessmentNum); - cockpitStats.setSpecialExpertNum(specialExpertNum); - - //3.顶部数据 - //3.1 计划项目数(申报项目:完成年度计划的项目总数 - // 项目归集:评审中、待立项、已立项、已采购、已初验、已终验项目总和) - Integer planProjectNum = (int) projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - p.getStatus().compareTo(ProjectStatus.PENDING_PREQUALIFICATION.getCode()) >= 0) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - Integer planProjectNumGov = (int) baseInfos.stream().filter(p -> { - if (Objects.nonNull(p.getBaseProjSetProg()) && - //排除 已驳回 已终止 - (!Lists.newArrayList(GovProjectStatusEnum.REJECTED.getCode(), - GovProjectStatusEnum.TERMINATED.getCode()).contains(p.getBaseProjSetProg()))) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - cockpitStats.setTopPlanProjectsNum(planProjectNum + planProjectNumGov); - - //3.2 批复项目数(申报项目:完成立项批复流程项目总数 项目归集:已立项、已采购、已初验、已终验项目总和) - Integer approvalNumDeclared = (int) projects.stream().filter(p -> { - if (Objects.nonNull(p.getApprovalAmount())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - Integer approvalNumGov = (int) baseInfos.stream().filter(p -> { - if (Objects.nonNull(p.getBaseProjSetProg()) && Lists.newArrayList(GovProjectStatusEnum.APPROVED.getCode(), - GovProjectStatusEnum.PURCHASED.getCode(), GovProjectStatusEnum.HAS_PRE_INS.getCode(), - GovProjectStatusEnum.HAS_FINAL_INS.getCode()).contains(p.getBaseProjSetProg())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - - BigDecimal approvalAmount = projects.stream().filter(p -> { - if (Objects.nonNull(p.getApprovalAmount())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).map(Project::getApprovalAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - - BigDecimal approvalAmountGov = approves.stream() - .map(GovBizProjectApprove::getBaseInitialReviewTotalMoney) - .filter(Objects::nonNull) - .reduce(BigDecimal::add) - .orElse(BigDecimal.ZERO); - - cockpitStats.setTopApprovalProjectsNum(approvalNumDeclared + approvalNumGov); - cockpitStats.setTopApprovalProjectsAmount(approvalAmount.add(approvalAmountGov)); - //3.3 平均建设周期 - OptionalDouble od = Stream.concat(projects.stream().map(Project::getBuildCycle), - applies.stream().map(GovBizProjectApply::getBaseProjDuration)).mapToInt(c -> { - try { - return Integer.parseInt(c); - } catch (Exception e) { - return 0; - } - }).average(); - double average = od.isPresent() ? od.getAsDouble() : 0.0; - cockpitStats.setTopAverageConstructionPeriod((int) average); - //3.4 在建项目数 采购备案后的项目 - Integer constructionNum = (int) projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - p.getStatus().compareTo(ProjectStatus.TO_BE_PURCHASED.getCode()) >= 0 - && p.getStatus().compareTo(ProjectStatus.ACCEPTED.getCode()) < 0) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - Integer constructionNumGov = (int) baseInfos.stream().filter(b -> { - if (Objects.nonNull(b.getBaseProjSetProg()) && - Lists.newArrayList(GovProjectStatusEnum.PURCHASED.getCode(), GovProjectStatusEnum.HAS_PRE_INS.getCode()).contains(b.getBaseProjSetProg())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - cockpitStats.setTopOngoingProjectsNum(constructionNum + constructionNumGov); - - //4.地图 只要放总数 取的时候 会有逻辑(也要取项目归集) - cockpitStats.setProjectsTotal(projects.size() + baseInfos.size()); - - //5.下面项目状态数 - //5.1 计划(申报项目:项目预审完成到年度计划未完成 项目归集:评审中) - Integer inPlanNum = (int) projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - p.getStatus().compareTo(ProjectStatus.PREQUALIFICATION_FAILED.getCode()) > 0 && - p.getStatus().compareTo(ProjectStatus.IN_THE_ANNUAL_PLAN.getCode()) <= 0) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - Integer inPlanNumGov = (int) baseInfos.stream().filter(p -> { - if (Objects.nonNull(p.getBaseProjSetProg()) && - p.getBaseProjSetProg().equals(GovProjectStatusEnum.APPROVAL.getCode())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - cockpitStats.setProjectsTotalPlan(inPlanNum + inPlanNumGov); - - //5.2 处于申报(申报项目:年度计划完成到建设方案审批第一个节点审批未通过前 项目归集:待立项) - Integer inApplyNum = (int) projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - (ProjectStatus.PLAN_TO_BE_DECLARED.getCode().equals(p.getStatus()) || - (ProjectStatus.SCHEME_UNDER_REVIEW.getCode().equals(p.getStatus()) && - searchSchemaReviewFlow(p.getProjectCode())))) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - Integer inApplyNumGov = (int) baseInfos.stream().filter(p -> { - if (Objects.nonNull(p.getBaseProjSetProg()) && - p.getBaseProjSetProg().equals(GovProjectStatusEnum.PENDING.getCode())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - cockpitStats.setProjectsTotalApply(inApplyNum + inApplyNumGov); - - //5.3 处于审批 (申报项目:建设方案审批第一个节点审批通过到立项批复未完成 项目归集:已立项) - Integer inApproveNum = (int) projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - (ProjectStatus.TO_BE_APPROVED.getCode().equals(p.getStatus()) || - p.getStatus().compareTo(ProjectStatus.APPROVED_AFTER_CHOICE.getCode()) > 0 || - (ProjectStatus.SCHEME_UNDER_REVIEW.getCode().equals(p.getStatus()) && - searchSchemaReviewedFlow(p.getProjectCode())))) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - Integer inApproveNumGov = (int) baseInfos.stream().filter(p -> { - if (Objects.nonNull(p.getBaseProjSetProg()) && - p.getBaseProjSetProg().equals(GovProjectStatusEnum.APPROVED.getCode())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - cockpitStats.setProjectsTotalApprove(inApproveNum + inApproveNumGov); - - //5.4 建设 (申报项目:立项批复完成到项目初验未完成 项目归集:已采购) - Integer inConstructionNum = (int) projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - (p.getStatus().compareTo(ProjectStatus.APPROVED_AFTER_CHOICE.getCode()) > 0 && - p.getStatus().compareTo(ProjectStatus.UNDER_CONSTRUCTION.getCode()) < 0) || - //如果在建设中 那么初验材料为空代表 初验未完成 - (p.getStatus().equals(ProjectStatus.UNDER_CONSTRUCTION.getCode()) /*&& - StringUtils.isBlank(p.getPreliminaryInspectionMaterials())*/)) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - Integer inConstructionNumGov = (int) baseInfos.stream().filter(p -> { - if (Objects.nonNull(p.getBaseProjSetProg()) && - p.getBaseProjSetProg().equals(GovProjectStatusEnum.PURCHASED.getCode())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - cockpitStats.setProjectsTotalConstruction(inConstructionNum + inConstructionNumGov); - - //5.5 验收 (申报项目:项目初验完成到项目终验未完成 项目归集:已初验) - List inAcceptProjects = projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - p.getStatus().compareTo(ProjectStatus.UNDER_CONSTRUCTION.getCode()) > 0 && - p.getStatus().compareTo(ProjectStatus.ACCEPTED.getCode()) < 0 || - //如果在建设中 那么初验材料不为空代表 初验完成 - (p.getStatus().equals(ProjectStatus.UNDER_CONSTRUCTION.getCode()) /*&& - StringUtils.isNotBlank(p.getPreliminaryInspectionMaterials())*/)) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).collect(Collectors.toList()); - List inAcceptProjectsGov = baseInfos.stream().filter(b -> { - if (Objects.nonNull(b.getBaseProjSetProg()) && - b.getBaseProjSetProg().equals(GovProjectStatusEnum.HAS_PRE_INS.getCode())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).collect(Collectors.toList()); - cockpitStats.setProjectsTotalAccept(inAcceptProjects.size() + inAcceptProjectsGov.size()); - - //5.6 运维(申报项目:项目验收完成后且项目未注销 项目归集:已终验) - List inOperationProjects = projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - p.getStatus().equals(ProjectStatus.ACCEPTED.getCode())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).collect(Collectors.toList()); - int inOperationProjectsGov = (int) baseInfos.stream().filter(b -> { - if (Objects.nonNull(b.getBaseProjSetProg()) && - b.getBaseProjSetProg().equals(GovProjectStatusEnum.HAS_FINAL_INS.getCode())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).count(); - cockpitStats.setProjectsTotalOperation(inOperationProjects.size() + inOperationProjectsGov); - - //5.7 绩效(申报项目:项目验收完成后且未完成绩效自评 项目归集:无) - List inAcceptCodes = inOperationProjects.stream().map(Project::getProjectCode).collect(Collectors.toList()); - List performances = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) - .in(CollUtil.isNotEmpty(inAcceptCodes), PerformanceAppraisalProject::getProjectCode, inAcceptCodes) - .in(CollUtil.isEmpty(inAcceptCodes), PerformanceAppraisalProject::getProjectCode, Lists.newArrayList("NONE")) - .eq(PerformanceAppraisalProject::getIsReAppraisal, Boolean.TRUE) - .isNull(PerformanceAppraisalProject::getReAppraisalTotalScore) - ); - cockpitStats.setProjectsTotalPerformance(performances.size()); - cockpitStats.setProjectsTotalLogOff(0); - - //6.项目效益 - cockpitStats.setExcellentBestAppNum(0); - cockpitStats.setExcellentMajorAppNum(0); - cockpitStats.setExcellentCrossLevelSharingNum(0); - cockpitStats.setExcellentMajorAppNum(0); - - //7.2驳回节约资金 - List rejectPreProjects = projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - p.getStatus().equals(ProjectStatus.PREQUALIFICATION_FAILED.getCode())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).collect(Collectors.toList()); - BigDecimal rejectPreSum = rejectPreProjects.stream().map(p -> { - if (Objects.nonNull(p.getDeclareAmount())) { - return p.getDeclareAmount(); - } - return BigDecimal.ZERO; - }).reduce(BigDecimal::add).orElse(BigDecimal.ZERO); - cockpitStats.setRejectSavingsFunds(rejectPreSum); - - //7.3 柱状图 - //7.3.1 申报状态的3个资金 -// projects.stream() - //首先完成年度计划 并且未注销的项目 - List normalProjects = projects.stream().filter(p -> { - if (Objects.nonNull(p.getStatus()) && - p.getStatus().compareTo(ProjectStatus.BE_SUSPENDED.getCode()) > 0) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).collect(Collectors.toList()); - - //申报的申报金额(申报项目:初步方案申报金额 项目归集:项目总投资) - final BigDecimal[] declaredAmountApprove = {BigDecimal.ZERO}; - normalProjects.stream().map(p -> ObjectUtil.defaultIfNull(p.getDeclareAmount(), BigDecimal.ZERO)) - .reduce(BigDecimal::add).ifPresent(b -> declaredAmountApprove[0] = b); - final BigDecimal[] declaredAmountApproveGov = {BigDecimal.ZERO}; - applies.stream().map(g -> ObjectUtil.defaultIfNull(g.getBaseProjTotalAmount(), BigDecimal.ZERO)) - .reduce(BigDecimal::add).ifPresent(b -> declaredAmountApproveGov[0] = b); - BigDecimal declaredAmountApproveTotal = declaredAmountApprove[0].add(declaredAmountApproveGov[0]); - cockpitStats.setDeclaredAmountApprove(declaredAmountApproveTotal); - - //申报的批复金额(申报项目:建设方案申报金额 项目归集:建议总投资) - final BigDecimal[] approvalAmountApprove = {BigDecimal.ZERO}; - normalProjects.stream().map(p -> ObjectUtil.defaultIfNull(p.getApprovalAmount(), BigDecimal.ZERO)) - .reduce(BigDecimal::add).ifPresent(b -> approvalAmountApprove[0] = b); - final BigDecimal[] approvalAmountApproveGov = {BigDecimal.ZERO}; - approves.stream().map(p -> ObjectUtil.defaultIfNull(p.getBaseExpertTotalMoney(), BigDecimal.ZERO)) - .reduce(BigDecimal::add).ifPresent(b -> approvalAmountApproveGov[0] = b); - BigDecimal approvalAmountApproveTotal = approvalAmountApprove[0].add(approvalAmountApproveGov[0]); - cockpitStats.setApprovalAmountApprove(approvalAmountApproveTotal); - //申报的差额 - BigDecimal subtractApprove = declaredAmountApproveTotal.subtract(approvalAmountApproveTotal); - cockpitStats.setDifferenceApprove(subtractApprove); - - //批复的申报金额(申报项目:建设方案申报金额 项目归集:建议总投资) - cockpitStats.setDeclaredAmountApproval(approvalAmountApproveTotal); - - //批复的批复金额(申报项目:归集信息建议批复总投资 项目归集:建议批复总投资) - final BigDecimal[] approvalAmountApproval = {BigDecimal.ZERO}; - normalProjects.stream().map(p -> ObjectUtil.defaultIfNull(p.getProposeTotalInvest(), BigDecimal.ZERO)) - .reduce(BigDecimal::add).ifPresent(b -> approvalAmountApproval[0] = b); - final BigDecimal[] approvalAmountApprovalGov = {BigDecimal.ZERO}; - approves.stream().map(p -> ObjectUtil.defaultIfNull(p.getBaseInitialReviewTotalMoney(), BigDecimal.ZERO)) - .reduce(BigDecimal::add).ifPresent(b -> approvalAmountApprovalGov[0] = b); - BigDecimal approvalAmountApprovalTotal = approvalAmountApproval[0].add(approvalAmountApprovalGov[0]); - cockpitStats.setApprovalAmountApproval(approvalAmountApprovalTotal); - - //批复的差额 - BigDecimal subtractApproval = approvalAmountApproveTotal.subtract(approvalAmountApprovalTotal); - cockpitStats.setDifferenceApproval(subtractApproval); - - //合同的申报金额(申报项目:归集信息建议批复总投资 项目归集:建议批复总投资) - cockpitStats.setDeclaredAmountContract(approvalAmountApprovalTotal); - - //合同的批复金额(申报项目:成交金额 项目归集:成交金额) - final BigDecimal[] approvalAmountContract = {BigDecimal.ZERO}; - normalProjects.stream().map(p -> Objects.nonNull(p.getTransactionAmount()) ? p.getTransactionAmount() : BigDecimal.ZERO) - .reduce(BigDecimal::add).ifPresent(b -> approvalAmountContract[0] = b); - final BigDecimal[] approvalAmountContractGov = {BigDecimal.ZERO}; - procures.stream().map(p -> Objects.nonNull(p.getBaseProjPurchaseAmount()) ? - p.getBaseProjPurchaseAmount() : BigDecimal.ZERO).reduce(BigDecimal::add) - .ifPresent(b -> approvalAmountContractGov[0] = b); - BigDecimal approvalAmountContractTotal = approvalAmountContract[0].add(approvalAmountContractGov[0]); - cockpitStats.setApprovalAmountContract(approvalAmountContractTotal); - - //合同的差额 - BigDecimal subtractContract = approvalAmountApprovalTotal.subtract(approvalAmountContractTotal); - cockpitStats.setDifferenceContract(subtractContract); - - //7 核减资金 - cockpitStats.setReduceFundsTotal(subtractApprove.add(subtractApproval).add(subtractContract)); - - //8 产出数据 - cockpitStats.setProduceAppNum(0); - cockpitStats.setProduceDataNum(0); - cockpitStats.setProduceComponentNum(0); - cockpitStats.setProduceBrainElementsNum(0); - - //9.绩效 - List projectCodes = projects.stream().map(Project::getProjectCode).collect(Collectors.toList()); - if (CollUtil.isNotEmpty(projectCodes)) { - List performanceAll = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) - .in(PerformanceAppraisalProject::getProjectCode, projectCodes)); - List verified = performanceAll.stream().filter(p -> { - if (Objects.nonNull(p.getVerifyTotalScore())) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).sorted(Comparator.comparing(PerformanceAppraisalProject::getVerifyTotalScore).reversed()) - .collect(Collectors.toList()); - - List start5 = performanceAll.stream().filter(p -> { - if (Objects.nonNull(p.getVerifyTotalScore()) - && p.getVerifyTotalScore().compareTo(BigDecimal.valueOf(80)) > 0) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).sorted(Comparator.comparing(PerformanceAppraisalProject::getVerifyTotalScore).reversed()) - .collect(Collectors.toList()); - List start4 = performanceAll.stream().filter(p -> { - if (Objects.nonNull(p.getVerifyTotalScore()) - && p.getVerifyTotalScore().compareTo(BigDecimal.valueOf(60)) >= 0 - && p.getVerifyTotalScore().compareTo(BigDecimal.valueOf(80)) < 0) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).sorted(Comparator.comparing(PerformanceAppraisalProject::getVerifyTotalScore).reversed()) - .collect(Collectors.toList()); - List start3 = performanceAll.stream().filter(p -> { - if (Objects.nonNull(p.getVerifyTotalScore()) - && p.getVerifyTotalScore().compareTo(BigDecimal.valueOf(40)) >= 0 - && p.getVerifyTotalScore().compareTo(BigDecimal.valueOf(60)) < 0) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).sorted(Comparator.comparing(PerformanceAppraisalProject::getVerifyTotalScore).reversed()) - .collect(Collectors.toList()); - List start2 = performanceAll.stream().filter(p -> { - if (Objects.nonNull(p.getVerifyTotalScore()) - && p.getVerifyTotalScore().compareTo(BigDecimal.valueOf(20)) >= 0 - && p.getVerifyTotalScore().compareTo(BigDecimal.valueOf(40)) < 0) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).sorted(Comparator.comparing(PerformanceAppraisalProject::getVerifyTotalScore).reversed()) - .collect(Collectors.toList()); - List start1 = performanceAll.stream().filter(p -> { - if (Objects.nonNull(p.getVerifyTotalScore()) - && p.getVerifyTotalScore().compareTo(BigDecimal.ZERO) >= 0 - && p.getVerifyTotalScore().compareTo(BigDecimal.valueOf(20)) < 0) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }).sorted(Comparator.comparing(PerformanceAppraisalProject::getVerifyTotalScore).reversed()) - .collect(Collectors.toList()); - cockpitStats.setPerformanceTotal(performanceAll.size()); - cockpitStats.setPerformanceReviewedTotal(verified.size()); - cockpitStats.setPerformanceTobeReviewTotal(performanceAll.size() - verified.size()); - - cockpitStats.setPerformanceTop1Score(BigDecimal.valueOf(start1.size())); - cockpitStats.setPerformanceTop2Score(BigDecimal.valueOf(start2.size())); - cockpitStats.setPerformanceTop3Score(BigDecimal.valueOf(start3.size())); - cockpitStats.setPerformanceTop4Score(BigDecimal.valueOf(start4.size())); - cockpitStats.setPerformanceTop5Score(BigDecimal.valueOf(start5.size())); - } - - return cockpitStats; - } - - /** - * 建设方案申报了 但未开始审核的项目 - * - * @param projectCode - * @return - */ - private boolean searchSchemaReviewFlow(String projectCode) { - Project project = projectService.getProjectByCode(projectCode); - if (Objects.isNull(project)) { - return Boolean.FALSE; - } - List allVersionProjectId = projectService.allVersionProjectIds(project.getProjectCode()); - ProjectInst pi = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) - .in(ProjectInst::getProjectId, allVersionProjectId) - .eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) - .last(BizConst.LIMIT_1)); - if (Objects.isNull(pi)) { - return Boolean.FALSE; - } - String instCode = pi.getInstCode(); - List finished = historyService.createHistoricActivityInstanceQuery() - .finished() - .processInstanceId(instCode) - .orderByHistoricActivityInstanceEndTime() - .asc() - .list(); - List unfinished = historyService.createHistoricActivityInstanceQuery() - .unfinished() - .processInstanceId(instCode) - .orderByHistoricActivityInstanceStartTime() - .asc() - .list(); - //已经完成的没有 未完成的有 则可计算 - if (CollUtil.isNotEmpty(unfinished) && CollUtil.isEmpty(finished)) { - return Boolean.TRUE; - } - return Boolean.FALSE; - } - - //已经开始审批 - private boolean searchSchemaReviewedFlow(String projectCode) { - Project project = projectService.getProjectByCode(projectCode); - if (Objects.isNull(project)) { - return Boolean.FALSE; - } - List allVersionProjectId = projectService.allVersionProjectIds(project.getProjectCode()); - ProjectInst pi = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) - .in(ProjectInst::getProjectId, allVersionProjectId) - .eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) - .last(BizConst.LIMIT_1)); - if (Objects.isNull(pi)) { - return Boolean.FALSE; - } - String instCode = pi.getInstCode(); - List finished = historyService.createHistoricActivityInstanceQuery() - .finished() - .processInstanceId(instCode) - .orderByHistoricActivityInstanceEndTime() - .asc() - .list(); - //已经完成的 则可计算 - if (CollUtil.isNotEmpty(finished)) { - return Boolean.TRUE; - } - return Boolean.FALSE; - } - - /** - * 计算环节滞后项目 - * - * @param projects - * @return - */ - private Integer computeLagging(List projects) { - List projectCodes = projects.stream().map(Project::getProjectCode).collect(Collectors.toList()); - Map map = projects.stream().collect(Collectors.toMap(Project::getProjectCode, p -> p)); - List records = Lists.newArrayList(); - if (CollUtil.isNotEmpty(projectCodes)) { - records = earlyWarningRecordsService.list(Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) - .in(WflowEarlyWarningRecords::getProjectCode, projectCodes)); - } - return records.stream().mapToInt(r -> { - if (!map.containsKey(r.getProjectCode())) { - return 0; - } - Project project = map.get(r.getProjectCode()); - //如果状态 相等 说明预警了 但是没处理 +1 - if (Objects.nonNull(project.getStatus()) && Objects.nonNull(r.getProjectStatus()) && - project.getStatus().equals(r.getProjectStatus())) { - return 1; - } - return 0; - }).sum(); - } - - private void buildMonitorRise(CockpitStats cockpitStats, CockpitStats thisYearData, CockpitStats lastYearData) { - if (Objects.isNull(thisYearData) || Objects.isNull(lastYearData)) { - return; - } - cockpitStats.setMonitorOverdueConstructionProjectsRise(BizUtils.computeRise(thisYearData.getMonitorOverdueConstructionProjectsNum(), - lastYearData.getMonitorOverdueConstructionProjectsNum())); - cockpitStats.setMonitorLaggingProjectsRise(BizUtils.computeRise(thisYearData.getMonitorLaggingProjectsNum(), - lastYearData.getMonitorLaggingProjectsNum())); - cockpitStats.setMonitorRejectedApproveProjectsRise(BizUtils.computeRise(thisYearData.getMonitorRejectedApproveProjectsNum(), - lastYearData.getMonitorRejectedApproveProjectsNum())); - cockpitStats.setMonitorRejectedPreReviewProjectsRise(BizUtils.computeRise(thisYearData.getMonitorRejectedPreReviewProjectsNum(), - lastYearData.getMonitorRejectedPreReviewProjectsNum())); - cockpitStats.setMonitorAcceptConditionsNotStandardsRise(BizUtils.computeRise(thisYearData.getMonitorAcceptConditionsNotStandardsNum(), - lastYearData.getMonitorAcceptConditionsNotStandardsNum())); - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/ProjectStatusFlowTask.java b/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/ProjectStatusFlowTask.java deleted file mode 100644 index 42c0bbc..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/ProjectStatusFlowTask.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.hz.pm.api.scheduler.task; - -import cn.hutool.core.collection.CollUtil; -import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.hz.pm.api.projectlib.model.entity.Project; -import com.hz.pm.api.projectlib.service.IProjectService; -import com.hz.pm.api.staging.contants.StagingContant; -import com.hz.pm.api.staging.model.entity.ProjectStaging; -import com.hz.pm.api.staging.service.IProjectStagingService; -import com.hz.pm.api.staging.utils.ProjectStatusFlowMapUtil; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; - -/** - * @Classname ProjectStatusFlowTask - * @Description - * @Date 2023/2/20 10:12 - * @Author PoffyZhang - */ -@Slf4j -@Component -@RequiredArgsConstructor -public class ProjectStatusFlowTask { - - private final IProjectStagingService projectStagingService; - - private final IProjectService projectService; - - @Value("${hostname:}") - private String HOST_NAME; - - @Scheduled(cron = "0 */1 * * * ?") - public void statusFlow() throws UnknownHostException { - if (HOST_NAME.equals(InetAddress.getLocalHost().getHostName())) { - //1. 定时取 项目暂存表的数据 去进行状态继续流转 - List stagingList = projectStagingService.list(Wrappers.lambdaQuery(ProjectStaging.class) - .eq(ProjectStaging::getDead, Boolean.FALSE) - .le(ProjectStaging::getNextTime, LocalDateTime.now()) - .le(ProjectStaging::getRetryTimes, StagingContant.Retry.MAX_RETRY_TIMES) - .orderByAsc(ProjectStaging::getProjectId)); - - log.info("需要状态流转的项目 size:{} :{}", stagingList.size(), JSON.toJSONString(stagingList)); - if (CollUtil.isEmpty(stagingList)) { - log.info("没有需要状态流转的项目!"); - return; - } - - //遍历 - for (ProjectStaging projectStaging : stagingList) { - try { - Project project = projectService.getById(projectStaging.getProjectId()); - if (Objects.isNull(project)) { - log.info("此项目 【{}】 不存在", projectStaging.getProjectId()); - continue; - } - //2. 用函数map 定位到 状态流转的函数 - Function flowFunction = ProjectStatusFlowMapUtil.getFlowFunction(project.getStatus()); - if (flowFunction == null) { - log.info("此项目 【{}】 当前状态 【{}】,没有对应流转函数", projectStaging.getProjectId(), project.getStatus()); - continue; - } - //执行对应的函数 - if (flowFunction.apply(project)) { - //执行成功了 删除暂存的数据 - projectStagingService.removeById(projectStaging); - } - } catch (Exception e) { - log.error("项目流转 异常 projectId:【" + projectStaging.getProjectId() + "】 异常内容:" + e.getMessage()); - } finally { - //增加重试的次数 和下次扫描时间 - projectStagingService.addRetryTimes(projectStaging); - } - } - } - } - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java b/hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java deleted file mode 100644 index a3d5919..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.hz.pm.api.staging.utils; - -import com.google.common.collect.Maps; -import com.hz.pm.api.projectdeclared.manage.ReviewByDeptJointManage; -import com.hz.pm.api.projectdeclared.manage.ReviewByProvincialDeptManage; -import com.hz.pm.api.projectlib.model.entity.Project; -import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; -import org.springframework.stereotype.Component; - -import java.util.Map; -import java.util.function.Function; - -/** - * @Classname ProjectStatusFlowMapUtil - * @Description 状态流转 事件函数MAP - * @Date 2023/2/15 11:19 - * @Author PoffyZhang - */ -@Component -public class ProjectStatusFlowMapUtil { - - private static final Map> STATUS_FLOW_FUNCTION_MAP = Maps.newHashMap(); - - - public static Function getFlowFunction(Integer status){ - return STATUS_FLOW_FUNCTION_MAP.get(status); - } - - /** - * 初始化业务分派逻辑,代替了if-else部分 - * key: 枚举 状态值 - * value: lambda表达式,最终会获取发起实例的函数 - */ - public ProjectStatusFlowMapUtil(ReviewByProvincialDeptManage provincialDeptManage, - ReviewByDeptJointManage reviewByDeptJointManage) { - //省级部门联审 - STATUS_FLOW_FUNCTION_MAP.put(ProjectStatus.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), - provincialDeptManage::startTheProcess); - //部门联审 - STATUS_FLOW_FUNCTION_MAP.put(ProjectStatus.DEPARTMENT_JOINT_REVIEW.getCode(), - reviewByDeptJointManage::startTheProcess); - } - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/handle/WithDrawHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/handle/WithDrawHandle.java index fab24ff..04bbc73 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/handle/WithDrawHandle.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/handle/WithDrawHandle.java @@ -3,6 +3,7 @@ package com.hz.pm.api.todocenter.handle; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; import com.hz.pm.api.common.helper.UserInfoHelper; import com.hz.pm.api.common.util.StrUtils; import com.hz.pm.api.projectlib.model.entity.ProjectInst; @@ -20,7 +21,6 @@ import com.wflow.workflow.bean.vo.ProcessProgressVo; import com.wflow.workflow.enums.ProcessStatusEnum; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.assertj.core.util.Lists; import org.flowable.bpmn.model.*; import org.flowable.engine.HistoryService; import org.flowable.engine.RepositoryService; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java index 161c25c..866bbfa 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java @@ -204,12 +204,6 @@ public class HandlerManage { case DECLARED_APPROVED_RECORD_AUDITING: updatePassProjectStatus(userId, project); break; - case SCHEME_UNDER_REVIEW: - // 当前项目状态是终验审核中 - updatePassProjectStatus(userId, project); - // 判断是否 保存建设建议信息 - saveConstructionSuggestInfo(instance.getId(), project); - break; case ON_PURCHASING: case TO_BE_FIRST_INSPECTED: case ON_PILOT_RUNNING: @@ -443,8 +437,6 @@ public class HandlerManage { case PRE_APPLYING: // 当前项目状态是部门联审中 case DEPARTMENT_JOINT_REVIEW: - // 当前项目状态是方案评审中 - case SCHEME_UNDER_REVIEW: updateWithdrawProjectStatus(userId, project); break; default: diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/workbench/converter/WorkbenchConverter.java b/hz-pm-api/src/main/java/com/hz/pm/api/workbench/converter/WorkbenchConverter.java index cdc76db..af5fb0d 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/workbench/converter/WorkbenchConverter.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/workbench/converter/WorkbenchConverter.java @@ -16,9 +16,12 @@ import java.util.Objects; */ public class WorkbenchConverter { - public static WorkbenchVO.DeclaredStatistics convert(DeclaredProjectStatisticsPO po,DeclaredProjectStatisticsPO lastYearPo) { - WorkbenchVO.DeclaredStatistics res = BeanUtil.copyProperties(po,WorkbenchVO.DeclaredStatistics.class); - if(Objects.nonNull(lastYearPo)){ + private WorkbenchConverter() { + } + + public static WorkbenchVO.DeclaredStatistics convert(DeclaredProjectStatisticsPO po, DeclaredProjectStatisticsPO lastYearPo) { + WorkbenchVO.DeclaredStatistics res = BeanUtil.copyProperties(po, WorkbenchVO.DeclaredStatistics.class); + if (Objects.nonNull(lastYearPo)) { res.setDeclaredAmountLastYear(lastYearPo.getDeclaredAmount()); res.setApprovalAmountLastYear(lastYearPo.getApprovalAmount()); } @@ -32,4 +35,5 @@ public class WorkbenchConverter { res.setProjectName(vo.getProjectName()); return res; } + } diff --git a/pom.xml b/pom.xml index e1bfa25..70d2e47 100644 --- a/pom.xml +++ b/pom.xml @@ -27,16 +27,6 @@ - org.apache.poi - poi - 5.2.2 - - - org.apache.poi - poi-ooxml - 5.2.2 - - com.alibaba fastjson ${fastjson.version} @@ -87,7 +77,7 @@ com.alibaba easyexcel-core - 3.1.2 + 3.3.2 com.ningdatech @@ -116,11 +106,6 @@ 2.0.1.RELEASE - cn.afterturn - easypoi-base - 4.4.0 - - com.github.oshi oshi-core 6.4.0