|
@@ -3,9 +3,8 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
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.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
|
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.entity.ClockInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ClockInfo;
|
|
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;
|
|
@@ -13,8 +12,6 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
-import java.time.LocalDate;
|
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -65,6 +62,7 @@ public class ClockInfoServiceImpl extends ServiceImpl<ClockInfoMapper, ClockInfo
|
|
ClockInfo clockInfo1 = this.selectOne(new EntityWrapper<ClockInfo>()
|
|
ClockInfo clockInfo1 = this.selectOne(new EntityWrapper<ClockInfo>()
|
|
.eq("comp_id", clockInfo.getCompId())
|
|
.eq("comp_id", clockInfo.getCompId())
|
|
.eq("common_id", clockInfo.getCommonId())
|
|
.eq("common_id", clockInfo.getCommonId())
|
|
|
|
+ .eq("delete_flag", "0")
|
|
.gt("create_date", timeOfDay));
|
|
.gt("create_date", timeOfDay));
|
|
//信息不为空,下班打卡
|
|
//信息不为空,下班打卡
|
|
if (clockInfo1 != null) {
|
|
if (clockInfo1 != null) {
|
|
@@ -136,22 +134,45 @@ public class ClockInfoServiceImpl extends ServiceImpl<ClockInfoMapper, ClockInfo
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public String suppClock(ClockInfo clockInfo) {
|
|
public String suppClock(ClockInfo clockInfo) {
|
|
- //当天零点
|
|
|
|
- SimpleDateFormat zero = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
|
|
|
|
- Calendar d = Calendar.getInstance();
|
|
|
|
- d.setTime(new Date());
|
|
|
|
- d.add(Calendar.YEAR, 0);
|
|
|
|
- Date n = d.getTime();
|
|
|
|
- String zeroOfDay = zero.format(n);
|
|
|
|
//查询打卡信息
|
|
//查询打卡信息
|
|
- ClockInfo clockInfo1 = this.selectOne(new EntityWrapper<ClockInfo>()
|
|
|
|
- .eq("common_id", clockInfo.getCommonId())
|
|
|
|
- .gt("create_date",zeroOfDay));
|
|
|
|
|
|
+ ClockInfo clockInfo1 = this.selectById(clockInfo.getId());
|
|
if (clockInfo1 != null) {
|
|
if (clockInfo1 != null) {
|
|
clockInfo1.setSupplementClockType(clockInfo.getSupplementClockType());
|
|
clockInfo1.setSupplementClockType(clockInfo.getSupplementClockType());
|
|
clockInfo1.setReasonForApplication(clockInfo.getReasonForApplication());
|
|
clockInfo1.setReasonForApplication(clockInfo.getReasonForApplication());
|
|
|
|
+ //补卡状态改为审核中
|
|
|
|
+ clockInfo1.setStatus(StatusEnum.SUPP_REVIEWED.getName());
|
|
|
|
+ clockInfo1.setStatusFlag(StatusEnum.SUPP_REVIEWED.getFlag());
|
|
this.updateById(clockInfo1);
|
|
this.updateById(clockInfo1);
|
|
}
|
|
}
|
|
return "OK";
|
|
return "OK";
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 补卡信息审核
|
|
|
|
+ *
|
|
|
|
+ * @param clockInfo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public String examineClock(ClockInfo clockInfo) {
|
|
|
|
+ //查询打卡信息
|
|
|
|
+ ClockInfo clockInfo1 = this.selectById(clockInfo.getId());
|
|
|
|
+ if (clockInfo1 != null && "1".equals(clockInfo1.getStatusFlag())) {
|
|
|
|
+ //通过
|
|
|
|
+ if (clockInfo.getExamineFlag() == 1) {
|
|
|
|
+ //补卡状态改为补卡成功
|
|
|
|
+ clockInfo1.setStatus(StatusEnum.SUPP_SUCCESS.getName());
|
|
|
|
+ clockInfo1.setStatusFlag(StatusEnum.SUPP_SUCCESS.getFlag());
|
|
|
|
+ }
|
|
|
|
+ //驳回
|
|
|
|
+ else {
|
|
|
|
+ //补卡状态改为补卡失败
|
|
|
|
+ clockInfo1.setStatus(StatusEnum.SUPP_FAIL.getName());
|
|
|
|
+ clockInfo1.setStatusFlag(StatusEnum.SUPP_FAIL.getFlag());
|
|
|
|
+ }
|
|
|
|
+ //更新数据
|
|
|
|
+ this.updateById(clockInfo1);
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
}
|
|
}
|