增加统计单日接口

This commit is contained in:
czx 2020-12-24 14:10:16 +08:00
parent 69785a0388
commit e01edd535b
5 changed files with 21 additions and 0 deletions

View File

@ -260,4 +260,9 @@ public class ClientController extends BaseController {
w = 0;
return weekMenuDaoService.getMenuOfDay(weekDays[w]);
}
@GetMapping("/StatisGetOrderOfDate")
public AjaxResult statisGetOrderOfDate(@RequestParam Date date) {
return orderDaoService.statisGetOrderOfDate(date);
}
}

View File

@ -141,4 +141,7 @@ public class FtOrderDao implements Serializable {
// 订用餐日期
private Date orderDate;
@TableField(exist = false)
private Integer countOrder;
}

View File

@ -3,7 +3,10 @@ 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;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
/**
@ -16,4 +19,7 @@ public interface FtOrderDaoMapper extends BaseMapper<FtOrderDao> {
@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();
@Select("select order_type, count(*) as count_order from ft_order where order_date BETWEEN #{start} and #{end} GROUP BY order_type")
List<FtOrderDao> statisGetOrderOfDate(@Param("start")String start,@Param("end") String end);
}

View File

@ -29,4 +29,6 @@ public interface IFtOrderDaoService extends IService<FtOrderDao> {
AjaxResult getAvailableStopOrder(Long staffId);
AjaxResult cancelStopOrder(Long orderId);
AjaxResult statisGetOrderOfDate(Date date);
}

View File

@ -106,4 +106,9 @@ public class FtOrderDaoServiceImpl extends ServiceImpl<FtOrderDaoMapper, FtOrder
public AjaxResult cancelStopOrder(Long orderId) {
return AjaxResult.success(staffStopMealsDaoMapper.deleteById(orderId));
}
@Override
public AjaxResult statisGetOrderOfDate(Date date) {
return AjaxResult.success(this.baseMapper.statisGetOrderOfDate(DateUtil.beginOfDay(date).toString(), DateUtil.endOfDay(date).toString()));
}
}