diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/config/ProvincialProperties.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/config/ProvincialProperties.java index 34065ef..2c12cd9 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/config/ProvincialProperties.java +++ b/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 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/constant/RegionConst.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/constant/RegionConst.java index 0e44d21..dea5ee1 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/constant/RegionConst.java +++ b/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 LS_ARR = Lists.newArrayList(RC_LS,LS_KF,LD,QT,JY,SC,SY,YH,QY,QN,LQ); + List LS_ARR = Lists.newArrayList(RC_LS, LS_KF, LD, QT, JY, SC, SY, YH, QY, QN, LQ); //----------------------------------------地区父级ID(缩写PID)--------------------------------------------------------- diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/enumeration/ExportOptionEnum.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/enumeration/ExportOptionEnum.java index f51711d..b7fb20e 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/enumeration/ExportOptionEnum.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionLimitHelperImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionLimitHelperImpl.java index ea3d9a3..1d20bba 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionLimitHelperImpl.java +++ b/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 regionList = regionService.list(Wrappers.lambdaQuery(Region.class) .eq(Region::getRegionCode, regionCode) .orderByDesc(Region::getRegionLevel)); - Region region = regionList.get(0); Collection regionCodes = regionCache .listChildRegionCodeList(region.getRegionCode(), region.getRegionLevel()); RegionContainsBO regionContainsBO = new RegionContainsBO(); regionContainsBO.setContainsRegionCodeList(new ArrayList<>(regionCodes)); regionContainsBO.setParentRegionTreeLevel(region.getRegionLevel()); - - ArrayList regionContainsBOS = CollectionUtil.toList(regionContainsBO); - - return regionContainsBOS; + return CollectionUtil.toList(regionContainsBO); } - } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java index 4504921..a933c13 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/util/DictUtils.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/util/DictUtils.java index 4bc4d3f..5874fb6 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/util/DictUtils.java +++ b/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 list1, List list2) { if (CollUtil.isEmpty(list1) && CollUtil.isEmpty(list2)) { return true; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/util/Md5Utils.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/util/Md5Utils.java index a6a4bc0..ebb2039 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/util/Md5Utils.java +++ b/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) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/util/RefreshKeyUtil.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/util/RefreshKeyUtil.java index 39d5dbb..8d8a4fd 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/util/RefreshKeyUtil.java +++ b/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); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/util/RegionUtils.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/util/RegionUtils.java index 4397c6a..29f67a0 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/util/RegionUtils.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/handle/ProjectStatusHandler.java b/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/handle/ProjectStatusHandler.java index 62ab917..841e503 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/handle/ProjectStatusHandler.java +++ b/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 projects = projectService.list(Wrappers.lambdaQuery(Project.class) - .eq(Project::getProjectCode, projectCode)); - List ids = projects.stream().map(Project::getId).collect(Collectors.toList()); //查询 状态机流转的时间点 - ProjectStatusChange statusChange = statusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) - .eq(ProjectStatusChange::getBeforeStatus, beforeStatusCode) + LambdaQueryWrapper 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 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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ExpertStatisticsManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ExpertStatisticsManage.java index 228847a..830ee0b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ExpertStatisticsManage.java +++ b/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 experts) { + private void lastYearsCompleteExpert(ExpertStatisticsVO res, List experts) { List 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 experts) { + private void threeYearsCompleteExpert(ExpertStatisticsVO res, List experts) { List 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 experts,List intentionWorkRegions, - List expertTags,List tags,List expertDictionaries, + List experts, List intentionWorkRegions, + List expertTags, List tags, List expertDictionaries, Map 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 experts, - List expertDictionaries,Map dictionMap) { + List expertDictionaries, Map dictionMap) { List levels = Lists.newArrayList(); Set userSets = Sets.newHashSet(); @@ -213,9 +218,9 @@ public class ExpertStatisticsManage { Map> 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 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 experts, - List expertDictionaries,Map dictionMap) { + List expertDictionaries, Map dictionMap) { List types = Lists.newArrayList(); Set userSets = Sets.newHashSet(); @@ -246,18 +252,18 @@ public class ExpertStatisticsManage { Map> 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 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> typeDistribution = Maps.newHashMap(); + Map> typeDistribution = Maps.newHashMap(); Map> tagsMap = expertTags.stream().filter(e -> Objects.nonNull(e.getTagCode())) @@ -283,25 +289,26 @@ public class ExpertStatisticsManage { //1.省维度 List shengWeidu = Lists.newArrayList(); - for(String code : SHENGWEIDU){ + for (String code : SHENGWEIDU) { shengWeidu.add(getExpertData(expertUserFullInfoMap, tagsMap, tagNameMap, code)); } //2.市维度 List 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 expertUserFullInfoMap, Map> tagsMap, Map tagNameMap, String code) { int num = 0; - if(tagsMap.containsKey(code)){ + if (tagsMap.containsKey(code)) { List 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 intentionWorkRegions, Map expertMap, List regions) { List 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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ProjectCostStatisticsManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ProjectCostStatisticsManage.java index 541ea5e..a2d54ca 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ProjectCostStatisticsManage.java +++ b/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 yearMeetings = meetings.stream().filter(m -> { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/model/vo/ProtraitProjectInfoVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/model/vo/ProtraitProjectInfoVO.java index d0cc276..a723362 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/dashboard/model/vo/ProtraitProjectInfoVO.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/DictionaryAssembler.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/DictAssembler.java similarity index 93% rename from hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/DictionaryAssembler.java rename to hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/DictAssembler.java index 338e4ec..61752dc 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/DictionaryAssembler.java +++ b/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 toDictFieldInfoList(List expertDictList) { if (CollUtil.isEmpty(expertDictList)) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertUserInfoAssembler.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertUserInfoAssembler.java index 91953ca..5f2dde9 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertUserInfoAssembler.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertUserInfoAssembler.java @@ -423,11 +423,11 @@ public class ExpertUserInfoAssembler { List userExpertDictList = expertDictMap.getOrDefault(userId, Collections.emptyList()); Map> 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 expertTagList = Objects.isNull(expertTagMap.get(userId)) ? new ArrayList<>() : expertTagMap.get(userId); Map> 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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/RegionWrapperAssembler.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/RegionWrapperAssembler.java index 57a9c94..f707d2c 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/RegionWrapperAssembler.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/constant/ExpertUserInfoSensitiveFieldEnum.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/constant/ExpertUserInfoSensitiveFieldEnum.java index 03279f2..d6a01c9 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/constant/ExpertUserInfoSensitiveFieldEnum.java +++ b/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; } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ReviewTemplateSettingsController.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ReviewTemplateSettingsController.java index 3b35621..4d35a1a 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ReviewTemplateSettingsController.java +++ b/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.*; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertMetaApplyManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertMetaApplyManage.java index 7ee2c93..d7dc126 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertMetaApplyManage.java +++ b/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 applyStatusList = new ArrayList<>(); + List 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 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, diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertReviewManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertReviewManage.java index acaf708..1dd34fc 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertReviewManage.java +++ b/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 attachFileIds = CollUtils.fieldList(reviews, ExpertReview::getAttachFileId); Map fileMap = new HashMap<>(attachFileIds.size()); - if (attachFileIds.size() > 0) { + if (!attachFileIds.isEmpty()) { List 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); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ReviewTemplateVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ReviewTemplateVO.java index af5b74c..00b80ec 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ReviewTemplateVO.java +++ b/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; /** diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertAdminManageServiceImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertAdminManageServiceImpl.java index 943a4be..1d0b870 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertAdminManageServiceImpl.java +++ b/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 recordList = new ArrayList<>(); - if (userIdList.size() != 0) { + if (!userIdList.isEmpty()) { List currPageUserIdList = CollUtil.page(req.getPageNumber() - 1, req.getPageSize(), userIdList); List expertUserList = iExpertUserFullInfoService.listByUserIds(currPageUserIdList); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertReviewServiceImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertReviewServiceImpl.java index 6814635..6cddbbf 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertReviewServiceImpl.java +++ b/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 constructMeetings = meetingMapper.selectList(Wrappers.lambdaQuery(Meeting.class) + LambdaQueryWrapper mQuery = Wrappers.lambdaQuery(Meeting.class) .select(Meeting::getId) - .eq(Meeting::getType, meetingType)); + .eq(Meeting::getType, meetingType); + List constructMeetings = meetingMapper.selectList(mQuery); List 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 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); } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertUserFullInfoServiceImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertUserFullInfoServiceImpl.java index 8713311..ce11e53 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertUserFullInfoServiceImpl.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/DocumentationManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/DocumentationManage.java index 7f751ea..801b2ff 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/DocumentationManage.java +++ b/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 groupList() { List 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 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); } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/gov/convert/ProjectConvert.java b/hz-pm-api/src/main/java/com/hz/pm/api/gov/convert/ProjectConvert.java index 04fd41c..b75ba10 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/gov/convert/ProjectConvert.java +++ b/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 convertProcures(List procures) { - if(CollUtil.isEmpty(procures)){ + if (CollUtil.isEmpty(procures)) { return Collections.emptyList(); } List 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 convertProcuresVo(List procures) { - if(CollUtil.isEmpty(procures)){ + if (CollUtil.isEmpty(procures)) { return Collections.emptyList(); } List 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 convertProcuresVoWithConvertPdf(List 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; } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/gov/utils/ProjectCollectionUtil.java b/hz-pm-api/src/main/java/com/hz/pm/api/gov/utils/ProjectCollectionUtil.java index d809876..933bef1 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/gov/utils/ProjectCollectionUtil.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/irs/manage/AppIrsManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/irs/manage/AppIrsManage.java index 94e3e5e..0f479c3 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/irs/manage/AppIrsManage.java +++ b/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 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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/irs/model/dto/ApiDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/irs/model/dto/ApiDTO.java index ce1f4c7..64c9403 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/irs/model/dto/ApiDTO.java +++ b/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 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/irs/model/res/ApiResponse.java b/hz-pm-api/src/main/java/com/hz/pm/api/irs/model/res/ApiResponse.java index cd9222b..793b8ef 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/irs/model/res/ApiResponse.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/irs/model/res/ApiResponse.java @@ -68,7 +68,7 @@ public class ApiResponse implements Serializable { * @return ApiResponse */ public static ApiResponse of(Integer code, String message, T data,Boolean success) { - return new ApiResponse(code, message, data,success); + return new ApiResponse<>(code, message, data,success); } /** diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/irs/utils/RefreshTokenUtil.java b/hz-pm-api/src/main/java/com/hz/pm/api/irs/utils/RefreshTokenUtil.java index a9c8690..cb1f1ba 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/irs/utils/RefreshTokenUtil.java +++ b/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"; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/leave/manage/LeaveManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/leave/manage/LeaveManage.java index 45820a8..2bf9abf 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/leave/manage/LeaveManage.java +++ b/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 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 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 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 meetingIds = new ArrayList<>(), auditIds = new ArrayList<>(), fileIds = new ArrayList<>(); + List meetingIds = new ArrayList<>(); + List auditIds = new ArrayList<>(); + List 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 delete = Wrappers.lambdaQuery(ExpertLeaveDetail.class) .eq(ExpertLeaveDetail::getExpertLeaveId, leave.getId()); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ReviewProjectDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ReviewProjectDTO.java index eb2bad3..29d76f4 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ReviewProjectDTO.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertAttendSummaryVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertAttendStatVO.java similarity index 77% rename from hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertAttendSummaryVO.java rename to hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertAttendStatVO.java index 50c2e65..474c401 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertAttendSummaryVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertAttendStatVO.java @@ -5,16 +5,16 @@ import lombok.Data; /** *

