|
@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
|
|
+import com.yh.saas.common.support.util.StringUtils;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ClockInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ClockInfo;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.LeaveInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.ClockInfoMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.ClockInfoMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IClockInfoService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IClockInfoService;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.ILeaveInfoService;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -28,6 +31,8 @@ import java.util.*;
|
|
public class ClockInfoServiceImpl extends ServiceImpl<ClockInfoMapper, ClockInfo> implements IClockInfoService {
|
|
public class ClockInfoServiceImpl extends ServiceImpl<ClockInfoMapper, ClockInfo> implements IClockInfoService {
|
|
@Autowired
|
|
@Autowired
|
|
private IClockInfoService clockInfoService;
|
|
private IClockInfoService clockInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ILeaveInfoService leaveInfoService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 添加打卡信息
|
|
* 添加打卡信息
|
|
@@ -68,13 +73,17 @@ public class ClockInfoServiceImpl extends ServiceImpl<ClockInfoMapper, ClockInfo
|
|
.eq("common_id", clockInfo.getCommonId())
|
|
.eq("common_id", clockInfo.getCommonId())
|
|
.eq("delete_flag", "0")
|
|
.eq("delete_flag", "0")
|
|
.gt("create_date", timeOfDay));
|
|
.gt("create_date", timeOfDay));
|
|
- //信息不为空,下班打卡
|
|
|
|
|
|
+ //信息不为空
|
|
if (clockInfo1 != null) {
|
|
if (clockInfo1 != null) {
|
|
- if (timeOfFive.compareTo(currentTime) > 0) {
|
|
|
|
- //早退
|
|
|
|
- clockInfo1.setLeaveEarlyFlag("1");
|
|
|
|
|
|
+ if ("3".equals(clockInfo.getClockType())) {
|
|
|
|
+ if (timeOfFive.compareTo(currentTime) > 0 && clockInfo1.getLeaveId() == null) {
|
|
|
|
+ //早退
|
|
|
|
+ clockInfo1.setLeaveEarlyFlag("1");
|
|
|
|
+ }
|
|
|
|
+ clockInfo1.setOffClockDate(date);
|
|
|
|
+ } else {
|
|
|
|
+ clockInfo1.setToClockDate(date);
|
|
}
|
|
}
|
|
- clockInfo1.setOffClockDate(date);
|
|
|
|
//更新主表数据
|
|
//更新主表数据
|
|
this.updateById(clockInfo1);
|
|
this.updateById(clockInfo1);
|
|
}
|
|
}
|
|
@@ -83,7 +92,7 @@ public class ClockInfoServiceImpl extends ServiceImpl<ClockInfoMapper, ClockInfo
|
|
clockInfo.setId(IdGenerator.generateUUID());
|
|
clockInfo.setId(IdGenerator.generateUUID());
|
|
//下班打卡
|
|
//下班打卡
|
|
if ("3".equals(clockInfo.getClockType())) {
|
|
if ("3".equals(clockInfo.getClockType())) {
|
|
- if (timeOfFive.compareTo(currentTime) > 0) {
|
|
|
|
|
|
+ if (timeOfFive.compareTo(currentTime) > 0 && clockInfo1.getLeaveId() == null) {
|
|
//早退
|
|
//早退
|
|
clockInfo.setLeaveEarlyFlag("1");
|
|
clockInfo.setLeaveEarlyFlag("1");
|
|
}
|
|
}
|
|
@@ -91,7 +100,7 @@ public class ClockInfoServiceImpl extends ServiceImpl<ClockInfoMapper, ClockInfo
|
|
}
|
|
}
|
|
//上班打卡
|
|
//上班打卡
|
|
else {
|
|
else {
|
|
- if (currentTime.compareTo(timeOfEight) > 0) {
|
|
|
|
|
|
+ if (currentTime.compareTo(timeOfEight) > 0 && clockInfo1.getLeaveId() == null) {
|
|
//迟到
|
|
//迟到
|
|
clockInfo.setLateFlag("1");
|
|
clockInfo.setLateFlag("1");
|
|
}
|
|
}
|