|
@@ -2,12 +2,15 @@ package com.xjrsoft.module.teacher.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.google.gson.JsonArray;
|
|
|
import com.google.gson.JsonElement;
|
|
|
import com.google.gson.JsonObject;
|
|
|
import com.google.gson.JsonParser;
|
|
|
import com.xjrsoft.common.enums.LeaveReasonEnum;
|
|
|
+import com.xjrsoft.module.attendance.entity.TeacherAttendanceRecord;
|
|
|
+import com.xjrsoft.module.attendance.mapper.TeacherAttendanceRecordMapper;
|
|
|
import com.xjrsoft.module.hikvision.entity.HikvisionData;
|
|
|
import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
|
|
|
import com.xjrsoft.module.hikvision.util.ApiUtil;
|
|
@@ -46,6 +49,9 @@ public class WfTeacherleaveServiceImpl extends MPJBaseServiceImpl<WfTeacherleave
|
|
|
private final IWfHeadTeacherLeaveService wfHeadTeacherLeaveService;
|
|
|
private final HikvisionDataMapper hikvisionDataMapper;
|
|
|
private final WfTeacherleaveMapper wfTeacherleaveMapper;
|
|
|
+
|
|
|
+ private final TeacherAttendanceRecordMapper attendanceRecordMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean dataHandle(Long dataId) {
|
|
|
WfTeacherleave wfTeacherleave = this.getById(dataId);
|
|
@@ -207,6 +213,22 @@ public class WfTeacherleaveServiceImpl extends MPJBaseServiceImpl<WfTeacherleave
|
|
|
return this.baseMapper.getLeaveByUserId(startTime, endTime, userId);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void updateAttendancestatus(Long id) {
|
|
|
+ WfTeacherleave teacherleave = this.getById(id);
|
|
|
+ List<TeacherAttendanceRecord> leaveList = attendanceRecordMapper.getLeaveList(teacherleave);
|
|
|
+ for (TeacherAttendanceRecord teacherAttendanceRecord : leaveList) {
|
|
|
+ UpdateWrapper<TeacherAttendanceRecord> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.eq("id", teacherAttendanceRecord.getId());
|
|
|
+ updateWrapper.setSql("attendance_mode = null");
|
|
|
+ updateWrapper.setSql("car_number = null");
|
|
|
+ updateWrapper.setSql("record_time = null");
|
|
|
+ updateWrapper.setSql("attendance_status = '" + teacherleave.getLeaveType() + "'");
|
|
|
+
|
|
|
+ attendanceRecordMapper.update(teacherAttendanceRecord, updateWrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
JsonArray selectResource(ApiUtil apiUtil){
|
|
|
String apiPath = "/api/irds/v2/resource/resourcesByParams";
|
|
|
JsonObject jsonObject = new JsonObject();
|