|
@@ -4,6 +4,8 @@ import java.util.*;
|
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.system.domain.OrderFood;
|
|
|
+import com.ruoyi.system.mapper.OrderFoodMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.system.mapper.BomanReservatMapper;
|
|
@@ -21,6 +23,8 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
{
|
|
|
@Autowired
|
|
|
private BomanReservatMapper bomanReservatMapper;
|
|
|
+ @Autowired
|
|
|
+ private OrderFoodMapper orderFoodMapper;
|
|
|
|
|
|
/**
|
|
|
* 查询预约
|
|
@@ -133,7 +137,7 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
if(lastList!=null && lastList.size()>0){
|
|
|
yy = lastList.size();
|
|
|
}
|
|
|
- //周一到周日的访客人数
|
|
|
+ //周一到周日的预约人数
|
|
|
List<String> yyList = new ArrayList<>();
|
|
|
//周一到周日的到访人数
|
|
|
List<String> fkList = new ArrayList<>();
|
|
@@ -163,4 +167,67 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
return AjaxResult.success(resultMap);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public AjaxResult yydc() {
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ //获取当前日期
|
|
|
+ String day = DateUtils.getDate();
|
|
|
+
|
|
|
+ BomanReservat bomanReservat = new BomanReservat();
|
|
|
+ bomanReservat.setVisitTime(day);
|
|
|
+ List<BomanReservat> lastList = bomanReservatMapper.selectBomanReservatTimeList(bomanReservat);
|
|
|
+ //本月来访数
|
|
|
+ int bylf = 0;
|
|
|
+ //本月预约数
|
|
|
+ int byyy = 0;
|
|
|
+ //今日来访
|
|
|
+ int jrlf = 0;
|
|
|
+ //今日预约
|
|
|
+ int jryy = 0;
|
|
|
+ if(lastList!=null && lastList.size()>0){
|
|
|
+ byyy = lastList.size();
|
|
|
+ for (BomanReservat reservat : lastList) {
|
|
|
+ if("2".equals(reservat.getVisitStatus())){
|
|
|
+ bylf++;
|
|
|
+ if(day.equals(reservat.getVisitTime())){
|
|
|
+ jrlf++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(day.equals(reservat.getVisitTime())){
|
|
|
+ jryy++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //订餐统计
|
|
|
+ OrderFood orderFood = new OrderFood();
|
|
|
+ orderFood.setOrderFoodTime(DateUtils.parseDate(day));
|
|
|
+ List<OrderFood> orderFoods = orderFoodMapper.selectOrderFoodList(orderFood);
|
|
|
+ //订餐总人数
|
|
|
+ int dczs = 0;
|
|
|
+ //订餐午餐人数
|
|
|
+ int dcwc = 0;
|
|
|
+ //订餐晚餐人数
|
|
|
+ int dcDinner = 0;
|
|
|
+ if(orderFoods!=null && orderFoods.size()>0){
|
|
|
+ dczs = orderFoods.size();
|
|
|
+ for (OrderFood food : orderFoods) {
|
|
|
+ if("1".equals(food.getOrderFoodType())){
|
|
|
+ dcwc++;
|
|
|
+ }
|
|
|
+ if("2".equals(food.getOrderFoodType())){
|
|
|
+ dcDinner++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resultMap.put("bylf",bylf);
|
|
|
+ resultMap.put("byyy",byyy);
|
|
|
+ resultMap.put("jrlf",jrlf);
|
|
|
+ resultMap.put("jryy",jryy);
|
|
|
+ resultMap.put("dczs",dczs);
|
|
|
+ resultMap.put("dcwc",dcwc);
|
|
|
+ resultMap.put("dcDinner",dcDinner);
|
|
|
+ return AjaxResult.success(resultMap);
|
|
|
+ }
|
|
|
+
|
|
|
}
|