@@ -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 | |||
*/ | |||
public interface DefValConstants { | |||
public interface DefValConst { | |||
/** | |||
* 默认的根节点path | |||
@@ -30,28 +30,5 @@ public interface DefValConstants { | |||
* 字典占位符 | |||
*/ | |||
String DICT_PLACEHOLDER = "###"; | |||
/** | |||
* 浙江省的region_id | |||
*/ | |||
Long ZJREGION_ID = 116L; | |||
/** | |||
* 城市 level | |||
*/ | |||
Integer CITY_REGION_LEVEL = 2; | |||
/** | |||
* 区的 level | |||
*/ | |||
Integer QU_REGION_LEVEL = 3; | |||
/** | |||
* 驾驶员异常数据GPS字符串起始偏移量 | |||
*/ | |||
Integer GPS_START_OFFSET = 5; | |||
/** | |||
* 驾驶员异常数据GPS字符串结尾偏移量 | |||
*/ | |||
Integer GPS_END_OFFSET = 69; | |||
} |
@@ -6,7 +6,7 @@ package com.ningdatech.pmapi.common.constant; | |||
* @author CMM | |||
* @since 2023/02/01 14:49 | |||
*/ | |||
public interface DingConstant { | |||
public interface DingConst { | |||
/** | |||
* 工作通知 | |||
*/ |
@@ -1,7 +1,5 @@ | |||
package com.ningdatech.pmapi.common.constant; | |||
import io.swagger.models.auth.In; | |||
import java.math.BigDecimal; | |||
/** | |||
@@ -10,7 +8,7 @@ import java.math.BigDecimal; | |||
* @author CMM | |||
* @since 2023/01/19 10:31 | |||
*/ | |||
public interface ProjectDeclareConstants { | |||
public interface ProjectDeclareConst { | |||
/** | |||
* 基本信息 |
@@ -0,0 +1,19 @@ | |||
package com.ningdatech.pmapi.common.constant; | |||
/** | |||
* <p> | |||
* RegionLevelConst | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 13:57 2023/3/1 | |||
*/ | |||
public interface RegionLevelConst { | |||
int PROVINCE = 1; | |||
int CITY = 2; | |||
int COUNTY = 3; | |||
} |
@@ -5,7 +5,7 @@ package com.ningdatech.pmapi.common.constant; | |||
* @since 2023/02/07 16:24 | |||
*/ | |||
public class StateMachineConstants { | |||
public class StateMachineConst { | |||
public static final String PROJECT_DECLARE = "projectDeclare"; | |||
public static final String LI_SHUI_CITY_AREA_CODE = "331100"; |
@@ -1,4 +1,4 @@ | |||
package com.ningdatech.pmapi.common.constant; | |||
package com.ningdatech.pmapi.common.enumeration; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; |
@@ -0,0 +1,111 @@ | |||
package com.ningdatech.pmapi.common.helper; | |||
import com.ningdatech.pmapi.sys.model.dto.RegionDTO; | |||
import com.ningdatech.pmapi.sys.model.dto.RegionTreeDTO; | |||
import java.util.List; | |||
import java.util.Map; | |||
/** | |||
* <p> | |||
* RegionCacheHelper - | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 13:50 2023/3/1 | |||
*/ | |||
public interface RegionCacheHelper { | |||
/** | |||
* 获取完整的区域树状结构 | |||
* | |||
* @return / | |||
*/ | |||
List<RegionTreeDTO> all(); | |||
/** | |||
* 获取用于前端回显示使用的unionList 仅用于返回前端的时候使用 | |||
* | |||
* @param code 区域编码 | |||
* @param level 区域层级 | |||
* @return | |||
*/ | |||
String getUnionPathStr(String code, Integer level); | |||
/** | |||
* 原专家库数据导入使用 返回名称区域Map | |||
* | |||
* @return | |||
*/ | |||
Map<String, RegionDTO> getNameRegionMap(); | |||
/** | |||
* key.getRegionCode() + "###" + key.getRegionLevel() ,regionMap.get(key) | |||
* | |||
* @return | |||
*/ | |||
Map<String, RegionDTO> getRegionMap(); | |||
/** | |||
* 获取市级区域列表 | |||
* | |||
* @return | |||
*/ | |||
List<RegionDTO> getMunicipalRegion(); | |||
/** | |||
* 获取省级区域列表 | |||
* | |||
* @return / | |||
*/ | |||
List<RegionDTO> getProvincialRegion(); | |||
/** | |||
* 根据区域code 区域层级获取 区域类 | |||
* | |||
* @param code 区域编码 | |||
* @param level 区域层级 | |||
* @return / | |||
*/ | |||
RegionDTO getByCodeAndLevel(String code, int level); | |||
/** | |||
* 根据传入的地区code与level获取所有上层地区集合 | |||
* 按照level升序排列 | |||
* | |||
* @param code 地区编码 | |||
* @param level 地区层级 | |||
* @return / | |||
*/ | |||
List<RegionDTO> listParents(String code, int level); | |||
/** | |||
* 获取所有区域编码「parent -> child」 | |||
* | |||
* @param regionCode 区域编码 | |||
* @param regionLevel 级别 | |||
* @return / | |||
*/ | |||
List<String> getRegionCodes(String regionCode, int regionLevel); | |||
/** | |||
* 获取当前区域所有的子集 | |||
* | |||
* @param code 区域编码 | |||
* @param level 级别 | |||
* @return / | |||
*/ | |||
List<String> getAllChildrenRegionCodeList(String code, int level); | |||
/** | |||
* 获取 根节点 区域层级编码 | |||
* | |||
* @return / | |||
*/ | |||
String getParentCodeRoot(); | |||
} |
@@ -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); | |||
} |
@@ -0,0 +1,138 @@ | |||
package com.ningdatech.pmapi.common.helper.basic; | |||
import com.github.benmanes.caffeine.cache.Caffeine; | |||
import com.github.benmanes.caffeine.cache.LoadingCache; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.pmapi.common.helper.RegionCacheHelper; | |||
import com.ningdatech.pmapi.common.model.RegionMapKey; | |||
import com.ningdatech.pmapi.sys.convert.RegionConverter; | |||
import com.ningdatech.pmapi.sys.model.dto.RegionDTO; | |||
import com.ningdatech.pmapi.sys.model.dto.RegionTreeDTO; | |||
import com.ningdatech.pmapi.sys.service.IRegionService; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import org.springframework.beans.factory.InitializingBean; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import java.util.*; | |||
import java.util.concurrent.ConcurrentHashMap; | |||
import java.util.concurrent.TimeUnit; | |||
import java.util.stream.Collectors; | |||
/** | |||
* <p> | |||
* AbstractRegionCache | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 14:41 2023/3/1 | |||
*/ | |||
public abstract class AbstractRegionCache implements InitializingBean, RegionCacheHelper { | |||
@Autowired | |||
private IRegionService regionService; | |||
/** | |||
* 当前支持最大层级 | |||
*/ | |||
private static final int REGION_LEVEL_MAX = 3; | |||
private LoadingCache<String, List<RegionTreeDTO>> regionsCache; | |||
/** | |||
* 中国行政区划编码 | |||
*/ | |||
private static final String PARENT_CODE_ROOT = "100000"; | |||
protected Map<RegionMapKey, RegionDTO> regionMap; | |||
@Override | |||
public void afterPropertiesSet() { | |||
regionsCache = Caffeine.newBuilder() | |||
.expireAfterWrite(10, TimeUnit.MINUTES) | |||
.refreshAfterWrite(5, TimeUnit.MINUTES) | |||
.build(key -> { | |||
// 查询全部 | |||
List<RegionDTO> regionDTOList = regionService.all(); | |||
if (regionDTOList.isEmpty()) { | |||
throw BizException.wrap("区域元数据不能为空"); | |||
} | |||
regionMap = buildCacheMap(regionDTOList); | |||
List<RegionDTO> regionInLevel = regionMap.values().stream() | |||
.filter(regionDTO -> { | |||
// 只过滤出小于等于level的region | |||
if (Objects.isNull(regionDTO.getRegionLevel())) { | |||
return false; | |||
} | |||
return Integer.parseInt(key) >= regionDTO.getRegionLevel(); | |||
}).collect(Collectors.toList()); | |||
List<RegionTreeDTO> treeDtos = RegionConverter.toRegionTreeDTOList(regionInLevel); | |||
return toTreeStructure(treeDtos); | |||
}); | |||
warmUp(); | |||
} | |||
protected List<RegionTreeDTO> getByLevel(int level) { | |||
return regionsCache.get(String.valueOf(level)); | |||
} | |||
private Map<RegionMapKey, RegionDTO> buildCacheMap(List<RegionDTO> regionDTOList) { | |||
Map<RegionMapKey, RegionDTO> regionDtoMap = new ConcurrentHashMap<>(256); | |||
regionDTOList.forEach(region -> { | |||
RegionMapKey key = RegionMapKey.builder() | |||
.regionCode(region.getRegionCode()) | |||
.regionLevel(region.getRegionLevel()) | |||
.build(); | |||
regionDtoMap.put(key, region); | |||
}); | |||
return regionDtoMap; | |||
} | |||
private List<RegionTreeDTO> toTreeStructure(List<RegionTreeDTO> rootList) { | |||
List<RegionTreeDTO> nodeList = new ArrayList<>(); | |||
for (RegionTreeDTO treeNode : rootList) { | |||
if (PARENT_CODE_ROOT.equals(treeNode.getParentCode()) || Objects.isNull(treeNode.getParentCode())) { | |||
nodeList.add(treeNode); | |||
} | |||
treeNode.setChildren(getChildren(treeNode.getRegionCode(), treeNode.getLevel(), rootList)); | |||
} | |||
return nodeList; | |||
} | |||
private List<RegionTreeDTO> getChildren(String regionCode, int regionLevel, List<RegionTreeDTO> list) { | |||
List<RegionTreeDTO> childList = new ArrayList<>(); | |||
for (RegionTreeDTO regionTreeDTO : list) { | |||
if (regionCode.equals(regionTreeDTO.getParentCode()) && regionLevel + 1 == regionTreeDTO.getLevel()) { | |||
childList.add(regionTreeDTO); | |||
} | |||
} | |||
for (RegionTreeDTO regionTreeDTO : childList) { | |||
regionTreeDTO.setChildren(getChildren(regionTreeDTO.getRegionCode(), regionTreeDTO.getLevel(), list)); | |||
} | |||
if (CollectionUtils.isEmpty(childList)) { | |||
return Collections.emptyList(); | |||
} | |||
childList.sort(Comparator.comparing(RegionTreeDTO::getRegionCode)); | |||
return childList; | |||
} | |||
private void warmUp() { | |||
for (int level = 1; level <= REGION_LEVEL_MAX; level++) { | |||
getByLevel(level); | |||
} | |||
} | |||
protected List<RegionTreeDTO> getCopyListByLevel(int level) { | |||
List<RegionTreeDTO> regionTreeDtos = regionsCache.get(String.valueOf(level)); | |||
List<RegionTreeDTO> copyRegionTreeDtos = new ArrayList<>(); | |||
if (CollectionUtils.isNotEmpty(regionTreeDtos)) { | |||
copyRegionTreeDtos.addAll(regionTreeDtos); | |||
} | |||
return copyRegionTreeDtos; | |||
} | |||
@Override | |||
public String getParentCodeRoot() { | |||
return PARENT_CODE_ROOT; | |||
} | |||
} |
@@ -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 regionCacheHelper; | |||
protected final IExpertUserFullInfoService expertUserFullInfoService; | |||
/** | |||
* 根据 专家用户id 获取专家层级 | |||
* | |||
* @param expertUserId / | |||
* @return / | |||
*/ | |||
protected ExpertRegionInfo getExpertRegionInfo(Long expertUserId) { | |||
ExpertUserFullInfo userFullInfo = expertUserFullInfoService.getByUserId(expertUserId); | |||
if (Objects.isNull(userFullInfo)) { | |||
return new ExpertRegionInfo(); | |||
} | |||
ExpertRegionInfo regionInfo = new ExpertRegionInfo(); | |||
regionInfo.setRegionCode(userFullInfo.getRegionCode()); | |||
regionInfo.setRegionLevel(userFullInfo.getRegionLevel()); | |||
return regionInfo; | |||
} | |||
} |
@@ -0,0 +1,122 @@ | |||
package com.ningdatech.pmapi.common.helper.impl; | |||
import com.ningdatech.pmapi.common.helper.RegionCacheHelper; | |||
import com.ningdatech.pmapi.common.helper.basic.AbstractRegionLimitHelper; | |||
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; | |||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||
import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
import org.springframework.stereotype.Component; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Objects; | |||
import java.util.stream.Collectors; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/8/1 下午2:27 | |||
*/ | |||
@Component | |||
public class RegionLimitHelperImpl extends AbstractRegionLimitHelper { | |||
private static final Logger logger = LoggerFactory.getLogger(RegionLimitHelperImpl.class); | |||
public RegionLimitHelperImpl(RegionCacheHelper regionCacheHelper, IExpertUserFullInfoService expertUserFullInfoService) { | |||
super(regionCacheHelper, expertUserFullInfoService); | |||
} | |||
public static Boolean contains(Integer adminRegionLevel, List<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) { | |||
List<String> regionCodes = regionCacheHelper | |||
.getAllChildrenRegionCodeList(regionCode, regionLevel); | |||
RegionContainsBO regionContainsBO = new RegionContainsBO(); | |||
regionContainsBO.setContainsRegionCodeList(regionCodes); | |||
regionContainsBO.setParentRegionTreeLevel(regionLevel); | |||
return regionContainsBO; | |||
} | |||
@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,205 @@ | |||
package com.ningdatech.pmapi.common.helper.impl; | |||
import cn.hutool.core.lang.Assert; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.common.helper.basic.AbstractRegionCache; | |||
import com.ningdatech.pmapi.common.model.RegionMapKey; | |||
import com.ningdatech.pmapi.sys.model.dto.RegionDTO; | |||
import com.ningdatech.pmapi.sys.model.dto.RegionTreeDTO; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.stereotype.Component; | |||
import java.util.*; | |||
import java.util.concurrent.ConcurrentHashMap; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/22 上午8:58 | |||
* 构建地区码 地区树 | |||
*/ | |||
@Slf4j | |||
@Component | |||
public class RegionsCacheImpl extends AbstractRegionCache { | |||
@Override | |||
public List<RegionTreeDTO> all() { | |||
return getByLevel(3); | |||
} | |||
@Override | |||
public List<String> getAllChildrenRegionCodeList(String code, int level) { | |||
List<RegionTreeDTO> regionTreeDTOList = all(); | |||
Set<String> childrenRegionCodeSet = new HashSet<>(); | |||
childrenRegionCodeSet.add(code); | |||
RegionTreeDTO currentRegionTree = getCurrentRegionTree(code, level, regionTreeDTOList); | |||
if (Objects.isNull(currentRegionTree)) { | |||
List<String> childrenRegionCodeList = new ArrayList<>(); | |||
childrenRegionCodeList.add(code); | |||
return childrenRegionCodeList; | |||
} | |||
getAllChildrenRegionCodeList(currentRegionTree.getChildren(), childrenRegionCodeSet); | |||
return new ArrayList<>(childrenRegionCodeSet); | |||
} | |||
private RegionTreeDTO getCurrentRegionTree(String code, int level, List<RegionTreeDTO> regionTreeDtos) { | |||
for (RegionTreeDTO regionTreeDTO : regionTreeDtos) { | |||
if (level == regionTreeDTO.getLevel() && code.equals(regionTreeDTO.getRegionCode())) { | |||
return regionTreeDTO; | |||
} | |||
if (CollectionUtils.isNotEmpty(regionTreeDTO.getChildren())) { | |||
return getCurrentRegionTree(code, level, regionTreeDTO.getChildren()); | |||
} | |||
} | |||
return null; | |||
} | |||
private void getAllChildrenRegionCodeList(List<RegionTreeDTO> regionTreeDtos, Set<String> childrenRegionCodeSet) { | |||
if (CollectionUtils.isEmpty(regionTreeDtos)) { | |||
return; | |||
} | |||
for (RegionTreeDTO regionTreeDTO : regionTreeDtos) { | |||
childrenRegionCodeSet.add(regionTreeDTO.getRegionCode()); | |||
getAllChildrenRegionCodeList(regionTreeDTO.getChildren(), childrenRegionCodeSet); | |||
} | |||
} | |||
@Override | |||
public List<String> getRegionCodes(String regionCode, int regionLevel) { | |||
RegionTreeDTO regionTreeNode = getTreeByRegionAndCode(null, regionCode, regionLevel); | |||
Assert.notNull(regionTreeNode, "不存在此级别区域信息:{}", regionLevel); | |||
List<String> regionCodes = new ArrayList<>(); | |||
if (regionTreeNode != null) { | |||
regionCodes.addAll(CollUtils.fieldList(treeToList(Collections.singletonList(regionTreeNode)), RegionTreeDTO::getRegionCode)); | |||
} | |||
if (!regionCodes.contains(regionCode)) { | |||
regionCodes.add(regionCode); | |||
} | |||
return regionCodes; | |||
} | |||
protected List<RegionTreeDTO> treeToList(List<RegionTreeDTO> treeList) { | |||
ArrayList<RegionTreeDTO> result = new ArrayList<>(); | |||
treeList.forEach(w -> { | |||
result.add(w); | |||
if (CollectionUtils.isNotEmpty(w.getChildren())) { | |||
result.addAll(treeToList(w.getChildren())); | |||
} | |||
}); | |||
return result; | |||
} | |||
/** | |||
* 获取某一个地区开始的层级树 | |||
* | |||
* @param list 地区集合 | |||
* @param code 地区编码 | |||
* @param level 地区层级 | |||
* @return / | |||
*/ | |||
protected RegionTreeDTO getTreeByRegionAndCode(List<RegionTreeDTO> list, String code, int level) { | |||
if (CollectionUtils.isEmpty(list)) { | |||
list = super.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 = regionMap.get(RegionMapKey.of(code, level)); | |||
result.add(0, dto); | |||
if (dto.getParentCode().equals(super.getParentCodeRoot())) { | |||
return result; | |||
} | |||
result.addAll(0, listParents(dto.getParentCode(), dto.getRegionLevel() - 1)); | |||
return result; | |||
} | |||
@Override | |||
public RegionDTO getByCodeAndLevel(String code, int level) { | |||
return regionMap.get(RegionMapKey.of(code, level)); | |||
} | |||
@Override | |||
public List<RegionDTO> getProvincialRegion() { | |||
List<RegionDTO> provincialRegionList = new ArrayList<>(); | |||
regionMap.values().forEach(v -> { | |||
if (v.getRegionCode().equals(v.getParentCode()) && v.getRegionLevel() == 2) { | |||
provincialRegionList.add(v); | |||
} | |||
}); | |||
return provincialRegionList; | |||
} | |||
@Override | |||
public List<RegionDTO> getMunicipalRegion() { | |||
List<RegionDTO> municipalRegionList = new ArrayList<>(); | |||
regionMap.values().forEach(v -> { | |||
if (v.getRegionCode().equals(v.getParentCode()) && v.getRegionLevel() == 3) { | |||
municipalRegionList.add(v); | |||
} | |||
}); | |||
return municipalRegionList; | |||
} | |||
@Override | |||
public Map<String, RegionDTO> getRegionMap() { | |||
Map<String, RegionDTO> regionDtoMap = new ConcurrentHashMap<>(512); | |||
regionMap.forEach((k, v) -> regionDtoMap.put(k.getRegionCode() + "###" + k.getRegionLevel(), v)); | |||
return regionDtoMap; | |||
} | |||
@Override | |||
public Map<String, RegionDTO> getNameRegionMap() { | |||
Map<String, RegionDTO> nameRegionDtoMap = new ConcurrentHashMap<>(512); | |||
regionMap.forEach((k, v) -> nameRegionDtoMap.put(v.getRegionName(), v)); | |||
return nameRegionDtoMap; | |||
} | |||
@Override | |||
public String getUnionPathStr(String code, Integer level) { | |||
if (StringUtils.isBlank(code) || Objects.isNull(level)) { | |||
return null; | |||
} | |||
List<String> unionPathStrList = new ArrayList<>(); | |||
buildUnionPathStrList(code, level, unionPathStrList); | |||
Collections.reverse(unionPathStrList); | |||
if (CollectionUtils.isEmpty(unionPathStrList)) { | |||
return null; | |||
} | |||
return String.join("@@", unionPathStrList); | |||
} | |||
protected void buildUnionPathStrList(String code, Integer level, List<String> unionPathStrList) { | |||
if (level <= 0 || super.getParentCodeRoot().equals(code)) { | |||
return; | |||
} | |||
RegionDTO regionDTO = regionMap.get(RegionMapKey.of(code, level)); | |||
unionPathStrList.add(regionDTO.getRegionCode() + "##" + regionDTO.getRegionName() + "##" + regionDTO.getRegionLevel()); | |||
if (!super.getParentCodeRoot().equals(regionDTO.getParentCode())) { | |||
buildUnionPathStrList(regionDTO.getParentCode(), level - 1, unionPathStrList); | |||
} | |||
} | |||
} |
@@ -0,0 +1,59 @@ | |||
package com.ningdatech.pmapi.common.model; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Builder; | |||
import lombok.Data; | |||
import lombok.experimental.Tolerate; | |||
import java.util.Objects; | |||
/** | |||
* <p> | |||
* RegionMapKey | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 13:54 2023/3/1 | |||
*/ | |||
@Data | |||
@Builder | |||
@AllArgsConstructor | |||
public class RegionMapKey { | |||
public static RegionMapKey of(String regionCode, int regionLevel) { | |||
return new RegionMapKey(regionCode, regionLevel); | |||
} | |||
@Tolerate | |||
public RegionMapKey() { | |||
} | |||
/** | |||
* 区域码 | |||
*/ | |||
private String regionCode; | |||
/** | |||
* 地区级别 | |||
*/ | |||
private Integer regionLevel; | |||
@Override | |||
public boolean equals(Object o) { | |||
if (this == o) { | |||
return true; | |||
} | |||
if (o == null || getClass() != o.getClass()) { | |||
return false; | |||
} | |||
RegionMapKey regionMapKey = (RegionMapKey) o; | |||
return regionCode.equals(regionMapKey.getRegionCode()) && | |||
regionLevel.equals(regionMapKey.getRegionLevel()); | |||
} | |||
@Override | |||
public int hashCode() { | |||
return Objects.hash(regionCode, regionLevel); | |||
} | |||
} |
@@ -1,6 +1,6 @@ | |||
package com.ningdatech.pmapi.common.statemachine.action; | |||
import com.ningdatech.pmapi.common.constant.StateMachineConstants; | |||
import com.ningdatech.pmapi.common.constant.StateMachineConst; | |||
import com.ningdatech.pmapi.common.statemachine.builder.ProjectDeclareStateMachineBuilder; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
@@ -23,7 +23,7 @@ import org.springframework.statemachine.annotation.WithStateMachine; | |||
@WithStateMachine(id = ProjectDeclareStateMachineBuilder.MACHINEID_TO) | |||
public class ProjectDeclareAction { | |||
private static final String PROJECT_DECLARE = StateMachineConstants.PROJECT_DECLARE; | |||
private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | |||
@OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION") | |||
public void UNDER_INTERNAL_PASS(Message<ProjectStatusChangeEvent> message) { | |||
@@ -1,6 +1,6 @@ | |||
package com.ningdatech.pmapi.common.statemachine.action; | |||
import com.ningdatech.pmapi.common.constant.StateMachineConstants; | |||
import com.ningdatech.pmapi.common.constant.StateMachineConst; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
@@ -18,7 +18,7 @@ import org.springframework.statemachine.action.Action; | |||
@Slf4j | |||
public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, ProjectStatusChangeEvent> { | |||
private static final String PROJECT_DECLARE = StateMachineConstants.PROJECT_DECLARE; | |||
private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | |||
@Override | |||
public void execute(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | |||
@@ -1,6 +1,6 @@ | |||
package com.ningdatech.pmapi.common.statemachine.factory; | |||
import com.ningdatech.pmapi.common.constant.StateMachineConstants; | |||
import com.ningdatech.pmapi.common.constant.StateMachineConst; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
@@ -16,7 +16,7 @@ import org.springframework.statemachine.guard.Guard; | |||
*/ | |||
public class ProjectDeclareGuardFactory { | |||
private static final String PROJECT_DECLARE = StateMachineConstants.PROJECT_DECLARE; | |||
private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | |||
public class PendingPreQualificationChoiceGuard implements Guard<ProjectStatusEnum, ProjectStatusChangeEvent> { | |||
@Override | |||
@@ -1,8 +1,8 @@ | |||
package com.ningdatech.pmapi.common.statemachine.util; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.pmapi.common.constant.ProjectDeclareConstants; | |||
import com.ningdatech.pmapi.common.constant.StateMachineConstants; | |||
import com.ningdatech.pmapi.common.constant.ProjectDeclareConst; | |||
import com.ningdatech.pmapi.common.constant.StateMachineConst; | |||
import com.ningdatech.pmapi.common.statemachine.builder.ProjectDeclareStateMachineBuilder; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
@@ -32,7 +32,7 @@ import java.util.Objects; | |||
@RequiredArgsConstructor | |||
public class StateMachineUtils { | |||
private static final String PROJECT_DECLARE = StateMachineConstants.PROJECT_DECLARE; | |||
private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | |||
private final ProjectDeclareStateMachineBuilder projectDeclareStateMachineBuilder; | |||
@@ -70,7 +70,7 @@ public class StateMachineUtils { | |||
* @since 2023/02/07 17:13 | |||
*/ | |||
public static boolean judgeDeclareAmount(Project project) { | |||
int flag = project.getDeclareAmount().compareTo(ProjectDeclareConstants.Number.DECLARE_AMOUNT_JUDGEMENT); | |||
int flag = project.getDeclareAmount().compareTo(ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT); | |||
if (flag > 0 || flag == 0) { | |||
return true; | |||
} | |||
@@ -87,7 +87,7 @@ public class StateMachineUtils { | |||
*/ | |||
public static boolean isCityProject(Project project) { | |||
String areaCode = project.getAreaCode(); | |||
if (areaCode.equals(StateMachineConstants.LI_SHUI_CITY_AREA_CODE)) { | |||
if (areaCode.equals(StateMachineConst.LI_SHUI_CITY_AREA_CODE)) { | |||
return true; | |||
} | |||
return false; | |||
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.pmapi.common.constant.BoolDisplayEnum; | |||
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; | |||
import com.ningdatech.pmapi.expert.assembler.ExpertUserInfoAssembler; | |||
import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; | |||
import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum; | |||
@@ -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.EqualsAndHashCode; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
/** | |||
@@ -57,25 +56,25 @@ public class ExpertInviteDetailVO { | |||
} | |||
@ApiModelProperty("参与数量总计") | |||
private Integer attendTotal = 0; | |||
private Integer attendTotal; | |||
@ApiModelProperty("随机邀请参与数量") | |||
private Integer randomAttend = 0; | |||
private Integer randomAttend; | |||
@ApiModelProperty("指定邀请参与数量") | |||
private Integer appointAttend = 0; | |||
private Integer appointAttend; | |||
@ApiModelProperty("是否已停止邀请") | |||
private Boolean invitedStopped; | |||
@ApiModelProperty("最终参与名单") | |||
private List<ExpertAttendListItemVO> attendList = new ArrayList<>(); | |||
private List<ExpertAttendListItemVO> attendList; | |||
@ApiModelProperty("随机邀请名单") | |||
private List<RandomInviteListItemVO> randomInviteList = new ArrayList<>(); | |||
private List<RandomInviteListItemVO> randomInviteList; | |||
@ApiModelProperty("指定邀请名单") | |||
private List<RandomInviteListItemVO> appointInviteList = new ArrayList<>(); | |||
private List<RandomInviteListItemVO> appointInviteList; | |||
public void addAttendList(ExpertAttendListItemVO attend) { | |||
this.attendList.add(attend); | |||
@@ -16,59 +16,15 @@ import java.util.List; | |||
@Data | |||
public class InviteRuleDetailVO { | |||
@ApiModelProperty("是否创建邀请规则") | |||
private Boolean invited; | |||
private Integer inviteType; | |||
@ApiModelProperty("随机邀请规则") | |||
private List<RandomInviteRuleVO> randomRules; | |||
@ApiModelProperty("是否有指定抽取规则") | |||
private Boolean hasAppointRule; | |||
@ApiModelProperty("指定抽取规则") | |||
private AppointRuleVo appointRule; | |||
@ApiModelProperty("是否有回避规则") | |||
private Boolean hasAvoidInfo; | |||
private AppointRuleVO appointRule; | |||
@ApiModelProperty("回避信息") | |||
private AvoidInfoVo avoidInfo; | |||
@Data | |||
public static class AvoidInfoVo { | |||
private List<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; | |||
import com.alibaba.fastjson.annotation.JSONField; | |||
import com.ningdatech.file.entity.vo.result.AttachFileVo; | |||
import com.ningdatech.pmapi.sys.model.dto.RegionDTO; | |||
import com.ningdatech.pmapi.meeting.entity.req.ExpertInviteReq; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Builder; | |||
@@ -10,7 +9,6 @@ import lombok.Data; | |||
import lombok.experimental.Tolerate; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
/** | |||
* <p> | |||
@@ -29,35 +27,36 @@ public class MeetingDetailBasicVO { | |||
public MeetingDetailBasicVO() { | |||
} | |||
private Long id; | |||
private Long meetingId; | |||
@ApiModelProperty("会议名称") | |||
private String name; | |||
private String meetingName; | |||
@ApiModelProperty("会议类型名称") | |||
private String typeName; | |||
@ApiModelProperty("会议类型代码") | |||
private String type; | |||
private String meetingType; | |||
@ApiModelProperty("开始时间") | |||
@JSONField(format = "yyyy-MM-dd HH:mm") | |||
private LocalDateTime startTime; | |||
@ApiModelProperty("结束时间") | |||
@ApiModelProperty("评委到场时间") | |||
@JSONField(format = "yyyy-MM-dd HH:mm") | |||
private LocalDateTime endTime; | |||
private LocalDateTime judgesAttendanceTime; | |||
@ApiModelProperty("会议耗时") | |||
private Integer meetingUsageTime; | |||
@ApiModelProperty("联系人") | |||
private String connecter; | |||
@ApiModelProperty("创建人") | |||
private String author; | |||
private List<RegionDTO> regions; | |||
private String creator; | |||
@ApiModelProperty("地点") | |||
private String address; | |||
@ApiModelProperty("评审地点") | |||
private String meetingAddress; | |||
@ApiModelProperty("联系方式") | |||
private String contact; | |||
@@ -65,33 +64,19 @@ public class MeetingDetailBasicVO { | |||
@ApiModelProperty("创建时间") | |||
private LocalDateTime createOn; | |||
@ApiModelProperty("会议说明") | |||
private String description; | |||
@ApiModelProperty("相关材料") | |||
private List<AttachFileVo> attachments; | |||
@ApiModelProperty("备注") | |||
private String remark; | |||
@ApiModelProperty("会议状态") | |||
private Integer status; | |||
@ApiModelProperty("专家出席状态") | |||
private Integer attendStatus; | |||
@ApiModelProperty("取消说明") | |||
private String cancelRemark; | |||
@ApiModelProperty("创建人") | |||
private String createBy; | |||
private Boolean invited; | |||
@ApiModelProperty("抽取单位") | |||
private String holdOrg; | |||
@ApiModelProperty("是否已确认下发会议通知名单") | |||
private Boolean sendMeetingNotice; | |||
@ApiModelProperty("抽取信息") | |||
private InviteRuleDetailVO inviteRule; | |||
} |
@@ -17,6 +17,7 @@ import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.basic.util.ValidUtil; | |||
import com.ningdatech.cache.lock.DistributedLock; | |||
import com.ningdatech.file.service.FileService; | |||
import com.ningdatech.pmapi.common.helper.RegionCacheHelper; | |||
import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; | |||
import com.ningdatech.pmapi.expert.helper.PermissionCheckHelper; | |||
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; | |||
@@ -64,6 +65,7 @@ import static com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper.getExpertIn | |||
@RequiredArgsConstructor | |||
public class MeetingManage { | |||
private final RegionCacheHelper regionCacheHelper; | |||
private final IMeetingService meetingService; | |||
private final IExpertInviteAvoidRuleService inviteAvoidRuleService; | |||
private final IExpertInviteRuleService inviteRuleService; | |||
@@ -306,32 +308,23 @@ public class MeetingManage { | |||
public MeetingDetailBasicVO getMeetingBasicInfo(Long meetingId) { | |||
Meeting meeting = meetingService.getById(meetingId); | |||
if (Objects.isNull(meeting)) { | |||
throw new BizException("该会议信息不存在"); | |||
} | |||
Integer attendStatus = null; | |||
if (LoginUserUtil.isExpert()) { | |||
List<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)); | |||
} | |||
Assert.notNull(meeting, "会议不存在"); | |||
return MeetingDetailBasicVO.builder() | |||
.id(meeting.getId()) | |||
.name(meeting.getName()) | |||
.type(meeting.getType()) | |||
.meetingId(meeting.getId()) | |||
.meetingName(meeting.getName()) | |||
.meetingType(meeting.getType()) | |||
.meetingAddress(meeting.getMeetingAddress()) | |||
.typeName(dictionaryCache.getByCode(meeting.getType()).getName()) | |||
.author(meeting.getCreator()) | |||
.startTime(meeting.getStartTime()) | |||
.createOn(meeting.getCreateOn()) | |||
.judgesAttendanceTime(meeting.getJudgesAttendanceTime()) | |||
.meetingUsageTime(meeting.getMeetingUsageTime()) | |||
.contact(meeting.getContact()) | |||
.connecter(meeting.getConnecter()) | |||
.status(meeting.getStatus()) | |||
.attendStatus(attendStatus) | |||
.createBy(meeting.getCreator()) | |||
.holdOrg(meeting.getHoldOrg()) | |||
.createOn(meeting.getCreateOn()) | |||
.creator(meeting.getCreator()) | |||
.createBy(meeting.getCreator()) | |||
.build(); | |||
} | |||
@@ -441,9 +434,6 @@ public class MeetingManage { | |||
public InviteRuleDetailVO inviteRuleDetail(Long meetingId) { | |||
InviteRuleDetailVO result = new InviteRuleDetailVO(); | |||
List<ExpertInviteRule> inviteRules = inviteRuleService.listByMeetingId(meetingId); | |||
if (!result.setAndGetInvited(inviteRules.size() > 0)) { | |||
return result; | |||
} | |||
result.setRandomRules(new ArrayList<>()); | |||
Map<ExpertInviteTypeEnum, List<ExpertInviteRule>> groupByType = CollUtils.group(inviteRules, w -> ExpertInviteTypeEnum.getByCode(w.getInviteType())); | |||
List<ExpertInviteRule> randoms = groupByType.get(ExpertInviteTypeEnum.RANDOM); | |||
@@ -474,25 +464,22 @@ public class MeetingManage { | |||
} | |||
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.setAvoidUnitIds(avoidInfo.getAvoidUnitIdList()); | |||
if (CollUtil.isNotEmpty(avoidInfo.getExpertIds())) { | |||
vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values())); | |||
} | |||
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; | |||
} | |||
@@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.common.constant.BoolDisplayEnum; | |||
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; | |||
import com.ningdatech.pmapi.common.util.BizUtils; | |||
import com.ningdatech.pmapi.meta.assembler.MetaDictionaryAssembler; | |||
import com.ningdatech.pmapi.meta.assembler.MetaTagAssembler; | |||
@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; | |||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | |||
@@ -14,7 +13,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
import org.springframework.core.annotation.Order; | |||
import org.springframework.stereotype.Component; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | |||
@@ -63,7 +62,7 @@ public class AnnualPlanHandle extends AbstractProcessBusinessHandle { | |||
// 项目状态为年度计划中之前的状态 | |||
if (fieldList.contains(status)){ | |||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | |||
processDetailVO.setProcessName(CommonConstant.ANNUAL_PLAN); | |||
processDetailVO.setProcessName(CommonConst.ANNUAL_PLAN); | |||
processSchedule.add(processDetailVO); | |||
return; | |||
} | |||
@@ -95,7 +94,7 @@ public class AnnualPlanHandle extends AbstractProcessBusinessHandle { | |||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | |||
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | |||
} | |||
processDetailVO.setProcessName(CommonConstant.ANNUAL_PLAN); | |||
processDetailVO.setProcessName(CommonConst.ANNUAL_PLAN); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -7,7 +7,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
import org.springframework.core.annotation.Order; | |||
import org.springframework.stereotype.Component; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | |||
@@ -41,7 +41,7 @@ public class ArchivedHandle extends AbstractProcessBusinessHandle { | |||
// 项目阶段不为已归档 | |||
if (!ProjectStatusEnum.ARCHIVED.getCode().equals(status)){ | |||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | |||
processDetailVO.setProcessName(CommonConstant.ARCHIVED); | |||
processDetailVO.setProcessName(CommonConst.ARCHIVED); | |||
processSchedule.add(processDetailVO); | |||
return; | |||
} | |||
@@ -53,7 +53,7 @@ public class ArchivedHandle extends AbstractProcessBusinessHandle { | |||
.eq(NdProjectStatusChange::getEvent, ProjectStatusChangeEvent.FINAL_ACCEPTANCE_PASS.name()) | |||
.last("limit 1")); | |||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | |||
processDetailVO.setProcessName(CommonConstant.ARCHIVED); | |||
processDetailVO.setProcessName(CommonConst.ARCHIVED); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -11,7 +11,7 @@ import org.springframework.core.annotation.Order; | |||
import org.springframework.stereotype.Component; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | |||
@@ -51,7 +51,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle | |||
if (Objects.isNull(projectInst)){ | |||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | |||
processDetailVO.setProcessName(CommonConstant.CONSTRUCTION_PLAN_REVIEW); | |||
processDetailVO.setProcessName(CommonConst.CONSTRUCTION_PLAN_REVIEW); | |||
processSchedule.add(processDetailVO); | |||
return; | |||
} | |||
@@ -76,7 +76,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle | |||
processDetailVO.setFinishTime(finishTime); | |||
} | |||
processDetailVO.setProcessProgressVo(instanceDetail); | |||
processDetailVO.setProcessName(CommonConstant.CONSTRUCTION_PLAN_REVIEW); | |||
processDetailVO.setProcessName(CommonConst.CONSTRUCTION_PLAN_REVIEW); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -11,7 +11,7 @@ import org.springframework.core.annotation.Order; | |||
import org.springframework.stereotype.Component; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | |||
@@ -50,7 +50,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { | |||
.last("limit 1")); | |||
if (Objects.isNull(projectInst)){ | |||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | |||
processDetailVO.setProcessName(CommonConstant.DEPT_UNITED_REVIEW); | |||
processDetailVO.setProcessName(CommonConst.DEPT_UNITED_REVIEW); | |||
processSchedule.add(processDetailVO); | |||
return; | |||
} | |||
@@ -74,7 +74,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { | |||
processDetailVO.setFinishTime(finishTime); | |||
} | |||
processDetailVO.setProcessProgressVo(instanceDetail); | |||
processDetailVO.setProcessName(CommonConstant.DEPT_UNITED_REVIEW); | |||
processDetailVO.setProcessName(CommonConst.DEPT_UNITED_REVIEW); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -3,7 +3,7 @@ package com.ningdatech.pmapi.projectlib.handle; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.google.common.collect.Lists; | |||
import com.ningdatech.basic.util.NdDateUtils; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | |||
@@ -49,7 +49,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { | |||
.last("limit 1")); | |||
if (Objects.isNull(projectInst)){ | |||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | |||
processDetailVO.setProcessName(CommonConstant.PRELIMINARY_PREVIEW); | |||
processDetailVO.setProcessName(CommonConst.PRELIMINARY_PREVIEW); | |||
processSchedule.add(processDetailVO); | |||
return; | |||
} | |||
@@ -73,7 +73,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { | |||
processDetailVO.setFinishTime(finishTime); | |||
} | |||
processDetailVO.setProcessProgressVo(instanceDetail); | |||
processDetailVO.setProcessName(CommonConstant.PRELIMINARY_PREVIEW); | |||
processDetailVO.setProcessName(CommonConst.PRELIMINARY_PREVIEW); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -3,24 +3,19 @@ package com.ningdatech.pmapi.projectlib.handle; | |||
import java.time.LocalDate; | |||
import java.time.LocalDateTime; | |||
import java.util.*; | |||
import java.util.stream.Collectors; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.basic.util.NdDateUtils; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import org.springframework.core.annotation.Order; | |||
import org.springframework.stereotype.Component; | |||
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.projectlib.enumeration.ProjectStatusEnum; | |||
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.req.ProjectListReq; | |||
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; | |||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | |||
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
@@ -78,7 +73,7 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { | |||
// 项目状态为待立项批复之前的状态 | |||
if (fieldList.contains(status)){ | |||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | |||
processDetailVO.setProcessName(CommonConstant.PROJECT_APPROVAL); | |||
processDetailVO.setProcessName(CommonConst.PROJECT_APPROVAL); | |||
processSchedule.add(processDetailVO); | |||
return; | |||
} | |||
@@ -101,7 +96,7 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { | |||
processDetailVO.setFinishTime(approvalDateTime); | |||
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | |||
} | |||
processDetailVO.setProcessName(CommonConstant.PROJECT_APPROVAL); | |||
processDetailVO.setProcessName(CommonConst.PROJECT_APPROVAL); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -1,6 +1,6 @@ | |||
package com.ningdatech.pmapi.projectlib.handle; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | |||
@@ -37,7 +37,7 @@ public class ProjectDeclareHandle extends AbstractProcessBusinessHandle { | |||
Project project = projectService.getById(projectId); | |||
LocalDateTime createOn = project.getCreateOn(); | |||
processDetailVO.setFinishTime(createOn); | |||
processDetailVO.setProcessName(CommonConstant.PROJECT_DECLARE); | |||
processDetailVO.setProcessName(CommonConst.PROJECT_DECLARE); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -15,7 +15,7 @@ import com.wflow.workflow.service.ProcessInstanceService; | |||
import org.springframework.core.annotation.Order; | |||
import org.springframework.stereotype.Component; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | |||
@@ -50,7 +50,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle | |||
if (Objects.isNull(projectInst)){ | |||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | |||
processDetailVO.setProcessName(CommonConstant.PROJECT_FINAL_INSPECTION); | |||
processDetailVO.setProcessName(CommonConst.PROJECT_FINAL_INSPECTION); | |||
processSchedule.add(processDetailVO); | |||
return; | |||
} | |||
@@ -76,7 +76,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle | |||
processDetailVO.setFinishTime(finishTime); | |||
} | |||
processDetailVO.setProcessProgressVo(instanceDetail); | |||
processDetailVO.setProcessName(CommonConstant.PRELIMINARY_PREVIEW); | |||
processDetailVO.setProcessName(CommonConst.PRELIMINARY_PREVIEW); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -4,18 +4,16 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
import java.util.Objects; | |||
import org.springframework.core.annotation.Order; | |||
import org.springframework.stereotype.Component; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; | |||
import com.ningdatech.pmapi.projectlib.model.entity.NdProjectStatusChange; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | |||
@@ -60,7 +58,7 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH | |||
// 项目状态不在建设中及之后的状态 | |||
if (!fieldList.contains(status)){ | |||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | |||
processDetailVO.setProcessName(CommonConstant.PROJECT_PRELIMINARY_INSPECTION); | |||
processDetailVO.setProcessName(CommonConst.PROJECT_PRELIMINARY_INSPECTION); | |||
processSchedule.add(processDetailVO); | |||
return; | |||
} | |||
@@ -76,7 +74,7 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH | |||
.last("limit 1")); | |||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | |||
} | |||
processDetailVO.setProcessName(CommonConstant.TENDER_PURCHASE); | |||
processDetailVO.setProcessName(CommonConst.TENDER_PURCHASE); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -2,26 +2,19 @@ package com.ningdatech.pmapi.projectlib.handle; | |||
import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; | |||
import java.time.LocalDate; | |||
import java.time.LocalDateTime; | |||
import java.util.*; | |||
import java.util.stream.Collectors; | |||
import org.springframework.core.annotation.Order; | |||
import org.springframework.stereotype.Component; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
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.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.service.INdProjectStatusChangeService; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
@@ -63,7 +56,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { | |||
// 未进行立项批复 | |||
if (Objects.isNull(project.getApprovalDate())){ | |||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | |||
processDetailVO.setProcessName(CommonConstant.TENDER_PURCHASE); | |||
processDetailVO.setProcessName(CommonConst.TENDER_PURCHASE); | |||
processSchedule.add(processDetailVO); | |||
return; | |||
} | |||
@@ -80,7 +73,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { | |||
.last("limit 1")); | |||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | |||
} | |||
processDetailVO.setProcessName(CommonConstant.TENDER_PURCHASE); | |||
processDetailVO.setProcessName(CommonConst.TENDER_PURCHASE); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -10,7 +10,7 @@ import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO; | |||
import com.wflow.workflow.bean.process.ProgressNode; | |||
@@ -69,7 +69,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { | |||
processDetailVO.setFinishTime(finishTime); | |||
} | |||
processDetailVO.setProcessProgressVo(instanceDetail); | |||
processDetailVO.setProcessName(CommonConstant.UNIT_INNER_AUDIT); | |||
processDetailVO.setProcessName(CommonConst.UNIT_INNER_AUDIT); | |||
processSchedule.add(processDetailVO); | |||
} | |||
} |
@@ -12,7 +12,7 @@ import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.basic.util.ValidUtil; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
@@ -217,8 +217,8 @@ public class AnnualPlanLibManage { | |||
} | |||
public void exportList(ProjectListReq param, HttpServletResponse response) { | |||
param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); | |||
param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); | |||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param); | |||
Integer isTemporaryAugment = param.getIsTemporaryAugment(); | |||
if (Objects.isNull(isTemporaryAugment)){ | |||
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.google.common.collect.Lists; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; | |||
import com.ningdatech.pmapi.common.util.ExcelDownUtil; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
@@ -135,8 +135,8 @@ public class ProjectLibManage { | |||
} | |||
public void exportList(ProjectListReq param, HttpServletResponse response) { | |||
param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); | |||
param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); | |||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param); | |||
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.util.CollUtils; | |||
import com.ningdatech.basic.util.NdDateUtils; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.common.util.ExcelDownUtil; | |||
import com.ningdatech.pmapi.common.util.ExcelExportStyle; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum; | |||
@@ -167,8 +167,8 @@ public class ProjectRenewalFundManage { | |||
public void exportList(HttpServletResponse response, ProjectRenewalListReq param) { | |||
param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); | |||
param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); | |||
Page<ProjectRenewalFundDeclarationPO> page = param.page(); | |||
projectRenewalFundDeclarationService.pageSql(page, param); | |||
List<ProjectRenewalFundDeclarationPO> records = page.getRecords(); | |||
@@ -27,7 +27,7 @@ public class RegionManage { | |||
private final static Long ROOT_PARENT_ID = 0L; | |||
public List<RegionTreeVO> getRegionTree() { | |||
List<RegionDTO> regions = regionService.queryAll(); | |||
List<RegionDTO> regions = regionService.all(); | |||
Map<Long, List<RegionDTO>> regionMap = CollUtils.group(regions, RegionDTO::getParentId); | |||
return RegionConverter.toRegionTree(ROOT_PARENT_ID, regionMap, false); | |||
} | |||
@@ -21,7 +21,7 @@ public interface IRegionService extends IService<Region> { | |||
* | |||
* @return 所有区域 | |||
*/ | |||
List<RegionDTO> queryAll(); | |||
List<RegionDTO> all(); | |||
/** | |||
* 查询大于等与该级别的所有区域 | |||
@@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.google.common.collect.Lists; | |||
import com.ningdatech.basic.exception.BaseUncheckedException; | |||
import com.ningdatech.basic.util.ValidatorUtil; | |||
import com.ningdatech.pmapi.common.constant.DefValConstants; | |||
import com.ningdatech.pmapi.common.constant.DefValConst; | |||
import com.ningdatech.pmapi.sys.model.entity.Menu; | |||
import com.ningdatech.pmapi.sys.model.enumeration.MenuTypeEnum; | |||
import com.ningdatech.pmapi.sys.model.dto.MenuSaveDTO; | |||
@@ -141,7 +141,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IM | |||
private void fill(Menu resource) { | |||
if (resource.getPid() == null || resource.getPid() <= 0) { | |||
resource.setPid(DefValConstants.PARENT_ID); | |||
resource.setPid(DefValConst.PARENT_ID); | |||
} else { | |||
Menu parent = getById(resource.getPid()); | |||
if (Objects.isNull(parent)) { | |||
@@ -24,9 +24,8 @@ import java.util.List; | |||
public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements IRegionService { | |||
@Override | |||
public List<RegionDTO> queryAll() { | |||
List<Region> allRegions = this.lambdaQuery().ne(Region::getId, -1).list(); | |||
return CollUtils.convert(allRegions, RegionConverter::toRegionDTO); | |||
public List<RegionDTO> all() { | |||
return CollUtils.convert(list(), RegionConverter::toRegionDTO); | |||
} | |||
@Override | |||
@@ -1,15 +1,13 @@ | |||
package com.ningdatech.pmapi.todocenter.manage; | |||
import cn.hutool.core.collection.CollUtil; | |||
import cn.hutool.core.date.StopWatch; | |||
import cn.hutool.core.util.StrUtil; | |||
import com.alibaba.fastjson.JSON; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.google.common.collect.Sets; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; | |||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
@@ -35,7 +33,6 @@ import com.ningdatech.pmapi.todocenter.model.dto.vo.ResToBeProcessedVO; | |||
import com.ningdatech.pmapi.user.entity.UserInfo; | |||
import com.ningdatech.pmapi.user.service.IUserInfoService; | |||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | |||
import com.ningdatech.zwdd.client.ZwddClient; | |||
import com.wflow.contants.HisProInsEndActId; | |||
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | |||
import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO; | |||
@@ -48,12 +45,10 @@ import com.wflow.workflow.enums.ProcessStatusEnum; | |||
import com.wflow.workflow.service.*; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.assertj.core.util.Lists; | |||
import org.flowable.bpmn.model.*; | |||
import org.flowable.engine.*; | |||
import org.flowable.engine.history.HistoricProcessInstance; | |||
import org.flowable.engine.repository.ProcessDefinition; | |||
import org.flowable.engine.runtime.ActivityInstance; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.stereotype.Component; | |||
@@ -150,8 +145,8 @@ public class TodoCenterManage { | |||
public void exportTodoList(HttpServletResponse response, ToBeProcessedExportReq param) { | |||
// 获取登录用户ID | |||
Long userId = LoginUserUtil.getUserId(); | |||
param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); | |||
param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); | |||
//因为要解耦 不能把项目和工作流一起查 | |||
//1.先查出用户工作流 | |||
@@ -663,8 +658,8 @@ public class TodoCenterManage { | |||
// 获取登录用户ID | |||
Long userId = LoginUserUtil.getUserId(); | |||
param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); | |||
param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); | |||
// 查询用户已处理工作流 | |||
List<ProcessTaskVo> userIdoList = processTaskService.getUserIdoList(param.getProcessDefId(), String.valueOf(userId)); | |||
@@ -757,8 +752,8 @@ public class TodoCenterManage { | |||
// 获取登录用户ID | |||
long userId = LoginUserUtil.getUserId(); | |||
param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); | |||
param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); | |||
// 查询用户已处理工作流 | |||
List<ProcessInstanceVo> userSubmittedList = processInstanceService.getUserSubmittedList(String.valueOf(userId), param.getProcessDefId(), null); | |||
List<String> instCodes = userSubmittedList.stream().map(ProcessInstanceVo::getInstanceId).collect(Collectors.toList()); | |||
@@ -854,8 +849,8 @@ public class TodoCenterManage { | |||
// 获取登录用户ID | |||
Long userId = LoginUserUtil.getUserId(); | |||
param.setPageNumber(CommonConstant.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConstant.EXPORT_PAGE_SIZE); | |||
param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); | |||
param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); | |||
// 查询抄送登录用户的工作流 | |||
List<ProcessInstanceVo> ccMeList = processInstanceService.getCcMeList(param.getProcessDefId(), String.valueOf(userId)); | |||
@@ -3,7 +3,7 @@ package com.ningdatech.pmapi.user.security.auth; | |||
import com.ningdatech.basic.util.NdJsonUtil; | |||
import com.ningdatech.basic.util.StrPool; | |||
import com.ningdatech.pmapi.common.constant.BizConst; | |||
import com.ningdatech.pmapi.common.constant.CommonConstant; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.user.security.auth.handler.DefaultExpiredSessionStrategy; | |||
import com.ningdatech.pmapi.user.security.auth.credential.CredentialAuthSecurityConfig; | |||
import org.springframework.beans.factory.annotation.Qualifier; | |||
@@ -61,7 +61,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | |||
.expiredSessionStrategy(defaultExpiredSessionStrategy) | |||
.and().and() | |||
.logout().logoutUrl(authProperties.getLogoutUrl()).logoutSuccessHandler(logoutSuccessHandler) | |||
.deleteCookies(CommonConstant.COOKIE_KEY) | |||
.deleteCookies(CommonConst.COOKIE_KEY) | |||
// .and() | |||
// .cors().configurationSource(corsConfigurationSource()) | |||
.and() | |||