Commit e88a10bd authored by fangxinjiang's avatar fangxinjiang

VO调整

parent 2fb6df10
......@@ -147,4 +147,19 @@ public class TCheckIdCardController {
public R<List<TCheckIdCard>> checkIdCardInner(@RequestBody List<TCheckIdCard> checkList) {
return tCheckIdCardService.checkIdCard(checkList);
}
/**
* @Author fxj
* @Description 校验姓名身份证 --- 单个
* @Date 16:52 2022/6/22
* @Param
* @return
**/
@Operation(description = "校验姓名身份证 --- 单个")
@SysLog("校验姓名身份证 --- 单个")
//@Inner
@PostMapping("/inner/checkIdCardSingle")
public R<TCheckIdCard> checkIdCardSingle(String idCard, String name) {
return tCheckIdCardService.checkIdCardSingle(idCard, name);
}
}
......@@ -45,4 +45,5 @@ public interface TCheckIdCardService extends IService<TCheckIdCard> {
**/
R<List<TCheckIdCard>> checkIdCard(List<TCheckIdCard> checkList);
R<TCheckIdCard> checkIdCardSingle(String idCard, String name);
}
......@@ -48,18 +48,20 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh
if (Common.isEmpty(name) || Common.isEmpty(idNum) || Common.isEmpty(cardNo)){
return R.failed(MsgUtils.getMessage(ErrorCodes.CHECKS_BANK_NO_REQUEST_PARAM_ERROR));
}
TCheckBankNo checkBankNo = baseMapper.selectOne(Wrappers.<TCheckBankNo>query().lambda()
.eq(TCheckBankNo::getBankNo,cardNo)
.eq(TCheckBankNo::getName,name)
.eq(TCheckBankNo::getIdNum,idNum)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(checkBankNo)){
return R.ok(checkBankNo);
synchronized (this){
TCheckBankNo checkBankNo = baseMapper.selectOne(Wrappers.<TCheckBankNo>query().lambda()
.eq(TCheckBankNo::getBankNo,cardNo)
.eq(TCheckBankNo::getName,name)
.eq(TCheckBankNo::getIdNum,idNum)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(checkBankNo)){
return R.ok(checkBankNo);
}
R<TCheckBankNo> res = ChecksUtil.checkBankNo(name,idNum,cardNo,mobile,canCheckService.getCanCheck());
if (Common.isNotNull(res) && Common.isNotNull(res.getData())){
baseMapper.insert(res.getData());
}
return res;
}
R<TCheckBankNo> res = ChecksUtil.checkBankNo(name,idNum,cardNo,mobile,canCheckService.getCanCheck());
if (Common.isNotNull(res) && Common.isNotNull(res.getData())){
baseMapper.insert(res.getData());
}
return res;
}
}
package com.yifu.cloud.plus.v1.check.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckApiNum;
......@@ -189,7 +190,7 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
return R.failed("数据为空!");
}
/**
/**
* @param content
* @Description: 判断身份证格式:18位数字,17位数字+X,15位数字,14位数字+X
* 格式正确返回true
......@@ -224,4 +225,26 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
return flag;
}
@Override
public R<TCheckIdCard> checkIdCardSingle(String idCard, String name) {
if (Common.isEmpty(idCard) || Common.isEmpty(name)){
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
}
synchronized (this){
TCheckIdCard checkIdCard = baseMapper.selectOne(Wrappers.<TCheckIdCard>query().lambda()
.eq(TCheckIdCard::getIdCard,idCard)
.eq(TCheckIdCard::getIsTrue,CommonConstants.ONE_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(checkIdCard)){
return R.ok(checkIdCard);
}
TCheckIdCard c = new TCheckIdCard();
c.setIdCard(idCard);
c.setName(name);
ChecksUtil.checkIdCard(c,canCheckService.getCanCheck());
baseMapper.insert(c);
return R.ok(c);
}
}
}
......@@ -54,7 +54,7 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
* @Date 19:18 2022/6/20
**/
@Override
public R<Map<String,TCheckMobile>> checkMobiles(String mobiles){
public synchronized R<Map<String,TCheckMobile>> checkMobiles(String mobiles){
R<Map<String,TCheckMobile>> mobileMapR = null;
Map<String,TCheckMobile> checkMobileMap = null;
Map<String,TCheckMobile> existMap = new HashMap<>();
......
......@@ -216,8 +216,10 @@ public interface CommonConstants {
* @Author pwang
* @Date 2020-05-14 14:10
**/
public static final int EMPLOYEE_INIT_NO_START = 7;
int EMPLOYEE_INIT_NO_START = 7;
String SAVE_FAILED = "保存失败!";
String RESULT_EMPTY = "获取结果为空";
/**
......@@ -225,6 +227,9 @@ public interface CommonConstants {
* @Date 2020-03-12 14:48
* @return
**/
public static final String RESULT_DATA_FAIL= "操作失败";
String RESULT_DATA_FAIL= "操作失败";
String SAVE_SUCCESS = "保存成功!";
String PARAM_IS_NOT_EMPTY = "参数不可为空";
}
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