liuliang
parent
860a825441
commit
adf1d6ce86
@ -1,8 +1,10 @@
|
||||
2023-10-24 00:28:21,221 [main] [com.engine.attendance.attendanceanalysis.cmd.AbsenteeismCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=180, xmlx=2, zysd=1, zxhsl=60}, {zdhsl=180, xmlx=2, zysd=1, zxhsl=60}, {zdhsl=60, xmlx=1, zysd=1, zxhsl=0}]]
|
||||
2023-10-24 00:29:46,847 [main] [com.engine.attendance.attendanceanalysis.cmd.AbsenteeismCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=180, xmlx=1, zysd=1, zxhsl=60}, {zdhsl=180, xmlx=2, zysd=1, zxhsl=60}, {zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-24 00:33:14,365 [main] [com.engine.attendance.attendanceanalysis.cmd.AbsenteeismCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=180, xmlx=2, zysd=1, zxhsl=60}]]
|
||||
2023-10-24 00:33:33,275 [main] [com.engine.attendance.attendanceanalysis.cmd.AbsenteeismCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-26 17:08:22,114 [main] [com.engine.attendance.attendanceanalysis.cmd.AbsenteeismCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-26 17:09:45,677 [main] [com.engine.attendance.attendanceanalysis.cmd.AbsenteeismCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-26 17:10:16,663 [main] [com.engine.attendance.attendanceanalysis.cmd.AbsenteeismCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-27 16:45:00,661 [main] [com.engine.attendance.attendanceanalysis.cmd.AbsenteeismCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-24 00:28:21,221 [main] [com.engine.attendance.attendanceanalysis.cmd.item.AbsenteeismItemCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=180, xmlx=2, zysd=1, zxhsl=60}, {zdhsl=180, xmlx=2, zysd=1, zxhsl=60}, {zdhsl=60, xmlx=1, zysd=1, zxhsl=0}]]
|
||||
2023-10-24 00:29:46,847 [main] [com.engine.attendance.attendanceanalysis.cmd.item.AbsenteeismItemCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=180, xmlx=1, zysd=1, zxhsl=60}, {zdhsl=180, xmlx=2, zysd=1, zxhsl=60}, {zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-24 00:33:14,365 [main] [com.engine.attendance.attendanceanalysis.cmd.item.AbsenteeismItemCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=180, xmlx=2, zysd=1, zxhsl=60}]]
|
||||
2023-10-24 00:33:33,275 [main] [com.engine.attendance.attendanceanalysis.cmd.item.AbsenteeismItemCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-26 17:08:22,114 [main] [com.engine.attendance.attendanceanalysis.cmd.item.AbsenteeismItemCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-26 17:09:45,677 [main] [com.engine.attendance.attendanceanalysis.cmd.item.AbsenteeismItemCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-26 17:10:16,663 [main] [com.engine.attendance.attendanceanalysis.cmd.item.AbsenteeismItemCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-10-27 16:45:00,661 [main] [com.engine.attendance.attendanceanalysis.cmd.item.AbsenteeismItemCmd] [INFO] - absenteeismCmd attendanceItems : [[{zdhsl=60, xmlx=2, zysd=1, zxhsl=0}]]
|
||||
2023-11-12 21:59:10,226 [Timer-0] [A2] [INFO] - rootPath == null
|
||||
2023-11-12 21:59:10,226 [Timer-0] [A2] [INFO] - filePath == nullWEB-INF\prop\isSyncLog4j.properties
|
||||
|
@ -1,37 +0,0 @@
|
||||
package com.engine.attendance.attendanceanalysis.cmd;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class BeLateCmd extends AbstractCommonCommand<Map<String,Object>> {
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
public BeLateCmd(Map<String,Object> params){
|
||||
this.params=params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
//分析人员
|
||||
String userId = Util.null2String(params.get("userId"));
|
||||
//分析日期
|
||||
String analysisDate = Util.null2String(params.get("analysisDate"));
|
||||
//打卡数据
|
||||
List<Map<String, Object>> clockInTimeList = (List<Map<String, Object>>)params.get("analysisDate");
|
||||
//班次
|
||||
List<Map<String, Object>> scheduleResult = (List<Map<String, Object>>)params.get("scheduleResult");
|
||||
//考勤项目
|
||||
List<Map<String, Object>> attendanceItems = (List<Map<String, Object>>)params.get("attendanceItems");
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package com.engine.attendance.attendanceanalysis.cmd;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class LeaveEarlyCmd extends AbstractCommonCommand<Map<String,Object>> {
|
||||
|
||||
public LeaveEarlyCmd(Map<String,Object> params){
|
||||
this.params=params;
|
||||
}
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.engine.attendance.attendanceanalysis.cmd.item;
|
||||
|
||||
import com.engine.attendance.enums.AttendanceItemTypeEnum;
|
||||
import com.engine.attendance.enums.WorkForTimeEnum;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 人员旷工项目
|
||||
*/
|
||||
@Slf4j
|
||||
public class AbsenteeismItemCmd extends AbstractCommonCommand<Map<String,Object>> {
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
public AbsenteeismItemCmd(Map<String,Object> params){
|
||||
this.params=params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
//作用时段
|
||||
String workfor = Util.null2String(params.get("workfor"));
|
||||
//旷工分钟数
|
||||
int time = Util.null2String(params.get("time")).equals("")? 0:Util.getIntValue(Util.null2String(params.get("time")));
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
||||
List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)params.get("attendanceItems");
|
||||
attendanceItems = attendanceItems.stream().filter(e -> {
|
||||
//项目类型
|
||||
String xmlx = Util.null2String(e.get("xmlx"));
|
||||
//作用时段
|
||||
String zysd = Util.null2String(e.get("zysd"));
|
||||
//最小核算分钟数(不包含)
|
||||
int zxhsl = Util.null2String(e.get("zxhsl")).equals("")?0:Util.getIntValue(Util.null2String(e.get("zxhsl")));
|
||||
//最大核算分钟数(包含)
|
||||
int zdhsl = Util.null2String(e.get("zdhsl")).equals("")?0:Util.getIntValue(Util.null2String(e.get("zdhsl")));
|
||||
|
||||
if(AttendanceItemTypeEnum.ABSENTEESIM.getKey().equals(xmlx) && (zysd.contains(workfor) || WorkForTimeEnum.ALL_TIME.getKey().equals(zysd)) && time > zxhsl && time<=zdhsl) {
|
||||
return true;
|
||||
}else if (AttendanceItemTypeEnum.ABSENTEESIM.getKey().equals(xmlx) && (zysd.contains(workfor) || WorkForTimeEnum.ALL_TIME.getKey().equals(zysd)) && zxhsl==0 && zdhsl==0){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
log.info("absenteeismCmd attendanceItems : [{}]",attendanceItems);
|
||||
resultMap.put("attendanceItems",attendanceItems);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.engine.attendance.attendanceanalysis.cmd.item;
|
||||
|
||||
import com.engine.attendance.enums.AttendanceItemTypeEnum;
|
||||
import com.engine.attendance.enums.WorkForTimeEnum;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 出差考勤项目
|
||||
*/
|
||||
@Slf4j
|
||||
public class BeAwayItemCmd extends AbstractCommonCommand<Map<String,Object>> {
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
public BeAwayItemCmd(Map<String,Object> params){
|
||||
this.params=params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
//作用时段
|
||||
String workfor = Util.null2String(params.get("workfor"));
|
||||
//考勤项目
|
||||
List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)params.get("attendanceItems");
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
attendanceItems = attendanceItems.stream().filter(e -> {
|
||||
//项目类型
|
||||
String xmlx = Util.null2String(e.get("xmlx"));
|
||||
//作用时段
|
||||
String zysd = Util.null2String(e.get("zysd"));
|
||||
|
||||
if(AttendanceItemTypeEnum.EVECTION.getKey().equals(xmlx) && (zysd.contains(workfor) || WorkForTimeEnum.ALL_TIME.getKey().equals(zysd))) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
log.info("absenteeismCmd attendanceItems : [{}]",attendanceItems);
|
||||
resultMap.put("attendanceItems",attendanceItems);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.engine.attendance.attendanceanalysis.cmd.item;
|
||||
|
||||
import com.engine.attendance.enums.AttendanceItemTypeEnum;
|
||||
import com.engine.attendance.enums.WorkForTimeEnum;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 获取早退项目
|
||||
*/
|
||||
@Slf4j
|
||||
public class LeaveEarlyItemCmd extends AbstractCommonCommand<Map<String,Object>> {
|
||||
|
||||
public LeaveEarlyItemCmd(Map<String,Object> params){
|
||||
this.params=params;
|
||||
}
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
//作用时段
|
||||
String workfor = Util.null2String(params.get("workfor"));
|
||||
//早退分钟数
|
||||
int time = Util.null2String(params.get("time")).equals("")? 0:Util.getIntValue(Util.null2String(params.get("time")));
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
||||
List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)params.get("attendanceItems");
|
||||
attendanceItems = attendanceItems.stream().filter(e -> {
|
||||
//项目类型
|
||||
String xmlx = Util.null2String(e.get("xmlx"));
|
||||
//作用时段
|
||||
String zysd = Util.null2String(e.get("zysd"));
|
||||
//最小核算分钟数(不包含)
|
||||
int zxhsl = Util.null2String(e.get("zxhsl")).equals("")?0:Util.getIntValue(Util.null2String(e.get("zxhsl")));
|
||||
//最大核算分钟数(包含)
|
||||
int zdhsl = Util.null2String(e.get("zdhsl")).equals("")?0:Util.getIntValue(Util.null2String(e.get("zdhsl")));
|
||||
|
||||
if(AttendanceItemTypeEnum.LEAVE_EARLY.getKey().equals(xmlx) && (zysd.contains(workfor) || WorkForTimeEnum.ALL_TIME.getKey().equals(zysd)) && time > zxhsl && time<=zdhsl) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
log.info("absenteeismCmd attendanceItems : [{}]",attendanceItems);
|
||||
resultMap.put("attendanceItems",attendanceItems);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.engine.attendance.attendanceanalysis.cmd.item;
|
||||
|
||||
import com.engine.attendance.enums.AttendanceItemTypeEnum;
|
||||
import com.engine.attendance.enums.WorkForTimeEnum;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 获得假期考勤项目
|
||||
*/
|
||||
@Slf4j
|
||||
public class VacationItemCmd extends AbstractCommonCommand<Map<String,Object>> {
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
public VacationItemCmd(Map<String,Object> params){
|
||||
this.params=params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
//作用时段
|
||||
String workfor = Util.null2String(params.get("workfor"));
|
||||
//考勤项目
|
||||
List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)params.get("attendanceItems");
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
attendanceItems = attendanceItems.stream().filter(e -> {
|
||||
//项目类型
|
||||
String xmlx = Util.null2String(e.get("xmlx"));
|
||||
//作用时段
|
||||
String zysd = Util.null2String(e.get("zysd"));
|
||||
|
||||
if(AttendanceItemTypeEnum.HOLIDAY.getKey().equals(xmlx) && (zysd.contains(workfor) || WorkForTimeEnum.ALL_TIME.getKey().equals(zysd))) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
log.info("absenteeismCmd attendanceItems : [{}]",attendanceItems);
|
||||
resultMap.put("attendanceItems",attendanceItems);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.engine.attendance.attendanceanalysis.cmd.item;
|
||||
|
||||
import com.engine.attendance.enums.AttendanceItemTypeEnum;
|
||||
import com.engine.attendance.enums.WorkForTimeEnum;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 获得加班项目
|
||||
*/
|
||||
@Slf4j
|
||||
public class WorkOvertimeItemCmd extends AbstractCommonCommand<Map<String,Object>> {
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
public WorkOvertimeItemCmd(Map<String,Object> params){
|
||||
this.params=params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
//作用时段
|
||||
String workfor = Util.null2String(params.get("workfor"));
|
||||
//日期类型
|
||||
String rqlx = Util.null2String(params.get("rqlx"));
|
||||
//考勤项目
|
||||
List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)params.get("attendanceItems");
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
attendanceItems = attendanceItems.stream().filter(e -> {
|
||||
//项目类型
|
||||
String xmlx = Util.null2String(e.get("xmlx"));
|
||||
//作用时段
|
||||
String zysd = Util.null2String(e.get("zysd"));
|
||||
//项目绑定的日期类型
|
||||
String bddrqlx = Util.null2String(e.get("bddrqlx"));
|
||||
|
||||
if(AttendanceItemTypeEnum.WORK_OVERTIME.getKey().equals(xmlx) && (zysd.contains(workfor) || WorkForTimeEnum.ALL_TIME.getKey().equals(zysd)) && bddrqlx.contains(rqlx)) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
log.info("absenteeismCmd attendanceItems : [{}]",attendanceItems);
|
||||
resultMap.put("attendanceItems",attendanceItems);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
}
|
@ -0,0 +1,279 @@
|
||||
package com.engine.attendance.attendanceanalysis.service.impl;
|
||||
|
||||
import com.engine.attendance.attendanceanalysis.cmd.item.*;
|
||||
import com.engine.attendance.attendanceanalysis.cmd.UpdateAttendanceResultsCmd;
|
||||
import com.engine.attendance.attendanceanalysis.service.AbnormalAttendanceService;
|
||||
import com.engine.attendance.enums.AccountingUnitEnum;
|
||||
import com.engine.attendance.enums.ClassSegmentTypeEnum;
|
||||
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;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAttendanceService {
|
||||
@Override
|
||||
public Map<String, Object> fullDayAbsenteeism(Map<String, Object> params) {
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean beLate(Map<String, Object> params) {
|
||||
//当前单条明细班次
|
||||
Map<String, Object> classInfo = (Map<String, Object>)params.get("classInfo");
|
||||
//当前单个打卡数据
|
||||
Map<String,Object> clcokInTimeData = (Map<String, Object>)params.get("clcokInTimeData");
|
||||
//考勤项目
|
||||
List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)params.get("attendanceItems");
|
||||
//班段类型
|
||||
String bdlx = Util.null2String(classInfo.get("bdlx"));
|
||||
//分析日期
|
||||
String analysisDate = Util.null2String(params.get("analysisDate"));
|
||||
//人员
|
||||
String userId = Util.null2String(params.get("userId"));
|
||||
|
||||
String clockInTime = clcokInTimeData.get("signdate")+" "+clcokInTimeData.get("signtime");
|
||||
String classStartTime = analysisDate +" "+Util.null2String(classInfo.get("dtkssj"));
|
||||
int between = DateUtil.getBetWeenMinutes(classStartTime,clockInTime);
|
||||
|
||||
Map<String,Object> lateParams = Maps.newHashMap();
|
||||
lateParams.put("attendanceItems",attendanceItems);
|
||||
lateParams.put("time",between);
|
||||
lateParams.put("rqlx",classInfo.get("rqlx"));
|
||||
|
||||
boolean ifBeLate = false;
|
||||
|
||||
if (ClassSegmentTypeEnum.WORK_TIME.getKey().equals(bdlx)){
|
||||
//工作时段
|
||||
lateParams.put("workfor",WorkForTimeEnum.WORK_TIME.getKey());
|
||||
Map<String,Object> result = commandExecutor.execute(new BeLateItemCmd(lateParams));
|
||||
List<Map<String,Object>> workTimeBeLateItems = (List<Map<String,Object>>)result.get("attendanceItems");
|
||||
if (workTimeBeLateItems.size() == 0){
|
||||
workTimeBeLateItems = (List<Map<String,Object>>)commandExecutor.execute(new AbsenteeismItemCmd(lateParams)).get("attendanceItems");
|
||||
}
|
||||
if (workTimeBeLateItems.size() > 0){
|
||||
Map<String,Object> saveWorkTimeBeLateParam = Maps.newHashMap();
|
||||
double hsl = Float.valueOf(Util.null2String(workTimeBeLateItems.get(0).get("hsl")));
|
||||
String hsdw = Util.null2String(workTimeBeLateItems.get(0).get("hsdw"));
|
||||
double itemduration = Utils.getItemduration(hsl,hsdw,between,AccountingUnitEnum.MINUTES);
|
||||
saveWorkTimeBeLateParam.put("userId",userId);
|
||||
saveWorkTimeBeLateParam.put("date",analysisDate);
|
||||
saveWorkTimeBeLateParam.put("item",workTimeBeLateItems.get(0).get("key"));
|
||||
saveWorkTimeBeLateParam.put("itemduration",itemduration);
|
||||
saveWorkTimeBeLateParam.put("classInfo", Lists.newArrayList().add(classInfo));
|
||||
saveWorkTimeBeLateParam.put("cqzt","1");
|
||||
commandExecutor.execute(new UpdateAttendanceResultsCmd(saveWorkTimeBeLateParam));
|
||||
ifBeLate=true;
|
||||
}
|
||||
|
||||
}else if (ClassSegmentTypeEnum.EXTENDED_OVERTIME.getKey().equals(bdlx) || ClassSegmentTypeEnum.EARLY_OVERTIME.getKey().equals(bdlx)
|
||||
|| ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(bdlx)){
|
||||
//加班
|
||||
if (ClassSegmentTypeEnum.EXTENDED_OVERTIME.getKey().equals(bdlx)){
|
||||
lateParams.put("workfor",WorkForTimeEnum.DELAY_TO_WORK_OVERTIME.getKey());
|
||||
}else if (ClassSegmentTypeEnum.EARLY_OVERTIME.getKey().equals(bdlx)){
|
||||
lateParams.put("workfor",WorkForTimeEnum.EARLY_TO_WORK_OVERTIME.getKey());
|
||||
}else if (ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(bdlx)){
|
||||
lateParams.put("workfor",WorkForTimeEnum.PLAN_WORK_OVERTIME.getKey());
|
||||
}
|
||||
Map<String,Object> result = commandExecutor.execute(new WorkOvertimeItemCmd(lateParams));
|
||||
List<Map<String,Object>> workTimeBeLateItems = (List<Map<String,Object>>)result.get("attendanceItems");
|
||||
if (workTimeBeLateItems.size() > 0){
|
||||
double hsl = Float.valueOf(Util.null2String(workTimeBeLateItems.get(0).get("hsl")));
|
||||
String hsdw = Util.null2String(workTimeBeLateItems.get(0).get("hsdw"));
|
||||
String jbwdhlfzs = Util.null2String(workTimeBeLateItems.get(0).get("jbwdhlfzs"));
|
||||
if (!"".equals(jbwdhlfzs) && between > Integer.valueOf(jbwdhlfzs)){
|
||||
Map<String,Object> saveWorkTimeBeLateParam = Maps.newHashMap();
|
||||
double itemduration = Utils.getItemduration(hsl,hsdw,between,AccountingUnitEnum.MINUTES);
|
||||
saveWorkTimeBeLateParam.put("userId",userId);
|
||||
saveWorkTimeBeLateParam.put("date",analysisDate);
|
||||
saveWorkTimeBeLateParam.put("item",getBeLateItems(lateParams).get(0).get("key"));
|
||||
saveWorkTimeBeLateParam.put("itemduration",itemduration);
|
||||
saveWorkTimeBeLateParam.put("classInfo", Lists.newArrayList().add(classInfo));
|
||||
saveWorkTimeBeLateParam.put("cqzt","1");
|
||||
commandExecutor.execute(new UpdateAttendanceResultsCmd(saveWorkTimeBeLateParam));
|
||||
ifBeLate=true;
|
||||
}
|
||||
}
|
||||
|
||||
}else if (ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey().equals(bdlx) || ClassSegmentTypeEnum.EVECTION.getKey().equals(bdlx)){
|
||||
//请假、出差
|
||||
Map<String,Object> result = null;
|
||||
if (ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey().equals(bdlx)){
|
||||
lateParams.put("workfor",WorkForTimeEnum.WORK_TIME.getKey());
|
||||
result = commandExecutor.execute(new VacationItemCmd(lateParams));
|
||||
}else if (ClassSegmentTypeEnum.EVECTION.getKey().equals(bdlx)){
|
||||
lateParams.put("workfor",WorkForTimeEnum.WORK_TIME.getKey());
|
||||
result = commandExecutor.execute(new BeAwayItemCmd(lateParams));
|
||||
}
|
||||
List<Map<String,Object>> workTimeBeLateItems = (List<Map<String,Object>>)result.get("attendanceItems");
|
||||
double hsl = Float.valueOf(Util.null2String(workTimeBeLateItems.get(0).get("hsl")));
|
||||
String hsdw = Util.null2String(workTimeBeLateItems.get(0).get("hsdw"));
|
||||
String thfghlfzs = Util.null2String(workTimeBeLateItems.get(0).get("thfghlfzs"));
|
||||
if (!"".equals(thfghlfzs) && between> Integer.valueOf(thfghlfzs)){
|
||||
double itemduration = Utils.getItemduration(hsl,hsdw,between,AccountingUnitEnum.MINUTES);
|
||||
Map<String,Object> saveWorkTimeBeLateParam = Maps.newHashMap();
|
||||
saveWorkTimeBeLateParam.put("userId",userId);
|
||||
saveWorkTimeBeLateParam.put("date",analysisDate);
|
||||
saveWorkTimeBeLateParam.put("item",getBeLateItems(lateParams).get(0).get("key"));
|
||||
saveWorkTimeBeLateParam.put("itemduration",itemduration);
|
||||
saveWorkTimeBeLateParam.put("classInfo", Lists.newArrayList().add(classInfo));
|
||||
saveWorkTimeBeLateParam.put("cqzt","1");
|
||||
commandExecutor.execute(new UpdateAttendanceResultsCmd(saveWorkTimeBeLateParam));
|
||||
ifBeLate=true;
|
||||
}
|
||||
}
|
||||
|
||||
return ifBeLate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean leaveEarly(Map<String, Object> params) {
|
||||
//当前单条明细班次
|
||||
Map<String, Object> classInfo = (Map<String, Object>)params.get("classInfo");
|
||||
//当前单个打卡数据
|
||||
Map<String,Object> clcokInTimeData = (Map<String, Object>)params.get("clcokInTimeData");
|
||||
//考勤项目
|
||||
List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)params.get("attendanceItems");
|
||||
//班段类型
|
||||
String bdlx = Util.null2String(classInfo.get("bdlx"));
|
||||
//分析日期
|
||||
String analysisDate = Util.null2String(params.get("analysisDate"));
|
||||
//人员
|
||||
String userId = Util.null2String(params.get("userId"));
|
||||
|
||||
String clockInTime = clcokInTimeData.get("signdate")+" "+clcokInTimeData.get("signtime");
|
||||
String dtkssj = analysisDate+" "+classInfo.get("dtkssj");
|
||||
String dtjssj = analysisDate+" "+classInfo.get("dtjssj");
|
||||
if (DateUtil.getTime(dtkssj).compareTo(DateUtil.getTime(dtjssj)) > 0){
|
||||
dtjssj = DateUtil.AfterDay(analysisDate,1) +" "+classInfo.get("dtjssj");
|
||||
}
|
||||
String classEndTime = dtjssj;
|
||||
int between = DateUtil.getBetWeenMinutes(clockInTime,classEndTime);
|
||||
|
||||
Map<String,Object> earlyParams = Maps.newHashMap();
|
||||
earlyParams.put("attendanceItems",attendanceItems);
|
||||
earlyParams.put("time",between);
|
||||
earlyParams.put("rqlx",classInfo.get("rqlx"));
|
||||
|
||||
boolean ifLeaveEarly = false;
|
||||
|
||||
if (ClassSegmentTypeEnum.WORK_TIME.getKey().equals(bdlx)){
|
||||
//工作时段
|
||||
earlyParams.put("workfor",WorkForTimeEnum.WORK_TIME.getKey());
|
||||
Map<String,Object> result = commandExecutor.execute(new LeaveEarlyItemCmd(earlyParams));
|
||||
List<Map<String,Object>> workTimeBeLateItems = (List<Map<String,Object>>)result.get("attendanceItems");
|
||||
if (workTimeBeLateItems.size() == 0){
|
||||
workTimeBeLateItems = (List<Map<String,Object>>)commandExecutor.execute(new AbsenteeismItemCmd(earlyParams)).get("attendanceItems");
|
||||
}
|
||||
if (workTimeBeLateItems.size() > 0){
|
||||
Map<String,Object> saveWorkTimeBeLateParam = Maps.newHashMap();
|
||||
double hsl = Float.valueOf(Util.null2String(workTimeBeLateItems.get(0).get("hsl")));
|
||||
String hsdw = Util.null2String(workTimeBeLateItems.get(0).get("hsdw"));
|
||||
double itemduration = Utils.getItemduration(hsl,hsdw,between,AccountingUnitEnum.MINUTES);
|
||||
saveWorkTimeBeLateParam.put("userId",userId);
|
||||
saveWorkTimeBeLateParam.put("date",analysisDate);
|
||||
saveWorkTimeBeLateParam.put("item",getBeEarlyItems(earlyParams).get(0).get("key"));
|
||||
saveWorkTimeBeLateParam.put("itemduration",itemduration);
|
||||
saveWorkTimeBeLateParam.put("classInfo", Lists.newArrayList().add(classInfo));
|
||||
saveWorkTimeBeLateParam.put("cqzt","1");
|
||||
commandExecutor.execute(new UpdateAttendanceResultsCmd(saveWorkTimeBeLateParam));
|
||||
ifLeaveEarly=true;
|
||||
}
|
||||
|
||||
}else if (ClassSegmentTypeEnum.EXTENDED_OVERTIME.getKey().equals(bdlx) || ClassSegmentTypeEnum.EARLY_OVERTIME.getKey().equals(bdlx)
|
||||
|| ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(bdlx)){
|
||||
//加班
|
||||
if (ClassSegmentTypeEnum.EXTENDED_OVERTIME.getKey().equals(bdlx)){
|
||||
earlyParams.put("workfor",WorkForTimeEnum.DELAY_TO_WORK_OVERTIME.getKey());
|
||||
}else if (ClassSegmentTypeEnum.EARLY_OVERTIME.getKey().equals(bdlx)){
|
||||
earlyParams.put("workfor",WorkForTimeEnum.EARLY_TO_WORK_OVERTIME.getKey());
|
||||
}else if (ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(bdlx)){
|
||||
earlyParams.put("workfor",WorkForTimeEnum.PLAN_WORK_OVERTIME.getKey());
|
||||
}
|
||||
Map<String,Object> result = commandExecutor.execute(new WorkOvertimeItemCmd(earlyParams));
|
||||
List<Map<String,Object>> workTimeBeLateItems = (List<Map<String,Object>>)result.get("attendanceItems");
|
||||
if (workTimeBeLateItems.size() > 0){
|
||||
double hsl = Float.valueOf(Util.null2String(workTimeBeLateItems.get(0).get("hsl")));
|
||||
String hsdw = Util.null2String(workTimeBeLateItems.get(0).get("hsdw"));
|
||||
String jbzzhlfzs = Util.null2String(workTimeBeLateItems.get(0).get("jbzzhlfzs"));
|
||||
if (!"".equals(jbzzhlfzs) && between > Integer.valueOf(jbzzhlfzs)){
|
||||
Map<String,Object> saveWorkTimeBeLateParam = Maps.newHashMap();
|
||||
double itemduration = Utils.getItemduration(hsl,hsdw,between,AccountingUnitEnum.MINUTES);
|
||||
|
||||
|
||||
saveWorkTimeBeLateParam.put("userId",userId);
|
||||
saveWorkTimeBeLateParam.put("date",analysisDate);
|
||||
saveWorkTimeBeLateParam.put("item",getBeEarlyItems(earlyParams).get(0).get("key"));
|
||||
saveWorkTimeBeLateParam.put("itemduration",itemduration);
|
||||
saveWorkTimeBeLateParam.put("classInfo", Lists.newArrayList().add(classInfo));
|
||||
saveWorkTimeBeLateParam.put("cqzt","1");
|
||||
commandExecutor.execute(new UpdateAttendanceResultsCmd(saveWorkTimeBeLateParam));
|
||||
ifLeaveEarly=true;
|
||||
}
|
||||
}
|
||||
|
||||
}else if (ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey().equals(bdlx) || ClassSegmentTypeEnum.EVECTION.getKey().equals(bdlx)){
|
||||
//请假、出差
|
||||
Map<String,Object> result = null;
|
||||
if (ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey().equals(bdlx)){
|
||||
earlyParams.put("workfor",WorkForTimeEnum.WORK_TIME.getKey());
|
||||
result = commandExecutor.execute(new VacationItemCmd(earlyParams));
|
||||
}else if (ClassSegmentTypeEnum.EVECTION.getKey().equals(bdlx)){
|
||||
earlyParams.put("workfor",WorkForTimeEnum.WORK_TIME.getKey());
|
||||
result = commandExecutor.execute(new BeAwayItemCmd(earlyParams));
|
||||
}
|
||||
List<Map<String,Object>> workTimeBeLateItems = (List<Map<String,Object>>)result.get("attendanceItems");
|
||||
double hsl = Float.valueOf(Util.null2String(workTimeBeLateItems.get(0).get("hsl")));
|
||||
String hsdw = Util.null2String(workTimeBeLateItems.get(0).get("hsdw"));
|
||||
String tqlghlfzs = Util.null2String(workTimeBeLateItems.get(0).get("tqlghlfzs"));
|
||||
if (!"".equals(tqlghlfzs) && between> Integer.valueOf(tqlghlfzs)){
|
||||
double itemduration = Utils.getItemduration(hsl,hsdw,between,AccountingUnitEnum.MINUTES);
|
||||
Map<String,Object> saveWorkTimeBeLateParam = Maps.newHashMap();
|
||||
saveWorkTimeBeLateParam.put("userId",userId);
|
||||
saveWorkTimeBeLateParam.put("date",analysisDate);
|
||||
saveWorkTimeBeLateParam.put("item",getBeEarlyItems(earlyParams).get(0).get("key"));
|
||||
saveWorkTimeBeLateParam.put("itemduration",itemduration);
|
||||
saveWorkTimeBeLateParam.put("classInfo", Lists.newArrayList().add(classInfo));
|
||||
saveWorkTimeBeLateParam.put("cqzt","1");
|
||||
commandExecutor.execute(new UpdateAttendanceResultsCmd(saveWorkTimeBeLateParam));
|
||||
ifLeaveEarly=true;
|
||||
}
|
||||
}
|
||||
|
||||
return ifLeaveEarly;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得迟到项目
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getBeLateItems(Map<String,Object> lateParams){
|
||||
Map<String,Object> result = commandExecutor.execute(new BeLateItemCmd(lateParams));
|
||||
List<Map<String,Object>> workTimeBeLateItems = (List<Map<String,Object>>)result.get("attendanceItems");
|
||||
if (workTimeBeLateItems.size() == 0){
|
||||
workTimeBeLateItems = (List<Map<String,Object>>)commandExecutor.execute(new AbsenteeismItemCmd(lateParams)).get("attendanceItems");
|
||||
}
|
||||
return workTimeBeLateItems;
|
||||
}
|
||||
/**
|
||||
* 获得早退项目
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getBeEarlyItems(Map<String,Object> earlyParams){
|
||||
Map<String,Object> result = commandExecutor.execute(new LeaveEarlyItemCmd(earlyParams));
|
||||
List<Map<String,Object>> workTimeBeLateItems = (List<Map<String,Object>>)result.get("attendanceItems");
|
||||
if (workTimeBeLateItems.size() == 0){
|
||||
workTimeBeLateItems = (List<Map<String,Object>>)commandExecutor.execute(new AbsenteeismItemCmd(earlyParams)).get("attendanceItems");
|
||||
}
|
||||
return workTimeBeLateItems;
|
||||
}
|
||||
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package com.engine.attendance.attendanceanalysis.service.impl;
|
||||
|
||||
import com.engine.attendance.attendanceanalysis.service.BeLateService;
|
||||
import com.engine.core.impl.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class BeLateServiceImpl extends Service implements BeLateService {
|
||||
@Override
|
||||
public Map<String, Object> fullDayAbsenteeism(Map<String, Object> params) {
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean beLate(Map<String, Object> params) {
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean leaveEarly(Map<String, Object> params) {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.engine.attendance.enums;
|
||||
|
||||
import com.finance.toolkit.BaseEnum;
|
||||
|
||||
/**
|
||||
* 核算单位
|
||||
*/
|
||||
public enum AccountingUnitEnum implements BaseEnum {
|
||||
DAY("0","天"),
|
||||
HOUR("1","小时"),
|
||||
MINUTES("2","分钟"),
|
||||
ONCE("3","次");
|
||||
AccountingUnitEnum(String key, String value){
|
||||
this.key=key;
|
||||
this.value=value;
|
||||
}
|
||||
private String key;
|
||||
private String value;
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.engine.attendance.enums;
|
||||
|
||||
import com.finance.toolkit.BaseEnum;
|
||||
|
||||
public enum ClockPointEnum implements BaseEnum {
|
||||
|
||||
START("0","开始打卡时间点"),
|
||||
END("1","结束打卡时间点"),
|
||||
EMPTY("2","漏卡"),
|
||||
EQUAL("3","打卡时间和班次时间相等"),
|
||||
BEFORE("4","打卡时间在班次时间之前"),
|
||||
AFTER("5","打卡时间在班次时间之后");
|
||||
|
||||
private String key;
|
||||
private String value;
|
||||
|
||||
ClockPointEnum(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.
Loading…
Reference in New Issue