Commit efa04039 authored by hongguangwu's avatar hongguangwu

MVP1.7.14-手机号编辑

parent 2452ffca
......@@ -613,7 +613,8 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
if (a != null && a.getData() != null) {
checkMobile = a.getData();
if (checkMobile != null && Common.isNotNull(checkMobile.getStatus())) {
if (!CommonConstants.ONE_STRING.equals(checkMobile.getStatus())) {
if (!CommonConstants.ONE_STRING.equals(checkMobile.getStatus())
&& !CommonConstants.FOUR_STRING.equals(checkMobile.getStatus())) {
return pre + checkMobile.getMessage();
}
} else {
......@@ -1192,6 +1193,9 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
// 2024-2-4 16:05:56 hgw 银行卡需要校验
String pre = getCheckBankNo(tSalaryEmployee, old);
if (pre != null) {return R.failed(pre);}
// 2025-8-4 10:00:21 hgw 手机号需要校验,且与卡号校验不一样,无论改不改,都校验,且校验重复性
String prePhone = getCheckPhone(tSalaryEmployee);
if (prePhone != null) {return R.failed(prePhone);}
// 变更日志 fxj 2023-10-24
logService.initModLog(tSalaryEmployee,old,CommonConstants.ZERO_STRING,user.getNickname(),null);
......@@ -1235,6 +1239,41 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
return null;
}
/**
* @Description: 单个校验手机号通用方法
* @Author: hgw
* @Date: 2025-8-4 10:18:41
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
private String getCheckPhone(TSalaryEmployee employee) {
if (Common.isNotNull(employee.getEmpPhone()) && Common.isNotNull(employee.getEmpIdcard())) {
// 先校验重复性:
TSalaryEmployee one = baseMapper.selectOne(Wrappers.<TSalaryEmployee>query().lambda()
.ne(TSalaryEmployee::getEmpIdcard, employee.getEmpIdcard())
.eq(TSalaryEmployee::getEmpPhone, employee.getEmpPhone()).last(CommonConstants.LAST_ONE_SQL));
if (one != null) {
return "手机号已被占用,请更改手机号后重试";
}
// 调用校验服务-校验手机号
TCheckMobile checkMobile = new TCheckMobile();
checkMobile.setMobile(employee.getEmpPhone());
R<TCheckMobile> a = HttpDaprUtil.invokeMethodPost(checkProperties.getAppUrl(), checkProperties.getAppId()
, "/tcheckmobile/inner/checkOneMobile", checkMobile, TCheckMobile.class, SecurityConstants.FROM_IN);
if (a != null && a.getData() != null) {
checkMobile = a.getData();
if (checkMobile != null && Common.isNotNull(checkMobile.getStatus())) {
if (!CommonConstants.ONE_STRING.equals(checkMobile.getStatus())
&& !CommonConstants.FOUR_STRING.equals(checkMobile.getStatus())) {
return "手机号校验不通过,请更改手机号后重试";
}
} else {
return "手机号校验不通过,请更改手机号后重试!";
}
}
}
return null;
}
/**
* @param empIdCard 身份证
* @Description: C端预入职获取计税月份
......
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