| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.RequestSeqUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.WithdrawalExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.WithdrawalReq; |
| | | import com.stylefeng.guns.modular.huifu.biz.DouGongWithdrawBiz; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | |
| | | private ITSystemNoticeService tSystemNoticeService; |
| | | @Resource |
| | | private IUserWithdrawalService userWithdrawalService; |
| | | @Autowired |
| | | private DouGongWithdrawBiz douGongWithdrawBiz; |
| | | |
| | | /** |
| | | * 跳转到提现列表首页 |
| | |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = UpyztException.class,propagation = Propagation.REQUIRES_NEW) |
| | | @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW) |
| | | public synchronized Object immediately(@RequestParam Integer id,@RequestParam Integer state,@RequestParam String remark) { |
| | | TPubWithdrawal tPubWithdrawal = tPubWithdrawalService.selectById(id); |
| | | if(tPubWithdrawal.getState()!=1){ |
| | |
| | | System.out.println("用户:"+userWithdrawals.get(0)); |
| | | try { |
| | | log.info("用户提现创建========="); |
| | | WithdrawalResp withdrawalResp = WithdrawalExample.create(userWithdrawalService.createInfo(userWithdrawals.get(0), tPubWithdrawal)); |
| | | tPubWithdrawal.setWithdrawId(withdrawalResp.getWithdrawalId()); |
| | | String reqSeqId = RequestSeqUtil.generate("TX"); |
| | | JSONObject result = douGongWithdrawBiz.encashment(reqSeqId, tPubWithdrawal.getMoney(), userWithdrawals.get(0).getHuiFuId(), userWithdrawals.get(0).getTokenNo(), 2); |
| | | if (!result.get("resp_code").equals("00000000") || !result.getBoolean("success")) { |
| | | return new ErrorTip(500, "操作失败,异常原因:"+result.get("resp_desc")); |
| | | } |
| | | |
| | | String hfSeqId = (String) result.get("hf_seq_id"); |
| | | tPubWithdrawal.setReqSeqId(reqSeqId); |
| | | tPubWithdrawal.setHfSeqId(hfSeqId); |
| | | //WithdrawalResp withdrawalResp = WithdrawalExample.create(userWithdrawalService.createInfo(userWithdrawals.get(0), tPubWithdrawal)); |
| | | //tPubWithdrawal.setWithdrawId(withdrawalResp.getWithdrawalId()); |
| | | tPubWithdrawalService.updateById(tPubWithdrawal); |
| | | log.info("用户提现创建信息========="+withdrawalResp.toString()); |
| | | //log.info("用户提现创建信息========="+withdrawalResp.toString()); |
| | | log.info("用户提现创建信息:{}", result.toJSONString()); |
| | | log.info("用户提现创建成功========="); |
| | | } catch (UpyztException e) { |
| | | } catch (Exception e) { |
| | | log.info("用户提现创建失败========="); |
| | | e.printStackTrace(); |
| | | if(userType==1){ |
| | |
| | | } |
| | | try { |
| | | log.info("司机提现创建========="); |
| | | WithdrawalResp withdrawalResp = WithdrawalExample.create(userWithdrawalService.createInfo(userWithdrawal, tPubWithdrawal)); |
| | | tPubWithdrawal.setWithdrawId(withdrawalResp.getWithdrawalId()); |
| | | String reqSeqId = RequestSeqUtil.generate("TX"); |
| | | JSONObject result = douGongWithdrawBiz.encashment(reqSeqId, tPubWithdrawal.getMoney(), userWithdrawal.getHuiFuId(), userWithdrawal.getTokenNo(), 2); |
| | | if (!result.get("resp_code").equals("00000000") || !result.getBoolean("success")) { |
| | | return new ErrorTip(500, "操作失败,异常原因:"+result.get("resp_desc")); |
| | | } |
| | | |
| | | String hfSeqId = (String) result.get("hf_seq_id"); |
| | | tPubWithdrawal.setReqSeqId(reqSeqId); |
| | | tPubWithdrawal.setHfSeqId(hfSeqId); |
| | | //WithdrawalResp withdrawalResp = WithdrawalExample.create(userWithdrawalService.createInfo(userWithdrawal, tPubWithdrawal)); |
| | | //tPubWithdrawal.setWithdrawId(withdrawalResp.getWithdrawalId()); |
| | | tPubWithdrawalService.updateById(tPubWithdrawal); |
| | | log.info("司机提现创建信息========="+withdrawalResp.toString()); |
| | | //log.info("司机提现创建信息========="+withdrawalResp.toString()); |
| | | log.info("司机提现创建信息:{}", result.toJSONString()); |
| | | log.info("司机提现创建成功========="); |
| | | } catch (UpyztException e) { |
| | | } catch (Exception e) { |
| | | log.info("司机提现创建失败========="); |
| | | e.printStackTrace(); |
| | | if(userType==1){ |