Browse Source

绩效评价-应用评价修改

tags/24080901
CMM 1 year ago
parent
commit
774d61a997
84 changed files with 1722 additions and 756 deletions
  1. +3
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java
  2. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/model/ReqRegionDTO.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java
  4. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java
  5. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java
  6. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java
  7. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java
  8. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java
  9. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java
  10. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java
  11. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java
  12. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java
  13. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java
  14. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/constant/AnalysisBasicConstant.java
  15. +65
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/constant/ChartTypeEnum.java
  16. +65
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/DashboardController.java
  17. +106
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/helper/DashboardChartAssembler.java
  18. +77
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/helper/DashboardHelper.java
  19. +168
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardExpertManage.java
  20. +317
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardProjectManage.java
  21. +25
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/AnalysisChart.java
  22. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/AnalysisData.java
  23. +31
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/CompanyProjectCntBO.java
  24. +31
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/ProjectATIISBO.java
  25. +23
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/QueryTimeYearBO.java
  26. +24
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/StarExpertBO.java
  27. +45
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/YearTrendBO.java
  28. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/po/QueryYearPO.java
  29. +34
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardInvestmentSummaryVO.java
  30. +30
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardProjectCntSummaryVO.java
  31. +58
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardProjectSummaryVO.java
  32. +31
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/ExpertDashboardSummaryVO.java
  33. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java
  34. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertMetaApply.java
  35. +0
    -29
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java
  36. +23
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/constant/ExpertAuditMsgTemplate.java
  37. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/enumeration/ReviewTemplateTypeEnum.java
  38. +28
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java
  39. +52
    -56
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java
  40. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java
  41. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java
  42. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/ExpertDashboardController.java
  43. +2
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/RandomInviteRuleDTO.java
  44. +3
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/MeetingReviewTypeEnum.java
  45. +5
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java
  46. +8
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java
  47. +0
    -75
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertCallResultRewriteTask.java
  48. +10
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java
  49. +0
    -93
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/MeetingInviteCompleteNoticeTask.java
  50. +0
    -160
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/NoticeExpertAt24HoursBeforeMeetingTask.java
  51. +5
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/AppAppraisalController.java
  52. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java
  53. +3
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/helper/TemplateDetailBuildHelper.java
  54. +5
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/performance/helper/impl/TemplateDetailBuildHelperImpl.java
  55. +58
    -151
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/AppAppraisalManage.java
  56. +2
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java
  57. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java
  58. +33
    -10
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java
  59. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/RectifyAuditManage.java
  60. +0
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalAppIndicator.java
  61. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppAppraisalIndexDetailVO.java
  62. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/contants/ProjectCodeContant.java
  63. +0
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java
  64. +8
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionManage.java
  65. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PurchaseManage.java
  66. +32
    -68
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java
  67. +0
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java
  68. +8
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java
  69. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java
  70. +83
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  71. +33
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java
  72. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java
  73. +7
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectRenewalFundDeclarationVO.java
  74. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/provincial/service/impl/JoinReviewProvincialBureauServiceImpl.java
  75. +2
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java
  76. +9
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/staging/enums/MsgTypeEnum.java
  77. +25
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  78. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/convert/UserInfoConvertor.java
  79. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java
  80. +1
    -0
      pmapi/src/main/resources/application-dev.yml
  81. +1
    -0
      pmapi/src/main/resources/application-pre.yml
  82. +1
    -0
      pmapi/src/main/resources/application-prod.yml
  83. +2
    -2
      pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest.java
  84. +2
    -2
      pmapi/src/test/java/com/ningdatech/pmapi/irs/irsTest3.java

+ 3
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java View File

@@ -32,7 +32,9 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
"com.ningdatech.pmapi.performance.controller",
"com.ningdatech.pmapi.irs.controller",
"com.ningdatech.pmapi.safety.controller",
"com.ningdatech.pmapi.portrait.controller"
"com.ningdatech.pmapi.portrait.controller",
"com.ningdatech.pmapi.irs.controller",
"com.ningdatech.pmapi.dashboard.controller"
})
public class GlobalResponseHandler implements ResponseBodyAdvice<Object> {



+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/model/ReqRegionDTO.java View File

@@ -0,0 +1,20 @@
package com.ningdatech.pmapi.common.model;

import lombok.Data;

/**
* <p>
* ReqRegionDTO
* </p>
*
* @author WendyYang
* @since 2023/8/4
**/
@Data
public class ReqRegionDTO {

private String regionCode;

private Integer regionLevel;

}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java View File

@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineJNBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java View File

@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineJYBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java View File

@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineKFQBuilder implements ProjectDeclareState
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java View File

@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineLDBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineLDBuilder implements ProjectDeclareStateM
.withExternal()
.source(ProjectStatusEnum.OPERATION)
.target(ProjectStatusEnum.UNDER_CONSTRUCTION)
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and()
.event(ProjectStatusChangeEvent.START_TO_WORK).and()
// 建设中初验备案,从建设中到待终验
.withExternal()
.source(ProjectStatusEnum.UNDER_CONSTRUCTION)


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java View File

@@ -212,7 +212,7 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)
@@ -222,7 +222,7 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM
.withExternal()
.source(ProjectStatusEnum.OPERATION)
.target(ProjectStatusEnum.UNDER_CONSTRUCTION)
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and()
.event(ProjectStatusChangeEvent.START_TO_WORK).and()
// 建设中初验备案,从建设中到待终验
.withExternal()
.source(ProjectStatusEnum.UNDER_CONSTRUCTION)


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java View File

@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineQTBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineQTBuilder implements ProjectDeclareStateM
.withExternal()
.source(ProjectStatusEnum.OPERATION)
.target(ProjectStatusEnum.UNDER_CONSTRUCTION)
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and()
.event(ProjectStatusChangeEvent.START_TO_WORK).and()
// 建设中初验备案,从建设中到待终验
.withExternal()
.source(ProjectStatusEnum.UNDER_CONSTRUCTION)


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java View File

@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineQYBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineQYBuilder implements ProjectDeclareStateM
.withExternal()
.source(ProjectStatusEnum.OPERATION)
.target(ProjectStatusEnum.UNDER_CONSTRUCTION)
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and()
.event(ProjectStatusChangeEvent.START_TO_WORK).and()
// 建设中初验备案,从建设中到待终验
.withExternal()
.source(ProjectStatusEnum.UNDER_CONSTRUCTION)


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java View File

@@ -212,7 +212,7 @@ public class ProjectDeclareStateMachineSBJBuilder implements ProjectDeclareState
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)
@@ -222,7 +222,7 @@ public class ProjectDeclareStateMachineSBJBuilder implements ProjectDeclareState
.withExternal()
.source(ProjectStatusEnum.OPERATION)
.target(ProjectStatusEnum.UNDER_CONSTRUCTION)
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and()
.event(ProjectStatusChangeEvent.START_TO_WORK).and()
// 建设中初验备案,从建设中到待终验
.withExternal()
.source(ProjectStatusEnum.UNDER_CONSTRUCTION)


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java View File

@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineSCBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.TO_BE_APP_REGISTER)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.REGISTER_APP).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)
@@ -231,7 +231,7 @@ public class ProjectDeclareStateMachineSCBuilder implements ProjectDeclareStateM
.withExternal()
.source(ProjectStatusEnum.OPERATION)
.target(ProjectStatusEnum.UNDER_CONSTRUCTION)
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and()
.event(ProjectStatusChangeEvent.START_TO_WORK).and()
// 建设中初验备案,从建设中到待终验
.withExternal()
.source(ProjectStatusEnum.UNDER_CONSTRUCTION)


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java View File

@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineSYBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineSYBuilder implements ProjectDeclareStateM
.withExternal()
.source(ProjectStatusEnum.OPERATION)
.target(ProjectStatusEnum.UNDER_CONSTRUCTION)
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and()
.event(ProjectStatusChangeEvent.START_TO_WORK).and()
// 建设中初验备案,从建设中到待终验
.withExternal()
.source(ProjectStatusEnum.UNDER_CONSTRUCTION)


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java View File

@@ -211,7 +211,7 @@ public class ProjectDeclareStateMachineYHBuilder implements ProjectDeclareStateM
.source(ProjectStatusEnum.TO_BE_APPROVED)
.target(ProjectStatusEnum.TO_BE_PURCHASED)
.event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and()
// 待采购采购备案,从待采购到建设
// 待采购采购备案,从待采购到实施
.withExternal()
.source(ProjectStatusEnum.TO_BE_PURCHASED)
.target(ProjectStatusEnum.OPERATION)
@@ -221,7 +221,7 @@ public class ProjectDeclareStateMachineYHBuilder implements ProjectDeclareStateM
.withExternal()
.source(ProjectStatusEnum.OPERATION)
.target(ProjectStatusEnum.UNDER_CONSTRUCTION)
.event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and()
.event(ProjectStatusChangeEvent.START_TO_WORK).and()
// 建设中初验备案,从建设中到待终验
.withExternal()
.source(ProjectStatusEnum.UNDER_CONSTRUCTION)


+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/constant/AnalysisBasicConstant.java View File

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.dashboard.constant;

/**
* @author liuxinxin
* @date 2023/8/2 下午2:46
*/

public class AnalysisBasicConstant {


/**
* 丽水市区域编码
*/
public static final String LS_REGION_CODE = "331100";

}

+ 65
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/constant/ChartTypeEnum.java View File

@@ -0,0 +1,65 @@
package com.ningdatech.pmapi.dashboard.constant;

/**
* @author liuxinxin
* @date 2023/8/2 下午2:52
*/

public enum ChartTypeEnum {

/**
* 各区域专家数量分布
*/
REGION_EXPERT_NUMBER_CHART,

/**
* 各区域专家学历分布
*/
REGION_EXPERT_EDUCATION_CHART,

/**
* 各区域专家职称级别分布
*/
REGION_EXPERT_TITLE_LEVEL_CHART,

/**
* 各类型评审次数
*/
MEETING_TYPE_CNT_CHART,

/**
* 项目增补情况
*/
PROJECT_SUPPLEMENTATION_STATUS_CHART,

/**
* 各类型项目数量
*/
EACH_TYPE_QUANTITY_OF_PROJECT_CHART,

/**
* 各区域项目数量
*/
PROJECTS_NUMBER_IN_EACH_REGION_CHART,

/**
* 各领域项目数量
*/
PROJECTS_NUMBER_IN_VARIOUS_FIELDS_CHART,

/**
* 各阶段项目数量
*/
PROJECTS_NUMBER_IN_EACH_STAGE_CHART,

/**
* 各领域项目投资金额
*/
PROJECTS_INVESTMENT_AMOUNT_IN_VARIOUS_FIELDS_CHART,

/**
* 各区域项目投资情况
*/
PROJECTS_INVESTMENT_SITUATION_IN_VARIOUS_REGIONS

}

+ 65
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/DashboardController.java View File

@@ -0,0 +1,65 @@
package com.ningdatech.pmapi.dashboard.controller;

import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.dashboard.manage.DashboardExpertManage;
import com.ningdatech.pmapi.dashboard.manage.DashboardProjectManage;
import com.ningdatech.pmapi.dashboard.model.po.QueryYearPO;
import com.ningdatech.pmapi.dashboard.model.vo.DashboardInvestmentSummaryVO;
import com.ningdatech.pmapi.dashboard.model.vo.DashboardProjectCntSummaryVO;
import com.ningdatech.pmapi.dashboard.model.vo.DashboardProjectSummaryVO;
import com.ningdatech.pmapi.dashboard.model.vo.ExpertDashboardSummaryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
* @author liuxinxin
* @date 2023/8/2 上午10:36
*/

@RestController
@RequestMapping("/api/v1/dashboard")
@Validated
@RequiredArgsConstructor
@Api(value = "DashboardController", tags = "驾驶舱相关接口")
public class DashboardController {

private final DashboardExpertManage dashboardExpertManage;
private final DashboardProjectManage dashboardProjectManage;

@PostMapping("/expert-summary")
@ApiOperation("专家驾驶舱统计数据")
@WebLog("专家驾驶舱统计数据")
public ExpertDashboardSummaryVO getExpertDashboardSummary(@Valid @RequestBody QueryYearPO queryYearPO) {
return dashboardExpertManage.getExpertDashboardSummary(queryYearPO);
}

@PostMapping("project-summary")
@ApiOperation("驾驶舱项目总览")
@WebLog("驾驶舱项目总览")
public DashboardProjectSummaryVO getProjectSummary(@Valid @RequestBody QueryYearPO queryYearPO) {
return dashboardProjectManage.getProjectSummary(queryYearPO);
}

@PostMapping("project-cnt-summary")
@ApiOperation("驾驶舱项目数量")
@WebLog("驾驶舱项目数量")
public DashboardProjectCntSummaryVO getProjectCntSummary(@Valid @RequestBody QueryYearPO queryYearPO) {
return dashboardProjectManage.getProjectCntSummary(queryYearPO);
}

@PostMapping("investment-summary")
@ApiOperation("驾驶舱投资金额")
@WebLog("驾驶舱投资金额")
public DashboardInvestmentSummaryVO getInvestmentSummary(@Valid @RequestBody QueryYearPO queryYearPO) {
return dashboardProjectManage.getInvestmentSummary(queryYearPO);
}

}

+ 106
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/helper/DashboardChartAssembler.java View File

@@ -0,0 +1,106 @@
package com.ningdatech.pmapi.dashboard.helper;

import cn.hutool.core.collection.CollUtil;
import com.ningdatech.pmapi.dashboard.constant.ChartTypeEnum;
import com.ningdatech.pmapi.dashboard.model.basic.AnalysisChart;
import com.ningdatech.pmapi.dashboard.model.basic.AnalysisData;
import com.ningdatech.pmapi.meta.helper.DictionaryCache;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
* @author liuxinxin
* @date 2023/8/4 下午2:36
*/

@Component
@RequiredArgsConstructor
public class DashboardChartAssembler {

private final DictionaryCache dictionaryCache;


public static AnalysisChart buildProjectStateAnalysisChart(Map<Integer, List<Project>> projectGroupMap, ChartTypeEnum chartTypeEnum) {
AnalysisChart analysisChart = new AnalysisChart();
List<AnalysisData> dataList = new ArrayList<>();
analysisChart.setChartType(chartTypeEnum);
analysisChart.setDataList(dataList);
for (Integer key : projectGroupMap.keySet()) {
AnalysisData analysisData = new AnalysisData();
String chartKey = ProjectStatusEnum.getDesc(key);
List<Project> projectList = projectGroupMap.get(key);
analysisData.setKey(chartKey);
analysisData.setValue(CollUtil.isEmpty(projectList) ? 0 : projectList.size());
dataList.add(analysisData);
}
return analysisChart;
}

public static <T> AnalysisChart buildInvestmentAnalysisChart(Map<T, String> keyValueMap
, Map<T, List<Project>> projectGroupMap, ChartTypeEnum chartTypeEnum) {
AnalysisChart analysisChart = new AnalysisChart();
List<AnalysisData> dataList = new ArrayList<>();
analysisChart.setChartType(chartTypeEnum);
analysisChart.setDataList(dataList);
for (T key : keyValueMap.keySet()) {
AnalysisData analysisData = new AnalysisData();
String chartKey = keyValueMap.get(key);
List<Project> projectList = projectGroupMap.get(key);

BigDecimal approvedTotalInvestmentIncreaseSum = new BigDecimal("0");
if (CollUtil.isNotEmpty(projectList)) {
for (Project project : projectList) {
BigDecimal approvedTotalInvestmentIncrease = project.getApprovedTotalInvestmentIncrease();
if (Objects.nonNull(approvedTotalInvestmentIncrease)) {
approvedTotalInvestmentIncreaseSum.add(approvedTotalInvestmentIncrease);
}
}
}
analysisData.setKey(chartKey);
analysisData.setValue(approvedTotalInvestmentIncreaseSum);
dataList.add(analysisData);
}
return analysisChart;
}

public static <T> AnalysisChart buildAnalysisChart(Map<T, String> keyValueMap
, Map<T, List<Project>> projectGroupMap, ChartTypeEnum chartTypeEnum) {
AnalysisChart analysisChart = new AnalysisChart();
List<AnalysisData> dataList = new ArrayList<>();
analysisChart.setChartType(chartTypeEnum);
analysisChart.setDataList(dataList);
for (T key : keyValueMap.keySet()) {
AnalysisData analysisData = new AnalysisData();
String chartKey = keyValueMap.get(key);
List<Project> projectList = projectGroupMap.get(key);
analysisData.setKey(chartKey);
analysisData.setValue(CollUtil.isEmpty(projectList) ? 0 : projectList.size());
dataList.add(analysisData);
}
return analysisChart;
}

public <T> AnalysisChart assemblerAnalysisChart(Map<String, List<T>> dictionaryCodeIdMap
, ChartTypeEnum chartTypeEnum) {
AnalysisChart analysisChart = new AnalysisChart();
List<AnalysisData> dataList = new ArrayList<>();
analysisChart.setChartType(chartTypeEnum);
analysisChart.setDataList(dataList);

for (String dictionaryCode : dictionaryCodeIdMap.keySet()) {
AnalysisData analysisData = new AnalysisData();
analysisData.setKey(dictionaryCache.getByCode(dictionaryCode).getName());
analysisData.setValue(dictionaryCodeIdMap.get(dictionaryCode).size());
dataList.add(analysisData);
}
return analysisChart;
}
}

+ 77
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/helper/DashboardHelper.java View File

@@ -0,0 +1,77 @@
package com.ningdatech.pmapi.dashboard.helper;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.dashboard.constant.AnalysisBasicConstant;
import com.ningdatech.pmapi.sys.model.entity.Region;
import com.ningdatech.pmapi.sys.service.IRegionService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
* @author liuxinxin
* @date 2023/8/3 下午3:13
*/

@Component
@RequiredArgsConstructor
public class DashboardHelper {

private final IRegionService iRegionService;

/**
* 获取丽水区域相关信息
*/
public Map<String, String> getLiShuiRegionCodeNameMap() {
List<Region> regionList = iRegionService.list(Wrappers.lambdaQuery(Region.class)
.eq(Region::getParentCode, AnalysisBasicConstant.LS_REGION_CODE));
Map<String, String> regionCodeNameMap = regionList.stream().collect(Collectors.toMap(Region::getRegionCode, Region::getRegionName));
return regionCodeNameMap;
}

/**
* 获取增补情况键值表
*/
public Map<Integer, String> getTemporaryAugmentMap() {
// 0:否 1:是
Map<Integer, String> map = new HashMap<>();
map.put(1, "增补项目");
map.put(0, "非增补项目");
return map;
}


/**
* 获取项目类型键值表
*/
public Map<Integer, String> getProjectTypeMap() {
// "项目类型 1:建设 2:运维
Map<Integer, String> map = new HashMap<>();
map.put(1, "建设");
map.put(2, "运维");
return map;
}

/**
* 获取项目类型键值表
*/
public Map<Integer, String> getBizDomainMap() {
// 综合业务领域 1: '党政机关整体智治',2: '数字政府',3: '数字经济',4: '数字社会',7: '数字文化',5: '数字法治',6: '一体化智能化公共数据平台', 8: '基层智治'
Map<Integer, String> map = new HashMap<>();
map.put(1, "党政机关整体智治");
map.put(2, "数字政府");
map.put(3, "数字经济");
map.put(4, "数字社会");
map.put(5, "数字文化");
map.put(6, "数字法治");
map.put(7, "一体化智能化公共数据平台");
map.put(8, "基层智治");
return map;
}


}

+ 168
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardExpertManage.java View File

