Commit 4976d844 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents ed43d9a9 8df15e0b
......@@ -109,7 +109,7 @@ public class SyncDoorsEventWeekTaskImpl implements ITaskExcuteService {
}
log.info("开始计算及统计最近7天考勤!");
String expire = cacheService.get(KEY_ATTENDANCE_STAT_LOCK_CACHE);
if(ObjectUtils.isEmpty(expire)) {
if (ObjectUtils.isEmpty(expire)) {
AddAttendThread addAttendThread = new AddAttendThread(recordHikService, hikEntity, null);
ThreadPool.getInstance().execute(addAttendThread);
}
......@@ -126,13 +126,14 @@ public class SyncDoorsEventWeekTaskImpl implements ITaskExcuteService {
query.setStartTimeStart(hikEntity.getAttendanceDateStart());
query.setEndTimeEnd(hikEntity.getAttendanceDateEnd());
if (between > 120) return;
Thread thread = new Thread(new Runnable() {
Runnable runnable = new Runnable() {
@Override
public void run() {
attendanceLeaveRecordService.syncLeaveRecord(query, null);
}
});
ThreadPool.getInstance().execute(thread);
};
ThreadPool.getInstance().execute(runnable);
}
......
......@@ -3,6 +3,7 @@ package com.mortals.xhx.module.attendance.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.dingtalkworkflow_1_0.models.ListProcessInstanceIdsResponse;
import com.aliyun.dingtalkworkflow_1_0.models.ListProcessInstanceIdsResponseBody;
......@@ -201,11 +202,13 @@ public class AttendanceLeaveRecordServiceImpl extends AbstractCRUDServiceImpl<At
//同步指定用户
List<UserEntity> userEntityList = userCacheList.stream()
.filter(f -> !ObjectUtils.isEmpty(f.getDingUserId()))
.filter(f -> staffId == f.getCustomerId())
.filter(f -> staffId.equals(f.getCustomerId()))
.collect(Collectors.toList());
getLeaveRecordByUserList(query, userEntityList, waitSyncLeaveRecords);
}
log.info("待同步请假记录:{}", JSON.toJSONString(waitSyncLeaveRecords));
if (!ObjectUtils.isEmpty(waitSyncLeaveRecords)) {
for (AttendanceLeaveRecordEntity waitSyncLeaveRecord : waitSyncLeaveRecords) {
dingPersonService.handleByProcessInstanceId(waitSyncLeaveRecord.getRemark());
......
......@@ -110,13 +110,15 @@ public class AttendanceLeaveRecordController extends BaseCRUDJsonBodyMappingCont
long between = DateUtil.between(DateUtil.parseDate(query.getStartTimeStart()), DateUtil.parseDate(query.getEndTimeEnd()), DateUnit.DAY, true);
if (between > 120) throw new AppException("时间范围不能超过120天");
Context context = this.getContext();
Thread thread = new Thread(new Runnable() {
Runnable runnable = new Runnable() {
@Override
public void run() {
service.syncLeaveRecord(query, context);
}
});
ThreadPool.getInstance().execute(thread);
};
ThreadPool.getInstance().execute(runnable);
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
......
......@@ -5,7 +5,7 @@ Content-Type: application/json
{
"loginName": "admin",
"password": "xhxADMIN8@a",
"password": "admin",
"securityCode": "admin"
}
......@@ -132,8 +132,9 @@ Authorization: {{authToken}}
Content-Type: application/json
{
"startTimeStart": "2024-03-01",
"endTimeEnd": "2024-04-09"
"staffId": 405,
"startTimeStart": "2024-08-11",
"endTimeEnd": "2024-08-19"
}
......
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