|
@@ -2,10 +2,7 @@ package com.jpsoft.smart.schduled;
|
|
|
|
|
|
import com.jpsoft.smart.config.WxConfig;
|
|
|
import com.jpsoft.smart.modules.base.entity.*;
|
|
|
-import com.jpsoft.smart.modules.base.service.AlarmConfigService;
|
|
|
-import com.jpsoft.smart.modules.base.service.CompanyInfoService;
|
|
|
-import com.jpsoft.smart.modules.base.service.PersonDeviceFilterLogService;
|
|
|
-import com.jpsoft.smart.modules.base.service.WarningPusherService;
|
|
|
+import com.jpsoft.smart.modules.base.service.*;
|
|
|
import com.jpsoft.smart.modules.business.entity.WorkAttendance;
|
|
|
import com.jpsoft.smart.modules.business.service.WorkAttendanceService;
|
|
|
import com.jpsoft.smart.modules.common.utils.WechatMessageUtil;
|
|
@@ -41,6 +38,9 @@ public class UnmeasureTemperatureAlarmTask {
|
|
|
@Autowired
|
|
|
private WorkAttendanceService workAttendanceService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PersonDeviceLogService personDeviceLogService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private WxConfig wxConfig;
|
|
|
|
|
@@ -138,7 +138,7 @@ public class UnmeasureTemperatureAlarmTask {
|
|
|
}
|
|
|
|
|
|
//todo 查询该单位当前时间段未考勤人员列表
|
|
|
- List<PersonInfo> attendanceList = personDeviceFilterLogService.queryUnAttendanceList(companyCode,startDate,endDate);
|
|
|
+ List<PersonInfo> attendanceList = personDeviceLogService.queryUnAttendanceList(companyCode,startDate,endDate);
|
|
|
|
|
|
for (PersonInfo personInfo: attendanceList) {
|
|
|
WorkAttendance workAttendance = new WorkAttendance();
|
|
@@ -167,9 +167,9 @@ public class UnmeasureTemperatureAlarmTask {
|
|
|
}
|
|
|
|
|
|
//todo 查询该单位当前时间段考勤人员列表
|
|
|
- List<PersonInfo> unAttendanceList = personDeviceFilterLogService.queryAttendanceList(companyCode,startDate,endDate);
|
|
|
+ List<PersonInfo> attendanceList = personDeviceLogService.queryAttendanceList(companyCode,startDate,endDate);
|
|
|
|
|
|
- for (PersonInfo personInfo: unAttendanceList) {
|
|
|
+ for (PersonInfo personInfo: attendanceList) {
|
|
|
WorkAttendance workAttendance = new WorkAttendance();
|
|
|
workAttendance.setId(UUID.randomUUID().toString());
|
|
|
workAttendance.setPersonId(personInfo.getId());
|
|
@@ -177,6 +177,23 @@ public class UnmeasureTemperatureAlarmTask {
|
|
|
workAttendance.setCreateTime(new Date());
|
|
|
workAttendance.setResult(result);
|
|
|
|
|
|
+ List<PersonDeviceLog> logList = personDeviceLogService.findByPersonAndDate(personInfo.getId(),startDate,endDate);
|
|
|
+
|
|
|
+ if (logList.size()>0) {
|
|
|
+ PersonDeviceLog personDeviceLog = null;
|
|
|
+
|
|
|
+ if (alarmConfig.getClassifier().equals(1)) {
|
|
|
+ //上班算最早一次考勤
|
|
|
+ personDeviceLog = logList.get(0);
|
|
|
+ } else {
|
|
|
+ //下班算最迟一次考勤
|
|
|
+ personDeviceLog = logList.get(logList.size()-1);
|
|
|
+ }
|
|
|
+
|
|
|
+ workAttendance.setRecordTime(personDeviceLog.getRecordTime());
|
|
|
+ workAttendance.setTemperature(personDeviceLog.getTemperature());
|
|
|
+ }
|
|
|
+
|
|
|
workAttendanceService.insert(workAttendance);
|
|
|
}
|
|
|
}
|
|
@@ -192,7 +209,7 @@ public class UnmeasureTemperatureAlarmTask {
|
|
|
}
|
|
|
|
|
|
//todo 查询该单位当前时间段是否有人员未测体温
|
|
|
- List<PersonInfo> unmeasuredList = personDeviceFilterLogService.queryUnAttendanceList(companyCode,startTime.toDate(),endTime.toDate());
|
|
|
+ List<PersonInfo> unmeasuredList = personDeviceLogService.queryUnAttendanceList(companyCode,startTime.toDate(),endTime.toDate());
|
|
|
|
|
|
if (unmeasuredList.size()==0){
|
|
|
return;
|
|
@@ -222,7 +239,7 @@ public class UnmeasureTemperatureAlarmTask {
|
|
|
}
|
|
|
|
|
|
//todo 查询该单位当前时间段是否有人员未测体温
|
|
|
- List<PersonInfo> unmeasuredList = personDeviceFilterLogService.queryUnAttendanceList(companyCode,startTime.toDate(),endTime.toDate());
|
|
|
+ List<PersonInfo> unmeasuredList = personDeviceLogService.queryUnAttendanceList(companyCode,startTime.toDate(),endTime.toDate());
|
|
|
|
|
|
if (unmeasuredList.size()==0){
|
|
|
return;
|