@@ -0,0 +1,168 @@
package com.ningdatech.pmapi.dashboard.manage;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.dashboard.constant.ChartTypeEnum;
import com.ningdatech.pmapi.dashboard.helper.DashboardChartAssembler;
import com.ningdatech.pmapi.dashboard.helper.DashboardHelper;
import com.ningdatech.pmapi.dashboard.model.basic.AnalysisChart;
import com.ningdatech.pmapi.dashboard.model.basic.AnalysisData;
import com.ningdatech.pmapi.dashboard.model.basic.StarExpertBO;
import com.ningdatech.pmapi.dashboard.model.po.QueryYearPO;
import com.ningdatech.pmapi.dashboard.model.vo.ExpertDashboardSummaryVO;
import com.ningdatech.pmapi.expert.constant.ExpertUserInfoStepEnum;
import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo;
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService;
import com.ningdatech.pmapi.meeting.entity.domain.Meeting;
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpertJudge;
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum;
import com.ningdatech.pmapi.meeting.service.IMeetingExpertJudgeService;
import com.ningdatech.pmapi.meeting.service.IMeetingService;
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum;
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary;
import com.ningdatech.pmapi.meta.service.IExpertDictionaryService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
* @author liuxinxin
* @date 2023/8/2 上午10:39
*/

@Component
@RequiredArgsConstructor
public class DashboardExpertManage {

private final DashboardHelper dashboardHelper;
private final IExpertUserFullInfoService iExpertUserFullInfoService;
private final IMeetingService iMeetingService;
// private final DictionaryCache dictionaryCache;
private final IMeetingExpertJudgeService iMeetingExpertJudgeService;
private final IExpertDictionaryService iExpertDictionaryService;
private final DashboardChartAssembler dashboardChartAssembler;


public ExpertDashboardSummaryVO getExpertDashboardSummary(QueryYearPO queryYearPO) {
String queryRegionCode = queryYearPO.getRegionCode();
List<AnalysisChart> analysisChartList = new ArrayList<>();

// 获取丽水区域 code name Map
Map<String, String> liShuiRegionCodeNameMap = dashboardHelper.getLiShuiRegionCodeNameMap();
// 获取库内所有的专家列表
List<ExpertUserFullInfo> evidenceHasBeenSubmittedExpertInfoList = iExpertUserFullInfoService.list(Wrappers.lambdaQuery(ExpertUserFullInfo.class)
.eq(ExpertUserFullInfo::getUserInfoStep, ExpertUserInfoStepEnum.EVIDENCE_HAS_BEEN_SUBMITTED.getKey()));

// 专家regionCode分组map列表
Map<String, List<ExpertUserFullInfo>> regionCodeExpertMap = evidenceHasBeenSubmittedExpertInfoList.stream()
.collect(Collectors.groupingBy(ExpertUserFullInfo::getRegionCode));

// 各区域专家数量
AnalysisChart regionExpertNumberChartAnalysisChart = new AnalysisChart();
List<AnalysisData> regionExpertNumberChartDataList = new ArrayList<>();
regionExpertNumberChartAnalysisChart.setChartType(ChartTypeEnum.REGION_EXPERT_NUMBER_CHART);
regionExpertNumberChartAnalysisChart.setDataList(regionExpertNumberChartDataList);
for (String regionCode : liShuiRegionCodeNameMap.keySet()) {
AnalysisData analysisData = new AnalysisData();
String regionName = liShuiRegionCodeNameMap.get(regionCode);
List<ExpertUserFullInfo> expertUserFullInfoList = regionCodeExpertMap.get(regionCode);
Integer expertCnt = 0;
if (CollectionUtil.isNotEmpty(expertUserFullInfoList)) {
expertCnt = expertUserFullInfoList.size();
}
analysisData.setKey(regionName);
analysisData.setValue(expertCnt);
regionExpertNumberChartDataList.add(analysisData);
}
analysisChartList.add(regionExpertNumberChartAnalysisChart);

// 查询区域的专家id 列表
List<Long> regionDegreeExpertIdList = new ArrayList<>();
if (StringUtils.isNotBlank(queryRegionCode)) {
List<ExpertUserFullInfo> expertUserFullInfoList = regionCodeExpertMap.get(queryRegionCode);
if (CollectionUtil.isNotEmpty(expertUserFullInfoList)) {
regionDegreeExpertIdList = expertUserFullInfoList.stream()
.map(ExpertUserFullInfo::getUserId)
.collect(Collectors.toList());
}
} else {
regionDegreeExpertIdList = evidenceHasBeenSubmittedExpertInfoList.stream()
.map(ExpertUserFullInfo::getUserId)
.collect(Collectors.toList());
}

if (CollectionUtil.isNotEmpty(regionDegreeExpertIdList)) {
// 区域学历分布
List<ExpertDictionary> degreeExpertDictionaryList = iExpertDictionaryService
.listByUserId(regionDegreeExpertIdList, DictExpertInfoTypeEnum.DEGREE);
Map<String, List<String>> degreeCodeMap = degreeExpertDictionaryList.stream()
.map(ExpertDictionary::getDictionaryCode)
.collect(Collectors.groupingBy(Function.identity()));
AnalysisChart regionExpertEducationChartAnalysisChart =
dashboardChartAssembler.assemblerAnalysisChart(degreeCodeMap, ChartTypeEnum.REGION_EXPERT_EDUCATION_CHART);
analysisChartList.add(regionExpertEducationChartAnalysisChart);

// 区域职称级别分布
List<ExpertDictionary> titleLevelExpertDictionaryList = iExpertDictionaryService
.listByUserId(regionDegreeExpertIdList, DictExpertInfoTypeEnum.TITLE_LEVEL);
Map<String, List<ExpertDictionary>> titleLevelCodeMap = titleLevelExpertDictionaryList.stream()
.collect(Collectors.groupingBy(ExpertDictionary::getDictionaryCode));
AnalysisChart regionExpertTitleLevelChartAnalysisChart =
dashboardChartAssembler.assemblerAnalysisChart(titleLevelCodeMap, ChartTypeEnum.REGION_EXPERT_TITLE_LEVEL_CHART);
analysisChartList.add(regionExpertTitleLevelChartAnalysisChart);
}

// 评审次数
List<Meeting> normalMeetingList = iMeetingService.list(Wrappers.lambdaQuery(Meeting.class)
.eq(StringUtils.isNotBlank(queryRegionCode), Meeting::getRegionCode, queryRegionCode)
.ne(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode()));
Integer meetingCnt = normalMeetingList.size();

// 各类型评审次数
Map<String, List<Meeting>> meetingTypeMap = normalMeetingList.stream().collect(Collectors.groupingBy(Meeting::getType));
AnalysisChart meetingTypeCntChartAnalysisChart =
dashboardChartAssembler.assemblerAnalysisChart(meetingTypeMap, ChartTypeEnum.MEETING_TYPE_CNT_CHART);
analysisChartList.add(meetingTypeCntChartAnalysisChart);

// 明星专家列表
List<StarExpertBO> starExpertList = new ArrayList<>();
List<MeetingExpertJudge> meetingExpertJudgeList = iMeetingExpertJudgeService.list();
Map<Long, List<MeetingExpertJudge>> expertIdMeetingExpertJudgeMap = meetingExpertJudgeList.stream()
.collect(Collectors.groupingBy(MeetingExpertJudge::getExpertId));
Map<Long, String> expertIdExpertNameMap = evidenceHasBeenSubmittedExpertInfoList.stream()
.collect(Collectors.toMap(ExpertUserFullInfo::getUserId, ExpertUserFullInfo::getExpertName));

for (Long expertId : expertIdMeetingExpertJudgeMap.keySet()) {
String expertName = expertIdExpertNameMap.get(expertId);
List<MeetingExpertJudge> expertMeetingExpertJudgeList = expertIdMeetingExpertJudgeMap.get(expertId);
DoubleSummaryStatistics statistics = expertMeetingExpertJudgeList
.stream().filter(r -> Objects.nonNull(r.getScore()))
.map(MeetingExpertJudge::getScore).mapToDouble(Number::doubleValue).summaryStatistics();
double average = statistics.getAverage();
StarExpertBO starExpertBO = new StarExpertBO();
starExpertBO.setAveragePerformanceScore(average);
starExpertBO.setExpertId(expertId);
starExpertBO.setExpertName(expertName);
starExpertList.add(starExpertBO);
}
starExpertList = starExpertList.stream()
.sorted(Comparator.comparing(StarExpertBO::getAveragePerformanceScore)
.reversed()).collect(Collectors.toList());
if (starExpertList.size() > 5) {
starExpertList = starExpertList.subList(0, 5);
}

// 装配返回类
ExpertDashboardSummaryVO expertDashboardSummaryVO = new ExpertDashboardSummaryVO();
expertDashboardSummaryVO.setMeetingCnt(meetingCnt);
expertDashboardSummaryVO.setStarExpertList(starExpertList);
expertDashboardSummaryVO.setAnalysisChartList(analysisChartList);
return expertDashboardSummaryVO;
}

}


+ 317
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardProjectManage.java View File

@@ -0,0 +1,317 @@
package com.ningdatech.pmapi.dashboard.manage;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.dashboard.constant.ChartTypeEnum;
import com.ningdatech.pmapi.dashboard.helper.DashboardChartAssembler;
import com.ningdatech.pmapi.dashboard.helper.DashboardHelper;
import com.ningdatech.pmapi.dashboard.model.basic.AnalysisChart;
import com.ningdatech.pmapi.dashboard.model.basic.CompanyProjectCntBO;
import com.ningdatech.pmapi.dashboard.model.basic.ProjectATIISBO;
import com.ningdatech.pmapi.dashboard.model.po.QueryYearPO;
import com.ningdatech.pmapi.dashboard.model.vo.DashboardInvestmentSummaryVO;
import com.ningdatech.pmapi.dashboard.model.vo.DashboardProjectCntSummaryVO;
import com.ningdatech.pmapi.dashboard.model.vo.DashboardProjectSummaryVO;
import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase;
import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectDelayApply;
import com.ningdatech.pmapi.projectlib.service.INdProjectDelayApplyService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

/**
* @author liuxinxin
* @date 2023/8/2 上午10:39
*/

@Component
@RequiredArgsConstructor
public class DashboardProjectManage {

private final IProjectService iProjectService;
private final INdProjectDelayApplyService iProjectDelayApplyService;
private final DashboardHelper dashboardHelper;
private final IPurchaseService iPurchaseService;

public DashboardProjectSummaryVO getProjectSummary(QueryYearPO queryYearPO) {
// 预算年度
Integer year = queryYearPO.getYear();
String regionCode = queryYearPO.getRegionCode();
List<Project> allProjectWithRepeatList = iProjectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Objects.nonNull(year), Project::getProjectYear, year)
.eq(StringUtils.isNotBlank(regionCode), Project::getAreaCode, regionCode)
);
List<Project> allProjectList = allProjectWithRepeatList.stream()
.filter(r -> r.getNewest()).collect(Collectors.toList());

List<Long> allProjectIdWithRepeatList = allProjectWithRepeatList.stream().map(Project::getId).collect(Collectors.toList());

// 项目总数
Integer projectCnt = allProjectList.size();

// 待立项项目数
List<Project> toBeApprovedProjectList = allProjectList.stream()
.filter(r -> ProjectStatusEnum.TO_BE_APPROVED.getCode().equals(r.getStatus()))
.collect(Collectors.toList());
Integer toBeApprovedProjectCnt = toBeApprovedProjectList.size();

// 已立项项目数
Integer approvedProjectCnt = projectCnt - toBeApprovedProjectCnt;

// 项目立项率
Double projectApprovalRate = new BigDecimal((float) approvedProjectCnt / projectCnt).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

// 项目申报总金额
List<BigDecimal> declareAmountList = allProjectList.stream().filter(r -> Objects.nonNull(r.getDeclareAmount()))
.map(Project::getDeclareAmount).
collect(Collectors.toList());
BigDecimal declareAmountSum = new BigDecimal("0");
for (BigDecimal declareAmount : declareAmountList) {
declareAmountSum.add(declareAmount);
}

// 项目批复总金额
List<BigDecimal> approvedTotalInvestmentIncreaseList = allProjectList.stream().filter(r -> Objects.nonNull(r.getApprovedTotalInvestmentIncrease()))
.map(Project::getApprovedTotalInvestmentIncrease)
.collect(Collectors.toList());
BigDecimal approvedTotalInvestmentIncreaseSum = new BigDecimal("0");
for (BigDecimal approvedTotalInvestmentIncrease : approvedTotalInvestmentIncreaseList) {
approvedTotalInvestmentIncreaseSum.add(approvedTotalInvestmentIncrease);
}

// 资金核定率
BigDecimal fundApprovalRate = new BigDecimal("0");
if (new BigDecimal("0").compareTo(approvedTotalInvestmentIncreaseSum) != 0) {
fundApprovalRate = declareAmountSum.divide(approvedTotalInvestmentIncreaseSum, 2, BigDecimal.ROUND_HALF_UP);
}


// 项目采购总金额
BigDecimal projectProcurementTotalAmount = new BigDecimal("0");
List<Purchase> purchaseList = iPurchaseService.list(Wrappers.lambdaQuery(Purchase.class)
.in(Purchase::getProjectId, allProjectIdWithRepeatList));
for (Purchase purchase : purchaseList) {
BigDecimal transactionAmount = purchase.getTransactionAmount();
if (Objects.nonNull(transactionAmount)) {
projectProcurementTotalAmount.add(transactionAmount);
}
}

// 项目画像

// 延期项目数 延期占比
List<ProjectDelayApply> projectDelayApplyList = iProjectDelayApplyService
.list(Wrappers.lambdaQuery(ProjectDelayApply.class)
.in(ProjectDelayApply::getProjectId, allProjectIdWithRepeatList));
Map<Long, List<ProjectDelayApply>> projectDelayApplyListMap = projectDelayApplyList.stream().collect(Collectors.groupingBy(ProjectDelayApply::getProjectId));
Integer delayProjectCnt = projectDelayApplyListMap.keySet().size();
Double delayProportion = new BigDecimal((float) delayProjectCnt / projectCnt).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

// 项目变更数量 项目变更金额
List<Project> changedProjectList = new ArrayList<>();
Map<String, List<Project>> allProjectMap = allProjectWithRepeatList.stream().collect(Collectors.groupingBy(Project::getProjectCode));
for (String projectCode : allProjectMap.keySet()) {
List<Project> projectList = allProjectMap.get(projectCode);
Project newestProject = projectList.stream()
.filter(r -> r.getNewest())
.collect(Collectors.toList()).get(0);
Boolean isChanged = false;
for (Project project : projectList) {
Boolean newest = project.getNewest();
Boolean isBackReject = project.getIsBackReject();
if (!newest && isBackReject) {
isChanged = true;
break;
}
}
if (isChanged) {
changedProjectList.add(newestProject);
}
}
Integer changedProjectCnt = changedProjectList.size();

// 项目变更金额
BigDecimal changedProjectContractAmountSum = new BigDecimal("0");
for (Project project : changedProjectList) {
BigDecimal contractAmount = project.getContractAmount();
if (Objects.nonNull(contractAmount)) {
changedProjectContractAmountSum.add(contractAmount);
}
}

// 装配返回VO
DashboardProjectSummaryVO dashboardProjectSummaryVO = new DashboardProjectSummaryVO();
dashboardProjectSummaryVO.setProjectCnt(projectCnt);
dashboardProjectSummaryVO.setApprovedProjectCnt(approvedProjectCnt);
dashboardProjectSummaryVO.setToBeApprovedProjectCnt(toBeApprovedProjectCnt);
dashboardProjectSummaryVO.setProjectApprovalRate(projectApprovalRate);
dashboardProjectSummaryVO.setDeclareAmountSum(declareAmountSum);
dashboardProjectSummaryVO.setApprovedTotalInvestmentIncreaseSum(approvedTotalInvestmentIncreaseSum);

dashboardProjectSummaryVO.setDelayProjectCnt(delayProjectCnt);
dashboardProjectSummaryVO.setDelayProportion(delayProportion);
dashboardProjectSummaryVO.setChangedProjectCnt(changedProjectCnt);
dashboardProjectSummaryVO.setChangedProjectContractAmountSum(changedProjectContractAmountSum);
dashboardProjectSummaryVO.setFundApprovalRate(fundApprovalRate);
return dashboardProjectSummaryVO;
}

public DashboardProjectCntSummaryVO getProjectCntSummary(QueryYearPO queryYearPO) {
// 预算年度
Integer year = queryYearPO.getYear();
String regionCode = queryYearPO.getRegionCode();
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)
);

// 单位项目数量TOP5
List<CompanyProjectCntBO> companyProjectCntTop5List = new ArrayList<>();
Map<String, List<Project>> buildOrgNameProjectGroupMap = allProjectList.stream()
.collect(Collectors.groupingBy(Project::getBuildOrgName));
for (String buildOrgName : buildOrgNameProjectGroupMap.keySet()) {
List<Project> projectList = buildOrgNameProjectGroupMap.get(buildOrgName);
CompanyProjectCntBO companyProjectCntBO = new CompanyProjectCntBO();
companyProjectCntBO.setBuildOrgName(buildOrgName);
companyProjectCntBO.setProjectCnt(projectList.size());
companyProjectCntTop5List.add(companyProjectCntBO);
}
companyProjectCntTop5List = companyProjectCntTop5List.stream()
.sorted(Comparator.comparing(CompanyProjectCntBO::getProjectCnt).reversed())
.collect(Collectors.toList());
if (companyProjectCntTop5List.size() > 5) {
companyProjectCntTop5List = companyProjectCntTop5List.subList(0, 5);
}

// 项目增补情况
Map<Integer, List<Project>> isTemporaryAugmentGroupMap = allProjectList.stream()
.collect(Collectors.groupingBy(Project::getIsTemporaryAugment));
Map<Integer, String> temporaryAugmentMap = dashboardHelper.getTemporaryAugmentMap();
AnalysisChart isTemporaryAugmentAnalysisChart = DashboardChartAssembler.buildAnalysisChart(temporaryAugmentMap, isTemporaryAugmentGroupMap
, ChartTypeEnum.PROJECT_SUPPLEMENTATION_STATUS_CHART);

// 各类型项目数量
Map<Integer, List<Project>> projectTypeGroupMap = allProjectList.stream()
.collect(Collectors.groupingBy(Project::getProjectType));
Map<Integer, String> projectTypeMap = dashboardHelper.getTemporaryAugmentMap();
AnalysisChart projectTypeAnalysisChart = DashboardChartAssembler.buildAnalysisChart(projectTypeMap, projectTypeGroupMap
, ChartTypeEnum.EACH_TYPE_QUANTITY_OF_PROJECT_CHART);

// 各区域项目数量
Map<String, List<Project>> areaCodeGroupMap = allProjectList.stream()
.collect(Collectors.groupingBy(Project::getAreaCode));
Map<String, String> liShuiRegionCodeNameMap = dashboardHelper.getLiShuiRegionCodeNameMap();
AnalysisChart areaCodeAnalysisChart = DashboardChartAssembler.buildAnalysisChart(liShuiRegionCodeNameMap, areaCodeGroupMap
, ChartTypeEnum.PROJECTS_NUMBER_IN_EACH_REGION_CHART);

// 各领域项目数量
Map<Integer, List<Project>> bizDomainGroupMap = allProjectList.stream()
.collect(Collectors.groupingBy(Project::getBizDomain));
Map<Integer, String> bizDomainMap = dashboardHelper.getBizDomainMap();
AnalysisChart bizDomainAnalysisChart = DashboardChartAssembler.buildAnalysisChart(bizDomainMap, bizDomainGroupMap
, ChartTypeEnum.PROJECTS_NUMBER_IN_VARIOUS_FIELDS_CHART);

