班后加班计划调整,候选班组调整,弹性吃饭算加班时长调整

main
liuliang 4 months ago
parent 30377a2d9c
commit a327327ebb

@ -205,7 +205,7 @@ public class GetClockInTimeListCmd extends AbstractCommonCommand<Map<String,Obje
String beforeOneDay = DateUtil.beforeDay(date ,1); String beforeOneDay = DateUtil.beforeDay(date ,1);
String userId = Util.null2String(params.get("userId")); String userId = Util.null2String(params.get("userId"));
String earliestTime = date+" 00:00:00"; String earliestTime = date+" 00:00:00";
Map<String,Object> clockIntime = clockInTimeMap.get(date); Map<String,Object> clockIntime = clockInTimeMap.get(DateUtil.beforeDay(date,1));
// if (clockIntime == null || clockIntime.size() == 0){ // if (clockIntime == null || clockIntime.size() == 0){
// String sql = "select rq,j1,c1,j2,c2,j3,c3,j4,c4,j5,c5,j6,c6,j7,c7,j8,c8 from uf_jcl_kq_cqjg where ygid=? and rq>=? and rq<=?"; // String sql = "select rq,j1,c1,j2,c2,j3,c3,j4,c4,j5,c5,j6,c6,j7,c7,j8,c8 from uf_jcl_kq_cqjg where ygid=? and rq>=? and rq<=?";
// List<Map<String,Object>> attendanceResult = DbTools.getSqlToList(sql,userId,DateUtil.beforeDay(beforeOneDay,1),beforeOneDay); // List<Map<String,Object>> attendanceResult = DbTools.getSqlToList(sql,userId,DateUtil.beforeDay(beforeOneDay,1),beforeOneDay);

