Browse Source

单位名修改

tags/24080901
WendyYang 11 months ago
parent
commit
ee46ce6d0c
62 changed files with 361 additions and 2703 deletions
  1. +0
    -15
      hz-pm-api/pom.xml
  2. +2
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/common/util/FreemarkerWordUtil.java
  3. +8
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/handle/ProjectStatusHandler.java
  4. +0
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/helper/DashboardHelper.java
  5. +54
    -70
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/DashboardProjectManage.java
  6. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/datascope/provider/DataScopeContext.java
  7. +0
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/irs/manage/AppIrsManage.java
  8. +9
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectApplicationService.java
  9. +10
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectInstService.java
  10. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/safety/model/vo/EqualProtectionVO.java
  11. +47
    -58
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessEndListener.java
  12. +86
    -102
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java
  13. +18
    -17
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java
  14. +119
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/utils/PdfUtil.java
  15. +0
    -134
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/utils/PdfUtils.java
  16. +3
    -3
      hz-pm-api/src/test/java/com/hz/pm/api/todocenter/TodoCenterTest.java
  17. +0
    -198
      hz-pm-sync/pom.xml
  18. +0
    -33
      hz-pm-sync/src/main/java/com/hz/pm/sync/SynDataTaskApp.java
  19. +0
    -106
      hz-pm-sync/src/main/java/com/hz/pm/sync/common/constant/BizConst.java
  20. +0
    -85
      hz-pm-sync/src/main/java/com/hz/pm/sync/common/utils/CryptUtils.java
  21. +0
    -55
      hz-pm-sync/src/main/java/com/hz/pm/sync/open/controller/ProjectReceiveController.java
  22. +0
    -59
      hz-pm-sync/src/main/java/com/hz/pm/sync/open/enumeration/GovProjectStatusEnum.java
  23. +0
    -56
      hz-pm-sync/src/main/java/com/hz/pm/sync/open/manage/IrsManage.java
  24. +0
    -317
      hz-pm-sync/src/main/java/com/hz/pm/sync/open/manage/ProjectReceiveManage.java
  25. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectApplyMapper.java
  26. +0
    -5
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectApplyMapper.xml
  27. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectApproveMapper.java
  28. +0
    -5
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectApproveMapper.xml
  29. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectBaseInfoMapper.java
  30. +0
    -5
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectBaseInfoMapper.xml
  31. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectCimplementMapper.java
  32. +0
    -5
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectCimplementMapper.xml
  33. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectMimplementMapper.java
  34. +0
    -5
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectMimplementMapper.xml
  35. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectProcureMapper.java
  36. +0
    -5
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectProcureMapper.xml
  37. +0
    -26
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/dto/ForwardDTO.java
  38. +0
    -100
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/dto/ProjectBaseInfoDTO.java
  39. +0
    -34
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/dto/ProjectSaveDTO.java
  40. +0
    -138
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectApply.java
  41. +0
    -90
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectApprove.java
  42. +0
    -105
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectBaseInfo.java
  43. +0
    -108
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectCimplement.java
  44. +0
    -96
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectMimplement.java
  45. +0
    -96
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectProcure.java
  46. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectApplyService.java
  47. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectApproveService.java
  48. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectBaseInfoService.java
  49. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectCimplementService.java
  50. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectMimplementService.java
  51. +0
    -16
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectProcureService.java
  52. +0
    -21
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/IProjectCimplementServiceImpl.java
  53. +0
    -20
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/ProjectApplyServiceImpl.java
  54. +0
    -21
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/ProjectApproveServiceImpl.java
  55. +0
    -21
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/ProjectBaseInfoServiceImpl.java
  56. +0
    -21
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/ProjectMimplementServiceImpl.java
  57. +0
    -21
      hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/ProjectProcureServiceImpl.java
  58. +0
    -79
      hz-pm-sync/src/main/resources/application-dev.yml
  59. +0
    -77
      hz-pm-sync/src/main/resources/application-pre.yml
  60. +0
    -3
      hz-pm-sync/src/main/resources/application.yml
  61. +0
    -68
      hz-pm-sync/src/main/resources/logback-spring.xml
  62. +2
    -4
      pom.xml

+ 0
- 15
hz-pm-api/pom.xml View File

@@ -9,9 +9,6 @@
</parent>
<artifactId>hz-pm-api</artifactId>
<version>1.0.0</version>
<properties>
<jjwt.version>0.11.5</jjwt.version>
</properties>

<dependencies>
<dependency>
@@ -108,12 +105,6 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</dependency>
<!-- 阿里云oss -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.15.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -128,12 +119,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<!--引入jwt-->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.10.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>


+ 2
- 4
hz-pm-api/src/main/java/com/hz/pm/api/common/util/FreemarkerWordUtil.java View File

@@ -66,10 +66,8 @@ public class FreemarkerWordUtil {
//输出文件
File outFile = new File(filePath + File.separator + fileName);
//如果输出目标文件夹不存在,则创建
if (!outFile.getParentFile().exists()) {
if (outFile.getParentFile().mkdirs()) {
log.info("创建文件目录:{}", outFile.getParentFile().getAbsolutePath());
}
if (!outFile.getParentFile().exists() && (outFile.getParentFile().mkdirs())) {
log.info("创建文件目录:{}", outFile.getParentFile().getAbsolutePath());
}
//将模板和数据模型合并生成文件
Writer out = new BufferedWriter(new OutputStreamWriter(Files.newOutputStream(outFile.toPath()), StandardCharsets.UTF_8));


+ 8
- 6
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/handle/ProjectStatusHandler.java View File

@@ -11,6 +11,8 @@ 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.entity.ProjectStatusChange;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.service.INdProjectStatusChangeService;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
@@ -51,7 +53,7 @@ public class ProjectStatusHandler {
* @param project \
* @return \
*/
public ProtraitProjectStatusSituationVO generateApproveStatus(Project project, String statusName, Integer instType) {
public ProtraitProjectStatusSituationVO genApproveStatus(Project project, String statusName, InstTypeEnum instType) {
ProtraitProjectStatusSituationVO vo = new ProtraitProjectStatusSituationVO();
if (Objects.isNull(project)) {
return vo;
@@ -65,7 +67,7 @@ public class ProjectStatusHandler {
//查询 项目与实例关联表
ProjectInst unitInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, ids)
.eq(ProjectInst::getInstType, instType)
.eq(ProjectInst::getInstType, instType.getCode())
.last(BizConst.LIMIT_1));
if (Objects.isNull(unitInst)) {
return vo;
@@ -89,8 +91,8 @@ public class ProjectStatusHandler {
* @param project \
* @return \
*/
public ProtraitProjectStatusSituationVO generateStatus(Project project, String statusName,
Integer currStatus, Integer nextStatus) {
public ProtraitProjectStatusSituationVO genStatus(Project project, String statusName,
ProjectStatusEnum currStatus, ProjectStatusEnum nextStatus) {
ProtraitProjectStatusSituationVO vo = new ProtraitProjectStatusSituationVO();
if (Objects.isNull(project)) {
return vo;
@@ -101,9 +103,9 @@ public class ProjectStatusHandler {
//查询 状态机流转的时间点
LambdaQueryWrapper<ProjectStatusChange> pscQuery = Wrappers
.lambdaQuery(ProjectStatusChange.class)
.eq(ProjectStatusChange::getBeforeStatus, currStatus)
.eq(ProjectStatusChange::getBeforeStatus, currStatus.getCode())
.eq(ProjectStatusChange::getProjectCode, projectCode)
.eq(ProjectStatusChange::getAfterStatus, nextStatus)
.eq(ProjectStatusChange::getAfterStatus, nextStatus.getCode())
.last(BizConst.LIMIT_1);
ProjectStatusChange statusChange = statusChangeService.getOne(pscQuery);
if (Objects.isNull(statusChange)) {


+ 0
- 4
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/helper/DashboardHelper.java View File

@@ -1,10 +1,7 @@
package com.hz.pm.api.dashboard.helper;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.dashboard.constant.AnalysisBasicConstant;
import com.hz.pm.api.dashboard.model.entity.CockpitStats;
import com.hz.pm.api.dashboard.model.vo.CockpitStatsVO;
import com.hz.pm.api.sys.model.entity.Region;
import com.hz.pm.api.sys.service.IRegionService;
import lombok.RequiredArgsConstructor;
@@ -13,7 +10,6 @@ import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

/**


+ 54
- 70
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/DashboardProjectManage.java View File

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.dashboard.constant.ChartTypeEnum;
import com.hz.pm.api.dashboard.constant.DashboardConstant;
import com.hz.pm.api.dashboard.constant.DashboardConstant.Protrait;
import com.hz.pm.api.dashboard.handle.ApplicationHandler;
import com.hz.pm.api.dashboard.handle.ProjectStatusHandler;
import com.hz.pm.api.dashboard.helper.DashboardChartAssembler;
@@ -28,10 +28,10 @@ import com.hz.pm.api.gov.service.IGovOperationProjectBaseinfoService;
import com.hz.pm.api.portrait.service.IProjectTagService;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.service.IPurchaseService;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectDelayApply;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.service.INdProjectDelayApplyService;
import com.hz.pm.api.projectlib.service.IProjectService;
import lombok.RequiredArgsConstructor;
@@ -194,15 +194,12 @@ public class DashboardProjectManage {
return dashboardProjectSummaryVO;
}

public DashboardProjectCntSummaryVO getProjectCntSummary(QueryYearPO queryYearPO) {
public DashboardProjectCntSummaryVO getProjectCntSummary(QueryYearPO req) {
// 预算年度
Integer year = queryYearPO.getYear();
String regionCode = queryYearPO.getRegionCode();
Integer year = req.getYear();
List<Project> allProjectList = iProjectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, true)
.eq(Objects.nonNull(year), Project::getProjectYear, year)
.eq(StringUtils.isNotBlank(regionCode), Project::getAreaCode, regionCode)
);
.eq(Objects.nonNull(year), Project::getProjectYear, year));

// 单位项目数量TOP5
List<CompanyProjectCntBO> companyProjectCntTop5List = new ArrayList<>();
@@ -215,9 +212,7 @@ public class DashboardProjectManage {
companyProjectCntBO.setProjectCnt(projectList.size());
companyProjectCntTop5List.add(companyProjectCntBO);
}
companyProjectCntTop5List = companyProjectCntTop5List.stream()
.sorted(Comparator.comparing(CompanyProjectCntBO::getProjectCnt).reversed())
.collect(Collectors.toList());
companyProjectCntTop5List.sort(Comparator.comparing(CompanyProjectCntBO::getProjectCnt).reversed());
if (companyProjectCntTop5List.size() > 5) {
companyProjectCntTop5List = companyProjectCntTop5List.subList(0, 5);
}
@@ -269,10 +264,10 @@ public class DashboardProjectManage {
}


public DashboardInvestmentSummaryVO getInvestmentSummary(QueryYearPO queryYearPO) {
public DashboardInvestmentSummaryVO getInvestmentSummary(QueryYearPO req) {
// 预算年度
Integer year = queryYearPO.getYear();
String regionCode = queryYearPO.getRegionCode();
Integer year = req.getYear();
String regionCode = req.getRegionCode();
List<Project> allProjectList = iProjectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, true)
.eq(Objects.nonNull(year), Project::getProjectYear, year)
@@ -289,9 +284,7 @@ public class DashboardProjectManage {
projectATIISBO.setApprovedTotalInvestmentIncrease(r.getApprovedTotalInvestmentIncrease());
return projectATIISBO;
}).collect(Collectors.toList());
projectATIISTop5List = projectATIISTop5List.stream()
.sorted(Comparator.comparing(ProjectATIISBO::getApprovedTotalInvestmentIncrease)
.reversed()).collect(Collectors.toList());
projectATIISTop5List.sort(Comparator.comparing(ProjectATIISBO::getApprovedTotalInvestmentIncrease));
if (projectATIISTop5List.size() > 5) {
projectATIISTop5List = projectATIISTop5List.subList(0, 5);
}
@@ -314,9 +307,7 @@ public class DashboardProjectManage {
companyProjectCntBO.setApprovedTotalInvestmentIncreaseSum(approvedTotalInvestmentIncreaseSum);
companyProjectATIISTop5List.add(companyProjectCntBO);
}
companyProjectATIISTop5List = companyProjectATIISTop5List.stream()
.sorted(Comparator.comparing(CompanyProjectCntBO::getApprovedTotalInvestmentIncreaseSum).reversed())
.collect(Collectors.toList());
companyProjectATIISTop5List.sort(Comparator.comparing(CompanyProjectCntBO::getApprovedTotalInvestmentIncreaseSum).reversed());
if (companyProjectATIISTop5List.size() > 5) {
companyProjectATIISTop5List = companyProjectATIISTop5List.subList(0, 5);
}
@@ -379,7 +370,7 @@ public class DashboardProjectManage {
projectInfo.setSafetyInputRate(convertSafetyInputRate(project));
projectInfo.setStatus(Objects.nonNull(project.getStatus()) ? project.getStatus().toString() : null);
//3.项目状态情况
projectInfo.setStatusSituation(generateProjectStatus(project));
projectInfo.setStatusSituation(genProjectStatus(project));
res.setProjectInfo(projectInfo);
} else if (Objects.nonNull(baseInfo)) {
ProtraitProjectInfoVO projectInfo = BeanUtil.copyProperties(baseInfo, ProtraitProjectInfoVO.class);
@@ -388,7 +379,7 @@ public class DashboardProjectManage {
if (Objects.nonNull(apply)) {
try {
projectInfo.setProjectYear(Integer.valueOf(apply.getBaseProjSetYear()));
} catch (Exception e) {
} catch (Exception ignored) {
}
projectInfo.setProjectIntroduction(apply.getBaseProjIntro());
projectInfo.setBuildCycle(apply.getBaseProjDuration());
@@ -399,7 +390,7 @@ public class DashboardProjectManage {
projectInfo.setBuildOrgName(baseInfo.getBaseBuildDeprt());
projectInfo.setBuildOrgCode(baseInfo.getBaseBuildDeprtDing());
//3.项目状态情况
projectInfo.setStatusSituation(generateProjectStatus(baseInfo));
projectInfo.setStatusSituation(genProjectStatus(baseInfo));
projectInfo.setStatus(baseInfo.getBaseProjSetProg());
res.setProjectInfo(projectInfo);
} else if (Objects.nonNull(operationBase)) {
@@ -409,7 +400,7 @@ public class DashboardProjectManage {
if (Objects.nonNull(apply)) {
try {
projectInfo.setProjectYear(Integer.valueOf(apply.getBaseProjSetYear()));
} catch (Exception e) {
} catch (Exception ignored) {
}
projectInfo.setProjectIntroduction(apply.getBaseProjIntro());
projectInfo.setBuildCycle(apply.getBaseProjDuration());
@@ -420,7 +411,7 @@ public class DashboardProjectManage {
projectInfo.setBuildOrgName(operationBase.getBaseBuildDeprt());
projectInfo.setBuildOrgCode(operationBase.getBaseBuildDeprtDing());
//3.项目状态情况
projectInfo.setStatusSituation(generateProjectStatus(operationBase));
projectInfo.setStatusSituation(genProjectStatus(operationBase));
projectInfo.setStatus(operationBase.getBaseProjSetProg());
res.setProjectInfo(projectInfo);
}
@@ -449,7 +440,7 @@ public class DashboardProjectManage {
final Double[] total = {0.0};
array.forEach(j -> {
JSONObject json = JSON.parseObject(JSON.toJSONString(j));
Double safetyInputAmount = json.getDouble(DashboardConstant.Protrait.FEILD_SAFETYMONEY);
Double safetyInputAmount = json.getDouble(Protrait.FEILD_SAFETYMONEY);
if (Objects.nonNull(safetyInputAmount)) {
total[0] += safetyInputAmount;
}
@@ -458,16 +449,16 @@ public class DashboardProjectManage {
//申报金额
BigDecimal declareAmount = project.getDeclareAmount();
if (Objects.isNull(declareAmount) || declareAmount.compareTo(BigDecimal.ZERO) == 0) {
return DashboardConstant.Protrait.ZREO_PERCEN;
return Protrait.ZREO_PERCEN;
}
BigDecimal rate = BigDecimal.valueOf(totalAmount).multiply(BigDecimal.valueOf(100))
.divide(declareAmount, BigDecimal.ROUND_CEILING, RoundingMode.HALF_UP)
.stripTrailingZeros();
return rate.toPlainString();
} catch (Exception e) {
} catch (Exception ignored) {
}
}
return DashboardConstant.Protrait.ZREO_PERCEN;
return Protrait.ZREO_PERCEN;
}

/**
@@ -476,7 +467,7 @@ public class DashboardProjectManage {
* @param project
* @return
*/
private List<ProtraitProjectStatusSituationVO> generateProjectStatus(Project project) {
private List<ProtraitProjectStatusSituationVO> genProjectStatus(Project project) {
final List<ProtraitProjectStatusSituationVO> res = Lists.newArrayList();
//1.计划(单位内部审核)
res.add(new ProtraitProjectStatusSituationVO());
@@ -489,77 +480,70 @@ public class DashboardProjectManage {
//5.验收(终验)
res.add(new ProtraitProjectStatusSituationVO());
//6.运维(todo: 运维时间还没有)
res.add(ProtraitProjectStatusSituationVO.builder().statusName(DashboardConstant.Protrait.OPERATION).build());
res.add(ProtraitProjectStatusSituationVO.builder().statusName(Protrait.OPERATION).build());
//7.绩效
res.add(new ProtraitProjectStatusSituationVO());
//8.注销(todo: 还没有注销功能)
res.add(ProtraitProjectStatusSituationVO.builder().statusName(DashboardConstant.Protrait.LOG_OFF).build());
res.add(ProtraitProjectStatusSituationVO.builder().statusName(Protrait.LOG_OFF).build());

CompletableFuture.allOf(
CompletableFuture.runAsync(() -> {
res.set(0, statusHandler.generateApproveStatus(project, DashboardConstant.Protrait.PLAN, InstTypeEnum.UNIT_INNER_AUDIT.getCode()));
}, ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> {
res.set(1, statusHandler.generateApproveStatus(project, DashboardConstant.Protrait.DECLARED, InstTypeEnum.PRELIMINARY_PREVIEW.getCode()));
}, ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> {
res.set(2, statusHandler.generateApproveStatus(project, DashboardConstant.Protrait.APPROVE, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()));
}, ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> {
res.set(3, statusHandler.generateStatus(project, DashboardConstant.Protrait.CONSTRUCTION,
ProjectStatusEnum.UNDER_CONSTRUCTION.getCode(), ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()));
}, ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> {
res.set(4, statusHandler.generateApproveStatus(project, DashboardConstant.Protrait.ACCEPT, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()));
}, ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> {
res.set(6, statusHandler.generatePerformanceStatus(project));
}, ForkJoinPool.commonPool())
CompletableFuture.runAsync(() -> res.set(0, statusHandler.genApproveStatus(project, Protrait.PLAN,
InstTypeEnum.UNIT_INNER_AUDIT)), ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> res.set(1, statusHandler.genApproveStatus(project, Protrait.DECLARED,
InstTypeEnum.PRELIMINARY_PREVIEW)), ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> res.set(2, statusHandler.genApproveStatus(project, Protrait.APPROVE,
InstTypeEnum.CONSTRUCTION_PLAN_REVIEW)), ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> res.set(3, statusHandler.genStatus(project, Protrait.CONSTRUCTION,
ProjectStatusEnum.UNDER_CONSTRUCTION, ProjectStatusEnum.TO_BE_FINALLY_INSPECTED)), ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> res.set(4, statusHandler.genApproveStatus(project, Protrait.ACCEPT,
InstTypeEnum.PROJECT_FINAL_INSPECTION)), ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> res.set(6, statusHandler.generatePerformanceStatus(project)),
ForkJoinPool.commonPool())
).join();
return res;
}

private List<ProtraitProjectStatusSituationVO> generateProjectStatus(GovBizProjectBaseinfo baseinfo) {
private List<ProtraitProjectStatusSituationVO> genProjectStatus(GovBizProjectBaseinfo baseinfo) {
final List<ProtraitProjectStatusSituationVO> res = Lists.newArrayList();
//1.计划(单位内部审核)
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.PLAN, null));
res.add(new ProtraitProjectStatusSituationVO(Protrait.PLAN, null));
//2.申报(项目预审)
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.DECLARED, null));
res.add(new ProtraitProjectStatusSituationVO(Protrait.DECLARED, null));
//3.审批(建设方案审批)
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.APPROVE, null));
res.add(new ProtraitProjectStatusSituationVO(Protrait.APPROVE, null));
//4.建设(立项后的建设中)
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.CONSTRUCTION, null));
res.add(new ProtraitProjectStatusSituationVO(Protrait.CONSTRUCTION, null));
//5.验收(终验)
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.ACCEPT,
res.add(new ProtraitProjectStatusSituationVO(Protrait.ACCEPT,
Objects.nonNull(baseinfo.getBaseProjSetProg()) && "07".equals(baseinfo.getBaseProjSetProg()) ? baseinfo.getTongTime() : null));
//6.运维(todo: 运维时间还没有)
res.add(ProtraitProjectStatusSituationVO.builder().statusName(DashboardConstant.Protrait.OPERATION).build());
res.add(ProtraitProjectStatusSituationVO.builder().statusName(Protrait.OPERATION).build());
//7.绩效
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.ACCEPT, null));
res.add(new ProtraitProjectStatusSituationVO(Protrait.ACCEPT, null));
//8.注销(todo: 还没有注销功能)
res.add(ProtraitProjectStatusSituationVO.builder().statusName(DashboardConstant.Protrait.LOG_OFF).build());
res.add(ProtraitProjectStatusSituationVO.builder().statusName(Protrait.LOG_OFF).build());
return res;
}

private List<ProtraitProjectStatusSituationVO> generateProjectStatus(GovOperationProjectBaseinfo baseinfo) {
private List<ProtraitProjectStatusSituationVO> genProjectStatus(GovOperationProjectBaseinfo baseinfo) {
final List<ProtraitProjectStatusSituationVO> res = Lists.newArrayList();
//1.计划(单位内部审核)
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.PLAN, null));
res.add(new ProtraitProjectStatusSituationVO(Protrait.PLAN, null));
//2.申报(项目预审)
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.DECLARED, null));
res.add(new ProtraitProjectStatusSituationVO(Protrait.DECLARED, null));
//3.审批(建设方案审批)
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.APPROVE, null));
res.add(new ProtraitProjectStatusSituationVO(Protrait.APPROVE, null));
//4.建设(立项后的建设中)
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.CONSTRUCTION, null));
res.add(new ProtraitProjectStatusSituationVO(Protrait.CONSTRUCTION, null));
//5.验收(终验)
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.ACCEPT,
res.add(new ProtraitProjectStatusSituationVO(Protrait.ACCEPT,
Objects.nonNull(baseinfo.getBaseProjSetProg()) && "07".equals(baseinfo.getBaseProjSetProg()) ? baseinfo.getTongTime() : null));
//6.运维(todo: 运维时间还没有)
res.add(ProtraitProjectStatusSituationVO.builder().statusName(DashboardConstant.Protrait.OPERATION).build());
res.add(ProtraitProjectStatusSituationVO.builder().statusName(Protrait.OPERATION).build());
//7.绩效
res.add(new ProtraitProjectStatusSituationVO(DashboardConstant.Protrait.ACCEPT, null));
res.add(new ProtraitProjectStatusSituationVO(Protrait.ACCEPT, null));
//8.注销(todo: 还没有注销功能)
res.add(ProtraitProjectStatusSituationVO.builder().statusName(DashboardConstant.Protrait.LOG_OFF).build());
res.add(ProtraitProjectStatusSituationVO.builder().statusName(Protrait.LOG_OFF).build());
return res;
}
}