// 各阶段项目数量
Map<Integer, List<Project>> projectStateGroupMap = allProjectList.stream()
.collect(Collectors.groupingBy(Project::getStage));
AnalysisChart projectStateAnalysisChart = DashboardChartAssembler
.buildProjectStateAnalysisChart(projectStateGroupMap, ChartTypeEnum.PROJECTS_NUMBER_IN_EACH_STAGE_CHART);

DashboardProjectCntSummaryVO dashboardProjectCntSummaryVO = new DashboardProjectCntSummaryVO();
dashboardProjectCntSummaryVO.setCompanyProjectCntTop5List(companyProjectCntTop5List);
List<AnalysisChart> analysisChartList = new ArrayList<>();
dashboardProjectCntSummaryVO.setAnalysisChartList(analysisChartList);
analysisChartList.add(isTemporaryAugmentAnalysisChart);
analysisChartList.add(projectTypeAnalysisChart);
analysisChartList.add(bizDomainAnalysisChart);
analysisChartList.add(areaCodeAnalysisChart);
analysisChartList.add(projectStateAnalysisChart);
return dashboardProjectCntSummaryVO;
}


public DashboardInvestmentSummaryVO getInvestmentSummary(QueryYearPO queryYearPO) {
// 预算年度
Integer year = queryYearPO.getYear();
String regionCode = queryYearPO.getRegionCode();
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)
);

// 项目预算TOP5
List<ProjectATIISBO> projectATIISTop5List = allProjectList.stream().filter(r -> Objects.nonNull(r.getApprovedTotalInvestmentIncrease()))
.map(r -> {
ProjectATIISBO projectATIISBO = new ProjectATIISBO();
projectATIISBO.setProjectId(r.getId());
projectATIISBO.setProjectCode(r.getProjectCode());
projectATIISBO.setProjectName(r.getProjectName());
projectATIISBO.setApprovedTotalInvestmentIncrease(r.getApprovedTotalInvestmentIncrease());
return projectATIISBO;
}).collect(Collectors.toList());
projectATIISTop5List = projectATIISTop5List.stream()
.sorted(Comparator.comparing(ProjectATIISBO::getApprovedTotalInvestmentIncrease)
.reversed()).collect(Collectors.toList());
if (projectATIISTop5List.size() > 5) {
projectATIISTop5List = projectATIISTop5List.subList(0, 5);
}

// 单位预算TOP5
List<CompanyProjectCntBO> companyProjectATIISTop5List = new ArrayList<>();
Map<String, List<Project>> buildOrgNameProjectGroupMap = allProjectList.stream()
.collect(Collectors.groupingBy(Project::getBuildOrgName));
for (String buildOrgName : buildOrgNameProjectGroupMap.keySet()) {
List<Project> projectList = buildOrgNameProjectGroupMap.get(buildOrgName);
CompanyProjectCntBO companyProjectCntBO = new CompanyProjectCntBO();
companyProjectCntBO.setBuildOrgName(buildOrgName);
BigDecimal approvedTotalInvestmentIncreaseSum = new BigDecimal("0");
for (Project project : projectList) {
BigDecimal approvedTotalInvestmentIncrease = project.getApprovedTotalInvestmentIncrease();
if (Objects.nonNull(approvedTotalInvestmentIncrease)) {
approvedTotalInvestmentIncreaseSum.add(approvedTotalInvestmentIncrease);
}
}
companyProjectCntBO.setApprovedTotalInvestmentIncreaseSum(approvedTotalInvestmentIncreaseSum);
companyProjectATIISTop5List.add(companyProjectCntBO);
}
companyProjectATIISTop5List = companyProjectATIISTop5List.stream()
.sorted(Comparator.comparing(CompanyProjectCntBO::getApprovedTotalInvestmentIncreaseSum).reversed())
.collect(Collectors.toList());
if (companyProjectATIISTop5List.size() > 5) {
companyProjectATIISTop5List = companyProjectATIISTop5List.subList(0, 5);
}

// 各领域项目投资情况
Map<Integer, List<Project>> bizDomainGroupMap = allProjectList.stream()
.collect(Collectors.groupingBy(Project::getBizDomain));
Map<Integer, String> bizDomainMap = dashboardHelper.getBizDomainMap();
AnalysisChart bizDomainInvestmentAnalysisChart = DashboardChartAssembler.buildInvestmentAnalysisChart(bizDomainMap, bizDomainGroupMap
, ChartTypeEnum.PROJECTS_INVESTMENT_AMOUNT_IN_VARIOUS_FIELDS_CHART);

// 各区域项目投资情况
Map<String, List<Project>> areaCodeGroupMap = allProjectList.stream()
.collect(Collectors.groupingBy(Project::getAreaCode));
Map<String, String> liShuiRegionCodeNameMap = dashboardHelper.getLiShuiRegionCodeNameMap();
AnalysisChart areaCodeInvestmentAnalysisChart = DashboardChartAssembler.buildInvestmentAnalysisChart(liShuiRegionCodeNameMap, areaCodeGroupMap
, ChartTypeEnum.PROJECTS_INVESTMENT_SITUATION_IN_VARIOUS_REGIONS);

DashboardInvestmentSummaryVO dashboardInvestmentSummaryVO = new DashboardInvestmentSummaryVO();
dashboardInvestmentSummaryVO.setCompanyProjectATIISTop5List(companyProjectATIISTop5List);
dashboardInvestmentSummaryVO.setProjectATIISTop5List(projectATIISTop5List);
List<AnalysisChart> analysisChartList = new ArrayList<>();
dashboardInvestmentSummaryVO.setAnalysisChartList(analysisChartList);
analysisChartList.add(areaCodeInvestmentAnalysisChart);
analysisChartList.add(bizDomainInvestmentAnalysisChart);
return dashboardInvestmentSummaryVO;
}

}

+ 25
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/AnalysisChart.java View File

@@ -0,0 +1,25 @@
package com.ningdatech.pmapi.dashboard.model.basic;

import com.ningdatech.pmapi.dashboard.constant.ChartTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
* @author liuxinxin
* @date 2023/8/2 下午3:02
*/

@Data
@ApiModel("图表数据")
public class AnalysisChart {

@ApiModelProperty("图表数据类型")
private ChartTypeEnum chartType;

@ApiModelProperty("数据列表")
private List<AnalysisData> dataList;

}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/AnalysisData.java View File

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.dashboard.model.basic;

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

/**
* @author liuxinxin
* @date 2023/8/2 下午2:27
*/

@Data
@ApiModel("分析数据基础类")
public class AnalysisData {

@ApiModelProperty("key")
private String key;

@ApiModelProperty("值")
private Object value;
}

+ 31
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/CompanyProjectCntBO.java View File

@@ -0,0 +1,31 @@
package com.ningdatech.pmapi.dashboard.model.basic;

import com.ningdatech.pmapi.common.compare.Compare;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
* @author liuxinxin
* @date 2023/8/4 下午3:51
*/

@Data
@ApiModel("单位项目数量")
public class CompanyProjectCntBO {

@ApiModelProperty("建设单位名称")
private String buildOrgName;

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

@ApiModelProperty("项目数量")
private Integer projectCnt;

@ApiModelProperty("项目预算(批复金额总合)")
private BigDecimal approvedTotalInvestmentIncreaseSum;

}

+ 31
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/ProjectATIISBO.java View File

@@ -0,0 +1,31 @@
package com.ningdatech.pmapi.dashboard.model.basic;

import com.ningdatech.pmapi.common.compare.Compare;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
* @author liuxinxin
* @date 2023/8/4 下午4:12
*/

@Data
@ApiModel("项目预算")
public class ProjectATIISBO {

@ApiModelProperty("项目id")
private Long projectId;

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

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

@ApiModelProperty("批复金额")
@Compare("批复金额")
private BigDecimal approvedTotalInvestmentIncrease;
}

+ 23
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/QueryTimeYearBO.java View File

@@ -0,0 +1,23 @@
package com.ningdatech.pmapi.dashboard.model.basic;

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

import java.time.LocalDateTime;

/**
* @author liuxinxin
* @date 2023/7/27 下午3:24
*/

@Data
@ApiModel("查询年份起止BO")
public class QueryTimeYearBO {

@ApiModelProperty("开始年份时间")
private LocalDateTime startYearTime;

@ApiModelProperty("截止年份时间")
private LocalDateTime endYearTime;
}

+ 24
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/StarExpertBO.java View File

@@ -0,0 +1,24 @@
package com.ningdatech.pmapi.dashboard.model.basic;

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

/**
* @author liuxinxin
* @date 2023/8/2 下午3:57
*/

@Data
@ApiModel("明星专家")
public class StarExpertBO {

@ApiModelProperty("专家姓名")
private String expertName;

@ApiModelProperty("专家id")
private Long expertId;

@ApiModelProperty("履职平均分")
private Double averagePerformanceScore;
}

+ 45
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/YearTrendBO.java View File

@@ -0,0 +1,45 @@
package com.ningdatech.pmapi.dashboard.model.basic;

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

/**
* @author liuxinxin
* @date 2023/8/4 下午4:27
*/

@Data
@ApiModel("年度走势BO")
public class YearTrendBO {

@ApiModelProperty("年份")
private Integer year;

@ApiModelProperty("项目总数")
private Integer projectCnt;

/**
* 建设类项目总数
*/

/**
* 运维类项目总数
*/

/**
* 建设类项目批复金额
*/

/**
* 运维类项目批复金额
*/

/**
* 资金核定率
*/

/**
* 立项率
*/
}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/po/QueryYearPO.java View File

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.dashboard.model.po;

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

/**
* @author liuxinxin
* @date 2023/8/2 下午3:51
*/

@Data
@ApiModel("查询年份")
public class QueryYearPO {

@ApiModelProperty("查询年份")
private Integer year;

@ApiModelProperty("区域编码")
private String regionCode;
}

+ 34
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardInvestmentSummaryVO.java View File

@@ -0,0 +1,34 @@
package com.ningdatech.pmapi.dashboard.model.vo;

import com.ningdatech.pmapi.dashboard.model.basic.AnalysisChart;
import com.ningdatech.pmapi.dashboard.model.basic.CompanyProjectCntBO;
import com.ningdatech.pmapi.dashboard.model.basic.ProjectATIISBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
* @author liuxinxin
* @date 2023/8/2 下午3:36
*/

@Data
@ApiModel("驾驶舱投资金额统计数据")
public class DashboardInvestmentSummaryVO {

/**
* 近5年项目投资走势
* 近5年资金核定率走势
*/

@ApiModelProperty("项目预算TOP5")
private List<ProjectATIISBO> projectATIISTop5List;

@ApiModelProperty("单位预算TOP5")
private List<CompanyProjectCntBO> companyProjectATIISTop5List;

@ApiModelProperty("各领域项目投资金额,各区域项目投资情况")
private List<AnalysisChart> analysisChartList;
}

+ 30
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardProjectCntSummaryVO.java View File

@@ -0,0 +1,30 @@
package com.ningdatech.pmapi.dashboard.model.vo;

import com.ningdatech.pmapi.dashboard.model.basic.AnalysisChart;
import com.ningdatech.pmapi.dashboard.model.basic.CompanyProjectCntBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
* @author liuxinxin
* @date 2023/8/2 下午3:36
*/

@Data
@ApiModel("项目数量驶舱统计数据")
public class DashboardProjectCntSummaryVO {
/**
* 近5年项目数量走势
* 近5年立项率走势
*/

@ApiModelProperty("单位项目数量TOP5")
private List<CompanyProjectCntBO> companyProjectCntTop5List;

@ApiModelProperty("项目增补情况,各类型项目数量,各区域项目数量,各领域项目数量,各阶段项目数量")
private List<AnalysisChart> analysisChartList;

}

+ 58
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardProjectSummaryVO.java View File

@@ -0,0 +1,58 @@
package com.ningdatech.pmapi.dashboard.model.vo;

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

import java.math.BigDecimal;

/**
* @author liuxinxin
* @date 2023/8/2 下午3:37
*/
@Data
@ApiModel("驾驶舱项目总览驶舱统计数据")
public class DashboardProjectSummaryVO {
/**
* 项目画像
*/

@ApiModelProperty("项目总数")
private Integer projectCnt;

@ApiModelProperty("待立项项目数")
private Integer toBeApprovedProjectCnt;

@ApiModelProperty("已立项项目数")
private Integer approvedProjectCnt;

@ApiModelProperty("项目立项率")
private Double projectApprovalRate;

@ApiModelProperty("项目申报总金额")
private BigDecimal declareAmountSum;

@ApiModelProperty("项目批复总金额")
private BigDecimal approvedTotalInvestmentIncreaseSum;

@ApiModelProperty("延期项目数")
private Integer delayProjectCnt;

@ApiModelProperty("延期占比")
private Double delayProportion;

@ApiModelProperty("项目变更数量")
private Integer changedProjectCnt;

@ApiModelProperty("项目变更金额")
private BigDecimal changedProjectContractAmountSum;

@ApiModelProperty("项目采购总金额")
private BigDecimal projectProcurementTotalAmount;

// 批复总金额/申报总金额
@ApiModelProperty("资金核定率")
private BigDecimal fundApprovalRate;


}

+ 31
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/ExpertDashboardSummaryVO.java View File

@@ -0,0 +1,31 @@
package com.ningdatech.pmapi.dashboard.model.vo;

import com.ningdatech.pmapi.dashboard.model.basic.AnalysisChart;
import com.ningdatech.pmapi.dashboard.model.basic.StarExpertBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
* @author liuxinxin
* @date 2023/8/2 下午3:07
*/

@Data
@ApiModel("专家驾驶舱统计数据")
public class ExpertDashboardSummaryVO {

@ApiModelProperty("明星专家列表")
private List<StarExpertBO> starExpertList;

@ApiModelProperty("评审次数")
private Integer meetingCnt;

@ApiModelProperty("图表列表 各区域专家总数,学历分布,职称级别分布,各类型评审次数")
List<AnalysisChart> analysisChartList;


}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java View File

