Commit 199f9868 by 崔彦峰

feat(recruitment): 完善招聘需求服务中的省份代码处理逻辑

- 添加了省份代码变量初始化
- 从商户信息中获取省份代码并赋值
- 解析省份城市代码字符串提取省份代码
- 在查询HRBP时增加省份代码非空校验避免空指针异常
1 parent 76a17340
...@@ -238,6 +238,7 @@ public class RecruitmentDemandService { ...@@ -238,6 +238,7 @@ public class RecruitmentDemandService {
// 查询门店省市信息 // 查询门店省市信息
String merchantId = dto.getMerchantId(); String merchantId = dto.getMerchantId();
String provinceName = null; String provinceName = null;
String provinceCode = null;
boolean bySystemMerchant = !Boolean.FALSE.equals(dto.getBySystemMerchant()); boolean bySystemMerchant = !Boolean.FALSE.equals(dto.getBySystemMerchant());
if (bySystemMerchant) { if (bySystemMerchant) {
// 通过系统门店创建:查询门店省市信息 // 通过系统门店创建:查询门店省市信息
...@@ -275,6 +276,7 @@ public class RecruitmentDemandService { ...@@ -275,6 +276,7 @@ public class RecruitmentDemandService {
if (StringUtils.isNotBlank(merchant.getMerchantAddress())) { if (StringUtils.isNotBlank(merchant.getMerchantAddress())) {
dto.setMerchantAddressDetail(merchant.getMerchantAddress()); dto.setMerchantAddressDetail(merchant.getMerchantAddress());
} }
provinceCode = merchant.getProvinceCode().toString();
} }
} }
} }
...@@ -292,6 +294,10 @@ public class RecruitmentDemandService { ...@@ -292,6 +294,10 @@ public class RecruitmentDemandService {
dto.setProvinceCity(dto.getMerchantAddress()); dto.setProvinceCity(dto.getMerchantAddress());
// 省份信息取入参中的 province,用于后续查询技术督导 // 省份信息取入参中的 province,用于后续查询技术督导
provinceName = dto.getProvince(); provinceName = dto.getProvince();
String[] provinceCityCode = dto.getProvinceCityCode().split("/");
if (provinceCityCode.length > 1) {
provinceCode = provinceCityCode[0];
}
} }
//二手车、轻改、窗膜技师、三膜技师、车衣技师、精品技师、洗车工 //二手车、轻改、窗膜技师、三膜技师、车衣技师、精品技师、洗车工
...@@ -312,9 +318,8 @@ public class RecruitmentDemandService { ...@@ -312,9 +318,8 @@ public class RecruitmentDemandService {
//根据业务、省份查询HRBP //根据业务、省份查询HRBP
else if (RecruitmentDemandBusinessTypeEnum.EXTENDED_WARRANTY.getValue().equals(businessType) else if (RecruitmentDemandBusinessTypeEnum.EXTENDED_WARRANTY.getValue().equals(businessType)
|| RecruitmentDemandBusinessTypeEnum.RIGHTS.getValue().equals(businessType) || RecruitmentDemandBusinessTypeEnum.RIGHTS.getValue().equals(businessType)
|| RecruitmentDemandBusinessTypeEnum.RIGHTS_EXTENDED_WARRANTY.getValue().equals(businessType)){ || RecruitmentDemandBusinessTypeEnum.RIGHTS_EXTENDED_WARRANTY.getValue().equals(businessType)) {
String[] provinceCityCode = dto.getProvinceCityCode().split("/"); if (StringUtils.isNotBlank(provinceCode)) {
String provinceCode = provinceCityCode[0];
Example hrbpRelation = new Example(RecruitmentProvinceHrbpRelation.class); Example hrbpRelation = new Example(RecruitmentProvinceHrbpRelation.class);
hrbpRelation.createCriteria().andEqualTo("businessType", businessType).andEqualTo("provinceCode", provinceCode); hrbpRelation.createCriteria().andEqualTo("businessType", businessType).andEqualTo("provinceCode", provinceCode);
List<RecruitmentProvinceHrbpRelation> hrbpRelations = provinceHrbpRelationMapper.selectByExample(hrbpRelation); List<RecruitmentProvinceHrbpRelation> hrbpRelations = provinceHrbpRelationMapper.selectByExample(hrbpRelation);
...@@ -323,6 +328,7 @@ public class RecruitmentDemandService { ...@@ -323,6 +328,7 @@ public class RecruitmentDemandService {
dto.setRecruiterPhone(hrbpRelations.get(0).getHrbpPhone()); dto.setRecruiterPhone(hrbpRelations.get(0).getHrbpPhone());
} }
} }
}
// 根据省份查询技术督导(仅针对特定业务类型:窗膜技师、三膜技师、车衣技师、精品技师) // 根据省份查询技术督导(仅针对特定业务类型:窗膜技师、三膜技师、车衣技师、精品技师)
if (StringUtils.isNotBlank(provinceName) && RecruitmentDemandBusinessTypeEnum.needsTechnicalSupervisor(businessType)) { if (StringUtils.isNotBlank(provinceName) && RecruitmentDemandBusinessTypeEnum.needsTechnicalSupervisor(businessType)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!