diff --git a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java index 2398e98..c0705f6 100644 --- a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java +++ b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java @@ -46,7 +46,7 @@ public class GeneratorCodeKingbaseConfig { path + "/com/ningdatech/pmapi/" + packageName + "/mapper")); }) .strategyConfig(builder -> { - builder.addTablePrefix("wflow"); + builder.addTablePrefix(""); // 设置需要生成的表名 builder.addInclude(tableNames); }) @@ -56,7 +56,11 @@ public class GeneratorCodeKingbaseConfig { } public static void main(String[] args) { +<<<<<<< HEAD generate("Liuxinxin", "expert", PATH_LXX, "expert_avoid_company"); +======= + generate("Liuxinxin", "expert", PATH_LXX, "expert_meta_apply"); +>>>>>>> 3fc1952d747d914fc53e00cda93621feed6be50f } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/config/DingOrganizationProperties.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/config/DingOrganizationProperties.java new file mode 100644 index 0000000..d6cd0e7 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/config/DingOrganizationProperties.java @@ -0,0 +1,19 @@ +package com.ningdatech.pmapi.common.config; + +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 liuxinxin + * @date 2022/9/9 下午5:37 + */ +@Data +@Configuration +@ConfigurationProperties(prefix = "organization") +public class DingOrganizationProperties { + private List deptVisibleScopes = new ArrayList<>(); +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java new file mode 100644 index 0000000..19d85ad --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java @@ -0,0 +1,35 @@ +package com.ningdatech.pmapi.common.constant; + +/** + * @description: 常量 + * @author: LiuXinXin + * @date: 2022/5/5 17:31 + */ +public interface CommonConst { + + String COOKIE_KEY = "ND_JSESSION"; + + Integer EXPORT_PAGE_NUMBER = 1; + Integer EXPORT_PAGE_SIZE = 100000; + String CALL_STATUS = "status"; + String CALL_STATUS_OK_VALUE = "ok"; + + Integer COMMENT_MAX_SIZE = 163; + Integer SUB_COMMENT_SIZE_MIN = 0; + Integer SUB_COMMENT_SIZE_MAX = 160; + + String PROJECT_DECLARE = "项目申报"; + String UNIT_INNER_AUDIT = "单位内部审核"; + String PRELIMINARY_PREVIEW = "项目预审"; + String DEPT_UNITED_REVIEW = "部门联审"; + String ANNUAL_PLAN = "年度计划"; + String CONSTRUCTION_PLAN_REVIEW = "建设方案评审"; + String PROJECT_APPROVAL = "立项批复"; + String TENDER_PURCHASE = "招标采购"; + String PROJECT_PRELIMINARY_INSPECTION = "项目初验"; + String PROJECT_FINAL_INSPECTION = "项目终验"; + + String ARCHIVED = "归档"; + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConstant.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConstant.java deleted file mode 100644 index 3391e87..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConstant.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.ningdatech.pmapi.common.constant; - -/** - * @description: 常量 - * @author: LiuXinXin - * @date: 2022/5/5 17:31 - */ -public class CommonConstant { - - public static final String COOKIE_KEY = "ND_JSESSION"; - - public static final Integer EXPORT_PAGE_NUMBER = 1; - public static final Integer EXPORT_PAGE_SIZE = 100000; - public static final String CALL_STATUS = "status"; - public static final String CALL_STATUS_OK_VALUE = "ok"; - - public static final Integer COMMENT_MAX_SIZE = 163; - public static final Integer SUB_COMMENT_SIZE_MIN = 0; - public static final Integer SUB_COMMENT_SIZE_MAX = 160; - - public static final String PROJECT_DECLARE = "项目申报"; - public static final String UNIT_INNER_AUDIT = "单位内部审核"; - public static final String PRELIMINARY_PREVIEW = "项目预审"; - public static final String DEPT_UNITED_REVIEW = "部门联审"; - public static final String ANNUAL_PLAN = "年度计划"; - public static final String CONSTRUCTION_PLAN_REVIEW = "建设方案评审"; - public static final String PROJECT_APPROVAL = "立项批复"; - public static final String TENDER_PURCHASE = "招标采购"; - public static final String PROJECT_PRELIMINARY_INSPECTION = "项目初验"; - public static final String PROJECT_FINAL_INSPECTION = "项目终验"; - - public static final String ARCHIVED = "归档"; - - - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DefValConstants.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DefValConst.java similarity index 51% rename from pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DefValConstants.java rename to pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DefValConst.java index a11b052..9646f75 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DefValConstants.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DefValConst.java @@ -8,7 +8,7 @@ import com.ningdatech.basic.util.StrPool; * * @author PoffyZhang */ -public interface DefValConstants { +public interface DefValConst { /** * 默认的根节点path @@ -30,28 +30,5 @@ public interface DefValConstants { * 字典占位符 */ String DICT_PLACEHOLDER = "###"; - /** - * 浙江省的region_id - */ - Long ZJREGION_ID = 116L; - /** - * 城市 level - */ - Integer CITY_REGION_LEVEL = 2; - - /** - * 区的 level - */ - Integer QU_REGION_LEVEL = 3; - - /** - * 驾驶员异常数据GPS字符串起始偏移量 - */ - Integer GPS_START_OFFSET = 5; - - /** - * 驾驶员异常数据GPS字符串结尾偏移量 - */ - Integer GPS_END_OFFSET = 69; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DingConstant.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DingConst.java similarity index 86% rename from pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DingConstant.java rename to pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DingConst.java index 9590c8b..4fbf071 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DingConstant.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DingConst.java @@ -6,7 +6,7 @@ package com.ningdatech.pmapi.common.constant; * @author CMM * @since 2023/02/01 14:49 */ -public interface DingConstant { +public interface DingConst { /** * 工作通知 */ diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/ProjectDeclareConstants.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/ProjectDeclareConst.java similarity index 98% rename from pmapi/src/main/java/com/ningdatech/pmapi/common/constant/ProjectDeclareConstants.java rename to pmapi/src/main/java/com/ningdatech/pmapi/common/constant/ProjectDeclareConst.java index 392cd3a..b9f08a2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/ProjectDeclareConstants.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/ProjectDeclareConst.java @@ -1,7 +1,5 @@ package com.ningdatech.pmapi.common.constant; -import io.swagger.models.auth.In; - import java.math.BigDecimal; /** @@ -10,7 +8,7 @@ import java.math.BigDecimal; * @author CMM * @since 2023/01/19 10:31 */ -public interface ProjectDeclareConstants { +public interface ProjectDeclareConst { /** * 基本信息 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionLevelConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionLevelConst.java new file mode 100644 index 0000000..42161f8 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionLevelConst.java @@ -0,0 +1,19 @@ +package com.ningdatech.pmapi.common.constant; + +/** + *

+ * RegionLevelConst + *

+ * + * @author WendyYang + * @since 13:57 2023/3/1 + */ +public interface RegionLevelConst { + + int PROVINCE = 1; + + int CITY = 2; + + int COUNTY = 3; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/StateMachineConstants.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/StateMachineConst.java similarity index 86% rename from pmapi/src/main/java/com/ningdatech/pmapi/common/constant/StateMachineConstants.java rename to pmapi/src/main/java/com/ningdatech/pmapi/common/constant/StateMachineConst.java index e1a84c7..e90e5dc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/StateMachineConstants.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/StateMachineConst.java @@ -5,7 +5,7 @@ package com.ningdatech.pmapi.common.constant; * @since 2023/02/07 16:24 */ -public class StateMachineConstants { +public class StateMachineConst { public static final String PROJECT_DECLARE = "projectDeclare"; public static final String LI_SHUI_CITY_AREA_CODE = "331100"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BoolDisplayEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/BoolDisplayEnum.java similarity index 90% rename from pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BoolDisplayEnum.java rename to pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/BoolDisplayEnum.java index d4ab72f..29415af 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BoolDisplayEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/BoolDisplayEnum.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.common.constant; +package com.ningdatech.pmapi.common.enumeration; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/RegionCacheHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/RegionCacheHelper.java new file mode 100644 index 0000000..219a23c --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/RegionCacheHelper.java @@ -0,0 +1,111 @@ +package com.ningdatech.pmapi.common.helper; + + +import com.ningdatech.pmapi.sys.model.dto.RegionDTO; +import com.ningdatech.pmapi.sys.model.dto.RegionTreeDTO; + +import java.util.List; +import java.util.Map; + +/** + *

+ * RegionCacheHelper - + *

+ * + * @author WendyYang + * @since 13:50 2023/3/1 + */ +public interface RegionCacheHelper { + + + /** + * 获取完整的区域树状结构 + * + * @return / + */ + List all(); + + /** + * 获取用于前端回显示使用的unionList 仅用于返回前端的时候使用 + * + * @param code 区域编码 + * @param level 区域层级 + * @return + */ + String getUnionPathStr(String code, Integer level); + + /** + * 原专家库数据导入使用 返回名称区域Map + * + * @return + */ + Map getNameRegionMap(); + + + /** + * key.getRegionCode() + "###" + key.getRegionLevel() ,regionMap.get(key) + * + * @return + */ + Map getRegionMap(); + + /** + * 获取市级区域列表 + * + * @return + */ + List getMunicipalRegion(); + + /** + * 获取省级区域列表 + * + * @return / + */ + List getProvincialRegion(); + + /** + * 根据区域code 区域层级获取 区域类 + * + * @param code 区域编码 + * @param level 区域层级 + * @return / + */ + RegionDTO getByCodeAndLevel(String code, int level); + + /** + * 根据传入的地区code与level获取所有上层地区集合 + * 按照level升序排列 + * + * @param code 地区编码 + * @param level 地区层级 + * @return / + */ + List listParents(String code, int level); + + /** + * 获取所有区域编码「parent -> child」 + * + * @param regionCode 区域编码 + * @param regionLevel 级别 + * @return / + */ + List getRegionCodes(String regionCode, int regionLevel); + + /** + * 获取当前区域所有的子集 + * + * @param code 区域编码 + * @param level 级别 + * @return / + */ + List getAllChildrenRegionCodeList(String code, int level); + + + /** + * 获取 根节点 区域层级编码 + * + * @return / + */ + String getParentCodeRoot(); + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/RegionLimitHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/RegionLimitHelper.java new file mode 100644 index 0000000..d264cd9 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/RegionLimitHelper.java @@ -0,0 +1,59 @@ +package com.ningdatech.pmapi.common.helper; + +import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/12/21 下午5:37 + * 区域限制帮助类 + */ + +public interface RegionLimitHelper { + + /** + * 管理员 是否包含 专家层级校验 + * + * @param expertUserId / + * @param expertAdminUserId / + * @return / + */ + Boolean regionContainsCheck(Long expertUserId, Long expertAdminUserId); + + /** + * 校验层级包含关系 + * + * @param regionContainsBOList / + * @param regionCode / + * @param regionLevel / + * @return / + */ + Boolean regionContains(List regionContainsBOList, String regionCode, Integer regionLevel); + + /** + * 查询操作 包含区域包含列表装配 + * + * @param queryRegionContainBo 查询区域范围列表 + * @param expertAdminContainsRegionList 专家管理员可管理的区域范围列表 + * @return / + */ + List queryContainsRegionAssembler(RegionContainsBO queryRegionContainBo, List expertAdminContainsRegionList); + + /** + * 根据 区域层级-区域编码 获取区域包含列表 + * + * @param regionLevel 区域层级 + * @param regionCode 区域编码 + * @return / + */ + RegionContainsBO getContainsRegionBo(Integer regionLevel, String regionCode); + + /** + * 根据专家管理员用户id 获取专家管理员管辖区域列表 + * + * @param expertAdminUserId 专家管理员用户id + * @return / + */ + List getExpertAdminContainsRegion(Long expertAdminUserId); +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java index d421e51..a9b9cc7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java @@ -22,4 +22,6 @@ public interface UserInfoHelper { UserFullInfoDTO getUserFullInfo(Long userId); + String getUserName(Long userId); + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/basic/AbstractRegionCache.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/basic/AbstractRegionCache.java new file mode 100644 index 0000000..1322223 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/basic/AbstractRegionCache.java @@ -0,0 +1,138 @@ +package com.ningdatech.pmapi.common.helper.basic; + +import com.github.benmanes.caffeine.cache.Caffeine; +import com.github.benmanes.caffeine.cache.LoadingCache; +import com.ningdatech.basic.exception.BizException; +import com.ningdatech.pmapi.common.helper.RegionCacheHelper; +import com.ningdatech.pmapi.common.model.RegionMapKey; +import com.ningdatech.pmapi.sys.convert.RegionConverter; +import com.ningdatech.pmapi.sys.model.dto.RegionDTO; +import com.ningdatech.pmapi.sys.model.dto.RegionTreeDTO; +import com.ningdatech.pmapi.sys.service.IRegionService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +/** + *

+ * AbstractRegionCache + *

+ * + * @author WendyYang + * @since 14:41 2023/3/1 + */ +public abstract class AbstractRegionCache implements InitializingBean, RegionCacheHelper { + + @Autowired + private IRegionService regionService; + /** + * 当前支持最大层级 + */ + private static final int REGION_LEVEL_MAX = 3; + + private LoadingCache> regionsCache; + + /** + * 中国行政区划编码 + */ + private static final String PARENT_CODE_ROOT = "100000"; + + protected Map regionMap; + + @Override + public void afterPropertiesSet() { + regionsCache = Caffeine.newBuilder() + .expireAfterWrite(10, TimeUnit.MINUTES) + .refreshAfterWrite(5, TimeUnit.MINUTES) + .build(key -> { + // 查询全部 + List regionDTOList = regionService.all(); + if (regionDTOList.isEmpty()) { + throw BizException.wrap("区域元数据不能为空"); + } + regionMap = buildCacheMap(regionDTOList); + List regionInLevel = regionMap.values().stream() + .filter(regionDTO -> { + // 只过滤出小于等于level的region + if (Objects.isNull(regionDTO.getRegionLevel())) { + return false; + } + return Integer.parseInt(key) >= regionDTO.getRegionLevel(); + }).collect(Collectors.toList()); + List treeDtos = RegionConverter.toRegionTreeDTOList(regionInLevel); + return toTreeStructure(treeDtos); + }); + warmUp(); + } + + protected List getByLevel(int level) { + return regionsCache.get(String.valueOf(level)); + } + + private Map buildCacheMap(List regionDTOList) { + Map regionDtoMap = new ConcurrentHashMap<>(256); + regionDTOList.forEach(region -> { + RegionMapKey key = RegionMapKey.builder() + .regionCode(region.getRegionCode()) + .regionLevel(region.getRegionLevel()) + .build(); + regionDtoMap.put(key, region); + }); + return regionDtoMap; + } + + private List toTreeStructure(List rootList) { + List nodeList = new ArrayList<>(); + for (RegionTreeDTO treeNode : rootList) { + if (PARENT_CODE_ROOT.equals(treeNode.getParentCode()) || Objects.isNull(treeNode.getParentCode())) { + nodeList.add(treeNode); + } + treeNode.setChildren(getChildren(treeNode.getRegionCode(), treeNode.getLevel(), rootList)); + } + return nodeList; + } + + private List getChildren(String regionCode, int regionLevel, List list) { + List childList = new ArrayList<>(); + for (RegionTreeDTO regionTreeDTO : list) { + if (regionCode.equals(regionTreeDTO.getParentCode()) && regionLevel + 1 == regionTreeDTO.getLevel()) { + childList.add(regionTreeDTO); + } + } + for (RegionTreeDTO regionTreeDTO : childList) { + regionTreeDTO.setChildren(getChildren(regionTreeDTO.getRegionCode(), regionTreeDTO.getLevel(), list)); + } + if (CollectionUtils.isEmpty(childList)) { + return Collections.emptyList(); + } + childList.sort(Comparator.comparing(RegionTreeDTO::getRegionCode)); + return childList; + } + + + private void warmUp() { + for (int level = 1; level <= REGION_LEVEL_MAX; level++) { + getByLevel(level); + } + } + + protected List getCopyListByLevel(int level) { + List regionTreeDtos = regionsCache.get(String.valueOf(level)); + List copyRegionTreeDtos = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(regionTreeDtos)) { + copyRegionTreeDtos.addAll(regionTreeDtos); + } + return copyRegionTreeDtos; + } + + + @Override + public String getParentCodeRoot() { + return PARENT_CODE_ROOT; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/basic/AbstractRegionLimitHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/basic/AbstractRegionLimitHelper.java new file mode 100644 index 0000000..d990c0b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/basic/AbstractRegionLimitHelper.java @@ -0,0 +1,44 @@ +package com.ningdatech.pmapi.common.helper.basic; + +import com.ningdatech.pmapi.common.helper.RegionCacheHelper; +import com.ningdatech.pmapi.common.helper.RegionLimitHelper; +import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import lombok.AllArgsConstructor; + +import java.util.Objects; + +/** + *

+ * AbstractRegionLimitHelper + *

+ * + * @author WendyYang + * @since 14:35 2023/3/1 + */ +@AllArgsConstructor +public abstract class AbstractRegionLimitHelper implements RegionLimitHelper { + + protected final RegionCacheHelper regionCacheHelper; + protected final IExpertUserFullInfoService expertUserFullInfoService; + + + /** + * 根据 专家用户id 获取专家层级 + * + * @param expertUserId / + * @return / + */ + protected ExpertRegionInfo getExpertRegionInfo(Long expertUserId) { + ExpertUserFullInfo userFullInfo = expertUserFullInfoService.getByUserId(expertUserId); + if (Objects.isNull(userFullInfo)) { + return new ExpertRegionInfo(); + } + ExpertRegionInfo regionInfo = new ExpertRegionInfo(); + regionInfo.setRegionCode(userFullInfo.getRegionCode()); + regionInfo.setRegionLevel(userFullInfo.getRegionLevel()); + return regionInfo; + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java new file mode 100644 index 0000000..3228561 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java @@ -0,0 +1,122 @@ +package com.ningdatech.pmapi.common.helper.impl; + +import com.ningdatech.pmapi.common.helper.RegionCacheHelper; +import com.ningdatech.pmapi.common.helper.basic.AbstractRegionLimitHelper; +import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; +import org.apache.commons.collections4.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * @author liuxinxin + * @date 2022/8/1 下午2:27 + */ +@Component +public class RegionLimitHelperImpl extends AbstractRegionLimitHelper { + + private static final Logger logger = LoggerFactory.getLogger(RegionLimitHelperImpl.class); + + public RegionLimitHelperImpl(RegionCacheHelper regionCacheHelper, IExpertUserFullInfoService expertUserFullInfoService) { + super(regionCacheHelper, expertUserFullInfoService); + } + + public static Boolean contains(Integer adminRegionLevel, List adminAllContainsRegionCodes + , Integer expertRegionLevel, String expertRegionCode) { + for (String adminAllContainsRegionCode : adminAllContainsRegionCodes) { + if (adminAllContainsRegionCode.equals(expertRegionCode) && adminRegionLevel >= expertRegionLevel) { + return true; + } + } + return false; + } + + @Override + public Boolean regionContainsCheck(Long expertUserId, Long expertAdminUserId) { + List expertAdminContainsRegion = getExpertAdminContainsRegion(expertAdminUserId); + ExpertRegionInfo expertRegionInfo = getExpertRegionInfo(expertUserId); + return regionContains(expertAdminContainsRegion, expertRegionInfo.getRegionCode(), expertRegionInfo.getRegionLevel()); + } + + @Override + public Boolean regionContains(List regionContainsBOList, String regionCode, Integer regionLevel) { + for (RegionContainsBO regionContainsBO : regionContainsBOList) { + Integer parentRegionTreeLevel = regionContainsBO.getParentRegionTreeLevel(); + List containsRegionCodeList = regionContainsBO.getContainsRegionCodeList(); + for (String containsRegionCode : containsRegionCodeList) { + if (containsRegionCode.equals(regionCode) && parentRegionTreeLevel <= regionLevel) { + return true; + } + } + } + return false; + } + + + @Override + public List queryContainsRegionAssembler(RegionContainsBO queryRegionContainBo, List expertAdminContainsRegionList) { + List resultBoList = new ArrayList<>(); + if (Objects.nonNull(queryRegionContainBo)) { + resultBoList.add(queryRegionContainBo); + Integer parentRegionTreeLevel = queryRegionContainBo.getParentRegionTreeLevel(); + List containsRegionCodeList = queryRegionContainBo.getContainsRegionCodeList(); + + // 查询取并级 + if (CollectionUtils.isNotEmpty(expertAdminContainsRegionList)) { + for (RegionContainsBO regionContainsBO : expertAdminContainsRegionList) { + regionContainsBO.setParentRegionTreeLevel(parentRegionTreeLevel); + List regionCodeList = regionContainsBO.getContainsRegionCodeList(); + regionCodeList = regionCodeList.stream().filter(containsRegionCodeList::contains).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(regionCodeList)) { + regionContainsBO.setContainsRegionCodeList(regionCodeList); + resultBoList.add(regionContainsBO); + } + } + } + return resultBoList; + } else { + return expertAdminContainsRegionList; + } + } + + @Override + public RegionContainsBO getContainsRegionBo(Integer regionLevel, String regionCode) { + List regionCodes = regionCacheHelper + .getAllChildrenRegionCodeList(regionCode, regionLevel); + RegionContainsBO regionContainsBO = new RegionContainsBO(); + regionContainsBO.setContainsRegionCodeList(regionCodes); + regionContainsBO.setParentRegionTreeLevel(regionLevel); + return regionContainsBO; + } + + @Override + public List getExpertAdminContainsRegion(Long expertAdminUserId) { + if (Objects.isNull(expertAdminUserId)) { + logger.error("getExpertAdminContainsRegion expertAdminUserId is null"); + return new ArrayList<>(); + } + // TODO + /*LambdaQueryWrapper expertAdminRegionEq = Wrappers.lambdaQuery(ExpertAdminRegion.class) + .eq(ExpertAdminRegion::getUserId, expertAdminUserId); + List expertAdminRegionList = iExpertAdminRegionService.list(expertAdminRegionEq); + List regionContainsBOList = new ArrayList<>(); + for (ExpertAdminRegion expertAdminRegion : expertAdminRegionList) { + List regionCodes = regionCacheHelper + .getAllChildrenRegionCodeList(expertAdminRegion.getRegionCode(), expertAdminRegion.getRegionLevel()); + RegionContainsBO regionContainsBO = new RegionContainsBO(); + regionContainsBO.setContainsRegionCodeList(regionCodes); + regionContainsBO.setParentRegionTreeLevel(expertAdminRegion.getRegionLevel()); + regionContainsBOList.add(regionContainsBO); + }*/ + return null; + } + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionsCacheImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionsCacheImpl.java new file mode 100644 index 0000000..df3c23d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionsCacheImpl.java @@ -0,0 +1,205 @@ +package com.ningdatech.pmapi.common.helper.impl; + +import cn.hutool.core.lang.Assert; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.common.helper.basic.AbstractRegionCache; +import com.ningdatech.pmapi.common.model.RegionMapKey; +import com.ningdatech.pmapi.sys.model.dto.RegionDTO; +import com.ningdatech.pmapi.sys.model.dto.RegionTreeDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author liuxinxin + * @date 2022/7/22 上午8:58 + * 构建地区码 地区树 + */ +@Slf4j +@Component +public class RegionsCacheImpl extends AbstractRegionCache { + + @Override + public List all() { + return getByLevel(3); + } + + @Override + public List getAllChildrenRegionCodeList(String code, int level) { + List regionTreeDTOList = all(); + Set childrenRegionCodeSet = new HashSet<>(); + childrenRegionCodeSet.add(code); + RegionTreeDTO currentRegionTree = getCurrentRegionTree(code, level, regionTreeDTOList); + if (Objects.isNull(currentRegionTree)) { + List childrenRegionCodeList = new ArrayList<>(); + childrenRegionCodeList.add(code); + return childrenRegionCodeList; + } + getAllChildrenRegionCodeList(currentRegionTree.getChildren(), childrenRegionCodeSet); + return new ArrayList<>(childrenRegionCodeSet); + } + + private RegionTreeDTO getCurrentRegionTree(String code, int level, List regionTreeDtos) { + for (RegionTreeDTO regionTreeDTO : regionTreeDtos) { + if (level == regionTreeDTO.getLevel() && code.equals(regionTreeDTO.getRegionCode())) { + return regionTreeDTO; + } + if (CollectionUtils.isNotEmpty(regionTreeDTO.getChildren())) { + return getCurrentRegionTree(code, level, regionTreeDTO.getChildren()); + } + } + return null; + } + + private void getAllChildrenRegionCodeList(List regionTreeDtos, Set childrenRegionCodeSet) { + if (CollectionUtils.isEmpty(regionTreeDtos)) { + return; + } + for (RegionTreeDTO regionTreeDTO : regionTreeDtos) { + childrenRegionCodeSet.add(regionTreeDTO.getRegionCode()); + getAllChildrenRegionCodeList(regionTreeDTO.getChildren(), childrenRegionCodeSet); + + } + } + + @Override + public List getRegionCodes(String regionCode, int regionLevel) { + RegionTreeDTO regionTreeNode = getTreeByRegionAndCode(null, regionCode, regionLevel); + Assert.notNull(regionTreeNode, "不存在此级别区域信息:{}", regionLevel); + List regionCodes = new ArrayList<>(); + if (regionTreeNode != null) { + regionCodes.addAll(CollUtils.fieldList(treeToList(Collections.singletonList(regionTreeNode)), RegionTreeDTO::getRegionCode)); + } + if (!regionCodes.contains(regionCode)) { + regionCodes.add(regionCode); + } + return regionCodes; + } + + protected List treeToList(List treeList) { + ArrayList result = new ArrayList<>(); + treeList.forEach(w -> { + result.add(w); + if (CollectionUtils.isNotEmpty(w.getChildren())) { + result.addAll(treeToList(w.getChildren())); + } + }); + return result; + } + + + /** + * 获取某一个地区开始的层级树 + * + * @param list 地区集合 + * @param code 地区编码 + * @param level 地区层级 + * @return / + */ + protected RegionTreeDTO getTreeByRegionAndCode(List list, String code, int level) { + if (CollectionUtils.isEmpty(list)) { + list = super.getCopyListByLevel(3); + if (CollectionUtils.isEmpty(list)) { + return null; + } + } + Optional first = list.stream() + .filter(w -> w.getRegionCode().equals(code) && w.getLevel() == level) + .findFirst(); + if (first.isPresent()) { + return first.get(); + } + for (RegionTreeDTO dto : list) { + if (CollectionUtils.isEmpty(dto.getChildren())) { + continue; + } + RegionTreeDTO temp = getTreeByRegionAndCode(dto.getChildren(), code, level); + if (temp != null) { + return temp; + } + } + return null; + } + + @Override + public List listParents(String code, int level) { + List result = new ArrayList<>(); + RegionDTO dto = regionMap.get(RegionMapKey.of(code, level)); + result.add(0, dto); + if (dto.getParentCode().equals(super.getParentCodeRoot())) { + return result; + } + result.addAll(0, listParents(dto.getParentCode(), dto.getRegionLevel() - 1)); + return result; + } + + @Override + public RegionDTO getByCodeAndLevel(String code, int level) { + return regionMap.get(RegionMapKey.of(code, level)); + } + + @Override + public List getProvincialRegion() { + List provincialRegionList = new ArrayList<>(); + regionMap.values().forEach(v -> { + if (v.getRegionCode().equals(v.getParentCode()) && v.getRegionLevel() == 2) { + provincialRegionList.add(v); + } + }); + return provincialRegionList; + } + + @Override + public List getMunicipalRegion() { + List municipalRegionList = new ArrayList<>(); + regionMap.values().forEach(v -> { + if (v.getRegionCode().equals(v.getParentCode()) && v.getRegionLevel() == 3) { + municipalRegionList.add(v); + } + }); + return municipalRegionList; + } + + @Override + public Map getRegionMap() { + Map regionDtoMap = new ConcurrentHashMap<>(512); + regionMap.forEach((k, v) -> regionDtoMap.put(k.getRegionCode() + "###" + k.getRegionLevel(), v)); + return regionDtoMap; + } + + @Override + public Map getNameRegionMap() { + Map nameRegionDtoMap = new ConcurrentHashMap<>(512); + regionMap.forEach((k, v) -> nameRegionDtoMap.put(v.getRegionName(), v)); + return nameRegionDtoMap; + } + + @Override + public String getUnionPathStr(String code, Integer level) { + if (StringUtils.isBlank(code) || Objects.isNull(level)) { + return null; + } + List unionPathStrList = new ArrayList<>(); + buildUnionPathStrList(code, level, unionPathStrList); + Collections.reverse(unionPathStrList); + if (CollectionUtils.isEmpty(unionPathStrList)) { + return null; + } + return String.join("@@", unionPathStrList); + } + + protected void buildUnionPathStrList(String code, Integer level, List unionPathStrList) { + if (level <= 0 || super.getParentCodeRoot().equals(code)) { + return; + } + RegionDTO regionDTO = regionMap.get(RegionMapKey.of(code, level)); + unionPathStrList.add(regionDTO.getRegionCode() + "##" + regionDTO.getRegionName() + "##" + regionDTO.getRegionLevel()); + if (!super.getParentCodeRoot().equals(regionDTO.getParentCode())) { + buildUnionPathStrList(regionDTO.getParentCode(), level - 1, unionPathStrList); + } + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java index 5dcac28..c4cc856 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java @@ -30,4 +30,11 @@ public class UserInfoHelperImpl implements UserInfoHelper { UserFullInfoDTO userFullInfo = userAuthLoginManage.getUserFullInfo(userId); return userFullInfo; } + + @Override + public String getUserName(Long userId) { + UserFullInfoDTO userFullInfo = userAuthLoginManage.getUserFullInfo(userId); + String realName = userFullInfo.getRealName(); + return realName; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/model/CommonPageReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/model/CommonPageReq.java new file mode 100644 index 0000000..945ca97 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/model/CommonPageReq.java @@ -0,0 +1,22 @@ +package com.ningdatech.pmapi.common.model; + +import lombok.Data; + +/** + * @author liuxinxin + * @date 2022/8/4 上午11:19 + */ +@Data +public class CommonPageReq { + private static final long serialVersionUID = 1L; + private int pageSize; + private int pageNumber; + + public int getOffset() { + return (this.getPageNumber() - 1) * this.getPageSize(); + } + + public int getLimit() { + return this.getPageSize(); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/model/RegionMapKey.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/model/RegionMapKey.java new file mode 100644 index 0000000..31c5bf8 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/model/RegionMapKey.java @@ -0,0 +1,59 @@ +package com.ningdatech.pmapi.common.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.experimental.Tolerate; + +import java.util.Objects; + +/** + *

+ * RegionMapKey + *

+ * + * @author WendyYang + * @since 13:54 2023/3/1 + */ +@Data +@Builder +@AllArgsConstructor +public class RegionMapKey { + + public static RegionMapKey of(String regionCode, int regionLevel) { + return new RegionMapKey(regionCode, regionLevel); + } + + + @Tolerate + public RegionMapKey() { + } + + /** + * 区域码 + */ + private String regionCode; + + /** + * 地区级别 + */ + private Integer regionLevel; + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RegionMapKey regionMapKey = (RegionMapKey) o; + return regionCode.equals(regionMapKey.getRegionCode()) && + regionLevel.equals(regionMapKey.getRegionLevel()); + } + + @Override + public int hashCode() { + return Objects.hash(regionCode, regionLevel); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java index 8176cdb..6a301f8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.common.statemachine.action; -import com.ningdatech.pmapi.common.constant.StateMachineConstants; +import com.ningdatech.pmapi.common.constant.StateMachineConst; import com.ningdatech.pmapi.common.statemachine.builder.ProjectDeclareStateMachineBuilder; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; @@ -23,7 +23,7 @@ import org.springframework.statemachine.annotation.WithStateMachine; @WithStateMachine(id = ProjectDeclareStateMachineBuilder.MACHINEID_TO) public class ProjectDeclareAction { - private static final String PROJECT_DECLARE = StateMachineConstants.PROJECT_DECLARE; + private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION") public void UNDER_INTERNAL_PASS(Message message) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareChoiceAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareChoiceAction.java index d34a239..1367289 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareChoiceAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareChoiceAction.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.common.statemachine.action; -import com.ningdatech.pmapi.common.constant.StateMachineConstants; +import com.ningdatech.pmapi.common.constant.StateMachineConst; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; @@ -18,7 +18,7 @@ import org.springframework.statemachine.action.Action; @Slf4j public class ProjectDeclareChoiceAction implements Action { - private static final String PROJECT_DECLARE = StateMachineConstants.PROJECT_DECLARE; + private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; @Override public void execute(StateContext stateContext) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/factory/ProjectDeclareGuardFactory.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/factory/ProjectDeclareGuardFactory.java index 287bfa0..7936261 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/factory/ProjectDeclareGuardFactory.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/factory/ProjectDeclareGuardFactory.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.common.statemachine.factory; -import com.ningdatech.pmapi.common.constant.StateMachineConstants; +import com.ningdatech.pmapi.common.constant.StateMachineConst; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; @@ -16,7 +16,7 @@ import org.springframework.statemachine.guard.Guard; */ public class ProjectDeclareGuardFactory { - private static final String PROJECT_DECLARE = StateMachineConstants.PROJECT_DECLARE; + private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; public class PendingPreQualificationChoiceGuard implements Guard { @Override diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java index 38f1893..a60301f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java @@ -1,8 +1,8 @@ package com.ningdatech.pmapi.common.statemachine.util; import com.ningdatech.basic.exception.BizException; -import com.ningdatech.pmapi.common.constant.ProjectDeclareConstants; -import com.ningdatech.pmapi.common.constant.StateMachineConstants; +import com.ningdatech.pmapi.common.constant.ProjectDeclareConst; +import com.ningdatech.pmapi.common.constant.StateMachineConst; import com.ningdatech.pmapi.common.statemachine.builder.ProjectDeclareStateMachineBuilder; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; @@ -32,7 +32,7 @@ import java.util.Objects; @RequiredArgsConstructor public class StateMachineUtils { - private static final String PROJECT_DECLARE = StateMachineConstants.PROJECT_DECLARE; + private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; private final ProjectDeclareStateMachineBuilder projectDeclareStateMachineBuilder; @@ -70,7 +70,7 @@ public class StateMachineUtils { * @since 2023/02/07 17:13 */ public static boolean judgeDeclareAmount(Project project) { - int flag = project.getDeclareAmount().compareTo(ProjectDeclareConstants.Number.DECLARE_AMOUNT_JUDGEMENT); + int flag = project.getDeclareAmount().compareTo(ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT); if (flag > 0 || flag == 0) { return true; } @@ -87,7 +87,7 @@ public class StateMachineUtils { */ public static boolean isCityProject(Project project) { String areaCode = project.getAreaCode(); - if (areaCode.equals(StateMachineConstants.LI_SHUI_CITY_AREA_CODE)) { + if (areaCode.equals(StateMachineConst.LI_SHUI_CITY_AREA_CODE)) { return true; } return false; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java index 4798e83..2e7de02 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java @@ -71,7 +71,6 @@ public class EmployeeBatchGetTask { GenericResult> firstPageGenericResult = zwddClient.pageOrganizationEmployeePositions(query); Page data = firstPageGenericResult.getData(); if (CollUtil.isNotEmpty(data.getData())) { - allOrganizationEmployeePositionList.addAll(data.getData()); } Long totalSize = data.getTotalSize(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java new file mode 100644 index 0000000..3231f86 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java @@ -0,0 +1,475 @@ +package com.ningdatech.pmapi.expert.assembler; + +//import com.ningdatech.emapi.common.enumeration.BoolDisplayEnum; +//import com.ningdatech.emapi.common.helper.RegionCache; +//import com.ningdatech.emapi.common.utils.JSONObject; +//import com.ningdatech.emapi.expert.constants.DictExpertInfoTypeEnum; +//import com.ningdatech.emapi.expert.constants.ExpertApplyTypeEnum; +//import com.ningdatech.emapi.expert.constants.ExpertTagEnum; +//import com.ningdatech.emapi.expert.entity.*; +//import com.ningdatech.emapi.expert.entity.domain.*; +//import com.ningdatech.emapi.expert.entity.dto.*; +//import com.ningdatech.emapi.expert.entity.vo.ExpertFullInfoVO; +//import com.ningdatech.emapi.sys.file.entity.FileBasicInfo; +//import com.ningdatech.emapi.sys.file.entity.vo.result.AttachFileVo; +//import com.ningdatech.emapi.sys.meta.entity.RegionDtoMapKey; +//import com.ningdatech.emapi.sys.meta.entity.dto.DictionaryDTO; +//import com.ningdatech.emapi.sys.meta.entity.dto.TagDTO; +//import com.ningdatech.emapi.sys.meta.helper.DictionaryCache; +//import com.ningdatech.emapi.sys.meta.helper.TagCache; + +import com.alibaba.fastjson.JSONObject; +import com.ningdatech.file.entity.vo.result.AttachFileVo; +import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; +import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; +import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; +import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion; +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; +import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.expert.model.*; +import com.ningdatech.pmapi.expert.model.dto.*; +import com.ningdatech.pmapi.expert.model.vo.ExpertFullInfoVO; +import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; +import com.ningdatech.pmapi.meta.constant.ExpertTagEnum; +import com.ningdatech.pmapi.meta.helper.DictionaryCache; +import com.ningdatech.pmapi.meta.helper.TagCache; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import com.ningdatech.pmapi.meta.model.dto.DictionaryDTO; +import com.ningdatech.pmapi.meta.model.dto.TagDTO; +import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; +import com.ningdatech.pmapi.meta.model.entity.ExpertTag; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @author liuxinxin + * @date 2022/7/27 上午10:46 + */ +@Component +@RequiredArgsConstructor +public class ExpertUserInfoAssembler { + + private final TagCache tagCache; + private final DictionaryCache dictionaryCache; +// private final RegionCache regionCache; + + public ExpertFullInfoVO buildExpertFullInfoVO(List attachFiles + , ExpertFullInfoAllDTO expertUserFullInfoAll) { + ExpertUserFullInfoDTO expertUserInfoDTO = expertUserFullInfoAll.getExpertUserInfoDTO(); + // 字典字典段map + Map> dictionaryFieldInfoMap = + buildDictionaryFieldInfoMap(expertUserFullInfoAll.getExpertDictionaryList()); + // 专家文件资料map + Map fileBasicInfoMap = buildFileBasicInfoMap(attachFiles); + // 专家标签字段map + Map> tagFieldInfoMap = buildTagFieldInfoMap(expertUserFullInfoAll.getExpertTagList()); + // 专家履职意向地 + List expertIntentionWorkRegionInfo = + expertUserFullInfoAll.getExpertIntentionWorkRegionInfo(); + // 专家回避单位列表 + List expertAvoidCompanyList = expertUserFullInfoAll.getExpertAvoidCompanyList(); + // 基本信息 + ExpertBasicInfo basicInfo = buildExpertBasicInfo(expertUserInfoDTO, dictionaryFieldInfoMap, tagFieldInfoMap, expertIntentionWorkRegionInfo, fileBasicInfoMap); + // 学历信息 + ExpertEduInfo eduInfo = buildExpertEduInfo(expertUserInfoDTO, dictionaryFieldInfoMap, fileBasicInfoMap); + // 职业信息 + ExpertJobInfo jobInfo = buildExpertJobInfo(expertUserInfoDTO, dictionaryFieldInfoMap); + // 专业信息 + ExpertProfessionalInfo professionalInfo = + buildExpertProfessionalInfo(expertUserInfoDTO, dictionaryFieldInfoMap, tagFieldInfoMap + , fileBasicInfoMap, expertAvoidCompanyList); + // 推荐信息 + ExpertRecommendInfo recommendInfo = new ExpertRecommendInfo(); + recommendInfo.setRecommendedWay(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey())); + recommendInfo.setRecommendationProofFile( + getFileBasicInfoList(fileBasicInfoMap, expertUserInfoDTO.getRecommendationProofFileIdList())); + // 其他信息 + ExpertOtherInfo otherInfo = new ExpertOtherInfo(); + otherInfo.setOther(tagFieldInfoMap.get(ExpertTagEnum.OTHER.getKey())); + otherInfo.setRemark(expertUserInfoDTO.getRemark()); + + // 专家申请履职意向展示列表 + List expertApplyIntentionWorkRegions = expertUserFullInfoAll.getExpertApplyIntentionWorkRegionInfo().stream().map(r -> { + ExpertRegionInfo expertApplyIntentionWorkRegion = new ExpertRegionInfo(); + expertApplyIntentionWorkRegion.setRegionLevel(r.getRegionLevel()); + expertApplyIntentionWorkRegion.setRegionCode(r.getRegionCode()); +// expertApplyIntentionWorkRegion.setRegionName(regionCache.getUnionPathStr(r.getRegionCode(), r.getRegionLevel())); + return expertApplyIntentionWorkRegion; + }).collect(Collectors.toList()); + + + ExpertFullInfoVO expertFullInfoVO = new ExpertFullInfoVO(); + expertFullInfoVO.setUserId(expertUserInfoDTO.getUserId()); + expertFullInfoVO.setBasicInfo(basicInfo); + expertFullInfoVO.setEduInfo(eduInfo); + expertFullInfoVO.setJobInfo(jobInfo); + expertFullInfoVO.setProfessionalInfo(professionalInfo); + expertFullInfoVO.setRecommendInfo(recommendInfo); + expertFullInfoVO.setExpertOtherInfo(otherInfo); + expertFullInfoVO.setExpertApplyIntentionWorkRegions(expertApplyIntentionWorkRegions); + + return expertFullInfoVO; + } + + public static Map buildFileBasicInfoMap(List attachFiles) { + return attachFiles.stream().map(r -> { + FileBasicInfo fileBasicInfo = new FileBasicInfo(); + fileBasicInfo.setFileId(r.getFileId()); + fileBasicInfo.setFileName(r.getOriginalFileName()); + return fileBasicInfo; + }).collect(Collectors.toMap(FileBasicInfo::getFileId, Function.identity())); + } + + public Map> buildTagFieldInfoMap(List expertTagList) { + return expertTagList.stream().map(r -> { + TagFieldInfo tagFieldInfo = new TagFieldInfo(); + tagFieldInfo.setTagCode(r.getTagCode()); + tagFieldInfo.setTagFieldName(r.getExpertInfoField()); + TagDTO tagDTO = tagCache.getByTagCode(r.getTagCode()); + if (Objects.nonNull(tagDTO)) { + tagFieldInfo.setTagName(tagDTO.getTagName()); + } + return tagFieldInfo; + }).collect(Collectors.groupingBy(TagFieldInfo::getTagFieldName)); + } + + public Map> buildDictionaryFieldInfoMap(List expertDictionaryList) { + return expertDictionaryList.stream().map(r -> { + DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); + dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); + dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); + DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); + if (Objects.nonNull(dictionaryDTO)) { + dictionaryFieldInfo.setDictionaryName(dictionaryDTO.getName()); + } + return dictionaryFieldInfo; + }).collect(Collectors.groupingBy(DictionaryFieldInfo::getDictionaryFieldName)); + } + + public static ExpertProfessionalInfo buildExpertProfessionalInfo(ExpertUserFullInfoDTO expertUserInfoDTO + , Map> dictionaryFieldInfoMap, Map> tagFieldInfoMap + , Map fileBasicInfoMap, List expertAvoidCompanyList) { + ExpertProfessionalInfo professionalInfo = new ExpertProfessionalInfo(); + professionalInfo.setTechnicalTitles(expertUserInfoDTO.getTechnicalTitles()); + professionalInfo.setTitleLevel(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey())); + professionalInfo.setTitleCertificateFile(getFileBasicInfoList(fileBasicInfoMap, expertUserInfoDTO.getTitleCertificateFileIdList())); + professionalInfo.setGoodAt(tagFieldInfoMap.get(ExpertTagEnum.GOOD_AT.getKey())); + professionalInfo.setTechnicalExpertise(tagFieldInfoMap.get(ExpertTagEnum.TECHNICAL_EXPERTISE.getKey())); + professionalInfo.setAwards(expertUserInfoDTO.getAwards()); + professionalInfo.setIndustrySector(tagFieldInfoMap.get(ExpertTagEnum.INDUSTRY_SECTOR.getKey())); + professionalInfo.setRecognitionReward(expertUserInfoDTO.getRecognitionReward()); + professionalInfo.setAvoidCompanyList(expertAvoidCompanyList.stream().map(r -> { + ExpertAvoidCompanyInfo expertAvoidCompanyInfo = new ExpertAvoidCompanyInfo(); + expertAvoidCompanyInfo.setCompanyName(r.getCompanyName()); + expertAvoidCompanyInfo.setCompanyUniqCode(r.getCompanyUniqCode()); + return expertAvoidCompanyInfo; + }).collect(Collectors.toList())); + return professionalInfo; + } + + public static ExpertJobInfo buildExpertJobInfo(ExpertUserFullInfoDTO expertUserInfoDTO + , Map> dictionaryFieldInfoMap) { + ExpertJobInfo jobInfo = new ExpertJobInfo(); + jobInfo.setJobStatus(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.JOB_STATUS.getKey())); + jobInfo.setRetiredAt(expertUserInfoDTO.getRetiredAt()); + jobInfo.setCompany(expertUserInfoDTO.getCompany()); + jobInfo.setCompanyUniqCode(expertUserInfoDTO.getCompanyUniqCode()); + jobInfo.setLegalEntityCode(expertUserInfoDTO.getLegalEntityCode()); + jobInfo.setAdministrativeDuties(expertUserInfoDTO.getAdministrativeDuties()); + jobInfo.setStartWorkAt(expertUserInfoDTO.getStartWorkAt()); + jobInfo.setAdministrativeRank(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.ADMINISTRATIVE_RANK.getKey())); + jobInfo.setCompanyAttribute(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey())); + jobInfo.setAddress(expertUserInfoDTO.getAddress()); + jobInfo.setExperience(expertUserInfoDTO.getExperience()); + return jobInfo; + } + + public static ExpertEduInfo buildExpertEduInfo(ExpertUserFullInfoDTO expertUserInfoDTO + , Map> dictionaryFieldInfoMap, Map fileBasicInfoMap) { + // 学历信息 + ExpertEduInfo eduInfo = new ExpertEduInfo(); + eduInfo.setSchool(expertUserInfoDTO.getSchool()); + eduInfo.setGraduatedAt(expertUserInfoDTO.getGraduatedAt()); + eduInfo.setAcademicTitle(expertUserInfoDTO.getAcademicTitle()); + eduInfo.setEdu(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.EDU.getKey())); + eduInfo.setGraduationCertificateFile(getFileBasicInfoList(fileBasicInfoMap + , expertUserInfoDTO.getGraduationCertificateFileIdList())); + eduInfo.setDegree(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.DEGREE.getKey())); + eduInfo.setDegreeCertificateFile(getFileBasicInfoList(fileBasicInfoMap, expertUserInfoDTO.getDegreeCertificateFileIdList())); + return eduInfo; + } + + public static List getFileBasicInfoList(Map fileBasicInfoMap, List fileIdList) { + if (CollectionUtils.isEmpty(fileIdList)) { + return new ArrayList<>(); + } + List fileBasicInfoList = new ArrayList<>(); + for (Long fileId : fileIdList) { + FileBasicInfo fileBasicInfo = fileBasicInfoMap.get(fileId); + if (Objects.nonNull(fileBasicInfo)) { + fileBasicInfoList.add(fileBasicInfo); + } + } + return fileBasicInfoList; + } + + public static FileBasicInfo getFileBasicInfo(Map fileBasicInfoMap, Long fileId) { + if (Objects.isNull(fileId)) { + return null; + } + FileBasicInfo fileBasicInfo = fileBasicInfoMap.get(fileId); + return fileBasicInfo; + } + + public ExpertBasicInfo buildExpertBasicInfo(ExpertUserFullInfoDTO expertUserInfoDTO + , Map> dictionaryFieldInfoMap + , Map> tagFieldInfoMap + , List expertIntentionWorkRegionInfo + , Map fileBasicInfoMap) { + //专家层级 + ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); + expertRegionInfo.setRegionLevel(expertUserInfoDTO.getRegionLevel()); + expertRegionInfo.setRegionCode(expertUserInfoDTO.getRegionCode()); + + // 基本信息 + ExpertBasicInfo basicInfo = new ExpertBasicInfo(); + basicInfo.setIsDingUser(expertUserInfoDTO.getIsDingUser()); + basicInfo.setPhoneNo(expertUserInfoDTO.getPhoneNo()); + basicInfo.setName(expertUserInfoDTO.getName()); + basicInfo.setAvatarFile(getFileBasicInfo(fileBasicInfoMap, expertUserInfoDTO.getAvatarFileId())); + basicInfo.setGender(expertUserInfoDTO.getGender()); + basicInfo.setPolitical(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.POLITICAL.getKey())); + basicInfo.setIdCard(expertUserInfoDTO.getIdCard()); + basicInfo.setOfficePhone(expertUserInfoDTO.getPhoneNo()); + basicInfo.setBirth(expertUserInfoDTO.getBirth()); + basicInfo.setBank(expertUserInfoDTO.getBank()); + basicInfo.setBankNo(expertUserInfoDTO.getBankNo()); + basicInfo.setEmail(expertUserInfoDTO.getEmail()); + basicInfo.setHometown(expertUserInfoDTO.getHometown()); + basicInfo.setNationality(expertUserInfoDTO.getNationality()); + basicInfo.setExpertSource(tagFieldInfoMap.get(ExpertTagEnum.EXPERT_SOURCE.getKey())); + if (Objects.nonNull(expertRegionInfo)) { +// expertRegionInfo.setRegionName(regionCache.getUnionPathStr(expertRegionInfo.getRegionCode(), expertRegionInfo.getRegionLevel())); + basicInfo.setExpertRegionInfo(expertRegionInfo); + } + + basicInfo.setExpertIntentionWorkRegions(expertIntentionWorkRegionInfo.stream().map(r -> { + ExpertRegionInfo expertIntentionWorkRegion = new ExpertRegionInfo(); + expertIntentionWorkRegion.setRegionCode(r.getRegionCode()); + expertIntentionWorkRegion.setRegionLevel(r.getRegionLevel()); +// expertIntentionWorkRegion.setRegionName(regionCache.getUnionPathStr(r.getRegionCode(), r.getRegionLevel())); + return expertIntentionWorkRegion; + }).collect(Collectors.toList())); + basicInfo.setExpertType(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())); + return basicInfo; + } + + public static ExpertFullInfoAllDTO buildExpertFullInfoAllDTO(ExpertUserFullInfo expertUserFullInfo + , List expertTagList + , List expertDictionaryList + , List expertIntentionWorkRegionList + , List expertMetaApplyList + , List expertAvoidCompanyList) { + ExpertUserFullInfoDTO expertUserFullInfoDTO = buildExpertUserFullInfoDTO(expertUserFullInfo); + List expertDictionaryDTOList = buildExpertDictionaryDTOList(expertDictionaryList); + List expertTagDTOList = buildExpertTagDTOList(expertTagList); + List expertIntentionWorkRegionInfo = buildExpertIntentionWorkRegionInfo(expertIntentionWorkRegionList); + + // 专家申请履职意向展示列表 + List expertApplyIntentionWorkRegionInfo = buildExpertApplyIntentionWorkRegionInfo(expertIntentionWorkRegionList, expertMetaApplyList); + List expertAvoidCompanyDTOList = buildExpertAvoidCompanyDTOList(expertAvoidCompanyList); + ExpertFullInfoAllDTO expertFullInfoAllDTO = new ExpertFullInfoAllDTO(); + expertFullInfoAllDTO.setUserId(expertUserFullInfo.getUserId()); + expertFullInfoAllDTO.setExpertUserInfoDTO(expertUserFullInfoDTO); + expertFullInfoAllDTO.setExpertDictionaryList(expertDictionaryDTOList); + expertFullInfoAllDTO.setExpertTagList(expertTagDTOList); + expertFullInfoAllDTO.setExpertIntentionWorkRegionInfo(expertIntentionWorkRegionInfo); + expertFullInfoAllDTO.setExpertApplyIntentionWorkRegionInfo(expertApplyIntentionWorkRegionInfo); + expertFullInfoAllDTO.setExpertAvoidCompanyList(expertAvoidCompanyDTOList); + return expertFullInfoAllDTO; + } + + private static List buildExpertApplyIntentionWorkRegionInfo(List expertIntentionWorkRegionList + , List expertMetaApplyList) { + HashSet set = new HashSet(); + for (ExpertIntentionWorkRegion expertIntentionWorkRegion : expertIntentionWorkRegionList) { + RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); + regionDtoMapKey.setRegionCode(expertIntentionWorkRegion.getRegionCode()); + regionDtoMapKey.setRegionLevel(expertIntentionWorkRegion.getRegionLevel()); + set.add(regionDtoMapKey); + } + + for (ExpertMetaApply expertMetaApply : expertMetaApplyList) { + String applyType = expertMetaApply.getApplyType(); + RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); + regionDtoMapKey.setRegionCode(expertMetaApply.getRegionCode()); + regionDtoMapKey.setRegionLevel(expertMetaApply.getRegionLevel()); + ExpertApplyTypeEnum typeEnum = ExpertApplyTypeEnum.of(applyType); + switch (typeEnum) { + case EXPERT_INTENTION_LEAVE: { + set.remove(regionDtoMapKey); + } + break; + case EXPERT_INTENTION_JOIN: { + set.add(regionDtoMapKey); + } + break; + default: + break; + } + } + return set.stream().map(r -> { + ExpertRegionDTO expertRegionDTO = new ExpertRegionDTO(); + expertRegionDTO.setRegionCode(r.getRegionCode()); + expertRegionDTO.setRegionLevel(r.getRegionLevel()); + return expertRegionDTO; + }).collect(Collectors.toList()); + } + + private static List buildExpertAvoidCompanyDTOList(List expertAvoidCompanyList) { + return expertAvoidCompanyList.stream().map(r -> { + ExpertAvoidCompanyDTO expertAvoidCompanyDTO = new ExpertAvoidCompanyDTO(); + expertAvoidCompanyDTO.setCompanyUniqCode(r.getCompanyUniqCode()); + expertAvoidCompanyDTO.setCompanyName(r.getCompanyName()); + return expertAvoidCompanyDTO; + }).collect(Collectors.toList()); + } + + private static List buildExpertIntentionWorkRegionInfo(List expertIntentionWorkRegionList) { + return expertIntentionWorkRegionList.stream().map(r -> { + ExpertRegionDTO expertRegionDTO = new ExpertRegionDTO(); + expertRegionDTO.setRegionLevel(r.getRegionLevel()); + expertRegionDTO.setRegionCode(r.getRegionCode()); + return expertRegionDTO; + }).collect(Collectors.toList()); + } + + private static List buildExpertTagDTOList(List expertTagList) { + return expertTagList.stream().map(r -> { + ExpertTagDTO expertTagDTO = new ExpertTagDTO(); + expertTagDTO.setExpertInfoField(r.getExpertInfoField()); + expertTagDTO.setTagCode(r.getTagCode()); + return expertTagDTO; + }).collect(Collectors.toList()); + } + + private static List buildExpertDictionaryDTOList(List expertDictionaryList) { + return expertDictionaryList.stream().map(r -> { + ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO(); + expertDictionaryDTO.setExpertInfoField(r.getExpertInfoField()); + expertDictionaryDTO.setDictionaryCode(r.getDictionaryCode()); + return expertDictionaryDTO; + }).collect(Collectors.toList()); + } + + public static ExpertUserFullInfoDTO buildExpertUserFullInfoDTO(ExpertUserFullInfo expertUserFullInfo) { + ExpertUserFullInfoDTO expertUserFullInfoDTO = new ExpertUserFullInfoDTO(); + expertUserFullInfoDTO.setIsDingUser(BoolDisplayEnum.judgeBoolean(expertUserFullInfo.getIsDingUser())); + expertUserFullInfoDTO.setPhoneNo(expertUserFullInfo.getPhoneNo()); + expertUserFullInfoDTO.setGender(expertUserFullInfo.getGender()); + expertUserFullInfoDTO.setName(expertUserFullInfo.getExpertName()); + expertUserFullInfoDTO.setAvatarFileId(expertUserFullInfo.getAvatarFileId()); + expertUserFullInfoDTO.setIdCard(expertUserFullInfo.getIdCard()); + expertUserFullInfoDTO.setOfficePhone(expertUserFullInfo.getOfficePhone()); + expertUserFullInfoDTO.setBirth(expertUserFullInfo.getBirth()); + expertUserFullInfoDTO.setBankNo(expertUserFullInfo.getBankNo()); + expertUserFullInfoDTO.setBank(expertUserFullInfo.getBank()); + expertUserFullInfoDTO.setEmail(expertUserFullInfo.getEmail()); + expertUserFullInfoDTO.setHometown(expertUserFullInfo.getHometown()); + expertUserFullInfoDTO.setNationality(expertUserFullInfo.getNationality()); + + expertUserFullInfoDTO.setSchool(expertUserFullInfo.getSchool()); + expertUserFullInfoDTO.setGraduatedAt(expertUserFullInfo.getGraduatedAt()); + expertUserFullInfoDTO.setAcademicTitle(expertUserFullInfo.getAcademicTitle()); + if (StringUtils.isNotBlank(expertUserFullInfo.getGraduationCertificateFileIdList())) { + expertUserFullInfoDTO.setGraduationCertificateFileIdList(JSONObject.parseArray(expertUserFullInfo.getGraduationCertificateFileIdList(), Long.class)); + } + if (StringUtils.isNotBlank(expertUserFullInfo.getDegreeCertificateFileIdList())) { + expertUserFullInfoDTO.setDegreeCertificateFileIdList(JSONObject.parseArray(expertUserFullInfo.getDegreeCertificateFileIdList(), Long.class)); + } + expertUserFullInfoDTO.setRetiredAt(expertUserFullInfo.getRetiredAt()); + expertUserFullInfoDTO.setCompany(expertUserFullInfo.getCompany()); +// expertUserFullInfoDTO.setCompanyUniqCode(expertUserFullInfo.getCompanyUniqCode()); + expertUserFullInfoDTO.setLegalEntityCode(expertUserFullInfo.getLegalEntityCode()); + expertUserFullInfoDTO.setAdministrativeDuties(expertUserFullInfo.getAdministrativeDuties()); + expertUserFullInfoDTO.setStartWorkAt(expertUserFullInfo.getStartWorkAt()); + expertUserFullInfoDTO.setAddress(expertUserFullInfo.getAddress()); + expertUserFullInfoDTO.setExperience(expertUserFullInfo.getExperience()); + + expertUserFullInfoDTO.setTechnicalTitles(expertUserFullInfo.getTechnicalTitles()); + if (StringUtils.isNotBlank(expertUserFullInfo.getTitleCertificateFileIdList())) { + expertUserFullInfoDTO.setTitleCertificateFileIdList(JSONObject.parseArray(expertUserFullInfo.getTitleCertificateFileIdList(), Long.class)); + } + expertUserFullInfoDTO.setAwards(expertUserFullInfo.getAwards()); + expertUserFullInfoDTO.setRecognitionReward(expertUserFullInfo.getRecognitionReward()); + + expertUserFullInfoDTO.setRegionCode(expertUserFullInfo.getRegionCode()); + expertUserFullInfoDTO.setRegionLevel(expertUserFullInfo.getRegionLevel()); + + if (StringUtils.isNotBlank(expertUserFullInfo.getRecommendationProofFileIdList())) { + expertUserFullInfoDTO.setRecommendationProofFileIdList(JSONObject.parseArray(expertUserFullInfo.getRecommendationProofFileIdList(), Long.class)); + } + expertUserFullInfoDTO.setRemark(expertUserFullInfo.getRemark()); + + return expertUserFullInfoDTO; + } + +// public static ExpertAdminExpertManageListDTO buildExpertAdminExpertManageListDTO(ExpertUserFullInfo expertUserFullInfo +// , Map> expertDictionaryMap, Map> expertTagMap) { +// Long userId = expertUserFullInfo.getUserId(); +// ExpertAdminExpertManageListDTO expertAdminExpertManageListDTO = new ExpertAdminExpertManageListDTO(); +// expertAdminExpertManageListDTO.setUserId(expertUserFullInfo.getUserId()); +// expertAdminExpertManageListDTO.setExpertName(expertUserFullInfo.getName()); +// expertAdminExpertManageListDTO.setPhoneNo(expertUserFullInfo.getPhoneNo()); +// expertAdminExpertManageListDTO.setIsDingUser(BoolDisplayEnum.judgeBoolean(expertUserFullInfo.getIsDingUser())); +// expertAdminExpertManageListDTO.setCompany(expertUserFullInfo.getCompany()); +// expertAdminExpertManageListDTO.setLegalEntityCode(expertUserFullInfo.getLegalEntityCode()); +// expertAdminExpertManageListDTO.setExpertAccountStatus(expertUserFullInfo.getExpertAccountStatus()); +// +// // 装配字典数据 +// List userExpertDictionaryList = Objects.isNull(expertDictionaryMap.get(userId)) ? new ArrayList<>() : expertDictionaryMap.get(userId); +// Map> fieldExpertDictionaryMap = userExpertDictionaryList.stream().collect(Collectors.groupingBy(ExpertDictionary::getExpertInfoField)); +// expertAdminExpertManageListDTO.setExpertType( +// DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey()))); +// expertAdminExpertManageListDTO.setCompanyAttribute( +// DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey()))); +// expertAdminExpertManageListDTO.setTitleLevel( +// DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.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)); +// expertAdminExpertManageListDTO.setExpertSource( +// TagAssembler.toTagFieldInfoList(fieldExpertTagMap.get(ExpertTagEnum.EXPERT_SOURCE.getKey()))); +// +// if (StringUtils.isNotBlank(expertUserFullInfo.getRegionCode()) && Objects.nonNull(expertUserFullInfo.getRegionLevel())) { +// ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); +// expertRegionInfo.setRegionLevel(expertUserFullInfo.getRegionLevel()); +// expertRegionInfo.setRegionCode(expertUserFullInfo.getRegionCode()); +// expertAdminExpertManageListDTO.setExpertRegionInfo(expertRegionInfo); +// } +// +// // 以下数据为专家excel导出使用 +// expertAdminExpertManageListDTO.setGender(expertUserFullInfo.getGender()); +// expertAdminExpertManageListDTO.setBirth(expertUserFullInfo.getBirth()); +// expertAdminExpertManageListDTO.setHometown(expertUserFullInfo.getHometown()); +// expertAdminExpertManageListDTO.setNationality(expertUserFullInfo.getNationality()); +// expertAdminExpertManageListDTO.setPolitical( +// DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.POLITICAL.getKey()))); +// expertAdminExpertManageListDTO.setIdCard(expertUserFullInfo.getIdCard()); +// expertAdminExpertManageListDTO.setBankNo(expertUserFullInfo.getBankNo()); +// expertAdminExpertManageListDTO.setEdu( +// DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.EDU.getKey()))); +// expertAdminExpertManageListDTO.setRecommendedWay( +// DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey()))); +// return expertAdminExpertManageListDTO; +// +// } + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/RegionWrapperAssembler.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/RegionWrapperAssembler.java new file mode 100644 index 0000000..80a0cf1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/RegionWrapperAssembler.java @@ -0,0 +1,39 @@ +package com.ningdatech.pmapi.expert.assembler; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; +import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/8/10 下午5:36 + */ + +public class RegionWrapperAssembler { + + public static void expertUserFullInfoRegionContainsWrapperAssembler(LambdaQueryWrapper wrapperQuery, List containsRegionList) { + for (RegionContainsBO regionContainsBO : containsRegionList) { + List containsRegionCodeList = regionContainsBO.getContainsRegionCodeList(); + Integer parentRegionTreeLevel = regionContainsBO.getParentRegionTreeLevel(); + if (CollectionUtils.isNotEmpty(containsRegionCodeList)) { + wrapperQuery.and(wrapper -> wrapper.in(ExpertUserFullInfo::getRegionCode, containsRegionCodeList) + .ge(ExpertUserFullInfo::getRegionLevel, parentRegionTreeLevel)); + } + } + } + + public static void expertMetaApplyRegionContainsWrapperAssembler(LambdaQueryWrapper wrapperQuery, List containsRegionList) { + for (RegionContainsBO regionContainsBO : containsRegionList) { + List containsRegionCodeList = regionContainsBO.getContainsRegionCodeList(); + Integer parentRegionTreeLevel = regionContainsBO.getParentRegionTreeLevel(); + if (CollectionUtils.isNotEmpty(containsRegionCodeList)) { + wrapperQuery.and(wrapper -> wrapper.in(ExpertMetaApply::getRegionCode, containsRegionCodeList) + .ge(ExpertMetaApply::getRegionLevel, parentRegionTreeLevel)); + } + } + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyStatusEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyStatusEnum.java new file mode 100644 index 0000000..f56b30a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyStatusEnum.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.expert.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.apache.commons.lang3.StringUtils; + +/** + * @author liuxinxin + * @date 2022/7/26 下午1:38 + */ +@AllArgsConstructor +@Getter +public enum ExpertApplyStatusEnum { + + // 待审核 + PENDING_REVIEW("pending_review"), + // 审核通过 + PASSED("passed"), + // 审核不通过 + REFUSED("refused"), + // 已撤销 + REVOKED("revoked"); + private final String key; + + public static boolean contains(String key) { + if (StringUtils.isBlank(key)) { + return false; + } + for (ExpertApplyStatusEnum statusEnum : ExpertApplyStatusEnum.values()) { + if (statusEnum.key.equals(key)) { + return true; + } + } + return false; + } + + public static ExpertApplyStatusEnum of(String key) { + for (ExpertApplyStatusEnum statusEnum : ExpertApplyStatusEnum.values()) { + if (statusEnum.key.equals(key)) { + return statusEnum; + } + } + throw new IllegalArgumentException(String.format("Illegal ExpertApplyStatusEnum = %s", key)); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeEnum.java new file mode 100644 index 0000000..19b173a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeEnum.java @@ -0,0 +1,52 @@ +package com.ningdatech.pmapi.expert.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.apache.commons.lang3.StringUtils; + +/** + * @author liuxinxin + * @date 2022/7/26 下午1:40 + * 专家审核申请类型 + */ +@AllArgsConstructor +@Getter +public enum ExpertApplyTypeEnum { + + // 专家入库 + EXPERT_STORAGE("expert_storage"), + // 专家出库 + EXPERT_DELIVERY("expert_delivery"), + // 专家履职意向加入 + EXPERT_INTENTION_JOIN("expert_intention_join"), + // 专家履职意向退出 + EXPERT_INTENTION_LEAVE("expert_intention_leave"), + // 长期请假申请 + LONG_TERM_LEAVE("long_term_leave"), + // 专家信息修改申请 + EXPERT_INFO_MODIFY("expert_info_modify"); + + private final String key; + + public static boolean contains(String key) { + if (StringUtils.isBlank(key)) { + return false; + } + for (ExpertApplyTypeEnum typeEnum : ExpertApplyTypeEnum.values()) { + if (typeEnum.key.equals(key)) { + return true; + } + } + return false; + } + + public static ExpertApplyTypeEnum of(String key) { + for (ExpertApplyTypeEnum typeEnum : ExpertApplyTypeEnum.values()) { + if (typeEnum.key.equals(key)) { + return typeEnum; + } + } + throw new IllegalArgumentException(String.format("IllegalExpertApplyTypeEnum = %s", key)); + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeQueryEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeQueryEnum.java new file mode 100644 index 0000000..11701dc --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeQueryEnum.java @@ -0,0 +1,50 @@ +package com.ningdatech.pmapi.expert.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.apache.commons.lang3.StringUtils; + +/** + * @author liuxinxin + * @date 2022/7/26 下午1:40 + * 专家 申请类型用于前端筛选时入参展示 + */ +@AllArgsConstructor +@Getter +public enum ExpertApplyTypeQueryEnum { + + // 专家入库 + EXPERT_STORAGE("expert_storage"), + // 专家出库 + EXPERT_DELIVERY("expert_delivery"), + // 专家履职意变更 + EXPERT_INTENTION_CHANGE("expert_intention_change"), + // 长期请假申请 + LONG_TERM_LEAVE("long_term_leave"), + // 专家信息修改申请 + EXPERT_INFO_MODIFY("expert_info_modify"); + + private final String key; + + public static boolean contains(String key) { + if (StringUtils.isBlank(key)) { + return false; + } + for (ExpertApplyTypeQueryEnum typeEnum : ExpertApplyTypeQueryEnum.values()) { + if (typeEnum.key.equals(key)) { + return true; + } + } + return false; + } + + public static ExpertApplyTypeQueryEnum of(String key) { + for (ExpertApplyTypeQueryEnum typeEnum : ExpertApplyTypeQueryEnum.values()) { + if (typeEnum.key.equals(key)) { + return typeEnum; + } + } + throw new IllegalArgumentException(String.format("ExpertApplyTypeQueryEnum = %s", key)); + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/QueryExpertAccountStatusEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/QueryExpertAccountStatusEnum.java new file mode 100644 index 0000000..63f6111 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/QueryExpertAccountStatusEnum.java @@ -0,0 +1,49 @@ +package com.ningdatech.pmapi.expert.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.apache.commons.lang3.StringUtils; + +/** + * @author liuxinxin + * @date 2022/8/4 上午11:14 + */ +@AllArgsConstructor +@Getter +public enum QueryExpertAccountStatusEnum { + + + /** + * 冻结中 + */ + FREEZING("freezing"), + + /** + * 正常 + */ + NORMAL("normal"); + + private final String key; + + public static boolean contains(String key) { + if (StringUtils.isBlank(key)) { + return false; + } + for (QueryExpertAccountStatusEnum statusEnum : QueryExpertAccountStatusEnum.values()) { + if (statusEnum.key.equals(key)) { + return true; + } + } + return false; + } + + + public static QueryExpertAccountStatusEnum of(String key) { + for (QueryExpertAccountStatusEnum statusEnum : QueryExpertAccountStatusEnum.values()) { + if (statusEnum.key.equals(key)) { + return statusEnum; + } + } + throw new IllegalArgumentException(String.format("Illegal QueryExpertAccountStatusEnum = %s", key)); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertAvoidCompanyController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertAvoidCompanyController.java deleted file mode 100644 index e078e71..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertAvoidCompanyController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.ningdatech.pmapi.expert.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.stereotype.Controller; - -/** - *

- * 前端控制器 - *

- * - * @author Liuxinxin - * @since 2023-02-23 - */ -@Controller -@RequestMapping("/pmapi.expert/expert-avoid-company") -public class ExpertAvoidCompanyController { - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java index 5f9b29f..b0309fa 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java @@ -1,15 +1,18 @@ package com.ningdatech.pmapi.expert.controller; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.expert.manage.ExpertAdminManage; import com.ningdatech.pmapi.expert.manage.ExpertManage; +import com.ningdatech.pmapi.expert.model.ExpertAdminExpertManageQuery; +import com.ningdatech.pmapi.expert.model.req.ExpertRecommendProofSubmitRequest; import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest; +import com.ningdatech.pmapi.expert.model.vo.ExpertAdminExpertManageListVO; +import com.ningdatech.pmapi.expert.model.vo.ExpertFullInfoVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -28,6 +31,7 @@ import javax.validation.Valid; public class ExpertController { private final ExpertManage expertManage; + private final ExpertAdminManage expertAdminManage; @PostMapping("/basic-info-submit") @ApiOperation("填写基本信息接口(专家报名使用))") @@ -36,5 +40,23 @@ public class ExpertController { expertManage.expertBasicInfoSubmit(request); } + @PostMapping("/recommend-proof-submit") + @ApiOperation("推荐证明提交接口(专家报名使用)") + public void expertRecommendProofSubmit(@Valid @RequestBody ExpertRecommendProofSubmitRequest request) { + expertManage.expertRecommendProofSubmit(request); + } + + @GetMapping("/detail") + @ApiOperation("专家获取专家详细信息") + public ExpertFullInfoVO getExpertFullInfoDetail() { + return expertManage.getExpertFullInfoDetail(null); + } + + @PostMapping("/expert-library/list") + @ApiOperation("专家库列表查询接口") + public PageVo getExpertLibraryList( + @RequestBody @Valid ExpertAdminExpertManageQuery expertAdminExpertManageQuery) { + return expertAdminManage.getExpertLibraryList(expertAdminExpertManageQuery); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertIntentionWorkRegionController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertIntentionWorkRegionController.java deleted file mode 100644 index 55ef1a5..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertIntentionWorkRegionController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.ningdatech.pmapi.expert.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.stereotype.Controller; - -/** - *

- * 前端控制器 - *

- * - * @author Liuxinxin - * @since 2023-02-22 - */ -@Controller -@RequestMapping("/pmapi.expert/expert-intention-work-region") -public class ExpertIntentionWorkRegionController { - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java new file mode 100644 index 0000000..7060bb0 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java @@ -0,0 +1,61 @@ +package com.ningdatech.pmapi.expert.controller; + + +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.expert.manage.ExpertMetaApplyManage; +import com.ningdatech.pmapi.expert.model.cmd.MetaApplyListQuery; +import com.ningdatech.pmapi.expert.model.req.MetaApplyResultRequest; +import com.ningdatech.pmapi.expert.model.vo.ExpertApplyMetaVO; +import com.ningdatech.pmapi.expert.model.vo.MetaApplyResultVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + *

+ * 前端控制器 + *

+ * + * @author Liuxinxin + * @since 2023-03-01 + */ +@RestController +@RequestMapping("/api/v1/apply/meta/") +@Validated +@RequiredArgsConstructor +@Api(value = "ExpertMetaApplyController", tags = "专家申请管理相关接口") +public class ExpertMetaApplyController { + + private final ExpertMetaApplyManage expertMetaApplyManage; + + @PostMapping("/list") + @ApiOperation(value = "审核列表筛选") + public PageVo metaApplyListQuery(@RequestBody @Valid MetaApplyListQuery metaApplyListQuery) { +// ExpertMetaApplyValidator.metaApplyListQueryValidate(metaApplyListQuery); + return expertMetaApplyManage.metaApplyListQuery(metaApplyListQuery); + } + + @PostMapping("/result") + @ApiOperation(value = "审核结果处理") + public void metaApplyResult(@RequestBody @Valid MetaApplyResultRequest applyResultRequest) { + expertMetaApplyManage.metaApplyResult(applyResultRequest); + } + + @PostMapping("/revoke/{applyId}") + @ApiOperation(value = "申请撤销") + public void metaApplyRevoke(@PathVariable Long applyId) { + expertMetaApplyManage.metaApplyRevoke(applyId); + } + + @ApiOperation("申请审核详情") + @GetMapping("/detail/{applyId}") + public MetaApplyResultVo applyAuditDetail(@PathVariable Long applyId) { + return expertMetaApplyManage.metaApplyResult(applyId); + } + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertMetaApply.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertMetaApply.java new file mode 100644 index 0000000..46c6296 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertMetaApply.java @@ -0,0 +1,61 @@ +package com.ningdatech.pmapi.expert.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author Liuxinxin + * @since 2023-03-01 + */ +@TableName("expert_meta_apply") +@ApiModel(value = "ExpertMetaApply对象", description = "") +@Data +public class ExpertMetaApply implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + private LocalDateTime createOn; + + private LocalDateTime updateOn; + + private Long createBy; + + private Long updateBy; + + private String applyType; + + private Long userId; + + private Long approverUserId; + + private String applyStatus; + + private LocalDateTime reviewTime; + + private String auditOpinion; + + private String regionCode; + + private String approver; + + private Integer regionLevel; + + private Long applicantId; + + private String extraMaterial; + + private String displayEnable; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java index e89563e..0516acb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java @@ -11,7 +11,7 @@ import java.time.LocalDateTime; /** *

- * + * *

* * @author Liuxinxin diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertInfoCommonHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertInfoCommonHelper.java new file mode 100644 index 0000000..fe63c30 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertInfoCommonHelper.java @@ -0,0 +1,46 @@ +package com.ningdatech.pmapi.expert.helper; + +import com.ningdatech.pmapi.expert.model.dto.ExpertFullInfoAllDTO; +import com.ningdatech.pmapi.expert.model.dto.ExpertUserFullInfoDTO; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * @author liuxinxin + * @date 2022/7/28 上午10:18 + */ +@Component +public class ExpertInfoCommonHelper { + + /** + * 获取专家的所有文件id + * 头像,学位证书,毕业证书,推荐证明材料,职称证明 + * + * @param expertUserFullInfoAll + * @return + */ + public List getExpertFileIdList(ExpertFullInfoAllDTO expertUserFullInfoAll) { + ExpertUserFullInfoDTO expertUserInfoDTO = expertUserFullInfoAll.getExpertUserInfoDTO(); + List fileIdList = new ArrayList<>(); + if (Objects.nonNull(expertUserInfoDTO.getAvatarFileId())) { + fileIdList.add(expertUserInfoDTO.getAvatarFileId()); + } + if (CollectionUtils.isNotEmpty(expertUserInfoDTO.getDegreeCertificateFileIdList())) { + fileIdList.addAll(expertUserInfoDTO.getDegreeCertificateFileIdList()); + } + if (CollectionUtils.isNotEmpty(expertUserInfoDTO.getGraduationCertificateFileIdList())) { + fileIdList.addAll(expertUserInfoDTO.getGraduationCertificateFileIdList()); + } + if (CollectionUtils.isNotEmpty(expertUserInfoDTO.getRecommendationProofFileIdList())) { + fileIdList.addAll(expertUserInfoDTO.getRecommendationProofFileIdList()); + } + if (CollectionUtils.isNotEmpty(expertUserInfoDTO.getTitleCertificateFileIdList())) { + fileIdList.addAll(expertUserInfoDTO.getTitleCertificateFileIdList()); + } + return fileIdList; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java new file mode 100644 index 0000000..49655b7 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java @@ -0,0 +1,142 @@ +package com.ningdatech.pmapi.expert.manage; + +import cn.hutool.core.collection.CollectionUtil; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.common.helper.RegionLimitHelper; +import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; +import com.ningdatech.pmapi.expert.constant.QueryExpertAccountStatusEnum; +import com.ningdatech.pmapi.expert.helper.PermissionCheckHelper; +import com.ningdatech.pmapi.expert.model.ExpertAdminExpertManageQuery; +import com.ningdatech.pmapi.expert.model.cmd.ExpertAdminExpertManageQueryCmd; +import com.ningdatech.pmapi.expert.model.query.ExpertDictionaryQuery; +import com.ningdatech.pmapi.expert.model.query.ExpertTagQuery; +import com.ningdatech.pmapi.expert.model.vo.ExpertAdminExpertManageListVO; +import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; +import com.ningdatech.pmapi.meta.constant.ExpertTagEnum; +import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import lombok.RequiredArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * @author liuxinxin + * @date 2023/3/1 下午2:12 + */ + +@Component +@RequiredArgsConstructor +public class ExpertAdminManage { + + private final PermissionCheckHelper permissionCheckHelper; + private final RegionLimitHelper regionLimitHelper; + + /** + * 专家管理员使用 专家库列表查询 + * + * @param query + * @return + */ + public PageVo getExpertLibraryList(ExpertAdminExpertManageQuery query) { + Long userId = LoginUserUtil.getUserId(); + ExpertAdminExpertManageQueryCmd expertAdminExpertManageQueryCmd = buildExpertAdminExpertManageQueryCmd(query, userId); +// CommonPage pageResult = +// expertAdminManageService.getExpertLibraryList(expertAdminExpertManageQueryCmd); +// +// PageVo pageVo = new PageVo<>(); +// pageVo.setTotal(pageResult.getItemsTotal()); +// pageVo.setRecords(expertAdminExpertManageAssembler.toExpertAdminExpertManageListVOList(pageResult.getItems())); +// return pageVo; + return null; + } + + + private ExpertAdminExpertManageQueryCmd buildExpertAdminExpertManageQueryCmd(ExpertAdminExpertManageQuery query, Long userId) { + ExpertAdminExpertManageQueryCmd expertAdminExpertManageQueryCmd = new ExpertAdminExpertManageQueryCmd(); + expertAdminExpertManageQueryCmd.setPageNumber(query.getPageNumber()); + expertAdminExpertManageQueryCmd.setPageSize(query.getPageSize()); + if (StringUtils.isNotBlank(query.getExpertName())) { + expertAdminExpertManageQueryCmd.setExpertName(query.getExpertName()); + } + if (StringUtils.isNotBlank(query.getCompany())) { + expertAdminExpertManageQueryCmd.setCompany(query.getCompany()); + } + List expertDictionaryQueryList = new ArrayList<>(); + if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) { + ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery(); + expertDictionaryQuery.setExpertInfoField(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey()); + expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode())); + expertDictionaryQueryList.add(expertDictionaryQuery); + } + if (StringUtils.isNotBlank(query.getCompanyAttributeDictionaryCode())) { + ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery(); + expertDictionaryQuery.setExpertInfoField(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey()); + expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getCompanyAttributeDictionaryCode())); + expertDictionaryQueryList.add(expertDictionaryQuery); + } + if (StringUtils.isNotBlank(query.getExpertTypeDictionaryCode())) { + ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery(); + expertDictionaryQuery.setExpertInfoField(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey()); + expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getExpertTypeDictionaryCode())); + expertDictionaryQueryList.add(expertDictionaryQuery); + } + List expertTagQueryList = new ArrayList<>(); + if (StringUtils.isNotBlank(query.getExpertSourceTagCode())) { + ExpertTagQuery expertTagQuery = new ExpertTagQuery(); + expertTagQuery.setExpertInfoField(ExpertTagEnum.EXPERT_SOURCE.getKey()); + expertTagQuery.setTagCodeList(CollectionUtil.toList(query.getExpertSourceTagCode())); + expertTagQueryList.add(expertTagQuery); + } + if (StringUtils.isNotBlank(query.getGoodAtTagCode())) { + ExpertTagQuery expertTagQuery = new ExpertTagQuery(); + expertTagQuery.setExpertInfoField(ExpertTagEnum.GOOD_AT.getKey()); + expertTagQuery.setTagCodeList(CollectionUtil.toList(query.getGoodAtTagCode())); + expertTagQueryList.add(expertTagQuery); + } + if (StringUtils.isNotBlank(query.getExpertAccountStatus())) { + QueryExpertAccountStatusEnum queryExpertAccountStatusEnum = QueryExpertAccountStatusEnum.of(query.getExpertAccountStatus()); + switch (queryExpertAccountStatusEnum) { + case NORMAL: + expertAdminExpertManageQueryCmd + .setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.AVAILABLE)); + break; + case FREEZING: + expertAdminExpertManageQueryCmd + .setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.FREEZE)); + break; + default: + break; + } + } else { + expertAdminExpertManageQueryCmd + .setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.AVAILABLE, ExpertAccountStatusEnum.FREEZE)); + } + + List expertAdminContainsRegionList = new ArrayList<>(); + + // 如果为超级管理员,可以查看所有的专家,包括没有层级的专家 + if (!permissionCheckHelper.isSuperAdmin()) { + expertAdminContainsRegionList = regionLimitHelper.getExpertAdminContainsRegion(userId); + } + List containsRegion = new ArrayList<>(); + if (Objects.nonNull(query.getExpertRegionInfo())) { + RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegionInfo().getRegionLevel() + , query.getExpertRegionInfo().getRegionCode()); + containsRegion = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList); + } else { + containsRegion = expertAdminContainsRegionList; + } + expertAdminExpertManageQueryCmd.setExpertDictionaryQueryList(expertDictionaryQueryList); + expertAdminExpertManageQueryCmd.setExpertTagQueryList(expertTagQueryList); + expertAdminExpertManageQueryCmd.setIsDingUser(query.getIsDingUser()); + expertAdminExpertManageQueryCmd.setRegionContainsList(containsRegion); + expertAdminExpertManageQueryCmd.setPageSize(query.getPageSize()); + expertAdminExpertManageQueryCmd.setPageNumber(query.getPageNumber()); + return expertAdminExpertManageQueryCmd; + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java index f9b55dd..3ca3ddd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java @@ -1,25 +1,36 @@ package com.ningdatech.pmapi.expert.manage; +import com.ningdatech.basic.exception.BizException; +import com.ningdatech.file.entity.vo.result.AttachFileVo; +import com.ningdatech.file.service.FileService; import com.ningdatech.pmapi.expert.assembler.ExpertInfoCmdAssembler; +import com.ningdatech.pmapi.expert.assembler.ExpertUserInfoAssembler; import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; import com.ningdatech.pmapi.expert.constant.ExpertUserInfoStepEnum; import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.expert.helper.ExpertInfoCommonHelper; import com.ningdatech.pmapi.expert.helper.ExpertManageHelper; -import com.ningdatech.pmapi.expert.model.ExpertBasicInfo; -import com.ningdatech.pmapi.expert.model.ExpertEduInfo; -import com.ningdatech.pmapi.expert.model.ExpertJobInfo; -import com.ningdatech.pmapi.expert.model.ExpertProfessionalInfo; +import com.ningdatech.pmapi.expert.model.*; import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; +import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd; +import com.ningdatech.pmapi.expert.model.dto.ExpertDictionaryDTO; +import com.ningdatech.pmapi.expert.model.dto.ExpertFullInfoAllDTO; +import com.ningdatech.pmapi.expert.model.req.ExpertRecommendProofSubmitRequest; import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest; +import com.ningdatech.pmapi.expert.model.vo.ExpertFullInfoVO; import com.ningdatech.pmapi.expert.service.ExpertInfoService; import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; import com.ningdatech.pmapi.user.util.LoginUserUtil; import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Component; +import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * @author liuxinxin @@ -31,10 +42,11 @@ import java.util.Objects; public class ExpertManage { private final ExpertManageHelper expertManageHelper; - private final IExpertUserFullInfoService iExpertUserFullInfoService; - private final ExpertInfoService expertInfoService; + private final ExpertInfoCommonHelper expertInfoCommonHelper; + private final FileService fileService; + private final ExpertUserInfoAssembler expertUserInfoAssembler; /** @@ -75,4 +87,51 @@ public class ExpertManage { } + public void expertRecommendProofSubmit(ExpertRecommendProofSubmitRequest request) { + // 用户id + Long expertUserId = LoginUserUtil.getUserId(); + ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(expertUserId); + // 判断专家状态,是否可以进行证明材料提交 + if (Objects.isNull(expertUserFullInfo) + || !ExpertAccountStatusEnum.APPLYING.getKey().equals(expertUserFullInfo.getExpertAccountStatus()) + || ExpertUserInfoStepEnum.EVIDENCE_HAS_BEEN_SUBMITTED.getKey().equals(expertUserFullInfo.getUserInfoStep())) { + throw new BizException("当前状态无法提交证明材料"); + } + // 根据用户id 获取用户信息,获取手机号校验 验证码是否正确 + String phoneNo = expertUserFullInfo.getPhoneNo(); + String verificationCode = request.getVerificationCode(); + + // 证明材料提交 + List recommendProofFile = request.getRecommendProofFile(); + List recommendedWayList = request.getRecommendedWay(); + ExpertRecommendProofSaveCmd expertRecommendProofSaveCmd = new ExpertRecommendProofSaveCmd(); + if (CollectionUtils.isNotEmpty(recommendProofFile)) { + expertRecommendProofSaveCmd.setRecommendationProofFileIdList(recommendProofFile.stream().map(FileBasicInfo::getFileId).collect(Collectors.toList())); + } + List recommendedWayDictionaryDTOList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(recommendedWayList)) { + recommendedWayDictionaryDTOList = recommendedWayList.stream().map(r -> { + ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO(); + expertDictionaryDTO.setDictionaryCode(r.getDictionaryCode()); + expertDictionaryDTO.setExpertInfoField(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey()); + return expertDictionaryDTO; + }).collect(Collectors.toList()); + } + expertRecommendProofSaveCmd.setRecommendedWay(recommendedWayDictionaryDTOList); + expertRecommendProofSaveCmd.setUserId(expertUserId); + expertInfoService.expertRecommendProofSave(expertRecommendProofSaveCmd); + } + + public ExpertFullInfoVO getExpertFullInfoDetail(Long expertUserId) { + Long currentUserId = LoginUserUtil.getUserId(); + if (Objects.isNull(expertUserId)) { + expertUserId = currentUserId; + } + ExpertFullInfoAllDTO expertUserFullInfoAll = expertInfoService.getExpertUserFullInfoAll(expertUserId); + if (Objects.isNull(expertUserFullInfoAll)) { + return null; + } + List fileIdList = expertInfoCommonHelper.getExpertFileIdList(expertUserFullInfoAll); + List attachFiles = fileService.getByIds(fileIdList); + return expertUserInfoAssembler.buildExpertFullInfoVO(attachFiles, expertUserFullInfoAll); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java new file mode 100644 index 0000000..2348321 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java @@ -0,0 +1,527 @@ +package com.ningdatech.pmapi.expert.manage; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.CollectionUtil; +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.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; +import com.ningdatech.pmapi.common.helper.RegionLimitHelper; +import com.ningdatech.pmapi.common.helper.UserInfoHelper; +import com.ningdatech.pmapi.common.util.BizUtils; +import com.ningdatech.pmapi.expert.assembler.RegionWrapperAssembler; +import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum; +import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; +import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeQueryEnum; +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; +import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo; +import com.ningdatech.pmapi.expert.model.TagFieldInfo; +import com.ningdatech.pmapi.expert.model.cmd.ExpertAdminExpertManageQueryCmd; +import com.ningdatech.pmapi.expert.model.cmd.ExpertStorageDealCmd; +import com.ningdatech.pmapi.expert.model.cmd.MetaApplyListQuery; +import com.ningdatech.pmapi.expert.model.dto.ExpertDictionaryDTO; +import com.ningdatech.pmapi.expert.model.dto.ExpertTagDTO; +import com.ningdatech.pmapi.expert.model.query.ExpertDictionaryQuery; +import com.ningdatech.pmapi.expert.model.req.MetaApplyResultRequest; +import com.ningdatech.pmapi.expert.model.vo.ExpertApplyMetaVO; +import com.ningdatech.pmapi.expert.model.vo.MetaApplyResultVo; +import com.ningdatech.pmapi.expert.service.ExpertInfoService; +import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService; +import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; +import com.ningdatech.pmapi.meta.helper.DictionaryCache; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; +import com.ningdatech.pmapi.meta.model.dto.DictionaryDTO; +import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; +import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import lombok.RequiredArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * @author liuxinxin + * @date 2023/3/1 上午10:38 + */ + +@Component +@RequiredArgsConstructor +public class ExpertMetaApplyManage { + + private final IExpertMetaApplyService iMetaApplyService; + private final IExpertDictionaryService expertDictionaryService; + + // private final IExpertAdminManageService ExpertAdminManageService; + private final IExpertUserFullInfoService userFullInfoService; + private final DictionaryCache dictionaryCache; + + private final ExpertInfoService expertInfoService; + + private final UserInfoHelper userInfoHelper; + + private final RegionLimitHelper regionLimitHelper; + + + public PageVo metaApplyListQuery(MetaApplyListQuery req) { + Long expertAdminUserId = LoginUserUtil.getUserId(); + // 查找符合专家条件的用户id + List viewRegions = regionLimitHelper.getExpertAdminContainsRegion(expertAdminUserId); + ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(req, viewRegions); + // TODO +// List filterExpertUserIdList = expertAdminManageService.filterExpertUserIdList(queryCmd); + List filterExpertUserIdList = new ArrayList<>(); + if (CollUtil.isEmpty(filterExpertUserIdList)) { + return PageVo.empty(); + } + + LambdaQueryWrapper expertMetaApplyListQuery = + buildMetaApplyListQueryWrapper(req, filterExpertUserIdList, viewRegions); + + RegionWrapperAssembler.expertMetaApplyRegionContainsWrapperAssembler(expertMetaApplyListQuery, viewRegions); + Page pageResult = iMetaApplyService.page(req.page(), expertMetaApplyListQuery); + PageVo result = new PageVo<>(); + result.setTotal(pageResult.getTotal()); + BizUtils.notEmpty(pageResult.getRecords(), records -> { + List expertIds = CollUtils.fieldList(records, ExpertMetaApply::getUserId); + // 根据用户id 获取专家基本信息 + List expertList = userFullInfoService.listByUserIds(expertIds); + Map expertMap = CollUtils.listToMap(expertList, ExpertUserFullInfo::getUserId); + List expertDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.TITLE_LEVEL); + Map> dictMap = CollUtils.group(expertDictList, ExpertDictionary::getUserId); + result.setRecords(buildExpertApplyMetaVOList(records, expertMap, dictMap)); + }); + return result; + } + + @Transactional(rollbackFor = Exception.class) + public void metaApplyResult(MetaApplyResultRequest req) { + Long applyId = req.getApplyId(); + ExpertMetaApply expertMetaApply = iMetaApplyService.getById(applyId); + Long userId = LoginUserUtil.getUserId(); + + // 校验专家管理员区域权限,是否可以审核当前专家申请 +// permissionCheckHelper.operationPermissionsCheck(userId, expertMetaApply.getUserId()); + String applyStatus = expertMetaApply.getApplyStatus(); + if (!ExpertApplyStatusEnum.PENDING_REVIEW.getKey().equals(applyStatus)) { + throw BizException.wrap("apply is already processed"); + } + ExpertApplyTypeEnum applyType = ExpertApplyTypeEnum.of(expertMetaApply.getApplyType()); + boolean applyResult = req.getApplyResult(); + + switch (applyType) { + // 专家入库 + case EXPERT_STORAGE: { + ExpertStorageDealCmd expertStorageDealCmd = buildExpertStorageDealCmd(req, expertMetaApply.getUserId(), expertMetaApply); + expertInfoService.expertStorageDeal(expertStorageDealCmd); + // 专家入库时,需要先审核专家入库,入库成功后,再履职意向审核,如果履职意向跟专家层级是同一层级的,就直接同意不需要审核 + if (applyResult) { + Long expertUserId = expertMetaApply.getUserId(); +// ExpertRegionInfo expertRegionInfo = expertUserInfoHelper.getExpertRegionInfo(expertUserId); +// Integer regionLevel = expertRegionInfo.getRegionLevel(); +// String regionCode = expertRegionInfo.getRegionCode(); + + List expertJoinApplyList = iMetaApplyService.list(Wrappers.lambdaQuery(ExpertMetaApply.class) + .eq(ExpertMetaApply::getUserId, expertUserId) + .eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()) + .eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey()) + .eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.Y.name())); +// .eq(ExpertMetaApply::getRegionLevel, regionLevel) +// .eq(ExpertMetaApply::getRegionCode, regionCode)); + BizUtils.notEmpty(expertJoinApplyList, list -> list.forEach(r -> { + MetaApplyResultRequest resultRequest = new MetaApplyResultRequest(); + resultRequest.setApplyId(r.getId()); + resultRequest.setApplyResult(true); + resultRequest.setAuditOpinion("同意"); + metaApplyResult(resultRequest); + })); + } + } + break; + // 专家出库 + case EXPERT_DELIVERY: +// ExpertDeliveryDealCmd expertDeliveryDealCmd = buildExpertDeliveryDealCmd(req, expertMetaApply.getUserId()); +// expertInfoService.expertDeliveryDeal(expertDeliveryDealCmd); + break; + // 长期请假 + case LONG_TERM_LEAVE: +// leaveManage.leaveAuditCallback(req.getApplyResult(), applyId); + break; + // 专家信息审核 + case EXPERT_INFO_MODIFY: +// ExpertInfoModifyApplyDealCmd applyDealCmd = buildExpertInfoModifyApplyDealCmd(req, expertMetaApply.getUserId(), applyId); +// expertInfoService.expertInfoModifyDeal(applyDealCmd); + break; + // 专家履职意向加入/离开 + case EXPERT_INTENTION_JOIN: + case EXPERT_INTENTION_LEAVE: +// ExpertIntentionApplyDealCmd expertIntentionApplyDealCmd = buildExpertIntentionApplyDealCmd(req, expertMetaApply); +// expertInfoService.expertIntentionApplyDeal(expertIntentionApplyDealCmd); + break; + default: + break; + } + + Long expertUserId = expertMetaApply.getUserId(); + String auditOpinion = req.getAuditOpinion(); + // 发送审核结果短信 +// sendApplyResultNotify(applyType, applyResult, auditOpinion, expertUserId); + // 更新申请结果 + expertMetaApply.setApproverUserId(userId); + String adminUserName = userInfoHelper.getUserName(userId); + expertMetaApply.setApprover(adminUserName); + expertMetaApply.setAuditOpinion(auditOpinion); + expertMetaApply.setApplyStatus(applyResult ? ExpertApplyStatusEnum.PASSED.getKey() : ExpertApplyStatusEnum.REFUSED.getKey()); + expertMetaApply.setReviewTime(LocalDateTime.now()); + expertMetaApply.setUpdateOn(LocalDateTime.now()); + iMetaApplyService.saveOrUpdate(expertMetaApply); + } + + public MetaApplyResultVo metaApplyResult(Long applyId) { + ExpertMetaApply metaApply = iMetaApplyService.getById(applyId); + if (Objects.isNull(metaApply)) { + throw BizException.wrap("当前审核不存在"); + } + MetaApplyResultVo metaApplyResultVo = MetaApplyResultVo.builder() + .applyTime(metaApply.getCreateOn()) + .auditor(metaApply.getApprover()) + .expertUserId(metaApply.getUserId()) + .auditOption(metaApply.getAuditOpinion()) + .auditStatus(metaApply.getApplyStatus()) + .auditTime(metaApply.getReviewTime()) + .build(); + String extraMaterialStr = metaApply.getExtraMaterial(); +// if (StringUtils.isNotBlank(extraMaterialStr)) { +// ExtraMaterialDO extraMaterialDO = JSONObject.parseObject(extraMaterialStr, ExtraMaterialDO.class); +// ModifyApplyExtraInfo modifyApplyExtraInfo = new ModifyApplyExtraInfo(); +// BizUtils.notEmpty(extraMaterialDO.getEvidenceList(), list -> { +// List fileIdList = CollUtils.fieldList(list, FileBasicInfo::getFileId); +// List attachFiles = fileService.getByIds(fileIdList); +// List tempList = attachFiles.stream().map(r -> { +// FileBasicInfo fileBasicInfo = new FileBasicInfo(); +// fileBasicInfo.setFileId(r.getFileId()); +// fileBasicInfo.setFileName(r.getOriginalFileName()); +// return fileBasicInfo; +// }).collect(Collectors.toList()); +// modifyApplyExtraInfo.setEvidenceList(tempList); +// }); +// modifyApplyExtraInfo.setFactSheet(extraMaterialDO.getFactSheet()); +// metaApplyResultVo.setModifyApplyExtraInfo(modifyApplyExtraInfo); +// } + String applyType = metaApply.getApplyType(); + ExpertApplyTypeEnum applyTypeEnum = ExpertApplyTypeEnum.of(applyType); + switch (applyTypeEnum) { +// case EXPERT_INFO_MODIFY: +// buildInfoModifyApplyDisplayVO(metaApplyResultVo, metaApply); +// break; + case EXPERT_INTENTION_JOIN: + case EXPERT_INTENTION_LEAVE: + buildIntentionApplyDisplayVO(metaApplyResultVo, metaApply, applyTypeEnum); + break; + case EXPERT_DELIVERY: + case LONG_TERM_LEAVE: + case EXPERT_STORAGE: + default: + break; + } + metaApplyResultVo.setApplyType(applyTypeTrans(applyTypeEnum)); + return metaApplyResultVo; + } + + + public void metaApplyRevoke(Long applyId) { + Long userId = LoginUserUtil.getUserId(); + ExpertMetaApply expertMetaApply = iMetaApplyService.getById(applyId); + if (Objects.isNull(expertMetaApply)) { + throw new BizException("apply not exist"); + } + if (!expertMetaApply.getUserId().equals(userId)) { + throw new BizException("has not right to operate"); + } + String applyStatus = expertMetaApply.getApplyStatus(); + ExpertApplyStatusEnum expertApplyStatusEnum = ExpertApplyStatusEnum.of(applyStatus); + if (!ExpertApplyStatusEnum.PENDING_REVIEW.equals(expertApplyStatusEnum)) { + throw new BizException("apply is already deal"); + } + expertMetaApply.setApplyStatus(ExpertApplyStatusEnum.REVOKED.getKey()); + expertMetaApply.setUpdateOn(LocalDateTime.now()); + iMetaApplyService.updateById(expertMetaApply); + } + + + private void buildIntentionApplyDisplayVO(MetaApplyResultVo metaApplyResultVo, ExpertMetaApply metaApply, ExpertApplyTypeEnum applyTypeEnum) { + String regionCode = metaApply.getRegionCode(); + Integer regionLevel = metaApply.getRegionLevel(); +// String unionPathStr = regionCache.getUnionPathStr(regionCode, regionLevel); + MetaApplyResultVo.IntentionApplyDisplayVO intentionApplyDisplayVO = new MetaApplyResultVo.IntentionApplyDisplayVO(); + intentionApplyDisplayVO.setExpertApplyId(metaApply.getId()); + ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); + expertRegionInfo.setRegionCode(regionCode); + expertRegionInfo.setRegionLevel(regionLevel); +// expertRegionInfo.setRegionName(unionPathStr); + switch (applyTypeEnum) { + case EXPERT_INTENTION_LEAVE: { + intentionApplyDisplayVO.setReduceExpertRegion(expertRegionInfo); + } + break; + case EXPERT_INTENTION_JOIN: { + intentionApplyDisplayVO.setAddExpertRegion(expertRegionInfo); + } + break; + default: + break; + } + metaApplyResultVo.setIntentionApplyDisplayVo(intentionApplyDisplayVO); + } + +// private void buildInfoModifyApplyDisplayVO(MetaApplyResultVo metaApplyResultVo, ExpertMetaApply infoModifyApply) { +// InfoModifyApplyDisplayVO infoModifyApplyDisplayVo = new InfoModifyApplyDisplayVO(); +// if (Objects.nonNull(infoModifyApply)) { +// Long metaApplyId = infoModifyApply.getId(); +// LambdaQueryWrapper eq = Wrappers.lambdaQuery(ExpertSensitiveInfoModifyDetailRecord.class) +// .eq(ExpertSensitiveInfoModifyDetailRecord::getMetaApplyId, metaApplyId); +// ExpertSensitiveInfoModifyDetailRecord one = iExpertSensitiveInfoModifyDetailRecordService.getOne(eq); +// String originalJson = null; +// if (StringUtils.isNotBlank(one.getOriginalJson())) { +// originalJson = GzipUtils.uncompress(one.getOriginalJson()); +// } +// List sensitiveModifySegments = JSONUtils.parseArray(originalJson, SensitiveModifySegment.class); +// +// infoModifyApplyDisplayVo.setExpertApplyId(metaApplyId); +// List displayValueList = new ArrayList<>(); +// for (SensitiveModifySegment segment : sensitiveModifySegments) { +// InfoModifyApplyDisplayVO.InfoModifyApplyDisplayValue displayValue = sensitiveModifySegmentParser.getDisplayValue(segment); +// displayValueList.add(displayValue); +// } +// infoModifyApplyDisplayVo.setInfoModifyApplyDisplayValueList(displayValueList); +// metaApplyResultVo.setInfoModifyApplyDisplayVo(infoModifyApplyDisplayVo); +// } +// } + + private String applyTypeTrans(ExpertApplyTypeEnum applyTypeEnum) { + switch (applyTypeEnum) { + case EXPERT_INTENTION_JOIN: + case EXPERT_INTENTION_LEAVE: { + return ExpertApplyTypeQueryEnum.EXPERT_INTENTION_CHANGE.getKey(); + } + case EXPERT_INFO_MODIFY: { + return ExpertApplyTypeQueryEnum.EXPERT_INFO_MODIFY.getKey(); + } + case LONG_TERM_LEAVE: { + return ExpertApplyTypeQueryEnum.LONG_TERM_LEAVE.getKey(); + } + case EXPERT_DELIVERY: { + return ExpertApplyTypeQueryEnum.EXPERT_DELIVERY.getKey(); + } + case EXPERT_STORAGE: { + return ExpertApplyTypeQueryEnum.EXPERT_STORAGE.getKey(); + } + default: + return null; + } + } + + private List applyTypeTrans(ExpertApplyTypeQueryEnum applyTypeQueryEnum) { + List applyTypeList = new ArrayList<>(); + switch (applyTypeQueryEnum) { + case EXPERT_INTENTION_CHANGE: { + applyTypeList.add(ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey()); + applyTypeList.add(ExpertApplyTypeEnum.EXPERT_INTENTION_LEAVE.getKey()); + } + break; + case EXPERT_INFO_MODIFY: { + applyTypeList.add(ExpertApplyTypeEnum.EXPERT_INFO_MODIFY.getKey()); + } + break; + case LONG_TERM_LEAVE: { + applyTypeList.add(ExpertApplyTypeEnum.LONG_TERM_LEAVE.getKey()); + } + break; + case EXPERT_DELIVERY: { + applyTypeList.add(ExpertApplyTypeEnum.EXPERT_DELIVERY.getKey()); + } + break; + case EXPERT_STORAGE: { + applyTypeList.add(ExpertApplyTypeEnum.EXPERT_STORAGE.getKey()); + } + break; + default: + break; + } + return applyTypeList; + } + + private ExpertAdminExpertManageQueryCmd buildExpertAdminExpertManageQueryCmd(MetaApplyListQuery query, List expertAdminContainsRegionList) { + ExpertAdminExpertManageQueryCmd expertAdminExpertManageQueryCmd = new ExpertAdminExpertManageQueryCmd(); + expertAdminExpertManageQueryCmd.setPageNumber(query.getPageNumber()); + expertAdminExpertManageQueryCmd.setPageSize(query.getPageSize()); + if (StringUtils.isNotBlank(query.getExpertName())) { + expertAdminExpertManageQueryCmd.setExpertName(query.getExpertName()); + } + if (StringUtils.isNotBlank(query.getCompanyName())) { + expertAdminExpertManageQueryCmd.setCompany(query.getCompanyName()); + } + List expertDictionaryQueryList = new ArrayList<>(); + if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) { + ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery(); + expertDictionaryQuery.setExpertInfoField(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey()); + expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode())); + expertDictionaryQueryList.add(expertDictionaryQuery); + } + + List containsRegion; + if (Objects.nonNull(query.getExpertRegion())) { + RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegion().getRegionLevel() + , query.getExpertRegion().getRegionCode()); + containsRegion = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList); + } else { + containsRegion = expertAdminContainsRegionList; + } + + expertAdminExpertManageQueryCmd.setExpertDictionaryQueryList(expertDictionaryQueryList); + expertAdminExpertManageQueryCmd.setRegionContainsList(containsRegion); + expertAdminExpertManageQueryCmd.setPageSize(query.getPageSize()); + expertAdminExpertManageQueryCmd.setPageNumber(query.getPageNumber()); + return expertAdminExpertManageQueryCmd; + } + + + /** + * 装配 专家审核列表筛选返回VO + * + * @param expertMetaApplyList / + * @param expertUserFullInfoMap / + * @param expertDictionaryListMap / + * @return / + */ + private List buildExpertApplyMetaVOList(List expertMetaApplyList + , Map expertUserFullInfoMap + , Map> expertDictionaryListMap) { + List expertApplyMetaVOList = new ArrayList<>(); + for (ExpertMetaApply expertMetaApply : expertMetaApplyList) { + ExpertApplyMetaVO expertApplyMetaVO = new ExpertApplyMetaVO(); + Long userId = expertMetaApply.getUserId(); + ExpertUserFullInfo expertUserFullInfo = expertUserFullInfoMap.get(userId); + expertApplyMetaVO.setId(expertMetaApply.getId()); + expertApplyMetaVO.setUserId(userId); + expertApplyMetaVO.setApplyStatus(expertMetaApply.getApplyStatus()); + + String applyType = expertMetaApply.getApplyType(); + if (Objects.nonNull(applyType)) { + expertApplyMetaVO.setApplyType(applyTypeTrans(ExpertApplyTypeEnum.of(applyType))); + } + expertApplyMetaVO.setName(expertUserFullInfo.getExpertName()); + +// RegionDTO regionDTO = regionCache.getByCodeAndLevel(expertUserFullInfo.getRegionCode(), expertUserFullInfo.getRegionLevel()); + ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); + expertRegionInfo.setRegionCode(expertUserFullInfo.getRegionCode()); + expertRegionInfo.setRegionLevel(expertUserFullInfo.getRegionLevel()); +// expertRegionInfo.setRegionName(regionDTO.getRegionName()); + expertApplyMetaVO.setExpertRegionInfo(expertRegionInfo); + + List expertDictionaryList = expertDictionaryListMap.get(userId); + if (CollectionUtils.isNotEmpty(expertDictionaryList)) { + expertApplyMetaVO.setTitleLevel(expertDictionaryList.stream().map(r -> { + DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); + DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); + dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); + dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); + if (Objects.nonNull(dictionaryDTO)) { + dictionaryFieldInfo.setDictionaryName(dictionaryDTO.getName()); + } + return dictionaryFieldInfo; + }).collect(Collectors.toList())); + } + + expertApplyMetaVO.setCompany(expertUserFullInfo.getCompany()); + expertApplyMetaVO.setPhoneNo(expertUserFullInfo.getPhoneNo()); + expertApplyMetaVO.setApplyTime(expertMetaApply.getCreateOn()); + expertApplyMetaVOList.add(expertApplyMetaVO); + } + return expertApplyMetaVOList; + } + + private LambdaQueryWrapper buildMetaApplyListQueryWrapper(MetaApplyListQuery applyListReq, + List expertIdList, + List viewRegions) { + // 审核类型 + List applyTypeList = new ArrayList<>(); + if (CollUtil.isNotEmpty(applyListReq.getApplyTypeList())) { + List applyTypeQueryEnumList = applyListReq.getApplyTypeList(); + for (ExpertApplyTypeQueryEnum applyTypeQueryEnum : applyTypeQueryEnumList) { + applyTypeList.addAll(applyTypeTrans(applyTypeQueryEnum)); + } + } + // 审核结果 + List applyStatusList = new ArrayList<>(); + if (CollUtil.isNotEmpty(applyListReq.getApplyStatusList())) { + applyStatusList = CollUtils.fieldList(applyListReq.getApplyStatusList(), ExpertApplyStatusEnum::getKey); + ; + } + + 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) + .in(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.Y.name()) + .in(CollectionUtils.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); + + RegionWrapperAssembler.expertMetaApplyRegionContainsWrapperAssembler(expertMetaApplyListQuery, viewRegions); + return expertMetaApplyListQuery; + } + + private ExpertStorageDealCmd buildExpertStorageDealCmd( + MetaApplyResultRequest applyResultRequest, Long expertUserId, ExpertMetaApply expertMetaApply) { + MetaApplyResultRequest.StorageApplyResultExtraInfo extraInfo = applyResultRequest.getStorageApplyResultExtraInfo(); + ExpertStorageDealCmd expertStorageDealCmd = new ExpertStorageDealCmd(); + Boolean applyResult = applyResultRequest.getApplyResult(); + expertStorageDealCmd.setApplyResult(applyResult); + + if (Objects.nonNull(extraInfo)) { + List expertType = extraInfo.getExpertType(); + if (CollectionUtils.isNotEmpty(expertType)) { + expertStorageDealCmd.setExpertType(extraInfo.getExpertType().stream().map(r -> { + ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO(); + expertDictionaryDTO.setExpertInfoField(r.getDictionaryFieldName()); + expertDictionaryDTO.setDictionaryCode(r.getDictionaryCode()); + return expertDictionaryDTO; + }).collect(Collectors.toList())); + } + List other = extraInfo.getOther(); + if (CollectionUtils.isNotEmpty(other)) { + expertStorageDealCmd.setOther(extraInfo.getOther().stream().map(r -> { + ExpertTagDTO expertTagDTO = new ExpertTagDTO(); + expertTagDTO.setExpertInfoField(r.getTagFieldName()); + expertTagDTO.setTagCode(r.getTagCode()); + return expertTagDTO; + }).collect(Collectors.toList())); + } + expertStorageDealCmd.setRemark(extraInfo.getRemark()); + } + expertStorageDealCmd.setExpertUserId(expertUserId); + expertStorageDealCmd.setJoinRegionCode(expertMetaApply.getRegionCode()); + expertStorageDealCmd.setJoinRegionLevel(expertMetaApply.getRegionLevel()); + return expertStorageDealCmd; + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.java new file mode 100644 index 0000000..77ee648 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.expert.mapper; + +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Liuxinxin + * @since 2023-03-01 + */ +public interface ExpertMetaApplyMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.xml new file mode 100644 index 0000000..6ebe245 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertAdminExpertManageQuery.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertAdminExpertManageQuery.java new file mode 100644 index 0000000..d1150d9 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertAdminExpertManageQuery.java @@ -0,0 +1,48 @@ +package com.ningdatech.pmapi.expert.model; + + +import com.ningdatech.basic.model.PagePo; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author liuxinxin + * @date 2022/8/4 上午10:18 + */ +@Data +@ApiModel("专家库筛选接口") +public class ExpertAdminExpertManageQuery extends PagePo { + + @ApiModelProperty("专家姓名(精准匹配)") + private String expertName; + + @ApiModelProperty("工作单位(模糊匹配)") + private String company; + + @ApiModelProperty("职称级别字典编码") + private String titleLevelDictionaryCode; + + @ApiModelProperty("单位属性字典编码") + private String companyAttributeDictionaryCode; + + @ApiModelProperty(value = "专家账号状态", allowableValues = "冻结:freezing,正常:normal") + private String expertAccountStatus; + + @ApiModelProperty("区域信息") + private ExpertRegionInfo expertRegionInfo; + + @ApiModelProperty(value = "是否浙政钉用户") + private Boolean isDingUser; + + @ApiModelProperty("内外围字典编码") + private String expertTypeDictionaryCode; + + @ApiModelProperty("专家来源标签编码") + private String expertSourceTagCode; + + @ApiModelProperty("擅长方向标签编码") + private String goodAtTagCode; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExtraMaterialDO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExtraMaterialDO.java new file mode 100644 index 0000000..a0e8abf --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExtraMaterialDO.java @@ -0,0 +1,29 @@ +package com.ningdatech.pmapi.expert.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/27 下午4:18 + * 提交修改申请额外信息 + */ +@Data +@ApiModel("提交修改申请额外信息,保存于expert_meta_apply表的 extra_material 字段") +public class ExtraMaterialDO { + + /** + * 情况说明 + */ + @ApiModelProperty("申请说明") + private String factSheet; + + /** + * 证明材料 + */ + @ApiModelProperty("证明材料") + private List evidenceList; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/RegionDtoMapKey.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/RegionDtoMapKey.java new file mode 100644 index 0000000..d38894d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/RegionDtoMapKey.java @@ -0,0 +1,41 @@ +package com.ningdatech.pmapi.expert.model; + +import lombok.Data; + +import java.util.Objects; + +/** + * @author liuxinxin + * @date 2022/7/22 上午10:07 + */ +@Data +public class RegionDtoMapKey { + + /** + * 区域码 + */ + private String regionCode; + + /** + * 地区级别 + */ + private Integer regionLevel; + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RegionDtoMapKey regionDtoMapKey = (RegionDtoMapKey) o; + return regionCode.equals(regionDtoMapKey.getRegionCode()) && + regionLevel.equals(regionDtoMapKey.getRegionLevel()); + } + + @Override + public int hashCode() { + return Objects.hash(regionCode, regionLevel); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/AdminModifyExpertInfoCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/AdminModifyExpertInfoCmd.java new file mode 100644 index 0000000..322291f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/AdminModifyExpertInfoCmd.java @@ -0,0 +1,37 @@ +//package com.ningdatech.pmapi.expert.model.cmd; +// +//import com.ningdatech.emapi.expert.entity.bo.ExpertInfoSensitiveFieldCheckBO; +//import com.ningdatech.emapi.expert.entity.dto.*; +//import lombok.Data; +// +//import java.util.List; +// +///** +// * @author liuxinxin +// * @date 2022/7/28 下午2:43 +// */ +//@Data +//public class AdminModifyExpertInfoCmd { +// +// private Long userId; +// +// private ExpertUserFullInfoDTO expertUserInfoDTO; +// +// private List expertDictionaryList; +// +// private List expertTagList; +// +// /** +// * 专家履职意向(区域编码) +// */ +// private List expertIntentionWorkRegionInfo; +// +// /** +// * 回避单位列表 +// */ +// private List expertAvoidCompanyList; +// +// private ExpertInfoSensitiveFieldCheckBO expertInfoSensitiveFieldCheckBO; +// +// private ModifyApplyExtraInfoDTO modifyApplyExtraInfo; +//} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java new file mode 100644 index 0000000..665751c --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java @@ -0,0 +1,62 @@ +package com.ningdatech.pmapi.expert.model.cmd; + + +import com.ningdatech.pmapi.common.model.CommonPageReq; +import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; +import com.ningdatech.pmapi.expert.model.query.ExpertDictionaryQuery; +import com.ningdatech.pmapi.expert.model.query.ExpertTagQuery; +import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/8/4 上午11:11 + */ +@Data +public class ExpertAdminExpertManageQueryCmd extends CommonPageReq { + + @ApiModelProperty("专家姓名(精准匹配)") + private String expertName; + + @ApiModelProperty("工作单位(模糊匹配)") + private String company; + + @ApiModelProperty("专家账号状态") + private List expertAccountStatusList; + + /** + * 区域编码 + */ + @ApiModelProperty("区域编码") + private String regionCode; + + /** + * 区域级别 + */ + @ApiModelProperty("区域级别") + private Integer regionLevel; + + /** + * 专家管理区域范围 + */ + List regionContainsList; + + /** + * 专家字典信息 + */ + private List expertDictionaryQueryList; + + /** + * 专家标签信息 + */ + private List expertTagQueryList; + + /** + * 是否为钉用户 + */ + private Boolean isDingUser; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertDeliveryDealCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertDeliveryDealCmd.java new file mode 100644 index 0000000..ece2d3c --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertDeliveryDealCmd.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.expert.model.cmd; + +import lombok.Data; + +/** + * @author liuxinxin + * @date 2022/7/26 下午6:28 + * 专家出库审核处理cmd + */ +@Data +public class ExpertDeliveryDealCmd { + + private Long expertUserId; + + private Boolean applyResult; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertInfoModifyApplyDealCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertInfoModifyApplyDealCmd.java new file mode 100644 index 0000000..dc09f5a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertInfoModifyApplyDealCmd.java @@ -0,0 +1,18 @@ +package com.ningdatech.pmapi.expert.model.cmd; + +import lombok.Data; + +/** + * @author liuxinxin + * @date 2022/7/28 下午5:35 + */ +@Data +public class ExpertInfoModifyApplyDealCmd { + + private Long expertUserId; + + private Boolean applyResult; + + private Long applyId; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertInfoModifyCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertInfoModifyCmd.java new file mode 100644 index 0000000..28a82cd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertInfoModifyCmd.java @@ -0,0 +1,37 @@ +//package com.ningdatech.pmapi.expert.model.cmd; +// +//import com.ningdatech.emapi.expert.entity.bo.ExpertInfoSensitiveFieldCheckBO; +//import com.ningdatech.emapi.expert.entity.dto.*; +//import lombok.Data; +// +//import java.util.List; +// +///** +// * @author liuxinxin +// * @date 2022/7/28 下午2:43 +// */ +//@Data +//public class ExpertInfoModifyCmd { +// +// private Long userId; +// +// private ExpertUserFullInfoDTO expertUserInfoDTO; +// +// private List expertDictionaryList; +// +// private List expertTagList; +// +// /** +// * 专家履职意向(区域编码) +// */ +// private List expertIntentionWorkRegionInfo; +// +// /** +// * 回避单位列表 +// */ +// private List expertAvoidCompanyList; +// +// private ExpertInfoSensitiveFieldCheckBO expertInfoSensitiveFieldCheckBO; +// +// private ModifyApplyExtraInfoDTO modifyApplyExtraInfo; +//} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertIntentionApplyDealCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertIntentionApplyDealCmd.java new file mode 100644 index 0000000..73aa7e6 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertIntentionApplyDealCmd.java @@ -0,0 +1,22 @@ +//package com.ningdatech.pmapi.expert.model.cmd; +// +//import com.ningdatech.emapi.expert.constants.ExpertApplyTypeEnum; +//import lombok.Data; +// +///** +// * @author liuxinxin +// * @date 2022/7/27 上午9:06 +// */ +//@Data +//public class ExpertIntentionApplyDealCmd { +// +// private Long expertUserId; +// +// private Boolean applyResult; +// +// ExpertApplyTypeEnum applyTypeEnum; +// +// private String expertRegionCode; +// +// private Integer expertRegionLevel; +//} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertRecommendProofSaveCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertRecommendProofSaveCmd.java new file mode 100644 index 0000000..91b5b9f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertRecommendProofSaveCmd.java @@ -0,0 +1,22 @@ +package com.ningdatech.pmapi.expert.model.cmd; + +import com.ningdatech.pmapi.expert.model.dto.ExpertDictionaryDTO; +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/25 下午4:59 + */ +@Data +public class ExpertRecommendProofSaveCmd { + + + private Long userId; + + private List recommendationProofFileIdList; + + private List recommendedWay; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertStorageDealCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertStorageDealCmd.java new file mode 100644 index 0000000..d615e19 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertStorageDealCmd.java @@ -0,0 +1,36 @@ +package com.ningdatech.pmapi.expert.model.cmd; + + +import com.ningdatech.pmapi.expert.model.dto.ExpertDictionaryDTO; +import com.ningdatech.pmapi.expert.model.dto.ExpertTagDTO; +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/26 下午5:40 + */ +@Data +public class ExpertStorageDealCmd { + + private Long expertUserId; + + private Boolean applyResult; + + private String joinRegionCode; + + private Integer joinRegionLevel; + + /** + * 专家类型(内外围) + */ + private List expertType; + + /** + * 其他标签(标签code) + */ + private List other; + + private String remark; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/MetaApplyListQuery.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/MetaApplyListQuery.java new file mode 100644 index 0000000..0049729 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/MetaApplyListQuery.java @@ -0,0 +1,46 @@ +package com.ningdatech.pmapi.expert.model.cmd; + +import com.ningdatech.basic.model.PagePo; +import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum; +import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeQueryEnum; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/26 下午2:35 + */ +@Data +@ApiModel("申请列表查询请求") +public class MetaApplyListQuery extends PagePo { + + @ApiModelProperty("审核类型") + private List applyTypeList; + + @ApiModelProperty("审核结果") + private List applyStatusList; + + @ApiModelProperty("工作单位") + private String companyName; + + @ApiModelProperty("专家姓名") + private String expertName; + + @ApiModelProperty("职称级别字典编码") + private String titleLevelDictionaryCode; + + @ApiModelProperty("专家层级") + private ExpertRegionInfo expertRegion; + + @ApiModelProperty("筛选开始时间") + private LocalDateTime applyStartTime; + + @ApiModelProperty("筛选结束时间") + private LocalDateTime applyEndTime; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/SaveExpertAdminCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/SaveExpertAdminCmd.java new file mode 100644 index 0000000..1408d93 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/SaveExpertAdminCmd.java @@ -0,0 +1,60 @@ +//package com.ningdatech.pmapi.expert.model.cmd; +// +//import com.ningdatech.emapi.expert.entity.dto.ExpertAdminRegionDTO; +//import lombok.Data; +// +//import java.util.List; +// +///** +// * @author liuxinxin +// * @date 2022/8/1 上午10:54 +// */ +//@Data +//public class SaveExpertAdminCmd { +// +// /** +// * 用户id +// */ +// private Long userId; +// +// /** +// * 是否浙政钉用户Y/N +// */ +// private Boolean isDingUser; +// +// /** +// * 手机号 +// */ +// private String phoneNo; +// +// /** +// * 用户名称 +// */ +// private String name; +// +// /** +// * 工作单位 +// */ +// private String company; +// +// /** +// * 公司唯一标识 +// */ +// private String companyUniqCode; +// +// /** +// * 层级 +// */ +// private List regionInfoList; +// +// /** +// * 用户状态(启用/关闭) +// */ +// private Boolean isEnable; +// +// /** +// * 操作者id +// */ +// private Long operatorId; +// +//} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertFullInfoAllDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertFullInfoAllDTO.java new file mode 100644 index 0000000..c7a2d90 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertFullInfoAllDTO.java @@ -0,0 +1,39 @@ +package com.ningdatech.pmapi.expert.model.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/27 上午10:22 + * 专家全量信息表,包含履职意向,专家字典信息,专家标签信息,回避单位信息 + */ +@Data +public class ExpertFullInfoAllDTO { + + private Long userId; + + private ExpertUserFullInfoDTO expertUserInfoDTO; + + private List expertDictionaryList; + + private List expertTagList; + + /** + * 专家履职意向(区域编码) + */ + private List expertIntentionWorkRegionInfo; + + /** + * 专家申请履职意向展示列表 + */ + private List expertApplyIntentionWorkRegionInfo; + + /** + * 回避单位列表 + */ + private List expertAvoidCompanyList; + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertDictionaryQuery.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertDictionaryQuery.java new file mode 100644 index 0000000..0220b2f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertDictionaryQuery.java @@ -0,0 +1,17 @@ +package com.ningdatech.pmapi.expert.model.query; + +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/8/5 上午11:16 + */ +@Data +public class ExpertDictionaryQuery { + + private String expertInfoField; + + private List dictionaryCodeList; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertTagQuery.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertTagQuery.java new file mode 100644 index 0000000..164ba63 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertTagQuery.java @@ -0,0 +1,17 @@ +package com.ningdatech.pmapi.expert.model.query; + +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/8/5 上午11:16 + */ +@Data +public class ExpertTagQuery { + + private String expertInfoField; + + private List tagCodeList; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ListExpertQuery.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ListExpertQuery.java new file mode 100644 index 0000000..e39c3af --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ListExpertQuery.java @@ -0,0 +1,59 @@ +package com.ningdatech.pmapi.expert.model.query; + +import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/8/5 上午10:52 + */ +@Data +public class ListExpertQuery { + + private Integer limit; + private Integer offset; + + /** + * 专家姓名(精准匹配) + */ + private String expertName; + + /** + * 工作单位(模糊匹配) + */ + private String company; + + /** + * 专家账号状态 + */ + private List expertAccountStatusList; + + /** + * 区域编码 + */ + private String regionCode; + + /** + * 区域级别 + */ + private Integer regionLevel; + + /** + * 专家管理区域范围 + */ + List regionContainsList; + + /** + * 专家字典信息 + */ + private List expertDictionaryQueryList; + + /** + * 专家标签信息 + */ + private List expertTagQueryList; + + private Boolean isDingUser; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertRecommendProofSubmitRequest.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertRecommendProofSubmitRequest.java new file mode 100644 index 0000000..d828e3b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertRecommendProofSubmitRequest.java @@ -0,0 +1,31 @@ +package com.ningdatech.pmapi.expert.model.req; + +import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo; +import com.ningdatech.pmapi.expert.model.FileBasicInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/22 下午5:49 + */ +@Data +@ApiModel("专家证明材料提交Request") +public class ExpertRecommendProofSubmitRequest { + + @NotEmpty + @ApiModelProperty("推荐方式") + private List recommendedWay; + + @ApiModelProperty("推荐证明材料") + private List recommendProofFile; + + @NotBlank + @ApiModelProperty("短信验证码") + private String verificationCode; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/MetaApplyResultRequest.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/MetaApplyResultRequest.java new file mode 100644 index 0000000..5272f6f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/MetaApplyResultRequest.java @@ -0,0 +1,49 @@ +package com.ningdatech.pmapi.expert.model.req; + +import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo; +import com.ningdatech.pmapi.expert.model.TagFieldInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.validation.annotation.Validated; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/26 下午4:20 + * 申请结果请求基类 + */ +@Data +@Validated +public class MetaApplyResultRequest { + + @NotNull + @ApiModelProperty("申请id") + private Long applyId; + + @NotNull + @ApiModelProperty("审核结果") + private Boolean applyResult; + + @ApiModelProperty("审核意见") + private String auditOpinion; + + @ApiModelProperty("入库审核额外参数,只有入库审核结果审批才需要填写") + private StorageApplyResultExtraInfo storageApplyResultExtraInfo; + + + @Data + @ApiModel("入库审核额外参数") + public static class StorageApplyResultExtraInfo { + @ApiModelProperty("专家类型-内外围") + private List expertType; + + @ApiModelProperty("其他标签(标签code)") + private List other; + + @ApiModelProperty("备注") + private String remark; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertAdminExpertManageListVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertAdminExpertManageListVO.java new file mode 100644 index 0000000..fdbe9de --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertAdminExpertManageListVO.java @@ -0,0 +1,56 @@ +package com.ningdatech.pmapi.expert.model.vo; + + +import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo; +import com.ningdatech.pmapi.expert.model.TagFieldInfo; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/8/4 上午11:04 + */ +@Data +@ApiModel("专家库列表查询返回model") +public class ExpertAdminExpertManageListVO { + + @ApiModelProperty(value = "用户id") + private Long userId; + + @ApiModelProperty(value = "专家姓名") + private String expertName; + + @ApiModelProperty(value = "职称级别") + private List titleLevel; + + @ApiModelProperty("工作单位") + private String company; + + @ApiModelProperty(" 单位法人编号") + private String legalEntityCode; + + @ApiModelProperty("单位类型(字典code)") + private List companyAttribute; + + @ApiModelProperty(value = "手机号") + private String phoneNo; + + @ApiModelProperty(value = "专家类型(内外围)") + private List expertType; + + @ApiModelProperty(value = "专家层级") + private ExpertRegionInfo expertRegionInfo; + + @ApiModelProperty(value = "是否浙政钉用户") + private Boolean isDingUser; + + @ApiModelProperty(value = "专家账号状态", allowableValues = "冻结:freezing,正常:normal") + private String expertAccountStatus; + + @ApiModelProperty(value = "专家来源") + private List expertSource; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertApplyMetaVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertApplyMetaVO.java new file mode 100644 index 0000000..37f8acd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertApplyMetaVO.java @@ -0,0 +1,76 @@ +package com.ningdatech.pmapi.expert.model.vo; + +import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/26 上午11:17 + * 专家审核列表展示VO基础类 + */ +@Data +@ApiModel("审核列表展示VO") +public class ExpertApplyMetaVO { + + @ApiModelProperty("id") + private Long id; + + @ApiModelProperty("用户id") + private Long userId; + + /** + * 审核结果 + */ + @ApiModelProperty("审核结果") + private String applyStatus; + + /** + * 审核类型 + */ + @ApiModelProperty("审核类型") + private String applyType; + + /** + * 专家姓名 + */ + @ApiModelProperty("专家姓名") + private String name; + + /** + * 专家层级 + */ + @ApiModelProperty("专家层级") + private ExpertRegionInfo expertRegionInfo; + + /** + * 职称级别 + */ + @ApiModelProperty("职称级别") + private List titleLevel; + + /** + * 工作单位 + */ + @ApiModelProperty("工作单位") + private String company; + + /** + * 手机号 + */ + @ApiModelProperty("手机号") + private String phoneNo; + + /** + * 申请时间 + */ + @ApiModelProperty("申请时间") + private LocalDateTime applyTime; + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertFullInfoVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertFullInfoVO.java new file mode 100644 index 0000000..c3047bd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertFullInfoVO.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.expert.model.vo; + +import com.ningdatech.pmapi.expert.model.*; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/25 下午1:43 + */ +@Data +@ApiModel("专家全量信息") +public class ExpertFullInfoVO { + + @ApiModelProperty("专家用户id") + private Long userId; + + @ApiModelProperty("基本信息") + private ExpertBasicInfo basicInfo; + + @ApiModelProperty("学历信息") + private ExpertEduInfo eduInfo; + + @ApiModelProperty("职业信息") + private ExpertJobInfo jobInfo; + + @ApiModelProperty("专业信息") + private ExpertProfessionalInfo professionalInfo; + + @ApiModelProperty("推荐信息") + private ExpertRecommendInfo recommendInfo; + + @ApiModelProperty("其他信息") + private ExpertOtherInfo expertOtherInfo; + + @NotEmpty + @ApiModelProperty("专家申请履职意向展示列表") + private List expertApplyIntentionWorkRegions; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/MetaApplyResultVo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/MetaApplyResultVo.java new file mode 100644 index 0000000..fae2507 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/MetaApplyResultVo.java @@ -0,0 +1,70 @@ +package com.ningdatech.pmapi.expert.model.vo; + +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + *

+ * LeaveAuditInfoVo + *

+ * + * @author WendyYang + * @since 13:46 2022/8/12 + */ +@Data +@Builder +@ApiModel("审核详情返回参数") +public class MetaApplyResultVo { + + @ApiModelProperty("审核人") + private String auditor; + + @ApiModelProperty("审核时间") + private LocalDateTime auditTime; + + @ApiModelProperty("审核意见") + private String auditOption; + + @ApiModelProperty("审核状态") + private String auditStatus; + + @ApiModelProperty("申请时间") + private LocalDateTime applyTime; + + @ApiModelProperty("申请类型") + private String applyType; + + @ApiModelProperty("专家用户userId") + private Long expertUserId; + +// @ApiModelProperty("额外的材料") +// private ModifyApplyExtraInfo modifyApplyExtraInfo; +// +// @ApiModelProperty("信息修改申请展示列表-只有审核类型为信息变更审核时才有值") +// private InfoModifyApplyDisplayVO infoModifyApplyDisplayVo; + + @ApiModelProperty("履职意向修改申请展示列表-只有审核类型为履职意向变更时才会有值") + private IntentionApplyDisplayVO intentionApplyDisplayVo; + + + @Data + @ApiModel("履职意向修改申请展示列表") + public static class IntentionApplyDisplayVO { + + @ApiModelProperty("审核申请id") + private Long expertApplyId; + + @ApiModelProperty("履职意向增加") + private ExpertRegionInfo addExpertRegion; + + @ApiModelProperty("履职意向减少") + private ExpertRegionInfo reduceExpertRegion; + } + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java index fba707d..6ca67a3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java @@ -1,6 +1,9 @@ package com.ningdatech.pmapi.expert.service; import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; +import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd; +import com.ningdatech.pmapi.expert.model.cmd.ExpertStorageDealCmd; +import com.ningdatech.pmapi.expert.model.dto.ExpertFullInfoAllDTO; /** * @author liuxinxin @@ -11,4 +14,22 @@ public interface ExpertInfoService { void saveExpertInfo(ExpertFullInfoSaveCmd cmd); + /** + * 专家报名提交 推荐证明材料 + * + * @param expertRecommendProofSaveCmd + */ + void expertRecommendProofSave(ExpertRecommendProofSaveCmd expertRecommendProofSaveCmd); + + /** + * 根据user_id 获取用户全量信息 + * + * @param userId + * @return + */ + ExpertFullInfoAllDTO getExpertUserFullInfoAll(Long userId); + + + void expertStorageDeal(ExpertStorageDealCmd cmd); } + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java new file mode 100644 index 0000000..e9dcba1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.expert.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; + +/** + *

+ * 服务类 + *

+ * + * @author Liuxinxin + * @since 2023-03-01 + */ +public interface IExpertMetaApplyService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertUserFullInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertUserFullInfoService.java index af68be9..a0a6c27 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertUserFullInfoService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertUserFullInfoService.java @@ -32,4 +32,14 @@ public interface IExpertUserFullInfoService extends IService **/ List listByUserId(List userId); + + + /** + * 批量查询专家用户信息 + * + * @param userIds 用户ID + * @return / + */ + List listByUserIds(List userIds); + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java index 8da61e5..2dab362 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java @@ -2,17 +2,24 @@ package com.ningdatech.pmapi.expert.service.impl; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.ningdatech.pmapi.common.constant.BoolDisplayEnum; +import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; +import com.ningdatech.pmapi.expert.assembler.ExpertUserInfoAssembler; import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; +import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum; +import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; import com.ningdatech.pmapi.expert.constant.ExpertUserInfoStepEnum; import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; +import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion; +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; +import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd; +import com.ningdatech.pmapi.expert.model.cmd.ExpertStorageDealCmd; import com.ningdatech.pmapi.expert.model.dto.*; -import com.ningdatech.pmapi.expert.service.ExpertInfoService; -import com.ningdatech.pmapi.expert.service.IExpertAvoidCompanyService; -import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +import com.ningdatech.pmapi.expert.service.*; +import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; import com.ningdatech.pmapi.meta.model.entity.ExpertTag; import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; @@ -24,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -37,12 +45,11 @@ import java.util.stream.Collectors; public class ExpertInfoServiceImpl implements ExpertInfoService { private final IExpertUserFullInfoService iExpertUserFullInfoService; - private final IExpertTagService iExpertTagService; - private final IExpertDictionaryService iExpertDictionaryService; - private final IExpertAvoidCompanyService iExpertAvoidCompanyService; + private final IExpertIntentionWorkRegionService iExpertIntentionWorkRegionService; + private final IExpertMetaApplyService iExpertMetaApplyService; /** @@ -75,12 +82,12 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { .eq(ExpertDictionary::getUserId, userId); iExpertDictionaryService.remove(expertDictionaryRemove); // 删除所有专家履职意向申请 - // TODO 补充审核逻辑 -// LambdaQueryWrapper expertMetaApplyRemove = Wrappers.lambdaQuery(ExpertMetaApply.class) -// .eq(ExpertMetaApply::getUserId, userId) -// .eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey()) -// .eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.N.name()); -// iExpertMetaApplyService.remove(expertMetaApplyRemove); + // 补充审核逻辑 + LambdaQueryWrapper expertMetaApplyRemove = Wrappers.lambdaQuery(ExpertMetaApply.class) + .eq(ExpertMetaApply::getUserId, userId) + .eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey()) + .eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.N.name()); + iExpertMetaApplyService.remove(expertMetaApplyRemove); // 删除回避单位 LambdaQueryWrapper expertAvoidCompanyRemove = Wrappers.lambdaQuery(ExpertAvoidCompany.class) .eq(ExpertAvoidCompany::getUserId, userId); @@ -104,11 +111,11 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { } // 保存所有专家履职意向申请 - // TODO 补充审核逻辑 -// List saveExpertIntentionWorkRegionApplyList = buildSaveExpertIntentionWorkRegionApplyList(userId, expertIntentionWorkRegionInfoList); -// if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) { -// iExpertMetaApplyService.saveBatch(saveExpertIntentionWorkRegionApplyList); -// } + // 审核逻辑 + List saveExpertIntentionWorkRegionApplyList = buildSaveExpertIntentionWorkRegionApplyList(userId, expertIntentionWorkRegionInfoList); + if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) { + iExpertMetaApplyService.saveBatch(saveExpertIntentionWorkRegionApplyList); + } // 保存所有专家回避单位 List saveExpertAvoidCompanyList = buildSaveExpertAvoidCompanyList(userId, expertAvoidCompanyList); if (CollectionUtils.isNotEmpty(saveExpertAvoidCompanyList)) { @@ -216,4 +223,153 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { }).collect(Collectors.toList()); } + @Override + @Transactional(rollbackFor = Exception.class) + public void expertRecommendProofSave(ExpertRecommendProofSaveCmd cmd) { + // 保存专家证明材料 + Long userId = cmd.getUserId(); + ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId); + expertUserFullInfo.setRecommendationProofFileIdList(JSONObject.toJSONString(cmd.getRecommendationProofFileIdList())); + expertUserFullInfo.setUpdateOn(LocalDateTime.now()); + expertUserFullInfo.setUserInfoStep(ExpertUserInfoStepEnum.EVIDENCE_HAS_BEEN_SUBMITTED.getKey()); + iExpertUserFullInfoService.saveOrUpdate(expertUserFullInfo); + + List recommendedWayList = cmd.getRecommendedWay(); + if (CollectionUtils.isNotEmpty(recommendedWayList)) { + List saveExpertDictionaryList = recommendedWayList.stream().map(r -> { + ExpertDictionary expertDictionary = new ExpertDictionary(); + expertDictionary.setUserId(userId); + expertDictionary.setExpertInfoField(r.getExpertInfoField()); + expertDictionary.setDictionaryCode(r.getDictionaryCode()); + expertDictionary.setUpdateOn(LocalDateTime.now()); + expertDictionary.setCreateOn(LocalDateTime.now()); + return expertDictionary; + }).collect(Collectors.toList()); + iExpertDictionaryService.saveBatch(saveExpertDictionaryList); + } + + // 创建入库申请 + ExpertMetaApply expertRegionApply = new ExpertMetaApply(); + expertRegionApply.setApplyType(ExpertApplyTypeEnum.EXPERT_STORAGE.getKey()); + expertRegionApply.setApplyStatus(ExpertApplyStatusEnum.PENDING_REVIEW.getKey()); + expertRegionApply.setRegionCode(expertUserFullInfo.getRegionCode()); + expertRegionApply.setRegionLevel(expertUserFullInfo.getRegionLevel()); + expertRegionApply.setUserId(userId); + expertRegionApply.setDisplayEnable(BoolDisplayEnum.Y.name()); + iExpertMetaApplyService.save(expertRegionApply); + } + + @Override + public ExpertFullInfoAllDTO getExpertUserFullInfoAll(Long userId) { + ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId); + if (Objects.isNull(expertUserFullInfo)) { + return null; + } + // 所有专家标签字段 + List expertTagList = iExpertTagService + .list(Wrappers.lambdaQuery(ExpertTag.class).eq(ExpertTag::getUserId, userId)); + // 所有专家字典字段 + List expertDictionaryList = iExpertDictionaryService + .list(Wrappers.lambdaQuery(ExpertDictionary.class).eq(ExpertDictionary::getUserId, userId)); + // 专家履职意向列表 + List expertIntentionWorkRegionList = iExpertIntentionWorkRegionService + .list(Wrappers.lambdaQuery(ExpertIntentionWorkRegion.class).eq(ExpertIntentionWorkRegion::getUserId, userId)); + // 专家履职意向申请列表 + List expertMetaApplyList = iExpertMetaApplyService.list(Wrappers.lambdaQuery(ExpertMetaApply.class) + .eq(ExpertMetaApply::getUserId, userId) + .eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()) + .in(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey(), ExpertApplyTypeEnum.EXPERT_INTENTION_LEAVE.getKey())); + // 所有专家回避单位 + List expertAvoidCompanyList = iExpertAvoidCompanyService + .list(Wrappers.lambdaQuery(ExpertAvoidCompany.class).eq(ExpertAvoidCompany::getUserId, userId)); + + return ExpertUserInfoAssembler.buildExpertFullInfoAllDTO(expertUserFullInfo, expertTagList, expertDictionaryList + , expertIntentionWorkRegionList, expertMetaApplyList, expertAvoidCompanyList); + + } + + + private List buildSaveExpertIntentionWorkRegionApplyList(Long userId, List expertIntentionWorkRegionInfoList) { + if (CollectionUtils.isEmpty(expertIntentionWorkRegionInfoList)) { + return new ArrayList<>(); + } + return expertIntentionWorkRegionInfoList.stream().map(r -> { + ExpertMetaApply expertMetaApply = new ExpertMetaApply(); + expertMetaApply.setApplyType(ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey()); + expertMetaApply.setApplyStatus(ExpertApplyStatusEnum.PENDING_REVIEW.getKey()); + expertMetaApply.setRegionCode(r.getRegionCode()); + expertMetaApply.setRegionLevel(r.getRegionLevel()); + expertMetaApply.setUserId(userId); + expertMetaApply.setDisplayEnable(BoolDisplayEnum.N.name()); + expertMetaApply.setUpdateOn(LocalDateTime.now()); + expertMetaApply.setCreateOn(LocalDateTime.now()); + return expertMetaApply; + }).collect(Collectors.toList()); + } + + + /** + * 专家入库审核 + * + * @param cmd + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void expertStorageDeal(ExpertStorageDealCmd cmd) { + boolean applyResult = cmd.getApplyResult(); + Long expertUserId = cmd.getExpertUserId(); + ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(expertUserId); + + if (applyResult) { + // 修改专家状态为可用 + expertUserFullInfo.setExpertAccountStatus(ExpertAccountStatusEnum.AVAILABLE.getKey()); + expertUserFullInfo.setRemark(cmd.getRemark()); + expertUserFullInfo.setRegionCode(cmd.getJoinRegionCode()); + expertUserFullInfo.setRegionLevel(cmd.getJoinRegionLevel()); + + // 保存所有专家标签字段 + List saveExpertTagList = buildSaveExpertTagList(expertUserId, cmd.getOther()); + iExpertTagService.saveBatch(saveExpertTagList); + // 保存所有专家字典字段 + List expertType = cmd.getExpertType(); + if (CollectionUtils.isNotEmpty(expertType)) { + expertType = expertType.stream().peek(r -> r.setExpertInfoField(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())).collect(Collectors.toList()); + List saveExpertDictionaryList = buildSaveExpertDictionaryList(expertUserId, expertType); + iExpertDictionaryService.saveBatch(saveExpertDictionaryList); + } + + // 修改履职意向申请状态 + LambdaUpdateWrapper set = Wrappers.lambdaUpdate(ExpertMetaApply.class).eq(ExpertMetaApply::getUserId, expertUserId) + .eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey()) + .eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()) + .eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.N.name()) + .set(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.Y.name()); + iExpertMetaApplyService.update(set); + + } else { + expertUserFullInfo.setUserInfoStep(ExpertUserInfoStepEnum.INFORMATION_TO_BE_SUBMITTED.getKey()); + } + if (applyResult) { + // 补充专家 专家角色 TODO +// SysRole sysRole = roleService.getOne(Wrappers.lambdaQuery(SysRole.class) +// .eq(SysRole::getCode, SysRoleEnum.EXPERT.getKey())); +// if (Objects.nonNull(sysRole)) { +// Long roleId = sysRole.getRoleId(); +// LambdaQueryWrapper eq = Wrappers.lambdaQuery(SysUsersRoles.class) +// .eq(SysUsersRoles::getUserId, expertUserFullInfo.getUserId()) +// .eq(SysUsersRoles::getRoleId, sysRole.getRoleId()); +// SysUsersRoles one = userRoleService.getOne(eq); +// if (Objects.isNull(one)) { +// SysUsersRoles sysUsersRolesSaveRecord = new SysUsersRoles(); +// sysUsersRolesSaveRecord.setUserId(expertUserFullInfo.getUserId()); +// sysUsersRolesSaveRecord.setRoleId(roleId); +// userRoleService.saveAndReloadRoleListForToken(Collections.singletonList(sysUsersRolesSaveRecord), false); +// } +// } + } + iExpertUserFullInfoService.saveOrUpdate(expertUserFullInfo); + } + + + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertMetaApplyServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertMetaApplyServiceImpl.java new file mode 100644 index 0000000..481fbc5 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertMetaApplyServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.expert.service.impl; + +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; +import com.ningdatech.pmapi.expert.mapper.ExpertMetaApplyMapper; +import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author Liuxinxin + * @since 2023-03-01 + */ +@Service +public class ExpertMetaApplyServiceImpl extends ServiceImpl implements IExpertMetaApplyService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertUserFullInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertUserFullInfoServiceImpl.java index 69544bc..234d70d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertUserFullInfoServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertUserFullInfoServiceImpl.java @@ -33,4 +33,9 @@ public class ExpertUserFullInfoServiceImpl extends ServiceImpllambdaQuery().in(ExpertUserFullInfo::getUserId, userIds)); } + @Override + public List listByUserIds(List userIds) { + return list(Wrappers.lambdaQuery().in(ExpertUserFullInfo::getUserId, userIds)); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/builder/ExpertInviteBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/builder/ExpertInviteBuilder.java index 1191f09..5f54ae3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/builder/ExpertInviteBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/builder/ExpertInviteBuilder.java @@ -2,8 +2,7 @@ package com.ningdatech.pmapi.meeting.builder; import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; -import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteType; -import com.ningdatech.pmapi.user.entity.UserInfo; +import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; /** *

@@ -19,10 +18,10 @@ public class ExpertInviteBuilder { } public static MeetingExpert getExpertByRandom(Long meetingId, ExpertUserFullInfo user, Long ruleId) { - return getExpertBasic(meetingId, user, ruleId, ExpertInviteType.RANDOM); + return getExpertBasic(meetingId, user, ruleId, ExpertInviteTypeEnum.RANDOM); } - private static MeetingExpert getExpertBasic(Long meetingId, ExpertUserFullInfo user, Long ruleId, ExpertInviteType type) { + private static MeetingExpert getExpertBasic(Long meetingId, ExpertUserFullInfo user, Long ruleId, ExpertInviteTypeEnum type) { MeetingExpert expert = new MeetingExpert(); expert.setMeetingId(meetingId); expert.setMobile(user.getPhoneNo()); @@ -34,7 +33,7 @@ public class ExpertInviteBuilder { } public static MeetingExpert getExpertByAppoint(Long meetingId, ExpertUserFullInfo user, Long ruleId) { - return getExpertBasic(meetingId, user, ruleId, ExpertInviteType.APPOINT); + return getExpertBasic(meetingId, user, ruleId, ExpertInviteTypeEnum.APPOINT); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java index 747227e..991c528 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java @@ -4,7 +4,6 @@ package com.ningdatech.pmapi.meeting.controller; import com.ningdatech.basic.model.IdVo; import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; -import com.ningdatech.pmapi.meeting.entity.dto.MeetingBasicDTO; import com.ningdatech.pmapi.meeting.entity.req.*; import com.ningdatech.pmapi.meeting.entity.vo.*; import com.ningdatech.pmapi.meeting.manage.MeetingManage; @@ -33,27 +32,27 @@ public class MeetingController { private final MeetingManage meetingManage; - @PostMapping("/save") - @ApiOperation("新建会议") + @PostMapping("/create") + @ApiOperation(value = "新建会议") @WebLog(value = "新建会议") - public IdVo meetingCreate(@Valid @RequestBody MeetingBasicDTO req) { - return meetingManage.save(req); + public IdVo meetingCreate(@Valid @RequestBody MeetingCreateReq req) { + return meetingManage.meetingCreateAndInviteExpert(req); } @PostMapping("/expertInviteByCreate") - @ApiOperation("新建会议-专家抽取") + @ApiOperation(value = "新建会议-专家抽取", hidden = true) @WebLog(value = "新建会议-专家抽取") - public void expertInviteByCreate(@Valid @RequestBody ExpertInviteCreateReq po) { + public void expertInviteByCreate(@Valid @RequestBody ExpertInviteReq po) { meetingManage.expertInviteByCreate(po); } @ApiOperation("专家抽取数量校验") @PostMapping("/expertCountOnChange") - public ExpertCountOnChangeVO expertCountOnChange(@RequestBody ExpertInviteCreateReq po) { + public ExpertCountOnChangeVO expertCountOnChange(@RequestBody ExpertInviteReq po) { return meetingManage.expertCountOnChange(po); } - @ApiOperation("专家抽取员事务列表") + @ApiOperation("专家抽取员会议列表") @GetMapping("/meetingListByManager") @WebLog(value = "专家抽取员事务列表") public PageVo meetingListByManager(MeetingListReq po) { @@ -74,21 +73,6 @@ public class MeetingController { return meetingManage.getMeetingBasicInfo(meetingId); } - @ApiOperation("会议结果上传") - @PostMapping("/uploadMeetingResult") - @WebLog(value = "会议结果上传") - public void uploadMeetingResult(@Valid @RequestBody MeetingResultReq po) { - meetingManage.uploadMeetingResult(po); - - } - - @ApiOperation("会议结果详情") - @GetMapping("/detail/{meetingId}/meetingResult") - @WebLog(value = "会议结果详情况") - public MeetingResultVO meetingResultDetail(@PathVariable Long meetingId) { - return meetingManage.meetingResultDetail(meetingId); - } - @ApiOperation("邀请情况详情") @GetMapping("/detail/{meetingId}/inviteDetail") @WebLog(value = "邀请情况详请") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingInnerProjectController.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingInnerProjectController.java new file mode 100644 index 0000000..ba8ca99 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingInnerProjectController.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.meeting.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.stereotype.Controller; + +/** + *

+ * 会议评审内部项目表 前端控制器 + *

+ * + * @author WendyYang + * @since 2023-02-28 + */ +@Controller +@RequestMapping("/pmapi.meeting/meeting-inner-project") +public class MeetingInnerProjectController { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingOuterProjectController.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingOuterProjectController.java new file mode 100644 index 0000000..7956aa4 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingOuterProjectController.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.meeting.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.stereotype.Controller; + +/** + *

+ * 会议评审外部项目 前端控制器 + *

+ * + * @author WendyYang + * @since 2023-02-28 + */ +@Controller +@RequestMapping("/pmapi.meeting/meeting-outer-project") +public class MeetingOuterProjectController { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/ExpertInviteAvoidRule.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/ExpertInviteAvoidRule.java index dd99ef2..2f41a0b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/ExpertInviteAvoidRule.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/ExpertInviteAvoidRule.java @@ -35,11 +35,14 @@ public class ExpertInviteAvoidRule implements Serializable { @ApiModelProperty("回避专家ID") private String expertIds; - @ApiModelProperty("回避单位名称") - private String companyIds; + @ApiModelProperty("回避单位ID") + private String avoidUnitIds; - @ApiModelProperty("回避本单位同事") - private Boolean avoidMates; + @ApiModelProperty("回避条线ID") + private String avoidOrgIds; + + @ApiModelProperty("每周参与次数") + private Integer weekInviteCount; @ApiModelProperty("创建人ID") private Long createBy; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java index 22b0341..c3c42a2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java @@ -81,20 +81,13 @@ public class Meeting implements Serializable { @ApiModelProperty("是否停止随机邀请") private Boolean inviteStopped; - @ApiModelProperty("是否进行了专家抽取") - private Boolean invited; - - @ApiModelProperty("取消说明") - private String cancelRemark; - @ApiModelProperty("举办单位") private String holdOrg; @ApiModelProperty("举办单位ID") private String holdOrgCode; - public String getHoldCompanyBracket() { - return "(" + this.getHoldOrg() + ")"; - } + @ApiModelProperty("是否为内部项目") + private Boolean isInnerProject; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingInnerProject.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingInnerProject.java new file mode 100644 index 0000000..64ae07b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingInnerProject.java @@ -0,0 +1,37 @@ +package com.ningdatech.pmapi.meeting.entity.domain; + +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; + +import java.io.Serializable; + +/** + *

+ * 会议评审内部项目表 + *

+ * + * @author WendyYang + * @since 2023-02-28 + */ +@Data +@TableName("meeting_inner_project") +@ApiModel(value = "MeetingInnerProject对象", description = "会议评审内部项目表") +public class MeetingInnerProject implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("会议ID") + private Long meetingId; + + @ApiModelProperty("项目ID") + private Long projectId; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingOuterProject.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingOuterProject.java new file mode 100644 index 0000000..1aa86b2 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingOuterProject.java @@ -0,0 +1,61 @@ +package com.ningdatech.pmapi.meeting.entity.domain; + +import com.baomidou.mybatisplus.annotation.*; +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; + +/** + *

+ * 会议评审外部项目 + *

+ * + * @author WendyYang + * @since 2023-02-28 + */ +@Data +@TableName("meeting_outer_project") +@ApiModel(value = "MeetingOuterProject对象", description = "会议评审外部项目") +public class MeetingOuterProject implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位") + private String buildOrg; + + @ApiModelProperty("项目类型") + private String projectType; + + @ApiModelProperty("预算年度") + private Integer projectYear; + + @ApiModelProperty("申报金额") + private BigDecimal declareAmount; + + @ApiModelProperty("会议ID") + private Long meetingId; + + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createOn; + + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updateBy; + + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateOn; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/AvoidInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/AvoidInfoDTO.java index 97c4d5e..d32b7a0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/AvoidInfoDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/AvoidInfoDTO.java @@ -6,12 +6,11 @@ import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -import java.util.Collections; import java.util.List; /** *

- * AvoidInfoDto + * 专家邀请回避规则 *

* * @author WendyYang @@ -23,38 +22,17 @@ public class AvoidInfoDTO { @ApiModelProperty("回避单位") @NotEmpty(message = "回避单位不能为空", groups = {AbstractInviteRule.RuleSave.class}) - private List companyIds; + private List avoidUnitIdList; - @ApiModelProperty("是否回避同单位其他专家") - @NotNull(message = "是否回避同单位其他专家不能为空") - private Boolean avoidMates; + @ApiModelProperty("回避条线") + @NotEmpty(message = "回避条线不能为空", groups = {AbstractInviteRule.RuleSave.class}) + private List avoidOrgIdList; - @ApiModelProperty("回避专家ID") - private List expertIds; + @ApiModelProperty("每周邀请次数") + private Integer weekInviteCount; - /** - * 返回一个默认值,仅在前端未传值时使用 - * - * @return / - */ - public static AvoidInfoDTO defVal() { - AvoidInfoDTO val = new AvoidInfoDTO(); - val.setAvoidMates(false); - val.setCompanyIds(Collections.emptyList()); - val.setExpertIds(Collections.emptyList()); - return val; - } - - public void initDefVal() { - if (this.avoidMates == null) { - this.setAvoidMates(false); - } - if (this.companyIds == null) { - this.setCompanyIds(Collections.emptyList()); - } - if (this.expertIds == null) { - this.setExpertIds(Collections.emptyList()); - } - } + @ApiModelProperty("回避专家") + @NotEmpty(message = "回避专家不能为空", groups = {AbstractInviteRule.RuleSave.class}) + private List expertIds; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingBasicDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingBasicDTO.java index f9f34ef..ad48603 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingBasicDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingBasicDTO.java @@ -1,6 +1,5 @@ package com.ningdatech.pmapi.meeting.entity.dto; -import com.alibaba.excel.annotation.format.DateTimeFormat; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -9,6 +8,7 @@ import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; +import java.util.List; /** *

@@ -22,6 +22,10 @@ import java.time.LocalDateTime; @ApiModel("会议基本信息") public class MeetingBasicDTO { + @NotNull(message = "是否是系统内部项目不能为空") + @ApiModelProperty("是否是系统内部项目") + private Boolean isInnerProject; + @NotEmpty(message = "事务名称不能为空") @ApiModelProperty("事务名称") private String name; @@ -50,10 +54,16 @@ public class MeetingBasicDTO { @NotEmpty(message = "联系人不能为空") @ApiModelProperty("联系人") - private String contacter; + private String connecter; @NotEmpty(message = "联系方式不能为空") @ApiModelProperty("联系方式") private String contact; + @ApiModelProperty("内部项目ID") + private List projectIdList; + + @ApiModelProperty("外部项目") + private List projects; + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingReviewProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingReviewProjectDTO.java new file mode 100644 index 0000000..41ac6e2 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingReviewProjectDTO.java @@ -0,0 +1,32 @@ +package com.ningdatech.pmapi.meeting.entity.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + *

+ * MeetingEvalProjectDTO + *

+ * + * @author WendyYang + * @since 17:18 2023/2/28 + */ +@Data +public class MeetingReviewProjectDTO { + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("预算年度") + private Integer projectYear; + + @ApiModelProperty("项目类型") + private String projectType; + + @ApiModelProperty("申报金额") + private String declareAmount; + + @ApiModelProperty("申报单位") + private String buildOrg; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertInviteType.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertInviteTypeEnum.java similarity index 73% rename from pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertInviteType.java rename to pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertInviteTypeEnum.java index fde33e9..98c9801 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertInviteType.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertInviteTypeEnum.java @@ -13,7 +13,7 @@ import java.util.Arrays; * @since 10:11 2022/7/26 */ @Getter -public enum ExpertInviteType { +public enum ExpertInviteTypeEnum { /** * 专家抽取类型 @@ -24,12 +24,16 @@ public enum ExpertInviteType { private final Integer code; private final String name; - ExpertInviteType(Integer code, String name) { + ExpertInviteTypeEnum(Integer code, String name) { this.code = code; this.name = name; } - public static ExpertInviteType getByCode(Integer code) { + public boolean eq(Integer code) { + return this.getCode().equals(code); + } + + public static ExpertInviteTypeEnum getByCode(Integer code) { return Arrays.stream(values()) .filter(w -> w.getCode().equals(code)) .findFirst() diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/ExpertInviteCreateReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/ExpertInviteReq.java similarity index 77% rename from pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/ExpertInviteCreateReq.java rename to pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/ExpertInviteReq.java index 220654e..400da36 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/ExpertInviteCreateReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/ExpertInviteReq.java @@ -1,6 +1,5 @@ package com.ningdatech.pmapi.meeting.entity.req; -import com.ningdatech.pmapi.meeting.entity.dto.AbstractInviteRule; import com.ningdatech.pmapi.meeting.entity.dto.AppointInviteRuleDTO; import com.ningdatech.pmapi.meeting.entity.dto.AvoidInfoDTO; import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO; @@ -22,15 +21,19 @@ import java.util.List; */ @Data @ApiModel("专家抽取新家实体") -public class ExpertInviteCreateReq { +public class ExpertInviteReq { - @NotNull(message = "会议ID不能为空", groups = {AbstractInviteRule.RuleSave.class, AbstractInviteRule.CountCheck.class}) @ApiModelProperty("会议ID") private Long meetingId; + @NotNull(message = "抽取类型不能为空") + @ApiModelProperty("抽取类型:1 随机抽取、2 指定抽取") + private Integer inviteType; + @Valid + @NotNull(message = "回避信息不能为空") @ApiModelProperty("回避信息") - private AvoidInfoDTO avoidInfo; + private AvoidInfoDTO avoidRule; @Valid @ApiModelProperty("随机抽取规则") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingCreateReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingCreateReq.java new file mode 100644 index 0000000..480e3c0 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingCreateReq.java @@ -0,0 +1,31 @@ +package com.ningdatech.pmapi.meeting.entity.req; + +import com.ningdatech.pmapi.meeting.entity.dto.MeetingBasicDTO; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +/** + *

+ * MeetingCreateReq + *

+ * + * @author WendyYang + * @since 14:33 2023/2/28 + */ +@Data +public class MeetingCreateReq { + + @Valid + @NotNull(message = "会议基本信息不能为空") + @ApiModelProperty("会议基本信息") + private MeetingBasicDTO meetingBasicInfo; + + @Valid + @NotNull(message = "会议邀请规则不能为空") + @ApiModelProperty("会议邀请规则") + private ExpertInviteReq expertInviteRule; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/AppointRuleVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/AppointRuleVO.java new file mode 100644 index 0000000..d93c100 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/AppointRuleVO.java @@ -0,0 +1,27 @@ +package com.ningdatech.pmapi.meeting.entity.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + *

+ * 指定邀请规则 + *

+ * + * @author WendyYang + * @since 11:26 2023/3/1 + */ +@Data +@ApiModel("指定邀请规则") +public class AppointRuleVO { + + @ApiModelProperty("邀请说明") + private String inviteDesc; + + @ApiModelProperty("指定邀请专家") + private List experts; + +} \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/AvoidInfoVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/AvoidInfoVO.java new file mode 100644 index 0000000..e256063 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/AvoidInfoVO.java @@ -0,0 +1,33 @@ +package com.ningdatech.pmapi.meeting.entity.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + *

+ * 回避信息 + *

+ * + * @author WendyYang + * @since 11:25 2023/3/1 + */ +@Data +@ApiModel("回避信息") +public class AvoidInfoVO { + + @ApiModelProperty("回避单位") + private List avoidUnitIds; + + @ApiModelProperty("回避条线") + private List avoidOrgIds; + + @ApiModelProperty("每周邀请次数") + private Integer weekInviteCount; + + @ApiModelProperty("回避专家") + private List experts; + +} \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/ExpertInviteDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/ExpertInviteDetailVO.java index 8c8cbb4..acb2d20 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/ExpertInviteDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/ExpertInviteDetailVO.java @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.ArrayList; import java.util.List; /** @@ -57,25 +56,25 @@ public class ExpertInviteDetailVO { } @ApiModelProperty("参与数量总计") - private Integer attendTotal = 0; + private Integer attendTotal; @ApiModelProperty("随机邀请参与数量") - private Integer randomAttend = 0; + private Integer randomAttend; @ApiModelProperty("指定邀请参与数量") - private Integer appointAttend = 0; + private Integer appointAttend; @ApiModelProperty("是否已停止邀请") private Boolean invitedStopped; @ApiModelProperty("最终参与名单") - private List attendList = new ArrayList<>(); + private List attendList; @ApiModelProperty("随机邀请名单") - private List randomInviteList = new ArrayList<>(); + private List randomInviteList; @ApiModelProperty("指定邀请名单") - private List appointInviteList = new ArrayList<>(); + private List appointInviteList; public void addAttendList(ExpertAttendListItemVO attend) { this.attendList.add(attend); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/InviteRuleDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/InviteRuleDetailVO.java index 267127d..e2f8e19 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/InviteRuleDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/InviteRuleDetailVO.java @@ -16,57 +16,15 @@ import java.util.List; @Data public class InviteRuleDetailVO { - @ApiModelProperty("是否创建邀请规则") - private Boolean invited; + private Integer inviteType; @ApiModelProperty("随机邀请规则") private List randomRules; - @ApiModelProperty("是否有指定抽取规则") - private Boolean hasAppointRule; - @ApiModelProperty("指定抽取规则") - private AppointRuleVo appointRule; - - @ApiModelProperty("是否有回避规则") - private Boolean hasAvoidInfo; + private AppointRuleVO appointRule; @ApiModelProperty("回避信息") - private AvoidInfoVo avoidInfo; - - @Data - public static class AvoidInfoVo { - - private List companyIds; - - private Boolean avoidMates; - - private List experts; - - } - - @Data - public static class AppointRuleVo { - - private String inviteDesc; - - private List experts; - - } - - public Boolean setAndGetHasAppointRule(Boolean hasAppointRule) { - this.hasAppointRule = hasAppointRule; - return this.hasAppointRule; - } - - public Boolean setAndGetHasAvoidInfo(Boolean hasAvoidInfo) { - this.hasAvoidInfo = hasAvoidInfo; - return this.hasAvoidInfo; - } - - public Boolean setAndGetInvited(Boolean invited) { - this.invited = invited; - return this.invited; - } + private AvoidInfoVO avoidInfo; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingDetailBasicVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingDetailBasicVO.java index c5078aa..2cd42b2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingDetailBasicVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingDetailBasicVO.java @@ -1,8 +1,7 @@ package com.ningdatech.pmapi.meeting.entity.vo; import com.alibaba.fastjson.annotation.JSONField; -import com.ningdatech.file.entity.vo.result.AttachFileVo; -import com.ningdatech.pmapi.sys.model.dto.RegionDTO; +import com.ningdatech.pmapi.meeting.entity.req.ExpertInviteReq; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Builder; @@ -10,7 +9,6 @@ import lombok.Data; import lombok.experimental.Tolerate; import java.time.LocalDateTime; -import java.util.List; /** *

@@ -29,35 +27,36 @@ public class MeetingDetailBasicVO { public MeetingDetailBasicVO() { } - private Long id; + private Long meetingId; @ApiModelProperty("会议名称") - private String name; + private String meetingName; @ApiModelProperty("会议类型名称") private String typeName; @ApiModelProperty("会议类型代码") - private String type; + private String meetingType; @ApiModelProperty("开始时间") @JSONField(format = "yyyy-MM-dd HH:mm") private LocalDateTime startTime; - @ApiModelProperty("结束时间") + @ApiModelProperty("评委到场时间") @JSONField(format = "yyyy-MM-dd HH:mm") - private LocalDateTime endTime; + private LocalDateTime judgesAttendanceTime; + + @ApiModelProperty("会议耗时") + private Integer meetingUsageTime; @ApiModelProperty("联系人") private String connecter; @ApiModelProperty("创建人") - private String author; - - private List regions; + private String creator; - @ApiModelProperty("地点") - private String address; + @ApiModelProperty("评审地点") + private String meetingAddress; @ApiModelProperty("联系方式") private String contact; @@ -65,33 +64,19 @@ public class MeetingDetailBasicVO { @ApiModelProperty("创建时间") private LocalDateTime createOn; - @ApiModelProperty("会议说明") - private String description; - - @ApiModelProperty("相关材料") - private List attachments; - - @ApiModelProperty("备注") - private String remark; - @ApiModelProperty("会议状态") private Integer status; - @ApiModelProperty("专家出席状态") - private Integer attendStatus; - @ApiModelProperty("取消说明") private String cancelRemark; @ApiModelProperty("创建人") private String createBy; - private Boolean invited; - @ApiModelProperty("抽取单位") private String holdOrg; - @ApiModelProperty("是否已确认下发会议通知名单") - private Boolean sendMeetingNotice; + @ApiModelProperty("抽取信息") + private InviteRuleDetailVO inviteRule; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/ExpertInviteHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/ExpertInviteHelper.java index 997f565..91789ca 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/ExpertInviteHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/ExpertInviteHelper.java @@ -1,10 +1,17 @@ package com.ningdatech.pmapi.meeting.helper; +import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +import com.ningdatech.pmapi.meeting.entity.domain.ExpertInviteRule; import com.ningdatech.pmapi.meeting.entity.domain.Meeting; import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; +import com.ningdatech.pmapi.meeting.entity.dto.AbstractInviteRule; +import com.ningdatech.pmapi.meeting.entity.dto.AppointInviteRuleDTO; import com.ningdatech.pmapi.meeting.entity.dto.AvoidInfoDTO; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatus; @@ -12,7 +19,9 @@ import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; import com.ningdatech.pmapi.meeting.service.IMeetingService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Component; +import org.springframework.util.Assert; import java.time.LocalDateTime; import java.util.*; @@ -32,6 +41,7 @@ public class ExpertInviteHelper { private final IMeetingService meetingService; private final IMeetingExpertService meetingExpertService; + private final IExpertUserFullInfoService expertUserFullInfoService; /** * 获取时间段内被抽中的专家(通知中、确认参加) @@ -77,4 +87,29 @@ public class ExpertInviteHelper { return expertIds; } + public Map checkAppointExpert(AppointInviteRuleDTO appointRule) { + if (appointRule == null) { + return Collections.emptyMap(); + } + List expertInfos = expertUserFullInfoService.listByUserId(appointRule.getExpertIds()); + return CollUtils.listToMap(expertInfos, ExpertUserFullInfo::getUserId); + } + + /** + * 构建邀请规则 + * + * @param rule 邀请规则 + * @param meetingId 会议ID + * @return {@link ExpertInviteRule} + * @author WendyYang + **/ + public static ExpertInviteRule getExpertInviteRule(AbstractInviteRule rule, Long meetingId) { + ExpertInviteRule result = new ExpertInviteRule(); + result.setInviteRule(JSONObject.toJSONString(rule)); + result.setInviteCount(rule.getCount()); + result.setInviteType(rule.getInviteType()); + result.setMeetingId(meetingId); + return result; + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java index 0f463e1..030b0a7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java @@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.common.util.BizUtils; -import com.ningdatech.pmapi.common.util.StrUtils; import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; import com.ningdatech.pmapi.expert.service.ExpertInfoService; @@ -16,6 +15,7 @@ import com.ningdatech.pmapi.meeting.entity.domain.Meeting; import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; import com.ningdatech.pmapi.meeting.entity.dto.AvoidInfoDTO; import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO; +import com.ningdatech.pmapi.meeting.entity.dto.MeetingBasicDTO; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatus; import com.ningdatech.pmapi.meeting.entity.req.MeetingListReq; @@ -50,6 +50,14 @@ public class MeetingManageHelper { private final IExpertInviteRuleService inviteRuleService; private final IExpertInviteAvoidRuleService inviteAvoidRuleService; + public void checkReviewProject(MeetingBasicDTO meetingBasic) { + if (meetingBasic.getIsInnerProject()) { + Assert.notEmpty(meetingBasic.getProjectIdList(), "评审项目不能为空"); + } else { + Assert.notEmpty(meetingBasic.getProjects(), "评审项目不能为空"); + } + } + /** * 获取专家出席会议的状态 * @@ -80,7 +88,6 @@ public class MeetingManageHelper { .connecter(meeting.getConnecter()) .contact(meeting.getContact()) .status(meeting.getStatus()) - .invited(meeting.getInvited()) .holdOrg(meeting.getHoldOrg()) .build(); } @@ -134,11 +141,12 @@ public class MeetingManageHelper { public AvoidInfoDTO getAvoidInfoDto(Long meetingId) { ExpertInviteAvoidRule avoidRule = inviteAvoidRuleService.getByMeetingId(meetingId); - AvoidInfoDTO avoidInfoDto = new AvoidInfoDTO(); - avoidInfoDto.setAvoidMates(avoidRule.getAvoidMates()); - avoidInfoDto.setExpertIds(BizUtils.splitToLong(avoidRule.getExpertIds())); - avoidInfoDto.setCompanyIds(StrUtils.split(avoidRule.getCompanyIds())); - return avoidInfoDto; + AvoidInfoDTO result = new AvoidInfoDTO(); + result.setAvoidOrgIdList(StrUtil.split(avoidRule.getAvoidOrgIds(), ",")); + result.setExpertIds(BizUtils.splitToLong(avoidRule.getExpertIds())); + result.setAvoidUnitIdList(StrUtil.split(avoidRule.getAvoidUnitIds(), ",")); + result.setWeekInviteCount(result.getWeekInviteCount()); + return result; } public void saveAvoidInfo(Long meetingId, List expertIds) { @@ -159,16 +167,12 @@ public class MeetingManageHelper { AvoidInfoDTO avoidRule = getAvoidInfoDto(meetingId); Map countMap = new HashMap<>(16); experts.forEach(expert -> { - if (avoidRule.getCompanyIds().contains(expert.getCompany())) { + if (avoidRule.getAvoidUnitIdList().contains(expert.getCompany())) { throw BizException.wrap("回避单位的专家不可出现在指定邀请名单中"); } if (CollectionUtils.isNotEmpty(avoidRule.getExpertIds()) && avoidRule.getExpertIds().contains(expert.getUserId())) { throw BizException.wrap("已回避的专家不可被指定邀请"); } - if (avoidRule.getAvoidMates()) { - Integer oldValue = countMap.put(expert.getCompany(), 1); - Assert.isNull(oldValue, "不可选择同单位的多个专家"); - } // 校验专家状态 ExpertAccountStatusEnum accountStatus = ExpertAccountStatusEnum.of(expert.getExpertAccountStatus()); if (!accountStatus.equals(ExpertAccountStatusEnum.AVAILABLE)) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/DashboardManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/DashboardManage.java index 12fcf76..de8e5be 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/DashboardManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/DashboardManage.java @@ -13,7 +13,7 @@ import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; import com.ningdatech.pmapi.meeting.entity.dto.CountConfirmByMeetingIdDTO; import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; -import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteType; +import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatus; import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusByDashboard; import com.ningdatech.pmapi.meeting.entity.req.MeetingCalenderReq; @@ -202,7 +202,7 @@ public class DashboardManage { item.setExpertMeetingId(w.getId()); Meeting meeting = meetingMap.get(w.getMeetingId()); item.setMeetingName(meeting.getName()); - item.setInviteType(ExpertInviteType.getByCode(w.getInviteType()).getName()); + item.setInviteType(ExpertInviteTypeEnum.getByCode(w.getInviteType()).getName()); item.setStatus(w.getStatus()); item.setStartTime(meeting.getStartTime()); item.setEndTime(meeting.getEndTime()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java index 546b676..4ea45a7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java @@ -1,7 +1,6 @@ package com.ningdatech.pmapi.meeting.manage; import cn.hutool.core.collection.CollUtil; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.util.CollUtils; @@ -16,7 +15,10 @@ import com.ningdatech.pmapi.meeting.builder.ExpertInviteBuilder; import com.ningdatech.pmapi.meeting.entity.domain.ExpertInviteRule; import com.ningdatech.pmapi.meeting.entity.domain.Meeting; import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; -import com.ningdatech.pmapi.meeting.entity.dto.*; +import com.ningdatech.pmapi.meeting.entity.dto.AvoidInfoDTO; +import com.ningdatech.pmapi.meeting.entity.dto.ExpertChooseDTO; +import com.ningdatech.pmapi.meeting.entity.dto.ExpertDictChooseDTO; +import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; import com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper; import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; @@ -35,13 +37,14 @@ import org.apache.commons.collections4.Predicate; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.RandomUtils; import org.springframework.stereotype.Component; -import org.springframework.util.Assert; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; +import static com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper.getExpertInviteRule; + /** *

* 专家邀请管理 @@ -149,7 +152,7 @@ public class ExpertInviteManage { return null; } // 处理专家回避单位 与 抽取回避单位是否相同 - List avoidCompanyExpertIds = avoidCompanyExpertIds(avoidInfo.getCompanyIds()); + List avoidCompanyExpertIds = avoidCompanyExpertIds(avoidInfo.getAvoidUnitIdList()); // 聚合用户ID List expertIdsIn = new ArrayList<>(); @@ -261,10 +264,10 @@ public class ExpertInviteManage { } boolean avoid = avoidInfo != null; boolean avoidExpert = avoid && CollUtil.isNotEmpty(avoidInfo.getExpertIds()); - boolean avoidCompany = avoid && CollUtil.isNotEmpty(avoidInfo.getCompanyIds()); + boolean avoidCompany = avoid && CollUtil.isNotEmpty(avoidInfo.getAvoidUnitIdList()); Set tmpAvoidCompany = new HashSet<>(); if (avoidCompany) { - List companyIds = avoidInfo.getCompanyIds(); + List companyIds = avoidInfo.getAvoidUnitIdList(); for (String companyId : companyIds) { if (companyId.contains(",")) { String[] splitCompanyIds = companyId.split(","); @@ -277,16 +280,11 @@ public class ExpertInviteManage { } } // 回避信息 - if (CollUtil.isNotEmpty(appointExpertIds) && avoid && avoidInfo.getAvoidMates()) { - // 如果设置了回避本单位同事且手动指定了专家,则对应的单位需要排除 - List appointUsers = expertUserFullInfoService.listByUserId(appointExpertIds); - tmpAvoidCompany.addAll(CollUtils.fieldList(appointUsers, ExpertUserFullInfo::getCompany)); - } LambdaQueryWrapper query = buildBaseExpertQuery(); query.notIn(!tmpAvoidCompany.isEmpty(), ExpertUserFullInfo::getCompany, tmpAvoidCompany); if (avoidCompany) { query.notExists("select 1 from expert_avoid_company eac where eac.user_id = expert_user_full_info.user_id" + - " and company_name in ({0})", CollUtils.joinByComma(avoidInfo.getCompanyIds())); + " and company_name in ({0})", CollUtils.joinByComma(avoidInfo.getAvoidUnitIdList())); } // 处理专家层级 addRegionLimit(query, randomRule); @@ -326,21 +324,11 @@ public class ExpertInviteManage { if (userFullInfos.isEmpty()) { return result; } - if (avoid && avoidInfo.getAvoidMates()) { - // 回避同单位其他专家 - Map> userFullInfoMap = CollUtils.group(userFullInfos, ExpertUserFullInfo::getCompany); - result.setTotal(userFullInfoMap.size()); - if (randomRule.getCount() == null || userFullInfoMap.size() >= randomRule.getCount()) { - List userFullInfoList = inviteGroupByCompany(userFullInfoMap, randomRule.getCount()); - result.setExperts(userFullInfoList); - } - } else { - result.setTotal(userFullInfos.size()); - // count为空表示数量校验 - if (randomRule.getCount() == null || result.getTotal() >= randomRule.getCount()) { - List userFullInfoList = inviteWithoutCompany(userFullInfos, randomRule.getCount()); - result.setExperts(userFullInfoList); - } + result.setTotal(userFullInfos.size()); + // count为空表示数量校验 + if (randomRule.getCount() == null || result.getTotal() >= randomRule.getCount()) { + List userFullInfoList = inviteWithoutCompany(userFullInfos, randomRule.getCount()); + result.setExperts(userFullInfoList); } return result; } @@ -369,9 +357,9 @@ public class ExpertInviteManage { return result; } LambdaQueryWrapper query = buildBaseExpertQuery(); - query.notIn(ExpertUserFullInfo::getCompany, avoidInfo.getCompanyIds()); + query.notIn(ExpertUserFullInfo::getCompany, avoidInfo.getAvoidUnitIdList()); query.notExists("select 1 from expert_avoid_company eac where eac.user_id = expert_user_full_info.user_id" + - " and company_name in ({0})", CollUtils.joinByComma(avoidInfo.getCompanyIds())); + " and company_name in ({0})", CollUtils.joinByComma(avoidInfo.getAvoidOrgIdList())); // 处理专家层级 if (ObjectUtils.allNotNull(randomRule.getExpertRegionCode(), randomRule.getExpertRegionLevel())) { @@ -440,23 +428,10 @@ public class ExpertInviteManage { removeExpertIds.add(replacedExpertId); } List tempExpertIds = CollUtils.fieldList(removeExpertByCompany, MeetingExpert::getExpertId); - if (avoidInfo.getAvoidMates()) { - if (!tempExpertIds.isEmpty()) { - Set confirmedCompany = userFullInfos.stream() - .filter(w -> tempExpertIds.contains(w.getUserId())) - .map(ExpertUserFullInfo::getCompany).collect(Collectors.toSet()); - userFullInfos.removeIf(w -> confirmedCompany.contains(w.getCompany())); - } - userFullInfos.removeIf(w -> removeExpertIds.contains(w.getUserId())); - Map> groupByCompany = CollUtils.group(userFullInfos, ExpertUserFullInfo::getCompany); - result.setTotal(groupByCompany.size()); - result.setExperts(inviteGroupByCompany(groupByCompany, count)); - } else { - // 移除确认参加、通知中的、拒绝参加、已取消 - userFullInfos.removeIf(w -> tempExpertIds.contains(w.getUserId()) || removeExpertIds.contains(w.getUserId())); - result.setTotal(userFullInfos.size()); - result.setExperts(inviteWithoutCompany(userFullInfos, count)); - } + // 移除确认参加、通知中的、拒绝参加、已取消 + userFullInfos.removeIf(w -> tempExpertIds.contains(w.getUserId()) || removeExpertIds.contains(w.getUserId())); + result.setTotal(userFullInfos.size()); + result.setExperts(inviteWithoutCompany(userFullInfos, count)); return result; } @@ -569,78 +544,27 @@ public class ExpertInviteManage { } /** - * 构建邀请规则 - * - * @param inviteRule 邀请规则 - * @param meetingId 会议ID - * @return {@link ExpertInviteRule} - * @author WendyYang - **/ - private static ExpertInviteRule getExpertInviteRule(AbstractInviteRule inviteRule, Long meetingId) { - ExpertInviteRule rule = new ExpertInviteRule(); - rule.setInviteRule(JSONObject.toJSONString(inviteRule)); - rule.setInviteCount(inviteRule.getCount()); - rule.setInviteType(inviteRule.getInviteType()); - rule.setMeetingId(meetingId); - return rule; - } - - public Map checkAppointExpertConflictWithAvoidRule(AppointInviteRuleDTO appointRule, AvoidInfoDTO avoidRule) { - if (appointRule == null) { - return Collections.emptyMap(); - } - List expertInfos = expertUserFullInfoService.listByUserId(appointRule.getExpertIds()); - Map infoMap = CollUtils.listToMap(expertInfos, ExpertUserFullInfo::getUserId); - if (avoidRule == null) { - return infoMap; - } - Map countMap = new HashMap<>(16); - infoMap.forEach((key, userFullInfo) -> { - if (CollectionUtils.isNotEmpty(avoidRule.getExpertIds())) { - boolean contains = avoidRule.getExpertIds().contains(key); - Assert.isTrue(!contains, "已回避的专家不可被指定邀请"); - } - if (CollectionUtils.isNotEmpty(avoidRule.getCompanyIds())) { - boolean contains = avoidRule.getCompanyIds().contains(userFullInfo.getCompany()); - Assert.isTrue(!contains, "回避单位的专家不可出现在指定邀请名单中"); - } - if (avoidRule.getAvoidMates()) { - Integer oldValue = countMap.put(userFullInfo.getCompany(), 1); - Assert.isNull(oldValue, "不可选择同单位的多个专家"); - } - }); - return infoMap; - } - - - /** * 专家抽取(会议创建时抽取) * * @param randomRules 随机抽取规则 - * @param appointRule 指定抽取规则 * @param avoid 回避信息 * @author WendyYang **/ - public void expertInviteByMeetingCreate(Meeting meeting, - List randomRules, - AppointInviteRuleDTO appointRule, - AvoidInfoDTO avoid) { - Map appointUser = checkAppointExpertConflictWithAvoidRule(appointRule, avoid); + public void expertRandomInviteByMeetingCreate(Meeting meeting, + List randomRules, + AvoidInfoDTO avoid) { List expertInserts = new ArrayList<>(); - boolean appointed = appointRule != null; // 处理随机抽取规则 if (CollectionUtils.isNotEmpty(randomRules)) { List randoms = new ArrayList<>(); List expertsByRandom = new ArrayList<>(); - List tempExpertIdSelected = new ArrayList<>(); - if (appointed) { - tempExpertIdSelected.addAll(appointRule.getExpertIds()); - } - LocalDateTime startTime = meeting.getStartTime(), endTime = meeting.getEndTime(); + List choosedExpertIds = new ArrayList<>(); + LocalDateTime startTime = meeting.getStartTime(); + LocalDateTime endTime = meeting.getEndTime(); randomRules.forEach(rule -> { - ExpertChooseDTO tempExperts = expertInviteByRandomRule(avoid, rule, tempExpertIdSelected, startTime, endTime); + ExpertChooseDTO tempExperts = expertInviteByRandomRule(avoid, rule, choosedExpertIds, startTime, endTime); expertsByRandom.add(tempExperts); - tempExpertIdSelected.addAll(CollUtils.fieldList(tempExperts.getExperts(), ExpertUserFullInfo::getUserId)); + choosedExpertIds.addAll(CollUtils.fieldList(tempExperts.getExperts(), ExpertUserFullInfo::getUserId)); randoms.add(getExpertInviteRule(rule, meeting.getId())); }); inviteRuleService.saveBatch(randoms); @@ -654,18 +578,6 @@ public class ExpertInviteManage { } yxtCallOrSmsHelper.callByMeetingExperts(meeting, expertInserts); } - if (appointed) { - // 处理指定抽取规则 - ExpertInviteRule appoint = getExpertInviteRule(appointRule, meeting.getId()); - inviteRuleService.save(appoint); - Long ruleId = appoint.getId(); - appointRule.getExpertIds().forEach(w -> { - ExpertUserFullInfo info = appointUser.get(w); - MeetingExpert expert = ExpertInviteBuilder.getExpertByAppoint(meeting.getId(), info, ruleId); - expert.setStatus(ExpertAttendStatus.NOTICING.getCode()); - expertInserts.add(expert); - }); - } meetingExpertService.saveBatch(expertInserts); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java index e111a1c..5ba10b6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java @@ -2,6 +2,7 @@ package com.ningdatech.pmapi.meeting.manage; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.SecureUtil; import com.alibaba.fastjson.JSON; @@ -16,17 +17,15 @@ import com.ningdatech.basic.util.CollUtils; import com.ningdatech.basic.util.ValidUtil; import com.ningdatech.cache.lock.DistributedLock; import com.ningdatech.file.service.FileService; +import com.ningdatech.pmapi.common.helper.RegionCacheHelper; import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; import com.ningdatech.pmapi.expert.helper.PermissionCheckHelper; import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; import com.ningdatech.pmapi.meeting.builder.ExpertInviteBuilder; -import com.ningdatech.pmapi.meeting.entity.domain.ExpertInviteAvoidRule; -import com.ningdatech.pmapi.meeting.entity.domain.ExpertInviteRule; -import com.ningdatech.pmapi.meeting.entity.domain.Meeting; -import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; +import com.ningdatech.pmapi.meeting.entity.domain.*; import com.ningdatech.pmapi.meeting.entity.dto.*; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; -import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteType; +import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatus.Manager; import com.ningdatech.pmapi.meeting.entity.req.*; import com.ningdatech.pmapi.meeting.entity.vo.*; @@ -35,10 +34,7 @@ import com.ningdatech.pmapi.meeting.entity.vo.ExpertInviteDetailVO.RandomInviteL import com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper; import com.ningdatech.pmapi.meeting.helper.MeetingManageHelper; import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; -import com.ningdatech.pmapi.meeting.service.IExpertInviteAvoidRuleService; -import com.ningdatech.pmapi.meeting.service.IExpertInviteRuleService; -import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; -import com.ningdatech.pmapi.meeting.service.IMeetingService; +import com.ningdatech.pmapi.meeting.service.*; import com.ningdatech.pmapi.meeting.task.ExpertInviteTask; import com.ningdatech.pmapi.meta.helper.DictionaryCache; import com.ningdatech.pmapi.meta.helper.TagCache; @@ -46,7 +42,6 @@ import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; import com.ningdatech.pmapi.user.service.IUserInfoService; import com.ningdatech.pmapi.user.util.LoginUserUtil; import lombok.RequiredArgsConstructor; -import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; @@ -54,6 +49,9 @@ import org.springframework.util.Assert; import java.time.LocalDateTime; import java.util.*; import java.util.function.Function; +import java.util.stream.Collectors; + +import static com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper.getExpertInviteRule; /** *

@@ -67,6 +65,7 @@ import java.util.function.Function; @RequiredArgsConstructor public class MeetingManage { + private final RegionCacheHelper regionCacheHelper; private final IMeetingService meetingService; private final IExpertInviteAvoidRuleService inviteAvoidRuleService; private final IExpertInviteRuleService inviteRuleService; @@ -82,6 +81,8 @@ public class MeetingManage { private final DistributedLock distributedLock; private final PermissionCheckHelper permissionCheckHelper; private final IUserInfoService userInfoService; + private final IMeetingInnerProjectService meetingInnerProjectService; + private final IMeetingOuterProjectService meetingOuterProjectService; private final ExpertInviteHelper expertInviteHelper; private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; @@ -93,23 +94,45 @@ public class MeetingManage { */ public static final int RETRY_TIMES = 3; - public IdVo save(MeetingBasicDTO po) { - String md5ByParam = SecureUtil.md5(po.toString()); + @Transactional(rollbackFor = Exception.class) + public IdVo meetingCreateAndInviteExpert(MeetingCreateReq req) { + MeetingBasicDTO meetingBasic = req.getMeetingBasicInfo(); + meetingManageHelper.checkReviewProject(meetingBasic); + String md5ByParam = SecureUtil.md5(meetingBasic.toString()); String key = MEETING_CREATE_KEY + md5ByParam; if (!distributedLock.lock(key, RETRY_TIMES)) { throw BizException.wrap("会议正在创建中"); } try { - Meeting meeting = BeanUtil.copyProperties(po, Meeting.class); + // 保存会议基本信息 + Meeting meeting = BeanUtil.copyProperties(meetingBasic, Meeting.class); meeting.setStatus(Manager.UNCOMPLETED.getCode()); UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); - // TODO meeting.setHoldOrg(userDetail.getOrganizationName()); meeting.setHoldOrgCode(userDetail.getOrganizationCode()); + meeting.setRegionCode(userDetail.getRegionCode()); meeting.setCreator(userDetail.getUsername()); - meeting.setInvited(Boolean.FALSE); meeting.setInviteStopped(true); meetingService.save(meeting); + if (meetingBasic.getIsInnerProject()) { + List projects = meetingBasic.getProjectIdList().stream().map(w -> { + MeetingInnerProject project = new MeetingInnerProject(); + project.setMeetingId(meeting.getId()); + project.setProjectId(w); + return project; + }).collect(Collectors.toList()); + meetingInnerProjectService.saveBatch(projects); + } else { + List projects = meetingBasic.getProjects().stream().map(w -> { + MeetingOuterProject project = BeanUtil.copyProperties(w, MeetingOuterProject.class); + project.setMeetingId(meeting.getId()); + return project; + }).collect(Collectors.toList()); + meetingOuterProjectService.saveBatch(projects); + } + // 抽取专家 + req.getExpertInviteRule().setMeetingId(meeting.getId()); + expertInviteByCreate(req.getExpertInviteRule()); return IdVo.of(meeting.getId()); } finally { distributedLock.releaseLock(key); @@ -117,45 +140,61 @@ public class MeetingManage { } @Transactional(rollbackFor = Exception.class) - public void expertInviteByCreate(ExpertInviteCreateReq req) { - // 未传递指定邀请专家直接忽略 - if (req.getAppointRule() != null && CollectionUtils.isEmpty(req.getAppointRule().getExpertIds())) { - Assert.isTrue(CollectionUtils.isNotEmpty(req.getRandomRules()), "未指定抽取规则"); - req.setAppointRule(null); - } + public void expertInviteByCreate(ExpertInviteReq req) { String key = INVITED_RULE_CREATE + req.getMeetingId(); if (!distributedLock.lock(key, RETRY_TIMES)) { throw BizException.wrap("不可重复进行专家抽取"); } try { Meeting meeting = meetingService.getById(req.getMeetingId()); - Assert.isTrue(!meeting.getInvited(), "不可重复进行专家抽取"); - ExpertCountOnChangeVO countOnChange = expertCountOnChange(req); - for (int i = 0; i < req.getRandomRules().size(); i++) { - Integer checkCount = countOnChange.getCountList().get(i); - Integer inviteCount = req.getRandomRules().get(i).getCount(); - Assert.isTrue(checkCount >= inviteCount, "可供抽取的专家数量不足"); - } - AvoidInfoDTO avoidInfo = req.getAvoidInfo(); - expertInviteManage.expertInviteByMeetingCreate(meeting, req.getRandomRules(), req.getAppointRule(), avoidInfo); - LambdaUpdateWrapper updater = Wrappers.lambdaUpdate(Meeting.class) - .set(Meeting::getInvited, Boolean.TRUE) - .eq(Meeting::getId, req.getMeetingId()); - if (CollectionUtils.isNotEmpty(req.getRandomRules())) { + if (ExpertInviteTypeEnum.RANDOM.eq(req.getInviteType())) { + List randomRules = req.getRandomRules(); + Assert.notEmpty(randomRules, "随机抽取规则不能为空"); + AvoidInfoDTO avoidInfo = req.getAvoidRule(); + Assert.notNull(avoidInfo, "回避信息不能为空"); + // 随机抽取的话则需进行抽取数量校验 + ExpertCountOnChangeVO countOnChange = expertCountOnChange(req); + if (!countOnChange.getStatus()) { + throw BizException.wrap(countOnChange.getMessage()); + } + for (int i = 0; i < randomRules.size(); i++) { + Integer checkCount = countOnChange.getCountList().get(i); + Integer inviteCount = randomRules.get(i).getCount(); + Assert.isTrue(checkCount >= inviteCount, "可供抽取的专家数量不足"); + } + expertInviteManage.expertRandomInviteByMeetingCreate(meeting, randomRules, avoidInfo); expertInviteTask.addInviteExpertTaskByMeetingCreate(meeting.getId(), 5); - updater.set(Meeting::getInviteStopped, false); - } - meetingService.update(updater); - // 回避规则 - if (avoidInfo != null) { - ExpertInviteAvoidRule avoidRule = new ExpertInviteAvoidRule(); - avoidRule.setMeetingId(meeting.getId()); - avoidRule.setAvoidMates(avoidInfo.getAvoidMates()); - avoidRule.setCompanyIds(CollUtils.joinByComma(avoidInfo.getCompanyIds())); - if (CollectionUtils.isNotEmpty(avoidInfo.getExpertIds())) { + LambdaUpdateWrapper update = Wrappers.lambdaUpdate(Meeting.class); + update.set(Meeting::getInviteStopped, false); + update.eq(Meeting::getId, meeting.getId()); + meetingService.update(update); + // 回避规则 + if (avoidInfo != null) { + ExpertInviteAvoidRule avoidRule = new ExpertInviteAvoidRule(); + avoidRule.setMeetingId(meeting.getId()); + // 未传值时设置为0 表示不限制周参与次数 + avoidRule.setWeekInviteCount(ObjectUtil.defaultIfNull(avoidRule.getWeekInviteCount(), 0)); + avoidRule.setAvoidOrgIds(CollUtils.joinByComma(avoidInfo.getAvoidOrgIdList())); + avoidRule.setAvoidUnitIds(CollUtils.joinByComma(avoidInfo.getAvoidUnitIdList())); avoidRule.setExpertIds(CollUtils.joinByComma(avoidInfo.getExpertIds())); + inviteAvoidRuleService.save(avoidRule); } - inviteAvoidRuleService.save(avoidRule); + } else { + // 指定邀请 + AppointInviteRuleDTO appointRule = req.getAppointRule(); + Assert.notNull(appointRule, "指定邀请规则不能为空"); + Map usersMap = expertInviteHelper.checkAppointExpert(appointRule); + // 处理指定抽取规则 + ExpertInviteRule appoint = getExpertInviteRule(appointRule, meeting.getId()); + inviteRuleService.save(appoint); + Long ruleId = appoint.getId(); + List experts = appointRule.getExpertIds().stream().map(w -> { + ExpertUserFullInfo info = usersMap.get(w); + MeetingExpert expert = ExpertInviteBuilder.getExpertByAppoint(meeting.getId(), info, ruleId); + expert.setStatus(ExpertAttendStatus.NOTICING.getCode()); + return expert; + }).collect(Collectors.toList()); + meetingExpertService.saveBatch(experts); } } finally { distributedLock.releaseLock(key); @@ -165,35 +204,27 @@ public class MeetingManage { /** * 抽取数量校验 * - * @param po 抽取参数 + * @param req 抽取参数 * @return {@link ExpertCountOnChangeVO} * @author WendyYang **/ - public ExpertCountOnChangeVO expertCountOnChange(ExpertInviteCreateReq po) { + public ExpertCountOnChangeVO expertCountOnChange(ExpertInviteReq req) { // 未传递指定邀请专家直接忽略 - if (po.getAppointRule() != null && CollUtil.isEmpty(po.getAppointRule().getExpertIds())) { - Assert.isTrue(CollUtil.isNotEmpty(po.getRandomRules()), "未指定抽取规则"); - po.setAppointRule(null); - } - boolean appointed = po.getAppointRule() != null; - expertInviteManage.checkAppointExpertConflictWithAvoidRule(po.getAppointRule(), po.getAvoidInfo()); - Meeting meeting = meetingService.getById(po.getMeetingId()); + expertInviteHelper.checkAppointExpert(req.getAppointRule()); + Meeting meeting = meetingService.getById(req.getMeetingId()); ExpertCountOnChangeVO resultCount = new ExpertCountOnChangeVO(); resultCount.setStatus(true); resultCount.setCountList(new ArrayList<>()); // 参数校验 - String errMsg = ValidUtil.validFast(po, AbstractInviteRule.CountCheck.class); + String errMsg = ValidUtil.validFast(req, AbstractInviteRule.CountCheck.class); if (errMsg != null) { resultCount.setStatus(false); resultCount.setMessage(errMsg); return resultCount; } List expertIdsChoose = new ArrayList<>(); - if (appointed) { - expertIdsChoose.addAll(po.getAppointRule().getExpertIds()); - } - for (RandomInviteRuleDTO randomRule : po.getRandomRules()) { - ExpertChooseDTO chooseExpert = expertInviteManage.expertInviteByRandomRule(po.getAvoidInfo(), + for (RandomInviteRuleDTO randomRule : req.getRandomRules()) { + ExpertChooseDTO chooseExpert = expertInviteManage.expertInviteByRandomRule(req.getAvoidRule(), randomRule, expertIdsChoose, meeting.getStartTime(), meeting.getEndTime()); resultCount.addCountList(chooseExpert.getTotal()); } @@ -277,53 +308,26 @@ public class MeetingManage { public MeetingDetailBasicVO getMeetingBasicInfo(Long meetingId) { Meeting meeting = meetingService.getById(meetingId); - if (Objects.isNull(meeting)) { - throw new BizException("该会议信息不存在"); - } - Integer attendStatus = null; - if (LoginUserUtil.isExpert()) { - List meIds = Collections.singletonList(meetingId); - List status = meetingExpertService.listByExpertIdAndStatus(LoginUserUtil.getUserId(), null, meIds); - if (status.isEmpty()) { - throw BizException.wrap("您未被邀请参加次会议"); - } - attendStatus = meetingManageHelper.getExpertAttendStatus(status.get(0)); - } + Assert.notNull(meeting, "会议不存在"); return MeetingDetailBasicVO.builder() - .id(meeting.getId()) - .name(meeting.getName()) - .type(meeting.getType()) + .meetingId(meeting.getId()) + .meetingName(meeting.getName()) + .meetingType(meeting.getType()) + .meetingAddress(meeting.getMeetingAddress()) .typeName(dictionaryCache.getByCode(meeting.getType()).getName()) - .author(meeting.getCreator()) .startTime(meeting.getStartTime()) - .createOn(meeting.getCreateOn()) + .judgesAttendanceTime(meeting.getJudgesAttendanceTime()) + .meetingUsageTime(meeting.getMeetingUsageTime()) .contact(meeting.getContact()) .connecter(meeting.getConnecter()) .status(meeting.getStatus()) - .attendStatus(attendStatus) - .cancelRemark(meeting.getCancelRemark()) - .createBy(meeting.getCreator()) .holdOrg(meeting.getHoldOrg()) - .invited(meeting.getInvited()) + .createOn(meeting.getCreateOn()) + .creator(meeting.getCreator()) + .createBy(meeting.getCreator()) .build(); } - public void uploadMeetingResult(MeetingResultReq po) { - LambdaUpdateWrapper updater = Wrappers.lambdaUpdate(Meeting.class) - .eq(Meeting::getId, po.getMeetingId()) - .set(Meeting::getStatus, Manager.COMPLETED.getCode()); - meetingService.update(updater); - } - - public MeetingResultVO meetingResultDetail(Long meetingId) { - LambdaQueryWrapper query = Wrappers.lambdaQuery(Meeting.class) - .eq(Meeting::getId, meetingId); - MeetingResultVO result = new MeetingResultVO(); - result.setMeetingId(meetingId); - return result; - } - - public ExpertInviteDetailVO inviteDetail(Long meetingId) { ExpertInviteDetailVO result = new ExpertInviteDetailVO(); Meeting meeting = meetingService.getById(meetingId); @@ -340,7 +344,7 @@ public class MeetingManage { List attendList = new ArrayList<>(); List expertIds = new ArrayList<>(); experts.forEach(w -> { - boolean randomInvite = w.getInviteType().equals(ExpertInviteType.RANDOM.getCode()); + boolean randomInvite = w.getInviteType().equals(ExpertInviteTypeEnum.RANDOM.getCode()); if (randomInvite) { randomList.add(w); } else { @@ -382,7 +386,7 @@ public class MeetingManage { attendList.forEach(w -> { ExpertBasicInfoVO expertBasicInfoVo = expertBasicInfoVoMap.get(w.getExpertId()); ExpertAttendListItemVO item = BeanUtil.copyProperties(expertBasicInfoVo, ExpertAttendListItemVO.class); - item.setInviteType(ExpertInviteType.getByCode(w.getInviteType()).getName()); + item.setInviteType(ExpertInviteTypeEnum.getByCode(w.getInviteType()).getName()); result.addAttendList(item); }); return result; @@ -430,13 +434,10 @@ public class MeetingManage { public InviteRuleDetailVO inviteRuleDetail(Long meetingId) { InviteRuleDetailVO result = new InviteRuleDetailVO(); List inviteRules = inviteRuleService.listByMeetingId(meetingId); - if (!result.setAndGetInvited(inviteRules.size() > 0)) { - return result; - } result.setRandomRules(new ArrayList<>()); - Map> groupByType = CollUtils.group(inviteRules, w -> ExpertInviteType.getByCode(w.getInviteType())); - List randoms = groupByType.get(ExpertInviteType.RANDOM); - if (CollectionUtils.isNotEmpty(randoms)) { + Map> groupByType = CollUtils.group(inviteRules, w -> ExpertInviteTypeEnum.getByCode(w.getInviteType())); + List randoms = groupByType.get(ExpertInviteTypeEnum.RANDOM); + if (CollUtil.isNotEmpty(randoms)) { randoms.forEach(random -> { RandomInviteRuleVO randomRule = JSON.parseObject(random.getInviteRule(), RandomInviteRuleVO.class); if (randomRule.getExpertTags() != null) { @@ -452,35 +453,34 @@ public class MeetingManage { }); } if (StrUtil.isNotEmpty(randomRule.getIntentionRegionCode())) { + // TODO 履职意向地 /*List intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel()); randomRule.setIntentionRegions(intentionRegions);*/ } if (StrUtil.isNotEmpty(randomRule.getExpertRegionCode())) { + // TODO 专家层级 /*List expertRegions = regionCache.listParents(randomRule.getExpertRegionCode(), randomRule.getExpertRegionLevel()); randomRule.setExpertRegions(expertRegions);*/ } result.getRandomRules().add(randomRule); }); - } - List appoints = groupByType.get(ExpertInviteType.APPOINT); - if (result.setAndGetHasAppointRule(CollUtil.isNotEmpty(appoints))) { + AvoidInfoDTO avoidInfo = inviteAvoidRuleService.getAvoidInfoDto(meetingId); + AvoidInfoVO vo = new AvoidInfoVO(); + vo.setAvoidOrgIds(avoidInfo.getAvoidOrgIdList()); + vo.setAvoidUnitIds(avoidInfo.getAvoidUnitIdList()); + if (CollUtil.isNotEmpty(avoidInfo.getExpertIds())) { + vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values())); + } + result.setAvoidInfo(vo); + } else { + List appoints = groupByType.get(ExpertInviteTypeEnum.APPOINT); ExpertInviteRule appoint = appoints.get(0); AppointInviteRuleDTO appointRule = JSON.parseObject(appoint.getInviteRule(), AppointInviteRuleDTO.class); - InviteRuleDetailVO.AppointRuleVo vo = new InviteRuleDetailVO.AppointRuleVo(); + AppointRuleVO vo = new AppointRuleVO(); vo.setInviteDesc(appointRule.getInviteDesc()); vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(appointRule.getExpertIds()).values())); result.setAppointRule(vo); } - AvoidInfoDTO avoidInfo = inviteAvoidRuleService.getAvoidInfoDto(meetingId); - if (result.setAndGetHasAvoidInfo(avoidInfo != null)) { - InviteRuleDetailVO.AvoidInfoVo vo = new InviteRuleDetailVO.AvoidInfoVo(); - vo.setAvoidMates(avoidInfo.getAvoidMates()); - vo.setCompanyIds(avoidInfo.getCompanyIds()); - if (CollectionUtils.isNotEmpty(avoidInfo.getExpertIds())) { - vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values())); - } - result.setAvoidInfo(vo); - } return result; } @@ -506,7 +506,7 @@ public class MeetingManage { // 邀请规则 RandomInviteRuleDTO randomInviteRuleDto = null; for (ExpertInviteRule rule : inviteRules) { - if (rule.getInviteType().equals(ExpertInviteType.RANDOM.getCode()) && + if (rule.getInviteType().equals(ExpertInviteTypeEnum.RANDOM.getCode()) && rule.getId().equals(meetingExpert.getRuleId())) { randomInviteRuleDto = JSON.parseObject(rule.getInviteRule(), RandomInviteRuleDTO.class); ruleId = rule.getId(); @@ -607,7 +607,6 @@ public class MeetingManage { LambdaUpdateWrapper update = Wrappers.lambdaUpdate(Meeting.class) .set(Meeting::getStatus, Manager.CANCELED.getCode()) .set(Meeting::getUpdateBy, LoginUserUtil.getUserId()) - .set(Meeting::getCancelRemark, po.getCancelRemark()) .set(Meeting::getUpdateOn, LocalDateTime.now()) .eq(Meeting::getId, po.getMeetingId()); meetingService.update(update); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingInnerProjectMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingInnerProjectMapper.java new file mode 100644 index 0000000..8a393df --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingInnerProjectMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.meeting.mapper; + +import com.ningdatech.pmapi.meeting.entity.domain.MeetingInnerProject; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 会议评审内部项目表 Mapper 接口 + *

+ * + * @author WendyYang + * @since 2023-02-28 + */ +public interface MeetingInnerProjectMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingInnerProjectMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingInnerProjectMapper.xml new file mode 100644 index 0000000..3d78af0 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingInnerProjectMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingOuterProjectMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingOuterProjectMapper.java new file mode 100644 index 0000000..b0e89f4 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingOuterProjectMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.meeting.mapper; + +import com.ningdatech.pmapi.meeting.entity.domain.MeetingOuterProject; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 会议评审外部项目 Mapper 接口 + *

+ * + * @author WendyYang + * @since 2023-02-28 + */ +public interface MeetingOuterProjectMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingOuterProjectMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingOuterProjectMapper.xml new file mode 100644 index 0000000..52d562d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingOuterProjectMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingExpertService.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingExpertService.java index 00a7237..3519b7d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingExpertService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingExpertService.java @@ -6,7 +6,7 @@ import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; import com.ningdatech.pmapi.meeting.entity.dto.CountConfirmByMeetingIdDTO; import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; -import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteType; +import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; import java.util.Collection; import java.util.List; @@ -100,7 +100,7 @@ public interface IMeetingExpertService extends IService { * @return int * @author WendyYang **/ - int countExpertByStatusAndMeetingId(ExpertAttendStatus status, Long meetingId, ExpertInviteType inviteType); + int countExpertByStatusAndMeetingId(ExpertAttendStatus status, Long meetingId, ExpertInviteTypeEnum inviteType); /** * 查询所有同意参加的专家记录 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingInnerProjectService.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingInnerProjectService.java new file mode 100644 index 0000000..be0a0b1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingInnerProjectService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.meeting.service; + +import com.ningdatech.pmapi.meeting.entity.domain.MeetingInnerProject; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 会议评审内部项目表 服务类 + *

+ * + * @author WendyYang + * @since 2023-02-28 + */ +public interface IMeetingInnerProjectService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingOuterProjectService.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingOuterProjectService.java new file mode 100644 index 0000000..b7f66a9 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingOuterProjectService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.meeting.service; + +import com.ningdatech.pmapi.meeting.entity.domain.MeetingOuterProject; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 会议评审外部项目 服务类 + *

+ * + * @author WendyYang + * @since 2023-02-28 + */ +public interface IMeetingOuterProjectService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/ExpertInviteAvoidRuleServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/ExpertInviteAvoidRuleServiceImpl.java index 1a02396..57f7eb0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/ExpertInviteAvoidRuleServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/ExpertInviteAvoidRuleServiceImpl.java @@ -36,9 +36,10 @@ public class ExpertInviteAvoidRuleServiceImpl extends ServiceImpl randomRuleByMeetingId(Long meetingId) { LambdaQueryWrapper query = wrapperByMeetingId(meetingId) - .eq(ExpertInviteRule::getInviteType, ExpertInviteType.RANDOM.getCode()); + .eq(ExpertInviteRule::getInviteType, ExpertInviteTypeEnum.RANDOM.getCode()); List inviteRules = baseMapper.selectList(query); return inviteRules.stream().collect(Collectors.toMap(ExpertInviteRule::getId, w -> JSONObject.parseObject(w.getInviteRule(), RandomInviteRuleDTO.class))); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingExpertServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingExpertServiceImpl.java index e953c75..915a316 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingExpertServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingExpertServiceImpl.java @@ -10,7 +10,7 @@ import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; import com.ningdatech.pmapi.meeting.entity.dto.CountConfirmByMeetingIdDTO; import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; -import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteType; +import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; import com.ningdatech.pmapi.meeting.mapper.ExpertInviteRuleMapper; import com.ningdatech.pmapi.meeting.mapper.MeetingExpertMapper; import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; @@ -44,7 +44,7 @@ public class MeetingExpertServiceImpl extends ServiceImpl countConfirmedByMeetingIds(List meetingIds) { List inviteRules = inviteRuleMapper.selectList(Wrappers.lambdaQuery(ExpertInviteRule.class) - .eq(ExpertInviteRule::getInviteType, ExpertInviteType.RANDOM.getCode()) + .eq(ExpertInviteRule::getInviteType, ExpertInviteTypeEnum.RANDOM.getCode()) .in(ExpertInviteRule::getMeetingId, meetingIds)); Map countByRandom = CollUtils.groupSumInt(inviteRules, ExpertInviteRule::getMeetingId, ExpertInviteRule::getInviteCount); Page page = pageExpertByStatusAndMeetingIds(new Page<>(0, 500), meetingIds, null); @@ -59,7 +59,7 @@ public class MeetingExpertServiceImpl extends ServiceImpl { ExpertAttendStatus attendStatus = ExpertAttendStatus.getByCode(item.getStatus()); - if (item.getInviteType().equals(ExpertInviteType.APPOINT.getCode())) { + if (item.getInviteType().equals(ExpertInviteTypeEnum.APPOINT.getCode())) { // 被替换和已取消的不计数 if (attendStatus.equals(ExpertAttendStatus.CANCELED) || attendStatus.equals(ExpertAttendStatus.REPLACED)) { @@ -113,7 +113,7 @@ public class MeetingExpertServiceImpl extends ServiceImpl + * 会议评审内部项目表 服务实现类 + *

+ * + * @author WendyYang + * @since 2023-02-28 + */ +@Service +public class MeetingInnerProjectServiceImpl extends ServiceImpl implements IMeetingInnerProjectService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingOuterProjectServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingOuterProjectServiceImpl.java new file mode 100644 index 0000000..f84b62d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingOuterProjectServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.meeting.service.impl; + +import com.ningdatech.pmapi.meeting.entity.domain.MeetingOuterProject; +import com.ningdatech.pmapi.meeting.mapper.MeetingOuterProjectMapper; +import com.ningdatech.pmapi.meeting.service.IMeetingOuterProjectService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 会议评审外部项目 服务实现类 + *

+ * + * @author WendyYang + * @since 2023-02-28 + */ +@Service +public class MeetingOuterProjectServiceImpl extends ServiceImpl implements IMeetingOuterProjectService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java index 7cb75a0..64df938 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java @@ -17,7 +17,7 @@ import com.ningdatech.pmapi.meeting.entity.dto.AvoidInfoDTO; import com.ningdatech.pmapi.meeting.entity.dto.ExpertChooseDTO; import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; -import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteType; +import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; import com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper; import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; import com.ningdatech.pmapi.meeting.manage.ExpertInviteManage; @@ -125,9 +125,9 @@ public class ExpertInviteTask { **/ private boolean inviteCheck(Long meetingId) { List expertInviteRules = inviteRuleService.listByMeetingId(meetingId); - Function groupKey = w -> ExpertInviteType.getByCode(w.getInviteType()); - Map> groupByType = CollUtils.group(expertInviteRules, groupKey); - List randomRules = groupByType.get(ExpertInviteType.RANDOM); + Function groupKey = w -> ExpertInviteTypeEnum.getByCode(w.getInviteType()); + Map> groupByType = CollUtils.group(expertInviteRules, groupKey); + List randomRules = groupByType.get(ExpertInviteTypeEnum.RANDOM); if (CollUtil.isEmpty(randomRules)) { return false; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meta/manage/MetaManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meta/manage/MetaManage.java index 398b7f1..b6cf02a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meta/manage/MetaManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meta/manage/MetaManage.java @@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.pmapi.common.constant.BoolDisplayEnum; +import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.meta.assembler.MetaDictionaryAssembler; import com.ningdatech.pmapi.meta.assembler.MetaTagAssembler; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java b/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java index 9ea3a35..cfb9ed0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java @@ -1,8 +1,12 @@ package com.ningdatech.pmapi.meta.service; +import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + /** *

* 服务类 @@ -13,4 +17,15 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IExpertDictionaryService extends IService { + + /** + * 根据专家ID批量查询专家字典信息 + * + * @param userIds 专家ID + * @param dictType 专家字典类型 + * @return / + * @author WendyYang + **/ + List listByUserId(Collection userIds, DictExpertInfoTypeEnum dictType); + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/impl/ExpertDictionaryServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/impl/ExpertDictionaryServiceImpl.java index 346f4ec..43ccffa 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/impl/ExpertDictionaryServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/impl/ExpertDictionaryServiceImpl.java @@ -1,11 +1,17 @@ package com.ningdatech.pmapi.meta.service.impl; -import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; +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.pmapi.meta.constant.DictExpertInfoTypeEnum; import com.ningdatech.pmapi.meta.mapper.ExpertDictionaryMapper; +import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; +import java.util.Collection; +import java.util.List; + /** *

* 服务实现类 @@ -17,4 +23,13 @@ import org.springframework.stereotype.Service; @Service public class ExpertDictionaryServiceImpl extends ServiceImpl implements IExpertDictionaryService { + @Override + public List listByUserId(Collection userIds, DictExpertInfoTypeEnum dictType) { + // 获取专家职称 + LambdaQueryWrapper query = Wrappers.lambdaQuery(ExpertDictionary.class) + .in(ExpertDictionary::getUserId, userIds) + .eq(ExpertDictionary::getExpertInfoField, dictType.getKey()); + return list(query); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java index 1268dd4..8c70934 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java @@ -4,18 +4,18 @@ package com.ningdatech.pmapi.organization.controller; import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.organization.manage.OrganizationManage; import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO; +import com.ningdatech.pmapi.organization.model.vo.OrganizationTreeVO; import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiModelProperty; +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.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.List; /** *

@@ -42,4 +42,10 @@ public class DingOrganizationController { return organizationManage.organizationList(reqOrganizationListPO); } + @PostMapping("/get-child-list") + @ApiOperation("获取组织架构的树状结构(单位筛选列表)") + public List getChildOrganizationList(@RequestParam(value = "parentCode", required = false) String parentCode) { + return organizationManage.getChildOrganizationList(parentCode); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java index 69e314a..2a2eb19 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java @@ -1,18 +1,24 @@ package com.ningdatech.pmapi.organization.manage; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.common.config.DingOrganizationProperties; +import com.ningdatech.pmapi.common.util.StrUtils; import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO; +import com.ningdatech.pmapi.organization.model.vo.OrganizationTreeVO; import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO; import com.ningdatech.pmapi.organization.service.IDingOrganizationService; import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Component; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; @@ -26,6 +32,8 @@ public class OrganizationManage { private final IDingOrganizationService iDingOrganizationService; + private final DingOrganizationProperties dingOrganizationProperties; + public PageVo organizationList(ReqOrganizationListPO reqOrganizationListPO) { String orgName = reqOrganizationListPO.getOrgName(); @@ -54,4 +62,43 @@ public class OrganizationManage { return pageVo; } + public List getChildOrganizationList(String parentCode) { + List parentCodeList = new ArrayList<>(); + List dingOrganizationList = new ArrayList<>(); + if (StrUtils.isBlank(parentCode)) { + parentCodeList = dingOrganizationProperties.getDeptVisibleScopes(); + dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) + .in(DingOrganization::getOrganizationCode, parentCodeList)); + } else { + parentCodeList = CollectionUtil.toList(parentCode); + dingOrganizationList = iDingOrganizationService + .list(Wrappers.lambdaQuery(DingOrganization.class).in(DingOrganization::getParentCode, parentCodeList)); + } + + if (CollectionUtils.isEmpty(dingOrganizationList)) { + return new ArrayList<>(); + } + + dingOrganizationList.sort(Comparator.comparing(DingOrganization::getDisplayOrder)); + return dingOrganizationList.stream().map(r -> { + OrganizationTreeVO treeVO = new OrganizationTreeVO(); + treeVO.setId(r.getId()); + treeVO.setName(r.getOrganizationName()); +// Boolean enabled = "1".equals(r.get()); +// treeVO.setEnabled(enabled); + treeVO.setOrganizationCode(r.getOrganizationCode()); + treeVO.setParentCode(r.getParentCode()); +// treeVO.setSubCount(r.get()); +// Boolean isLeaf = true; +// Long subCount = r.getSubCount(); +// if (Objects.nonNull(subCount) && subCount > 0) { +// isLeaf = false; +// } +// treeVO.setIsLeaf(isLeaf); +// treeVO.setDeptSort(r.getDeptSort()); +// treeVO.setUnionCode(r.getName() + "##" + r.getOrganizationCode()); + return treeVO; + }).collect(Collectors.toList()); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/vo/OrganizationTreeVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/vo/OrganizationTreeVO.java new file mode 100644 index 0000000..b2249b2 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/vo/OrganizationTreeVO.java @@ -0,0 +1,43 @@ +package com.ningdatech.pmapi.organization.model.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/8/17 下午2:01 + */ +@Data +public class OrganizationTreeVO { + + private Long id; + + @ApiModelProperty("上级部门") + private String parentCode; + + @ApiModelProperty("浙政钉组织编号") + private String organizationCode; + +// @ApiModelProperty("子部门数目") +// private Long subCount; +// +// @ApiModelProperty("排序") +// private Long deptSort; +// +// @ApiModelProperty("状态(禁用,启用)") + private Boolean enabled; + + @ApiModelProperty("名称") + private String name; + +// @ApiModelProperty(value = "子节点") +// private List children; +// +// @ApiModelProperty(value = "是否为叶子节点") +// private Boolean isLeaf; +// +// @ApiModelProperty(value = "联合唯一字段方便页面使用(name##organizationCode)") +// private String unionCode; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java index b7cdf5b..54f3295 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java @@ -2,13 +2,10 @@ package com.ningdatech.pmapi.projectlib.controller; import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; - -import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; -import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedExportReq; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java index 899b12f..7994cf3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java @@ -6,14 +6,18 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +<<<<<<< HEAD import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; +======= +import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; +>>>>>>> 3fc1952d747d914fc53e00cda93621feed6be50f import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; import com.ningdatech.pmapi.projectlib.service.IProjectService; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; @@ -62,7 +66,7 @@ public class AnnualPlanHandle extends AbstractProcessBusinessHandle { // 项目状态为年度计划中之前的状态 if (fieldList.contains(status)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); - processDetailVO.setProcessName(CommonConstant.ANNUAL_PLAN); + processDetailVO.setProcessName(CommonConst.ANNUAL_PLAN); processSchedule.add(processDetailVO); return; } @@ -94,7 +98,7 @@ public class AnnualPlanHandle extends AbstractProcessBusinessHandle { processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); } - processDetailVO.setProcessName(CommonConstant.ANNUAL_PLAN); + processDetailVO.setProcessName(CommonConst.ANNUAL_PLAN); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java index e0fdf39..3e66f78 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java @@ -7,7 +7,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; @@ -41,7 +41,7 @@ public class ArchivedHandle extends AbstractProcessBusinessHandle { // 项目阶段不为已归档 if (!ProjectStatusEnum.ARCHIVED.getCode().equals(status)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); - processDetailVO.setProcessName(CommonConstant.ARCHIVED); + processDetailVO.setProcessName(CommonConst.ARCHIVED); processSchedule.add(processDetailVO); return; } @@ -53,7 +53,7 @@ public class ArchivedHandle extends AbstractProcessBusinessHandle { .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.FINAL_ACCEPTANCE_PASS.name()) .last("limit 1")); processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); - processDetailVO.setProcessName(CommonConstant.ARCHIVED); + processDetailVO.setProcessName(CommonConst.ARCHIVED); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java index d1f64f8..9ac5438 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java @@ -11,7 +11,7 @@ import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; @@ -51,7 +51,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle if (Objects.isNull(projectInst)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); - processDetailVO.setProcessName(CommonConstant.CONSTRUCTION_PLAN_REVIEW); + processDetailVO.setProcessName(CommonConst.CONSTRUCTION_PLAN_REVIEW); processSchedule.add(processDetailVO); return; } @@ -76,7 +76,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle processDetailVO.setFinishTime(finishTime); } processDetailVO.setProcessProgressVo(instanceDetail); - processDetailVO.setProcessName(CommonConstant.CONSTRUCTION_PLAN_REVIEW); + processDetailVO.setProcessName(CommonConst.CONSTRUCTION_PLAN_REVIEW); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java index 5236c0f..4446a28 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java @@ -11,7 +11,7 @@ import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; @@ -50,7 +50,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { .last("limit 1")); if (Objects.isNull(projectInst)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); - processDetailVO.setProcessName(CommonConstant.DEPT_UNITED_REVIEW); + processDetailVO.setProcessName(CommonConst.DEPT_UNITED_REVIEW); processSchedule.add(processDetailVO); return; } @@ -74,7 +74,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { processDetailVO.setFinishTime(finishTime); } processDetailVO.setProcessProgressVo(instanceDetail); - processDetailVO.setProcessName(CommonConstant.DEPT_UNITED_REVIEW); + processDetailVO.setProcessName(CommonConst.DEPT_UNITED_REVIEW); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java index 73f4616..d4c71c8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java @@ -3,7 +3,7 @@ package com.ningdatech.pmapi.projectlib.handle; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import com.ningdatech.basic.util.NdDateUtils; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; @@ -49,7 +49,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { .last("limit 1")); if (Objects.isNull(projectInst)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); - processDetailVO.setProcessName(CommonConstant.PRELIMINARY_PREVIEW); + processDetailVO.setProcessName(CommonConst.PRELIMINARY_PREVIEW); processSchedule.add(processDetailVO); return; } @@ -73,7 +73,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { processDetailVO.setFinishTime(finishTime); } processDetailVO.setProcessProgressVo(instanceDetail); - processDetailVO.setProcessName(CommonConstant.PRELIMINARY_PREVIEW); + processDetailVO.setProcessName(CommonConst.PRELIMINARY_PREVIEW); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java index 5014c0e..e05e5a5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java @@ -10,12 +10,20 @@ import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +<<<<<<< HEAD import com.ningdatech.pmapi.common.constant.CommonConstant; +======= +import com.ningdatech.pmapi.common.constant.CommonConst; +>>>>>>> 3fc1952d747d914fc53e00cda93621feed6be50f import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; +<<<<<<< HEAD import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; +======= +import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; +>>>>>>> 3fc1952d747d914fc53e00cda93621feed6be50f import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; import com.ningdatech.pmapi.projectlib.service.IProjectService; @@ -73,7 +81,7 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { // 项目状态为待立项批复之前的状态 if (fieldList.contains(status)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); - processDetailVO.setProcessName(CommonConstant.PROJECT_APPROVAL); + processDetailVO.setProcessName(CommonConst.PROJECT_APPROVAL); processSchedule.add(processDetailVO); return; } @@ -96,7 +104,7 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { processDetailVO.setFinishTime(approvalDateTime); processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); } - processDetailVO.setProcessName(CommonConstant.PROJECT_APPROVAL); + processDetailVO.setProcessName(CommonConst.PROJECT_APPROVAL); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectDeclareHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectDeclareHandle.java index 7806f2e..d374548 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectDeclareHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectDeclareHandle.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.projectlib.handle; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; @@ -37,7 +37,7 @@ public class ProjectDeclareHandle extends AbstractProcessBusinessHandle { Project project = projectService.getById(projectId); LocalDateTime createOn = project.getCreateOn(); processDetailVO.setFinishTime(createOn); - processDetailVO.setProcessName(CommonConstant.PROJECT_DECLARE); + processDetailVO.setProcessName(CommonConst.PROJECT_DECLARE); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java index dbd5045..144d568 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java @@ -15,7 +15,7 @@ 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.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; @@ -50,7 +50,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle if (Objects.isNull(projectInst)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); - processDetailVO.setProcessName(CommonConstant.PROJECT_FINAL_INSPECTION); + processDetailVO.setProcessName(CommonConst.PROJECT_FINAL_INSPECTION); processSchedule.add(processDetailVO); return; } @@ -76,7 +76,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle processDetailVO.setFinishTime(finishTime); } processDetailVO.setProcessProgressVo(instanceDetail); - processDetailVO.setProcessName(CommonConstant.PRELIMINARY_PREVIEW); + processDetailVO.setProcessName(CommonConst.PRELIMINARY_PREVIEW); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java index 9cb5bb9..943f876 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java @@ -10,11 +10,15 @@ import org.springframework.stereotype.Component; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; +<<<<<<< HEAD import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; +======= +import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; +>>>>>>> 3fc1952d747d914fc53e00cda93621feed6be50f import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; @@ -58,7 +62,7 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH // 项目状态不在建设中及之后的状态 if (!fieldList.contains(status)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); - processDetailVO.setProcessName(CommonConstant.PROJECT_PRELIMINARY_INSPECTION); + processDetailVO.setProcessName(CommonConst.PROJECT_PRELIMINARY_INSPECTION); processSchedule.add(processDetailVO); return; } @@ -74,7 +78,7 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH .last("limit 1")); processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); } - processDetailVO.setProcessName(CommonConstant.TENDER_PURCHASE); + processDetailVO.setProcessName(CommonConst.TENDER_PURCHASE); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java index 7e9a8de..b73af77 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java @@ -9,11 +9,15 @@ import org.springframework.stereotype.Component; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; +<<<<<<< HEAD import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; +======= +import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; +>>>>>>> 3fc1952d747d914fc53e00cda93621feed6be50f import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; @@ -56,7 +60,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { // 未进行立项批复 if (Objects.isNull(project.getApprovalDate())){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); - processDetailVO.setProcessName(CommonConstant.TENDER_PURCHASE); + processDetailVO.setProcessName(CommonConst.TENDER_PURCHASE); processSchedule.add(processDetailVO); return; } @@ -73,7 +77,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { .last("limit 1")); processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); } - processDetailVO.setProcessName(CommonConstant.TENDER_PURCHASE); + processDetailVO.setProcessName(CommonConst.TENDER_PURCHASE); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java index b4326f7..ce3b334 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java @@ -10,7 +10,7 @@ import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectInstService; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; import com.wflow.workflow.bean.process.ProgressNode; @@ -69,7 +69,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { processDetailVO.setFinishTime(finishTime); } processDetailVO.setProcessProgressVo(instanceDetail); - processDetailVO.setProcessName(CommonConstant.UNIT_INNER_AUDIT); + processDetailVO.setProcessName(CommonConst.UNIT_INNER_AUDIT); processSchedule.add(processDetailVO); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index ebbefd0..e2db4ad 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -12,7 +12,7 @@ import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.basic.util.ValidUtil; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; @@ -217,8 +217,8 @@ public class AnnualPlanLibManage { } public void exportList(ProjectListReq param, HttpServletResponse response) { - param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); - param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); + param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); + param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); LambdaQueryWrapper query = ProjectHelper.projectQuery(param); Integer isTemporaryAugment = param.getIsTemporaryAugment(); if (Objects.isNull(isTemporaryAugment)){ diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index e82bac4..61a28ef 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; import com.ningdatech.pmapi.common.util.ExcelDownUtil; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; @@ -23,13 +23,15 @@ import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; import com.ningdatech.pmapi.projectlib.service.IProjectService; -import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletResponse; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; /** *

@@ -80,7 +82,6 @@ public class ProjectLibManage { } /** - * * @param projectId 项目详情 * @return com.ningdatech.pmapi.projectlib.model.entity.vo.ProjectDetailVO * @author ZPF @@ -89,7 +90,7 @@ public class ProjectLibManage { public ProjectDetailVO getProjectDetail(Long projectId) { // 查询项目申报信息 Project projectInfo = projectService.getById(projectId); - if(Objects.isNull(projectInfo)){ + if (Objects.isNull(projectInfo)) { return null; } ProjectDetailVO vo = new ProjectDetailVO(); @@ -101,28 +102,28 @@ public class ProjectLibManage { Optional.ofNullable(applications).ifPresent(apps -> vo.setProjectApplications(CollUtils.convert(apps, ProjectHelper::convertVO) - )); + )); //查询年度投资金额 要是已验收的项目 - if(ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())){ + if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { List annualAmounts = Lists.newArrayList(); annualAmounts.add(AnnualAmountVO.builder() - .projectId(projectInfo.getId()) - .projectYear(projectInfo.getProjectYear()) - .annualAmount(projectInfo.getAnnualPlanAmount()) - .build()); + .projectId(projectInfo.getId()) + .projectYear(projectInfo.getProjectYear()) + .annualAmount(projectInfo.getAnnualPlanAmount()) + .build()); List renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) .eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) .orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> - declarations.forEach(declaration -> { - annualAmounts.add(AnnualAmountVO.builder() - .projectId(projectInfo.getId()) - .projectYear(declaration.getProjectYear()) - .annualAmount(declaration.getAnnualPaymentAmount()) - .build()); - }) - ); + declarations.forEach(declaration -> { + annualAmounts.add(AnnualAmountVO.builder() + .projectId(projectInfo.getId()) + .projectYear(declaration.getProjectYear()) + .annualAmount(declaration.getAnnualPaymentAmount()) + .build()); + }) + ); vo.setAnnualAccumulateAmountList(annualAmounts); } return vo; @@ -134,9 +135,8 @@ public class ProjectLibManage { } public void exportList(ProjectListReq param, HttpServletResponse response) { - - param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); - param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); + param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); + param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); LambdaQueryWrapper query = ProjectHelper.projectQuery(param); List projects = projectService.list(query); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java index ce45daa..ef5521f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java @@ -8,7 +8,7 @@ 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.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.util.ExcelDownUtil; import com.ningdatech.pmapi.common.util.ExcelExportStyle; import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum; @@ -167,8 +167,8 @@ public class ProjectRenewalFundManage { public void exportList(HttpServletResponse response, ProjectRenewalListReq param) { - param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); - param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); + param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); + param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); Page page = param.page(); projectRenewalFundDeclarationService.pageSql(page, param); List records = page.getRecords(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java index 3674466..7c89151 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java @@ -3,18 +3,17 @@ package com.ningdatech.pmapi.sys.controller; import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.ningdatech.basic.auth.AbstractLoginUserUtil; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity; import com.ningdatech.pmapi.common.util.TreeUtil; -import com.ningdatech.pmapi.sys.model.entity.Menu; +import com.ningdatech.pmapi.sys.manage.MenuManage; import com.ningdatech.pmapi.sys.model.dto.MenuQueryDTO; import com.ningdatech.pmapi.sys.model.dto.MenuSaveDTO; import com.ningdatech.pmapi.sys.model.dto.MenuUpdateDTO; +import com.ningdatech.pmapi.sys.model.entity.Menu; import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO; import com.ningdatech.pmapi.sys.model.vo.MenuVO; -import com.ningdatech.pmapi.sys.manage.MenuManage; import com.ningdatech.pmapi.sys.service.IMenuService; import com.ningdatech.pmapi.user.util.LoginUserUtil; import io.swagger.annotations.Api; @@ -93,7 +92,7 @@ public class MenuController { @PostMapping("/modify") @WebLog("编辑菜单") public MenuVO handlerUpdate(@RequestBody MenuUpdateDTO data) { - menuService.update(data, AbstractLoginUserUtil.getUserId()); + menuService.update(data, LoginUserUtil.getUserId()); return BeanUtil.toBean(data, MenuVO.class); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java index 2401192..ca34fd1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java @@ -27,7 +27,7 @@ public class RegionManage { private final static Long ROOT_PARENT_ID = 0L; public List getRegionTree() { - List regions = regionService.queryAll(); + List regions = regionService.all(); Map> regionMap = CollUtils.group(regions, RegionDTO::getParentId); return RegionConverter.toRegionTree(ROOT_PARENT_ID, regionMap, false); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRegionService.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRegionService.java index b5a0295..f70430d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRegionService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRegionService.java @@ -21,7 +21,7 @@ public interface IRegionService extends IService { * * @return 所有区域 */ - List queryAll(); + List all(); /** * 查询大于等与该级别的所有区域 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/MenuServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/MenuServiceImpl.java index e0dc101..d00e4f8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/MenuServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/MenuServiceImpl.java @@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.Lists; import com.ningdatech.basic.exception.BaseUncheckedException; import com.ningdatech.basic.util.ValidatorUtil; -import com.ningdatech.pmapi.common.constant.DefValConstants; +import com.ningdatech.pmapi.common.constant.DefValConst; import com.ningdatech.pmapi.sys.model.entity.Menu; import com.ningdatech.pmapi.sys.model.enumeration.MenuTypeEnum; import com.ningdatech.pmapi.sys.model.dto.MenuSaveDTO; @@ -141,7 +141,7 @@ public class MenuServiceImpl extends ServiceImpl implements IM private void fill(Menu resource) { if (resource.getPid() == null || resource.getPid() <= 0) { - resource.setPid(DefValConstants.PARENT_ID); + resource.setPid(DefValConst.PARENT_ID); } else { Menu parent = getById(resource.getPid()); if (Objects.isNull(parent)) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RegionServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RegionServiceImpl.java index 709ed42..7d43cc3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RegionServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RegionServiceImpl.java @@ -24,9 +24,8 @@ import java.util.List; public class RegionServiceImpl extends ServiceImpl implements IRegionService { @Override - public List queryAll() { - List allRegions = this.lambdaQuery().ne(Region::getId, -1).list(); - return CollUtils.convert(allRegions, RegionConverter::toRegionDTO); + public List all() { + return CollUtils.convert(list(), RegionConverter::toRegionDTO); } @Override diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 8de2098..cee1623 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -1,16 +1,13 @@ package com.ningdatech.pmapi.todocenter.manage; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.date.StopWatch; import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Sets; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.pmapi.common.constant.CommonConstant; -import com.ningdatech.pmapi.common.helper.UserInfoHelper; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; @@ -40,7 +37,6 @@ import com.ningdatech.pmapi.user.entity.UserInfo; import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; import com.ningdatech.pmapi.user.service.IUserInfoService; import com.ningdatech.pmapi.user.util.LoginUserUtil; -import com.ningdatech.zwdd.client.ZwddClient; import com.wflow.contants.HisProInsEndActId; import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO; @@ -53,12 +49,10 @@ import com.wflow.workflow.enums.ProcessStatusEnum; import com.wflow.workflow.service.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.assertj.core.util.Lists; import org.flowable.bpmn.model.*; import org.flowable.engine.*; import org.flowable.engine.history.HistoricProcessInstance; -import org.flowable.engine.repository.ProcessDefinition; import org.flowable.engine.runtime.ActivityInstance; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; @@ -92,7 +86,6 @@ public class TodoCenterManage { private final IDingEmployeeInfoService dingEmployeeInfoService; private final IDingOrganizationService dingOrganizationService; private final ProcessInstanceService processInstanceService; - private final ZwddClient zwddClient; private final INdWorkNoticeStagingService workNoticeStagingService; @@ -157,8 +150,8 @@ public class TodoCenterManage { public void exportTodoList(HttpServletResponse response, ToBeProcessedExportReq param) { // 获取登录用户ID Long userId = LoginUserUtil.getUserId(); - param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); - param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); + param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); + param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); //因为要解耦 不能把项目和工作流一起查 //1.先查出用户工作流 @@ -677,8 +670,8 @@ public class TodoCenterManage { // 获取登录用户ID Long userId = LoginUserUtil.getUserId(); - param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); - param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); + param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); + param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); // 查询用户已处理工作流 List userIdoList = processTaskService.getUserIdoList(param.getProcessDefId(), String.valueOf(userId)); @@ -771,8 +764,8 @@ public class TodoCenterManage { // 获取登录用户ID long userId = LoginUserUtil.getUserId(); - param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); - param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); + param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); + param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); // 查询用户已处理工作流 List userSubmittedList = processInstanceService.getUserSubmittedList(String.valueOf(userId), param.getProcessDefId(), null); List instCodes = userSubmittedList.stream().map(ProcessInstanceVo::getInstanceId).collect(Collectors.toList()); @@ -868,8 +861,8 @@ public class TodoCenterManage { // 获取登录用户ID Long userId = LoginUserUtil.getUserId(); - param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); - param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); + param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); + param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); // 查询抄送登录用户的工作流 List ccMeList = processInstanceService.getCcMeList(param.getProcessDefId(), String.valueOf(userId)); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/WebSecurityConfig.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/WebSecurityConfig.java index 7da9923..99c8077 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/WebSecurityConfig.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/WebSecurityConfig.java @@ -3,7 +3,7 @@ package com.ningdatech.pmapi.user.security.auth; import com.ningdatech.basic.util.NdJsonUtil; import com.ningdatech.basic.util.StrPool; import com.ningdatech.pmapi.common.constant.BizConst; -import com.ningdatech.pmapi.common.constant.CommonConstant; +import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.user.security.auth.handler.DefaultExpiredSessionStrategy; import com.ningdatech.pmapi.user.security.auth.credential.CredentialAuthSecurityConfig; import org.springframework.beans.factory.annotation.Qualifier; @@ -61,7 +61,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .expiredSessionStrategy(defaultExpiredSessionStrategy) .and().and() .logout().logoutUrl(authProperties.getLogoutUrl()).logoutSuccessHandler(logoutSuccessHandler) - .deleteCookies(CommonConstant.COOKIE_KEY) + .deleteCookies(CommonConst.COOKIE_KEY) // .and() // .cors().configurationSource(corsConfigurationSource()) .and() diff --git a/pmapi/src/main/resources/application-dev.yml b/pmapi/src/main/resources/application-dev.yml index fb43bdf..f2e6e8c 100644 --- a/pmapi/src/main/resources/application-dev.yml +++ b/pmapi/src/main/resources/application-dev.yml @@ -170,6 +170,10 @@ sa-token: token-style: uuid # 是否输出操作日志 is-log: false +#浙政钉公司顶级organizationCode +organization: + dept-visible-scopes: + - 430857a6-fa0b-49f6-89f8-5437b0e2d234 yxt: wsdl-url: http://115.239.137.23:9501/ws/v1?wsdl