@@ -51,7 +51,7 @@ public class DingInfoPullController {

private final ProcDefManage procDefManage;

@Resource(name = "refreshToken")
@Resource
private IRefreshTokenService refreshTokenService;

@Value("${irs.interface-refresh.request-token-url}")


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertMetaApply.java View File

@@ -17,9 +17,9 @@ import java.time.LocalDateTime;
* @author Liuxinxin
* @since 2023-03-01
*/
@TableName("expert_meta_apply")
@ApiModel(value = "ExpertMetaApply对象", description = "")
@Data
@TableName("expert_meta_apply")
@ApiModel(value = "ExpertMetaApply对象")
public class ExpertMetaApply implements Serializable {

private static final long serialVersionUID = 1L;


+ 0
- 29
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java View File

@@ -74,7 +74,6 @@ public class ExpertMetaApplyManage {
private final IExpertDictionaryService iExpertDictionaryService;

public PageVo<ExpertApplyMetaVO> metaApplyListQuery(MetaApplyListQuery req) {
Long expertAdminUserId = LoginUserUtil.getUserId();
// 筛选符合专家类型的用户id
List<Long> filterExpertTypeUserIdList = null;
DictionaryFieldInfo expertType = req.getExpertType();
@@ -129,7 +128,6 @@ public class ExpertMetaApplyManage {
Long applyId = req.getApplyId();
ExpertMetaApply expertMetaApply = iMetaApplyService.getById(applyId);
Long userId = LoginUserUtil.getUserId();

// 校验专家管理员区域权限,是否可以审核当前专家申请
// permissionCheckHelper.operationPermissionsCheck(userId, expertMetaApply.getUserId());
String applyStatus = expertMetaApply.getApplyStatus();
@@ -186,7 +184,6 @@ public class ExpertMetaApplyManage {
break;
}

Long expertUserId = expertMetaApply.getUserId();
String auditOpinion = req.getAuditOpinion();
// 发送审核结果短信
// sendApplyResultNotify(applyType, applyResult, auditOpinion, expertUserId);
@@ -276,13 +273,11 @@ public class ExpertMetaApplyManage {
private void buildIntentionApplyDisplayVO(MetaApplyResultVo metaApplyResultVo, ExpertMetaApply metaApply, ExpertApplyTypeEnum applyTypeEnum) {
String regionCode = metaApply.getRegionCode();
Integer regionLevel = metaApply.getRegionLevel();
// String unionPathStr = regionCache.getUnionPathStr(regionCode, regionLevel);
MetaApplyResultVo.IntentionApplyDisplayVO intentionApplyDisplayVO = new MetaApplyResultVo.IntentionApplyDisplayVO();
intentionApplyDisplayVO.setExpertApplyId(metaApply.getId());
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo();
expertRegionInfo.setRegionCode(regionCode);
expertRegionInfo.setRegionLevel(regionLevel);
// expertRegionInfo.setRegionName(unionPathStr);
switch (applyTypeEnum) {
case EXPERT_INTENTION_LEAVE: {
intentionApplyDisplayVO.setReduceExpertRegion(expertRegionInfo);
@@ -298,30 +293,6 @@ public class ExpertMetaApplyManage {
metaApplyResultVo.setIntentionApplyDisplayVo(intentionApplyDisplayVO);
}

// private void buildInfoModifyApplyDisplayVO(MetaApplyResultVo metaApplyResultVo, ExpertMetaApply infoModifyApply) {
// InfoModifyApplyDisplayVO infoModifyApplyDisplayVo = new InfoModifyApplyDisplayVO();
// if (Objects.nonNull(infoModifyApply)) {
// Long metaApplyId = infoModifyApply.getId();
// LambdaQueryWrapper<ExpertSensitiveInfoModifyDetailRecord> eq = Wrappers.lambdaQuery(ExpertSensitiveInfoModifyDetailRecord.class)
// .eq(ExpertSensitiveInfoModifyDetailRecord::getMetaApplyId, metaApplyId);
// ExpertSensitiveInfoModifyDetailRecord one = iExpertSensitiveInfoModifyDetailRecordService.getOne(eq);
// String originalJson = null;
// if (StringUtils.isNotBlank(one.getOriginalJson())) {
// originalJson = GzipUtils.uncompress(one.getOriginalJson());
// }
// List<SensitiveModifySegment> sensitiveModifySegments = JSONUtils.parseArray(originalJson, SensitiveModifySegment.class);
//
// infoModifyApplyDisplayVo.setExpertApplyId(metaApplyId);
// List<InfoModifyApplyDisplayVO.InfoModifyApplyDisplayValue> displayValueList = new ArrayList<>();
// for (SensitiveModifySegment segment : sensitiveModifySegments) {
// InfoModifyApplyDisplayVO.InfoModifyApplyDisplayValue displayValue = sensitiveModifySegmentParser.getDisplayValue(segment);
// displayValueList.add(displayValue);
// }
// infoModifyApplyDisplayVo.setInfoModifyApplyDisplayValueList(displayValueList);
// metaApplyResultVo.setInfoModifyApplyDisplayVo(infoModifyApplyDisplayVo);
// }
// }

private String applyTypeTrans(ExpertApplyTypeEnum applyTypeEnum) {
switch (applyTypeEnum) {
case EXPERT_INTENTION_JOIN:


+ 23
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/constant/ExpertAuditMsgTemplate.java View File

@@ -0,0 +1,23 @@
package com.ningdatech.pmapi.expert.model.constant;

/**
* <p>
* ExpertAuditMsgTemplate
* </p>
*
* @author WendyYang
* @since 2023/8/7
**/
public interface ExpertAuditMsgTemplate {

/**
* 【丽水市大数据局】尊敬的xxx专家您好,您提交的专家入库申请未通过,如有疑问请联系xxx确认。
*/
String EXPERT_AUDIT_PASS_MSG = "尊敬的%s专家您好,您提交的专家入库申请未通过,如有疑问请联系%s「%s」确认。";

/**
* 【丽水市大数据局】尊敬的xxx专家您好,您提交的专家入库申请已通过,请登录http://60.188.225.145/login查看,如有疑问请联系xxx。
*/
String EXPERT_AUDIT_FAIL_MSG = "尊敬的%s专家您好,您提交的专家入库申请已通过,请登录%s查看,如有疑问请联系%s「%s」。";

}

+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/enumeration/ReviewTemplateTypeEnum.java View File

@@ -23,8 +23,9 @@ public enum ReviewTemplateTypeEnum {

ACCEPTANCE_SCHEME_REVIEW("验收方案评审", 3),

DEPT_JOIN_REVIEW("部门联审", 4);
DEPT_JOIN_REVIEW("部门联审", 4),

FAIRNESS_REVIEW("公平性审查", 5);

private final String value;
private final Integer code;


+ 28
- 9
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java View File

@@ -1,6 +1,7 @@
package com.ningdatech.pmapi.expert.service.impl;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.PhoneUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -19,9 +20,11 @@ import com.ningdatech.pmapi.expert.model.SensitiveModifySegment;
import com.ningdatech.pmapi.expert.model.TagFieldInfo;
import com.ningdatech.pmapi.expert.model.bo.ExpertInfoSensitiveFieldCheckBO;
import com.ningdatech.pmapi.expert.model.cmd.*;
import com.ningdatech.pmapi.expert.model.constant.ExpertAuditMsgTemplate;
import com.ningdatech.pmapi.expert.model.dto.*;
import com.ningdatech.pmapi.expert.service.*;
import com.ningdatech.pmapi.expert.utils.SensitiveModifySegmentUtils;
import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper;
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum;
import com.ningdatech.pmapi.meta.constant.ExpertTagEnum;
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo;
@@ -33,16 +36,17 @@ import com.ningdatech.pmapi.sys.model.entity.Role;
import com.ningdatech.pmapi.sys.model.entity.UserRole;
import com.ningdatech.pmapi.sys.service.IRoleService;
import com.ningdatech.pmapi.sys.service.IUserRoleService;
import com.ningdatech.pmapi.sys.service.impl.UserRoleServiceImpl;
import com.ningdatech.pmapi.user.constant.UserAvailableEnum;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.ningdatech.yxt.utils.JSONUtils;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@@ -51,6 +55,8 @@ import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

import static com.ningdatech.yxt.model.cmd.SendSmsCmd.SendSmsContext;

/**
* @author liuxinxin
* @date 2022/7/22 下午4:39
@@ -69,7 +75,10 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
private final IUserRoleService userRoleService;
private final IExpertSensitiveInfoModifyDetailRecordService iExpertSensitiveInfoModifyDetailRecordService;
private final IUserInfoService userInfoService;
private final YxtCallOrSmsHelper yxtCallOrSmsHelper;

@Value("${login.url:}")
private String loginUrl;

/**
* 用户第一次申请修改,仅在专家用户状态为applying 状态时调用
@@ -387,16 +396,18 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
@Transactional(rollbackFor = Exception.class)
public void expertStorageDeal(ExpertStorageDealCmd cmd) {
Long expertUserId = cmd.getExpertUserId();
ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(expertUserId);
ExpertUserFullInfo expertInfo = iExpertUserFullInfoService.getByUserId(expertUserId);
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail();
String smsContent;
if (cmd.getApplyResult()) {
// 修改专家状态为可用
expertUserFullInfo.setExpertAccountStatus(ExpertAccountStatusEnum.AVAILABLE.getKey());
expertUserFullInfo.setRemark(cmd.getRemark());
expertUserFullInfo.setRegionCode(cmd.getJoinRegionCode());
expertUserFullInfo.setRegionLevel(cmd.getJoinRegionLevel());
expertInfo.setExpertAccountStatus(ExpertAccountStatusEnum.AVAILABLE.getKey());
expertInfo.setRemark(cmd.getRemark());
expertInfo.setRegionCode(cmd.getJoinRegionCode());
expertInfo.setRegionLevel(cmd.getJoinRegionLevel());
// 账号启用
LambdaUpdateWrapper<UserInfo> userInfoUpdate = Wrappers.lambdaUpdate(UserInfo.class)
.eq(UserInfo::getId,expertUserId)
.eq(UserInfo::getId, expertUserId)
.set(UserInfo::getAvailable, UserAvailableEnum.ENABLE);
userInfoService.update(userInfoUpdate);

@@ -421,10 +432,18 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
userRoleService.save(saveUserRole);
}
}
smsContent = String.format(ExpertAuditMsgTemplate.EXPERT_AUDIT_PASS_MSG, expertInfo.getExpertName(), userDetail.getRealName(), userDetail.getMobile());
} else {
expertUserFullInfo.setUserInfoStep(ExpertUserInfoStepEnum.INFORMATION_TO_BE_SUBMITTED.getKey());
expertInfo.setUserInfoStep(ExpertUserInfoStepEnum.INFORMATION_TO_BE_SUBMITTED.getKey());
smsContent = String.format(ExpertAuditMsgTemplate.EXPERT_AUDIT_FAIL_MSG, expertInfo.getExpertName(), loginUrl, userDetail.getRealName(), userDetail.getMobile());
}
iExpertUserFullInfoService.saveOrUpdate(expertInfo);
if (PhoneUtil.isMobile(expertInfo.getPhoneNo())) {
SendSmsContext smsCtx = new SendSmsContext();
smsCtx.setContent(smsContent);
smsCtx.setReceiveNumber(expertInfo.getPhoneNo());
yxtCallOrSmsHelper.sendSms(smsCtx);
}
iExpertUserFullInfoService.saveOrUpdate(expertUserFullInfo);
}




+ 52
- 56
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java View File

@@ -123,13 +123,13 @@ public class ProjectFileManage {
String empPosUnitCode = userFullInfo.getEmpPosUnitCode();

Page<Project> page = param.page();
projectService.page(page,Wrappers.lambdaQuery(Project.class)
.like(StringUtils.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName())
.like(StringUtils.isNotBlank(param.getBuildOrgName()),Project::getBuildOrgName,param.getBuildOrgName())
projectService.page(page, Wrappers.lambdaQuery(Project.class)
.like(StringUtils.isNotBlank(param.getProjectName()), Project::getProjectName, param.getProjectName())
.like(StringUtils.isNotBlank(param.getBuildOrgName()), Project::getBuildOrgName, param.getBuildOrgName())
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode())
.orderByDesc(Project::getUpdateOn));

if(0L == page.getTotal()){
if (0L == page.getTotal()) {
return PageVo.empty();
}

@@ -140,7 +140,7 @@ public class ProjectFileManage {
ProjectFileListVO vo = new ProjectFileListVO();
vo.setId(p.getId());
// 用户只可查阅自己及下属单位的项目档案和已经申请借阅通过的项目档案
if (subOrgSet.contains(p.getBuildOrgCode()) || checkCanRead(subOrgSet,p)) {
if (subOrgSet.contains(p.getBuildOrgCode()) || checkCanRead(subOrgSet, p)) {
vo.setCanRead(Boolean.TRUE);
}
vo.setBuildOrgName(p.getBuildOrgName());
@@ -148,7 +148,7 @@ public class ProjectFileManage {
vo.setProjectName(p.getProjectName());
// 判断当前项目,当前登录用户是否已经开启了申请借阅并且没有审批完成
ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class)
.eq(ProjectApplyBorrow::getApplyBorrowEmployeeCode,employeeCode)
.eq(ProjectApplyBorrow::getApplyBorrowEmployeeCode, employeeCode)
.eq(ProjectApplyBorrow::getProjectId, p.getId())
.orderByDesc(ProjectApplyBorrow::getCreateOn)
.last("limit 1"));
@@ -200,8 +200,8 @@ public class ProjectFileManage {
// 先将自己加入子集
orgSet.add(empPosUnitCode);
Set<String> subOrgList = dingOrganizationService
.list(Wrappers.lambdaQuery(DingOrganization.class).eq(DingOrganization::getParentCode, empPosUnitCode))
.stream().map(DingOrganization::getOrganizationCode).collect(Collectors.toSet());
.list(Wrappers.lambdaQuery(DingOrganization.class).eq(DingOrganization::getParentCode, empPosUnitCode))
.stream().map(DingOrganization::getOrganizationCode).collect(Collectors.toSet());
// 遍历子集
for (String orgCode : subOrgList) {
orgSet.addAll(getSubOrgList(orgCode));
@@ -218,7 +218,7 @@ public class ProjectFileManage {
Project project = projectService.getById(projectId);
Set<String> subOrgList = getSubOrgList(empPosUnitCode);

if (!checkCanRead(subOrgList,project)){
if (!checkCanRead(subOrgList, project)) {
throw new BizException("您没有权限查看此项目档案!");
}
ProjectFileVO projectFileVo = new ProjectFileVO();
@@ -260,8 +260,8 @@ public class ProjectFileManage {
String regionCode = user.getRegionCode();

WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode, regionCode)
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.APPLY_BORROW.getCode()).last(BizConst.LIMIT_1));
.eq(WflowModels::getRegionCode, regionCode)
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.APPLY_BORROW.getCode()).last(BizConst.LIMIT_1));

if (Objects.isNull(model)) {
log.error("此 【{}】区域找不到申请借阅流程配置", regionCode);
@@ -277,7 +277,7 @@ public class ProjectFileManage {
// 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMapUserOrgCode(project);
String instanceId =
processInstanceService.newStartProcess(model.getProcessDefId(), model.getFormId(), params, orgModelMap);
processInstanceService.newStartProcess(model.getProcessDefId(), model.getFormId(), params, orgModelMap);
log.info("申请借阅申报成功 【{}】", instanceId);

// 保存项目借阅实例相关
@@ -285,7 +285,7 @@ public class ProjectFileManage {

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

return instanceId;
}
@@ -295,48 +295,43 @@ public class ProjectFileManage {
// 获取项目各阶段上传文件ID
List<Long> fileIdList = Lists.newArrayList();
getProjectAppendix(project, fileIdList);

if (fileIdList.isEmpty()) {
throw BizException.wrap("暂无档案可供下载");
}
List<File> files = fileService.listByIds(fileIdList);
if (files.isEmpty()) {
throw BizException.wrap("暂无档案可供下载");
}
String zipFileName = "项目档案";

// 设置response的header
response.setContentType("application/zip");
response.setHeader("Content-disposition",
"attachment;filename*=utf-8''" + ExcelDownUtil.encodeName(zipFileName) + ".zip");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + ExcelDownUtil.encodeName(zipFileName) + ".zip");

try {
// 创建ZipOutputStream
ZipOutputStream zos = new ZipOutputStream(response.getOutputStream());
if (CollUtil.isNotEmpty(fileIdList)) {
// 对文件ID进行去重
HashSet<Long> hashSet = new HashSet<>();
List<Long> fidList = fileIdList.stream().filter(hashSet::add).collect(Collectors.toList());
// 获取文件输入流
for (Long fileId : fidList) {
File file = fileService.getById(fileId);
// 文件不存在,跳过
if (Objects.isNull(file)) {
continue;
}
String originalFileName = file.getOriginalFileName();
String name = originalFileName.substring(0, originalFileName.indexOf(StrPool.DOT));
String fileName = name + StrPool.UNDERSCORE + fileId
// 获取文件输入流
for (File file : files) {
String originalFileName = file.getOriginalFileName();
String name = originalFileName.substring(0, originalFileName.indexOf(StrPool.DOT));
String fileName = name + StrPool.UNDERSCORE + file.getId()
+ originalFileName.substring(originalFileName.indexOf(StrPool.DOT));
InputStream fileInputStream = fileService.getFileInputStream(file);
// 文件
ZipEntry zipEntry = new ZipEntry(fileName);
zos.putNextEntry(zipEntry);
byte[] bytes = new byte[1024];
int length;
while ((length = fileInputStream.read(bytes)) >= 0) {
zos.write(bytes, 0, length);
}
fileInputStream.close();
zos.closeEntry();
InputStream fileInputStream = fileService.getFileInputStream(file);
// 文件
ZipEntry zipEntry = new ZipEntry(fileName);
zos.putNextEntry(zipEntry);
byte[] bytes = new byte[1024];
int length;
while ((length = fileInputStream.read(bytes)) >= 0) {
zos.write(bytes, 0, length);
}
zos.close();
fileInputStream.close();
zos.closeEntry();
}
zos.close();
} catch (IOException e) {
throw new BizException(e.getMessage());
log.error("项目档案下载失败:", e);
throw BizException.wrap("项目档案下载失败");
}
}

@@ -373,7 +368,7 @@ public class ProjectFileManage {
fileIdList.addAll(projectAppFormFileIdList);
// 获取项目应用信息中的文件
List<ProjectApplication> applicationList = projectApplicationService
.list(Wrappers.lambdaQuery(ProjectApplication.class).eq(ProjectApplication::getProjectId, projectId));
.list(Wrappers.lambdaQuery(ProjectApplication.class).eq(ProjectApplication::getProjectId, projectId));
for (ProjectApplication projectApplication : applicationList) {
// 获取试点文件
String experimentsFile = projectApplication.getExperimentsFile();
@@ -387,7 +382,7 @@ public class ProjectFileManage {
// 流程审核意见文件
// 获取项目关联的流程实例
List<ProjectInst> projectInstList =
projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getProjectId, projectId));
projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getProjectId, projectId));
// 从历史评论表中获取对应流程实例的评论附件信息
for (ProjectInst projectInst : projectInstList) {
String instanceId = projectInst.getInstCode();
@@ -434,7 +429,7 @@ public class ProjectFileManage {

// 采购结果备案阶段
Purchase purchase = purchaseService
.getOne(Wrappers.lambdaQuery(Purchase.class).eq(Purchase::getProjectId, projectId).last(BizConst.LIMIT_1));
.getOne(Wrappers.lambdaQuery(Purchase.class).eq(Purchase::getProjectId, projectId).last(BizConst.LIMIT_1));
// 获取投标文件
if (Objects.nonNull(purchase)) {
String biddingDoc = purchase.getBiddingDoc();
@@ -452,7 +447,7 @@ public class ProjectFileManage {

// 合同备案阶段
Contract contract = contractService
.getOne(Wrappers.lambdaQuery(Contract.class).eq(Contract::getProjectId, projectId).last(BizConst.LIMIT_1));
.getOne(Wrappers.lambdaQuery(Contract.class).eq(Contract::getProjectId, projectId).last(BizConst.LIMIT_1));
// 获取合同附件
if (Objects.nonNull(contract)) {
String attachment = contract.getAttachment();
@@ -528,6 +523,7 @@ public class ProjectFileManage {

/**
* 查看 借阅的详情
*
* @param instanceId
* @return
*/
@@ -536,28 +532,28 @@ public class ProjectFileManage {
.eq(ProjectApplyBorrow::getInstanceId, instanceId)
.last(BizConst.LIMIT_1));

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

ProjectApplyBorrowVO vo = BeanUtil.copyProperties(apply,ProjectApplyBorrowVO.class);
if(StringUtils.isNotBlank(vo.getApplyBorrowEmployeeCode())){
ProjectApplyBorrowVO vo = BeanUtil.copyProperties(apply, ProjectApplyBorrowVO.class);
if (StringUtils.isNotBlank(vo.getApplyBorrowEmployeeCode())) {
UserFullInfoDTO user = userInfoHelper.getUserFullInfoByEmployeeCode(vo.getApplyBorrowEmployeeCode());
if(Objects.nonNull(user)){
if (Objects.nonNull(user)) {
vo.setApplyBorrowEmployeeName(user.getUsername());
}
}
if(StringUtils.isNotBlank(vo.getApplyBorrowEmpPosUnitCode())){
if (StringUtils.isNotBlank(vo.getApplyBorrowEmpPosUnitCode())) {
DingOrganization organization = dingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class)
.eq(DingOrganization::getOrganizationCode, vo.getApplyBorrowEmpPosUnitCode())
.last(BizConst.LIMIT_1));
if(Objects.nonNull(organization)){
if (Objects.nonNull(organization)) {
vo.setApplyBorrowEmpPosUnitName(organization.getOrganizationName());
}
}
if(Objects.nonNull(vo.getProjectId())){
if (Objects.nonNull(vo.getProjectId())) {
Project project = projectService.getById(vo.getProjectId());
if(Objects.nonNull(project)){
if (Objects.nonNull(project)) {
vo.setProjectName(project.getProjectName());
}
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java View File

@@ -73,7 +73,7 @@ public class AppIrsManage {

@Value("${irs.search-app.url}")
private String searchUrl;
@Resource(name = "refreshToken")
@Resource
private IRefreshTokenService refreshTokenService;

@Value("${irs.interface-refresh.request-token-url}")


+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java View File

@@ -22,6 +22,7 @@ public class ApiApplySearchResult implements Serializable {
private String type;
private String status;
private String sysStateTime;
private String systemAreas;
private String deptName;
private String deptCode;
private String fiveAreas;


pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/DashboardController.java → pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/ExpertDashboardController.java View File

@@ -28,7 +28,7 @@ import java.util.List;
@RestController
@AllArgsConstructor
@RequestMapping("/api/v1/dashboard")
public class DashboardController {
public class ExpertDashboardController {

private final DashboardManage dashboardManage;


+ 2
- 5
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/RandomInviteRuleDTO.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.meeting.entity.dto;

import com.ningdatech.pmapi.common.model.ReqRegionDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -30,11 +31,7 @@ public class RandomInviteRuleDTO extends AbstractInviteRule {
@ApiModelProperty("履职意向地层级")
private Integer intentionRegionLevel;

@ApiModelProperty("专家层级编码")
private String expertRegionCode;

@ApiModelProperty("专家层级级别")
private Integer expertRegionLevel;
private List<ReqRegionDTO> expertRegionList;

@ApiModelProperty("专家标签")
private List<ExpertTagChooseDTO> expertTags;


+ 3
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/MeetingReviewTypeEnum.java View File

@@ -26,7 +26,9 @@ public enum MeetingReviewTypeEnum {

ACCEPTANCE_SCHEME_REVIEW("验收方案评审", "3"),

DEPT_JOIN_REVIEW("部门联审", "4");
DEPT_JOIN_REVIEW("部门联审", "4"),

FAIRNESS_REVIEW( "公平性审查","5");

private final String value;
private final String code;


+ 5
- 3
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java View File

@@ -123,9 +123,11 @@ public class ExpertInviteManage {
* @param rule 随机邀请规则
*/
private static void addRegionLimit(LambdaQueryWrapper<ExpertUserFullInfo> query, RandomInviteRuleDTO rule) {
if (ObjectUtils.allNotNull(rule.getExpertRegionCode(), rule.getExpertRegionLevel())) {
query.eq(ExpertUserFullInfo::getRegionCode, rule.getExpertRegionCode());
query.eq(ExpertUserFullInfo::getRegionLevel, rule.getExpertRegionLevel());
if (CollUtil.isNotEmpty(rule.getExpertRegionList())) {
String inSqlParam = rule.getExpertRegionList().stream()
.map(w -> "('" + w.getRegionCode() + "'," + w.getRegionLevel() + ")")
.collect(Collectors.joining(",", "(", ")"));
query.apply("(region_code, region_level) in " + inSqlParam);
}
}



+ 8
- 4
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java View File

@@ -586,9 +586,10 @@ public class MeetingManage {
List<RegionDTO> intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel());
randomRule.setIntentionRegions(intentionRegions);
}
if (StrUtil.isNotEmpty(randomRule.getExpertRegionCode())) {
List<RegionDTO> expertRegions = regionCache.listParents(randomRule.getExpertRegionCode(), randomRule.getExpertRegionLevel());
randomRule.setExpertRegions(expertRegions);
if (CollUtil.isNotEmpty(randomRule.getExpertRegionList())) {
List<RegionDTO> regions = CollUtils.convert(randomRule.getExpertRegions(),
w -> regionCache.getByCodeAndLevel(w.getRegionCode(), w.getRegionLevel()));
randomRule.setExpertRegions(regions);
}
result.getRandomRules().add(randomRule);
});
@@ -850,7 +851,8 @@ public class MeetingManage {

public PageVo<MeetingReviewProjectVO> optionProject(MeetingOptionProjectReq req) {
String meetingType = req.getMeetingType();
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class);
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, Boolean.TRUE);
switch (MeetingReviewTypeEnum.getByCode(meetingType)) {
case PRELIMINARY_SCHEME_REVIEW:
buildOptionProjectQuery(query, meetingType, ProjectStatusEnum.PRE_APPLYING);
@@ -864,6 +866,8 @@ public class MeetingManage {
case DEPT_JOIN_REVIEW:
buildOptionProjectQuery(query, meetingType, ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW);
break;
case FAIRNESS_REVIEW:
break;
default:
return PageVo.empty();
}


+ 0
- 75
pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertCallResultRewriteTask.java View File

@@ -6,25 +6,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.common.util.StrUtils;
import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo;
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService;
import com.ningdatech.pmapi.meeting.entity.config.WebProperties;
import com.ningdatech.pmapi.meeting.entity.domain.ExpertInviteRule;
import com.ningdatech.pmapi.meeting.entity.domain.Meeting;
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert;
import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO;
import com.ningdatech.pmapi.meeting.entity.dto.YxtCallBackDTO;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum;
import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper;
import com.ningdatech.pmapi.meeting.service.IExpertInviteRuleService;
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService;
import com.ningdatech.pmapi.meeting.service.IMeetingService;
import com.ningdatech.pmapi.meta.helper.DictionaryCache;
import com.ningdatech.pmapi.sms.constant.VoiceSmsTemplateConst;
import com.ningdatech.pmapi.sms.utils.DateUtil;
import com.ningdatech.yxt.entity.SysMsgRecordDetail;
import com.ningdatech.yxt.model.cmd.SendSmsCmd.SendSmsContext;
import com.ningdatech.yxt.service.ISysMsgRecordDetailService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -61,11 +51,7 @@ public class ExpertCallResultRewriteTask {
private final ThreadPoolTaskScheduler scheduler;
private final IMeetingExpertService meetingExpertService;
private final IExpertInviteRuleService inviteRuleService;
private final IMeetingService meetingService;
private final ISysMsgRecordDetailService msgRecordDetailService;
private final DictionaryCache dictionaryCache;
private final YxtCallOrSmsHelper yxtCallOrSmsHelper;
private final IExpertUserFullInfoService userFullInfoService;
private final static int MINUTES_CALL_RESULT_FEEDBACK = 15;

private static final String AGREE_KEY = "1";
@@ -140,38 +126,6 @@ public class ExpertCallResultRewriteTask {
}
}
meetingExpertService.updateBatchById(updates);
if (agrees.size() > 0) {
obtainCallBackAfterMeetingCanceled(agrees);
}
}

private void sendAgreeNotice(MeetingExpert expert) {
try {
Meeting meeting = meetingService.getById(expert.getMeetingId());
if (Objects.isNull(meeting)) {
return;
}
ExpertUserFullInfo expertUserFullInfo = userFullInfoService.getByUserId(expert.getExpertId());
String expertName = null;
if (Objects.nonNull(expertUserFullInfo)) {
expertName = expertUserFullInfo.getExpertName();
}
String smsContent = String.format(VoiceSmsTemplateConst.EXPERT_AGREE_ATTEND_TEMPLATE,
meeting.getHoldOrg(),
expertName,
meeting.getName(),
meeting.getStartTime().format(DateUtil.DTF_YMD_HM),
meeting.getMeetingAddress(),
meeting.getConnecter(),
meeting.getContact(),
WebProperties.webUrl);
SendSmsContext context = new SendSmsContext();
context.setContent(smsContent);
context.setReceiveNumber(expert.getMobile());
yxtCallOrSmsHelper.sendSms(context);
} catch (Exception e) {
log.info("发送专家会议接受通知短信失败:{}", JSONObject.toJSONString(expert));
}
}

private static Optional<Integer> getStatusByMsgRecordDetail(SysMsgRecordDetail mrd, int minutes, LocalDateTime createOn) {
@@ -217,33 +171,4 @@ public class ExpertCallResultRewriteTask {
return Optional.of(status.getCode());
}

/**
* 会议取消之后拿到回调结果的话需要发送取消短信
**/
private void obtainCallBackAfterMeetingCanceled(List<MeetingExpert> experts) {
/*List<Long> meetingIds = CollUtils.fieldList(experts, MeetingExpert::getMeetingId);
LambdaQueryWrapper<Meeting> mQuery = Wrappers.lambdaQuery(Meeting.class)
.eq(Meeting::getStatus, Manager.CANCELED.getCode())
.in(Meeting::getId, meetingIds);
Map<Long, Meeting> meetingMap = CollUtils.listToMap(meetingService.list(mQuery), Meeting::getId);
if (meetingMap.size() > 0) {
Map<Meeting, List<MeetingExpert>> expertList = new HashMap<>(16);
experts.forEach(w -> {
Meeting meeting = meetingMap.get(w.getMeetingId());
if (meeting == null) {
return;
}
List<MeetingExpert> list = expertList.computeIfAbsent(meeting, k -> new ArrayList<>());
list.add(w);
});
if (!expertList.isEmpty()) {
expertList.forEach((m, mes) -> {
String meetingType = dictionaryCache.getByCode(m.getType()).getName();
List<SendSmsContext> contexts = YxtSmsContextBuilder.smsToExpertByCancelMeeting(m, mes, meetingType);
yxtCallOrSmsHelper.sendSms(contexts);
});
}
}*/
}

}

+ 10
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java View File

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.SpringUtils;
import com.ningdatech.cache.model.cache.CacheHashKey;
import com.ningdatech.cache.repository.CachePlusOps;
import com.ningdatech.pmapi.common.util.SpringContextHolder;
@@ -16,8 +17,10 @@ import com.ningdatech.pmapi.meeting.entity.dto.ExpertChooseDTO;
import com.ningdatech.pmapi.meeting.entity.dto.InviteCacheDTO;
import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.ningdatech.pmapi.meeting.entity.req.ConfirmedRosterReq;
import com.ningdatech.pmapi.meeting.helper.MeetingCallOrMsgHelper;
import com.ningdatech.pmapi.meeting.manage.ExpertInviteManage;
import com.ningdatech.pmapi.meeting.manage.MeetingManage;
import com.ningdatech.pmapi.meeting.service.IExpertInviteAvoidRuleService;
import com.ningdatech.pmapi.meeting.service.IExpertInviteRuleService;
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService;
@@ -275,6 +278,13 @@ public class ExpertRandomInviteTask {
currProxy().cancelByMeetingId(meetingId);
meetingCallOrMsgHelper.sendInviteStopMsg(meeting.getCreateBy(), meetingId, meeting.getName());
}
if (notIgnoreCnt.get() == 0 && notSupportCnt.get() == 0) {
MeetingManage meetingManage = SpringUtils.getBean(MeetingManage.class);
ConfirmedRosterReq req = new ConfirmedRosterReq();
req.setReconfirmed(false);
req.setMeetingId(meetingId);
meetingManage.confirmedRoster(req);
}
}

@Transactional(rollbackFor = Exception.class)


+ 0
- 93
pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/MeetingInviteCompleteNoticeTask.java View File

@@ -1,93 +0,0 @@
//package com.ningdatech.pmapi.meeting.task;
//
//import com.alibaba.fastjson.JSONObject;
//import com.baomidou.mybatisplus.core.toolkit.StringUtils;
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//import com.ningdatech.pmapi.meeting.builder.YxtSmsContextBuilder;
//import com.ningdatech.pmapi.meeting.entity.domain.ExpertInviteRule;
//import com.ningdatech.pmapi.meeting.entity.domain.Meeting;
//import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus;
//import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatus;
//import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper;
//import com.ningdatech.pmapi.meeting.service.IExpertInviteRuleService;
//import com.ningdatech.pmapi.meeting.service.IMeetingExpertService;
//import com.ningdatech.pmapi.meeting.service.IMeetingService;
//import lombok.AllArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.PostConstruct;
//import java.time.Duration;
//import java.time.Instant;
//import java.time.temporal.ChronoUnit;
//import java.util.HashSet;
//import java.util.List;
//import java.util.Objects;
//import java.util.Set;
//
///**
// * @author liuxinxin
// * @date 2023/2/2 上午9:57
// */
//
//@Slf4j
//@Component
//@AllArgsConstructor
//public class MeetingInviteCompleteNoticeTask {
//
// private final RandomInviteProperties randomInviteProperties;
// private final IMeetingService meetingService;
// private final IMeetingExpertService meetingExpertService;
// private final ThreadPoolTaskScheduler scheduler;
// private final RedisUtils redisUtils;
// private final static String MEETING_INVITE_COMPLETE_NOTICED_MEETING_ID_CACHE_KEY = "MEETING_INVITE_COMPLETE_NOTICED_MEETING_ID_CACHE_KEY";
// private final YxtCallOrSmsHelper yxtCallOrSmsHelper;
// private final IExpertInviteRuleService iExpertInviteRuleService;
//
// @PostConstruct
// public void initTask() {
// Instant startTime = Instant.now().plus(randomInviteProperties.getMeetingInviteCompleteNoticeRate(), ChronoUnit.MINUTES);
// // 处理电话结果回填
// scheduler.scheduleAtFixedRate(this::meetingInviteCompleteNotice, startTime, Duration.ofMinutes(randomInviteProperties.getResultRewriteFixedRate()));
// }
//
// public void meetingInviteCompleteNotice() {
// log.info("开始执行抽取完成通知:{}", Thread.currentThread().getName());
// List<Meeting> meetingIdList = meetingService.list(Wrappers.lambdaQuery(Meeting.class)
// .eq(Meeting::getStatus, MeetingStatus.Manager.UNCOMPLETED.getCode())
// .eq(Meeting::getSendMeetingNotice, false)
// .eq(Meeting::getStopRandomInvite, true));
//
// Set<Long> completeNoticedMeetingIdList = getCompleteNoticedMeetingIdList();
// for (Meeting meeting : meetingIdList) {
// Long meetingId = meeting.getId();
// if (completeNoticedMeetingIdList.add(meetingId)) {
// List<ExpertInviteRule> expertInviteRules = iExpertInviteRuleService.listByMeetingId(meetingId);
// if (expertInviteRules.size() == 0) {
// return;
// }
// int noticeCount = meetingExpertService.countExpertByStatusAndMeetingId(ExpertAttendStatus.NOTICING, meetingId, null);
// if (noticeCount == 0) {
// redisUtils.set(MEETING_INVITE_COMPLETE_NOTICED_MEETING_ID_CACHE_KEY, JSONObject.toJSONString(completeNoticedMeetingIdList), 24 * 60 * 60);
// if (StringUtils.isNotBlank(meeting.getContact()) && StringUtils.isNotBlank(meeting.getConnecter())) {
// SendSmsCmd.SendSmsContext context = YxtSmsContextBuilder.meetingInviteCompleteNotice(meeting);
// yxtCallOrSmsHelper.sendSms(context);
// }
// }
// }
// }
// }
//
// private Set<Long> getCompleteNoticedMeetingIdList() {
// Object result = redisUtils.get(MEETING_INVITE_COMPLETE_NOTICED_MEETING_ID_CACHE_KEY);
// HashSet<Long> completeNoticedMeetingIdSet = new HashSet<>();
// if (Objects.nonNull(result)) {
// String resultStr = result.toString();
// List<Long> completeNoticedMeetingIdList = JSONObject.parseArray(resultStr, Long.class);
// completeNoticedMeetingIdSet = new HashSet<>(completeNoticedMeetingIdList);
// }
// return completeNoticedMeetingIdSet;
// }
//
//}

+ 0
- 160
pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/NoticeExpertAt24HoursBeforeMeetingTask.java View File

@@ -1,160 +0,0 @@
//package com.ningdatech.pmapi.meeting.task;
//
//import cn.hutool.crypto.SecureUtil;
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//import com.ningdatech.basic.util.CollUtils;
//import com.ningdatech.basic.util.StrPool;
//import com.ningdatech.cache.model.cache.CacheHashKey;
//import com.ningdatech.cache.repository.CachePlusOps;
//import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService;
//import com.ningdatech.pmapi.meeting.entity.domain.Meeting;
//import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert;
//import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatus;
//import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper;
//import com.ningdatech.pmapi.meeting.service.IMeetingExpertService;
//import com.ningdatech.pmapi.meeting.service.IMeetingService;
//import com.ningdatech.pmapi.meta.helper.DictionaryCache;
//import lombok.AllArgsConstructor;
//import lombok.Data;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//import java.time.LocalDateTime;
//import java.time.temporal.ChronoUnit;
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//import java.util.stream.Collectors;
//
///**
// * <p>
// * NoticeExpertAt24HoursBeforeMeetingTask
// * </p>
// *
// * @author WendyYang
// * @since 09:16 2022/11/16
// */
//@Slf4j
//@Component
//@AllArgsConstructor
//public class NoticeExpertAt24HoursBeforeMeetingTask {
//
// @Data
// private static class NoticeValue {
//
// private LocalDateTime startTime;
//
// private String addressMd5;
//
// }
//
// private final IMeetingService meetingService;
// private final IMeetingExpertService meetingExpertService;
// private final YxtCallOrSmsHelper yxtCallOrSmsHelper;
// private final DictionaryCache dictionaryCache;
// private final CachePlusOps cachePlusOps;
// private final IExpertUserFullInfoService expertUserFullInfoService;
//
// private static final String EXPERT_NOTICE_AT_24H_BEFORE_MEETING = "EXPERT_NOTICE_AT_24H_BEFORE_MEETING";
//
// private void addNoticeKey(Long meetingId, Map<String, Object> noticeValue, LocalDateTime startTime) {
// long mills = ChronoUnit.SECONDS.between(LocalDateTime.now(), startTime);
// CacheHashKey key = new CacheHashKey();
// key.setKey(EXPERT_NOTICE_AT_24H_BEFORE_MEETING + StrPool.COLON + meetingId);
// key.setField(mills);
// cachePlusOps.hSet(key, noticeValue);
// }
//
// private Map<Long, NoticeValue> getNoticeKey(Long meetingId) {
// Map<Object, Object> cache = cachePlusOps.hGet(EXPERT_NOTICE_AT_24H_BEFORE_MEETING + StrPool.COLON + meetingId);
// return cache.entrySet().stream().collect(Collectors.toMap(w -> Long.valueOf(w.getKey().toString()), w -> (NoticeValue) w.getValue()));
// }
//
// /**
// * 查询需要发送通知的会议:
// * <ul>1. 未完成</ul>
// * <ul>2. 创建邀请</ul>
// * <ul>3. 当前时间距离会议开始时间不足24小时</ul>
// *
// * @return 会议信息
// * @author WendyYang
// **/
// private Map<Long, Meeting> loadMeetingAt24HoursBeforeMeeting() {
// LambdaQueryWrapper<Meeting> query = Wrappers.lambdaQuery(Meeting.class);
// LocalDateTime now = LocalDateTime.now(), hoursAgoBy24 = now.plusHours(24);
// // 10分钟之内不再发送通知
// query.between(Meeting::getStartTime, now.plusMinutes(10), hoursAgoBy24);
// query.eq(Meeting::getStatus, MeetingStatus.Manager.UNCOMPLETED.getCode());
// query.eq(Meeting::getInvited, Boolean.TRUE);
// List<Meeting> meetings = meetingService.list(query);
// return CollUtils.listToMap(meetings, Meeting::getId);
// }
//
// private String addressDetailMd5(Meeting meeting) {
// String content = meeting.getRegionCode() + StrPool.HASH + meeting.getRegionLevel() + StrPool.HASH + meeting.getRegionDetail();
// return SecureUtil.md5(content);
// }
//
// private boolean skipExpert(NoticeValue noticeValue, String addressMd5, LocalDateTime startTime) {
// boolean skip = noticeValue.getAddressMd5().equals(addressMd5);
// if (skip) {
// skip = noticeValue.getStartTime().equals(startTime);
// }
// return skip;
// }
//
// @Scheduled(cron = "${expert-attend-notice.cron:0 0/5 7-21 * * ?}")
// public void execute() {
// log.info("开始执行会议开始前24小时再次短信提醒任务");
// Map<Long, Meeting> meetingsMap = loadMeetingAt24HoursBeforeMeeting();
// if (meetingsMap.isEmpty()) {
// return;
// }
// List<MeetingExpert> expertList = meetingExpertService.listExpertByAgreeAttend(meetingsMap.keySet());
// if (expertList.isEmpty()) {
// return;
// }
// List<SendSmsCmd.SendSmsContext> contexts = new ArrayList<>();
// Map<Long, List<MeetingExpert>> expertGroup = CollUtils.group(expertList, MeetingExpert::getMeetingId);
// expertGroup.forEach((meetingId, experts) -> {
// Map<String, Object> noticeCache = new HashMap<>(16);
// Meeting meeting = meetingsMap.get(meetingId);
// String md5 = addressDetailMd5(meeting);
// Map<Long, NoticeValue> noticeKey = getNoticeKey(meetingId);
// String holdCompany = meeting.getHoldCompanyBracket();
// String startTime = meeting.getStartTime().format(DateUtil.DTF_YMD_HM);
// String meetingType = dictionaryCache.getByCode(meeting.getType()).getName();
// for (MeetingExpert expert : experts) {
// NoticeValue noticeValue = noticeKey.get(expert.getId());
// if (noticeValue != null) {
// if (skipExpert(noticeValue, md5, meeting.getStartTime())) {
// continue;
// }
// }
// NoticeValue value = new NoticeValue();
// value.setAddressMd5(md5);
// value.setStartTime(meeting.getStartTime());
// noticeCache.put(expert.getId().toString(), value);
// SendSmsCmd.SendSmsContext context = new SendSmsCmd.SendSmsContext();
//
// ExpertUserFullInfo expertUserFullInfo = expertUserFullInfoService.getByUserId(expert.getExpertId());
// String content = String.format(YxtSmsTemplateConst.SEND_MEETING_NOTICE, expertUserFullInfo.getName(),
// expert.getUpdateOn().format(DateUtil.DTF_YMD_HM), meetingType, startTime,
// meeting.getRegionDetail(), meeting.getContact());
// context.setContent(holdCompany + content);
// context.setReceiveNumber(expert.getMobile());
// contexts.add(context);
// }
// if (!noticeCache.isEmpty()) {
// addNoticeKey(meetingId, noticeCache, meeting.getStartTime());
// }
// });
// if (!contexts.isEmpty()) {
// yxtCallOrSmsHelper.sendSms(contexts);
// }
// }
//
//}

+ 5
- 5
pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/AppAppraisalController.java View File

@@ -35,16 +35,16 @@ public class AppAppraisalController {
return appAppraisalManage.list(req);
}

@GetMapping("/unEvaluate-list/{planId}")
@GetMapping("/unEvaluate-list/{planId}/{reAppraisalGroupId}")
@ApiOperation("当前绩效评价应用待评价列表")
public PageVo<PerformanceAppraisalAppVO> pendingList(@PathVariable Long planId, PerformanceAppraisalListReq req) {
return appAppraisalManage.unEvaluateList(planId,req);
public PageVo<PerformanceAppraisalAppVO> pendingList(@PathVariable Long planId, @PathVariable Long reAppraisalGroupId, PerformanceAppraisalListReq req) {
return appAppraisalManage.unEvaluateList(planId,reAppraisalGroupId,req);
}

@GetMapping("/evaluated-list/{planId}")
@ApiOperation("当前绩效评价应用已评价列表")
public PageVo<PerformanceAppraisalAppVO> evaluatedList(@PathVariable Long planId,PerformanceAppraisalListReq req) {
return appAppraisalManage.evaluatedList(planId,req);
public PageVo<PerformanceAppraisalAppVO> evaluatedList(@PathVariable Long planId, @PathVariable Long reAppraisalGroupId, PerformanceAppraisalListReq req) {
return appAppraisalManage.evaluatedList(planId,reAppraisalGroupId,req);
}

@GetMapping("/detail/{appId}")


+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java View File

@@ -22,7 +22,6 @@ public enum PerformanceTemplateTypeEnum {
/**
* 模板类型
*/
//STAGE(0, "阶段"),
FIRST_INDEX(1, "第一指标"),
SECOND_INDEX(2, "第二指标"),
THIRD_INDEX(3, "第三指标");


+ 3
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/helper/TemplateDetailBuildHelper.java View File

@@ -15,9 +15,11 @@ import java.util.List;
public interface TemplateDetailBuildHelper {
/**
* 构建评价模板详情信息
*
* @param templateDetails
* @param projectCode
* @param vo
* @return
*/
List<ProjectTemplateDetailVO> buildTemplateDetail(List<PerformanceIndicatorProjectTemplateDetail> templateDetails, ProjectAppraisalIndexDetailVO vo);
List<ProjectTemplateDetailVO> buildTemplateDetail(List<PerformanceIndicatorProjectTemplateDetail> templateDetails, String projectCode, ProjectAppraisalIndexDetailVO vo);
}

+ 5
- 2
pmapi/src/main/java/com/ningdatech/pmapi/performance/helper/impl/TemplateDetailBuildHelperImpl.java View File

@@ -8,7 +8,6 @@ import com.google.common.collect.Lists;
import com.ningdatech.pmapi.performance.enumration.AppraisalTypeEnum;
import com.ningdatech.pmapi.performance.enumration.PerformanceTemplateTypeEnum;
import com.ningdatech.pmapi.performance.helper.TemplateDetailBuildHelper;
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalInfoDTO;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalScoreInfo;
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplateDetail;
import com.ningdatech.pmapi.performance.model.vo.ProjectAppraisalIndexDetailVO;
@@ -35,7 +34,7 @@ public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper
private final IPerformanceAppraisalScoreInfoService performanceAppraisalScoreInfoService;

@Override
public List<ProjectTemplateDetailVO> buildTemplateDetail(List<PerformanceIndicatorProjectTemplateDetail> templateDetails, ProjectAppraisalIndexDetailVO vo) {
public List<ProjectTemplateDetailVO> buildTemplateDetail(List<PerformanceIndicatorProjectTemplateDetail> templateDetails, String projectCode, ProjectAppraisalIndexDetailVO vo) {
List<ProjectTemplateDetailVO> res = Lists.newArrayList();
//第一层是 一级的
for (PerformanceIndicatorProjectTemplateDetail templateDetailFirst : templateDetails) {
@@ -57,6 +56,7 @@ public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper
// 获取自评分数信息
List<PerformanceAppraisalScoreInfo> selfAppraisalScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId())
.eq(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCode)
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.SELF_APPRAISAL.getCode()));
if (CollUtil.isNotEmpty(selfAppraisalScoreInfo)) {
detailThirdVo.setSelfAppraisalScoreInfo(selfAppraisalScoreInfo);
@@ -70,6 +70,7 @@ public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper
// 按照复评人员分组 获取复评分数信息
List<PerformanceAppraisalScoreInfo> reAppraisalScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId())
.eq(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCode)
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.RE_APPRAISAL.getCode()));
if (CollUtil.isNotEmpty(reAppraisalScoreInfo)) {
Map<String, List<PerformanceAppraisalScoreInfo>> reAppScoreInfoMap = reAppraisalScoreInfo.stream().collect(Collectors.groupingBy(PerformanceAppraisalScoreInfo::getAppraisalEmployeeName));
@@ -93,6 +94,7 @@ public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper
// 按照核查人员分组 获取核查分数信息
List<PerformanceAppraisalScoreInfo> verifyScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId())
.eq(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCode)
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.EXPERT_VERIFY.getCode()));
if (CollUtil.isNotEmpty(verifyScoreInfo)) {
Map<String, List<PerformanceAppraisalScoreInfo>> verifyScoreInfoMap = verifyScoreInfo.stream().collect(Collectors.groupingBy(PerformanceAppraisalScoreInfo::getAppraisalEmployeeName));
@@ -116,6 +118,7 @@ public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper
// 获取整改审核分数信息
List<PerformanceAppraisalScoreInfo> rectifyAuditScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId())
.eq(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCode)
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.EXPERT_RECTIFY_AUDIT.getCode()));
if (CollUtil.isNotEmpty(rectifyAuditScoreInfo)) {
detailThirdVo.setRectifyAuditScoreInfo(rectifyAuditScoreInfo);


+ 58
- 151
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/AppAppraisalManage.java View File

@@ -9,14 +9,11 @@ import cn.hutool.core.map.MapUtil;
import com.ningdatech.pmapi.performance.enumration.AppIndexTypeEnum;
import com.ningdatech.pmapi.performance.model.dto.AppAppraisalInfoDTO;
import com.ningdatech.pmapi.performance.model.vo.*;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -27,14 +24,10 @@ import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.performance.constant.BizConst;
import com.ningdatech.pmapi.performance.enumration.AppraisalTypeEnum;
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalDTO;
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalInfoDTO;
import com.ningdatech.pmapi.performance.model.entity.*;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.service.*;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.sys.model.entity.Role;
import com.ningdatech.pmapi.sys.service.IRoleService;
@@ -56,10 +49,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@AllArgsConstructor
public class AppAppraisalManage {

private final IPerformanceAppraisalService performanceAppraisalService;
private final IPerformanceAppraisalProjectService performanceAppraisalProjectService;
private final IProjectService projectService;
private final IRoleService roleService;
private final IPerformanceAppraisalAppScoreInfoService performanceAppraisalAppScoreInfoService;
private final IPerformanceAppraisalProjectGroupService groupService;
@@ -68,14 +58,13 @@ public class AppAppraisalManage {
private final IPerformanceAppraisalAppIndicatorService performanceAppraisalAppIndicatorService;
private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService;
/**
* 复评-评价计划列表
* 应用评价-评价计划列表
* @param req
* @return
*/
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
String employeeCode = user.getEmployeeCode();
String regionCode = user.getRegionCode();
// 获取当前登录用户的角色列表,只有绩效复评人员才能查看该列表
List<Role> userRoleList = user.getUserRoleList();
List<Long> roleIdList = userRoleList.stream().map(Role::getId).collect(Collectors.toList());
@@ -90,21 +79,8 @@ public class AppAppraisalManage {
return PageVo.empty();
}

// 获取登录用户所在区域的所有已终验项目信息
List<Project> projectLists = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode())
.eq(Project::getAreaCode, regionCode));
List<String> projectCodes = projectLists.stream().map(Project::getProjectCode).collect(Collectors.toList());
// 获取项目关联的应用信息
List<ProjectApplication> applications = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.in(ProjectApplication::getProjectCode, projectCodes));
// 已验收的项目关联的应用信息不存在
if(CollUtil.isEmpty(applications)){
return PageVo.empty();
}
List<Long> appIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList());
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.in(PerformanceAppraisalApplication::getApplicationId, appIds));
// 获取所有已添加到评价计划中的应用信息
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list();
// 没有包含应用的评价计划
if (CollUtil.isEmpty(paas)){
return PageVo.empty();
@@ -132,8 +108,11 @@ public class AppAppraisalManage {
if (CollUtil.isEmpty(groupList)){
return PageVo.empty();
}
// 因为一个复评用户只能出现在一个计划的一个分组中 所以可以将分组信息按评价计划分组
Map<Long, PerformanceAppraisalProjectGroup> groupMap = groupList.stream().collect(Collectors.toMap(PerformanceAppraisalProjectGroup::getAppraisalId, g -> g));
// 获取分组所在的评价计划ID
List<Long> appraisalIds = groupList.stream().map(PerformanceAppraisalProjectGroup::getAppraisalId).collect(Collectors.toList());

// 获取复评计划列表
Page<PerformanceAppraisal> page = req.page();
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class)
@@ -141,56 +120,37 @@ public class AppAppraisalManage {
.orderByDesc(PerformanceAppraisal::getUpdateOn);
performanceAppraisalService.page(page,wrapper);
List<PerformanceAppraisalVO> res = page.getRecords().stream()
.map(p -> BeanUtil.copyProperties(p, PerformanceAppraisalVO.class))
.map(p -> {
PerformanceAppraisalVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalVO.class);
PerformanceAppraisalProjectGroup group = groupMap.get(p.getId());
vo.setReAppraisalGroupId(group.getId());
return vo;
})
.collect(Collectors.toList());
return PageVo.of(res,page.getTotal());
}


public PageVo<PerformanceAppraisalAppVO> unEvaluateList(Long planId, PerformanceAppraisalListReq req) {
public PageVo<PerformanceAppraisalAppVO> unEvaluateList(Long planId, Long reAppraisalGroupId, PerformanceAppraisalListReq req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
String employeeCode = user.getEmployeeCode();

PerformanceAppraisal plan = performanceAppraisalService.getById(planId);
VUtils.isTrue(Objects.isNull(plan)).throwMessage("该评价计划不存在!");

// 获取评价计划内已添加的未完成评价应用信息,且应用为当前登录复评用户所在分组评价项目关联的应用
List<PerformanceAppraisalProjectGroup> groupList = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class)
.eq(PerformanceAppraisalProjectGroup::getAppraisalId, planId));
// 筛选出当前登录复评用户所在的分组信息
List<PerformanceAppraisalProjectGroup> groups = groupList.stream().filter(g -> {
String reAppraisalUsers = g.getReAppraisalUsers();
if (reAppraisalUsers.contains(employeeCode)) {
return true;
}
return false;
}).collect(Collectors.toList());
// 获取评价计划分组信息内的项目信息
List<String> proCodes = groups.stream()
.map(PerformanceAppraisalProjectGroup::getProjectCodes)
.collect(Collectors.toList());
List<String> projectCodes = Lists.newArrayList();
for (String proCode : proCodes) {
if (proCode.contains(StrPool.COMMA)){
projectCodes.addAll(Arrays.asList(proCode.split(StrPool.COMMA)));
}else {
projectCodes.add(proCode);
}
}
PerformanceAppraisalProjectGroup group = groupService.getById(reAppraisalGroupId);
VUtils.isTrue(Objects.isNull(group)).throwMessage("分组不存在!");

// 获取分组所在评价计划添加的未完成评价的应用信息
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId, plan.getId())
.in(PerformanceAppraisalApplication::getAppraisalProjectCode,projectCodes)
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal,Boolean.FALSE));
.eq(PerformanceAppraisalApplication::getAppraisalId, group.getAppraisalId())
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal, Boolean.FALSE));
if (CollUtil.isEmpty(paas)){
return PageVo.empty();
}
Set<Long> appraisalIds = paas.stream()
.map(PerformanceAppraisalApplication::getAppraisalId)
.collect(Collectors.toSet());
// 从绩效评价打分信息表中获取上述绩效评价计划应用的打分信息
List<PerformanceAppraisalAppScoreInfo> appraisalScoreInfos = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.in(PerformanceAppraisalAppScoreInfo::getAppraisalId, appraisalIds));
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId, planId));
// 筛选出当前登录用户未进行打分的应用信息
List<Long> appIds = appraisalScoreInfos.stream()
.filter(a -> !employeeCode.equals(a.getAppraisalEmployeeCode()))
@@ -224,7 +184,7 @@ public class AppAppraisalManage {
return PageVo.of(res,page.getTotal());
}

public PageVo<PerformanceAppraisalAppVO> evaluatedList(Long planId, PerformanceAppraisalListReq req) {
public PageVo<PerformanceAppraisalAppVO> evaluatedList(Long planId, Long reAppraisalGroupId, PerformanceAppraisalListReq req) {

UserInfoDetails user = LoginUserUtil.loginUserDetail();
String employeeCode = user.getEmployeeCode();
@@ -232,45 +192,20 @@ public class AppAppraisalManage {
PerformanceAppraisal plan = performanceAppraisalService.getById(planId);
VUtils.isTrue(Objects.isNull(plan)).throwMessage("该评价计划不存在!");

PerformanceAppraisalProjectGroup group = groupService.getById(reAppraisalGroupId);
VUtils.isTrue(Objects.isNull(group)).throwMessage("分组不存在!");

// 获取评价计划内已添加的未完成评价应用信息,且应用为当前登录复评用户所在分组评价项目关联的应用
List<PerformanceAppraisalProjectGroup> groupList = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class)
.eq(PerformanceAppraisalProjectGroup::getAppraisalId, planId));
// 筛选出当前登录复评用户所在的分组信息
List<PerformanceAppraisalProjectGroup> groups = groupList.stream().filter(g -> {
String reAppraisalUsers = g.getReAppraisalUsers();
if (reAppraisalUsers.contains(employeeCode)) {
return true;
}
return false;
}).collect(Collectors.toList());
// 获取评价计划分组信息内的项目信息
List<String> proCodes = groups.stream()
.map(PerformanceAppraisalProjectGroup::getProjectCodes)
.collect(Collectors.toList());
List<String> projectCodes = Lists.newArrayList();
for (String proCode : proCodes) {
if (proCode.contains(StrPool.COMMA)){
projectCodes.addAll(Arrays.asList(proCode.split(StrPool.COMMA)));
}else {
projectCodes.add(proCode);
}
}

// 获取分组所在评价计划添加的未完成评价的应用信息
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId, plan.getId())
.in(PerformanceAppraisalApplication::getAppraisalProjectCode,projectCodes)
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal,Boolean.FALSE));
.eq(PerformanceAppraisalApplication::getAppraisalId, group.getAppraisalId())
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal, Boolean.FALSE));
if (CollUtil.isEmpty(paas)){
return PageVo.empty();
}
Set<Long> appraisalIds = paas.stream()
.map(PerformanceAppraisalApplication::getAppraisalId)
.collect(Collectors.toSet());
// 从绩效评价打分信息表中获取上述绩效评价计划应用的打分信息
List<PerformanceAppraisalAppScoreInfo> appraisalScoreInfos = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.in(PerformanceAppraisalAppScoreInfo::getAppraisalId, appraisalIds));
// 筛选出当前登录用户进行打分的应用信息
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId, planId));
// 筛选出当前登录用户已进行打分的应用信息
List<Long> appIds = appraisalScoreInfos.stream()
.filter(a -> employeeCode.equals(a.getAppraisalEmployeeCode()))
.map(PerformanceAppraisalAppScoreInfo::getApplicationId)
@@ -326,52 +261,45 @@ public class AppAppraisalManage {


public AppAppraisalIndexDetailVO detail(Long appId) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
String regionCode = user.getRegionCode();

AppAppraisalIndexDetailVO resVo = new AppAppraisalIndexDetailVO();

// 获取指标配置的应用指标信息
// 登录复评用户所在区域通用指标
// todo 是否需要过滤展示形式为打分的通用指标
// 通用指标
List<PerformanceAppraisalAppIndicator> commonIndexList = performanceAppraisalAppIndicatorService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppIndicator.class)
.eq(PerformanceAppraisalAppIndicator::getRegionCode, regionCode)
.eq(PerformanceAppraisalAppIndicator::getIndexType, AppIndexTypeEnum.COMMON.getCode()));
// 获取当前应用通用指标的的打分信息
Map<Long, PerformanceAppraisalAppScoreInfo> commonScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId)
.eq(PerformanceAppraisalAppScoreInfo::getIndexType, AppIndexTypeEnum.COMMON.getCode()))
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getIndexId, p -> p));
if (CollUtil.isNotEmpty(commonIndexList)) {
List<AppIndexDetailVO> commonIndexDetails = commonIndexList.stream().map(i -> {
AppIndexDetailVO vo = new AppIndexDetailVO();
BeanUtils.copyProperties(i, vo);
// 如果进行了打分,按复评人员分组
List<PerformanceAppraisalAppScoreInfo> appAppraisalScoreInfo = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId));
if (CollUtil.isNotEmpty(appAppraisalScoreInfo)){
Map<String, List<PerformanceAppraisalAppScoreInfo>> scoreInfoMap = appAppraisalScoreInfo.stream()
.collect(Collectors.groupingBy(PerformanceAppraisalAppScoreInfo::getAppraisalEmployeeName));
HashMap<String, BigDecimal> scoreMap = MapUtil.newHashMap();
for (String name : scoreInfoMap.keySet()) {
List<PerformanceAppraisalAppScoreInfo> scoreInfos = scoreInfoMap.get(name);
BigDecimal totalScore = scoreInfos.stream().map(PerformanceAppraisalAppScoreInfo::getAppraisalScore)
.filter(Objects::nonNull)
.reduce(BigDecimal.ZERO, BigDecimal::add);
scoreMap.put(name, totalScore);
}
resVo.setAppraisalScoreInfo(scoreInfoMap);
resVo.setAppraisalTotalScoreInfo(scoreMap);
PerformanceAppraisalAppScoreInfo scoreInfo = commonScoreInfoMap.get(i.getId());
if (Objects.nonNull(scoreInfo)) {
vo.setAppraisalScore(scoreInfo.getAppraisalScore());
}
return vo;
}).collect(Collectors.toList());
resVo.setCommonIndexDetails(commonIndexDetails);
}

