|
@@ -1,7 +1,8 @@
|
|
|
package cn.iocoder.yudao.module.system.service.miniapp;
|
|
package cn.iocoder.yudao.module.system.service.miniapp;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.VisitAppointmentCountRespVO;
|
|
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.VisitAppointmentCountRespVO;
|
|
|
-import cn.iocoder.yudao.module.system.dal.mysql.miniapp.VisitAppointmentMapper;
|
|
|
|
|
|
|
+import cn.iocoder.yudao.module.system.dal.dataobject.miniapp.JiashuVisitAppointmentDO;
|
|
|
|
|
+import cn.iocoder.yudao.module.system.dal.mysql.miniapp.JiashuVisitAppointmentMapper;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -16,46 +17,46 @@ import java.time.LocalDate;
|
|
|
*/
|
|
*/
|
|
|
@Service
|
|
@Service
|
|
|
@DS("miniapp")
|
|
@DS("miniapp")
|
|
|
-public class VisitAppointmentServiceImpl implements VisitAppointmentService {
|
|
|
|
|
|
|
+public class JiashuVisitAppointmentServiceImpl implements JiashuVisitAppointmentService {
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
- private VisitAppointmentMapper visitAppointmentMapper;
|
|
|
|
|
|
|
+ private JiashuVisitAppointmentMapper jiashuVisitAppointmentMapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public VisitAppointmentCountRespVO getVisitCount(Long tenantId) {
|
|
|
|
|
|
|
+ public VisitAppointmentCountRespVO getVisitCount() {
|
|
|
VisitAppointmentCountRespVO respVO = new VisitAppointmentCountRespVO();
|
|
VisitAppointmentCountRespVO respVO = new VisitAppointmentCountRespVO();
|
|
|
- respVO.setTodayCount(getTodayCount(tenantId));
|
|
|
|
|
- respVO.setWeekCount(getWeekCount(tenantId));
|
|
|
|
|
- respVO.setMonthCount(getMonthCount(tenantId));
|
|
|
|
|
|
|
+ respVO.setTodayCount(getTodayCount());
|
|
|
|
|
+ respVO.setWeekCount(getWeekCount());
|
|
|
|
|
+ respVO.setMonthCount(getMonthCount());
|
|
|
return respVO;
|
|
return respVO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 当日预约参观数量
|
|
* 当日预约参观数量
|
|
|
*/
|
|
*/
|
|
|
- private Long getTodayCount(Long tenantId) {
|
|
|
|
|
|
|
+ private Long getTodayCount() {
|
|
|
LocalDate today = LocalDate.now();
|
|
LocalDate today = LocalDate.now();
|
|
|
- return visitAppointmentMapper.countByVisitDateRange(tenantId,today, today);
|
|
|
|
|
|
|
+ return jiashuVisitAppointmentMapper.countByVisitDateRange(today, today);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 当周(周一至周日)预约参观数量
|
|
* 当周(周一至周日)预约参观数量
|
|
|
*/
|
|
*/
|
|
|
- private Long getWeekCount(Long tenantId) {
|
|
|
|
|
|
|
+ private Long getWeekCount() {
|
|
|
LocalDate now = LocalDate.now();
|
|
LocalDate now = LocalDate.now();
|
|
|
LocalDate monday = now.with(DayOfWeek.MONDAY);
|
|
LocalDate monday = now.with(DayOfWeek.MONDAY);
|
|
|
LocalDate sunday = now.with(DayOfWeek.SUNDAY);
|
|
LocalDate sunday = now.with(DayOfWeek.SUNDAY);
|
|
|
- return visitAppointmentMapper.countByVisitDateRange(tenantId,monday, sunday);
|
|
|
|
|
|
|
+ return jiashuVisitAppointmentMapper.countByVisitDateRange(monday, sunday);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 当月(1号至月末)预约参观数量
|
|
* 当月(1号至月末)预约参观数量
|
|
|
*/
|
|
*/
|
|
|
- private Long getMonthCount(Long tenantId) {
|
|
|
|
|
|
|
+ private Long getMonthCount() {
|
|
|
LocalDate now = LocalDate.now();
|
|
LocalDate now = LocalDate.now();
|
|
|
LocalDate firstDay = now.withDayOfMonth(1);
|
|
LocalDate firstDay = now.withDayOfMonth(1);
|
|
|
LocalDate lastDay = now.withDayOfMonth(now.lengthOfMonth());
|
|
LocalDate lastDay = now.withDayOfMonth(now.lengthOfMonth());
|
|
|
- return visitAppointmentMapper.countByVisitDateRange(tenantId,firstDay, lastDay);
|
|
|
|
|
|
|
+ return jiashuVisitAppointmentMapper.countByVisitDateRange(firstDay, lastDay);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|