api:今明日报餐统计
This commit is contained in:
parent
4a7b400569
commit
172dd0dcd3
@ -527,6 +527,31 @@ public class ClientController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 今日员工报餐统计
|
||||
*/
|
||||
@GetMapping("/getStatisticsOrderOfToday")
|
||||
public AjaxResult getStatisticsOrderOfToday() {
|
||||
|
||||
Date today = new Date();
|
||||
|
||||
return orderDaoService.statisGetOrderOfDate(today);
|
||||
}
|
||||
|
||||
/**
|
||||
* 明日员工报餐统计
|
||||
*/
|
||||
@GetMapping("/getStatisticsOrderOfTomorrow")
|
||||
public AjaxResult getStatisticsReportMealsOfTomorrow() {
|
||||
|
||||
Date today = new Date();
|
||||
Date tomorrow = DateUtil.offsetDay(today, 1);
|
||||
|
||||
return orderDaoService.statisGetOrderOfDate(tomorrow);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 人脸识别设备心跳信号
|
||||
* @param request
|
||||
|
@ -170,6 +170,18 @@ public class ClientPatientController extends BaseController {
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 明日(未报)病患报餐统计
|
||||
*/
|
||||
@GetMapping("/getStatisticsReportMealsOfTomorrow")
|
||||
public AjaxResult getStatisticsReportMealsOfTomorrow() {
|
||||
|
||||
List<FtReportMealsDao> list = iFtFoodDemandDaoService.getStatisticsFoodDemand();
|
||||
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 病患报餐周统计
|
||||
*/
|
||||
|
@ -125,12 +125,14 @@ public class FtReportMealsDao implements Serializable {
|
||||
* 当前报餐总价
|
||||
*/
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
|
||||
private Boolean vegetables;
|
||||
|
||||
|
||||
private Boolean meat;
|
||||
|
||||
|
||||
private Boolean rice;
|
||||
|
||||
|
||||
private Integer egg;
|
||||
|
||||
private Integer total;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.ruoyi.system.fantang.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
|
||||
import com.ruoyi.system.fantang.domain.FtOrderDao;
|
||||
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@ -32,16 +33,29 @@ public interface FtFoodDemandDaoMapper extends BaseMapper<FtFoodDemandDao> {
|
||||
"\ta.type \n" +
|
||||
"FROM\n" +
|
||||
"\tft_report_meals a\n" +
|
||||
"\tLEFT JOIN ft_food_demand b ON a.patient_id = b.patient_id\n" +
|
||||
"\tLEFT JOIN ft_patient c ON a.patient_id = c.patient_id\n" +
|
||||
"\tLEFT JOIN ft_depart d ON c.depart_id = d.depart_id \n" +
|
||||
"WHERE\n" +
|
||||
"\tb.flag = 1 \n" +
|
||||
"\tAND a.type = b.type \n" +
|
||||
"\tAND c.depart_id = d.depart_id and a.create_at BETWEEN #{start} and #{end}\n" +
|
||||
"\tc.depart_id = d.depart_id and a.create_at BETWEEN #{start} and #{end}\n" +
|
||||
"\t\n" +
|
||||
"GROUP BY\n" +
|
||||
"\td.depart_name,\n" +
|
||||
"\ta.type")
|
||||
List<FtOrderDao> getStatisticsOfDate(@Param("start") String start, @Param("end") String end);
|
||||
|
||||
@Select("SELECT\n" +
|
||||
"\ta.type,\n" +
|
||||
"\tc.depart_name,\n" +
|
||||
"\tCOUNT(*) AS total \n" +
|
||||
"FROM\n" +
|
||||
"\tft_food_demand a\n" +
|
||||
"\tLEFT JOIN ft_patient b ON b.patient_id = a.patient_id\n" +
|
||||
"\tLEFT JOIN ft_depart c ON c.depart_id = b.depart_id \n" +
|
||||
"WHERE\n" +
|
||||
"\tb.depart_id = c.depart_id \n" +
|
||||
"\tAND flag = 1 \n" +
|
||||
"GROUP BY\n" +
|
||||
"\ta.type,\n" +
|
||||
"\tc.depart_name")
|
||||
List<FtReportMealsDao> getStatisticsFoodDemand();
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.ruoyi.system.fantang.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
|
||||
import com.ruoyi.system.fantang.domain.FtOrderDao;
|
||||
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -27,4 +28,6 @@ public interface IFtFoodDemandDaoService extends IService<FtFoodDemandDao> {
|
||||
List<FtOrderDao> getStatisticsOfWeek(Date day);
|
||||
|
||||
List<FtOrderDao> getStatisticsOfMonth(Date day);
|
||||
|
||||
List<FtReportMealsDao> getStatisticsFoodDemand();
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
|
||||
import com.ruoyi.system.fantang.domain.FtOrderDao;
|
||||
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
|
||||
import com.ruoyi.system.fantang.mapper.FtFoodDemandDaoMapper;
|
||||
import com.ruoyi.system.fantang.service.IFtFoodDemandDaoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -60,4 +61,9 @@ public class FtFoodDemandDaoServiceImpl extends ServiceImpl<FtFoodDemandDaoMappe
|
||||
public List<FtOrderDao> getStatisticsOfMonth(Date day) {
|
||||
return this.baseMapper.getStatisticsOfDate(DateUtil.beginOfMonth(day).toString(), DateUtil.endOfMonth(day).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FtReportMealsDao> getStatisticsFoodDemand() {
|
||||
return this.baseMapper.getStatisticsFoodDemand();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user