|
@@ -1,6 +1,8 @@
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
@@ -44,6 +46,13 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
@Override
|
|
|
public List<BomanReservat> selectBomanReservatList(BomanReservat bomanReservat)
|
|
|
{
|
|
|
+ String dataType = bomanReservat.getDataType();
|
|
|
+ if ("1".equals(dataType)){
|
|
|
+ bomanReservat.setVisitDate(DateUtils.getDate());
|
|
|
+ }
|
|
|
+ if ("2".equals(dataType)){
|
|
|
+ bomanReservat.setVisitDate(DateUtils.getDateByDays(-1));
|
|
|
+ }
|
|
|
return bomanReservatMapper.selectBomanReservatList(bomanReservat);
|
|
|
}
|
|
|
|
|
@@ -111,4 +120,30 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
int i = bomanReservatMapper.updateBomanReservat(bomanReservat);
|
|
|
return i > 0 ? AjaxResult.success() : AjaxResult.error();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 预约首页统计
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public AjaxResult indexStatistics(BomanReservat bomanReservat) {
|
|
|
+ Map<String,Object> map = new HashMap<>(4);
|
|
|
+ map.put("canGuan",0);
|
|
|
+ map.put("yuYue",0);
|
|
|
+ map.put("todayYuYue",0);
|
|
|
+ map.put("todayCanGuan",0);
|
|
|
+ List<BomanReservat> bomanReservats = bomanReservatMapper.selectBomanReservatList(bomanReservat);
|
|
|
+ if (bomanReservats != null && bomanReservats.size() > 0){
|
|
|
+ //来访数
|
|
|
+ long canGuan = bomanReservats.stream().filter(s -> "2".equals(s.getVisitStatus())).count();
|
|
|
+ long todayYuYue = bomanReservats.stream().filter(s -> DateUtils.getDate().equals(s.getVisitDate())).count();
|
|
|
+ long todayCanGuan = bomanReservats.stream().filter(s -> DateUtils.getDate().equals(s.getVisitDate())).filter(s -> "2".equals(s.getVisitStatus())).count();
|
|
|
+ map.put("canGuan",canGuan);
|
|
|
+ map.put("yuYue",bomanReservats.size());
|
|
|
+ map.put("todayYuYue",todayYuYue);
|
|
|
+ map.put("todayCanGuan",todayCanGuan);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(map);
|
|
|
+ }
|
|
|
}
|