+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/datascope/provider/DataScopeContext.java View File

@@ -1,7 +1,7 @@
package com.hz.pm.api.datascope.provider;

import com.ningdatech.basic.util.SpringUtils;
import com.hz.pm.api.datascope.model.DataScopeDTO;
import com.ningdatech.basic.util.SpringUtils;
import lombok.RequiredArgsConstructor;

import java.io.Serializable;
@@ -19,7 +19,7 @@ import java.util.Optional;
@RequiredArgsConstructor
public class DataScopeContext implements Serializable {

private static final String WARN_MSG = "请先创建数据权限[%s]的实现类,使其实现 DataScopeProvider";
private static final String WARN_MSG = "请先创建数据权限[%s]的实现类";

private static final Map<String, DataScopeProvider> DSP_MAP;

@@ -35,7 +35,7 @@ public class DataScopeContext implements Serializable {
return dataScopeProvider.findDataFieldProperty();
}

public static Optional<DataScopeDTO> getDataScopeHasUserId(String roleCode,Long userId) {
public static Optional<DataScopeDTO> getDataScopeHasUserId(String roleCode, Long userId) {
DataScopeProvider dataScopeProvider = DSP_MAP.get(roleCode);
if (dataScopeProvider == null) {
throw new IllegalArgumentException(String.format(WARN_MSG, roleCode));


+ 0
- 2
hz-pm-api/src/main/java/com/hz/pm/api/irs/manage/AppIrsManage.java View File

@@ -277,7 +277,6 @@ public class AppIrsManage {
String appSecret = "496f0f2a19994f76b4fd9dae087366c7";
String appKey = "A331101453557202109017383";
String method = "POST";
String interfaceName = "5crv7i4727abLCv0";
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, method);
log.info("secret :{}", secret);
String sign = MD5.create().digestHex(appKey + secret + timestamp);
@@ -374,7 +373,6 @@ public class AppIrsManage {
String appSecret = driAppSecret;
String appKey = driAppKey;
String method = HttpMethod.POST.name();
String interfaceName = driInterfaceName;
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, method);
log.info("secret : {}", secret);
String sign = MD5.create().digestHex(appKey + secret + timestamp);


+ 9
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectApplicationService.java View File

@@ -1,5 +1,6 @@
package com.hz.pm.api.projectlib.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -8,7 +9,7 @@ import java.util.List;

/**
* <p>
* 服务类
* 服务类
* </p>
*
* @author WendyYang
@@ -18,5 +19,11 @@ public interface IProjectApplicationService extends IService<ProjectApplication>

List<ProjectApplication> getApplicationsByProject(Project project);

void saveApplication(Project project,Project oldProject,Boolean isConstruct);
void saveApplication(Project project, Project oldProject, Boolean isConstruct);

default List<ProjectApplication> listByProjectId(Long projectId) {
return list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, projectId));
}

}

+ 10
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectInstService.java View File

@@ -1,11 +1,13 @@
package com.hz.pm.api.projectlib.service;

import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;

/**
* <p>
* 服务类
* 服务类
* </p>
*
* @author Poffy
@@ -13,4 +15,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IProjectInstService extends IService<ProjectInst> {

default ProjectInst getByInstCode(String instCode) {
return getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getInstCode, instCode)
.last(BizConst.LIMIT_1));
}

}

+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/safety/model/vo/EqualProtectionVO.java View File

@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* <p>


+ 47
- 58
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessEndListener.java View File

@@ -1,19 +1,12 @@
package com.hz.pm.api.scheduler.listener;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.file.service.FileService;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.model.constant.ProjectDeclareConst;
import com.hz.pm.api.common.statemachine.util.StateMachineUtil;
import com.hz.pm.api.projectdeclared.converter.ApplicationConverter;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import cn.hutool.core.util.NumberUtil;
import com.google.common.collect.Sets;
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.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
@@ -22,6 +15,8 @@ import com.hz.pm.api.staging.enums.MsgTypeEnum;
import com.hz.pm.api.staging.service.IProjectStagingService;
import com.hz.pm.api.sys.manage.NoticeManage;
import com.hz.pm.api.todocenter.manage.HandlerManage;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.file.service.FileService;
import com.wflow.contants.HisProInsEndActId;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.process.enums.NodeTypeEnum;
@@ -39,10 +34,11 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.Set;

import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.PASS_MSG_TEMPLATE;
import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.PASS_MSG_TEMPLATE2;
@@ -83,6 +79,7 @@ public class ProcessEndListener {

@Async
@EventListener
@Transactional(rollbackFor = Exception.class)
public void onApplicationEvent(ProcessEndEvent event) {
log.info("进入工作流结束的 事件监听!{}", event.getInstCode());
String instCode = event.getInstCode();
@@ -93,13 +90,11 @@ public class ProcessEndListener {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
throw new BizException(e);
Thread.currentThread().interrupt();
}

//1.去查找 项目实例关系表
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getInstCode, instCode)
.last(BizConst.LIMIT_1));
ProjectInst projectInst = projectInstService.getByInstCode(instCode);

if (Objects.isNull(projectInst)) {
return;
@@ -129,51 +124,42 @@ public class ProcessEndListener {
/**
* 审核通过后 所处理的逻辑
*
* @param declaredProject \
* @param instance \
* @param project \
* @param instance \
*/
public void afterPassTodo(Project declaredProject, HistoricProcessInstance instance) {
Long userId = 110L;
private void afterPassTodo(Project project, HistoricProcessInstance instance) {
// 获取流程通过后的流程实例
HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery()
.processInstanceId(instance.getId())
.singleResult();
// 获取当前流程实例类型
String instanceId = newInstance.getId();
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getInstCode, instanceId)
.last(BizConst.LIMIT_1));
ProjectInst projectInst = projectInstService.getByInstCode(instanceId);
Integer instType = projectInst.getInstType();
InstTypeEnum instTypeEnum = InstTypeEnum.getByCode(instType);
if (Objects.isNull(instTypeEnum)) {
throw new BizException("当前审批流类型不存在,流程类型code:" + instType);
throw BizException.wrap("当前审批流类型不存在,流程类型code:" + instType);
}

// 获取流程通过后当前流程详情
ProcessProgressVo newInstanceDetail = processInstanceService.getProgressInstanceDetail(null, instance.getId());
ProcessProgressVo newInstDetail = processInstanceService.getProgressInstanceDetail(null, instance.getId());
// 获取流程通过后当前审核人信息,向其发送工作通知
// 会签/或签会有多个审核人
List<String> currentEmployeeCodeList = Lists.newArrayList();
List<ProgressNode> newProgressInfo = newInstanceDetail.getProgressInfo();
ProgressNode currentNode = newProgressInfo.get(newProgressInfo.size() - 1);
Set<String> currUserIdList = Sets.newHashSet();
List<ProgressNode> newProgressInfo = newInstDetail.getProgressInfo();
ProgressNode currNode = newProgressInfo.get(newProgressInfo.size() - 1);

// 说明当前节点是子流程节点
if (currentNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())) {
List<ProgressNode> children = currentNode.getChildren();
if (currNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())) {
List<ProgressNode> children = currNode.getChildren();
// 获取子流程当前审核人节点
ProgressNode subCurrentNode = CollUtil.isEmpty(children) ? new ProgressNode() : children.get(children.size() - 1);
ProgressNode subCurrNode = CollUtil.isEmpty(children) ? new ProgressNode() : children.get(children.size() - 1);
// 获取节点ID相同地审核节点
List<ProgressNode> nodeList = children.stream()
.filter(c -> subCurrentNode.getNodeId().equals(c.getNodeId()))
.collect(Collectors.toList());
List<String> userIdList = nodeList.stream().map(ProgressNode::getUserId).collect(Collectors.toList());
currentEmployeeCodeList.addAll(userIdList);
children.stream().filter(c -> subCurrNode.getNodeId().equals(c.getNodeId()))
.forEach(c -> currUserIdList.add(c.getUserId()));
} else {
List<ProgressNode> nodeList = newProgressInfo.stream()
.filter(c -> currentNode.getNodeId().equals(c.getNodeId()))
.collect(Collectors.toList());
List<String> userIdList = nodeList.stream().map(ProgressNode::getUserId).collect(Collectors.toList());
currentEmployeeCodeList.addAll(userIdList);
newProgressInfo.stream().filter(c -> currNode.getNodeId().equals(c.getNodeId()))
.forEach(c -> currUserIdList.add(c.getUserId()));
}

// 流程通过后,判断当前登录用户是不是最后一个审核人
@@ -181,55 +167,58 @@ public class ProcessEndListener {
// 并向流程发起人发送浙政钉工作通知:【项目名称】已通过【流程名称】,请及时开始下一步操作。
if (HisProInsEndActId.END.equals(newInstance.getEndActivityId())) {
// 如果是申请延期和申请借阅审批流程,不走状态机
if (InstTypeEnum.APPLY_DELAY.getCode().equals(instType) || InstTypeEnum.APPLY_BORROW.getCode().equals(instType)) {
if (InstTypeEnum.APPLY_DELAY.eq(instType) || InstTypeEnum.APPLY_BORROW.eq(instType)) {
switch (instTypeEnum) {
case APPLY_DELAY:
// 保存延期申请记录,更新项目建设周期和计划验收时间
handlerManage.updateProjectDelayApplyInfo(declaredProject, instanceId);
handlerManage.updateProjectDelayApplyInfo(project, instanceId);
break;
case APPLY_BORROW:
// 更新申请借阅状态为成功
handlerManage.updateProjectApplyBorrowInfo(declaredProject, instanceId);
handlerManage.updateProjectApplyBorrowInfo(project, instanceId);
break;
default:
throw new BizException("传入实例类型错误: " + instTypeEnum);
throw BizException.wrap("传入实例类型错误:%s ", instTypeEnum);
}
} else {
switch (Objects.requireNonNull(ProjectStatusEnum.match(declaredProject.getStatus()))) {
switch (Objects.requireNonNull(ProjectStatusEnum.match(project.getStatus()))) {
// 当前项目状态是预审中
case PRE_APPLYING:
//先修改项目状态
handlerManage.updatePassProjectStatus(userId, declaredProject);
handlerManage.updatePassProjectStatus(0L, project);
//然后入库暂存库
projectStagingService.addByProject(declaredProject, "暂存入库 待提交部门联审");
projectStagingService.addByProject(project, "暂存入库 待提交部门联审");
break;
// 当前项目状态是单位内部审核中
case UNDER_INTERNAL_AUDIT:
// 当前项目状态是部门联审中
case DEPARTMENT_JOINT_REVIEW:
// 当前项目状态是方案评审中
// 当前项目状态是方案评审中
case SCHEME_UNDER_REVIEW:
// 当前项目状态是终验审核中
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW:
handlerManage.updatePassProjectStatus(userId, declaredProject);
handlerManage.updatePassProjectStatus(0L, project);
break;
default:
throw new BizException("传入项目状态错误: " + declaredProject.getStatus());
throw BizException.wrap("传入项目状态错误:%s", project.getStatus());
}
}
//发送消息
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(), PASS_MSG_TEMPLATE2, MsgTypeEnum.PROJECT_REVIEW_PASS);
noticeManage.sendNotice(Long.parseLong(instance.getStartUserId()), project, instance.getProcessDefinitionName(),
PASS_MSG_TEMPLATE2, MsgTypeEnum.PROJECT_REVIEW_PASS);
} else {
// 若有下一个审核人(当前节点的用户),会签/或签会有多个
// 向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。
// 获取发送浙政钉工作通知必要信息
for (String currentEmployeeCode : currentEmployeeCodeList) {
if (Objects.isNull(currentEmployeeCode)) {
throw new BizException("审核人信息不存在!");
for (String currUserId : currUserIdList) {
if (NumberUtil.isNumber(currUserId)) {
//发送消息
noticeManage.sendNotice(Long.parseLong(currUserId), project, instance.getProcessDefinitionName(),
PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
} else {
log.warn("无效的审核人用户Id:{}", currUserId);
}
//发送消息
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(),
PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);

}
}
}

+ 86
- 102
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java View File

@@ -2,16 +2,17 @@ package com.hz.pm.api.todocenter.manage;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.model.constant.ProjectDeclareConst;
import com.hz.pm.api.common.statemachine.util.StateMachineUtil;
import com.hz.pm.api.filemanage.model.entity.ProjectApplyBorrow;
import com.hz.pm.api.filemanage.service.INdProjectApplyBorrowService;
import com.hz.pm.api.projectdeclared.converter.ApplicationConverter;
import com.hz.pm.api.projectdeclared.manage.DeclaredProjectManage;
import com.hz.pm.api.projectdeclared.model.dto.ProjectDraftSaveDTO;
import com.hz.pm.api.projectdeclared.model.entity.ProjectConstructionSuggestions;
@@ -55,14 +56,10 @@ import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;

import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.*;
@@ -104,10 +101,10 @@ public class HandlerManage {
/**
* 审核通过后 所处理的逻辑
*
* @param declaredProject
* @param instance
* @param project \
* @param instance \
*/
public void afterPassTodo(Project declaredProject, HistoricProcessInstance instance) {
public void afterPassTodo(Project project, HistoricProcessInstance instance) {
Long userId = LoginUserUtil.getUserId();
// 获取流程通过后的流程实例
HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery()
@@ -115,9 +112,7 @@ public class HandlerManage {
.singleResult();
// 获取当前流程实例类型
String instanceId = newInstance.getId();
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getInstCode, instanceId)
.last(BizConst.LIMIT_1));
ProjectInst projectInst = projectInstService.getByInstCode(instanceId);
Integer instType = projectInst.getInstType();
InstTypeEnum instTypeEnum = InstTypeEnum.getByCode(instType);
if (Objects.isNull(instTypeEnum)) {
@@ -125,30 +120,24 @@ public class HandlerManage {
}

// 获取流程通过后当前流程详情
ProcessProgressVo newInstanceDetail = processInstanceService.getProgressInstanceDetail(null, instance.getId());
ProcessProgressVo newInstDetail = processInstanceService.getProgressInstanceDetail(null, instance.getId());
// 获取流程通过后当前审核人信息,向其发送工作通知
// 会签/或签会有多个审核人
List<String> currentEmployeeCodeList = Lists.newArrayList();
List<ProgressNode> newProgressInfo = newInstanceDetail.getProgressInfo();
ProgressNode currentNode = newProgressInfo.get(newProgressInfo.size() - 1);
Set<String> currUserIdList = Sets.newHashSet();
List<ProgressNode> newProgressInfo = newInstDetail.getProgressInfo();
ProgressNode currNode = newProgressInfo.get(newProgressInfo.size() - 1);

// 说明当前节点是子流程节点
if (currentNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())) {
List<ProgressNode> children = currentNode.getChildren();
if (currNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())) {
List<ProgressNode> children = currNode.getChildren();
// 获取子流程当前审核人节点
ProgressNode subCurrentNode = CollUtil.isEmpty(children) ? new ProgressNode() : children.get(children.size() - 1);
ProgressNode subCurrNode = CollUtil.isEmpty(children) ? new ProgressNode() : children.get(children.size() - 1);
// 获取节点ID相同地审核节点
List<ProgressNode> nodeList = children.stream()
.filter(c -> subCurrentNode.getNodeId().equals(c.getNodeId()))
.collect(Collectors.toList());
List<String> userIdList = nodeList.stream().map(ProgressNode::getUserId).collect(Collectors.toList());
currentEmployeeCodeList.addAll(userIdList);
children.stream().filter(c -> subCurrNode.getNodeId().equals(c.getNodeId()))
.forEach(c -> currUserIdList.add(c.getUserId()));
} else {
List<ProgressNode> nodeList = newProgressInfo.stream()
.filter(c -> currentNode.getNodeId().equals(c.getNodeId()))
.collect(Collectors.toList());
List<String> userIdList = nodeList.stream().map(ProgressNode::getUserId).collect(Collectors.toList());
currentEmployeeCodeList.addAll(userIdList);
newProgressInfo.stream().filter(c -> currNode.getNodeId().equals(c.getNodeId()))
.forEach(w -> currUserIdList.add(w.getUserId()));
}

// 流程通过后,判断当前登录用户是不是最后一个审核人
@@ -160,54 +149,56 @@ public class HandlerManage {
switch (instTypeEnum) {
case APPLY_DELAY:
// 保存延期申请记录,更新项目建设周期和计划验收时间
updateProjectDelayApplyInfo(declaredProject, instanceId);
updateProjectDelayApplyInfo(project, instanceId);
break;
case APPLY_BORROW:
// 更新申请借阅状态为成功
updateProjectApplyBorrowInfo(declaredProject, instanceId);
updateProjectApplyBorrowInfo(project, instanceId);
break;
default:
throw new BizException("传入实例类型错误: " + instTypeEnum);
}
} else {
switch (Objects.requireNonNull(ProjectStatusEnum.match(declaredProject.getStatus()))) {
switch (Objects.requireNonNull(ProjectStatusEnum.match(project.getStatus()))) {
// 当前项目状态是预审中
case PRE_APPLYING:
//先修改项目状态
updatePassProjectStatus(userId, declaredProject);
updatePassProjectStatus(userId, project);
//然后入库暂存库
projectStagingService.addByProject(declaredProject, "暂存入库 待提交部门联审");
projectStagingService.addByProject(project, "暂存入库 待提交部门联审");
break;
// 当前项目状态是部门联审中
case DEPARTMENT_JOINT_REVIEW:
case UNDER_INTERNAL_AUDIT:
// 当前项目状态是方案评审中
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW:
updatePassProjectStatus(userId, declaredProject);
updatePassProjectStatus(userId, project);
break;
case SCHEME_UNDER_REVIEW:
// 当前项目状态是终验审核中
updatePassProjectStatus(userId, declaredProject);
updatePassProjectStatus(userId, project);
// 判断是否 保存建设建议信息
saveContructionSuggestionInfo(instance.getId(), declaredProject);
saveConstructionSuggestInfo(instance.getId(), project);
break;
default:
throw new BizException("传入项目状态错误: " + declaredProject.getStatus());
throw new BizException("传入项目状态错误: " + project.getStatus());
}
}
//发送消息
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(), PASS_MSG_TEMPLATE2, MsgTypeEnum.PROJECT_REVIEW_PASS);
noticeManage.sendNotice(Long.parseLong(instance.getStartUserId()), project,
instance.getProcessDefinitionName(), PASS_MSG_TEMPLATE2, MsgTypeEnum.PROJECT_REVIEW_PASS);
} else {
// 若有下一个审核人(当前节点的用户),会签/或签会有多个
// 向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。
// 获取发送浙政钉工作通知必要信息
for (String currentEmployeeCode : currentEmployeeCodeList) {
if (Objects.isNull(currentEmployeeCode)) {
throw new BizException("审核人信息不存在!");
for (String currUserId : currUserIdList) {
if (!NumberUtil.isNumber(currUserId)) {
log.warn("审核人信息不存在:{}", currUserId);
} else {
//发送消息
noticeManage.sendNotice(Long.parseLong(currUserId), project, instance.getProcessDefinitionName(),
PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
}
//发送消息
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(),
PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW);
}
}
}
@@ -215,30 +206,29 @@ public class HandlerManage {
/**
* 去保存 建设建议信息
*
* @param instanceId
* @param project
* @param instanceId \
* @param project \
*/
private void saveContructionSuggestionInfo(String instanceId, Project project) {
ProjectConstructionSuggestions pcs = constrctionSuggestionsService.getOne(Wrappers.lambdaQuery(ProjectConstructionSuggestions.class)
private void saveConstructionSuggestInfo(String instanceId, Project project) {
Wrapper<ProjectConstructionSuggestions> query = Wrappers.lambdaQuery(ProjectConstructionSuggestions.class)
.eq(ProjectConstructionSuggestions::getProjectCode, project.getProjectCode())
.eq(ProjectConstructionSuggestions::getInstanceId, instanceId)
.last(BizConst.LIMIT_1));
if (Objects.isNull(pcs)) {
log.info("没有该流程的 建设 建议信息");
return;
.last(BizConst.LIMIT_1);
ProjectConstructionSuggestions pcs = constrctionSuggestionsService.getOne(query);
if (Objects.nonNull(pcs)) {
project.setProposeTotalInvest(pcs.getProposeTotalInvest());
project.setProposeAnnualBudget(pcs.getProposeAnnualBudget());
project.setProposeAttachFiles(pcs.getProposeAttachFiles());
projectService.updateById(project);
}

project.setProposeTotalInvest(pcs.getProposeTotalInvest());
project.setProposeAnnualBudget(pcs.getProposeAnnualBudget());
project.setProposeAttachFiles(pcs.getProposeAttachFiles());
projectService.updateById(project);
}

public void updateProjectApplyBorrowInfo(Project declaredProject, String instanceId) {
public void updateProjectApplyBorrowInfo(Project project, String instanceId) {
// 获取申请借阅信息
ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class)
.eq(ProjectApplyBorrow::getProjectId, declaredProject.getId())
.eq(ProjectApplyBorrow::getInstanceId, instanceId));
Wrapper<ProjectApplyBorrow> query = Wrappers.lambdaQuery(ProjectApplyBorrow.class)
.eq(ProjectApplyBorrow::getProjectId, project.getId())
.eq(ProjectApplyBorrow::getInstanceId, instanceId);
ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(query);
// 更新项目借阅信息为成功
projectApplyBorrow.setIsSuccess(Boolean.TRUE);
projectApplyBorrow.setUpdateOn(LocalDateTime.now());
@@ -260,7 +250,7 @@ public class HandlerManage {
// 重新计算建设周期、验收时间
String constructCycle = String.valueOf(Integer.parseInt(buildCycle) + delayApply.getDelayTime());
declaredProject.setBuildCycle(constructCycle);
Long constructMonth = Long.valueOf(constructCycle);
long constructMonth = Long.parseLong(constructCycle);
String acceptTime = NdDateUtils.format(approvalDate.plusMonths(constructMonth), DatePattern.NORM_DATETIME_MINUTE_PATTERN);
LocalDateTime time = LocalDateTime.parse(acceptTime, DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_MINUTE_PATTERN));
declaredProject.setPlanAcceptanceTime(time);
@@ -277,23 +267,22 @@ public class HandlerManage {
/**
* 驳回后 所处理的逻辑
*
* @param declaredProject
* @param instance
* @param project \
* @param instance \
*/
public void afterRejectTodo(Project declaredProject, HistoricProcessInstance instance) {
public void afterRejectTodo(Project project, HistoricProcessInstance instance) {
Long userId = LoginUserUtil.getUserId();
// 获取当前流程实例类型
String instanceId = declaredProject.getInstCode();
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getInstCode, instanceId));
String instanceId = project.getInstCode();
ProjectInst projectInst = projectInstService.getByInstCode(instanceId);
Integer instType = projectInst.getInstType();
// 审批流程不是申请延期和申请借阅,需调用状态机
if (!InstTypeEnum.APPLY_DELAY.getCode().equals(instType) && !InstTypeEnum.APPLY_BORROW.getCode().equals(instType)) {
if (!InstTypeEnum.APPLY_DELAY.eq(instType) && !InstTypeEnum.APPLY_BORROW.eq(instType)) {
// 更新项目状态和流程状态
updateRejectProjectStatus(userId, declaredProject, instType);
updateRejectProjectStatus(userId, project, instType);
}
//发送消息
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(),
noticeManage.sendNotice(userId, project, instance.getProcessDefinitionName(),
REJECT_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_REJECT);
}

@@ -329,20 +318,21 @@ public class HandlerManage {
}

// 保存到草稿箱中
private void saveToDraft(Project declaredProject) {
private void saveToDraft(Project req) {
ProjectDraftSaveDTO draftSaveDto = new ProjectDraftSaveDTO();
ProjectDTO projectInfo = new ProjectDTO();
BeanUtils.copyProperties(declaredProject, projectInfo);
BeanUtils.copyProperties(req, projectInfo);
// 查询出项目关联的应用信息
List<ProjectApplication> applicationList = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, declaredProject.getId()));
List<ProjectApplicationDTO> applicationDTOList = applicationList.stream().map(a -> {
List<ProjectApplication> applications = projectApplicationService.listByProjectId(req.getId());
List<ProjectApplicationDTO> applicationDTOList = applications.stream().map(a -> {
ProjectApplicationDTO applicationDTO = new ProjectApplicationDTO();
BeanUtils.copyProperties(a, applicationDTO);
return applicationDTO;
}).collect(Collectors.toList());
projectInfo.setApplicationList(applicationDTOList);
HashMap<String, Object> dynamicMap = JSON.parseObject(declaredProject.getDynamicForm(), HashMap.class);
Map<String, Object> dynamicMap = JSON.parseObject(req.getDynamicForm(),
new TypeReference<Map<String, Object>>() {
});
projectInfo.setDynamicForm(dynamicMap);
draftSaveDto.setProjectInfo(projectInfo);
declaredProjectManage.saveToDraft(draftSaveDto);
@@ -351,45 +341,45 @@ public class HandlerManage {
/**
* 删除项目的所有信息
*
* @param declaredProject
* @param project \
*/
public void deleteProjectRelated(Project declaredProject) {
private void deleteProjectRelated(Project project) {
//删除项目库中该项目信息
projectService.removeById(declaredProject);
projectService.removeById(project);
//删除app信息
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, declaredProject.getId()));
.eq(ProjectApplication::getProjectId, project.getId()));
}

/**
* 退回审核后 所处理的逻辑
*
* @param declaredProject
* @param instance
* @param project \
* @param instance \
*/
public void afterBackTodo(Project declaredProject, HistoricProcessInstance instance) {
public void afterBackTodo(Project project, HistoricProcessInstance instance) {
Long userId = LoginUserUtil.getUserId();
// 获取当前流程实例类型
String instanceId = declaredProject.getInstCode();
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getInstCode, instanceId));
String instCode = project.getInstCode();
ProjectInst projectInst = projectInstService.getByInstCode(instCode);
Integer instType = projectInst.getInstType();
LambdaUpdateWrapper<Project> updateWrapper = Wrappers.lambdaUpdate();
// 如果是预审审批或建设方案退回,需要重新盖章,原来盖过章的文件要清空
if (InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType)) {
if (InstTypeEnum.PRELIMINARY_PREVIEW.eq(instType)) {
updateWrapper.set(Project::getPretrialFileId, null)
.set(Project::getPretrialFileName, null)
.eq(Project::getId, declaredProject.getId());
.eq(Project::getId, project.getId());
projectService.update(updateWrapper);
} else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)) {
} else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.eq(instType)) {
updateWrapper.set(Project::getConstructFileId, null)
.set(Project::getConstructFileName, null)
.eq(Project::getId, declaredProject.getId());
.eq(Project::getId, project.getId());
projectService.update(updateWrapper);
}
// 给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被退回,请及时处理。
//发送消息
noticeManage.sendNotice(userId, declaredProject, instance.getProcessDefinitionName(), BACK_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_BACK);
noticeManage.sendNotice(userId, project, instance.getProcessDefinitionName(),
BACK_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_BACK);
}


@@ -452,7 +442,6 @@ public class HandlerManage {
* @author CMM
* @since 2023/02/08
*/
@Transactional(rollbackFor = Exception.class)
public void updateWithdrawProjectStatus(Long userId, Project project) {
// 删除关联表信息
projectInstService.remove(Wrappers.lambdaQuery(ProjectInst.class)
@@ -475,17 +464,12 @@ public class HandlerManage {
&& (ProcessHandlerEnum.BACK.equals(ProcessHandlerEnum.getEnumByName(String.valueOf(approve.getValue()))))) {
runtimeService.removeVariable(approve.getProcessInstanceId(), approve.getVariableName());

Comment comment;
Optional<Comment> first = taskService.getProcessInstanceComments(approve.getProcessInstanceId())
.stream()
.filter(c -> c.getTaskId().equals(approve.getVariableName().replace("approve_", StringUtils.EMPTY)))
.findFirst();
if (first.isPresent()) {
comment = first.get();
taskService.deleteComment(comment.getId());
}
first.ifPresent(comment -> taskService.deleteComment(comment.getId()));
break;

}
}
}


+ 18
- 17
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java View File

@@ -40,6 +40,7 @@ import com.hz.pm.api.signature.service.ICompanySignatureService;
import com.hz.pm.api.sys.model.entity.Region;
import com.hz.pm.api.sys.service.IRegionService;
import com.hz.pm.api.todocenter.constant.TodoCenterConst;
import com.hz.pm.api.todocenter.constant.TodoCenterConst.SealTemplate;
import com.hz.pm.api.todocenter.enumeration.IsAppendProjectEnum;
import com.hz.pm.api.todocenter.enumeration.IsOrNotEnum;
import com.hz.pm.api.todocenter.handle.PassHandle;
@@ -56,7 +57,7 @@ import com.hz.pm.api.todocenter.model.vo.*;
import com.hz.pm.api.todocenter.service.ITodoService;
import com.hz.pm.api.todocenter.service.StatisticsService;
import com.hz.pm.api.todocenter.utils.BuildUserUtils;
import com.hz.pm.api.todocenter.utils.PdfUtils;
import com.hz.pm.api.todocenter.utils.PdfUtil;
import com.hz.pm.api.user.security.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
@@ -135,7 +136,6 @@ public class TodoCenterManage {
private final UserInfoHelper userInfoHelper;
private final BuildUserUtils buildUserUtils;
private final IProjectInstService projectInstService;
private final PdfUtils pdfUtils;
private final FileService fileService;
private final ICompanySignatureService companySignatureService;
private final StatisticsService statisticsService;
@@ -327,6 +327,7 @@ public class TodoCenterManage {
* @author CMM
* @since 2023/02/01
*/
@Transactional(rollbackFor = Exception.class)
public String handler(ReqProcessHandlerDTO param) {
// 获取登录用户ID
UserInfoDetails user = LoginUserUtil.loginUserDetail();
@@ -516,12 +517,12 @@ public class TodoCenterManage {
FileResultVO resultVo = fileService.upload(multipartFile, "default");
// 将返回的文件ID更新到项目库中对应的项目下
// 根据模版名称判断是预审申请单还是建设方案申请单
if (TodoCenterConst.SealTemplate.CITY_TEMPLATE.equals(templateName) ||
TodoCenterConst.SealTemplate.COUNTRY_TEMPLATE.equals(templateName)) {
if (SealTemplate.CITY_TEMPLATE.equals(templateName) ||
SealTemplate.COUNTRY_TEMPLATE.equals(templateName)) {
//放到项目申报书字段
declaredProject.setProjectApplicationForm(BizUtils.buildFileJson(resultVo));
declaredProject.setUpdateOn(LocalDateTime.now());
} else if (TodoCenterConst.SealTemplate.CONSTRUCT_TEMPLATE.equals(templateName)) {
} else if (SealTemplate.CONSTRUCT_TEMPLATE.equals(templateName)) {
declaredProject.setConstructFileId(resultVo.getId());
declaredProject.setConstructFileName(resultVo.getOriginalFileName());
declaredProject.setUpdateOn(LocalDateTime.now());
@@ -1204,7 +1205,7 @@ public class TodoCenterManage {
if (Boolean.TRUE.equals(getCityNotSealedInfoVO(pretrialFileId, notSealedInfoVo))) {
return notSealedInfoVo;
}
String cityTemplateName = TodoCenterConst.SealTemplate.CITY_TEMPLATE;
String cityTemplateName = SealTemplate.CITY_TEMPLATE;
// 设置pdf模板参数
JSONObject cityParamsMap = assemblyPdfParams(project, cityTemplateName);
// 盖章审核为主管单位审核
@@ -1228,7 +1229,7 @@ public class TodoCenterManage {
return notSealedInfoVo;
}
// 设置pdf模板参数
String constructTemplateName = TodoCenterConst.SealTemplate.CONSTRUCT_TEMPLATE;
String constructTemplateName = SealTemplate.CONSTRUCT_TEMPLATE;
JSONObject constructParamsMap = assemblyPdfParams(project, constructTemplateName);
// 审核为指定大数据局盖章
// 获取流程配置的指定单位信息
@@ -1276,10 +1277,10 @@ public class TodoCenterManage {
} else {
fileName = templateName;
}
InputStream htmlInputStream =
this.getClass().getClassLoader().getResourceAsStream("template" + java.io.File.separator + templateName + ".html");
InputStream htmlInputStream = this.getClass().getClassLoader()
.getResourceAsStream("template" + java.io.File.separator + templateName + ".html");
// 生成pdf字节数组
byte[] pdf = pdfUtils.generatePdf(htmlInputStream, paramsMap);
byte[] pdf = PdfUtil.generatePdf(htmlInputStream, paramsMap);

// 转换成MultipartFile
MultipartFile multipartFile = new MockMultipartFile("file", fileName + ".pdf", "application/pdf", pdf);
@@ -1293,12 +1294,12 @@ public class TodoCenterManage {
String superOrgOpinion = paramsMap.getString("superOrgOpinion");
String higherOrgOpinion = paramsMap.getString("higherOrgOpinion");
if (StringUtils.isNotBlank(superOrgOpinion) || StringUtils.isNotBlank(higherOrgOpinion)) {
if (TodoCenterConst.SealTemplate.CITY_TEMPLATE.equals(templateName) ||
TodoCenterConst.SealTemplate.COUNTRY_TEMPLATE.equals(templateName)) {
if (SealTemplate.CITY_TEMPLATE.equals(templateName) ||
SealTemplate.COUNTRY_TEMPLATE.equals(templateName)) {
//放到项目申报书字段
declaredProject.setProjectApplicationForm(BizUtils.buildFileJson(resultVo));
declaredProject.setUpdateOn(LocalDateTime.now());
} else if (TodoCenterConst.SealTemplate.CONSTRUCT_TEMPLATE.equals(templateName)) {
} else if (SealTemplate.CONSTRUCT_TEMPLATE.equals(templateName)) {
declaredProject.setConstructFileId(resultVo.getId());
declaredProject.setConstructFileName(resultVo.getOriginalFileName());
declaredProject.setUpdateOn(LocalDateTime.now());
@@ -1357,7 +1358,7 @@ public class TodoCenterManage {
.eq(ProjectInst::getInstType, InstTypeEnum.PRELIMINARY_PREVIEW.getCode())
.orderByDesc(ProjectInst::getCreatOn)
.last("limit 1"));
LocalDateTime time = null;
LocalDateTime time;
if (Objects.nonNull(projectInst)) {
time = projectInst.getCreatOn();
paramsMap.put("time", NdDateUtils.format(time, "yyyy-MM-dd HH:mm"));
@@ -1476,11 +1477,11 @@ public class TodoCenterManage {
switch (regionLevel) {
// 市级预审(市本级)
case RegionConst.RL_CITY:
String cityTemplateName = TodoCenterConst.SealTemplate.CITY_TEMPLATE;
String cityTemplateName = SealTemplate.CITY_TEMPLATE;
return generateSealedPdf(req, declaredProject, cityTemplateName, notSealedFileId);
// 区县预审
case RegionConst.RL_COUNTY:
String countryTemplateName = TodoCenterConst.SealTemplate.COUNTRY_TEMPLATE;
String countryTemplateName = SealTemplate.COUNTRY_TEMPLATE;
return generateSealedPdf(req, declaredProject, countryTemplateName, notSealedFileId);
default:
throw new IllegalStateException("Unexpected value: " + regionLevel);
@@ -1489,7 +1490,7 @@ public class TodoCenterManage {
// 如果为建设方案申报审批
else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)) {
// 设置pdf模板参数
String constructTemplateName = TodoCenterConst.SealTemplate.CONSTRUCT_TEMPLATE;
String constructTemplateName = SealTemplate.CONSTRUCT_TEMPLATE;
return generateSealedPdf(req, declaredProject, constructTemplateName, notSealedFileId);
}
return null;


+ 119
- 0
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/utils/PdfUtil.java View File

@@ -0,0 +1,119 @@
package com.hz.pm.api.todocenter.utils;


import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.BaseFont;
import com.ningdatech.basic.exception.BizException;
import lombok.extern.slf4j.Slf4j;
import org.xhtmlrenderer.pdf.ITextFontResolver;
import org.xhtmlrenderer.pdf.ITextRenderer;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;

/**
* pdf生成工具类
*
* @author CMM
* @since 2023/03/13 17:01
*/
@Slf4j
public class PdfUtil {

private PdfUtil() {
}

/**
* 生成PDF文件
*
* @return int
* @author CMM
* @since 2023/03/13 17:07
*/
public static byte[] generatePdf(InputStream templateHtmlInputStream, Map<String, Object> paramsMap) {
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(templateHtmlInputStream, StandardCharsets.UTF_8))) {
// 字体格式
String fontPath = "font" + File.separator + "simsun.ttc";
StringBuilder stringBuilder = new StringBuilder();
bufferedReader.lines().forEach(stringBuilder::append);
String htmlInfo = stringBuilder.toString();

// 替换参数、多个参数多次替换
for (Map.Entry<String, Object> entry : paramsMap.entrySet()) {
String value = Optional.ofNullable(entry.getValue())
.map(Object::toString)
.orElse("");
htmlInfo = htmlInfo.replace("#" + entry.getKey() + "#", value);
}

// 生成临时文件
String htmlFileName = UUID.randomUUID().toString().replace("-", "") + ".html";
String htmlFilePath = "fileout" + File.separator + htmlFileName;
File file = new File(htmlFilePath);
try (FileOutputStream fop = new FileOutputStream(file)) {
byte[] contentInBytes = htmlInfo.getBytes();
fop.write(contentInBytes);
} catch (IOException e) {
throw BizException.wrap("生成html文件失败!" + e.getMessage());
}

// 生成pdf
String pdfFileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
String pdfFilePath = "fileout" + File.separator + pdfFileName;
String url = new File(htmlFilePath).toURI().toURL().toString();
try (OutputStream os = Files.newOutputStream(Paths.get(pdfFilePath))) {
ITextRenderer renderer = new ITextRenderer();
renderer.setDocument(url);
ITextFontResolver fontResolver = renderer.getFontResolver();
fontResolver.addFont(fontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
renderer.layout();
renderer.createPDF(os);
} catch (IOException | DocumentException e) {
throw BizException.wrap("生成pdf文件失败!" + e.getMessage());
}

// 返回生成的pdf文件字节数组
try (FileInputStream inputStream = new FileInputStream(pdfFilePath)) {
return readBytes(inputStream);
} catch (IOException e) {
throw BizException.wrap("读取pdf文件失败!" + e.getMessage());
}
} catch (IOException e) {
throw BizException.wrap("读取模板html文件失败!" + e.getMessage());
}
}


/**
* 读取输入流到字节数组
*
* @param in
* @return
* @throws IOException
*/
private static byte[] readBytes(InputStream in) throws IOException {
//读取字节的缓冲
byte[] buffer = new byte[1024];
//最终的数据
byte[] result = new byte[0];
int size;
while ((size = in.read(buffer)) != -1) {
int oldLen = result.length;
byte[] tmp = new byte[oldLen + size];
if (oldLen > 0) {
//copy 旧字节
System.arraycopy(result, 0, tmp, 0, oldLen);
}
//copy 新字节
System.arraycopy(buffer, 0, tmp, oldLen, size);
result = tmp;
}
return result;
}

}

+ 0
- 134
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/utils/PdfUtils.java View File

@@ -1,134 +0,0 @@
package com.hz.pm.api.todocenter.utils;


import cn.hutool.core.io.IoUtil;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.BaseFont;
import com.ningdatech.basic.exception.BizException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.xhtmlrenderer.pdf.ITextFontResolver;
import org.xhtmlrenderer.pdf.ITextRenderer;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;
import java.util.UUID;

/**
* pdf生成工具类
*
* @author CMM
* @since 2023/03/13 17:01
*/
@Slf4j
@Component
public class PdfUtils {
/**
* 生成PDF文件
*
* @return int
* @author CMM
* @since 2023/03/13 17:07
*/
public byte[] generatePdf(InputStream templateHtmlInputStream, Map<String, Object> paramsMap) {
FileInputStream inputStream = null;

try (InputStreamReader isr = new InputStreamReader(templateHtmlInputStream, StandardCharsets.UTF_8);
BufferedReader bufferedReader = new BufferedReader(isr)) {
File directory = new File("");
// 临时文件输出路径
String filePath = directory.getAbsolutePath() + File.separator + "fileout";
//字体格式
String fontPath = directory.getAbsolutePath() + File.separator + "font" + File.separator + "simsun.ttc";
if (!new File(filePath).exists()) {
new File(filePath).mkdir();
}
StringBuilder stringBuilder = new StringBuilder();
String line;
while ((line = bufferedReader.readLine()) != null) {
stringBuilder.append(line);
}
String htmlInfo = stringBuilder.toString();

//替换参数、多个参数多次替换
for (String fieldName : paramsMap.keySet()) {
if (paramsMap.get(fieldName) == null) {
// 没有值的字段使用-覆盖
htmlInfo = htmlInfo.replace("#" + fieldName + "#", "");
} else {
// 设置占位字段
htmlInfo = htmlInfo.replace("#" + fieldName + "#", paramsMap.get(fieldName).toString());
}
}

//生成临时文件
String htmlFileName = UUID.randomUUID().toString().replace("-", "") + ".html";
String htmlFilePath = filePath + File.separator + htmlFileName;
File file = new File(htmlFilePath);
FileOutputStream fop = new FileOutputStream(file);
if (!file.exists()) {
file.createNewFile();
}
byte[] contentInBytes = htmlInfo.getBytes();
fop.write(contentInBytes);
fop.flush();
fop.close();

//生成pdf
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
String pdfFilePath = filePath + File.separator + fileName;
String url = new File(htmlFilePath).toURI().toURL().toString();
OutputStream os = Files.newOutputStream(Paths.get(pdfFilePath));

ITextRenderer renderer = new ITextRenderer();
renderer.setDocument(url);
ITextFontResolver fontResolver = renderer.getFontResolver();
fontResolver.addFont(fontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
renderer.layout();
renderer.createPDF(os);
os.flush();
os.close();

inputStream = new FileInputStream(pdfFilePath);

// 返回生成的pdf文件字节数组
return readBytes(inputStream);
} catch (IOException | DocumentException e) {
throw BizException.wrap("生成pdf文件失败!" + e.getMessage());
} finally {
IoUtil.close(inputStream);
}
}


/**
* 读取输入流到字节数组
*
* @param in
* @return
* @throws IOException
*/
private byte[] readBytes(InputStream in) throws IOException {
//读取字节的缓冲
byte[] buffer = new byte[1024];
//最终的数据
byte[] result = new byte[0];
int size = 0;
while ((size = in.read(buffer)) != -1) {
int oldLen = result.length;
byte[] tmp = new byte[oldLen + size];
if (oldLen > 0) {//copy 旧字节
System.arraycopy(result, 0, tmp, 0, oldLen);
}
//copy 新字节
System.arraycopy(buffer, 0, tmp, oldLen, size);

result = tmp;
}
return result;
}

}

+ 3
- 3
hz-pm-api/src/test/java/com/hz/pm/api/todocenter/TodoCenterTest.java View File

@@ -17,7 +17,7 @@ import com.hz.pm.api.sys.manage.NoticeManage;
import com.hz.pm.api.todocenter.bean.entity.WorkNoticeInfo;
import com.hz.pm.api.todocenter.manage.TodoCenterManage;
import com.hz.pm.api.todocenter.model.dto.PdfGenerateDTO;
import com.hz.pm.api.todocenter.utils.PdfUtils;
import com.hz.pm.api.todocenter.utils.PdfUtil;
import com.hz.pm.api.user.service.IUserInfoService;
import com.ningdatech.zwdd.client.ZwddClient;
import com.wflow.contants.ProcessConstant;
@@ -63,7 +63,7 @@ public class TodoCenterTest extends AppTests {
@Autowired
private IProjectService projectService;
@Autowired
private PdfUtils pdfUtils;
private PdfUtil pdfUtil;

@Autowired
private TaskService taskService;
@@ -169,7 +169,7 @@ public class TodoCenterTest extends AppTests {
paramsMap.put("bigDataBureauName",null);

// 生成pdf字节数组
byte[] pdf = pdfUtils.generatePdf(htmlInputStream, paramsMap);
byte[] pdf = pdfUtil.generatePdf(htmlInputStream, paramsMap);

// 转换成MultipartFile
MultipartFile multipartFile = new MockMultipartFile("file", fileName + ".pdf", "application/pdf", pdf);


+ 0
- 198
hz-pm-sync/pom.xml View File

@@ -1,198 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>hz-project-management</artifactId>
<groupId>com.hz.pm</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>hz-pm-sync</artifactId>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.5</version>
</dependency>
<!-- mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- mybatis plus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!--实现springboot的热加载-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-swagger2-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-basic</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<artifactId>spring-boot-starter-security</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
<exclusion>
<artifactId>spring-security-config</artifactId>
<groupId>org.springframework.security</groupId>
</exclusion>
<exclusion>
<artifactId>spring-security-web</artifactId>
<groupId>org.springframework.security</groupId>
</exclusion>
<exclusion>
<artifactId>spring-security-core</artifactId>
<groupId>org.springframework.security</groupId>
</exclusion>
<exclusion>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
</dependencies>

<!-- 打包 -->
<!--配置环境的profile-->
<profiles>
<profile>
<id>dev</id>
<properties>
<!--使用${environment}获取值-->
<environment>dev</environment>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<environment>test</environment>
</properties>
</profile>
<profile>
<id>pre</id>
<properties>
<environment>pre</environment>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<environment>prod</environment>
</properties>
</profile>
</profiles>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<targetPath>BOOT-INF/classes/</targetPath>
</resource>
</resources>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.8</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

+ 0
- 33
hz-pm-sync/src/main/java/com/hz/pm/sync/SynDataTaskApp.java View File

@@ -1,33 +0,0 @@
package com.hz.pm.sync;


import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
* <p>
* SynDataTaskApp
* </p>
*
* @author WendyYang
* @since 10:44 2023/12/12
*/
@SpringBootApplication
@EnableAsync
@MapperScan(SynDataTaskApp.MAPPER_PACKAGES)
@EnableScheduling
@EnableTransactionManagement
@EnableAspectJAutoProxy(exposeProxy = true)
public class SynDataTaskApp {

protected static final String MAPPER_PACKAGES = "com.hz.pm.sync.**.mapper";

public static void main(String[] args) {
SpringApplication.run(SynDataTaskApp.class, args);
}
}

+ 0
- 106
hz-pm-sync/src/main/java/com/hz/pm/sync/common/constant/BizConst.java View File

@@ -1,106 +0,0 @@
package com.hz.pm.sync.common.constant;

import com.ningdatech.basic.model.ApiResponse;

import java.math.BigDecimal;

/**
* <p>
* 业务常量
* </p>
*
* @author WendyYang
* @since 13:42 2022/12/1
*/
public interface BizConst {

/**
* SQL查询一条
*/
String LIMIT_1 = "limit 1";

String COOKIE_KEY = "ND_PROJECT_MANAGEMENT_JSESSION";

/**
* 一小时秒数
**/
BigDecimal SECONDS_BY_HOUR = new BigDecimal(60 * 60);

/**
* 十分钟的毫秒数
*/
long MILLS_10_MIN = 1000L * 60 * 10;

/**
* 中国行政区划编码
*/
long ROOT_REGION_CODE = 100000L;

/**
* 一级行政区划数量
*/
int NUM_PROVINCE = 34;

/**
* 默认的父id
*/
long PARENT_ID = 0L;

/**
* 默认树层级
*/
int TREE_GRADE = 0;

/**
* 默认的排序
*/
int SORT_VALUE = 0;

/**
* 浙江省的region_id
*/
long ZJ_REGION_CODE = 330000L;
String NINE_AREA_CODE_LAST = "000";

/**
* 省/直辖市 level
*/
int GOV_L1 = 1;

/**
* 市 level
*/
int GOV_L2 = 2;

/**
* 区/县 level
*/
int GOV_L3 = 3;

/**
* 密码正则:长度8-20位且至少包含大写字母、小写字母、数字或特殊符号中的任意三种
*/
String REGEX_PASS = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_]+$)(?![a-z0-9]+$)(?![a-z\\W_]+$)(?![0-9\\W_]+$)[a-zA-Z0-9\\W_]{8,20}$";

ApiResponse<Void> UNAUTHENTICATED = ApiResponse.of(401, "用户未登录", null);

int MAX_EXPORT_COUNT = 5000;

String RESPONSE_KEY_DATA = "data";
String ORG_NAME = "organizationName";
String ORG_CODE = "organizationCode";

String DEV = "dev";
String PRE = "pre";
String PROD = "prod";

String SAVE_SUCCESS = "保存成功";
String OP_SUCCESS = "操作成功";
String SAVE_FAIL = "保存失败";
String NOT_EFFECTIVE = "1";

String OP_INSERT = "insert";
String OP_UPDATE = "update";
String OP_DELETE = "delete";
String OP_FAIL = "操作失败";
}

+ 0
- 85
hz-pm-sync/src/main/java/com/hz/pm/sync/common/utils/CryptUtils.java View File

@@ -1,85 +0,0 @@
package com.hz.pm.sync.common.utils;
import org.apache.commons.codec.binary.Hex;

import javax.crypto.Mac;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
* 加密工具
* @author hank
*/
public class CryptUtils {
/**
* 默认的算法
*/
private static final String DE_KEY_MAC = "HmacMD5";
/**
* 默认的字符集
*/
private static final Charset DE_CHARSET = StandardCharsets.UTF_8;
/**
* 使用默认的算法(HmacMD5) 得到hmac 16进制字符串
* @param inputStr 需要加密的串
* @param key key
* @return 16进制字符串
* @throws Exception
*/
public static String encryptHMAC(String inputStr, String key) throws Exception {
return encryptHMAC(inputStr, key, DE_KEY_MAC);
}
/**
* 使用指定的算法得到hmac 16进制字符串
* @param inputStr 需要加密的串
* @param key key
* @param keyMac hmac算法
* @return 16进制字符串
* @throws Exception
*/
public static String encryptHMAC(String inputStr, String key, String keyMac) throws Exception {
return Hex.encodeHexString(encryptHMAC(inputStr.getBytes(DE_CHARSET), key, keyMac));
}
public static String MD5Encode(String origin) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("MD5");
return Hex.encodeHexString(md.digest(origin.getBytes(DE_CHARSET)));
}
private static byte[] encryptHMAC(byte[] data, String key, String keyMac) throws Exception {
SecretKey secretKey = new SecretKeySpec(key.getBytes(DE_CHARSET), keyMac);
Mac mac = Mac.getInstance(secretKey.getAlgorithm());
mac.init(secretKey);
return mac.doFinal(data);
}

/**
* 生成HMAC-MD5值
* @param data 消息数据
* @param key 密钥
* @return HMAC-MD5值
* @throws NoSuchAlgorithmException
* @throws InvalidKeyException
*/
public static byte[] hmacMd5(byte[] data, byte[] key)
throws NoSuchAlgorithmException, InvalidKeyException {
SecretKeySpec signingKey = new SecretKeySpec(key, "HmacMD5");
Mac mac = Mac.getInstance("HmacMD5");
mac.init(signingKey);
return mac.doFinal(data);
}
public static void main(String[] args) throws Exception{
System.out.println("HMACStr:\n" + encryptHMAC("a", "hank"));
}
}

+ 0
- 55
hz-pm-sync/src/main/java/com/hz/pm/sync/open/controller/ProjectReceiveController.java View File

@@ -1,55 +0,0 @@
package com.hz.pm.sync.open.controller;

import com.hz.pm.sync.open.manage.IrsManage;
import com.hz.pm.sync.open.manage.ProjectReceiveManage;
import com.hz.pm.sync.scheduler.model.dto.ForwardDTO;
import com.hz.pm.sync.scheduler.model.dto.ProjectBaseInfoDTO;
import com.hz.pm.sync.scheduler.model.dto.ProjectSaveDTO;
import com.ningdatech.basic.model.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
* @Classname ProjectCollectionController
* @Description
* @Date 2023/6/25 9:11
* @Author PoffyZhang
*/
@RestController
@RequiredArgsConstructor
@Api(tags = "项目归集控制器")
@RequestMapping("/open/api/v1/project-receive")
public class ProjectReceiveController {

private final ProjectReceiveManage receiveManage;

private final IrsManage irsManage;

@PostMapping("/save")
@ApiOperation("项目归集接收")
public ApiResponse<String> save(@Valid @RequestBody ProjectSaveDTO dto) {
return ApiResponse.ofSuccess(receiveManage.save(dto));
}

@PostMapping("/not-effective")
@ApiOperation("项目归集置为无效")
public ApiResponse<String> notEffective(@Valid @RequestBody ProjectBaseInfoDTO baseinfo) {
return ApiResponse.ofSuccess(receiveManage.notEffective(baseinfo));
}

@PostMapping("/delete-all")
@ApiOperation("清空当前表数据")
public ApiResponse<String> deleteAll() {
return ApiResponse.ofSuccess(receiveManage.deleteAll());
}

@ApiOperation(value = "转发IRS请求", notes = "转发IRS请求 用于")
@PostMapping("/forward")
public String forward(@Valid @RequestBody ForwardDTO dto) {
return irsManage.forward(dto);
}
}

+ 0
- 59
hz-pm-sync/src/main/java/com/hz/pm/sync/open/enumeration/GovProjectStatusEnum.java View File

@@ -1,59 +0,0 @@
package com.hz.pm.sync.open.enumeration;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

/**
* GovProjectStatusEnum
*
* @return
* @author ZPF
* @since 2023/10/24 16:27
*/
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum GovProjectStatusEnum {
/**
* 项目归集 状态
*/
APPROVAL("01", "评审中"),
PENDING("02", "待立项"),
REJECTED("03","已驳回"),
APPROVED("04","已立项"),
PURCHASED("05","已采购"),
HAS_PRE_INS("06","已初验"),
HAS_FINAL_INS("07","已终验"),
TERMINATED("00","已终止");

private String code;
private String desc;

public static String getDescByCode(Integer code) {
if (Objects.isNull(code)) {
return StringUtils.EMPTY;
}
for (GovProjectStatusEnum t : GovProjectStatusEnum.values()) {
if (code.equals(t.getCode())) {
return t.desc;
}
}
return StringUtils.EMPTY;
}

public static GovProjectStatusEnum match(String code) {
if (StringUtils.isBlank(code)) {
return null;
}
for (GovProjectStatusEnum t : GovProjectStatusEnum.values()) {
if (code.equals(t.getCode())) {
return t;
}
}
return null;
}
}

+ 0
- 56
hz-pm-sync/src/main/java/com/hz/pm/sync/open/manage/IrsManage.java View File

@@ -1,56 +0,0 @@
package com.hz.pm.sync.open.manage;

import com.google.common.base.Joiner;
import com.hz.pm.sync.scheduler.model.dto.ForwardDTO;
import com.hz.pm.sync.common.constant.BizConst;
import com.hz.pm.sync.common.utils.CryptUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import java.util.Map;

/**
* @Classname IrsManage
* @Description
* @Date 2023/9/1 15:15
* @Author PoffyZhang
*/
@Component
@Slf4j
public class IrsManage {


/**
* 转发IRS请求
* @param dto
* @return
*/
public String forward(ForwardDTO dto) {
try{
String url = dto.getUrl();
String appkey = dto.getAppKey();
long timestamp = System.currentTimeMillis();
String requestSecret = dto.getSecret();
String sign = CryptUtils.MD5Encode(appkey + requestSecret + timestamp);
url = url + "?requestTime=" + timestamp + "&sign=" + sign + "&" + asUrlParams(dto.getData());
log.info("url :{}",url);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
log.info(forEntity.getBody());
return forEntity.getBody();
}catch (Exception e){
log.error("e:" + e);
}
return BizConst.OP_FAIL;
}

public static String asUrlParams(Map<String, Object> source){
return Joiner.on("&")
// 用指定符号代替空值,key 或者value 为null都会被替换
.useForNull("")
.withKeyValueSeparator("=")
.join(source);
}
}

+ 0
- 317
hz-pm-sync/src/main/java/com/hz/pm/sync/open/manage/ProjectReceiveManage.java View File

@@ -1,317 +0,0 @@
package com.hz.pm.sync.open.manage;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.sync.scheduler.model.dto.ProjectBaseInfoDTO;
import com.hz.pm.sync.scheduler.model.dto.ProjectSaveDTO;
import com.hz.pm.sync.scheduler.model.entity.*;
import com.hz.pm.sync.scheduler.service.*;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.util.StrPool;
import com.hz.pm.sync.common.constant.BizConst;
import com.hz.pm.sync.open.enumeration.GovProjectStatusEnum;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

/**
* @Classname ProjectReceiveManage
* @Description
* @Date 2023/8/25 9:11
* @Author PoffyZhang
*/
@Component
@RequiredArgsConstructor
@Slf4j
public class ProjectReceiveManage {

private final IProjectBaseInfoService baseInfoService;

private final IProjectApplyService applyService;

private final IProjectApproveService approveService;

private final IProjectCimplementService cimplementService;

private final IProjectMimplementService mimplementService;

private final IProjectProcureService procureService;

/**
* 接收保存 项目
*
* @param dto
* @return
*/
public String save(ProjectSaveDTO dto) {

//1.保存项目基本信息
ProjectBaseInfo baseInfo = dto.getBaseinfo();
String baseProjId = baseInfo.getBaseProjId();
VUtils.isTrue(StringUtils.isBlank(baseProjId))
.throwMessage("项目编号不能为空!");

ProjectBaseInfo oldBaseInfo = baseInfoService.getOne(Wrappers.lambdaQuery(ProjectBaseInfo.class)
.eq(ProjectBaseInfo::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));
ProjectBaseInfo saveBase = BeanUtil.copyProperties(baseInfo, ProjectBaseInfo.class);

//项目状态
String baseProjSetProg = saveBase.getBaseProjSetProg();
if (StringUtils.isBlank(baseProjSetProg)) {
return "无状态不保存";
}
//评审中 基本信息和申报信息
GovProjectStatusEnum match = GovProjectStatusEnum.match(baseProjSetProg);
if (Objects.isNull(match)) {
return "状态不对 不保存";
}
switch (match) {
case APPROVAL:
log.info("评审中状态 保存基本信息和申报信息 :{}", baseProjId);
saveBase(oldBaseInfo, saveBase, baseInfo);
saveApply(dto, baseProjId);
break;
case PENDING:
case APPROVED:
log.info("待立项和已立项状态 保存基本信息,申报信息,评审信息 :{}", baseProjId);
saveBase(oldBaseInfo, saveBase, baseInfo);
saveApply(dto, baseProjId);
saveApprove(dto, baseProjId);
break;
case PURCHASED:
log.info("已采购状态 保存基本信息,申报信息,评审信息,采购信息 :{}", baseProjId);
saveBase(oldBaseInfo, saveBase, baseInfo);
saveApply(dto, baseProjId);
saveApprove(dto, baseProjId);
saveProcure(dto, baseProjId);
break;
case HAS_PRE_INS:
case HAS_FINAL_INS:
case TERMINATED:
log.info("初验 终验状态 终止 保存所有信息 :{}", baseProjId);
saveBase(oldBaseInfo, saveBase, baseInfo);
saveApply(dto, baseProjId);
saveApprove(dto, baseProjId);
saveProcure(dto, baseProjId);
saveCimplementOrMimplement(dto, baseProjId);
break;
case REJECTED:
log.info("驳回终止状态 啥都不保存 :{}", baseProjId);
break;
default:
log.info("没有匹配任何状态 保存失败 :{}", baseProjId);
}

return BizConst.SAVE_SUCCESS;
}

private void saveCimplementOrMimplement(ProjectSaveDTO dto, String baseProjId) {
// 4.保存 建设项目 实施信息
ProjectCimplement cimplement = dto.getCimplement();
if (Objects.nonNull(cimplement)) {
ProjectCimplement oldCimplement = cimplementService.getOne(Wrappers.lambdaQuery(ProjectCimplement.class)
.eq(ProjectCimplement::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));

ProjectCimplement saveCimplement = BeanUtil.copyProperties(cimplement, ProjectCimplement.class);
saveCimplement.setBaseProjId(baseProjId);
if (Objects.isNull(oldCimplement)) {
//如果当前 数据不存在 但是我们平台操作是修改 说明之前数据被推送过了那么 可以置为修改update
if (StringUtils.isNotBlank(cimplement.getOp()) && BizConst.OP_UPDATE.equals(cimplement.getOp())) {
saveCimplement.setOp(BizConst.OP_UPDATE);
} else {
saveCimplement.setOp(BizConst.OP_INSERT);
}
saveCimplement.setTongTime(LocalDateTime.now());
} else {
saveCimplement.setOp(BizConst.OP_INSERT);
saveCimplement.setTongID(oldCimplement.getTongID());
saveCimplement.setTongTime(LocalDateTime.now());
}
saveCimplement.setBizTime(LocalDateTime.now());
cimplementService.saveOrUpdate(saveCimplement);
}

// 5.保存 运维项目 实施信息
ProjectMimplement mimplement = dto.getMimplement();
if (Objects.nonNull(mimplement)) {
ProjectMimplement oldMimplement = mimplementService.getOne(Wrappers.lambdaQuery(ProjectMimplement.class)
.eq(ProjectMimplement::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));

ProjectMimplement saveMimplement = BeanUtil.copyProperties(mimplement, ProjectMimplement.class);
saveMimplement.setBaseProjId(baseProjId);
if (Objects.isNull(oldMimplement)) {
//如果当前 数据不存在 但是我们平台操作是修改 说明之前数据被推送过了那么 可以置为修改update
if (StringUtils.isNotBlank(mimplement.getOp()) && BizConst.OP_UPDATE.equals(mimplement.getOp())) {
saveMimplement.setOp(BizConst.OP_UPDATE);
} else {
saveMimplement.setOp(BizConst.OP_INSERT);
}
saveMimplement.setTongTime(LocalDateTime.now());
} else {
saveMimplement.setOp(BizConst.OP_INSERT);
saveMimplement.setTongID(oldMimplement.getTongID());
saveMimplement.setTongTime(LocalDateTime.now());
}
saveMimplement.setBizTime(LocalDateTime.now());
mimplementService.saveOrUpdate(saveMimplement);
}
}

private void saveProcure(ProjectSaveDTO dto, String baseProjId) {
// 6.保存 采购信息
List<ProjectProcure> procures = dto.getProcures();
if (Objects.nonNull(procures)) {
List<ProjectProcure> olds = procureService.list(Wrappers.lambdaQuery(ProjectProcure.class)
.eq(ProjectProcure::getBaseProjId, baseProjId)
.orderByAsc(ProjectProcure::getBaseBidCode));
int index = 0;
for (ProjectProcure old : olds) {
if (StringUtils.isNotBlank(old.getBaseBidCode())) {
try {
String bidCode = old.getBaseBidCode().split(StrPool.DASH)[1];
index = Integer.parseInt(bidCode);
} catch (Exception e) {
log.error(e.getMessage(),e);
}
}
//删除标记
old.setOp(BizConst.OP_DELETE);
procureService.updateById(old);
}
index++;
for (ProjectProcure procure : procures) {
//添加标记
ProjectProcure saveProcure = BeanUtil.copyProperties(procure, ProjectProcure.class);
saveProcure.setBaseProjId(baseProjId);
saveProcure.setBaseBidCode(baseProjId + StrPool.DASH + String.format(StrPool.FORMAT_DATE_SINGLE_DIGITS, index));
saveProcure.setTongID(null);
saveProcure.setTongTime(LocalDateTime.now());
saveProcure.setBizTime(LocalDateTime.now());
saveProcure.setOp(BizConst.OP_INSERT);
procureService.save(saveProcure);
index++;
}
}
}

private void saveApprove(ProjectSaveDTO dto, String baseProjId) {
// 3.保存 审批信息
ProjectApprove approve = dto.getApprove();

ProjectApprove oldApprove = approveService.getOne(Wrappers.lambdaQuery(ProjectApprove.class)
.eq(ProjectApprove::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));

ProjectApprove saveApprove = BeanUtil.copyProperties(approve, ProjectApprove.class);
saveApprove.setBaseProjId(baseProjId);
if (Objects.isNull(oldApprove)) {
//如果当前 数据不存在 但是我们平台操作是修改 说明之前数据被推送过了那么 可以置为修改update
if (StringUtils.isNotBlank(approve.getOp()) && BizConst.OP_UPDATE.equals(approve.getOp())) {
saveApprove.setOp(BizConst.OP_UPDATE);
} else {
saveApprove.setOp(BizConst.OP_INSERT);
}
saveApprove.setTongTime(LocalDateTime.now());
} else {
saveApprove.setOp(BizConst.OP_INSERT);
saveApprove.setTongID(oldApprove.getTongID());
saveApprove.setTongTime(LocalDateTime.now());
}
saveApprove.setBizTime(LocalDateTime.now());
approveService.saveOrUpdate(saveApprove);
}

private void saveApply(ProjectSaveDTO dto, String baseProjId) {
// 2.保存 申报信息
ProjectApply apply = dto.getApply();

ProjectApply oldApply = applyService.getOne(Wrappers.lambdaQuery(ProjectApply.class)
.eq(ProjectApply::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));

ProjectApply saveApply = BeanUtil.copyProperties(apply, ProjectApply.class);
saveApply.setBaseProjId(baseProjId);
if (Objects.isNull(oldApply)) {
//如果当前 数据不存在 但是我们平台操作是修改 说明之前数据被推送过了那么 可以置为修改update
if (StringUtils.isNotBlank(apply.getOp()) && BizConst.OP_UPDATE.equals(apply.getOp())) {
saveApply.setOp(BizConst.OP_UPDATE);
} else {
saveApply.setOp(BizConst.OP_INSERT);
}
saveApply.setTongTime(LocalDateTime.now());
} else {
saveApply.setOp(BizConst.OP_INSERT);
saveApply.setTongID(oldApply.getTongID());
saveApply.setTongTime(LocalDateTime.now());
}

saveApply.setBizTime(LocalDateTime.now());
applyService.saveOrUpdate(saveApply);
}

//保存基本信息
private void saveBase(ProjectBaseInfo oldBaseInfo, ProjectBaseInfo saveBase, ProjectBaseInfo baseInfo) {
if (Objects.isNull(oldBaseInfo)) {
//如果当前 数据不存在 但是我们平台操作是修改 说明之前数据被推送过了那么 可以置为修改update
if (StringUtils.isNotBlank(baseInfo.getOp()) && BizConst.OP_UPDATE.equals(baseInfo.getOp())) {
saveBase.setOp(BizConst.OP_UPDATE);
} else {
saveBase.setOp(BizConst.OP_INSERT);
}
saveBase.setTongTime(LocalDateTime.now());
} else {
saveBase.setOp(BizConst.OP_INSERT);
saveBase.setTongID(oldBaseInfo.getTongID());
saveBase.setTongTime(LocalDateTime.now());
}
saveBase.setBizTime(LocalDateTime.now());
baseInfoService.saveOrUpdate(saveBase);
}

/**
* 置为无效
*
* @param dto
* @return
*/
public String notEffective(ProjectBaseInfoDTO dto) {
ProjectBaseInfo oldBaseInfo = baseInfoService.getOne(Wrappers.lambdaQuery(ProjectBaseInfo.class)
.eq(ProjectBaseInfo::getBaseProjId, dto.getBaseProjId())
.last(BizConst.LIMIT_1));

ProjectBaseInfo saveBaseinfo = BeanUtil.copyProperties(dto, ProjectBaseInfo.class);
saveBaseinfo.setIsEffective(BizConst.NOT_EFFECTIVE);
if (Objects.isNull(oldBaseInfo)) {
saveBaseinfo.setTongTime(LocalDateTime.now());
}
saveBaseinfo.setBizTime(LocalDateTime.now());
saveBaseinfo.setOp(BizConst.OP_UPDATE);
baseInfoService.saveOrUpdate(saveBaseinfo);

return BizConst.OP_SUCCESS;
}

/**
* 删除表里的所有数据
*
* @return
*/
public String deleteAll() {
baseInfoService.remove(Wrappers.lambdaQuery(ProjectBaseInfo.class));
applyService.remove(Wrappers.lambdaQuery(ProjectApply.class));
approveService.remove(Wrappers.lambdaQuery(ProjectApprove.class));
cimplementService.remove(Wrappers.lambdaQuery(ProjectCimplement.class));
mimplementService.remove(Wrappers.lambdaQuery(ProjectMimplement.class));
procureService.remove(Wrappers.lambdaQuery(ProjectProcure.class));
log.info("删除所有前置表数据成功");
return BizConst.OP_SUCCESS;
}
}

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectApplyMapper.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.mapper;

import com.hz.pm.sync.scheduler.model.entity.ProjectApply;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* <p>
* 项目申报信息 Mapper 接口
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface ProjectApplyMapper extends BaseMapper<ProjectApply> {

}

+ 0
- 5
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectApplyMapper.xml View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hz.pm.sync.scheduler.mapper.ProjectApplyMapper">

</mapper>

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectApproveMapper.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hz.pm.sync.scheduler.model.entity.ProjectApprove;

/**
* <p>
* 项目立项评审信息 Mapper 接口
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface ProjectApproveMapper extends BaseMapper<ProjectApprove> {

}

+ 0
- 5
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectApproveMapper.xml View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hz.pm.sync.scheduler.mapper.ProjectApproveMapper">

</mapper>

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectBaseInfoMapper.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hz.pm.sync.scheduler.model.entity.ProjectBaseInfo;

/**
* <p>
* 项目基本信息 Mapper 接口
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface ProjectBaseInfoMapper extends BaseMapper<ProjectBaseInfo> {

}

+ 0
- 5
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectBaseInfoMapper.xml View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hz.pm.sync.scheduler.mapper.ProjectBaseInfoMapper">

</mapper>

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectCimplementMapper.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hz.pm.sync.scheduler.model.entity.ProjectCimplement;

/**
* <p>
* 建设项目实施信息 Mapper 接口
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface ProjectCimplementMapper extends BaseMapper<ProjectCimplement> {

}

+ 0
- 5
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectCimplementMapper.xml View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hz.pm.sync.scheduler.mapper.ProjectCimplementMapper">

</mapper>

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectMimplementMapper.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hz.pm.sync.scheduler.model.entity.ProjectMimplement;

/**
* <p>
* 运维项目实施信息 Mapper 接口
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface ProjectMimplementMapper extends BaseMapper<ProjectMimplement> {

}

+ 0
- 5
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectMimplementMapper.xml View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hz.pm.sync.scheduler.mapper.ProjectMimplementMapper">

</mapper>

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectProcureMapper.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hz.pm.sync.scheduler.model.entity.ProjectProcure;

/**
* <p>
* 项目采购信息 Mapper 接口
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface ProjectProcureMapper extends BaseMapper<ProjectProcure> {

}

+ 0
- 5
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/mapper/ProjectProcureMapper.xml View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hz.pm.sync.scheduler.mapper.ProjectProcureMapper">

</mapper>

+ 0
- 26
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/dto/ForwardDTO.java View File

@@ -1,26 +0,0 @@
package com.hz.pm.sync.scheduler.model.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Map;

/**
* @Classname ForwardDTO
* @Description
* @Date 2023/7/13 18:03
* @Author PoffyZhang
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ForwardDTO implements Serializable {
private static final long serialVersionUID = 1L;

private String url;
private String secret;
private String appKey;
private Map<String,Object> data;
}

+ 0
- 100
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/dto/ProjectBaseInfoDTO.java View File

@@ -1,100 +0,0 @@
package com.hz.pm.sync.scheduler.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
* <p>
* 项目基本信息
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Data
@ApiModel(value = "SzlsDaBiz331100ProjectBaseinfo对象", description = "项目基本信息")
public class ProjectBaseInfoDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("项目代码")
@NotBlank(message = "项目编号不能为空")
private String baseProjId;

@ApiModelProperty("项目名称")
private String baseProjName;

@ApiModelProperty("所属区划")
private String baseAreaName;

@ApiModelProperty("所属区划编码")
private String baseAreaCode;

@ApiModelProperty("是否涉密")
private String baseProjIsConfidentiality;

@ApiModelProperty("项目类型")
private String baseProjType;

@ApiModelProperty("内容类别")
private String baseConstructionType;

@ApiModelProperty("项目状态")
private String baseProjSetProg;

@ApiModelProperty("信息是否有效")
private String isEffective;

@ApiModelProperty("上级主管单位")
private String baseProvManDeprt;

@ApiModelProperty("上级主管单位浙政钉ID")
private String baseProvManDeprtDing;

@ApiModelProperty("本级主管单位")
private String baseManDeprt;

@ApiModelProperty("本级主管单位浙政钉ID")
private String baseManDeprtDing;

@ApiModelProperty("本级主管单位统一社会信用代码")
private String baseManDepartUsci;

@ApiModelProperty("建设单位(申报单位)")
private String baseBuildDeprt;

@ApiModelProperty("建设单位浙政钉ID")
private String baseBuildDeprtDing;

@ApiModelProperty("建设单位统一社会信用代码")
private String baseBuildDepartUsci;

@ApiModelProperty("项目负责人")
private String baseProjPrincipal;

@ApiModelProperty("项目负责人手机号")
private String baseProjPrincipalCall;

@ApiModelProperty("项目联系人")
private String baseProjContacts;

@ApiModelProperty("项目联系人手机号")
private String baseProjContactsCall;

@ApiModelProperty("数据来源")
private String areaCode;

@ApiModelProperty("出生产库时间")
private LocalDateTime bizTime;

@ApiModelProperty("操作标记")
private String op;

@ApiModelProperty("数据入库时间")
private LocalDateTime tongTime;
}

+ 0
- 34
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/dto/ProjectSaveDTO.java View File

@@ -1,34 +0,0 @@
package com.hz.pm.sync.scheduler.model.dto;

import com.hz.pm.sync.scheduler.model.entity.*;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
* @Classname ProjectSaveDTO
* @Description
* @Date 2023/8/25 9:45
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "SProjectSaveDTO", description = "项目保存")
public class ProjectSaveDTO {

@NotNull(message = "项目基本信息不能为空")
private ProjectBaseInfo baseinfo;

@NotNull(message = "项目申报信息不能为空")
private ProjectApply apply;

@NotNull(message = "项目审批信息不能为空")
private ProjectApprove approve;

private ProjectCimplement cimplement;

private ProjectMimplement mimplement;

private List<ProjectProcure> procures;
}

+ 0
- 138
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectApply.java View File

@@ -1,138 +0,0 @@
package com.hz.pm.sync.scheduler.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
* 项目申报信息
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Data
@TableName("szls_da_biz_331100_project_apply")
@ApiModel(value = "SzlsDaBiz331100ProjectApply对象", description = "项目申报信息")
public class ProjectApply implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("项目代码")
private String baseProjId;

@ApiModelProperty("项目名称")
private String baseProjName;

@ApiModelProperty("发改项目代码")
private String baseDevelopCode;

@ApiModelProperty("财政项目代码")
private String setProjCodeFinan;

@ApiModelProperty("历年项目名称")
private String baseHistorProjName;

@ApiModelProperty("历年项目代码")
private String baseHistorProjId;

@ApiModelProperty("关联IRS应用名称")
private String baseProjSys;

@ApiModelProperty("关联IRS应用编码")
private String baseProjSysCode;

@ApiModelProperty("一本账重大应用名称")
private String baseAccountAppName;

@ApiModelProperty("“领域大脑”一本账名称")
private String baseBrainName;

@ApiModelProperty("单位核心业务名称")
private String baseCoreBusiness;

@ApiModelProperty("单位核心业务编码")
private String baseCoreBusinessCode;

@ApiModelProperty("项目起始时间")
private String baseProjStartTime;

@ApiModelProperty("项目终止时间")
private String baseProjEndTime;

@ApiModelProperty("项目期限")
private String baseProjDuration;

@ApiModelProperty("预算年度")
private String baseProjSetYear;

@ApiModelProperty("预算来源")
private String baseProjAmountOri;

@ApiModelProperty("预算来源说明")
private String baseBasisAmountOri;

@ApiModelProperty("项目总投资")
private String baseProjTotalAmount;

@ApiModelProperty("申报年度预算")
private String baseProjDeclAmount;

@ApiModelProperty("建设层级")
private String baseProjConsClass;

@ApiModelProperty("贯通层级")
private String baseLowestLevel;

@ApiModelProperty("立项依据")
private String baseProjBasis;

@ApiModelProperty("立项依据说明")
private String baseBasisEstablish;

@ApiModelProperty("立项依据证明材料")
private String baseProjBasisFile;

@ApiModelProperty("项目概述")
private String baseProjIntro;

@ApiModelProperty("项目内容与预期成效")
private String beseExpectedResults;

@ApiModelProperty("可行性研究报告")
private String baseResearchReportFile;

@ApiModelProperty("项目申报书")
private String baseProjApplyFile;

@ApiModelProperty("运维方案")
private String baseOperatMaintenFile;

@ApiModelProperty("其他附件")
private String baseProjOtherFile;

@ApiModelProperty("备注")
private String baseProjRemark;

@ApiModelProperty("数据来源")
private String areaCode;

@ApiModelProperty("出生产库时间")
private LocalDateTime bizTime;

@ApiModelProperty("操作标记")
private String op;

@ApiModelProperty("数据入库时间")
private LocalDateTime tongTime;

@ApiModelProperty("发送端自增列")
@TableId(value = "tongID", type = IdType.AUTO)
private Integer tongID;
}

+ 0
- 90
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectApprove.java View File

@@ -1,90 +0,0 @@
package com.hz.pm.sync.scheduler.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
* 项目立项评审信息
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Data
@TableName("szls_da_biz_331100_project_approve")
@ApiModel(value = "SzlsDaBiz331100ProjectApprove对象", description = "项目立项评审信息")
public class ProjectApprove implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("项目代码")
private String baseProjId;

@ApiModelProperty("项目名称")
private String baseProjName;

@ApiModelProperty("发改项目代码")
private String baseDevelopCode;

@ApiModelProperty("财政项目代码")
private String setProjCodeFinan;

@ApiModelProperty("评审结果")
private String baseReviewResults;

@ApiModelProperty("评审意见")
private String baseReviewOpinion;

@ApiModelProperty("评审意见附件")
private String baseReviewCommentsFile;

@ApiModelProperty("建议总投资")
private String baseExpertTotalMoney;

@ApiModelProperty("建议年度预算")
private String baseExpertYearMoney;

@ApiModelProperty("立项批复文件")
private String approvalFile;

@ApiModelProperty("建议批复总投资")
private String baseInitialReviewTotalMoney;

@ApiModelProperty("建议批复年度预算")
private String baseProjReplyAmount;

@ApiModelProperty("等保定级")
private String equalProtectionLevel;

@ApiModelProperty("初步设计方案")
private String preliminaryDesignScheme;

@ApiModelProperty("初步设计方案批复函")
private String preliminaryDesignFile;

@ApiModelProperty("年度预算下达金额")
private String releaseYearMoney;

@ApiModelProperty("数据来源")
private String areaCode;

@ApiModelProperty("出生产库时间")
private LocalDateTime bizTime;

@ApiModelProperty("操作标记")
private String op;

@ApiModelProperty("数据入库时间")
private LocalDateTime tongTime;

@ApiModelProperty("发送端自增列")
@TableId(value = "tongID", type = IdType.AUTO)
private Integer tongID;
}

+ 0
- 105
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectBaseInfo.java View File

@@ -1,105 +0,0 @@
package com.hz.pm.sync.scheduler.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
* 项目基本信息
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Data
@TableName("szls_da_biz_331100_project_baseinfo")
@ApiModel(value = "SzlsDaBiz331100ProjectBaseinfo对象", description = "项目基本信息")
public class ProjectBaseInfo implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("项目代码")
private String baseProjId;

@ApiModelProperty("项目名称")
private String baseProjName;

@ApiModelProperty("所属区划")
private String baseAreaName;

@ApiModelProperty("所属区划编码")
private String baseAreaCode;

@ApiModelProperty("是否涉密")
private String baseProjIsConfidentiality;

@ApiModelProperty("项目类型")
private String baseProjType;

@ApiModelProperty("内容类别")
private String baseConstructionType;

@ApiModelProperty("项目状态")
private String baseProjSetProg;

@ApiModelProperty("信息是否有效")
private String isEffective;

@ApiModelProperty("上级主管单位")
private String baseProvManDeprt;

@ApiModelProperty("上级主管单位浙政钉ID")
private String baseProvManDeprtDing;

@ApiModelProperty("本级主管单位")
private String baseManDeprt;

@ApiModelProperty("本级主管单位浙政钉ID")
private String baseManDeprtDing;

@ApiModelProperty("本级主管单位统一社会信用代码")
private String baseManDepartUsci;

@ApiModelProperty("建设单位(申报单位)")
private String baseBuildDeprt;

@ApiModelProperty("建设单位浙政钉ID")
private String baseBuildDeprtDing;

@ApiModelProperty("建设单位统一社会信用代码")
private String baseBuildDepartUsci;

@ApiModelProperty("项目负责人")
private String baseProjPrincipal;

@ApiModelProperty("项目负责人手机号")
private String baseProjPrincipalCall;

@ApiModelProperty("项目联系人")
private String baseProjContacts;

@ApiModelProperty("项目联系人手机号")
private String baseProjContactsCall;

@ApiModelProperty("数据来源")
private String areaCode;

@ApiModelProperty("出生产库时间")
private LocalDateTime bizTime;

@ApiModelProperty("操作标记")
private String op;

@ApiModelProperty("数据入库时间")
private LocalDateTime tongTime;

@ApiModelProperty("发送端自增列")
@TableId(value = "tongID", type = IdType.AUTO)
private Integer tongID;
}

+ 0
- 108
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectCimplement.java View File

@@ -1,108 +0,0 @@
package com.hz.pm.sync.scheduler.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
* 建设项目实施信息
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Data
@TableName("szls_da_biz_331100_project_cimplement")
@ApiModel(value = "SzlsDaBiz331100ProjectCimplement对象", description = "建设项目实施信息")
public class ProjectCimplement implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("标段代码")
private String baseBidCode;

@ApiModelProperty("标段名称")
private String baseBidName;

@ApiModelProperty("项目代码")
private String baseProjId;

@ApiModelProperty("项目名称")
private String baseProjName;

@ApiModelProperty("发改项目代码")
private String baseDevelopCode;

@ApiModelProperty("关联IRS应用编码")
private String baseProjSysCode;

@ApiModelProperty("初验意见")
private String baseInitialOpinionFile;

@ApiModelProperty("信息安全等级保护测评报告")
private String baseInforLevelFile;

@ApiModelProperty("商业密码应用评估报告")
private String basePasswAssessFile;

@ApiModelProperty("第三方验收测试报告")
private String baseThirdAcceptFile;

@ApiModelProperty("建设核查表")
private String baseCheckFile;

@ApiModelProperty("财务审计报告")
private String baseFinanlAuditFile;

@ApiModelProperty("用户使用报告")
private String baseUserConsFile;

@ApiModelProperty("监理总结报告")
private String baseEstaSummFile;

@ApiModelProperty("IRS应用试运行报告")
private String baseIrsTestRunFile;

@ApiModelProperty("项目总结报告")
private String baseSummReportFile;

@ApiModelProperty("是否完成日志数据归集")
private String baseLogAggregation;

@ApiModelProperty("实际成效指标")
private String baseBusinessMetrics;

@ApiModelProperty("终验意见")
private String baseFinalExpertOpinionFile;

@ApiModelProperty("项目延期申请表")
private String baseEngineerPostpoFile;

@ApiModelProperty("变更申请单")
private String baseChangeFormFile;

@ApiModelProperty("变更批复文件")
private String baseChanFile;

@ApiModelProperty("数据来源")
private String areaCode;

@ApiModelProperty("出生产库时间")
private LocalDateTime bizTime;

@ApiModelProperty("操作标记")
private String op;

@ApiModelProperty("数据入库时间")
private LocalDateTime tongTime;

@ApiModelProperty("发送端自增列")
@TableId(value = "tongID", type = IdType.AUTO)
private Integer tongID;
}

+ 0
- 96
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectMimplement.java View File

@@ -1,96 +0,0 @@
package com.hz.pm.sync.scheduler.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
* 运维项目实施信息
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Data
@TableName("szls_da_biz_331100_project_mimplement")
@ApiModel(value = "SzlsDaBiz331100ProjectMimplement对象", description = "运维项目实施信息")
public class ProjectMimplement implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("标段代码")
private String baseBidCode;

@ApiModelProperty("标段名称")
private String baseBidName;

@ApiModelProperty("项目代码")
private String baseProjId;

@ApiModelProperty("项目名称")
private String baseProjName;

@ApiModelProperty("发改项目代码")
private String baseDevelopCode;

@ApiModelProperty("关联IRS应用编码")
private String baseProjSysCode;

@ApiModelProperty("信息安全等级保护测评报告")
private String baseInforLevelFile;

@ApiModelProperty("商业密码应用评估报告")
private String basePasswAssessFile;

@ApiModelProperty("第三方验收测试报告")
private String baseThirdAcceptFile;

@ApiModelProperty("用户使用报告")
private String baseUserConsFile;

@ApiModelProperty("监理总结报告")
private String baseEstaSummFile;

@ApiModelProperty("运维总结报告")
private String baseOperatMaintenSummFile;

@ApiModelProperty("是否完成日志数据归集")
private String baseLogAggregation;

@ApiModelProperty("实际成效指标")
private String baseBusinessMetrics;

@ApiModelProperty("终验意见")
private String baseFinalExpertOpinionFile;

@ApiModelProperty("项目延期申请表")
private String baseEngineerPostpoFile;

@ApiModelProperty("变更报告")
private String baseEngineerAlterFile;

@ApiModelProperty("变更批复文件")
private String baseChanFile;

@ApiModelProperty("数据来源")
private String areaCode;

@ApiModelProperty("出生产库时间")
private LocalDateTime bizTime;

@ApiModelProperty("操作标记")
private String op;

@ApiModelProperty("数据入库时间")
private LocalDateTime tongTime;

@ApiModelProperty("发送端自增列")
@TableId(value = "tongID", type = IdType.AUTO)
private Integer tongID;
}

+ 0
- 96
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/entity/ProjectProcure.java View File

@@ -1,96 +0,0 @@
package com.hz.pm.sync.scheduler.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
* 项目采购信息
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Data
@TableName("szls_da_biz_331100_project_procure")
@ApiModel(value = "SzlsDaBiz331100ProjectProcure对象", description = "项目采购信息")
public class ProjectProcure implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("标段代码")
private String baseBidCode;

@ApiModelProperty("标段名称")
private String baseBidName;

@ApiModelProperty("项目代码")
private String baseProjId;

@ApiModelProperty("项目名称")
private String baseProjName;

@ApiModelProperty("财政项目代码")
private String setProjCodeFinan;

@ApiModelProperty("采购方式")
private String baseProjPurchaseWay;

@ApiModelProperty("预算执行确认书编号")
private String basePurchaseCode;

@ApiModelProperty("招标(采购)文件")
private String purchaseFile;

@ApiModelProperty("采购代理机构")
private String basePurchasingAgencies;

@ApiModelProperty("采购代理机构统一社会信用代码")
private String baseUnifiedCreditCode;

@ApiModelProperty("中标(成交)时间")
private String baseWinningBidTime;

@ApiModelProperty("中标(成交)金额")
private String baseProjPurchaseAmount;

@ApiModelProperty("中标(成交)通知书")
private String biddingFile;

@ApiModelProperty("中标(成交)供应商名称")
private String baseConsDeprt;

@ApiModelProperty("中标(成交)供应商统一社会信用代码")
private String baseConsDeprtUsci;

@ApiModelProperty("采购合同")
private String purchaseContract;

@ApiModelProperty("项目款支付时间")
private String basePaymentTime;

@ApiModelProperty("项目款支付金额")
private String paymentProgress;

@ApiModelProperty("数据来源")
private String areaCode;

@ApiModelProperty("出生产库时间")
private LocalDateTime bizTime;

@ApiModelProperty("操作标记")
private String op;

@ApiModelProperty("数据入库时间")
private LocalDateTime tongTime;

@ApiModelProperty("发送端自增列")
@TableId(value = "tongID", type = IdType.AUTO)
private Integer tongID;
}

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectApplyService.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.service;

import com.hz.pm.sync.scheduler.model.entity.ProjectApply;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* <p>
* 项目申报信息 服务类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface IProjectApplyService extends IService<ProjectApply> {

}

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectApproveService.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.sync.scheduler.model.entity.ProjectApprove;

/**
* <p>
* 项目立项评审信息 服务类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface IProjectApproveService extends IService<ProjectApprove> {

}

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectBaseInfoService.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.sync.scheduler.model.entity.ProjectBaseInfo;

/**
* <p>
* 项目基本信息 服务类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface IProjectBaseInfoService extends IService<ProjectBaseInfo> {

}

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectCimplementService.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.sync.scheduler.model.entity.ProjectCimplement;

/**
* <p>
* 建设项目实施信息 服务类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface IProjectCimplementService extends IService<ProjectCimplement> {

}

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectMimplementService.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.sync.scheduler.model.entity.ProjectMimplement;

/**
* <p>
* 运维项目实施信息 服务类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface IProjectMimplementService extends IService<ProjectMimplement> {

}

+ 0
- 16
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/IProjectProcureService.java View File

@@ -1,16 +0,0 @@
package com.hz.pm.sync.scheduler.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.sync.scheduler.model.entity.ProjectProcure;

/**
* <p>
* 项目采购信息 服务类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
public interface IProjectProcureService extends IService<ProjectProcure> {

}

+ 0
- 21
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/IProjectCimplementServiceImpl.java View File

@@ -1,21 +0,0 @@
package com.hz.pm.sync.scheduler.service.impl;

import com.hz.pm.sync.scheduler.mapper.ProjectCimplementMapper;
import com.hz.pm.sync.scheduler.model.entity.ProjectCimplement;
import com.hz.pm.sync.scheduler.service.IProjectCimplementService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
* <p>
* 建设项目实施信息 服务实现类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Service
public class IProjectCimplementServiceImpl extends ServiceImpl<ProjectCimplementMapper, ProjectCimplement> implements IProjectCimplementService {

}

+ 0
- 20
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/ProjectApplyServiceImpl.java View File

@@ -1,20 +0,0 @@
package com.hz.pm.sync.scheduler.service.impl;

import com.hz.pm.sync.scheduler.mapper.ProjectApplyMapper;
import com.hz.pm.sync.scheduler.model.entity.ProjectApply;
import com.hz.pm.sync.scheduler.service.IProjectApplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 项目申报信息 服务实现类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Service
public class ProjectApplyServiceImpl extends ServiceImpl<ProjectApplyMapper, ProjectApply> implements IProjectApplyService {

}

+ 0
- 21
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/ProjectApproveServiceImpl.java View File

@@ -1,21 +0,0 @@
package com.hz.pm.sync.scheduler.service.impl;

import com.hz.pm.sync.scheduler.mapper.ProjectApproveMapper;
import com.hz.pm.sync.scheduler.model.entity.ProjectApprove;
import com.hz.pm.sync.scheduler.service.IProjectApproveService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
* <p>
* 项目立项评审信息 服务实现类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Service
public class ProjectApproveServiceImpl extends ServiceImpl<ProjectApproveMapper, ProjectApprove> implements IProjectApproveService {

}

+ 0
- 21
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/ProjectBaseInfoServiceImpl.java View File

@@ -1,21 +0,0 @@
package com.hz.pm.sync.scheduler.service.impl;

import com.hz.pm.sync.scheduler.mapper.ProjectBaseInfoMapper;
import com.hz.pm.sync.scheduler.model.entity.ProjectBaseInfo;
import com.hz.pm.sync.scheduler.service.IProjectBaseInfoService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
* <p>
* 项目基本信息 服务实现类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Service
public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMapper, ProjectBaseInfo> implements IProjectBaseInfoService {

}

+ 0
- 21
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/ProjectMimplementServiceImpl.java View File

@@ -1,21 +0,0 @@
package com.hz.pm.sync.scheduler.service.impl;

import com.hz.pm.sync.scheduler.mapper.ProjectMimplementMapper;
import com.hz.pm.sync.scheduler.model.entity.ProjectMimplement;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hz.pm.sync.scheduler.service.IProjectMimplementService;

/**
* <p>
* 运维项目实施信息 服务实现类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Service
public class ProjectMimplementServiceImpl extends ServiceImpl<ProjectMimplementMapper, ProjectMimplement> implements IProjectMimplementService {

}

+ 0
- 21
hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/service/impl/ProjectProcureServiceImpl.java View File

@@ -1,21 +0,0 @@
package com.hz.pm.sync.scheduler.service.impl;

import com.hz.pm.sync.scheduler.model.entity.ProjectProcure;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hz.pm.sync.scheduler.mapper.ProjectProcureMapper;
import com.hz.pm.sync.scheduler.service.IProjectProcureService;

/**
* <p>
* 项目采购信息 服务实现类
* </p>
*
* @author CMM
* @since 2023-08-22
*/
@Service
public class ProjectProcureServiceImpl extends ServiceImpl<ProjectProcureMapper, ProjectProcure> implements IProjectProcureService {

}

+ 0
- 79
hz-pm-sync/src/main/resources/application-dev.yml View File

@@ -1,79 +0,0 @@
server:
port: 38088
spring:
application:
name: syn-data-task
jackson:
default-property-inclusion: non_null
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
jpa:
properties:
hibernate:
default_schema: PUBLIC
hbm2ddl:
auto: update
show_sql: true
show-sql: true
hibernate:
ddl-auto: update
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://47.98.125.47:3306/szls_da_lsxmss_sjgx?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false
username: root
password: NingdaKeji123!
# 数据源
hikari:
# 是客户端等待连接池连接的最大毫秒数
connection-timeout: 30000
# 是允许连接在连接池中空闲的最长时间
minimum-idle: 5
# 配置最大池大小
maximum-pool-size: 20
# 是允许连接在连接池中空闲的最长时间(以毫秒为单位)
idle-timeout: 60000
# 池中连接关闭后的最长生命周期(以毫秒为单位)
max-lifetime: 600000
# 配置从池返回的连接的默认自动提交行为。默认值为true。
auto-commit: true
# 开启连接监测泄露
leak-detection-threshold: 5000
# 测试连接数据库
connection-test-query: SELECT 1
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-value: true
logic-not-delete-value: false
logging:
config: classpath:logback-spring.xml
#日志配置
level:
root: info
file:
path: logs
# 日志文件配置
log:
path: ./logs
info:
file-size: 50MB
max-size: 5
total-size: 200MB
error:
file-size: 10MB
max-size: 5
total-size: 50MB

swagger:
enabled: true

task:
host: iZbp13nwyvib53j4j1p2xoZ
switch:
is-open: true #开关




+ 0
- 77
hz-pm-sync/src/main/resources/application-pre.yml View File

@@ -1,77 +0,0 @@
server:
port: 38088
spring:
application:
name: syn-data-task
jackson:
default-property-inclusion: non_null
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
jpa:
properties:
hibernate:
default_schema: PUBLIC
hbm2ddl:
auto: update
show_sql: true
show-sql: true
hibernate:
ddl-auto: update
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://10.53.129.228:63306/szls_da_lsxmss_sjgx?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false
username: szls_da_lsxmss
password: 1Lzo6XqF
# 数据源
hikari:
# 是客户端等待连接池连接的最大毫秒数
connection-timeout: 30000
# 是允许连接在连接池中空闲的最长时间
minimum-idle: 10
# 配置最大池大小
maximum-pool-size: 20
# 是允许连接在连接池中空闲的最长时间(以毫秒为单位)
idle-timeout: 60000
# 池中连接关闭后的最长生命周期(以毫秒为单位)
max-lifetime: 600000
# 配置从池返回的连接的默认自动提交行为。默认值为true。
auto-commit: true
# 开启连接监测泄露
leak-detection-threshold: 5000
# 测试连接数据库
connection-test-query: SELECT 1
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-value: true
logic-not-delete-value: false
logging:
config: classpath:logback-spring.xml
#日志配置
level:
root: info
file:
path: logs
# 日志文件配置
log:
path: ./logs
info:
file-size: 50MB
max-size: 5
total-size: 200MB
error:
file-size: 10MB
max-size: 5
total-size: 50MB

swagger:
enabled: true

task:
host: iZ6mx01asxnsmennpzoxooZ
switch:
is-open: true #开关


+ 0
- 3
hz-pm-sync/src/main/resources/application.yml View File

@@ -1,3 +0,0 @@
spring:
profiles:
active: dev

+ 0
- 68
hz-pm-sync/src/main/resources/logback-spring.xml View File

@@ -1,68 +0,0 @@
<configuration scan="true" scanPeriod="10 seconds">
<springProperty name="logPath" scope="context" source="log.path" defaultValue="./logs"/>
<springProperty name="infoFileSize" scope="context" source="log.info.file-size"/>
<springProperty name="infoMaxSize" scope="context" source="log.info.max-size"/>
<springProperty name="infoTotalSize" scope="context" source="log.info.total-size"/>
<springProperty name="errorFileSize" scope="context" source="log.error.file-size"/>
<springProperty name="errorMaxSize" scope="context" source="log.error.max-size"/>
<springProperty name="errorTotalSize" scope="context" source="log.error.total-size"/>

<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${logPath}/info.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${logPath}/info-%d{yyyyMMdd}-%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>${infoFileSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>${infoMaxSize}</maxHistory>
<totalSizeCap>${infoTotalSize}</totalSizeCap>
</rollingPolicy>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
</Pattern>
</layout>
<charset>UTF-8</charset>
</encoder>
</appender>

<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<File>${logPath}/error.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${logPath}/error-%d{yyyyMMdd}-%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>${errorFileSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>${errorMaxSize}</maxHistory>
<totalSizeCap>${errorTotalSize}</totalSizeCap>
</rollingPolicy>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
</Pattern>
</layout>
<charset>UTF-8</charset>
</encoder>
</appender>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
</pattern>
<charset>UTF-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>DEBUG</level>
</filter>
</appender>

<root level="INFO">
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="ERROR_FILE"/>
<appender-ref ref="STDOUT"/>
</root>
</configuration>

+ 2
- 4
pom.xml View File

@@ -8,7 +8,7 @@
<packaging>pom</packaging>
<version>1.0.0</version>
<name>hz-project-management</name>
<description>丽水项管二期项目</description>
<description>杭州市委办项管</description>

<properties>
<skipTests>true</skipTests>
@@ -16,7 +16,6 @@
<spring-boot.version>2.6.11</spring-boot.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jwt.version>3.7.0</jwt.version>
<mybatis.plus.version>3.5.1</mybatis.plus.version>
<io.springfox-swagger2.version>3.0.0</io.springfox-swagger2.version>
<swagger-knife.version>3.0.3</swagger-knife.version>
@@ -157,7 +156,7 @@
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>4.2.0</version>
<version>4.4.0</version>
</dependency>
</dependencies>
</dependencyManagement>
@@ -195,6 +194,5 @@

<modules>
<module>hz-pm-api</module>
<module>hz-pm-sync</module>
</modules>
</project>

Loading…
Cancel
Save