| | |
| | | private IOrderRideService orderRideService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取正在进行中的订单 |
| | | * |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @PostMapping("/api/order/queryMyTripList") |
| | | @ApiOperation(value = "获取我的行程列表", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | |
| | | |
| | | List<Map<String,Object>> raw = fetchTrips(uid, type, pageNum, size); |
| | | return ResultUtil.success(TripOrderVo.getTripOrderVo(raw)); |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 私有:拉取指定 type 的行程列表。 |
| | | * type=0 → 全部类型;1/2/3 → 对应三种服务;pageNum/size 负责分页。 |
| | |
| | | if (da == null && db == null) return 0; |
| | | if (da == null) return 1; // a 在后面 |
| | | if (db == null) return -1; // b 在后面 |
| | | return da.compareTo(db); // 按时间正序(升序)排列 |
| | | return da.compareTo(db) * -1; // 按时间正序(升序)排列 |
| | | }); |
| | | // 将经纬度转换为城市并设置到数据中 |
| | | if (list != null && !list.isEmpty()) { |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/api/user/sendTripSheetEmail") |
| | | @ApiOperation(value = "发送行程单邮件", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | |
| | | String filePath = tripSheetGenerator.generatePdf(tripOrderVos); |
| | | File attachment = new File(filePath); |
| | | String displayFileName = "贵人家园出行-行程单.pdf"; |
| | | emailUtil.sendEmailWithAttachment(tripSheet.getRecipientEmail(), "贵人家园出行-行程单", "贵人家园出行-行程单", attachment,displayFileName); |
| | | emailUtil.sendEmailWithAttachment(tripSheet.getRecipientEmail(), "贵人家园出行-行程单", "请查收您的行程单", attachment, displayFileName); |
| | | attachment.delete(); // 发送成功后删除临时文件 |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("orderNum", orderList.size()); |
| | |
| | | return ResultUtil.error("邮件发送失败"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据订单类型和ID集合查询订单 |
| | | */ |