Commit f424423fa553e7cc6095e828d02efc1bc9a0be8a

Authored by 张志伟
1 parent 667e410c

:sparkles: 事故车线索录入,校验手机号必填,非正常手机号拨号时直接返回该号码

fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/AccidentPoolDTO.java
... ... @@ -29,6 +29,7 @@ public class AccidentPoolDTO {
29 29 /**
30 30 * 报案手机号
31 31 */
  32 + @NotBlank(message = "报案手机号不能为空")
32 33 private String reportMobile;
33 34 /**
34 35 * 车牌号
... ...
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 }
... ...