添加定时器,定时生成员工订餐记录
This commit is contained in:
parent
84125a0f72
commit
cb8614201d
@ -2,6 +2,7 @@ package com.ruoyi.quartz.task;
|
|||||||
|
|
||||||
import com.ruoyi.system.fantang.mapper.FtReportMealVoMapper;
|
import com.ruoyi.system.fantang.mapper.FtReportMealVoMapper;
|
||||||
import com.ruoyi.system.fantang.service.impl.FtFoodDemandDaoServiceImpl;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@ -19,6 +20,9 @@ public class FtGenerateOrderTask {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private FtReportMealVoMapper ftReportMealVoMapper;
|
private FtReportMealVoMapper ftReportMealVoMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FtOrderDaoServiceImpl orderDaoService;
|
||||||
|
|
||||||
public void GenerateOrderTask() {
|
public void GenerateOrderTask() {
|
||||||
System.out.println("执行生成一条病患默认订餐配置记录");
|
System.out.println("执行生成一条病患默认订餐配置记录");
|
||||||
foodDemandDaoService.GenerateOrderForNewPatient();
|
foodDemandDaoService.GenerateOrderForNewPatient();
|
||||||
@ -28,4 +32,10 @@ public class FtGenerateOrderTask {
|
|||||||
System.out.println("生成次日病患报餐记录");
|
System.out.println("生成次日病患报餐记录");
|
||||||
ftReportMealVoMapper.insertTomorrowReportMeal();
|
ftReportMealVoMapper.insertTomorrowReportMeal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生成次日员工订餐记录
|
||||||
|
public void GenerateStaffTomorrowOrder() {
|
||||||
|
System.out.println("生成次日员工订餐记录");
|
||||||
|
orderDaoService.GenerateStaffTomorrowOrder();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.ruoyi.system.fantang.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.ruoyi.system.fantang.domain.FtOrderDao;
|
import com.ruoyi.system.fantang.domain.FtOrderDao;
|
||||||
|
import org.apache.ibatis.annotations.Insert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单管理Mapper接口
|
* 订单管理Mapper接口
|
||||||
@ -11,4 +12,6 @@ import com.ruoyi.system.fantang.domain.FtOrderDao;
|
|||||||
*/
|
*/
|
||||||
public interface FtOrderDaoMapper extends BaseMapper<FtOrderDao> {
|
public interface FtOrderDaoMapper extends BaseMapper<FtOrderDao> {
|
||||||
|
|
||||||
|
@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();
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.ruoyi.system.fantang.domain.FtOrderDao;
|
import com.ruoyi.system.fantang.domain.FtOrderDao;
|
||||||
import com.ruoyi.system.fantang.mapper.FtOrderDaoMapper;
|
import com.ruoyi.system.fantang.mapper.FtOrderDaoMapper;
|
||||||
import com.ruoyi.system.fantang.service.IFtOrderDaoService;
|
import com.ruoyi.system.fantang.service.IFtOrderDaoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -15,4 +16,8 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class FtOrderDaoServiceImpl extends ServiceImpl<FtOrderDaoMapper, FtOrderDao> implements IFtOrderDaoService {
|
public class FtOrderDaoServiceImpl extends ServiceImpl<FtOrderDaoMapper, FtOrderDao> implements IFtOrderDaoService {
|
||||||
|
|
||||||
|
public void GenerateStaffTomorrowOrder() {
|
||||||
|
this.baseMapper.GenerateStaffTomorrowOrder();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user