| | |
| | | import com.supersavedriving.user.modular.system.util.MallBook.model.PaymentOrder; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.model.PaymentOrderGood; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.model.QueryOrder; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.util.Transfer; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.util.TrhRequest; |
| | | import com.supersavedriving.user.modular.system.util.PayMoneyUtil; |
| | | import com.supersavedriving.user.modular.system.util.RedisUtil; |
| | |
| | | |
| | | @Autowired |
| | | private IAccountChangeDetailService accountChangeDetailService; |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | @Autowired |
| | | private ISystemConfigService systemConfigService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath;//支付回调网关地址 |
| | |
| | | @Override |
| | | public ResultUtil<SignInToRegisterWarpper> signInToRegister(SignInToRegister signInToRegister) throws Exception { |
| | | SignInToRegisterWarpper warpper = new SignInToRegisterWarpper(); |
| | | try { |
| | | if(ToolUtil.isEmpty(signInToRegister.getJscode())){ |
| | | return ResultUtil.paranErr("jscode"); |
| | | } |
| | |
| | | return ResultUtil.error("获取身份凭证失败"); |
| | | } |
| | | warpper.setToken(token); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | redisUtil.unlock(); |
| | | } |
| | | return ResultUtil.success(warpper); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 转账 |
| | | * @param id |
| | | * @param merOrderId |
| | | * @param toUserId |
| | | * @param amount |
| | | * @param notifyUrl |
| | | * @return |
| | | */ |
| | | public ResultUtil zhaunzhang(Integer id, String merOrderId, String toUserId, Double amount, String notifyUrl){ |
| | | Transfer transfer = new Transfer(); |
| | | transfer.setDepositMerOrderId(merOrderId); |
| | | transfer.setToUserId(toUserId); |
| | | transfer.setAmount(String.valueOf(Double.valueOf(amount * 100).intValue())); |
| | | transfer.setOrderName("补贴"); |
| | | transfer.setNotifyUrl(notifyUrl); |
| | | transfer.setParameter1(id.toString()); |
| | | TrhRequest<Transfer> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(transfer, Transfer.SERVICE_CODE); |
| | | if("0000".equals(execute.getCode())){ |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | Integer status = jsonObject.getInteger("status");//0:待处理;1:成功;2:失败 |
| | | if(2 == status){ |
| | | System.err.println("转账失败"); |
| | | return ResultUtil.error("转账失败"); |
| | | } |
| | | return ResultUtil.success(); |
| | | }else{ |
| | | System.err.println("转账失败:" + execute.getMsg()); |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | PaymentOrder paymentOrder = new PaymentOrder(); |
| | | paymentOrder.setBizOrderId(out_trade_no); |
| | | paymentOrder.setAmount(String.valueOf(amount * 100)); |
| | | paymentOrder.setAmount(String.valueOf(Double.valueOf(amount * 100).intValue())); |
| | | paymentOrder.setOrderName("账户充值"); |
| | | paymentOrder.setPayType("WX_MINI"); |
| | | paymentOrder.setTransferType("0"); |