// 登录复评用户所在区域辅助指标
// todo 是否需要过滤展示形式为打分的辅助指标
// 辅助指标
List<PerformanceAppraisalAppIndicator> auxIndexList = performanceAppraisalAppIndicatorService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppIndicator.class)
.eq(PerformanceAppraisalAppIndicator::getRegionCode, regionCode)
.eq(PerformanceAppraisalAppIndicator::getIndexType, AppIndexTypeEnum.AUX.getCode()));
// 获取当前应用辅助指标的的打分信息
Map<Long, PerformanceAppraisalAppScoreInfo> auxScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId)
.eq(PerformanceAppraisalAppScoreInfo::getIndexType, AppIndexTypeEnum.AUX.getCode()))
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getIndexId, p -> p));
if (CollUtil.isNotEmpty(auxIndexList)) {
List<AppIndexDetailVO> auxIndexDetails = auxIndexList.stream().map(i -> {
AppIndexDetailVO vo = new AppIndexDetailVO();
BeanUtils.copyProperties(i, vo);
PerformanceAppraisalAppScoreInfo scoreInfo = auxScoreInfoMap.get(i.getId());
if (Objects.nonNull(scoreInfo)) {
vo.setAppraisalScore(scoreInfo.getAppraisalScore());
}
return vo;
}).collect(Collectors.toList());
resVo.setAuxIndexDetails(auxIndexDetails);
@@ -379,10 +307,19 @@ public class AppAppraisalManage {
// 获取应用的核心业务指标
List<ProjectCoreBusinessIndicators> coreBusinessIndicators = projectCoreBusinessIndicatorsService.list(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class)
.eq(ProjectCoreBusinessIndicators::getApplicationId, appId));
// 获取当前应用业务指标的的打分信息
Map<Long, PerformanceAppraisalAppScoreInfo> businessScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId)
.eq(PerformanceAppraisalAppScoreInfo::getIndexType, AppIndexTypeEnum.BUSINESS.getCode()))
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getIndexId, p -> p));
if (CollUtil.isNotEmpty(coreBusinessIndicators)) {
List<AppBusinessIndexDetailVO> businessIndexDetails = coreBusinessIndicators.stream().map(c -> {
AppBusinessIndexDetailVO appBusinessIndexDetailVo = new AppBusinessIndexDetailVO();
BeanUtils.copyProperties(coreBusinessIndicators, appBusinessIndexDetailVo);
PerformanceAppraisalAppScoreInfo scoreInfo = businessScoreInfoMap.get(c.getId());
if (Objects.nonNull(scoreInfo)) {
appBusinessIndexDetailVo.setAppraisalScore(scoreInfo.getAppraisalScore());
}
return appBusinessIndexDetailVo;
}).collect(Collectors.toList());
resVo.setBusinessIndexDetails(businessIndexDetails);
@@ -466,46 +403,16 @@ public class AppAppraisalManage {
.map(AppAppraisalInfoDTO::getScore)
.filter(Objects::nonNull)
.reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal lastAppraisalTotalScore;
// 判断项目所在分组内其他复评人员是否已经打分
if (Objects.nonNull(appraisalApplication.getAppraisalTotalScore())){
// 已经进行了复评,计算两个分值的平均分
BigDecimal add = appraisalTotalScore.add(appraisalApplication.getAppraisalTotalScore());
lastAppraisalTotalScore = add.divide(BigDecimal.valueOf(2));
}else {
// 还没有进行过复评
lastAppraisalTotalScore = appraisalTotalScore;
}
appraisalApplication.setAppraisalTotalScore(lastAppraisalTotalScore);
// 取最新地打分时间
appraisalApplication.setAppraisalTotalScore(appraisalTotalScore);
appraisalApplication.setAppraisalScoreTime(LocalDateTime.now());
// 判断当前复评人是否为该评价应用关联的评价项目所在分组的复评人员中的最后一个复评人
// 获取评价应用关联的评价项目所在的评价计划关联的分组信息
String appraisalProjectCode = appraisalApplication.getAppraisalProjectCode();
List<PerformanceAppraisalProjectGroup> groups = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class)
.eq(PerformanceAppraisalProjectGroup::getAppraisalId,appraisalId));

