加班增加当月月末,出勤分析适配出差请假流程变动

main
liuliang 5 months ago
parent 378c227b5a
commit 454f9c2c87

@ -131,20 +131,20 @@ public class GetEvectionCmd extends AbstractCommonCommand<Map<String,Object>> {
evectionGroupMap.entrySet().forEach(e->{ evectionGroupMap.entrySet().forEach(e->{
if (e.getValue().size()>1){ if (e.getValue().size()>1){
Map<String,Object> beforeEvectionMap = e.getValue().get(0); Map<String,Object> beforeEvectionMap = e.getValue().get(0);
Map<String,Object> beforeEvectionItem = collect.get(beforeEvectionMap.get("jqlx")).get(0); Map<String,Object> beforeEvectionItem = collect.get(beforeEvectionMap.get("cclx")).get(0);
String beforeJcbyxsyqjb = Util.null2String(beforeEvectionItem.get("jcbyxsyqjb")); String beforeJcbyxsyqjb = Util.null2String(beforeEvectionItem.get("jcbyxsyqjb"));
String beforeyxsydjb = Util.null2String(beforeEvectionItem.get("yxsydjb")); String beforeyxsydjb = Util.null2String(beforeEvectionItem.get("yxsydjb"));
Map<String,Object> afterEvectionMap = e.getValue().get(1); Map<String,Object> afterEvectionMap = e.getValue().get(1);
Map<String,Object> afterEvectionItem = collect.get(afterEvectionMap.get("jqlx")).get(0); Map<String,Object> afterEvectionItem = collect.get(afterEvectionMap.get("cclx")).get(0);
String afterJcbyxsyqjb = Util.null2String(afterEvectionItem.get("jcbyxsyqjb")); String afterJcbyxsyqjb = Util.null2String(afterEvectionItem.get("jcbyxsyqjb"));
String afteryxsydjb = Util.null2String(afterEvectionItem.get("yxsydjb")); String afteryxsydjb = Util.null2String(afterEvectionItem.get("yxsydjb"));
if (CheckBoxEnum.CHECKED.getKey().equals(beforeJcbyxsyqjb)){ if (CheckBoxEnum.CHECKED.getKey().equals(beforeJcbyxsyqjb)){
if (beforeyxsydjb.equals(afterEvectionMap.get("jqlx"))){ if (beforeyxsydjb.equals(afterEvectionMap.get("cclx"))){
filterEvectionList.add(beforeEvectionMap); filterEvectionList.add(beforeEvectionMap);
} }
}else if (CheckBoxEnum.CHECKED.getKey().equals(afterJcbyxsyqjb)){ }else if (CheckBoxEnum.CHECKED.getKey().equals(afterJcbyxsyqjb)){
if (afteryxsydjb.equals(beforeEvectionMap.get("jqlx"))){ if (afteryxsydjb.equals(beforeEvectionMap.get("cclx"))){
filterEvectionList.add(afterEvectionMap); filterEvectionList.add(afterEvectionMap);
} }
}else { }else {

@ -243,6 +243,9 @@ public class SaveWorkOverTimeCmd extends AbstractCommonCommand<Map<String,Object
}else if ("2".equals(yesxrq)){ }else if ("2".equals(yesxrq)){
//次日 //次日
insertHoliDayParam.put("sxrq",DateUtil.AfterDay(analysisDate,1)); insertHoliDayParam.put("sxrq",DateUtil.AfterDay(analysisDate,1));
}else if ("3".equals(yesxrq)){
//当月1号
insertHoliDayParam.put("sxrq",analysisDate.split("-")[0]+"-"+analysisDate.split("-")[1]+"-01");
} }
//额度可用的周期 //额度可用的周期
String yekyzq = Util.null2String(workTimeBeLateItems.get(0).get("yekyzq")); String yekyzq = Util.null2String(workTimeBeLateItems.get(0).get("yekyzq"));

@ -47,7 +47,7 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
Map<String,Object> leaveMap = Maps.newHashMap(); Map<String,Object> leaveMap = Maps.newHashMap();
leaveMap.put("kssj",kssj); leaveMap.put("kssj",kssj);
leaveMap.put("jssj",jssj); leaveMap.put("jssj",jssj);
int betweenTime = Integer.valueOf(betweenMinutes); int betweenTime = Double.valueOf(betweenMinutes).intValue();
int intersectionTime = Utils.getIntersectionTime(classStartTime,classEndTime,leaveMap,scheduleResult,analysisDate); int intersectionTime = Utils.getIntersectionTime(classStartTime,classEndTime,leaveMap,scheduleResult,analysisDate);
if (betweenTime <= intersectionTime){ if (betweenTime <= intersectionTime){
offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i)); offsetAskForLeaveAnomaly.add(abnormalClockInList.get(i));
@ -337,7 +337,7 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
AttendanceItemTypeEnum itemType = (AttendanceItemTypeEnum)offsetAbnormal.get("itemType"); AttendanceItemTypeEnum itemType = (AttendanceItemTypeEnum)offsetAbnormal.get("itemType");
String classStartTime = Util.null2String(offsetAbnormal.get("classStartTime")); String classStartTime = Util.null2String(offsetAbnormal.get("classStartTime"));
String classEndTime = Util.null2String(offsetAbnormal.get("classEndTime")); String classEndTime = Util.null2String(offsetAbnormal.get("classEndTime"));
if (abnormalClockInList.size() > 0){ if (abnormalClockInList.size() > 0 && !"".equals(classStartTime) && !"".equals(classEndTime)){
for (int i = abnormalClockInList.size()-1;i>=0;i--){ for (int i = abnormalClockInList.size()-1;i>=0;i--){
if (!(boolean)abnormalClockInList.get(i).get("record") && abnormalClockInList.get(i).get("itemType") == itemType && if (!(boolean)abnormalClockInList.get(i).get("record") && abnormalClockInList.get(i).get("itemType") == itemType &&
DateUtil.getTime(classStartTime).compareTo(DateUtil.getTime(abnormalClockInList.get(i).get("pointTime").toString())) <= 0 && DateUtil.getTime(classStartTime).compareTo(DateUtil.getTime(abnormalClockInList.get(i).get("pointTime").toString())) <= 0 &&

@ -44,7 +44,7 @@ public class EvectionServiceImpl extends Service implements EvectionService {
Map<String,Object> leaveMap = Maps.newHashMap(); Map<String,Object> leaveMap = Maps.newHashMap();
leaveMap.put("kssj",kssj); leaveMap.put("kssj",kssj);
leaveMap.put("jssj",jssj); leaveMap.put("jssj",jssj);
int betweenTime = Integer.valueOf(betweenMinutes); int betweenTime = Double.valueOf(betweenMinutes).intValue();
int intersectionTime = Utils.getIntersectionTime(classStartTime,classEndTime,leaveMap,scheduleResult,analysisDate); int intersectionTime = Utils.getIntersectionTime(classStartTime,classEndTime,leaveMap,scheduleResult,analysisDate);
if (betweenTime <= intersectionTime){ if (betweenTime <= intersectionTime){
offsetEvectionAnomaly.add(abnormalClockInList.get(i)); offsetEvectionAnomaly.add(abnormalClockInList.get(i));
@ -328,7 +328,7 @@ public class EvectionServiceImpl extends Service implements EvectionService {
AttendanceItemTypeEnum itemType = (AttendanceItemTypeEnum)offsetAbnormal.get("itemType"); AttendanceItemTypeEnum itemType = (AttendanceItemTypeEnum)offsetAbnormal.get("itemType");
String classStartTime = Util.null2String(offsetAbnormal.get("classStartTime")); String classStartTime = Util.null2String(offsetAbnormal.get("classStartTime"));
String classEndTime = Util.null2String(offsetAbnormal.get("classEndTime")); String classEndTime = Util.null2String(offsetAbnormal.get("classEndTime"));
if (abnormalClockInList.size() > 0){ if (abnormalClockInList.size() > 0 && !"".equals(classStartTime) && !"".equals(classEndTime)){
for (int i = abnormalClockInList.size()-1;i>=0;i--){ for (int i = abnormalClockInList.size()-1;i>=0;i--){
if (!(boolean)abnormalClockInList.get(i).get("record") && abnormalClockInList.get(i).get("itemType") == itemType && if (!(boolean)abnormalClockInList.get(i).get("record") && abnormalClockInList.get(i).get("itemType") == itemType &&
DateUtil.getTime(classStartTime).compareTo(DateUtil.getTime(abnormalClockInList.get(i).get("pointTime").toString())) <= 0 && DateUtil.getTime(classStartTime).compareTo(DateUtil.getTime(abnormalClockInList.get(i).get("pointTime").toString())) <= 0 &&

@ -35,6 +35,7 @@ public class ForgetClockInServiceImpl extends Service implements ForgetClockInSe
@Override @Override
public List<Map<String,Object>> forgetClockIn(Map<String, Object> params) { public List<Map<String,Object>> forgetClockIn(Map<String, Object> params) {
Map<String, Object> classInfo = (Map<String, Object>)params.get("classInfo"); Map<String, Object> classInfo = (Map<String, Object>)params.get("classInfo");
String analysisDate = params.get("analysisDate").toString();
//班段类型 //班段类型
String bdlx = Util.null2String(classInfo.get("bdlx")); String bdlx = Util.null2String(classInfo.get("bdlx"));
@ -47,12 +48,16 @@ public class ForgetClockInServiceImpl extends Service implements ForgetClockInSe
List<Map<String,Object>> resultList = Lists.newArrayList(); List<Map<String,Object>> resultList = Lists.newArrayList();
attendanceItems = attendanceItems.stream().filter(e->e.get("key").equals(SystemItemEnum.MISSING_CLOCK_IN.getKey())).collect(Collectors.toList()); attendanceItems = attendanceItems.stream().filter(e->e.get("key").equals(SystemItemEnum.MISSING_CLOCK_IN.getKey())).collect(Collectors.toList());
if (attendanceItems.size() > 0){ if (attendanceItems.size() > 0){
Map<String,Object> forgetParam = Maps.newHashMap(); Map<String,Object> forgetParam = Maps.newHashMap();
forgetParam.put("item", SystemItemEnum.MISSING_CLOCK_IN.getKey()); forgetParam.put("item", SystemItemEnum.MISSING_CLOCK_IN.getKey());
forgetParam.put("itemduration", 1); forgetParam.put("itemduration", 1);
forgetParam.put("itemType", AttendanceItemTypeEnum.MISSE_CARD); forgetParam.put("itemType", AttendanceItemTypeEnum.MISSE_CARD);
forgetParam.put("zysd",attendanceItems.get(0).get("zysd")); forgetParam.put("zysd",attendanceItems.get(0).get("zysd"));
forgetParam.put("kczgsc", CheckBoxEnum.CHECKED.getKey()); forgetParam.put("kczgsc", CheckBoxEnum.CHECKED.getKey());
// forgetParam.put("classStartTime",Utils.getkssjTime(classInfo,analysisDate));
//forgetParam.put("classEndTime",Utils.getjssjTime(classInfo,analysisDate));
//forgetParam.put("betweenMinutes",DateUtil.getBetWeenMinutes(forgetParam.get("classStartTime").toString(),forgetParam.get("classEndTime").toString()));
resultList.add(forgetParam); resultList.add(forgetParam);
} }
return resultList; return resultList;
@ -119,7 +124,7 @@ public class ForgetClockInServiceImpl extends Service implements ForgetClockInSe
forgotMap.put("bdlx",bdlx); forgotMap.put("bdlx",bdlx);
forgotMap.put("hsdw",hsdw); forgotMap.put("hsdw",hsdw);
forgotMap.put("kczgsc",items.get(0).get("kczgsc")); forgotMap.put("kczgsc",items.get(0).get("kczgsc"));
forgotMap.put("betweenMinutes",edfzs); forgotMap.put("betweenMinutes",Double.valueOf(edfzs).intValue());
forgotMap.put("hsl",items.get(0).get("hsl")); forgotMap.put("hsl",items.get(0).get("hsl"));
forgotMap.put("classStartTime",dtkssj); forgotMap.put("classStartTime",dtkssj);
forgotMap.put("classEndTime",dtjssj); forgotMap.put("classEndTime",dtjssj);

@ -8,6 +8,7 @@ import com.engine.jucailinkq.attendance.attendanceplan.service.impl.AttendancePl
import com.engine.jucailinkq.attendance.workflow.service.AllowanceService; import com.engine.jucailinkq.attendance.workflow.service.AllowanceService;
import com.engine.jucailinkq.attendance.workflow.service.impl.AllowanceServiceImpl; import com.engine.jucailinkq.attendance.workflow.service.impl.AllowanceServiceImpl;
import com.engine.common.util.*; import com.engine.common.util.*;
import com.engine.jucailinkq.common.exception.AttendanceRunTimeException;
import com.engine.jucailinkq.common.service.CommonService; import com.engine.jucailinkq.common.service.CommonService;
import com.engine.jucailinkq.common.service.impl.CommonServiceImpl; import com.engine.jucailinkq.common.service.impl.CommonServiceImpl;
import com.engine.jucailinkq.common.util.*; import com.engine.jucailinkq.common.util.*;
@ -48,9 +49,9 @@ public class AttendanceanalysisAction {
log.info("********AttendanceanalysisAction start********"); log.info("********AttendanceanalysisAction start********");
Map<String,Object> paramMap = ParamUtil.request2Map(request); Map<String,Object> paramMap = ParamUtil.request2Map(request);
// Map<String,Object> paramMap = Maps.newHashMap(); // Map<String,Object> paramMap = Maps.newHashMap();
// paramMap.put("startDate","2024-11-05"); // paramMap.put("startDate","2024-11-22");
// paramMap.put("endDate","2024-11-05"); // paramMap.put("endDate","2024-11-22");
// paramMap.put("userIds","82"); // paramMap.put("userIds","22");
String startDate = Util.null2String(paramMap.get("startDate")); String startDate = Util.null2String(paramMap.get("startDate"));
String startBeforeDate = DateUtil.beforeDay(startDate,2); String startBeforeDate = DateUtil.beforeDay(startDate,2);
@ -90,6 +91,7 @@ public class AttendanceanalysisAction {
if ("".equals(userIds)){ if ("".equals(userIds)){
log.info("********AttendanceanalysisAction prepare start******");
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where (type_n = 5 or type_n = 7) and changedate <> '' and changedate is not null"; String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where (type_n = 5 or type_n = 7) and changedate <> '' and changedate is not null";
//获取离职日期 //获取离职日期
List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql); List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql);
@ -133,16 +135,17 @@ public class AttendanceanalysisAction {
List<Map<String,Object>> attendaceResult = DbTools.getSqlToList(sql,startBeforeDate,endAfterDate); List<Map<String,Object>> attendaceResult = DbTools.getSqlToList(sql,startBeforeDate,endAfterDate);
Map<String,List<Map<String,Object>>> attendaceGroupById = attendaceResult.stream().collect(Collectors.groupingBy(e->e.get("ygid").toString())); Map<String,List<Map<String,Object>>> attendaceGroupById = attendaceResult.stream().collect(Collectors.groupingBy(e->e.get("ygid").toString()));
log.info("********AttendanceanalysisAction prepare end******");
int anyslsSize = 0;
for (Map<String,Object> userMap :userList){ for (Map<String,Object> userMap :userList){
anyslsSize++;
String userId = userMap.get("id").toString(); String userId = userMap.get("id").toString();
//入职日期 //入职日期
String companystartDate = Util.null2String(userMap.get("companystartdate")); String companystartDate = Util.null2String(userMap.get("companystartdate"));
//离职日期 //离职日期
String terminationDate = Util.null2String(departEmployeeMap.get(userId)); String terminationDate = Util.null2String(departEmployeeMap.get(userId));
log.info("***********analysis userId:{} start***********", userId); log.info("***********analysis userId:{},anyslsSize:{},allsize:{} start***********", userId,anyslsSize,userList.size());
//出勤结果,进出时间 //出勤结果,进出时间
Map<String,Map<String,Object>> clockInTimeMap = Maps.newHashMap(); Map<String,Map<String,Object>> clockInTimeMap = Maps.newHashMap();
@ -178,19 +181,30 @@ public class AttendanceanalysisAction {
if (leaveAndEntry.equals("1")){ if (leaveAndEntry.equals("1")){
if (("".equals(companystartDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(companystartDate))>0) if (("".equals(companystartDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(companystartDate))>0)
&& ("".equals(terminationDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(terminationDate)) <0)){ && ("".equals(terminationDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(terminationDate)) <0)){
try {
attendanceAnalysisService.attendanceAnalysisForApi(userId,date,collect.get(userId),analysisParam,clockInTimeMap,attendaceResultMap); attendanceAnalysisService.attendanceAnalysisForApi(userId,date,collect.get(userId),analysisParam,clockInTimeMap,attendaceResultMap);
}catch (Exception e){
log.info("***********analysis userId:{} date: {} error ***********", userId,date);
log.error("execute fail,catch error: [{}]",e);
}
} }
}else { }else {
if (("".equals(companystartDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(companystartDate))>=0) if (("".equals(companystartDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(companystartDate))>=0)
&& ("".equals(terminationDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(terminationDate)) <=0)){ && ("".equals(terminationDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(terminationDate)) <=0)){
try {
attendanceAnalysisService.attendanceAnalysisForApi(userId,date,collect.get(userId),analysisParam,clockInTimeMap,attendaceResultMap); attendanceAnalysisService.attendanceAnalysisForApi(userId,date,collect.get(userId),analysisParam,clockInTimeMap,attendaceResultMap);
}catch (Exception e){
log.info("***********analysis userId:{} date: {} error ***********", userId,date);
log.error("execute fail,catch error: [{}]",e);
}
} }
} }
} }
allowanceService.addAllowanceRecords(paramMap); allowanceService.addAllowanceRecords(paramMap);
} }
}else { }else {
log.info("********AttendanceanalysisAction prepare start******");
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where (type_n = 5 or type_n = 7) and changedate <> '' and changedate is not null and resourceid in ("+userIds+")"; String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where (type_n = 5 or type_n = 7) and changedate <> '' and changedate is not null and resourceid in ("+userIds+")";
//获取离职日期 //获取离职日期
List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql); List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql);
@ -239,6 +253,7 @@ public class AttendanceanalysisAction {
Map<String,List<Map<String,Object>>> attendaceGroupById = attendaceResult.stream().collect(Collectors.groupingBy(e->e.get("ygid").toString())); Map<String,List<Map<String,Object>>> attendaceGroupById = attendaceResult.stream().collect(Collectors.groupingBy(e->e.get("ygid").toString()));
log.info("********AttendanceanalysisAction prepare end******");
for (String userId : userIds.split(",")){ for (String userId : userIds.split(",")){
//入职日期 //入职日期
String companystartDate = Util.null2String(userGroupMap.get(userId).get(0).get("companystartdate")); String companystartDate = Util.null2String(userGroupMap.get(userId).get(0).get("companystartdate"));
@ -279,14 +294,30 @@ public class AttendanceanalysisAction {
if (("".equals(companystartDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(companystartDate))>0) if (("".equals(companystartDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(companystartDate))>0)
&& ("".equals(terminationDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(terminationDate)) <0)){ && ("".equals(terminationDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(terminationDate)) <0)){
log.info("***********analysis userId:{},analysisDate:{} start***********", userId, date); log.info("***********analysis userId:{},analysisDate:{} start***********", userId, date);
try {
attendanceAnalysisService.attendanceAnalysisForApi(userId,date,collect.get(userId),analysisParam,clockInTimeMap,attendaceResultMap); attendanceAnalysisService.attendanceAnalysisForApi(userId,date,collect.get(userId),analysisParam,clockInTimeMap,attendaceResultMap);
}catch (Exception e){
log.info("***********analysis userId:{} date: {} error ***********", userId,date);
log.error("execute fail,catch error: [{}]",e);
if (userIds.split(",").length ==1 && startDate.equals(endDate)){
throw new AttendanceRunTimeException("analysis error ");
}
}
} }
}else { }else {
if (("".equals(companystartDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(companystartDate))>=0) if (("".equals(companystartDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(companystartDate))>=0)
&& ("".equals(terminationDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(terminationDate)) <=0)){ && ("".equals(terminationDate) || DateUtil.getTime(date).compareTo(DateUtil.getTime(terminationDate)) <=0)){
log.info("***********analysis userId:{},analysisDate:{} start***********", userId, date); log.info("***********analysis userId:{},analysisDate:{} start***********", userId, date);
try {
attendanceAnalysisService.attendanceAnalysisForApi(userId,date,collect.get(userId),analysisParam,clockInTimeMap,attendaceResultMap); attendanceAnalysisService.attendanceAnalysisForApi(userId,date,collect.get(userId),analysisParam,clockInTimeMap,attendaceResultMap);
}catch (Exception e){
log.info("***********analysis userId:{} date: {} error ***********", userId,date);
log.error("execute fail,catch error: [{}]",e);
if (userIds.split(",").length ==1 && startDate.equals(endDate)){
throw new AttendanceRunTimeException("analysis error ");
}
}
} }
} }
} }

@ -64,6 +64,7 @@ public class AttendanceAnalysisWrapper extends Service {
for (String analysisDate :analysisDateList){ for (String analysisDate :analysisDateList){
try {
/**获得人员考勤项目*/ /**获得人员考勤项目*/
Map<String,Object> getAttendacneParamMap = Maps.newHashMap(); Map<String,Object> getAttendacneParamMap = Maps.newHashMap();
getAttendacneParamMap.put("userId",userId); getAttendacneParamMap.put("userId",userId);
@ -114,6 +115,7 @@ public class AttendanceAnalysisWrapper extends Service {
if (analysisDateAttendaceResult == null || analysisDateAttendaceResult.size() == 0 || (!CheckBoxEnum.CHECKED.getKey().equals(analysisDateAttendaceResult.get(0).get("sgsj")) && if (analysisDateAttendaceResult == null || analysisDateAttendaceResult.size() == 0 || (!CheckBoxEnum.CHECKED.getKey().equals(analysisDateAttendaceResult.get(0).get("sgsj")) &&
!"3".equals(analysisDateAttendaceResult.get(0).get("sjzt")))) { !"3".equals(analysisDateAttendaceResult.get(0).get("sjzt")))) {
/**人员换了部门,需班次、分部、部门继续走老的*/ /**人员换了部门,需班次、分部、部门继续走老的*/
if (analysisDateAttendaceResult!=null && analysisDateAttendaceResult.size() >0 && (!analysisDateAttendaceResult.get(0).get("fbid").equals(subcompanyid1) || !analysisDateAttendaceResult.get(0).get("bm").equals(departmentid))){ if (analysisDateAttendaceResult!=null && analysisDateAttendaceResult.size() >0 && (!analysisDateAttendaceResult.get(0).get("fbid").equals(subcompanyid1) || !analysisDateAttendaceResult.get(0).get("bm").equals(departmentid))){
String olddepartmentid = analysisDateAttendaceResult.get(0).get("bm").toString(); String olddepartmentid = analysisDateAttendaceResult.get(0).get("bm").toString();
String oldsubCompanyid = analysisDateAttendaceResult.get(0).get("fbid").toString(); String oldsubCompanyid = analysisDateAttendaceResult.get(0).get("fbid").toString();
@ -175,6 +177,10 @@ public class AttendanceAnalysisWrapper extends Service {
(List<Map<String,Object>>)analysisParam.get("evectionList"),(List<Map<String,Object>>)analysisParam.get("askforList")); (List<Map<String,Object>>)analysisParam.get("evectionList"),(List<Map<String,Object>>)analysisParam.get("askforList"));
clockInTimeMap.put(analysisDate, recordDataTime1); clockInTimeMap.put(analysisDate, recordDataTime1);
} }
}catch (Exception e){
log.error("AttendanceAnalysisJob userId:[{}],analysisDate: [{}]",userId,analysisDate);
log.error("AttendanceAnalysisJob error : [{}]",e);
}
} }
} }

@ -225,8 +225,6 @@ public class UpdateAttendanceResultWrapper extends Service {
String btj = Util.null2String(askForLeaveList.get(i).get("btj")); String btj = Util.null2String(askForLeaveList.get(i).get("btj"));
//请假时长 //请假时长
String qjsc = Util.null2String(askForLeaveList.get(i).get("qjsc")); String qjsc = Util.null2String(askForLeaveList.get(i).get("qjsc"));
//请假时长分钟数
int qjscMinute = "".equals(qjsc)?0:Double.valueOf(Math.ceil(Double.valueOf(qjsc)*60)).intValue();
//请假项目 //请假项目
Map<String,Object> askForLeaveItem = askForLeaveItems.get(askForLeaveList.get(i).get("jqlx")); Map<String,Object> askForLeaveItem = askForLeaveItems.get(askForLeaveList.get(i).get("jqlx"));
//自动移除时间区间内的非工作时长 //自动移除时间区间内的非工作时长
@ -239,10 +237,14 @@ public class UpdateAttendanceResultWrapper extends Service {
String zysd = Util.null2String(askForLeaveItem.get("zysd")); String zysd = Util.null2String(askForLeaveItem.get("zysd"));
//核算量 //核算量
double hsl = Double.valueOf(Util.null2String(askForLeaveItem.get("hsl"))); double hsl = Double.valueOf(Util.null2String(askForLeaveItem.get("hsl")));
//额定时长
double edsc = Double.valueOf(scheduleResult.get(0).get("edsc").toString());
//核算单位 //核算单位
String hsdw = Util.null2String(askForLeaveItem.get("hsdw")); String hsdw = Util.null2String(askForLeaveItem.get("hsdw"));
//是否分组呈现 //是否分组呈现
String sffzcx = Util.null2String(askForLeaveItem.get("sffzcx")); String sffzcx = Util.null2String(askForLeaveItem.get("sffzcx"));
//请假时长分钟数
int qjscMinute = "".equals(qjsc)?0:Double.valueOf(CommonUtil.convertToMinute(hsdw,qjsc,edsc)).intValue();
if (!sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){ if (!sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
resultMap.put("item",askForLeaveList.get(i).get("jqlx")); resultMap.put("item",askForLeaveList.get(i).get("jqlx"));
@ -421,8 +423,6 @@ public class UpdateAttendanceResultWrapper extends Service {
String btj = Util.null2String(evectionList.get(i).get("btcc")); String btj = Util.null2String(evectionList.get(i).get("btcc"));
//出差时长 //出差时长
String ccsc = Util.null2String(evectionList.get(i).get("ccsc")); String ccsc = Util.null2String(evectionList.get(i).get("ccsc"));
//出差时长分钟数
int ccscMinute = "".equals(ccsc)?0:Double.valueOf(Math.ceil(Double.valueOf(ccsc)*60)).intValue();
//请假项目 //请假项目
Map<String,Object> evectionItem = evectionItems.get(evectionList.get(i).get("cclx")); Map<String,Object> evectionItem = evectionItems.get(evectionList.get(i).get("cclx"));
//自动移除时间区间内的非工作时长 //自动移除时间区间内的非工作时长
@ -439,6 +439,10 @@ public class UpdateAttendanceResultWrapper extends Service {
String zysd = Util.null2String(evectionItem.get("zysd")); String zysd = Util.null2String(evectionItem.get("zysd"));
//是否分组呈现 //是否分组呈现
String sffzcx = Util.null2String(evectionItem.get("sffzcx")); String sffzcx = Util.null2String(evectionItem.get("sffzcx"));
//额定时长
double edsc = Double.valueOf(scheduleResult.get(0).get("edsc").toString());
//请假时长分钟数
int ccscMinute = "".equals(ccsc)?0:Double.valueOf(CommonUtil.convertToMinute(hsdw,ccsc,edsc)).intValue();
if (!sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){ if (!sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
resultList.add(resultMap); resultList.add(resultMap);

@ -458,7 +458,7 @@ public class PersongroupCommonUtil {
} }
}else if (PersonGroupListTypeEnum.SQLCONDITION.getKey().equals(list_type) && !"".equals(sqltj)){ }else if (PersonGroupListTypeEnum.SQLCONDITION.getKey().equals(list_type) && !"".equals(sqltj)){
sqltj = Utils.converSQL(sqltj); sqltj = Utils.converSQL(sqltj);
log.info("getPersonnelGroupingByPerson sqltj : [{}]",sqltj); log.info("getUserIdsByPersonnelGrouping sqltj : [{}]",sqltj);
List<Map<String,Object>> dataList = DbTools.getSqlToList(sqltj); List<Map<String,Object>> dataList = DbTools.getSqlToList(sqltj);
for (Map<String,Object> dataMap :dataList){ for (Map<String,Object> dataMap :dataList){
String hrmId = Util.null2String(dataMap.get("id")); String hrmId = Util.null2String(dataMap.get("id"));
@ -514,7 +514,7 @@ public class PersongroupCommonUtil {
} }
}else if (PersonGroupListTypeEnum.SQLCONDITION.getKey().equals(list_type) && !"".equals(sqltj)){ }else if (PersonGroupListTypeEnum.SQLCONDITION.getKey().equals(list_type) && !"".equals(sqltj)){
sqltj = Utils.converSQL(sqltj); sqltj = Utils.converSQL(sqltj);
log.info("getPersonnelGroupingByPerson sqltj : [{}]",sqltj); log.info("getUserIdsByPersonnelGrouping sqltj : [{}]",sqltj);
List<Map<String,Object>> dataList = DbTools.getSqlToList(sqltj); List<Map<String,Object>> dataList = DbTools.getSqlToList(sqltj);
for (Map<String,Object> dataMap :dataList){ for (Map<String,Object> dataMap :dataList){
String hrmId = Util.null2String(dataMap.get("id")); String hrmId = Util.null2String(dataMap.get("id"));
@ -567,7 +567,7 @@ public class PersongroupCommonUtil {
} }
}else if (PersonGroupListTypeEnum.SQLCONDITION.getKey().equals(list_type) && !"".equals(sqltj)){ }else if (PersonGroupListTypeEnum.SQLCONDITION.getKey().equals(list_type) && !"".equals(sqltj)){
sqltj = Utils.converSQL(sqltj); sqltj = Utils.converSQL(sqltj);
log.info("getPersonnelGroupingByPerson sqltj : [{}]",sqltj); log.info("getAllpersonBelongGroup sqltj : [{}]",sqltj);
List<Map<String,Object>> dataList = DbTools.getSqlToList(sqltj); List<Map<String,Object>> dataList = DbTools.getSqlToList(sqltj);
for (Map<String,Object> dataMap :dataList){ for (Map<String,Object> dataMap :dataList){
String hrmId = Util.null2String(dataMap.get("id")); String hrmId = Util.null2String(dataMap.get("id"));

@ -66,6 +66,7 @@ public class VocationServiceImpl extends Service implements VocationService {
paramMap.put("resourceId",userId); paramMap.put("resourceId",userId);
Map<String,Object> dataMap = basicsetService.getAttendanceItemsByPerson(paramMap); Map<String,Object> dataMap = basicsetService.getAttendanceItemsByPerson(paramMap);
List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)dataMap.get("data"); List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)dataMap.get("data");
Map<String,List<Map<String,Object>>> itemGroup = attendanceItems.stream().collect(Collectors.groupingBy(e->e.get("key").toString()));
Map<String, Object> needGenerateVocationMap = Maps.newHashMap(); Map<String, Object> needGenerateVocationMap = Maps.newHashMap();
for (Map<String,Object> map : attendanceItems){ for (Map<String,Object> map : attendanceItems){
if (vocationMap.get(map.get("key")) != null){ if (vocationMap.get(map.get("key")) != null){
@ -79,6 +80,7 @@ public class VocationServiceImpl extends Service implements VocationService {
vocationParam.put("userId",userId); vocationParam.put("userId",userId);
vocationParam.put("vocationList",e.getValue()); vocationParam.put("vocationList",e.getValue());
vocationParam.put("userList",userIdMap.get(userId)); vocationParam.put("userList",userIdMap.get(userId));
vocationParam.put("yxyz",itemGroup.get(e.getKey()).get(0).get("yxyz"));
vocationParam.put("releaseDate",params.get("releaseDate")); vocationParam.put("releaseDate",params.get("releaseDate"));
vocationParam.put("cover",params.get("cover")); vocationParam.put("cover",params.get("cover"));
vocationParam.put("leaveDate",departEmployeeMap.get(userId)); vocationParam.put("leaveDate",departEmployeeMap.get(userId));

@ -2,6 +2,7 @@ package com.engine.jucailinkq.common.util;
import com.engine.jucailinkq.attendance.attendanceanalysis.cmd.getclockInpoint.biz.AbstractAdjustClockPointAction; import com.engine.jucailinkq.attendance.attendanceanalysis.cmd.getclockInpoint.biz.AbstractAdjustClockPointAction;
import com.engine.jucailinkq.attendance.component.persongroup.commonutil.PersongroupCommonUtil; import com.engine.jucailinkq.attendance.component.persongroup.commonutil.PersongroupCommonUtil;
import com.engine.jucailinkq.attendance.enums.AccountingUnitEnum;
import com.engine.jucailinkq.attendance.enums.ApplicableOrganizationEnum; import com.engine.jucailinkq.attendance.enums.ApplicableOrganizationEnum;
import com.engine.jucailinkq.attendance.enums.CheckBoxEnum; import com.engine.jucailinkq.attendance.enums.CheckBoxEnum;
import com.engine.jucailinkq.attendance.enums.PersonGroupListTypeEnum; import com.engine.jucailinkq.attendance.enums.PersonGroupListTypeEnum;
@ -1316,4 +1317,27 @@ public class CommonUtil {
} }
return resultMap; return resultMap;
} }
public static double convertTohour(String hsdw,String time){
double hour = 0;
if (hsdw.equals(AccountingUnitEnum.DAY.getKey())){
hour = Double.valueOf(time)*8;
}else if (hsdw.equals(AccountingUnitEnum.HOUR.getKey())){
hour = Double.valueOf(time);
}else if (hsdw.equals(AccountingUnitEnum.MINUTES.getKey())){
hour = Double.valueOf(String.format ("%.2f", Double.valueOf(time)/60));
}
return hour;
}
public static double convertToMinute(String hsdw,String time,double edsc){
double minute = 0;
if (hsdw.equals(AccountingUnitEnum.DAY.getKey())){
minute = Double.valueOf(time)*edsc*60;
}else if (hsdw.equals(AccountingUnitEnum.HOUR.getKey())){
minute = Double.valueOf(time)*60;
}else if (hsdw.equals(AccountingUnitEnum.MINUTES.getKey())){
minute = Double.valueOf(time);
}
return minute;
}
} }

Loading…
Cancel
Save