|
@@ -7,19 +7,13 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.template.config.ScheduleConfig;
|
|
import com.template.config.ScheduleConfig;
|
|
|
import com.template.model.dto.WarningUserDto;
|
|
import com.template.model.dto.WarningUserDto;
|
|
|
-import com.template.model.pojo.SmartAccess;
|
|
|
|
|
-import com.template.model.pojo.SmartFaceDiscern;
|
|
|
|
|
-import com.template.model.pojo.SmartRelation;
|
|
|
|
|
|
|
+import com.template.model.pojo.*;
|
|
|
import com.template.mapper.SmartRelationMapper;
|
|
import com.template.mapper.SmartRelationMapper;
|
|
|
-import com.template.model.pojo.SmartUser;
|
|
|
|
|
import com.template.model.result.PageUtils;
|
|
import com.template.model.result.PageUtils;
|
|
|
import com.template.model.vo.SmartRelationVo;
|
|
import com.template.model.vo.SmartRelationVo;
|
|
|
import com.template.model.vo.UserVo;
|
|
import com.template.model.vo.UserVo;
|
|
|
-import com.template.services.SmartAccessService;
|
|
|
|
|
-import com.template.services.SmartFaceDiscernService;
|
|
|
|
|
-import com.template.services.SmartRelationService;
|
|
|
|
|
|
|
+import com.template.services.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.template.services.SmartUserService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
@@ -54,8 +48,13 @@ public class SmartRelationServiceImpl extends ServiceImpl<SmartRelationMapper, S
|
|
|
SmartUserService smartUserService;
|
|
SmartUserService smartUserService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ SmartAttendanceService smartAttendanceService;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
SmartRelationMapper smartRelationMapper;
|
|
SmartRelationMapper smartRelationMapper;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
@Async
|
|
@Async
|
|
|
@Scheduled(cron = "0 20 0 * * ? ")//每天凌晨一点
|
|
@Scheduled(cron = "0 20 0 * * ? ")//每天凌晨一点
|
|
|
// @Scheduled(cron = "0 10 14 * * ? ")//每天凌晨一点
|
|
// @Scheduled(cron = "0 10 14 * * ? ")//每天凌晨一点
|
|
@@ -185,6 +184,24 @@ public class SmartRelationServiceImpl extends ServiceImpl<SmartRelationMapper, S
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Async
|
|
|
|
|
+ @Scheduled(cron = "0 20 3 * * ? ")//每天凌晨一点
|
|
|
|
|
+ public void getAttendanceListSmartRelation() {
|
|
|
|
|
+ if (scheduleConfig.getIsOpen().equals("1")) {
|
|
|
|
|
+ DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
+ LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0).minusDays(1);
|
|
|
|
|
+ LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59).minusDays(1);
|
|
|
|
|
+ String format = start.format(pattern);
|
|
|
|
|
+
|
|
|
|
|
+// 找到昨天的所有数据
|
|
|
|
|
+ List<SmartAttendance> attendanceList = smartAttendanceService.toDateList(start, end);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public PageUtils<SmartRelationVo> getList(int currentPage,int pageCount,Integer userId, String startTime, String endTime) {
|
|
public PageUtils<SmartRelationVo> getList(int currentPage,int pageCount,Integer userId, String startTime, String endTime) {
|