|
|
|
@ -2,7 +2,9 @@ package com.engine.attendance.attendanceanalysis.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.engine.attendance.attendanceanalysis.service.EvectionService;
|
|
|
|
|
import com.engine.attendance.enums.CheckBoxEnum;
|
|
|
|
|
import com.engine.attendance.enums.WorkForTimeEnum;
|
|
|
|
|
import com.engine.common.util.DateUtil;
|
|
|
|
|
import com.engine.common.util.Utils;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
@ -22,13 +24,18 @@ public class EvectionServiceImpl extends Service implements EvectionService {
|
|
|
|
|
String kssj = Util.null2String(param.get("kssj"));
|
|
|
|
|
//请假结束时间
|
|
|
|
|
String jssj = Util.null2String(param.get("jssj"));
|
|
|
|
|
//作用时段
|
|
|
|
|
String zysd = Util.null2String(param.get("zysd"));
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> offsetEvectionAnomaly = Lists.newArrayList();
|
|
|
|
|
for (int i=0;i<abnormalClockInList.size();i++){
|
|
|
|
|
String pointTime = Util.null2String(abnormalClockInList.get(i).get("pointTime"));
|
|
|
|
|
if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(pointTime)) <=0 &&
|
|
|
|
|
DateUtil.getTime(jssj).compareTo(DateUtil.getTime(pointTime)) >=0){
|
|
|
|
|
offsetEvectionAnomaly.add(abnormalClockInList.get(i));
|
|
|
|
|
String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx"));
|
|
|
|
|
if (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey())) {
|
|
|
|
|
if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(pointTime)) <= 0 &&
|
|
|
|
|
DateUtil.getTime(jssj).compareTo(DateUtil.getTime(pointTime)) >= 0) {
|
|
|
|
|
offsetEvectionAnomaly.add(abnormalClockInList.get(i));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
abnormalClockInList.removeAll(offsetEvectionAnomaly);
|
|
|
|
@ -50,12 +57,15 @@ public class EvectionServiceImpl extends Service implements EvectionService {
|
|
|
|
|
int ccsc = param.get("ccsc") == null?0:Double.valueOf(Double.valueOf(param.get("ccsc").toString())*60).intValue();
|
|
|
|
|
//同一天可抵消多个异常
|
|
|
|
|
List<Map<String,Object>> offsetEvectionAnomaly = Lists.newArrayList();
|
|
|
|
|
//作用时段
|
|
|
|
|
String zysd = Util.null2String(param.get("zysd"));
|
|
|
|
|
|
|
|
|
|
String tybcndbjlhbjs = Util.null2String(param.get("tybcndbjlhbjs"));
|
|
|
|
|
if (CheckBoxEnum.CHECKED.getKey().equals(tybcndbjlhbjs)){
|
|
|
|
|
for (int i=abnormalClockInList.size() -1;i>=0;i--){
|
|
|
|
|
int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString());
|
|
|
|
|
if (ccsc > time){
|
|
|
|
|
String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx"));
|
|
|
|
|
if (ccsc > time && (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))){
|
|
|
|
|
ccsc = ccsc-time;
|
|
|
|
|
offsetEvectionAnomaly.add(abnormalClockInList.get(i));
|
|
|
|
|
}
|
|
|
|
@ -64,7 +74,8 @@ public class EvectionServiceImpl extends Service implements EvectionService {
|
|
|
|
|
}else{
|
|
|
|
|
for (int i=abnormalClockInList.size() -1;i>=0;i--){
|
|
|
|
|
int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString());
|
|
|
|
|
if (ccsc > time){
|
|
|
|
|
String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx"));
|
|
|
|
|
if (ccsc > time && (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))){
|
|
|
|
|
offsetEvectionAnomaly.add(abnormalClockInList.get(i));
|
|
|
|
|
abnormalClockInList.remove(i);
|
|
|
|
|
break;
|
|
|
|
|