From a067fdbf6b1374a1402096c722257575916eab99 Mon Sep 17 00:00:00 2001
From: wjli <591616088@qq.com>
Date: 星期四, 11 五月 2023 16:21:14 +0800
Subject: [PATCH] 1.首页分段显示 2.配送订单页可根据分段显示 3.后端配送率统计
---
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CarController.java | 51 +++++++++++++++++++++++++++++++++------------------
1 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CarController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CarController.java
index df00ea4..e5a0da8 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CarController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CarController.java
@@ -129,25 +129,40 @@
public Result<List<Car>> getInfo(String beginTime,String endTime) {
java.text.DecimalFormat df =new java.text.DecimalFormat("#.##");
- QueryWrapper<Car> wrapper = new QueryWrapper<>();
- wrapper.ge(beginTime!=null && beginTime!="","a.add_date",beginTime);
- wrapper.le(endTime!=null && endTime!="","a.add_date",endTime);
- wrapper.groupBy("car_no");
- List<Car> list2 = iCarService.getCarInfo2(wrapper);
- List<Car> list = iCarService.getCarInfo();
- for (Car car:list2){
- for (Car car1:list){
- if (car.getId().equals(car1.getId())){
- car1.setAmount(Double.parseDouble(df.format(car.getAmount())));
- car1.setMileage(Double.parseDouble(df.format(car.getMileage())));
- car1.setMoney(Double.parseDouble(df.format(car.getMoney())));
- car1.setAllAmount(Double.parseDouble(df.format(car1.getAllAmount())));
- car1.setAllMileage(Double.parseDouble(df.format(car1.getAllMileage())));
- car1.setAllMoney(Double.parseDouble(df.format(car1.getAllMoney())));
- continue;
- }
- }
+ QueryWrapper<AddOil> wrapper = new QueryWrapper<>();
+ wrapper.ge(beginTime!=null && beginTime!="","add_date",beginTime);
+ wrapper.le(endTime!=null && endTime!="","add_date",endTime);
+// wrapper.groupBy("car_id");
+ List<AddOil> addOilList = iAddOilService.list(wrapper);
+ List<Car> list = new ArrayList<>();
+ Map<String, List<AddOil>> collect = addOilList.stream().collect(Collectors.groupingBy(AddOil::getCarId));
+ for (Map.Entry<String, List<AddOil>> stringListEntry : collect.entrySet()) {
+ String key = stringListEntry.getKey();
+ Car car = iCarService.getById(key);
+ Car carInfoByCarId = iCarService.getCarInfoByCarId(key);
+ car.setAmount(Double.parseDouble(df.format(carInfoByCarId.getAmount())));
+ car.setMileage(Double.parseDouble(df.format(carInfoByCarId.getMileage())));
+ car.setMoney(Double.parseDouble(df.format(carInfoByCarId.getMoney())));
+ car.setAllAmount(Double.parseDouble(df.format(carInfoByCarId.getAllAmount())));
+ car.setAllMileage(Double.parseDouble(df.format(carInfoByCarId.getAllMileage())));
+ car.setAllMoney(Double.parseDouble(df.format(carInfoByCarId.getAllMoney())));
+ list.add(car);
}
+// List<Car> list2 = iCarService.getCarInfo2(wrapper);
+// List<Car> list = iCarService.getCarInfo();
+// for (Car car:list2){
+// for (Car car1:list){
+// if (car.getId().equals(car1.getId())){
+// car1.setAmount(Double.parseDouble(df.format(car.getAmount())));
+// car1.setMileage(Double.parseDouble(df.format(car.getMileage())));
+// car1.setMoney(Double.parseDouble(df.format(car.getMoney())));
+// car1.setAllAmount(Double.parseDouble(df.format(car1.getAllAmount())));
+// car1.setAllMileage(Double.parseDouble(df.format(car1.getAllMileage())));
+// car1.setAllMoney(Double.parseDouble(df.format(car1.getAllMoney())));
+// continue;
+// }
+// }
+// }
return new ResultUtil<List<Car>>().setData(list);
}
--
Gitblit v1.9.1