@ -60,6 +60,8 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
//调整加班计时间段的打卡 //调整加班计时间段的打卡
scheduleResult = adjustWorkOverTimeClock(scheduleResult,analysisDate); scheduleResult = adjustWorkOverTimeClock(scheduleResult,analysisDate);
//调整班后计划加班的打卡
scheduleResult = adjustOverTimePlanAfterWorkTimeClock(scheduleResult,analysisDate);
//调整请假出差时间段的打卡 //调整请假出差时间段的打卡
askForLeaveAndEvctionScheduleList = adjustAskforSchedule(scheduleResult,analysisDate,askForLeaveAndEvctionScheduleList); askForLeaveAndEvctionScheduleList = adjustAskforSchedule(scheduleResult,analysisDate,askForLeaveAndEvctionScheduleList);
log.debug("经过adjustWorkOverTimeClock 加班调整过后的 的scheduleResult: [{}]",scheduleResult); log.debug("经过adjustWorkOverTimeClock 加班调整过后的 的scheduleResult: [{}]",scheduleResult);
@ -646,6 +648,34 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
return newList; return newList;
} }
/**
*
* @param scheduleResult
* @param analysisDate
* @return
*/
public List<Map<String, Object>> adjustOverTimePlanAfterWorkTimeClock(List<Map<String, Object>> scheduleResult,String analysisDate){
List<Map<String, Object>> workscheduleList = scheduleResult.stream().filter(e->!Utils.ifRestClassSegment(e.get("bdlx").toString())).collect(Collectors.toList());
List<Map<String, Object>> restscheduleList = scheduleResult.stream().filter(e->Utils.ifRestClassSegment(e.get("bdlx").toString())).collect(Collectors.toList());
workscheduleList = workscheduleList.stream().sorted(Comparator.comparing(e->DateUtil.getTime(Utils.getkssjTime(e,analysisDate)).toInstant(ZoneOffset.of("+8")).toEpochMilli())).collect(Collectors.toList());
if (workscheduleList.size() >1 && ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(workscheduleList.get(workscheduleList.size()-1).get("bdlx"))
&& !ClassSegmentTypeEnum.WORK_TIME.getKey().equals(workscheduleList.get(workscheduleList.size()-1).get("beforeClassSegment"))){
Map<String, Object> lastClassScheduleMap = workscheduleList.get(workscheduleList.size()-2);
Map<String, Object> overTimeScheduleMap = workscheduleList.get(workscheduleList.size()-1);
if (CheckBoxEnum.CHECKED.getKey().equals(overTimeScheduleMap.get("jsdk")) && !ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(lastClassScheduleMap.get("bdlx"))){
overTimeScheduleMap.put("ksdk",CheckBoxEnum.UNCHECKED.getKey());
lastClassScheduleMap.put("jsdk",CheckBoxEnum.UNCHECKED.getKey());
}
}
List<Map<String, Object>> newList = Lists.newArrayList();
newList.addAll(workscheduleList);
newList.addAll(restscheduleList);
return newList;
}
/** /**
* *
* @param scheduleResult * @param scheduleResult

@ -83,6 +83,7 @@ public class GetOvertimeDurationCmd extends AbstractCommonCommand<Map<String, Ob
String kssj = Utils.getkssjTime(scheduleMap, analysisDate); String kssj = Utils.getkssjTime(scheduleMap, analysisDate);
List<ClockPointDTO> startClockPointDTO = clcokInTimeDataList.stream().filter(e->e.getPointType() == ClockPointEnum.START && List<ClockPointDTO> startClockPointDTO = clcokInTimeDataList.stream().filter(e->e.getPointType() == ClockPointEnum.START &&
DateUtil.getTime(kssj).compareTo(DateUtil.getTime(e.getClassTime())) == 0).collect(Collectors.toList()); DateUtil.getTime(kssj).compareTo(DateUtil.getTime(e.getClassTime())) == 0).collect(Collectors.toList());
//加班结束时间 //加班结束时间
String jssj = Utils.getjssjTime(scheduleMap, analysisDate); String jssj = Utils.getjssjTime(scheduleMap, analysisDate);
List<ClockPointDTO> endClockPointDTO = clcokInTimeDataList.stream().filter(e->e.getPointType() == ClockPointEnum.END && List<ClockPointDTO> endClockPointDTO = clcokInTimeDataList.stream().filter(e->e.getPointType() == ClockPointEnum.END &&
@ -274,6 +275,16 @@ public class GetOvertimeDurationCmd extends AbstractCommonCommand<Map<String, Ob
if (CheckBoxEnum.CHECKED.getKey().equals(tqdkjrjb) && CheckBoxEnum.CHECKED.getKey().equals(ksjbbxydk)) { if (CheckBoxEnum.CHECKED.getKey().equals(tqdkjrjb) && CheckBoxEnum.CHECKED.getKey().equals(ksjbbxydk)) {
//提前打卡记入分钟数 //提前打卡记入分钟数
forComputeStartTime = realityStartTime; forComputeStartTime = realityStartTime;
}else {
if (startClockPointDTO.size()>0 && startClockPointDTO.get(0).getElasticTime() != null && !startClockPointDTO.get(0).getElasticTime().equals("")){
forComputeStartTime = startClockPointDTO.get(0).getElasticTime();
}else {
forComputeStartTime = kssj;
}
}
}else {
if (startClockPointDTO.size()>0 && startClockPointDTO.get(0).getElasticTime() != null && !startClockPointDTO.get(0).getElasticTime().equals("")){
forComputeStartTime = startClockPointDTO.get(0).getElasticTime();
}else { }else {
forComputeStartTime = kssj; forComputeStartTime = kssj;
} }
@ -284,6 +295,16 @@ public class GetOvertimeDurationCmd extends AbstractCommonCommand<Map<String, Ob
//推后打卡计入分钟数 //推后打卡计入分钟数
forComputeEndTime = realityEndime; forComputeEndTime = realityEndime;
}else {
if (endClockPointDTO.size()>0 && endClockPointDTO.get(0).getElasticTime() != null && !endClockPointDTO.get(0).getElasticTime().equals("")){
forComputeEndTime = endClockPointDTO.get(0).getElasticTime();
}else {
forComputeEndTime = jssj;
}
}
}else {
if (endClockPointDTO.size()>0 && endClockPointDTO.get(0).getElasticTime() != null && !endClockPointDTO.get(0).getElasticTime().equals("")){
forComputeEndTime = endClockPointDTO.get(0).getElasticTime();
}else { }else {
forComputeEndTime = jssj; forComputeEndTime = jssj;
} }

@ -236,6 +236,13 @@ public class ShiftServiceImpl extends Service implements ShiftService {
compareMap.put("judgePartD", String.valueOf(redundantMinutes)); compareMap.put("judgePartD", String.valueOf(redundantMinutes));
compareMap.put("judgePartE", compareMap.get("priorityValue")); compareMap.put("judgePartE", compareMap.get("priorityValue"));
List<ClockPointDTO> emptyClockPointDTO = clockInTimeData.stream().filter(e->e.getTimeType()==ClockPointEnum.EMPTY).collect(Collectors.toList());
if (emptyClockPointDTO.size() == clockInTimeData.size()){
//当全为漏打卡时
compareMap.put("judgePartC","0");
}
return compareMap; return compareMap;
} }

@ -73,10 +73,12 @@ public class AttendaceActionWrapper extends Service {
CommonUtil.checkHavePermission(); CommonUtil.checkHavePermission();
if ("".equals(userIds)){ if ("".equals(userIds)){
log.info("********AttendanceanalysisAction prepare start******"); log.info("********AttendanceanalysisAction prepare start******");
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where changedate is not null"; String queryDepartEmployeeSql = "select resourceid ,changedate,type_n,newdepartmentid from HRMSTATUSHISTORY where changedate is not null";
//获取离职日期 //获取离职日期
List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql); List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql);
Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList); Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList);
Map<String,Object> transferDepartmenteeMap = CommonUtil.getTransferDepartment(departEmployeeList);
/**排班结果*/ /**排班结果*/
String querySchedulesql = "select a.id as keyid,a.* from uf_pbjg a where bcrq >=? and bcrq<=? order by bcrq"; String querySchedulesql = "select a.id as keyid,a.* from uf_pbjg a where bcrq >=? and bcrq<=? order by bcrq";
@ -156,6 +158,7 @@ public class AttendaceActionWrapper extends Service {
analysisParam.put("seclevel",Util.null2String(userMap.get("seclevel"))); analysisParam.put("seclevel",Util.null2String(userMap.get("seclevel")));
analysisParam.put("departmentId",Util.null2String(userMap.get("departmentid"))); analysisParam.put("departmentId",Util.null2String(userMap.get("departmentid")));
analysisParam.put("subCompanyId",Util.null2String(userMap.get("subcompanyid1"))); analysisParam.put("subCompanyId",Util.null2String(userMap.get("subcompanyid1")));
analysisParam.put("transferDepartmenteeMap",transferDepartmenteeMap.get(userId));
@ -189,10 +192,11 @@ public class AttendaceActionWrapper extends Service {
} }
}else { }else {
log.info("********AttendanceanalysisAction prepare start******"); log.info("********AttendanceanalysisAction prepare start******");
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where changedate is not null and resourceid in ("+userIds+")"; String queryDepartEmployeeSql = "select resourceid ,changedate,type_n,newdepartmentid from HRMSTATUSHISTORY where changedate is not null and resourceid in ("+userIds+")";
//获取离职日期 //获取离职日期
List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql); List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql);
Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList); Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList);
Map<String,Object> transferDepartmenteeMap = CommonUtil.getTransferDepartment(departEmployeeList);
/**排班结果*/ /**排班结果*/
String querySchedulesql = "select a.id as keyid,a.* from uf_pbjg a where bcrq >=? and bcrq<=? order by bcrq"; String querySchedulesql = "select a.id as keyid,a.* from uf_pbjg a where bcrq >=? and bcrq<=? order by bcrq";
@ -266,6 +270,7 @@ public class AttendaceActionWrapper extends Service {
analysisParam.put("seclevel",userGroupMap.get(userId).get(0).get("seclevel")); analysisParam.put("seclevel",userGroupMap.get(userId).get(0).get("seclevel"));
analysisParam.put("departmentId",userGroupMap.get(userId).get(0).get("departmentid")); analysisParam.put("departmentId",userGroupMap.get(userId).get(0).get("departmentid"));
analysisParam.put("subCompanyId",userGroupMap.get(userId).get(0).get("subcompanyid1")); analysisParam.put("subCompanyId",userGroupMap.get(userId).get(0).get("subcompanyid1"));
analysisParam.put("transferDepartmenteeMap",transferDepartmenteeMap.get(userId));
Map<String, List<Map<String, Object>>> attendaceResultMap = Maps.newHashMap(); Map<String, List<Map<String, Object>>> attendaceResultMap = Maps.newHashMap();

@ -8,6 +8,7 @@ import com.engine.jucailinkq.attendance.attendanceanalysis.service.impl.UtilServ
import com.engine.jucailinkq.attendance.enums.CheckBoxEnum; import com.engine.jucailinkq.attendance.enums.CheckBoxEnum;
import com.engine.jucailinkq.attendance.enums.ClassSegmentTypeEnum; import com.engine.jucailinkq.attendance.enums.ClassSegmentTypeEnum;
import com.engine.jucailinkq.attendance.enums.ClockPointEnum; import com.engine.jucailinkq.attendance.enums.ClockPointEnum;
import com.engine.jucailinkq.attendance.enums.SystemItemEnum;
import com.engine.jucailinkq.common.util.CommonUtil; import com.engine.jucailinkq.common.util.CommonUtil;
import com.engine.jucailinkq.common.util.DateUtil; import com.engine.jucailinkq.common.util.DateUtil;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
@ -55,6 +56,7 @@ public class AttendanceAnalysisWrapper extends Service {
String departmentid = Util.null2String(analysisParam.get("departmentId")); String departmentid = Util.null2String(analysisParam.get("departmentId"));
String subcompanyid1 = Util.null2String(analysisParam.get("subCompanyId")); String subcompanyid1 = Util.null2String(analysisParam.get("subCompanyId"));
Map<String,String> attendancePlanMap = (Map<String,String>)analysisParam.get("attendancePlanMap"); Map<String,String> attendancePlanMap = (Map<String,String>)analysisParam.get("attendancePlanMap");
List<Map<String,Object>> generalAttendanceItems = (List<Map<String,Object>>)analysisParam.get("generalAttendanceItems"); List<Map<String,Object>> generalAttendanceItems = (List<Map<String,Object>>)analysisParam.get("generalAttendanceItems");
Map<String,List<Map<String,Object>>> attendanceItemGroupByPlan = (Map<String,List<Map<String,Object>>>)analysisParam.get("attendanceItemGroupByPlan"); Map<String,List<Map<String,Object>>> attendanceItemGroupByPlan = (Map<String,List<Map<String,Object>>>)analysisParam.get("attendanceItemGroupByPlan");
@ -117,7 +119,7 @@ public class AttendanceAnalysisWrapper extends Service {
!"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("bm").equals(departmentid)
&& DateUtil.getTime(analysisDate).compareTo(DateUtil.getTime(DateUtil.beforeDay(DateUtil.getCurrentDate(),1))) <0){ && DateUtil.getTime(analysisDate).compareTo(DateUtil.getTime(DateUtil.beforeDay(DateUtil.getCurrentDate(),1))) <0){
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();
@ -170,6 +172,7 @@ public class AttendanceAnalysisWrapper extends Service {
getClockTimeParam.put("clockInTimeCollect", collect); getClockTimeParam.put("clockInTimeCollect", collect);
getClockTimeParam.put("schedulingResultCollect", schedulingResultsMap); getClockTimeParam.put("schedulingResultCollect", schedulingResultsMap);
getClockTimeParam.put("clockInTimeMap", clockInTimeMap); getClockTimeParam.put("clockInTimeMap", clockInTimeMap);
getClockTimeParam.put("workHourItems",workHourItems);
getClockTimeParam.put("userId", userId); getClockTimeParam.put("userId", userId);
//打卡数据 //打卡数据
@ -217,6 +220,10 @@ public class AttendanceAnalysisWrapper extends Service {
String departmentid = Util.null2String(analysisParam.get("departmentId")); String departmentid = Util.null2String(analysisParam.get("departmentId"));
String subcompanyid1 = Util.null2String(analysisParam.get("subCompanyId")); String subcompanyid1 = Util.null2String(analysisParam.get("subCompanyId"));
List<Map<String,Object>> transferDepartmenteelist = analysisParam.get("transferDepartmenteeMap")==null?Lists.newArrayList():(List<Map<String,Object>>)analysisParam.get("transferDepartmenteeMap");
transferDepartmenteelist = transferDepartmenteelist.stream().filter(e->departmentid.equals(e.get("newdepartmentid"))).sorted(Comparator.comparing(e->DateUtil.getTime(e.get("changedate").toString()).toInstant(ZoneOffset.of("+8")).toEpochMilli())).collect(Collectors.toList());
String changeDate = transferDepartmenteelist.size()>0?transferDepartmenteelist.get(transferDepartmenteelist.size()-1).get("changedate").toString():DateUtil.getCurrentDate();
/**获得人员考勤项目*/ /**获得人员考勤项目*/
@ -266,7 +273,7 @@ public class AttendanceAnalysisWrapper extends Service {
List<Map<String, Object>> analysisDateAttendanceItems =Lists.newArrayList(); List<Map<String, Object>> analysisDateAttendanceItems =Lists.newArrayList();
/**人员换了部门,需班次、分部、部门继续走老的*/ /**人员换了部门,需班次、分部、部门继续走老的*/
if (attendaceResult!=null && attendaceResult.size() >0 && (!attendaceResult.get(0).get("fbid").equals(subcompanyid1) || !attendaceResult.get(0).get("bm").equals(departmentid)) && if (attendaceResult!=null && attendaceResult.size() >0 && (!attendaceResult.get(0).get("fbid").equals(subcompanyid1) || !attendaceResult.get(0).get("bm").equals(departmentid)) &&
DateUtil.getTime(analysisDate).compareTo(DateUtil.getTime(DateUtil.getCurrentDate())) <0){ DateUtil.getTime(analysisDate).compareTo(DateUtil.getTime(changeDate)) <0){
String olddepartmentid = attendaceResult.get(0).get("bm").toString(); String olddepartmentid = attendaceResult.get(0).get("bm").toString();
String oldsubCompanyid = attendaceResult.get(0).get("fbid").toString(); String oldsubCompanyid = attendaceResult.get(0).get("fbid").toString();
@ -546,6 +553,8 @@ public class AttendanceAnalysisWrapper extends Service {
} }
//recordData.addAll(needRecordAbnormalList); //recordData.addAll(needRecordAbnormalList);
//消除非工作班段的record为false的漏卡
abnormalClockInListByEvction = abnormalClockInListByEvction.stream().filter(e->!(!(boolean) e.get("record") && SystemItemEnum.MISSING_CLOCK_IN.getKey().equals(e.get("item")) && !ClassSegmentTypeEnum.WORK_TIME.getKey().equals(e.get("bdlx")))).collect(Collectors.toList());
recordData.addAll(abnormalClockInListByEvction); recordData.addAll(abnormalClockInListByEvction);
List<Map<String, Object>> workOverTimeItemList = (List<Map<String, Object>>)recordWorkOverTime.get("workOverTimeItemList"); List<Map<String, Object>> workOverTimeItemList = (List<Map<String, Object>>)recordWorkOverTime.get("workOverTimeItemList");
if (workOverTimeItemList.size() > 0){ if (workOverTimeItemList.size() > 0){

@ -5,13 +5,12 @@ import com.engine.jucailinkq.attendance.enums.CheckBoxEnum;
import com.engine.jucailinkq.attendance.enums.QuotaChangeMethodEnum; import com.engine.jucailinkq.attendance.enums.QuotaChangeMethodEnum;
import com.engine.jucailinkq.attendance.enums.StartingUnitEnum; import com.engine.jucailinkq.attendance.enums.StartingUnitEnum;
import com.engine.jucailinkq.attendance.vacation.util.VocationCommonUtil; import com.engine.jucailinkq.attendance.vacation.util.VocationCommonUtil;
import com.engine.jucailinkq.common.exception.AttendanceRunTimeException;
import com.engine.jucailinkq.common.util.DateUtil; import com.engine.jucailinkq.common.util.DateUtil;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import weaver.general.Util; import weaver.general.Util;
import javax.swing.text.DateFormatter;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
@ -70,8 +69,6 @@ public class SinglePaymentInFullWay implements HolidayGenerationWay {
String schdedkzsxrq = Util.null2String(vocationList.get(0).get("schdedkzsxrq")); String schdedkzsxrq = Util.null2String(vocationList.get(0).get("schdedkzsxrq"));
//间隔时长算法 //间隔时长算法
String jgscsf = Util.null2String(vocationList.get(0).get("jgsc")); String jgscsf = Util.null2String(vocationList.get(0).get("jgsc"));
//累计时长单位01
String ljgldw = Util.null2String(vocationList.get(0).get("lsgldw"));
if ("".equals(qsrq)){ if ("".equals(qsrq)){
return Maps.newHashMap(); return Maps.newHashMap();
@ -100,7 +97,7 @@ public class SinglePaymentInFullWay implements HolidayGenerationWay {
Map<String, Object> insertHoliDayParam = VocationCommonUtil.getInsertHoliDayParam(vocationList.get(0), userId, qsrq, releaseDate); Map<String, Object> insertHoliDayParam = VocationCommonUtil.getInsertHoliDayParam(vocationList.get(0), userId, qsrq, releaseDate);
List<Map<String,Object>> dataList = VocationCommonUtil.ifexist("uf_jcl_kq_jqye", insertHoliDayParam); List<Map<String,Object>> dataList = VocationCommonUtil.ifexist("uf_jcl_kq_jqye", insertHoliDayParam);
// List<Map<String,Object>> dataList = new ArrayList<>(); // List<Map<String,Object>> dataList = new ArrayList<>();
//已存在数据且不覆盖 //已存在数据且不覆盖
if (dataList.size()>0 && !"1".equals(cover)) { if (dataList.size()>0 && !"1".equals(cover)) {
@ -251,44 +248,43 @@ public class SinglePaymentInFullWay implements HolidayGenerationWay {
String wscl = Util.null2String(vocationList.get(0).get("wscl")); String wscl = Util.null2String(vocationList.get(0).get("wscl"));
//间隔时长算法 //间隔时长算法
String jgscsf = Util.null2String(vocationList.get(0).get("jgsc")); String jgscsf = Util.null2String(vocationList.get(0).get("jgsc"));
//累计工龄数或者直取工龄数
int seniority = 0; int seniority = "".equals(ljcrglyfslwz)?0:Double.valueOf(ljcrglyfslwz).intValue();
//累计时长单位01
String ljgldw = Util.null2String(vocationList.get(0).get("lsgldw"));
if(!"2".equals(jgscsf)) {
//间隔时长不为直取工龄时,进行取整处理 todo:实际上累计工龄为年时 基本上都是有小数的 ,都不应该取整 ,这里的逻辑有待优化
seniority = "".equals(ljcrglyfslwz) ? 0 : Double.valueOf(ljcrglyfslwz).intValue();
}
double restTime=0.0; double restTime=0.0;
//折算 //折算
if (changeMethodEnum == QuotaChangeMethodEnum.CONVERT){ if (changeMethodEnum == QuotaChangeMethodEnum.CONVERT){
int beginYear = 0; int beginYearMonth = DateUtil.getBetWeenMonths(qsrq,sxrq);
int endYear = 0; if (beginYearMonth < 0){
String divideTime = ""; beginYearMonth = 0;
if("2".equals(jgscsf)) { }
beginYearMonth = beginYearMonth+seniority;
int endYearMonth = DateUtil.getBetWeenMonths(qsrq,nextSxrq);
endYearMonth = endYearMonth+seniority;
int beginYear = beginYearMonth/12;
int endYear = endYearMonth/12;
//残年分割日期
String divideTime = DateUtil.beforeMonth(qsrq,seniority);
//divideTime = sxrq.split("-")[0]+"-"+divideTime.split("-")[1]+"-"+divideTime.split("-")[2];
divideTime = DateUtil.nextYear(divideTime,endYear,DateUtil.yyyyMMdd);
if (jgscsf.equals("2")){
//直接取工龄字段 //直接取工龄字段
beginYear = Double.valueOf(ljcrglyfslwz).intValue(); beginYear = seniority/12;
endYear = beginYear+1; endYear = beginYear+1;
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
double divdemonths = Double.valueOf(ljcrglyfslwz) - Double.valueOf(ljcrglyfslwz).intValue(); //分割日期
divideTime = DateUtil.nextMonth(sxrq,(int)Math.ceil(divdemonths*12),dateTimeFormatter); int month = DateUtil.getBetWeenMonths(qsrq,sxrq);
//LocalDateTime localDateTime = DateUtil.getTime(sxrq); if (month < 0){
//localDateTime = localDateTime.plusMonths((int)Math.ceil(divdemonths*12)); month = 0;
//divideTime = localDateTime.format(dateTimeFormatter);
}else {
int beginYearMonth = DateUtil.getBetWeenMonths(qsrq, sxrq);
if (beginYearMonth < 0) {
beginYearMonth = 0;
} }
beginYearMonth = beginYearMonth + seniority; int historySeniority = seniority-month<0?0:seniority-month;
int endYearMonth = DateUtil.getBetWeenMonths(qsrq, nextSxrq);
endYearMonth = endYearMonth + seniority; divideTime = DateUtil.beforeMonth(qsrq,historySeniority);
beginYear = beginYearMonth / 12;
endYear = endYearMonth / 12;
//残年分割日期
divideTime = DateUtil.beforeMonth(qsrq,seniority);
divideTime = sxrq.split("-")[0]+"-"+divideTime.split("-")[1]+"-"+divideTime.split("-")[2]; divideTime = sxrq.split("-")[0]+"-"+divideTime.split("-")[1]+"-"+divideTime.split("-")[2];
} }
Map<String,Object> beginYearmap = VocationCommonUtil.getVocationMap(vocationList, beginYear, yjzd,userId); Map<String,Object> beginYearmap = VocationCommonUtil.getVocationMap(vocationList, beginYear, yjzd,userId);
Map<String,Object> endYearmap = VocationCommonUtil.getVocationMap(vocationList, endYear, yjzd,userId); Map<String,Object> endYearmap = VocationCommonUtil.getVocationMap(vocationList, endYear, yjzd,userId);
double beginEdktsc = Double.valueOf(beginYearmap.get("edktsc") == null? "0" :Util.null2String(beginYearmap.get("edktsc"))); double beginEdktsc = Double.valueOf(beginYearmap.get("edktsc") == null? "0" :Util.null2String(beginYearmap.get("edktsc")));
@ -328,12 +324,13 @@ public class SinglePaymentInFullWay implements HolidayGenerationWay {
restTime = VocationCommonUtil.handleRestDays(beforeRestTime+afterRestTime,wscl); restTime = VocationCommonUtil.handleRestDays(beforeRestTime+afterRestTime,wscl);
} }
} }
}else { }else {
//不折算 //不折算
int beginYear = 0; int beginYear = 0;
if (jgscsf.equals("2")){ if (jgscsf.equals("2")){
//直接取工龄字段 //直接取工龄字段
beginYear = Double.valueOf(ljcrglyfslwz).intValue(); beginYear = seniority/12;
}else { }else {
//起算日期与当前日期间隔+工龄字段 //起算日期与当前日期间隔+工龄字段
int beginYearMonth = DateUtil.getBetWeenMonths(qsrq,sxrq); int beginYearMonth = DateUtil.getBetWeenMonths(qsrq,sxrq);

@ -1,10 +1,7 @@
package com.engine.jucailinkq.attendance.vacation.util; package com.engine.jucailinkq.attendance.vacation.util;
import com.engine.jucailinkq.attendance.enums.*; import com.engine.jucailinkq.attendance.enums.*;
import com.engine.jucailinkq.common.util.CommonUtil; import com.engine.jucailinkq.common.util.*;
import com.engine.jucailinkq.common.util.DateUtil;
import com.engine.jucailinkq.common.util.DbTools;
import com.engine.jucailinkq.common.util.Utils;
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 lombok.extern.slf4j.Slf4j;
@ -567,8 +564,16 @@ public class VocationCommonUtil {
String jqid = Util.null2String(dataMap.get("jqid")); String jqid = Util.null2String(dataMap.get("jqid"));
String sxrq = Util.null2String(dataMap.get("sxrq")); String sxrq = Util.null2String(dataMap.get("sxrq"));
String jzrq = Util.null2String(dataMap.get("jzrq")); String jzrq = Util.null2String(dataMap.get("jzrq"));
String vacationRepeat = Util.null2String(ExtensionClassHolder.getGlobalSetMap().get("vacationRepeat"));
String sql = "select id,ffsj,ktsc,yxsc,wxsc,ztsc,zfsc,yqsc,yqyxsc,yqsxrq from "+tableName +" where lyid=? and ygid=? and jqid=? and sxrq<=? and jzrq>=?"; String sql = "select id,ffsj,ktsc,yxsc,wxsc,ztsc,zfsc,yqsc,yqyxsc,yqsxrq from "+tableName +" where lyid=? and ygid=? and jqid=? and sxrq<=? and jzrq>=?";
List<Map<String,Object>> dataList = DbTools.getSqlToList(sql,lyid,ygid,jqid,jzrq,sxrq); List<Map<String,Object>> dataList = null;
if (vacationRepeat.equals("1")){
sql = "select id,ffsj,ktsc,yxsc,wxsc,ztsc,zfsc,yqsc,yqyxsc,yqsxrq from "+tableName +" where ygid=? and jqid=? and sxrq<=? and jzrq>=?";
dataList = DbTools.getSqlToList(sql,ygid,jqid,jzrq,sxrq);
}else {
dataList = DbTools.getSqlToList(sql,lyid,ygid,jqid,jzrq,sxrq);
}
return dataList; return dataList;
} }

@ -155,6 +155,7 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
String leaveMode = Util.null2String(mainTableData.get("cxjqj")); String leaveMode = Util.null2String(mainTableData.get("cxjqj"));
String leaveType = Util.null2String(mainTableData.get("jqlx")); String leaveType = Util.null2String(mainTableData.get("jqlx"));
String dailyRepeat = Util.null2String(mainTableData.get("mtcfsdjq")); String dailyRepeat = Util.null2String(mainTableData.get("mtcfsdjq"));
String bcxx = Util.null2String(mainTableData.get("bcxx"));
//假期余额使用规则0-假别优先1-失效日期优先默认0 //假期余额使用规则0-假别优先1-失效日期优先默认0
String jqyeUsePriority = Util.null2String(mainTableData.get("yesygz")); String jqyeUsePriority = Util.null2String(mainTableData.get("yesygz"));
if ("".equals(jqyeUsePriority)) { if ("".equals(jqyeUsePriority)) {
@ -250,10 +251,10 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
Map<String, Map<String, Double>> empIdToDateRatedHours = new HashMap<>(); Map<String, Map<String, Double>> empIdToDateRatedHours = new HashMap<>();
if (leaveMode.equals(AskAndEvctionWayEnum.TIME_INTERVAL.getKey()) && !"1".equals(dailyRepeat)) { if (leaveMode.equals(AskAndEvctionWayEnum.TIME_INTERVAL.getKey()) && !"1".equals(dailyRepeat)) {
simpleLeaveDetailList = createSimpleLeaveDetailListWithNoDaily(leaveEmpIdList, leaveDateList, removeNonWorkDayRange, scheduleInfoMap, simpleLeaveDetailList = createSimpleLeaveDetailListWithNoDaily(leaveEmpIdList, leaveDateList, removeNonWorkDayRange, scheduleInfoMap,
restDayInfo, countBdlxList, hsdw, hsl, shiftInfoMap, mainTableData, empIdToDateRatedHours); restDayInfo, countBdlxList, hsdw, hsl, shiftInfoMap, mainTableData, empIdToDateRatedHours,bcxx);
} else { } else {
simpleLeaveDetailList = createSimpleLeaveDetailList(leaveEmpIdList, leaveDateList, removeNonWorkDayRange, scheduleInfoMap, simpleLeaveDetailList = createSimpleLeaveDetailList(leaveEmpIdList, leaveDateList, removeNonWorkDayRange, scheduleInfoMap,
restDayInfo, countBdlxList, hsdw, hsl, shiftInfoMap, mainTableData, empIdToDateRatedHours); restDayInfo, countBdlxList, hsdw, hsl, shiftInfoMap, mainTableData, empIdToDateRatedHours,bcxx);
} }
//收集已关联假期余额的请假明细数据 //收集已关联假期余额的请假明细数据
List<Map<String, String>> completeLeaveDetailList = new ArrayList<>(); List<Map<String, String>> completeLeaveDetailList = new ArrayList<>();
@ -438,7 +439,7 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
*/ */
private List<Map<String, String>> createSimpleLeaveDetailList(List<String> leaveEmpIdList, List<String> leaveDateList, boolean removeNonWorkDayRange, Map<String, List<Map<String, Object>>> scheduleInfoMap, private List<Map<String, String>> createSimpleLeaveDetailList(List<String> leaveEmpIdList, List<String> leaveDateList, boolean removeNonWorkDayRange, Map<String, List<Map<String, Object>>> scheduleInfoMap,
Map<String, List<String>> restDayInfo, List<String> countBdlxList, String hsdw, double hsl, Map<String, Map<String, Object>> shiftInfoMap, Map<String, List<String>> restDayInfo, List<String> countBdlxList, String hsdw, double hsl, Map<String, Map<String, Object>> shiftInfoMap,
Map<String,String> mainTableData, Map<String, Map<String, Double>> empIdToDateRatedHours) { Map<String,String> mainTableData, Map<String, Map<String, Double>> empIdToDateRatedHours,String bcxx) {
//开始时间、结束时间、请假方式、请假时长、上下午选择、开始时段、结束时段 //开始时间、结束时间、请假方式、请假时长、上下午选择、开始时段、结束时段
String startTime = Util.null2String(mainTableData.get("kssj")); String startTime = Util.null2String(mainTableData.get("kssj"));
String endTime = Util.null2String(mainTableData.get("jssj")); String endTime = Util.null2String(mainTableData.get("jssj"));
@ -478,6 +479,9 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
for (String leaveDate : leaveDateList) { for (String leaveDate : leaveDateList) {
//获取当天班次id //获取当天班次id
String currentDayBcId = restDateList.contains(leaveDate) ? "" : Util.null2String(dateToBcxxMap.get(leaveDate)).split("-")[0]; String currentDayBcId = restDateList.contains(leaveDate) ? "" : Util.null2String(dateToBcxxMap.get(leaveDate)).split("-")[0];
if ("".equals(currentDayBcId) && !"".equals(bcxx)){
currentDayBcId = bcxx;
}
if (!"".equals(currentDayBcId)) { if (!"".equals(currentDayBcId)) {
Map<String, Object> shiftInfo = shiftInfoMap.get(currentDayBcId); Map<String, Object> shiftInfo = shiftInfoMap.get(currentDayBcId);
qjscHours = shiftInfo == null ? "8" : shiftInfo.get("edsc").toString(); qjscHours = shiftInfo == null ? "8" : shiftInfo.get("edsc").toString();
@ -627,7 +631,7 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
*/ */
private List<Map<String, String>> createSimpleLeaveDetailListWithNoDaily(List<String> leaveEmpIdList, List<String> leaveDateList, boolean removeNonWorkDayRange, Map<String, List<Map<String, Object>>> scheduleInfoMap, private List<Map<String, String>> createSimpleLeaveDetailListWithNoDaily(List<String> leaveEmpIdList, List<String> leaveDateList, boolean removeNonWorkDayRange, Map<String, List<Map<String, Object>>> scheduleInfoMap,
Map<String, List<String>> restDayInfo, List<String> countBdlxList, String hsdw, double hsl, Map<String, Map<String, Object>> shiftInfoMap, Map<String, List<String>> restDayInfo, List<String> countBdlxList, String hsdw, double hsl, Map<String, Map<String, Object>> shiftInfoMap,
Map<String,String> mainTableData, Map<String, Map<String, Double>> empIdToDateRatedHours) { Map<String,String> mainTableData, Map<String, Map<String, Double>> empIdToDateRatedHours,String bcxx) {
//开始日期、结束日期、开始时间、结束时间、请假方式、请假时长、上下午选择、开始时段、结束时段 //开始日期、结束日期、开始时间、结束时间、请假方式、请假时长、上下午选择、开始时段、结束时段
String startDate = Util.null2String(mainTableData.get("ksrq")); String startDate = Util.null2String(mainTableData.get("ksrq"));
String endDate = Util.null2String(mainTableData.get("jsrq")); String endDate = Util.null2String(mainTableData.get("jsrq"));
@ -701,6 +705,9 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
simpleLeaveDetailItem.put("jssj", realEndTime); simpleLeaveDetailItem.put("jssj", realEndTime);
for (String date : leaveDateList) { for (String date : leaveDateList) {
targetDateBcId = restDateList.contains(date) ? "" : Util.null2String(dateToBcxxMap.get(date)).split("-")[0]; targetDateBcId = restDateList.contains(date) ? "" : Util.null2String(dateToBcxxMap.get(date)).split("-")[0];
if ("".equals(targetDateBcId) && !"".equals(bcxx)){
targetDateBcId = bcxx;
}
if (!"".equals(targetDateBcId)) { if (!"".equals(targetDateBcId)) {
Map<String, Object> shiftInfo = shiftInfoMap.get(targetDateBcId); Map<String, Object> shiftInfo = shiftInfoMap.get(targetDateBcId);
dateToRatedHours.put(date, Double.parseDouble(shiftInfo == null ? "8" : shiftInfo.get("edsc").toString())); dateToRatedHours.put(date, Double.parseDouble(shiftInfo == null ? "8" : shiftInfo.get("edsc").toString()));

@ -42,6 +42,7 @@ public class OvertimePlanServiceImpl extends Service implements OvertimePlanServ
String endDate = Util.null2String(mainTableData.get("jsrq")); String endDate = Util.null2String(mainTableData.get("jsrq"));
String startTime = Util.null2String(mainTableData.get("kssj")); String startTime = Util.null2String(mainTableData.get("kssj"));
String endTime = Util.null2String(mainTableData.get("jssj")); String endTime = Util.null2String(mainTableData.get("jssj"));
String jblx = Util.null2String(mainTableData.get("jblx"));
//获取加班人员列表 //获取加班人员列表
List<String> empIdList = "".equals(jbry) ? new ArrayList<>() : Arrays.asList(jbry.split(",")); List<String> empIdList = "".equals(jbry) ? new ArrayList<>() : Arrays.asList(jbry.split(","));
//获取加班日期集合 //获取加班日期集合
@ -295,6 +296,14 @@ public class OvertimePlanServiceImpl extends Service implements OvertimePlanServ
matchItemInfo = attendanceItemInfo; matchItemInfo = attendanceItemInfo;
} }
} }
if (!"".equals(jblx)){
List<Map<String, Object>> jblxList = jblxAttendanceList.stream().filter(e->e.get("id").equals(jblx)).collect(Collectors.toList());
if (jblxList.size()>0){
matchItemInfo = jblxList.get(0);
detailItem.put("jblx", Util.null2String(matchItemInfo.get("id")));
detailItem.put("jblxName", Util.null2String(matchItemInfo.get("mc")));
}
}
detailItem.put("gsrq", belongDate); detailItem.put("gsrq", belongDate);
//20240814需求变更。增加单条明细的最小加班分钟数校验工作日加班最大小时数、周加班最大小时数、月加班最大小时数 //20240814需求变更。增加单条明细的最小加班分钟数校验工作日加班最大小时数、周加班最大小时数、月加班最大小时数
if (matchItemInfo.size() == 0) { if (matchItemInfo.size() == 0) {

@ -1321,6 +1321,23 @@ public class CommonUtil {
} }
return resultMap; return resultMap;
} }
/**
*
* @param departEmployeeList
* @return
*/
public static Map<String,Object> getTransferDepartment(List<Map<String,Object>> departEmployeeList){
departEmployeeList = departEmployeeList.stream().filter(e->!Util.null2String(e.get("changedate")).equals("")).collect(Collectors.toList());
Map<String,List<Map<String,Object>>> group = departEmployeeList.stream().collect(Collectors.groupingBy(e -> Util.null2String(e.get("resourceid"))));
Map<String,Object> resultMap = Maps.newHashMap();
for (Map.Entry<String,List<Map<String,Object>>> entry: group.entrySet()){
String userid = entry.getKey();
List<Map<String,Object>> list = entry.getValue();
list = list.stream().filter(e->e.get("type_n").equals("4")).collect(Collectors.toList());
resultMap.put(userid,list);
}
return resultMap;
}
public static double convertTohour(String hsdw,String time){ public static double convertTohour(String hsdw,String time){
double hour = 0; double hour = 0;

@ -23,7 +23,8 @@
sxwxz: WfForm.getFieldValue(WfForm.convertFieldNameToId("sxwxz")), sxwxz: WfForm.getFieldValue(WfForm.convertFieldNameToId("sxwxz")),
kssd: WfForm.getFieldValue(WfForm.convertFieldNameToId("kssd")), kssd: WfForm.getFieldValue(WfForm.convertFieldNameToId("kssd")),
jssd: WfForm.getFieldValue(WfForm.convertFieldNameToId("jssd")), jssd: WfForm.getFieldValue(WfForm.convertFieldNameToId("jssd")),
qjsc: WfForm.getFieldValue(WfForm.convertFieldNameToId("qjsc")) qjsc: WfForm.getFieldValue(WfForm.convertFieldNameToId("qjsc")),
bcxx:WfForm.getFieldValue(WfForm.convertFieldNameToId("bcxx"))
} }
generateHoliday(mainTableData); generateHoliday(mainTableData);
}) })

@ -23,7 +23,8 @@
sxwxz: WfForm.getFieldValue(WfForm.convertFieldNameToId("sxwxz")), sxwxz: WfForm.getFieldValue(WfForm.convertFieldNameToId("sxwxz")),
kssd: WfForm.getFieldValue(WfForm.convertFieldNameToId("kssd")), kssd: WfForm.getFieldValue(WfForm.convertFieldNameToId("kssd")),
jssd: WfForm.getFieldValue(WfForm.convertFieldNameToId("jssd")), jssd: WfForm.getFieldValue(WfForm.convertFieldNameToId("jssd")),
qjsc: WfForm.getFieldValue(WfForm.convertFieldNameToId("qjsc")) qjsc: WfForm.getFieldValue(WfForm.convertFieldNameToId("qjsc")),
bcxx:WfForm.getFieldValue(WfForm.convertFieldNameToId("bcxx"))
} }
let detailTableData=[]; let detailTableData=[];

@ -134,6 +134,12 @@
WfForm.changeFieldValue(WfForm.convertFieldNameToId("jbsc"), {value:totalsc}); WfForm.changeFieldValue(WfForm.convertFieldNameToId("jbsc"), {value:totalsc});
} }
WfForm.registerAction(WfForm.ACTION_DELROW+"1", function(arg){
var totalsc = getTotalsc();
WfForm.changeFieldValue(WfForm.convertFieldNameToId("jbsc"), {value:totalsc});
});
WfForm.bindDetailFieldChangeEvent(WfForm.convertFieldNameToId("kssj","detail_1"), WfForm.bindDetailFieldChangeEvent(WfForm.convertFieldNameToId("kssj","detail_1"),
function(id,rowIndex,value) { function(id,rowIndex,value) {
console.log("WfForm.bindDetailFieldChangeEvent--",id,rowIndex,value); console.log("WfForm.bindDetailFieldChangeEvent--",id,rowIndex,value);
@ -145,6 +151,12 @@
console.log("WfForm.bindDetailFieldChangeEvent--",id,rowIndex,value); console.log("WfForm.bindDetailFieldChangeEvent--",id,rowIndex,value);
updateDetail(rowIndex); updateDetail(rowIndex);
});
WfForm.bindDetailFieldChangeEvent(WfForm.convertFieldNameToId("jblx","detail_1"),
function(id,rowIndex,value) {
console.log("WfForm.bindDetailFieldChangeEvent--",id,rowIndex,value);
updateDetail(rowIndex);
}); });
WfForm.bindDetailFieldChangeEvent(WfForm.convertFieldNameToId("jsrq","detail_1"), WfForm.bindDetailFieldChangeEvent(WfForm.convertFieldNameToId("jsrq","detail_1"),

@ -27,7 +27,7 @@
if (userIds.equals("")){ if (userIds.equals("")){
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where (type_n = 5 or type_n = 7)"; String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY ";
//获取离职日期 //获取离职日期
List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql); List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql);
Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList); Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList);
@ -49,6 +49,8 @@
DbTools.update(updateSql,user,startDate,beforeCompanystartdateDay); DbTools.update(updateSql,user,startDate,beforeCompanystartdateDay);
} }
} }
}else if (!"".equals(companystartdate) && DateUtil.getTime(companystartdate).compareTo(DateUtil.getTime(endDate))>0){
DbTools.update(updateSql,user,startDate,endDate);
} }
if (!"".equals(terminationDate) && DateUtil.getTime(terminationDate).compareTo(DateUtil.getTime(endDate))<=0 && if (!"".equals(terminationDate) && DateUtil.getTime(terminationDate).compareTo(DateUtil.getTime(endDate))<=0 &&
DateUtil.getTime(terminationDate).compareTo(DateUtil.getTime(startDate))>=0){ DateUtil.getTime(terminationDate).compareTo(DateUtil.getTime(startDate))>=0){
@ -60,11 +62,13 @@
DbTools.update(updateSql,user,AfterDay,endDate); DbTools.update(updateSql,user,AfterDay,endDate);
} }
} }
}else if (!"".equals(terminationDate) && DateUtil.getTime(terminationDate).compareTo(DateUtil.getTime(startDate))<0 ){
DbTools.update(updateSql,user,startDate,endDate);
} }
} }
}else { }else {
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where resourceid in ("+userIds+") and (type_n = 5 or type_n = 7)"; String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where resourceid in ("+userIds+")";
//获取离职日期 //获取离职日期
List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql); List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql);
Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList); Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList);
@ -86,6 +90,8 @@
DbTools.update(updateSql,user,startDate,beforeCompanystartdateDay); DbTools.update(updateSql,user,startDate,beforeCompanystartdateDay);
} }
} }
}else if (!"".equals(companystartdate) && DateUtil.getTime(companystartdate).compareTo(DateUtil.getTime(endDate))>0){
DbTools.update(updateSql,user,startDate,endDate);
} }
if (!"".equals(terminationDate) && DateUtil.getTime(terminationDate).compareTo(DateUtil.getTime(endDate))<=0 && if (!"".equals(terminationDate) && DateUtil.getTime(terminationDate).compareTo(DateUtil.getTime(endDate))<=0 &&
DateUtil.getTime(terminationDate).compareTo(DateUtil.getTime(startDate))>=0){ DateUtil.getTime(terminationDate).compareTo(DateUtil.getTime(startDate))>=0){
@ -97,6 +103,8 @@
DbTools.update(updateSql,user,AfterDay,endDate); DbTools.update(updateSql,user,AfterDay,endDate);
} }
} }
}else if (!"".equals(terminationDate) && DateUtil.getTime(terminationDate).compareTo(DateUtil.getTime(startDate))<0 ){
DbTools.update(updateSql,user,startDate,endDate);
} }
} }

@ -0,0 +1,20 @@
<%@ page import="weaver.general.Util" %>
<%@ page import="com.engine.jucailinkq.common.util.DbTools" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%@ page import="weaver.conn.RecordSet" %>
<%
String tableName = Util.null2String(request.getParameter("tableName"));
String sql = "select * from "+tableName;
RecordSet rs = new RecordSet();
rs.executeQuery(sql);
String newTableName = "uf_"+tableName;
if (rs.next()){
String[] columns = rs.getColumnName();
}
%>
Loading…
Cancel
Save