@@ -56,7 +56,7 @@ public class GeneratorCodeKingbaseConfig { | |||||
} | } | ||||
public static void main(String[] args) { | public static void main(String[] args) { | ||||
generate("Liuxinxin", "expert", PATH_LXX, "expert_meta_apply"); | |||||
generate("Liuxinxin", "expert", PATH_LXX, "expert_avoid_company"); | |||||
} | } | ||||
} | } |
@@ -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 = "归档"; | |||||
} |
@@ -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 = "归档"; | |||||
} |
@@ -8,7 +8,7 @@ import com.ningdatech.basic.util.StrPool; | |||||
* | * | ||||
* @author PoffyZhang | * @author PoffyZhang | ||||
*/ | */ | ||||
public interface DefValConstants { | |||||
public interface DefValConst { | |||||
/** | /** | ||||
* 默认的根节点path | * 默认的根节点path | ||||
@@ -30,28 +30,5 @@ public interface DefValConstants { | |||||
* 字典占位符 | * 字典占位符 | ||||
*/ | */ | ||||
String DICT_PLACEHOLDER = "###"; | 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; | |||||
} | } |
@@ -6,7 +6,7 @@ package com.ningdatech.pmapi.common.constant; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/01 14:49 | * @since 2023/02/01 14:49 | ||||
*/ | */ | ||||
public interface DingConstant { | |||||
public interface DingConst { | |||||
/** | /** | ||||
* 工作通知 | * 工作通知 | ||||
*/ | */ |
@@ -1,7 +1,5 @@ | |||||
package com.ningdatech.pmapi.common.constant; | package com.ningdatech.pmapi.common.constant; | ||||
import io.swagger.models.auth.In; | |||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
/** | /** | ||||
@@ -10,7 +8,7 @@ import java.math.BigDecimal; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/01/19 10:31 | * @since 2023/01/19 10:31 | ||||
*/ | */ | ||||
public interface ProjectDeclareConstants { | |||||
public interface ProjectDeclareConst { | |||||
/** | /** | ||||
* 基本信息 | * 基本信息 |
@@ -0,0 +1,43 @@ | |||||
package com.ningdatech.pmapi.common.constant; | |||||
/** | |||||
* <p> | |||||
* RegionConst | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 13:57 2023/3/1 | |||||
*/ | |||||
public interface RegionConst { | |||||
//---------------------------------------地区层级(缩写RL)------------------------------------------------------------- | |||||
int RL_PROVINCE = 1; | |||||
int RL_CITY = 2; | |||||
int RL_COUNTY = 3; | |||||
//---------------------------------------地区编码(缩写RC)------------------------------------------------------------- | |||||
/** | |||||
* 丽水行政区划编码 | |||||
*/ | |||||
String RC_LS = "331100"; | |||||
/** | |||||
* 中国行政区划编码 | |||||
*/ | |||||
String RC_CHINA = "100000"; | |||||
/** | |||||
* 浙江行政区划编码 | |||||
*/ | |||||
String RC_ZJ = "330000"; | |||||
//----------------------------------------地区父级ID(缩写PID)--------------------------------------------------------- | |||||
long PID_CHINA = 0; | |||||
} |
@@ -5,7 +5,7 @@ package com.ningdatech.pmapi.common.constant; | |||||
* @since 2023/02/07 16:24 | * @since 2023/02/07 16:24 | ||||
*/ | */ | ||||
public class StateMachineConstants { | |||||
public class StateMachineConst { | |||||
public static final String PROJECT_DECLARE = "projectDeclare"; | public static final String PROJECT_DECLARE = "projectDeclare"; | ||||
public static final String LI_SHUI_CITY_AREA_CODE = "331100"; | public static final String LI_SHUI_CITY_AREA_CODE = "331100"; |
@@ -1,4 +1,4 @@ | |||||
package com.ningdatech.pmapi.common.constant; | |||||
package com.ningdatech.pmapi.common.enumeration; | |||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.Getter; | import lombok.Getter; |
@@ -0,0 +1,92 @@ | |||||
package com.ningdatech.pmapi.common.helper; | |||||
import com.ningdatech.pmapi.sys.model.dto.RegionDTO; | |||||
import com.ningdatech.pmapi.sys.model.vo.RegionTreeVO; | |||||
import java.util.Collection; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* RegionCacheHelper - | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 13:50 2023/3/1 | |||||
*/ | |||||
public interface RegionCacheHelper { | |||||
/** | |||||
* 获取完整的区域树状结构 | |||||
* | |||||
* @return / | |||||
*/ | |||||
List<RegionDTO> all(); | |||||
/** | |||||
* 根据区域code 区域层级获取 区域类 | |||||
* | |||||
* @param code 区域编码 | |||||
* @param level 区域层级 | |||||
* @return {@link RegionDTO} | |||||
*/ | |||||
RegionDTO getByCodeAndLevel(String code, int level); | |||||
/** | |||||
* 获取区域名称 | |||||
* | |||||
* @param code 区域编码 | |||||
* @param level 区域层级 | |||||
* @return 名称 | |||||
*/ | |||||
String getRegionName(String code, int level); | |||||
/** | |||||
* 根据传入的地区code与level获取所有上层地区集合 | |||||
* 按照level升序排列 | |||||
* | |||||
* @param code 地区编码 | |||||
* @param level 地区层级 | |||||
* @return / | |||||
*/ | |||||
List<RegionDTO> listParents(String code, int level); | |||||
/** | |||||
* 获取当前区域所有的子区域(包括自己) | |||||
* | |||||
* @param code 区域编码 | |||||
* @param level 级别 | |||||
* @return / | |||||
*/ | |||||
Collection<String> listChildRegionCodeList(String code, int level); | |||||
/** | |||||
* 获取当前节点开始的区域树 | |||||
* | |||||
* @param regionCode 区域编码 | |||||
* @param regionLevel 区域层级 | |||||
* @return 区域树 | |||||
*/ | |||||
RegionTreeVO getRegionTree(String regionCode, Integer regionLevel); | |||||
/** | |||||
* 获取展示名称(浙江省/杭州市/滨江区) | |||||
* | |||||
* @param regionCode 区域编码 | |||||
* @param regionLevel 区域层级 | |||||
* @return java.lang.String | |||||
**/ | |||||
String getFullDisplayName(String regionCode, Integer regionLevel); | |||||
/** | |||||
* 获取展示名称(杭州市/滨江区) | |||||
* | |||||
* @param regionCode 区域编码 | |||||
* @param regionLevel 区域层级 | |||||
* @return java.lang.String | |||||
**/ | |||||
String getDisplayName(String regionCode, Integer regionLevel); | |||||
} |
@@ -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<RegionContainsBO> regionContainsBOList, String regionCode, Integer regionLevel); | |||||
/** | |||||
* 查询操作 包含区域包含列表装配 | |||||
* | |||||
* @param queryRegionContainBo 查询区域范围列表 | |||||
* @param expertAdminContainsRegionList 专家管理员可管理的区域范围列表 | |||||
* @return / | |||||
*/ | |||||
List<RegionContainsBO> queryContainsRegionAssembler(RegionContainsBO queryRegionContainBo, List<RegionContainsBO> expertAdminContainsRegionList); | |||||
/** | |||||
* 根据 区域层级-区域编码 获取区域包含列表 | |||||
* | |||||
* @param regionLevel 区域层级 | |||||
* @param regionCode 区域编码 | |||||
* @return / | |||||
*/ | |||||
RegionContainsBO getContainsRegionBo(Integer regionLevel, String regionCode); | |||||
/** | |||||
* 根据专家管理员用户id 获取专家管理员管辖区域列表 | |||||
* | |||||
* @param expertAdminUserId 专家管理员用户id | |||||
* @return / | |||||
*/ | |||||
List<RegionContainsBO> getExpertAdminContainsRegion(Long expertAdminUserId); | |||||
} |
@@ -22,4 +22,6 @@ public interface UserInfoHelper { | |||||
UserFullInfoDTO getUserFullInfo(Long userId); | UserFullInfoDTO getUserFullInfo(Long userId); | ||||
String getUserName(Long userId); | |||||
} | } |
@@ -0,0 +1,69 @@ | |||||
package com.ningdatech.pmapi.common.helper.basic; | |||||
import cn.hutool.core.lang.Assert; | |||||
import com.github.benmanes.caffeine.cache.Caffeine; | |||||
import com.github.benmanes.caffeine.cache.LoadingCache; | |||||
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.entity.Region; | |||||
import com.ningdatech.pmapi.sys.service.IRegionService; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.assertj.core.util.Lists; | |||||
import org.springframework.beans.factory.InitializingBean; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import java.util.List; | |||||
import java.util.concurrent.TimeUnit; | |||||
/** | |||||
* <p> | |||||
* AbstractRegionCache | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 14:41 2023/3/1 | |||||
*/ | |||||
@Slf4j | |||||
public abstract class AbstractRegionCacheHelper implements InitializingBean { | |||||
@Autowired | |||||
private IRegionService regionService; | |||||
private LoadingCache<RegionMapKey, RegionDTO> regionsCache; | |||||
private void initRegionCache() { | |||||
List<RegionDTO> allRegions = regionService.all(); | |||||
if (allRegions.isEmpty()) { | |||||
log.warn("区域元数据未初始化"); | |||||
return; | |||||
} | |||||
allRegions.forEach(w -> { | |||||
RegionMapKey key = RegionMapKey.of(w.getRegionCode(), w.getRegionLevel()); | |||||
regionsCache.put(key, w); | |||||
}); | |||||
} | |||||
protected RegionDTO get(RegionMapKey key) { | |||||
return regionsCache.get(key); | |||||
} | |||||
protected List<RegionDTO> all() { | |||||
return Lists.newArrayList(regionsCache.asMap().values()); | |||||
} | |||||
@Override | |||||
public void afterPropertiesSet() { | |||||
regionsCache = Caffeine.newBuilder() | |||||
.refreshAfterWrite(7, TimeUnit.DAYS) | |||||
.maximumSize(512) | |||||
.build(key -> { | |||||
Region region = regionService.getOne(key.getRegionCode(), key.getRegionLevel()); | |||||
Assert.notNull(region, "区域不存在:%s", key); | |||||
return RegionConverter.toRegionDTO(region); | |||||
}); | |||||
// 初始化所有区域数据到缓存 | |||||
initRegionCache(); | |||||
} | |||||
} |
@@ -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; | |||||
/** | |||||
* <p> | |||||
* AbstractRegionLimitHelper | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 14:35 2023/3/1 | |||||
*/ | |||||
@AllArgsConstructor | |||||
public abstract class AbstractRegionLimitHelper implements RegionLimitHelper { | |||||
protected final RegionCacheHelper regionCache; | |||||
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; | |||||
} | |||||
} |
@@ -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.Collection; | |||||
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 regionCache, IExpertUserFullInfoService expertUserFullInfoService) { | |||||
super(regionCache, expertUserFullInfoService); | |||||
} | |||||
public static Boolean contains(Integer adminRegionLevel, List<String> 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<RegionContainsBO> expertAdminContainsRegion = getExpertAdminContainsRegion(expertAdminUserId); | |||||
ExpertRegionInfo expertRegionInfo = getExpertRegionInfo(expertUserId); | |||||
return regionContains(expertAdminContainsRegion, expertRegionInfo.getRegionCode(), expertRegionInfo.getRegionLevel()); | |||||
} | |||||
@Override | |||||
public Boolean regionContains(List<RegionContainsBO> regionContainsBOList, String regionCode, Integer regionLevel) { | |||||
for (RegionContainsBO regionContainsBO : regionContainsBOList) { | |||||
Integer parentRegionTreeLevel = regionContainsBO.getParentRegionTreeLevel(); | |||||
List<String> containsRegionCodeList = regionContainsBO.getContainsRegionCodeList(); | |||||
for (String containsRegionCode : containsRegionCodeList) { | |||||
if (containsRegionCode.equals(regionCode) && parentRegionTreeLevel <= regionLevel) { | |||||
return true; | |||||
} | |||||
} | |||||
} | |||||
return false; | |||||
} | |||||
@Override | |||||
public List<RegionContainsBO> queryContainsRegionAssembler(RegionContainsBO queryRegionContainBo, List<RegionContainsBO> expertAdminContainsRegionList) { | |||||
List<RegionContainsBO> resultBoList = new ArrayList<>(); | |||||
if (Objects.nonNull(queryRegionContainBo)) { | |||||
resultBoList.add(queryRegionContainBo); | |||||
Integer parentRegionTreeLevel = queryRegionContainBo.getParentRegionTreeLevel(); | |||||
List<String> containsRegionCodeList = queryRegionContainBo.getContainsRegionCodeList(); | |||||
// 查询取并级 | |||||
if (CollectionUtils.isNotEmpty(expertAdminContainsRegionList)) { | |||||
for (RegionContainsBO regionContainsBO : expertAdminContainsRegionList) { | |||||
regionContainsBO.setParentRegionTreeLevel(parentRegionTreeLevel); | |||||
List<String> 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) { | |||||
Collection<String> regionCodes = regionCache.listChildRegionCodeList(regionCode, regionLevel); | |||||
RegionContainsBO regionContains = new RegionContainsBO(); | |||||
regionContains.setContainsRegionCodeList(new ArrayList<>(regionCodes)); | |||||
regionContains.setParentRegionTreeLevel(regionLevel); | |||||
return regionContains; | |||||
} | |||||
@Override | |||||
public List<RegionContainsBO> getExpertAdminContainsRegion(Long expertAdminUserId) { | |||||
if (Objects.isNull(expertAdminUserId)) { | |||||
logger.error("getExpertAdminContainsRegion expertAdminUserId is null"); | |||||
return new ArrayList<>(); | |||||
} | |||||
// TODO | |||||
/*LambdaQueryWrapper<ExpertAdminRegion> expertAdminRegionEq = Wrappers.lambdaQuery(ExpertAdminRegion.class) | |||||
.eq(ExpertAdminRegion::getUserId, expertAdminUserId); | |||||
List<ExpertAdminRegion> expertAdminRegionList = iExpertAdminRegionService.list(expertAdminRegionEq); | |||||
List<RegionContainsBO> regionContainsBOList = new ArrayList<>(); | |||||
for (ExpertAdminRegion expertAdminRegion : expertAdminRegionList) { | |||||
List<String> regionCodes = regionCacheHelper | |||||
.getAllChildrenRegionCodeList(expertAdminRegion.getRegionCode(), expertAdminRegion.getRegionLevel()); | |||||
RegionContainsBO regionContainsBO = new RegionContainsBO(); | |||||
regionContainsBO.setContainsRegionCodeList(regionCodes); | |||||
regionContainsBO.setParentRegionTreeLevel(expertAdminRegion.getRegionLevel()); | |||||
regionContainsBOList.add(regionContainsBO); | |||||
}*/ | |||||
return null; | |||||
} | |||||
} |
@@ -0,0 +1,173 @@ | |||||
package com.ningdatech.pmapi.common.helper.impl; | |||||
import cn.hutool.core.text.StrPool; | |||||
import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.util.CollUtils; | |||||
import com.ningdatech.pmapi.common.constant.RegionConst; | |||||
import com.ningdatech.pmapi.common.helper.RegionCacheHelper; | |||||
import com.ningdatech.pmapi.common.helper.basic.AbstractRegionCacheHelper; | |||||
import com.ningdatech.pmapi.common.model.RegionMapKey; | |||||
import com.ningdatech.pmapi.common.util.StrUtils; | |||||
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.model.vo.RegionTreeVO; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.apache.commons.collections4.CollectionUtils; | |||||
import org.springframework.stereotype.Component; | |||||
import java.util.*; | |||||
import java.util.stream.Collectors; | |||||
/** | |||||
* @author liuxinxin | |||||
* @date 2022/7/22 上午8:58 | |||||
* 构建地区码 地区树 | |||||
*/ | |||||
@Slf4j | |||||
@Component | |||||
public class RegionsCacheHelperImpl extends AbstractRegionCacheHelper implements RegionCacheHelper { | |||||
@Override | |||||
public RegionDTO getByCodeAndLevel(String code, int level) { | |||||
return super.get(RegionMapKey.of(code, level)); | |||||
} | |||||
@Override | |||||
public String getRegionName(String code, int level) { | |||||
return getByCodeAndLevel(code, level).getRegionName(); | |||||
} | |||||
@Override | |||||
public List<RegionDTO> all() { | |||||
return super.all(); | |||||
} | |||||
@Override | |||||
public Collection<String> listChildRegionCodeList(String regionCode, int regionLevel) { | |||||
RegionDTO currRegion = getByCodeAndLevel(regionCode, regionLevel); | |||||
if (currRegion.getParentCode().equals(regionCode)) { | |||||
return Collections.singletonList(regionCode); | |||||
} | |||||
List<RegionDTO> allRegions = all(); | |||||
return allRegions.stream().filter(w -> StrUtils.split(w.getRegionCodePath()).contains(regionCode)) | |||||
.map(RegionDTO::getRegionCode).collect(Collectors.toSet()); | |||||
} | |||||
@Override | |||||
public RegionTreeVO getRegionTree(String regionCode, Integer regionLevel) { | |||||
Map<Long, List<RegionDTO>> regions; | |||||
Long parentId; | |||||
if (regionCode == null || regionCode.equals(RegionConst.RC_CHINA)) { | |||||
regions = CollUtils.group(all(), RegionDTO::getParentId); | |||||
parentId = RegionConst.PID_CHINA; | |||||
} else { | |||||
RegionDTO currRegion = getByCodeAndLevel(regionCode, regionLevel); | |||||
if (currRegion.getParentCode().equals(regionCode)) { | |||||
return RegionConverter.toRegionTreeVO(currRegion); | |||||
} | |||||
regions = all().stream() | |||||
.filter(w -> StrUtils.split(w.getRegionCodePath()).contains(regionCode)) | |||||
.collect(Collectors.groupingBy(RegionDTO::getParentId)); | |||||
parentId = currRegion.getParentId(); | |||||
} | |||||
regions.values().forEach(w -> w.sort(Comparator.comparing(x -> Long.parseLong(x.getRegionCode())))); | |||||
return RegionConverter.toRegionTree(parentId, regions, false).get(0); | |||||
} | |||||
@Override | |||||
public String getFullDisplayName(String regionCode, Integer regionLevel) { | |||||
RegionDTO regionCurr = getByCodeAndLevel(regionCode, regionLevel); | |||||
return getDisplayName(regionCurr, RegionConst.RL_PROVINCE); | |||||
} | |||||
@Override | |||||
public String getDisplayName(String regionCode, Integer regionLevel) { | |||||
RegionDTO regionCurr = getByCodeAndLevel(regionCode, regionLevel); | |||||
return getDisplayName(regionCurr, RegionConst.RL_CITY); | |||||
} | |||||
//------------------------------------------------------------------------------------------------------------------ | |||||
/** | |||||
* 获取指定层级的展示名称 | |||||
* | |||||
* @param region 当前区域 | |||||
* @param sLevel 开始层级 | |||||
* @return 展示名称 | |||||
*/ | |||||
private String getDisplayName(RegionDTO region, int sLevel) { | |||||
Integer level = region.getRegionLevel(); | |||||
if (RegionConst.RL_PROVINCE > sLevel || sLevel > level) { | |||||
throw BizException.wrap("区域层级无效"); | |||||
} | |||||
if (sLevel == level) { | |||||
return region.getRegionName(); | |||||
} | |||||
StringBuilder builder = new StringBuilder(); | |||||
List<String> regionCodes = StrUtils.split(region.getRegionCodePath()); | |||||
for (int i = regionCodes.size() - 2; i > 0; i--) { | |||||
if (level <= sLevel) { | |||||
break; | |||||
} | |||||
RegionDTO tmp = getByCodeAndLevel(regionCodes.get(i), --level); | |||||
builder.insert(0, StrPool.SLASH); | |||||
builder.insert(0, tmp.getRegionName()); | |||||
} | |||||
builder.append(region.getRegionName()); | |||||
return builder.toString(); | |||||
} | |||||
protected List<RegionTreeDTO> getCopyListByLevel(int level) { | |||||
List<RegionDTO> regions = all().stream() | |||||
.filter(w -> w.getRegionLevel() <= level) | |||||
.collect(Collectors.toList()); | |||||
return RegionConverter.toRegionTreeDTOList(regions); | |||||
} | |||||
/** | |||||
* 获取某一个地区开始的层级树 | |||||
* | |||||
* @param list 地区集合 | |||||
* @param code 地区编码 | |||||
* @param level 地区层级 | |||||
* @return / | |||||
*/ | |||||
private RegionTreeDTO getTreeByRegionAndCode(List<RegionTreeDTO> list, String code, int level) { | |||||
if (CollectionUtils.isEmpty(list)) { | |||||
list = getCopyListByLevel(3); | |||||
if (CollectionUtils.isEmpty(list)) { | |||||
return null; | |||||
} | |||||
} | |||||
Optional<RegionTreeDTO> 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<RegionDTO> listParents(String code, int level) { | |||||
List<RegionDTO> result = new ArrayList<>(); | |||||
RegionDTO dto = getByCodeAndLevel(code, level); | |||||
result.add(0, dto); | |||||
if (RegionConst.RC_CHINA.equals(dto.getParentCode())) { | |||||
return result; | |||||
} | |||||
result.addAll(0, listParents(dto.getParentCode(), dto.getRegionLevel() - 1)); | |||||
return result; | |||||
} | |||||
} |
@@ -30,4 +30,11 @@ public class UserInfoHelperImpl implements UserInfoHelper { | |||||
UserFullInfoDTO userFullInfo = userAuthLoginManage.getUserFullInfo(userId); | UserFullInfoDTO userFullInfo = userAuthLoginManage.getUserFullInfo(userId); | ||||
return userFullInfo; | return userFullInfo; | ||||
} | } | ||||
@Override | |||||
public String getUserName(Long userId) { | |||||
UserFullInfoDTO userFullInfo = userAuthLoginManage.getUserFullInfo(userId); | |||||
String realName = userFullInfo.getRealName(); | |||||
return realName; | |||||
} | |||||
} | } |
@@ -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(); | |||||
} | |||||
} |
@@ -0,0 +1,53 @@ | |||||
package com.ningdatech.pmapi.common.model; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Builder; | |||||
import lombok.Data; | |||||
import lombok.experimental.Tolerate; | |||||
import java.util.Objects; | |||||
/** | |||||
* <p> | |||||
* RegionMapKey | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 13:54 2023/3/1 | |||||
*/ | |||||
@Data | |||||
@AllArgsConstructor | |||||
public class RegionMapKey { | |||||
public static RegionMapKey of(String regionCode, int regionLevel) { | |||||
return new RegionMapKey(regionCode, regionLevel); | |||||
} | |||||
/** | |||||
* 区域码 | |||||
*/ | |||||
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); | |||||
} | |||||
} |
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.common.statemachine.action; | 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.builder.ProjectDeclareStateMachineBuilder; | ||||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | ||||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | ||||
@@ -23,7 +23,7 @@ import org.springframework.statemachine.annotation.WithStateMachine; | |||||
@WithStateMachine(id = ProjectDeclareStateMachineBuilder.MACHINEID_TO) | @WithStateMachine(id = ProjectDeclareStateMachineBuilder.MACHINEID_TO) | ||||
public class ProjectDeclareAction { | 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") | @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION") | ||||
public void UNDER_INTERNAL_PASS(Message<ProjectStatusChangeEvent> message) { | public void UNDER_INTERNAL_PASS(Message<ProjectStatusChangeEvent> message) { | ||||
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.common.statemachine.action; | 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.util.StateMachineUtils; | ||||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
@@ -18,7 +18,7 @@ import org.springframework.statemachine.action.Action; | |||||
@Slf4j | @Slf4j | ||||
public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, ProjectStatusChangeEvent> { | public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, ProjectStatusChangeEvent> { | ||||
private static final String PROJECT_DECLARE = StateMachineConstants.PROJECT_DECLARE; | |||||
private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | |||||
@Override | @Override | ||||
public void execute(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | public void execute(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | ||||
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.common.statemachine.factory; | 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.util.StateMachineUtils; | ||||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
@@ -16,7 +16,7 @@ import org.springframework.statemachine.guard.Guard; | |||||
*/ | */ | ||||
public class ProjectDeclareGuardFactory { | 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<ProjectStatusEnum, ProjectStatusChangeEvent> { | public class PendingPreQualificationChoiceGuard implements Guard<ProjectStatusEnum, ProjectStatusChangeEvent> { | ||||
@Override | @Override | ||||
@@ -1,12 +1,12 @@ | |||||
package com.ningdatech.pmapi.common.statemachine.util; | package com.ningdatech.pmapi.common.statemachine.util; | ||||
import com.ningdatech.basic.exception.BizException; | 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.builder.ProjectDeclareStateMachineBuilder; | ||||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -32,7 +32,7 @@ import java.util.Objects; | |||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
public class StateMachineUtils { | 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; | private final ProjectDeclareStateMachineBuilder projectDeclareStateMachineBuilder; | ||||
@@ -44,7 +44,7 @@ public class StateMachineUtils { | |||||
public void execute(Project project, ProjectStatusChangeEvent event) throws Exception { | public void execute(Project project, ProjectStatusChangeEvent event) throws Exception { | ||||
log.info("调用状态机前的项目状态为>>>>>>>>>>{}" + project.getStatus()); | log.info("调用状态机前的项目状态为>>>>>>>>>>{}" + project.getStatus()); | ||||
// 将状态变更记录保存到项目状态变更表中 | // 将状态变更记录保存到项目状态变更表中 | ||||
NdProjectStatusChange projectStatusChange = new NdProjectStatusChange(); | |||||
ProjectStatusChange projectStatusChange = new ProjectStatusChange(); | |||||
projectStatusChange.setBeforeStatus(project.getStatus()); | projectStatusChange.setBeforeStatus(project.getStatus()); | ||||
//获取TO状态机 | //获取TO状态机 | ||||
StateMachine<ProjectStatusEnum, ProjectStatusChangeEvent> stateMachine = projectDeclareStateMachineBuilder.build(); | StateMachine<ProjectStatusEnum, ProjectStatusChangeEvent> stateMachine = projectDeclareStateMachineBuilder.build(); | ||||
@@ -70,7 +70,7 @@ public class StateMachineUtils { | |||||
* @since 2023/02/07 17:13 | * @since 2023/02/07 17:13 | ||||
*/ | */ | ||||
public static boolean judgeDeclareAmount(Project project) { | 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) { | if (flag > 0 || flag == 0) { | ||||
return true; | return true; | ||||
} | } | ||||
@@ -87,7 +87,7 @@ public class StateMachineUtils { | |||||
*/ | */ | ||||
public static boolean isCityProject(Project project) { | public static boolean isCityProject(Project project) { | ||||
String areaCode = project.getAreaCode(); | 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 true; | ||||
} | } | ||||
return false; | return false; | ||||
@@ -4,8 +4,11 @@ import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.model.GenericResult; | import com.ningdatech.basic.model.GenericResult; | ||||
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; | import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; | ||||
import com.ningdatech.zwdd.client.ZwddClient; | import com.ningdatech.zwdd.client.ZwddClient; | ||||
import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.stereotype.Component; | |||||
import java.util.List; | |||||
import java.util.concurrent.*; | import java.util.concurrent.*; | ||||
/** | /** | ||||
@@ -15,18 +18,22 @@ import java.util.concurrent.*; | |||||
* @since 2023/02/23 13:50 | * @since 2023/02/23 13:50 | ||||
*/ | */ | ||||
@Slf4j | @Slf4j | ||||
@RequiredArgsConstructor | |||||
@Component | |||||
public class SendWorkNoticeUtil { | public class SendWorkNoticeUtil { | ||||
private SendWorkNoticeUtil(){ | |||||
private final ZwddClient zwddClient; | |||||
} | |||||
/** | |||||
* 初始化线程池 | |||||
*/ | |||||
public static ThreadPoolExecutor threadPool = new ThreadPoolExecutor(2, 10, | |||||
60, TimeUnit.SECONDS, new ArrayBlockingQueue(10), new ThreadPoolExecutor.AbortPolicy()); | |||||
public static void sendWorkNotice(ZwddClient zwddClient, WorkNoticeInfo workNoticeInfo, String msg){ | |||||
// 初始化线程池 | |||||
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(10, 20, | |||||
60, TimeUnit.SECONDS, new ArrayBlockingQueue(20), new ThreadPoolExecutor.AbortPolicy()); | |||||
public Boolean sendWorkNotice(WorkNoticeInfo workNoticeInfo){ | |||||
// 将发送工作通知交给异步任务Future | // 将发送工作通知交给异步任务Future | ||||
String msg = workNoticeInfo.getMsg(); | |||||
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> { | CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> { | ||||
// 调用浙政钉的接口发送工作通知 | // 调用浙政钉的接口发送工作通知 | ||||
long startTime = System.currentTimeMillis(); | long startTime = System.currentTimeMillis(); | ||||
@@ -41,17 +48,19 @@ public class SendWorkNoticeUtil { | |||||
return "发送工作通知失败!"; | return "发送工作通知失败!"; | ||||
} | } | ||||
return "发送工作通知成功!"; | return "发送工作通知成功!"; | ||||
}, threadPool); | |||||
String s; | |||||
try { | |||||
s = future.get(); | |||||
} catch (Exception e) { | |||||
throw new BizException("获取异步线程处理结果失败!"); | |||||
} | |||||
threadPool.shutdown(); | |||||
while (threadPool.isTerminated()) { | |||||
}, threadPool); | |||||
String s; | |||||
try { | |||||
s = future.get(); | |||||
} catch (Exception e) { | |||||
throw new BizException("获取异步线程处理结果失败!"); | |||||
} | |||||
threadPool.shutdown(); | |||||
while (!threadPool.isTerminated()) { | |||||
log.info(s); | |||||
return Boolean.FALSE; | |||||
} | |||||
log.info(s); | log.info(s); | ||||
break; | |||||
} | |||||
return Boolean.TRUE; | |||||
} | } | ||||
} | } |
@@ -20,7 +20,7 @@ package com.ningdatech.pmapi.expert.assembler; | |||||
import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
import com.ningdatech.file.entity.vo.result.AttachFileVo; | import com.ningdatech.file.entity.vo.result.AttachFileVo; | ||||
import com.ningdatech.pmapi.common.constant.BoolDisplayEnum; | |||||
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; | |||||
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; | import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; | ||||
import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; | import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; | ||||
import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion; | import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion; | ||||
@@ -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<ExpertUserFullInfo> wrapperQuery, List<RegionContainsBO> containsRegionList) { | |||||
for (RegionContainsBO regionContainsBO : containsRegionList) { | |||||
List<String> 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<ExpertMetaApply> wrapperQuery, List<RegionContainsBO> containsRegionList) { | |||||
for (RegionContainsBO regionContainsBO : containsRegionList) { | |||||
List<String> containsRegionCodeList = regionContainsBO.getContainsRegionCodeList(); | |||||
Integer parentRegionTreeLevel = regionContainsBO.getParentRegionTreeLevel(); | |||||
if (CollectionUtils.isNotEmpty(containsRegionCodeList)) { | |||||
wrapperQuery.and(wrapper -> wrapper.in(ExpertMetaApply::getRegionCode, containsRegionCodeList) | |||||
.ge(ExpertMetaApply::getRegionLevel, parentRegionTreeLevel)); | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -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)); | |||||
} | |||||
} |
@@ -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)); | |||||
} | |||||
} |
@@ -1,9 +1,13 @@ | |||||
package com.ningdatech.pmapi.expert.controller; | 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.manage.ExpertManage; | ||||
import com.ningdatech.pmapi.expert.model.ExpertAdminExpertManageQuery; | |||||
import com.ningdatech.pmapi.expert.model.req.ExpertRecommendProofSubmitRequest; | import com.ningdatech.pmapi.expert.model.req.ExpertRecommendProofSubmitRequest; | ||||
import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest; | 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 com.ningdatech.pmapi.expert.model.vo.ExpertFullInfoVO; | ||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
@@ -27,6 +31,7 @@ import javax.validation.Valid; | |||||
public class ExpertController { | public class ExpertController { | ||||
private final ExpertManage expertManage; | private final ExpertManage expertManage; | ||||
private final ExpertAdminManage expertAdminManage; | |||||
@PostMapping("/basic-info-submit") | @PostMapping("/basic-info-submit") | ||||
@ApiOperation("填写基本信息接口(专家报名使用))") | @ApiOperation("填写基本信息接口(专家报名使用))") | ||||
@@ -47,5 +52,11 @@ public class ExpertController { | |||||
return expertManage.getExpertFullInfoDetail(null); | return expertManage.getExpertFullInfoDetail(null); | ||||
} | } | ||||
@PostMapping("/expert-library/list") | |||||
@ApiOperation("专家库列表查询接口") | |||||
public PageVo<ExpertAdminExpertManageListVO> getExpertLibraryList( | |||||
@RequestBody @Valid ExpertAdminExpertManageQuery expertAdminExpertManageQuery) { | |||||
return expertAdminManage.getExpertLibraryList(expertAdminExpertManageQuery); | |||||
} | |||||
} | } |
@@ -1,10 +1,19 @@ | |||||
package com.ningdatech.pmapi.expert.controller; | 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.Api; | ||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.*; | |||||
import javax.validation.Valid; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -15,10 +24,38 @@ import org.springframework.web.bind.annotation.RestController; | |||||
* @since 2023-03-01 | * @since 2023-03-01 | ||||
*/ | */ | ||||
@RestController | @RestController | ||||
@Api(tags = "专家相关审核") | |||||
@RequestMapping("/api/v1/expert-meta-apply") | |||||
@RequestMapping("/api/v1/apply/meta/") | |||||
@Validated | |||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
@Api(value = "ExpertMetaApplyController", tags = "专家申请管理相关接口") | |||||
public class ExpertMetaApplyController { | public class ExpertMetaApplyController { | ||||
private final ExpertMetaApplyManage expertMetaApplyManage; | |||||
@PostMapping("/list") | |||||
@ApiOperation(value = "审核列表筛选") | |||||
public PageVo<ExpertApplyMetaVO> 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); | |||||
} | |||||
} | } |
@@ -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<ExpertAdminExpertManageListVO> getExpertLibraryList(ExpertAdminExpertManageQuery query) { | |||||
Long userId = LoginUserUtil.getUserId(); | |||||
ExpertAdminExpertManageQueryCmd expertAdminExpertManageQueryCmd = buildExpertAdminExpertManageQueryCmd(query, userId); | |||||
// CommonPage<ExpertAdminExpertManageListDTO> pageResult = | |||||
// expertAdminManageService.getExpertLibraryList(expertAdminExpertManageQueryCmd); | |||||
// | |||||
// PageVo<ExpertAdminExpertManageListVO> 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<ExpertDictionaryQuery> 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<ExpertTagQuery> 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<RegionContainsBO> expertAdminContainsRegionList = new ArrayList<>(); | |||||
// 如果为超级管理员,可以查看所有的专家,包括没有层级的专家 | |||||
if (!permissionCheckHelper.isSuperAdmin()) { | |||||
expertAdminContainsRegionList = regionLimitHelper.getExpertAdminContainsRegion(userId); | |||||
} | |||||
List<RegionContainsBO> 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; | |||||
} | |||||
} |
@@ -0,0 +1,533 @@ | |||||
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.RegionCacheHelper; | |||||
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.helper.ExpertUserInfoHelper; | |||||
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.sys.model.dto.RegionDTO; | |||||
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 RegionCacheHelper regionCacheHelper; | |||||
private final IExpertUserFullInfoService userFullInfoService; | |||||
private final DictionaryCache dictionaryCache; | |||||
private final ExpertInfoService expertInfoService; | |||||
private final UserInfoHelper userInfoHelper; | |||||
private final RegionLimitHelper regionLimitHelper; | |||||
private final ExpertUserInfoHelper expertUserInfoHelper; | |||||
public PageVo<ExpertApplyMetaVO> metaApplyListQuery(MetaApplyListQuery req) { | |||||
Long expertAdminUserId = LoginUserUtil.getUserId(); | |||||
// 查找符合专家条件的用户id | |||||
List<RegionContainsBO> viewRegions = regionLimitHelper.getExpertAdminContainsRegion(expertAdminUserId); | |||||
ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(req, viewRegions); | |||||
// TODO | |||||
// List<Long> filterExpertUserIdList = expertAdminManageService.filterExpertUserIdList(queryCmd); | |||||
List<Long> filterExpertUserIdList = new ArrayList<>(); | |||||
if (CollUtil.isEmpty(filterExpertUserIdList)) { | |||||
return PageVo.empty(); | |||||
} | |||||
LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyListQuery = | |||||
buildMetaApplyListQueryWrapper(req, filterExpertUserIdList, viewRegions); | |||||
RegionWrapperAssembler.expertMetaApplyRegionContainsWrapperAssembler(expertMetaApplyListQuery, viewRegions); | |||||
Page<ExpertMetaApply> pageResult = iMetaApplyService.page(req.page(), expertMetaApplyListQuery); | |||||
PageVo<ExpertApplyMetaVO> result = new PageVo<>(); | |||||
result.setTotal(pageResult.getTotal()); | |||||
BizUtils.notEmpty(pageResult.getRecords(), records -> { | |||||
List<Long> expertIds = CollUtils.fieldList(records, ExpertMetaApply::getUserId); | |||||
// 根据用户id 获取专家基本信息 | |||||
List<ExpertUserFullInfo> expertList = userFullInfoService.listByUserIds(expertIds); | |||||
Map<Long, ExpertUserFullInfo> expertMap = CollUtils.listToMap(expertList, ExpertUserFullInfo::getUserId); | |||||
List<ExpertDictionary> expertDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.TITLE_LEVEL); | |||||
Map<Long, List<ExpertDictionary>> 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<ExpertMetaApply> 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<Long> fileIdList = CollUtils.fieldList(list, FileBasicInfo::getFileId); | |||||
// List<AttachFileVo> attachFiles = fileService.getByIds(fileIdList); | |||||
// List<FileBasicInfo> 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<ExpertSensitiveInfoModifyDetailRecord> eq = Wrappers.lambdaQuery(ExpertSensitiveInfoModifyDetailRecord.class) | |||||
// .eq(ExpertSensitiveInfoModifyDetailRecord::getMetaApplyId, metaApplyId); | |||||
// ExpertSensitiveInfoModifyDetailRecord one = iExpertSensitiveInfoModifyDetailRecordService.getOne(eq); | |||||
// String originalJson = null; | |||||
// if (StringUtils.isNotBlank(one.getOriginalJson())) { | |||||
// originalJson = GzipUtils.uncompress(one.getOriginalJson()); | |||||
// } | |||||
// List<SensitiveModifySegment> sensitiveModifySegments = JSONUtils.parseArray(originalJson, SensitiveModifySegment.class); | |||||
// | |||||
// infoModifyApplyDisplayVo.setExpertApplyId(metaApplyId); | |||||
// List<InfoModifyApplyDisplayVO.InfoModifyApplyDisplayValue> displayValueList = new ArrayList<>(); | |||||
// for (SensitiveModifySegment segment : sensitiveModifySegments) { | |||||
// InfoModifyApplyDisplayVO.InfoModifyApplyDisplayValue displayValue = sensitiveModifySegmentParser.getDisplayValue(segment); | |||||
// displayValueList.add(displayValue); | |||||
// } | |||||
// infoModifyApplyDisplayVo.setInfoModifyApplyDisplayValueList(displayValueList); | |||||
// metaApplyResultVo.setInfoModifyApplyDisplayVo(infoModifyApplyDisplayVo); | |||||
// } | |||||
// } | |||||
private String applyTypeTrans(ExpertApplyTypeEnum applyTypeEnum) { | |||||
switch (applyTypeEnum) { | |||||
case EXPERT_INTENTION_JOIN: | |||||
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<String> applyTypeTrans(ExpertApplyTypeQueryEnum applyTypeQueryEnum) { | |||||
List<String> 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<RegionContainsBO> 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<ExpertDictionaryQuery> 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<RegionContainsBO> 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<ExpertApplyMetaVO> buildExpertApplyMetaVOList(List<ExpertMetaApply> expertMetaApplyList | |||||
, Map<Long, ExpertUserFullInfo> expertUserFullInfoMap | |||||
, Map<Long, List<ExpertDictionary>> expertDictionaryListMap) { | |||||
List<ExpertApplyMetaVO> 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 = regionCacheHelper.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<ExpertDictionary> 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<ExpertMetaApply> buildMetaApplyListQueryWrapper(MetaApplyListQuery applyListReq, | |||||
List<Long> expertIdList, | |||||
List<RegionContainsBO> viewRegions) { | |||||
// 审核类型 | |||||
List<String> applyTypeList = new ArrayList<>(); | |||||
if (CollUtil.isNotEmpty(applyListReq.getApplyTypeList())) { | |||||
List<ExpertApplyTypeQueryEnum> applyTypeQueryEnumList = applyListReq.getApplyTypeList(); | |||||
for (ExpertApplyTypeQueryEnum applyTypeQueryEnum : applyTypeQueryEnumList) { | |||||
applyTypeList.addAll(applyTypeTrans(applyTypeQueryEnum)); | |||||
} | |||||
} | |||||
// 审核结果 | |||||
List<String> applyStatusList = new ArrayList<>(); | |||||
if (CollUtil.isNotEmpty(applyListReq.getApplyStatusList())) { | |||||
applyStatusList = CollUtils.fieldList(applyListReq.getApplyStatusList(), ExpertApplyStatusEnum::getKey); | |||||
; | |||||
} | |||||
LocalDateTime applyStartTime = applyListReq.getApplyStartTime(); | |||||
LocalDateTime applyEndTime = applyListReq.getApplyEndTime(); | |||||
// 不展示撤回的申请记录 | |||||
LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyListQuery = Wrappers.lambdaQuery(ExpertMetaApply.class) | |||||
.in(CollectionUtils.isNotEmpty(applyTypeList), ExpertMetaApply::getApplyType, applyTypeList) | |||||
.in(CollectionUtils.isNotEmpty(applyStatusList), ExpertMetaApply::getApplyStatus, applyStatusList) | |||||
.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<DictionaryFieldInfo> 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<TagFieldInfo> 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; | |||||
} | |||||
} |
@@ -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; | |||||
} |
@@ -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<FileBasicInfo> evidenceList; | |||||
} |
@@ -1,61 +1,62 @@ | |||||
//package com.ningdatech.pmapi.expert.model.cmd; | |||||
// | |||||
//import com.ningdatech.emapi.common.model.CommonPageReq; | |||||
//import com.ningdatech.emapi.expert.constants.ExpertAccountStatusEnum; | |||||
//import com.ningdatech.emapi.expert.entity.bo.RegionContainsBO; | |||||
//import com.ningdatech.emapi.expert.entity.query.ExpertDictionaryQuery; | |||||
//import com.ningdatech.emapi.expert.entity.query.ExpertTagQuery; | |||||
//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<ExpertAccountStatusEnum> expertAccountStatusList; | |||||
// | |||||
// /** | |||||
// * 区域编码 | |||||
// */ | |||||
// @ApiModelProperty("区域编码") | |||||
// private String regionCode; | |||||
// | |||||
// /** | |||||
// * 区域级别 | |||||
// */ | |||||
// @ApiModelProperty("区域级别") | |||||
// private Integer regionLevel; | |||||
// | |||||
// /** | |||||
// * 专家管理区域范围 | |||||
// */ | |||||
// List<RegionContainsBO> regionContainsList; | |||||
// | |||||
// /** | |||||
// * 专家字典信息 | |||||
// */ | |||||
// private List<ExpertDictionaryQuery> expertDictionaryQueryList; | |||||
// | |||||
// /** | |||||
// * 专家标签信息 | |||||
// */ | |||||
// private List<ExpertTagQuery> expertTagQueryList; | |||||
// | |||||
// /** | |||||
// * 是否为钉用户 | |||||
// */ | |||||
// private Boolean isDingUser; | |||||
// | |||||
//} | |||||
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<ExpertAccountStatusEnum> expertAccountStatusList; | |||||
/** | |||||
* 区域编码 | |||||
*/ | |||||
@ApiModelProperty("区域编码") | |||||
private String regionCode; | |||||
/** | |||||
* 区域级别 | |||||
*/ | |||||
@ApiModelProperty("区域级别") | |||||
private Integer regionLevel; | |||||
/** | |||||
* 专家管理区域范围 | |||||
*/ | |||||
List<RegionContainsBO> regionContainsList; | |||||
/** | |||||
* 专家字典信息 | |||||
*/ | |||||
private List<ExpertDictionaryQuery> expertDictionaryQueryList; | |||||
/** | |||||
* 专家标签信息 | |||||
*/ | |||||
private List<ExpertTagQuery> expertTagQueryList; | |||||
/** | |||||
* 是否为钉用户 | |||||
*/ | |||||
private Boolean isDingUser; | |||||
} |
@@ -1,35 +1,36 @@ | |||||
//package com.ningdatech.pmapi.expert.model.cmd; | |||||
// | |||||
//import com.ningdatech.emapi.expert.entity.dto.ExpertDictionaryDTO; | |||||
//import com.ningdatech.emapi.expert.entity.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<ExpertDictionaryDTO> expertType; | |||||
// | |||||
// /** | |||||
// * 其他标签(标签code) | |||||
// */ | |||||
// private List<ExpertTagDTO> other; | |||||
// | |||||
// private String remark; | |||||
//} | |||||
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<ExpertDictionaryDTO> expertType; | |||||
/** | |||||
* 其他标签(标签code) | |||||
*/ | |||||
private List<ExpertTagDTO> other; | |||||
private String remark; | |||||
} |
@@ -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<ExpertApplyTypeQueryEnum> applyTypeList; | |||||
@ApiModelProperty("审核结果") | |||||
private List<ExpertApplyStatusEnum> 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; | |||||
} |
@@ -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<String> dictionaryCodeList; | |||||
} |
@@ -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<String> tagCodeList; | |||||
} |
@@ -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<String> expertAccountStatusList; | |||||
/** | |||||
* 区域编码 | |||||
*/ | |||||
private String regionCode; | |||||
/** | |||||
* 区域级别 | |||||
*/ | |||||
private Integer regionLevel; | |||||
/** | |||||
* 专家管理区域范围 | |||||
*/ | |||||
List<RegionContainsBO> regionContainsList; | |||||
/** | |||||
* 专家字典信息 | |||||
*/ | |||||
private List<ExpertDictionaryQuery> expertDictionaryQueryList; | |||||
/** | |||||
* 专家标签信息 | |||||
*/ | |||||
private List<ExpertTagQuery> expertTagQueryList; | |||||
private Boolean isDingUser; | |||||
} |
@@ -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<DictionaryFieldInfo> expertType; | |||||
@ApiModelProperty("其他标签(标签code)") | |||||
private List<TagFieldInfo> other; | |||||
@ApiModelProperty("备注") | |||||
private String remark; | |||||
} | |||||
} |
@@ -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<DictionaryFieldInfo> titleLevel; | |||||
@ApiModelProperty("工作单位") | |||||
private String company; | |||||
@ApiModelProperty(" 单位法人编号") | |||||
private String legalEntityCode; | |||||
@ApiModelProperty("单位类型(字典code)") | |||||
private List<DictionaryFieldInfo> companyAttribute; | |||||
@ApiModelProperty(value = "手机号") | |||||
private String phoneNo; | |||||
@ApiModelProperty(value = "专家类型(内外围)") | |||||
private List<DictionaryFieldInfo> expertType; | |||||
@ApiModelProperty(value = "专家层级") | |||||
private ExpertRegionInfo expertRegionInfo; | |||||
@ApiModelProperty(value = "是否浙政钉用户") | |||||
private Boolean isDingUser; | |||||
@ApiModelProperty(value = "专家账号状态", allowableValues = "冻结:freezing,正常:normal") | |||||
private String expertAccountStatus; | |||||
@ApiModelProperty(value = "专家来源") | |||||
private List<TagFieldInfo> expertSource; | |||||
} |
@@ -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<DictionaryFieldInfo> titleLevel; | |||||
/** | |||||
* 工作单位 | |||||
*/ | |||||
@ApiModelProperty("工作单位") | |||||
private String company; | |||||
/** | |||||
* 手机号 | |||||
*/ | |||||
@ApiModelProperty("手机号") | |||||
private String phoneNo; | |||||
/** | |||||
* 申请时间 | |||||
*/ | |||||
@ApiModelProperty("申请时间") | |||||
private LocalDateTime applyTime; | |||||
} |
@@ -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; | |||||
/** | |||||
* <p> | |||||
* LeaveAuditInfoVo | |||||
* </p> | |||||
* | |||||
* @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; | |||||
} | |||||
} |
@@ -2,8 +2,11 @@ package com.ningdatech.pmapi.expert.service; | |||||
import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; | import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; | ||||
import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd; | import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd; | ||||
import com.ningdatech.pmapi.expert.model.cmd.ExpertStorageDealCmd; | |||||
import com.ningdatech.pmapi.expert.model.dto.ExpertFullInfoAllDTO; | import com.ningdatech.pmapi.expert.model.dto.ExpertFullInfoAllDTO; | ||||
import java.util.List; | |||||
/** | /** | ||||
* @author liuxinxin | * @author liuxinxin | ||||
* @date 2022/7/22 下午4:39 | * @date 2022/7/22 下午4:39 | ||||
@@ -27,4 +30,14 @@ public interface ExpertInfoService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
ExpertFullInfoAllDTO getExpertUserFullInfoAll(Long userId); | ExpertFullInfoAllDTO getExpertUserFullInfoAll(Long userId); | ||||
void expertStorageDeal(ExpertStorageDealCmd cmd); | |||||
/** | |||||
* 批量获取用户全量信息 | |||||
**/ | |||||
List<ExpertFullInfoAllDTO> listExpertUserFullInfoAll(List<Long> userIds); | |||||
} | } | ||||
@@ -1,11 +1,11 @@ | |||||
package com.ningdatech.pmapi.expert.service; | package com.ningdatech.pmapi.expert.service; | ||||
import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 服务类 | |||||
* 服务类 | |||||
* </p> | * </p> | ||||
* | * | ||||
* @author Liuxinxin | * @author Liuxinxin | ||||
@@ -32,4 +32,14 @@ public interface IExpertUserFullInfoService extends IService<ExpertUserFullInfo> | |||||
**/ | **/ | ||||
List<ExpertUserFullInfo> listByUserId(List<Long> userId); | List<ExpertUserFullInfo> listByUserId(List<Long> userId); | ||||
/** | |||||
* 批量查询专家用户信息 | |||||
* | |||||
* @param userIds 用户ID | |||||
* @return / | |||||
*/ | |||||
List<ExpertUserFullInfo> listByUserIds(List<Long> userIds); | |||||
} | } |
@@ -2,8 +2,10 @@ package com.ningdatech.pmapi.expert.service.impl; | |||||
import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.pmapi.common.constant.BoolDisplayEnum; | |||||
import com.ningdatech.basic.util.CollUtils; | |||||
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; | |||||
import com.ningdatech.pmapi.expert.assembler.ExpertUserInfoAssembler; | import com.ningdatech.pmapi.expert.assembler.ExpertUserInfoAssembler; | ||||
import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; | import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; | ||||
import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum; | import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum; | ||||
@@ -15,8 +17,10 @@ import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; | |||||
import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; | import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; | ||||
import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; | import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; | ||||
import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd; | 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.model.dto.*; | ||||
import com.ningdatech.pmapi.expert.service.*; | 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.ExpertDictionary; | ||||
import com.ningdatech.pmapi.meta.model.entity.ExpertTag; | import com.ningdatech.pmapi.meta.model.entity.ExpertTag; | ||||
import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; | import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; | ||||
@@ -27,9 +31,7 @@ import org.springframework.stereotype.Component; | |||||
import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import java.util.Objects; | |||||
import java.util.*; | |||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
/** | /** | ||||
@@ -304,4 +306,102 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||||
} | } | ||||
/** | |||||
* 专家入库审核 | |||||
* | |||||
* @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<ExpertTag> saveExpertTagList = buildSaveExpertTagList(expertUserId, cmd.getOther()); | |||||
iExpertTagService.saveBatch(saveExpertTagList); | |||||
// 保存所有专家字典字段 | |||||
List<ExpertDictionaryDTO> expertType = cmd.getExpertType(); | |||||
if (CollectionUtils.isNotEmpty(expertType)) { | |||||
expertType = expertType.stream().peek(r -> r.setExpertInfoField(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())).collect(Collectors.toList()); | |||||
List<ExpertDictionary> saveExpertDictionaryList = buildSaveExpertDictionaryList(expertUserId, expertType); | |||||
iExpertDictionaryService.saveBatch(saveExpertDictionaryList); | |||||
} | |||||
// 修改履职意向申请状态 | |||||
LambdaUpdateWrapper<ExpertMetaApply> 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<SysUsersRoles> 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); | |||||
} | |||||
@Override | |||||
public List<ExpertFullInfoAllDTO> listExpertUserFullInfoAll(List<Long> userIds) { | |||||
List<ExpertUserFullInfo> expertUserFullInfos = iExpertUserFullInfoService.listByUserIds(userIds); | |||||
// 所有专家标签字段 | |||||
List<ExpertTag> expertTagList = iExpertTagService.list(Wrappers.lambdaQuery(ExpertTag.class) | |||||
.in(ExpertTag::getUserId, userIds)); | |||||
Map<Long, List<ExpertTag>> expertTagListMap = CollUtils.group(expertTagList, ExpertTag::getUserId); | |||||
// 所有专家字典字段 | |||||
List<ExpertDictionary> expertDictionaryList = iExpertDictionaryService.list(Wrappers.lambdaQuery(ExpertDictionary.class) | |||||
.in(ExpertDictionary::getUserId, userIds)); | |||||
Map<Long, List<ExpertDictionary>> expertDictMap = CollUtils.group(expertDictionaryList, ExpertDictionary::getUserId); | |||||
// 专家履职意向列表 | |||||
List<ExpertIntentionWorkRegion> expertIntentionWorkRegionList = iExpertIntentionWorkRegionService | |||||
.list(Wrappers.lambdaQuery(ExpertIntentionWorkRegion.class) | |||||
.in(ExpertIntentionWorkRegion::getUserId, userIds)); | |||||
Map<Long, List<ExpertIntentionWorkRegion>> intentionRegionMap = CollUtils.group(expertIntentionWorkRegionList, ExpertIntentionWorkRegion::getUserId); | |||||
// 专家履职意向申请列表 | |||||
List<ExpertMetaApply> expertMetaApplyList = iExpertMetaApplyService.list(Wrappers.lambdaQuery(ExpertMetaApply.class) | |||||
.in(ExpertMetaApply::getUserId, userIds) | |||||
.eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()) | |||||
.in(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey(), ExpertApplyTypeEnum.EXPERT_INTENTION_LEAVE.getKey())); | |||||
Map<Long, List<ExpertMetaApply>> metaApplyMap = CollUtils.group(expertMetaApplyList, ExpertMetaApply::getUserId); | |||||
// 所有专家回避单位 | |||||
List<ExpertAvoidCompany> expertAvoidCompanyList = iExpertAvoidCompanyService.list(Wrappers.lambdaQuery(ExpertAvoidCompany.class) | |||||
.in(ExpertAvoidCompany::getUserId, userIds)); | |||||
Map<Long, List<ExpertAvoidCompany>> avoidInfoMap = CollUtils.group(expertAvoidCompanyList, ExpertAvoidCompany::getUserId); | |||||
return expertUserFullInfos.stream().map(w -> ExpertUserInfoAssembler.buildExpertFullInfoAllDTO(w, | |||||
expertTagListMap.getOrDefault(w.getUserId(), Collections.emptyList()), | |||||
expertDictMap.getOrDefault(w.getUserId(), Collections.emptyList()), | |||||
intentionRegionMap.getOrDefault(w.getUserId(), Collections.emptyList()), | |||||
metaApplyMap.getOrDefault(w.getUserId(), Collections.emptyList()), | |||||
avoidInfoMap.getOrDefault(w.getUserId(), Collections.emptyList()))) | |||||
.collect(Collectors.toList()); | |||||
} | |||||
} | } |
@@ -33,4 +33,9 @@ public class ExpertUserFullInfoServiceImpl extends ServiceImpl<NdExpertUserFullI | |||||
return list(Wrappers.<ExpertUserFullInfo>lambdaQuery().in(ExpertUserFullInfo::getUserId, userIds)); | return list(Wrappers.<ExpertUserFullInfo>lambdaQuery().in(ExpertUserFullInfo::getUserId, userIds)); | ||||
} | } | ||||
@Override | |||||
public List<ExpertUserFullInfo> listByUserIds(List<Long> userIds) { | |||||
return list(Wrappers.<ExpertUserFullInfo>lambdaQuery().in(ExpertUserFullInfo::getUserId, userIds)); | |||||
} | |||||
} | } |
@@ -70,7 +70,7 @@ public class MeetingController { | |||||
@GetMapping("detail/{meetingId}/basicInfo") | @GetMapping("detail/{meetingId}/basicInfo") | ||||
@WebLog(value = "会议详情-基本信息") | @WebLog(value = "会议详情-基本信息") | ||||
public MeetingDetailBasicVO meetingBasic(@PathVariable Long meetingId) { | public MeetingDetailBasicVO meetingBasic(@PathVariable Long meetingId) { | ||||
return meetingManage.getMeetingBasicInfo(meetingId); | |||||
return meetingManage.getMeetingDetail(meetingId); | |||||
} | } | ||||
@ApiOperation("邀请情况详情") | @ApiOperation("邀请情况详情") | ||||
@@ -1,8 +1,6 @@ | |||||
package com.ningdatech.pmapi.meeting.entity.domain; | 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 com.baomidou.mybatisplus.annotation.*; | |||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Data; | import lombok.Data; | ||||
@@ -33,7 +31,7 @@ public class ExpertInviteAvoidRule implements Serializable { | |||||
private Long meetingId; | private Long meetingId; | ||||
@ApiModelProperty("回避专家ID") | @ApiModelProperty("回避专家ID") | ||||
private String expertIds; | |||||
private String avoidExpertIds; | |||||
@ApiModelProperty("回避单位ID") | @ApiModelProperty("回避单位ID") | ||||
private String avoidUnitIds; | private String avoidUnitIds; | ||||
@@ -45,15 +43,19 @@ public class ExpertInviteAvoidRule implements Serializable { | |||||
private Integer weekInviteCount; | private Integer weekInviteCount; | ||||
@ApiModelProperty("创建人ID") | @ApiModelProperty("创建人ID") | ||||
@TableField(fill = FieldFill.INSERT) | |||||
private Long createBy; | private Long createBy; | ||||
@ApiModelProperty("创建时间") | @ApiModelProperty("创建时间") | ||||
@TableField(fill = FieldFill.INSERT) | |||||
private LocalDateTime createOn; | private LocalDateTime createOn; | ||||
@ApiModelProperty("修改时间") | @ApiModelProperty("修改时间") | ||||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||||
private LocalDateTime updateOn; | private LocalDateTime updateOn; | ||||
@ApiModelProperty("修改人ID") | @ApiModelProperty("修改人ID") | ||||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||||
private Long updateBy; | private Long updateBy; | ||||
} | } |
@@ -1,8 +1,6 @@ | |||||
package com.ningdatech.pmapi.meeting.entity.domain; | 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 com.baomidou.mybatisplus.annotation.*; | |||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Data; | import lombok.Data; | ||||
@@ -35,15 +33,19 @@ public class ExpertInviteRule implements Serializable { | |||||
private String inviteRule; | private String inviteRule; | ||||
@ApiModelProperty("创建人ID") | @ApiModelProperty("创建人ID") | ||||
@TableField(fill = FieldFill.INSERT) | |||||
private Long createBy; | private Long createBy; | ||||
@ApiModelProperty("创建时间") | @ApiModelProperty("创建时间") | ||||
@TableField(fill = FieldFill.INSERT) | |||||
private LocalDateTime createOn; | private LocalDateTime createOn; | ||||
@ApiModelProperty("修改时间") | @ApiModelProperty("修改时间") | ||||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||||
private LocalDateTime updateOn; | private LocalDateTime updateOn; | ||||
@ApiModelProperty("修改人ID") | @ApiModelProperty("修改人ID") | ||||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||||
private Long updateBy; | private Long updateBy; | ||||
@ApiModelProperty("抽取类型:1 自定义规则、2 指定邀请") | @ApiModelProperty("抽取类型:1 自定义规则、2 指定邀请") | ||||
@@ -3,6 +3,8 @@ package com.ningdatech.pmapi.meeting.entity.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Data; | import lombok.Data; | ||||
import java.math.BigDecimal; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* MeetingEvalProjectDTO | * MeetingEvalProjectDTO | ||||
@@ -24,7 +26,7 @@ public class MeetingReviewProjectDTO { | |||||
private String projectType; | private String projectType; | ||||
@ApiModelProperty("申报金额") | @ApiModelProperty("申报金额") | ||||
private String declareAmount; | |||||
private BigDecimal declareAmount; | |||||
@ApiModelProperty("申报单位") | @ApiModelProperty("申报单位") | ||||
private String buildOrg; | private String buildOrg; | ||||
@@ -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; | |||||
/** | |||||
* <p> | |||||
* 指定邀请规则 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 11:26 2023/3/1 | |||||
*/ | |||||
@Data | |||||
@ApiModel("指定邀请规则") | |||||
public class AppointRuleVO { | |||||
@ApiModelProperty("邀请说明") | |||||
private String inviteDesc; | |||||
@ApiModelProperty("指定邀请专家") | |||||
private List<ExpertBasicInfoVO> experts; | |||||
} |
@@ -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; | |||||
/** | |||||
* <p> | |||||
* 回避信息 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 11:25 2023/3/1 | |||||
*/ | |||||
@Data | |||||
@ApiModel("回避信息") | |||||
public class AvoidInfoVO { | |||||
@ApiModelProperty("回避单位") | |||||
private List<String> avoidUnitIds; | |||||
@ApiModelProperty("回避条线") | |||||
private List<String> avoidOrgIds; | |||||
@ApiModelProperty("每周邀请次数") | |||||
private Integer weekInviteCount; | |||||
@ApiModelProperty("回避专家") | |||||
private List<ExpertBasicInfoVO> experts; | |||||
} |
@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | import lombok.Data; | ||||
import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
import java.util.ArrayList; | |||||
import java.util.List; | import java.util.List; | ||||
/** | /** | ||||
@@ -57,25 +56,25 @@ public class ExpertInviteDetailVO { | |||||
} | } | ||||
@ApiModelProperty("参与数量总计") | @ApiModelProperty("参与数量总计") | ||||
private Integer attendTotal = 0; | |||||
private Integer attendTotal; | |||||
@ApiModelProperty("随机邀请参与数量") | @ApiModelProperty("随机邀请参与数量") | ||||
private Integer randomAttend = 0; | |||||
private Integer randomAttend; | |||||
@ApiModelProperty("指定邀请参与数量") | @ApiModelProperty("指定邀请参与数量") | ||||
private Integer appointAttend = 0; | |||||
private Integer appointAttend; | |||||
@ApiModelProperty("是否已停止邀请") | @ApiModelProperty("是否已停止邀请") | ||||
private Boolean invitedStopped; | private Boolean invitedStopped; | ||||
@ApiModelProperty("最终参与名单") | @ApiModelProperty("最终参与名单") | ||||
private List<ExpertAttendListItemVO> attendList = new ArrayList<>(); | |||||
private List<ExpertAttendListItemVO> attendList; | |||||
@ApiModelProperty("随机邀请名单") | @ApiModelProperty("随机邀请名单") | ||||
private List<RandomInviteListItemVO> randomInviteList = new ArrayList<>(); | |||||
private List<RandomInviteListItemVO> randomInviteList; | |||||
@ApiModelProperty("指定邀请名单") | @ApiModelProperty("指定邀请名单") | ||||
private List<RandomInviteListItemVO> appointInviteList = new ArrayList<>(); | |||||
private List<RandomInviteListItemVO> appointInviteList; | |||||
public void addAttendList(ExpertAttendListItemVO attend) { | public void addAttendList(ExpertAttendListItemVO attend) { | ||||
this.attendList.add(attend); | this.attendList.add(attend); | ||||
@@ -16,59 +16,15 @@ import java.util.List; | |||||
@Data | @Data | ||||
public class InviteRuleDetailVO { | public class InviteRuleDetailVO { | ||||
@ApiModelProperty("是否创建邀请规则") | |||||
private Boolean invited; | |||||
private Integer inviteType; | |||||
@ApiModelProperty("随机邀请规则") | @ApiModelProperty("随机邀请规则") | ||||
private List<RandomInviteRuleVO> randomRules; | private List<RandomInviteRuleVO> randomRules; | ||||
@ApiModelProperty("是否有指定抽取规则") | |||||
private Boolean hasAppointRule; | |||||
@ApiModelProperty("指定抽取规则") | @ApiModelProperty("指定抽取规则") | ||||
private AppointRuleVo appointRule; | |||||
@ApiModelProperty("是否有回避规则") | |||||
private Boolean hasAvoidInfo; | |||||
private AppointRuleVO appointRule; | |||||
@ApiModelProperty("回避信息") | @ApiModelProperty("回避信息") | ||||
private AvoidInfoVo avoidInfo; | |||||
@Data | |||||
public static class AvoidInfoVo { | |||||
private List<String> avoidUnitIds; | |||||
private List<String> avoidOrgIds; | |||||
private Integer weekInviteCount; | |||||
private List<ExpertBasicInfoVO> experts; | |||||
} | |||||
@Data | |||||
public static class AppointRuleVo { | |||||
private String inviteDesc; | |||||
private List<ExpertBasicInfoVO> 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; | |||||
} | } |
@@ -1,8 +1,7 @@ | |||||
package com.ningdatech.pmapi.meeting.entity.vo; | package com.ningdatech.pmapi.meeting.entity.vo; | ||||
import com.alibaba.fastjson.annotation.JSONField; | 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.dto.MeetingReviewProjectDTO; | |||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Builder; | import lombok.Builder; | ||||
@@ -29,35 +28,36 @@ public class MeetingDetailBasicVO { | |||||
public MeetingDetailBasicVO() { | public MeetingDetailBasicVO() { | ||||
} | } | ||||
private Long id; | |||||
private Long meetingId; | |||||
@ApiModelProperty("会议名称") | @ApiModelProperty("会议名称") | ||||
private String name; | |||||
private String meetingName; | |||||
@ApiModelProperty("会议类型名称") | @ApiModelProperty("会议类型名称") | ||||
private String typeName; | private String typeName; | ||||
@ApiModelProperty("会议类型代码") | @ApiModelProperty("会议类型代码") | ||||
private String type; | |||||
private String meetingType; | |||||
@ApiModelProperty("开始时间") | @ApiModelProperty("开始时间") | ||||
@JSONField(format = "yyyy-MM-dd HH:mm") | @JSONField(format = "yyyy-MM-dd HH:mm") | ||||
private LocalDateTime startTime; | private LocalDateTime startTime; | ||||
@ApiModelProperty("结束时间") | |||||
@ApiModelProperty("评委到场时间") | |||||
@JSONField(format = "yyyy-MM-dd HH:mm") | @JSONField(format = "yyyy-MM-dd HH:mm") | ||||
private LocalDateTime endTime; | |||||
private LocalDateTime judgesAttendanceTime; | |||||
@ApiModelProperty("会议耗时") | |||||
private Integer meetingUsageTime; | |||||
@ApiModelProperty("联系人") | @ApiModelProperty("联系人") | ||||
private String connecter; | private String connecter; | ||||
@ApiModelProperty("创建人") | @ApiModelProperty("创建人") | ||||
private String author; | |||||
private List<RegionDTO> regions; | |||||
private String creator; | |||||
@ApiModelProperty("地点") | |||||
private String address; | |||||
@ApiModelProperty("评审地点") | |||||
private String meetingAddress; | |||||
@ApiModelProperty("联系方式") | @ApiModelProperty("联系方式") | ||||
private String contact; | private String contact; | ||||
@@ -65,33 +65,22 @@ public class MeetingDetailBasicVO { | |||||
@ApiModelProperty("创建时间") | @ApiModelProperty("创建时间") | ||||
private LocalDateTime createOn; | private LocalDateTime createOn; | ||||
@ApiModelProperty("会议说明") | |||||
private String description; | |||||
@ApiModelProperty("相关材料") | |||||
private List<AttachFileVo> attachments; | |||||
@ApiModelProperty("备注") | |||||
private String remark; | |||||
@ApiModelProperty("会议状态") | @ApiModelProperty("会议状态") | ||||
private Integer status; | private Integer status; | ||||
@ApiModelProperty("专家出席状态") | |||||
private Integer attendStatus; | |||||
@ApiModelProperty("取消说明") | @ApiModelProperty("取消说明") | ||||
private String cancelRemark; | private String cancelRemark; | ||||
@ApiModelProperty("创建人") | @ApiModelProperty("创建人") | ||||
private String createBy; | private String createBy; | ||||
private Boolean invited; | |||||
@ApiModelProperty("抽取单位") | @ApiModelProperty("抽取单位") | ||||
private String holdOrg; | private String holdOrg; | ||||
@ApiModelProperty("是否已确认下发会议通知名单") | |||||
private Boolean sendMeetingNotice; | |||||
@ApiModelProperty("抽取信息") | |||||
private InviteRuleDetailVO inviteRule; | |||||
@ApiModelProperty("评审项目信息") | |||||
private List<MeetingReviewProjectDTO> projects; | |||||
} | } |
@@ -143,7 +143,7 @@ public class MeetingManageHelper { | |||||
ExpertInviteAvoidRule avoidRule = inviteAvoidRuleService.getByMeetingId(meetingId); | ExpertInviteAvoidRule avoidRule = inviteAvoidRuleService.getByMeetingId(meetingId); | ||||
AvoidInfoDTO result = new AvoidInfoDTO(); | AvoidInfoDTO result = new AvoidInfoDTO(); | ||||
result.setAvoidOrgIdList(StrUtil.split(avoidRule.getAvoidOrgIds(), ",")); | result.setAvoidOrgIdList(StrUtil.split(avoidRule.getAvoidOrgIds(), ",")); | ||||
result.setExpertIds(BizUtils.splitToLong(avoidRule.getExpertIds())); | |||||
result.setExpertIds(BizUtils.splitToLong(avoidRule.getAvoidExpertIds())); | |||||
result.setAvoidUnitIdList(StrUtil.split(avoidRule.getAvoidUnitIds(), ",")); | result.setAvoidUnitIdList(StrUtil.split(avoidRule.getAvoidUnitIds(), ",")); | ||||
result.setWeekInviteCount(result.getWeekInviteCount()); | result.setWeekInviteCount(result.getWeekInviteCount()); | ||||
return result; | return result; | ||||
@@ -151,7 +151,7 @@ public class MeetingManageHelper { | |||||
public void saveAvoidInfo(Long meetingId, List<Long> expertIds) { | public void saveAvoidInfo(Long meetingId, List<Long> expertIds) { | ||||
ExpertInviteAvoidRule avoidRule = inviteAvoidRuleService.getByMeetingId(meetingId); | ExpertInviteAvoidRule avoidRule = inviteAvoidRuleService.getByMeetingId(meetingId); | ||||
avoidRule.setExpertIds(CollUtils.joinByComma(expertIds)); | |||||
avoidRule.setAvoidExpertIds(CollUtils.joinByComma(expertIds)); | |||||
inviteAvoidRuleService.saveOrUpdate(avoidRule); | inviteAvoidRuleService.saveOrUpdate(avoidRule); | ||||
} | } | ||||
@@ -17,6 +17,7 @@ import com.ningdatech.basic.util.CollUtils; | |||||
import com.ningdatech.basic.util.ValidUtil; | import com.ningdatech.basic.util.ValidUtil; | ||||
import com.ningdatech.cache.lock.DistributedLock; | import com.ningdatech.cache.lock.DistributedLock; | ||||
import com.ningdatech.file.service.FileService; | 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.entity.ExpertUserFullInfo; | ||||
import com.ningdatech.pmapi.expert.helper.PermissionCheckHelper; | import com.ningdatech.pmapi.expert.helper.PermissionCheckHelper; | ||||
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; | import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; | ||||
@@ -37,6 +38,9 @@ import com.ningdatech.pmapi.meeting.service.*; | |||||
import com.ningdatech.pmapi.meeting.task.ExpertInviteTask; | import com.ningdatech.pmapi.meeting.task.ExpertInviteTask; | ||||
import com.ningdatech.pmapi.meta.helper.DictionaryCache; | import com.ningdatech.pmapi.meta.helper.DictionaryCache; | ||||
import com.ningdatech.pmapi.meta.helper.TagCache; | import com.ningdatech.pmapi.meta.helper.TagCache; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
import com.ningdatech.pmapi.sys.model.dto.RegionDTO; | |||||
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | ||||
import com.ningdatech.pmapi.user.service.IUserInfoService; | import com.ningdatech.pmapi.user.service.IUserInfoService; | ||||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | import com.ningdatech.pmapi.user.util.LoginUserUtil; | ||||
@@ -64,6 +68,7 @@ import static com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper.getExpertIn | |||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
public class MeetingManage { | public class MeetingManage { | ||||
private final RegionCacheHelper regionCache; | |||||
private final IMeetingService meetingService; | private final IMeetingService meetingService; | ||||
private final IExpertInviteAvoidRuleService inviteAvoidRuleService; | private final IExpertInviteAvoidRuleService inviteAvoidRuleService; | ||||
private final IExpertInviteRuleService inviteRuleService; | private final IExpertInviteRuleService inviteRuleService; | ||||
@@ -79,6 +84,7 @@ public class MeetingManage { | |||||
private final DistributedLock distributedLock; | private final DistributedLock distributedLock; | ||||
private final PermissionCheckHelper permissionCheckHelper; | private final PermissionCheckHelper permissionCheckHelper; | ||||
private final IUserInfoService userInfoService; | private final IUserInfoService userInfoService; | ||||
private final IProjectService projectService; | |||||
private final IMeetingInnerProjectService meetingInnerProjectService; | private final IMeetingInnerProjectService meetingInnerProjectService; | ||||
private final IMeetingOuterProjectService meetingOuterProjectService; | private final IMeetingOuterProjectService meetingOuterProjectService; | ||||
@@ -174,7 +180,7 @@ public class MeetingManage { | |||||
avoidRule.setWeekInviteCount(ObjectUtil.defaultIfNull(avoidRule.getWeekInviteCount(), 0)); | avoidRule.setWeekInviteCount(ObjectUtil.defaultIfNull(avoidRule.getWeekInviteCount(), 0)); | ||||
avoidRule.setAvoidOrgIds(CollUtils.joinByComma(avoidInfo.getAvoidOrgIdList())); | avoidRule.setAvoidOrgIds(CollUtils.joinByComma(avoidInfo.getAvoidOrgIdList())); | ||||
avoidRule.setAvoidUnitIds(CollUtils.joinByComma(avoidInfo.getAvoidUnitIdList())); | avoidRule.setAvoidUnitIds(CollUtils.joinByComma(avoidInfo.getAvoidUnitIdList())); | ||||
avoidRule.setExpertIds(CollUtils.joinByComma(avoidInfo.getExpertIds())); | |||||
avoidRule.setAvoidExpertIds(CollUtils.joinByComma(avoidInfo.getExpertIds())); | |||||
inviteAvoidRuleService.save(avoidRule); | inviteAvoidRuleService.save(avoidRule); | ||||
} | } | ||||
} else { | } else { | ||||
@@ -304,35 +310,45 @@ public class MeetingManage { | |||||
return result; | return result; | ||||
} | } | ||||
public MeetingDetailBasicVO getMeetingBasicInfo(Long meetingId) { | |||||
public MeetingDetailBasicVO getMeetingDetail(Long meetingId) { | |||||
Meeting meeting = meetingService.getById(meetingId); | Meeting meeting = meetingService.getById(meetingId); | ||||
if (Objects.isNull(meeting)) { | |||||
throw new BizException("该会议信息不存在"); | |||||
} | |||||
Integer attendStatus = null; | |||||
if (LoginUserUtil.isExpert()) { | |||||
List<Long> meIds = Collections.singletonList(meetingId); | |||||
List<MeetingAndAttendStatusDTO> status = meetingExpertService.listByExpertIdAndStatus(LoginUserUtil.getUserId(), null, meIds); | |||||
if (status.isEmpty()) { | |||||
throw BizException.wrap("您未被邀请参加次会议"); | |||||
} | |||||
attendStatus = meetingManageHelper.getExpertAttendStatus(status.get(0)); | |||||
} | |||||
return MeetingDetailBasicVO.builder() | |||||
.id(meeting.getId()) | |||||
.name(meeting.getName()) | |||||
.type(meeting.getType()) | |||||
Assert.notNull(meeting, "会议不存在"); | |||||
MeetingDetailBasicVO detail = MeetingDetailBasicVO.builder() | |||||
.meetingId(meeting.getId()) | |||||
.meetingName(meeting.getName()) | |||||
.meetingType(meeting.getType()) | |||||
.meetingAddress(meeting.getMeetingAddress()) | |||||
.typeName(dictionaryCache.getByCode(meeting.getType()).getName()) | .typeName(dictionaryCache.getByCode(meeting.getType()).getName()) | ||||
.author(meeting.getCreator()) | |||||
.startTime(meeting.getStartTime()) | .startTime(meeting.getStartTime()) | ||||
.createOn(meeting.getCreateOn()) | |||||
.judgesAttendanceTime(meeting.getJudgesAttendanceTime()) | |||||
.meetingUsageTime(meeting.getMeetingUsageTime()) | |||||
.contact(meeting.getContact()) | .contact(meeting.getContact()) | ||||
.connecter(meeting.getConnecter()) | .connecter(meeting.getConnecter()) | ||||
.status(meeting.getStatus()) | .status(meeting.getStatus()) | ||||
.attendStatus(attendStatus) | |||||
.createBy(meeting.getCreator()) | |||||
.holdOrg(meeting.getHoldOrg()) | .holdOrg(meeting.getHoldOrg()) | ||||
.createOn(meeting.getCreateOn()) | |||||
.creator(meeting.getCreator()) | |||||
.createBy(meeting.getCreator()) | |||||
.build(); | .build(); | ||||
if (meeting.getIsInnerProject()) { | |||||
List<MeetingInnerProject> innerProjects = meetingInnerProjectService.listByMeetingId(meetingId); | |||||
List<Project> projects = projectService.listByIds(CollUtils.fieldList(innerProjects, MeetingInnerProject::getProjectId)); | |||||
List<MeetingReviewProjectDTO> convert = CollUtils.convert(projects, w -> { | |||||
MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO(); | |||||
mrp.setBuildOrg(w.getBuildOrgName()); | |||||
mrp.setProjectName(w.getProjectName()); | |||||
mrp.setProjectType(w.getProjectType().toString()); | |||||
mrp.setProjectYear(w.getProjectYear()); | |||||
mrp.setDeclareAmount(w.getDeclareAmount()); | |||||
return mrp; | |||||
}); | |||||
detail.setProjects(convert); | |||||
} else { | |||||
List<MeetingOuterProject> outerProjects = meetingOuterProjectService.listByMeetingId(meetingId); | |||||
detail.setProjects(BeanUtil.copyToList(outerProjects, MeetingReviewProjectDTO.class)); | |||||
} | |||||
detail.setInviteRule(inviteRuleDetail(meetingId)); | |||||
return detail; | |||||
} | } | ||||
public ExpertInviteDetailVO inviteDetail(Long meetingId) { | public ExpertInviteDetailVO inviteDetail(Long meetingId) { | ||||
@@ -441,9 +457,6 @@ public class MeetingManage { | |||||
public InviteRuleDetailVO inviteRuleDetail(Long meetingId) { | public InviteRuleDetailVO inviteRuleDetail(Long meetingId) { | ||||
InviteRuleDetailVO result = new InviteRuleDetailVO(); | InviteRuleDetailVO result = new InviteRuleDetailVO(); | ||||
List<ExpertInviteRule> inviteRules = inviteRuleService.listByMeetingId(meetingId); | List<ExpertInviteRule> inviteRules = inviteRuleService.listByMeetingId(meetingId); | ||||
if (!result.setAndGetInvited(inviteRules.size() > 0)) { | |||||
return result; | |||||
} | |||||
result.setRandomRules(new ArrayList<>()); | result.setRandomRules(new ArrayList<>()); | ||||
Map<ExpertInviteTypeEnum, List<ExpertInviteRule>> groupByType = CollUtils.group(inviteRules, w -> ExpertInviteTypeEnum.getByCode(w.getInviteType())); | Map<ExpertInviteTypeEnum, List<ExpertInviteRule>> groupByType = CollUtils.group(inviteRules, w -> ExpertInviteTypeEnum.getByCode(w.getInviteType())); | ||||
List<ExpertInviteRule> randoms = groupByType.get(ExpertInviteTypeEnum.RANDOM); | List<ExpertInviteRule> randoms = groupByType.get(ExpertInviteTypeEnum.RANDOM); | ||||
@@ -463,36 +476,31 @@ public class MeetingManage { | |||||
}); | }); | ||||
} | } | ||||
if (StrUtil.isNotEmpty(randomRule.getIntentionRegionCode())) { | if (StrUtil.isNotEmpty(randomRule.getIntentionRegionCode())) { | ||||
// TODO 履职意向地 | |||||
/*List<RegionDTO> intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel()); | |||||
randomRule.setIntentionRegions(intentionRegions);*/ | |||||
List<RegionDTO> intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel()); | |||||
randomRule.setIntentionRegions(intentionRegions); | |||||
} | } | ||||
if (StrUtil.isNotEmpty(randomRule.getExpertRegionCode())) { | if (StrUtil.isNotEmpty(randomRule.getExpertRegionCode())) { | ||||
// TODO 专家层级 | |||||
/*List<RegionDTO> expertRegions = regionCache.listParents(randomRule.getExpertRegionCode(), randomRule.getExpertRegionLevel()); | |||||
randomRule.setExpertRegions(expertRegions);*/ | |||||
List<RegionDTO> expertRegions = regionCache.listParents(randomRule.getExpertRegionCode(), randomRule.getExpertRegionLevel()); | |||||
randomRule.setExpertRegions(expertRegions); | |||||
} | } | ||||
result.getRandomRules().add(randomRule); | result.getRandomRules().add(randomRule); | ||||
}); | }); | ||||
} | |||||
List<ExpertInviteRule> appoints = groupByType.get(ExpertInviteTypeEnum.APPOINT); | |||||
if (result.setAndGetHasAppointRule(CollUtil.isNotEmpty(appoints))) { | |||||
ExpertInviteRule appoint = appoints.get(0); | |||||
AppointInviteRuleDTO appointRule = JSON.parseObject(appoint.getInviteRule(), AppointInviteRuleDTO.class); | |||||
InviteRuleDetailVO.AppointRuleVo vo = new InviteRuleDetailVO.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(); | |||||
AvoidInfoDTO avoidInfo = inviteAvoidRuleService.getAvoidInfoDto(meetingId); | |||||
AvoidInfoVO vo = new AvoidInfoVO(); | |||||
vo.setAvoidOrgIds(avoidInfo.getAvoidOrgIdList()); | vo.setAvoidOrgIds(avoidInfo.getAvoidOrgIdList()); | ||||
vo.setAvoidUnitIds(avoidInfo.getAvoidUnitIdList()); | vo.setAvoidUnitIds(avoidInfo.getAvoidUnitIdList()); | ||||
if (CollUtil.isNotEmpty(avoidInfo.getExpertIds())) { | if (CollUtil.isNotEmpty(avoidInfo.getExpertIds())) { | ||||
vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values())); | vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values())); | ||||
} | } | ||||
result.setAvoidInfo(vo); | result.setAvoidInfo(vo); | ||||
} else { | |||||
List<ExpertInviteRule> appoints = groupByType.get(ExpertInviteTypeEnum.APPOINT); | |||||
ExpertInviteRule appoint = appoints.get(0); | |||||
AppointInviteRuleDTO appointRule = JSON.parseObject(appoint.getInviteRule(), AppointInviteRuleDTO.class); | |||||
AppointRuleVO vo = new AppointRuleVO(); | |||||
vo.setInviteDesc(appointRule.getInviteDesc()); | |||||
vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(appointRule.getExpertIds()).values())); | |||||
result.setAppointRule(vo); | |||||
} | } | ||||
return result; | return result; | ||||
} | } | ||||
@@ -3,6 +3,8 @@ package com.ningdatech.pmapi.meeting.service; | |||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingInnerProject; | import com.ningdatech.pmapi.meeting.entity.domain.MeetingInnerProject; | ||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 会议评审内部项目表 服务类 | * 会议评审内部项目表 服务类 | ||||
@@ -13,4 +15,13 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||||
*/ | */ | ||||
public interface IMeetingInnerProjectService extends IService<MeetingInnerProject> { | public interface IMeetingInnerProjectService extends IService<MeetingInnerProject> { | ||||
/** | |||||
* 查询会议评审的内部项目 | |||||
* | |||||
* @param meetingId 会议ID | |||||
* @return 会议关联的系统内部项目 | |||||
* @author WendyYang | |||||
**/ | |||||
List<MeetingInnerProject> listByMeetingId(Long meetingId); | |||||
} | } |
@@ -3,6 +3,8 @@ package com.ningdatech.pmapi.meeting.service; | |||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingOuterProject; | import com.ningdatech.pmapi.meeting.entity.domain.MeetingOuterProject; | ||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 会议评审外部项目 服务类 | * 会议评审外部项目 服务类 | ||||
@@ -13,4 +15,13 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||||
*/ | */ | ||||
public interface IMeetingOuterProjectService extends IService<MeetingOuterProject> { | public interface IMeetingOuterProjectService extends IService<MeetingOuterProject> { | ||||
/** | |||||
* 查询会议评审的外部项目 | |||||
* | |||||
* @param meetingId 会议ID | |||||
* @return 评审的外部项目 | |||||
* @author WendyYang | |||||
**/ | |||||
List<MeetingOuterProject> listByMeetingId(Long meetingId); | |||||
} | } |
@@ -38,7 +38,7 @@ public class ExpertInviteAvoidRuleServiceImpl extends ServiceImpl<ExpertInviteAv | |||||
AvoidInfoDTO avoidInfo = new AvoidInfoDTO(); | AvoidInfoDTO avoidInfo = new AvoidInfoDTO(); | ||||
avoidInfo.setAvoidOrgIdList(StrUtils.split(avoidRule.getAvoidOrgIds())); | avoidInfo.setAvoidOrgIdList(StrUtils.split(avoidRule.getAvoidOrgIds())); | ||||
avoidInfo.setAvoidUnitIdList(StrUtils.split(avoidRule.getAvoidUnitIds())); | avoidInfo.setAvoidUnitIdList(StrUtils.split(avoidRule.getAvoidUnitIds())); | ||||
avoidInfo.setExpertIds(BizUtils.splitToLong(avoidRule.getExpertIds())); | |||||
avoidInfo.setExpertIds(BizUtils.splitToLong(avoidRule.getAvoidExpertIds())); | |||||
avoidInfo.setWeekInviteCount(avoidInfo.getWeekInviteCount()); | avoidInfo.setWeekInviteCount(avoidInfo.getWeekInviteCount()); | ||||
return avoidInfo; | return avoidInfo; | ||||
} | } | ||||
@@ -1,11 +1,14 @@ | |||||
package com.ningdatech.pmapi.meeting.service.impl; | package com.ningdatech.pmapi.meeting.service.impl; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingInnerProject; | import com.ningdatech.pmapi.meeting.entity.domain.MeetingInnerProject; | ||||
import com.ningdatech.pmapi.meeting.mapper.MeetingInnerProjectMapper; | import com.ningdatech.pmapi.meeting.mapper.MeetingInnerProjectMapper; | ||||
import com.ningdatech.pmapi.meeting.service.IMeetingInnerProjectService; | import com.ningdatech.pmapi.meeting.service.IMeetingInnerProjectService; | ||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 会议评审内部项目表 服务实现类 | * 会议评审内部项目表 服务实现类 | ||||
@@ -17,4 +20,10 @@ import org.springframework.stereotype.Service; | |||||
@Service | @Service | ||||
public class MeetingInnerProjectServiceImpl extends ServiceImpl<MeetingInnerProjectMapper, MeetingInnerProject> implements IMeetingInnerProjectService { | public class MeetingInnerProjectServiceImpl extends ServiceImpl<MeetingInnerProjectMapper, MeetingInnerProject> implements IMeetingInnerProjectService { | ||||
@Override | |||||
public List<MeetingInnerProject> listByMeetingId(Long meetingId) { | |||||
return list(Wrappers.lambdaQuery(MeetingInnerProject.class) | |||||
.eq(MeetingInnerProject::getMeetingId, meetingId)); | |||||
} | |||||
} | } |
@@ -1,11 +1,14 @@ | |||||
package com.ningdatech.pmapi.meeting.service.impl; | package com.ningdatech.pmapi.meeting.service.impl; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingOuterProject; | import com.ningdatech.pmapi.meeting.entity.domain.MeetingOuterProject; | ||||
import com.ningdatech.pmapi.meeting.mapper.MeetingOuterProjectMapper; | import com.ningdatech.pmapi.meeting.mapper.MeetingOuterProjectMapper; | ||||
import com.ningdatech.pmapi.meeting.service.IMeetingOuterProjectService; | import com.ningdatech.pmapi.meeting.service.IMeetingOuterProjectService; | ||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 会议评审外部项目 服务实现类 | * 会议评审外部项目 服务实现类 | ||||
@@ -17,4 +20,10 @@ import org.springframework.stereotype.Service; | |||||
@Service | @Service | ||||
public class MeetingOuterProjectServiceImpl extends ServiceImpl<MeetingOuterProjectMapper, MeetingOuterProject> implements IMeetingOuterProjectService { | public class MeetingOuterProjectServiceImpl extends ServiceImpl<MeetingOuterProjectMapper, MeetingOuterProject> implements IMeetingOuterProjectService { | ||||
@Override | |||||
public List<MeetingOuterProject> listByMeetingId(Long meetingId) { | |||||
return list(Wrappers.lambdaQuery(MeetingOuterProject.class) | |||||
.eq(MeetingOuterProject::getMeetingId, meetingId)); | |||||
} | |||||
} | } |
@@ -0,0 +1,16 @@ | |||||
package com.ningdatech.pmapi.meta.helper; | |||||
import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; | |||||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||||
/** | |||||
* @author liuxinxin | |||||
* @date 2023/3/2 上午11:02 | |||||
*/ | |||||
public interface ExpertUserInfoHelper { | |||||
ExpertUserFullInfo getExpertBasicFullInfo(Long expertUserId); | |||||
ExpertRegionInfo getExpertRegionInfo(Long expertUserId); | |||||
} |
@@ -0,0 +1,63 @@ | |||||
package com.ningdatech.pmapi.meta.helper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; | |||||
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; | |||||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||||
import lombok.RequiredArgsConstructor; | |||||
import org.springframework.stereotype.Component; | |||||
/** | |||||
* @author liuxinxin | |||||
* @date 2022/8/30 下午2:17 | |||||
* 公共专家相关信息工具类 用于获取专家的一些基础信息 | |||||
*/ | |||||
@Component | |||||
@RequiredArgsConstructor | |||||
public class ExpertUserInfoHelperImpl implements ExpertUserInfoHelper { | |||||
private final IExpertUserFullInfoService iExpertUserFullInfoService; | |||||
/** | |||||
* 获取专家 | |||||
* | |||||
* @param expertUserId | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public ExpertUserFullInfo getExpertBasicFullInfo(Long expertUserId) { | |||||
ExpertUserFullInfo one = iExpertUserFullInfoService | |||||
.getOne(Wrappers.lambdaQuery(ExpertUserFullInfo.class).eq(ExpertUserFullInfo::getUserId, expertUserId)); | |||||
return one; | |||||
} | |||||
/** | |||||
* 获取专家层级 | |||||
* | |||||
* @param expertUserId | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public ExpertRegionInfo getExpertRegionInfo(Long expertUserId) { | |||||
ExpertUserFullInfo one = getExpertBasicFullInfo(expertUserId); | |||||
Integer regionLevel = one.getRegionLevel(); | |||||
String regionCode = one.getRegionCode(); | |||||
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); | |||||
expertRegionInfo.setRegionCode(regionCode); | |||||
expertRegionInfo.setRegionLevel(regionLevel); | |||||
return expertRegionInfo; | |||||
} | |||||
// /** | |||||
// * 专家是否已经出库 | |||||
// */ | |||||
// public Boolean isDelivery(Long expertUserId) { | |||||
// ExpertUserFullInfo one = getExpertBasicFullInfo(expertUserId); | |||||
// if (Objects.isNull(one)) { | |||||
// return true; | |||||
// } | |||||
// return ExpertAccountStatusEnum.DELIVERY.getKey().equals(one.getExpertAccountStatus()); | |||||
// } | |||||
} |
@@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.basic.util.CollUtils; | 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.common.util.BizUtils; | ||||
import com.ningdatech.pmapi.meta.assembler.MetaDictionaryAssembler; | import com.ningdatech.pmapi.meta.assembler.MetaDictionaryAssembler; | ||||
import com.ningdatech.pmapi.meta.assembler.MetaTagAssembler; | import com.ningdatech.pmapi.meta.assembler.MetaTagAssembler; | ||||
@@ -1,8 +1,12 @@ | |||||
package com.ningdatech.pmapi.meta.service; | package com.ningdatech.pmapi.meta.service; | ||||
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; | import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; | ||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
import java.util.Collection; | |||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 服务类 | * 服务类 | ||||
@@ -13,4 +17,15 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||||
*/ | */ | ||||
public interface IExpertDictionaryService extends IService<ExpertDictionary> { | public interface IExpertDictionaryService extends IService<ExpertDictionary> { | ||||
/** | |||||
* 根据专家ID批量查询专家字典信息 | |||||
* | |||||
* @param userIds 专家ID | |||||
* @param dictType 专家字典类型 | |||||
* @return / | |||||
* @author WendyYang | |||||
**/ | |||||
List<ExpertDictionary> listByUserId(Collection<Long> userIds, DictExpertInfoTypeEnum dictType); | |||||
} | } |
@@ -1,11 +1,17 @@ | |||||
package com.ningdatech.pmapi.meta.service.impl; | 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.mapper.ExpertDictionaryMapper; | ||||
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; | |||||
import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; | import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; | ||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import java.util.Collection; | |||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 服务实现类 | * 服务实现类 | ||||
@@ -17,4 +23,13 @@ import org.springframework.stereotype.Service; | |||||
@Service | @Service | ||||
public class ExpertDictionaryServiceImpl extends ServiceImpl<ExpertDictionaryMapper, ExpertDictionary> implements IExpertDictionaryService { | public class ExpertDictionaryServiceImpl extends ServiceImpl<ExpertDictionaryMapper, ExpertDictionary> implements IExpertDictionaryService { | ||||
@Override | |||||
public List<ExpertDictionary> listByUserId(Collection<Long> userIds, DictExpertInfoTypeEnum dictType) { | |||||
// 获取专家职称 | |||||
LambdaQueryWrapper<ExpertDictionary> query = Wrappers.lambdaQuery(ExpertDictionary.class) | |||||
.in(ExpertDictionary::getUserId, userIds) | |||||
.eq(ExpertDictionary::getExpertInfoField, dictType.getKey()); | |||||
return list(query); | |||||
} | |||||
} | } |
@@ -8,7 +8,6 @@ import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | ||||
import com.ningdatech.pmapi.common.helper.UserInfoHelper; | import com.ningdatech.pmapi.common.helper.UserInfoHelper; | ||||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | ||||
import com.ningdatech.pmapi.projectdeclared.contants.DeclaredProjectContant; | |||||
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; | import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; | ||||
import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO; | import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO; | ||||
import com.ningdatech.pmapi.projectdeclared.model.req.PrequalificationDeclaredListReq; | import com.ningdatech.pmapi.projectdeclared.model.req.PrequalificationDeclaredListReq; | ||||
@@ -21,7 +20,7 @@ import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.ningdatech.pmapi.staging.serivice.IProjectStagingService; | |||||
import com.ningdatech.pmapi.staging.service.IProjectStagingService; | |||||
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | ||||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | import com.ningdatech.pmapi.user.util.LoginUserUtil; | ||||
import com.wflow.bean.entity.WflowModels; | import com.wflow.bean.entity.WflowModels; | ||||
@@ -6,15 +6,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import org.springframework.core.annotation.Order; | import org.springframework.core.annotation.Order; | ||||
import org.springframework.stereotype.Component; | 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.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | ||||
@@ -63,7 +62,7 @@ public class AnnualPlanHandle extends AbstractProcessBusinessHandle { | |||||
// 项目状态为年度计划中之前的状态 | // 项目状态为年度计划中之前的状态 | ||||
if (fieldList.contains(status)){ | if (fieldList.contains(status)){ | ||||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | ||||
processDetailVO.setProcessName(CommonConstant.ANNUAL_PLAN); | |||||
processDetailVO.setProcessName(CommonConst.ANNUAL_PLAN); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
return; | return; | ||||
} | } | ||||
@@ -71,31 +70,31 @@ public class AnnualPlanHandle extends AbstractProcessBusinessHandle { | |||||
// 项目状态为年度计划中 | // 项目状态为年度计划中 | ||||
if (ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode().equals(status)){ | if (ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode().equals(status)){ | ||||
// 根据部门联审通过的时间获取 | // 根据部门联审通过的时间获取 | ||||
NdProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(NdProjectStatusChange.class) | |||||
.eq(NdProjectStatusChange::getProjectId, projectId) | |||||
.eq(NdProjectStatusChange::getEvent, ProjectStatusChangeEvent.DEPARTMENT_UNITED_REVIEW_PASS.name()) | |||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | |||||
.eq(ProjectStatusChange::getProjectId, projectId) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.DEPARTMENT_UNITED_REVIEW_PASS.name()) | |||||
.last("limit 1")); | .last("limit 1")); | ||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||
processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); | processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); | ||||
} else if (ProjectStatusEnum.BE_SUSPENDED.getCode().equals(status)) { | } else if (ProjectStatusEnum.BE_SUSPENDED.getCode().equals(status)) { | ||||
// 根据年度计划暂缓的时间获取 | // 根据年度计划暂缓的时间获取 | ||||
NdProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(NdProjectStatusChange.class) | |||||
.eq(NdProjectStatusChange::getProjectId, projectId) | |||||
.eq(NdProjectStatusChange::getEvent, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND.name()) | |||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | |||||
.eq(ProjectStatusChange::getProjectId, projectId) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND.name()) | |||||
.last("limit 1")); | .last("limit 1")); | ||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||
processDetailVO.setStepStatus(StepStatusEnum.REJECTED); | processDetailVO.setStepStatus(StepStatusEnum.REJECTED); | ||||
} else { | } else { | ||||
// 根据开启方案申报的时间获取 | // 根据开启方案申报的时间获取 | ||||
NdProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(NdProjectStatusChange.class) | |||||
.eq(NdProjectStatusChange::getProjectId, projectId) | |||||
.eq(NdProjectStatusChange::getEvent, ProjectStatusChangeEvent.ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE.name()) | |||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | |||||
.eq(ProjectStatusChange::getProjectId, projectId) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE.name()) | |||||
.last("limit 1")); | .last("limit 1")); | ||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | ||||
} | } | ||||
processDetailVO.setProcessName(CommonConstant.ANNUAL_PLAN); | |||||
processDetailVO.setProcessName(CommonConst.ANNUAL_PLAN); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -7,11 +7,11 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
import org.springframework.core.annotation.Order; | import org.springframework.core.annotation.Order; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 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.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | ||||
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | ||||
@@ -41,19 +41,19 @@ public class ArchivedHandle extends AbstractProcessBusinessHandle { | |||||
// 项目阶段不为已归档 | // 项目阶段不为已归档 | ||||
if (!ProjectStatusEnum.ARCHIVED.getCode().equals(status)){ | if (!ProjectStatusEnum.ARCHIVED.getCode().equals(status)){ | ||||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | ||||
processDetailVO.setProcessName(CommonConstant.ARCHIVED); | |||||
processDetailVO.setProcessName(CommonConst.ARCHIVED); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
return; | return; | ||||
} | } | ||||
// 项目阶段为已归档 | // 项目阶段为已归档 | ||||
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | ||||
// 根据项目终验获取归档时间 | // 根据项目终验获取归档时间 | ||||
NdProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(NdProjectStatusChange.class) | |||||
.eq(NdProjectStatusChange::getProjectId, projectId) | |||||
.eq(NdProjectStatusChange::getEvent, ProjectStatusChangeEvent.FINAL_ACCEPTANCE_PASS.name()) | |||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | |||||
.eq(ProjectStatusChange::getProjectId, projectId) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.FINAL_ACCEPTANCE_PASS.name()) | |||||
.last("limit 1")); | .last("limit 1")); | ||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||
processDetailVO.setProcessName(CommonConstant.ARCHIVED); | |||||
processDetailVO.setProcessName(CommonConst.ARCHIVED); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -11,7 +11,7 @@ import org.springframework.core.annotation.Order; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 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.InstTypeEnum; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | ||||
@@ -51,7 +51,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle | |||||
if (Objects.isNull(projectInst)){ | if (Objects.isNull(projectInst)){ | ||||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | ||||
processDetailVO.setProcessName(CommonConstant.CONSTRUCTION_PLAN_REVIEW); | |||||
processDetailVO.setProcessName(CommonConst.CONSTRUCTION_PLAN_REVIEW); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
return; | return; | ||||
} | } | ||||
@@ -76,7 +76,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle | |||||
processDetailVO.setFinishTime(finishTime); | processDetailVO.setFinishTime(finishTime); | ||||
} | } | ||||
processDetailVO.setProcessProgressVo(instanceDetail); | processDetailVO.setProcessProgressVo(instanceDetail); | ||||
processDetailVO.setProcessName(CommonConstant.CONSTRUCTION_PLAN_REVIEW); | |||||
processDetailVO.setProcessName(CommonConst.CONSTRUCTION_PLAN_REVIEW); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -11,7 +11,7 @@ import org.springframework.core.annotation.Order; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 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.InstTypeEnum; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | ||||
@@ -50,7 +50,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { | |||||
.last("limit 1")); | .last("limit 1")); | ||||
if (Objects.isNull(projectInst)){ | if (Objects.isNull(projectInst)){ | ||||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | ||||
processDetailVO.setProcessName(CommonConstant.DEPT_UNITED_REVIEW); | |||||
processDetailVO.setProcessName(CommonConst.DEPT_UNITED_REVIEW); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
return; | return; | ||||
} | } | ||||
@@ -74,7 +74,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { | |||||
processDetailVO.setFinishTime(finishTime); | processDetailVO.setFinishTime(finishTime); | ||||
} | } | ||||
processDetailVO.setProcessProgressVo(instanceDetail); | processDetailVO.setProcessProgressVo(instanceDetail); | ||||
processDetailVO.setProcessName(CommonConstant.DEPT_UNITED_REVIEW); | |||||
processDetailVO.setProcessName(CommonConst.DEPT_UNITED_REVIEW); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -3,7 +3,7 @@ package com.ningdatech.pmapi.projectlib.handle; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.google.common.collect.Lists; | import com.google.common.collect.Lists; | ||||
import com.ningdatech.basic.util.NdDateUtils; | 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.InstTypeEnum; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | ||||
@@ -49,7 +49,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { | |||||
.last("limit 1")); | .last("limit 1")); | ||||
if (Objects.isNull(projectInst)){ | if (Objects.isNull(projectInst)){ | ||||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | ||||
processDetailVO.setProcessName(CommonConstant.PRELIMINARY_PREVIEW); | |||||
processDetailVO.setProcessName(CommonConst.PRELIMINARY_PREVIEW); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
return; | return; | ||||
} | } | ||||
@@ -73,7 +73,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { | |||||
processDetailVO.setFinishTime(finishTime); | processDetailVO.setFinishTime(finishTime); | ||||
} | } | ||||
processDetailVO.setProcessProgressVo(instanceDetail); | processDetailVO.setProcessProgressVo(instanceDetail); | ||||
processDetailVO.setProcessName(CommonConstant.PRELIMINARY_PREVIEW); | |||||
processDetailVO.setProcessName(CommonConst.PRELIMINARY_PREVIEW); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -3,24 +3,19 @@ package com.ningdatech.pmapi.projectlib.handle; | |||||
import java.time.LocalDate; | import java.time.LocalDate; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.*; | import java.util.*; | ||||
import java.util.stream.Collectors; | |||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
import com.ningdatech.basic.util.NdDateUtils; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import org.springframework.core.annotation.Order; | import org.springframework.core.annotation.Order; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.basic.model.PageVo; | |||||
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.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; | import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | ||||
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
@@ -78,7 +73,7 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { | |||||
// 项目状态为待立项批复之前的状态 | // 项目状态为待立项批复之前的状态 | ||||
if (fieldList.contains(status)){ | if (fieldList.contains(status)){ | ||||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | ||||
processDetailVO.setProcessName(CommonConstant.PROJECT_APPROVAL); | |||||
processDetailVO.setProcessName(CommonConst.PROJECT_APPROVAL); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
return; | return; | ||||
} | } | ||||
@@ -86,9 +81,9 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { | |||||
// 当前项目状态为待立项批复 | // 当前项目状态为待立项批复 | ||||
if (ProjectStatusEnum.TO_BE_APPROVED.getCode().equals(status)){ | if (ProjectStatusEnum.TO_BE_APPROVED.getCode().equals(status)){ | ||||
// 根据建设方案评审通过的时间获取 | // 根据建设方案评审通过的时间获取 | ||||
NdProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(NdProjectStatusChange.class) | |||||
.eq(NdProjectStatusChange::getProjectId, projectId) | |||||
.eq(NdProjectStatusChange::getEvent, ProjectStatusChangeEvent.PLAN_REVIEW_PASS.name()) | |||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | |||||
.eq(ProjectStatusChange::getProjectId, projectId) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PLAN_REVIEW_PASS.name()) | |||||
.last("limit 1")); | .last("limit 1")); | ||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||
processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); | processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); | ||||
@@ -101,7 +96,7 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { | |||||
processDetailVO.setFinishTime(approvalDateTime); | processDetailVO.setFinishTime(approvalDateTime); | ||||
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | ||||
} | } | ||||
processDetailVO.setProcessName(CommonConstant.PROJECT_APPROVAL); | |||||
processDetailVO.setProcessName(CommonConst.PROJECT_APPROVAL); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.projectlib.handle; | 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.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | ||||
@@ -37,7 +37,7 @@ public class ProjectDeclareHandle extends AbstractProcessBusinessHandle { | |||||
Project project = projectService.getById(projectId); | Project project = projectService.getById(projectId); | ||||
LocalDateTime createOn = project.getCreateOn(); | LocalDateTime createOn = project.getCreateOn(); | ||||
processDetailVO.setFinishTime(createOn); | processDetailVO.setFinishTime(createOn); | ||||
processDetailVO.setProcessName(CommonConstant.PROJECT_DECLARE); | |||||
processDetailVO.setProcessName(CommonConst.PROJECT_DECLARE); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -15,7 +15,7 @@ import com.wflow.workflow.service.ProcessInstanceService; | |||||
import org.springframework.core.annotation.Order; | import org.springframework.core.annotation.Order; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 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.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | ||||
@@ -50,7 +50,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle | |||||
if (Objects.isNull(projectInst)){ | if (Objects.isNull(projectInst)){ | ||||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | ||||
processDetailVO.setProcessName(CommonConstant.PROJECT_FINAL_INSPECTION); | |||||
processDetailVO.setProcessName(CommonConst.PROJECT_FINAL_INSPECTION); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
return; | return; | ||||
} | } | ||||
@@ -76,7 +76,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle | |||||
processDetailVO.setFinishTime(finishTime); | processDetailVO.setFinishTime(finishTime); | ||||
} | } | ||||
processDetailVO.setProcessProgressVo(instanceDetail); | processDetailVO.setProcessProgressVo(instanceDetail); | ||||
processDetailVO.setProcessName(CommonConstant.PRELIMINARY_PREVIEW); | |||||
processDetailVO.setProcessName(CommonConst.PRELIMINARY_PREVIEW); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -4,19 +4,17 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; | |||||
import java.util.Arrays; | import java.util.Arrays; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | |||||
import org.springframework.core.annotation.Order; | import org.springframework.core.annotation.Order; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.basic.util.CollUtils; | 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.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | ||||
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | ||||
@@ -60,7 +58,7 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH | |||||
// 项目状态不在建设中及之后的状态 | // 项目状态不在建设中及之后的状态 | ||||
if (!fieldList.contains(status)){ | if (!fieldList.contains(status)){ | ||||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | ||||
processDetailVO.setProcessName(CommonConstant.PROJECT_PRELIMINARY_INSPECTION); | |||||
processDetailVO.setProcessName(CommonConst.PROJECT_PRELIMINARY_INSPECTION); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
return; | return; | ||||
} | } | ||||
@@ -70,13 +68,13 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH | |||||
}else { | }else { | ||||
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | ||||
// 根据初验备案的时间获取 | // 根据初验备案的时间获取 | ||||
NdProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(NdProjectStatusChange.class) | |||||
.eq(NdProjectStatusChange::getProjectId, projectId) | |||||
.eq(NdProjectStatusChange::getEvent, ProjectStatusChangeEvent.PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD.name()) | |||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | |||||
.eq(ProjectStatusChange::getProjectId, projectId) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD.name()) | |||||
.last("limit 1")); | .last("limit 1")); | ||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||
} | } | ||||
processDetailVO.setProcessName(CommonConstant.TENDER_PURCHASE); | |||||
processDetailVO.setProcessName(CommonConst.TENDER_PURCHASE); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -2,26 +2,19 @@ package com.ningdatech.pmapi.projectlib.handle; | |||||
import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; | import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; | ||||
import java.time.LocalDate; | |||||
import java.time.LocalDateTime; | |||||
import java.util.*; | import java.util.*; | ||||
import java.util.stream.Collectors; | |||||
import org.springframework.core.annotation.Order; | import org.springframework.core.annotation.Order; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.basic.util.CollUtils; | 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.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | ||||
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
@@ -63,7 +56,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { | |||||
// 未进行立项批复 | // 未进行立项批复 | ||||
if (Objects.isNull(project.getApprovalDate())){ | if (Objects.isNull(project.getApprovalDate())){ | ||||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | ||||
processDetailVO.setProcessName(CommonConstant.TENDER_PURCHASE); | |||||
processDetailVO.setProcessName(CommonConst.TENDER_PURCHASE); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
return; | return; | ||||
} | } | ||||
@@ -74,13 +67,13 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { | |||||
}else if (fieldList.contains(status)){ | }else if (fieldList.contains(status)){ | ||||
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | ||||
// 根据采购备案的时间获取 | // 根据采购备案的时间获取 | ||||
NdProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(NdProjectStatusChange.class) | |||||
.eq(NdProjectStatusChange::getProjectId, projectId) | |||||
.eq(NdProjectStatusChange::getEvent, ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD.name()) | |||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | |||||
.eq(ProjectStatusChange::getProjectId, projectId) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD.name()) | |||||
.last("limit 1")); | .last("limit 1")); | ||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||
} | } | ||||
processDetailVO.setProcessName(CommonConstant.TENDER_PURCHASE); | |||||
processDetailVO.setProcessName(CommonConst.TENDER_PURCHASE); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -10,7 +10,7 @@ import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | 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.enumeration.StepStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | ||||
import com.wflow.workflow.bean.process.ProgressNode; | import com.wflow.workflow.bean.process.ProgressNode; | ||||
@@ -69,7 +69,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { | |||||
processDetailVO.setFinishTime(finishTime); | processDetailVO.setFinishTime(finishTime); | ||||
} | } | ||||
processDetailVO.setProcessProgressVo(instanceDetail); | processDetailVO.setProcessProgressVo(instanceDetail); | ||||
processDetailVO.setProcessName(CommonConstant.UNIT_INNER_AUDIT); | |||||
processDetailVO.setProcessName(CommonConst.UNIT_INNER_AUDIT); | |||||
processSchedule.add(processDetailVO); | processSchedule.add(processDetailVO); | ||||
} | } | ||||
} | } |
@@ -12,7 +12,7 @@ import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
import com.ningdatech.basic.util.ValidUtil; | 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.model.entity.ExcelExportWriter; | ||||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | ||||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | ||||
@@ -217,8 +217,8 @@ public class AnnualPlanLibManage { | |||||
} | } | ||||
public void exportList(ProjectListReq param, HttpServletResponse response) { | 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<Project> query = ProjectHelper.projectQuery(param); | LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param); | ||||
Integer isTemporaryAugment = param.getIsTemporaryAugment(); | Integer isTemporaryAugment = param.getIsTemporaryAugment(); | ||||
if (Objects.isNull(isTemporaryAugment)){ | if (Objects.isNull(isTemporaryAugment)){ | ||||
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.google.common.collect.Lists; | import com.google.common.collect.Lists; | ||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.basic.util.CollUtils; | 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.model.entity.ExcelExportWriter; | ||||
import com.ningdatech.pmapi.common.util.ExcelDownUtil; | import com.ningdatech.pmapi.common.util.ExcelDownUtil; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
@@ -135,8 +135,8 @@ public class ProjectLibManage { | |||||
} | } | ||||
public void exportList(ProjectListReq param, HttpServletResponse response) { | 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<Project> query = ProjectHelper.projectQuery(param); | LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param); | ||||
List<Project> projects = projectService.list(query); | List<Project> projects = projectService.list(query); | ||||
@@ -8,7 +8,7 @@ import com.ningdatech.basic.function.VUtils; | |||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
import com.ningdatech.basic.util.NdDateUtils; | 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.ExcelDownUtil; | ||||
import com.ningdatech.pmapi.common.util.ExcelExportStyle; | import com.ningdatech.pmapi.common.util.ExcelExportStyle; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum; | ||||
@@ -167,8 +167,8 @@ public class ProjectRenewalFundManage { | |||||
public void exportList(HttpServletResponse response, ProjectRenewalListReq param) { | 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<ProjectRenewalFundDeclarationPO> page = param.page(); | Page<ProjectRenewalFundDeclarationPO> page = param.page(); | ||||
projectRenewalFundDeclarationService.pageSql(page, param); | projectRenewalFundDeclarationService.pageSql(page, param); | ||||
List<ProjectRenewalFundDeclarationPO> records = page.getRecords(); | List<ProjectRenewalFundDeclarationPO> records = page.getRecords(); | ||||
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.projectlib.mapper; | package com.ningdatech.pmapi.projectlib.mapper; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
/** | /** | ||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023-02-27 | * @since 2023-02-27 | ||||
*/ | */ | ||||
public interface NdProjectStatusChangeMapper extends BaseMapper<NdProjectStatusChange> { | |||||
public interface NdProjectStatusChangeMapper extends BaseMapper<ProjectStatusChange> { | |||||
} | } |
@@ -1,95 +0,0 @@ | |||||
package com.ningdatech.pmapi.projectlib.model.entity; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import java.io.Serializable; | |||||
import java.time.LocalDateTime; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
/** | |||||
* <p> | |||||
* | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-02-27 | |||||
*/ | |||||
@TableName("nd_project_status_change") | |||||
@ApiModel(value = "NdProjectStatusChange对象", description = "") | |||||
public class NdProjectStatusChange implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty("主键") | |||||
private Long id; | |||||
@ApiModelProperty("项目ID") | |||||
private Long projectId; | |||||
@ApiModelProperty("状态机执行前的项目状态") | |||||
private Integer beforeStatus; | |||||
@ApiModelProperty("状态机执行后的项目状态") | |||||
private Integer afterStatus; | |||||
@ApiModelProperty("状态变更对应的事件") | |||||
private String event; | |||||
@ApiModelProperty("状态变更发生的时间") | |||||
private LocalDateTime createOn; | |||||
public Long getId() { | |||||
return id; | |||||
} | |||||
public void setId(Long id) { | |||||
this.id = id; | |||||
} | |||||
public Long getProjectId() { | |||||
return projectId; | |||||
} | |||||
public void setProjectId(Long projectId) { | |||||
this.projectId = projectId; | |||||
} | |||||
public Integer getBeforeStatus() { | |||||
return beforeStatus; | |||||
} | |||||
public void setBeforeStatus(Integer beforeStatus) { | |||||
this.beforeStatus = beforeStatus; | |||||
} | |||||
public Integer getAfterStatus() { | |||||
return afterStatus; | |||||
} | |||||
public void setAfterStatus(Integer afterStatus) { | |||||
this.afterStatus = afterStatus; | |||||
} | |||||
public String getEvent() { | |||||
return event; | |||||
} | |||||
public void setEvent(String event) { | |||||
this.event = event; | |||||
} | |||||
public LocalDateTime getCreateOn() { | |||||
return createOn; | |||||
} | |||||
public void setCreateOn(LocalDateTime createOn) { | |||||
this.createOn = createOn; | |||||
} | |||||
@Override | |||||
public String toString() { | |||||
return "NdProjectStatusChange{" + | |||||
"id=" + id + | |||||
", projectId=" + projectId + | |||||
", beforeStatus=" + beforeStatus + | |||||
", afterStatus=" + afterStatus + | |||||
", event=" + event + | |||||
", createOn=" + createOn + | |||||
"}"; | |||||
} | |||||
} |
@@ -0,0 +1,48 @@ | |||||
package com.ningdatech.pmapi.projectlib.model.entity; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import java.io.Serializable; | |||||
import java.time.LocalDateTime; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Builder; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
/** | |||||
* <p> | |||||
* | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-02-27 | |||||
*/ | |||||
@Data | |||||
@Builder | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
@TableName("nd_project_status_change") | |||||
@ApiModel(value = "NdProjectStatusChange对象", description = "") | |||||
public class ProjectStatusChange implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty("主键") | |||||
private Long id; | |||||
@ApiModelProperty("项目ID") | |||||
private Long projectId; | |||||
@ApiModelProperty("状态机执行前的项目状态") | |||||
private Integer beforeStatus; | |||||
@ApiModelProperty("状态机执行后的项目状态") | |||||
private Integer afterStatus; | |||||
@ApiModelProperty("状态变更对应的事件") | |||||
private String event; | |||||
@ApiModelProperty("状态变更发生的时间") | |||||
private LocalDateTime createOn; | |||||
} |
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.projectlib.service; | package com.ningdatech.pmapi.projectlib.service; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
/** | /** | ||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023-02-27 | * @since 2023-02-27 | ||||
*/ | */ | ||||
public interface INdProjectStatusChangeService extends IService<NdProjectStatusChange> { | |||||
public interface INdProjectStatusChangeService extends IService<ProjectStatusChange> { | |||||
} | } |
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.projectlib.service.impl; | package com.ningdatech.pmapi.projectlib.service.impl; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; | |||||
import com.ningdatech.pmapi.projectlib.mapper.NdProjectStatusChangeMapper; | import com.ningdatech.pmapi.projectlib.mapper.NdProjectStatusChangeMapper; | ||||
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | ||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
@@ -15,6 +15,6 @@ import org.springframework.stereotype.Service; | |||||
* @since 2023-02-27 | * @since 2023-02-27 | ||||
*/ | */ | ||||
@Service | @Service | ||||
public class NdProjectStatusChangeServiceImpl extends ServiceImpl<NdProjectStatusChangeMapper, NdProjectStatusChange> implements INdProjectStatusChangeService { | |||||
public class NdProjectStatusChangeServiceImpl extends ServiceImpl<NdProjectStatusChangeMapper, ProjectStatusChange> implements INdProjectStatusChangeService { | |||||
} | } |
@@ -6,9 +6,9 @@ import cn.hutool.core.util.IdUtil; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.google.common.collect.Maps; | import com.google.common.collect.Maps; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.pmapi.common.constant.RegionConst; | |||||
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | ||||
import com.ningdatech.pmapi.scheduler.contants.TaskContant; | import com.ningdatech.pmapi.scheduler.contants.TaskContant; | ||||
import com.ningdatech.pmapi.sys.contant.RegionConst; | |||||
import com.ningdatech.pmapi.sys.model.entity.Region; | import com.ningdatech.pmapi.sys.model.entity.Region; | ||||
import com.ningdatech.pmapi.sys.service.IRegionService; | import com.ningdatech.pmapi.sys.service.IRegionService; | ||||
import com.wflow.bean.dto.WflowModelHistorysDto; | import com.wflow.bean.dto.WflowModelHistorysDto; | ||||
@@ -53,7 +53,7 @@ public class InitProcessTask { | |||||
//1.查出丽水市下的 区县 分别去初始化 表单和流程配置数据 | //1.查出丽水市下的 区县 分别去初始化 表单和流程配置数据 | ||||
List<Region> regions = regionService.list(Wrappers.lambdaQuery(Region.class) | List<Region> regions = regionService.list(Wrappers.lambdaQuery(Region.class) | ||||
.eq(Region::getDeleted,Boolean.FALSE) | .eq(Region::getDeleted,Boolean.FALSE) | ||||
.eq(Region::getParentCode, RegionConst.LS_REGION_CODE)); | |||||
.eq(Region::getParentCode, RegionConst.RC_LS)); | |||||
if(CollUtil.isEmpty(regions)){ | if(CollUtil.isEmpty(regions)){ | ||||
throw new BizException("丽水地区数据为空 任务结束!"); | throw new BizException("丽水地区数据为空 任务结束!"); | ||||
@@ -8,7 +8,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
import com.ningdatech.pmapi.scheduler.contants.TaskContant; | import com.ningdatech.pmapi.scheduler.contants.TaskContant; | ||||
import com.ningdatech.pmapi.staging.contants.StagingContant; | import com.ningdatech.pmapi.staging.contants.StagingContant; | ||||
import com.ningdatech.pmapi.staging.model.entity.ProjectStaging; | import com.ningdatech.pmapi.staging.model.entity.ProjectStaging; | ||||
import com.ningdatech.pmapi.staging.serivice.IProjectStagingService; | |||||
import com.ningdatech.pmapi.staging.service.IProjectStagingService; | |||||
import com.ningdatech.pmapi.staging.utils.ProjectStatusFlowMapUtil; | import com.ningdatech.pmapi.staging.utils.ProjectStatusFlowMapUtil; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
@@ -0,0 +1,87 @@ | |||||
package com.ningdatech.pmapi.scheduler.task; | |||||
import java.net.InetAddress; | |||||
import java.net.UnknownHostException; | |||||
import java.time.LocalDateTime; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
import java.util.Objects; | |||||
import java.util.function.Function; | |||||
import com.ningdatech.basic.model.GenericResult; | |||||
import com.ningdatech.pmapi.staging.model.entity.WorkNoticeStaging; | |||||
import com.ningdatech.pmapi.staging.service.INdWorkNoticeStagingService; | |||||
import com.ningdatech.pmapi.staging.utils.WorkNoticeFlowMapUtil; | |||||
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; | |||||
import com.ningdatech.zwdd.client.ZwddClient; | |||||
import org.springframework.beans.BeanUtils; | |||||
import org.springframework.scheduling.annotation.Scheduled; | |||||
import org.springframework.stereotype.Component; | |||||
import com.alibaba.fastjson.JSON; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
import com.ningdatech.pmapi.scheduler.contants.TaskContant; | |||||
import com.ningdatech.pmapi.staging.contants.StagingContant; | |||||
import com.ningdatech.pmapi.staging.model.entity.ProjectStaging; | |||||
import com.ningdatech.pmapi.staging.service.IProjectStagingService; | |||||
import com.ningdatech.pmapi.staging.utils.ProjectStatusFlowMapUtil; | |||||
import cn.hutool.core.collection.CollUtil; | |||||
import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
/** | |||||
* 发送工作通知定时任务 | |||||
* @return | |||||
* @author CMM | |||||
* @since 2023/02/28 21:23 | |||||
*/ | |||||
@Slf4j | |||||
@Component | |||||
@RequiredArgsConstructor | |||||
public class WorkNoticeFlowTask { | |||||
private final INdWorkNoticeStagingService workNoticeStagingService; | |||||
private final ZwddClient zwddClient; | |||||
@Scheduled(cron = "0 */1 * * * ?") | |||||
public void statusFlow() throws UnknownHostException { | |||||
//测试暂时用自己电脑HOST | |||||
if (TaskContant.Host.HOST_CMM.equals(InetAddress.getLocalHost().getHostName())) { | |||||
//1. 定时取 工作通知暂存表的数据进行发送 | |||||
List<WorkNoticeStaging> stagingList = workNoticeStagingService.list(Wrappers.lambdaQuery(WorkNoticeStaging.class) | |||||
.eq(WorkNoticeStaging::getDead, Boolean.FALSE) | |||||
.le(WorkNoticeStaging::getNextTime, LocalDateTime.now()) | |||||
.le(WorkNoticeStaging::getRetryTimes, StagingContant.Retry.MAX_RETRY_TIMES) | |||||
.orderByAsc(WorkNoticeStaging::getId)); | |||||
log.info("需要发送的工作通知 size:{} :{}",stagingList.size(), JSON.toJSONString(stagingList)); | |||||
if(CollUtil.isEmpty(stagingList)){ | |||||
log.info("没有需要发送的工作通知!"); | |||||
return; | |||||
} | |||||
//遍历 | |||||
for(WorkNoticeStaging workNoticeStaging : stagingList){ | |||||
try{ | |||||
WorkNoticeInfo workNoticeInfo = new WorkNoticeInfo(); | |||||
BeanUtils.copyProperties(workNoticeStaging,workNoticeInfo); | |||||
String receiverUserId = workNoticeInfo.getReceiverUserId(); | |||||
String bizMsgId = workNoticeInfo.getBizMsgId(); | |||||
String msg = workNoticeInfo.getMsg(); | |||||
GenericResult<Void> result = zwddClient.sendWorkNotice(receiverUserId, bizMsgId, msg); | |||||
if (result.isSuccess()){ | |||||
//执行成功了 删除暂存的数据 | |||||
workNoticeStagingService.removeById(workNoticeStaging); | |||||
} | |||||
}catch (Exception e){ | |||||
log.error("发送工作通知 异常 bizMsgId:【" + workNoticeStaging.getBizMsgId() + "】 异常内容:" + e); | |||||
}finally { | |||||
//增加重试的次数 和下次扫描时间 | |||||
workNoticeStagingService.addRetryTimes(workNoticeStaging); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,51 @@ | |||||
package com.ningdatech.pmapi.staging.enums; | |||||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
import lombok.NoArgsConstructor; | |||||
import org.apache.commons.lang3.StringUtils; | |||||
import java.util.Objects; | |||||
/** | |||||
* 消息类型枚举 | |||||
* @author CMM | |||||
* @since 2023/02/28 17:34 | |||||
*/ | |||||
@Getter | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
public enum MsgTypeEnum { | |||||
/** | |||||
* 消息类型 | |||||
*/ | |||||
AUDIT(1, "项目审核(待审核)"), | |||||
PASS(2, "项目审核(通过)"), | |||||
REJECTED(3,"项目审核(被驳回)"), | |||||
BACKED(4,"项目审核(被退回)"), | |||||
WARING(5,"预警提醒"), | |||||
EXPORT_REVIEW(6,"专家评审"), | |||||
REVIEW_MEETING(7,"评审会议"); | |||||
private Integer code; | |||||
private String desc; | |||||
public static String getDescByCode(Integer code) { | |||||
if (Objects.isNull(code)) { | |||||
return StringUtils.EMPTY; | |||||
} | |||||
for (MsgTypeEnum t : MsgTypeEnum.values()) { | |||||
if (code.equals(t.getCode())) { | |||||
return t.desc; | |||||
} | |||||
} | |||||
return StringUtils.EMPTY; | |||||
} | |||||
public boolean eq(String val) { | |||||
return this.name().equals(val); | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
package com.ningdatech.pmapi.staging.mapper; | |||||
import com.ningdatech.pmapi.staging.model.entity.WorkNoticeStaging; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-02-28 | |||||
*/ | |||||
public interface NdWorkNoticeStagingMapper extends BaseMapper<WorkNoticeStaging> { | |||||
Boolean addRetryTimes(@Param("id") Long id, @Param("retryTimes") Integer retryTimes, | |||||
@Param("nextRetryTime") LocalDateTime nextRetryTime, @Param("dead") Boolean dead); | |||||
} |
@@ -0,0 +1,12 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.ningdatech.pmapi.staging.mapper.NdWorkNoticeStagingMapper"> | |||||
<update id="addRetryTimes"> | |||||
update nd_work_notice_staging | |||||
set retry_times = #{retryTimes}, | |||||
next_time = #{nextRetryTime}, | |||||
dead = #{dead} | |||||
where id = #{id} and retry_times = #{retryTimes - 1} | |||||
</update> | |||||
</mapper> |
@@ -0,0 +1,71 @@ | |||||
package com.ningdatech.pmapi.staging.model.entity; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import java.io.Serializable; | |||||
import java.time.LocalDateTime; | |||||
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Builder; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
/** | |||||
* <p> | |||||
* | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-02-28 | |||||
*/ | |||||
@Data | |||||
@Builder | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
@TableName("nd_work_notice_staging") | |||||
@ApiModel(value = "NdWorkNoticeStaging对象", description = "") | |||||
public class WorkNoticeStaging implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty("主键") | |||||
private Long id; | |||||
@ApiModelProperty("浙政钉用户ID") | |||||
private Long accountId; | |||||
@ApiModelProperty("部门编号") | |||||
private String organizationCode; | |||||
@ApiModelProperty("部门名称") | |||||
private String organizationName; | |||||
@ApiModelProperty("工作通知唯一标识") | |||||
private String bizMsgId; | |||||
@ApiModelProperty("接收人浙政钉ID") | |||||
private String receiverUserId; | |||||
@ApiModelProperty("工作通知内容") | |||||
private String msg; | |||||
@ApiModelProperty("重试次数 最大10次") | |||||
private Integer retryTimes; | |||||
@ApiModelProperty("false 可继续扫描 true 死信") | |||||
private Boolean dead; | |||||
@ApiModelProperty("下次扫描时间") | |||||
private LocalDateTime nextTime; | |||||
@ApiModelProperty("消息类型") | |||||
private MsgTypeEnum msgType; | |||||
@ApiModelProperty("创建时间") | |||||
private LocalDateTime createOn; | |||||
@ApiModelProperty("更新时间") | |||||
private LocalDateTime updateOn; | |||||
} |
@@ -0,0 +1,23 @@ | |||||
package com.ningdatech.pmapi.staging.service; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum; | |||||
import com.ningdatech.pmapi.staging.model.entity.ProjectStaging; | |||||
import com.ningdatech.pmapi.staging.model.entity.WorkNoticeStaging; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; | |||||
/** | |||||
* <p> | |||||
* 服务类 | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-02-28 | |||||
*/ | |||||
public interface INdWorkNoticeStagingService extends IService<WorkNoticeStaging> { | |||||
Boolean addRetryTimes(WorkNoticeStaging workNoticeStaging); | |||||
public Boolean addByWorkNotice(WorkNoticeInfo workNoticeInfo, MsgTypeEnum msgType) ; | |||||
} |
@@ -1,4 +1,4 @@ | |||||
package com.ningdatech.pmapi.staging.serivice; | |||||
package com.ningdatech.pmapi.staging.service; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; |
@@ -0,0 +1,84 @@ | |||||
package com.ningdatech.pmapi.staging.service.impl; | |||||
import com.ningdatech.pmapi.staging.contants.StagingContant; | |||||
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum; | |||||
import com.ningdatech.pmapi.staging.model.entity.ProjectStaging; | |||||
import com.ningdatech.pmapi.staging.model.entity.WorkNoticeStaging; | |||||
import com.ningdatech.pmapi.staging.mapper.NdWorkNoticeStagingMapper; | |||||
import com.ningdatech.pmapi.staging.service.INdWorkNoticeStagingService; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import com.ningdatech.pmapi.staging.utils.WorkNoticeFlowMapUtil; | |||||
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; | |||||
import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.stereotype.Service; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-02-28 | |||||
*/ | |||||
@Service | |||||
@Slf4j | |||||
@RequiredArgsConstructor | |||||
public class NdWorkNoticeStagingServiceImpl extends ServiceImpl<NdWorkNoticeStagingMapper, WorkNoticeStaging> implements INdWorkNoticeStagingService { | |||||
private final NdWorkNoticeStagingMapper mapper; | |||||
private final WorkNoticeFlowMapUtil workNoticeFlowMapUtil; | |||||
/** | |||||
* 增加 重试次数 和下次扫描时间 | |||||
* @param workNoticeStaging | |||||
* @return java.lang.Boolean | |||||
* @author CMM | |||||
* @since 2023/02/28 18:02 | |||||
*/ | |||||
@Override | |||||
public Boolean addRetryTimes(WorkNoticeStaging workNoticeStaging) { | |||||
Integer retryTimes = workNoticeStaging.getRetryTimes() + 1; | |||||
if(!workNoticeFlowMapUtil.intervalTimeMap.containsKey(retryTimes)){ | |||||
log.info("没有对应重试间隔时间 添加重试信息失败"); | |||||
return Boolean.FALSE; | |||||
} | |||||
Integer addSeconds = workNoticeFlowMapUtil.intervalTimeMap.get(retryTimes); | |||||
Boolean dead = Boolean.FALSE; | |||||
//超过重试最大次数 dead置为 true | |||||
if(retryTimes.compareTo(StagingContant.Retry.MAX_RETRY_TIMES) > 0){ | |||||
dead = Boolean.TRUE; | |||||
} | |||||
LocalDateTime nextRetryTime = LocalDateTime.now().plusSeconds(addSeconds); | |||||
return mapper.addRetryTimes(workNoticeStaging.getId(),retryTimes,nextRetryTime,dead); | |||||
} | |||||
/** | |||||
* 在对应的流程处理后,增加一个工作通知到暂存表中 | |||||
* @param workNoticeInfo | |||||
* @param msgType | |||||
* @return java.lang.Boolean | |||||
* @author CMM | |||||
* @since 2023/02/28 20:02 | |||||
*/ | |||||
@Override | |||||
public Boolean addByWorkNotice(WorkNoticeInfo workNoticeInfo, MsgTypeEnum msgType) { | |||||
WorkNoticeStaging workNoticeStaging = WorkNoticeStaging.builder() | |||||
.accountId(workNoticeInfo.getAccountId()) | |||||
.msg(workNoticeInfo.getMsg()) | |||||
.bizMsgId(workNoticeInfo.getBizMsgId()) | |||||
.organizationCode(workNoticeInfo.getOrganizationCode()) | |||||
.organizationName(workNoticeInfo.getOrganizationName()) | |||||
.receiverUserId(workNoticeInfo.getReceiverUserId()) | |||||
.msgType(msgType) | |||||
.createOn(LocalDateTime.now()) | |||||
.updateOn(LocalDateTime.now()) | |||||
.nextTime(LocalDateTime.now()) | |||||
.retryTimes(0) | |||||
.build(); | |||||
return this.save(workNoticeStaging); | |||||
} | |||||
} |