Commit 2b512020 by 章家宝

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

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