| | |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.CbyzxOrderPayHelper; |
| | | import com.stylefeng.guns.modular.system.util.UUIDUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | private IDriverRideService driverRideService; |
| | | @Autowired |
| | | private IFinancialService financialService; |
| | | @Autowired |
| | | private CbyzxOrderPayHelper cbyzxOrderPayHelper; |
| | | |
| | | |
| | | /** |
| | |
| | | if (payType == null || payType == 0) { |
| | | return ApiJson.returnNG("payType不能为空"); |
| | | } |
| | | Object info = new Object(); |
| | | String openId = null; |
| | | if (ToolUtil.isNotEmpty(code)) { |
| | | /*根据微信端的code获取openId*/ |
| | | // openId=new JsapiTicketUtilX().getOpenId(code); |
| | |
| | | if (orderRide.getState() == 2) {//已支付 |
| | | return ApiJson.returnNG("该订单不需要支付"); |
| | | } |
| | | info = new PayUtil().getPayInfo(payType, orderRide.getOrderNum(), openId, request); |
| | | return ApiJson.returnOK(info); |
| | | UserInfo userInfo = userInfoService.selectById(orderRide.getUserId()); |
| | | if (userInfo == null) { |
| | | return ApiJson.returnNG("用户信息不存在"); |
| | | } |
| | | String outTradeNo = orderId + "_8_" + UUIDUtil.getRandomCode(5); |
| | | JSONObject response = cbyzxOrderPayHelper.createOrder(orderRide.getUserId(), userInfo.getAppletsOpenId(), outTradeNo, orderRide.getMoney()); |
| | | if (!cbyzxOrderPayHelper.isCreateSuccess(response)) { |
| | | return ApiJson.returnNG(cbyzxOrderPayHelper.extractMessage(response), response); |
| | | } |
| | | return ApiJson.returnOK(response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |