From 1540db84df9f37f40954f7ffebb4726a71e1b037 Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Fri, 11 Dec 2020 14:42:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E5=BD=93?= =?UTF-8?q?=E5=A4=A9=E5=91=98=E5=B7=A5=E8=AE=A2=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantang/controller/ClientController.java | 7 +++---- .../ruoyi/system/fantang/domain/FtOrderDao.java | 2 +- .../system/fantang/mapper/FtOrderDaoMapper.java | 5 +++++ .../system/fantang/service/IFtOrderDaoService.java | 2 ++ .../service/impl/FtOrderDaoServiceImpl.java | 14 ++++++++++++++ 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java index c0fc78090..0ba64a499 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java @@ -42,8 +42,8 @@ public class ClientController extends BaseController { } @GetMapping("/getOrderOfToday/{staffId}") - public AjaxResult getOrderOfToday(@PathVariable("staffId") Integer staffId) { - return AjaxResult.success("调用成功"); + public AjaxResult getOrderOfToday(@PathVariable("staffId") Long staffId) { + return AjaxResult.success(orderDaoService.getOrderOfToday(staffId)); } @GetMapping("/getWeekMenu") @@ -95,8 +95,7 @@ public class ClientController extends BaseController { @PostMapping("/logout/{staffId}") public AjaxResult logout(@PathVariable("staffId") Long staffId) { - staffInfoDaoService.logout(staffId); - return AjaxResult.success("登录成功"); + return AjaxResult.success(staffInfoDaoService.logout(staffId)); } @GetMapping("/getWorkday") diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java index 92e271f00..71a4d0309 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java @@ -46,7 +46,7 @@ public class FtOrderDao implements Serializable { /** * 员工 id */ - private Long workerId; + private Long staffId; /** * 清单 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java index b5e2c28cf..486929230 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.fantang.domain.FtOrderDao; import org.apache.ibatis.annotations.Insert; +import java.util.List; + /** * 订单管理Mapper接口 * @@ -14,4 +16,7 @@ public interface FtOrderDaoMapper extends BaseMapper { @Insert("insert into ft_order (order_type, staff_id, order_src, create_at, order_date, order_list, total_price) select type as order_type, staff_id, 1 as order_src, now() as create_at, date_add(now(), interval 1 day) as order_date, foods, (select sum(price) from ft_food f where FIND_IN_SET(f.food_id,d.foods)) as price from ft_staff_demand d where d.demand_mode = 1") void GenerateStaffTomorrowOrder(); + + + List getOrderOfToday(Long staffId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtOrderDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtOrderDaoService.java index d11f742d4..b3b11bb07 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtOrderDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtOrderDaoService.java @@ -1,6 +1,7 @@ package com.ruoyi.system.fantang.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtOrderDao; /** @@ -11,4 +12,5 @@ import com.ruoyi.system.fantang.domain.FtOrderDao; */ public interface IFtOrderDaoService extends IService { + AjaxResult getOrderOfToday(Long staffId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java index 1779ddcc9..32b5df66f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java @@ -1,12 +1,17 @@ package com.ruoyi.system.fantang.service.impl; +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtOrderDao; import com.ruoyi.system.fantang.mapper.FtOrderDaoMapper; import com.ruoyi.system.fantang.service.IFtOrderDaoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Date; + /** * 订单管理Service业务层处理 * @@ -20,4 +25,13 @@ public class FtOrderDaoServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); + wrapper.eq("staff_id", staffId); + wrapper.between("order_date", DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date())); + return AjaxResult.success(this.baseMapper.selectList(wrapper)); + } }