- * ExpertAttendSummaryVo + * ExpertAttendStatVO *

* * @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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meta/controller/MetaDictionaryManageController.java b/hz-pm-api/src/main/java/com/hz/pm/api/meta/controller/MetaDictionaryManageController.java index ea36eaa..f223d46 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meta/controller/MetaDictionaryManageController.java +++ b/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 expertDictList(@RequestBody ReqDictionaryListPO request) { - DictionaryRequestValidator.dictionaryRequestValidator(request); + DictParamValidator.dictionaryRequestValidator(request); return metaManage.getDictionaryList(request); } @PostMapping("/common/list") @ApiOperation("通用字典筛选数据返回") public List commonDictList(@RequestBody ReqDictionaryListPO request) { - DictionaryRequestValidator.dictionaryRequestValidator(request); + DictParamValidator.dictionaryRequestValidator(request); return metaManage.commonDictList(request); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/ExpertUserInfoHelperImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/ExpertUserInfoHelperImpl.java index a787314..03ee775 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/ExpertUserInfoHelperImpl.java +++ b/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()); -// } - } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/impl/TagsCacheImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/impl/TagsCacheImpl.java index 1019aac..1dd8e26 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/impl/TagsCacheImpl.java +++ b/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 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; } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meta/validate/DictionaryRequestValidator.java b/hz-pm-api/src/main/java/com/hz/pm/api/meta/validate/DictParamValidator.java similarity index 50% rename from hz-pm-api/src/main/java/com/hz/pm/api/meta/validate/DictionaryRequestValidator.java rename to hz-pm-api/src/main/java/com/hz/pm/api/meta/validate/DictParamValidator.java index 732fccd..5dcc2af 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meta/validate/DictionaryRequestValidator.java +++ b/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 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 dictTypeList = req.getDictionaryTypeList(); + if (CollectionUtils.isNotEmpty(dictTypeList)) { + for (String dictType : dictTypeList) { + if (!DictExpertInfoTypeEnum.contains(dictType)) { + throw new BizException("无效的字典信息: " + dictType); } } } } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/organization/entity/OrganizationMainManageTag.java b/hz-pm-api/src/main/java/com/hz/pm/api/organization/entity/OrganizationMainManageTag.java index cf0000f..c8a2d32 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/organization/entity/OrganizationMainManageTag.java +++ b/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; /** *

