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,6 +29,7 @@ public class AccidentPoolDTO {
29 /** 29 /**
30 * 报案手机号 30 * 报案手机号
31 */ 31 */
  32 + @NotBlank(message = "报案手机号不能为空")
32 private String reportMobile; 33 private String reportMobile;
33 /** 34 /**
34 * 车牌号 35 * 车牌号
fw-valhalla-server/src/test/java/cn/fw/valhalla/ValhallaAppTests.java
1 package cn.fw.valhalla; 1 package cn.fw.valhalla;
2 2
  3 +import cn.fw.common.util.ValidationUtils;
3 import org.junit.jupiter.api.Test; 4 import org.junit.jupiter.api.Test;
4 import org.junit.runner.RunWith; 5 import org.junit.runner.RunWith;
5 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,4 +36,9 @@ class ValhallaAppTests { @@ -35,4 +36,9 @@ class ValhallaAppTests {
35 .andDo(MockMvcResultHandlers.print()); 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 package cn.fw.valhalla.service.bus; 1 package cn.fw.valhalla.service.bus;
2 2
  3 +import cn.fw.common.util.ValidationUtils;
3 import cn.fw.valhalla.common.constant.RoleCode; 4 import cn.fw.valhalla.common.constant.RoleCode;
4 import cn.fw.valhalla.domain.db.customer.AccidentPool; 5 import cn.fw.valhalla.domain.db.customer.AccidentPool;
5 import cn.fw.valhalla.domain.db.customer.Customer; 6 import cn.fw.valhalla.domain.db.customer.Customer;
@@ -77,6 +78,9 @@ public class CommonService { @@ -77,6 +78,9 @@ public class CommonService {
77 AccidentPool accidentPool = accidentPoolService.getById(cusId); 78 AccidentPool accidentPool = accidentPoolService.getById(cusId);
78 BV.notNull(accidentPool, () -> "用户不存在"); 79 BV.notNull(accidentPool, () -> "用户不存在");
79 becallNo = accidentPool.getReportMobile(); 80 becallNo = accidentPool.getReportMobile();
  81 + if (!ValidationUtils.checkMobile(becallNo)) {
  82 + return becallNo;
  83 + }
80 } else { 84 } else {
81 Customer customer = customerService.queryByIdWithInvalid(cusId); 85 Customer customer = customerService.queryByIdWithInvalid(cusId);
82 BV.notNull(customer, () -> "用户不存在"); 86 BV.notNull(customer, () -> "用户不存在");
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/ACFollowStrategy.java
1 package cn.fw.valhalla.service.bus.follow.strategy.impl; 1 package cn.fw.valhalla.service.bus.follow.strategy.impl;
2 2
3 import cn.fw.common.exception.BusinessException; 3 import cn.fw.common.exception.BusinessException;
  4 +import cn.fw.common.util.ValidationUtils;
4 import cn.fw.valhalla.common.utils.DateUtil; 5 import cn.fw.valhalla.common.utils.DateUtil;
5 import cn.fw.valhalla.common.utils.MobileUtil; 6 import cn.fw.valhalla.common.utils.MobileUtil;
6 import cn.fw.valhalla.common.utils.StringUtils; 7 import cn.fw.valhalla.common.utils.StringUtils;
@@ -93,7 +94,7 @@ public class ACFollowStrategy extends AbstractFollowStrategy { @@ -93,7 +94,7 @@ public class ACFollowStrategy extends AbstractFollowStrategy {
93 ACDetailVO vo = assemble(followRecord.getCustomerId()); 94 ACDetailVO vo = assemble(followRecord.getCustomerId());
94 vo.setId(followRecord.getId()); 95 vo.setId(followRecord.getId());
95 vo.setTaskId(followRecord.getTaskId()); 96 vo.setTaskId(followRecord.getTaskId());
96 - vo.setHadCall(count > 0); 97 + vo.setHadCall(count > 0 || !ValidationUtils.checkMobile(vo.getReportMobile()));
97 vo.setDeadline(Objects.isNull(followRecord.getLimitTime()) ? followRecord.getDeadline() : followRecord.getLimitTime()); 98 vo.setDeadline(Objects.isNull(followRecord.getLimitTime()) ? followRecord.getDeadline() : followRecord.getLimitTime());
98 return vo; 99 return vo;
99 } 100 }