实名认证需要补充省、市、及开户行
This commit is contained in:
parent
1e3e9ad7c0
commit
428d7c5213
|
|
@ -35,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -153,7 +154,7 @@ public class AppController {
|
|||
@ResponseBody
|
||||
@Debounce(interval = 60000, value = "#auth.certNum")
|
||||
public Result realNameAuth(@RequestAttribute("userId") Long userId, @RequestBody AuthDTO auth) {
|
||||
return realNameAuth(userId, auth.getCertName(), auth.getCertNum(), auth.getAccountNo(), auth.getMobile());
|
||||
return realNameAuth(userId, auth.getCertName(), auth.getCertNum(), auth.getAccountNo(), auth.getMobile(), auth.getProvince(), auth.getCity(), auth.getBankBranch());
|
||||
}
|
||||
|
||||
@Login
|
||||
|
|
@ -162,10 +163,13 @@ public class AppController {
|
|||
@ResponseBody
|
||||
@Debounce(interval = 3000, value = "#userId")
|
||||
public Result realNameAuth(@RequestAttribute("userId") Long userId,
|
||||
@RequestParam String certName,
|
||||
@RequestParam String certNum,
|
||||
@RequestParam String accountNo,
|
||||
@RequestParam String mobile
|
||||
@RequestParam String certName,
|
||||
@RequestParam String certNum,
|
||||
@RequestParam String accountNo,
|
||||
@RequestParam String mobile,
|
||||
@RequestParam String province,
|
||||
@RequestParam String city,
|
||||
@RequestParam String bankBranch
|
||||
) {
|
||||
// 判断身份证号是否有空格
|
||||
if (certNum.contains(" ")) {
|
||||
|
|
@ -177,7 +181,17 @@ public class AppController {
|
|||
if (StrUtil.isAllBlank(certName, certNum, accountNo, mobile)) {
|
||||
return Result.error("真实姓名、身份证号码、银行卡号、银行预留手机号缺一不可");
|
||||
}
|
||||
if (StrUtil.isAllBlank(province, city, bankBranch)) {
|
||||
return Result.error("省、市、开户行缺一不可");
|
||||
}
|
||||
// 已完成实名认证,补充开户行等信息
|
||||
if (certNum.contains("*") || accountNo.contains("*") || mobile.contains("*")) {
|
||||
userInfoService.update(null, Wrappers.<UserInfo>lambdaUpdate()
|
||||
.set(UserInfo::getProvince, province)
|
||||
.set(UserInfo::getCity, city)
|
||||
.set(UserInfo::getBankBranch, bankBranch)
|
||||
.set(UserInfo::getUpdateTime, new Date())
|
||||
.eq(UserInfo::getUserId, userId));
|
||||
return Result.success();
|
||||
}
|
||||
int count = userInfoService.count(Wrappers.<UserInfo>lambdaQuery()
|
||||
|
|
@ -206,6 +220,9 @@ public class AppController {
|
|||
userInfo.setAccountNo(accountNo);
|
||||
userInfo.setMobile(mobile);
|
||||
userInfo.setBankName(resp.getBankName());
|
||||
userInfo.setProvince(province);
|
||||
userInfo.setCity(city);
|
||||
userInfo.setBankBranch(bankBranch);
|
||||
userInfo.setRespJson(resp.getRespJson());
|
||||
userInfo.setUpdateTime(DateUtil.date());
|
||||
boolean update = userInfoService.update(userInfo, new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId).eq(UserInfo::getId, userInfo.getId()));
|
||||
|
|
|
|||
|
|
@ -21,4 +21,11 @@ public class AuthDTO {
|
|||
|
||||
@NotBlank
|
||||
private String mobile;
|
||||
|
||||
@NotBlank
|
||||
private String province;
|
||||
@NotBlank
|
||||
private String city;
|
||||
@NotBlank
|
||||
private String bankBranch;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,21 @@ public class UserInfo implements Serializable {
|
|||
*/
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 开户行
|
||||
*/
|
||||
private String bankBranch;
|
||||
|
||||
/**
|
||||
* 四要素接口响应报文
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -79,6 +79,21 @@ public class CashOut implements Serializable {
|
|||
*/
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 开户行
|
||||
*/
|
||||
private String bankBranch;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -543,6 +543,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
String bankName;
|
||||
String idCardNo = null;
|
||||
Set<String> withdrawCheckNameSet = new HashSet<>();
|
||||
UserInfo userDetailInfo = null;
|
||||
if (isSys) {
|
||||
SysUserEntity sysUserEntity = sysUserService.getById(userId);
|
||||
Msg msg1 = msgDao.findByPhoneAndCode(sysUserEntity.getMobile(), msg);
|
||||
|
|
@ -565,13 +566,19 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
throw new SqxException("账号已被禁用,请联系客服处理!");
|
||||
}
|
||||
|
||||
UserInfo userDetailInfo = userInfoService.getOne(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId));
|
||||
userDetailInfo = userInfoService.getOne(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId));
|
||||
if (userDetailInfo == null || StrUtil.isBlank(userDetailInfo.getCertName())) {
|
||||
return Result.error(9991, "请先实名认证!");
|
||||
}
|
||||
if (StrUtil.isEmpty(userDetailInfo.getAccountNo()) || StrUtil.isEmpty(userDetailInfo.getMobile())) {
|
||||
return Result.error(9991, "需重新完成实名认证后才可提现!");
|
||||
}
|
||||
if (StrUtil.isEmpty(userDetailInfo.getProvince())
|
||||
|| StrUtil.isEmpty(userDetailInfo.getCity())
|
||||
|| StrUtil.isEmpty(userDetailInfo.getBankBranch())
|
||||
) {
|
||||
return Result.error(9991, "请补充实名认证信息后提现!");
|
||||
}
|
||||
if (StrUtil.isEmpty(userDetailInfo.getBankName()) && StrUtil.isNotEmpty(userDetailInfo.getRespJson())) {
|
||||
userDetailInfo.setBankName(getBankName(userDetailInfo.getRespJson()));
|
||||
userInfoService.updateById(userDetailInfo);
|
||||
|
|
@ -611,6 +618,11 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
cashOut.setZhifubao(alipayAccount);
|
||||
cashOut.setZhifubaoName(alipayName);
|
||||
cashOut.setBankName(bankName);
|
||||
if (userDetailInfo != null) {
|
||||
cashOut.setProvince(userDetailInfo.getProvince());
|
||||
cashOut.setCity(userDetailInfo.getCity());
|
||||
cashOut.setBankBranch(userDetailInfo.getBankBranch());
|
||||
}
|
||||
cashOut.setState(0);
|
||||
cashOut.setRate(0.00);
|
||||
cashOut.setCreateAt(DateUtil.now());
|
||||
|
|
@ -639,7 +651,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
try {
|
||||
wuyouPay.checkCanCash(userId, WithdrawTypeEnum.MANUAL, new BigDecimal(money.toString()));
|
||||
cashOut.setStatus(4);
|
||||
BaseResp baseResp = wuyouPay.extractOrder(isAlipay, outOrderNo, cashOut.getUserId(), false, cashOut.getMoney(), cashOut.getZhifubao(), cashOut.getZhifubaoName(), cashOut.getBankName());
|
||||
BaseResp baseResp = wuyouPay.extractOrder(isAlipay, outOrderNo, cashOut.getUserId(), false, cashOut.getMoney(), cashOut.getZhifubao(), cashOut.getZhifubaoName(), cashOut.getBankName(), null, null, null);
|
||||
if (baseResp.getStatus() != null && (baseResp.getStatus().equals(2) || baseResp.getStatus().equals(10000))) {
|
||||
sysUserMoneyDetails.setContent("成功提现:" + money);
|
||||
cashOut.setState(1);
|
||||
|
|
@ -691,7 +703,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
try {
|
||||
wuyouPay.checkCanCash(userId, WithdrawTypeEnum.MANUAL, new BigDecimal(money.toString()));
|
||||
cashOut.setStatus(4);
|
||||
BaseResp baseResp = wuyouPay.extractOrder(isAlipay, outOrderNo, cashOut.getUserId(), true, cashOut.getMoney(), cashOut.getZhifubao(), cashOut.getZhifubaoName(), cashOut.getBankName());
|
||||
BaseResp baseResp = wuyouPay.extractOrder(isAlipay, outOrderNo, cashOut.getUserId(), true, cashOut.getMoney(), cashOut.getZhifubao(), cashOut.getZhifubaoName(), cashOut.getBankName(), cashOut.getProvince(), cashOut.getCity(), cashOut.getBankBranch());
|
||||
if (baseResp.getStatus() != null && (baseResp.getStatus().equals(2) || baseResp.getStatus().equals(10000))) {
|
||||
userMoneyDetails.setContent("成功提现:" + money);
|
||||
cashOut.setState(1);
|
||||
|
|
@ -848,7 +860,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
entity.setOrderNumber(outOrderNo);
|
||||
}
|
||||
// 执行提现操作
|
||||
BaseResp baseResp = wuyouPay.extractOrderExt(isHistoryData, true, entity.getOrderNumber(), entity.getUserId(), isUser, entity.getMoney(), entity.getZhifubao(), entity.getZhifubaoName(), entity.getBankName());
|
||||
BaseResp baseResp = wuyouPay.extractOrderExt(isHistoryData, true, entity.getOrderNumber(), entity.getUserId(), isUser, entity.getMoney(), entity.getZhifubao(), entity.getZhifubaoName(), entity.getBankName(), StrUtil.emptyToDefault(entity.getProvince(), "1"), StrUtil.emptyToDefault(entity.getCity(), "1"), StrUtil.emptyToDefault(entity.getBankBranch(), "1"));
|
||||
if (baseResp.getStatus() != null && (baseResp.getStatus().equals(2) || baseResp.getStatus().equals(10000))) {
|
||||
entity.setState(1);
|
||||
} else if (StringUtils.isNotBlank(baseResp.getErrorMsg())) {
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class WuyouPay {
|
|||
}
|
||||
|
||||
boolean ret = money.compareTo(new BigDecimal(info.getValue())) <= 0;
|
||||
if(!ret){
|
||||
if (!ret) {
|
||||
throw new ValidateException("单次提现超额");
|
||||
}
|
||||
}
|
||||
|
|
@ -159,7 +159,7 @@ public class WuyouPay {
|
|||
* 提现
|
||||
*
|
||||
* @param outOrderNo 提现订单号
|
||||
* @param userId
|
||||
* @param userId 用户ID
|
||||
* @param isUser 是否普通用户 普通用户-true,代理用户-false
|
||||
* @param amount 提现金额
|
||||
* @param account 收款账户,支付宝账号 / 银行卡号
|
||||
|
|
@ -167,8 +167,8 @@ public class WuyouPay {
|
|||
* @param bankName 开户行,支付宝提现可以不用传
|
||||
*/
|
||||
public BaseResp extractOrder(boolean isAlipay, String outOrderNo, Long userId, boolean isUser, String amount, String account,
|
||||
String userName, String bankName) {
|
||||
return extractOrderExt(isAlipay, false, outOrderNo, userId, isUser, amount, account, userName, bankName);
|
||||
String userName, String bankName, String province, String city, String bankBranch) {
|
||||
return extractOrderExt(isAlipay, false, outOrderNo, userId, isUser, amount, account, userName, bankName, province, city, bankBranch);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -178,19 +178,19 @@ public class WuyouPay {
|
|||
* @param userName 支付宝名称
|
||||
*/
|
||||
/**
|
||||
* @param isAlipay 是否是支付宝提现,true是
|
||||
* @param ignoreConfig 是否忽略配置开关,true忽略
|
||||
* @param outOrderNo 提现订单号
|
||||
* @param userId
|
||||
* @param isUser 是否普通用户 普通用户-true,代理用户-false
|
||||
* @param amount 提现金额
|
||||
* @param account 收款账户,支付宝账号 / 银行卡号
|
||||
* @param userName 真实姓名 / 用户名
|
||||
* @param bankName 开户行,支付宝提现可以不用传
|
||||
* @param isAlipay 是否是支付宝提现,true是
|
||||
* @param ignoreConfig 是否忽略配置开关,true忽略
|
||||
* @param outOrderNo 提现订单号
|
||||
* @param userId 用户ID
|
||||
* @param isUser 是否普通用户 普通用户-true,代理用户-false
|
||||
* @param amount 提现金额
|
||||
* @param account 收款账户,支付宝账号 / 银行卡号
|
||||
* @param userName 真实姓名 / 用户名
|
||||
* @param bankName 开户行,支付宝提现可以不用传
|
||||
* @return
|
||||
*/
|
||||
public BaseResp extractOrderExt(boolean isAlipay, boolean ignoreConfig, String outOrderNo, Long userId, boolean isUser, String amount, String account,
|
||||
String userName, String bankName) {
|
||||
String userName, String bankName, String province, String city, String bankBranch) {
|
||||
if (!ignoreConfig) {
|
||||
String payConfig = commonInfoService.findOne(927).getValue();
|
||||
if (!"1".equals(payConfig)) {
|
||||
|
|
@ -207,12 +207,16 @@ public class WuyouPay {
|
|||
params.put("bank_account_name", userName);
|
||||
if (isAlipay) {
|
||||
params.put("bank_name", "1");
|
||||
params.put("bank_branch", "1");
|
||||
params.put("province", "1");
|
||||
params.put("city", "1");
|
||||
} else {
|
||||
params.put("bank_name", isUser ? bankName : "1");
|
||||
params.put("bank_branch", bankBranch);
|
||||
params.put("province", province);
|
||||
params.put("city", city);
|
||||
}
|
||||
params.put("bank_branch", "1");
|
||||
params.put("province", "1");
|
||||
params.put("city", "1");
|
||||
|
||||
params.put("notify_url", extractNotifyUrl);
|
||||
|
||||
String sign = Encrypt.getParamsSign(params);
|
||||
|
|
|
|||
Loading…
Reference in New Issue