| | |
| | | stateObj = 1; |
| | | // 支付宝提现 |
| | | String certNo = ""; |
| | | String name = ""; |
| | | if (tPubWithdrawal.getUserType()==1){ |
| | | TUser tUser = userService.selectById(tPubWithdrawal.getUserId()); |
| | | certNo = tUser.getIdCard(); |
| | | name = tUser.getName(); |
| | | |
| | | }else{ |
| | | TDriver tDriver = driverService.selectById(tPubWithdrawal.getUserId()); |
| | | certNo = tDriver.getIdCard(); |
| | | name = tDriver.getName(); |
| | | } |
| | | if (SinataUtil.isEmpty(name)){ |
| | | return ResultUtil.error("提现失败:用户未保存真实姓名!"); |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | String s = AlipayUtils.aliWithdrawal(code, tPubWithdrawal.getMoney() + "", tPubWithdrawal.getCode(), certNo); |
| | | String s = AlipayUtils.aliWithdrawal(code, tPubWithdrawal.getMoney() + "", tPubWithdrawal.getCode(), certNo, name); |
| | | JSONObject res = JSONObject.parseObject(s); |
| | | JSONObject alipayFundTransUniTransferResponse = res.getJSONObject("alipay_fund_trans_uni_transfer_response"); |
| | | if (alipayFundTransUniTransferResponse!=null){ |
| | | if (alipayFundTransUniTransferResponse.getString("status").equals("Success")){ |
| | | if (alipayFundTransUniTransferResponse.getString("status")!=null && alipayFundTransUniTransferResponse.getString("status").equals("Success")){ |
| | | String string = alipayFundTransUniTransferResponse.getString("order_id"); |
| | | tPubWithdrawal.setOrderNumber(string); |
| | | }else{ |
| | | return ResultUtil.error("提现失败:"+alipayFundTransUniTransferResponse.getString("msg")); |
| | | return ResultUtil.error("提现失败:"+alipayFundTransUniTransferResponse.getString("sub_msg")); |
| | | } |
| | | } |
| | | System.err.println("支付宝提现返回信息"+s); |
| | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | public static void main(String[] args) throws AlipayApiException { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | String s = AlipayUtils.aliWithdrawal(code, 0.1 + "", "19983174515", "513902200006257079",""); |
| | | JSONObject res = JSONObject.parseObject(s); |
| | | JSONObject alipayFundTransUniTransferResponse = res.getJSONObject("alipay_fund_trans_uni_transfer_response"); |
| | | if (alipayFundTransUniTransferResponse!=null){ |
| | | if (alipayFundTransUniTransferResponse.getString("status")!=null && alipayFundTransUniTransferResponse.getString("status").equals("Success")){ |
| | | String string = alipayFundTransUniTransferResponse.getString("order_id"); |
| | | }else{ |
| | | System.err.println("提现失败"+alipayFundTransUniTransferResponse.getString("sub_msg")); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 修改提现列表 |
| | | */ |