- * + * *

* * @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 + - "}"; - } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/organization/service/impl/DingEmployeeInfoServiceImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/organization/service/impl/DingEmployeeInfoServiceImpl.java index a2e8489..be83d03 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/organization/service/impl/DingEmployeeInfoServiceImpl.java +++ b/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 getEmployeesOrgCodeList(List employeeCodeList) { if (CollUtil.isEmpty(employeeCodeList)) { - return new ArrayList<>(); + return Collections.emptyList(); } List dingEmployeeInfoList = this.list(Wrappers.lambdaQuery(DingEmployeeInfo.class).in(DingEmployeeInfo::getEmployeeCode, employeeCodeList)); - List 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 getEmployeeList(List employeeCodeList) { if (CollUtil.isEmpty(employeeCodeList)) { - return new ArrayList<>(); + return Collections.emptyList(); } - List dingEmployeeInfoList = this.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) + return list(Wrappers.lambdaQuery(DingEmployeeInfo.class) .in(DingEmployeeInfo::getEmployeeCode, employeeCodeList)); - return dingEmployeeInfoList; } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/controller/AppAppraisalController.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/controller/AppAppraisalController.java index 1ce30c5..f27cac4 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/controller/AppAppraisalController.java +++ b/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 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/controller/ReAppraisalController.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/controller/ReAppraisalController.java index a8b403b..891ffaa 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/controller/ReAppraisalController.java +++ b/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 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); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/ReAppraisalManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/ReAppraisalManage.java index 9cb228d..df1b6c6 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/ReAppraisalManage.java +++ b/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 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 paIds = paps.stream().map(PerformanceAppraisalProject::getAppraisalId).collect(Collectors.toSet()); @@ -114,7 +112,7 @@ public class ReAppraisalManage { List 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 page = req.page(); LambdaQueryWrapper 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 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 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 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 proCodeList = appraisalProjects.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList()); @@ -203,11 +201,11 @@ public class ReAppraisalManage { LambdaQueryWrapper 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 ids = appraisalInfoList.stream() .map(ProjectAppraisalInfoDTO::getProjectTemplateDetailId) @@ -253,7 +251,7 @@ public class ReAppraisalManage { // 查出项目模版详情信息 List detailList = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class) .in(PerformanceIndicatorProjectTemplateDetail::getId, ids)); - if (CollUtil.isEmpty(detailList)){ + if (CollUtil.isEmpty(detailList)) { throw new BizException("评价指标不存在!"); } Map 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 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 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 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) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/RectifyManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/RectifyManage.java index a3da2c1..c28a605 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/RectifyManage.java +++ b/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 userRoleList = user.getUserRoleList(); List 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 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 projectIds = projectLists.stream().map(Project::getId).collect(Collectors.toList()); // 获取添加过该单位项目的所有评价计划信息,且评价计划内包含有需要整改项目 List 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> 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 page = req.page(); LambdaQueryWrapper 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 projects = papsMap.get(p.getId()); List 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 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 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 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 projectCodes = - paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet()); + paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet()); Page page = req.page(); LambdaQueryWrapper 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 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 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 projectCodes = - paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet()); + paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet()); Page page = req.page(); LambdaQueryWrapper 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("该项目已被移除评价计划,请返回上一页或者刷新重试!"); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/AppAppraisalInfoDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/AppAppraisalInfoDTO.java index 056c670..a008414 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/AppAppraisalInfoDTO.java +++ b/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; + /** + *

* 应用评价信息 - * @return + *

+ * * @author CMM * @since 2023/08/08 18:46 */ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ProjectAppraisalDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ProjectAppraisalDTO.java index eceb038..ffd74cd 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ProjectAppraisalDTO.java +++ b/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 */ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ProjectAppraisalInfoDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ProjectAppraisalInfoDTO.java index dba3f5f..9e202b5 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ProjectAppraisalInfoDTO.java +++ b/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; /** * 项目评价信息 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ReAppraisalInfoDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ReAppraisalInfoDTO.java index 4bd70d3..d88cc02 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ReAppraisalInfoDTO.java +++ b/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 */ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ReAppraisalScoreExportDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ReAppraisalScoreExportDTO.java index 201e4e3..2433376 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/dto/ReAppraisalScoreExportDTO.java +++ b/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; } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/entity/ProjectCoreBusinessIndicators.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/entity/ProjectCoreBusinessIndicators.java index b21f1e4..b8d5e66 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/entity/ProjectCoreBusinessIndicators.java +++ b/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; /** *

@@ -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 { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppAppraisalIndexDetailVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppAppraisalIndexDetailVO.java index ea214a3..2524b69 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppAppraisalIndexDetailVO.java +++ b/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; + /** + *

* 应用评价指标 - * @return + *

+ * * @author CMM * @since 2023/08/08 8:55 */ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppBusinessIndexDetailVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppBusinessIndexDetailVO.java index 91187c8..f5521dd 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppBusinessIndexDetailVO.java +++ b/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; - /** + *

* AppIndexDetailVO - * @return + *

+ * * @author CMM * @since 2023/08/14 8:55 */ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppIndexDetailVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppIndexDetailVO.java index 8f25d76..7d40057 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppIndexDetailVO.java +++ b/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; - /** + *

* AppIndexDetailVO - * @return + *

+ * * @author CMM * @since 2023/08/14 8:55 */ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppIndexVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppIndexVO.java index 1a4dd88..1a50679 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/AppIndexVO.java +++ b/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 */ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/PerformanceAppraisalAppVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/PerformanceAppraisalAppVO.java index b6856f6..ac208f7 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/model/vo/PerformanceAppraisalAppVO.java +++ b/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 = "绩效评价应用对象") diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ProjectAdjustmentController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ProjectAdjustmentController.java index 503284b..e6ebb49 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ProjectAdjustmentController.java +++ b/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 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ReviewChecklistController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ReviewChecklistController.java index d641744..a0c9ddb 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ReviewChecklistController.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java index 0815904..6c23430 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectAdjustmentManage.java @@ -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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java index a83f664..fd9410b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByProvincialDeptManage.java @@ -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 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 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("提交省级部门联审失败"); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java index 2c79cc2..240cb6e 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewChecklistManage.java @@ -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 page = projectService.page(req.page(), query); - long total; if (CollUtil.isEmpty(page.getRecords())) { return PageVo.empty(); } @@ -90,17 +90,16 @@ public class ReviewChecklistManage { Map> approveMap = approves.stream().collect(Collectors.groupingBy(ReviewChecklistApprove::getProjectCode)); - List reviewHumans = Lists.newArrayList();; - if(BizConst.DEV.equals(active)){ + List reviewHumans; + if (BizConst.DEV.equals(active)) { reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZYD; - }else{ + } else { reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZZD; } List users = userInfoHelper.getUserFullInfoByEmployeeCodes(reviewHumans); Set userSet = Sets.newHashSet(); Map 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 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 reviewChecklistApproves, - Map userMap,UserInfoDetails user) { - List reviewHumans = Lists.newArrayList();; - if(BizConst.DEV.equals(active)){ + private String computeVerify(ProjectReviewCheckListItemVO item, List reviewChecklistApproves, + Map userMap, UserInfoDetails user) { + List 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 computeHumanSet = reviewHumans.stream().collect(Collectors.toSet()); - - if(CollUtil.isEmpty(reviewChecklistApproves)){ - item.setReviewCheckNotApprove(convertUser(userMap,computeHumanSet)); + Set 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 userMap, Set 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 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 reviewHumans = Lists.newArrayList();; - if(BizConst.DEV.equals(active)){ + List 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 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 reviewHumans = Lists.newArrayList();; - if(BizConst.DEV.equals(active)){ + List 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 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 dupTitle = approves.stream().filter(r -> titleSet.add(r.getTitle())) .collect(Collectors.toList()); - List 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 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 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 reviewHumans = Lists.newArrayList();; - if(BizConst.DEV.equals(active)){ + List reviewHumans; + if (BizConst.DEV.equals(active)) { reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZYD; - }else{ + } else { reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZZD; } - Set computeHumanSet = reviewHumans.stream().collect(Collectors.toSet()); - for(ReviewChecklistApprove approve : approves){ - if(computeHumanSet.contains(approve.getCreateByCode())){ - computeHumanSet.remove(approve.getCreateByCode()); - } + Set 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> 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 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 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 convertModulesFinal(List 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 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()); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/mapper/NdPiotTasksMapper.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/mapper/NdPiotTasksMapper.java index 520b5ab..fe7dabf 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/mapper/NdPiotTasksMapper.java +++ b/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; /** *

- * Mapper 接口 + * Mapper 接口 *

* * @author zpf diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java index 877eba7..8a0e1ac 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java +++ b/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; /** diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ContractVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ContractVO.java index 36e7a37..9753cf9 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ContractVO.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/DelayedApplyVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/DelayedApplyVO.java index 57636a3..9139dba 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/DelayedApplyVO.java +++ b/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; /** diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ReviewCheckInfoVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ReviewCheckInfoVO.java index 2fe8149..8d7d99f 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ReviewCheckInfoVO.java +++ b/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 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/constant/ProjectConstant.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/constant/ProjectConstant.java index cdf9144..62ef272 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/constant/ProjectConstant.java +++ b/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"; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/DeptUnitedReviewHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/DeptUnitedReviewHandle.java index 7fd6505..967b84c 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/DeptUnitedReviewHandle.java +++ b/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); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProcessExecuteChainHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProcessExecuteChainHandle.java index 2a1303c..987685d 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProcessExecuteChainHandle.java +++ b/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 handle(Long projectId, List processSchedule){ + public List handle(Long projectId, List processSchedule) { Project project = projectService.getById(projectId); List 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); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProjectApprovalHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProjectApprovalHandle.java index 507c5d3..d6d440d 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProjectApprovalHandle.java +++ b/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.*; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProvinceUnitedReviewHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProvinceUnitedReviewHandle.java index 0ce555e..600aca2 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProvinceUnitedReviewHandle.java +++ b/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 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); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/TenderPurchaseHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/TenderPurchaseHandle.java index 528caff..676c815 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/TenderPurchaseHandle.java +++ b/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 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 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) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/UnitInnerAuditHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/UnitInnerAuditHandle.java index 841eb06..d536393 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/UnitInnerAuditHandle.java +++ b/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; + /** * 单位内部审核处理 * diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectRenewFundHelper.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectRenewFundHelper.java new file mode 100644 index 0000000..721565e --- /dev/null +++ b/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; + +/** + *

+ * ProjectRenewFundHelper + *

+ * + * @author ZPF + * @since 14:15 2023/11/16 + */ +public class ProjectRenewFundHelper { + + private ProjectRenewFundHelper() { + } + + /** + * 通用项目查询 + * + * @param req 查询条件 + * @return / + **/ + public static LambdaQueryWrapper projectQuery(ProjectRenewalListReq req) { + LambdaQueryWrapper 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; + } +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectRenewwalFundHelper.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectRenewwalFundHelper.java deleted file mode 100644 index 304379f..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectRenewwalFundHelper.java +++ /dev/null @@ -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; - -/** - *

- * ProjectRenewwalFundHelper - *

- * - * @author ZPF - * @since 14:15 2023/11/16 - */ -public class ProjectRenewwalFundHelper { - - /** - * 通用项目查询 - * - * @param req 查询条件 - * @return / - **/ - public static LambdaQueryWrapper projectQuery(ProjectRenewalListReq req) { - LambdaQueryWrapper 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; - } -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectCollectionManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectCollectionManage.java index cc18421..1e6a87a 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectCollectionManage.java +++ b/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 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 "删除失败"; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectRenewalFundManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectRenewalFundManage.java index 3859ffb..06a06f4 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectRenewalFundManage.java +++ b/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 projectlist(ProjectRenewalListReq req, UserFullInfoDTO user) { - LambdaQueryWrapper query = ProjectRenewwalFundHelper.projectQuery(req); + LambdaQueryWrapper query = ProjectRenewFundHelper.projectQuery(req); //项目查最新 query.eq(Project::getNewest, Boolean.TRUE); //自己单位 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectCollectionSaveDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectCollectionSaveDTO.java index babeffa..48cf67c 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectCollectionSaveDTO.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java index 7803c32..cfcbf65 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/ProjectApprovedReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/ProjectApprovedReq.java index ee2007e..21b20bb 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/ProjectApprovedReq.java +++ b/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; /** diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java index f529f35..deb032e 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java +++ b/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 tags; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/impl/ProjectApplicationServiceImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/impl/ProjectApplicationServiceImpl.java index adafbfd..ceb9e0f 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/impl/ProjectApplicationServiceImpl.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/impl/ProjectApplicationServiceImpl.java @@ -34,9 +34,8 @@ public class ProjectApplicationServiceImpl extends ServiceImpl getApplicationsByProject(Project project) { - List apps = this.list(Wrappers.lambdaQuery(ProjectApplication.class) + return this.list(Wrappers.lambdaQuery(ProjectApplication.class) .eq(ProjectApplication::getProjectCode, project.getProjectCode())); - return apps; } @Override diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/utils/ProjectVersionUtil.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/utils/ProjectVersionUtil.java index bc318bf..d3e8939 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/utils/ProjectVersionUtil.java +++ b/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 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 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 processProgressVoList = projectInstList.stream() - .map(p -> processInstanceService.getProgressInstanceDetail(null, p.getInstCode())) - .collect(Collectors.toList()); + .map(p -> processInstanceService.getProgressInstanceDetail(null, p.getInstCode())) + .collect(Collectors.toList()); // 筛选出上个版本该类型审核流程通过的流程详情 List 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); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/controller/TestController.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/controller/TestController.java index efadfd8..e93b011 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/controller/TestController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/controller/TestController.java @@ -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(); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvinceApiResponse.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvinceApiResponse.java index 8a13d1c..e2716ee 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvinceApiResponse.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvinceApiResponse.java @@ -66,7 +66,7 @@ public class ProvinceApiResponse implements Serializable { * @return ApiResponse */ public static ProvinceApiResponse of(Integer code, String message, T data) { - return new ProvinceApiResponse(code, message, data); + return new ProvinceApiResponse<>(code, message, data); } /** diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialApplicationDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialApplicationDTO.java index 875eb11..02aa5cd 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialApplicationDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/dto/ProvincialApplicationDTO.java @@ -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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialProjectRes.java b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialProjectRes.java index 19027a4..d341502 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialProjectRes.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/provincial/model/res/ProvincialProjectRes.java @@ -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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/safety/manage/SafetyRiskManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/safety/manage/SafetyRiskManage.java index adc37e6..5378fef 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/safety/manage/SafetyRiskManage.java +++ b/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 personMonitorList(ProjectListReq req) { LambdaQueryWrapper 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 page = projectService.page(req.page(), query); long total; if ((total = page.getTotal()) == 0) { return PageVo.empty(); } List 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 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 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 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 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 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++; } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/CcTaskListener.java b/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/CcTaskListener.java index d5053cf..8433d27 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/CcTaskListener.java +++ b/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 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); }); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessStartListener.java b/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessStartListener.java index 44c02f7..0f1d661 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/ProcessStartListener.java +++ b/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.去查找 项目实例关系表 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/staging/service/impl/ProjectStagingServiceImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/staging/service/impl/ProjectStagingServiceImpl.java index d83cb42..f8578e4 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/staging/service/impl/ProjectStagingServiceImpl.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/staging/service/impl/ProjectStagingServiceImpl.java @@ -15,7 +15,7 @@ import java.time.LocalDateTime; /** *

- * 服务实现类 + * 服务实现类 *

* * @author zpf @@ -28,15 +28,14 @@ public class ProjectStagingServiceImpl extends ServiceImpl 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); } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java b/hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java index 651ec1b..ba643b1 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowMapUtil.java @@ -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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowUtil.java b/hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowUtil.java index 7bc0f43..7ad8a79 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/staging/utils/ProjectStatusFlowUtil.java +++ b/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 intervalTimeMap = Maps.newHashMap(); + private static final Map 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); } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/UserGuidanceController.java b/hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/UserGuidanceController.java index 809782e..0673e9c 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/UserGuidanceController.java +++ b/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 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/Region.java b/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/Region.java index 90529ca..00546a5 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/Region.java +++ b/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; /** *

diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/controller/TodoCenterController.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/controller/TodoCenterController.java index a3c0745..923499f 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/controller/TodoCenterController.java +++ b/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); } /** diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/handle/PassHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/handle/PassHandle.java index 995c4ab..c5e2115 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/handle/PassHandle.java +++ b/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 activities = runtimeService.createActivityInstanceQuery() .taskAssignee(employeeCode) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java index 7419c0e..4afefdc 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java +++ b/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 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 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 userSubmittedList = Lists.newArrayList(); Map projectInfoMap = Maps.newHashMap(); - if(StringUtils.isBlank(employeeCode)){ - projects = Collections.emptyList(); + if (StringUtils.isBlank(employeeCode)) { + projects = Collections.emptyList(); } if (CollUtil.isNotEmpty(projects)) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/ProcessProgressDetailVo.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/ProcessProgressDetailVO.java similarity index 90% rename from hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/ProcessProgressDetailVo.java rename to hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/ProcessProgressDetailVO.java index 77c5bfe..b941b6b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/ProcessProgressDetailVo.java +++ b/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 { /** * 流程处理详情 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/TodoNumVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/TodoNumVO.java index 900c31b..a5f60a3 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/model/vo/TodoNumVO.java +++ b/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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/ITodoService.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/ITodoService.java index c86872e..1acd79b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/ITodoService.java +++ b/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) ; } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/impl/TodoServiceImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/impl/TodoServiceImpl.java index 09c24e2..47e335a 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/impl/TodoServiceImpl.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/service/impl/TodoServiceImpl.java @@ -11,7 +11,7 @@ import com.hz.pm.api.todocenter.handle.PassHandle; import com.hz.pm.api.todocenter.handle.WithDrawHandle; import com.hz.pm.api.todocenter.manage.HandlerManage; 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; import com.hz.pm.api.todocenter.service.ITodoService; import com.hz.pm.api.todocenter.utils.BuildUserUtils; import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO; @@ -61,7 +61,7 @@ public class TodoServiceImpl implements ITodoService { * @return 流程进度及表单详情 */ @Override - public ProcessProgressDetailVo getProcessDetail(ProcessDetailReq request) { + public ProcessProgressDetailVO getProcessDetail(ProcessDetailReq request) { String employeeCode = LoginUserUtil.loginUserDetail().getEmployeeCode(); String instanceId = request.getInstanceId(); String nodeId = request.getNodeId(); @@ -79,7 +79,7 @@ public class TodoServiceImpl implements ITodoService { buildUserUtils.buildUserByProcessInfo(progressInfo); isHighLine = checkHighLine(progressInfo,taskId,LoginUserUtil.loginUserDetail()); } - ProcessProgressDetailVo res = new ProcessProgressDetailVo(); + ProcessProgressDetailVO res = new ProcessProgressDetailVO(); res.setProcessProgressVo(progressInstanceDetail); res.setStatus(progressInstanceDetail.getStatus()); res.setProjectId(projectId); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/utils/PdfUtils.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/utils/PdfUtils.java index 576fada..bedfc17 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/utils/PdfUtils.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/utils/PdfUtils.java @@ -5,9 +5,11 @@ import java.io.*; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; +import java.util.Iterator; import java.util.Map; import java.util.UUID; +import cn.hutool.core.io.IoUtil; import org.springframework.stereotype.Component; import org.xhtmlrenderer.pdf.ITextFontResolver; import org.xhtmlrenderer.pdf.ITextRenderer; @@ -34,20 +36,21 @@ public class PdfUtils { * @author CMM * @since 2023/03/13 17:07 */ - public byte[] generatePdf(InputStream templateHtmlInputStream, Map paramsMap){ + public byte[] generatePdf(InputStream templateHtmlInputStream, Map paramsMap) { FileInputStream inputStream = null; - try { + try (InputStreamReader isr = new InputStreamReader(templateHtmlInputStream, StandardCharsets.UTF_8); + BufferedReader bufferedReader = new BufferedReader(isr)) { File directory = new File(""); - //临时文件输出路径 + // 临时文件输出路径 String filePath = directory.getAbsolutePath() + File.separator + "fileout"; //字体格式 - String fontPath = directory.getAbsolutePath() + File.separator + "font" + File.separator + "simsun.ttc"; - if(!new File(filePath).exists()){ + String fontPath = directory.getAbsolutePath() + File.separator + "font" + File.separator + "simsun.ttc"; + if (!new File(filePath).exists()) { new File(filePath).mkdir(); } StringBuilder stringBuilder = new StringBuilder(); - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(templateHtmlInputStream, StandardCharsets.UTF_8)); + ; String line; while ((line = bufferedReader.readLine()) != null) { stringBuilder.append(line); @@ -59,14 +62,14 @@ public class PdfUtils { if (paramsMap.get(fieldName) == null) { // 没有值的字段使用-覆盖 htmlInfo = htmlInfo.replace("#" + fieldName + "#", ""); - }else { + } else { // 设置占位字段 htmlInfo = htmlInfo.replace("#" + fieldName + "#", paramsMap.get(fieldName).toString()); } } //生成临时文件 - String htmlFileName = UUID.randomUUID().toString().replace("-","") + ".html"; + String htmlFileName = UUID.randomUUID().toString().replace("-", "") + ".html"; String htmlFilePath = filePath + File.separator + htmlFileName; File file = new File(htmlFilePath); FileOutputStream fop = new FileOutputStream(file); @@ -79,7 +82,7 @@ public class PdfUtils { fop.close(); //生成pdf - String fileName = UUID.randomUUID().toString().replace("-","") + ".pdf"; + String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf"; String pdfFilePath = filePath + File.separator + fileName; String url = new File(htmlFilePath).toURI().toURL().toString(); OutputStream os = Files.newOutputStream(Paths.get(pdfFilePath)); @@ -97,21 +100,12 @@ public class PdfUtils { // 返回生成的pdf文件字节数组 return readBytes(inputStream); - } catch (IOException e) { - throw new BizException("生成pdf文件失败!" + e.getMessage()); - } catch (DocumentException e) { - throw new BizException("生成pdf文件失败!" +e.getMessage()); + } catch (IOException | DocumentException e) { + throw BizException.wrap("生成pdf文件失败!" + e.getMessage()); } finally { - try { - if (null != inputStream) { - - inputStream.close(); - } - } catch (IOException e) { - log.error("close resource error", e.getMessage()); - } - } + IoUtil.close(inputStream); } + } /** diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/agent/AgentAuthFilter.java b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/agent/AgentAuthFilter.java index bead658..d50c650 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/agent/AgentAuthFilter.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/agent/AgentAuthFilter.java @@ -1,7 +1,7 @@ package com.hz.pm.api.user.security.auth.agent; -import com.ningdatech.basic.exception.BizException; import com.hz.pm.api.user.security.auth.model.WebRequestDetails; +import com.ningdatech.basic.exception.BizException; import org.apache.commons.lang3.StringUtils; import org.springframework.http.HttpMethod; import org.springframework.security.authentication.AuthenticationServiceException; @@ -14,7 +14,6 @@ import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.time.LocalDateTime; /** * @Author LiuXinXin @@ -34,7 +33,6 @@ public class AgentAuthFilter extends AbstractAuthenticationProcessingFilter { super(new AntPathRequestMatcher(processingUrl, HttpMethod.POST.name())); } - // ~ Methods // ======================================================================================================== @Override diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/agent/AgentAuthProvider.java b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/agent/AgentAuthProvider.java index cf1d7d2..2b2ff77 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/agent/AgentAuthProvider.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/agent/AgentAuthProvider.java @@ -1,5 +1,6 @@ package com.hz.pm.api.user.security.auth.agent; +import lombok.Setter; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; @@ -7,19 +8,20 @@ import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; /** - * @Author LiuXinXin - * @Date 2020/8/3 8:55 下午 - * @Version 1.0 - **/ + *

+ * AgentAuthProvider + *

+ * + * @author WendyYang + * @since 20:41 2023/12/15 + */ +@Setter public class AgentAuthProvider implements AuthenticationProvider { private UserDetailsService userDetailsService; @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { - if (!(authentication instanceof AgentAuthToken)) { - throw new RuntimeException("CustomAuthProvider 只支持 CustomAuthToken"); - } AgentAuthToken authenticationToken = (AgentAuthToken) authentication; String principal = (String) authenticationToken.getPrincipal(); @@ -33,8 +35,4 @@ public class AgentAuthProvider implements AuthenticationProvider { return AgentAuthToken.class.isAssignableFrom(authentication); } - public void setUserDetailsService(UserDetailsService userDetailsService) { - this.userDetailsService = userDetailsService; - } - } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/constants/UserDeatilsServiceConstant.java b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/constants/UserDeatilsServiceConstant.java index 2ca4b78..aa4b1a3 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/constants/UserDeatilsServiceConstant.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/constants/UserDeatilsServiceConstant.java @@ -7,5 +7,9 @@ package com.hz.pm.api.user.security.auth.constants; public class UserDeatilsServiceConstant { + private UserDeatilsServiceConstant() { + } + public static final String USER_DETAILS_SERVICE_SEPARATOR = "@###@"; + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/validate/DingQrLoginException.java b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/validate/DingQrLoginException.java index 12fcd96..213a439 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/validate/DingQrLoginException.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/auth/validate/DingQrLoginException.java @@ -1,19 +1,20 @@ package com.hz.pm.api.user.security.auth.validate; import lombok.Data; +import lombok.EqualsAndHashCode; /** * @author liuxinxin * @date 2023/3/24 上午11:47 * 浙政钉扫码登陆错误 */ - @Data +@EqualsAndHashCode(callSuper = true) public class DingQrLoginException extends RuntimeException { - private Integer code; + private final Integer code; - private String message; + private final String message; public DingQrLoginException(int code, String message) { this.code = code; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/wps/manage/WpsConvertManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/wps/manage/WpsConvertManage.java index 70d2d24..21fcf80 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/wps/manage/WpsConvertManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/wps/manage/WpsConvertManage.java @@ -49,7 +49,7 @@ public class WpsConvertManage { try { //2-1、传参文件对象转换输出PDF文件 //1)、定义集合,存储待转换的原文件 - List fileList =new ArrayList(); + List fileList = new ArrayList<>(); //2)、定义转换后的pdf文件输出流 OutputStream out = null; //3)、添加原文件到集合 diff --git a/hz-pm-api/src/test/java/com/ningdatech/pmapi/cpu/CPUTest.java b/hz-pm-api/src/test/java/com/ningdatech/pmapi/cpu/CPUTest.java deleted file mode 100644 index 0c62563..0000000 --- a/hz-pm-api/src/test/java/com/ningdatech/pmapi/cpu/CPUTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.hz.pm.api.cpu; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -public class CPUTest { - public static ExecutorService executorService = Executors.newFixedThreadPool(10); - - public static volatile boolean flag = true; - - public static void main(String[] args) { - for(int i = 0;i < 10;i++){ - executorService.execute(() -> { - while (flag) { - // 一个复杂的计算任务 - long x = 123456789123456789L; - for (int j = 0; j < 10000; j++) { - if(!flag){ - break; - } - x = (x * 123456789123456789L) % 123456789; - } - } - }); - } - - try{ - Thread.sleep(10000); - executorService.shutdownNow(); - flag = false; - }catch (Exception e){ - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/dto/ProjectBaseInfoDTO.java b/hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/dto/ProjectBaseInfoDTO.java index bcb3a46..be8eab9 100644 --- a/hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/dto/ProjectBaseInfoDTO.java +++ b/hz-pm-sync/src/main/java/com/hz/pm/sync/scheduler/model/dto/ProjectBaseInfoDTO.java @@ -1,8 +1,5 @@ package com.hz.pm.sync.scheduler.model.dto; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data;