zm_dev
liuliang 2 years ago
parent 00747aed0c
commit 54101fe06e

@ -8,13 +8,13 @@ public interface AskForLeaveService {
*
* @return
*/
List<Map<String,Object>> askForLeaveByTime(Map<String,Object> param);
Map<String,Object> askForLeaveByTime(Map<String,Object> param);
/**
*
* @return
*/
List<Map<String,Object>> askForLeaveByDurationTime(Map<String,Object> param);
Map<String,Object> askForLeaveByDurationTime(Map<String,Object> param);
/**
*

@ -8,13 +8,13 @@ public interface EvectionService {
*
* @return
*/
List<Map<String,Object>> evectionByTime(Map<String,Object> param);
Map<String,Object> evectionByTime(Map<String,Object> param);
/**
*
* @return
*/
List<Map<String,Object>> evectionByDurationTime(Map<String,Object> param);
Map<String,Object> evectionByDurationTime(Map<String,Object> param);
/**
*

@ -3,6 +3,7 @@ package com.engine.attendance.attendanceanalysis.service.impl;
import com.engine.attendance.attendanceanalysis.cmd.item.*;
import com.engine.attendance.attendanceanalysis.service.AbnormalAttendanceService;
import com.engine.attendance.enums.AccountingUnitEnum;
import com.engine.attendance.enums.AttendanceItemTypeEnum;
import com.engine.attendance.enums.ClassSegmentTypeEnum;
import com.engine.attendance.enums.WorkForTimeEnum;
import com.engine.common.util.DateUtil;
@ -76,6 +77,8 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
saveWorkTimeBeLateParam.put("item",workTimeBeLateItems.get(0).get("key"));
saveWorkTimeBeLateParam.put("itemduration",itemduration);
saveWorkTimeBeLateParam.put("betweenMinutes",between);
saveWorkTimeBeLateParam.put("itemType", AttendanceItemTypeEnum.LATE);
saveWorkTimeBeLateParam.put("hsdw",hsdw);
resultList.add(saveWorkTimeBeLateParam);
// List<Map<String,Object>> classInfoList = Lists.newArrayList();
// classInfoList.add(classInfo);
@ -109,6 +112,8 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
saveWorkTimeBeLateParam.put("item",getBeLateItems(lateParams).get(0).get("key"));
saveWorkTimeBeLateParam.put("itemduration",itemduration);
saveWorkTimeBeLateParam.put("betweenMinutes",between);
saveWorkTimeBeLateParam.put("itemType", AttendanceItemTypeEnum.LATE);
saveWorkTimeBeLateParam.put("hsdw",hsdw);
resultList.add(saveWorkTimeBeLateParam);
// List<Map<String,Object>> classInfoList = Lists.newArrayList();
// classInfoList.add(classInfo);
@ -141,6 +146,8 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
saveWorkTimeBeLateParam.put("item",getBeLateItems(lateParams).get(0).get("key"));
saveWorkTimeBeLateParam.put("itemduration",itemduration);
saveWorkTimeBeLateParam.put("betweenMinutes",between);
saveWorkTimeBeLateParam.put("itemType", AttendanceItemTypeEnum.LATE);
saveWorkTimeBeLateParam.put("hsdw",hsdw);
resultList.add(saveWorkTimeBeLateParam);
// List<Map<String,Object>> classInfoList = Lists.newArrayList();
// classInfoList.add(classInfo);
@ -207,6 +214,7 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
saveWorkTimeBeLateParam.put("item",getBeEarlyItems(earlyParams).get(0).get("key"));
saveWorkTimeBeLateParam.put("itemduration",itemduration);
saveWorkTimeBeLateParam.put("betweenMinutes",between);
saveWorkTimeBeLateParam.put("hsdw",hsdw);
resultList.add(saveWorkTimeBeLateParam);
// List<Map<String,Object>> classInfoList = Lists.newArrayList();
// classInfoList.add(classInfo);
@ -242,6 +250,7 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
saveWorkTimeBeLateParam.put("item",getBeEarlyItems(earlyParams).get(0).get("key"));
saveWorkTimeBeLateParam.put("itemduration",itemduration);
saveWorkTimeBeLateParam.put("betweenMinutes",between);
saveWorkTimeBeLateParam.put("hsdw",hsdw);
resultList.add(saveWorkTimeBeLateParam);
// List<Map<String,Object>> classInfoList = Lists.newArrayList();
// classInfoList.add(classInfo);
@ -274,6 +283,7 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
saveWorkTimeBeLateParam.put("item",getBeEarlyItems(earlyParams).get(0).get("key"));
saveWorkTimeBeLateParam.put("itemduration",itemduration);
saveWorkTimeBeLateParam.put("betweenMinutes",between);
saveWorkTimeBeLateParam.put("hsdw",hsdw);
resultList.add(saveWorkTimeBeLateParam);
// List<Map<String,Object>> classInfoList = Lists.newArrayList();
// classInfoList.add(classInfo);

@ -5,6 +5,7 @@ import com.engine.attendance.enums.CheckBoxEnum;
import com.engine.common.util.DateUtil;
import com.engine.core.impl.Service;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import weaver.general.Util;
import java.util.Comparator;
@ -15,7 +16,7 @@ import java.util.stream.Collectors;
public class AskForLeaveServiceImpl extends Service implements AskForLeaveService {
@Override
public List<Map<String,Object>> askForLeaveByTime(Map<String, Object> param) {
public Map<String,Object> askForLeaveByTime(Map<String, Object> param) {
//人员迟到、早退、漏卡等记录
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)param.get("abnormalClockInList");
//请假开始时间
@ -23,16 +24,20 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
//请假结束时间
String jssj = Util.null2String(param.get("jssj"));
List<Map<String,Object>> needRemoveList = Lists.newArrayList();
List<Map<String,Object>> offsetAskForLeaveAnomaly = 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){
needRemoveList.add(abnormalClockInList.get(i));
offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i));
}
}
abnormalClockInList.removeAll(needRemoveList);
return abnormalClockInList;
abnormalClockInList.removeAll(offsetAskForLeaveAnomaly);
Map<String,Object> map = Maps.newHashMap();
map.put("abnormalClockInList",abnormalClockInList);
map.put("offsetAskForLeaveAnomaly",offsetAskForLeaveAnomaly);
return map;
}
@Override
@ -41,39 +46,43 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
}
@Override
public List<Map<String,Object>> askForLeaveByDurationTime(Map<String, Object> param) {
public Map<String,Object> askForLeaveByDurationTime(Map<String, Object> param) {
//人员迟到、早退、漏卡等记录
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)param.get("abnormalClockInList");
List<Map<String,Object>> forgetClockList = abnormalClockInList.stream().filter(e -> e.get("betweenMinutes") == null).collect(Collectors.toList());
abnormalClockInList = abnormalClockInList.stream().filter(e -> e.get("betweenMinutes") != null).collect(Collectors.toList());
abnormalClockInList = abnormalClockInList.stream().sorted(Comparator.comparing(e->Integer.valueOf(e.get("betweenMinutes").toString()))).collect(Collectors.toList());
List<Map<String,Object>> offsetAskForLeaveAnomaly = Lists.newArrayList();
//请假时长,单位小时
int qjsc = param.get("qjsc") == null?0:Double.valueOf(Double.valueOf(param.get("qjsc").toString())*60).intValue();
//同一天可抵消多个异常
String tybcndbjlhbjs = Util.null2String(param.get("tybcndbjlhbjs"));
List<Map<String,Object>> needRemoveList = Lists.newArrayList();
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 (qjsc >= time){
qjsc = qjsc-time;
needRemoveList.add(abnormalClockInList.get(i));
offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i));
}
}
abnormalClockInList.removeAll(needRemoveList);
abnormalClockInList.removeAll(offsetAskForLeaveAnomaly);
}else{
for (int i=abnormalClockInList.size() -1;i>=0;i--){
int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString());
if (qjsc >= time){
offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i));
abnormalClockInList.remove(i);
break;
}
}
}
abnormalClockInList.addAll(forgetClockList);
return abnormalClockInList;
Map<String,Object> map = Maps.newHashMap();
map.put("abnormalClockInList",abnormalClockInList);
map.put("offsetAskForLeaveAnomaly",offsetAskForLeaveAnomaly);
return map;
}
}

@ -5,6 +5,7 @@ import com.engine.attendance.enums.CheckBoxEnum;
import com.engine.common.util.DateUtil;
import com.engine.core.impl.Service;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import weaver.general.Util;
import java.util.Comparator;
@ -14,7 +15,7 @@ import java.util.stream.Collectors;
public class EvectionServiceImpl extends Service implements EvectionService {
@Override
public List<Map<String, Object>> evectionByTime(Map<String, Object> param) {
public Map<String,Object> evectionByTime(Map<String, Object> param) {
//人员迟到、早退、漏卡等记录
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)param.get("abnormalClockInList");
//请假开始时间
@ -22,20 +23,23 @@ public class EvectionServiceImpl extends Service implements EvectionService {
//请假结束时间
String jssj = Util.null2String(param.get("jssj"));
List<Map<String,Object>> needRemoveList = Lists.newArrayList();
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){
needRemoveList.add(abnormalClockInList.get(i));
offsetEvectionAnomaly.add(abnormalClockInList.get(i));
}
}
abnormalClockInList.removeAll(needRemoveList);
return abnormalClockInList;
abnormalClockInList.removeAll(offsetEvectionAnomaly);
Map<String,Object> resultMap = Maps.newHashMap();
resultMap.put("abnormalClockInList",abnormalClockInList);
resultMap.put("offsetEvectionAnomaly",offsetEvectionAnomaly);
return resultMap;
}
@Override
public List<Map<String, Object>> evectionByDurationTime(Map<String, Object> param) {
public Map<String,Object> evectionByDurationTime(Map<String, Object> param) {
//人员迟到、早退、漏卡等记录
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)param.get("abnormalClockInList");
List<Map<String,Object>> forgetClockList = abnormalClockInList.stream().filter(e -> e.get("betweenMinutes") == null).collect(Collectors.toList());
@ -45,30 +49,33 @@ 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();
List<Map<String,Object>> needRemoveList = Lists.newArrayList();
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){
ccsc = ccsc-time;
needRemoveList.add(abnormalClockInList.get(i));
offsetEvectionAnomaly.add(abnormalClockInList.get(i));
}
}
abnormalClockInList.removeAll(needRemoveList);
abnormalClockInList.removeAll(offsetEvectionAnomaly);
}else{
for (int i=abnormalClockInList.size() -1;i>=0;i--){
int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString());
if (ccsc > time){
offsetEvectionAnomaly.add(abnormalClockInList.get(i));
abnormalClockInList.remove(i);
break;
}
}
}
abnormalClockInList.addAll(forgetClockList);
return abnormalClockInList;
Map<String,Object> resultMap = Maps.newHashMap();
resultMap.put("abnormalClockInList",abnormalClockInList);
resultMap.put("offsetEvectionAnomaly",offsetEvectionAnomaly);
return resultMap;
}
@Override

@ -1,6 +1,7 @@
package com.engine.attendance.attendanceanalysis.service.impl;
import com.engine.attendance.attendanceanalysis.service.ForgetClockInService;
import com.engine.attendance.enums.AttendanceItemTypeEnum;
import com.engine.attendance.enums.SystemItemEnum;
import com.engine.core.impl.Service;
import com.google.common.collect.Lists;
@ -34,6 +35,7 @@ public class ForgetClockInServiceImpl extends Service implements ForgetClockInSe
Map<String,Object> forgetParam = Maps.newHashMap();
forgetParam.put("item", SystemItemEnum.MISSING_CLOCK_IN.getKey());
forgetParam.put("itemduration", 1);
forgetParam.put("itemType", AttendanceItemTypeEnum.MISSE_CARD);
// List<Map<String,Object>> classInfoList = Lists.newArrayList();
// classInfoList.add((Map<String, Object>)params.get("classInfo"));
// forgetParam.put("classInfo",classInfoList);

@ -17,6 +17,7 @@ import com.engine.core.impl.Service;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import weaver.conn.RecordSet;
import weaver.general.Util;
import java.util.List;
import java.util.Map;
@ -55,12 +56,16 @@ public class UtilServiceImpl extends Service implements UtilService {
sql = sql +bcxxIds+") order by b.kssj";
List<Map<String,Object>> dataList = DbTools.getSqlToList(sql);
Map<String,List<Map<String,Object>>> dataMap = dataList.stream().collect(Collectors.groupingBy(e->Util.null2String(e.get("bcxx"))));
String edsc = "8";
if (dataList.size()>0){
edsc = Util.null2String(dataList.get(0).get("edsc"));
}
dataMap.entrySet().forEach(e -> {
List<Map<String,Object>> schedulingList = schedulingMap.get(e.getKey());
for (Map<String,Object> scheduling :schedulingList){
String bcrq = Util.null2String(scheduling.get("bcrq"));
String rqlx = Util.null2String(scheduling.get("rqlx"));
List<Map<String,Object>> bcxxs = e.getValue();
for (Map<String,Object> map:bcxxs){
map.put("rqlx",rqlx);
@ -124,7 +129,7 @@ public class UtilServiceImpl extends Service implements UtilService {
map.put("bcxx","0");
map.put("bcsdxx","");
map.put("edsc","8");
map.put("edsc",edsc);
map.put("bdlx", ClassSegmentTypeEnum.OVERTIME_PLAN.getKey());
map.put("dtkssj",overtimePlan.get("kssj"));
map.put("dtjssj",overtimePlan.get("jssj"));
@ -136,6 +141,7 @@ public class UtilServiceImpl extends Service implements UtilService {
map.put("zddxfz","0");
map.put("dxhs","0");
map.put("rqlx",dateMap.get(e.getKey()));
map.put("jbsc",overtimePlan.get("jbsc"));
if (attendanceItems.size() >0){
map.put("ksdk",attendanceItems.get(0).get("ksjbbxydk"));
map.put("jsdk",attendanceItems.get(0).get("jsjbbxydk"));

@ -2,24 +2,25 @@ package com.engine.attendance.attendanceanalysis.service.impl;
import com.engine.attendance.attendanceanalysis.cmd.item.WorkOvertimeItemCmd;
import com.engine.attendance.attendanceanalysis.service.WorkOverTimeService;
import com.engine.attendance.enums.CheckBoxEnum;
import com.engine.attendance.enums.ClassSegmentTypeEnum;
import com.engine.attendance.enums.DateTypeEnum;
import com.engine.attendance.enums.WorkForTimeEnum;
import com.engine.attendance.enums.*;
import com.engine.common.util.CommonUtil;
import com.engine.common.util.DateUtil;
import com.engine.common.util.DbTools;
import com.engine.common.util.Utils;
import com.engine.core.impl.Service;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import weaver.general.TimeUtil;
import weaver.general.Util;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeService {
@Override
public List<Map<String, Object>> recordWorkOverTime(Map<String, Object> params) {
@ -31,10 +32,21 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
String analysisDate = Util.null2String(params.get("analysisDate"));
//请假记录
List<Map<String,Object>> askForLeaveList = (List<Map<String,Object>>)params.get("askForLeaveList");
//请假项目
Map<String,Map<String,Object>> askForLeaveItems = (Map<String,Map<String,Object>>)params.get("askForLeaveItems");
//外出记录
List<Map<String,Object>> evectionList = (List<Map<String,Object>>)params.get("evectionList");
//外出项目
Map<String,Map<String,Object>> evectionItems = (Map<String,Map<String,Object>>)params.get("evectionItems");
//打卡卡点
List<Map<String,Map<String,Object>>> clcokInTimeList = (List<Map<String,Map<String,Object>>>)params.get("clcokInTimeList");
//请假后消除的异常
List<Map<String,Object>> offsetAskForLeaveAnomaly = (List<Map<String,Object>>)params.get("offsetAskForLeaveAnomaly");
//出差外出后消除的异常
List<Map<String,Object>> offsetEvectionAnomaly = (List<Map<String,Object>>)params.get("offsetEvectionAnomaly");
//经过请假外出处理过的异常项目
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)params.get("abnormalClockInList");
Map<String,Map<String,Object>> clcokInTimeMap = Maps.newHashMap();
@ -60,9 +72,7 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
//人员
String userId = Util.null2String(params.get("userId"));
List<Map<String, Object>> resultLists = Lists.newArrayList();
int maxDayTime = 0;
int maxWeekTime = 0;
int maxMonthTime = 0;
for (Map<String, Object> scheduleMap :scheduleResult){
String bdlx = Util.null2String(scheduleMap.get("bdlx"));
String rqlx = Util.null2String(scheduleMap.get("rqlx"));
@ -73,26 +83,27 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
//加班结束时间
String dtjssj = Util.null2String(scheduleMap.get("dtjssj"));
String kssj = analysisDate +" "+Util.null2String(scheduleMap.get("dtkssj"));
String jssj = analysisDate +" "+Util.null2String(scheduleMap.get("dtjssj"));
String kssj = analysisDate +" "+dtkssj;
String jssj = analysisDate +" "+dtjssj;
if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(jssj)) >0){
jssj = DateUtil.AfterDay(analysisDate,1)+" "+Util.null2String(scheduleMap.get("dtjssj"));
}
//加班实际开始时间
String realityStartTime = "";
//加班实际结束时间
String realityEndime = "";
//申请时间
int applicationTime = DateUtil.getBetWeenMinutes(kssj,jssj);
//扣除休息时间后的剩余
int applicationRestTime = applicationTime;
resultLists.add(workOverTimeItems);
getWorkOverTimeParam.put("attendanceItems",attendanceItems);
getWorkOverTimeParam.put("rqlx",scheduleMap.get("rqlx"));
if (ClassSegmentTypeEnum.EXTENDED_OVERTIME.getKey().equals(bdlx)){
getWorkOverTimeParam.put("workfor", WorkForTimeEnum.DELAY_TO_WORK_OVERTIME.getKey());
}else if (ClassSegmentTypeEnum.EARLY_OVERTIME.getKey().equals(bdlx)){
getWorkOverTimeParam.put("workfor",WorkForTimeEnum.EARLY_TO_WORK_OVERTIME.getKey());
}else if (ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(bdlx)){
applicationRestTime = Utils.removeRestTime(kssj,jssj,scheduleResult,analysisDate);
getWorkOverTimeParam.put("workfor",WorkForTimeEnum.PLAN_WORK_OVERTIME.getKey());
}
Map<String,Object> result = commandExecutor.execute(new WorkOvertimeItemCmd(getWorkOverTimeParam));
@ -101,14 +112,20 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
if (workTimeBeLateItems.size() == 0){
continue;
}
workOverTimeItems.put("item",workTimeBeLateItems.get(0).get("key"));
double jbsc = Integer.valueOf(Util.null2String(scheduleMap.get("jbsc")));
//开始加班必须打卡
String ksjbbxydk = Util.null2String(workTimeBeLateItems.get(0).get("ksjbbxydk"));
//结束加班必须打卡
String jsjbbxydk = Util.null2String(workTimeBeLateItems.get(0).get("jsjbbxydk"));
//提前打卡开始的时长计入加班
String tqdkjrjb = Util.null2String(workTimeBeLateItems.get(0).get("tqdkjrjb"));
//推后打卡结束的时长计入加班
String thdkjrjb = Util.null2String(workTimeBeLateItems.get(0).get("thdkjrjb"));
//结算加班时长不得超过申请的时长
String jbscbdccsqsc = Util.null2String(workTimeBeLateItems.get(0).get("jbscbdccsqsc"));
//结算加班时长不得超过申请的时长
//是否扣除时间区间内的就餐休息时长
String zdkcjcxxsc = Util.null2String(workTimeBeLateItems.get(0).get("zdkcjcxxsc"));
//超出限制时长的处理方式
String ccclfs = Util.null2String(workTimeBeLateItems.get(0).get("ccclfs"));
@ -120,21 +137,139 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
String zzdjbxss = Util.null2String(workTimeBeLateItems.get(0).get("zzdjbxss"));
//加班时长自动转入假期余额
String jbzdzjqye= Util.null2String(workTimeBeLateItems.get(0).get("jbzdzjqye"));
//最小加班分钟数
String jbqsfzs = Util.null2String(workTimeBeLateItems.get(0).get("jbqsfzs"));
//超出最小时长后的单次累加分钟数
String ccqszhdhsfzs = Util.null2String(workTimeBeLateItems.get(0).get("ccqszhdhsfzs"));
//核算量
double workOverTimeHsl = Double.valueOf(Util.null2String(workTimeBeLateItems.get(0).get("hsl")));
//核算单位
String workOverTimeHsdw = Util.null2String(workTimeBeLateItems.get(0).get("hsdw"));
if (CheckBoxEnum.CHECKED.getKey().equals(tqdkjrjb)){
/**
*
*/
if (CheckBoxEnum.CHECKED.getKey().equals(ksjbbxydk)){
Map<String,Object> clcokInTimeData = clcokInTimeMap.get(dtkssj);
String signTime = clcokInTimeData.get("signdate")+" "+clcokInTimeData.get("signtime");
if (DateUtil.getTime(signTime).compareTo(DateUtil.getTime(dtkssj)) < 0){
dtkssj = signTime;
}
realityStartTime = signTime;
}else {
realityStartTime = kssj;
}
if (CheckBoxEnum.CHECKED.getKey().equals(thdkjrjb)){
if (CheckBoxEnum.CHECKED.getKey().equals(jsjbbxydk)){
Map<String,Object> clcokInTimeData = clcokInTimeMap.get(dtjssj);
String signTime = clcokInTimeData.get("signdate")+" "+clcokInTimeData.get("signtime");
if (DateUtil.getTime(signTime).compareTo(DateUtil.getTime(dtjssj)) > 0){
dtjssj = signTime;
realityEndime = signTime;
}else {
realityEndime= jssj;
}
jbsc = jbsc*60;
if (CheckBoxEnum.CHECKED.getKey().equals(tqdkjrjb)){
//提前打卡开始的时长计入加班
if (DateUtil.getTime(realityStartTime).compareTo(DateUtil.getTime(kssj)) <0){
jbsc +=DateUtil.getBetWeenMinutes(realityStartTime,kssj);
}
}
if (CheckBoxEnum.CHECKED.getKey().equals(thdkjrjb)){
// 推后打卡结束的时长计入加班
if (DateUtil.getTime(realityEndime).compareTo(DateUtil.getTime(jssj)) >0){
jbsc +=DateUtil.getBetWeenMinutes(jssj,realityEndime);
}
}
/**
*
*/
List<Map<String,Object>> beLateAbnormal = abnormalClockInList.stream().filter(e->e.get("pointTime").toString().split(" ")[1].equals(dtkssj)).collect(Collectors.toList());
double beLateTime = 0;
if (beLateAbnormal.size() >0){
String hsdw = Util.null2String(beLateAbnormal.get(0).get("hsdw"));
String itemduration = Util.null2String(beLateAbnormal.get(0).get("itemduration"));
AttendanceItemTypeEnum itemType = (AttendanceItemTypeEnum)beLateAbnormal.get(0).get("itemType");
if (itemType == AttendanceItemTypeEnum.MISSE_CARD){
//早上漏卡
beLateTime = jbsc;
}else {
if (AccountingUnitEnum.DAY.getKey().equals(hsdw)){
beLateTime = Integer.valueOf(scheduleMap.get("edsc").toString()) * Double.valueOf(itemduration);
}else if (AccountingUnitEnum.HOUR.getKey().equals(hsdw)){
beLateTime = Double.valueOf(itemduration)*60;
}else if (AccountingUnitEnum.MINUTES.getKey().equals(hsdw)){
beLateTime = Double.valueOf(itemduration);
}else if (AccountingUnitEnum.ONCE.getKey().equals(hsdw)){
beLateTime = jbsc;
}
}
}else {
if (DateUtil.getTime(realityStartTime).compareTo(DateUtil.getTime(kssj)) >0){
beLateTime = DateUtil.getBetWeenMinutes(kssj,realityStartTime);
}
}
/**
* 退,退
*/
List<Map<String,Object>> leaveEarlyAbnormal = abnormalClockInList.stream().filter(e->e.get("pointTime").toString().split(" ")[1].equals(dtjssj)).collect(Collectors.toList());
double leaveElaryTime=0;
if (leaveEarlyAbnormal.size() > 0){
String hsdw = Util.null2String(beLateAbnormal.get(0).get("hsdw"));
String itemduration = Util.null2String(beLateAbnormal.get(0).get("itemduration"));
AttendanceItemTypeEnum itemType = (AttendanceItemTypeEnum)beLateAbnormal.get(0).get("itemType");
if (itemType == AttendanceItemTypeEnum.MISSE_CARD){
//下午漏卡
leaveElaryTime = jbsc;
}else {
if (AccountingUnitEnum.DAY.getKey().equals(hsdw)){
leaveElaryTime = Integer.valueOf(scheduleMap.get("edsc").toString()) * Double.valueOf(itemduration);
}else if (AccountingUnitEnum.HOUR.getKey().equals(hsdw)){
leaveElaryTime = Double.valueOf(itemduration)*60;
}else if (AccountingUnitEnum.MINUTES.getKey().equals(hsdw)){
leaveElaryTime = Double.valueOf(itemduration);
}else if (AccountingUnitEnum.ONCE.getKey().equals(hsdw)){
leaveElaryTime = jbsc;
}
}
}else {
if (DateUtil.getTime(realityEndime).compareTo(DateUtil.getTime(jssj)) <0){
leaveElaryTime = DateUtil.getBetWeenMinutes(realityEndime,jssj);
}
}
/**
*
*/
int askForLeaveTime = removeAskForLeave(realityStartTime,realityEndime,Util.null2String(getWorkOverTimeParam.get("workfor"))
,bdlx,evectionList,askForLeaveItems,offsetAskForLeaveAnomaly);
/**
*
*/
int evectionTime = removeEvection(realityStartTime,realityEndime,Util.null2String(getWorkOverTimeParam.get("workfor"))
,bdlx,askForLeaveList,evectionItems,offsetEvectionAnomaly);
log.info("加班时长: {}",jbsc);
log.info("beLateTime :[{}],leaveElaryTime :[{}],askForLeaveTime:[{}],evectionTime:[{}]",beLateTime,leaveElaryTime,askForLeaveTime,evectionTime);
BigDecimal jbscbig = new BigDecimal(jbsc);
jbsc = jbscbig.subtract(new BigDecimal(beLateTime)).subtract(new BigDecimal(leaveElaryTime)).subtract(new BigDecimal(askForLeaveTime)).subtract(new BigDecimal(evectionTime)).intValue();
log.info("jbsc :[{}]",jbsc);
if (!"".equals(jbqsfzs)){
if (jbsc < Integer.valueOf(jbqsfzs)){
//小于最小加班分钟数不算加班
continue;
}else if (jbsc >= Integer.valueOf(jbqsfzs) && !"".equals(ccqszhdhsfzs)){
jbsc = Double.valueOf(Utils.getItemdurationDown(Integer.valueOf(ccqszhdhsfzs),AccountingUnitEnum.MINUTES.getKey(),Double.valueOf(jbsc).intValue(),AccountingUnitEnum.MINUTES)).intValue();
}
}
if (jbsc < 0){
//加班时长为0
workOverTimeItems.put("item",workTimeBeLateItems.get(0).get("key"));
workOverTimeItems.put("itemduration","0");
continue;
}
//自动扣除
if ("2".equals(ccclfs) && workOverTimeResults == null){
String startDate = analysisDate.split("-")[0]+"-"+ analysisDate.split("-")[1]+"-01";
@ -144,26 +279,122 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
}
if ("2".equals(ccclfs) && !"".equals(rzdjbxss) && DateTypeEnum.WORK_DAY.getKey().equals(rqlx)){
//工作日加班最大数
maxDayTime = getWorkDayTime(workOverTimeResults,analysisDate);
}else if ("2".equals(ccclfs) && !"".equals(yzdjbxss)){
//每月最大加班数
maxWeekTime = getMonthTime(workOverTimeResults);
}else if ("2".equals(ccclfs) && !"".equals(zzdjbxss)){
double dayTime = getWorkDayTime(workOverTimeResults,analysisDate) *60;
double maxDayTime = Double.valueOf(rzdjbxss) *60;
double time = jbsc+dayTime;
if (time > maxDayTime){
jbsc = maxDayTime-dayTime;
}
}
if ("2".equals(ccclfs) && !"".equals(zzdjbxss)){
//每周最大加班小时数
maxMonthTime = getWeekTime(workOverTimeResults,analysisDate);
double weekTime = getWeekTime(workOverTimeResults,analysisDate);
double maxWeekTime = Double.valueOf(zzdjbxss) *60;
double time = jbsc+weekTime;
if (time > maxWeekTime){
jbsc = maxWeekTime-weekTime;
}
}
if ("2".equals(ccclfs) && !"".equals(yzdjbxss)){
//每月最大加班数
double monthTime = getMonthTime(workOverTimeResults);
double maxMonthTime = Double.valueOf(yzdjbxss) *60;
double time = jbsc+monthTime;
if (time > maxMonthTime){
jbsc = maxMonthTime-monthTime;
}
}
if (CheckBoxEnum.CHECKED.getKey().equals(jbscbdccsqsc)){
if (jbsc > Integer.valueOf(Util.null2String(scheduleMap.get("jbsc")))*60){
jbsc = Integer.valueOf(Util.null2String(scheduleMap.get("jbsc")))*60;
}
}
log.info("最终加班时长: {}",jbsc);
workOverTimeItems.put("item",workTimeBeLateItems.get(0).get("key"));
double itemduration = Utils.getItemdurationDown(workOverTimeHsl,workOverTimeHsdw,Long.valueOf(Math.round(jbsc)).intValue(),AccountingUnitEnum.MINUTES);
workOverTimeItems.put("itemduration",itemduration);
/**
*
*/
Map<String,Object> insertParam = Maps.newHashMap();
insertParam.put("jbry",userId);
insertParam.put("sjksrq",realityStartTime.split(" ")[0]);
insertParam.put("sjkssj",realityStartTime.split(" ")[1]);
insertParam.put("sjjsrq",realityEndime.split(" ")[0]);
insertParam.put("sjjssj",realityEndime.split(" ")[1]);
insertParam.put("sjjbsc",String.format ("%.2f", jbsc/60));
insertParam.put("jbjgly","4");
insertParam.put("zt","1");
DbTools.update(CommonUtil.makeInsertSql("uf_jcl_kq_jbjg",insertParam));
/**
*
*/
//加班时长自动转入假期余额
if (CheckBoxEnum.CHECKED.getKey().equals(jbzdzjqye)){
Map<String,Object> insertHoliDayParam = Maps.newHashMap();
insertHoliDayParam.put("ygid",userId);
insertHoliDayParam.put("jqid",workTimeBeLateItems.get(0).get("zrdjb"));
//转入的假期额度生效日期
String yesxrq = Util.null2String(workTimeBeLateItems.get(0).get("yesxrq"));
if ("0".equals(yesxrq)){
//一月后
insertHoliDayParam.put("sxrq",DateUtil.lastMonth(analysisDate,DateUtil.yyyyMMdd));
}else if ("1".equals(yesxrq)){
//次月
insertHoliDayParam.put("sxrq",DateUtil.lastMonth(analysisDate)+"-01");
}else if ("2".equals(yesxrq)){
//次日
insertHoliDayParam.put("sxrq",DateUtil.AfterDay(analysisDate,1));
}
//额度可用的周期
String yekyzq = Util.null2String(workTimeBeLateItems.get(0).get("yekyzq"));
if ("0".equals(yekyzq)){
//一个月
insertHoliDayParam.put("jzrq",DateUtil.nextMonth(analysisDate,1,DateUtil.yyyyMMdd));
}else if ("1".equals(yekyzq)){
//两个月
insertHoliDayParam.put("jzrq",DateUtil.nextMonth(analysisDate,2,DateUtil.yyyyMMdd));
}else if ("2".equals(yekyzq)){
//三个月
insertHoliDayParam.put("jzrq",DateUtil.nextMonth(analysisDate,3,DateUtil.yyyyMMdd));
}else if ("3".equals(yekyzq)){
//六个月
insertHoliDayParam.put("jzrq",DateUtil.nextMonth(analysisDate,6,DateUtil.yyyyMMdd));
}else if ("4".equals(yekyzq)){
//十二个月
insertHoliDayParam.put("jzrq",DateUtil.nextMonth(analysisDate,12,DateUtil.yyyyMMdd));
}else if ("5".equals(yekyzq)){
//季度
insertHoliDayParam.put("jzrq",DateUtil.nextMonth(analysisDate,3,DateUtil.yyyyMMdd));
}else if ("6".equals(yekyzq)){
//半年
insertHoliDayParam.put("jzrq",DateUtil.nextMonth(analysisDate,6,DateUtil.yyyyMMdd));
}else if ("7".equals(yekyzq)){
//一年
insertHoliDayParam.put("jzrq",DateUtil.nextMonth(analysisDate,12,DateUtil.yyyyMMdd));
}
insertHoliDayParam.put("ktsc",String.format ("%.2f", jbsc/60));
String zdyqsc = Util.null2String(workTimeBeLateItems.get(0).get("zdyqsc"));
if ("0".equals(zdyqsc)){
//一个月
insertHoliDayParam.put("yqsxrq",DateUtil.nextMonth(analysisDate,1,DateUtil.yyyyMMdd));
}else if ("1".equals(zdyqsc)){
//两个月
insertHoliDayParam.put("yqsxrq",DateUtil.nextMonth(analysisDate,2,DateUtil.yyyyMMdd));
}else if ("2".equals(zdyqsc)){
//三个月
insertHoliDayParam.put("yqsxrq",DateUtil.nextMonth(analysisDate,3,DateUtil.yyyyMMdd));
}else if ("3".equals(zdyqsc)){
//半年
insertHoliDayParam.put("yqsxrq",DateUtil.nextMonth(analysisDate,6,DateUtil.yyyyMMdd));
}else if ("4".equals(zdyqsc)){
//一年
insertHoliDayParam.put("yqsxrq",DateUtil.nextMonth(analysisDate,12,DateUtil.yyyyMMdd));
}
DbTools.update(CommonUtil.makeInsertSql("uf_jcl_kq_kqxm",insertHoliDayParam));
}
}
@ -219,4 +450,81 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
return totalHour;
}
/**
*
* @param kssj
* @param jssj
* @param workFor
* @param askForLeaveList
* @param askForLeaveItems
* @return
*/
public int removeAskForLeave(String kssj,String jssj,String workFor,String bdlx,List<Map<String, Object>> askForLeaveList,
Map<String,Map<String,Object>> askForLeaveItems,List<Map<String, Object>> offsetAskForLeaveAnomaly ){
int employTime = 0;
for (int i=0;i<askForLeaveList.size();i++){
//请假时长
String qjsc = Util.null2String(askForLeaveList.get(i).get("qjsc"));
//请假项目
Map<String,Object> askForLeaveItem = askForLeaveItems.get(askForLeaveList.get(i).get("jqlx"));
//作用时段
String zysd = Util.null2String(askForLeaveItem.get("zysd"));
if (!zysd.contains(workFor) && !WorkForTimeEnum.ALL_TIME.getKey().equals(zysd)){
continue;
}
if ("".equals(Util.null2String(askForLeaveList.get(i).get("kssj"))) || "".equals(Util.null2String(askForLeaveList.get(i).get("jssj")))){
if (!"".equals(qjsc)){
//时长请假
if (offsetAskForLeaveAnomaly.size() > 0){
List<Map<String, Object>> list = offsetAskForLeaveAnomaly.stream().filter(e->bdlx.equals(e.get("bdlx"))).collect(Collectors.toList());
employTime += Math.round(list.size()/Double.valueOf(offsetAskForLeaveAnomaly.size()) *Double.valueOf(qjsc)*60);
}
}
}else {
//按照开始时间,结束时间请假
employTime +=Utils.getStartAndEndTime(kssj,jssj,askForLeaveList.get(i));
}
}
return employTime;
}
/**
*
* @param kssj
* @param jssj
* @param evectionList
* @return
*/
public int removeEvection(String kssj,String jssj,String workFor,String bdlx,List<Map<String, Object>> evectionList,Map<String,
Map<String,Object>> evectionItems,List<Map<String, Object>> offsetEvectionAnomaly){
int askForLeaveTime=0;
for (int i=0;i<evectionList.size();i++){
Map<String, Object> resultMap = Maps.newHashMap();
resultMap.put("item",evectionList.get(i).get("cclx"));
//请假时长
String qjsc = Util.null2String(evectionList.get(i).get("ccsc"));
//请假项目
Map<String,Object> evectionItem = evectionItems.get(evectionList.get(i).get("cclx"));
//作用时段
String zysd = Util.null2String(evectionItem.get("zysd"));
if (!zysd.contains(workFor) && !WorkForTimeEnum.ALL_TIME.getKey().equals(zysd)){
continue;
}
if ("".equals(Util.null2String(evectionList.get(i).get("kssj"))) || "".equals(Util.null2String(evectionList.get(i).get("jssj")))){
if (!"".equals(qjsc)){
if (offsetEvectionAnomaly.size() > 0){
List<Map<String, Object>> list = offsetEvectionAnomaly.stream().filter(e->bdlx.equals(e.get("bdlx"))).collect(Collectors.toList());
askForLeaveTime += Math.round(list.size()/Double.valueOf(offsetEvectionAnomaly.size()) *Double.valueOf(qjsc)*60);
}
}
}else {
//按照开始时间,结束时间请假
askForLeaveTime +=Utils.getStartAndEndTime(kssj,jssj,evectionList.get(i));
}
}
return askForLeaveTime;
}
}

