| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService; |
| | | import com.stylefeng.guns.modular.account.model.TEnterpriseWithdrawal; |
| | | import com.stylefeng.guns.modular.account.server.ITEnterpriseWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.server.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.call.server.IOrderCallService; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.DepositExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.DepositReq; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.enums.PaymentTypeEnum; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.QYTPaymentCallback; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; |
| | | import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; |
| | | import com.unionpay.upyzt.exception.UpyztException; |
| | | import com.unionpay.upyzt.resp.AllocationResp; |
| | | import com.unionpay.upyzt.resp.DepositResp; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import sun.security.krb5.internal.crypto.Des; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | |
| | | * 订单控制器(综合) |
| | | */ |
| | | @Api |
| | | //@CrossOrigin |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class OrderController { |
| | |
| | | |
| | | @Autowired |
| | | private IAdditionalFeeService additionalFeeService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITEnterpriseWithdrawalService enterpriseWithdrawalService; |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | private ICompanyService companyService; |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private SystemPriceMapper systemPriceMapper; |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | |
| | | /** |
| | | * 获取正在进行中的订单 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Resource |
| | | private SystemPriceMapper systemPriceMapper; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取服务中的详情数据 |
| | | * @param orderId |
| | |
| | | } |
| | | orderList= orderPrivateCarService.queryOrderInfo2(orderId,6,null,null); |
| | | if(orderInfoWarpper.getState()>1 && orderInfoWarpper.getDriverId()!=0){ |
| | | String value = redisUtil.getValue("DRIVER" + String.valueOf(orderInfoWarpper.getDriverId())); |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER" + String.valueOf(orderInfoWarpper.getDriverId())); |
| | | if(value==null || value.equals("")){ |
| | | if(orderList.isEmpty()){ |
| | | orderList= orderPrivateCarService.queryOrderInfo2(orderId,5,"0","0"); |
| | |
| | | System.out.println("完成订单微信支付回调"); |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | System.out.println("wx支付信息:"+map); |
| | | |
| | | |
| | | if(null != map){ |
| | | String order_id = map.get("transaction_id"); |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String result = map.get("result"); |
| | | String total_fee = map.get("total_fee"); |
| | | String transaction_id = map.get("transaction_id"); |
| | | |
| | | if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){ |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 管理后台推单 |
| | | * |
| | | * @param orderType |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/taxi/pushOrder") |
| | | public ResultUtil pushOrder(Integer orderId, Integer orderType){ |
| | | public ResultUtil pushOrder(Integer orderId, Integer orderType) { |
| | | try { |
| | | switch (orderType){ |
| | | switch (orderType) { |
| | | case 1: |
| | | return orderPrivateCarService.pushOrderPrivateCar(orderId); |
| | | case 2: |
| | | return orderTaxiService.pushOrderTaxi(orderId); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // public void cloudPay(String total_fee,String transaction_id,int type) { |
| | | // if(type==1){ |
| | | // BigDecimal divide = new BigDecimal(total_fee).divide(new BigDecimal(100)); |
| | | // total_fee=divide.toString(); |
| | | // } |
| | | // Company company = companyService.selectOne(new EntityWrapper<Company>() |
| | | // .eq("type", 1) |
| | | // .last("LIMIT 1")); |
| | | // // 查询平台开户信息 |
| | | // TEnterpriseWithdrawal enterpriseWithdrawal = enterpriseWithdrawalService.selectOne(new EntityWrapper<TEnterpriseWithdrawal>() |
| | | // .eq("companyId", company.getId())); |
| | | // DepositReq depositReq = new DepositReq(); |
| | | // depositReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | // depositReq.setTotalAmount(new BigDecimal(total_fee).multiply(new BigDecimal(100)).intValue()); // 总金额 |
| | | // depositReq.setAmount(new BigDecimal(total_fee).multiply(new BigDecimal(100)).intValue()); // 支付金额 |
| | | // depositReq.setDiscountAmount(0); // 优惠金额 |
| | | // depositReq.setBalanceAcctId(enterpriseWithdrawal.getBalanceAcctId()); |
| | | // depositReq.setDepositType("1"); |
| | | // depositReq.setPaymentType(PaymentTypeEnum.CUP_APP.getCode()); |
| | | // depositReq.setPaymentTradeNo(transaction_id); // 系统交易流水号 |
| | | // depositReq.setPaymentSucceededAt(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date())); |
| | | // depositReq.setOrderNo(transaction_id); |
| | | // depositReq.setOrderAmount(new BigDecimal(total_fee).multiply(new BigDecimal(100)).longValue()); |
| | | // depositReq.setProductName("用户支付充值"); |
| | | // depositReq.setProductCount(1); |
| | | // |
| | | // try { |
| | | // DepositResp depositResp = DepositExample.create(depositReq); |
| | | // System.err.println(depositResp); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 黔云通支付回调通知 |
| | | * |
| | | * @param qytPaymentCallback |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/order/qytPaymentCallback") |
| | | public String qytPaymentCallback(@RequestBody QYTPaymentCallback qytPaymentCallback) { |
| | | log.info("【黔云通支付回调通知】请求参数:" + JSON.toJSONString(qytPaymentCallback)); |
| | | if (null == qytPaymentCallback) { |
| | | return "error"; |
| | | } |
| | | return "success"; |
| | | } |
| | | |
| | | } |