Commit f424423fa553e7cc6095e828d02efc1bc9a0be8a
1 parent
667e410c
事故车线索录入,校验手机号必填,非正常手机号拨号时直接返回该号码
Showing
4 changed files
with
13 additions
and
1 deletions
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/AccidentPoolDTO.java
fw-valhalla-server/src/test/java/cn/fw/valhalla/ValhallaAppTests.java
1 | 1 | package cn.fw.valhalla; |
2 | 2 | |
3 | +import cn.fw.common.util.ValidationUtils; | |
3 | 4 | import org.junit.jupiter.api.Test; |
4 | 5 | import org.junit.runner.RunWith; |
5 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -35,4 +36,9 @@ class ValhallaAppTests { |
35 | 36 | .andDo(MockMvcResultHandlers.print()); |
36 | 37 | } |
37 | 38 | |
39 | + @Test | |
40 | + public void phoneTest() { | |
41 | + String phone ="+8619142820251"; | |
42 | + System.out.println(ValidationUtils.checkMobile(phone)); | |
43 | + } | |
38 | 44 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CommonService.java
1 | 1 | package cn.fw.valhalla.service.bus; |
2 | 2 | |
3 | +import cn.fw.common.util.ValidationUtils; | |
3 | 4 | import cn.fw.valhalla.common.constant.RoleCode; |
4 | 5 | import cn.fw.valhalla.domain.db.customer.AccidentPool; |
5 | 6 | import cn.fw.valhalla.domain.db.customer.Customer; |
... | ... | @@ -77,6 +78,9 @@ public class CommonService { |
77 | 78 | AccidentPool accidentPool = accidentPoolService.getById(cusId); |
78 | 79 | BV.notNull(accidentPool, () -> "用户不存在"); |
79 | 80 | becallNo = accidentPool.getReportMobile(); |
81 | + if (!ValidationUtils.checkMobile(becallNo)) { | |
82 | + return becallNo; | |
83 | + } | |
80 | 84 | } else { |
81 | 85 | Customer customer = customerService.queryByIdWithInvalid(cusId); |
82 | 86 | BV.notNull(customer, () -> "用户不存在"); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/ACFollowStrategy.java
1 | 1 | package cn.fw.valhalla.service.bus.follow.strategy.impl; |
2 | 2 | |
3 | 3 | import cn.fw.common.exception.BusinessException; |
4 | +import cn.fw.common.util.ValidationUtils; | |
4 | 5 | import cn.fw.valhalla.common.utils.DateUtil; |
5 | 6 | import cn.fw.valhalla.common.utils.MobileUtil; |
6 | 7 | import cn.fw.valhalla.common.utils.StringUtils; |
... | ... | @@ -93,7 +94,7 @@ public class ACFollowStrategy extends AbstractFollowStrategy { |
93 | 94 | ACDetailVO vo = assemble(followRecord.getCustomerId()); |
94 | 95 | vo.setId(followRecord.getId()); |
95 | 96 | vo.setTaskId(followRecord.getTaskId()); |
96 | - vo.setHadCall(count > 0); | |
97 | + vo.setHadCall(count > 0 || !ValidationUtils.checkMobile(vo.getReportMobile())); | |
97 | 98 | vo.setDeadline(Objects.isNull(followRecord.getLimitTime()) ? followRecord.getDeadline() : followRecord.getLimitTime()); |
98 | 99 | return vo; |
99 | 100 | } | ... | ... |