| | |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.service.IWithdrawalService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.Tingg.TinggPayoutUtil; |
| | | import com.stylefeng.guns.modular.system.util.Tingg.model.AuthStatus; |
| | | import com.stylefeng.guns.modular.system.util.Tingg.model.PayoutResponse; |
| | | import com.stylefeng.guns.modular.system.util.Tingg.model.Results; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Isolation; |
| | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | /* @Autowired |
| | | private ICBCPayUtil icbcPayUtil;*/ |
| | | @Autowired |
| | | private TinggPayoutUtil tinggPayoutUtil; |
| | | |
| | | private Map<String, Timer> timerMap = new HashMap<>(); |
| | | |
| | |
| | | withdrawal.setUserId(uid); |
| | | withdrawal.setUserType(1); |
| | | |
| | | /*ResultUtil<String> transfer = icbcPayUtil.transfer(Double.valueOf(withdrawal.getMoney() * 100).longValue(), withdrawal.getCode(), withdrawal.getName()); |
| | | withdrawal.setSerialNo(transfer.getData());*/ |
| | | PayoutResponse payoutResponse = tinggPayoutUtil.sendPayout("+233" + userInfo.getPhone(), withdrawal.getCode(), withdrawal.getMoney(), "", "用户提现"); |
| | | AuthStatus authStatus = payoutResponse.getAuthStatus(); |
| | | Results results = payoutResponse.getResults().get(0); |
| | | String statusCode = results.getStatusCode(); |
| | | if(!"131".equals(authStatus.getAuthStatusCode())){ |
| | | return ResultUtil.error(authStatus.getAuthStatusDescription()); |
| | | } |
| | | if(!"139".equals(statusCode)){ |
| | | return ResultUtil.error(results.getStatusDescription()); |
| | | } |
| | | withdrawal.setSerialNo(results.getBeepTransactionID()); |
| | | this.insert(withdrawal); |
| | | |
| | | double v = new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryWithdrawal(Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | public List<Map<String, Object>> queryWithdrawal(Integer uid, Integer pageNum, Integer size, Integer language) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | return withdrawalMapper.queryWithdrawal(uid, 1, pageNum, size); |
| | | String name = language == 1 ? "银行卡提现" : language == 2 ? "Bank card withdrawal" : "Retrait par carte bancaire"; |
| | | List<Map<String, Object>> list = withdrawalMapper.queryWithdrawal(uid, 1, pageNum, size); |
| | | for (Map<String, Object> map : list) { |
| | | map.put("name", name); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |