zm_dev
liuliang 2 years ago
parent c846119a7b
commit cf734e7dc3

@ -45,9 +45,9 @@ public class AbsenteeismItemCmd extends AbstractCommonCommand<Map<String,Object>
//最大核算分钟数(包含)
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) {
if(AttendanceItemTypeEnum.ABSENTEESIM.getKey().equals(xmlx) && (zysd.contains(workfor) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey())) && 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){
}else if (AttendanceItemTypeEnum.ABSENTEESIM.getKey().equals(xmlx) && (zysd.contains(workfor) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey())) && zxhsl==0 && zdhsl==0){
return true;
}else {
return false;

@ -40,7 +40,7 @@ public class BeAwayItemCmd extends AbstractCommonCommand<Map<String,Object>> {
//作用时段
String zysd = Util.null2String(e.get("zysd"));
if(AttendanceItemTypeEnum.EVECTION.getKey().equals(xmlx) && (zysd.contains(workfor) || WorkForTimeEnum.ALL_TIME.getKey().equals(zysd))) {
if(AttendanceItemTypeEnum.EVECTION.getKey().equals(xmlx) && (zysd.contains(workfor) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))) {
return true;
}else {
return false;

@ -45,7 +45,7 @@ public class BeLateItemCmd extends AbstractCommonCommand<Map<String,Object>> {
//最大核算分钟数(包含)
int zdhsl = Util.null2String(e.get("zdhsl")).equals("")?0:Util.getIntValue(Util.null2String(e.get("zdhsl")));
if(AttendanceItemTypeEnum.LATE.getKey().equals(xmlx) && (zysd.contains(workfor) || WorkForTimeEnum.ALL_TIME.getKey().equals(zysd)) && time > zxhsl && time<=zdhsl) {
if(AttendanceItemTypeEnum.LATE.getKey().equals(xmlx) && (zysd.contains(workfor) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey())) && time > zxhsl && time<=zdhsl) {
return true;
}else {
return false;

@ -46,7 +46,7 @@ public class LeaveEarlyItemCmd extends AbstractCommonCommand<Map<String,Object>>
//最大核算分钟数(包含)
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) {
if(AttendanceItemTypeEnum.LEAVE_EARLY.getKey().equals(xmlx) && (zysd.contains(workfor) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey())) && time > zxhsl && time<=zdhsl) {
return true;
}else {
return false;

@ -40,7 +40,7 @@ public class VacationItemCmd extends AbstractCommonCommand<Map<String,Object>> {
//作用时段
String zysd = Util.null2String(e.get("zysd"));
if(AttendanceItemTypeEnum.HOLIDAY.getKey().equals(xmlx) && (zysd.contains(workfor) || WorkForTimeEnum.ALL_TIME.getKey().equals(zysd))) {
if(AttendanceItemTypeEnum.HOLIDAY.getKey().equals(xmlx) && (zysd.contains(workfor) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))) {
return true;
}else {
return false;

@ -44,7 +44,7 @@ public class WorkOvertimeItemCmd extends AbstractCommonCommand<Map<String,Object
//项目绑定的日期类型
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)) {
if(AttendanceItemTypeEnum.WORK_OVERTIME.getKey().equals(xmlx) && (zysd.contains(workfor) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey())) && bddrqlx.contains(rqlx)) {
return true;
}else {
return false;

@ -2,7 +2,9 @@ package com.engine.attendance.attendanceanalysis.service.impl;
import com.engine.attendance.attendanceanalysis.service.AskForLeaveService;
import com.engine.attendance.enums.CheckBoxEnum;
import com.engine.attendance.enums.WorkForTimeEnum;
import com.engine.common.util.DateUtil;
import com.engine.common.util.Utils;
import com.engine.core.impl.Service;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@ -23,14 +25,19 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
String kssj = Util.null2String(param.get("kssj"));
//请假结束时间
String jssj = Util.null2String(param.get("jssj"));
//作用时段
String zysd = Util.null2String(param.get("zysd"));
List<Map<String,Object>> 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){
offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i));
String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx"));
if (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey())){
if (DateUtil.getTime(kssj).compareTo(DateUtil.getTime(pointTime)) <=0 &&
DateUtil.getTime(jssj).compareTo(DateUtil.getTime(pointTime)) >=0){
offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i));
}
}
}
abnormalClockInList.removeAll(offsetAskForLeaveAnomaly);
@ -58,11 +65,14 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
int qjsc = param.get("qjsc") == null?0:Double.valueOf(Double.valueOf(param.get("qjsc").toString())*60).intValue();
//同一天可抵消多个异常
String tybcndbjlhbjs = Util.null2String(param.get("tybcndbjlhbjs"));
//作用时段
String zysd = Util.null2String(param.get("zysd"));
if (CheckBoxEnum.CHECKED.getKey().equals(tybcndbjlhbjs)){
for (int i=abnormalClockInList.size() -1;i>=0;i--){
int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString());
if (qjsc >= time){
String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx"));
if (qjsc >= time && (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))){
qjsc = qjsc-time;
offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i));
}
@ -71,7 +81,8 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
}else{
for (int i=abnormalClockInList.size() -1;i>=0;i--){
int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString());
if (qjsc >= time){
String bdlx = Util.null2String(abnormalClockInList.get(i).get("bdlx"));
if (qjsc >= time && (zysd.contains(Utils.getWorkFor(bdlx)) || zysd.contains(WorkForTimeEnum.ALL_TIME.getKey()))){
offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i));
abnormalClockInList.remove(i);
break;

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

@ -509,7 +509,7 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
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)){
if (!zysd.contains(workFor) && !zysd.contains(WorkForTimeEnum.ALL_TIME.getKey())){
continue;
}
if ("".equals(Util.null2String(askForLeaveList.get(i).get("kssj"))) || "".equals(Util.null2String(askForLeaveList.get(i).get("jssj")))){

@ -204,7 +204,7 @@ public class AttendanceAnalysisWrapper extends Service {
put("dxhs",askForLeaveItem.get("thfghlfzs"));
}};
//scheduleResult.add(askForLeaveMap);
scheduleResult.add(askForLeaveMap);
if (!"".equals(Util.null2String(askForLeaveData.get("kssj"))) && !"".equals(Util.null2String(askForLeaveData.get("jssj"))) &&(CheckBoxEnum.CHECKED.getKey().equals(askForLeaveItem.get("lgsbxydk")) || CheckBoxEnum.CHECKED.getKey().equals(askForLeaveItem.get("fgsbxydk")))){
needClockInSchedule.add(askForLeaveMap);
}
@ -239,7 +239,7 @@ public class AttendanceAnalysisWrapper extends Service {
put("zddxfz",evectionItem.get("tqlghlfzs"));
put("dxhs",evectionItem.get("thfghlfzs"));
}};
//scheduleResult.add(evectionMap);
scheduleResult.add(evectionMap);
if (!"".equals(Util.null2String(evectionData.get("kssj"))) && !"".equals(Util.null2String(evectionData.get("jssj"))) && (CheckBoxEnum.CHECKED.getKey().equals(evectionItem.get("lgsbxydk")) || CheckBoxEnum.CHECKED.getKey().equals(evectionItem.get("fgsbxydk")))){
needClockInSchedule.add(evectionMap);
}

