...
|
...
|
@@ -93,6 +93,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
@Autowired
|
|
|
UnionShareUserBankMapper unionShareUserBankMapper;
|
|
|
@Autowired
|
|
|
UnionShareUserIdentityCardMapper unionShareUserIdentityCardMapper;
|
|
|
@Autowired
|
|
|
UnionShareUserApplyMapper unionShareUserApplyMapper;
|
|
|
@Autowired
|
|
|
UnionShareOrdersActivityLogsMapper unionShareOrdersActivityLogsMapper;
|
...
|
...
|
@@ -169,6 +171,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
private String USER_SETTLEMENT_HASSETTLEMENT = "hasSettlement";
|
|
|
private String USER_SETTLEMENT_BANKCARD = "bankCard";
|
|
|
private String USER_SETTLEMENT_BANKCARD_UFO = "bankCardUfo";
|
|
|
private String USER_SETTLEMENT_IDENTITYCARD = "identityCard";
|
|
|
|
|
|
//马甲随机增预操作key
|
|
|
private static String VIRTUAL_ADD_KEY = "yh:union:share:virtual:add";
|
...
|
...
|
@@ -1315,6 +1318,25 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
return bo;
|
|
|
}
|
|
|
|
|
|
public void checkUserIdentityCard(UnionShareUserIdentityCardBo bo) {
|
|
|
// 校验姓名
|
|
|
if (!ChineseNameUtils.checkName(bo.getName())) {
|
|
|
throw new ServiceException(ServiceError.UNION_CHINESE_NAME_ERROR);
|
|
|
}
|
|
|
// 校验身份证
|
|
|
if (!checkIdCard(bo.getIdCardNo())) {
|
|
|
throw new ServiceException(ServiceError.UNION_IDCARD_ERROR);
|
|
|
}
|
|
|
// 校验身份证图片
|
|
|
if (!checkBankCard(bo.getCardFrontUrl())) {
|
|
|
throw new ServiceException(ServiceError.UNION_IDENTITYCARD_FRONT_IMAGE_ERROR);
|
|
|
}
|
|
|
// 校验身份证图片
|
|
|
if (!checkBankCard(bo.getCardBackUrl())) {
|
|
|
throw new ServiceException(ServiceError.UNION_IDENTITYCARD_BACK_IMAGE_ERROR);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private boolean checkIdCard(String idcard) {
|
|
|
return IDCardUtil.isIDCard(idcard);
|
|
|
}
|
...
|
...
|
@@ -3681,4 +3703,51 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
logger.info("setVirtualAddToRedis.add to redis,addBo is {}",addBo);
|
|
|
redisValueCache.set(VIRTUAL_ADD_KEY,addBo,50,TimeUnit.HOURS);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新增身份证信息
|
|
|
*/
|
|
|
@Override
|
|
|
public int insertUserIdentityCard(UnionShareUserIdentityCardBo bo){
|
|
|
logger.info("insertUserIdentityCard, bo is {}",bo);
|
|
|
if (null == bo||bo.getUid()<0) {
|
|
|
return 0;
|
|
|
}
|
|
|
//信息格式校验
|
|
|
checkUserIdentityCard(bo);
|
|
|
UnionShareUserIdentityCard identityCard = new UnionShareUserIdentityCard();
|
|
|
BeanUtils.copyProperties(bo, identityCard);
|
|
|
identityCard.setStatus((byte)1);
|
|
|
identityCard.setCreateTime(DateUtil.getCurrentTimeSecond());
|
|
|
identityCard.setUpdateTime(identityCard.getCreateTime());
|
|
|
int result = unionShareUserIdentityCardMapper.insert(identityCard);
|
|
|
redisHashCache.delete(ShareOrdersKeyEnum.USER_SETTLEMENT.getPreKey(), bo.getUid());
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public UnionShareUserIdentityCardBo getUserIdentityCard(Integer uid){
|
|
|
logger.info("getUserIdentityCard, uid is {}", uid);
|
|
|
if (uid==null || uid < 1) {
|
|
|
return null;
|
|
|
}
|
|
|
String hashkey = USER_SETTLEMENT_IDENTITYCARD;
|
|
|
UnionShareUserIdentityCardBo cacheResult = getFromRedis(ShareOrdersKeyEnum.USER_SETTLEMENT, uid, UnionShareUserIdentityCardBo.class, hashkey);
|
|
|
if (cacheResult != null) {
|
|
|
logger.info("getUserIdentityCard end, get redis cache ,uid is {},cacheResult is {}",uid,cacheResult);
|
|
|
return cacheResult;
|
|
|
}
|
|
|
UnionShareUserBank req = new UnionShareUserBank();
|
|
|
req.setUid(uid);
|
|
|
req.setStatus((byte)1);
|
|
|
UnionShareUserIdentityCard identityCard = unionShareUserIdentityCardMapper.selectByUid(uid);
|
|
|
if (identityCard==null) {
|
|
|
return null;
|
|
|
}
|
|
|
UnionShareUserIdentityCardBo result = new UnionShareUserIdentityCardBo();
|
|
|
BeanUtils.copyProperties(identityCard, result);
|
|
|
addToRedis(ShareOrdersKeyEnum.USER_SETTLEMENT, uid, result, hashkey);
|
|
|
logger.info("getBankCard end,set redis cache ,uid is {},hashkey is {},IdentityCard is {}",uid,hashkey,result);
|
|
|
return result;
|
|
|
}
|
|
|
} |
...
|
...
|
|