// 获取当前登录复评员所在包含该评价应用的分组信息
List<PerformanceAppraisalProjectGroup> groupList = groups.stream().filter(g -> {
String reAppraisalUsers = g.getReAppraisalUsers();
String projectCodes = g.getProjectCodes();
if (reAppraisalUsers.contains(employeeCode) &&
projectCodes.contains(appraisalProjectCode)) {
return true;
}
return false;
}).collect(Collectors.toList());
PerformanceAppraisalProjectGroup projectGroup = groupList.get(0);
judgeCompleteAppraisal(projectGroup, appraisalApplication);
appraisalApplication.setUpdateOn(LocalDateTime.now());
// 一个复评员打完分就认为完成了打分
appraisalApplication.setIsCompleteAppraisal(Boolean.TRUE);
appraisalApplication.setUpdateBy(username);
performanceAppraisalApplicationService.updateById(appraisalApplication);
return "提交成功";
}
return "提交失败";
}


private void judgeCompleteAppraisal(PerformanceAppraisalProjectGroup group, PerformanceAppraisalApplication appraisalApplication) {
// 获取该评价应用的复评打分信息
List<PerformanceAppraisalAppScoreInfo> scoreInfos = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)


+ 2
- 4
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java View File

@@ -12,7 +12,6 @@ import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.enumeration.CommonEnum;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.performance.enumration.PerformanceTemplateTypeEnum;
import com.ningdatech.pmapi.performance.helper.TemplateDetailBuildHelper;
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorAppIndexSaveDTO;
@@ -32,7 +31,6 @@ import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalAppIndicato
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectIndicatorService;
import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateDetailService;
import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateService;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.AllArgsConstructor;
@@ -116,12 +114,12 @@ public class IndicatorConfigManage {
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, id)
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.TRUE));
if(CollUtil.isNotEmpty(templateDetails)){
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails,null);
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails, null, null);
vo.setTemplateDetails(templateDetailVos);
}

