您的位置:首页 > 文旅 > 旅游 > 宣传片制作公司有哪些_投票网页怎么制作_什么是论坛推广_海外推广运营

宣传片制作公司有哪些_投票网页怎么制作_什么是论坛推广_海外推广运营

2025/1/9 10:31:06 来源:https://blog.csdn.net/qq_73340809/article/details/143163362  浏览:    关键词:宣传片制作公司有哪些_投票网页怎么制作_什么是论坛推广_海外推广运营
宣传片制作公司有哪些_投票网页怎么制作_什么是论坛推广_海外推广运营

文章目录

  • 工作台
    • 今日数据接口
      • WorkSpaceController
      • WorkspaceService
      • WorkspaceServiceImpl
    • 订单管理接口
      • WorkSpaceController
      • WorkspaceService
      • WorkspaceServiceImpl
    • 菜品总览接口
      • WorkSpaceController
      • WorkspaceService
      • WorkspaceServiceImpl
    • 套餐总览接口
      • WorkSpaceController
      • WorkspaceService
      • WorkspaceServiceImpl

数据统计-Excel报表

工作台

今日数据接口

WorkSpaceController

@RestController
@RequestMapping("/admin/workspace")
@Slf4j
@Api(tags = "工作台")
public class WorkSpaceController {@Autowiredprivate WorkspaceService workspaceService;/*** 查询今日运营数据*/@GetMapping("/businessData")@ApiOperation(value = "查询今日运营数据")public Result<BusinessDataVO> businessData() {log.info("查询今日运营数据");//获得当天的开始时间LocalDateTime begin = LocalDateTime.now().with(LocalTime.MIN);//获得当天的结束时间LocalDateTime end = LocalDateTime.now().with(LocalTime.MAX);BusinessDataVO businessDataVO = workspaceService.getBusinessData(begin, end);return Result.success(businessDataVO);}
}

WorkspaceService

public interface WorkspaceService {/*** 查询今日运营数据*/BusinessDataVO getBusinessData(LocalDateTime begin, LocalDateTime end);
}

WorkspaceServiceImpl

@Service
@Slf4j
public class WorkspaceServiceImpl implements WorkspaceService {@Autowiredprivate OrderMapper orderMapper;@Autowiredprivate UserMapper userMapper;@Autowiredprivate DishMapper dishMapper;@Autowiredprivate SetmealMapper setmealMapper;/*** 查询今日运营数据*/@Overridepublic BusinessDataVO getBusinessData(LocalDateTime begin, LocalDateTime end) {/*** 营业额:当日已完成订单的总金额* 有效订单:当日已完成订单的数量* 订单完成率:有效订单数 / 总订单数* 平均客单价:营业额 / 有效订单数* 新增用户:当日新增用户的数量*/Map map = new HashMap();map.put("begin", begin);map.put("end", end);//查询总订单数Integer totalOrderCount = orderMapper.countByMap(map);map.put("status", Orders.COMPLETED);//营业额Double turnover = orderMapper.sumByMap(map);turnover = turnover == null ? 0.0 : turnover;//有效订单数Integer validOrderCount = orderMapper.countByMap(map);Double unitPrice = 0.0;Double orderCompletionRate = 0.0;if (totalOrderCount != 0 && validOrderCount != 0) {//订单完成率orderCompletionRate = validOrderCount.doubleValue() / totalOrderCount;//平均客单价unitPrice = turnover / validOrderCount;}//新增用户数Integer newUsers = userMapper.countByMap(map);return BusinessDataVO.builder().turnover(turnover).validOrderCount(validOrderCount).orderCompletionRate(orderCompletionRate).unitPrice(unitPrice).newUsers(newUsers).build();}
}

订单管理接口

WorkSpaceController

    /*** 查询订单管理数据*/@GetMapping("/overviewOrders")@ApiOperation(value = "查询订单管理数据")public Result<OrderOverViewVO> orderOverView() {log.info("查询订单概况");OrderOverViewVO orderOverViewVO = workspaceService.getOrderOverView();return Result.success(orderOverViewVO);}

WorkspaceService

 /*** 查询订单管理数据*/OrderOverViewVO getOrderOverView();

WorkspaceServiceImpl

/*** 查询订单管理数据*/@Overridepublic OrderOverViewVO getOrderOverView() {Map map = new HashMap();map.put("begin", LocalDateTime.now().with(LocalTime.MIN));map.put("status", Orders.TO_BE_CONFIRMED);//待接单Integer waitingOrders = orderMapper.countByMap(map);//待派送map.put("status", Orders.CONFIRMED);Integer deliveredOrders = orderMapper.countByMap(map);//已完成map.put("status", Orders.COMPLETED);Integer completedOrders = orderMapper.countByMap(map);//已取消map.put("status", Orders.CANCELLED);Integer cancelledOrders = orderMapper.countByMap(map);//全部订单map.put("status", null);Integer allOrders = orderMapper.countByMap(map);return OrderOverViewVO.builder().waitingOrders(waitingOrders).deliveredOrders(deliveredOrders).completedOrders(completedOrders).cancelledOrders(cancelledOrders).allOrders(allOrders).build();}

菜品总览接口

WorkSpaceController

    /*** 查询菜品总览*/@GetMapping("/overviewDishes")@ApiOperation("查询菜品总览")public Result<DishOverViewVO> dishOverView(){return Result.success(workspaceService.getDishOverView());}

WorkspaceService

    /*** 查询菜品管理数据*/DishOverViewVO getDishOverView();

WorkspaceServiceImpl

/*** 查询菜品总览*/@Overridepublic DishOverViewVO getDishOverView() {LambdaQueryWrapper<Dish> wrapper = new LambdaQueryWrapper<Dish>().eq(Dish::getStatus, StatusConstant.ENABLE);Long sold = dishMapper.selectCount(wrapper);Wrapper<Dish> wrapper1 = new LambdaQueryWrapper<Dish>().eq(Dish::getStatus, StatusConstant.DISABLE);Long discontinued = dishMapper.selectCount(wrapper1);return DishOverViewVO.builder().sold(sold.intValue()).discontinued(discontinued.intValue()).build();}

套餐总览接口

WorkSpaceController

    /*** 查询套餐总览*/@GetMapping("/overviewSetmeals")@ApiOperation("查询套餐总览")public Result<SetmealOverViewVO> setmealOverView(){return Result.success(workspaceService.getSetmealOverView());}

WorkspaceService

  /*** 查询套餐管理数据*/SetmealOverViewVO getSetmealOverView();

WorkspaceServiceImpl

 /*** 查询套餐总览*/@Overridepublic SetmealOverViewVO getSetmealOverView() {LambdaQueryWrapper<Setmeal> wrapper = new LambdaQueryWrapper<Setmeal>().eq(Setmeal::getStatus, StatusConstant.ENABLE);Long sold = setmealMapper.selectCount(wrapper);Wrapper<Setmeal> wrapper1 = new LambdaQueryWrapper<Setmeal>().eq(Setmeal::getStatus, StatusConstant.DISABLE);Long discontinued = setmealMapper.selectCount(wrapper1);return SetmealOverViewVO.builder().sold(sold.intValue()).discontinued(discontinued.intValue()).build();}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com