@ -177,6 +177,8 @@ public class UpdateAttendanceResultWrapper extends Service {
String zdycbcndfgzsd = Util.null2String(askForLeaveItem.get("zdycbcndfgzsd"));
//同一天可抵消多个异常
String tybcndbjlhbjs = Util.null2String(askForLeaveItem.get("tybcndbjlhbjs"));
//作用时段
String zysd = Util.null2String(askForLeaveItem.get("zysd"));
//核算量
double hsl = Double.valueOf(Util.null2String(askForLeaveItem.get("hsl")));
//核算单位
@ -184,6 +186,7 @@ public class UpdateAttendanceResultWrapper extends Service {
Map<String,Object> param = Maps.newHashMap();
param.put("abnormalClockInList",abnormalClockInList);
param.put("zysd",zysd);
double itemduration = 0;
if ("".equals(Util.null2String(askForLeaveList.get(i).get("kssj"))) || "".equals(Util.null2String(askForLeaveList.get(i).get("jssj")))){
//弹性请假,半天请假
@ -270,10 +273,12 @@ public class UpdateAttendanceResultWrapper extends Service {
double hsl = Double.valueOf(Util.null2String(evectionItem.get("hsl")));
//核算单位
String hsdw = Util.null2String(evectionItem.get("hsdw"));
//作用时间段
String zysd = Util.null2String(evectionItem.get("zysd"));
Map<String,Object> param = Maps.newHashMap();
param.put("abnormalClockInList",abnormalClockInList);
param.put("zysd",zysd);
double itemduration = 0;
if ("".equals(Util.null2String(evectionList.get(i).get("kssj"))) || "".equals(Util.null2String(evectionList.get(i).get("jssj")))){
//弹性请假,半天出差

@ -1,9 +1,6 @@
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.engine.attendance.enums.*;
import com.google.common.collect.Maps;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
@ -455,4 +452,21 @@ public class Utils<T> {
DbTools.update(CommonUtil.makeInsertSql(tableName,dataMap));
}
public static String getWorkFor(String bdlx){
String workFor="";
if (ClassSegmentTypeEnum.WORK_TIME.getKey().equals(bdlx)){
workFor = WorkForTimeEnum.WORK_TIME.getKey();
}else if (ClassSegmentTypeEnum.EXTENDED_OVERTIME.getKey().equals(bdlx)){
workFor = WorkForTimeEnum.DELAY_TO_WORK_OVERTIME.getKey();
}else if (ClassSegmentTypeEnum.EARLY_OVERTIME.getKey().equals(bdlx)){
workFor = WorkForTimeEnum.EARLY_TO_WORK_OVERTIME.getKey();
}else if (ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(bdlx)){
workFor = WorkForTimeEnum.PLAN_WORK_OVERTIME.getKey();
}else if (ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey().equals(bdlx)){
workFor = WorkForTimeEnum.LEAVE_TIME.getKey();
}else if (ClassSegmentTypeEnum.EVECTION.getKey().equals(bdlx)){
workFor = WorkForTimeEnum.EVECTION.getKey();
}
return workFor;
}
}

Loading…
Cancel
Save