| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.OfflineTravelPayment; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOfflineTravelPaymentService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ChinaMobileUtil; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.LiuZhouBank.PayUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.UUIDUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Autowired |
| | | private IOfflineTravelPaymentService offlineTravelPaymentService; |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil driverQrCodePaymentCollection(Integer driverId, Double money, Integer payType) throws Exception { |
| | | String randomCode = UUIDUtil.getRandomCode(); |
| | | String pay_type = ""; |
| | | if(payType == 1){//微信 |
| | | pay_type = "02"; |
| | | } |
| | | if(payType == 2){//支付宝 |
| | | pay_type = "04"; |
| | | } |
| | | OfflineTravelPayment offlineTravelPayment = new OfflineTravelPayment(); |
| | | offlineTravelPayment.setOrderId(randomCode); |
| | | offlineTravelPayment.setDriverId(driverId); |
| | | offlineTravelPayment.setPayType(payType); |
| | | offlineTravelPayment.setPayMoney(money); |
| | | offlineTravelPayment.setStatus(1); |
| | | offlineTravelPayment.setInsertTime(new Date()); |
| | | offlineTravelPaymentService.insert(offlineTravelPayment); |
| | | Driver driver = driverService.selectById(driverId); |
| | | String codeUrl = PayUtil.polymericPay(null, null, "", pay_type, money, "打车支付" |
| | | , callbackPath + "/base/offlineTravelPaymentCallback", randomCode |
| | | , "https://okyueche.com:8443/h5/#/pages/index/evaluate", driver.getMchtNo()); |
| | | if(ToolUtil.isNotEmpty(codeUrl)){ |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("url", codeUrl); |
| | | map.put("id", randomCode); |
| | | return ResultUtil.success(map); |
| | | } |
| | | return ResultUtil.error("获取支付数据失败"); |
| | | } |
| | | } |