| | |
| | | // 更新订单状态为已完成(10) |
| | | this.lambdaUpdate().set(XpOrder::getStatus, 10) |
| | | .eq(XpOrder::getId, order.getId()).update(); |
| | | |
| | | |
| | | // 消息推送 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("orderId", order.getId().toString()); |
| | | content.put("status", OrderStatusEnum.COMPLETED.getCode()); |
| | | params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); |
| | | params.put("content", com.alibaba.fastjson2.JSONObject.toJSONString(content)); |
| | | params.put("timestamp", new Date().getTime() + ""); |
| | | String message = JSONObject.toJSONString(params); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | | sendMessageDTO.setMessage(message); |
| | | sendMessageDTO.setAppUserId(String.valueOf(order.getAppUserId())); |
| | | xpPushMessageClient.sendStatus(sendMessageDTO); |
| | | log.info("运营人员取消订单成功,推送乘客消息完成"); |
| | | log.info("订单关闭成功,订单ID: {}, 操作人: {}", order.getId(), SecurityUtils.getUsername()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<XpHistoryStartPointsVo> getHistoryStartPoints(String uid, double lon, double lat) { |
| | | public List<XpHistoryStartPointsVo> getHistoryStartPoints(String uid, double lon, double lat,Long electronicAreaId) { |
| | | // |
| | | List<XpOrder> xpOrders = this.baseMapper.getHistoryStartPoints(Long.valueOf(uid)); |
| | | // selectList(new LambdaQueryWrapper<XpOrder>().eq(XpOrder::getAppUserId, Long.parseLong(uid)).orderByDesc(BaseModel::getCreateTime).last("LIMIT 10")); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<XpHistoryEndPointsVo> getHistoryEndPoints(String uid, double lon, double lat) { |
| | | public List<XpHistoryEndPointsVo> getHistoryEndPoints(String uid, double lon, double lat,Long electronicAreaId) { |
| | | // |
| | | List<XpOrder> xpOrders = this.baseMapper.getHistoryEndPoints(Long.valueOf(uid)); |
| | | // selectList(new LambdaQueryWrapper<XpOrder>().eq(XpOrder::getAppUserId, Long.parseLong(uid)).orderByDesc(BaseModel::getCreateTime).last("LIMIT 10")); |
| | |
| | | } |
| | | String durationAndMileage = key.split("\\|")[2]; |
| | | startDetail.setDuration(Double.valueOf(durationAndMileage.split("&")[0])); |
| | | startDetail.setMileage(new BigDecimal(durationAndMileage.split("&")[1])); |
| | | startDetail.setMileage(new BigDecimal(durationAndMileage.split("&")[1]).multiply(BigDecimal.valueOf(1000))); |
| | | start.add(startDetail); |
| | | } |
| | | // 封装里程费 |
| | |
| | | // 封装时长费 |
| | | FareBreakdownDetailVo timeDetail = new FareBreakdownDetailVo(); |
| | | if (key.contains("时长费")) { |
| | | timeDetail.setType(startDetail.getType()); |
| | | if(key.contains("普通时段")){ |
| | | timeDetail.setType(1); |
| | | } |
| | | if(key.contains("夜间行驶")){ |
| | | timeDetail.setType(2); |
| | | } |
| | | if(key.contains("高峰")){ |
| | | timeDetail.setType(3); |
| | | } |
| | | if(key.contains("节假")){ |
| | | timeDetail.setType(4); |
| | | } |
| | | |
| | | timeDetail.setMoney(stringBigDecimalEntry.getValue()); |
| | | timeDetail.setDuration(Double.valueOf(key.split("&")[1])); |
| | | duration.add(timeDetail); |
| | |
| | | if (key.contains("远途费")) { |
| | | longDetail.setType(startDetail.getType()); |
| | | longDetail.setMoney(stringBigDecimalEntry.getValue()); |
| | | longDetail.setMileage(new BigDecimal(key.split("&")[1])); |
| | | // longDetail.setMileage(new BigDecimal(key.split("&")[1])); |
| | | longDistance.add(longDetail); |
| | | } |
| | | } |
| | |
| | | XpOrder order = this.getById(dto.getOrderId()); |
| | | order.setStatus(9); |
| | | order.setAppUserId(null); |
| | | |
| | | |
| | | if(order.getCouponId()!=null){ |
| | | UseUserCouponDto useUserCouponDto = new UseUserCouponDto(); |
| | | useUserCouponDto.setUserCouponId(order.getCouponId()); |
| | | R<BigDecimal> decimalR = xpAppUserCouponClient.useUserCoupon(useUserCouponDto); |
| | | if(decimalR.getCode()==200){ |
| | | order.setCouponMoney(decimalR.getData()); |
| | | if(order.getCouponMoney().compareTo(order.getOrderMoney())>0){ |
| | | order.setPayMoney(BigDecimal.ZERO); |
| | | order.setCouponMoney(order.getOrderMoney()); |
| | | }else { |
| | | order.setPayMoney(order.getOrderMoney().subtract(decimalR.getData())); |
| | | } |
| | | } |
| | | |
| | | } |
| | | baseMapper.updateById(order); |
| | | return R.ok(); |
| | | } |