| | |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.SystemPriceMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.QYTPaymentCallback; |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 管理后台推单 |
| | | * |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 黔云通支付回调通知 |
| | | * |
| | |
| | | } |
| | | return "success"; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/get/unPayOrder") |
| | | @ApiOperation(value = "获取未支付订单", tags = {"用户端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=小件物流,null=全部)", name = "orderType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil getUnPayOrder( Integer orderType, HttpServletRequest request){ |
| | | try { |
| | | // 从Redis中获取当前用户ID |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | |
| | | List<UnPayOrderVO> unpaidOrders = new ArrayList<>(); |
| | | |
| | | // 根据订单类型查询对应未支付订单 |
| | | if (orderType == null || orderType == 1) { |
| | | // 查询未支付的专车订单 |
| | | List<UnPayOrderVO> privateCarOrders = orderPrivateCarService.getUnpayPrivateOrders(uid); |
| | | unpaidOrders.addAll(privateCarOrders); |
| | | } |
| | | |
| | | if (orderType == null || orderType == 2) { |
| | | // 查询未支付的出租车订单 |
| | | List<UnPayOrderVO> taxiOrders = orderTaxiService.getUnpayTaxiOrders(uid); |
| | | unpaidOrders.addAll(taxiOrders); |
| | | } |
| | | |
| | | if (orderType == null || orderType == 3) { |
| | | // 查询未支付的跨城订单 |
| | | List<UnPayOrderVO> crossCityOrders = orderCrossCityService.getUnpayCrossCityOrders(uid); |
| | | unpaidOrders.addAll(crossCityOrders); |
| | | } |
| | | |
| | | if (orderType == null || orderType == 4 || orderType == 5) { |
| | | // 查询未支付的物流订单(包含类型4和5) |
| | | List<UnPayOrderVO> logisticsOrders = orderLogisticsService.getUnpayLogisticsOrders(uid); |
| | | unpaidOrders.addAll(logisticsOrders); |
| | | } |
| | | |
| | | // 按创建时间倒序排序(最新的订单在前) |
| | | unpaidOrders.sort(Comparator.comparing(UnPayOrderVO::getInsertTime).reversed()); |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("total", unpaidOrders.size()); |
| | | result.put("orders", unpaidOrders); |
| | | |
| | | return ResultUtil.success(result); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.CouponsListVo; |
| | |
| | | * @throws Exception |
| | | */ |
| | | void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception; |
| | | |
| | | /** |
| | | * 获取未支付的跨城订单 |
| | | */ |
| | | List<UnPayOrderVO> getUnpayCrossCityOrders(Integer uid) throws Exception; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.dao.SysIntegralMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserActivityDiscount1Mapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.CouponsListVo; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderServerWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | |
| | | driverService.updateById(driver); |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : (payType==2?"支付宝":"云闪付")) + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1); |
| | | } |
| | | |
| | | @Override |
| | | public List<UnPayOrderVO> getUnpayCrossCityOrders(Integer uid) throws Exception { |
| | | EntityWrapper<OrderCrossCity> query = new EntityWrapper<>(); |
| | | query.eq("userId", uid).eq("state", 7); |
| | | // 查询未支付订单 |
| | | List<OrderCrossCity> orderCrossCities = this.selectList(query); |
| | | List<UnPayOrderVO> unPayOrderVOList = new ArrayList<>(); |
| | | for(OrderCrossCity orderCrossCity : orderCrossCities){ |
| | | |
| | | UnPayOrderVO unPayOrderVO = new UnPayOrderVO(); |
| | | //添加司机信息 |
| | | DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | BeanUtils.copyProperties(driver, driverInfoWarpper); unPayOrderVO.setDriverInfoWarpper(driverInfoWarpper); |
| | | //其余信息 |
| | | BeanUtils.copyProperties(orderCrossCity, unPayOrderVO); |
| | | unPayOrderVOList.add(unPayOrderVO); |
| | | } |
| | | return unPayOrderVOList; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.CouponsListVo; |
| | | import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo; |
| | |
| | | * @throws Exception |
| | | */ |
| | | void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception; |
| | | |
| | | /** |
| | | * 获取未支付订单 |
| | | */ |
| | | List<UnPayOrderVO> getUnpayLogisticsOrders(Integer uid); |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.CouponsListVo; |
| | | import com.stylefeng.guns.modular.system.warpper.DriverInfoWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo; |
| | | import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | | import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; |
| | | import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | driverService.updateById(driver); |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : (payType==2?"支付宝":"云闪付")) + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1); |
| | | } |
| | | |
| | | @Override |
| | | public List<UnPayOrderVO> getUnpayLogisticsOrders(Integer uid) { |
| | | EntityWrapper<OrderLogistics> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("userId", uid); |
| | | wrapper.eq("state", 7); |
| | | List<OrderLogistics> orderLogisticsList = this.selectList(wrapper); |
| | | List<UnPayOrderVO> unPayOrderVOList = new ArrayList<>(); |
| | | for (OrderLogistics orderLogistics:orderLogisticsList) { |
| | | |
| | | UnPayOrderVO unPayOrderVO = new UnPayOrderVO(); |
| | | //添加司机信息 |
| | | DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | BeanUtils.copyProperties(driver, driverInfoWarpper); unPayOrderVO.setDriverInfoWarpper(driverInfoWarpper); |
| | | //其余信息 |
| | | BeanUtils.copyProperties(orderLogistics, unPayOrderVO); |
| | | unPayOrderVOList.add(unPayOrderVO); |
| | | |
| | | } |
| | | return unPayOrderVOList; |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | |
| | | @Param("state") Integer state, |
| | | @Param("lon") String lon, |
| | | @Param("lat") String lat); |
| | | |
| | | /** |
| | | * 获取专车未支付的订单 |
| | | */ |
| | | List<UnPayOrderVO> getUnpayPrivateOrders(Integer uid); |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | |
| | | 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 org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | public List<Map<String, Object>> queryOrderInfo2(Integer orderId, Integer state, String lon, String lat) { |
| | | return this.baseMapper.queryOrderInfo2(orderId,state,lon,lat); |
| | | } |
| | | |
| | | /** |
| | | * 获取专车未支付订单 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<UnPayOrderVO> getUnpayPrivateOrders(Integer uid) { |
| | | EntityWrapper<OrderPrivateCar> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("userId", uid); |
| | | wrapper.eq("state", 7); |
| | | //查出未支付订单 |
| | | List<OrderPrivateCar> orderPrivateCars = this.selectList(wrapper); |
| | | List<UnPayOrderVO> unPayOrderVOList = new ArrayList<>(); |
| | | for (OrderPrivateCar order : orderPrivateCars) { |
| | | UnPayOrderVO vo = new UnPayOrderVO(); |
| | | // 复制属性 |
| | | //添加司机信息 |
| | | DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); |
| | | Driver driver = driverService.selectById(order.getDriverId()); |
| | | BeanUtils.copyProperties(driver, driverInfoWarpper); vo.setDriverInfoWarpper(driverInfoWarpper); |
| | | //其余信息 |
| | | BeanUtils.copyProperties(order, vo); |
| | | unPayOrderVOList.add(vo); |
| | | } |
| | | |
| | | return unPayOrderVOList; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.stylefeng.guns.modular.system.warpper.DriverInfoWarpper; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 未支付订单信息 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class UnPayOrderVO { |
| | | |
| | | @ApiModelProperty(value = "司机信息") |
| | | private DriverInfoWarpper driverInfoWarpper; |
| | | |
| | | @JsonFormat(pattern = "yyyy年MM月dd HH:mm", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "下单时间") |
| | | private Date insertTime; |
| | | |
| | | @ApiModelProperty(value = "上车地点") |
| | | private String boardingAddress; |
| | | |
| | | @ApiModelProperty(value = "下车地点") |
| | | private String getoffAddress; |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | private Double payMoney; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | private Integer orderId; |
| | | |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.taxi.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | |
| | | * @throws Exception |
| | | */ |
| | | void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception; |
| | | |
| | | /** |
| | | * 获取未支付的出租车订单 |
| | | */ |
| | | List<UnPayOrderVO> getUnpayTaxiOrders(Integer uid); |
| | | |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.dao.SysIntegralMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserActivityDiscount1Mapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | |
| | | 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 org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | driverService.updateById(driver); |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : (payType==2?"支付宝":"云闪付")) + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1); |
| | | } |
| | | |
| | | @Override |
| | | public List<UnPayOrderVO> getUnpayTaxiOrders(Integer uid) { |
| | | EntityWrapper<OrderTaxi> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("userId", uid); |
| | | wrapper.eq("state", 7); |
| | | //查出未支付订单 |
| | | List<OrderTaxi> orderTaxiList = this.selectList(wrapper); |
| | | List<UnPayOrderVO> unPayOrderVOList = new ArrayList<>(); |
| | | for (OrderTaxi orderTaxi:orderTaxiList) { |
| | | UnPayOrderVO unPayOrderVO = new UnPayOrderVO(); |
| | | //添加司机信息 |
| | | DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | BeanUtils.copyProperties(driver, driverInfoWarpper); |
| | | unPayOrderVO.setDriverInfoWarpper(driverInfoWarpper); |
| | | //其余信息 |
| | | BeanUtils.copyProperties(orderTaxi, unPayOrderVO); |
| | | unPayOrderVOList.add(unPayOrderVO); |
| | | |
| | | } |
| | | |
| | | return unPayOrderVOList; |
| | | } |
| | | } |