| | |
| | | appUserWalletRecord.setReason("提现"); |
| | | appUserWalletRecord.setAmount(new BigDecimal(money)); |
| | | BigDecimal bigDecimal1 = new BigDecimal(money).setScale(2, RoundingMode.HALF_DOWN); |
| | | String s2 = JuHeFuUtil.queryUserList(byId1.getIdentityCard()); |
| | | if (StringUtils.hasLength(s2)){ |
| | | byId.setFenzhangId(s2); |
| | | }else{ |
| | | // 没有开户 |
| | | long time = new Date().getTime(); |
| | | String s3 = RandomUtil.randomNumbers(4); |
| | | String s1 = "FZ" + time + s3; |
| | | String user = JuHeFuUtil.createUser(s1, byId1.getCardholder(), "00", |
| | | byId1.getIdentityCard(), byId1.getCellPhone(), byId1.getCardNo()); |
| | | if (StringUtils.hasLength(user)&&user.equals("success")){ |
| | | byId.setFenzhangId(s1); |
| | | appUserService.updateById(byId); |
| | | }else{ |
| | | return R.fail(user); |
| | | } |
| | | } |
| | | String s1 = JuHeFuUtil.updateAccount(byId.getFenzhangId(), byId1.getCardholder(), byId1.getCellPhone(), byId1.getCardNo()); |
| | | if (s1.contains("false")){ |
| | | if (!s1.contains("success")){ |
| | | // 修改报错 弹出提示 |
| | | return R.fail("银行卡信息或持卡人信息有误,请核对后输入"); |
| | | return R.fail(s1); |
| | | } |
| | | // 从商户余额分账到用户分账接收方 |
| | | JSONObject jsonObject = JuHeFuUtil.balancePay("CZ"+replace, byId.getFenzhangId(), bigDecimal1 + "" |
| | | , "https://xq.xqzhihui.com/api/user/client/app-user-withdraw/base/callback"); |
| | | |
| | | if (jsonObject.getString("error_msg")!=null){ |
| | | System.err.println("从商户余额分账到用户分账接收方报错异常"+jsonObject.getString("error_msg")); |
| | | |
| | | return R.fail("系统繁忙,5分钟后重试"); |
| | | // return R.fail(jsonObject.getString("error_msg")); |
| | | } |
| | | JSONObject jsonObject2 = JuHeFuUtil.balanceWithdraw("TX"+replace, bigDecimal1+"", byId.getFenzhangId(), |
| | | "https://xq.xqzhihui.com/api/user/client/app-user-withdraw/base/callbackA"); |
| | | if (jsonObject2.getString("error_msg")!=null){ |
| | | System.err.println("提现异常原因"+jsonObject2.getString("error_msg")); |
| | | |
| | | return R.fail("系统繁忙,5分钟后重试"); |
| | | } |
| | | System.err.println("执行完毕====="); |
| | |
| | | String key = CacheConstants.ADD_CARD_PHONE_CODE_PREFIX + appUserWithdraw.getCellPhone(); |
| | | String code = redisService.getCacheObject(key); |
| | | // 万能验证码 |
| | | if (appUserWithdraw.getCode().equals("123456") || (com.xinquan.common.core.utils.StringUtils.isNotBlank(code) && code.equals( |
| | | if (appUserWithdraw.getCode().equals("220125") || (com.xinquan.common.core.utils.StringUtils.isNotBlank(code) && code.equals( |
| | | appUserWithdraw.getCode()))) { |
| | | redisService.deleteObject(key); |
| | | }else{ |
| | |
| | | appUserBankService.save(appUserWithdraw); |
| | | // 查询是否已经开户 |
| | | AppUser byId = appUserService.getById(userId); |
| | | String s2 = JuHeFuUtil.queryUserList(appUserWithdraw.getIdentityCard()); |
| | | if (StringUtils.hasLength(s2)){ |
| | | byId.setFenzhangId(s2); |
| | | appUserService.updateById(byId); |
| | | } |
| | | if (byId.getFenzhangId()==null){ |
| | | // 开户 |
| | | long time = new Date().getTime(); |
| | |
| | | String s1 = "FZ" + time + s; |
| | | String user = JuHeFuUtil.createUser(s1, appUserWithdraw.getCardholder(), "00", |
| | | appUserWithdraw.getIdentityCard(), appUserWithdraw.getCellPhone(), appUserWithdraw.getCardNo()); |
| | | appUserWithdraw.setFenzhangId(s1); |
| | | appUserBankService.updateById(appUserWithdraw); |
| | | if (user.equals("success")){ |
| | | byId.setFenzhangId(s1); |
| | | appUserService.updateById(byId); |
| | | }else{ |
| | | return R.fail("添加银行卡失败,错误信息:"+user); |
| | | } |
| | | } |
| | | return R.ok(); |