if (CollUtil.isNotEmpty(additionalTemplateDetails)){
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails,null);
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails, null, null);
vo.setAdditionalIndexDetails(additionalTemplateDetailVos);
}
return vo;


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java View File

@@ -283,8 +283,8 @@ public class OrgSelfAppraisalManage {
List<PerformanceIndicatorProjectTemplateDetail> additionalTemplateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, projectTemplate.getId())
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.TRUE));
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails,vo);
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails,vo);
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails,projectCode,vo);
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails,projectCode,vo);
vo.setProjectName(project.getProjectName());
vo.setBuildOrgName(project.getBuildOrgName());
vo.setProjectStatus(project.getStatus());


+ 33
- 10
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java View File

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

import com.ningdatech.pmapi.performance.model.entity.*;
import com.ningdatech.pmapi.performance.service.*;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@@ -27,19 +29,11 @@ import com.ningdatech.pmapi.common.util.CodeUtil;
import com.ningdatech.pmapi.performance.convert.PerformanceAppraisalConveter;
import com.ningdatech.pmapi.performance.enumration.EvalObjectEnum;
import com.ningdatech.pmapi.performance.model.dto.*;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisal;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplication;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectGroup;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalApplicationVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectGroupVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalApplicationService;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectGroupService;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectService;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalService;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum;
@@ -84,6 +78,8 @@ public class PerformanceAppraisalPlanManage {
private final IProjectInstService projectInstService;
private final ProcessInstanceService processInstanceService;
private final BuildUserUtils buildUserUtils;
private final IPerformanceAppraisalScoreInfoService performanceAppraisalScoreInfoService;
private final IPerformanceAppraisalAppScoreInfoService performanceAppraisalAppScoreInfoService;

/**
* 绩效列表
@@ -247,6 +243,8 @@ public class PerformanceAppraisalPlanManage {
// 计划名称重复校验
deduplicationName(createDTO);
PerformanceAppraisal pa = BeanUtil.copyProperties(createDTO,PerformanceAppraisal.class);


pa.setCreateOn(LocalDateTime.now());
pa.setCreateBy(user.getUsername());
pa.setUpdateOn(LocalDateTime.now());
@@ -412,9 +410,17 @@ public class PerformanceAppraisalPlanManage {
return;
}

//删除先
// 删除计划内的项目
performanceAppraisalProjectService.remove(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId,editDTO.getId()));
// 删除项目的打分信息
List<Long> projectIds = editDTO.getProjects().stream().map(AppraisalProjectDTO::getId).collect(Collectors.toList());
List<String> projectCodes = projectService.listByIds(projectIds).stream().map(Project::getProjectCode).collect(Collectors.toList());
// 删除项目的打分信息
performanceAppraisalScoreInfoService.remove(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
.eq(PerformanceAppraisalScoreInfo::getAppraisalId,editDTO.getId())
.in(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCodes));

Integer startSelfDays = editDTO.getStartSelfDays();
Integer completeSelfDays = editDTO.getCompleteSelfDays();
List<AppraisalProjectDTO> projects = editDTO.getProjects();
@@ -446,9 +452,16 @@ public class PerformanceAppraisalPlanManage {
if(Objects.isNull(editDTO.getApplicationIds())){
return;
}
//删除先
// 删除计划内的应用
performanceAppraisalApplicationService.remove(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId,editDTO.getId()));
// 删除计划内应用的打分信息
List<Long> applicationIdList = editDTO.getApplicationIds();
// 删除应用的打分信息
performanceAppraisalAppScoreInfoService.remove(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId,editDTO.getId())
.in(PerformanceAppraisalAppScoreInfo::getApplicationId,applicationIdList));

List<Long> applicationIds = editDTO.getApplicationIds();
Map<Long, ProjectApplication> applicationMap = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class).in(ProjectApplication::getId, applicationIds)).stream()
.collect(Collectors.toMap(ProjectApplication::getId, a -> a));
@@ -485,11 +498,21 @@ public class PerformanceAppraisalPlanManage {
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, id));
performanceAppraisalProjectService.removeBatchByIds(paps);
List<String> projectCodes = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList());
// 删除项目的打分信息
performanceAppraisalScoreInfoService.remove(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
.eq(PerformanceAppraisalScoreInfo::getAppraisalId,id)
.in(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCodes));
// 删除评价计划关联的应用
//绩效关联的应用
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId, id));
performanceAppraisalApplicationService.removeBatchByIds(paas);
List<Long> applicationIds = paas.stream().map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList());
// 删除应用的打分信息
performanceAppraisalAppScoreInfoService.remove(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId,id)
.in(PerformanceAppraisalAppScoreInfo::getApplicationId,applicationIds));
// 删除评级计划关联的分组信息
groupService.remove(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class)
.eq(PerformanceAppraisalProjectGroup::getAppraisalId,id));


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/RectifyAuditManage.java View File

@@ -81,7 +81,7 @@ public class RectifyAuditManage {
List<Role> userRoleList = user.getUserRoleList();
List<Long> roleIdList = userRoleList.stream().map(Role::getId).collect(Collectors.toList());
Role role =
roleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getName, RoleEnum.COMPANY_MANAGER.getDesc()));
roleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getName, RoleEnum.EXPERT.getDesc()));
if (Objects.isNull(role)) {
throw new BizException("登录用户没有专家角色!");
}
@@ -96,7 +96,7 @@ public class RectifyAuditManage {
List<PerformanceAppraisalProjectGroup> projectGroups = groupService.list();
for (PerformanceAppraisalProjectGroup projectGroup : projectGroups) {
String verifyLeader = projectGroup.getVerifyLeader();
if (verifyLeader.equals(employeeCode)) {
if (Objects.nonNull(verifyLeader) && verifyLeader.equals(employeeCode)) {
groups.add(projectGroup);
}
}


+ 0
- 3
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalAppIndicator.java View File

@@ -56,9 +56,6 @@ public class PerformanceAppraisalAppIndicator implements Serializable {
@ApiModelProperty("指标定义")
private String indexDef;

@ApiModelProperty("所属区域")
private String regionCode;

@ApiModelProperty("创建时间")
private LocalDateTime createOn;



+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppAppraisalIndexDetailVO.java View File

@@ -39,7 +39,7 @@ public class AppAppraisalIndexDetailVO implements Serializable {
private List<AppBusinessIndexDetailVO> businessIndexDetails;

@ApiModelProperty("评价分数信息")
private Map<String, List<PerformanceAppraisalAppScoreInfo>> appraisalScoreInfo;
private List<PerformanceAppraisalAppScoreInfo> appraisalScoreInfo;

@ApiModelProperty("评价得分信息")
private Map<String, BigDecimal> appraisalTotalScoreInfo;


+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/contants/ProjectCodeContant.java View File

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.projectdeclared.contants;

/**
* @Classname ProjectCodeContant
* @Description
* @Date 2023/8/10 15:20
* @Author PoffyZhang
*/
public interface ProjectCodeContant {

String REGION_LAST_3 = "000";

String PROJECT_TYPE_PREFIX = "0";

String SHUZI_5 = "%05d";
}

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

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



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


+ 8
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionManage.java View File

@@ -119,6 +119,8 @@ public class ConstructionManage {
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
item.setApprovedAmount(w.getApprovalAmount());
item.setApprovalDate(w.getApprovalDate());
item.setTransactionAmount(w.getTransactionAmount());
item.setTransactionTime(w.getTransactionTime());
return item;
});
return PageVo.of(records, total);
@@ -332,6 +334,8 @@ public class ConstructionManage {
item.setDeliveryTime(w.getDeliveryTime());
item.setContractAmount(w.getContractAmount());
item.setAnnualPlanAmount(w.getAnnualPlanAmount());
item.setTransactionTime(w.getTransactionTime());
item.setTransactionAmount(w.getTransactionAmount());
return item;
});
return PageVo.of(records, total);
@@ -364,6 +368,10 @@ public class ConstructionManage {
exportDTO.setDeliveryTime(r.getDeliveryTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
exportDTO.setContractAmount(r.getContractAmount());
exportDTO.setAnnualPlanAmount(r.getAnnualPlanAmount());
if(Objects.nonNull(r.getTransactionTime())){
exportDTO.setTransactionTime(r.getTransactionTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
}
exportDTO.setTransactionAmount(r.getTransactionAmount());
return exportDTO;
}).collect(Collectors.toList());
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PurchaseManage.java View File

@@ -209,7 +209,7 @@ public class PurchaseManage {
// 获取总的成交时间及金额
LocalDateTime lastTransactionTime = null;
BigDecimal transactionAmountTotal = BigDecimal.ZERO;
for (Purchase purchase : purchases) {
for (Purchase purchase : purchaseEntities) {
if (lastTransactionTime == null) {
lastTransactionTime = purchase.getTransactionTime();
} else if (purchase.getTransactionTime().isAfter(lastTransactionTime)) {


+ 32
- 68
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java View File

@@ -1,13 +1,8 @@
package com.ningdatech.pmapi.projectdeclared.utils;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.fiscal.entity.CompanyFiscalCode;
import com.ningdatech.pmapi.fiscal.service.ICompanyFiscalCodeService;
import com.ningdatech.pmapi.projectdeclared.contants.DeclaredProjectContant;
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.ningdatech.pmapi.projectdeclared.contants.ProjectCodeContant;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectCollection;
@@ -15,8 +10,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectCollectionService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

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

/**
@@ -37,68 +31,38 @@ public class GenerateProjectCodeUtil {
private IProjectCollectionService projectCollectionService;

public String generateProjectCode(ProjectDTO project){
// 获取所属行政区划代码(6位)
String areaCode = project.getAreaCode();
// 获取建设年度后两位
String year = String.valueOf(project.getProjectYear() % DeclaredProjectContant.Project.YEAR_DRAW_SURPLUS);
// 9-12位固定
String fixedNumber = DeclaredProjectContant.Project.FIXED_NUMBER;
// 获取公司的财政编码
CompanyFiscalCode companyFiscalCode = companyFiscalCodeService.getByOrganizationCode(project.getBuildOrgCode());

// 从表中查出单位配置的财政编码
if (Objects.isNull(companyFiscalCode)){
throw new BizException("申报单位未配置财政编码!");
}

String fiscalCode = companyFiscalCode.getFiscalCode();
// 获取项目编号
String projectIdStr;
// 获取项目库当前最大项目序号
List<Project> projectList = projectService.list(Wrappers.lambdaQuery(Project.class).orderByDesc(Project::getId));
Project maxProject = CollUtil.isEmpty(projectList) ? null : projectList.get(0);
Long projectId = Objects.isNull(maxProject) ? DeclaredProjectContant.Project.MIN_PROJECT_ID : maxProject.getId() + 1;
if (projectId > DeclaredProjectContant.Project.MAX_PROJECT_ID){
// 超过999的项目号从1开始 1
Long newProjectId = projectId % DeclaredProjectContant.Project.MAX_PROJECT_ID;
projectIdStr = String.format(StrPool.FORMAT_NUMBER_THREE, newProjectId);
}else {
projectIdStr = String.format(StrPool.FORMAT_NUMBER_THREE, projectId);
}
// 生成21位的项目编号
return areaCode + year + fixedNumber + fiscalCode + projectIdStr;
// 获取所属行政区划代码(9位)
String areaCode = project.getAreaCode() + ProjectCodeContant.REGION_LAST_3;
// 获取建设年度 (10-13)
String year = Objects.nonNull(project.getProjectYear()) ? String.valueOf(project.getProjectYear())
: String.valueOf(LocalDateTime.now().getYear());
// 14-15 项目类型
String projectType = ProjectCodeContant.PROJECT_TYPE_PREFIX + project.getProjectType();
// 16-20 项目序号00001
Long max = projectService.count(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectYear,project.getProjectYear())
.eq(Project::getNewest,Boolean.TRUE));
Long maxCurrent = max + 1;
String serialNumber = String.format(ProjectCodeContant.SHUZI_5,maxCurrent);
// 生成20位的项目编号
return areaCode + year + projectType + serialNumber;
}

public String generateProjectCode(ProjectCollection project){
// 获取所属行政区划代码(6位)
String areaCode = project.getAreaCode();
// 获取建设年度后两位
String year = String.valueOf(project.getProjectYear() % DeclaredProjectContant.Project.YEAR_DRAW_SURPLUS);
// 9-12位固定
String fixedNumber = DeclaredProjectContant.Project.FIXED_NUMBER;
// 获取公司的财政编码
CompanyFiscalCode companyFiscalCode = companyFiscalCodeService.getByOrganizationCode(project.getBuildOrgCode());

// 从表中查出单位配置的财政编码
if (Objects.isNull(companyFiscalCode)){
throw new BizException("申报单位未配置财政编码!");
}

String fiscalCode = companyFiscalCode.getFiscalCode();
// 获取项目编号
String projectIdStr;
// 获取项目库当前最大项目序号
List<ProjectCollection> projectList = projectCollectionService.list(Wrappers.lambdaQuery(ProjectCollection.class).orderByDesc(ProjectCollection::getId));
ProjectCollection maxProject = CollUtil.isEmpty(projectList) ? null : projectList.get(0);
Long projectId = Objects.isNull(maxProject) ? DeclaredProjectContant.Project.MIN_PROJECT_ID : maxProject.getId() + 1;
if (projectId > DeclaredProjectContant.Project.MAX_PROJECT_ID){
// 超过999的项目号从1开始 1
Long newProjectId = projectId % DeclaredProjectContant.Project.MAX_PROJECT_ID;
projectIdStr = String.format(StrPool.FORMAT_NUMBER_THREE, newProjectId);
}else {
projectIdStr = String.format(StrPool.FORMAT_NUMBER_THREE, projectId);
}
// 生成21位的项目编号
return areaCode + year + fixedNumber + fiscalCode + projectIdStr;
// 获取所属行政区划代码(9位)
String areaCode = project.getAreaCode() + ProjectCodeContant.REGION_LAST_3;
// 获取建设年度 (10-13)
String year = Objects.nonNull(project.getProjectYear()) ? String.valueOf(project.getProjectYear())
: String.valueOf(LocalDateTime.now().getYear());
// 14-15 项目类型
String projectType = ProjectCodeContant.PROJECT_TYPE_PREFIX + project.getProjectType();
// 16-20 项目序号00001
Long max = projectService.count(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectYear,project.getProjectYear())
.eq(Project::getNewest,Boolean.TRUE));
Long maxCurrent = max + 1;
String serialNumber = String.format(ProjectCodeContant.SHUZI_5,maxCurrent);
// 生成20位的项目编号
return areaCode + year + projectType + serialNumber;
}
}

+ 0
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java View File

@@ -6,14 +6,10 @@ import com.ningdatech.pmapi.projectlib.manage.ApplicationManage;
import com.ningdatech.pmapi.projectlib.model.dto.ApplicationAppCodeSaveDTO;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**


+ 8
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java View File

@@ -1,6 +1,9 @@
package com.ningdatech.pmapi.projectlib.handle;

import java.util.*;
import java.util.stream.Collectors;

import cn.hutool.core.collection.CollUtil;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
@@ -68,14 +71,16 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle {
void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) {
ProcessDetailVO processDetailVO = new ProcessDetailVO();

Project project = projectService.getById(projectId);
Project project = projectService.getNewProject(projectId);
//查出历史版本的 所有项目ID
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project);
Integer status = project.getStatus();
List<Integer> fieldList = CollUtils.fieldList(PROJECT_APPROVAL_LIST_STATUS, ProjectStatusEnum::getCode);
if(Objects.isNull(status)){
return;
}

// 项目状态为待立项批复之前的状态
if (fieldList.contains(status)){
if (status < ProjectStatusEnum.TO_BE_APPROVED.getCode()){
processDetailVO.setStepStatus(StepStatusEnum.NOT_START);
processDetailVO.setProcessName(CommonConst.PROJECT_APPROVAL);
processSchedule.add(processDetailVO);


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

@@ -149,7 +149,6 @@ public class AnnualPlanLibManage {
Project oldProject = projectService.getById(req.getProjectId());
Project project = BeanUtil.copyProperties(oldProject, Project.class);
// 被撤回重新申报的项目,项目ID要置空
project.setId(null);
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
stateMachine.pass(project);
@@ -167,6 +166,7 @@ public class AnnualPlanLibManage {
project.setProjectCode(oldProject.getProjectCode());
project.setVersion(oldProject.getVersion() + 1);
project.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE);
project.setId(null);
if(projectService.save(project)){
applicationService.saveApplication(project,oldProject,Boolean.TRUE);
// 将旧的项目版本置为不是最新


+ 83
- 5
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -47,10 +47,10 @@ import com.ningdatech.pmapi.projectdeclared.service.*;
import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil;
import com.ningdatech.pmapi.projectlib.constant.ProjectConstant;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.handle.ProcessExecuteChainHandle;
import com.ningdatech.pmapi.projectlib.helper.ProjectHelper;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectApplicationDTO;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.*;
import com.ningdatech.pmapi.projectlib.model.req.ProjectApplicationListReq;
@@ -119,11 +119,11 @@ public class ProjectLibManage {
private final ITodoService todoService;
private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService;

private final IOperationService operationService;

private final IProjectTagService projectTagService;
private final ITagService tagService;

private final IOperationService operationService;

private final ISupplierSafetyQualificationService supplierSafetyQualificationService;

private final IPersonSafetyInfoService personSafetyInfoService;
@@ -136,6 +136,22 @@ public class ProjectLibManage {
if ((total = page.getTotal()) == 0) {
return PageVo.empty();
}

//已验收项目ID
List<Long> acceptedProjectId = page.getRecords().stream().filter(p -> ProjectStatusEnum.ACCEPTED.getCode().equals(p.getStatus()))
.map(Project::getId).collect(Collectors.toList());

Map<Long,List<ProjectRenewalFundDeclaration>> renewalMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(acceptedProjectId)){
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.in(ProjectRenewalFundDeclaration::getProjectId, acceptedProjectId)
.eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name())
.eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE)
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear));
renewalMap = renewalDeclarations.stream().collect(Collectors.groupingBy(ProjectRenewalFundDeclaration::getProjectId));
}

Map<Long, List<ProjectRenewalFundDeclaration>> finalRenewalMap = renewalMap;
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> {
ProjectLibListItemVO item = new ProjectLibListItemVO();
item.setId(w.getId());
@@ -154,6 +170,14 @@ public class ProjectLibManage {
item.setProcessStatus(w.getProcessStatus());
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
if(finalRenewalMap.containsKey(item.getId())){
List<ProjectRenewalFundDeclaration> prfs = finalRenewalMap.get(item.getId());
item.setAnnualAccumulateAmount(computeAmount(w.getAnnualPlanAmount(),prfs));
item.setAnnualAccumulateAmountList(convertAccmulate(w,prfs));
}else{
item.setAnnualAccumulateAmount(w.getAnnualPlanAmount());
item.setAnnualAccumulateAmountList(convertAccmulate(w,Collections.emptyList()));
}
return item;
});
return PageVo.of(records, total);
@@ -188,6 +212,22 @@ public class ProjectLibManage {
}
Map<String, List<ProjectTag>> finalTagMap = tagMap;
Map<Long,String> finalTagNameMap = tagNameMap;

//已验收项目ID
List<Long> acceptedProjectId = page.getRecords().stream().filter(p -> ProjectStatusEnum.ACCEPTED.getCode().equals(p.getStatus()))
.map(Project::getId).collect(Collectors.toList());

Map<Long,List<ProjectRenewalFundDeclaration>> renewalMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(acceptedProjectId)){
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.in(ProjectRenewalFundDeclaration::getProjectId, acceptedProjectId)
.eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name())
.eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE)
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear));
renewalMap = renewalDeclarations.stream().collect(Collectors.groupingBy(ProjectRenewalFundDeclaration::getProjectId));
}

Map<Long, List<ProjectRenewalFundDeclaration>> finalRenewalMap = renewalMap;
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> {
ProjectLibListItemVO item = new ProjectLibListItemVO();
item.setId(w.getId());
@@ -212,13 +252,48 @@ public class ProjectLibManage {
&& w.getSuperOrgCode().equals(finalUser.getEmpPosUnitCode())) {
item.setCanPreDeclared(Boolean.TRUE);
}
item.setApprovedAmount(w.getApprovalAmount());
item.setAnnualPlanAmount(w.getAnnualPlanAmount());
item.setPrePlanProjectId(w.getPrePlanProjectId());
setTag(item,finalTagMap,finalTagNameMap);
if(finalRenewalMap.containsKey(item.getId())){
List<ProjectRenewalFundDeclaration> prfs = finalRenewalMap.get(item.getId());
item.setAnnualAccumulateAmount(computeAmount(w.getAnnualPlanAmount(),prfs));
item.setAnnualAccumulateAmountList(convertAccmulate(w,prfs));
}else{
item.setAnnualAccumulateAmount(w.getAnnualPlanAmount());
item.setAnnualAccumulateAmountList(convertAccmulate(w,Collections.emptyList()));
}
return item;
});
return PageVo.of(records, total);
}

private BigDecimal computeAmount(BigDecimal cuurentAmount,List<ProjectRenewalFundDeclaration> prfs) {
BigDecimal res = cuurentAmount;
for(ProjectRenewalFundDeclaration prf : prfs){
res = res.add(prf.getAnnualPaymentAmount());
}
return res;
}

private List<AnnualAmountVO> convertAccmulate(Project project,List<ProjectRenewalFundDeclaration> prfs) {
List<AnnualAmountVO> annualAmounts = Lists.newArrayList();
annualAmounts.add(AnnualAmountVO.builder()
.projectId(project.getId())
.projectYear(project.getProjectYear())
.annualAmount(project.getAnnualPlanAmount())
.build());
for(ProjectRenewalFundDeclaration prf : prfs){
annualAmounts.add(AnnualAmountVO.builder()
.projectId(prf.getProjectId())
.projectYear(prf.getProjectYear())
.annualAmount(prf.getAnnualPaymentAmount())
.build());
}
return annualAmounts;
}

private void setTag(ProjectLibListItemVO item, Map<String, List<ProjectTag>> finalTagMap, Map<Long, String> finalTagNameMap) {
if(finalTagMap.containsKey(item.getProjectCode())){
List<TagVO> tags = Lists.newArrayList();
@@ -336,7 +411,9 @@ public class ProjectLibManage {
.annualAmount(projectInfo.getAnnualPlanAmount())
.build());
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId())
.eq(ProjectRenewalFundDeclaration::getProjectId, projectInfo.getId())
.eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name())
.eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE)
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear));
Optional.ofNullable(renewalDeclarations).ifPresent(declarations ->
declarations.forEach(declaration -> {
@@ -465,6 +542,8 @@ public class ProjectLibManage {
.build());
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId())
.eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name())
.eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE)
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear));
Optional.ofNullable(renewalDeclarations).ifPresent(declarations ->
declarations.forEach(declaration -> {
@@ -1278,7 +1357,6 @@ public class ProjectLibManage {
projectApplication.setBuildOrgName(finalProject.getBuildOrgName());
projectApplication.setProjectVersion(version);
projectApplication.setIsConstruct(isConstruct);

if(StringUtils.isNotBlank(application.getRelatedExistsApplication())){
projectApplication.setApplicationName(null);
}


+ 33
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java View File

@@ -2,7 +2,9 @@ package com.ningdatech.pmapi.projectlib.manage;

import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
@@ -22,6 +24,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaratio
import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO;
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq;
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq;
import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO;
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
@@ -37,6 +40,7 @@ import java.io.IOException;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;

/**
@@ -99,6 +103,30 @@ public class ProjectRenewalFundManage {
vo.setStage(project.getStage());
vo.setStatus(project.getStatus());
vo.setBuildOrgName(project.getBuildOrgName());
vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount());
if (ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus())) {
List<AnnualAmountVO> annualAmounts = Lists.newArrayList();
annualAmounts.add(AnnualAmountVO.builder()
.projectId(project.getId())
.projectYear(project.getProjectYear())
.annualAmount(project.getAnnualPlanAmount())
.build());
List<ProjectRenewalFundDeclaration> renewalDeclarations = projectRenewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getProjectId())
.eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name())
.eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE)
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear));
Optional.ofNullable(renewalDeclarations).ifPresent(declarations ->
declarations.forEach(declaration -> {
annualAmounts.add(AnnualAmountVO.builder()
.projectId(project.getId())
.projectYear(declaration.getProjectYear())
.annualAmount(declaration.getAnnualPaymentAmount())
.build());
})
);
vo.setAnnualAccumulateAmountList(annualAmounts);
}
return vo;
}

@@ -121,11 +149,14 @@ public class ProjectRenewalFundManage {
ProjectRenewalFundDeclaration oldDeclaration = projectRenewalFundDeclarationService.getById(dto.getId());
VUtils.isTrue(Objects.isNull(oldDeclaration)).throwMessage(String.format("重新申报失败 【%s】 该申报不存在!",dto.getId()));
BeanUtils.copyProperties(oldDeclaration,declaration);
}else{
declaration.setCreateOn(LocalDateTime.now());
declaration.setUpdateOn(LocalDateTime.now());
}
BeanUtils.copyProperties(dto,declaration);
declaration.setCreateOn(LocalDateTime.now());
declaration.setUpdateOn(LocalDateTime.now());
declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name());
declaration.setRegionCode(project.getAreaCode());
declaration.setOrgCode(project.getBuildOrgCode());
if(!projectRenewalFundDeclarationService.saveOrUpdate(declaration)){
throw new BusinessException(String.format("申报失败 【%s】",dto.getId()));
}


+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java View File

@@ -6,6 +6,7 @@ import com.ningdatech.pmapi.common.enumeration.CommonEnum;
import com.ningdatech.pmapi.portrait.model.vo.TagVO;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import io.swagger.annotations.ApiModel;
@@ -155,6 +156,10 @@ public class ProjectLibListItemVO {

//预审申报时候 需不需要上传上级条线意见文件
private Boolean needUploadSuperLineFile;

@ApiModelProperty("年度投资金额总额")
private BigDecimal annualAccumulateAmount;
private List<AnnualAmountVO> annualAccumulateAmountList;
public Boolean getNeedUploadSuperLineFile() {
UserInfoDetails userInfoDetail = LoginUserUtil.loginUserDetail();
//要满足条件 1.当前登录人是市本级单位 2.有上级条线单位 3.项目状态是待预审


+ 7
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectRenewalFundDeclarationVO.java View File

@@ -7,6 +7,7 @@ import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
* <p>
@@ -84,4 +85,10 @@ public class ProjectRenewalFundDeclarationVO implements Serializable {

@ApiModelProperty("项目类型 1建设 2运维")
private Integer projectType;

@ApiModelProperty("审核意见")
private String auditOpinion;

@ApiModelProperty("年度投资金额详情")
private List<AnnualAmountVO> annualAccumulateAmountList;
}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/provincial/service/impl/JoinReviewProvincialBureauServiceImpl.java View File

@@ -50,7 +50,7 @@ public class JoinReviewProvincialBureauServiceImpl implements IJoinReviewProvinc
@Autowired
private RestTemplate restTemplate;

@Resource(name = "refreshToken")
@Resource
private IRefreshTokenService refreshTokenService;

@Value("${irs.interface-refresh.request-token-url}")


+ 2
- 4
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java View File

@@ -114,6 +114,7 @@ public class EarlyWarningInstanceNotStartTask {
.eq(Project::getAreaCode, areaCode)
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getStatus,projectStutas));

//需要发通知的项目
List<Project> needToWaringProjects = needNextProjects.stream()
.filter(p -> {
@@ -129,9 +130,6 @@ public class EarlyWarningInstanceNotStartTask {
}
}

log.info("projectId :{}",p.getId());
log.info("秒数差 :{}",Duration.between(p.getUpdateOn(),LocalDateTime.now()).getSeconds());

if(Duration.between(p.getUpdateOn(),LocalDateTime.now()).toMinutes() >= time * 60 && //time * 60
Duration.between(p.getUpdateOn(),LocalDateTime.now()).toMinutes() <= time * 60 + 1){ //time * 60
return Boolean.TRUE;
@@ -220,7 +218,7 @@ public class EarlyWarningInstanceNotStartTask {
.eq(Project::getAreaCode, areaCode)
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getStatus,projectStutas));
log.info("needNextProjects :{}",needNextProjects.size());
List<String> projectCodes = needNextProjects.stream().map(Project::getProjectCode).collect(Collectors.toList());

List<Operation> operations = operationService.list(Wrappers.lambdaQuery(Operation.class)


+ 9
- 11
pmapi/src/main/java/com/ningdatech/pmapi/staging/enums/MsgTypeEnum.java View File

@@ -9,6 +9,7 @@ import java.util.Objects;

/**
* 消息类型枚举
*
* @author CMM
* @since 2023/02/28 17:34
*/
@@ -17,38 +18,35 @@ import java.util.Objects;
@NoArgsConstructor
public enum MsgTypeEnum {
/**
* 消息类型
*/
/**
* 项目待审核
*/
PROJECT_REVIEW(1,"项目审核"),
PROJECT_REVIEW(1, "项目审核"),
/**
* 预警提醒
*/
WARING(2,"预警提醒"),
WARING(2, "预警提醒"),
/**
* 专家评审
*/
EXPERT_REVIEW(3,"专家评审"),
EXPERT_REVIEW(3, "专家评审"),
/**
* 评审会议
*/
REVIEW_MEETING(4,"评审会议"),
REVIEW_MEETING(4, "评审会议"),
/**
* 项目审核被退回
*/
PROJECT_REVIEW_BACK(5,"项目审核"),
PROJECT_REVIEW_BACK(5, "项目审核"),
/**
* 项目审核通过
*/
PROJECT_REVIEW_PASS(6,"项目审核"),
PROJECT_REVIEW_PASS(6, "项目审核"),
/**
* 项目审核驳回
*/
PROJECT_REVIEW_REJECT(7,"项目审核"),
PROJECT_REVIEW_REJECT(7, "项目审核"),

PROJECT_REVIEW_CC(8,"项目抄送");
PROJECT_REVIEW_CC(8, "项目抄送");

private Integer code;
private String desc;


+ 25
- 7
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -648,7 +648,10 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
Map<String, Project> projectInfoMap = projectInstList.stream()
.filter(p -> StringUtils.isNotBlank(p.getInstCode()) &&
!TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode()))
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 查出用户工作流
@@ -719,7 +722,10 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
projectInfoMap = projectInstList.stream()
.filter(p -> StringUtils.isNotBlank(p.getInstCode()) &&
!TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode()))
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 查出用户工作流
@@ -788,7 +794,10 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
Map<String, Project> projectInfoMap = projectInstList.stream()
.filter(p -> StringUtils.isNotBlank(p.getInstCode()) &&
!TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode()))
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 查出用户工作流
@@ -857,7 +866,10 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
projectInfoMap = projectInstList.stream()
.filter(p -> StringUtils.isNotBlank(p.getInstCode()) &&
!TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode()))
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 查出用户工作流
@@ -927,7 +939,10 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
Map<String, Project> projectInfoMap = projectInstList.stream()
.filter(p -> StringUtils.isNotBlank(p.getInstCode()) &&
!TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode()))
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 查出用户工作流
@@ -997,7 +1012,10 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
projectInfoMap = projectInstList.stream()
.filter(p -> StringUtils.isNotBlank(p.getInstCode()) &&
!TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode()))
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 分页查出用户工作流
@@ -1105,7 +1123,7 @@ public class TodoCenterManage {
.eq(ProjectInst::getInstCode, oldProject.getInstCode()));

