Commit 8fb8cec5 authored by zhengyi's avatar zhengyi

获取手机号自定义规则不成功避免空指针错误,直接忽略走下一步正常逻辑

parent a97eb666
...@@ -162,7 +162,7 @@ public class PhoneUtil { ...@@ -162,7 +162,7 @@ public class PhoneUtil {
try { try {
List<DictDataRespDTO> dtos = DictFrameworkUtils.listDictDatasFromCache("phone_number_rule"); List<DictDataRespDTO> dtos = DictFrameworkUtils.listDictDatasFromCache("phone_number_rule");
if (CollUtil.isNotEmpty(dtos)) { if (CollUtil.isNotEmpty(dtos)) {
DictDataRespDTO dto = dtos.stream().filter(d -> d.getValue().trim().equals(code.trim())).findFirst().orElseGet(null); DictDataRespDTO dto = dtos.stream().filter(d -> d.getValue().trim().equals(code.trim())).findFirst().orElse(null);
if (Objects.nonNull(dto)) { if (Objects.nonNull(dto)) {
// 优先获取中文 // 优先获取中文
rule = dto.getLabel(); rule = dto.getLabel();
...@@ -171,9 +171,10 @@ public class PhoneUtil { ...@@ -171,9 +171,10 @@ public class PhoneUtil {
rule = dto.getLabelEn(); rule = dto.getLabelEn();
} }
} }
}else {
log.error("未获取到手机号自定义规则, code: %s, mobile: %s->", code, mobile);
} }
} } catch (Exception e) {
catch (Exception e) {
log.error(String.format("获取手机号规则失败, code: %s, mobile: %s->", code, mobile), e); log.error(String.format("获取手机号规则失败, code: %s, mobile: %s->", code, mobile), e);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment