| | |
| | | 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(); |
| | | } |
| | | } |
| | | |
| | | } |