Commit 4e1816a4 authored by 赵啸非's avatar 赵啸非

添加每天同步过去一周考勤数据并重新计算

parent 6fe1942e
...@@ -174,16 +174,16 @@ ...@@ -174,16 +174,16 @@
<profiles.hik.protocol>https://</profiles.hik.protocol> <profiles.hik.protocol>https://</profiles.hik.protocol>
<profiles.hik.appKey>25594054</profiles.hik.appKey> <profiles.hik.appKey>25594054</profiles.hik.appKey>
<profiles.hik.appSecret>K12IkZoSLxpsJjrUPtfV</profiles.hik.appSecret> <profiles.hik.appSecret>K12IkZoSLxpsJjrUPtfV</profiles.hik.appSecret>
<profiles.dingtalk.domain>https://oapi.dingtalk.com</profiles.dingtalk.domain> <profiles.dingtalk.domain></profiles.dingtalk.domain>
<profiles.dingtalk.oaScheme>https</profiles.dingtalk.oaScheme> <profiles.dingtalk.oaScheme></profiles.dingtalk.oaScheme>
<profiles.dingtalk.oaUrl>api.dingtalk.com</profiles.dingtalk.oaUrl> <profiles.dingtalk.oaUrl></profiles.dingtalk.oaUrl>
<profiles.dingtalk.oaScheme>https</profiles.dingtalk.oaScheme> <profiles.dingtalk.oaScheme></profiles.dingtalk.oaScheme>
<profiles.dingtalk.agentId>2652674890</profiles.dingtalk.agentId> <profiles.dingtalk.agentId></profiles.dingtalk.agentId>
<profiles.dingtalk.appKey>dingpqzradgfr4efdi2j</profiles.dingtalk.appKey> <profiles.dingtalk.appKey></profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret> <profiles.dingtalk.appSecret></profiles.dingtalk.appSecret>
<profiles.dingtalk.aesKey>1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ</profiles.dingtalk.aesKey> <profiles.dingtalk.aesKey></profiles.dingtalk.aesKey>
<profiles.dingtalk.token>m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd</profiles.dingtalk.token> <profiles.dingtalk.token></profiles.dingtalk.token>
<profiles.dingtalk.opUserId>254868153920685466</profiles.dingtalk.opUserId> <profiles.dingtalk.opUserId></profiles.dingtalk.opUserId>
<profiles.webUrl>https://ybswxxcx.zwfwhfgjjfzj.yibin.gov.cn/performance-h5</profiles.webUrl> <profiles.webUrl>https://ybswxxcx.zwfwhfgjjfzj.yibin.gov.cn/performance-h5</profiles.webUrl>
<package.environment>build</package.environment> <package.environment>build</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
......
...@@ -15,8 +15,10 @@ import com.mortals.framework.util.ThreadPool; ...@@ -15,8 +15,10 @@ import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.base.system.user.model.UserEntity; import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.AddAttendThread; import com.mortals.xhx.common.utils.AddAttendThread;
import com.mortals.xhx.module.attendance.model.AttendanceLeaveRecordQuery;
import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity; import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordHikQuery; import com.mortals.xhx.module.attendance.model.AttendanceRecordHikQuery;
import com.mortals.xhx.module.attendance.service.AttendanceLeaveRecordService;
import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService; import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService;
import com.mortals.xhx.module.attendance.service.AttendanceStatService; import com.mortals.xhx.module.attendance.service.AttendanceStatService;
import com.mortals.xhx.module.hik.door.model.req.door.DoorEventReq; import com.mortals.xhx.module.hik.door.model.req.door.DoorEventReq;
...@@ -25,7 +27,9 @@ import com.mortals.xhx.module.hik.door.service.IHikDoorService; ...@@ -25,7 +27,9 @@ import com.mortals.xhx.module.hik.door.service.IHikDoorService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
...@@ -45,6 +49,11 @@ public class SyncDoorsEventWeekTaskImpl implements ITaskExcuteService { ...@@ -45,6 +49,11 @@ public class SyncDoorsEventWeekTaskImpl implements ITaskExcuteService {
@Autowired @Autowired
private AttendanceRecordHikService recordHikService; private AttendanceRecordHikService recordHikService;
@Autowired
private AttendanceLeaveRecordService attendanceLeaveRecordService;
@Value("${dingtalk.domain:}")
protected String domain;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
...@@ -71,12 +80,26 @@ public class SyncDoorsEventWeekTaskImpl implements ITaskExcuteService { ...@@ -71,12 +80,26 @@ public class SyncDoorsEventWeekTaskImpl implements ITaskExcuteService {
stopWatch.stop(); stopWatch.stop();
log.info("考勤计算日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis()); log.info("考勤计算日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis());
} }
AddAttendThread addAttendThread = new AddAttendThread(recordHikService, hikEntity, null); AddAttendThread addAttendThread = new AddAttendThread(recordHikService, hikEntity, null);
ThreadPool.getInstance().execute(addAttendThread); ThreadPool.getInstance().execute(addAttendThread);
}
//同步最近钉钉请假事件
if(!ObjectUtils.isEmpty(domain)){
log.info("开始同步钉钉请假事件!");
long between = DateUtil.between(attendStart, attendEnd, DateUnit.DAY, true);
AttendanceLeaveRecordQuery query = new AttendanceLeaveRecordQuery();
query.setStartTimeStart(hikEntity.getAttendanceDateStart());
query.setEndTimeEnd(hikEntity.getAttendanceDateEnd());
if (between > 120) return;
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
attendanceLeaveRecordService.syncLeaveRecord(query, null);
}
});
ThreadPool.getInstance().execute(thread);
}
}
@Override @Override
......
...@@ -5,7 +5,7 @@ Content-Type: application/json ...@@ -5,7 +5,7 @@ Content-Type: application/json
{ {
"loginName":"admin", "loginName":"admin",
"password":"admin", "password":"xhxADMIN8@a",
"securityCode":"admin" "securityCode":"admin"
} }
...@@ -107,8 +107,8 @@ Authorization: {{authToken}} ...@@ -107,8 +107,8 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"startTimeStart":"2024-01-01", "startTimeStart":"2024-03-01",
"endTimeEnd":"2024-02-29" "endTimeEnd":"2024-03-14"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment