Commit 2b512020 by 章家宝

feat:本系统的业务类型与其他系统的业务类型做映射

1 parent 41e269e4
...@@ -31,10 +31,31 @@ public class MerchantHrbpRelationService { ...@@ -31,10 +31,31 @@ public class MerchantHrbpRelationService {
private RecruitmentDemandRemote recruitmentDemandRemote; private RecruitmentDemandRemote recruitmentDemandRemote;
/** /**
* 本系统业务类型映射到远程接口业务类型
* 本系统: 1=延保, 2=轻改, 3=权益
* 远程接口: 1=延保, 2=权益, 3=轻改
*/
private Integer mapToRemoteBusinessType(Byte localBusinessType) {
if (localBusinessType == null) {
return null;
}
switch (localBusinessType) {
case 1: // 延保 -> 延保
return 1;
case 2: // 轻改 -> 轻改(远程为3)
return 3;
case 3: // 权益 -> 权益(远程为2)
return 2;
default:
return (int) localBusinessType;
}
}
/**
* 基于省份获取HRBP映射 * 基于省份获取HRBP映射
* *
* @param provinceNames 省份名称集合 * @param provinceNames 省份名称集合
* @param businessType 业务类型,用于过滤匹配的HRBP配置 * @param businessType 业务类型(本系统编码:1=延保, 2=轻改, 3=权益),用于过滤匹配的HRBP配置
* @return provinceName -> (hrbpName, hrbpPhone) * @return provinceName -> (hrbpName, hrbpPhone)
*/ */
public Map<String, Pair<String, String>> buildProvinceToHrbpMap(Set<String> provinceNames, Byte businessType) { public Map<String, Pair<String, String>> buildProvinceToHrbpMap(Set<String> provinceNames, Byte businessType) {
...@@ -43,6 +64,8 @@ public class MerchantHrbpRelationService { ...@@ -43,6 +64,8 @@ public class MerchantHrbpRelationService {
} }
long startMs = System.currentTimeMillis(); long startMs = System.currentTimeMillis();
Map<String, Pair<String, String>> result = new HashMap<>(); Map<String, Pair<String, String>> result = new HashMap<>();
// 映射业务类型到远程接口编码
Integer remoteBusinessType = mapToRemoteBusinessType(businessType);
try { try {
RecruitmentProvinceHrbpRelation condition = new RecruitmentProvinceHrbpRelation(); RecruitmentProvinceHrbpRelation condition = new RecruitmentProvinceHrbpRelation();
RpcResponse<List<RecruitmentProvinceHrbpRelation>> response = RpcResponse<List<RecruitmentProvinceHrbpRelation>> response =
...@@ -51,7 +74,7 @@ public class MerchantHrbpRelationService { ...@@ -51,7 +74,7 @@ public class MerchantHrbpRelationService {
response.getResult().forEach(relation -> { response.getResult().forEach(relation -> {
// 业务类型过滤:仅当 businessType 不为空且不匹配时跳过 // 业务类型过滤:仅当 businessType 不为空且不匹配时跳过
if (relation.getBusinessType() != null if (relation.getBusinessType() != null
&& !Objects.equals(Byte.valueOf(relation.getBusinessType()), businessType)) { && !Objects.equals(Integer.valueOf(relation.getBusinessType()), remoteBusinessType)) {
return; return;
} }
// 处理全国通用配置 // 处理全国通用配置
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!