...
|
...
|
@@ -168,6 +168,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
private String USER_SETTLEMENT_HISTORYSETTLEAMOUNT = "historySettleAmount";
|
|
|
private String USER_SETTLEMENT_HASSETTLEMENT = "hasSettlement";
|
|
|
private String USER_SETTLEMENT_BANKCARD = "bankCard";
|
|
|
private String USER_SETTLEMENT_BANKCARD_UFO = "bankCardUfo";
|
|
|
|
|
|
//马甲随机增预操作key
|
|
|
private static String VIRTUAL_ADD_KEY = "yh:union:share:virtual:add";
|
...
|
...
|
@@ -215,7 +216,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
|
|
|
private boolean hasBankCard(int uid) {
|
|
|
logger.info("hasBankCard enter,uid is {}",uid);
|
|
|
UnionShareUserBankBo bo = getBankCard(uid);
|
|
|
UnionShareUserBankBo bo = getBankCard(uid,0);
|
|
|
if (null == bo) {
|
|
|
//存redis
|
|
|
return false;
|
...
|
...
|
@@ -1201,34 +1202,43 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
}
|
|
|
//信息格式校验
|
|
|
checkAndBuildBankCard(bo);
|
|
|
//查询该用户是否为特邀用户
|
|
|
int count = unionShareUserMapper.selectCountByUid(bo.getUid());
|
|
|
if (count == 0) {
|
|
|
//不是特邀用户
|
|
|
logger.info("bindBankCard end,can not find unionType,bo is {}",bo);
|
|
|
throw new ServiceException(ServiceError.UNION_UID_ERROR);
|
|
|
}
|
|
|
//查询该用户是否为特邀用户,checkAndBuildBankCard中已经检查过了
|
|
|
// int count = unionShareUserMapper.selectCountByUid(bo.getUid());
|
|
|
// if (count == 0) {
|
|
|
// //不是特邀用户
|
|
|
// logger.info("bindBankCard end,can not find unionType,bo is {}",bo);
|
|
|
// throw new ServiceException(ServiceError.UNION_UID_ERROR);
|
|
|
// }
|
|
|
UnionShareUserBank insertReq = new UnionShareUserBank();
|
|
|
BeanUtils.copyProperties(bo, insertReq);
|
|
|
insertReq.setStatus((byte)1);
|
|
|
if (bo.getSource()!=null&&1 == bo.getSource()) {
|
|
|
insertReq.setSource((byte)1);
|
|
|
}
|
|
|
insertReq.setCreateTime(DateUtil.getCurrentTimeSecond());
|
|
|
insertReq.setUpdateTime(insertReq.getCreateTime());
|
|
|
int result = unionShareUserBankMapper.insertSelective(insertReq);
|
|
|
redisHashCache.delete(ShareOrdersKeyEnum.USER_SETTLEMENT.getPreKey(),bo.getUid());
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询绑定银行卡
|
|
|
* @param uid
|
|
|
* @param source 2-ufo 姓名不需要隐位,1-有赚自己的请求,0-判断是否有银行卡时带过来的
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public UnionShareUserBankBo getBankCard(int uid){
|
|
|
logger.info("getBankCard,uid is {}",uid);
|
|
|
public UnionShareUserBankBo getBankCard(int uid,int source){
|
|
|
logger.info("getBankCard,uid is {},source is {}",uid,source);
|
|
|
if (uid < 1) {
|
|
|
return null;
|
|
|
}
|
|
|
UnionShareUserBankBo cacheResult = getFromRedis(ShareOrdersKeyEnum.USER_SETTLEMENT, uid, UnionShareUserBankBo.class, USER_SETTLEMENT_BANKCARD);
|
|
|
String hashkey = USER_SETTLEMENT_BANKCARD;
|
|
|
if (source == 2) {
|
|
|
hashkey = USER_SETTLEMENT_BANKCARD_UFO;
|
|
|
}
|
|
|
UnionShareUserBankBo cacheResult = getFromRedis(ShareOrdersKeyEnum.USER_SETTLEMENT, uid, UnionShareUserBankBo.class, hashkey);
|
|
|
if (cacheResult != null) {
|
|
|
logger.info("getBankCard end,get redis cache ,uid is {},cacheResult is {}",uid,cacheResult);
|
|
|
return cacheResult;
|
...
|
...
|
@@ -1242,14 +1252,18 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
return null;
|
|
|
}
|
|
|
UnionShareUserBankBo result = new UnionShareUserBankBo();
|
|
|
result.setName(StringHideUtils.hideTailString(list.get(0).getName(),1,1));
|
|
|
if (source == 2) {
|
|
|
result.setName(list.get(0).getName());
|
|
|
} else {
|
|
|
result.setName(StringHideUtils.hideTailString(list.get(0).getName(),1,1));
|
|
|
}
|
|
|
// result.setBankCardNo(StringHideUtils.hideSubString(list.get(0).getBankCardNo(),11));
|
|
|
result.setBankCardNo(list.get(0).getBankCardNo().substring(list.get(0).getBankCardNo().length()-4));
|
|
|
result.setBankName(list.get(0).getBankName());
|
|
|
result.setIdCardNo(list.get(0).getIdCardNo());
|
|
|
result.setBankBranch(list.get(0).getBankBranch());
|
|
|
addToRedis(ShareOrdersKeyEnum.USER_SETTLEMENT,uid,result,USER_SETTLEMENT_BANKCARD);
|
|
|
logger.info("getBankCard end,set redis cache ,uid is {},cacheKey is {},bankCard is {}",uid,USER_SETTLEMENT_BANKCARD,result);
|
|
|
addToRedis(ShareOrdersKeyEnum.USER_SETTLEMENT,uid,result,hashkey);
|
|
|
logger.info("getBankCard end,set redis cache ,uid is {},hashkey is {},bankCard is {}",uid,hashkey,result);
|
|
|
return result;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1282,6 +1296,10 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
if (null == bo.getBankName()) {
|
|
|
throw new ServiceException(ServiceError.UNION_BANK_CODE_ERROR);
|
|
|
}
|
|
|
if (bo.getSource()!=null&&1 == bo.getSource()) {
|
|
|
//普通yoho用户,可能来自ufo请求
|
|
|
return bo;
|
|
|
}
|
|
|
//查询该用户是否为特邀用户
|
|
|
int count = unionShareUserMapper.selectCountByUid(bo.getUid());
|
|
|
if (count == 0) {
|
...
|
...
|
|