|
@@ -1,5 +1,6 @@
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
import java.util.*;
|
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
@@ -14,13 +15,12 @@ import com.ruoyi.system.service.IBomanReservatService;
|
|
|
|
|
|
/**
|
|
|
* 预约Service业务层处理
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
* @date 2024-02-27
|
|
|
*/
|
|
|
@Service
|
|
|
-public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
-{
|
|
|
+public class BomanReservatServiceImpl implements IBomanReservatService {
|
|
|
@Autowired
|
|
|
private BomanReservatMapper bomanReservatMapper;
|
|
|
@Autowired
|
|
@@ -28,37 +28,34 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
|
|
|
/**
|
|
|
* 查询预约
|
|
|
- *
|
|
|
+ *
|
|
|
* @param reservatId 预约主键
|
|
|
* @return 预约
|
|
|
*/
|
|
|
@Override
|
|
|
- public BomanReservat selectBomanReservatByReservatId(Long reservatId)
|
|
|
- {
|
|
|
+ public BomanReservat selectBomanReservatByReservatId(Long reservatId) {
|
|
|
return bomanReservatMapper.selectBomanReservatByReservatId(reservatId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询预约列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param bomanReservat 预约
|
|
|
* @return 预约
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<BomanReservat> selectBomanReservatList(BomanReservat bomanReservat)
|
|
|
- {
|
|
|
+ public List<BomanReservat> selectBomanReservatList(BomanReservat bomanReservat) {
|
|
|
return bomanReservatMapper.selectBomanReservatList(bomanReservat);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新增预约
|
|
|
- *
|
|
|
+ *
|
|
|
* @param bomanReservat 预约
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int insertBomanReservat(BomanReservat bomanReservat)
|
|
|
- {
|
|
|
+ public int insertBomanReservat(BomanReservat bomanReservat) {
|
|
|
|
|
|
bomanReservat.setCreateTime(DateUtils.getNowDate());
|
|
|
return bomanReservatMapper.insertBomanReservat(bomanReservat);
|
|
@@ -66,38 +63,35 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
|
|
|
/**
|
|
|
* 修改预约
|
|
|
- *
|
|
|
+ *
|
|
|
* @param bomanReservat 预约
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int updateBomanReservat(BomanReservat bomanReservat)
|
|
|
- {
|
|
|
+ public int updateBomanReservat(BomanReservat bomanReservat) {
|
|
|
bomanReservat.setUpdateTime(DateUtils.getNowDate());
|
|
|
return bomanReservatMapper.updateBomanReservat(bomanReservat);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 批量删除预约
|
|
|
- *
|
|
|
+ *
|
|
|
* @param reservatIds 需要删除的预约主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int deleteBomanReservatByReservatIds(Long[] reservatIds)
|
|
|
- {
|
|
|
+ public int deleteBomanReservatByReservatIds(Long[] reservatIds) {
|
|
|
return bomanReservatMapper.deleteBomanReservatByReservatIds(reservatIds);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除预约信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param reservatId 预约主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int deleteBomanReservatByReservatId(Long reservatId)
|
|
|
- {
|
|
|
+ public int deleteBomanReservatByReservatId(Long reservatId) {
|
|
|
return bomanReservatMapper.deleteBomanReservatByReservatId(reservatId);
|
|
|
}
|
|
|
|
|
@@ -114,7 +108,7 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
*/
|
|
|
@Override
|
|
|
public AjaxResult weekAppointment() {
|
|
|
- Map<String,Object> resultMap = new HashMap<>();
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
//获取上周一
|
|
|
String lastMonday = DateUtils.lastMonday();
|
|
|
//获取上周日
|
|
@@ -134,7 +128,7 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
List<BomanReservat> lastList = bomanReservatMapper.selectBomanReservatTimeList(bomanReservat);
|
|
|
//访客人数
|
|
|
int fk = 0;
|
|
|
- if(lastList!=null && lastList.size()>0){
|
|
|
+ if (lastList != null && lastList.size() > 0) {
|
|
|
yy = lastList.size();
|
|
|
}
|
|
|
//周一到周日的预约人数
|
|
@@ -148,9 +142,9 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
//周几的访客人数
|
|
|
int weekfk = 0;
|
|
|
for (BomanReservat reservat : lastList) {
|
|
|
- if(string.equals(DateUtils.dateTime(reservat.getVisitDate()))){
|
|
|
+ if (string.equals(DateUtils.dateTime(reservat.getVisitDate()))) {
|
|
|
weekyy++;
|
|
|
- if("2".equals(reservat.getVisitStatus())){
|
|
|
+ if ("2".equals(reservat.getVisitStatus())) {
|
|
|
weekfk++;
|
|
|
fk++;
|
|
|
}
|
|
@@ -159,14 +153,15 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
yyList.add(String.valueOf(weekyy));
|
|
|
fkList.add(String.valueOf(weekfk));
|
|
|
}
|
|
|
- resultMap.put("yyzs",yy);
|
|
|
- resultMap.put("fkzs",fk);
|
|
|
- resultMap.put("x",strings);
|
|
|
- resultMap.put("y1",yyList);
|
|
|
- resultMap.put("y2",fkList);
|
|
|
+ resultMap.put("yyzs", yy);
|
|
|
+ resultMap.put("fkzs", fk);
|
|
|
+ resultMap.put("x", strings);
|
|
|
+ resultMap.put("y1", yyList);
|
|
|
+ resultMap.put("y2", fkList);
|
|
|
return AjaxResult.success(resultMap);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public AjaxResult yydc() {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
@@ -174,7 +169,7 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
String day = DateUtils.getDate();
|
|
|
|
|
|
BomanReservat bomanReservat = new BomanReservat();
|
|
|
- bomanReservat.setVisitTime(day);
|
|
|
+ bomanReservat.setVisitDate(DateUtils.getNowDate());
|
|
|
List<BomanReservat> lastList = bomanReservatMapper.selectBomanReservatTimeList(bomanReservat);
|
|
|
//本月来访数
|
|
|
int bylf = 0;
|
|
@@ -184,16 +179,16 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
int jrlf = 0;
|
|
|
//今日预约
|
|
|
int jryy = 0;
|
|
|
- if(lastList!=null && lastList.size()>0){
|
|
|
+ if (lastList != null && lastList.size() > 0) {
|
|
|
byyy = lastList.size();
|
|
|
for (BomanReservat reservat : lastList) {
|
|
|
- if("2".equals(reservat.getVisitStatus())){
|
|
|
+ if ("2".equals(reservat.getVisitStatus())) {
|
|
|
bylf++;
|
|
|
- if(day.contains(DateUtils.dateTime(reservat.getVisitDate()))){
|
|
|
+ if (day.contains(DateUtils.dateTime(reservat.getVisitDate()))) {
|
|
|
jrlf++;
|
|
|
}
|
|
|
}
|
|
|
- if(day.contains(DateUtils.dateTime(reservat.getVisitDate()))){
|
|
|
+ if (day.contains(DateUtils.dateTime(reservat.getVisitDate()))) {
|
|
|
jryy++;
|
|
|
}
|
|
|
}
|
|
@@ -209,24 +204,24 @@ public class BomanReservatServiceImpl implements IBomanReservatService
|
|
|
int dcwc = 0;
|
|
|
//订餐晚餐人数
|
|
|
int dcDinner = 0;
|
|
|
- if(orderFoods!=null && orderFoods.size()>0){
|
|
|
+ if (orderFoods != null && orderFoods.size() > 0) {
|
|
|
dczs = orderFoods.size();
|
|
|
for (OrderFood food : orderFoods) {
|
|
|
- if("1".equals(food.getOrderFoodType())){
|
|
|
+ if ("1".equals(food.getOrderFoodType())) {
|
|
|
dcwc++;
|
|
|
}
|
|
|
- if("2".equals(food.getOrderFoodType())){
|
|
|
+ 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);
|
|
|
+ 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);
|
|
|
}
|
|
|
|