WendyYang пре 11 месеци
родитељ
комит
5d769b0b60
100 измењених фајлова са 914 додато и 1063 уклоњено
  1. +0
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/common/config/ProvincialProperties.java
  2. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/common/constant/RegionConst.java
  3. +6
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/common/enumeration/ExportOptionEnum.java
  4. +1
    -9
      hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionLimitHelperImpl.java
  5. +0
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java
  6. +3
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/common/util/DictUtils.java
  7. +4
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/common/util/Md5Utils.java
  8. +5
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/common/util/RefreshKeyUtil.java
  9. +3
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/common/util/RegionUtils.java
  10. +33
    -31
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/handle/ProjectStatusHandler.java
  11. +53
    -46
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ExpertStatisticsManage.java
  12. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ProjectCostStatisticsManage.java
  13. +0
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/model/vo/ProtraitProjectInfoVO.java
  14. +3
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/DictAssembler.java
  15. +6
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertUserInfoAssembler.java
  16. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/RegionWrapperAssembler.java
  17. +3
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/expert/constant/ExpertUserInfoSensitiveFieldEnum.java
  18. +1
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ReviewTemplateSettingsController.java
  19. +10
    -11
      hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertMetaApplyManage.java
  20. +7
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertReviewManage.java
  21. +0
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ReviewTemplateVO.java
  22. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertAdminManageServiceImpl.java
  23. +12
    -12
      hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertReviewServiceImpl.java
  24. +1
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertUserFullInfoServiceImpl.java
  25. +22
    -18
      hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/DocumentationManage.java
  26. +37
    -32
      hz-pm-api/src/main/java/com/hz/pm/api/gov/convert/ProjectConvert.java
  27. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/gov/utils/ProjectCollectionUtil.java
  28. +5
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/irs/manage/AppIrsManage.java
  29. +0
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/irs/model/dto/ApiDTO.java
  30. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/irs/model/res/ApiResponse.java
  31. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/irs/utils/RefreshTokenUtil.java
  32. +14
    -12
      hz-pm-api/src/main/java/com/hz/pm/api/leave/manage/LeaveManage.java
  33. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ReviewProjectDTO.java
  34. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertAttendStatVO.java
  35. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/meta/controller/MetaDictionaryManageController.java
  36. +5
    -19
      hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/ExpertUserInfoHelperImpl.java
  37. +2
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/impl/TagsCacheImpl.java
  38. +10
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/meta/validate/DictParamValidator.java
  39. +6
    -58
      hz-pm-api/src/main/java/com/hz/pm/api/organization/entity/OrganizationMainManageTag.java
  40. +5
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/organization/service/impl/DingEmployeeInfoServiceImpl.java
  41. +8
    -9
      hz-pm-api/src/main/java/com/hz/pm/api/performance/controller/AppAppraisalController.java
  42. +14
    -16
      hz-pm-api/src/main/java/com/hz/pm/api/performance/controller/ReAppraisalController.java
  43. +86
    -88
      hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/ReAppraisalManage.java
  44. +59
    -63
      hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/RectifyManage.java
  45. +7
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/AppAppraisalInfoDTO.java
  46. +1
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ProjectAppraisalDTO.java
  47. +4
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ProjectAppraisalInfoDTO.java
  48. +4
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ReAppraisalInfoDTO.java
  49. +15
    -17
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ReAppraisalScoreExportDTO.java
  50. +4
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/entity/ProjectCoreBusinessIndicators.java
  51. +6
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppAppraisalIndexDetailVO.java
  52. +6
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppBusinessIndexDetailVO.java
  53. +6
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppIndexDetailVO.java
  54. +5
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppIndexVO.java
  55. +5
    -9
      hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/PerformanceAppraisalAppVO.java
  56. +3
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ProjectAdjustmentController.java
  57. +2
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ReviewChecklistController.java
  58. +3
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java
  59. +12
    -15
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java
  60. +79
    -83
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java
  61. +1
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/mapper/NdPiotTasksMapper.java
  62. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java
  63. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ContractVO.java
  64. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/DelayedApplyVO.java
  65. +0
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ReviewCheckInfoVO.java
  66. +5
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/constant/ProjectConstant.java
  67. +19
    -22
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/DeptUnitedReviewHandle.java
  68. +17
    -18
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProcessExecuteChainHandle.java
  69. +10
    -12
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProjectApprovalHandle.java
  70. +10
    -10
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProvinceUnitedReviewHandle.java
  71. +17
    -17
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/TenderPurchaseHandle.java
  72. +8
    -10
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/UnitInnerAuditHandle.java
  73. +42
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectRenewFundHelper.java
  74. +0
    -48
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectRenewwalFundHelper.java
  75. +23
    -19
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectCollectionManage.java
  76. +2
    -9
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectRenewalFundManage.java
  77. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectCollectionSaveDTO.java
  78. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java
  79. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/ProjectApprovedReq.java
  80. +2
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java
  81. +1
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/impl/ProjectApplicationServiceImpl.java
  82. +12
    -16
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/utils/ProjectVersionUtil.java
  83. +11
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/provincial/controller/TestController.java
  84. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvinceApiResponse.java
  85. +2
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialApplicationDTO.java
  86. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialProjectRes.java
  87. +43
    -44
      hz-pm-api/src/main/java/com/hz/pm/api/safety/manage/SafetyRiskManage.java
  88. +12
    -13
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/CcTaskListener.java
  89. +3
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessStartListener.java
  90. +11
    -11
      hz-pm-api/src/main/java/com/hz/pm/api/staging/service/impl/ProjectStagingServiceImpl.java
  91. +2
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java
  92. +25
    -27
      hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowUtil.java
  93. +4
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/UserGuidanceController.java
  94. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/Region.java
  95. +3
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/controller/TodoCenterController.java
  96. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/handle/PassHandle.java
  97. +20
    -21
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java
  98. +1
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/ProcessProgressDetailVO.java
  99. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/TodoNumVO.java
  100. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/ITodoService.java

+ 0
- 3
hz-pm-api/src/main/java/com/hz/pm/api/common/config/ProvincialProperties.java Прегледај датотеку

@@ -4,9 +4,6 @@ import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

