diff --git a/src/com/engine/jucailinkq/attendance/attendanceanalysis/service/impl/AskForLeaveServiceImpl.java b/src/com/engine/jucailinkq/attendance/attendanceanalysis/service/impl/AskForLeaveServiceImpl.java index 0869ffb..66228d6 100644 --- a/src/com/engine/jucailinkq/attendance/attendanceanalysis/service/impl/AskForLeaveServiceImpl.java +++ b/src/com/engine/jucailinkq/attendance/attendanceanalysis/service/impl/AskForLeaveServiceImpl.java @@ -250,27 +250,44 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic //作用时段 String zysd = Util.null2String(param.get("zysd")); - 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()); - String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx")); - if (qjsc >= time && (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))){ - qjsc = qjsc-time; - offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i)); - } - } - abnormalClockInList.removeAll(offsetAskForLeaveAnomaly); - }else{ - for (int i=abnormalClockInList.size() -1;i>=0;i--){ - int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString()); - String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx")); - if (qjsc >= time && (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))){ + for (int i=0;i= time){ + offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i)); - abnormalClockInList.remove(i); - break; + qjsc = qjsc-time; + }else { + qjsc = 0; + time = time-qjsc; + abnormalClockInList.get(i).put("betweenMinutes",time); } } } + abnormalClockInList.removeAll(offsetAskForLeaveAnomaly); + +// 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()); +// String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx")); +// if (qjsc >= time && (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))){ +// qjsc = qjsc-time; +// offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i)); +// } +// } +// abnormalClockInList.removeAll(offsetAskForLeaveAnomaly); +// }else{ +// for (int i=abnormalClockInList.size() -1;i>=0;i--){ +// int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString()); +// String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx")); +// if (qjsc >= time && (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))){ +// offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i)); +// abnormalClockInList.remove(i); +// break; +// } +// } +// } abnormalClockInList.addAll(forgetClockList); Map map = Maps.newHashMap(); map.put("abnormalClockInList",abnormalClockInList); diff --git a/src/com/engine/jucailinkq/attendance/attendanceanalysis/service/impl/EvectionServiceImpl.java b/src/com/engine/jucailinkq/attendance/attendanceanalysis/service/impl/EvectionServiceImpl.java index dbc1c92..bc47d41 100644 --- a/src/com/engine/jucailinkq/attendance/attendanceanalysis/service/impl/EvectionServiceImpl.java +++ b/src/com/engine/jucailinkq/attendance/attendanceanalysis/service/impl/EvectionServiceImpl.java @@ -80,27 +80,44 @@ public class EvectionServiceImpl extends Service implements EvectionService { 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()); - 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)); - } - } - abnormalClockInList.removeAll(offsetEvectionAnomaly); - }else{ - for (int i=abnormalClockInList.size() -1;i>=0;i--){ - int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString()); - String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx")); - if (ccsc > time && (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))){ + + for (int i=0;i= time){ offsetEvectionAnomaly.add(abnormalClockInList.get(i)); - abnormalClockInList.remove(i); - break; + ccsc = ccsc-time; + }else { + ccsc = 0; + time = time-ccsc; + abnormalClockInList.get(i).put("betweenMinutes",time); } } } + abnormalClockInList.removeAll(offsetEvectionAnomaly); + +// 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()); +// 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)); +// } +// } +// abnormalClockInList.removeAll(offsetEvectionAnomaly); +// }else{ +// for (int i=abnormalClockInList.size() -1;i>=0;i--){ +// int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString()); +// 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; +// } +// } +// } abnormalClockInList.addAll(forgetClockList); Map resultMap = Maps.newHashMap(); resultMap.put("abnormalClockInList",abnormalClockInList);