2023-02-22-01 大屏订单数据

zhc4dev
喻忠伟 2 years ago
parent 5f38e6ef18
commit c46abc86aa
  1. 1
      jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java
  2. 4
      jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/ZyShopService.java
  3. 14
      jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/impl/ZyShopServiceImpl.java
  4. 19
      jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/controller/ZyShopController.java
  5. 4
      jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/ZyShopMapper.java
  6. 26
      jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/xml/ZyShopMapper.xml
  7. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/ZyOrdersMapper.java
  8. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml
  9. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java
  10. 22
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java
  11. 27
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java

@ -370,6 +370,7 @@ public class ZyOrderServiceImpl implements ZyOrderService {
queryWrapper.isNotNull("id"); queryWrapper.isNotNull("id");
Double all = Double.valueOf(zyOrderMapper.selectCount(queryWrapper)); Double all = Double.valueOf(zyOrderMapper.selectCount(queryWrapper));
//获得不同订单状态数据
List<StatusNum> statusNums = zyOrderMapper.percentStatu(); List<StatusNum> statusNums = zyOrderMapper.percentStatu();
List<StatusNum> statusNumList = JSON.parseArray(ZyMakeClothPlanMessage.STATUS, StatusNum.class); List<StatusNum> statusNumList = JSON.parseArray(ZyMakeClothPlanMessage.STATUS, StatusNum.class);

@ -28,7 +28,7 @@ public interface ZyShopService {
//查询近七日订单数 //查询近七日订单数
String selectOrderBetweenThisW(); String selectOrderBetweenThisW();
//查询近七日销售额 //查询近七日销售额
List<Integer> selectSalesVolumeBetweenThisW(); Double selectSalesVolumeBetweenThisW();
List selectAllShopSalesVolumeByLastM(); List selectAllShopSalesVolumeByLastM();
//查询无人店铺下单人数 //查询无人店铺下单人数
@ -36,7 +36,7 @@ public interface ZyShopService {
List<Type> queryByList(); List<Type> queryByList();
Integer selectAllShopSalesThisD(); Double selectAllShopSalesThisD();
Integer selectSalesVolumeByThisTime(String id); Integer selectSalesVolumeByThisTime(String id);

@ -101,7 +101,7 @@ public class ZyShopServiceImpl implements ZyShopService {
* @return * @return
*/ */
@Override @Override
public List<Integer> selectSalesVolumeBetweenThisW() { public Double selectSalesVolumeBetweenThisW() {
String start_time = GetTime.getLastSevenDay(7); String start_time = GetTime.getLastSevenDay(7);
String end_time = String.format("%tF", date); String end_time = String.format("%tF", date);
return zyShopMapper.selectSalesVolumeBetweenThisW(start_time, end_time); return zyShopMapper.selectSalesVolumeBetweenThisW(start_time, end_time);
@ -247,13 +247,15 @@ public class ZyShopServiceImpl implements ZyShopService {
* @return * @return
*/ */
@Override @Override
public Integer selectAllShopSalesThisD() { public Double selectAllShopSalesThisD() {
int ShopSales = 0; Double ShopSales = 0.00d;
String format = String.format("%tF", date); String format = String.format("%tF", date);
List<Integer> list = zyShopMapper.selectAllShopSalesThisD(format); Double sales = zyShopMapper.selectAllShopSalesThisD(format);
for (int i = list.size() - 1; i >= 0; i--) { if(sales!=null && sales>ShopSales)
ShopSales = ShopSales + list.get(i); {
ShopSales=sales;
} }
return ShopSales; return ShopSales;
} }

@ -143,7 +143,7 @@ public class ZyShopController {
@ApiOperation(value = "查询今天的营业额", notes = "查询今天的营业额") @ApiOperation(value = "查询今天的营业额", notes = "查询今天的营业额")
@GetMapping("/selectAllShopSalesThisD") @GetMapping("/selectAllShopSalesThisD")
public Result<?> selectAllShopSalesThisD() { public Result<?> selectAllShopSalesThisD() {
Integer shopSales = zyShopService.selectAllShopSalesThisD(); Double shopSales = zyShopService.selectAllShopSalesThisD();
return Result.OK(shopSales); return Result.OK(shopSales);
} }
@ -160,17 +160,14 @@ public class ZyShopController {
@AutoLog(value = "查询近七日销售额") @AutoLog(value = "查询近七日销售额")
@ApiOperation(value = "查询近七日销售额", notes = "查询近七日销售额") @ApiOperation(value = "查询近七日销售额", notes = "查询近七日销售额")
@GetMapping("/selectSalesVolumeBetweenThisW") @GetMapping("/selectSalesVolumeBetweenThisW")
public Result<Integer> selectSalesVolumeBetweenThisW(){ public Result<Double> selectSalesVolumeBetweenThisW(){
List<Integer> list = zyShopService.selectSalesVolumeBetweenThisW(); Double sales = zyShopService.selectSalesVolumeBetweenThisW();
int salesVolem = 0; Double salesVolem = 0.00d;
if (list.isEmpty()) { if(sales!=null && sales>salesVolem)
return Result.OK(0); {
} else { salesVolem=sales;
for (Integer sales : list) {
salesVolem += sales;
}
return Result.OK(salesVolem);
} }
return Result.OK(salesVolem);
} }
} }

@ -26,7 +26,7 @@ public interface ZyShopMapper extends BaseMapper<ZyShop> {
//查询近七日订单数 //查询近七日订单数
String selectOrderBetweenThisW(String start_time,String end_time); String selectOrderBetweenThisW(String start_time,String end_time);
//查询近七日销售额 //查询近七日销售额
List<Integer> selectSalesVolumeBetweenThisW(String start_time,String end_time); Double selectSalesVolumeBetweenThisW(String start_time,String end_time);
//查询所有店铺上月销售额 //查询所有店铺上月销售额
List<ZyShopNameAndPayMoney> selectAllShopSalesVolumeByLastM(String start_time,String end_time); List<ZyShopNameAndPayMoney> selectAllShopSalesVolumeByLastM(String start_time,String end_time);
//查询无人店铺下单人数 //查询无人店铺下单人数
@ -36,7 +36,7 @@ public interface ZyShopMapper extends BaseMapper<ZyShop> {
//查询当前店铺月销售额 //查询当前店铺月销售额
List<ZyOrderPayAndTime> queryByList(String name, String start_time, String end_time); List<ZyOrderPayAndTime> queryByList(String name, String start_time, String end_time);
//查询今天的营业额 //查询今天的营业额
List<Integer> selectAllShopSalesThisD(String time); Double selectAllShopSalesThisD(String time);
// //
List<Integer> selectSalesVolumeByThisTime(String id,String time); List<Integer> selectSalesVolumeByThisTime(String id,String time);

@ -25,15 +25,15 @@
<!-- 查询近七日订单数 --> <!-- 查询近七日订单数 -->
<select id="selectOrderBetweenThisW" resultType="String"> <select id="selectOrderBetweenThisW" resultType="String">
select count(*) select count(*)
from zy_order from zy_orders
where pay_time BETWEEN #{start_time} AND #{end_time} where payment_time BETWEEN #{start_time} AND #{end_time} AND ischild=0
</select> </select>
<!-- 查询近七日销售额 --> <!-- 查询近七日销售额 -->
<select id="selectSalesVolumeBetweenThisW" resultType="Integer"> <select id="selectSalesVolumeBetweenThisW" resultType="Integer">
SELECT total_money SELECT sum(money) as total_money
FROM zy_order FROM zy_orders
WHERE pay_time between #{start_time} and #{end_time} WHERE payment_time between #{start_time} and #{end_time} AND ischild=0
</select> </select>
<!--查询所有店铺上月销售额 --> <!--查询所有店铺上月销售额 -->
@ -87,16 +87,16 @@
</select> </select>
<!-- 查询今天的营业额 --> <!-- 查询今天的营业额 -->
<select id="selectAllShopSalesThisD" resultType="Integer"> <select id="selectAllShopSalesThisD" resultType="Double">
SELECT total_money SELECT sum(money) as total_money
FROM zy_order FROM zy_orders
WHERE pay_time LIKE #{time}"%" WHERE payment_time LIKE #{time}"%" AND ischild=0 AND payment_status=1
</select> </select>
<select id="selectSalesVolumeByThisTime" resultType="Integer"> <select id="selectSalesVolumeByThisTime" resultType="Double">
SELECT total_money SELECT sum(money) as total_money
FROM zy_order FROM zy_orders
WHERE shop_id = #{id} WHERE shop_id = #{id}
AND pay_time LIKE #{time}"%" AND payment_time LIKE #{time}"%"
</select> </select>
</mapper> </mapper>

@ -5,6 +5,7 @@ import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
/** /**
* @Description: 订单基本信息管理 * @Description: 订单基本信息管理
@ -14,4 +15,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface ZyOrdersMapper extends BaseMapper<ZyOrders> { public interface ZyOrdersMapper extends BaseMapper<ZyOrders> {
/**
* 获取今日订单及七日订单
* @return
*/
TodayOrderAndQIriVo getTotalOrderAndWeek();
} }

@ -2,4 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper"> <mapper namespace="org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper">
<select id="getTotalOrderAndWeek" resultType="org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo">
SELECT
a.todayNum,
b.weekTotal
FROM
(
( SELECT COUNT( 1 ) todayNum FROM zy_orders WHERE to_days( create_time ) = to_days( now()) and payment_status=1 and ischild=0 ) a,
(
SELECT
COUNT( 1 ) weekTotal
FROM
zy_orders
WHERE
DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= DATE( create_time ) and payment_status=1 and ischild=0 ) b)
</select>
</mapper> </mapper>

@ -3,6 +3,7 @@ package org.jeecg.modules.demo.zyorders.service;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
import java.util.List; import java.util.List;
@ -18,4 +19,6 @@ public interface IZyOrdersService extends IService<ZyOrders> {
List<ZyOrders> getOrderStatus(); List<ZyOrders> getOrderStatus();
//大屏数据-获取历史订单 //大屏数据-获取历史订单
List<ZyOrders> getOldOrder(); List<ZyOrders> getOldOrder();
//大屏数据-获取今日订单及七日订单
TodayOrderAndQIriVo getOrder();
} }

@ -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.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper; import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -55,7 +56,7 @@ public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> i
// System.out.println(endTime); // System.out.println(endTime);
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>(); QueryWrapper<ZyOrders> 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<ZyOrders> zyOrderList = baseMapper.selectList(wrapper); List<ZyOrders> zyOrderList = baseMapper.selectList(wrapper);
return zyOrderList; return zyOrderList;
@ -68,8 +69,25 @@ public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> i
@Override @Override
public List<ZyOrders> getOldOrder() { public List<ZyOrders> getOldOrder() {
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>(); QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>();
wrapper.eq("is_delete", 0).orderByDesc("create_time"); wrapper
// .eq("is_delete", 0)
.orderByDesc("create_time");
List<ZyOrders> orderList = baseMapper.selectList(wrapper); List<ZyOrders> orderList = baseMapper.selectList(wrapper);
return orderList; return orderList;
} }
/**
* 获取今日订单及七日订单
* @return
*/
@Override
public TodayOrderAndQIriVo getOrder() {
TodayOrderAndQIriVo todayOrderAndQIriVo = baseMapper.getTotalOrderAndWeek();
if (todayOrderAndQIriVo != null) {
return todayOrderAndQIriVo;
} else {
return null;
}
}
} }

@ -7,6 +7,8 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; 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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -27,6 +29,10 @@ public class LargeScreenController {
private IZyOrdersService zyOrdersService; private IZyOrdersService zyOrdersService;
/********************************************订单大数据监控系统********************************************/
/************************************实时订单展示************************************/
/** /**
* 查询订单的状态 * 查询订单的状态
* *
@ -61,4 +67,25 @@ public class LargeScreenController {
} }
// @AutoLog(value = "订单销售分析")
// @ApiOperation(value = "订单销售分析", notes = "订单销售分析")
// @GetMapping("/selectOrderSale")
// public Result<?> selectOrderSale(){
// List<OrderSales> 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("没有工作安排");
}
}
} }

Loading…
Cancel
Save