From c46abc86aa856354cf8bb8a04cb9738c0b414392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=86=E7=B1=B3=E8=8A=B1?= <417727563@qq.com> Date: Wed, 22 Feb 2023 16:04:30 +0800 Subject: [PATCH] =?UTF-8?q?2023-02-22-01=20=E5=A4=A7=E5=B1=8F=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ZyOrderServiceImpl.java | 1 + .../modules/shop/Service/ZyShopService.java | 4 +-- .../shop/Service/impl/ZyShopServiceImpl.java | 14 +++++----- .../shop/controller/ZyShopController.java | 19 ++++++------- .../modules/shop/mapper/ZyShopMapper.java | 4 +-- .../modules/shop/mapper/xml/ZyShopMapper.xml | 26 +++++++++--------- .../demo/zyorders/mapper/ZyOrdersMapper.java | 6 +++++ .../zyorders/mapper/xml/ZyOrdersMapper.xml | 16 +++++++++++ .../zyorders/service/IZyOrdersService.java | 3 +++ .../service/impl/ZyOrdersServiceImpl.java | 22 +++++++++++++-- .../largeScreen/LargeScreenController.java | 27 +++++++++++++++++++ 11 files changed, 106 insertions(+), 36 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java b/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java index 262002ae..8efc678d 100644 --- a/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java @@ -370,6 +370,7 @@ public class ZyOrderServiceImpl implements ZyOrderService { queryWrapper.isNotNull("id"); Double all = Double.valueOf(zyOrderMapper.selectCount(queryWrapper)); + //获得不同订单状态数据 List statusNums = zyOrderMapper.percentStatu(); List statusNumList = JSON.parseArray(ZyMakeClothPlanMessage.STATUS, StatusNum.class); diff --git a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/ZyShopService.java b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/ZyShopService.java index f98d06e6..af23af87 100644 --- a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/ZyShopService.java +++ b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/ZyShopService.java @@ -28,7 +28,7 @@ public interface ZyShopService { //查询近七日订单数 String selectOrderBetweenThisW(); //查询近七日销售额 - List selectSalesVolumeBetweenThisW(); + Double selectSalesVolumeBetweenThisW(); List selectAllShopSalesVolumeByLastM(); //查询无人店铺下单人数 @@ -36,7 +36,7 @@ public interface ZyShopService { List queryByList(); - Integer selectAllShopSalesThisD(); + Double selectAllShopSalesThisD(); Integer selectSalesVolumeByThisTime(String id); diff --git a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/impl/ZyShopServiceImpl.java b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/impl/ZyShopServiceImpl.java index ccce7c49..b375e94a 100644 --- a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/impl/ZyShopServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/impl/ZyShopServiceImpl.java @@ -101,7 +101,7 @@ public class ZyShopServiceImpl implements ZyShopService { * @return */ @Override - public List selectSalesVolumeBetweenThisW() { + public Double selectSalesVolumeBetweenThisW() { String start_time = GetTime.getLastSevenDay(7); String end_time = String.format("%tF", date); return zyShopMapper.selectSalesVolumeBetweenThisW(start_time, end_time); @@ -247,13 +247,15 @@ public class ZyShopServiceImpl implements ZyShopService { * @return */ @Override - public Integer selectAllShopSalesThisD() { - int ShopSales = 0; + public Double selectAllShopSalesThisD() { + Double ShopSales = 0.00d; String format = String.format("%tF", date); - List list = zyShopMapper.selectAllShopSalesThisD(format); - for (int i = list.size() - 1; i >= 0; i--) { - ShopSales = ShopSales + list.get(i); + Double sales = zyShopMapper.selectAllShopSalesThisD(format); + if(sales!=null && sales>ShopSales) + { + ShopSales=sales; } + return ShopSales; } diff --git a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/controller/ZyShopController.java b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/controller/ZyShopController.java index b4bc3e46..56d52af0 100644 --- a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/controller/ZyShopController.java +++ b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/controller/ZyShopController.java @@ -143,7 +143,7 @@ public class ZyShopController { @ApiOperation(value = "查询今天的营业额", notes = "查询今天的营业额") @GetMapping("/selectAllShopSalesThisD") public Result selectAllShopSalesThisD() { - Integer shopSales = zyShopService.selectAllShopSalesThisD(); + Double shopSales = zyShopService.selectAllShopSalesThisD(); return Result.OK(shopSales); } @@ -160,17 +160,14 @@ public class ZyShopController { @AutoLog(value = "查询近七日销售额") @ApiOperation(value = "查询近七日销售额", notes = "查询近七日销售额") @GetMapping("/selectSalesVolumeBetweenThisW") - public Result selectSalesVolumeBetweenThisW(){ - List list = zyShopService.selectSalesVolumeBetweenThisW(); - int salesVolem = 0; - if (list.isEmpty()) { - return Result.OK(0); - } else { - for (Integer sales : list) { - salesVolem += sales; - } - return Result.OK(salesVolem); + public Result selectSalesVolumeBetweenThisW(){ + Double sales = zyShopService.selectSalesVolumeBetweenThisW(); + Double salesVolem = 0.00d; + if(sales!=null && sales>salesVolem) + { + salesVolem=sales; } + return Result.OK(salesVolem); } } diff --git a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/ZyShopMapper.java b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/ZyShopMapper.java index f99fd16b..01b3df21 100644 --- a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/ZyShopMapper.java +++ b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/ZyShopMapper.java @@ -26,7 +26,7 @@ public interface ZyShopMapper extends BaseMapper { //查询近七日订单数 String selectOrderBetweenThisW(String start_time,String end_time); //查询近七日销售额 - List selectSalesVolumeBetweenThisW(String start_time,String end_time); + Double selectSalesVolumeBetweenThisW(String start_time,String end_time); //查询所有店铺上月销售额 List selectAllShopSalesVolumeByLastM(String start_time,String end_time); //查询无人店铺下单人数 @@ -36,7 +36,7 @@ public interface ZyShopMapper extends BaseMapper { //查询当前店铺月销售额 List queryByList(String name, String start_time, String end_time); //查询今天的营业额 - List selectAllShopSalesThisD(String time); + Double selectAllShopSalesThisD(String time); // List selectSalesVolumeByThisTime(String id,String time); diff --git a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/xml/ZyShopMapper.xml b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/xml/ZyShopMapper.xml index c0ab0646..312b418a 100644 --- a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/xml/ZyShopMapper.xml +++ b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/xml/ZyShopMapper.xml @@ -25,15 +25,15 @@ @@ -87,16 +87,16 @@ - + SELECT sum(money) as total_money + FROM zy_orders + WHERE payment_time LIKE #{time}"%" AND ischild=0 AND payment_status=1 - + SELECT sum(money) as total_money + FROM zy_orders WHERE shop_id = #{id} - AND pay_time LIKE #{time}"%" + AND payment_time LIKE #{time}"%" diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/ZyOrdersMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/ZyOrdersMapper.java index 0613582e..3e6f5aac 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/ZyOrdersMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/ZyOrdersMapper.java @@ -5,6 +5,7 @@ import java.util.List; import org.apache.ibatis.annotations.Param; import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo; /** * @Description: 订单基本信息管理 @@ -14,4 +15,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface ZyOrdersMapper extends BaseMapper { + /** + * 获取今日订单及七日订单 + * @return + */ + TodayOrderAndQIriVo getTotalOrderAndWeek(); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml index 519d0cd0..6c40fc2e 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml @@ -2,4 +2,20 @@ + + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java index 8c48a272..eda4b3bb 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java @@ -3,6 +3,7 @@ package org.jeecg.modules.demo.zyorders.service; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo; import java.util.List; @@ -18,4 +19,6 @@ public interface IZyOrdersService extends IService { List getOrderStatus(); //大屏数据-获取历史订单 List getOldOrder(); + //大屏数据-获取今日订单及七日订单 + TodayOrderAndQIriVo getOrder(); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java index 00f20319..351ed7e4 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper; import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; +import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -55,7 +56,7 @@ public class ZyOrdersServiceImpl extends ServiceImpl i // System.out.println(endTime); QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.ge("create_time", starTime).le("create_time", endTime).eq("pay_status", 1); + wrapper.ge("create_time", starTime).le("create_time", endTime).eq("payment_status", 1); List zyOrderList = baseMapper.selectList(wrapper); return zyOrderList; @@ -68,8 +69,25 @@ public class ZyOrdersServiceImpl extends ServiceImpl i @Override public List getOldOrder() { QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("is_delete", 0).orderByDesc("create_time"); + wrapper +// .eq("is_delete", 0) + .orderByDesc("create_time"); List orderList = baseMapper.selectList(wrapper); return orderList; } + + /** + * 获取今日订单及七日订单 + * @return + */ + @Override + public TodayOrderAndQIriVo getOrder() { + TodayOrderAndQIriVo todayOrderAndQIriVo = baseMapper.getTotalOrderAndWeek(); + if (todayOrderAndQIriVo != null) { + return todayOrderAndQIriVo; + } else { + return null; + } + } + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java index dc654f25..bd9277d1 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java @@ -7,6 +7,8 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; +import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo; +import org.jeecg.modules.shop.vo.OrderSales; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -27,6 +29,10 @@ public class LargeScreenController { private IZyOrdersService zyOrdersService; + /********************************************订单大数据监控系统********************************************/ + + /************************************实时订单展示************************************/ + /** * 查询订单的状态 * @@ -61,4 +67,25 @@ public class LargeScreenController { } +// @AutoLog(value = "订单销售分析") +// @ApiOperation(value = "订单销售分析", notes = "订单销售分析") +// @GetMapping("/selectOrderSale") +// public Result selectOrderSale(){ +// List list = zyOrdersService.selectOrderSale(); +// return Result.OK(list); +// } + /************************************销售订单数据************************************/ + + @AutoLog(value = "获取今日订单及七日订单") + @ApiOperation(value = "获取今日订单及七日订单", notes = "获取今日订单及七日订单") + @GetMapping("/getOrder") + public Result getOrder() { + TodayOrderAndQIriVo todayOrderAndQIriVo = zyOrdersService.getOrder(); + if (todayOrderAndQIriVo != null) { + return Result.OK(todayOrderAndQIriVo); + }else { + return Result.OK("没有工作安排"); + } + } + }