From 8b5f7469e4470e4b89f1659e1dc361dff5ea1b09 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 11 九月 2024 09:52:54 +0800
Subject: [PATCH] 修改
---
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java | 457 +++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 351 insertions(+), 106 deletions(-)
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
index f405a62..4f25977 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -1,4 +1,7 @@
package com.ruoyi.order.controller;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.google.common.collect.Lists;
+
import java.math.BigDecimal;
import java.time.DayOfWeek;
import java.time.LocalDate;
@@ -28,6 +31,7 @@
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.BasePage;
import com.ruoyi.common.core.web.page.PageInfo;
+import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.integration.api.feignClient.UploadRealTimeMonitoringDataClient;
import com.ruoyi.integration.api.model.ChargingOrderAndUploadRealTimeMonitoringDataDto;
@@ -35,7 +39,11 @@
import com.ruoyi.order.api.model.*;
import com.ruoyi.order.api.query.ChargingOrderQuery;
import com.ruoyi.order.api.query.TChargingCountQuery;
+import com.ruoyi.order.api.query.UploadRealTimeMonitoringDataQuery;
+import com.ruoyi.order.api.vo.*;
+import com.ruoyi.order.api.vo.ChargingOrderInfoVO;
import com.ruoyi.order.api.vo.ChargingOrderVO;
+import com.ruoyi.order.api.vo.GetChargingOrderByLicensePlate;
import com.ruoyi.order.api.vo.TCharingOrderVO;
import com.ruoyi.order.dto.GetMyChargingOrderList;
import com.ruoyi.order.dto.GetNoInvoicedOrder;
@@ -48,6 +56,7 @@
import com.ruoyi.payment.api.feignClient.AliPaymentClient;
import com.ruoyi.payment.api.feignClient.WxPaymentClient;
import com.ruoyi.payment.api.vo.AliQueryOrder;
+import com.ruoyi.payment.api.vo.WxRefundNotifyResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -64,6 +73,7 @@
import java.time.YearMonth;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
+import java.util.*;
import java.util.*;
import java.util.List;
import java.util.stream.Collectors;
@@ -87,20 +97,21 @@
private TokenService tokenService;
@Autowired
private TOrderEvaluateService orderEvaluateService;
-
+
@Resource
private WxPaymentClient wxPaymentClient;
-
+
@Resource
private RedisService redisService;
-
+
@Resource
private AliPaymentClient aliPaymentClient;
@Resource
private TShoppingOrderService shoppingOrderService;
-
- @Autowired
+
+ @Resource
private AppUserClient appUserClient;
+
@Resource
private TVipOrderService vipOrderService;
@@ -124,15 +135,20 @@
@Resource
private TChargingOrderAccountingStrategyService chargingOrderAccountingStrategyService;
-
-
+
@ResponseBody
@PostMapping(value = "/pay/order/list")
@ApiOperation(value = "列表", tags = {"管理后台-支付订单-订单信息"})
public R<PageInfo<PayOrderDto>> payOrderList(@RequestBody PayOrderQueryDto payOrderQueryDto) {
return chargingOrderService.payOrderQuery(payOrderQueryDto);
+ }
+ @ResponseBody
+ @PostMapping(value = "/pay/order/refund")
+ @ApiOperation(value = "退款", tags = {"管理后台-支付订单-订单信息"})
+ public R refund(@RequestBody PayOrderRefundDto payOrderQueryDto) {
+ return chargingOrderService.payRefund(payOrderQueryDto);
}
@ResponseBody
@@ -186,11 +202,12 @@
// payOrderInfoDto3.setRefundAmount(new BigDecimal("0"));
- }
+
+
+ }
return R.ok();
}
-
@ResponseBody
@GetMapping(value = "/pay/order/refund/detail")
@ApiOperation(value = "退款信息", tags = {"管理后台-支付订单-订单信息"})
@@ -223,8 +240,10 @@
payOrderChargingInfo.setChargingName(data1.getName());
TChargingGun data2 = chargingGunClient.getChargingGunById(byId.getChargingGunId()).getData();
payOrderChargingInfo.setGunName(data2.getName());
- List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData();
- payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate());
+ if (byId.getAppUserCarId()!=null) {
+ List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData();
+ payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate());
+ }
return R.ok();
}
@@ -237,13 +256,25 @@
}
+
@ResponseBody
@PostMapping(value = "/pay/order/refund/list")
- @ApiOperation(value = "充电信息", tags = {"管理后台-支付订单-退款订单"})
+ @ApiOperation(value = "列表", tags = {"管理后台-支付订单-退款订单"})
public R<PageInfo<TChargingOrderRefund>> refundList(@RequestBody ChargingRefundDto chargingRefundDto) {
return chargingOrderService.getRefundList(chargingRefundDto);
}
+ @ResponseBody
+ @PostMapping(value = "/pay/order/refund/list1")
+ @ApiOperation(value = "列表1", tags = {"管理后台-支付订单-退款订单"})
+ public R<PageInfo<TChargingOrderRefund>> refundList1(@RequestBody ChargingRefundDto chargingRefundDto) {
+ return chargingOrderService.getRefundList(chargingRefundDto);
+
+ }
+
+
+
+
@ResponseBody
@@ -259,9 +290,19 @@
@ResponseBody
@PostMapping(value = "/chargingOrderInfo")
@ApiOperation(value = "充电桩订单列表查看详情", tags = {"管理后台-订单管理"})
- public AjaxResult<TCharingOrderVO> chargingOrderInfo(String orderId) {
-
- return AjaxResult.success();
+ public AjaxResult<ChargingOrderInfoVO> chargingOrderInfo(String orderId) {
+ ChargingOrderInfoVO chargingOrderInfoVO = new ChargingOrderInfoVO();
+ chargingOrderInfoVO.setCdElectronic("");
+ chargingOrderInfoVO.setCdVoltage("");
+ chargingOrderInfoVO.setSurplus("");
+ chargingOrderInfoVO.setTotalPower("");
+ chargingOrderInfoVO.setLicensePlate("");
+ chargingOrderInfoVO.setVehicleBrand("");
+ chargingOrderInfoVO.setVehicleModel("");
+ chargingOrderInfoVO.setVehicleUse("");
+ List<TChargingOrderAccountingStrategy> tChargingOrderAccountingStrategies = new ArrayList<>();
+ chargingOrderInfoVO.setList(tChargingOrderAccountingStrategies);
+ return AjaxResult.success(chargingOrderInfoVO);
}
@ResponseBody
@@ -272,9 +313,9 @@
orderEvaluateService.addOrderEvaluate(dto);
return AjaxResult.success();
}
-
/**
* 查询用户最近一次充电记录使用的车辆
+ *
* @param
* @return
*/
@@ -283,11 +324,11 @@
List<TChargingOrder> list = chargingOrderService.list(new LambdaQueryWrapper<TChargingOrder>()
.eq(TChargingOrder::getAppUserId, tokenService.getLoginUserApplet().getUserId())
.isNotNull(TChargingOrder::getAppUserCarId));
- if (!list.isEmpty()) {
+ if (!list.isEmpty()){
// 最近使用的车辆id
Long size = list.get(0).getAppUserCarId();
return R.ok(size);
- } else {
+ }else{
return R.ok(-1L);
}
}
@@ -305,7 +346,6 @@
.between(TChargingOrder::getStartTime, req.getStartTime(), req.getEndTime())).size();
return R.ok(size);
}
-
//用户订单数量
@PostMapping(value = "/useOrderCount")
public R<Long> useOrderCount(@RequestParam("userId") Long userId) {
@@ -345,8 +385,10 @@
.eq(TChargingOrder::getDelFlag, 0).eq(TChargingOrder::getStatus, 3));
return R.ok(one);
}
-
-
+
+
+
+
@ResponseBody
@GetMapping(value = "/getMyChargingOrderList")
@ApiOperation(value = "获取充电记录列表", tags = {"小程序-充电记录"})
@@ -354,8 +396,8 @@
Map<String, Object> orderList = chargingOrderService.getMyChargingOrderList(query);
return AjaxResult.success(orderList);
}
-
-
+
+
@ResponseBody
@GetMapping(value = "/getMyChargingOrderInfo")
@ApiOperation(value = "获取充电记订单明细", tags = {"小程序-充电记录"})
@@ -363,8 +405,9 @@
MyChargingOrderInfo myChargingOrderInfo = chargingOrderService.getMyChargingOrderInfo(id);
return AjaxResult.success(myChargingOrderInfo);
}
-
-
+
+
+
@ResponseBody
@GetMapping(value = "/getNoInvoicedOrder")
@ApiOperation(value = "获取未开票的订单数据", tags = {"小程序-充电发票"})
@@ -372,15 +415,16 @@
List<MyChargingOrderList> list = chargingOrderService.getNoInvoicedOrder(query);
return AjaxResult.success(list);
}
-
-
+
+
+
@ResponseBody
@PostMapping(value = "/paymentChargingOrder")
@ApiOperation(value = "支付充电充值费用", tags = {"小程序-扫一扫"})
public AjaxResult paymentChargingOrder(@RequestBody AddChargingOrder addChargingOrder) {
return chargingOrderService.paymentChargingOrder(addChargingOrder);
}
-
+
/**
* 充电充值支付回调
* @param request
@@ -422,6 +466,27 @@
e.printStackTrace();
}
}
+
+
+ /**
+ * 远程启动失败后退款回调
+ * @param request
+ */
+ @ResponseBody
+ @PostMapping(value = "/chargingOrderStartupFailureWxRefund")
+ public void chargingOrderStartupFailureWxRefund(HttpServletRequest request){
+ WxRefundNotifyResp data = wxPaymentClient.refundNotify(request).getData();
+ if(null != data){
+ String out_refund_no = data.getOut_refund_no();
+ String refund_id = data.getRefund_id();
+ String tradeState = data.getTradeState();
+ String success_time = data.getSuccess_time();
+ chargingOrderService.chargingOrderStartupFailureWxRefund(out_refund_no, refund_id, tradeState, success_time);
+ }
+ }
+
+
+
@ResponseBody
@@ -435,8 +500,9 @@
Object cacheObject = redisService.getCacheObject(key);
return AjaxResult.success(cacheObject);
}
-
-
+
+
+
@ResponseBody
@GetMapping(value = "/getChargingDetails/{id}")
@ApiOperation(value = "获取充电中页面数据", tags = {"小程序-扫一扫"})
@@ -529,10 +595,10 @@
@ResponseBody
@GetMapping(value = "/six/total")
@ApiOperation(value = "底部数据分类", tags = {"后台-数据分析-平台收入分析"})
- public R<Map<String,BigDecimal>> total() {
+ public R<Map<String,Object>> total() {
//count近6个月的数据
LocalDate sixBefore = PreviousSixMonths.get();
- Map<String,BigDecimal> map = chargingOrderService.countAll(sixBefore);
+ Map<String,Object> map = chargingOrderService.countAll(sixBefore);
BigDecimal data = parkingLotClient.getRecordAmount(sixBefore).getData();
map.put("parkingAmount",data);
BigDecimal data1 = shoppingOrderService.getSumAmount(sixBefore);
@@ -577,84 +643,223 @@
return AjaxResult.success(res);
}
+
+
+
+
+ /**
+ * 处理充电订单实时监控数据相关的业务逻辑
+ * @param query
+ */
+ @PostMapping("/chargeMonitoring")
+ public void chargeMonitoring(@RequestBody UploadRealTimeMonitoringDataQuery query){
+ chargingOrderService.chargeMonitoring(query);
+ }
+ /**
+ * 通过流水号查询订单
+ * @param code
+ * @return
+ */
+ @PostMapping(value = "/getOrderByCode/{code}")
+ public R<TChargingOrder> getOrderByCode(@PathVariable("code") String code){
+ return R.ok(chargingOrderService.getOne(Wrappers.lambdaQuery(TChargingOrder.class)
+ .eq(TChargingOrder::getCode,code)));
+ }
-// @ResponseBody
-// @PostMapping(value = "/charging/statistics")
-// @ApiOperation(value = "统计", tags = {"管理后台-数据分析-充电运营分析"})
-// public R<TCharingOrderVO> watchChargingOrder(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto){
-// List<Integer> siteIds =new ArrayList<>();
-// if (statisticsQueryDto.getSiteId()==null) {
-// Long userId = SecurityUtils.getUserId();
-// //获取当前登录的siteIds
-// List<GetSiteListDTO> data = siteClient.getSiteListByUserId(userId).getData();
-// for (GetSiteListDTO datum : data) {
-// siteIds.add(datum.getId());
-// }
-// }else {
-// siteIds.add(statisticsQueryDto.getSiteId());
-// }
-//
-//
-// LocalDate start = null;
-// LocalDate end = null;
-// if (statisticsQueryDto.getDayType()==1){
-// start = LocalDate.now();
-//
-// }else if (statisticsQueryDto.getDayType()==2){
-// LocalDate today = LocalDate.now();
-//
-// // 获取本周一的日期
-// LocalDate mondayThisWeek = today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
-//
-// System.out.println("本周一是: " + mondayThisWeek);
-// }
-// else if (statisticsQueryDto.getDayType()==3){
-// // 获取当前日期
-// LocalDate today = LocalDate.now();
-//
-// // 获取本月1号的日期
-// YearMonth yearMonth = YearMonth.from(today);
-// start = yearMonth.atDay(1);
-//
-// System.out.println("本月1号是: " + start);
-// }else if (statisticsQueryDto.getDayType()==4){
-// LocalDate today = LocalDate.now();
-// // 获取当前年份
-// int currentYear = today.getYear();
-// // 获取今年1月1日的日期
-// start = LocalDate.of(currentYear, 1, 1);
-// System.out.println("今年1月1日是: " + start);
-// }else if (statisticsQueryDto.getDayType()==5){
-//
-// // 获取今年1月1日的日期
-// start = statisticsQueryDto.getStartTime();
-// end = statisticsQueryDto.getEndTime();
-// }
-// List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getStartTime, start).le(TChargingOrder::getEndTime, end).in(TChargingOrder::getSiteId, siteIds).list();
-// List<Long> chargingOrderIds = list.stream().map(TChargingOrder::getId).collect(Collectors.toList());
-// //上方饼图
-// List<Map<String,BigDecimal>> maps = chargingOrderService.getSumByType(chargingOrderIds);
-//
-// if (statisticsQueryDto.getDayType()==1){
-// List<Map<String,BigDecimal>> maps1 = chargingOrderService.getDateData(chargingOrderIds);
-//
-// }else if (statisticsQueryDto.getDayType()==2){
-// List<Map<String,BigDecimal>> maps1 = chargingOrderService.getWeekData(chargingOrderIds);
-// }else if (statisticsQueryDto.getDayType()==3){
-// List<Map<String,BigDecimal>> maps1 = chargingOrderService.getMonthData(chargingOrderIds);
-// }else if (statisticsQueryDto.getDayType()==4){
-// List<Map<String,BigDecimal>> maps1 = chargingOrderService.getYearData(chargingOrderIds);
-// }
-//
-//
-//
-//
-//
-//
-// }
+
+ @ResponseBody
+ @PostMapping(value = "/charging/statistics")
+ @ApiOperation(value = "统计,充电订单分析", tags = {"管理后台-数据分析-充电运营分析"})
+ public R<TCharingOrderMapVO> watchChargingOrder(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto){
+ List<Integer> siteIds =new ArrayList<>();
+ if (statisticsQueryDto.getSiteId()==null) {
+ Long userId = SecurityUtils.getUserId();
+ //获取当前登录的siteIds
+ List<GetSiteListDTO> data = siteClient.getSiteListByUserId(userId).getData();
+ for (GetSiteListDTO datum : data) {
+ siteIds.add(datum.getId());
+ }
+ }else {
+ siteIds.add(statisticsQueryDto.getSiteId());
+ }
+ TCharingOrderMapVO tCharingOrderMapVO = new TCharingOrderMapVO();
+
+
+ LocalDate start = null;
+ LocalDate end = null;
+ if (statisticsQueryDto.getDayType()==1){
+ start = LocalDate.now();
+
+ }else if (statisticsQueryDto.getDayType()==2){
+ LocalDate today = LocalDate.now();
+
+ // 获取本周一的日期
+ LocalDate mondayThisWeek = today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
+
+ System.out.println("本周一是: " + mondayThisWeek);
+ }
+ else if (statisticsQueryDto.getDayType()==3){
+ // 获取当前日期
+ LocalDate today = LocalDate.now();
+
+ // 获取本月1号的日期
+ YearMonth yearMonth = YearMonth.from(today);
+ start = yearMonth.atDay(1);
+
+ System.out.println("本月1号是: " + start);
+ }else if (statisticsQueryDto.getDayType()==4){
+ LocalDate today = LocalDate.now();
+ // 获取当前年份
+ int currentYear = today.getYear();
+ // 获取今年1月1日的日期
+ start = LocalDate.of(currentYear, 1, 1);
+ System.out.println("今年1月1日是: " + start);
+ }else if (statisticsQueryDto.getDayType()==5){
+
+ // 获取今年1月1日的日期
+ start = statisticsQueryDto.getStartTime();
+ end = statisticsQueryDto.getEndTime();
+ }
+ List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getStartTime, start).le(TChargingOrder::getEndTime, end).in(TChargingOrder::getSiteId, siteIds).list();
+ List<Long> chargingOrderIds = list.stream().map(TChargingOrder::getId).collect(Collectors.toList());
+ //上方饼图
+ List<Map<String,Object>> maps = chargingOrderService.getSumByType(chargingOrderIds);
+
+ if (statisticsQueryDto.getDayType()==1){
+ List<Map<String,Object>> maps1 = chargingOrderService.getDateData(chargingOrderIds);
+ tCharingOrderMapVO.setMaps1(maps1);
+ }else if (statisticsQueryDto.getDayType()==2){
+ List<Map<String,Object>> maps1 = chargingOrderService.getWeekData(chargingOrderIds);
+ tCharingOrderMapVO.setMaps1(maps1);
+ }else if (statisticsQueryDto.getDayType()==3){
+ List<Map<String,Object>> maps1 = chargingOrderService.getMonthData(chargingOrderIds);
+ tCharingOrderMapVO.setMaps1(maps1);
+ }else if (statisticsQueryDto.getDayType()==4){
+ List<Map<String,Object>> maps1 = chargingOrderService.getYearData(chargingOrderIds);
+ tCharingOrderMapVO.setMaps1(maps1);
+ }else if (statisticsQueryDto.getDayType()==5){
+ List<Map<String,Object>> maps1 = chargingOrderService.getByDate(chargingOrderIds);
+ tCharingOrderMapVO.setMaps1(maps1);
+ }
+
+
+ tCharingOrderMapVO.setMaps(maps);
+
+
+ return R.ok(tCharingOrderMapVO);
+
+ }
+
+
+ @ResponseBody
+ @PostMapping(value = "/charging/power")
+ @ApiOperation(value = "功率", tags = {"管理后台-数据分析-充电运营分析"})
+ public R<TCharingOrderPowerMapVO> power(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto) {
+ List<Integer> siteIds = new ArrayList<>();
+ if (statisticsQueryDto.getSiteId() == null) {
+ Long userId = SecurityUtils.getUserId();
+ //获取当前登录的siteIds
+ List<GetSiteListDTO> data = siteClient.getSiteListByUserId(userId).getData();
+ for (GetSiteListDTO datum : data) {
+ siteIds.add(datum.getId());
+ }
+ } else {
+ siteIds.add(statisticsQueryDto.getSiteId());
+ }
+ List<Map<String,Object>> maps1 = chargingOrderService.queryPower(siteIds);
+
+
+ Map<String,Object> map = chargingOrderService.qureryPowerLevel(siteIds,statisticsQueryDto);
+
+ TCharingOrderPowerMapVO tCharingOrderPowerMapVO = new TCharingOrderPowerMapVO();
+ tCharingOrderPowerMapVO.setMaps1(map);
+ tCharingOrderPowerMapVO.setMaps(maps1);
+ return R.ok(tCharingOrderPowerMapVO);
+
+ }
+
+
+ @ResponseBody
+ @PostMapping(value = "/charging/users")
+ @ApiOperation(value = "除电站流量外", tags = {"管理后台-数据分析-充电用户分析"})
+ public R<TCharingUserMapVO> users(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto){
+
+ TCharingUserMapVO tCharingUserMapVO = new TCharingUserMapVO();
+ //上方折现
+ if (statisticsQueryDto.getDayType()==1){
+ List<Map<String,Object>> map = chargingOrderService.usersDay();
+ tCharingUserMapVO.setMap(map);
+ }else {
+ List<Map<String,Object>> map = chargingOrderService.usersByQuery(statisticsQueryDto);
+ tCharingUserMapVO.setMap(map);
+ }
+
+ //用户标签
+ List<Map<String,Object>> maps = chargingOrderService.getUserTagCount();
+ //会员标签
+ List<Map<String,Object>> maps1 = chargingOrderService.getVipCount();
+
+ //单位消费
+ List<Map<String, Object>> untiMap = chargingOrderService.unitConsumption(statisticsQueryDto);
+
+ //车辆用途
+ List<Map<String, Object>> carMap = chargingOrderService.carUserMethod();
+ //车辆品牌
+ List<Map<String, Object>> carBrandMap = chargingOrderService.carUserBrand();
+ //本地车数量
+ Map<String,Object> localCarMap = chargingOrderService.countLocalCar();
+
+
+ tCharingUserMapVO.setUserMaps(maps);
+ tCharingUserMapVO.setVipMaps(maps1);
+ tCharingUserMapVO.setUntiMap(untiMap);
+ tCharingUserMapVO.setCarMap(carMap);
+ tCharingUserMapVO.setCarBrandMap(carBrandMap);
+ tCharingUserMapVO.setLocalCarMap(localCarMap);
+ return R.ok(tCharingUserMapVO);
+
+ }
+ @ResponseBody
+ @PostMapping(value = "/charging/sites")
+ @ApiOperation(value = "电站评价", tags = {"管理后台-数据分析-充电用户分析"})
+ public R<TCharingUserEvaluateVO> sites(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto){
+ List<Integer> siteIds =new ArrayList<>();
+ if (statisticsQueryDto.getSiteId()==null) {
+ Long userId = SecurityUtils.getUserId();
+ //获取当前登录的siteIds
+ List<GetSiteListDTO> data = siteClient.getSiteListByUserId(userId).getData();
+ for (GetSiteListDTO datum : data) {
+ siteIds.add(datum.getId());
+ }
+ }else {
+ siteIds.add(statisticsQueryDto.getSiteId());
+ }
+ //查询评价分
+ Long aver = chargingOrderService.getAver(siteIds);
+ //查询各个分数
+ List<Map<String,Object>> evaluate = chargingOrderService.getLevelEvaluate(siteIds);
+ //查询差评回复数
+ Long count = orderEvaluateService.lambdaQuery().isNotNull(TOrderEvaluate::getResponseTime).count();
+ TCharingUserEvaluateVO tCharingUserEvaluateVO = new TCharingUserEvaluateVO();
+ tCharingUserEvaluateVO.setAver(aver);
+ tCharingUserEvaluateVO.setEvaluate(evaluate);
+ tCharingUserEvaluateVO.setBlackCount(count);
+
+
+
+ //标签
+ //查出好评ids
+// orderEvaluateService.goodTop();
+
+
+
+
+ //流量
+ return R.ok(tCharingUserEvaluateVO);
+ }
public static void main(String[] args) {
// 示例数据
@@ -709,4 +914,44 @@
return resultList;
}
+
+ /**
+ * 硬件充电结束后的处理逻辑
+ * @param code
+ */
+ @PostMapping("/endCharge")
+ public void endCharge(@RequestParam("code") String code){
+ chargingOrderService.endCharge(code, 2);
+ }
+
+ /**
+ * 硬件异常结束充电后的处理逻辑
+ * @param code
+ */
+ @PostMapping("/excelEndCharge")
+ public void excelEndCharge(@RequestParam("code") String code){
+ chargingOrderService.excelEndCharge(code);
+ }
+
+
+ /**
+ * 根据车牌号和时间查询有效的充电数据
+ * @param query
+ * @return
+ */
+ @PostMapping("/getChargingOrderByLicensePlate")
+ public R<TChargingOrder> getChargingOrderByLicensePlate(@RequestBody GetChargingOrderByLicensePlate query){
+ TChargingOrder chargingOrder = chargingOrderService.getChargingOrderByLicensePlate(query);
+ return R.ok(chargingOrder);
+ }
+ /**
+ * 修改充电订单
+ * @param chargingOrder
+ * @return
+ */
+ @PostMapping("/updateChargingOrder")
+ public R<String> updateChargingOrder(@RequestBody TChargingOrder chargingOrder){
+ chargingOrderService.updateById(chargingOrder);
+ return R.ok();
+ }
}
--
Gitblit v1.7.1