@ -270,7 +270,8 @@ public class AttendanceAnalysisWrapper extends Service {
/**
* ,退
* */
*
**/
List<Map<String,Object>> abnormalClockInList = updateAttendanceResultWrapper.recordAbnormalClockIn(recordAbnormalParam);
@ -282,19 +283,23 @@ public class AttendanceAnalysisWrapper extends Service {
recordAbnormalParam.put("askForLeaveItems",askForLeaveItems);
recordAbnormalParam.put("abnormalClockInList",abnormalClockInList);
Map<String, Object> vactionMap = updateAttendanceResultWrapper.recordAskForLeave(recordAbnormalParam);
abnormalClockInList = (List<Map<String,Object>>)vactionMap.get("abnormalClockInList");
List<Map<String,Object>> abnormalClockInListByAskForLeave = (List<Map<String,Object>>)vactionMap.get("abnormalClockInList");
List<Map<String,Object>> vactionList = (List<Map<String,Object>>)vactionMap.get("resultList");
recordAbnormalParam.put("offsetAskForLeaveAnomaly",vactionMap.get("offsetAskForLeaveAnomaly"));
log.info("请假后消除的异常 : [{}]",vactionMap.get("offsetAskForLeaveAnomaly"));
/**
*
*/
recordAbnormalParam.put("evectionList",evectionList);
recordAbnormalParam.put("evectionItems",evectionItems);
recordAbnormalParam.put("abnormalClockInList",abnormalClockInList);
recordAbnormalParam.put("abnormalClockInList",abnormalClockInListByAskForLeave);
Map<String, Object> recordEvection= updateAttendanceResultWrapper.recordEvection(recordAbnormalParam);
abnormalClockInList = (List<Map<String,Object>>)recordEvection.get("abnormalClockInList");
List<Map<String,Object>> abnormalClockInListByEvction = (List<Map<String,Object>>)recordEvection.get("abnormalClockInList");
List<Map<String,Object>> evectionResultList = (List<Map<String,Object>>)recordEvection.get("resultList");
recordAbnormalParam.put("abnormalClockInList",abnormalClockInListByEvction);
recordAbnormalParam.put("offsetEvectionAnomaly",recordEvection.get("offsetEvectionAnomaly"));
log.info("出差外出后消除的异常 : [{}]",recordEvection.get("offsetEvectionAnomaly"));
/**
*
*/
@ -307,11 +312,11 @@ public class AttendanceAnalysisWrapper extends Service {
List<Map<String,Object>> recordData = Lists.newArrayList();
recordData.addAll(vactionList);
recordData.addAll(evectionResultList);
recordData.addAll(abnormalClockInList);
recordData.addAll(abnormalClockInListByEvction);
recordParam.put("recordData",recordData);
recordParam.put("recordDataTime",utilService.getNeedRecordClockInTime(clcokInTimeData));
log.info("recordParam : {}",recordParam);
if (abnormalClockInList.size()>0){
if (abnormalClockInListByEvction.size()>0){
recordParam.put("cqzt",CheckBoxEnum.CHECKED.getKey());
}else {
recordParam.put("cqzt",CheckBoxEnum.UNCHECKED.getKey());

@ -83,6 +83,7 @@ public class UpdateAttendanceResultWrapper extends Service {
List<Map<String,Object>> iforgetClockIn = forgetClockInService.forgetClockIn(missCardParams);
if (iforgetClockIn.size() >0){
iforgetClockIn.get(0).put("pointTime",pointTime);
iforgetClockIn.get(0).put("bdlx",classInfo.get("bdlx"));
resultList.add(iforgetClockIn.get(0));
}
@ -99,6 +100,7 @@ public class UpdateAttendanceResultWrapper extends Service {
List<Map<String,Object>> ifBeLate = beLateService.beLate(beLateParams);
if (ifBeLate.size() > 0){
ifBeLate.get(0).put("pointTime",pointTime);
ifBeLate.get(0).put("bdlx",classInfo.get("bdlx"));
resultList.add(ifBeLate.get(0));
}
}else if (ClockPointEnum.END.getKey().equals(pointType) && ClockPointEnum.BEFORE.getKey().equals(timeType)){
@ -114,6 +116,7 @@ public class UpdateAttendanceResultWrapper extends Service {
List<Map<String,Object>> ifLeaveEarly = beLateService.leaveEarly(leaveEarlyParams);
if (ifLeaveEarly.size() > 0){
ifLeaveEarly.get(0).put("pointTime",pointTime);
ifLeaveEarly.get(0).put("bdlx",classInfo.get("bdlx"));
resultList.add(ifLeaveEarly.get(0));
}
}
@ -152,7 +155,8 @@ public class UpdateAttendanceResultWrapper extends Service {
List<Map<String, Object>> askForLeaveList = (List<Map<String,Object>>)params.get("askForLeaveList");
//异常记录
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)params.get("abnormalClockInList");
//请假抵消异常
List<Map<String,Object>> offsetAskForLeaveAnomaly = Lists.newArrayList();
Map<String, Object> map = Maps.newHashMap();
List<Map<String, Object>> resultList = Lists.newArrayList();
@ -180,7 +184,6 @@ public class UpdateAttendanceResultWrapper extends Service {
Map<String,Object> param = Maps.newHashMap();
param.put("abnormalClockInList",abnormalClockInList);
double itemduration = 0;
if ("".equals(Util.null2String(askForLeaveList.get(i).get("kssj"))) || "".equals(Util.null2String(askForLeaveList.get(i).get("jssj")))){
//弹性请假,半天请假
@ -195,7 +198,9 @@ public class UpdateAttendanceResultWrapper extends Service {
param.put("qjsc",qjsc);
param.put("tybcndbjlhbjs",tybcndbjlhbjs);
if (abnormalClockInList.size()>0){
abnormalClockInList =askForLeaveService.askForLeaveByDurationTime(param);
Map<String,Object> map1 = askForLeaveService.askForLeaveByDurationTime(param);
abnormalClockInList =(List<Map<String,Object>>)map1.get("abnormalClockInList");
offsetAskForLeaveAnomaly.addAll((List<Map<String,Object>>)map1.get("offsetAskForLeaveAnomaly"));
}
}
}else {
@ -210,12 +215,15 @@ public class UpdateAttendanceResultWrapper extends Service {
param.put("kssj",kssj);
param.put("jssj",jssj);
if (abnormalClockInList.size()>0){
abnormalClockInList = askForLeaveService.askForLeaveByTime(param);
Map<String,Object> map1 = askForLeaveService.askForLeaveByTime(param);
abnormalClockInList = (List<Map<String,Object>>)map1.get("abnormalClockInList");
offsetAskForLeaveAnomaly.addAll((List<Map<String,Object>>)map1.get("offsetAskForLeaveAnomaly"));
}
}
}
map.put("resultList",resultList);
map.put("abnormalClockInList",abnormalClockInList);
map.put("offsetAskForLeaveAnomaly",offsetAskForLeaveAnomaly);
return map;
}
@ -236,7 +244,8 @@ public class UpdateAttendanceResultWrapper extends Service {
List<Map<String, Object>> evectionList = (List<Map<String,Object>>)params.get("evectionList");
//异常记录
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)params.get("abnormalClockInList");
//外出抵消异常
List<Map<String,Object>> offsetEvectionAnomaly = Lists.newArrayList();
Map<String, Object> map = Maps.newHashMap();
List<Map<String, Object>> resultList = Lists.newArrayList();
@ -279,7 +288,9 @@ public class UpdateAttendanceResultWrapper extends Service {
param.put("ccsc",qjsc);
param.put("tybcndbjlhbjs",tybcndbjlhbjs);
if (abnormalClockInList.size()>0){
abnormalClockInList =evectionService.evectionByDurationTime(param);
Map<String,Object> map1 =evectionService.evectionByDurationTime(param);
abnormalClockInList = (List<Map<String,Object>>)map1.get("abnormalClockInList");
offsetEvectionAnomaly.addAll((List<Map<String,Object>>)map1.get("offsetEvectionAnomaly"));
}
}
}else {
@ -294,12 +305,15 @@ public class UpdateAttendanceResultWrapper extends Service {
param.put("kssj",kssj);
param.put("jssj",jssj);
if (abnormalClockInList.size()>0){
abnormalClockInList = evectionService.evectionByTime(param);
Map<String,Object> map1 = evectionService.evectionByTime(param);
abnormalClockInList = (List<Map<String,Object>>)map1.get("abnormalClockInList");
offsetEvectionAnomaly.addAll((List<Map<String,Object>>)map1.get("offsetEvectionAnomaly"));
}
}
}
map.put("resultList",resultList);
map.put("abnormalClockInList",abnormalClockInList);
map.put("offsetEvectionAnomaly",offsetEvectionAnomaly);
return map;
}

@ -11,7 +11,8 @@ public enum AttendanceItemTypeEnum implements BaseEnum {
EVECTION("5","出差"),
PUNCH_IN_AGAIN("6","补打卡"),
ALLOWANCE("7","津贴"),
OTHER("8","其他");
OTHER("8","其他"),
MISSE_CARD("9","漏打卡");
private String key;
private String value;

@ -14,14 +14,24 @@ public class DateUtil {
public static DateTimeFormatter yyyyMM = DateTimeFormatter.ofPattern("yyyy-MM");
public static String beforeMonth(String time){
LocalDateTime localDateTime = LocalDate.parse(time, yyyyMMdd).atStartOfDay();
LocalDateTime localDateTime = DateUtil.getTime(time);
return localDateTime.minusMonths(1).format(yyyyMM);
}
public static String lastMonth(String time){
LocalDateTime localDateTime = LocalDate.parse(time, yyyyMMdd).atStartOfDay();
LocalDateTime localDateTime = DateUtil.getTime(time);
return localDateTime.plusMonths(1).format(yyyyMM);
}
public static String lastMonth(String time,DateTimeFormatter dateTimeFormatter){
LocalDateTime localDateTime = DateUtil.getTime(time);
return localDateTime.plusMonths(1).format(dateTimeFormatter);
}
public static String nextMonth(String time,int month,DateTimeFormatter dateTimeFormatter){
LocalDateTime localDateTime = DateUtil.getTime(time);
return localDateTime.plusMonths(month).format(dateTimeFormatter);
}
public static String beforeDay(String time,long day){
@ -73,10 +83,8 @@ public class DateUtil {
public static LocalDateTime getTime(String time){
int length = time.length();
switch (length){
case 7:
return LocalDateTime.parse(time, yyyyMM);
case 10:
return LocalDateTime.parse(time, yyyyMMdd);
return LocalDate.parse(time, yyyyMMdd).atStartOfDay();
case 19:
return LocalDateTime.parse(time, yyyyMMddHHmmss);
case 16:

@ -15,6 +15,7 @@ public class DbTools {
public static List<Map<String,Object>> getSqlToList(String sql,Object...value){
RecordSet rs = thread.get();
List<Map<String,Object>> result = new ArrayList<>();
if (value == null || value.length <=0 || "".equals(value)){
rs.executeQuery(sql);

@ -1,6 +1,7 @@
package com.engine.common.util;
import com.engine.attendance.enums.AccountingUnitEnum;
import com.engine.attendance.enums.CheckBoxEnum;
import com.engine.attendance.enums.ClassSegmentTypeEnum;
import com.engine.attendance.enums.ClockPointEnum;
import com.google.common.collect.Maps;
@ -393,13 +394,13 @@ public class Utils<T> {
betweenMinutes = betweenMinutes - DateUtil.getBetWeenMinutes(dtkssj,dtjssj);
log.info("休息时间在请假时间中间");
}else if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(dtkssj)) <=0 && DateUtil.getTime(jssj).compareTo(DateUtil.getTime(dtjssj)) <=0 && DateUtil.getTime(jssj).compareTo(DateUtil.getTime(dtkssj)) >=0){
//休息时间在请假时间
//休息时间在请假时间
betweenMinutes = betweenMinutes - DateUtil.getBetWeenMinutes(dtkssj,jssj);
log.info("休息时间在请假时间 边");
log.info("休息时间在请假时间 边");
}else if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(dtkssj)) >=0 && DateUtil.getTime(jssj).compareTo(DateUtil.getTime(dtjssj)) >=0 && DateUtil.getTime(kssj).compareTo(DateUtil.getTime(dtjssj)) <=0){
//休息时间在请假时间
//休息时间在请假时间
betweenMinutes = betweenMinutes - DateUtil.getBetWeenMinutes(kssj,dtjssj);
log.info("休息时间在请假时间 边");
log.info("休息时间在请假时间 边");
}else if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(dtkssj)) >=0 && DateUtil.getTime(jssj).compareTo(DateUtil.getTime(dtjssj)) <=0){
//请假时间在休息时间中间
betweenMinutes = 0;
@ -411,4 +412,32 @@ public class Utils<T> {
return betweenMinutes;
}
/**
*
* @return
*/
public static int getStartAndEndTime(String kssj,String jssj,Map<String, Object> leaveMap){
String leavekssj = leaveMap.get("ksrq") + " "+leaveMap.get("kssj");
String leavejssj = leaveMap.get("jsrq")+ " "+leaveMap.get("jssj");
int betweenMinutes=0;
if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(leavekssj)) <=0 && DateUtil.getTime(jssj).compareTo(DateUtil.getTime(leavejssj)) >=0){
//请假外出时间在中间
betweenMinutes = DateUtil.getBetWeenMinutes(leavekssj,leavejssj);
log.info("请假外出时间在中间");
}else if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(leavekssj)) <=0 && DateUtil.getTime(jssj).compareTo(DateUtil.getTime(leavejssj)) <=0 && DateUtil.getTime(jssj).compareTo(DateUtil.getTime(leavekssj)) >=0){
//请假外出时间 右边
betweenMinutes = DateUtil.getBetWeenMinutes(leavekssj,jssj);
log.info("请假外出时间 右边");
}else if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(leavekssj)) >=0 && DateUtil.getTime(jssj).compareTo(DateUtil.getTime(leavejssj)) >=0 && DateUtil.getTime(kssj).compareTo(DateUtil.getTime(leavejssj)) <=0){
//休请假外出时间 左边
betweenMinutes = DateUtil.getBetWeenMinutes(kssj,leavejssj);
log.info("请假外出时间 左边");
}else if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(leavekssj)) >=0 && DateUtil.getTime(jssj).compareTo(DateUtil.getTime(leavejssj)) <=0){
//请假外出时间中间
betweenMinutes = 0;
log.info("加班实际在请假外出时间中间");
}
return betweenMinutes;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -18,6 +18,8 @@ import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@ -180,11 +182,24 @@ public class Test {
// System.out.println(lists2);
//
// System.out.println(Double.valueOf("1.00").intValue()*60);
String analysisDate = "2023-11-22";
// String analysisDate = "2023-11-22";
// List<String> lists = Lists.newArrayList();
// lists.add("aa");
// lists.add("aa");
// lists.add("bb");
// List<String> lists2 = lists.stream().filter(e->e.equals("aa")).collect(Collectors.toList());
// System.out.println(lists.size());
// System.out.println(lists2.size());
BigDecimal s = new BigDecimal(110.0);
System.out.println(String.format ("%.2f", 1.8333));
System.out.println(DateUtil.lastMonth("2023-11-23",DateUtil.yyyyMMdd));
//System.out.println(Utils.getItemdurationDown(15,AccountingUnitEnum.MINUTES.getKey(),59,AccountingUnitEnum.MINUTES));
// Calendar calendar = Calendar.getInstance();
// calendar.set(Integer.valueOf(analysisDate.split("-")[0]), Integer.valueOf(analysisDate.split("-")[1]) - 1, 1);
int day = TimeUtil.getDayOfWeek(analysisDate);
System.out.println(DateUtil.AfterDay(analysisDate,0));
// int day = TimeUtil.getDayOfWeek(analysisDate);
// System.out.println(DateUtil.AfterDay(analysisDate,0));
// System.out.println(calendar.getActualMaximum(Calendar.DAY_OF_WEEK));
// List<Map<String, Object>> lists = Lists.newArrayList();

Loading…
Cancel
Save