From cb8614201de4a708edc2f287f329899877984dd7 Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Thu, 10 Dec 2020 13:33:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=9A=E6=97=B6=E5=99=A8?= =?UTF-8?q?=EF=BC=8C=E5=AE=9A=E6=97=B6=E7=94=9F=E6=88=90=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E8=AE=A2=E9=A4=90=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/quartz/task/FtGenerateOrderTask.java | 10 ++++++++++ .../ruoyi/system/fantang/mapper/FtOrderDaoMapper.java | 3 +++ .../fantang/service/impl/FtOrderDaoServiceImpl.java | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/FtGenerateOrderTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/FtGenerateOrderTask.java index c6d33c094..ad1db65bf 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/FtGenerateOrderTask.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/FtGenerateOrderTask.java @@ -2,6 +2,7 @@ package com.ruoyi.quartz.task; import com.ruoyi.system.fantang.mapper.FtReportMealVoMapper; import com.ruoyi.system.fantang.service.impl.FtFoodDemandDaoServiceImpl; +import com.ruoyi.system.fantang.service.impl.FtOrderDaoServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -19,6 +20,9 @@ public class FtGenerateOrderTask { @Autowired private FtReportMealVoMapper ftReportMealVoMapper; + @Autowired + private FtOrderDaoServiceImpl orderDaoService; + public void GenerateOrderTask() { System.out.println("执行生成一条病患默认订餐配置记录"); foodDemandDaoService.GenerateOrderForNewPatient(); @@ -28,4 +32,10 @@ public class FtGenerateOrderTask { System.out.println("生成次日病患报餐记录"); ftReportMealVoMapper.insertTomorrowReportMeal(); } + + // 生成次日员工订餐记录 + public void GenerateStaffTomorrowOrder() { + System.out.println("生成次日员工订餐记录"); + orderDaoService.GenerateStaffTomorrowOrder(); + } } 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 d927dee87..b246f45eb 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 @@ -2,6 +2,7 @@ package com.ruoyi.system.fantang.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.fantang.domain.FtOrderDao; +import org.apache.ibatis.annotations.Insert; /** * 订单管理Mapper接口 @@ -11,4 +12,6 @@ import com.ruoyi.system.fantang.domain.FtOrderDao; */ public interface FtOrderDaoMapper extends BaseMapper { + @Insert("insert into ft_order (order_type, staff_id, order_src, create_at, order_date) select type as order_type, b.staff_id, 1 as order_src, now() as create_at, date_add(now(), interval 1 day) as order_date from ft_staff_demand b where b.demand_mode = 1") + void GenerateStaffTomorrowOrder(); } 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 b1159e872..1779ddcc9 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 @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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; /** @@ -15,4 +16,8 @@ import org.springframework.stereotype.Service; @Service public class FtOrderDaoServiceImpl extends ServiceImpl implements IFtOrderDaoService { + public void GenerateStaffTomorrowOrder() { + this.baseMapper.GenerateStaffTomorrowOrder(); + + } }