/**
* @author zpf
* @date 2023/3/2 下午5:37


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/common/constant/RegionConst.java Прегледај датотеку

@@ -65,7 +65,7 @@ public interface RegionConst {
String QN = "331127";
String LQ = "331181";

List<String> LS_ARR = Lists.newArrayList(RC_LS,LS_KF,LD,QT,JY,SC,SY,YH,QY,QN,LQ);
List<String> LS_ARR = Lists.newArrayList(RC_LS, LS_KF, LD, QT, JY, SC, SY, YH, QY, QN, LQ);

//----------------------------------------地区父级ID(缩写PID)---------------------------------------------------------



+ 6
- 7
hz-pm-api/src/main/java/com/hz/pm/api/common/enumeration/ExportOptionEnum.java Прегледај датотеку

@@ -2,7 +2,6 @@ package com.hz.pm.api.common.enumeration;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;


/**
@@ -13,7 +12,7 @@ import lombok.NoArgsConstructor;
*/
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuppressWarnings("all")
public enum ExportOptionEnum {
/**
* 导出选项
@@ -142,14 +141,14 @@ public enum ExportOptionEnum {

projectRemarks(59, "备注"),
processStatusName(60, "流程状态名称"),
processLaunchTime(61,"流程发起时间"),
processHandleTime(62,"流程处理时间"),
processLaunchTime(61, "流程发起时间"),
processHandleTime(62, "流程处理时间"),

projectStatusName(63,"项目状态名称"),
projectStatusName(63, "项目状态名称"),

createOn(64,"创建时间"),
createOn(64, "创建时间"),

updateOn(65,"更新时间");
updateOn(65, "更新时间");


private Integer code;


+ 1
- 9
hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionLimitHelperImpl.java Прегледај датотеку

@@ -98,30 +98,22 @@ public class RegionLimitHelperImpl extends AbstractRegionLimitHelper {
logger.error("getExpertAdminContainsRegion expertAdminUserId is null");
return new ArrayList<>();
}

UserInfo userInfo = iUserInfoService.getById(expertAdminUserId);

if (Objects.isNull(userInfo) || StringUtils.isBlank(userInfo.getRegionCode())) {
logger.error("getExpertAdminContainsRegion userInfo is null Or regionCode is null");
return new ArrayList<>();
}

String regionCode = userInfo.getRegionCode();
List<Region> regionList = regionService.list(Wrappers.lambdaQuery(Region.class)
.eq(Region::getRegionCode, regionCode)
.orderByDesc(Region::getRegionLevel));

Region region = regionList.get(0);
Collection<String> regionCodes = regionCache
.listChildRegionCodeList(region.getRegionCode(), region.getRegionLevel());
RegionContainsBO regionContainsBO = new RegionContainsBO();
regionContainsBO.setContainsRegionCodeList(new ArrayList<>(regionCodes));
regionContainsBO.setParentRegionTreeLevel(region.getRegionLevel());

ArrayList<RegionContainsBO> regionContainsBOS = CollectionUtil.toList(regionContainsBO);

return regionContainsBOS;
return CollectionUtil.toList(regionContainsBO);
}


}

+ 0
- 4
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java Прегледај датотеку

@@ -1,16 +1,12 @@
package com.hz.pm.api.common.statemachine.action;

import com.hz.pm.api.common.constant.StateMachineConst;
import com.hz.pm.api.common.statemachine.builder.ProjectDeclareStateMachineBuilder;
import com.hz.pm.api.common.statemachine.contants.RegionContant;
import com.hz.pm.api.common.statemachine.util.StateMachineUtils;
import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.Message;
import org.springframework.statemachine.StateContext;
import org.springframework.statemachine.action.Action;
import org.springframework.statemachine.annotation.OnTransition;
import org.springframework.statemachine.annotation.WithStateMachine;



+ 3
- 1
hz-pm-api/src/main/java/com/hz/pm/api/common/util/DictUtils.java Прегледај датотеку

@@ -10,9 +10,11 @@ import java.util.List;
* @author liuxinxin
* @date 2022/7/28 下午2:14
*/

public class DictUtils {

private DictUtils() {
}

public static Boolean isValueEquals(List<DictionaryFieldInfo> list1, List<DictionaryFieldInfo> list2) {
if (CollUtil.isEmpty(list1) && CollUtil.isEmpty(list2)) {
return true;


+ 4
- 0
hz-pm-api/src/main/java/com/hz/pm/api/common/util/Md5Utils.java Прегледај датотеку

@@ -7,6 +7,10 @@ import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;

public class Md5Utils {

private Md5Utils() {
}

private static final Logger LOGGER = LoggerFactory.getLogger(Md5Utils.class);

public static byte[] md5(String s) {


+ 5
- 1
hz-pm-api/src/main/java/com/hz/pm/api/common/util/RefreshKeyUtil.java Прегледај датотеку

@@ -16,7 +16,11 @@ import java.util.Objects;
*/
@Slf4j
public class RefreshKeyUtil {
public static String getRequestSecret(String appKey, String appSecret,Long requestTime) {

private RefreshKeyUtil() {
}

public static String getRequestSecret(String appKey, String appSecret, Long requestTime) {
// 刷新秘钥
HttpUtil httpUtil = HttpUtil.getInstance();
log.info("请求密钥" + appSecret);


+ 3
- 1
hz-pm-api/src/main/java/com/hz/pm/api/common/util/RegionUtils.java Прегледај датотеку

@@ -10,9 +10,11 @@ import java.util.List;
* @author liuxinxin
* @date 2022/7/28 下午2:27
*/

public class RegionUtils {

private RegionUtils() {
}

public static Boolean isValueEquals(ExpertRegionInfo regionInfo1, ExpertRegionInfo regionInfo2) {
if (null == regionInfo1.getRegionCode() && null == regionInfo1.getRegionLevel()) {
return false;


+ 33
- 31
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/handle/ProjectStatusHandler.java Прегледај датотеку

@@ -1,14 +1,13 @@
package com.hz.pm.api.dashboard.handle;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.core.util.CommonUtils;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.util.BizUtils;
import com.hz.pm.api.dashboard.constant.DashboardConstant;
import com.hz.pm.api.dashboard.model.vo.ProtraitProjectStatusSituationVO;
import com.hz.pm.api.performance.model.entity.PerformanceAppraisalProject;
import com.hz.pm.api.performance.service.IPerformanceAppraisalProjectService;
import com.hz.pm.api.projectlib.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange;
@@ -43,17 +42,18 @@ public class ProjectStatusHandler {
private final INdProjectStatusChangeService statusChangeService;

private final HistoryService historyService;
private final IPerformanceAppraisalProjectService performanceAppraisalProjectService;
/**
* 不同的项目状态 去求不同的审批完成时间 审批类型的
* @param project
* @return
*
* @param project \
* @return \
*/
public ProtraitProjectStatusSituationVO generateApproveStatus(Project project,String statusName,Integer instType) {
public ProtraitProjectStatusSituationVO generateApproveStatus(Project project, String statusName, Integer instType) {
ProtraitProjectStatusSituationVO vo = new ProtraitProjectStatusSituationVO();
if(Objects.isNull(project)){
if (Objects.isNull(project)) {
return vo;
}
vo.setStatusName(statusName);
@@ -67,7 +67,7 @@ public class ProjectStatusHandler {
.in(ProjectInst::getProjectId, ids)
.eq(ProjectInst::getInstType, instType)
.last(BizConst.LIMIT_1));
if(Objects.isNull(unitInst)){
if (Objects.isNull(unitInst)) {
return vo;
}
//查询 这个实例 的完成时间
@@ -75,7 +75,7 @@ public class ProjectStatusHandler {
.finished()
.processInstanceId(unitInst.getInstCode())
.singleResult();
if(Objects.isNull(instance)){
if (Objects.isNull(instance)) {
return vo;
}
Date endTime = instance.getEndTime();
@@ -85,29 +85,28 @@ public class ProjectStatusHandler {

/**
* 不同的项目状态 去求不同的审批完成时间 非审批类型的
* @param project
* @return
*
* @param project \
* @return \
*/
public ProtraitProjectStatusSituationVO generateStatus(Project project,String statusName,
Integer beforeStatusCode,Integer afterStatusCode) {
public ProtraitProjectStatusSituationVO generateStatus(Project project, String statusName,
Integer currStatus, Integer nextStatus) {
ProtraitProjectStatusSituationVO vo = new ProtraitProjectStatusSituationVO();
if(Objects.isNull(project)){
if (Objects.isNull(project)) {
return vo;
}
vo.setStatusName(statusName);
//查询 单位内部审核完成的时间
String projectCode = project.getProjectCode();
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectCode, projectCode));
List<Long> ids = projects.stream().map(Project::getId).collect(Collectors.toList());
//查询 状态机流转的时间点
ProjectStatusChange statusChange = statusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class)
.eq(ProjectStatusChange::getBeforeStatus, beforeStatusCode)
LambdaQueryWrapper<ProjectStatusChange> pscQuery = Wrappers
.lambdaQuery(ProjectStatusChange.class)
.eq(ProjectStatusChange::getBeforeStatus, currStatus)
.eq(ProjectStatusChange::getProjectCode, projectCode)
.eq(ProjectStatusChange::getAfterStatus, afterStatusCode)
.last(BizConst.LIMIT_1));
if(Objects.isNull(statusChange)){
.eq(ProjectStatusChange::getAfterStatus, nextStatus)
.last(BizConst.LIMIT_1);
ProjectStatusChange statusChange = statusChangeService.getOne(pscQuery);
if (Objects.isNull(statusChange)) {
return vo;
}
vo.setStatusTime(statusChange.getCreateOn());
@@ -116,23 +115,26 @@ public class ProjectStatusHandler {

/**
* 绩效
* @param project
* @return
*
* @param project \
* @return \
*/
public ProtraitProjectStatusSituationVO generatePerformanceStatus(Project project) {
ProtraitProjectStatusSituationVO vo = new ProtraitProjectStatusSituationVO();
vo.setStatusName(DashboardConstant.Protrait.PERFORMANCE);
if(Objects.isNull(project)){
if (Objects.isNull(project)) {
return vo;
}
//查询 绩效完成 核查时间
String projectCode = project.getProjectCode();
PerformanceAppraisalProject performance = performanceAppraisalProjectService.getOne(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getProjectCode,projectCode)
LambdaQueryWrapper<PerformanceAppraisalProject> papQuery = Wrappers
.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getProjectCode, projectCode)
.isNotNull(PerformanceAppraisalProject::getVerifyTotalScore)
.isNotNull(PerformanceAppraisalProject::getVerifyScoreTime)
.last(BizConst.LIMIT_1));
if(Objects.nonNull(performance)){
.last(BizConst.LIMIT_1);
PerformanceAppraisalProject performance = performanceAppraisalProjectService.getOne(papQuery);
if (Objects.nonNull(performance)) {
vo.setStatusTime(performance.getVerifyScoreTime());
}
return vo;


+ 53
- 46
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ExpertStatisticsManage.java Прегледај датотеку

@@ -58,30 +58,31 @@ public class ExpertStatisticsManage {

private final IMetaDictionaryService metaDictionaryService;

private Integer[] years = new Integer[]{LocalDateTime.now().getYear()-2,
LocalDateTime.now().getYear()-1,LocalDateTime.now().getYear(),
LocalDateTime.now().getYear()+1,LocalDateTime.now().getYear()+2};
private Integer[] years = new Integer[]{LocalDateTime.now().getYear() - 2,
LocalDateTime.now().getYear() - 1, LocalDateTime.now().getYear(),
LocalDateTime.now().getYear() + 1, LocalDateTime.now().getYear() + 2};

private Integer[] threeYears = new Integer[]{LocalDateTime.now().getYear()-2,
LocalDateTime.now().getYear()-1,LocalDateTime.now().getYear()};
private Integer[] threeYears = new Integer[]{LocalDateTime.now().getYear() - 2,
LocalDateTime.now().getYear() - 1, LocalDateTime.now().getYear()};

private String[] SHENGWEIDU = new String[]{DashboardConstant.Expert.NETWORK_CODE,
DashboardConstant.Expert.DANGZHENG_CODE,DashboardConstant.Expert.FANGAN_CODE,
DashboardConstant.Expert.JISHU_CODE,DashboardConstant.Expert.XINCHUANG_CODE,
DashboardConstant.Expert.DANGZHENG_CODE, DashboardConstant.Expert.FANGAN_CODE,
DashboardConstant.Expert.JISHU_CODE, DashboardConstant.Expert.XINCHUANG_CODE,
DashboardConstant.Expert.RUANYING_CODE};

private String[] SHIWEIDU = new String[]{DashboardConstant.Expert.CAIWU_CODE,
DashboardConstant.Expert.XINXIHUA_CODE,DashboardConstant.Expert.XINCHUANG_OTTHER_CODE};
DashboardConstant.Expert.XINXIHUA_CODE, DashboardConstant.Expert.XINCHUANG_OTTHER_CODE};

private String[] TYPES = new String[]{DashboardConstant.Expert.EXPERT_TYPE_INNER,
DashboardConstant.Expert.EXPERT_TYPE_OUT};

private String[] LEVELS = new String[]{DashboardConstant.Expert.EXPERT_LEVEL_ZHENGGAO,
DashboardConstant.Expert.EXPERT_LEVEL_FUGAO,DashboardConstant.Expert.EXPERT_LEVEL_MID,
DashboardConstant.Expert.EXPERT_LEVEL_CHUJI,DashboardConstant.Expert.EXPERT_LEVEL_NULL};
DashboardConstant.Expert.EXPERT_LEVEL_FUGAO, DashboardConstant.Expert.EXPERT_LEVEL_MID,
DashboardConstant.Expert.EXPERT_LEVEL_CHUJI, DashboardConstant.Expert.EXPERT_LEVEL_NULL};

/**
* 专家统计
*
* @param year
* @return
*/
@@ -107,16 +108,16 @@ public class ExpertStatisticsManage {
CompletableFuture.allOf(
CompletableFuture.runAsync(() -> {
//选择的年份去计算的数据
yearCompleteExpert(res,year,experts,intentionWorkRegions,expertTags,
tags,expertDictionaries,dictionMap);
yearCompleteExpert(res, year, experts, intentionWorkRegions, expertTags,
tags, expertDictionaries, dictionMap);
}, ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> {
//近三年
threeYearsCompleteExpert(res,experts);
threeYearsCompleteExpert(res, experts);
}, ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> {
//近一年
lastYearsCompleteExpert(res,experts);
lastYearsCompleteExpert(res, experts);
}, ForkJoinPool.commonPool())
).join();

@@ -125,9 +126,10 @@ public class ExpertStatisticsManage {

/**
* 近一年
*
* @param res
*/
private void lastYearsCompleteExpert(ExpertStatisticsVO res,List<ExpertUserFullInfo> experts) {
private void lastYearsCompleteExpert(ExpertStatisticsVO res, List<ExpertUserFullInfo> experts) {
List<ExpertUserFullInfo> lastYear = experts.stream().filter(expert -> {
if (expert.getCreateOn().compareTo(LocalDateTime.now().plusYears(-1)) >= 0 &&
expert.getCreateOn().compareTo(LocalDateTime.now()) <= 0) {
@@ -140,12 +142,13 @@ public class ExpertStatisticsManage {

/**
* 近三年
*
* @param res
*/
private void threeYearsCompleteExpert(ExpertStatisticsVO res,List<ExpertUserFullInfo> experts) {
private void threeYearsCompleteExpert(ExpertStatisticsVO res, List<ExpertUserFullInfo> experts) {
List<DataDTO> threeYearsAdds = Lists.newArrayList();
for (Integer year : threeYears){
threeYearsAdds.add(DataDTO.of(year.toString(),year.toString(),
for (Integer year : threeYears) {
threeYearsAdds.add(DataDTO.of(year.toString(), year.toString(),
experts.stream().filter(e -> {
if (Objects.nonNull(e.getCreateOn()) && year.equals(e.getCreateOn().getYear())) {
return Boolean.TRUE;
@@ -158,12 +161,13 @@ public class ExpertStatisticsManage {

/**
* 选择年份或者全部
* @param res
* @param year
*
* @param res \
* @param year \
*/
private void yearCompleteExpert(ExpertStatisticsVO res, Integer year,
List<ExpertUserFullInfo> experts,List<ExpertIntentionWorkRegion> intentionWorkRegions,
List<ExpertTag> expertTags,List<TagDTO> tags,List<ExpertDictionary> expertDictionaries,
List<ExpertUserFullInfo> experts, List<ExpertIntentionWorkRegion> intentionWorkRegions,
List<ExpertTag> expertTags, List<TagDTO> tags, List<ExpertDictionary> expertDictionaries,
Map<String, String> dictionMap) {
res.setTotal(experts.size());

@@ -188,22 +192,23 @@ public class ExpertStatisticsManage {
computeRegionExperts(res, intentionWorkRegions, expertMap, regions);

//计算专家特长
computeRegionDistribution(res,experts,expertTags,tags);
computeRegionDistribution(res, experts, expertTags, tags);

//计算专家类型
computeTypes(res,experts,expertDictionaries,dictionMap);
computeTypes(res, experts, expertDictionaries, dictionMap);

//计算专家等级
computeLevels(res,experts,expertDictionaries,dictionMap);
computeLevels(res, experts, expertDictionaries, dictionMap);
}

/**
* 计算 专家等级
*
* @param res
* @param experts
*/
private void computeLevels(ExpertStatisticsVO res, List<ExpertUserFullInfo> experts,
List<ExpertDictionary> expertDictionaries,Map<String, String> dictionMap) {
List<ExpertDictionary> expertDictionaries, Map<String, String> dictionMap) {
List<DataDTO> levels = Lists.newArrayList();

Set<Long> userSets = Sets.newHashSet();
@@ -213,9 +218,9 @@ public class ExpertStatisticsManage {

Map<String, List<ExpertDictionary>> dictionaryMap = expertDictionaries.stream()
.collect(Collectors.groupingBy(ExpertDictionary::getDictionaryCode));
for(String levelCode : LEVELS){
for (String levelCode : LEVELS) {
int num = 0;
if(dictionaryMap.containsKey(levelCode)){
if (dictionaryMap.containsKey(levelCode)) {
List<ExpertDictionary> dictionaries = dictionaryMap.get(levelCode);
num = dictionaries.stream().filter(d -> {
if (expertUserFullInfoMap.containsKey(d.getUserId())) {
@@ -224,7 +229,7 @@ public class ExpertStatisticsManage {
return Boolean.FALSE;
}).collect(Collectors.toList()).size();
}
levels.add(DataDTO.of(dictionMap.get(levelCode),levelCode,num));
levels.add(DataDTO.of(dictionMap.get(levelCode), levelCode, num));
}

res.setLevels(levels);
@@ -232,11 +237,12 @@ public class ExpertStatisticsManage {

/**
* 计算 专家类型
*
* @param res
* @param experts
*/
private void computeTypes(ExpertStatisticsVO res, List<ExpertUserFullInfo> experts,
List<ExpertDictionary> expertDictionaries,Map<String, String> dictionMap) {
List<ExpertDictionary> expertDictionaries, Map<String, String> dictionMap) {
List<DataDTO> types = Lists.newArrayList();

Set<Long> userSets = Sets.newHashSet();
@@ -246,18 +252,18 @@ public class ExpertStatisticsManage {

Map<String, List<ExpertDictionary>> dictionaryMap = expertDictionaries.stream()
.collect(Collectors.groupingBy(ExpertDictionary::getDictionaryCode));
for(String typeCode : TYPES){
for (String typeCode : TYPES) {
int num = 0;
if(dictionaryMap.containsKey(typeCode)){
if (dictionaryMap.containsKey(typeCode)) {
List<ExpertDictionary> dictionaries = dictionaryMap.get(typeCode);
num = dictionaries.stream().filter(d -> {
if(expertUserFullInfoMap.containsKey(d.getUserId())){
if (expertUserFullInfoMap.containsKey(d.getUserId())) {
return Boolean.TRUE;
}
return Boolean.FALSE;
}).collect(Collectors.toList()).size();
}
types.add(DataDTO.of(dictionMap.get(typeCode),typeCode,num));
types.add(DataDTO.of(dictionMap.get(typeCode), typeCode, num));
}

res.setTypes(types);
@@ -271,7 +277,7 @@ public class ExpertStatisticsManage {
.filter(u -> userSets.add(u.getUserId()))
.collect(Collectors.toMap(ExpertUserFullInfo::getUserId, e -> e));

Map<String,List<DataDTO>> typeDistribution = Maps.newHashMap();
Map<String, List<DataDTO>> typeDistribution = Maps.newHashMap();

Map<String, List<ExpertTag>> tagsMap =
expertTags.stream().filter(e -> Objects.nonNull(e.getTagCode()))
@@ -283,25 +289,26 @@ public class ExpertStatisticsManage {

//1.省维度
List<DataDTO> shengWeidu = Lists.newArrayList();
for(String code : SHENGWEIDU){
for (String code : SHENGWEIDU) {
shengWeidu.add(getExpertData(expertUserFullInfoMap,
tagsMap, tagNameMap, code));
}

//2.市维度
List<DataDTO> shiWeidu = Lists.newArrayList();
for(String code : SHIWEIDU){
for (String code : SHIWEIDU) {
shiWeidu.add(getExpertData(expertUserFullInfoMap,
tagsMap, tagNameMap, code));
}

typeDistribution.put(DashboardConstant.Expert.DISTRIBUTION_SHENG,shengWeidu);
typeDistribution.put(DashboardConstant.Expert.DISTRIBUTION_SHI,shiWeidu);
typeDistribution.put(DashboardConstant.Expert.DISTRIBUTION_SHENG, shengWeidu);
typeDistribution.put(DashboardConstant.Expert.DISTRIBUTION_SHI, shiWeidu);
res.setTypeDistribution(typeDistribution);
}

/**
* 包装
*
* @param expertUserFullInfoMap
* @param tagsMap
* @param tagNameMap
@@ -310,27 +317,27 @@ public class ExpertStatisticsManage {
*/
private static DataDTO getExpertData(Map<Long, ExpertUserFullInfo> expertUserFullInfoMap, Map<String, List<ExpertTag>> tagsMap, Map<String, String> tagNameMap, String code) {
int num = 0;
if(tagsMap.containsKey(code)){
if (tagsMap.containsKey(code)) {
List<ExpertTag> ets = tagsMap.get(code);
num = ets.stream().filter(e -> {
if(expertUserFullInfoMap.containsKey(e.getUserId())){
if (expertUserFullInfoMap.containsKey(e.getUserId())) {
return Boolean.TRUE;
}
return Boolean.FALSE;
}).collect(Collectors.toList()).size();
}
return DataDTO.of(tagNameMap.get(code),code,num);
return DataDTO.of(tagNameMap.get(code), code, num);
}

//计算区域专家
private static void computeRegionExperts(ExpertStatisticsVO res, List<ExpertIntentionWorkRegion> intentionWorkRegions, Map<Long, ExpertUserFullInfo> expertMap, List<RegionDTO> regions) {
List<DataDTO> regionExpert = Lists.newArrayList();
for(RegionDTO region : regions){
regionExpert.add(DataDTO.of(region.getRegionName(),region.getRegionCode(),
for (RegionDTO region : regions) {
regionExpert.add(DataDTO.of(region.getRegionName(), region.getRegionCode(),
intentionWorkRegions.stream().filter(w -> {
if(Objects.nonNull(w) && Objects.nonNull(w.getRegionCode()) &&
if (Objects.nonNull(w) && Objects.nonNull(w.getRegionCode()) &&
w.getRegionCode().equals(region.getRegionCode()) &&
expertMap.containsKey(w.getUserId())){
expertMap.containsKey(w.getUserId())) {
return Boolean.TRUE;
}
return Boolean.FALSE;


+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ProjectCostStatisticsManage.java Прегледај датотеку

@@ -64,7 +64,6 @@ public class ProjectCostStatisticsManage {
DataDTO pricingAvg = new DataDTO();
pricingAvg.setName("核价费");
BigDecimal reviewTwoYearTotal = BigDecimal.ZERO;
BigDecimal pricingTwoYearTotal = BigDecimal.ZERO;
for(Integer thisYear : thisTwoYears){
//查出 年份的 会议数据
List<Meeting> yearMeetings = meetings.stream().filter(m -> {


+ 0
- 3
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/model/vo/ProtraitProjectInfoVO.java Прегледај датотеку

@@ -1,8 +1,5 @@
package com.hz.pm.api.dashboard.model.vo;

import com.hz.pm.api.common.compare.Compare;
import com.hz.pm.api.dashboard.model.basic.AnalysisChart;
import com.hz.pm.api.dashboard.model.basic.StarExpertBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;


hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/DictionaryAssembler.java → hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/DictAssembler.java Прегледај датотеку

@@ -12,8 +12,10 @@ import java.util.stream.Collectors;
* @author liuxinxin
* @date 2022/7/25 下午4:30
*/
public class DictAssembler {

public class DictionaryAssembler {
private DictAssembler() {
}

public static List<DictionaryFieldInfo> toDictFieldInfoList(List<ExpertDictionary> expertDictList) {
if (CollUtil.isEmpty(expertDictList)) {

+ 6
- 6
hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertUserInfoAssembler.java Прегледај датотеку

@@ -423,11 +423,11 @@ public class ExpertUserInfoAssembler {
List<ExpertDictionary> userExpertDictList = expertDictMap.getOrDefault(userId, Collections.emptyList());
Map<String, List<ExpertDictionary>> fieldExpertDictMap = userExpertDictList.stream().collect(Collectors.groupingBy(ExpertDictionary::getExpertInfoField));
adminManageExpertListItem.setExpertType(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())));
adminManageExpertListItem.setCompanyAttribute(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey())));
adminManageExpertListItem.setTitleLevel(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey())));
// 装配标签数据
List<ExpertTag> expertTagList = Objects.isNull(expertTagMap.get(userId)) ? new ArrayList<>() : expertTagMap.get(userId);
Map<String, List<ExpertTag>> fieldExpertTagMap = expertTagList.stream().collect(Collectors.groupingBy(ExpertTag::getExpertInfoField));
@@ -446,13 +446,13 @@ public class ExpertUserInfoAssembler {
adminManageExpertListItem.setHometown(expertUserFullInfo.getHometown());
adminManageExpertListItem.setNationality(expertUserFullInfo.getNationality());
adminManageExpertListItem.setPolitical(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.POLITICAL.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.POLITICAL.getKey())));
adminManageExpertListItem.setIdCard(expertUserFullInfo.getIdCard());
adminManageExpertListItem.setBankNo(expertUserFullInfo.getBankNo());
adminManageExpertListItem.setEdu(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.EDU.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.EDU.getKey())));
adminManageExpertListItem.setRecommendedWay(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey())));

adminManageExpertListItem.setCreateTime(expertUserFullInfo.getCreateOn());
return adminManageExpertListItem;


+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/RegionWrapperAssembler.java Прегледај датотеку

@@ -2,7 +2,6 @@ package com.hz.pm.api.expert.assembler;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.hz.pm.api.expert.entity.ExpertMetaApply;
import com.hz.pm.api.expert.entity.ExpertUserFullInfo;
import com.hz.pm.api.meta.model.bo.RegionContainsBO;



+ 3
- 1
hz-pm-api/src/main/java/com/hz/pm/api/expert/constant/ExpertUserInfoSensitiveFieldEnum.java Прегледај датотеку

@@ -15,8 +15,9 @@ import java.util.List;
* @date 2022/7/27 下午3:34
* 专家修改信息需要审核的字段
*/
@AllArgsConstructor
@Getter
@AllArgsConstructor
@SuppressWarnings("all")
public enum ExpertUserInfoSensitiveFieldEnum {

// 手机号码
@@ -65,4 +66,5 @@ public enum ExpertUserInfoSensitiveFieldEnum {
*/
list;
}

}

+ 1
- 2
hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ReviewTemplateSettingsController.java Прегледај датотеку

@@ -1,13 +1,12 @@
package com.hz.pm.api.expert.controller;


import com.ningdatech.log.annotation.WebLog;
import com.hz.pm.api.expert.manage.ReviewTemplateSettingsManage;
import com.hz.pm.api.expert.model.req.ReviewTemplateReq;
import com.hz.pm.api.expert.model.vo.ReviewTemplateVO;
import com.ningdatech.log.annotation.WebLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;


+ 10
- 11
hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertMetaApplyManage.java Прегледај датотеку

@@ -6,9 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.hz.pm.api.common.enumeration.BoolDisplayEnum;
import com.hz.pm.api.common.helper.RegionCacheHelper;
import com.hz.pm.api.common.helper.RegionLimitHelper;
@@ -43,6 +40,9 @@ import com.hz.pm.api.meta.model.entity.ExpertDictionary;
import com.hz.pm.api.meta.service.IExpertDictionaryService;
import com.hz.pm.api.sys.model.dto.RegionDTO;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
@@ -464,27 +464,26 @@ public class ExpertMetaApplyManage {
}
}
// 审核结果
List<String> applyStatusList = new ArrayList<>();
List<String> applyStatusList;
if (CollUtil.isNotEmpty(applyListReq.getApplyStatusList())) {
applyStatusList = CollUtils.fieldList(applyListReq.getApplyStatusList(), ExpertApplyStatusEnum::getKey);
;
} else {
applyStatusList = null;
}

LocalDateTime applyStartTime = applyListReq.getApplyStartTime();
LocalDateTime applyEndTime = applyListReq.getApplyEndTime();

// 不展示撤回的申请记录
LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyListQuery = Wrappers.lambdaQuery(ExpertMetaApply.class)
.in(CollectionUtils.isNotEmpty(applyTypeList), ExpertMetaApply::getApplyType, applyTypeList)
.in(CollectionUtils.isNotEmpty(applyStatusList), ExpertMetaApply::getApplyStatus, applyStatusList)
return Wrappers.lambdaQuery(ExpertMetaApply.class)
.in(CollUtil.isNotEmpty(applyTypeList), ExpertMetaApply::getApplyType, applyTypeList)
.in(CollUtil.isNotEmpty(applyStatusList), ExpertMetaApply::getApplyStatus, applyStatusList)
.in(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.Y.name())
.in(CollectionUtils.isNotEmpty(expertIdList), ExpertMetaApply::getUserId, expertIdList)
.in(CollUtil.isNotEmpty(expertIdList), ExpertMetaApply::getUserId, expertIdList)
.gt(Objects.nonNull(applyStartTime), ExpertMetaApply::getCreateOn, applyStartTime)
.lt(Objects.nonNull(applyEndTime), ExpertMetaApply::getCreateOn, applyEndTime)
.ne(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.REVOKED.getKey())
.orderByDesc(ExpertMetaApply::getCreateOn);

return expertMetaApplyListQuery;
}

private ExpertStorageDealCmd buildExpertStorageDealCmd(MetaApplyResultRequest applyResultRequest,


+ 7
- 7
hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertReviewManage.java Прегледај датотеку

@@ -4,11 +4,6 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.cache.lock.DistributedLock;
import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.file.service.FileService;
import com.hz.pm.api.expert.constant.ReviewResultEnum;
import com.hz.pm.api.expert.model.dto.ReviewTemplateOptionDTO;
import com.hz.pm.api.expert.model.dto.ReviewTemplateSettingsDTO;
@@ -25,6 +20,11 @@ import com.hz.pm.api.meeting.service.IMeetingExpertService;
import com.hz.pm.api.meeting.service.IMeetingInnerProjectService;
import com.hz.pm.api.meeting.service.IMeetingService;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.cache.lock.DistributedLock;
import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.file.service.FileService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@@ -144,7 +144,7 @@ public class ExpertReviewManage {
}
List<Long> attachFileIds = CollUtils.fieldList(reviews, ExpertReview::getAttachFileId);
Map<Long, AttachFileVo> fileMap = new HashMap<>(attachFileIds.size());
if (attachFileIds.size() > 0) {
if (!attachFileIds.isEmpty()) {
List<AttachFileVo> files = fileService.getByIds(attachFileIds);
files.forEach(w -> fileMap.put(w.getFileId(), w));
}
@@ -192,7 +192,7 @@ public class ExpertReviewManage {
return tmpReviewDetail;
});
ExpertReviewDetailVO tmpReview = buildExpertReviewDetail(review);
if (review.getIsFinal()) {
if (Boolean.TRUE.equals(review.getIsFinal())) {
reviewDetailByType.setFinalReview(tmpReview);
} else {
reviewDetailByType.getTeamMemberReviews().add(tmpReview);


+ 0
- 3
hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ReviewTemplateVO.java Прегледај датотеку

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

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

/**


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertAdminManageServiceImpl.java Прегледај датотеку

@@ -86,7 +86,7 @@ public class ExpertAdminManageServiceImpl implements ExpertAdminManageService {

List<ExpertAdminExpertManageListDTO> recordList = new ArrayList<>();

if (userIdList.size() != 0) {
if (!userIdList.isEmpty()) {
List<Long> currPageUserIdList = CollUtil.page(req.getPageNumber() - 1, req.getPageSize(), userIdList);
List<ExpertUserFullInfo> expertUserList = iExpertUserFullInfoService.listByUserIds(currPageUserIdList);



+ 12
- 12
hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertReviewServiceImpl.java Прегледај датотеку

@@ -4,14 +4,13 @@ import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.basic.util.CollUtils;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.expert.mapper.ExpertReviewMapper;
import com.hz.pm.api.expert.model.entity.ExpertReview;
import com.hz.pm.api.expert.model.enumeration.ReviewTemplateTypeEnum;
import com.hz.pm.api.expert.service.IExpertReviewService;
import com.hz.pm.api.meeting.entity.domain.Meeting;
import com.hz.pm.api.meeting.mapper.MeetingMapper;
import com.ningdatech.basic.util.CollUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@@ -68,20 +67,21 @@ public class ExpertReviewServiceImpl extends ServiceImpl<ExpertReviewMapper, Exp

@Override
public ExpertReview getFinalReview(String projectCode, Integer meetingType) {
List<Meeting> constructMeetings = meetingMapper.selectList(Wrappers.lambdaQuery(Meeting.class)
LambdaQueryWrapper<Meeting> mQuery = Wrappers.lambdaQuery(Meeting.class)
.select(Meeting::getId)
.eq(Meeting::getType, meetingType));
.eq(Meeting::getType, meetingType);
List<Meeting> constructMeetings = meetingMapper.selectList(mQuery);
List<Long> meetingIds = constructMeetings.stream()
.map(Meeting::getId).collect(Collectors.toList());
ExpertReview expertReview = null;
if(CollUtil.isNotEmpty(meetingIds)){
expertReview = this.getOne(Wrappers.lambdaQuery(ExpertReview.class)
.eq(ExpertReview::getProjectCode, projectCode)
.eq(ExpertReview::getIsFinal, Boolean.TRUE)
.in(ExpertReview::getMeetingId,meetingIds)
.last(BizConst.LIMIT_1));
if (CollUtil.isEmpty(meetingIds)) {
return null;
}
return expertReview;
LambdaQueryWrapper<ExpertReview> erQuery = Wrappers.lambdaQuery(ExpertReview.class)
.eq(ExpertReview::getProjectCode, projectCode)
.eq(ExpertReview::getIsFinal, Boolean.TRUE)
.in(ExpertReview::getMeetingId, meetingIds)
.last(BizConst.LIMIT_1);
return this.getOne(erQuery);
}

}

+ 1
- 4
hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertUserFullInfoServiceImpl.java Прегледај датотеку

@@ -1,13 +1,10 @@
package com.hz.pm.api.expert.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hz.pm.api.expert.entity.ExpertUserFullInfo;
import com.hz.pm.api.expert.mapper.NdExpertUserFullInfoMapper;
import com.hz.pm.api.expert.service.IExpertUserFullInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;


+ 22
- 18
hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/DocumentationManage.java Прегледај датотеку

@@ -4,11 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.file.entity.File;
import com.ningdatech.file.service.FileService;
import com.hz.pm.api.filemanage.model.dto.DocumentationGroupSaveDTO;
import com.hz.pm.api.filemanage.model.dto.DocumentationSaveDTO;
import com.hz.pm.api.filemanage.model.entity.Documentation;
@@ -20,6 +15,11 @@ import com.hz.pm.api.filemanage.service.IDocumentationGroupService;
import com.hz.pm.api.filemanage.service.IDocumentationService;
import com.hz.pm.api.user.security.auth.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.file.entity.File;
import com.ningdatech.file.service.FileService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@@ -48,17 +48,17 @@ public class DocumentationManage {
private final FileService fileService;

/**
*
* @return
*/
public List<DocumentationGroupVO> groupList() {
List<DocumentationGroup> list = documentationGroupService.list();

return list.stream().map(g -> BeanUtil.copyProperties(g,DocumentationGroupVO.class)).collect(Collectors.toList());
return list.stream().map(g -> BeanUtil.copyProperties(g, DocumentationGroupVO.class)).collect(Collectors.toList());
}

/**
* 文档列表
*
* @param param
* @return
*/
@@ -67,33 +67,34 @@ public class DocumentationManage {
documentationService.page(page, Wrappers.lambdaQuery(Documentation.class)
.eq(Objects.nonNull(param.getGroupId()), Documentation::getGroupId, param.getGroupId()));

if(CollUtil.isEmpty(page.getRecords())){
if (CollUtil.isEmpty(page.getRecords())) {
return PageVo.empty();
}

List<DocumentationVO> vos = page.getRecords().stream()
.map(d -> BeanUtil.copyProperties(d,DocumentationVO.class))
.map(d -> BeanUtil.copyProperties(d, DocumentationVO.class))
.collect(Collectors.toList());

return PageVo.of(vos,page.getTotal());
return PageVo.of(vos, page.getTotal());
}

/**
* 增加分组
*
* @param dto
* @return
*/
public String addGroup(DocumentationGroupSaveDTO dto) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
if(documentationGroupService.count(Wrappers.lambdaQuery(DocumentationGroup.class)
.eq(DocumentationGroup::getName,dto.getName())) > 0){
if (documentationGroupService.count(Wrappers.lambdaQuery(DocumentationGroup.class)
.eq(DocumentationGroup::getName, dto.getName())) > 0) {
throw new BizException("此分组名 已经存在");
}

DocumentationGroup documentationGroup = BeanUtil.copyProperties(dto, DocumentationGroup.class);
documentationGroup.setCreateBy(user.getRealName());
documentationGroup.setCreateOn(LocalDateTime.now());
if(documentationGroupService.save(documentationGroup)){
if (documentationGroupService.save(documentationGroup)) {
return "添加成功";
}
return "添加失败";
@@ -101,6 +102,7 @@ public class DocumentationManage {

/**
* 删除分组 同时删除文档
*
* @param id
* @return
*/
@@ -119,6 +121,7 @@ public class DocumentationManage {

/**
* 上传文档
*
* @param dto
* @return
*/
@@ -137,11 +140,11 @@ public class DocumentationManage {
Documentation documentation = new Documentation();
documentation.setCreateBy(user.getRealName());
documentation.setCreateOn(LocalDateTime.now());
documentation.setSize(Objects.nonNull(file.getSize()) ? file.getSize()/1000L : 0L);
documentation.setSize(Objects.nonNull(file.getSize()) ? file.getSize() / 1000L : 0L);
documentation.setFileId(fileId);
documentation.setGroupId(dto.getGroupId());
documentation.setFileName(file.getOriginalFileName());
if(documentationService.save(documentation)){
if (documentationService.save(documentation)) {
documentation.setSort(documentation.getId().intValue());
documentationService.updateById(documentation);
}
@@ -151,6 +154,7 @@ public class DocumentationManage {

/**
* 删除文档
*
* @param id
* @return
*/
@@ -158,7 +162,7 @@ public class DocumentationManage {
Documentation doc = documentationService.getById(id);
VUtils.isTrue(Objects.isNull(doc)).throwMessage("该文档不存在!");

if(documentationService.removeById(id)){
if (documentationService.removeById(id)) {
return "删除成功";
}
return "删除失败";
@@ -166,9 +170,9 @@ public class DocumentationManage {

public DocumentationVO detail(Long id) {
Documentation doc = documentationService.getById(id);
if(Objects.isNull(doc)){
if (Objects.isNull(doc)) {
return null;
}
return BeanUtil.copyProperties(doc,DocumentationVO.class);
return BeanUtil.copyProperties(doc, DocumentationVO.class);
}
}

+ 37
- 32
hz-pm-api/src/main/java/com/hz/pm/api/gov/convert/ProjectConvert.java Прегледај датотеку

@@ -8,6 +8,7 @@ import com.hz.pm.api.gov.model.req.*;
import com.hz.pm.api.gov.model.vo.*;
import com.hz.pm.api.gov.utils.ProjectCollectionUtil;
import org.apache.commons.lang3.StringUtils;

import java.util.Collections;
import java.util.List;
import java.util.Objects;
@@ -21,14 +22,18 @@ import java.util.stream.Collectors;
*/
public class ProjectConvert {

private ProjectConvert() {
}

/**
* 6个 转换方法
*
* @param saveDTO
* @return
*/
public static ProjectPushReq convert(GovBizProjectSaveDTO saveDTO) {
ProjectPushReq req = new ProjectPushReq();
req.setBaseinfo(convertBase(saveDTO.getBaseinfo(),BizProjectContant.EFFECTIVE_CODE));
req.setBaseinfo(convertBase(saveDTO.getBaseinfo(), BizProjectContant.EFFECTIVE_CODE));
req.setApply(convertApply(saveDTO.getApply()));
req.setApprove(convertApprove(saveDTO.getApprove()));
req.setCimplement(convertCimplement(saveDTO.getCimplement()));
@@ -39,7 +44,7 @@ public class ProjectConvert {

public static ProjectPushReq convert(GovBizProjectDetailVO vo) {
ProjectPushReq req = new ProjectPushReq();
req.setBaseinfo(convertBaseVo(vo.getBaseinfo(),BizProjectContant.EFFECTIVE_CODE));
req.setBaseinfo(convertBaseVo(vo.getBaseinfo(), BizProjectContant.EFFECTIVE_CODE));
req.setApply(convertApplyVo(vo.getApply()));
req.setApprove(convertApproveVo(vo.getApprove()));
req.setCimplement(convertCimplementVo(vo.getCimplement()));
@@ -50,7 +55,7 @@ public class ProjectConvert {

public static ProjectPushReq convertWithConvertPdf(GovBizProjectDetailVO vo) {
ProjectPushReq req = new ProjectPushReq();
req.setBaseinfo(convertBaseVo(vo.getBaseinfo(),BizProjectContant.EFFECTIVE_CODE));
req.setBaseinfo(convertBaseVo(vo.getBaseinfo(), BizProjectContant.EFFECTIVE_CODE));
req.setApply(convertApplyVoWithConvertPdf(vo.getApply()));
req.setApprove(convertApproveVoWithConvertPdf(vo.getApprove()));
req.setCimplement(convertCimplementVoWithConvertPdf(vo.getCimplement()));
@@ -61,7 +66,7 @@ public class ProjectConvert {

public static ProjectPushReq convertWithConvertPdf(GovOperationProjectDetailVO vo) {
ProjectPushReq req = new ProjectPushReq();
req.setBaseinfo(convertBaseVo(vo.getBaseinfo(),BizProjectContant.EFFECTIVE_CODE));
req.setBaseinfo(convertBaseVo(vo.getBaseinfo(), BizProjectContant.EFFECTIVE_CODE));
req.setApply(convertApplyVoWithConvertPdf(vo.getApply()));
req.setApprove(convertApproveVoWithConvertPdf(vo.getApprove()));
req.setCimplement(convertCimplementVoWithConvertPdf(vo.getCimplement()));
@@ -71,14 +76,14 @@ public class ProjectConvert {
}

private static List<ProjectProcureReq> convertProcures(List<GovBizProjectProcureDTO> procures) {
if(CollUtil.isEmpty(procures)){
if (CollUtil.isEmpty(procures)) {
return Collections.emptyList();
}

List<ProjectProcureReq> req = procures.stream()
.map(p -> {
ProjectProcureReq r = BeanUtil.copyProperties(p, ProjectProcureReq.class);
if(Objects.nonNull(p.getId())){
if (Objects.nonNull(p.getId())) {
r.setTongID(p.getId().intValue());
}
r.setBaseWinningBidTime(ProjectCollectionUtil.convertLocalDateTime(p.getBaseWinningBidTime()));
@@ -90,14 +95,14 @@ public class ProjectConvert {
}

private static List<ProjectProcureReq> convertProcuresVo(List<GovBizProjectProcureVO> procures) {
if(CollUtil.isEmpty(procures)){
if (CollUtil.isEmpty(procures)) {
return Collections.emptyList();
}

List<ProjectProcureReq> req = procures.stream()
.map(p -> {
ProjectProcureReq r = BeanUtil.copyProperties(p, ProjectProcureReq.class);
if(Objects.nonNull(p.getId())){
if (Objects.nonNull(p.getId())) {
r.setTongID(p.getId().intValue());
}
r.setBaseWinningBidTime(ProjectCollectionUtil.convertLocalDateTime(p.getBaseWinningBidTime()));
@@ -109,7 +114,7 @@ public class ProjectConvert {
}

private static List<ProjectProcureReq> convertProcuresVoWithConvertPdf(List<GovBizProjectProcureVO> procures) {
if(CollUtil.isEmpty(procures)){
if (CollUtil.isEmpty(procures)) {
return Collections.emptyList();
}

@@ -131,18 +136,18 @@ public class ProjectConvert {
}

private static ProjectMimplementReq convertMimplement(GovBizProjectMimplementDTO mimplement) {
ProjectMimplementReq req = BeanUtil.copyProperties(mimplement,ProjectMimplementReq.class);
ProjectMimplementReq req = BeanUtil.copyProperties(mimplement, ProjectMimplementReq.class);
return req;
}

private static ProjectMimplementReq convertMimplementVo(GovBizProjectMimplementVO mimplement) {
ProjectMimplementReq req = BeanUtil.copyProperties(mimplement,ProjectMimplementReq.class);
ProjectMimplementReq req = BeanUtil.copyProperties(mimplement, ProjectMimplementReq.class);
return req;
}

private static ProjectMimplementReq convertMimplementVoWithConvertPdf(GovBizProjectMimplementVO mimplement) {
ProjectMimplementReq req = BeanUtil.copyProperties(mimplement,ProjectMimplementReq.class);
if(Objects.isNull(req)){
ProjectMimplementReq req = BeanUtil.copyProperties(mimplement, ProjectMimplementReq.class);
if (Objects.isNull(req)) {
return req;
}
req.setBaseUserConsFile(StringUtils.isNotBlank(mimplement.getBaseUserConsFilePdf()) ? mimplement.getBaseUserConsFilePdf() :
@@ -169,18 +174,18 @@ public class ProjectConvert {
}

public static ProjectCimplementReq convertCimplement(GovBizProjectCimplementDTO cimplement) {
ProjectCimplementReq req = BeanUtil.copyProperties(cimplement,ProjectCimplementReq.class);
ProjectCimplementReq req = BeanUtil.copyProperties(cimplement, ProjectCimplementReq.class);
return req;
}

public static ProjectCimplementReq convertCimplementVo(GovBizProjectCimplementVO cimplement) {
ProjectCimplementReq req = BeanUtil.copyProperties(cimplement,ProjectCimplementReq.class);
ProjectCimplementReq req = BeanUtil.copyProperties(cimplement, ProjectCimplementReq.class);
return req;
}

public static ProjectCimplementReq convertCimplementVoWithConvertPdf(GovBizProjectCimplementVO cimplement) {
ProjectCimplementReq req = BeanUtil.copyProperties(cimplement,ProjectCimplementReq.class);
if(Objects.isNull(req)){
ProjectCimplementReq req = BeanUtil.copyProperties(cimplement, ProjectCimplementReq.class);
if (Objects.isNull(req)) {
return req;
}
req.setBaseChangeFormFile(StringUtils.isNotBlank(cimplement.getBaseChangeFormFilePdf()) ? cimplement.getBaseChangeFormFilePdf() :
@@ -216,7 +221,7 @@ public class ProjectConvert {

public static ProjectApproveReq convertApprove(GovBizProjectApproveDTO approve) {
ProjectApproveReq req = new ProjectApproveReq();
if(Objects.isNull(approve)){
if (Objects.isNull(approve)) {
return req;
}
req.setBaseProjId(approve.getBaseProjId());
@@ -241,7 +246,7 @@ public class ProjectConvert {

public static ProjectApproveReq convertApproveVo(GovBizProjectApproveVO approve) {
ProjectApproveReq req = new ProjectApproveReq();
if(Objects.isNull(approve)){
if (Objects.isNull(approve)) {
return req;
}
req.setBaseProjId(approve.getBaseProjId());
@@ -266,7 +271,7 @@ public class ProjectConvert {

public static ProjectApproveReq convertApproveVoWithConvertPdf(GovBizProjectApproveVO approve) {
ProjectApproveReq req = new ProjectApproveReq();
if(Objects.isNull(approve)){
if (Objects.isNull(approve)) {
return req;
}
req.setBaseProjId(approve.getBaseProjId());
@@ -274,7 +279,7 @@ public class ProjectConvert {
req.setOp(approve.getOp());
req.setApprovalFile(StringUtils.isNotBlank(approve.getApprovalFilePdf()) ? approve.getApprovalFilePdf() :
null);
req.setBaseReviewCommentsFile(StringUtils.isNotBlank(approve.getBaseReviewCommentsFilePdf()) ? approve.getBaseReviewCommentsFilePdf():
req.setBaseReviewCommentsFile(StringUtils.isNotBlank(approve.getBaseReviewCommentsFilePdf()) ? approve.getBaseReviewCommentsFilePdf() :
null);
req.setPreliminaryDesignFile(StringUtils.isNotBlank(approve.getPreliminaryDesignFilePdf()) ? approve.getPreliminaryDesignFilePdf() :
null);
@@ -295,7 +300,7 @@ public class ProjectConvert {

public static ProjectApplyReq convertApply(GovBizProjectApplyDTO apply) {
ProjectApplyReq req = new ProjectApplyReq();
if(Objects.isNull(apply)){
if (Objects.isNull(apply)) {
return req;
}
req.setOp(apply.getOp());
@@ -336,7 +341,7 @@ public class ProjectConvert {

public static ProjectApplyReq convertApplyVo(GovBizProjectApplyVO apply) {
ProjectApplyReq req = new ProjectApplyReq();
if(Objects.isNull(apply)){
if (Objects.isNull(apply)) {
return req;
}
req.setOp(apply.getOp());
@@ -377,7 +382,7 @@ public class ProjectConvert {

public static ProjectApplyReq convertApplyVoWithConvertPdf(GovBizProjectApplyVO apply) {
ProjectApplyReq req = new ProjectApplyReq();
if(Objects.isNull(apply)){
if (Objects.isNull(apply)) {
return req;
}
req.setOp(apply.getOp());
@@ -391,10 +396,10 @@ public class ProjectConvert {
req.setBaseBrainName(apply.getBaseBrainName());
req.setBaseDevelopCode(apply.getBaseDevelopCode());
req.setBaseLowestLevel(apply.getBaseLowestLevel());
if(Objects.nonNull(apply.getMissing()) && apply.getMissing()){
if (Objects.nonNull(apply.getMissing()) && apply.getMissing()) {
req.setBaseHistorProjId(BizProjectContant.ProjectCollection.MISSING_HIS_PROJ_ID);
req.setBaseHistorProjName(BizProjectContant.ProjectCollection.MISSING_HIS_PROJ_NAME);
}else{
} else {
req.setBaseHistorProjId(apply.getBaseHistorProjId());
req.setBaseHistorProjName(apply.getBaseHistorProjName());
}
@@ -427,20 +432,20 @@ public class ProjectConvert {
return req;
}

public static ProjectBaseInfoReq convertBase(GovBizProjectBaseinfoDTO baseinfo,String isEffective) {
ProjectBaseInfoReq req = BeanUtil.copyProperties(baseinfo,ProjectBaseInfoReq.class);
public static ProjectBaseInfoReq convertBase(GovBizProjectBaseinfoDTO baseinfo, String isEffective) {
ProjectBaseInfoReq req = BeanUtil.copyProperties(baseinfo, ProjectBaseInfoReq.class);
req.setIsEffective(isEffective);
return req;
}

public static ProjectBaseInfoReq convertBaseVo(GovBizProjectBaseinfoVO baseinfo,String isEffective) {
ProjectBaseInfoReq req = BeanUtil.copyProperties(baseinfo,ProjectBaseInfoReq.class);
public static ProjectBaseInfoReq convertBaseVo(GovBizProjectBaseinfoVO baseinfo, String isEffective) {
ProjectBaseInfoReq req = BeanUtil.copyProperties(baseinfo, ProjectBaseInfoReq.class);
req.setIsEffective(isEffective);
return req;
}

public static ProjectBaseInfoReq convertBaseVo(GovOperationProjectBaseinfoVO baseinfo,String isEffective) {
ProjectBaseInfoReq req = BeanUtil.copyProperties(baseinfo,ProjectBaseInfoReq.class);
public static ProjectBaseInfoReq convertBaseVo(GovOperationProjectBaseinfoVO baseinfo, String isEffective) {
ProjectBaseInfoReq req = BeanUtil.copyProperties(baseinfo, ProjectBaseInfoReq.class);
req.setIsEffective(isEffective);
return req;
}


+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/gov/utils/ProjectCollectionUtil.java Прегледај датотеку

@@ -15,6 +15,9 @@ import java.util.Objects;
*/
public class ProjectCollectionUtil {

private ProjectCollectionUtil() {
}

public static String convertLocalDateTime(LocalDateTime localDateTime){
if(Objects.isNull(localDateTime)){
return StringUtils.EMPTY;


+ 5
- 5
hz-pm-api/src/main/java/com/hz/pm/api/irs/manage/AppIrsManage.java Прегледај датотеку

@@ -6,14 +6,11 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.irs.service.IRefreshTokenService;
import com.hz.pm.api.common.constant.RegionConst;
import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.common.statemachine.util.StateMachineUtils;
import com.hz.pm.api.common.util.CryptUtils;
import com.hz.pm.api.common.util.HttpUtil;
import com.hz.pm.api.common.util.RefreshKeyUtil;
import com.hz.pm.api.irs.model.dto.ApiApplyDTO;
import com.hz.pm.api.irs.model.dto.ApiApplySearchResult;
import com.hz.pm.api.irs.model.dto.PushProjectAppToIrsDTO;
@@ -23,6 +20,8 @@ import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.irs.service.IRefreshTokenService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -235,7 +234,7 @@ public class AppIrsManage {
"&appKey=" + searchAppKey + "&pageSize=1000&" +
"pageNum=1&areaCode=" + areaCode +
"&deptCode=&name=";
log.info("查询应用目录:{}",url);
log.info("查询应用目录:{}", url);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);

@@ -262,11 +261,12 @@ public class AppIrsManage {

/**
* 如果是市本级的 结尾改成01 还要转换开发区的code
*
* @param areaCode
* @return
*/
private String convertAreaCode(String areaCode) {
if(RegionConst.RC_LS.equals(areaCode) || RegionConst.LS_KF.equals(areaCode)){
if (RegionConst.RC_LS.equals(areaCode) || RegionConst.LS_KF.equals(areaCode)) {
return RegionConst.RC_LS_SBJ_IRS;
}
return areaCode;


+ 0
- 2
hz-pm-api/src/main/java/com/hz/pm/api/irs/model/dto/ApiDTO.java Прегледај датотеку

@@ -3,10 +3,8 @@ package com.hz.pm.api.irs.model.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.poi.ss.formula.functions.T;

import java.io.Serializable;
import java.util.List;

/**
* @Classname ApiDTO


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/irs/model/res/ApiResponse.java Прегледај датотеку

@@ -68,7 +68,7 @@ public class ApiResponse<T> implements Serializable {
* @return ApiResponse
*/
public static <T> ApiResponse<T> of(Integer code, String message, T data,Boolean success) {
return new ApiResponse<T>(code, message, data,success);
return new ApiResponse<>(code, message, data,success);
}

/**


+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/irs/utils/RefreshTokenUtil.java Прегледај датотеку

@@ -21,6 +21,9 @@ import java.util.Objects;
@Slf4j
public class RefreshTokenUtil {

private RefreshTokenUtil() {
}

public static String refrshByAppScret() throws NoSuchAlgorithmException {
long timestamp = System.currentTimeMillis();
String appSecret = "e066f496194540afa829c66983d4710e";


+ 14
- 12
hz-pm-api/src/main/java/com/hz/pm/api/leave/manage/LeaveManage.java Прегледај датотеку

@@ -8,13 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.IdVo;
import com.ningdatech.basic.model.PagePo;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.file.service.FileService;
import com.hz.pm.api.common.model.FileBasicInfo;
import com.hz.pm.api.common.model.entity.KeyValDTO;
import com.hz.pm.api.common.util.BizUtils;
@@ -47,6 +40,13 @@ import com.hz.pm.api.meeting.service.IMeetingService;
import com.hz.pm.api.meeting.task.ExpertRandomInviteTask;
import com.hz.pm.api.sms.utils.DateUtil;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.IdVo;
import com.ningdatech.basic.model.PagePo;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.file.service.FileService;
import lombok.AllArgsConstructor;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Component;
@@ -112,7 +112,8 @@ public class LeaveManage {
return w.get(0);
})));
List<Long> meetingIds = CollUtils.fieldList(expertMap.values(), MeetingExpert::getMeetingId);
LocalDateTime startTime = leaveTimes.get(0).getKey(), endTime = leaveTimes.get(leaveTimes.size() - 1).getValue();
LocalDateTime startTime = leaveTimes.get(0).getKey();
LocalDateTime endTime = leaveTimes.get(leaveTimes.size() - 1).getValue();
LambdaQueryWrapper<Meeting> meetingQuery = Wrappers.lambdaQuery(Meeting.class)
.in(Meeting::getId, meetingIds)
.ne(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode())
@@ -131,7 +132,8 @@ public class LeaveManage {

@Transactional(rollbackFor = Exception.class)
public IdVo<Long> askForLeave(LeaveCreateReq po) {
Long leaveUserId, applyUserId = Objects.requireNonNull(LoginUserUtil.getUserId());
Long leaveUserId;
Long applyUserId = Objects.requireNonNull(LoginUserUtil.getUserId());
leaveUserId = po.getExpertId() != null ? po.getExpertId() : applyUserId;
boolean leaveForSelf = leaveUserId.equals(applyUserId);
if (!leaveForSelf) {
@@ -325,7 +327,9 @@ public class LeaveManage {
if (page.getTotal() == 0) {
return PageVo.empty();
}
List<Long> meetingIds = new ArrayList<>(), auditIds = new ArrayList<>(), fileIds = new ArrayList<>();
List<Long> meetingIds = new ArrayList<>();
List<Long> auditIds = new ArrayList<>();
List<Long> fileIds = new ArrayList<>();
page.getRecords().forEach(w -> {
if (w.getMeetingId() != 0) {
meetingIds.add(w.getMeetingId());
@@ -485,11 +489,9 @@ public class LeaveManage {
.set(ExpertLeave::getUpdateOn, LocalDateTime.now())
.eq(ExpertLeave::getAuditId, applyId);
ExpertLeave leave = leaveService.getByAuditId(applyId);
ExpertUserFullInfo leaveUser = userFullInfoService.getByUserId(leave.getLeaveUserId());
if (status) {
update.set(ExpertLeave::getStatus, LeaveStatusEnum.PASSED.getCode());
} else {
ExpertMetaApply metaApply = metaApplyService.getById(applyId);
update.set(ExpertLeave::getStatus, LeaveStatusEnum.UN_PASSED.getCode());
LambdaQueryWrapper<ExpertLeaveDetail> delete = Wrappers.lambdaQuery(ExpertLeaveDetail.class)
.eq(ExpertLeaveDetail::getExpertLeaveId, leave.getId());


+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ReviewProjectDTO.java Прегледај датотеку

@@ -1,7 +1,6 @@
package com.hz.pm.api.meeting.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hz.pm.api.sms.constant.DatePattern;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;



hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertAttendSummaryVO.java → hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertAttendStatVO.java Прегледај датотеку

@@ -5,16 +5,16 @@ import lombok.Data;

/**
* <p>
* ExpertAttendSummaryVo
* ExpertAttendStatVO
* </p>
*
* @author WendyYang
* @since 11:18 2022/8/28
*/
@Data
public class ExpertAttendSummaryVO {
public class ExpertAttendStatVO {

private transient Long expertId;
private Long expertId;

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

+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/meta/controller/MetaDictionaryManageController.java Прегледај датотеку

@@ -6,7 +6,7 @@ import com.hz.pm.api.meta.manage.MetaManage;
import com.hz.pm.api.meta.model.po.ReqAddDictionaryPO;
import com.hz.pm.api.meta.model.po.ReqDictionaryListPO;
import com.hz.pm.api.meta.model.vo.ResDictionaryListVO;
import com.hz.pm.api.meta.validate.DictionaryRequestValidator;
import com.hz.pm.api.meta.validate.DictParamValidator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -37,14 +37,14 @@ public class MetaDictionaryManageController {
@PostMapping("/list")
@ApiOperation("字典筛选数据返回")
public List<ResDictionaryListVO> expertDictList(@RequestBody ReqDictionaryListPO request) {
DictionaryRequestValidator.dictionaryRequestValidator(request);
DictParamValidator.dictionaryRequestValidator(request);
return metaManage.getDictionaryList(request);
}

@PostMapping("/common/list")
@ApiOperation("通用字典筛选数据返回")
public List<ResDictionaryListVO> commonDictList(@RequestBody ReqDictionaryListPO request) {
DictionaryRequestValidator.dictionaryRequestValidator(request);
DictParamValidator.dictionaryRequestValidator(request);
return metaManage.commonDictList(request);
}



+ 5
- 19
hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/ExpertUserInfoHelperImpl.java Прегледај датотеку

@@ -1,6 +1,5 @@
package com.hz.pm.api.meta.helper;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.expert.entity.ExpertUserFullInfo;
import com.hz.pm.api.expert.service.IExpertUserFullInfoService;
import com.hz.pm.api.meta.model.ExpertRegionInfo;
@@ -21,25 +20,23 @@ public class ExpertUserInfoHelperImpl implements ExpertUserInfoHelper {
/**
* 获取专家
*
* @param expertUserId
* @return
* @param expertUserId \
* @return \
*/
@Override
public ExpertUserFullInfo getExpertBasicFullInfo(Long expertUserId) {
return iExpertUserFullInfoService
.getOne(Wrappers.lambdaQuery(ExpertUserFullInfo.class).eq(ExpertUserFullInfo::getUserId, expertUserId));
return iExpertUserFullInfoService.getByUserId(expertUserId);
}

/**
* 获取专家层级
*
* @param expertUserId
* @return
* @param expertUserId \
* @return \
*/
@Override
public ExpertRegionInfo getExpertRegionInfo(Long expertUserId) {
ExpertUserFullInfo one = getExpertBasicFullInfo(expertUserId);

Integer regionLevel = one.getRegionLevel();
String regionCode = one.getRegionCode();
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo();
@@ -48,15 +45,4 @@ public class ExpertUserInfoHelperImpl implements ExpertUserInfoHelper {
return expertRegionInfo;
}

// /**
// * 专家是否已经出库
// */
// public Boolean isDelivery(Long expertUserId) {
// ExpertUserFullInfo one = getExpertBasicFullInfo(expertUserId);
// if (Objects.isNull(one)) {
// return true;
// }
// return ExpertAccountStatusEnum.DELIVERY.getKey().equals(one.getExpertAccountStatus());
// }

}

+ 2
- 7
hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/impl/TagsCacheImpl.java Прегледај датотеку

@@ -10,10 +10,7 @@ import io.micrometer.core.instrument.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;

/**
* @author liuxinxin
@@ -99,9 +96,7 @@ public class TagsCacheImpl extends AbstractTagsCache {
List<TagTreeDTO> result = new ArrayList<>();
result.add(tagTreeDTO);
if (tagTreeDTO.getChildren() != null && !tagTreeDTO.getChildren().isEmpty()) {
tagTreeDTO.getChildren().forEach(node -> {
result.addAll(treeToList(node));
});
tagTreeDTO.getChildren().forEach(node -> result.addAll(treeToList(node)));
}
return result;
}


hz-pm-api/src/main/java/com/hz/pm/api/meta/validate/DictionaryRequestValidator.java → hz-pm-api/src/main/java/com/hz/pm/api/meta/validate/DictParamValidator.java Прегледај датотеку

@@ -11,17 +11,20 @@ import java.util.List;
* @author liuxinxin
* @date 2022/7/21 下午6:15
*/
public class DictParamValidator {

public class DictionaryRequestValidator {
private DictParamValidator() {
}

public static void dictionaryRequestValidator(ReqDictionaryListPO reqDictionaryListPO) {
List<String> dictionaryTypeList = reqDictionaryListPO.getDictionaryTypeList();
if (CollectionUtils.isNotEmpty(dictionaryTypeList)) {
for (String dictionaryType : dictionaryTypeList) {
if (!DictExpertInfoTypeEnum.contains(dictionaryType)) {
throw new BizException("Illegal dictionaryType: " + dictionaryType);
public static void dictionaryRequestValidator(ReqDictionaryListPO req) {
List<String> dictTypeList = req.getDictionaryTypeList();
if (CollectionUtils.isNotEmpty(dictTypeList)) {
for (String dictType : dictTypeList) {
if (!DictExpertInfoTypeEnum.contains(dictType)) {
throw new BizException("无效的字典信息: " + dictType);
}
}
}
}

}

+ 6
- 58
hz-pm-api/src/main/java/com/hz/pm/api/organization/entity/OrganizationMainManageTag.java Прегледај датотеку

@@ -1,21 +1,23 @@
package com.hz.pm.api.organization.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
* <p>
*
*
* </p>
*
* @author Liuxinxin
* @since 2023-03-09
*/
@Data
@TableName("organization_main_manage_tag")
@ApiModel(value = "OrganizationMainManageTag对象", description = "")
@ApiModel(value = "OrganizationMainManageTag对象")
public class OrganizationMainManageTag implements Serializable {

private static final long serialVersionUID = 1L;
@@ -32,58 +34,4 @@ public class OrganizationMainManageTag implements Serializable {

private String organizationCode;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}
public LocalDateTime getCreateOn() {
return createOn;
}

public void setCreateOn(LocalDateTime createOn) {
this.createOn = createOn;
}
public LocalDateTime getUpdateOn() {
return updateOn;
}

public void setUpdateOn(LocalDateTime updateOn) {
this.updateOn = updateOn;
}
public Long getCreateBy() {
return createBy;
}

public void setCreateBy(Long createBy) {
this.createBy = createBy;
}
public Long getUpdateBy() {
return updateBy;
}

public void setUpdateBy(Long updateBy) {
this.updateBy = updateBy;
}
public String getOrganizationCode() {
return organizationCode;
}

public void setOrganizationCode(String organizationCode) {
this.organizationCode = organizationCode;
}

@Override
public String toString() {
return "OrganizationMainManageTag{" +
"id=" + id +
", createOn=" + createOn +
", updateOn=" + updateOn +
", createBy=" + createBy +
", updateBy=" + updateBy +
", organizationCode=" + organizationCode +
"}";
}
}

+ 5
- 7
hz-pm-api/src/main/java/com/hz/pm/api/organization/service/impl/DingEmployeeInfoServiceImpl.java Прегледај датотеку

@@ -8,7 +8,7 @@ import com.hz.pm.api.organization.model.entity.DingEmployeeInfo;
import com.hz.pm.api.organization.service.IDingEmployeeInfoService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

@@ -26,20 +26,18 @@ public class DingEmployeeInfoServiceImpl extends ServiceImpl<DingEmployeeInfoMap
@Override
public List<String> getEmployeesOrgCodeList(List<String> employeeCodeList) {
if (CollUtil.isEmpty(employeeCodeList)) {
return new ArrayList<>();
return Collections.emptyList();
}
List<DingEmployeeInfo> dingEmployeeInfoList = this.list(Wrappers.lambdaQuery(DingEmployeeInfo.class).in(DingEmployeeInfo::getEmployeeCode, employeeCodeList));
List<String> orgCodeList = dingEmployeeInfoList.stream().map(DingEmployeeInfo::getOrganizationCode).distinct().collect(Collectors.toList());
return orgCodeList;
return dingEmployeeInfoList.stream().map(DingEmployeeInfo::getOrganizationCode).distinct().collect(Collectors.toList());
}

@Override
public List<DingEmployeeInfo> getEmployeeList(List<String> employeeCodeList) {
if (CollUtil.isEmpty(employeeCodeList)) {
return new ArrayList<>();
return Collections.emptyList();
}
List<DingEmployeeInfo> dingEmployeeInfoList = this.list(Wrappers.lambdaQuery(DingEmployeeInfo.class)
return list(Wrappers.lambdaQuery(DingEmployeeInfo.class)
.in(DingEmployeeInfo::getEmployeeCode, employeeCodeList));
return dingEmployeeInfoList;
}
}

+ 8
- 9
hz-pm-api/src/main/java/com/hz/pm/api/performance/controller/AppAppraisalController.java Прегледај датотеку

@@ -1,20 +1,19 @@
package com.hz.pm.api.performance.controller;

import javax.validation.Valid;

import com.ningdatech.log.annotation.WebLog;
import com.hz.pm.api.performance.manage.AppAppraisalManage;
import com.hz.pm.api.performance.model.vo.*;
import org.springframework.web.bind.annotation.*;

import com.ningdatech.basic.model.PageVo;
import com.hz.pm.api.performance.manage.ReAppraisalManage;
import com.hz.pm.api.performance.model.dto.ProjectAppraisalDTO;
import com.hz.pm.api.performance.model.req.PerformanceAppraisalListReq;

import com.hz.pm.api.performance.model.vo.AppAppraisalIndexDetailVO;
import com.hz.pm.api.performance.model.vo.PerformanceAppraisalAppVO;
import com.hz.pm.api.performance.model.vo.PerformanceAppraisalVO;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
* ReAppraisalController


+ 14
- 16
hz-pm-api/src/main/java/com/hz/pm/api/performance/controller/ReAppraisalController.java Прегледај датотеку

@@ -1,29 +1,27 @@
package com.hz.pm.api.performance.controller;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

import com.ningdatech.log.annotation.WebLog;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.performance.manage.ReAppraisalManage;
import com.hz.pm.api.performance.model.req.PerformanceAppraisalExportReq;
import org.springframework.web.bind.annotation.*;

import com.ningdatech.basic.model.PageVo;
import com.hz.pm.api.performance.model.dto.ProjectAppraisalDTO;
import com.hz.pm.api.performance.model.req.PerformanceAppraisalExportReq;
import com.hz.pm.api.performance.model.req.PerformanceAppraisalListReq;
import com.hz.pm.api.performance.model.vo.PerformanceAppraisalProjectVO;
import com.hz.pm.api.performance.model.vo.PerformanceAppraisalVO;
import com.hz.pm.api.performance.model.vo.ProjectAppraisalIndexDetailVO;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

/**
* ReAppraisalController
* @return
*
* @author CMM
* @return
* @since 2023/08/10 8:54
*/
@RestController
@@ -43,20 +41,20 @@ public class ReAppraisalController {
@GetMapping("/group-project-list/{groupId}")
@ApiOperation("当前复评用户所在分组复评项目列表")
public PageVo<PerformanceAppraisalProjectVO> groupProjectList(@PathVariable Long groupId, PerformanceAppraisalListReq req) {
return reAppraisalManage.groupProjectList(groupId,req);
return reAppraisalManage.groupProjectList(groupId, req);
}

@PostMapping("/submit-reAppraisal")
@ApiOperation("提交复评")
@WebLog(value = "提交复评",modular = "绩效评价-人工复评")
public String submitReAppraisal(@Valid @RequestBody ProjectAppraisalDTO param){
@WebLog(value = "提交复评", modular = "绩效评价-人工复评")
public String submitReAppraisal(@Valid @RequestBody ProjectAppraisalDTO param) {
return reAppraisalManage.submitReAppraisal(param);
}

@GetMapping("/score/export")
@ApiOperation("复评打分导出")
@WebLog(value = "复评打分导出",modular = "绩效评价-人工复评")
public void exportScore(@Valid @ModelAttribute PerformanceAppraisalExportReq param, HttpServletResponse response){
@WebLog(value = "复评打分导出", modular = "绩效评价-人工复评")
public void exportScore(@Valid @ModelAttribute PerformanceAppraisalExportReq param, HttpServletResponse response) {
ExcelDownUtil.downXls(response, param, reAppraisalManage::exportScore);
}



+ 86
- 88
hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/ReAppraisalManage.java Прегледај датотеку

@@ -1,61 +1,57 @@
package com.hz.pm.api.performance.manage;

import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.CharsetUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.google.common.collect.Lists;
import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.performance.model.dto.*;
import com.hz.pm.api.performance.model.req.PerformanceAppraisalExportReq;
import com.hz.pm.api.performance.util.*;
import com.hz.pm.api.portrait.model.entity.ProjectTag;
import com.hz.pm.api.portrait.service.IProjectTagService;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
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;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.StrPool;
import com.google.common.collect.Lists;
import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.performance.constant.BizConst;
import com.hz.pm.api.performance.enumration.AppraisalTypeEnum;
import com.hz.pm.api.performance.model.dto.ProjectAppraisalDTO;
import com.hz.pm.api.performance.model.dto.ProjectAppraisalInfoDTO;
import com.hz.pm.api.performance.model.entity.*;
import com.hz.pm.api.performance.model.req.PerformanceAppraisalExportReq;
import com.hz.pm.api.performance.model.req.PerformanceAppraisalListReq;
import com.hz.pm.api.performance.model.vo.PerformanceAppraisalProjectVO;
import com.hz.pm.api.performance.model.vo.PerformanceAppraisalVO;
import com.hz.pm.api.performance.service.*;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeEnum;
import com.hz.pm.api.performance.util.*;
import com.hz.pm.api.portrait.model.entity.ProjectTag;
import com.hz.pm.api.portrait.service.IProjectTagService;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.sys.model.entity.Role;
import com.hz.pm.api.sys.service.IRoleService;
import com.hz.pm.api.user.security.auth.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.StrPool;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

/**
* ReAppraisalManage
* @return
*
* @author CMM
* @since 2023/08/10 8:55
*/
@@ -73,8 +69,10 @@ public class ReAppraisalManage {
private final IPerformanceAppraisalProjectGroupService groupService;
private final IProjectTagService projectTagService;
private final IPerformanceIndicatorProjectTemplateService indicatorProjectTemplateService;

/**
* 复评-评价计划列表
*
* @param req
* @return
*/
@@ -86,12 +84,12 @@ public class ReAppraisalManage {
List<Long> roleIdList = userRoleList.stream().map(Role::getId).collect(Collectors.toList());
Role role = roleService.getOne(Wrappers.lambdaQuery(Role.class)
.eq(Role::getName, BizConst.REAPPRAISAL_ROLE));
if (Objects.isNull(role)){
if (Objects.isNull(role)) {
throw new BizException("登录用户没有复评员角色!");
}

// 登录用户不是复评员,不能查看复评计划列表
if (!roleIdList.contains(role.getId())){
if (!roleIdList.contains(role.getId())) {
return PageVo.empty();
}

@@ -100,7 +98,7 @@ public class ReAppraisalManage {
.filter(p -> Objects.nonNull(p.getSelfAppraisalScoreTime())).collect(Collectors.toList());

// 已存在的评价计划添加的评价项目都未完成单位自评
if(CollUtil.isEmpty(paps)){
if (CollUtil.isEmpty(paps)) {
return PageVo.empty();
}
Set<Long> paIds = paps.stream().map(PerformanceAppraisalProject::getAppraisalId).collect(Collectors.toSet());
@@ -114,7 +112,7 @@ public class ReAppraisalManage {
List<String> empCodeList = Lists.newArrayList();
if (reAppraisalUsers.contains(StrPool.COMMA)) {
empCodeList.addAll(Arrays.asList(reAppraisalUsers.split(StrPool.COMMA)));
}else {
} else {
empCodeList.add(reAppraisalUsers);
}
if (empCodeList.contains(employeeCode)) {
@@ -123,7 +121,7 @@ public class ReAppraisalManage {
return false;
}).collect(Collectors.toList());
// 当前登录复评员用户,没有参加评价计划
if (CollUtil.isEmpty(groupList)){
if (CollUtil.isEmpty(groupList)) {
return PageVo.empty();
}
// 获取分组所在的评价计划ID
@@ -133,9 +131,9 @@ public class ReAppraisalManage {
// 获取复评计划列表
Page<PerformanceAppraisal> page = req.page();
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class)
.in(PerformanceAppraisal::getId,appraisalIds)
.in(PerformanceAppraisal::getId, appraisalIds)
.orderByDesc(PerformanceAppraisal::getUpdateOn);
performanceAppraisalService.page(page,wrapper);
performanceAppraisalService.page(page, wrapper);

List<PerformanceAppraisalVO> res = page.getRecords().stream().map(p -> {
PerformanceAppraisalVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalVO.class);
@@ -146,7 +144,7 @@ public class ReAppraisalManage {
}
return vo;
}).collect(Collectors.toList());
return PageVo.of(res,page.getTotal());
return PageVo.of(res, page.getTotal());
}

/**
@@ -163,10 +161,10 @@ public class ReAppraisalManage {
// 如果没有相关的打分信息,说明是当前登录复评用户是首次复评
List<PerformanceAppraisalScoreInfo> scoreInfos = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.RE_APPRAISAL.getCode())
.eq(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCode)
.eq(PerformanceAppraisalScoreInfo::getAppraisalId,appraisalId)
.eq(PerformanceAppraisalScoreInfo::getAppraisalProjectCode, projectCode)
.eq(PerformanceAppraisalScoreInfo::getAppraisalId, appraisalId)
.eq(PerformanceAppraisalScoreInfo::getAppraisalEmployeeCode, employeeCode));
if (CollUtil.isEmpty(scoreInfos)){
if (CollUtil.isEmpty(scoreInfos)) {
return true;
}
return Boolean.FALSE;
@@ -179,7 +177,7 @@ public class ReAppraisalManage {

// 获取分组内的项目信息
PerformanceAppraisalProjectGroup projectGroup = groupService.getById(groupId);
if (Objects.isNull(projectGroup)){
if (Objects.isNull(projectGroup)) {
throw new BizException("当前复评用户所在分组不存在!");
}
String projectCodes = projectGroup.getProjectCodes();
@@ -190,10 +188,10 @@ public class ReAppraisalManage {
// 筛选出分组内已完成单位自评、需要复评的评价项目信息
List<PerformanceAppraisalProject> appraisalProjects = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.in(PerformanceAppraisalProject::getProjectCode, projectCodeList)
.eq(PerformanceAppraisalProject::getIsReAppraisal,Boolean.TRUE)
.eq(PerformanceAppraisalProject::getIsReAppraisal, Boolean.TRUE)
.eq(PerformanceAppraisalProject::getIsCompleteSelfAppraisal, Boolean.TRUE));
// 分组内已完成单位自评的项目信息不存在
if (CollUtil.isEmpty(appraisalProjects)){
if (CollUtil.isEmpty(appraisalProjects)) {
return PageVo.empty();
}
List<String> proCodeList = appraisalProjects.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList());
@@ -203,11 +201,11 @@ public class ReAppraisalManage {
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode, proCodeList)
.eq(Project::getNewest, Boolean.TRUE)
.like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName());
projectService.page(page,wrapper);
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName());
projectService.page(page, wrapper);

// 分组内项目信息不存在
if (CollUtil.isEmpty(page.getRecords())){
if (CollUtil.isEmpty(page.getRecords())) {
return PageVo.empty();
}

@@ -217,8 +215,8 @@ public class ReAppraisalManage {
BeanUtil.copyProperties(appraisalProject, vo);
vo.setProjectId(appraisalProject.getProjectId());
vo.setProjectTypeName(ProjectTypeNewEnum.getDesc(p.getProjectType()));
vo.setCanReAppraisal(checkCanReAppraisal(employeeCode,appraisalProject.getProjectCode(),appraisalId));
if (Boolean.TRUE.equals(appraisalProject.getIsCompleteReAppraisal())){
vo.setCanReAppraisal(checkCanReAppraisal(employeeCode, appraisalProject.getProjectCode(), appraisalId));
if (Boolean.TRUE.equals(appraisalProject.getIsCompleteReAppraisal())) {
// 完成复评的项目可以进行核查
vo.setCanVerify(Boolean.TRUE);
}
@@ -226,7 +224,7 @@ public class ReAppraisalManage {
return vo;
})
.collect(Collectors.toList());
return PageVo.of(res,page.getTotal());
return PageVo.of(res, page.getTotal());
}

@Transactional(rollbackFor = Exception.class)
@@ -245,7 +243,7 @@ public class ReAppraisalManage {
PerformanceAppraisalProject appraisalProject = performanceAppraisalProjectService.getOne(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, appraisalId)
.eq(PerformanceAppraisalProject::getProjectId, appraisalProjectId)
.eq(PerformanceAppraisalProject::getProjectCode,appraisalProjectCode));
.eq(PerformanceAppraisalProject::getProjectCode, appraisalProjectCode));

List<Long> ids = appraisalInfoList.stream()
.map(ProjectAppraisalInfoDTO::getProjectTemplateDetailId)
@@ -253,7 +251,7 @@ public class ReAppraisalManage {
// 查出项目模版详情信息
List<PerformanceIndicatorProjectTemplateDetail> detailList = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.in(PerformanceIndicatorProjectTemplateDetail::getId, ids));
if (CollUtil.isEmpty(detailList)){
if (CollUtil.isEmpty(detailList)) {
throw new BizException("评价指标不存在!");
}
Map<Long, PerformanceIndicatorProjectTemplateDetail> detailMap = detailList.stream().collect(Collectors.toMap(PerformanceIndicatorProjectTemplateDetail::getId, d -> d));
@@ -261,7 +259,7 @@ public class ReAppraisalManage {
PerformanceIndicatorProjectTemplateDetail templateDetail = detailMap.get(a.getProjectTemplateDetailId());
BigDecimal score = a.getScore();
BigDecimal indexScore = templateDetail.getIndexScore();
if (score.compareTo(indexScore) > 0 || score.compareTo(BigDecimal.ZERO) < 0){
if (score.compareTo(indexScore) > 0 || score.compareTo(BigDecimal.ZERO) < 0) {
throw new BizException("复评得分必须大于等于0且小于等于指标分值!");
}
// 保存复评分数信息
@@ -282,7 +280,7 @@ public class ReAppraisalManage {
return scoreInfo;
}).collect(Collectors.toList());

if (performanceAppraisalScoreInfoService.saveBatch(scoreInfos)){
if (performanceAppraisalScoreInfoService.saveBatch(scoreInfos)) {
// 计算复评总分并保存
BigDecimal reAppraisalTotalScore = appraisalInfoList.stream()
.map(ProjectAppraisalInfoDTO::getScore)
@@ -290,11 +288,11 @@ public class ReAppraisalManage {
.reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal lastReappraisalTotalScore;
// 判断项目所在分组内其他复评人员是否已经打分
if (Objects.nonNull(appraisalProject.getReAppraisalTotalScore())){
if (Objects.nonNull(appraisalProject.getReAppraisalTotalScore())) {
// 已经进行了复评,计算两个分值的平均分
BigDecimal add = reAppraisalTotalScore.add(appraisalProject.getReAppraisalTotalScore());
lastReappraisalTotalScore = add.divide(BigDecimal.valueOf(2));
}else {
} else {
// 还没有进行过复评
lastReappraisalTotalScore = reAppraisalTotalScore;
}
@@ -355,12 +353,12 @@ public class ReAppraisalManage {
String projectTagIds = String.join(StrPool.COMMA, strIdList);

Integer amountRange = null;
if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.FIVE_MILLION)) < 0){
if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.FIVE_MILLION)) < 0) {
amountRange = BizConst.AMOUNT_RANGE_ONE;
} else if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.FIVE_MILLION)) >= 0 &&
approvalAmount.compareTo(BigDecimal.valueOf(BizConst.TWENTY_MILLION)) < 0) {
amountRange = BizConst.AMOUNT_RANGE_TWO;
}else if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.TWENTY_MILLION)) >= 0){
} else if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.TWENTY_MILLION)) >= 0) {
amountRange = BizConst.AMOUNT_RANGE_THREE;
}
LambdaQueryWrapper<PerformanceIndicatorProjectTemplate> wrapper = Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplate.class)
@@ -368,12 +366,12 @@ public class ReAppraisalManage {
.eq(PerformanceIndicatorProjectTemplate::getProjectType, projectType)
.eq(PerformanceIndicatorProjectTemplate::getProjectYear, projectYear)
.eq(PerformanceIndicatorProjectTemplate::getAmountRange, amountRange)
.eq(PerformanceIndicatorProjectTemplate::getProjectTagIds,projectTagIds)
.eq(PerformanceIndicatorProjectTemplate::getProjectTagIds, projectTagIds)
.eq(PerformanceIndicatorProjectTemplate::getStatus, CommonEnum.YES.getCode())
.orderByDesc(PerformanceIndicatorProjectTemplate::getUpdateOn);
List<PerformanceIndicatorProjectTemplate> templates = indicatorProjectTemplateService.list(wrapper);
VUtils.isTrue(CollUtil.isEmpty(templates)).throwMessage("该项目匹配不到指标模板,请返回上一页或者刷新重试。");
if (templates.size() > 1){
if (templates.size() > 1) {
throw new BizException("当前项目匹配到多个模板,请返回模板库检查模板配置!");
}
PerformanceIndicatorProjectTemplate projectTemplate = templates.get(0);
@@ -416,38 +414,38 @@ public class ReAppraisalManage {
if (Objects.nonNull(secondTemplateDetail)) {
// 一级指标名称
Long firstId = secondTemplateDetail.getParentId();
if (Objects.nonNull(firstId)){
if (Objects.nonNull(firstId)) {
PerformanceIndicatorProjectTemplateDetail firstTemplateDetail = templateDetailMap.get(firstId);
if (Objects.nonNull(firstTemplateDetail)) {
scoreMap.put(BizConst.FIRST_INDEX_NAME,firstTemplateDetail.getName());
scoreMap.put(BizConst.SECOND_INDEX_NAME,secondTemplateDetail.getName());
scoreMap.put(BizConst.FIRST_INDEX_NAME, firstTemplateDetail.getName());
scoreMap.put(BizConst.SECOND_INDEX_NAME, secondTemplateDetail.getName());
}
}
}
}
scoreMap.put(BizConst.THIRD_INDEX_NAME,thirdTemplateDetail.getName());
scoreMap.put(BizConst.INDEX_SCORE,thirdTemplateDetail.getIndexScore());
scoreMap.put(BizConst.INDEX_DETAIL,thirdTemplateDetail.getIndexDetail());
scoreMap.put(BizConst.GRADE_DETAIL,thirdTemplateDetail.getGradeDetail());
scoreMap.put(BizConst.SUPPORT_MATERIAL,thirdTemplateDetail.getSupportMaterial());
scoreMap.put(BizConst.THIRD_INDEX_NAME, thirdTemplateDetail.getName());
scoreMap.put(BizConst.INDEX_SCORE, thirdTemplateDetail.getIndexScore());
scoreMap.put(BizConst.INDEX_DETAIL, thirdTemplateDetail.getIndexDetail());
scoreMap.put(BizConst.GRADE_DETAIL, thirdTemplateDetail.getGradeDetail());
scoreMap.put(BizConst.SUPPORT_MATERIAL, thirdTemplateDetail.getSupportMaterial());
PerformanceAppraisalScoreInfo appraisalScoreInfo = scoreInfoMap.get(thirdTemplateDetail.getId());
// 构建自评和复评打分信息
if (AppraisalTypeEnum.SELF_APPRAISAL.getCode().equals(appraisalScoreInfo.getAppraisalType())){
scoreMap.put(BizConst.SELF_APPRAISAL_BASIS,appraisalScoreInfo.getAppraisalBasis());
scoreMap.put(BizConst.SELF_APPRAISAL_SCORE,appraisalScoreInfo.getAppraisalScore());
if (AppraisalTypeEnum.SELF_APPRAISAL.getCode().equals(appraisalScoreInfo.getAppraisalType())) {
scoreMap.put(BizConst.SELF_APPRAISAL_BASIS, appraisalScoreInfo.getAppraisalBasis());
scoreMap.put(BizConst.SELF_APPRAISAL_SCORE, appraisalScoreInfo.getAppraisalScore());
} else if (AppraisalTypeEnum.RE_APPRAISAL.getCode().equals(appraisalScoreInfo.getAppraisalType())) {
scoreMap.put(appraisalScoreInfo.getAppraisalEmployeeName() + BizConst.RE_APPRAISAL_BASIS, appraisalScoreInfo.getAppraisalBasis());
scoreMap.put(appraisalScoreInfo.getAppraisalEmployeeName() + BizConst.RE_APPRAISAL_SCORE, appraisalScoreInfo.getAppraisalScore());
}

if (Boolean.TRUE.equals(thirdTemplateDetail.getIsAdditional())) {
scoreMap.put(BizConst.IS_ADDITIONAL,CommonEnum.YES.getDesc());
scoreMap.put(BizConst.IS_ADDITIONAL, CommonEnum.YES.getDesc());
} else if (Boolean.FALSE.equals(thirdTemplateDetail.getIsAdditional())) {
scoreMap.put(BizConst.IS_ADDITIONAL,CommonEnum.NO.getDesc());
scoreMap.put(BizConst.IS_ADDITIONAL, CommonEnum.NO.getDesc());
}
if (Boolean.FALSE.equals(thirdTemplateDetail.getIsAdditional())) {
exportDataList.add(scoreMap);
}else {
} else {
exportAdditionalDataList.add(scoreMap);
}
}
@@ -459,20 +457,20 @@ public class ReAppraisalManage {
int mergeRowIndex = 2;

List<ExcelHead> headList = Lists.newArrayList();
headList.add(new ExcelHead(BizConst.FIRST_INDEX_NAME,BizConst.FIRST_INDEX_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.SECOND_INDEX_NAME,BizConst.SECOND_INDEX_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.THIRD_INDEX_NAME,BizConst.THIRD_INDEX_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.INDEX_SCORE,BizConst.INDEX_SCORE_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.INDEX_DETAIL,BizConst.INDEX_DETAIL_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.GRADE_DETAIL,BizConst.GRADE_DETAIL_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.SUPPORT_MATERIAL,BizConst.SUPPORT_MATERIAL_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.SELF_APPRAISAL_BASIS,BizConst.SELF_APPRAISAL_BASIS_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.SELF_APPRAISAL_SCORE,BizConst.SELF_APPRAISAL_SCORE_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.FIRST_INDEX_NAME, BizConst.FIRST_INDEX_TITLE, StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.SECOND_INDEX_NAME, BizConst.SECOND_INDEX_TITLE, StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.THIRD_INDEX_NAME, BizConst.THIRD_INDEX_TITLE, StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.INDEX_SCORE, BizConst.INDEX_SCORE_TITLE, StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.INDEX_DETAIL, BizConst.INDEX_DETAIL_TITLE, StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.GRADE_DETAIL, BizConst.GRADE_DETAIL_TITLE, StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.SUPPORT_MATERIAL, BizConst.SUPPORT_MATERIAL_TITLE, StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.SELF_APPRAISAL_BASIS, BizConst.SELF_APPRAISAL_BASIS_TITLE, StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.SELF_APPRAISAL_SCORE, BizConst.SELF_APPRAISAL_SCORE_TITLE, StrPool.EMPTY));
for (String reUser : reUserList) {
headList.add(new ExcelHead(reUser + BizConst.RE_APPRAISAL_BASIS,BizConst.RE_APPRAISAL_BASIS_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(reUser + BizConst.RE_APPRAISAL_SCORE,BizConst.RE_APPRAISAL_SCORE_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(reUser + BizConst.RE_APPRAISAL_BASIS, BizConst.RE_APPRAISAL_BASIS_TITLE, StrPool.EMPTY));
headList.add(new ExcelHead(reUser + BizConst.RE_APPRAISAL_SCORE, BizConst.RE_APPRAISAL_SCORE_TITLE, StrPool.EMPTY));
}
headList.add(new ExcelHead(BizConst.IS_ADDITIONAL,BizConst.IS_ADDITIONAL_TITLE,StrPool.EMPTY));
headList.add(new ExcelHead(BizConst.IS_ADDITIONAL, BizConst.IS_ADDITIONAL_TITLE, StrPool.EMPTY));

// 数据导出处理函数
try {
@@ -482,9 +480,9 @@ public class ReAppraisalManage {
writerBuilder.file(response.getOutputStream());
writerBuilder.autoCloseStream(true);
writerBuilder.registerWriteHandler(new ExcelSheetVerticalCellStyleStrategy());
writerBuilder.registerWriteHandler(new MultiColumnMergeStrategy(exportDataList.size(),0,1));
writerBuilder.registerWriteHandler(new ExcelFillCellMergeStrategy(mergeRowIndex,mergeColumnIndex));
writerBuilder.head(ExcelUtils.getHead(reUserList,Lists.newArrayList()))
writerBuilder.registerWriteHandler(new MultiColumnMergeStrategy(exportDataList.size(), 0, 1));
writerBuilder.registerWriteHandler(new ExcelFillCellMergeStrategy(mergeRowIndex, mergeColumnIndex));
writerBuilder.head(ExcelUtils.getHead(reUserList, Lists.newArrayList()))
.sheet(fileName)
.doWrite(ExcelUtils.convertData(headList, exportDataList));
} catch (IOException e) {


+ 59
- 63
hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/RectifyManage.java Прегледај датотеку

@@ -1,24 +1,10 @@
package com.hz.pm.api.performance.manage;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.performance.enumration.RectifyStatusEnum;
import com.hz.pm.api.performance.model.dto.ProjectAppraisalDTO;
@@ -31,7 +17,7 @@ import com.hz.pm.api.performance.model.vo.RectifyDetailVO;
import com.hz.pm.api.performance.service.IPerformanceAppraisalProjectService;
import com.hz.pm.api.performance.service.IPerformanceAppraisalService;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeEnum;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.sys.model.entity.Role;
@@ -40,16 +26,26 @@ import com.hz.pm.api.user.entity.enumeration.RoleEnum;
import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.auth.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

/**
* RectifyManage
*
* @return
*
* @author CMM
* @since 2023/08/12 17:36
*/
@@ -66,7 +62,7 @@ public class RectifyManage {

/**
* 绩效列表
*
*
* @param req
* @return
*/
@@ -79,7 +75,7 @@ public class RectifyManage {
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.COMPANY_MANAGER.getDesc()));
if (Objects.isNull(role)) {
throw new BizException("登录用户没有单位管理员角色!");
}
@@ -91,7 +87,7 @@ public class RectifyManage {

// 获取登录用户所在单位的所有已终验项目信息
List<Project> projectLists = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode()).eq(Project::getBuildOrgCode, empPosUnitCode));
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode()).eq(Project::getBuildOrgCode, empPosUnitCode));

if (CollUtil.isEmpty(projectLists)) {
return PageVo.empty();
@@ -99,11 +95,11 @@ public class RectifyManage {
List<Long> projectIds = projectLists.stream().map(Project::getId).collect(Collectors.toList());
// 获取添加过该单位项目的所有评价计划信息,且评价计划内包含有需要整改项目
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers
.lambdaQuery(PerformanceAppraisalProject.class).in(PerformanceAppraisalProject::getProjectId, projectIds)
.eq(PerformanceAppraisalProject::getIsRectify, Boolean.TRUE));
.lambdaQuery(PerformanceAppraisalProject.class).in(PerformanceAppraisalProject::getProjectId, projectIds)
.eq(PerformanceAppraisalProject::getIsRectify, Boolean.TRUE));
// 按评价计划分组
Map<Long, List<PerformanceAppraisalProject>> papsMap =
paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId));
paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId));
if (CollUtil.isEmpty(paps)) {
return PageVo.empty();
}
@@ -111,7 +107,7 @@ public class RectifyManage {
// 获取评价计划列表
Page<PerformanceAppraisal> page = req.page();
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class)
.in(PerformanceAppraisal::getId, paIds).orderByDesc(PerformanceAppraisal::getUpdateOn);
.in(PerformanceAppraisal::getId, paIds).orderByDesc(PerformanceAppraisal::getUpdateOn);
performanceAppraisalService.page(page, wrapper);
if (CollUtil.isEmpty(page.getRecords())) {
return PageVo.empty();
@@ -122,16 +118,16 @@ public class RectifyManage {
// 统计评价计划待整改项目数量(整改状态为:整改情况待提交、整改核查不通过)
List<PerformanceAppraisalProject> projects = papsMap.get(p.getId());
List<PerformanceAppraisalProject> unRectifyProjects = projects.stream()
.filter(d -> RectifyStatusEnum.TO_BE_SUBMITTED.getCode().equals(d.getRectifyStatus())
|| RectifyStatusEnum.NOT_APPROVED.getCode().equals(d.getRectifyStatus()))
.collect(Collectors.toList());
.filter(d -> RectifyStatusEnum.TO_BE_SUBMITTED.getCode().equals(d.getRectifyStatus())
|| RectifyStatusEnum.NOT_APPROVED.getCode().equals(d.getRectifyStatus()))
.collect(Collectors.toList());
vo.setUnRectifyNumber(unRectifyProjects.size());
// 统计评价计划已整改项目数量(整改状态为:整改待审核、整改审核通过)
List<PerformanceAppraisalProject> rectifiedProjects =
paps.stream()
.filter(d -> RectifyStatusEnum.TO_BE_REVIEWED.getCode().equals(d.getRectifyStatus())
|| RectifyStatusEnum.APPROVED.getCode().equals(d.getRectifyStatus()))
.collect(Collectors.toList());
paps.stream()
.filter(d -> RectifyStatusEnum.TO_BE_REVIEWED.getCode().equals(d.getRectifyStatus())
|| RectifyStatusEnum.APPROVED.getCode().equals(d.getRectifyStatus()))
.collect(Collectors.toList());
vo.setRectifiedNumber(rectifiedProjects.size());
return vo;
}).collect(Collectors.toList());
@@ -146,14 +142,14 @@ public class RectifyManage {

// 获取评价计划内已添加的待整改项目信息
List<PerformanceAppraisalProject> paps =
performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, plan.getId())
.eq(PerformanceAppraisalProject::getIsRectify, Boolean.TRUE)
.and(wp -> wp
.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.TO_BE_SUBMITTED.getCode()).or()
.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.NOT_APPROVED.getCode())));
performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, plan.getId())
.eq(PerformanceAppraisalProject::getIsRectify, Boolean.TRUE)
.and(wp -> wp
.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.TO_BE_SUBMITTED.getCode()).or()
.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.NOT_APPROVED.getCode())));
Map<Long, PerformanceAppraisalProject> papsMap =
paps.stream().collect(Collectors.toMap(PerformanceAppraisalProject::getProjectId, p -> p));
paps.stream().collect(Collectors.toMap(PerformanceAppraisalProject::getProjectId, p -> p));

if (CollUtil.isEmpty(paps)) {
return PageVo.empty();
@@ -161,12 +157,12 @@ public class RectifyManage {

// 获取本单位在当前评价计划内的项目
Set<String> projectCodes =
paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet());
paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet());
Page<Project> page = req.page();
LambdaQueryWrapper<Project> wrapper =
Wrappers.lambdaQuery(Project.class).in(Project::getProjectCode, projectCodes)
.eq(Project::getNewest, Boolean.TRUE).eq(Project::getBuildOrgCode, user.getEmpPosUnitCode())
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName());
Wrappers.lambdaQuery(Project.class).in(Project::getProjectCode, projectCodes)
.eq(Project::getNewest, Boolean.TRUE).eq(Project::getBuildOrgCode, user.getEmpPosUnitCode())
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName());
projectService.page(page, wrapper);

if (CollUtil.isEmpty(page.getRecords())) {
@@ -197,14 +193,14 @@ public class RectifyManage {

// 获取评价计划内已添加的已整改项目信息
List<PerformanceAppraisalProject> paps =
performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, plan.getId())
.eq(PerformanceAppraisalProject::getIsRectify, Boolean.TRUE)
.and(wp -> wp
.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.TO_BE_REVIEWED.getCode()).or()
.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.APPROVED.getCode())));
performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, plan.getId())
.eq(PerformanceAppraisalProject::getIsRectify, Boolean.TRUE)
.and(wp -> wp
.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.TO_BE_REVIEWED.getCode()).or()
.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.APPROVED.getCode())));
Map<Long, PerformanceAppraisalProject> papsMap =
paps.stream().collect(Collectors.toMap(PerformanceAppraisalProject::getProjectId, p -> p));
paps.stream().collect(Collectors.toMap(PerformanceAppraisalProject::getProjectId, p -> p));

if (CollUtil.isEmpty(paps)) {
return PageVo.empty();
@@ -212,12 +208,12 @@ public class RectifyManage {

// 获取本单位在当前评价计划内的项目
Set<String> projectCodes =
paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet());
paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet());
Page<Project> page = req.page();
LambdaQueryWrapper<Project> wrapper =
Wrappers.lambdaQuery(Project.class).in(Project::getProjectCode, projectCodes)
.eq(Project::getNewest, Boolean.TRUE).eq(Project::getBuildOrgCode, user.getEmpPosUnitCode())
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName());
Wrappers.lambdaQuery(Project.class).in(Project::getProjectCode, projectCodes)
.eq(Project::getNewest, Boolean.TRUE).eq(Project::getBuildOrgCode, user.getEmpPosUnitCode())
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName());
projectService.page(page, wrapper);

if (CollUtil.isEmpty(page.getRecords())) {
@@ -243,8 +239,8 @@ public class RectifyManage {
RectifyDetailVO vo = new RectifyDetailVO();
// 根据评价计划ID和项目编号获取评价项目信息
PerformanceAppraisalProject appraisalProject = performanceAppraisalProjectService.getOne(Wrappers
.lambdaQuery(PerformanceAppraisalProject.class).eq(PerformanceAppraisalProject::getAppraisalId, planId)
.eq(PerformanceAppraisalProject::getProjectCode, projectCode));
.lambdaQuery(PerformanceAppraisalProject.class).eq(PerformanceAppraisalProject::getAppraisalId, planId)
.eq(PerformanceAppraisalProject::getProjectCode, projectCode));
VUtils.isTrue(Objects.isNull(appraisalProject)).throwMessage("该项目已被移除评价计划,请返回上一页或者刷新重试!!");
BeanUtils.copyProperties(appraisalProject, vo);
String rectifySubmitEmployeeCode = appraisalProject.getRectifySubmitEmployeeCode();
@@ -275,9 +271,9 @@ public class RectifyManage {

// 判断该项目是否还存在于计划或分组中
PerformanceAppraisalProject appraisalProject = performanceAppraisalProjectService.getOne(Wrappers
.lambdaQuery(PerformanceAppraisalProject.class).eq(PerformanceAppraisalProject::getAppraisalId, appraisalId)
.eq(PerformanceAppraisalProject::getProjectId, appraisalProjectId)
.eq(PerformanceAppraisalProject::getProjectCode, appraisalProjectCode));
.lambdaQuery(PerformanceAppraisalProject.class).eq(PerformanceAppraisalProject::getAppraisalId, appraisalId)
.eq(PerformanceAppraisalProject::getProjectId, appraisalProjectId)
.eq(PerformanceAppraisalProject::getProjectCode, appraisalProjectCode));
if (Objects.isNull(appraisalProject)) {
throw new BizException("该项目已被移除评价计划,请返回上一页或者刷新重试!");
}


+ 7
- 7
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/AppAppraisalInfoDTO.java Прегледај датотеку

@@ -1,17 +1,17 @@
package com.hz.pm.api.performance.model.dto;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

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

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
* <p>
* 应用评价信息
* @return
* </p>
*
* @author CMM
* @since 2023/08/08 18:46
*/


+ 1
- 3
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ProjectAppraisalDTO.java Прегледај датотеку

@@ -3,14 +3,12 @@ package com.hz.pm.api.performance.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
* 项目评价信息
* @return
*
* @author CMM
* @since 2023/08/08 18:46
*/


+ 4
- 6
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ProjectAppraisalInfoDTO.java Прегледај датотеку

@@ -1,14 +1,12 @@
package com.hz.pm.api.performance.model.dto;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;

/**
* 项目评价信息


+ 4
- 6
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ReAppraisalInfoDTO.java Прегледај датотеку

@@ -1,16 +1,14 @@
package com.hz.pm.api.performance.model.dto;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.validation.constraints.NotNull;

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

import java.io.Serializable;
import java.math.BigDecimal;

/**
* 应用评价信息
* @return
*
* @author CMM
* @since 2023/08/08 18:46
*/


+ 15
- 17
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ReAppraisalScoreExportDTO.java Прегледај датотеку

@@ -1,14 +1,12 @@
package com.hz.pm.api.performance.model.dto;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

import com.alibaba.excel.annotation.ExcelProperty;

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

import java.io.Serializable;
import java.math.BigDecimal;

/**
* 绩效打分详情导出实体
*
@@ -21,50 +19,50 @@ public class ReAppraisalScoreExportDTO implements Serializable {
private static final long serialVersionUID = 1L;

@ApiModelProperty("一级指标名称")
@ExcelProperty(value = "一级指标",index = 0)
@ExcelProperty(value = "一级指标", index = 0)
private String firstIndexName;

@ApiModelProperty("二级指标名称")
@ExcelProperty(value = "二级指标",index = 1)
@ExcelProperty(value = "二级指标", index = 1)
private String secondIndexName;

@ApiModelProperty("三级指标名称")
@ExcelProperty(value = "三级指标",index = 2)
@ExcelProperty(value = "三级指标", index = 2)
private String thirdIndexName;

@ApiModelProperty("指标分值 3级指标才有")
@ExcelProperty(value = "指标分值",index = 3)
@ExcelProperty(value = "指标分值", index = 3)
private BigDecimal indexScore;

@ApiModelProperty("指标细则 3级指标才有")
@ExcelProperty(value = "指标细则",index = 4)
@ExcelProperty(value = "指标细则", index = 4)
private String indexDetail;

@ApiModelProperty("评分细则")
@ExcelProperty(value = "评分细则",index = 5)
@ExcelProperty(value = "评分细则", index = 5)
private String gradeDetail;

@ApiModelProperty("佐证材料描述")
@ExcelProperty(value = "佐证材料",index = 6)
@ExcelProperty(value = "佐证材料", index = 6)
private String supportMaterial;

@ApiModelProperty("自评依据")
@ExcelProperty(value = "自评依据",index = 7)
@ExcelProperty(value = "自评依据", index = 7)
private String selfAppraisalBasis;

@ApiModelProperty("自评得分")
@ExcelProperty(value = "自评得分",index = 8)
@ExcelProperty(value = "自评得分", index = 8)
private BigDecimal selfAppraisalScore;

@ApiModelProperty("复评依据")
@ExcelProperty(value = "复评依据",index = 9)
@ExcelProperty(value = "复评依据", index = 9)
private String refAppraisalBasis;

@ApiModelProperty("复评得分")
@ExcelProperty(value = "复评得分",index = 10)
@ExcelProperty(value = "复评得分", index = 10)
private BigDecimal reAppraisalScore;

@ApiModelProperty("是否为附加指标")
@ExcelProperty(value = "是否附加指标",index = 11)
@ExcelProperty(value = "是否附加指标", index = 11)
private String isAdditional;
}

+ 4
- 8
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/entity/ProjectCoreBusinessIndicators.java Прегледај датотеку

@@ -3,17 +3,13 @@ package com.hz.pm.api.performance.model.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
* <p>
@@ -24,7 +20,7 @@ import javax.validation.constraints.Size;
* @since 2023-07-26
*/
@TableName("nd_project_core_business_indicators")
@ApiModel(value = "NdProjectCoreBusinessIndicators对象", description = "")
@ApiModel(value = "NdProjectCoreBusinessIndicators对象")
@Data
public class ProjectCoreBusinessIndicators implements Serializable {



+ 6
- 8
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppAppraisalIndexDetailVO.java Прегледај датотеку

@@ -1,19 +1,17 @@
package com.hz.pm.api.performance.model.vo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.hz.pm.api.performance.model.entity.PerformanceAppraisalAppScoreInfo;
import com.hz.pm.api.performance.model.entity.PerformanceAppraisalScoreInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
* <p>
* 应用评价指标
* @return
* </p>
*
* @author CMM
* @since 2023/08/08 8:55
*/


+ 6
- 7
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppBusinessIndexDetailVO.java Прегледај датотеку

@@ -1,19 +1,18 @@
package com.hz.pm.api.performance.model.vo;

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

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

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

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


/**
* <p>
* AppIndexDetailVO
* @return
* </p>
*
* @author CMM
* @since 2023/08/14 8:55
*/


+ 6
- 7
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppIndexDetailVO.java Прегледај датотеку

@@ -1,19 +1,18 @@
package com.hz.pm.api.performance.model.vo;

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

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

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

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


/**
* <p>
* AppIndexDetailVO
* @return
* </p>
*
* @author CMM
* @since 2023/08/14 8:55
*/


+ 5
- 8
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppIndexVO.java Прегледај датотеку

@@ -1,19 +1,16 @@
package com.hz.pm.api.performance.model.vo;

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

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

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

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

/**
* 绩效评价-项目指标库
* @return
*
* @author CMM
* @since 2023/07/28 14:45
*/


+ 5
- 9
hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/PerformanceAppraisalAppVO.java Прегледај датотеку

@@ -1,23 +1,19 @@
package com.hz.pm.api.performance.model.vo;

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

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO;

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

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

/**
* PerformanceAppraisalAppVO
* @return
*
* @author CMM
* @return \
*/
@Data
@ApiModel(value = "绩效评价应用对象", description = "绩效评价应用对象")


+ 3
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ProjectAdjustmentController.java Прегледај датотеку

@@ -1,14 +1,12 @@
package com.hz.pm.api.projectdeclared.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.projectdeclared.manage.ProjectAdjustmentManage;
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.hz.pm.api.projectdeclared.model.req.AdjustmentListReq;
import com.hz.pm.api.projectdeclared.manage.ProjectAdjustmentManage;
import com.hz.pm.api.projectlib.manage.ProjectLibManage;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -17,7 +15,6 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;

/**
* @Classname ConstructionPlanController


+ 2
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ReviewChecklistController.java Прегледај датотеку

@@ -1,13 +1,11 @@
package com.hz.pm.api.projectdeclared.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.hz.pm.api.projectdeclared.manage.ReviewChecklistManage;
import com.hz.pm.api.projectdeclared.model.dto.ReviewChecklistApproveDTO;
import com.hz.pm.api.projectdeclared.model.vo.ReviewCheckInfoVO;
import com.hz.pm.api.projectdeclared.model.vo.ReviewChecklistApproveVO;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectReviewCheckListItemVO;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.wflow.bean.dto.FormsReviewChecklistDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


+ 3
- 8
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java Прегледај датотеку

@@ -4,22 +4,15 @@ import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.NdDateUtils;
import com.hz.pm.api.common.constant.CommonConst;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.common.util.ExcelExportStyle;
import com.hz.pm.api.projectdeclared.model.dto.DeclaredProjectExportDTO;
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.hz.pm.api.projectdeclared.model.dto.ProjectAdjustmentExportDTO;
import com.hz.pm.api.projectdeclared.model.req.AdjustmentListReq;
import com.hz.pm.api.projectdeclared.utils.GenerateProjectCodeUtil;
import com.hz.pm.api.projectdeclared.utils.ReStartProcessMapUtil;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeEnum;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.helper.ProjectHelper;
import com.hz.pm.api.projectlib.manage.ProjectLibManage;
@@ -31,8 +24,10 @@ import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.auth.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.NdDateUtils;
import com.wflow.exception.BusinessException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;


+ 12
- 15
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java Прегледај датотеку

@@ -1,8 +1,6 @@
package com.hz.pm.api.projectdeclared.manage;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.file.service.FileService;
import com.hz.pm.api.projectdeclared.converter.ApplicationConverter;
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
@@ -13,8 +11,9 @@ import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.provincial.service.IJoinReviewProvincialBureauService;
import com.hz.pm.api.staging.service.IProjectStagingService;
import com.hz.pm.api.todocenter.constant.TodoCenterConstant;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.file.service.FileService;
import com.wflow.exception.BusinessException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -52,6 +51,7 @@ public class ReviewByProvincialDeptManage {

/**
* 省级部门联审
*
* @param project
* @return
*/
@@ -60,28 +60,26 @@ public class ReviewByProvincialDeptManage {
VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!");
Project projectInfo = projectService.getById(project.getId());
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!");
String regionCode = projectInfo.getAreaCode();

//首先要判断 项目当前状态 是不是 省级部门联审
VUtils.isTrue(!ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals(projectInfo.getStatus()) ||
!ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
!ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
.throwMessage("提交失败 该项目不是 省级部门联审状态状态或者未立项阶段");

// 对接省级联审的接口
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, projectInfo.getId()));
if(joinReviewProvincialBureauService.pushImportProject(
ApplicationConverter.convertProject(projectInfo,applications,fileService,active))){
if (joinReviewProvincialBureauService.pushImportProject(ApplicationConverter.convertProject(projectInfo, applications, fileService, active))) {
return Boolean.TRUE;
}

return Boolean.FALSE;
}

/**
* 省级部门联审 重新提交
* @param declaringDTO
* @return
*
* @param declaringDTO \
* @return \
*/
@Transactional(rollbackFor = Exception.class)
public String restartTheProcess(DefaultDeclaredDTO declaringDTO) {
@@ -89,7 +87,6 @@ public class ReviewByProvincialDeptManage {
VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!");
Project projectInfo = projectService.getNewProject(project.getId());
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!");
String regionCode = projectInfo.getAreaCode();

//首先要判断 项目当前状态 是不是 省级部门联审不通过
VUtils.isTrue(!ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode().equals(projectInfo.getStatus()) ||
@@ -97,8 +94,8 @@ public class ReviewByProvincialDeptManage {
.throwMessage("提交失败 该项目不是 省级部门联审不通过状态或者未立项阶段");

// 对接省级联审的接口
Project p = projectLibManage.saveProjectWithVersionAndStatus(project,null,
ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(),Boolean.FALSE);
Project p = projectLibManage.saveProjectWithVersionAndStatus(project, null,
ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), Boolean.FALSE);

List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, p.getId()));
@@ -111,8 +108,8 @@ public class ReviewByProvincialDeptManage {
p.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE);
declaringDTO.getProjectInfo().setId(p.getId());
projectService.updateById(p);
if(!joinReviewProvincialBureauService.pushImportProject(
ApplicationConverter.convertProject(p,applications,fileService,active))){
if (!joinReviewProvincialBureauService.pushImportProject(
ApplicationConverter.convertProject(p, applications, fileService, active))) {
throw new BusinessException("提交省级部门联审失败");
}



+ 79
- 83
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java Прегледај датотеку

@@ -8,11 +8,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.StrPool;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.constant.RegionConst;
import com.hz.pm.api.common.helper.RegionCacheHelper;
@@ -32,6 +27,11 @@ import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.auth.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.StrPool;
import com.wflow.bean.dto.FormsReviewChecklistDto;
import com.wflow.bean.dto.ReviewChecklistModuleDto;
import com.wflow.enums.ReviewChecklistResultEnum;
@@ -40,6 +40,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

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

@@ -70,14 +71,13 @@ public class ReviewChecklistManage {
//项目查最新
query.eq(Project::getNewest, Boolean.TRUE);
//建设方案提交后的状态
query.ge(Project::getStatus,ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode())
.ne(Project::getStatus,ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode())
.eq(Project::getAreaCode,RegionConst.RC_LS);
query.ge(Project::getStatus, ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode())
.ne(Project::getStatus, ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode())
.eq(Project::getAreaCode, RegionConst.RC_LS);
UserInfoDetails user = LoginUserUtil.loginUserDetail();
buildReviewCheckPermission(query, user);

Page<Project> page = projectService.page(req.page(), query);
long total;
if (CollUtil.isEmpty(page.getRecords())) {
return PageVo.empty();
}
@@ -90,17 +90,16 @@ public class ReviewChecklistManage {
Map<String, List<ReviewChecklistApprove>> approveMap =
approves.stream().collect(Collectors.groupingBy(ReviewChecklistApprove::getProjectCode));

List<String> reviewHumans = Lists.newArrayList();;
if(BizConst.DEV.equals(active)){
List<String> reviewHumans;
if (BizConst.DEV.equals(active)) {
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZYD;
}else{
} else {
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZZD;
}
List<UserFullInfoDTO> users = userInfoHelper.getUserFullInfoByEmployeeCodes(reviewHumans);
Set<String> userSet = Sets.newHashSet();
Map<String, String> userMap = users.stream().filter(u -> userSet.add(u.getEmployeeCode()))
.collect(Collectors.toMap(u -> u.getEmployeeCode()
, u -> u.getUsername()));
.collect(Collectors.toMap(UserFullInfoDTO::getEmployeeCode, UserFullInfoDTO::getUsername));
List<ProjectReviewCheckListItemVO> records = CollUtils.convert(page.getRecords(), w -> {
ProjectReviewCheckListItemVO item = new ProjectReviewCheckListItemVO();
item.setId(w.getId());
@@ -121,76 +120,75 @@ public class ReviewChecklistManage {
item.setApprovedAmount(w.getApprovalAmount());
item.setAnnualPlanAmount(w.getAnnualPlanAmount());
// 审查人员情况
item.setVerifiedHumans(computeVerify(item,approveMap.get(w.getProjectCode()),userMap,user));
item.setVerifiedHumans(computeVerify(item, approveMap.get(w.getProjectCode()), userMap, user));
item.setReviewCheckFinish(w.getReviewCheckFinish());
return item;
});
return PageVo.of(records, page.getTotal());
}

private String computeVerify(ProjectReviewCheckListItemVO item,List<ReviewChecklistApprove> reviewChecklistApproves,
Map<String, String> userMap,UserInfoDetails user) {
List<String> reviewHumans = Lists.newArrayList();;
if(BizConst.DEV.equals(active)){
private String computeVerify(ProjectReviewCheckListItemVO item, List<ReviewChecklistApprove> reviewChecklistApproves,
Map<String, String> userMap, UserInfoDetails user) {
List<String> reviewHumans;
if (BizConst.DEV.equals(active)) {
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZYD;
}else{
} else {
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZZD;
}

Integer maxNums = reviewHumans.size();
int maxNums = reviewHumans.size();
Integer finishNums = 0;
Set<String> computeHumanSet = reviewHumans.stream().collect(Collectors.toSet());

if(CollUtil.isEmpty(reviewChecklistApproves)){
item.setReviewCheckNotApprove(convertUser(userMap,computeHumanSet));
Set<String> computeHumanSet = new HashSet<>(reviewHumans);
if (CollUtil.isEmpty(reviewChecklistApproves)) {
item.setReviewCheckNotApprove(convertUser(userMap, computeHumanSet));
return finishNums + StrPool.SLASH + maxNums;
}
for(ReviewChecklistApprove approve : reviewChecklistApproves){
if(StringUtils.isNotBlank(approve.getCreateByCode()) ||
computeHumanSet.contains(approve.getCreateByCode())){
if(StringUtils.isNotBlank(user.getEmployeeCode()) &&
user.getEmployeeCode().equals(approve.getCreateByCode())){
for (ReviewChecklistApprove approve : reviewChecklistApproves) {
if (StringUtils.isNotBlank(approve.getCreateByCode()) ||
computeHumanSet.contains(approve.getCreateByCode())) {
if (StringUtils.isNotBlank(user.getEmployeeCode()) &&
user.getEmployeeCode().equals(approve.getCreateByCode())) {
item.setApproved(Boolean.TRUE);
}
if(computeHumanSet.remove(approve.getCreateByCode())){
if (computeHumanSet.remove(approve.getCreateByCode())) {
//说明 有指定人 审核过
finishNums++;
}
}
}
item.setReviewCheckNotApprove(convertUser(userMap,computeHumanSet));
item.setReviewCheckNotApprove(convertUser(userMap, computeHumanSet));

return finishNums + StrPool.SLASH + maxNums;
}

private String convertUser(Map<String, String> userMap, Set<String> computeHumanSet) {
if(CollUtil.isEmpty(userMap) || CollUtil.isEmpty(computeHumanSet)){
if (CollUtil.isEmpty(userMap) || CollUtil.isEmpty(computeHumanSet)) {
return StringUtils.EMPTY;
}
return computeHumanSet.stream().filter(s -> StringUtils.isNotBlank(s) && userMap.containsKey(s))
.map(s -> userMap.get(s)).collect(Collectors.joining(StrPool.COMMA));
.map(userMap::get).collect(Collectors.joining(StrPool.COMMA));
}

public UserFullInfoDTO buildReviewCheckPermission(LambdaQueryWrapper<Project> query, UserInfoDetails user) {
UserFullInfoDTO userDto = BeanUtil.copyProperties(user,UserFullInfoDTO.class);
UserFullInfoDTO userDto = BeanUtil.copyProperties(user, UserFullInfoDTO.class);
//1.只有 市本级能看到
String regionCode = user.getRegionCode();
String employeeCode = user.getEmployeeCode();
//如果是七大审查之一 就可以看
List<String> reviewHumans = Lists.newArrayList();;
if(BizConst.DEV.equals(active)){
List<String> reviewHumans;
if (BizConst.DEV.equals(active)) {
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZYD;
}else{
} else {
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZZD;
}
if(reviewHumans.contains(employeeCode)){
if (reviewHumans.contains(employeeCode)) {
log.warn("为七大审查人之一 可以查看");
return userDto;
}

if(!regionCode.equals(RegionConst.RC_LS) || StringUtils.isBlank(employeeCode)){
log.info("当前操作人 不是市本级 或者没有钉钉工号 :{},{},{}",user.getUsername(),
user.getRegionCode(),user.getEmployeeCode());
if (!regionCode.equals(RegionConst.RC_LS) || StringUtils.isBlank(employeeCode)) {
log.info("当前操作人 不是市本级 或者没有钉钉工号 :{},{},{}", user.getUsername(),
user.getRegionCode(), user.getEmployeeCode());
query.eq(Project::getId, 0L);
return userDto;
}
@@ -229,11 +227,12 @@ public class ReviewChecklistManage {

/**
* 去审批
*
* @param dtos
* @return
*/
public String approve(List<ReviewChecklistApproveDTO> dtos) {
if(CollUtil.isEmpty(dtos)){
if (CollUtil.isEmpty(dtos)) {
throw new BizException("传入数据不能为空!");
}
ReviewChecklistApproveDTO reviewChecklistApproveFirst = dtos.get(0);
@@ -243,23 +242,24 @@ public class ReviewChecklistManage {
Long userId = user.getUserId();
String employeeCode = user.getEmployeeCode();
String username = user.getUsername();
List<String> reviewHumans = Lists.newArrayList();;
if(BizConst.DEV.equals(active)){
List<String> reviewHumans;
;
if (BizConst.DEV.equals(active)) {
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZYD;
}else{
} else {
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZZD;
}

if(StringUtils.isBlank(employeeCode) || !reviewHumans.contains(employeeCode)){
if (StringUtils.isBlank(employeeCode) || !reviewHumans.contains(employeeCode)) {
throw new BizException("当前操作员 不是七大审查人之一!");
}

VUtils.isTrue(reviewChecklistApproveService.count(Wrappers.lambdaQuery(ReviewChecklistApprove.class)
.eq(ReviewChecklistApprove::getProjectCode,projectCode)
.eq(ReviewChecklistApprove::getCreateByCode,employeeCode)) > 0)
.eq(ReviewChecklistApprove::getProjectCode, projectCode)
.eq(ReviewChecklistApprove::getCreateByCode, employeeCode)) > 0)
.throwMessage("此项目 当前审查员 已经审批过 请不要重复审批");

for(ReviewChecklistApproveDTO dto : dtos){
for (ReviewChecklistApproveDTO dto : dtos) {
ReviewChecklistApprove saveEntity = new ReviewChecklistApprove();
saveEntity.setCreateBy(username);
saveEntity.setCreateById(userId);
@@ -281,6 +281,7 @@ public class ReviewChecklistManage {

/**
* 查看待意见汇总 列表
*
* @param projectCode
* @return
*/
@@ -288,7 +289,7 @@ public class ReviewChecklistManage {
List<ReviewChecklistApprove> approves = reviewChecklistApproveService.list(Wrappers.lambdaQuery(ReviewChecklistApprove.class)
.eq(ReviewChecklistApprove::getProjectCode, projectCode)
.orderByAsc(ReviewChecklistApprove::getCreateOn));
if(CollUtil.isEmpty(approves)){
if (CollUtil.isEmpty(approves)) {
return Collections.emptyList();
}

@@ -300,23 +301,21 @@ public class ReviewChecklistManage {
List<ReviewChecklistApprove> dupTitle = approves.stream().filter(r -> titleSet.add(r.getTitle()))
.collect(Collectors.toList());

List<FormsReviewChecklistDto> res = dupTitle.stream()
return dupTitle.stream()
.map(r -> {
FormsReviewChecklistDto vo = new FormsReviewChecklistDto();
vo.setTitle(r.getTitle());
if(groupTitleMap.containsKey(r.getTitle())){
if (groupTitleMap.containsKey(r.getTitle())) {
List<ReviewChecklistApprove> reviewChecklistApproves = groupTitleMap.get(r.getTitle());
vo.setModules(convertModules(reviewChecklistApproves));
}
return vo;
})
.collect(Collectors.toList());

return res;
}

public String summary(String projectCode) {
//修改到 项目里去
// 修改到 项目里去
Project project = projectService.getProjectByCode(projectCode);
VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在");
VUtils.isTrue(Objects.nonNull(project.getReviewCheckFinish()) && project.getReviewCheckFinish())
@@ -325,30 +324,28 @@ public class ReviewChecklistManage {
List<ReviewChecklistApprove> approves = reviewChecklistApproveService.list(Wrappers.lambdaQuery(ReviewChecklistApprove.class)
.eq(ReviewChecklistApprove::getProjectCode, projectCode)
.orderByAsc(ReviewChecklistApprove::getCreateOn));
if(CollUtil.isEmpty(approves)){
if (CollUtil.isEmpty(approves)) {
throw new BizException("该项目 未被七大审查人 审批!");
}

List<String> reviewHumans = Lists.newArrayList();;
if(BizConst.DEV.equals(active)){
List<String> reviewHumans;
if (BizConst.DEV.equals(active)) {
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZYD;
}else{
} else {
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZZD;
}
Set<String> computeHumanSet = reviewHumans.stream().collect(Collectors.toSet());
for(ReviewChecklistApprove approve : approves){
if(computeHumanSet.contains(approve.getCreateByCode())){
computeHumanSet.remove(approve.getCreateByCode());
}
Set<String> computeHumanSet = new HashSet<>(reviewHumans);
for (ReviewChecklistApprove approve : approves) {
computeHumanSet.remove(approve.getCreateByCode());
}
if(CollUtil.isNotEmpty(computeHumanSet)){
if (CollUtil.isNotEmpty(computeHumanSet)) {
throw new BizException("此项目的审查清单 未被七大审核人 审批完!");
}

//做成map 并且还要 未通过的
Map<String, List<ReviewChecklistApprove>> groupTitleMap = approves.stream()
.filter(r -> Objects.nonNull(r.getReviewResult()) && Lists.newArrayList(
ReviewChecklistResultEnum.NOT_PASS.getCode(),ReviewChecklistResultEnum.ONE_VOTE_VETO.getCode())
ReviewChecklistResultEnum.NOT_PASS.getCode(), ReviewChecklistResultEnum.ONE_VOTE_VETO.getCode())
.contains(r.getReviewResult()))
.collect(Collectors.groupingBy(ReviewChecklistApprove::getTitle));
//去重子标题
@@ -359,7 +356,7 @@ public class ReviewChecklistManage {
.map(r -> {
FormsReviewChecklistDto vo = new FormsReviewChecklistDto();
vo.setTitle(r.getTitle());
if(groupTitleMap.containsKey(r.getTitle())){
if (groupTitleMap.containsKey(r.getTitle())) {
List<ReviewChecklistApprove> reviewChecklistApproves = groupTitleMap.get(r.getTitle());
vo.setModules(convertModulesFinal(reviewChecklistApproves));
}
@@ -391,20 +388,20 @@ public class ReviewChecklistManage {
vo.setRejectionSituation(r.getRejectionSituation());
vo.setResponseSituation(r.getResponseSituation());
vo.setCorrPageNum(r.getCorrPageNum());
if(groupSubTitleMap.containsKey(r.getSubTitle())){
if (groupSubTitleMap.containsKey(r.getSubTitle())) {
List<ReviewChecklistApprove> approves = groupSubTitleMap.get(r.getSubTitle());
StringBuffer reviewCommentsSb = new StringBuffer();

for(ReviewChecklistApprove approve : approves){
StringBuilder reviewCommentsSb = new StringBuilder();
for (ReviewChecklistApprove approve : approves) {
ReviewChecklistResultEnum match = ReviewChecklistResultEnum.match(approve.getReviewResult());
reviewCommentsSb.append(approve.getCreateBy() + StrPool.COLON + (Objects.nonNull(match)?match.getDesc():StringUtils.EMPTY) +
(StringUtils.isNotBlank(approve.getReviewComments())?StrPool.COMMA+approve.getReviewComments():StringUtils.EMPTY) + "\n");
reviewCommentsSb.append(approve.getCreateBy())
.append(StrPool.COLON).append(Objects.nonNull(match) ? match.getDesc() : StringUtils.EMPTY)
.append(StringUtils.isNotBlank(approve.getReviewComments()) ? StrPool.COMMA + approve.getReviewComments() : StringUtils.EMPTY)
.append("\n");
}
vo.setReviewComments(reviewCommentsSb.toString());
}
return vo;
})
.collect(Collectors.toList());
}).collect(Collectors.toList());
}

private List<ReviewChecklistModuleDto> convertModulesFinal(List<ReviewChecklistApprove> reviewChecklistApproves) {
@@ -424,17 +421,16 @@ public class ReviewChecklistManage {
vo.setRejectionSituation(r.getRejectionSituation());
vo.setResponseSituation(r.getResponseSituation());
vo.setCorrPageNum(r.getCorrPageNum());
if(groupSubTitleMap.containsKey(r.getSubTitle())){
if (groupSubTitleMap.containsKey(r.getSubTitle())) {
List<ReviewChecklistApprove> approves = groupSubTitleMap.get(r.getSubTitle());
StringBuffer reviewCommentsSb = new StringBuffer();
if(CollUtil.isEmpty(approves)){
StringBuilder reviewCommentsSb = new StringBuilder();
if (CollUtil.isEmpty(approves)) {
vo.setReviewComments("通过");
}else{
} else {
Integer index = 1;
for(ReviewChecklistApprove approve : approves){
for (ReviewChecklistApprove approve : approves) {
ReviewChecklistResultEnum match = ReviewChecklistResultEnum.match(approve.getReviewResult());
reviewCommentsSb.append(index + StrPool.DOT + (Objects.nonNull(match)?match.getDesc():StringUtils.EMPTY) +
(StringUtils.isNotBlank(approve.getReviewComments())?StrPool.COMMA+approve.getReviewComments():StringUtils.EMPTY) + "\n");
reviewCommentsSb.append(index).append(StrPool.DOT).append(Objects.nonNull(match) ? match.getDesc() : StringUtils.EMPTY).append(StringUtils.isNotBlank(approve.getReviewComments()) ? StrPool.COMMA + approve.getReviewComments() : StringUtils.EMPTY).append("\n");
index++;
}
vo.setReviewComments(reviewCommentsSb.toString());


+ 1
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/mapper/NdPiotTasksMapper.java Прегледај датотеку

@@ -1,12 +1,11 @@
package com.hz.pm.api.projectdeclared.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hz.pm.api.projectdeclared.model.entity.IrsApplication;
import com.hz.pm.api.projectdeclared.model.entity.NdPiotTasks;

/**
* <p>
* Mapper 接口
* Mapper 接口
* </p>
*
* @author zpf


+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java Прегледај датотеку

@@ -10,7 +10,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ContractVO.java Прегледај датотеку

@@ -1,13 +1,13 @@
package com.hz.pm.api.projectdeclared.model.vo;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;



+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/DelayedApplyVO.java Прегледај датотеку

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

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**


+ 0
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ReviewCheckInfoVO.java Прегледај датотеку

@@ -1,14 +1,10 @@
package com.hz.pm.api.projectdeclared.model.vo;

import com.wflow.enums.ReviewChecklistResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
* @Classname ReviewCheckInfoVO
* @Description


+ 5
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/constant/ProjectConstant.java Прегледај датотеку

@@ -8,7 +8,11 @@ package com.hz.pm.api.projectlib.constant;
*/
public interface ProjectConstant {

class ProjectLib{
class ProjectLib {

private ProjectLib() {
}

public static final String PROJECT_BASIC = "basic";
public static final String PROJECT_CONSTRUCT = "construct";



+ 19
- 22
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/DeptUnitedReviewHandle.java Прегледај датотеку

@@ -1,31 +1,29 @@
package com.hz.pm.api.projectlib.handle;

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

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.constant.CommonConst;
import com.hz.pm.api.projectlib.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.projectlib.utils.ProjectVersionUtil;
import com.hz.pm.api.todocenter.constant.TodoCenterConstant;
import com.hz.pm.api.todocenter.utils.BuildUserUtils;
import com.ningdatech.basic.util.NdDateUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.enums.StepStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.common.constant.CommonConst;
import com.hz.pm.api.projectlib.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

/**
* 部门联审审核处理
@@ -42,18 +40,17 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle {
private final IProjectService projectService;
private final ProcessInstanceService processInstanceService;
private final BuildUserUtils buildUserUtils;
private final ProjectVersionUtil projectVersionUtil;

private Integer order = 5;

public DeptUnitedReviewHandle(IProjectInstService projectInstService,IProjectService projectService
, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils,
ProjectVersionUtil projectVersionUtil){
public DeptUnitedReviewHandle(IProjectInstService projectInstService,
IProjectService projectService,
ProcessInstanceService processInstanceService,
BuildUserUtils buildUserUtils) {
this.projectInstService = projectInstService;
this.projectService = projectService;
this.processInstanceService = processInstanceService;
this.buildUserUtils = buildUserUtils;
this.projectVersionUtil = projectVersionUtil;
}

@Override
@@ -70,7 +67,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle {
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.orderByDesc(ProjectInst::getCreatOn)
.last(BizConst.LIMIT_1));
if (Objects.isNull(projectInst)){
if (Objects.isNull(projectInst)) {
processDetailVO.setStepStatus(StepStatusEnum.NOT_START);
processDetailVO.setProcessName(CommonConst.DEPT_UNITED_REVIEW);
processSchedule.add(processDetailVO);
@@ -79,7 +76,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle {
String instCode = projectInst.getInstCode();
ProcessProgressVo instanceDetail = processInstanceService.getProgressInstanceDetail(null, instCode);
String status = instanceDetail.getStatus();
if (ProcessStatusEnum.UNDER_REVIEW.getDesc().equals(status)){
if (ProcessStatusEnum.UNDER_REVIEW.getDesc().equals(status)) {
processDetailVO.setStepStatus(StepStatusEnum.ON_GOING);
} else if (ProcessStatusEnum.BE_REJECTED.getDesc().equals(status)) {
processDetailVO.setStepStatus(StepStatusEnum.REJECTED);
@@ -98,7 +95,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle {
LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime());
processDetailVO.setFinishTime(finishTime);
}
}else {
} else {
LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(instanceDetail.getStartTime());
processDetailVO.setFinishTime(finishTime);
}


+ 17
- 18
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProcessExecuteChainHandle.java Прегледај датотеку

@@ -14,11 +14,11 @@ import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.service.ProcessModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* 流程执行链
@@ -46,56 +46,55 @@ public class ProcessExecuteChainHandle {

/**
* 遍历处理链,通过前缀判断能否处理逻辑,如果不能继续遍历
*
* @param projectId
* @return void
* @author CMM
* @since 2023/02/26
*/
public List<ProcessDetailVO> handle(Long projectId, List<ProcessDetailVO> processSchedule){
public List<ProcessDetailVO> handle(Long projectId, List<ProcessDetailVO> processSchedule) {
Project project = projectService.getById(projectId);

List<AbstractProcessBusinessHandle> handles = Lists.newArrayList();
for (AbstractProcessBusinessHandle processBusinessHandle : processBusinessHandles) {
if(Objects.nonNull(project) && RegionContant.LS_LQ_CODE.equals(project.getAreaCode())) {
if(processBusinessHandle instanceof AnnualPlanHandle){
if (Objects.nonNull(project) && RegionContant.LS_LQ_CODE.equals(project.getAreaCode())) {
if (processBusinessHandle instanceof AnnualPlanHandle) {
processBusinessHandle.setOrder(7);
}else if(processBusinessHandle instanceof ConstructionPlanReviewHandle){
} else if (processBusinessHandle instanceof ConstructionPlanReviewHandle) {
processBusinessHandle.setOrder(6);
}
}else{
if(processBusinessHandle instanceof AnnualPlanHandle){
} else {
if (processBusinessHandle instanceof AnnualPlanHandle) {
processBusinessHandle.setOrder(6);
}else if(processBusinessHandle instanceof ConstructionPlanReviewHandle){
} else if (processBusinessHandle instanceof ConstructionPlanReviewHandle) {
processBusinessHandle.setOrder(7);
}
}

//建设方案
if(processBusinessHandle instanceof ConstructionPlanReviewHandle){
if (processBusinessHandle instanceof ConstructionPlanReviewHandle) {
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode, project.getAreaCode())
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getCode())
.last(BizConst.LIMIT_1));
if(Objects.nonNull(model)){
if(!model.getIsStop()){
if (Objects.nonNull(model)) {
if (!model.getIsStop()) {
handles.add(processBusinessHandle);
}
}
}else if(processBusinessHandle instanceof ProvinceUnitedReviewHandle){
} else if (processBusinessHandle instanceof ProvinceUnitedReviewHandle) {
//省级联审
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project,
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)) {
handles.add(processBusinessHandle);
}
}else{
} else {
handles.add(processBusinessHandle);
}
}

handles = handles.stream()
.sorted(Comparator.comparing(AbstractProcessBusinessHandle::getOrder))
.collect(Collectors.toList());
if (handles.size() > 0) {
if (!handles.isEmpty()) {
handles.sort(Comparator.comparing(AbstractProcessBusinessHandle::getOrder));
for (AbstractProcessBusinessHandle processBusinessHandle : handles) {
processBusinessHandle.businessHandle(projectId, processSchedule);
}


+ 10
- 12
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProjectApprovalHandle.java Прегледај датотеку

@@ -1,25 +1,23 @@
package com.hz.pm.api.projectlib.handle;

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

import cn.hutool.core.collection.CollUtil;
import com.ningdatech.basic.util.CollUtils;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.constant.CommonConst;
import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.manage.AnnualPlanLibManage;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange;
import com.hz.pm.api.projectlib.service.INdProjectStatusChangeService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;

import static com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum.*;



+ 10
- 10
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProvinceUnitedReviewHandle.java Прегледај датотеку

@@ -10,9 +10,9 @@ import com.hz.pm.api.projectlib.service.INdProjectStatusChangeService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Objects;

@@ -31,7 +31,7 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle {
private Integer order = 3;

public ProvinceUnitedReviewHandle(IProjectService projectService,
INdProjectStatusChangeService projectStatusChangeService){
INdProjectStatusChangeService projectStatusChangeService) {
this.projectService = projectService;
this.projectStatusChangeService = projectStatusChangeService;
}
@@ -45,7 +45,7 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle {
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectId);

// 根据项目ID查询出部门联审流程的流程状态
if (Objects.isNull(project)){
if (Objects.isNull(project)) {
processDetailVO.setStepStatus(StepStatusEnum.NOT_START);
processDetailVO.setProcessName(CommonConst.PROVINCE_UNITED_REVIEW);
processSchedule.add(processDetailVO);
@@ -53,7 +53,7 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle {
}

Integer status = project.getStatus();
if (ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals(status)){
if (ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals(status)) {
processDetailVO.setStepStatus(StepStatusEnum.ON_GOING);
ProjectStatusChange startChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class)
.in(ProjectStatusChange::getProjectId, allVersionProjectId)
@@ -61,10 +61,10 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle {
.eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()).orderByDesc(ProjectStatusChange::getCreateOn)
.orderByDesc(ProjectStatusChange::getCreateOn)
.last(BizConst.LIMIT_1));
if(Objects.nonNull(startChange)){
if (Objects.nonNull(startChange)) {
processDetailVO.setFinishTime(startChange.getCreateOn());
}
} else if(status.compareTo(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()) > 0){
} else if (status.compareTo(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()) > 0) {
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED);
ProjectStatusChange passChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class)
.in(ProjectStatusChange::getProjectId, allVersionProjectId)
@@ -72,10 +72,10 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle {
.eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode())
.orderByDesc(ProjectStatusChange::getCreateOn)
.last(BizConst.LIMIT_1));
if(Objects.nonNull(passChange)){
if (Objects.nonNull(passChange)) {
processDetailVO.setFinishTime(passChange.getCreateOn());
}
}else if(status.compareTo(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()) > 0){
} else if (status.compareTo(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()) > 0) {
processDetailVO.setStepStatus(StepStatusEnum.REJECTED);
ProjectStatusChange rejectChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class)
.in(ProjectStatusChange::getProjectId, allVersionProjectId)
@@ -83,10 +83,10 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle {
.eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode())
.orderByDesc(ProjectStatusChange::getCreateOn)
.last(BizConst.LIMIT_1));
if(Objects.nonNull(rejectChange)){
if (Objects.nonNull(rejectChange)) {
processDetailVO.setFinishTime(rejectChange.getCreateOn());
}
}else{
} else {
processDetailVO.setStepStatus(StepStatusEnum.NOT_START);
processDetailVO.setProcessName(CommonConst.PROVINCE_UNITED_REVIEW);
processSchedule.add(processDetailVO);


+ 17
- 17
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/TenderPurchaseHandle.java Прегледај датотеку

@@ -1,25 +1,25 @@
package com.hz.pm.api.projectlib.handle;

import static com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum.*;

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

import com.hz.pm.api.common.constant.BizConst;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.util.CollUtils;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.constant.CommonConst;
import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange;
import com.hz.pm.api.projectlib.service.INdProjectStatusChangeService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.ningdatech.basic.util.CollUtils;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;

import static com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum.*;

/**
* 招标采购处理
@@ -47,7 +47,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle {
ACCEPTED
);

public TenderPurchaseHandle(INdProjectStatusChangeService projectStatusChangeService, IProjectService projectService){
public TenderPurchaseHandle(INdProjectStatusChangeService projectStatusChangeService, IProjectService projectService) {
this.projectStatusChangeService = projectStatusChangeService;
this.projectService = projectService;
}
@@ -60,7 +60,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle {
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project);
Integer status = project.getStatus();
// 未进行立项批复
if (Objects.isNull(project.getApprovalDate())){
if (Objects.isNull(project.getApprovalDate())) {
processDetailVO.setStepStatus(StepStatusEnum.NOT_START);
processDetailVO.setProcessName(CommonConst.TENDER_PURCHASE);
processSchedule.add(processDetailVO);
@@ -68,9 +68,9 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle {
}
List<Integer> fieldList = CollUtils.fieldList(TENDER_PURCHASE_LIST_STATUS, ProjectStatusEnum::getCode);
// 进行了立项批复且项目状态是待采购
if (ProjectStatusEnum.TO_BE_PURCHASED.getCode().equals(project.getStatus())){
if (ProjectStatusEnum.TO_BE_PURCHASED.getCode().equals(project.getStatus())) {
processDetailVO.setStepStatus(StepStatusEnum.ON_GOING);
}else if (fieldList.contains(status)){
} else if (fieldList.contains(status)) {
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED);
// 根据采购备案的时间获取
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class)


+ 8
- 10
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/UnitInnerAuditHandle.java Прегледај датотеку

@@ -1,27 +1,20 @@
package com.hz.pm.api.projectlib.handle;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.NdDateUtils;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.constant.CommonConst;
import com.hz.pm.api.projectlib.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.service.IProjectInstService;

import com.hz.pm.api.common.constant.CommonConst;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.projectlib.utils.ProjectVersionUtil;
import com.hz.pm.api.todocenter.constant.TodoCenterConstant;
import com.hz.pm.api.todocenter.utils.BuildUserUtils;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.NdDateUtils;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
@@ -32,6 +25,11 @@ import com.wflow.workflow.service.ProcessInstanceService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

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

/**
* 单位内部审核处理
*


+ 42
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectRenewFundHelper.java Прегледај датотеку

@@ -0,0 +1,42 @@
package com.hz.pm.api.projectlib.helper;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.req.ProjectRenewalListReq;

/**
* <p>
* ProjectRenewFundHelper
* </p>
*
* @author ZPF
* @since 14:15 2023/11/16
*/
public class ProjectRenewFundHelper {

private ProjectRenewFundHelper() {
}

/**
* 通用项目查询
*
* @param req 查询条件
* @return /
**/
public static LambdaQueryWrapper<Project> projectQuery(ProjectRenewalListReq req) {
LambdaQueryWrapper<Project> query = new LambdaQueryWrapper<>();
query.eq(req.getRegionCode() != null, Project::getAreaCode, req.getRegionCode())
.eq(req.getUserId() != null, Project::getCreateBy, req.getUserId())
.like(req.getProjectName() != null, Project::getProjectName, req.getProjectName())
.eq(req.getProjectType() != null, Project::getProjectType, req.getProjectType())
.eq(req.getStage() != null, Project::getStage, req.getStage())
.eq(req.getStatus() != null, Project::getStatus, req.getStatus())

//状态 阶段 list
.in(CollUtil.isNotEmpty(req.getStageList()), Project::getStage, req.getStageList())
.in(CollUtil.isNotEmpty(req.getStatusList()), Project::getStatus, req.getStatusList())
.orderByDesc(Project::getUpdateOn);
return query;
}
}

+ 0
- 48
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectRenewwalFundHelper.java Прегледај датотеку

@@ -1,48 +0,0 @@
package com.hz.pm.api.projectlib.helper;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hz.pm.api.performance.model.entity.ProjectCoreBusinessIndicators;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.req.ProjectRenewalListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectApplicationVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.Map;

/**
* <p>
* ProjectRenewwalFundHelper
* </p>
*
* @author ZPF
* @since 14:15 2023/11/16
*/
public class ProjectRenewwalFundHelper {

/**
* 通用项目查询
*
* @param req 查询条件
* @return /
**/
public static LambdaQueryWrapper<Project> projectQuery(ProjectRenewalListReq req) {
LambdaQueryWrapper<Project> query = new LambdaQueryWrapper<>();
query.eq(req.getRegionCode() != null, Project::getAreaCode, req.getRegionCode())
.eq(req.getUserId() != null, Project::getCreateBy, req.getUserId())
.like(req.getProjectName() != null, Project::getProjectName, req.getProjectName())
.eq(req.getProjectType() != null, Project::getProjectType, req.getProjectType())
.eq(req.getStage() != null, Project::getStage, req.getStage())
.eq(req.getStatus() != null, Project::getStatus, req.getStatus())

//状态 阶段 list
.in(CollUtil.isNotEmpty(req.getStageList()),Project::getStage,req.getStageList())
.in(CollUtil.isNotEmpty(req.getStatusList()),Project::getStatus,req.getStatusList())
.orderByDesc(Project::getUpdateOn);
return query;
}
}

+ 23
- 19
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectCollectionManage.java Прегледај датотеку

@@ -5,8 +5,6 @@ import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.constant.RegionConst;
import com.hz.pm.api.common.helper.RegionCacheHelper;
@@ -19,10 +17,13 @@ import com.hz.pm.api.projectlib.service.IProjectCollectionService;
import com.hz.pm.api.sys.model.dto.RegionDTO;
import com.hz.pm.api.user.security.auth.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
@@ -47,6 +48,7 @@ public class ProjectCollectionManage {

/**
* 项目归集
*
* @param req
* @return
*/
@@ -54,7 +56,7 @@ public class ProjectCollectionManage {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
String buildOrgCode = req.getBuildOrgCode();
//如果是超管 可以看所有
if(user.getSuperAdmin()){
if (user.getSuperAdmin()) {
buildOrgCode = null;
}

@@ -65,17 +67,17 @@ public class ProjectCollectionManage {
.like(StringUtils.isNotBlank(req.getBuildOrg()), ProjectCollection::getBuildOrg, req.getBuildOrg())
.eq(Objects.nonNull(buildOrgCode), ProjectCollection::getBuildOrgCode, buildOrgCode);
//处理 行政区域
if(StringUtils.isNotBlank(req.getRegionCode())){
if (StringUtils.isNotBlank(req.getRegionCode())) {
List<RegionDTO> regions = regionCacheHelper.listChildren(req.getRegionCode(), req.getRegionLevel());

if(CollUtil.isNotEmpty(regions)){
wrapper.in(ProjectCollection::getAreaCode,regions.stream().map(RegionDTO::getRegionCode).collect(Collectors.toList()));
if (CollUtil.isNotEmpty(regions)) {
wrapper.in(ProjectCollection::getAreaCode, regions.stream().map(RegionDTO::getRegionCode).collect(Collectors.toList()));
}
}

collectionService.page(page,wrapper);
collectionService.page(page, wrapper);

if(CollUtil.isEmpty(page.getRecords())){
if (CollUtil.isEmpty(page.getRecords())) {
return PageVo.empty();
}

@@ -84,37 +86,38 @@ public class ProjectCollectionManage {
ProjectCollectionVO vo = BeanUtil.copyProperties(record, ProjectCollectionVO.class);
vo.setArea(regionCacheHelper.getDisplayName(record.getAreaCode(), RegionConst.RL_COUNTY));
return vo;
})
.collect(Collectors.toList());
}).collect(Collectors.toList());

return PageVo.of(res,page.getTotal());
return PageVo.of(res, page.getTotal());
}

/**
* 项目归集详情
* @param id
* @return
*
* @param id \
* @return \
*/
public ProjectCollectionVO detail(Long id) {
ProjectCollection projectCollection = collectionService.getById(id);

return BeanUtil.copyProperties(projectCollection,ProjectCollectionVO.class);
return BeanUtil.copyProperties(projectCollection, ProjectCollectionVO.class);
}

/**
* 保存
*
* @param dto
* @return
*/
public String save(ProjectCollectionSaveDTO dto) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();

ProjectCollection projectCollection = BeanUtil.copyProperties(dto,ProjectCollection.class);
if(Objects.nonNull(dto.getId())){
ProjectCollection projectCollection = BeanUtil.copyProperties(dto, ProjectCollection.class);
if (Objects.nonNull(dto.getId())) {
ProjectCollection old = collectionService.getById(dto.getId());
VUtils.isTrue(Objects.isNull(old)).throwMessage("该项目归集不存在!");
projectCollection.setId(dto.getId());
}else{
} else {
projectCollection.setProjectCode(generateProjectCodeUtil.generateProjectCode(projectCollection));
projectCollection.setCreateBy(user.getUsername());
projectCollection.setCreateOn(LocalDateTime.now());
@@ -122,7 +125,7 @@ public class ProjectCollectionManage {

projectCollection.setUpdateBy(user.getUsername());
projectCollection.setUpdateOn(LocalDateTime.now());
if(collectionService.saveOrUpdate(projectCollection)){
if (collectionService.saveOrUpdate(projectCollection)) {
return BizConst.SAVE_SUCCESS;
}
return BizConst.SAVE_FAIL;
@@ -130,6 +133,7 @@ public class ProjectCollectionManage {

/**
* 删除
*
* @param id
* @return
*/
@@ -138,7 +142,7 @@ public class ProjectCollectionManage {

VUtils.isTrue(Objects.isNull(projectCollection)).throwMessage("该项目归集不存在 删除失败");

if(collectionService.removeById(id)){
if (collectionService.removeById(id)) {
return "删除成功";
}
return "删除失败";


+ 2
- 9
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectRenewalFundManage.java Прегледај датотеку

@@ -29,23 +29,18 @@ import com.hz.pm.api.gov.service.IGovBizProjectApplyService;
import com.hz.pm.api.gov.service.IGovBizProjectApproveService;
import com.hz.pm.api.gov.service.IGovBizProjectBaseinfoService;
import com.hz.pm.api.gov.service.IGovOperationProjectBaseinfoService;
import com.hz.pm.api.portrait.model.entity.ProjectTag;
import com.hz.pm.api.portrait.model.entity.Tag;
import com.hz.pm.api.projectdeclared.model.dto.ProjectRenewalDeclareExportDTO;
import com.hz.pm.api.projectdeclared.model.entity.PaymentPlan;
import com.hz.pm.api.projectdeclared.service.IPaymentPlanService;
import com.hz.pm.api.projectlib.enumeration.ProjectRenewalApprovalStatusEnum;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeEnum;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.helper.ProjectHelper;
import com.hz.pm.api.projectlib.helper.ProjectRenewwalFundHelper;
import com.hz.pm.api.projectlib.helper.ProjectRenewFundHelper;
import com.hz.pm.api.projectlib.model.dto.ProjectRenewalExportDTO;
import com.hz.pm.api.projectlib.model.dto.ProjectRenewalFundDeclarationDTO;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.hz.pm.api.projectlib.model.po.ProjectRenewalFundDeclarationPO;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.req.ProjectRenewalAuditReq;
import com.hz.pm.api.projectlib.model.req.ProjectRenewalListReq;
import com.hz.pm.api.projectlib.model.vo.AnnualAmountVO;
@@ -54,8 +49,6 @@ import com.hz.pm.api.projectlib.model.vo.ProjectRenewalFundDeclarationVO;
import com.hz.pm.api.projectlib.service.IProjectRenewalFundDeclarationService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.auth.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.wflow.exception.BusinessException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -121,7 +114,7 @@ public class ProjectRenewalFundManage {
}

public PageVo<ProjectLibListItemVO> projectlist(ProjectRenewalListReq req, UserFullInfoDTO user) {
LambdaQueryWrapper<Project> query = ProjectRenewwalFundHelper.projectQuery(req);
LambdaQueryWrapper<Project> query = ProjectRenewFundHelper.projectQuery(req);
//项目查最新
query.eq(Project::getNewest, Boolean.TRUE);
//自己单位


+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectCollectionSaveDTO.java Прегледај датотеку

@@ -7,7 +7,6 @@ import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Objects;
import java.util.Optional;



+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java Прегледај датотеку

@@ -2,7 +2,6 @@ package com.hz.pm.api.projectlib.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hz.pm.api.common.compare.Compare;
import com.hz.pm.api.performance.model.dto.ProjectCoreBusinessDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;


+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/ProjectApprovedReq.java Прегледај датотеку

@@ -10,7 +10,6 @@ import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**


+ 2
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java Прегледај датотеку

@@ -12,10 +12,9 @@ import com.hz.pm.api.projectdeclared.model.vo.OperationVO;
import com.hz.pm.api.projectdeclared.model.vo.PreInsAcceptancePersonVO;
import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeEnum;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.safety.model.vo.SafetyMonitorVO;
import com.hz.pm.api.todocenter.model.vo.ProcessProgressDetailVo;
import com.hz.pm.api.todocenter.model.vo.ProcessProgressDetailVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -431,7 +430,7 @@ public class ProjectDetailVO {
private String countrySealNo;

@ApiModelProperty("审批详情")
private ProcessProgressDetailVo process;
private ProcessProgressDetailVO process;

@ApiModelProperty("标签")
private List<TagVO> tags;


+ 1
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/impl/ProjectApplicationServiceImpl.java Прегледај датотеку

@@ -34,9 +34,8 @@ public class ProjectApplicationServiceImpl extends ServiceImpl<ProjectApplicatio

@Override
public List<ProjectApplication> getApplicationsByProject(Project project) {
List<ProjectApplication> apps = this.list(Wrappers.lambdaQuery(ProjectApplication.class)
return this.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectCode, project.getProjectCode()));
return apps;
}

@Override


+ 12
- 16
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/utils/ProjectVersionUtil.java Прегледај датотеку

@@ -2,26 +2,21 @@ package com.hz.pm.api.projectlib.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.CollUtils;
import com.hz.pm.api.common.constant.CommonConst;
import com.hz.pm.api.projectlib.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.ningdatech.basic.exception.BizException;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessHandlerEnum;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import liquibase.pro.packaged.I;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -43,22 +38,23 @@ public class ProjectVersionUtil {

/**
* 根据最新的项目ID获取临近项目版本的审核记录信息
*
* @param projectId
* @return
*/
public ProcessProgressVo getPreVerProcessInfo(Long projectId, InstTypeEnum instTypeEnum){
public ProcessProgressVo getPreVerProcessInfo(Long projectId, InstTypeEnum instTypeEnum) {
Project project = projectService.getById(projectId);
if (Objects.isNull(project)){
if (Objects.isNull(project)) {
throw new BizException("当前项目不存在!");
}
String projectCode = project.getProjectCode();
if (StringUtils.isEmpty(projectCode)){
if (StringUtils.isEmpty(projectCode)) {
throw new BizException("当前项目编号为空!");
}
// 获取相同项目编号的项目
List<Project> projectList = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectCode, projectCode));
if (projectList.size() < CommonConst.VERSION_SIZE){
if (projectList.size() < CommonConst.VERSION_SIZE) {
throw new BizException("未发现该项目的历史版本!");
}

@@ -66,16 +62,16 @@ public class ProjectVersionUtil {
for (Project preProject : projectList) {
// 从项目流程实例关联表中查出实例详情
List<ProjectInst> projectInstList = projectInstService
.list(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getProjectId, preProject.getId())
.eq(ProjectInst::getInstType, instTypeEnum.getCode()));
.list(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getProjectId, preProject.getId())
.eq(ProjectInst::getInstType, instTypeEnum.getCode()));
if (CollUtil.isNotEmpty(projectInstList)) {
List<ProcessProgressVo> processProgressVoList = projectInstList.stream()
.map(p -> processInstanceService.getProgressInstanceDetail(null, p.getInstCode()))
.collect(Collectors.toList());
.map(p -> processInstanceService.getProgressInstanceDetail(null, p.getInstCode()))
.collect(Collectors.toList());
// 筛选出上个版本该类型审核流程通过的流程详情
List<ProcessProgressVo> instanceDetailList = processProgressVoList.stream()
.filter(p -> ProcessStatusEnum.APPROVED.getDesc().equals(p.getStatus()))
.collect(Collectors.toList());
.filter(p -> ProcessStatusEnum.APPROVED.getDesc().equals(p.getStatus()))
.collect(Collectors.toList());
if (CollUtil.isNotEmpty(instanceDetailList)) {
// 获取最后一个流程详情
return instanceDetailList.get(instanceDetailList.size() - 1);


+ 11
- 7
hz-pm-api/src/main/java/com/hz/pm/api/provincial/controller/TestController.java Прегледај датотеку

@@ -6,8 +6,12 @@ import com.hz.pm.api.provincial.model.res.SjApiResponse;
import com.hz.pm.api.provincial.service.IJoinReviewProvincialBureauService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.io.IOException;
@@ -19,6 +23,7 @@ import java.io.InputStream;
* @Date 2023/3/2 15:08
* @Author PoffyZhang
*/
@Slf4j
@RestController
@RequestMapping("/api/v1/test")
@Api(tags = "测试省局接口")
@@ -32,7 +37,7 @@ public class TestController {

@GetMapping("/push")
@ApiOperation("测试推送")
private Boolean push(@Valid @RequestParam Long projectId){
public Boolean push(@Valid @RequestParam Long projectId) {
Project project = new Project();
project.setId(projectId);
return provincialDeptManage.startTheProcess(project);
@@ -40,22 +45,21 @@ public class TestController {

@GetMapping("/detail")
@ApiOperation("测试获取详情")
private SjApiResponse detail(@RequestParam String projectId){
public SjApiResponse detail(@RequestParam String projectId) {
return joinReviewProvincialBureauService.processInfo(projectId);
}

@GetMapping("/path")
@ApiOperation("测试获取详情")
private String path() throws IOException {
public String path() throws IOException {
// String template = ResourceUtil.getResource("template").getPath();
// return template;

InputStream in = this.getClass().getResourceAsStream("/template/simsun.ttc");
StringBuilder sb = new StringBuilder();
int n;
while ((n=in.read())!=-1){
sb.append((char)n);
System.out.print((char)n);
while ((n = in.read()) != -1) {
sb.append((char) n);
}

return sb.toString();


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvinceApiResponse.java Прегледај датотеку

@@ -66,7 +66,7 @@ public class ProvinceApiResponse<T> implements Serializable {
* @return ApiResponse
*/
public static <T> ProvinceApiResponse<T> of(Integer code, String message, T data) {
return new ProvinceApiResponse<T>(code, message, data);
return new ProvinceApiResponse<>(code, message, data);
}

/**


+ 2
- 4
hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialApplicationDTO.java Прегледај датотеку

@@ -2,10 +2,8 @@ package com.hz.pm.api.provincial.model.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;
@@ -18,7 +16,7 @@ import java.util.List;
*/
@Data
@Builder
@ApiModel(value = "ProvincialApplicationDTO", description = "")
@ApiModel(value = "ProvincialApplicationDTO")
public class ProvincialApplicationDTO implements Serializable {


@@ -91,7 +89,7 @@ public class ProvincialApplicationDTO implements Serializable {

@Builder
@Data
@JsonIgnoreProperties(value = { "handler"})
@JsonIgnoreProperties(value = {"handler"})
public static class Cloud implements Serializable {
//云资源台数 11
private Integer cloudNums;


+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialProjectRes.java Прегледај датотеку

@@ -1,6 +1,5 @@
package com.hz.pm.api.provincial.model.res;

import com.hz.pm.api.provincial.model.dto.ProvincialApplicationDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;


+ 43
- 44
hz-pm-api/src/main/java/com/hz/pm/api/safety/manage/SafetyRiskManage.java Прегледај датотеку

@@ -6,13 +6,8 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.constant.RegionConst;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
@@ -27,6 +22,10 @@ import com.hz.pm.api.safety.service.IPersonSafetyInfoService;
import com.hz.pm.api.safety.service.ISupplierSafetyQualificationService;
import com.hz.pm.api.user.security.auth.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -58,51 +57,53 @@ public class SafetyRiskManage {

/**
* 列表
*
* @param req
* @return
*/
public PageVo<ProjectMonitorVO> personMonitorList(ProjectListReq req) {
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, Boolean.TRUE)
.eq(StringUtils.isNotBlank(req.getRegionCode()),Project::getAreaCode,req.getRegionCode())
.like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName())
.eq(StringUtils.isNotBlank(req.getRegionCode()), Project::getAreaCode, req.getRegionCode())
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrgName()), Project::getBuildOrgName, req.getBuildOrgName())
.orderByDesc(Project::getUpdateOn);
checkAuth(query,LoginUserUtil.loginUserDetail());
checkAuth(query, LoginUserUtil.loginUserDetail());
Page<Project> page = projectService.page(req.page(), query);
long total;
if ((total = page.getTotal()) == 0) {
return PageVo.empty();
}
List<ProjectMonitorVO> records = CollUtils.convert(page.getRecords(),
p -> BeanUtil.copyProperties(p,ProjectMonitorVO.class));
p -> BeanUtil.copyProperties(p, ProjectMonitorVO.class));
return PageVo.of(records, total);
}

/**
* 权限控制
*
* @param query
* @param user
*/
private void checkAuth(LambdaQueryWrapper<Project> query, UserInfoDetails user) {
//如果是超管
if(user.getSuperAdmin()){
if (user.getSuperAdmin()) {
log.info(user.getUsername() + " 是超管,可以看所有项目");
}else if(user.getRegionAdmin()){
} else if (user.getRegionAdmin()) {
//如果是区域管理员
log.info(user.getUsername() + " 是区管,可以看本区域" + user.getRegionCode() + "项目");
if(!RegionConst.RC_LS.equals(user.getRegionCode())){
if (!RegionConst.RC_LS.equals(user.getRegionCode())) {
//不是丽水市本级的话 就只看 自己区域的
query.eq(Project::getAreaCode,user.getRegionCode());
query.eq(Project::getAreaCode, user.getRegionCode());
}
//如果是市本级 就能看所有的
}else if(user.getIsOrgAdmin()){
} else if (user.getIsOrgAdmin()) {
//单位管理员
log.info(user.getUsername() + " 是单位管理员,可以看单位 " + user.getEmpPosUnitName() + " 项目");
query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode());
}else{
query.eq(Project::getBuildOrgCode, user.getEmpPosUnitCode());
} else {
//其它角色全都看不见
query.eq(Project::getId,0L);
query.eq(Project::getId, 0L);
}
}

@@ -113,13 +114,13 @@ public class SafetyRiskManage {
.eq(Project::getProjectCode, projectCode)
.last(BizConst.LIMIT_1));

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

List<SupplierSafetyQualification> ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class)
.eq(SupplierSafetyQualification::getProjectCode, projectCode));
if(CollUtil.isNotEmpty(ssq)){
if (CollUtil.isNotEmpty(ssq)) {
vo.setSupplierSafetyQualification(ssq.stream()
.map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class))
.collect(Collectors.toList()));
@@ -127,7 +128,7 @@ public class SafetyRiskManage {

List<PersonSafetyInfo> psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class)
.eq(PersonSafetyInfo::getProjectCode, projectCode));
if(CollUtil.isNotEmpty(psi)){
if (CollUtil.isNotEmpty(psi)) {
vo.setPersonSafetyInfo(psi.stream()
.map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class))
.collect(Collectors.toList()));
@@ -139,20 +140,17 @@ public class SafetyRiskManage {

EqualProtectionVO equalProtectionVO = new EqualProtectionVO();

if(CollUtil.isNotEmpty(apps)){
Integer maxPassWordGrade = 0;
Integer maxSecerecyGrade = 0;
for(ProjectApplication app : apps) {
maxPassWordGrade = Math.max(maxPassWordGrade,app.getPasswordGrade());
maxSecerecyGrade = Math.max(maxSecerecyGrade,app.getSecrecyGrade());
if (CollUtil.isNotEmpty(apps)) {
int maxPassWordGrade = 0;
int maxSecerecyGrade = 0;
for (ProjectApplication app : apps) {
maxPassWordGrade = Math.max(maxPassWordGrade, app.getPasswordGrade());
maxSecerecyGrade = Math.max(maxSecerecyGrade, app.getSecrecyGrade());
}

equalProtectionVO.setPasswordGrade(maxPassWordGrade);
equalProtectionVO.setSecrecyGrade(maxSecerecyGrade);
}

vo.setEqualProtection(equalProtectionVO);

return vo;
}

@@ -162,25 +160,26 @@ public class SafetyRiskManage {

/**
* 保存 供应商安全资质
* @param dtos
* @return
*
* @param dtos \
* @return \
*/
public String supplierSafetyQualificationSave(List<SupplierSafetyQualificationDTO> dtos) {
if(CollUtil.isEmpty(dtos)){
if (CollUtil.isEmpty(dtos)) {
return "数据为空";
}

UserInfoDetails user = LoginUserUtil.loginUserDetail();

String projectCode = dtos.get(0).getProjectCode();
if(StringUtils.isBlank(projectCode)){
if (StringUtils.isBlank(projectCode)) {
throw new BizException("参数有误!");
}
supplierSafetyQualificationService.remove(Wrappers.lambdaQuery(SupplierSafetyQualification.class)
.eq(SupplierSafetyQualification::getProjectCode, projectCode));

Integer sucessNum = 0;
for(SupplierSafetyQualificationDTO dto : dtos){
int sucessNum = 0;
for (SupplierSafetyQualificationDTO dto : dtos) {
projectCode = dto.getProjectCode();
Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, Boolean.TRUE)
@@ -195,8 +194,8 @@ public class SafetyRiskManage {
entity.setProjectId(project.getId());
entity.setUpdateBy(user.getUsername());
entity.setUpdateOn(LocalDateTime.now());
if(supplierSafetyQualificationService.save(entity)){
sucessNum ++;
if (supplierSafetyQualificationService.save(entity)) {
sucessNum++;
}
}

@@ -204,21 +203,21 @@ public class SafetyRiskManage {
}

public String personMonitorSave(List<PersonSafetyInfoDTO> dtos) {
if(CollUtil.isEmpty(dtos)){
if (CollUtil.isEmpty(dtos)) {
return "数据为空";
}

UserInfoDetails user = LoginUserUtil.loginUserDetail();

String projectCode = dtos.get(0).getProjectCode();
if(StringUtils.isBlank(projectCode)){
if (StringUtils.isBlank(projectCode)) {
throw new BizException("参数有误!");
}
personSafetyInfoService.remove(Wrappers.lambdaQuery(PersonSafetyInfo.class)
.eq(PersonSafetyInfo::getProjectCode, projectCode));

Integer sucessNum = 0;
for(PersonSafetyInfoDTO dto : dtos){
int sucessNum = 0;
for (PersonSafetyInfoDTO dto : dtos) {
projectCode = dto.getProjectCode();
Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, Boolean.TRUE)
@@ -233,8 +232,8 @@ public class SafetyRiskManage {
entity.setProjectId(project.getId());
entity.setUpdateBy(user.getUsername());
entity.setUpdateOn(LocalDateTime.now());
if(personSafetyInfoService.save(entity)){
sucessNum ++;
if (personSafetyInfoService.save(entity)) {
sucessNum++;
}
}



+ 12
- 13
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/CcTaskListener.java Прегледај датотеку

@@ -2,8 +2,6 @@ package com.hz.pm.api.scheduler.listener;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.cache.model.cache.CacheKey;
import com.ningdatech.cache.repository.CachePlusOps;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.projectlib.model.entity.Project;
@@ -13,6 +11,8 @@ import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.staging.enums.MsgTypeEnum;
import com.hz.pm.api.sys.manage.NoticeManage;
import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.cache.model.cache.CacheKey;
import com.ningdatech.cache.repository.CachePlusOps;
import com.wflow.bean.entity.WflowCcTasks;
import com.wflow.service.WflowCcTasksService;
import com.wflow.workflow.notify.event.CcTaskEvent;
@@ -23,16 +23,17 @@ import org.flowable.engine.history.HistoricProcessInstance;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

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

import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.CC_MSG_TEMPLATE;

/**
* 抄送事件 事件监听
*
* @author ZPF
* @return
* @since 2023/04/14 14:19
*/
@Slf4j
@@ -59,9 +60,7 @@ public class CcTaskListener {
public void onApplicationEvent(CcTaskEvent event) throws InterruptedException {
log.info("进入抄送人任务 事件监听!{}", JSON.toJSONString(event));
String instCode = event.getInstCode();
String processDefinitionId = event.getProcessDefinitionId();
String nodeId = event.getNodeId();
String taskId = event.getTaskId();

//这里 redis 处理一下 1分钟处理同一 nodeId 一次
if (cachePlusOps.get(NODE + nodeId + DUP_KEY) != null) {
@@ -78,7 +77,7 @@ public class CcTaskListener {
//睡3秒 让数据库 生成抄送数据先
Thread.sleep(3000);

log.info("instCode :{},nodeId :{}",instCode, nodeId);
log.info("instCode :{},nodeId :{}", instCode, nodeId);
//1.去查找 项目实例关系表
List<WflowCcTasks> tasks = ccTasksService.list(Wrappers.lambdaQuery(WflowCcTasks.class)
.eq(WflowCcTasks::getInstanceId, instCode)
@@ -88,25 +87,25 @@ public class CcTaskListener {
return;
}

log.info("tasks :{}",tasks.size());
log.info("tasks :{}", tasks.size());

//有可能 一个节点 有多个用户抄送
tasks.stream().forEach(task -> {
log.info("cc tasks :{}",JSON.toJSONString(tasks));
tasks.forEach(task -> {
log.info("cc tasks :{}", JSON.toJSONString(tasks));

HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery()
.processInstanceId(instCode)
.singleResult();

log.info("instance :{}",JSON.toJSONString(instance));
log.info("instance :{}", JSON.toJSONString(instance));

ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getInstCode, instCode)
.last(BizConst.LIMIT_1));

log.info("projectInst :{}",JSON.toJSONString(projectInst));
log.info("projectInst :{}", JSON.toJSONString(projectInst));

if(Objects.isNull(projectInst) || Objects.isNull(instance)){
if (Objects.isNull(projectInst) || Objects.isNull(instance)) {
return;
}
Long projectId = projectInst.getProjectId();
@@ -115,7 +114,7 @@ public class CcTaskListener {
UserFullInfoDTO user = userInfoHelper.getUserFullInfoByEmployeeCode(task.getUserId());

//发送消息
noticeManage.sendNotice(task.getUserId(),Objects.nonNull(user)? user.getUserId() : 93L,project,instance.getProcessDefinitionName(),
noticeManage.sendNotice(task.getUserId(), Objects.nonNull(user) ? user.getUserId() : 93L, project, instance.getProcessDefinitionName(),
CC_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_CC);
});
}

+ 3
- 1
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessStartListener.java Прегледај датотеку

@@ -8,6 +8,7 @@ import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.ningdatech.basic.exception.BizException;
import com.wflow.workflow.notify.event.ProcessStartEvent;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -54,7 +55,8 @@ public class ProcessStartListener {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
log.error("流程开起异常:", e);
Thread.currentThread().interrupt();
}

//1.去查找 项目实例关系表


+ 11
- 11
hz-pm-api/src/main/java/com/hz/pm/api/staging/service/impl/ProjectStagingServiceImpl.java Прегледај датотеку

@@ -15,7 +15,7 @@ import java.time.LocalDateTime;

/**
* <p>
* 服务实现类
* 服务实现类
* </p>
*
* @author zpf
@@ -28,15 +28,14 @@ public class ProjectStagingServiceImpl extends ServiceImpl<ProjectStagingMapper,

private final ProjectStagingMapper mapper;

private final ProjectStatusFlowUtil projectStatusFlowUtil;

/**
* 在某些状态节点 增加一个项目到状态暂存库
*
* @param project
* @return
*/
@Override
public Boolean addByProject(Project project,String remark) {
public Boolean addByProject(Project project, String remark) {
ProjectStaging projectStaging = ProjectStaging.builder()
.projectId(project.getId())
.projectName(project.getProjectName())
@@ -55,23 +54,24 @@ public class ProjectStagingServiceImpl extends ServiceImpl<ProjectStagingMapper,

/**
* 增加 重试次数 和下次扫描时间
* @param projectStaging
* @return
*
* @param projectStaging \
* @return \
*/
@Override
public Boolean addRetryTimes(ProjectStaging projectStaging) {
Integer retryTimes = projectStaging.getRetryTimes() + 1;
if(!projectStatusFlowUtil.intervalTimeMap.containsKey(projectStaging.getRetryTimes())){
Integer intervalSeconds = ProjectStatusFlowUtil.get(retryTimes);
if (intervalSeconds == null) {
log.info("没有对应重试间隔时间 添加重试信息失败");
return Boolean.FALSE;
}
Integer addSeconds = projectStatusFlowUtil.intervalTimeMap.get(projectStaging.getRetryTimes());
Boolean dead = Boolean.FALSE;
//超过重试最大次数 dead置为 true
if(retryTimes.compareTo(StagingContant.Retry.MAX_RETRY_TIMES) > 0){
if (retryTimes.compareTo(StagingContant.Retry.MAX_RETRY_TIMES) > 0) {
dead = Boolean.TRUE;
}
LocalDateTime nextRetryTime = LocalDateTime.now().plusSeconds(addSeconds);
return mapper.addRetryTimes(projectStaging.getId(),retryTimes,nextRetryTime,dead);
LocalDateTime nextRetryTime = LocalDateTime.now().plusSeconds(intervalSeconds);
return mapper.addRetryTimes(projectStaging.getId(), retryTimes, nextRetryTime, dead);
}
}

+ 2
- 5
hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java Прегледај датотеку

@@ -1,16 +1,13 @@
package com.hz.pm.api.staging.utils;

import com.google.common.collect.Maps;
import com.hz.pm.api.projectdeclared.manage.*;
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.hz.pm.api.projectdeclared.manage.ReviewByDeptJointManage;
import com.hz.pm.api.projectdeclared.manage.ReviewByProvincialDeptManage;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.staging.model.entity.ProjectStaging;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Map;
import java.util.function.Function;



+ 25
- 27
hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowUtil.java Прегледај датотеку

@@ -1,16 +1,9 @@
package com.hz.pm.api.staging.utils;

import com.google.common.collect.Maps;
import com.hz.pm.api.projectdeclared.manage.ReviewByDeptJointManage;
import com.hz.pm.api.projectdeclared.manage.ReviewByProvincialDeptManage;
import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.entity.Project;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;

/**
* @Classname ProjectStatusFlowMapUtil
@@ -18,30 +11,35 @@ import java.util.function.Function;
* @Date 2023/2/15 11:19
* @Author PoffyZhang
*/
@Component
public class ProjectStatusFlowUtil {
/**
* key 重试的次数 , value 是增加是描述
*/
public Map<Integer, Integer> intervalTimeMap = Maps.newHashMap();
private static final Map<Integer, Integer> INTERVAL_TIME_MAP;

/**
* 初始化业务分派逻辑,代替了if-else部分
* key: 枚举 状态值
* value: lambda表达式,最终会获取发起实例的函数
/*
* 初始化业务分派逻辑,代替了if-else部分
* key: 枚举 状态值
* value: lambda表达式,最终会获取发起实例的函数
*/
public ProjectStatusFlowUtil(){
intervalTimeMap.put(0,60);
intervalTimeMap.put(1,60 * 2);
intervalTimeMap.put(2,60 * 6);
intervalTimeMap.put(3,60 * 15);
intervalTimeMap.put(4,60 * 30);
intervalTimeMap.put(5,60 * 60);
intervalTimeMap.put(6,60 * 60 * 2);
intervalTimeMap.put(7,60 * 60 * 5);
intervalTimeMap.put(8,60 * 60 * 12);
intervalTimeMap.put(9,60 * 60 * 24);
intervalTimeMap.put(10,60 * 60 * 72);
intervalTimeMap.put(11,60 * 60 * 216);
static {
INTERVAL_TIME_MAP = new HashMap<>(16);
INTERVAL_TIME_MAP.put(0, 60);
INTERVAL_TIME_MAP.put(1, 60 * 2);
INTERVAL_TIME_MAP.put(2, 60 * 6);
INTERVAL_TIME_MAP.put(3, 60 * 15);
INTERVAL_TIME_MAP.put(4, 60 * 30);
INTERVAL_TIME_MAP.put(5, 60 * 60);
INTERVAL_TIME_MAP.put(6, 60 * 60 * 2);
INTERVAL_TIME_MAP.put(7, 60 * 60 * 5);
INTERVAL_TIME_MAP.put(8, 60 * 60 * 12);
INTERVAL_TIME_MAP.put(9, 60 * 60 * 24);
INTERVAL_TIME_MAP.put(10, 60 * 60 * 72);
INTERVAL_TIME_MAP.put(11, 60 * 60 * 216);
}

public static Integer get(Integer interval) {
return INTERVAL_TIME_MAP.get(interval);
}

}

+ 4
- 3
hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/UserGuidanceController.java Прегледај датотеку

@@ -9,9 +9,10 @@ import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @Classname UserGuidanceController


+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/Region.java Прегледај датотеку

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

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

/**
* <p>


+ 3
- 4
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/controller/TodoCenterController.java Прегледај датотеку

@@ -18,7 +18,7 @@ import com.hz.pm.api.todocenter.model.dto.SealInfoDTO;
import com.hz.pm.api.todocenter.model.req.ProcessDetailReq;
import com.hz.pm.api.todocenter.model.req.ToBeProcessedExportReq;
import com.hz.pm.api.todocenter.model.req.ToBeProcessedReq;
import com.hz.pm.api.todocenter.model.vo.ProcessProgressDetailVo;
import com.hz.pm.api.todocenter.model.vo.ProcessProgressDetailVO;
import com.hz.pm.api.todocenter.model.vo.ResToBeProcessedVO;
import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO;

@@ -80,7 +80,7 @@ public class TodoCenterController {
* @return 流程进度及表单详情
*/
@GetMapping("/progress/detail")
public ProcessProgressDetailVo getProcessDetail(@Valid @ModelAttribute ProcessDetailReq request) {
public ProcessProgressDetailVO getProcessDetail(@Valid @ModelAttribute ProcessDetailReq request) {
return todoCenterManage.getProcessDetail(request);
}

@@ -92,8 +92,7 @@ public class TodoCenterController {
@PostMapping("/handler")
@WebLog("审核通过,盖章并通过、退回、撤回、驳回等操作")
public Object handler(@Valid @RequestBody ReqProcessHandlerDTO param) {
String nextTaskId = todoCenterManage.handler(param);
return nextTaskId;
return todoCenterManage.handler(param);
}

/**


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/handle/PassHandle.java Прегледај датотеку

@@ -1,7 +1,7 @@
package com.hz.pm.api.todocenter.handle;

import cn.hutool.core.collection.CollUtil;
import com.hz.pm.api.todocenter.model.vo.ProcessProgressDetailVo;
import com.hz.pm.api.todocenter.model.vo.ProcessProgressDetailVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -29,7 +29,7 @@ public class PassHandle {
* @param employeeCode
* @return
*/
public void checkCanPassOrSeal(String instanceId,String taskId,String employeeCode, ProcessProgressDetailVo res) {
public void checkCanPassOrSeal(String instanceId,String taskId,String employeeCode, ProcessProgressDetailVO res) {

List<ActivityInstance> activities = runtimeService.createActivityInstanceQuery()
.taskAssignee(employeeCode)


+ 20
- 21
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java Прегледај датотеку

@@ -13,15 +13,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.file.entity.File;
import com.ningdatech.file.entity.vo.result.FileResultVO;
import com.ningdatech.file.service.FileService;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.constant.CommonConst;
import com.hz.pm.api.common.constant.RegionConst;
@@ -31,7 +22,6 @@ import com.hz.pm.api.common.model.entity.ExcelExportWriter;
import com.hz.pm.api.common.util.BizUtils;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.irs.sign.IRSAPIRequest;
import com.hz.pm.api.performance.service.IProjectCoreBusinessIndicatorsService;
import com.hz.pm.api.projectdeclared.manage.DefaultDeclaredProjectManage;
import com.hz.pm.api.projectlib.enumeration.*;
import com.hz.pm.api.projectlib.manage.ProjectLibManage;
@@ -69,6 +59,15 @@ import com.hz.pm.api.todocenter.utils.PdfUtils;
import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.auth.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.file.entity.File;
import com.ningdatech.file.entity.vo.result.FileResultVO;
import com.ningdatech.file.service.FileService;
import com.wflow.contants.HisProInsEndActId;
import com.wflow.contants.ProcessConstant;
import com.wflow.exception.BusinessException;
@@ -93,7 +92,6 @@ import org.flowable.bpmn.model.FlowElementsContainer;
import org.flowable.bpmn.model.SubProcess;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.task.api.Task;
@@ -105,6 +103,7 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import sun.misc.BASE64Decoder;

import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -286,7 +285,7 @@ public class TodoCenterManage {
ProjectListReq projectListReq = new ProjectListReq();
BeanUtils.copyProperties(param, projectListReq);
List<Project> projects = projectLibManage.projectList(projectListReq);
if(StringUtils.isBlank(employeeCode)){
if (StringUtils.isBlank(employeeCode)) {
projects = Collections.emptyList();
}
if (CollUtil.isNotEmpty(projects)) {
@@ -553,7 +552,7 @@ public class TodoCenterManage {
* @param request 请求参数
* @return 流程进度及表单详情
*/
public ProcessProgressDetailVo getProcessDetail(ProcessDetailReq request) {
public ProcessProgressDetailVO getProcessDetail(ProcessDetailReq request) {
String employeeCode = LoginUserUtil.loginUserDetail().getEmployeeCode();
String instanceId = request.getInstanceId();
String nodeId = request.getNodeId();
@@ -575,13 +574,13 @@ public class TodoCenterManage {
buildUserUtils.buildUserByProcessInfo(progressInfo);
isHighLine = checkHighLine(progressInfo, taskId, LoginUserUtil.loginUserDetail());
}
ProcessProgressDetailVo res = new ProcessProgressDetailVo();
if(Objects.nonNull(projectInst)){
ProcessProgressDetailVO res = new ProcessProgressDetailVO();
if (Objects.nonNull(projectInst)) {
Long projectIdThis = projectInst.getProjectId();
Project project = projectService.getById(projectIdThis);
res.setProjectCode(project.getProjectCode());
res.setProjectId(projectInst.getProjectId());
}else{
} else {
res.setProjectId(request.getProjectId());
}
res.setProcessProgressVo(progressInstanceDetail);
@@ -596,11 +595,11 @@ public class TodoCenterManage {
}

private Boolean checkConstructionSuggestionsByNodeId(String taskId) {
if(StringUtils.isNotBlank(taskId)){
if (StringUtils.isNotBlank(taskId)) {
List<Task> tasks = taskService.createTaskQuery()
.taskId(taskId)
.orderByTaskId().desc().list();
if(CollUtil.isNotEmpty(tasks)){
if (CollUtil.isNotEmpty(tasks)) {
return tasks.get(0).getTaskDefinitionKey()
.endsWith(StrPool.DASH + ProcessConstant.Field.CONSTRUCTION);
}
@@ -811,7 +810,7 @@ public class TodoCenterManage {
// 获取登录用户浙政钉code
String employeeCode = userFullInfo.getEmployeeCode();

if(StringUtils.isBlank(employeeCode)){
if (StringUtils.isBlank(employeeCode)) {
return PageVo.empty();
}

@@ -896,8 +895,8 @@ public class TodoCenterManage {
List<ProcessInstanceVo> userSubmittedList = Lists.newArrayList();
Map<String, Project> projectInfoMap = Maps.newHashMap();

if(StringUtils.isBlank(employeeCode)){
projects = Collections.emptyList();
if (StringUtils.isBlank(employeeCode)) {
projects = Collections.emptyList();
}

if (CollUtil.isNotEmpty(projects)) {


hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/ProcessProgressDetailVo.java → hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/ProcessProgressDetailVO.java Прегледај датотеку

@@ -1,11 +1,8 @@
package com.hz.pm.api.todocenter.model.vo;


import com.wflow.workflow.bean.process.enums.NodeTypeEnum;
import com.wflow.workflow.bean.vo.ProcessProgressVo;

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

@@ -16,10 +13,9 @@ import lombok.NoArgsConstructor;
* @since 2023/01/30 17:21
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ProcessProgressDetailVo {
public class ProcessProgressDetailVO {

/**
* 流程处理详情

+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/TodoNumVO.java Прегледај датотеку

@@ -1,7 +1,6 @@
package com.hz.pm.api.todocenter.model.vo;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/ITodoService.java Прегледај датотеку

@@ -1,7 +1,7 @@
package com.hz.pm.api.todocenter.service;

import com.hz.pm.api.todocenter.model.req.ProcessDetailReq;
import com.hz.pm.api.todocenter.model.vo.ProcessProgressDetailVo;
import com.hz.pm.api.todocenter.model.vo.ProcessProgressDetailVO;

/**
* @Classname ITodoService
@@ -15,7 +15,7 @@ public interface ITodoService {
* @param request
* @return
*/
ProcessProgressDetailVo getProcessDetail(ProcessDetailReq request) ;
ProcessProgressDetailVO getProcessDetail(ProcessDetailReq request) ;

Boolean isChangeRecord(Long projectId) ;
}

Неке датотеке нису приказане због велике количине промена

Loading…
Откажи
Сачувај