Commit 199f9868 by 崔彦峰

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

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