liuliang
parent
adf1d6ce86
commit
9c728cd1b4
Binary file not shown.
@ -0,0 +1,25 @@
|
|||||||
|
package com.engine.attendance.attendanceanalysis.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface AskForLeaveService {
|
||||||
|
/**
|
||||||
|
* 根据时间请假
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Map<String,Object>> askForLeaveByTime(Map<String,Object> param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据时长请假
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Map<String,Object>> askForLeaveByDurationTime(Map<String,Object> param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据半天请假
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean askForLeaveByHalfDay(Map<String,Object> param);
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.engine.attendance.attendanceanalysis.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface EvectionService {
|
||||||
|
/**
|
||||||
|
* 根据时间出差
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Map<String,Object>> evectionByTime(Map<String,Object> param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据时长出差
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Map<String,Object>> evectionByDurationTime(Map<String,Object> param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据半天出差
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Map<String,Object>> evectionByHalfDay(Map<String,Object> param);
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
package com.engine.attendance.attendanceanalysis.service.impl;
|
||||||
|
|
||||||
|
import c.e.c.d.b.c.e;
|
||||||
|
import com.engine.attendance.attendanceanalysis.service.AskForLeaveService;
|
||||||
|
import com.engine.attendance.enums.CheckBoxEnum;
|
||||||
|
import com.engine.common.util.DateUtil;
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public class AskForLeaveServiceImpl extends Service implements AskForLeaveService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String,Object>> askForLeaveByTime(Map<String, Object> param) {
|
||||||
|
//人员迟到、早退、漏卡等记录
|
||||||
|
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)param.get("abnormalClockInList");
|
||||||
|
//请假开始时间
|
||||||
|
String kssj = Util.null2String(param.get("kssj"));
|
||||||
|
//请假结束时间
|
||||||
|
String jssj = Util.null2String(param.get("jssj"));
|
||||||
|
|
||||||
|
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){
|
||||||
|
abnormalClockInList.remove(i);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return abnormalClockInList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean askForLeaveByHalfDay(Map<String, Object> param) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<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());
|
||||||
|
|
||||||
|
//请假时长,单位小时
|
||||||
|
int qjsc = param.get("qjsc") == null?0:Double.valueOf(Double.valueOf(param.get("qjsc").toString())*60).intValue();
|
||||||
|
//同一天可抵消多个异常
|
||||||
|
String tybcndbjlhbjs = Util.null2String(param.get("tybcndbjlhbjs"));
|
||||||
|
if (CheckBoxEnum.CHECKED.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;
|
||||||
|
abnormalClockInList.remove(i);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for (int i=abnormalClockInList.size() -1;i>=0;i--){
|
||||||
|
int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString());
|
||||||
|
if (qjsc > time){
|
||||||
|
abnormalClockInList.remove(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
abnormalClockInList.addAll(forgetClockList);
|
||||||
|
|
||||||
|
return abnormalClockInList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
|||||||
|
package com.engine.attendance.attendanceanalysis.service.impl;
|
||||||
|
|
||||||
|
import com.engine.attendance.attendanceanalysis.service.EvectionService;
|
||||||
|
import com.engine.attendance.enums.CheckBoxEnum;
|
||||||
|
import com.engine.common.util.DateUtil;
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public class EvectionServiceImpl extends Service implements EvectionService {
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> evectionByTime(Map<String, Object> param) {
|
||||||
|
//人员迟到、早退、漏卡等记录
|
||||||
|
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)param.get("abnormalClockInList");
|
||||||
|
//请假开始时间
|
||||||
|
String kssj = Util.null2String(param.get("kssj"));
|
||||||
|
//请假结束时间
|
||||||
|
String jssj = Util.null2String(param.get("jssj"));
|
||||||
|
|
||||||
|
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){
|
||||||
|
abnormalClockInList.remove(i);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return abnormalClockInList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<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());
|
||||||
|
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());
|
||||||
|
|
||||||
|
//请假时长,单位小时
|
||||||
|
int ccsc = param.get("ccsc") == null?0:Double.valueOf(Double.valueOf(param.get("ccsc").toString())*60).intValue();
|
||||||
|
//同一天可抵消多个异常
|
||||||
|
String tybcndbjlhbjs = Util.null2String(param.get("tybcndbjlhbjs"));
|
||||||
|
if (CheckBoxEnum.CHECKED.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;
|
||||||
|
abnormalClockInList.remove(i);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for (int i=abnormalClockInList.size() -1;i>=0;i--){
|
||||||
|
int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString());
|
||||||
|
if (ccsc > time){
|
||||||
|
abnormalClockInList.remove(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
abnormalClockInList.addAll(forgetClockList);
|
||||||
|
|
||||||
|
return abnormalClockInList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String,Object>> evectionByHalfDay(Map<String, Object> param) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -1,37 +1,46 @@
|
|||||||
package com.engine.attendance.attendanceanalysis.service.impl;
|
package com.engine.attendance.attendanceanalysis.service.impl;
|
||||||
|
|
||||||
import com.engine.attendance.attendanceanalysis.cmd.UpdateAttendanceResultsCmd;
|
|
||||||
import com.engine.attendance.attendanceanalysis.service.ForgetClockInService;
|
import com.engine.attendance.attendanceanalysis.service.ForgetClockInService;
|
||||||
import com.engine.attendance.enums.SystemItemEnum;
|
import com.engine.attendance.enums.SystemItemEnum;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class ForgetClockInServiceImpl extends Service implements ForgetClockInService {
|
public class ForgetClockInServiceImpl extends Service implements ForgetClockInService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean forgetClockInAllDays(Map<String, Object> params) {
|
public List<Map<String,Object>> forgetClockInAllDays() {
|
||||||
Map<String,Object> forgetParam = Maps.newHashMap();
|
Map<String,Object> forgetParam = Maps.newHashMap();
|
||||||
forgetParam.put("item", SystemItemEnum.MISSING_CLOCK_IN);
|
forgetParam.put("item", SystemItemEnum.MISSING_CLOCK_IN.getKey());
|
||||||
forgetParam.put("itemduration", 1);
|
forgetParam.put("itemduration", 1);
|
||||||
forgetParam.put("classInfo", params.get("classInfo"));
|
List<Map<String,Object>> resultList = Lists.newArrayList();
|
||||||
forgetParam.put("userId",params.get("userId"));
|
// forgetParam.put("classInfo", params.get("classInfo"));
|
||||||
forgetParam.put("date",params.get("analysisDate"));
|
// forgetParam.put("userId",params.get("userId"));
|
||||||
Map<String,Object> result = commandExecutor.execute(new UpdateAttendanceResultsCmd(forgetParam));
|
// forgetParam.put("date",params.get("analysisDate"));
|
||||||
return true;
|
// forgetParam.put("modeId",params.get("modeId"));
|
||||||
|
// log.info("userId : {} ,analysisDate: {} forgetClockInAllDays");
|
||||||
|
resultList.add(forgetParam);
|
||||||
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean forgetClockIn(Map<String, Object> params) {
|
public List<Map<String,Object>> forgetClockIn(Map<String, Object> params) {
|
||||||
|
List<Map<String,Object>> resultList = Lists.newArrayList();
|
||||||
Map<String,Object> forgetParam = Maps.newHashMap();
|
Map<String,Object> forgetParam = Maps.newHashMap();
|
||||||
forgetParam.put("item", SystemItemEnum.MISSING_CLOCK_IN);
|
forgetParam.put("item", SystemItemEnum.MISSING_CLOCK_IN.getKey());
|
||||||
forgetParam.put("itemduration", 1);
|
forgetParam.put("itemduration", 1);
|
||||||
forgetParam.put("classInfo", Lists.newArrayList().add(params.get("classInfo")));
|
// List<Map<String,Object>> classInfoList = Lists.newArrayList();
|
||||||
forgetParam.put("userId",params.get("userId"));
|
// classInfoList.add((Map<String, Object>)params.get("classInfo"));
|
||||||
forgetParam.put("date",params.get("analysisDate"));
|
// forgetParam.put("classInfo",classInfoList);
|
||||||
Map<String,Object> result = commandExecutor.execute(new UpdateAttendanceResultsCmd(forgetParam));
|
// forgetParam.put("userId",params.get("userId"));
|
||||||
return true;
|
// forgetParam.put("date",params.get("analysisDate"));
|
||||||
|
// Map<String,Object> result = commandExecutor.execute(new UpdateAttendanceResultsCmd(forgetParam));
|
||||||
|
resultList.add(forgetParam);
|
||||||
|
return resultList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.engine.attendance.enums;
|
||||||
|
|
||||||
|
import com.finance.toolkit.BaseEnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期类型
|
||||||
|
*/
|
||||||
|
public enum DateTypeEnum implements BaseEnum {
|
||||||
|
WORK_DAY("0","工作日"),
|
||||||
|
HOLIDAY("1","节假日"),
|
||||||
|
PUBLIC_RESTDAY("2","公休日"),
|
||||||
|
EXCHANGE_LEAVEDAY("3","调休日"),
|
||||||
|
CHANGECLASS("4","调班日");
|
||||||
|
|
||||||
|
private String key;
|
||||||
|
private String value;
|
||||||
|
DateTypeEnum(String key, String value){
|
||||||
|
this.key=key;
|
||||||
|
this.value=value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getKey() {
|
||||||
|
return this.key;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
}
|
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.
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.
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.
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.
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.
Loading…
Reference in New Issue