String instCode = oldProject.getInstCode();
oldInst.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE);
oldInst.setInstCode("EMPTY");
projectInstService.updateById(oldInst);

ProjectInst newPi = new ProjectInst();


+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/convert/UserInfoConvertor.java View File

@@ -32,6 +32,7 @@ public class UserInfoConvertor {
userInfoDetails.setOrganizationName(userFullInfo.getOrganizationName());
userInfoDetails.setEmpPosUnitCode(userFullInfo.getEmpPosUnitCode());
userInfoDetails.setEmpPosUnitName(userFullInfo.getEmpPosUnitName());
userInfoDetails.setMobile(userFullInfo.getMobile());
return userInfoDetails;
}



+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java View File

@@ -73,6 +73,9 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails {
private String empPosUnitName;


private String mobile;


/**
* 获取用户权限
*


+ 1
- 0
pmapi/src/main/resources/application-dev.yml View File

@@ -253,5 +253,6 @@ hostname: iZbp13nwyvib53j4j1p2xoZ
login:
phone-verify-code:
skip: true
url: http://lspm.ningdatech.com/login



+ 1
- 0
pmapi/src/main/resources/application-pre.yml View File

@@ -255,3 +255,4 @@ hostname: iZ6mx01asxnsmennpzoxooZ
login:
phone-verify-code:
skip: true
url: http://60.188.225.145:8080/login

+ 1
- 0
pmapi/src/main/resources/application-prod.yml View File

@@ -255,3 +255,4 @@ hostname: iZ6mx01gyeodd80imxd2gbZ
login:
phone-verify-code:
skip: true
url: http://60.188.225.145/login

+ 2
- 2
pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest.java View File

@@ -50,7 +50,7 @@ public class IrsTest extends AppTests {
public void test1() {
String method = "GET";
String url = "https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020230427000001/irs-res-bill/report/pdfUrl" +
"?appCode=A331101453557202109017383";
"?appCode=A331123467587202210014168";
String appScret = "BCDSGS_4ab4235d26a9a357170a39f3a13fd68c";
String appKey = "BCDSGA_d874c8e46b541eb4e8aac6510fd3351b";

@@ -76,7 +76,7 @@ public class IrsTest extends AppTests {
String areaCode = "331123";
String appScret = "496f0f2a19994f76b4fd9dae087366c7";
String appKey = "A331101453557202109017383";
String appCode = "A331123467587202307014170";//A331123467587202307014171
String appCode = "A331123467587202307014177";//A331123467587202307014171

String requestSecret = RefreshKeyUtil.getRequestSecret(appKey, appScret);
String sign = CryptUtils.MD5Encode(appKey + requestSecret + timestamp);


+ 2
- 2
pmapi/src/test/java/com/ningdatech/pmapi/irs/irsTest3.java View File

@@ -24,7 +24,7 @@ import java.util.Objects;
@Slf4j
public class irsTest3 extends AppTests {

@Resource(name = "refreshToken")
@Resource
private IRefreshTokenService refreshTokenService;

@Value("${irs.interface-local-refresh.request-token-url}")
@@ -74,7 +74,7 @@ public class irsTest3 extends AppTests {
}else{
restTemplate = new RestTemplate();
}
String appId = "A330000100000202105005790";
String appId = "A331123467587202307014177";
String updateTime = "2023-07-26 00:00:00";
String capCode = timestamp + updateTime + appId;
String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/" +


Loading…
Cancel
Save