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());
+ if (Objects.isNull(region)) {
+ //查不到直接返回null
+ return null;
+ }
+ return RegionConverter.toRegionDTO(region);
+ });
+ // 初始化所有区域数据到缓存
+ initRegionCache();
+ }
+
+ public String getParentCodeRoot() {
+ return PARENT_CODE_ROOT;
+ }
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/basic/AbstractRegionLimitHelper.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/basic/AbstractRegionLimitHelper.java
new file mode 100644
index 0000000..56903b7
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/basic/AbstractRegionLimitHelper.java
@@ -0,0 +1,48 @@
+package com.hz.pm.api.common.helper.basic;
+
+import com.hz.pm.api.common.helper.RegionCacheHelper;
+import com.hz.pm.api.common.helper.RegionLimitHelper;
+import com.hz.pm.api.expert.entity.ExpertUserFullInfo;
+import com.hz.pm.api.expert.service.IExpertUserFullInfoService;
+import com.hz.pm.api.meta.model.ExpertRegionInfo;
+import com.hz.pm.api.sys.service.IRegionService;
+import com.hz.pm.api.user.service.IUserInfoService;
+import lombok.AllArgsConstructor;
+
+import java.util.Objects;
+
+/**
+ *
+ * AbstractRegionLimitHelper
+ *
+ *
+ * @author WendyYang
+ * @since 14:35 2023/3/1
+ */
+@AllArgsConstructor
+public abstract class AbstractRegionLimitHelper implements RegionLimitHelper {
+
+ protected final RegionCacheHelper regionCache;
+ protected final IExpertUserFullInfoService expertUserFullInfoService;
+ protected final IUserInfoService iUserInfoService;
+ protected final IRegionService regionService;
+
+
+ /**
+ * 根据 专家用户id 获取专家层级
+ *
+ * @param expertUserId /
+ * @return /
+ */
+ protected ExpertRegionInfo getExpertRegionInfo(Long expertUserId) {
+ ExpertUserFullInfo userFullInfo = expertUserFullInfoService.getByUserId(expertUserId);
+ if (Objects.isNull(userFullInfo)) {
+ return new ExpertRegionInfo();
+ }
+ ExpertRegionInfo regionInfo = new ExpertRegionInfo();
+ regionInfo.setRegionCode(userFullInfo.getRegionCode());
+ regionInfo.setRegionLevel(userFullInfo.getRegionLevel());
+ return regionInfo;
+ }
+
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionLimitHelperImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionLimitHelperImpl.java
new file mode 100644
index 0000000..ea3d9a3
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionLimitHelperImpl.java
@@ -0,0 +1,127 @@
+package com.hz.pm.api.common.helper.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.hz.pm.api.common.helper.RegionCacheHelper;
+import com.hz.pm.api.common.helper.basic.AbstractRegionLimitHelper;
+import com.hz.pm.api.expert.service.IExpertUserFullInfoService;
+import com.hz.pm.api.meta.model.bo.RegionContainsBO;
+import com.hz.pm.api.sys.model.entity.Region;
+import com.hz.pm.api.sys.service.IRegionService;
+import com.hz.pm.api.user.entity.UserInfo;
+import com.hz.pm.api.user.service.IUserInfoService;
+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;
+
+/**
+ * @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
+ , IUserInfoService iUserInfoService, IRegionService regionService) {
+ super(regionCache, expertUserFullInfoService, iUserInfoService, regionService);
+ }
+
+ public static Boolean contains(Integer adminRegionLevel, List adminAllContainsRegionCodes
+ , Integer expertRegionLevel, String expertRegionCode) {
+ for (String adminAllContainsRegionCode : adminAllContainsRegionCodes) {
+ if (adminAllContainsRegionCode.equals(expertRegionCode) && adminRegionLevel >= expertRegionLevel) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public Boolean regionContains(List regionContainsBOList, String regionCode, Integer regionLevel) {
+ for (RegionContainsBO regionContainsBO : regionContainsBOList) {
+ Integer parentRegionTreeLevel = regionContainsBO.getParentRegionTreeLevel();
+ List containsRegionCodeList = regionContainsBO.getContainsRegionCodeList();
+ for (String containsRegionCode : containsRegionCodeList) {
+ if (containsRegionCode.equals(regionCode) && parentRegionTreeLevel <= regionLevel) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+
+ @Override
+ public List queryContainsRegionAssembler(RegionContainsBO queryRegionContainBo, List expertAdminContainsRegionList) {
+ List resultBoList = new ArrayList<>();
+ if (Objects.nonNull(queryRegionContainBo)) {
+ List containsRegionCodeList = queryRegionContainBo.getContainsRegionCodeList();
+ // 查询取并级
+ if (CollectionUtils.isNotEmpty(expertAdminContainsRegionList)) {
+ for (RegionContainsBO regionContainsBO : expertAdminContainsRegionList) {
+ List regionCodeList = regionContainsBO.getContainsRegionCodeList();
+ regionCodeList.retainAll(containsRegionCodeList);
+ if (CollectionUtils.isNotEmpty(regionCodeList)) {
+ regionContainsBO.setContainsRegionCodeList(regionCodeList);
+ resultBoList.add(regionContainsBO);
+ }
+ }
+ }
+ return resultBoList;
+ } else {
+ return expertAdminContainsRegionList;
+ }
+ }
+
+ @Override
+ public RegionContainsBO getContainsRegionBo(Integer regionLevel, String regionCode) {
+ Collection regionCodes = regionCache.listChildRegionCodeList(regionCode, regionLevel);
+ RegionContainsBO regionContains = new RegionContainsBO();
+ regionContains.setContainsRegionCodeList(new ArrayList<>(regionCodes));
+ regionContains.setParentRegionTreeLevel(regionLevel);
+ return regionContains;
+ }
+
+
+ @Override
+ public List getExpertAdminContainsRegion(Long expertAdminUserId) {
+ if (Objects.isNull(expertAdminUserId)) {
+ logger.error("getExpertAdminContainsRegion expertAdminUserId is null");
+ return new ArrayList<>();
+ }
+
+ UserInfo userInfo = iUserInfoService.getById(expertAdminUserId);
+
+ if (Objects.isNull(userInfo) || StringUtils.isBlank(userInfo.getRegionCode())) {
+ logger.error("getExpertAdminContainsRegion userInfo is null Or regionCode is null");
+ return new ArrayList<>();
+ }
+
+ String regionCode = userInfo.getRegionCode();
+ List regionList = regionService.list(Wrappers.lambdaQuery(Region.class)
+ .eq(Region::getRegionCode, regionCode)
+ .orderByDesc(Region::getRegionLevel));
+
+ Region region = regionList.get(0);
+ Collection regionCodes = regionCache
+ .listChildRegionCodeList(region.getRegionCode(), region.getRegionLevel());
+ RegionContainsBO regionContainsBO = new RegionContainsBO();
+ regionContainsBO.setContainsRegionCodeList(new ArrayList<>(regionCodes));
+ regionContainsBO.setParentRegionTreeLevel(region.getRegionLevel());
+
+ ArrayList regionContainsBOS = CollectionUtil.toList(regionContainsBO);
+
+ return regionContainsBOS;
+ }
+
+
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionsCacheHelperImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionsCacheHelperImpl.java
new file mode 100644
index 0000000..20a1c0b
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/RegionsCacheHelperImpl.java
@@ -0,0 +1,244 @@
+package com.hz.pm.api.common.helper.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.text.StrPool;
+import com.ningdatech.basic.exception.BizException;
+import com.ningdatech.basic.util.CollUtils;
+import com.hz.pm.api.common.constant.RegionConst;
+import com.hz.pm.api.common.helper.RegionCacheHelper;
+import com.hz.pm.api.common.helper.basic.AbstractRegionCacheHelper;
+import com.hz.pm.api.common.model.RegionMapKey;
+import com.hz.pm.api.common.util.StrUtils;
+import com.hz.pm.api.sys.convert.RegionConverter;
+import com.hz.pm.api.sys.model.dto.RegionDTO;
+import com.hz.pm.api.sys.model.dto.RegionTreeDTO;
+import com.hz.pm.api.sys.model.vo.RegionTreeVO;
+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.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, Integer level) {
+ if (StringUtils.isBlank(code) || Objects.isNull(level)) {
+ return null;
+ }
+ return super.get(RegionMapKey.of(code, level));
+ }
+
+ @Override
+ public String getRegionName(String code, int level) {
+ RegionDTO dto = getByCodeAndLevel(code, level);
+ if (Objects.nonNull(dto)) {
+ return dto.getRegionName();
+ }
+ return StringUtils.EMPTY;
+ }
+
+ @Override
+ public List all() {
+ return super.all();
+ }
+
+ @Override
+ public Collection listChildRegionCodeList(String regionCode, int regionLevel) {
+ RegionDTO currRegion = getByCodeAndLevel(regionCode, regionLevel);
+ if (Objects.isNull(currRegion)) {
+ return Collections.emptyList();
+ }
+ if (currRegion.getParentCode().equals(regionCode)) {
+ return Collections.singletonList(regionCode);
+ }
+ List 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> 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) {
+ if (Objects.isNull(region)) {
+ return StringUtils.EMPTY;
+ }
+ 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 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 getCopyListByLevel(int level) {
+ List 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 list, String code, int level) {
+ if (CollectionUtils.isEmpty(list)) {
+ list = getCopyListByLevel(3);
+ if (CollectionUtils.isEmpty(list)) {
+ return null;
+ }
+ }
+ Optional first = list.stream()
+ .filter(w -> w.getRegionCode().equals(code) && w.getLevel() == level)
+ .findFirst();
+ if (first.isPresent()) {
+ return first.get();
+ }
+ for (RegionTreeDTO dto : list) {
+ if (CollectionUtils.isEmpty(dto.getChildren())) {
+ continue;
+ }
+ RegionTreeDTO temp = getTreeByRegionAndCode(dto.getChildren(), code, level);
+ if (temp != null) {
+ return temp;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public List listParents(String code, int level) {
+ List result = new ArrayList<>();
+ RegionDTO dto = 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;
+ }
+
+ @Override
+ public List listChildren(String code, int level) {
+ RegionDTO curr = getByCodeAndLevel(code, level);
+ if (curr.getParentCode().equals(curr.getRegionCode())) {
+ return Collections.singletonList(curr);
+ }
+ return all().stream()
+ .filter(w -> StrUtils.split(w.getRegionCodePath()).contains(code))
+ .collect(Collectors.toList());
+ }
+
+
+ @Override
+ public String getUnionPath(String code, Integer level) {
+ if (StrUtils.isBlank(code) || Objects.isNull(level)) {
+ return StrUtils.EMPTY;
+ }
+ List unionPathStrList = new ArrayList<>();
+ buildUnionPathStrList(code, level, unionPathStrList);
+ Collections.reverse(unionPathStrList);
+ if (CollUtil.isEmpty(unionPathStrList)) {
+ return StrUtils.EMPTY;
+ }
+ return String.join("@@", unionPathStrList);
+ }
+
+ @Override
+ public RegionDTO getByRegionName(String regionName) {
+ if (StrUtils.isBlank(regionName)) {
+ return null;
+ }
+ String[] regionArray = regionName.split("-");
+ int length = regionArray.length;
+ return all().stream()
+ .filter(w -> {
+ boolean lastEq = w.getRegionLevel().equals(length)
+ && w.getRegionName().equals(regionArray[length - 1]);
+ if (lastEq && length > 1) {
+ RegionDTO parent = getByCodeAndLevel(w.getParentCode(), w.getRegionLevel() - 1);
+ return parent.getRegionName().equals(regionArray[length - 2]);
+ }
+ return false;
+ }).findFirst().orElse(null);
+ }
+
+ protected void buildUnionPathStrList(String code, Integer level, List unionPathStrList) {
+ if (level <= 0 || super.getParentCodeRoot().equals(code)) {
+ return;
+ }
+ RegionDTO regionDTO = getByCodeAndLevel(code, level);
+ unionPathStrList.add(regionDTO.getRegionCode() + "##" + regionDTO.getRegionName() + "##" + regionDTO.getRegionLevel());
+ if (!super.getParentCodeRoot().equals(regionDTO.getParentCode())) {
+ buildUnionPathStrList(regionDTO.getParentCode(), level - 1, unionPathStrList);
+ }
+ }
+
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/UserInfoHelperImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/UserInfoHelperImpl.java
new file mode 100644
index 0000000..c550d84
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/UserInfoHelperImpl.java
@@ -0,0 +1,247 @@
+package com.hz.pm.api.common.helper.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.hz.pm.api.common.constant.BizConst;
+import com.hz.pm.api.common.helper.UserInfoHelper;
+import com.hz.pm.api.organization.model.entity.DingEmployeeInfo;
+import com.hz.pm.api.organization.model.entity.DingOrganization;
+import com.hz.pm.api.organization.service.IDingEmployeeInfoService;
+import com.hz.pm.api.organization.service.IDingOrganizationService;
+import com.hz.pm.api.sys.mapper.RoleMapper;
+import com.hz.pm.api.sys.model.entity.Role;
+import com.hz.pm.api.sys.model.entity.UserRole;
+import com.hz.pm.api.sys.service.IUserRoleService;
+import com.hz.pm.api.user.constant.UserAvailableEnum;
+import com.hz.pm.api.user.entity.UserInfo;
+import com.hz.pm.api.user.entity.enumeration.RoleEnum;
+import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO;
+import com.hz.pm.api.user.service.IUserInfoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @author liuxinxin
+ * @date 2023/2/10 下午4:40
+ */
+@Component
+@RequiredArgsConstructor
+public class UserInfoHelperImpl implements UserInfoHelper {
+
+
+ private final IUserInfoService userInfoService;
+ private final IDingEmployeeInfoService iDingEmployeeInfoService;
+ private final IDingOrganizationService iDingOrganizationService;
+ private final IUserRoleService iUserRoleService;
+ private final RoleMapper roleMapper;
+
+ @Override
+ public String getOrganizationCode(Long userId) {
+ UserFullInfoDTO userFullInfo = getUserFullInfo(userId);
+ return userFullInfo.getOrganizationCode();
+ }
+
+ @Override
+ public UserFullInfoDTO getUserFullInfo(Long userId) {
+ UserInfo userInfo = userInfoService.getById(userId);
+ if (Objects.isNull(userInfo)) {
+ return null;
+ }
+ // 返回用户全量信息
+ return getUserFullInfo(userInfo);
+ }
+
+ @Override
+ public UserFullInfoDTO getUserFullInfo(UserInfo userInfo) {
+ UserFullInfoDTO userFullInfo = new UserFullInfoDTO();
+ // 获取浙政钉雇员信息 组织信息
+ String employeeCode = userInfo.getEmployeeCode();
+ if (StringUtils.isNotBlank(employeeCode)) {
+ List dingEmployeeInfoList = iDingEmployeeInfoService
+ .list(Wrappers.lambdaQuery(DingEmployeeInfo.class)
+ .eq(DingEmployeeInfo::getEmployeeCode, employeeCode)
+ .eq(DingEmployeeInfo::getMainJob, "true"));
+ DingEmployeeInfo dingEmployeeInfo = dingEmployeeInfoList.get(0);
+
+
+ // 装配用户任职所在单位
+ String empPosUnitCode = dingEmployeeInfo.getEmpPosUnitCode();
+ if (StringUtils.isNotBlank(empPosUnitCode)) {
+ DingOrganization dingOrganization = iDingOrganizationService.getByOrgCode(empPosUnitCode);
+ if (Objects.nonNull(dingOrganization)) {
+ userFullInfo.setEmpPosUnitCode(empPosUnitCode);
+ userFullInfo.setEmpPosUnitName(dingOrganization.getOrganizationName());
+ userFullInfo.setRegionCode(dingOrganization.getDivisionCode());
+ }
+ }
+
+ // 装配用户所在orgCode
+ String organizationCode = dingEmployeeInfo.getOrganizationCode();
+ List dingOrganizationList = iDingOrganizationService.list(Wrappers
+ .lambdaQuery(DingOrganization.class)
+ .eq(DingOrganization::getOrganizationCode, organizationCode));
+ if (CollectionUtil.isNotEmpty(dingOrganizationList)) {
+ DingOrganization dingOrganization = dingOrganizationList.get(0);
+ userFullInfo.setOrganizationCode(dingOrganization.getOrganizationCode());
+ userFullInfo.setOrganizationName(dingOrganization.getOrganizationName());
+ // 测试使用
+ userFullInfo.setRegionLevel(3);
+ }
+ }
+
+ List roleList = new ArrayList<>();
+ // 获取用户角色列表信息
+ List userRoleList = iUserRoleService
+ .list(Wrappers.lambdaQuery(UserRole.class)
+ .eq(UserRole::getUserId, userInfo.getId()));
+ if (CollectionUtil.isNotEmpty(userRoleList)) {
+ List roleIdList = userRoleList.stream()
+ .map(UserRole::getRoleId).distinct()
+ .collect(Collectors.toList());
+ roleList = roleMapper.selectBatchIds(roleIdList);
+ }
+ userFullInfo.setUserRoleList(roleList);
+
+ // 装配用户任职所在单位
+
+ // 装配返回
+ userFullInfo.setUserId(userInfo.getId());
+ userFullInfo.setIdentifier(userInfo.getRealName());
+ userFullInfo.setRealName(userInfo.getRealName());
+ userFullInfo.setEmployeeCode(employeeCode);
+ userFullInfo.setUsername(userInfo.getRealName());
+ userFullInfo.setMobile(userInfo.getMobile());
+ userFullInfo.setAccountId(userInfo.getAccountId());
+
+ String available = userInfo.getAvailable();
+ if (StringUtils.isNotBlank(available)) {
+ userFullInfo.setAvailable(UserAvailableEnum.valueOf(available));
+ }
+ return userFullInfo;
+ }
+
+ /**
+ * 批量查询 这里 会没有角色
+ *
+ * @param userInfos \
+ * @return \
+ */
+ @Override
+ public List getUserFullInfos(List userInfos) {
+ if (CollUtil.isEmpty(userInfos)) {
+ return Collections.emptyList();
+ }
+ Map userMap = userInfos.stream().collect(Collectors.toMap(UserInfo::getEmployeeCode, e -> e));
+ // 获取浙政钉雇员信息 组织信息
+ List employeeCodes = userInfos.stream().map(UserInfo::getEmployeeCode).collect(Collectors.toList());
+ List dingEmployeeInfoList = iDingEmployeeInfoService
+ .list(Wrappers.lambdaQuery(DingEmployeeInfo.class)
+ .in(DingEmployeeInfo::getEmployeeCode, employeeCodes)
+ .eq(DingEmployeeInfo::getMainJob, "true"));
+
+ if (CollUtil.isEmpty(dingEmployeeInfoList)) {
+ return Collections.emptyList();
+ }
+
+ // 装配用户任职所在单位
+ List empPosUnitCodes = dingEmployeeInfoList.stream().map(DingEmployeeInfo::getEmpPosUnitCode).collect(Collectors.toList());
+ List orgCodes = dingEmployeeInfoList.stream().map(DingEmployeeInfo::getOrganizationCode).collect(Collectors.toList());
+ List allOrgCodes = Stream.concat(empPosUnitCodes.stream(), orgCodes.stream()).collect(Collectors.toList());
+ if (CollUtil.isEmpty(allOrgCodes)) {
+ return Collections.emptyList();
+ }
+ List dingOrganizations = iDingOrganizationService.listByCodes(allOrgCodes);
+ if (CollUtil.isEmpty(dingOrganizations)) {
+ return Collections.emptyList();
+ }
+ Map orgMap = dingOrganizations.stream().collect(Collectors.toMap(DingOrganization::getOrganizationCode, d -> d));
+
+ return dingEmployeeInfoList.stream().map(e -> {
+ UserFullInfoDTO userFullInfo = new UserFullInfoDTO();
+ if (orgMap.containsKey(e.getEmpPosUnitCode())) {
+ DingOrganization organization = orgMap.get(e.getEmpPosUnitCode());
+ userFullInfo.setEmpPosUnitCode(e.getEmpPosUnitCode());
+ userFullInfo.setEmpPosUnitName(organization.getOrganizationName());
+ userFullInfo.setRegionCode(organization.getDivisionCode());
+ }
+ if (orgMap.containsKey(e.getOrganizationCode())) {
+ DingOrganization organization = orgMap.get(e.getOrganizationCode());
+ userFullInfo.setOrganizationCode(organization.getOrganizationCode());
+ userFullInfo.setOrganizationName(organization.getOrganizationName());
+ // 测试使用
+ userFullInfo.setRegionLevel(3);
+ }
+ if (userMap.containsKey(e.getEmployeeCode())) {
+ UserInfo userInfo = userMap.get(e.getEmployeeCode());
+ // 装配返回
+ userFullInfo.setUserId(userInfo.getId());
+ userFullInfo.setIdentifier(userInfo.getRealName());
+ userFullInfo.setRealName(userInfo.getRealName());
+ userFullInfo.setEmployeeCode(e.getEmployeeCode());
+ userFullInfo.setUsername(userInfo.getRealName());
+ userFullInfo.setMobile(userInfo.getMobile());
+ userFullInfo.setAccountId(userInfo.getAccountId());
+ String available = userInfo.getAvailable();
+ if (StringUtils.isNotBlank(available)) {
+ userFullInfo.setAvailable(UserAvailableEnum.valueOf(available));
+ }
+ }
+ return userFullInfo;
+ }).collect(Collectors.toList());
+ }
+
+ @Override
+ public String getUserName(Long userId) {
+ UserFullInfoDTO userFullInfo = getUserFullInfo(userId);
+ return userFullInfo.getRealName();
+ }
+
+ @Override
+ public boolean isSuperOrRegionAdmin(Long userId) {
+ UserFullInfoDTO userFullInfo = getUserFullInfo(userId);
+ if (CollUtil.isNotEmpty(userFullInfo.getUserRoleList())) {
+ for (Role role : userFullInfo.getUserRoleList()) {
+ if (RoleEnum.SUPER_ADMIN.name().equals(role.getCode()) ||
+ RoleEnum.REGION_MANAGER.name().equals(role.getCode())) {
+ return Boolean.TRUE;
+ }
+ }
+ }
+ return Boolean.FALSE;
+ }
+
+ @Override
+ public UserFullInfoDTO getUserFullInfoByEmployeeCode(String employeeCode) {
+ UserInfo userInfo = userInfoService.getUserInfoByEmployeeCode(employeeCode);
+ return getUserFullInfo(userInfo);
+ }
+
+ @Override
+ public List getUserFullInfoByEmployeeCodes(Collection employeeCodes) {
+ List userInfos = userInfoService.getUserInfoByEmployeeCodes(employeeCodes);
+ return getUserFullInfos(userInfos);
+ }
+
+ @Override
+ public String getUserEmpPosUnitCode(Long userId) {
+ UserFullInfoDTO userFullInfo = getUserFullInfo(userId);
+ return userFullInfo.getEmpPosUnitCode();
+ }
+
+ @Override
+ public String getMainOrgCode(String empPosUnitCode) {
+ DingOrganization org = iDingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class)
+ .eq(DingOrganization::getOrganizationCode, empPosUnitCode)
+ .last(BizConst.LIMIT_1));
+ if(Objects.isNull(org)){
+ return null;
+ }
+ return org.getParentCode();
+ }
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/interceptor/LogInterceptor.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/interceptor/LogInterceptor.java
new file mode 100644
index 0000000..e25eda5
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/interceptor/LogInterceptor.java
@@ -0,0 +1,38 @@
+package com.hz.pm.api.common.interceptor;
+
+import cn.hutool.core.lang.UUID;
+import com.hz.pm.api.common.util.MDCUtil;
+import org.springframework.lang.NonNull;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ *
+ * LogInterceptor
+ *
+ *
+ * @author WendyYang
+ * @since 2023/10/26
+ **/
+public class LogInterceptor implements HandlerInterceptor {
+
+ @Override
+ public boolean preHandle(@NonNull HttpServletRequest request,
+ @NonNull HttpServletResponse response,
+ @NonNull Object handler) {
+ String traceId = UUID.randomUUID().toString(true);
+ response.addHeader(MDCUtil.TRACE_ID_HEADER, traceId);
+ MDCUtil.setTraceId(traceId);
+ return true;
+ }
+
+ @Override
+ public void afterCompletion(@NonNull HttpServletRequest request,
+ @NonNull HttpServletResponse response,
+ @NonNull Object handler, Exception ex) {
+ MDCUtil.removeTraceId();
+ }
+
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/CommonPage.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/CommonPage.java
new file mode 100644
index 0000000..3550c3d
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/CommonPage.java
@@ -0,0 +1,22 @@
+package com.hz.pm.api.common.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author liuxinxin
+ * @date 2022/8/4 上午11:34
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CommonPage implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private int currentPageNumber;
+ private Long itemsTotal;
+ private List items;
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/CommonPageReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/CommonPageReq.java
new file mode 100644
index 0000000..a39e388
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/CommonPageReq.java
@@ -0,0 +1,22 @@
+package com.hz.pm.api.common.model;
+
+import lombok.Data;
+
+/**
+ * @author liuxinxin
+ * @date 2022/8/4 上午11:19
+ */
+@Data
+public class CommonPageReq {
+ private static final long serialVersionUID = 1L;
+ private int pageSize;
+ private int pageNumber;
+
+ public int getOffset() {
+ return (this.getPageNumber() - 1) * this.getPageSize();
+ }
+
+ public int getLimit() {
+ return this.getPageSize();
+ }
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/ExpertRegionModifyDiffBO.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/ExpertRegionModifyDiffBO.java
new file mode 100644
index 0000000..7007876
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/ExpertRegionModifyDiffBO.java
@@ -0,0 +1,19 @@
+package com.hz.pm.api.common.model;
+
+import com.hz.pm.api.meta.model.ExpertRegionInfo;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author liuxinxin
+ * @date 2022/7/28 下午4:34
+ */
+@Data
+public class ExpertRegionModifyDiffBO {
+
+ private List addList;
+
+ private List removeList;
+
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/FileBasicInfo.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/FileBasicInfo.java
new file mode 100644
index 0000000..a5073c9
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/FileBasicInfo.java
@@ -0,0 +1,24 @@
+package com.hz.pm.api.common.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author liuxinxin
+ * @date 2022/7/25 下午1:55
+ * 用于包装使用
+ */
+@Data
+@ApiModel("文件信息基类")
+public class FileBasicInfo {
+
+ @ApiModelProperty("文件id")
+ private Long fileId;
+
+ @ApiModelProperty("文件url")
+ private String url;
+
+ @ApiModelProperty("文件名")
+ private String fileName;
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/FreemarkerBatchExportDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/FreemarkerBatchExportDTO.java
new file mode 100644
index 0000000..990f173
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/FreemarkerBatchExportDTO.java
@@ -0,0 +1,22 @@
+package com.hz.pm.api.common.model;
+
+import lombok.Data;
+
+/**
+ *
+ * FreemarkerBatchExportDTO
+ *
+ *
+ * @author WendyYang
+ * @since 2023/8/1
+ **/
+@Data
+public class FreemarkerBatchExportDTO {
+
+ private String fileName;
+
+ private String template;
+
+ private Object data;
+
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/RegionMapKey.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/RegionMapKey.java
new file mode 100644
index 0000000..4a979fb
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/RegionMapKey.java
@@ -0,0 +1,53 @@
+package com.hz.pm.api.common.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.experimental.Tolerate;
+
+import java.util.Objects;
+
+/**
+ *
+ * RegionMapKey
+ *
+ *
+ * @author WendyYang
+ * @since 13:54 2023/3/1
+ */
+@Data
+@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);
+ }
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/ReqRegionDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/ReqRegionDTO.java
new file mode 100644
index 0000000..974ceac
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/ReqRegionDTO.java
@@ -0,0 +1,20 @@
+package com.hz.pm.api.common.model;
+
+import lombok.Data;
+
+/**
+ *
+ * ReqRegionDTO
+ *
+ *
+ * @author WendyYang
+ * @since 2023/8/4
+ **/
+@Data
+public class ReqRegionDTO {
+
+ private String regionCode;
+
+ private Integer regionLevel;
+
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/ZwddTokenUser.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/ZwddTokenUser.java
new file mode 100644
index 0000000..2df8600
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/ZwddTokenUser.java
@@ -0,0 +1,16 @@
+package com.hz.pm.api.common.model;
+
+import lombok.Data;
+
+@Data
+public class ZwddTokenUser {
+ private Long accountId;
+
+ private String employeeCode;
+
+ private String employeeName;
+
+ private String mobile;
+
+ private Long tenantId;
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/CountGroupByDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/CountGroupByDTO.java
new file mode 100644
index 0000000..cff00c5
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/CountGroupByDTO.java
@@ -0,0 +1,20 @@
+package com.hz.pm.api.common.model.entity;
+
+import lombok.Data;
+
+/**
+ *
+ * CountGroupByDto
+ *
+ *
+ * @author WendyYang
+ * @since 15:44 2022/8/28
+ */
+@Data
+public class CountGroupByDTO {
+
+ private Integer total;
+
+ private T groupKey;
+
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/DataDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/DataDTO.java
new file mode 100644
index 0000000..ced9cbc
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/DataDTO.java
@@ -0,0 +1,73 @@
+package com.hz.pm.api.common.model.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import java.math.BigDecimal;
+
+/**
+ *
+ * DataDTO
+ *
+ *
+ * @author ZPF
+ * @since 16:40 2023/12/05
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class DataDTO {
+
+ public static DataDTO of(String name,Integer num){
+ DataDTO dataDTO = new DataDTO();
+ dataDTO.setName(name);
+ dataDTO.setNum(num);
+ return dataDTO;
+ }
+
+ public static DataDTO of(String name,String code,Integer num){
+ DataDTO dataDTO = new DataDTO();
+ dataDTO.setName(name);
+ dataDTO.setCode(code);
+ dataDTO.setNum(num);
+ return dataDTO;
+ }
+
+ public static DataDTO of(String name,BigDecimal amount){
+ DataDTO dataDTO = new DataDTO();
+ dataDTO.setName(name);
+ dataDTO.setAmount(amount);
+ return dataDTO;
+ }
+
+ public static DataDTO of(String name,String code,BigDecimal amount){
+ DataDTO dataDTO = new DataDTO();
+ dataDTO.setName(name);
+ dataDTO.setCode(code);
+ dataDTO.setAmount(amount);
+ return dataDTO;
+ }
+
+ public static DataDTO ofRate(String name,BigDecimal rate){
+ DataDTO dataDTO = new DataDTO();
+ dataDTO.setName(name);
+ dataDTO.setRate(rate);
+ return dataDTO;
+ }
+
+ @ApiModelProperty("编号")
+ private String code;
+
+ @ApiModelProperty("名称")
+ private String name;
+
+ @ApiModelProperty("数量")
+ private Integer num = 0;
+
+ @ApiModelProperty("金额")
+ private BigDecimal amount = BigDecimal.ZERO;
+
+ @ApiModelProperty("比例")
+ private BigDecimal rate = BigDecimal.ZERO;
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/ExcelExportDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/ExcelExportDTO.java
new file mode 100644
index 0000000..1bf8c1f
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/ExcelExportDTO.java
@@ -0,0 +1,200 @@
+package com.hz.pm.api.common.model.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 待办中心待我处理项目列表导出实体
+ *
+ * @author CMM
+ * @since 2023/01/19 16:42
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+
+public class ExcelExportDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @ExcelProperty("项目ID")
+ private Long id;
+
+ @ExcelProperty("项目名称")
+ private String projectName;
+
+ @ExcelProperty("行政区划编码")
+ private String areaCode;
+
+ @ExcelProperty("行政区划名称")
+ private String area;
+
+ @ExcelProperty("项目负责人")
+ private String responsibleMan;
+
+ @ExcelProperty("项目负责人手机号")
+ private String responsibleManMobile;
+
+ @ExcelProperty("项目联系人")
+ private String contactName;
+
+ @ExcelProperty("项目联系人手机号")
+ private String contactPhone;
+
+ @ExcelProperty("上级业务主管单位")
+ private String higherSuperOrg;
+
+ @ExcelProperty("上级主管单位浙政钉ID")
+ private String higherSuperOrgCode;
+
+ @ExcelProperty("本级主管部门")
+ private String superOrg;
+
+ @ExcelProperty("本级主管部门浙政钉ID")
+ private String superOrgCode;
+
+ @ExcelProperty("建设单位名称")
+ private String buildOrgName;
+
+ @ExcelProperty("建设单位浙政钉ID")
+ private String buildOrgZheJiangGovDingId;
+
+ @ExcelProperty("建设单位统一信用代码")
+ private String buildOrgCode;
+
+ @ExcelProperty("项目类型")
+ private Integer projectType;
+
+ @ExcelProperty("是否首次新建")
+ private Integer isFirst;
+
+ @ExcelProperty("关联应用")
+ private String relatedExistsApplication;
+
+ @ExcelProperty("关联应用IRS编码")
+ private String relatedExistsApplicationCode;
+
+ @ExcelProperty("申报金额(万元)")
+ private BigDecimal declareAmount;
+
+ @ExcelProperty("批复金额")
+ private BigDecimal approvedTotalInvestmentIncrease;
+
+ @ExcelProperty("预算来源")
+ private String budgetSource;
+
+ @ExcelProperty("预算年度")
+ private Integer projectYear;
+
+ @ExcelProperty("项目简介")
+ private String projectIntroduction;
+
+ @ExcelProperty("立项依据")
+ private String buildBasis;
+
+ @ExcelProperty("建设层级")
+ private String buildLevel;
+
+ @ExcelProperty("发改编码")
+ private String developCode;
+
+ @ExcelProperty("财政编码")
+ private String financialCode;
+
+ @ExcelProperty("信息是否有效")
+ private Boolean informationValidity;
+
+ @ExcelProperty("是否数字化改革项目")
+ private Integer isDigitalReform;
+
+ @ExcelProperty("综合应用领域")
+ private String bizDomain;
+
+ @ExcelProperty("是否上云")
+ private Integer isCloud;
+
+ @ExcelProperty("云类型")
+ private String cloudType;
+
+ @ExcelProperty("四大体系")
+ private Integer fourSystems;
+
+ @ExcelProperty("是否临时增补")
+ private Integer isTemporaryAugment;
+
+ @ExcelProperty("等保级别")
+ private Integer protectionLevel;
+
+ @ExcelProperty("是否密评 0:否 1:是")
+ private Integer isSecretComments;
+
+ @ExcelProperty("业务编号")
+ private String businessNumber;
+
+ @ExcelProperty("业务名称")
+ private String businessName;
+
+ @ExcelProperty("单位名称")
+ private String orgName;
+
+ @ExcelProperty("软件开发(万元)")
+ private BigDecimal softwareDevelopmentAmount;
+
+ @ExcelProperty("云资源、硬件购置(万元)")
+ private BigDecimal cloudHardwarePurchaseAmount;
+
+ @ExcelProperty("第三方服务(万元)")
+ private BigDecimal thirdPartyAmount;
+
+ @ExcelProperty("投入项")
+ private String safetyInputTitle;
+
+ @ExcelProperty("内容描述")
+ private String safetyInputDescribe;
+
+ @ExcelProperty("金额(万元)")
+ private BigDecimal safetyInputAmount;
+
+ @ExcelProperty("年度支付金额(万元)")
+ private BigDecimal annualPlanAmount;
+
+ @ExcelProperty("自有资金(万元)")
+ private BigDecimal annualPlanHaveAmount;
+
+ @ExcelProperty("政府投资-本级财政资金(万元)")
+ private BigDecimal declareGovOwnFinanceAmount;
+
+ @ExcelProperty("政府投资-上级补助资金(万元)")
+ private BigDecimal declareGovSuperiorFinanceAmount;
+
+ @ExcelProperty("银行贷款(万元)")
+ private BigDecimal declareBankLendingAmount;
+
+ @ExcelProperty("其它资金(万元)")
+ private BigDecimal declareOtherAmount;
+
+ @ExcelProperty("第一季度")
+ private String engineeringSpeedOne;
+
+ @ExcelProperty("第二季度")
+ private String engineeringSpeedTwo;
+
+ @ExcelProperty("第三季度")
+ private String engineeringSpeedThree;
+
+ @ExcelProperty("第四季度")
+ private String engineeringSpeedFour;
+
+ @ExcelProperty("初步方案")
+ private String preliminaryPlanFile;
+
+ @ExcelProperty("附件-佐证材料")
+ private String supportingMaterialsFile;
+
+ @ExcelProperty("备注")
+ private String projectRemarks;
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/ExcelExportWriter.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/ExcelExportWriter.java
new file mode 100644
index 0000000..aeeb3f5
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/ExcelExportWriter.java
@@ -0,0 +1,65 @@
+package com.hz.pm.api.common.model.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Collection;
+import java.util.List;
+
+
+/**
+ * 文件模板导出对象
+ * @author CMM
+ * @since 2023/02/11 11:26
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ExcelExportWriter {
+ /**
+ * 文件名称
+ */
+ private String fileName;
+
+ /**
+ * sheet 名称数组
+ */
+ private List sheets;
+
+ /**
+ * 是否启用 头部Excel属性。
+ * 如果使用,则会读取 class对象注解 ExcelProperty 属性值。
+ * 不启用:则会根据heads 动态对列名称去便利
+ */
+ private Boolean headPropertyFlag;
+
+ /**
+ * 头部属性class
+ */
+ private Class headPropertyClass;
+
+ /**
+ * 动态列名称
+ * 描述:
+ * 第一个List 代表:sheet 列表集合
+ * 第二个List 代表:表体行数据(集合)
+ * 第三个list 代表:表体列数据(集合)
+ */
+ private List>> heads;
+
+
+ /**
+ * 数据对象
+ * 1、对象写:根据对象固定字段写(分为三层)
+ * 第二个List 代表:表体行数据(集合)
+ * 第三个对象(class) 对象
+ * List
+ *
+ * 2、无对象写(动态表体数据) 分为三层
+ * 第一个List 代表:表体行数据(集合)
+ * 第二个list 代表:表体列数据(集合)
+ * List>
+ */
+ private Collection> datas;
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/KeyValDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/KeyValDTO.java
new file mode 100644
index 0000000..f332138
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/KeyValDTO.java
@@ -0,0 +1,28 @@
+package com.hz.pm.api.common.model.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ *
+ * KeyValueDTO
+ *
+ *
+ * @author WendyYang
+ * @since 16:40 2022/8/31
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class KeyValDTO {
+
+ private K key;
+
+ private V value;
+
+ public static KeyValDTO of(K k, V v) {
+ return new KeyValDTO<>(k, v);
+ }
+
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/MenuTreeEntity.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/MenuTreeEntity.java
new file mode 100644
index 0000000..2209dab
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/MenuTreeEntity.java
@@ -0,0 +1,125 @@
+package com.hz.pm.api.common.model.entity;
+
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
+
+/**
+ * 包括id、create_time、created_by、updated_by、update_time、label、parent_id、sort_value 字段的表继承的树形实体
+ *
+ * @author PoffyZhang
+ * @since 2022/09/30
+ */
+@Getter
+@Setter
+@Accessors(chain = true)
+@ToString(callSuper = true)
+public class MenuTreeEntity {
+
+ @TableId(value = "id", type = IdType.AUTO)
+ protected Long id;
+
+ /**
+ * 名称
+ */
+ @ApiModelProperty(value = "名称")
+ @NotEmpty(message = "名称不能为空")
+ @Size(max = 255, message = "名称长度不能超过255")
+ @TableField(value = "name", condition = LIKE)
+ protected String name;
+
+ /**
+ * 菜单标题
+ */
+ @ApiModelProperty(value = "菜单标题")
+ @NotEmpty(message = "菜单标题不能为空")
+ @Size(max = 255, message = "菜单标题长度不能超过255")
+ @TableField(value = "title", condition = LIKE)
+ protected String title;
+
+ /**
+ * 父菜单ID
+ */
+ @ApiModelProperty(value = "父ID")
+ @TableField(value = "pid")
+ protected Long pid;
+
+ /**
+ * 排序
+ */
+ @ApiModelProperty(value = "排序号")
+ @TableField(value = "sort")
+ protected Integer sort;
+
+ /**
+ * 顶层菜单
+ */
+ @ApiModelProperty(value = "顶层菜单")
+ @TableField(exist = false)
+ protected String topMenu;
+
+ /**
+ * 路径
+ */
+ @ApiModelProperty(value = "路径")
+ @Size(max = 255, message = "路径长度不能超过255")
+ @TableField(value = "path", condition = LIKE)
+ protected String path;
+
+
+ @ApiModelProperty(value = "子节点", hidden = true)
+ @TableField(exist = false)
+ protected List children;
+
+
+ /**
+ * 层级
+ */
+ @ApiModelProperty(value = "层级")
+ @TableField(exist = false)
+ protected Integer level = 1;
+
+
+ /**
+ * 初始化子类
+ */
+ @JsonIgnore
+ public void initChildren() {
+ if (getChildren() == null) {
+ this.setChildren(new ArrayList<>());
+ }
+ }
+
+ @JsonIgnore
+ public void addChildren(E child) {
+ initChildren();
+ children.add(child);
+ }
+
+ public Integer getSize() {
+ if (CollUtil.isNotEmpty(getChildren())) {
+ return getChildren().size();
+ }
+ return 0;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/ViewRegionDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/ViewRegionDTO.java
new file mode 100644
index 0000000..ddcdc18
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/model/entity/ViewRegionDTO.java
@@ -0,0 +1,24 @@
+package com.hz.pm.api.common.model.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+import java.util.Collection;
+
+/**
+ *
+ * ViewRegionDTO
+ *
+ *
+ * @author WendyYang
+ * @since 2023/4/27
+ **/
+@Data
+@AllArgsConstructor
+public class ViewRegionDTO {
+
+ private Collection regions;
+
+ private Integer regionLevel;
+
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java
new file mode 100644
index 0000000..4504921
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareAction.java
@@ -0,0 +1,277 @@
+package com.hz.pm.api.common.statemachine.action;
+
+import com.hz.pm.api.common.constant.StateMachineConst;
+import com.hz.pm.api.common.statemachine.builder.ProjectDeclareStateMachineBuilder;
+import com.hz.pm.api.common.statemachine.contants.RegionContant;
+import com.hz.pm.api.common.statemachine.util.StateMachineUtils;
+import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
+import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
+import com.hz.pm.api.projectlib.model.entity.Project;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.messaging.Message;
+import org.springframework.statemachine.StateContext;
+import org.springframework.statemachine.action.Action;
+import org.springframework.statemachine.annotation.OnTransition;
+import org.springframework.statemachine.annotation.WithStateMachine;
+
+/**
+ * 项目申报状态机action集合类
+ *
+ * @author CMM
+ * @since 2023/02/08 13:48
+ */
+@Slf4j
+@WithStateMachine(id = RegionContant.LS_SBJ_CODE)
+public class ProjectDeclareAction {
+
+ private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE;
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION")
+ public void UNDER_INTERNAL_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "UNDER_INTERNAL_AUDIT_NOT_PASS")
+ public void UNDER_INTERNAL_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "TO_BE_DECLARED")
+ public void UNDER_INTERNAL_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT_NOT_PASS", target = "UNDER_INTERNAL_AUDIT")
+ public void UNDER_INTERNAL_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
+ }
+
+
+ @OnTransition(source = "PENDING_PREQUALIFICATION", target = "PENDING_PREQUALIFICATION_CHOICE")
+ public void PRELIMINARY_REVIEW_DECLARE(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
+ }
+
+ @OnTransition(source = "PENDING_PREQUALIFICATION", target = "UNDER_INTERNAL_AUDIT")
+ public void PENDING_PREQUALIFICATION_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
+ }
+
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS")
+ public void PROVINCIAL_DEPARTMENT_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS", target = "PRE_APPLYING")
+ public void PROVINCIAL_PASS_TO_PRELIMINARY_REVIEW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED")
+ public void PROVINCIAL_DEPARTMENT_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "PENDING_PREQUALIFICATION")
+ public void JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "DEPARTMENT_JOINT_REVIEW")
+ public void PRELIMINARY_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_FAILED")
+ public void PRELIMINARY_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode());
+ }
+
+ @OnTransition(source = "PREQUALIFICATION_FAILED", target = "PENDING_PREQUALIFICATION_CHOICE")
+ public void PRELIMINARY_REVIEW_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_WITHDRAW_CHOICE")
+ public void PRE_APPLYING_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE.getCode());
+ }
+
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "IN_THE_ANNUAL_PLAN")
+ public void DEPARTMENT_UNITED_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
+ }
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "DEPARTMENT_JOINT_REVIEW_FAILED")
+ public void DEPARTMENT_UNITED_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED.getCode());
+ }
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "PRE_APPLYING")
+ public void DEPARTMENT_JOINT_REVIEW_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
+ }
+
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "PLAN_TO_BE_DECLARED")
+ public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
+ }
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "BE_SUSPENDED")
+ public void ANNUAL_PLAN_SUSPEND(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.BE_SUSPENDED.getCode());
+ }
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "DEPARTMENT_JOINT_REVIEW")
+ public void IN_THE_ANNUAL_PLAN_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode());
+ }
+
+
+ @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "SCHEME_UNDER_REVIEW")
+ public void DECLARE_PLAN(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "IN_THE_ANNUAL_PLAN")
+ public void PLAN_TO_DECLARE_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW")
+ public void DECLARE_PLAN_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED")
+ public void PLAN_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "SCHEME_REVIEW_FAILED")
+ public void PLAN_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW")
+ public void PLAN_REVIEW_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "PLAN_TO_BE_DECLARED")
+ public void SCHEME_UNDER_REVIEW_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
+ }
+
+
+ @OnTransition(source = "TO_BE_APPROVED", target = "TO_BE_PURCHASED")
+ public void PROJECT_APPROVAL(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ // 待立项批复批复后,项目一级状态变更为已立项
+ project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
+ project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
+ }
+
+ @OnTransition(source = "TO_BE_APPROVED", target = "SCHEME_UNDER_REVIEW")
+ public void TO_BE_APPROVED_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+
+ @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION")
+ public void PURCHASE_PUT_ON_RECORD(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.OPERATION.getCode());
+ }
+ @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION")
+ public void START_TO_WORK(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
+ }
+
+ @OnTransition(source = "TO_BE_PURCHASED", target = "TO_BE_APPROVED")
+ public void TO_BE_PURCHASED_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ // 待采购状态撤回后,项目一级状态回退到未立项
+ project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
+ project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode());
+ }
+
+
+ @OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_FINALLY_INSPECTED")
+ public void PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode());
+ }
+
+ @OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_PURCHASED")
+ public void UNDER_CONSTRUCTION_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
+ }
+
+
+ @OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW")
+ public void FINAL_ACCEPTANCE_APPLICATION(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "UNDER_CONSTRUCTION")
+ public void TO_BE_FINALLY_INSPECTED_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
+ }
+
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "ARCHIVED")
+ public void FINAL_ACCEPTANCE_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ // 终验审核通过后,项目一级状态变更为已归档
+ project.setStage(ProjectStatusEnum.ARCHIVED.getCode());
+ project.setStatus(ProjectStatusEnum.ACCEPTED.getCode());
+ }
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_REVIEW_FAILED")
+ public void FINAL_ACCEPTANCE_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode());
+ }
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW")
+ public void FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode());
+ }
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareChoiceAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareChoiceAction.java
new file mode 100644
index 0000000..e552782
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareChoiceAction.java
@@ -0,0 +1,96 @@
+package com.hz.pm.api.common.statemachine.action;
+
+import cn.hutool.core.collection.CollUtil;
+import com.hz.pm.api.common.constant.ProjectDeclareConst;
+import com.hz.pm.api.common.constant.StateMachineConst;
+import com.hz.pm.api.common.enumeration.CommonEnum;
+import com.hz.pm.api.common.statemachine.util.StateMachineUtils;
+import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
+import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
+import com.hz.pm.api.projectlib.model.entity.Project;
+import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.statemachine.StateContext;
+import org.springframework.statemachine.action.Action;
+
+import java.util.List;
+
+import static com.hz.pm.api.common.constant.StateMachineConst.APPLICATION_DECLARE;
+
+/**
+ * 项目申报状态机选择分支action类
+ *
+ * @author CMM
+ * @since 2023/02/07 22:31
+ */
+@Slf4j
+public class ProjectDeclareChoiceAction implements Action {
+
+ private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE;
+
+ @Override
+ public void execute(StateContext stateContext) {
+ log.info(String.valueOf(stateContext.getTarget().getId()));
+ ProjectStatusEnum projectStatusEnum = stateContext.getTarget().getId();
+ switch (projectStatusEnum){
+ case PENDING_PREQUALIFICATION_CHOICE:
+ preDeclareChoice(stateContext);
+ break;
+ case PREQUALIFICATION_WITHDRAW_CHOICE:
+ preWithDrawChoice(stateContext);
+ break;
+ case APPROVED_AFTER_CHOICE:
+ approvedAfterChoice(stateContext);
+ break;
+ default:
+ throw new IllegalStateException("Unexpected value: " + projectStatusEnum);
+ }
+ }
+
+ private void approvedAfterChoice(StateContext stateContext) {
+ List projectApplications = stateContext.getMessage().getHeaders().get(APPLICATION_DECLARE, List.class);
+ Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class);
+ log.info("立项批复之后,项目的状态为:{}" + project.getStatus());
+ // 判断 是否有初次创建的应用
+ if (CollUtil.isEmpty(projectApplications)){
+ project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
+ project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
+ }
+ final Boolean[] isFirstApp = {Boolean.FALSE};
+ projectApplications.stream().forEach(app -> {
+ Integer isFirst = app.getIsFirst();
+ if(isFirst.equals(CommonEnum.YES.getCode())){
+ isFirstApp[0] = Boolean.TRUE;
+ }
+ });
+ if(isFirstApp[0]){
+ project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
+ project.setStatus(ProjectStatusEnum.TO_BE_APP_REGISTER.getCode());
+ }else{
+ project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
+ project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
+ }
+ }
+
+ private void preDeclareChoice(StateContext stateContext) {
+ Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class);
+ log.info("预审申报事件之前,项目的状态为:{}"+project.getStatus());
+ if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project,
+ ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){
+ project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode());
+ }else {
+ project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
+ }
+ }
+
+ private void preWithDrawChoice(StateContext stateContext) {
+ Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class);
+ log.info("预审中撤回事件之前,项目的状态为:{}"+project.getStatus());
+ if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project,
+ ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){
+ project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
+ }else {
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
+ }
+ }
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareJNAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareJNAction.java
new file mode 100644
index 0000000..51a8dac
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareJNAction.java
@@ -0,0 +1,280 @@
+package com.hz.pm.api.common.statemachine.action;
+
+import com.hz.pm.api.common.constant.StateMachineConst;
+import com.hz.pm.api.common.statemachine.builder.ProjectDeclareStateMachineBuilder;
+import com.hz.pm.api.common.statemachine.contants.RegionContant;
+import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
+import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
+import com.hz.pm.api.projectlib.model.entity.Project;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.messaging.Message;
+import org.springframework.statemachine.annotation.OnTransition;
+import org.springframework.statemachine.annotation.WithStateMachine;
+
+/**
+ * 项目申报状态机action集合类
+ * 景宁畲族自治县
+ * @author CMM
+ * @since 2023/02/08 13:48
+ */
+@Slf4j
+@WithStateMachine(id = RegionContant.LS_JN_CODE)
+public class ProjectDeclareJNAction {
+
+ private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE;
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION")
+ public void UNDER_INTERNAL_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "UNDER_INTERNAL_AUDIT_NOT_PASS")
+ public void UNDER_INTERNAL_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "TO_BE_DECLARED")
+ public void UNDER_INTERNAL_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT_NOT_PASS", target = "UNDER_INTERNAL_AUDIT")
+ public void UNDER_INTERNAL_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
+ }
+
+
+ @OnTransition(source = "PENDING_PREQUALIFICATION", target = "PENDING_PREQUALIFICATION_CHOICE")
+ public void PRELIMINARY_REVIEW_DECLARE(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
+ }
+
+ @OnTransition(source = "PENDING_PREQUALIFICATION", target = "UNDER_INTERNAL_AUDIT")
+ public void PENDING_PREQUALIFICATION_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
+ }
+
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS")
+ public void PROVINCIAL_DEPARTMENT_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS", target = "PRE_APPLYING")
+ public void PROVINCIAL_PASS_TO_PRELIMINARY_REVIEW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED")
+ public void PROVINCIAL_DEPARTMENT_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "PENDING_PREQUALIFICATION")
+ public void JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "DEPARTMENT_JOINT_REVIEW")
+ public void PRELIMINARY_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_FAILED")
+ public void PRELIMINARY_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode());
+ }
+
+ @OnTransition(source = "PREQUALIFICATION_FAILED", target = "PENDING_PREQUALIFICATION_CHOICE")
+ public void PRELIMINARY_REVIEW_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_WITHDRAW_CHOICE")
+ public void PRE_APPLYING_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE.getCode());
+ }
+
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "IN_THE_ANNUAL_PLAN")
+ public void DEPARTMENT_UNITED_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
+ }
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "DEPARTMENT_JOINT_REVIEW_FAILED")
+ public void DEPARTMENT_UNITED_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED.getCode());
+ }
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "PRE_APPLYING")
+ public void DEPARTMENT_JOINT_REVIEW_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
+ }
+
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "PLAN_TO_BE_DECLARED")
+ public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
+ }
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "BE_SUSPENDED")
+ public void ANNUAL_PLAN_SUSPEND(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.BE_SUSPENDED.getCode());
+ }
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "DEPARTMENT_JOINT_REVIEW")
+ public void IN_THE_ANNUAL_PLAN_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode());
+ }
+
+
+ @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "SCHEME_UNDER_REVIEW")
+ public void DECLARE_PLAN(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "IN_THE_ANNUAL_PLAN")
+ public void PLAN_TO_DECLARE_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW")
+ public void DECLARE_PLAN_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED")
+ public void PLAN_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "SCHEME_REVIEW_FAILED")
+ public void PLAN_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW")
+ public void PLAN_REVIEW_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "PLAN_TO_BE_DECLARED")
+ public void SCHEME_UNDER_REVIEW_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
+ }
+
+
+ @OnTransition(source = "TO_BE_APPROVED", target = "TO_BE_PURCHASED")
+ public void PROJECT_APPROVAL(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ // 待立项批复批复后,项目一级状态变更为已立项
+ project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
+ project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
+ }
+
+ @OnTransition(source = "TO_BE_APPROVED", target = "SCHEME_UNDER_REVIEW")
+ public void TO_BE_APPROVED_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+
+ @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION")
+ public void PURCHASE_PUT_ON_RECORD(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.OPERATION.getCode());
+ }
+ @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION")
+ public void START_TO_WORK(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
+ }
+
+ @OnTransition(source = "TO_BE_PURCHASED", target = "TO_BE_APPROVED")
+ public void TO_BE_PURCHASED_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ // 待采购状态撤回后,项目一级状态回退到未立项
+ project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
+ project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode());
+ }
+
+
+ @OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_FINALLY_INSPECTED")
+ public void PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode());
+ }
+
+ @OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_PURCHASED")
+ public void UNDER_CONSTRUCTION_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
+ }
+
+
+ @OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW")
+ public void FINAL_ACCEPTANCE_APPLICATION(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "UNDER_CONSTRUCTION")
+ public void TO_BE_FINALLY_INSPECTED_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
+ }
+
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "ARCHIVED")
+ public void FINAL_ACCEPTANCE_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ // 终验审核通过后,项目一级状态变更为已归档
+ project.setStage(ProjectStatusEnum.ARCHIVED.getCode());
+ project.setStatus(ProjectStatusEnum.ACCEPTED.getCode());
+ }
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_REVIEW_FAILED")
+ public void FINAL_ACCEPTANCE_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode());
+ }
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW")
+ public void FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_REVIEW_FAILED", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW")
+ public void FINAL_RE_ACCEPTANCE_APPLICATION(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode());
+ }
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareJYAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareJYAction.java
new file mode 100644
index 0000000..80ceaa4
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareJYAction.java
@@ -0,0 +1,279 @@
+package com.hz.pm.api.common.statemachine.action;
+
+import com.hz.pm.api.common.constant.StateMachineConst;
+import com.hz.pm.api.common.statemachine.contants.RegionContant;
+import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
+import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
+import com.hz.pm.api.projectlib.model.entity.Project;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.messaging.Message;
+import org.springframework.statemachine.annotation.OnTransition;
+import org.springframework.statemachine.annotation.WithStateMachine;
+
+/**
+ * 项目申报状态机action集合类
+ * 缙云县
+ * @author CMM
+ * @since 2023/02/08 13:48
+ */
+@Slf4j
+@WithStateMachine(id = RegionContant.LS_JY_CODE)
+public class ProjectDeclareJYAction {
+
+ private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE;
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION")
+ public void UNDER_INTERNAL_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "UNDER_INTERNAL_AUDIT_NOT_PASS")
+ public void UNDER_INTERNAL_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "TO_BE_DECLARED")
+ public void UNDER_INTERNAL_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT_NOT_PASS", target = "UNDER_INTERNAL_AUDIT")
+ public void UNDER_INTERNAL_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
+ }
+
+
+ @OnTransition(source = "PENDING_PREQUALIFICATION", target = "PENDING_PREQUALIFICATION_CHOICE")
+ public void PRELIMINARY_REVIEW_DECLARE(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
+ }
+
+ @OnTransition(source = "PENDING_PREQUALIFICATION", target = "UNDER_INTERNAL_AUDIT")
+ public void PENDING_PREQUALIFICATION_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
+ }
+
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS")
+ public void PROVINCIAL_DEPARTMENT_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS", target = "PRE_APPLYING")
+ public void PROVINCIAL_PASS_TO_PRELIMINARY_REVIEW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED")
+ public void PROVINCIAL_DEPARTMENT_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "PENDING_PREQUALIFICATION")
+ public void JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "DEPARTMENT_JOINT_REVIEW")
+ public void PRELIMINARY_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_FAILED")
+ public void PRELIMINARY_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode());
+ }
+
+ @OnTransition(source = "PREQUALIFICATION_FAILED", target = "PENDING_PREQUALIFICATION_CHOICE")
+ public void PRELIMINARY_REVIEW_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_WITHDRAW_CHOICE")
+ public void PRE_APPLYING_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE.getCode());
+ }
+
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "IN_THE_ANNUAL_PLAN")
+ public void DEPARTMENT_UNITED_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
+ }
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "DEPARTMENT_JOINT_REVIEW_FAILED")
+ public void DEPARTMENT_UNITED_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED.getCode());
+ }
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "PRE_APPLYING")
+ public void DEPARTMENT_JOINT_REVIEW_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
+ }
+
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "PLAN_TO_BE_DECLARED")
+ public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
+ }
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "BE_SUSPENDED")
+ public void ANNUAL_PLAN_SUSPEND(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.BE_SUSPENDED.getCode());
+ }
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "DEPARTMENT_JOINT_REVIEW")
+ public void IN_THE_ANNUAL_PLAN_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode());
+ }
+
+
+ @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "SCHEME_UNDER_REVIEW")
+ public void DECLARE_PLAN(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "IN_THE_ANNUAL_PLAN")
+ public void PLAN_TO_DECLARE_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW")
+ public void DECLARE_PLAN_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "TO_BE_APPROVED")
+ public void PLAN_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "SCHEME_REVIEW_FAILED")
+ public void PLAN_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_REVIEW_FAILED", target = "SCHEME_UNDER_REVIEW")
+ public void PLAN_REVIEW_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "SCHEME_UNDER_REVIEW", target = "PLAN_TO_BE_DECLARED")
+ public void SCHEME_UNDER_REVIEW_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
+ }
+
+
+ @OnTransition(source = "TO_BE_APPROVED", target = "TO_BE_PURCHASED")
+ public void PROJECT_APPROVAL(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ // 待立项批复批复后,项目一级状态变更为已立项
+ project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
+ project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
+ }
+
+ @OnTransition(source = "TO_BE_APPROVED", target = "SCHEME_UNDER_REVIEW")
+ public void TO_BE_APPROVED_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "TO_BE_PURCHASED", target = "OPERATION")
+ public void PURCHASE_PUT_ON_RECORD(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.OPERATION.getCode());
+ }
+
+ @OnTransition(source = "OPERATION", target = "UNDER_CONSTRUCTION")
+ public void START_TO_WORK(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
+ }
+
+ @OnTransition(source = "TO_BE_PURCHASED", target = "TO_BE_APPROVED")
+ public void TO_BE_PURCHASED_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ // 待采购状态撤回后,项目一级状态回退到未立项
+ project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
+ project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode());
+ }
+
+
+ @OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_FINALLY_INSPECTED")
+ public void PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode());
+ }
+
+ @OnTransition(source = "UNDER_CONSTRUCTION", target = "TO_BE_PURCHASED")
+ public void UNDER_CONSTRUCTION_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode());
+ }
+
+
+ @OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW")
+ public void FINAL_ACCEPTANCE_APPLICATION(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "TO_BE_FINALLY_INSPECTED", target = "UNDER_CONSTRUCTION")
+ public void TO_BE_FINALLY_INSPECTED_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode());
+ }
+
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "ARCHIVED")
+ public void FINAL_ACCEPTANCE_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ // 终验审核通过后,项目一级状态变更为已归档
+ project.setStage(ProjectStatusEnum.ARCHIVED.getCode());
+ project.setStatus(ProjectStatusEnum.ACCEPTED.getCode());
+ }
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_REVIEW_FAILED")
+ public void FINAL_ACCEPTANCE_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode());
+ }
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW")
+ public void FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "FINAL_ACCEPTANCE_REVIEW_FAILED", target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW")
+ public void FINAL_RE_ACCEPTANCE_APPLICATION(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode());
+ }
+}
diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareKFBAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareKFBAction.java
new file mode 100644
index 0000000..700c654
--- /dev/null
+++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectDeclareKFBAction.java
@@ -0,0 +1,279 @@
+package com.hz.pm.api.common.statemachine.action;
+
+import com.hz.pm.api.common.constant.StateMachineConst;
+import com.hz.pm.api.common.statemachine.contants.RegionContant;
+import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
+import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum;
+import com.hz.pm.api.projectlib.model.entity.Project;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.messaging.Message;
+import org.springframework.statemachine.annotation.OnTransition;
+import org.springframework.statemachine.annotation.WithStateMachine;
+
+/**
+ * 项目申报状态机action集合类
+ * 开发区
+ * @author CMM
+ * @since 2023/02/08 13:48
+ */
+@Slf4j
+@WithStateMachine(id = RegionContant.LS_KFQ_CODE)
+public class ProjectDeclareKFBAction {
+
+ private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE;
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "PENDING_PREQUALIFICATION")
+ public void UNDER_INTERNAL_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "UNDER_INTERNAL_AUDIT_NOT_PASS")
+ public void UNDER_INTERNAL_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT", target = "TO_BE_DECLARED")
+ public void UNDER_INTERNAL_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode());
+ }
+
+ @OnTransition(source = "UNDER_INTERNAL_AUDIT_NOT_PASS", target = "UNDER_INTERNAL_AUDIT")
+ public void UNDER_INTERNAL_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
+ }
+
+
+ @OnTransition(source = "PENDING_PREQUALIFICATION", target = "PENDING_PREQUALIFICATION_CHOICE")
+ public void PRELIMINARY_REVIEW_DECLARE(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
+ }
+
+ @OnTransition(source = "PENDING_PREQUALIFICATION", target = "UNDER_INTERNAL_AUDIT")
+ public void PENDING_PREQUALIFICATION_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
+ }
+
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS")
+ public void PROVINCIAL_DEPARTMENT_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS", target = "PRE_APPLYING")
+ public void PROVINCIAL_PASS_TO_PRELIMINARY_REVIEW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED")
+ public void PROVINCIAL_DEPARTMENT_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode());
+ }
+
+ @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS", target = "PENDING_PREQUALIFICATION")
+ public void JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "DEPARTMENT_JOINT_REVIEW")
+ public void PRELIMINARY_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_FAILED")
+ public void PRELIMINARY_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode());
+ }
+
+ @OnTransition(source = "PREQUALIFICATION_FAILED", target = "PENDING_PREQUALIFICATION_CHOICE")
+ public void PRELIMINARY_REVIEW_REJECT_RESUBMIT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
+ }
+
+ @OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_WITHDRAW_CHOICE")
+ public void PRE_APPLYING_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE.getCode());
+ }
+
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "IN_THE_ANNUAL_PLAN")
+ public void DEPARTMENT_UNITED_REVIEW_PASS(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode());
+ }
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "DEPARTMENT_JOINT_REVIEW_FAILED")
+ public void DEPARTMENT_UNITED_REVIEW_REJECT(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED.getCode());
+ }
+
+ @OnTransition(source = "DEPARTMENT_JOINT_REVIEW", target = "PRE_APPLYING")
+ public void DEPARTMENT_JOINT_REVIEW_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
+ }
+
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "PLAN_TO_BE_DECLARED")
+ public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode());
+ }
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "BE_SUSPENDED")
+ public void ANNUAL_PLAN_SUSPEND(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.BE_SUSPENDED.getCode());
+ }
+
+ @OnTransition(source = "IN_THE_ANNUAL_PLAN", target = "DEPARTMENT_JOINT_REVIEW")
+ public void IN_THE_ANNUAL_PLAN_WITHDRAW(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode());
+ }
+
+
+ @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "SCHEME_UNDER_REVIEW")
+ public void DECLARE_PLAN(Message message) {
+ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
+ project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
+ }
+
+ @OnTransition(source = "PLAN_TO_BE_DECLARED", target = "IN_THE_ANNUAL_PLAN")
+ public void PLAN_TO_DECLARE_WITHDRAW(Message