Commit 0a3406d8 authored by 姬鋆屾's avatar 姬鋆屾
parents 4750d31b aaba4a11
......@@ -707,7 +707,9 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
public void deletFakeRecord(AttendanceRecordHikQuery recordHikQuery, Context context) {
//重新拉去的考勤记录,判断是否存在虚增的记录
log.info("开始删除虚增的记录!");
recordHikQuery.setEventSource("当日未有记录虚增考勤记录!");
return;
//只删除多条重复的记录
/* recordHikQuery.setEventSource("当日未有记录虚增考勤记录!");
List<AttendanceRecordHikEntity> fackAttendlist = this.find(recordHikQuery);
if (!ObjectUtils.isEmpty(fackAttendlist)) {
log.info("虚增的记录:{}", fackAttendlist.size());
......@@ -725,7 +727,7 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
this.remove(recordHikEntity.getId(), context);
}
}
}
}*/
}
public void syncDoorEvents(AttendanceRecordHikQuery recordHikQuery) {
......
......@@ -122,6 +122,20 @@ public abstract class AttendanceWorkAbstract {
}
protected Long getWeekWorkDayClassId(AttendanceGroupFixedworkEntity attendanceGroupFixedworkEntity, String week) {
Long weekClassId = -1L;
switch (week) {
case "星期六":
weekClassId = attendanceGroupFixedworkEntity.getSaturdayClassId();
break;
case "星期日":
weekClassId = attendanceGroupFixedworkEntity.getSundayClassId();
break;
}
return weekClassId;
}
public AttendanceWorkAbstract(int type) {
this.type = type;
......
......@@ -98,6 +98,9 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
if (!checkWorkByHoliday) {
// log.info("当前日期不在考勤时间范围内,不做处理!");
return;
}else{
//工作日要上班 获取配置的周六 周日班次 默认周一
weekClassId=this.getWeekClassId(attendanceGroupFixedworkEntity, "星期一");
}
} else {
if (checkHolidayByWorkDay) {
......@@ -382,11 +385,11 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
Date goWorkDate = detail.getGoWorkDate();
Date offWorkDate = detail.getOffWorkDate();
if (GoWorkResultEnum.正常.getValue() != goWorkResult) {
if (GoWorkResultEnum.请假.getValue() < goWorkResult) {
//判断 异常记录是否在请假时间段内
// DateUtil.between()
if(ObjectUtils.isEmpty(goWorkDate)){
detail.setGoWorkResult(GoWorkResultEnum.正常.getValue());
detail.setGoWorkResult(GoWorkResultEnum.请假.getValue());
}else{
boolean in = DateUtil.isIn(goWorkDate, startLeaveTime, endLeaveTime);
if (in) {
......@@ -396,11 +399,11 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
}
if (GoWorkResultEnum.正常.getValue() != offWorkResult) {
if (GoWorkResultEnum.请假.getValue() < offWorkResult) {
//判断 异常记录是否在请假时间段内
// DateUtil.between()
if(ObjectUtils.isEmpty(offWorkDate)){
detail.setOffWorkResult(GoWorkResultEnum.正常.getValue());
detail.setOffWorkResult(GoWorkResultEnum.请假.getValue());
}else{
boolean in = DateUtil.isIn(offWorkDate, startLeaveTime, endLeaveTime);
if (in) {
......
......@@ -66,8 +66,6 @@ import java.util.stream.Collectors;
@RequestMapping("attendance/record")
public class AttendanceRecordController extends BaseCRUDJsonBodyMappingController<AttendanceRecordService, AttendanceRecordEntity, Long> {
@Autowired
private ParamService paramService;
@Autowired
private UploadService uploadService;
......@@ -80,8 +78,6 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
@Autowired
private AttendanceClassService attendanceClassService;
@Autowired
private StaffService staffService;
@Autowired
private AttendanceExportRecordService attendanceExportRecordService;
@Autowired
private AttendanceGroupService groupService;
......@@ -371,37 +367,7 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
.filter(distinctByKey(f -> f.getOrderNum()))
.sorted(Comparator.comparingInt(AttendanceRecordDetailEntity::getOrderNum))
.collect(Collectors.toList());
//list.parallelStream().collect(Collectors.groupingBy())
List<AttDsyncColumn> dsyncColumns = new ArrayList<>();
/* for (int i = 1; i <= collect.size(); i++) {
AttDsyncColumn attDsyncColumn = new AttDsyncColumn();
attDsyncColumn.setName(String.format("上班%s打卡时间", i));
attDsyncColumn.setProperty("goWorkDate");
attDsyncColumn.setOrderNum(i);
dsyncColumns.add(attDsyncColumn);
attDsyncColumn = new AttDsyncColumn();
attDsyncColumn.setName(String.format("上班%s打卡结果", i));
attDsyncColumn.setProperty("goWorkResult");
attDsyncColumn.setOrderNum(i);
dsyncColumns.add(attDsyncColumn);
attDsyncColumn = new AttDsyncColumn();
attDsyncColumn.setName(String.format("下班%s打卡时间", i));
attDsyncColumn.setProperty("offWorkDate");
attDsyncColumn.setOrderNum(i);
dsyncColumns.add(attDsyncColumn);
attDsyncColumn = new AttDsyncColumn();
attDsyncColumn.setName(String.format("下班%s打卡结果",i));
attDsyncColumn.setProperty("offWorkResult");
attDsyncColumn.setOrderNum(i);
dsyncColumns.add(attDsyncColumn);
}*/
collect.forEach(item -> {
AttDsyncColumn attDsyncColumn = new AttDsyncColumn();
attDsyncColumn.setName(String.format("上班%s打卡时间", item.getOrderNum()));
......
......@@ -37,8 +37,8 @@ POST {{baseUrl}}/attendance/record/hik/addAttendanceRecord
Content-Type: application/json
{
"attendanceDateStart": "2024-03-01",
"attendanceDateEnd": "2024-03-31"
"attendanceDateStart": "2024-05-11",
"attendanceDateEnd": "2024-05-11"
}
###海康考勤打卡记录计算1
......@@ -46,8 +46,8 @@ POST {{baseUrl}}/attendance/record/hik/addAttendanceRecord
Content-Type: application/json
{
"attendanceDateStart": "2023-12-04",
"attendanceDateEnd": "2023-12-08",
"attendanceDateStart": "2024-05-11",
"attendanceDateEnd": "2024-05-11",
"staffId": 322
}
......@@ -58,8 +58,8 @@ POST {{baseUrl}}/attendance/record/hik/addAttendanceRecordCustom
Content-Type: application/json
{
"attendanceDateStart": "2024-05-01",
"attendanceDateEnd": "2024-05-19"
"attendanceDateStart": "2024-05-22",
"attendanceDateEnd": "2024-05-28"
}
......
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