| | |
| | | XpOperationsUserVO xpOperationsUserVO = xpOperationsUserService.detailById(id); |
| | | if (xpOperationsUserVO.getAvatar() != null) { |
| | | JSONObject jsonObject = JSONObject.parseObject(xpOperationsUserVO.getAvatar()); |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | String downloadUrl1 = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | downloadUrl = downloadUrl1; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | if(jsonObject!=null){ |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpOperationsUserVO.setAvatar(jsonObject.toJSONString()); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpOperationsUserVO.setAvatar(jsonObject.toJSONString()); |
| | | } |
| | | |
| | | return R.ok(xpOperationsUserVO); |
| | |
| | | String timeStr = dynamicPriceObj.toString(); |
| | | // 判断当前距离这个时间范围的新增订单数(排除取消) / 上浮数量 算出应该增加的价格率 |
| | | R<Integer> r = xpOrderClient.getOrderNum(new GetOrderNumDto(timeStr,openCityId)); |
| | | if(r.getData()==200){ |
| | | if(r.getCode()==200){ |
| | | int num = r.getData(); |
| | | // X单上升一次调价 |
| | | Integer orderNum = getOrderNum(jsonObject, 4); |
| | |
| | | xpPricingCardVo.setDurationPrice(durationPrice); |
| | | xpPricingCardVo.setTotalPrice(new BigDecimal(startPrice + distancePrice + durationPrice).setScale(2,RoundingMode.HALF_UP).doubleValue()); |
| | | // 里程 |
| | | xpPricingCardVo.setDistance(realDistance); |
| | | xpPricingCardVo.setDuration(realTime); |
| | | xpPricingCardVo.setDistance(realDistance*1000); |
| | | xpPricingCardVo.setDuration(realTime*60); |
| | | |
| | | return xpPricingCardVo; |
| | | } |
| | |
| | | String timeStr = dynamicPriceObj.toString(); |
| | | // 判断当前距离这个时间范围的新增订单数(排除取消) / 上浮数量 算出应该增加的价格率 |
| | | R<Integer> r = xpOrderClient.getOrderNum(new GetOrderNumDto(timeStr,openCityId)); |
| | | if(r.getData()==200){ |
| | | if(r.getCode()==200){ |
| | | int num = r.getData(); |
| | | // X单上升一次调价 |
| | | Integer orderNum = getOrderNum(jsonObject, 4); |
| | |
| | | // 时长费 |
| | | xpPricingCardVo.setDurationPrice((exceedTime * rule.getDouble("num17"))); |
| | | |
| | | xpPricingCardVo.setDistancePriceNormal(rule.getDouble("num2")*1000); |
| | | |
| | | xpPricingCardVo.setDurationPriceNormal(rule.getDouble("num3")*60); |
| | | |
| | | } else { |
| | | |
| | |
| | | xpPricingCardVo.setTime(rule.getString("num22")); |
| | | } |
| | | |
| | | xpPricingCardVo.setDistancePriceNormal(rule.getDouble("num2")*1000); |
| | | |
| | | xpPricingCardVo.setDurationPriceNormal(rule.getDouble("num3")*60); |
| | | |
| | | // 里程 |
| | | xpPricingCardVo.setDistance(realDistance); |
| | |
| | | amount=new BigDecimal(amount).setScale(2,RoundingMode.HALF_UP).doubleValue(); |
| | | // 先减去起步价重新计算 |
| | | amount = amount - startPrice; |
| | | |
| | | // 动态计算费用 |
| | | startPrice= new BigDecimal(startPrice).multiply(new BigDecimal(priceRate)).setScale(2, RoundingMode.HALF_UP).doubleValue(); |
| | | amount = amount+startPrice; |
| | |
| | | |
| | | |
| | | |
| | | xpPricingCardVo.setDistance(xpPricingCardVo.getDistance()*1000); |
| | | xpPricingCardVo.setDuration(xpPricingCardVo.getDuration()*60); |
| | | |
| | | |
| | | return xpPricingCardVo; |
| | |
| | | @GetMapping("/base/v1/mini-program/pricing/rules/{openCityId}") |
| | | @ApiOperation(value = "获取费用规则(弃用)", tags = {"小程序-根据开通城市获取费用规则(弃用)"}, response = String.class) |
| | | public R<?> getPricingRules(@PathVariable Long openCityId) { |
| | | XpPricing xpPricing = xpPricingService.getOne(new LambdaQueryWrapper<XpPricing>().eq(XpPricing::getCityId, openCityId).eq(XpPricing::getPricingType, 1).last("limit 1")); |
| | | XpPricing xpPricing = xpPricingService.getOne(new LambdaQueryWrapper<XpPricing>().eq(XpPricing::getCityId, openCityId).last("limit 1")); |
| | | if (xpPricing != null) { |
| | | return R.ok(xpPricing.getPriceRule()); |
| | | } |
| | |
| | | String timeStr = dynamicPriceObj.toString(); |
| | | // 判断当前距离这个时间范围的新增订单数(排除取消) / 上浮数量 算出应该增加的价格率 |
| | | R<Integer> r = xpOrderClient.getOrderNum(new GetOrderNumDto(timeStr,openCityId)); |
| | | if(r.getData()==200){ |
| | | if(r.getCode()==200){ |
| | | int num = r.getData(); |
| | | // X单上升一次调价 |
| | | Integer orderNum = getOrderNum(jsonObject, 4); |
| | |
| | | String timeStr = dynamicPriceObj.toString(); |
| | | // 判断当前距离这个时间范围的新增订单数(排除取消) / 上浮数量 算出应该增加的价格率 |
| | | R<Integer> r = xpOrderClient.getOrderNum(new GetOrderNumDto(timeStr,openCityId)); |
| | | if(r.getData()==200){ |
| | | if(r.getCode()==200){ |
| | | int num = r.getData(); |
| | | // X单上升一次调价 |
| | | Integer orderNum = getOrderNum(jsonObject, 4); |
| | |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | log.info("运维人员取消订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber()); |
| | | log.info("运维人员取消订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), order.getOrderNumber()); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | log.info("运维人员取消订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber()); |
| | | log.info("运维人员取消订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), order.getOrderNumber()); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | log.info("运维人员关闭订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber()); |
| | | log.info("运维人员关闭订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), order.getOrderNumber()); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | log.info("定时任务取消订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber()); |
| | | log.info("定时任务取消订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), order.getOrderNumber()); |
| | | } |
| | | }); |
| | | } |
| | |
| | | XpPoint endPoint = xpPointR1.getData(); |
| | | xpOrderDetailVO.setEndParkingTimeLimit(endPoint.getParkingTimeLimit()); |
| | | } |
| | | // 算时间 |
| | | if (xpOrder.getStatus() == 1) { |
| | | R<Integer> r = xpPricingClient.getWaitTime(new LonLatDto(xpOrder.getStartLon(), xpOrder.getStartLat())); |
| | | if (r.getCode() == R.SUCCESS) { |
| | | xpOrderDetailVO.setEstimatedTime(r.getData()); |
| | | } else { |
| | | throw new RuntimeException(r.getMsg()); |
| | | } |
| | | |
| | | } |
| | | // // 算时间 |
| | | // if (xpOrder.getStatus() == 1) { |
| | | // R<Integer> r = xpPricingClient.getWaitTime(new LonLatDto(xpOrder.getStartLon(), xpOrder.getStartLat())); |
| | | // if (r.getCode() == R.SUCCESS) { |
| | | // xpOrderDetailVO.setEstimatedTime(r.getData()); |
| | | // } else { |
| | | // throw new RuntimeException(r.getMsg()); |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | if (xpOrder.getVehicleId() != null) { |
| | | R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(xpOrder.getVehicleId()); |
| | |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | log.info("运维人员修改订单价格推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber()); |
| | | log.info("运维人员修改订单价格推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), order.getOrderNumber()); |
| | | } |
| | | }); |
| | | } |
| | |
| | | String timeStr = dynamicPriceObj.toString(); |
| | | // 判断当前距离这个时间范围的新增订单数(排除取消) / 上浮数量 算出应该增加的价格率 |
| | | R<Integer> r = xpOrderClient.getOrderNum(new GetOrderNumDto(timeStr,openCityId)); |
| | | if(r.getData()==200){ |
| | | if(r.getCode()==200){ |
| | | int num = r.getData(); |
| | | // X单上升一次调价 |
| | | Integer orderNum = getOrderNum(jsonObject, 4); |
| | |
| | | String timeStr = dynamicPriceObj.toString(); |
| | | // 判断当前距离这个时间范围的新增订单数(排除取消) / 上浮数量 算出应该增加的价格率 |
| | | R<Integer> r = xpOrderClient.getOrderNum(new GetOrderNumDto(timeStr,openCityId)); |
| | | if(r.getData()==200){ |
| | | if(r.getCode()==200){ |
| | | int num = r.getData(); |
| | | // X单上升一次调价 |
| | | Integer orderNum = getOrderNum(jsonObject, 4); |