将卡点换成实体类

zm_dev
liuliang 11 months ago
parent 8722a107dc
commit 64599fa0ab

@ -1 +1 @@
<EFBFBD><EFBFBD><EFBFBD>}<EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>Z譿<EFBFBD>y<EFBFBD>Q<EFBFBD><EFBFBD>
<EFBFBD>[<EFBFBD><EFBFBD>鵿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>

@ -10,6 +10,7 @@
</component>
<component name="ChangeListManager">
<list default="true" id="baeb3dfb-5097-46c5-933e-6d1dab18b815" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/dto/ClockPointDTO.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat.values" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat.values" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat.values.at" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat.values.at" afterDir="false" />
@ -19,31 +20,34 @@
<change beforePath="$PROJECT_DIR$/WEB-INF/sqllog/ecologysql" beforeDir="false" afterPath="$PROJECT_DIR$/WEB-INF/sqllog/ecologysql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/log/sdk.log" beforeDir="false" afterPath="$PROJECT_DIR$/log/sdk.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/artifacts/hrm_attendance/hrm-attendance.jar" beforeDir="false" afterPath="$PROJECT_DIR$/out/artifacts/hrm_attendance/hrm-attendance.jar" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/GetClockInPointCmd.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/GetClockInPointCmd.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/getclockInpoint/AdjustByWorkOverTimeCmd.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/getclockInpoint/AdjustByWorkOverTimeCmd.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/getclockInpoint/GetClockInPointCmd.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/getclockInpoint/GetClockInPointCmd.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/UtilService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/UtilService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/AbnormalAttendanceServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/AbnormalAttendanceServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/UtilServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/UtilServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/WorkOverTimeServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/WorkOverTimeServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/web/AttendanceanalysisAction.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/web/AttendanceanalysisAction.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/wrapper/AttendanceAnalysisWrapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/wrapper/AttendanceAnalysisWrapper.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/component/persongroup/job/scheduling/tactics/DayRegularScheduling.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/component/persongroup/job/scheduling/tactics/DayRegularScheduling.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/component/persongroup/job/scheduling/tactics/MonthRegularScheduling.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/component/persongroup/job/scheduling/tactics/MonthRegularScheduling.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/component/persongroup/job/scheduling/tactics/WeekRegularScheduling.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/component/persongroup/job/scheduling/tactics/WeekRegularScheduling.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/component/persongroup/job/scheduling/tactics/YearRegularScheduling.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/component/persongroup/job/scheduling/tactics/YearRegularScheduling.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/vacation/util/VocationCommonUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/vacation/util/VocationCommonUtil.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/workflow/service/impl/AskForLeaveServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/workflow/service/impl/AskForLeaveServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/common/util/DateUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/common/util/DateUtil.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/service/impl/WorkOverTimeServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/service/impl/WorkOverTimeServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/common/util/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/common/util/Utils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetClockInPointCmd.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/service/impl/UtilServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/service/impl/UtilServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/web/AttendanceanalysisAction.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/web/AttendanceanalysisAction.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/component/persongroup/job/scheduling/tactics/DayRegularScheduling.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/component/persongroup/job/scheduling/tactics/DayRegularScheduling.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/component/persongroup/job/scheduling/tactics/MonthRegularScheduling.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/component/persongroup/job/scheduling/tactics/MonthRegularScheduling.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/component/persongroup/job/scheduling/tactics/WeekRegularScheduling.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/component/persongroup/job/scheduling/tactics/WeekRegularScheduling.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/component/persongroup/job/scheduling/tactics/YearRegularScheduling.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/component/persongroup/job/scheduling/tactics/YearRegularScheduling.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/vacation/util/VocationCommonUtil.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/vacation/util/VocationCommonUtil.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/workflow/service/impl/AskForLeaveServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/workflow/service/impl/AskForLeaveServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/workflow/service/impl/AttendanceSummaryServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/workflow/service/impl/AttendanceSummaryServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/common/cmd/GetPersonDateBySuitOrganzation.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/common/cmd/GetPersonDateBySuitOrganzation.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/common/util/CommonUtil.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/common/util/CommonUtil.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/AttendanceAnalysisWrapper.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/AttendanceAnalysisWrapper.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper$1.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/workflow/action/askforleave/AskForLeaveWorkFlowSubmitAction.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/workflow/action/askforleave/AskForLeaveWorkFlowSubmitAction.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/common/util/DateUtil.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/common/util/DateUtil.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint$1.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint$2.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint$2.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint$3.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint$3.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint$4.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint$4.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint$5.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint$5.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/TestGetClockInPoint.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/vocation/Test1.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/vocation/Test1.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/TestAttendanceAllowance/Test.java" beforeDir="false" afterPath="$PROJECT_DIR$/test/TestAttendanceAllowance/Test.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/vocation/Test1.java" beforeDir="false" afterPath="$PROJECT_DIR$/test/vocation/Test1.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -86,7 +90,7 @@
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File" value="PLAIN_TEXT" />
<property name="last_directory_selection" value="$PROJECT_DIR$/src/com/engine/kq" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../浩鲸项目/haojing" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../../easyentry" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="project.structure.last.edited" value="Artifacts" />
<property name="project.structure.proportion" value="0.15" />
@ -618,7 +622,10 @@
<workItem from="1715304901078" duration="6497000" />
<workItem from="1715318983890" duration="15003000" />
<workItem from="1715391275306" duration="7358000" />
<workItem from="1715406393526" duration="6164000" />
<workItem from="1715406393526" duration="7053000" />
<workItem from="1715414317145" duration="8285000" />
<workItem from="1715577518625" duration="5016000" />
<workItem from="1715584285304" duration="3555000" />
</task>
<servers />
</component>
@ -667,31 +674,11 @@
<line>54</line>
<option name="timeStamp" value="84" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/RecordDataCmd.java</url>
<line>35</line>
<option name="timeStamp" value="90" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/WorkOverTimeServiceImpl.java</url>
<line>312</line>
<option name="timeStamp" value="91" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/WorkOverTimeServiceImpl.java</url>
<line>464</line>
<option name="timeStamp" value="93" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/com/engine/attendance/vacation/job/holidaygeneration/tactics/SinglePaymentInFullWay.java</url>
<line>280</line>
<option name="timeStamp" value="99" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/com/engine/common/util/DbTools.java</url>
<line>20</line>
<option name="timeStamp" value="100" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
<pin-to-top-manager>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -1,4 +1,49 @@
package com.engine.attendance.attendanceanalysis.cmd.getclockInpoint;
public class AdjustByWorkOverTimeCmd {
import com.engine.attendance.attendanceanalysis.dto.ClockPointDTO;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.common.util.Utils;
import com.engine.core.interceptor.CommandContext;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
*
*/
public class AdjustByWorkOverTimeCmd extends AbstractCommonCommand<Map<String, Object>> {
public AdjustByWorkOverTimeCmd(Map<String, Object> params) {
this.params = params;
}
@Override
public BizLogContext getLogContext() {
return null;
}
@Override
public Map<String, Object> execute(CommandContext commandContext) {
List<ClockPointDTO> clcokInTimeData = (List<ClockPointDTO>)params.get("clcokInTimeData");
List<Map<String, Object>> scheduleResult = (List<Map<String, Object>>)params.get("scheduleResult");
String analysisDate = params.get("analysisDate").toString();
return null;
}
public int getScheduleIndex(String time,List<Map<String, Object>> scheduleResult,String analysisDate){
for (int i =0;i<scheduleResult.size();i++){
String dtkssj = Utils.getkssjTime(scheduleResult.get(i),analysisDate);
String dtjssj = Utils.getjssjTime(scheduleResult.get(i),analysisDate);
if (dtkssj.equals(time) || dtjssj.equals(time)){
return i;
}
}
return -1;
}
}

@ -1,5 +1,6 @@
package com.engine.attendance.attendanceanalysis.cmd.getclockInpoint;
import com.engine.attendance.attendanceanalysis.dto.ClockPointDTO;
import com.engine.attendance.enums.AccountingUnitEnum;
import com.engine.attendance.enums.CheckBoxEnum;
import com.engine.attendance.enums.ClassSegmentTypeEnum;
@ -217,7 +218,7 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
log.info("经过重新计算卡点时 新的scheduleResult : [{}]",scheduleResult);
List<Map<String, Map<String, Object>>> clcokInTimeData = getClockInPoint(analysisDate, scheduleResult, clockInTimeList,needClockDateList);
List<ClockPointDTO> clcokInTimeData = getClockInPoint(analysisDate, scheduleResult, clockInTimeList,needClockDateList);
log.info("clcokInTimeData :[{}]",clcokInTimeData);
resultMap.put("clcokInTimeData", clcokInTimeData);
@ -236,10 +237,10 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
* @return {2023-11-12 09:00|0|3|2023-11-12 09:15 ={signtime=09:11:00, id=48, userid=53, signdate=2023-11-12}}
* |||timeType| = map
*/
public List<Map<String, Map<String, Object>>> getClockInPoint(String analysisDate, List<Map<String, Object>> scheduleResult, List<Map<String, Object>> clockInTimeList, List<String> needClockDateList) {
public List<ClockPointDTO> getClockInPoint(String analysisDate, List<Map<String, Object>> scheduleResult, List<Map<String, Object>> clockInTimeList, List<String> needClockDateList) {
List<Map<String, Map<String, Object>>> clcokInTimeData = Lists.newArrayList();
List<ClockPointDTO> clcokInTimeData = Lists.newArrayList();
for (Map<String, Object> needClockIn : scheduleResult) {
/**非请假外出开始打卡逻辑处理*/
@ -257,30 +258,29 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
tqdkfzs = Util.null2String(needClockIn.get("tqdkfzs")).equals("")?60:Integer.valueOf(needClockIn.get("tqdkfzs").toString());
}
Map<String, Map<String, Object>> ksdkNearestClcokInTime = Utils.getNearestClcokInTimeCmd(dtkssj, clockInTimeList);
String timeType = ClockPointEnum.EMPTY.getKey();
Map<String, Map<String, Object>> clcokInTimeMap = Maps.newHashMap();
if (ksdkNearestClcokInTime.get(ClockPointEnum.EQUAL.getKey()) != null) {
timeType = ClockPointEnum.EQUAL.getKey();
Map<ClockPointEnum, Map<String, Object>> ksdkNearestClcokInTime = Utils.getNearestClcokInTimeCmd(dtkssj, clockInTimeList);
ClockPointEnum timeType = ClockPointEnum.EMPTY;
if (ksdkNearestClcokInTime.get(ClockPointEnum.EQUAL) != null) {
timeType = ClockPointEnum.EQUAL;
}
if (ClockPointEnum.EMPTY.getKey().equals(timeType) && ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()) != null) {
String clockInTime = ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()).get("signdate") + " " + ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()).get("signtime");
if (ClockPointEnum.EMPTY.equals(timeType) && ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE) != null) {
String clockInTime = ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE).get("signdate") + " " + ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE).get("signtime");
if (DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(DateUtil.beforeMinutes(dtkssj, tqdkfzs))) >= 0 &&
(getBeforeClockTime(needClockDateList,dtkssj).equals("") || DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(getBeforeClockTime(needClockDateList,dtkssj))) > 0)) {
//打卡时间大于等于最早打卡时间
timeType = ClockPointEnum.BEFORE.getKey();
timeType = ClockPointEnum.BEFORE;
}
}
if (ClockPointEnum.EMPTY.getKey().equals(timeType) && ksdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()) != null) {
String clockInTime = ksdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()).get("signdate") + " " + ksdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()).get("signtime");
if (ClockPointEnum.EMPTY.equals(timeType) && ksdkNearestClcokInTime.get(ClockPointEnum.AFTER) != null) {
String clockInTime = ksdkNearestClcokInTime.get(ClockPointEnum.AFTER).get("signdate") + " " + ksdkNearestClcokInTime.get(ClockPointEnum.AFTER).get("signtime");
if (getNextClockTime(needClockDateList,dtkssj).equals("") || DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(getNextClockTime(needClockDateList,dtkssj))) < 0) {
//打卡时间小于结束时间
timeType = ClockPointEnum.AFTER.getKey();
timeType = ClockPointEnum.AFTER;
}
}
clcokInTimeMap.put(dtkssj + "|" + ClockPointEnum.START.getKey() + "|" + timeType, ksdkNearestClcokInTime.get(timeType));
clcokInTimeData.add(clcokInTimeMap);
//clcokInTimeMap.put(dtkssj + "|" + ClockPointEnum.START.getKey() + "|" + timeType, ksdkNearestClcokInTime.get(timeType));
clcokInTimeData.add(ClockPointDTO.builder().classTime(dtkssj).pointType(ClockPointEnum.START).timeType(timeType).classSegmentType(needClockIn.get("bdlx").toString()).clockTime(ksdkNearestClcokInTime.get(timeType)).build());
}
/**非请假外出结束打卡逻辑处理*/
if (CheckBoxEnum.CHECKED.getKey().equals(needClockIn.get("jsdk")) && !ClassSegmentTypeEnum.EVECTION.getKey().equals(needClockIn.get("bdlx")) &&
@ -295,28 +295,28 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
thdkfzs = Util.null2String(needClockIn.get("thdkfzs")).equals("")?60:Integer.valueOf(needClockIn.get("thdkfzs").toString());
}
Map<String, Map<String, Object>> jsdkNearestClcokInTime = Utils.getNearestClcokInTimeCmd(dtjssj, clockInTimeList);
Map<ClockPointEnum, Map<String, Object>> jsdkNearestClcokInTime = Utils.getNearestClcokInTimeCmd(dtjssj, clockInTimeList);
String timeType = ClockPointEnum.EMPTY.getKey();
Map<String, Map<String, Object>> clcokInTimeMap = Maps.newHashMap();
if (jsdkNearestClcokInTime.get(ClockPointEnum.EQUAL.getKey()) != null) {
timeType = ClockPointEnum.EQUAL.getKey();
ClockPointEnum timeType = ClockPointEnum.EMPTY;
if (jsdkNearestClcokInTime.get(ClockPointEnum.EQUAL) != null) {
timeType = ClockPointEnum.EQUAL;
}
if (ClockPointEnum.EMPTY.getKey().equals(timeType) && jsdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()).get("signtime");
if (ClockPointEnum.EMPTY.equals(timeType) && jsdkNearestClcokInTime.get(ClockPointEnum.AFTER) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.AFTER).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.AFTER).get("signtime");
if (DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(DateUtil.AfterMinutes(dtjssj, thdkfzs))) <= 0 &&
(getNextClockTime(needClockDateList,dtjssj).equals("") || DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(getNextClockTime(needClockDateList,dtjssj))) < 0)) {
timeType = ClockPointEnum.AFTER.getKey();
timeType = ClockPointEnum.AFTER;
}
}
if (ClockPointEnum.EMPTY.getKey().equals(timeType) && jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()).get("signtime");
if (ClockPointEnum.EMPTY.equals(timeType) && jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE).get("signtime");
if (getBeforeClockTime(needClockDateList,dtjssj).equals("") || DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(getBeforeClockTime(needClockDateList,dtjssj))) > 0) {
timeType = ClockPointEnum.BEFORE.getKey();
timeType = ClockPointEnum.BEFORE;
}
}
clcokInTimeMap.put(dtjssj + "|" + ClockPointEnum.END.getKey() + "|" + timeType, jsdkNearestClcokInTime.get(timeType));
clcokInTimeData.add(clcokInTimeMap);
//clcokInTimeMap.put(dtjssj + "|" + ClockPointEnum.END.getKey() + "|" + timeType, jsdkNearestClcokInTime.get(timeType));
clcokInTimeData.add(ClockPointDTO.builder().classTime(dtjssj).pointType(ClockPointEnum.END).timeType(timeType).classSegmentType(needClockIn.get("bdlx").toString()).clockTime(jsdkNearestClcokInTime.get(timeType)).build());
}
/**
@ -330,28 +330,28 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
DateUtil.getBetWeenMinutes(dtkssj,getNextClockTime(needClockDateList,dtkssj));
}
Map<String, Map<String, Object>> jsdkNearestClcokInTime = Utils.getNearestClcokInTimeCmd(dtkssj, clockInTimeList);
Map<ClockPointEnum, Map<String, Object>> jsdkNearestClcokInTime = Utils.getNearestClcokInTimeCmd(dtkssj, clockInTimeList);
String timeType = ClockPointEnum.EMPTY.getKey();
ClockPointEnum timeType = ClockPointEnum.EMPTY;
Map<String, Map<String, Object>> clcokInTimeMap = Maps.newHashMap();
if (jsdkNearestClcokInTime.get(ClockPointEnum.EQUAL.getKey()) != null) {
timeType = ClockPointEnum.EQUAL.getKey();
if (jsdkNearestClcokInTime.get(ClockPointEnum.EQUAL) != null) {
timeType = ClockPointEnum.EQUAL;
}
if (ClockPointEnum.EMPTY.getKey().equals(timeType) && jsdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()).get("signtime");
if (ClockPointEnum.EMPTY.equals(timeType) && jsdkNearestClcokInTime.get(ClockPointEnum.AFTER) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.AFTER).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.AFTER).get("signtime");
if (DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(DateUtil.AfterMinutes(dtkssj, thdkfzs))) <= 0 &&
(getNextClockTime(needClockDateList,dtkssj).equals("") || DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(getNextClockTime(needClockDateList,dtkssj))) < 0)) {
timeType = ClockPointEnum.AFTER.getKey();
timeType = ClockPointEnum.AFTER;
}
}
if (ClockPointEnum.EMPTY.getKey().equals(timeType) && jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()).get("signtime");
if (ClockPointEnum.EMPTY.equals(timeType) && jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE).get("signtime");
if (getBeforeClockTime(needClockDateList,dtkssj).equals("") || DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(getBeforeClockTime(needClockDateList,dtkssj))) > 0) {
timeType = ClockPointEnum.BEFORE.getKey();
timeType = ClockPointEnum.BEFORE;
}
}
clcokInTimeMap.put(dtkssj + "|" + ClockPointEnum.END.getKey() + "|" + timeType+"|0", jsdkNearestClcokInTime.get(timeType));
clcokInTimeData.add(clcokInTimeMap);
// clcokInTimeMap.put(dtkssj + "|" + ClockPointEnum.END.getKey() + "|" + timeType+"|0", jsdkNearestClcokInTime.get(timeType));
clcokInTimeData.add(ClockPointDTO.builder().classTime(dtkssj).pointType(ClockPointEnum.END).timeType(timeType).classSegmentType(needClockIn.get("bdlx").toString()).clockTime(jsdkNearestClcokInTime.get(timeType)).build());
}
/**
@ -369,46 +369,36 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
}
Map<String, Map<String, Object>> ksdkNearestClcokInTime = Utils.getNearestClcokInTimeCmd(dtjssj, clockInTimeList);
String timeType = ClockPointEnum.EMPTY.getKey();
Map<String, Map<String, Object>> clcokInTimeMap = Maps.newHashMap();
if (ksdkNearestClcokInTime.get(ClockPointEnum.EQUAL.getKey()) != null) {
timeType = ClockPointEnum.EQUAL.getKey();
Map<ClockPointEnum, Map<String, Object>> ksdkNearestClcokInTime = Utils.getNearestClcokInTimeCmd(dtjssj, clockInTimeList);
ClockPointEnum timeType = ClockPointEnum.EMPTY;
if (ksdkNearestClcokInTime.get(ClockPointEnum.EQUAL) != null) {
timeType = ClockPointEnum.EQUAL;
}
if (ClockPointEnum.EMPTY.getKey().equals(timeType) && ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()) != null) {
String clockInTime = ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()).get("signdate") + " " + ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()).get("signtime");
if (ClockPointEnum.EMPTY.equals(timeType) && ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE) != null) {
String clockInTime = ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE).get("signdate") + " " + ksdkNearestClcokInTime.get(ClockPointEnum.BEFORE).get("signtime");
if (DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(DateUtil.beforeMinutes(dtjssj, tqdkfzs))) >= 0 &&
(getBeforeClockTime(needClockDateList,dtjssj).equals("") || DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(getBeforeClockTime(needClockDateList,dtjssj))) > 0)) {
//打卡时间大于等于最早打卡时间
timeType = ClockPointEnum.BEFORE.getKey();
timeType = ClockPointEnum.BEFORE;
}
}
if (ClockPointEnum.EMPTY.getKey().equals(timeType) && ksdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()) != null) {
String clockInTime = ksdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()).get("signdate") + " " + ksdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()).get("signtime");
if (ClockPointEnum.EMPTY.equals(timeType) && ksdkNearestClcokInTime.get(ClockPointEnum.AFTER) != null) {
String clockInTime = ksdkNearestClcokInTime.get(ClockPointEnum.AFTER).get("signdate") + " " + ksdkNearestClcokInTime.get(ClockPointEnum.AFTER).get("signtime");
if (getNextClockTime(needClockDateList,dtjssj).equals("") || DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(getNextClockTime(needClockDateList,dtjssj))) < 0) {
//打卡时间小于结束时间
timeType = ClockPointEnum.AFTER.getKey();
timeType = ClockPointEnum.AFTER;
}
}
clcokInTimeMap.put(dtjssj + "|" + ClockPointEnum.START.getKey() + "|" + timeType+"|0", ksdkNearestClcokInTime.get(timeType));
clcokInTimeData.add(clcokInTimeMap);
//clcokInTimeMap.put(dtjssj + "|" + ClockPointEnum.START.getKey() + "|" + timeType+"|0", ksdkNearestClcokInTime.get(timeType));
clcokInTimeData.add(ClockPointDTO.builder().classTime(dtjssj).pointType(ClockPointEnum.START).timeType(timeType).classSegmentType(needClockIn.get("bdlx").toString()).clockTime(ksdkNearestClcokInTime.get(timeType)).build());
}
}
clcokInTimeData = clcokInTimeData.stream().sorted(Comparator.comparing(e->{
//卡点
String point = "";
//当天打卡数据
for (Map.Entry<String,Map<String,Object>> entry :e.entrySet()){
point = entry.getKey();
}
return DateUtil.getTime(point.split("\\|")[0]).toInstant(ZoneOffset.of("+8")).toEpochMilli();
})).collect(Collectors.toList());
//根据班次时间排序
clcokInTimeData = clcokInTimeData.stream().sorted(Comparator.comparing(e-> DateUtil.getTime(e.getClassTime()).toInstant(ZoneOffset.of("+8")).toEpochMilli())).collect(Collectors.toList());
/**
*
*/ //上下班弹性,
@ -475,21 +465,16 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
}
//弹性上班卡
for (int i = 0; i < clcokInTimeData.size(); i++) {
Map<String, Map<String, Object>> clcokInTimeMap = clcokInTimeData.get(i);
//卡点
String point = "";
ClockPointDTO clockdto = clcokInTimeData.get(i);
//当天打卡数据
Map<String, Object> clcokInTime = null;
for (Map.Entry<String, Map<String, Object>> entry : clcokInTimeMap.entrySet()) {
point = entry.getKey();
clcokInTime = entry.getValue();
}
Map<String, Object> clcokInTime = clockdto.getClockTime();
//需要计算的班次打卡时间点
String pointTime = point.split("\\|")[0];
String pointTime = clockdto.getClassTime();
//start开始打卡时间点end结束打卡时间点
String pointType = point.split("\\|")[1];
ClockPointEnum pointType = clockdto.getPointType();
//empty:漏卡equal:打卡时间和班次时间相等before打卡时间在班次时间之前after打卡时间在班次时间之后
String timeType = point.split("\\|")[2];
ClockPointEnum timeType = clockdto.getTimeType();
if (pointTime.equals(kssjStart) && ClockPointEnum.START.getKey().equals(pointType) && clcokInTime != null
&& CheckBoxEnum.CHECKED.getKey().equals(ifToWorkClock)) {
@ -497,39 +482,31 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
//该卡点是弹性开始时间
if ("".equals(flexibleWorkTime) ){
//弹性上班期间未被请假开始时间占据
if (ClockPointEnum.BEFORE.getKey().equals(timeType)) {
if (ClockPointEnum.BEFORE.equals(timeType)) {
int betWeenTime = DateUtil.getBetWeenMinutes(signTime, kssjStart);
String newPonit = point;
if (betWeenTime <= zddxfz) {
betWeenTime = Double.valueOf(Utils.getItemdurationDown(dxhs, AccountingUnitEnum.MINUTES.getKey(), betWeenTime, AccountingUnitEnum.MINUTES)).intValue();
flexibleWorkTime = DateUtil.beforeMinutes(kssjStart, betWeenTime);
newPonit = pointTime + "|" + pointType + "|" + ClockPointEnum.EQUAL.getKey() + "|" + flexibleWorkTime;
clockdto.setTimeType(ClockPointEnum.EQUAL);
} else if (betWeenTime > zddxfz) {
flexibleWorkTime = DateUtil.beforeMinutes(kssjStart, zddxfz);
newPonit = point + "|" + flexibleWorkTime;
}
clcokInTimeMap.remove(point);
clcokInTimeMap.put(newPonit, clcokInTime);
} else if (ClockPointEnum.AFTER.getKey().equals(timeType)) {
clockdto.setElasticTime(flexibleWorkTime);
} else if (ClockPointEnum.AFTER.equals(timeType)) {
//迟到
String newPonit = point;
int betWeenTime = DateUtil.getBetWeenMinutes(kssjStart, signTime);
if (betWeenTime <= zddxfz) {
betWeenTime = Double.valueOf(Utils.getItemduration(dxhs, AccountingUnitEnum.MINUTES.getKey(), betWeenTime, AccountingUnitEnum.MINUTES)).intValue();
flexibleWorkTime = DateUtil.AfterMinutes(kssjStart, betWeenTime);
newPonit = pointTime + "|" + pointType + "|" + ClockPointEnum.EQUAL.getKey() + "|" + flexibleWorkTime;
clockdto.setTimeType(ClockPointEnum.EQUAL);
} else if (betWeenTime > zddxfz) {
flexibleWorkTime = DateUtil.AfterMinutes(kssjStart, zddxfz);
newPonit = point + "|" + flexibleWorkTime;
}
clcokInTimeMap.remove(point);
clcokInTimeMap.put(newPonit, clcokInTime);
clockdto.setElasticTime(flexibleWorkTime);
}
}else {
//弹性上班期间被请假开始时间占据
String newPonit = point +"|"+flexibleWorkTime;
clcokInTimeMap.remove(point);
clcokInTimeMap.put(newPonit, clcokInTime);
clockdto.setElasticTime(flexibleWorkTime);
}
} else if (pointTime.equals(jssjEnd) && ClockPointEnum.END.getKey().equals(pointType) && CheckBoxEnum.CHECKED.getKey().equals(ifToCloseClock)) {
//该卡点是弹性下班点
@ -545,28 +522,32 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
}
if (!"".equals(flexibleOffWorkTime)){
//根据弹性下班时间点重新计算
Map<String, Map<String, Object>> jsdkNearestClcokInTime = Utils.getNearestClcokInTimeCmd(flexibleOffWorkTime, clockInTimeList);
Map<ClockPointEnum, Map<String, Object>> jsdkNearestClcokInTime = Utils.getNearestClcokInTimeCmd(flexibleOffWorkTime, clockInTimeList);
String newtimeType = ClockPointEnum.EMPTY.getKey();
if (jsdkNearestClcokInTime.get(ClockPointEnum.EQUAL.getKey()) != null) {
newtimeType = ClockPointEnum.EQUAL.getKey();
ClockPointEnum newtimeType = ClockPointEnum.EMPTY;
if (jsdkNearestClcokInTime.get(ClockPointEnum.EQUAL) != null) {
newtimeType = ClockPointEnum.EQUAL;
}
if (ClockPointEnum.EMPTY.getKey().equals(newtimeType) && jsdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.AFTER.getKey()).get("signtime");
if (ClockPointEnum.EMPTY.equals(newtimeType) && jsdkNearestClcokInTime.get(ClockPointEnum.AFTER) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.AFTER).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.AFTER).get("signtime");
if (DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(DateUtil.AfterMinutes(flexibleOffWorkTime, thdkfzs))) <= 0) {
newtimeType = ClockPointEnum.AFTER.getKey();
newtimeType = ClockPointEnum.AFTER;
}
}
if (ClockPointEnum.EMPTY.getKey().equals(newtimeType) && jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE.getKey()).get("signtime");
if (ClockPointEnum.EMPTY.equals(newtimeType) && jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE) != null) {
String clockInTime = jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE).get("signdate") + " " + jsdkNearestClcokInTime.get(ClockPointEnum.BEFORE).get("signtime");
if (DateUtil.getTime(clockInTime).compareTo(DateUtil.getTime(getBeforeClockTime(needClockDateList,jssjEnd))) > 0) {
newtimeType = ClockPointEnum.BEFORE.getKey();
newtimeType = ClockPointEnum.BEFORE;
}
}
String newPonit = jssjEnd + "|" + ClockPointEnum.END.getKey() + "|" + newtimeType + "|" + flexibleOffWorkTime;
clcokInTimeMap.remove(point);
clcokInTimeMap.put(newPonit, jsdkNearestClcokInTime.get(newtimeType));
// String newPonit = jssjEnd + "|" + ClockPointEnum.END.getKey() + "|" + newtimeType + "|" + flexibleOffWorkTime;
// clcokInTimeMap.put(newPonit, jsdkNearestClcokInTime.get(newtimeType));
clockdto.setClassTime(jssjEnd);
clockdto.setPointType(ClockPointEnum.END);
clockdto.setTimeType(newtimeType);
clockdto.setElasticTime(flexibleOffWorkTime);
clockdto.setClockTime(jsdkNearestClcokInTime.get(newtimeType));
}
}
}
@ -594,29 +575,20 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
*/
if (clcokInTimeData.size() > 1) {
for (int i = 0; i < clcokInTimeData.size() - 1; i++) {
Map<String, Map<String, Object>> beforeClcokInTimeData = clcokInTimeData.get(i);
Map<String, Map<String, Object>> afterClcokInTimeData = clcokInTimeData.get(i + 1);
Map<String, Object> beforeClcokInTimeMap = null;
String beforeClcokInTime = "";
String afterClcokInTime = "";
Map<String, Object> afterClcokInTimeMap = null;
for (Map.Entry<String, Map<String, Object>> beforeEntry : beforeClcokInTimeData.entrySet()) {
beforeClcokInTimeMap = beforeEntry.getValue();
beforeClcokInTime = beforeEntry.getKey();
}
for (Map.Entry<String, Map<String, Object>> afterEntry : afterClcokInTimeData.entrySet()) {
afterClcokInTimeMap = afterEntry.getValue();
afterClcokInTime = afterEntry.getKey();
}
ClockPointDTO beforeClcokDTO = clcokInTimeData.get(i);
ClockPointDTO afterClcokInDTO = clcokInTimeData.get(i + 1);
Map<String, Object> beforeClcokInTimeMap = beforeClcokDTO.getClockTime();
Map<String, Object> afterClcokInTimeMap = afterClcokInDTO.getClockTime();
//重复
if (beforeClcokInTimeMap != null && beforeClcokInTimeMap == afterClcokInTimeMap) {
String beforeTime = beforeClcokInTime.split("\\|")[0];
if (beforeClcokInTime.split("\\|").length ==4 && !"0".equals(beforeClcokInTime.split("\\|")[3])){
beforeTime = beforeClcokInTime.split("\\|")[3];
String beforeTime = beforeClcokDTO.getClassTime();
if (beforeClcokDTO.getElasticTime() != null && !"".equals(beforeClcokDTO.getElasticTime())){
beforeTime = beforeClcokDTO.getElasticTime();
}
String afterTime = afterClcokInTime.split("\\|")[0];
if (afterClcokInTime.split("\\|").length ==4 && !"0".equals(afterClcokInTime.split("\\|")[3])){
afterTime = afterClcokInTime.split("\\|")[3];
String afterTime = afterClcokInDTO.getClassTime();
if (afterClcokInDTO.getElasticTime() != null && !"".equals(afterClcokInDTO.getElasticTime())){
afterTime = afterClcokInDTO.getElasticTime();
}
long betWeenMinutes = DateUtil.getBetWeenMinutes(beforeTime, afterTime);
@ -624,109 +596,90 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
String signdateTime = beforeClcokInTimeMap.get("signdate") + " " + beforeClcokInTimeMap.get("signtime");
String resetClcokInTime ="";
Map<String, Map<String, Object>> resetClcokInTimeData = null;
ClockPointDTO resetClcokDTO =null;
if (DateUtil.getTime(signdateTime).compareTo(DateUtil.getTime(middileTime)) <= 0) {
//该打卡归属前一个打卡点,后一个打卡点需要重新设置
resetClcokInTime = afterClcokInTime;
resetClcokInTimeData = afterClcokInTimeData;
resetClcokDTO=afterClcokInDTO;
} else if (DateUtil.getTime(signdateTime).compareTo(DateUtil.getTime(middileTime)) > 0) {
//该打卡归属后一个打卡点,前一个打卡点需要重新设置
resetClcokInTime=beforeClcokInTime;
resetClcokInTimeData = beforeClcokInTimeData;
resetClcokDTO=beforeClcokDTO;
}
//需要重新赋值的打卡时间
String restTime = resetClcokInTime.split("\\|")[0];
if (resetClcokInTime.split("\\|").length ==4 && !"0".equals(resetClcokInTime.split("\\|")[3])){
restTime = resetClcokInTime.split("\\|")[3];
String restTime = resetClcokDTO.getClassTime();
if (resetClcokDTO.getElasticTime() != null && !"".equals(resetClcokDTO.getElasticTime())){
restTime = resetClcokDTO.getElasticTime();
}
Map<String, Map<String, Object>> nearestClcokInTime = Utils.getNearestClcokInTimeCmd(restTime, clockInTimeList);
Map<ClockPointEnum, Map<String, Object>> nearestClcokInTime = Utils.getNearestClcokInTimeCmd(restTime, clockInTimeList);
//start开始打卡时间点end结束打卡时间点
String pointType = resetClcokInTime.split("\\|")[1];
ClockPointEnum pointType = resetClcokDTO.getPointType();
//empty:漏卡equal:打卡时间和班次时间相等before打卡时间在班次时间之前after打卡时间在班次时间之后
String timeType = resetClcokInTime.split("\\|")[2];
String time = resetClcokInTime.split("\\|")[0];
String newPonit = time+"|"+pointType;
String newtimeType = "";
if (timeType.equals(ClockPointEnum.BEFORE.getKey())){
newtimeType = ClockPointEnum.AFTER.getKey();
}else if (timeType.equals(ClockPointEnum.AFTER.getKey())){
newtimeType = ClockPointEnum.BEFORE.getKey();
ClockPointEnum timeType = resetClcokDTO.getTimeType();
String time = resetClcokDTO.getClassTime();
ClockPointEnum newtimeType = null;
if (timeType.equals(ClockPointEnum.BEFORE)){
newtimeType = ClockPointEnum.AFTER;
}else if (timeType.equals(ClockPointEnum.AFTER)){
newtimeType = ClockPointEnum.BEFORE;
}
if (nearestClcokInTime.get(newtimeType) != null){
newPonit = newPonit +"|"+newtimeType;
if (resetClcokInTime.split("\\|").length ==4){
newPonit = newPonit +"|"+resetClcokInTime.split("\\|")[3];
}
Map<String, Object> newClockTimeMap = nearestClcokInTime.get(newtimeType);
String newClockTime = newClockTimeMap.get("signdate")+ " "+newClockTimeMap.get("signtime");
int index = clcokInTimeData.indexOf(resetClcokInTimeData);
if (newtimeType.equals(ClockPointEnum.BEFORE.getKey())){
int index = clcokInTimeData.indexOf(resetClcokDTO);
if (newtimeType.equals(ClockPointEnum.BEFORE)){
if (!getBeforeClockTime(needClockDateList,time).equals("") && DateUtil.getTime(newClockTime).compareTo(DateUtil.getTime(getBeforeClockTime(needClockDateList,time))) <= 0){
newClockTimeMap = null;
}
if ((index-1) >= 0){
//当重新需要打卡的时间戳与打卡时间之前的打卡集合时,进行比对
Map<String, Map<String, Object>> resetBeforeData = clcokInTimeData.get(index-1);
Map<String, Object> resetBeforeClcokInTimeMap = null;
for (Map.Entry<String, Map<String, Object>> resetBeforeEntry : resetBeforeData.entrySet()) {
resetBeforeClcokInTimeMap = resetBeforeEntry.getValue();
}
ClockPointDTO resetBeforeDTO = clcokInTimeData.get(index-1);
Map<String, Object> resetBeforeClcokInTimeMap = resetBeforeDTO.getClockTime();
if (newClockTimeMap == resetBeforeClcokInTimeMap){
newClockTimeMap = null;
}
}
}else if (newtimeType.equals(ClockPointEnum.AFTER.getKey())){
}else if (newtimeType.equals(ClockPointEnum.AFTER)){
if (!getNextClockTime(needClockDateList,time).equals("") && DateUtil.getTime(newClockTime).compareTo(DateUtil.getTime(getNextClockTime(needClockDateList,time))) >= 0){
newClockTimeMap = null;
}
}
if (newClockTimeMap == null){
//当需要调整的卡点为漏卡时将打卡进行退回,若另一个卡点调整后为不漏卡情况,则调整该节点
if (resetClcokInTimeData == beforeClcokInTimeData){
resetClcokInTime = afterClcokInTime;
resetClcokInTimeData = afterClcokInTimeData;
}else if (resetClcokInTimeData == afterClcokInTimeData){
resetClcokInTime=beforeClcokInTime;
resetClcokInTimeData = beforeClcokInTimeData;
if (resetClcokDTO == beforeClcokDTO){
resetClcokDTO=afterClcokInDTO;
}else if (resetClcokDTO == afterClcokInDTO){
resetClcokDTO=beforeClcokDTO;
}
if (!resetClcokInTimeData(analysisDate,resetClcokInTime,resetClcokInTimeData,clockInTimeList,needClockDateList,clcokInTimeData,scheduleResult)){
if (resetClcokInTimeData == beforeClcokInTimeData){
resetClcokInTimeData = afterClcokInTimeData;
}else if (resetClcokInTimeData == afterClcokInTimeData){
resetClcokInTimeData = beforeClcokInTimeData;
if (!resetClcokInTimeData(analysisDate,resetClcokDTO,clockInTimeList,needClockDateList,clcokInTimeData,scheduleResult)){
if (resetClcokDTO == beforeClcokDTO){
resetClcokDTO = afterClcokInDTO;
}else if (resetClcokDTO == afterClcokInDTO){
resetClcokDTO = beforeClcokDTO;
}
clcokInTimeData.remove(resetClcokInTimeData);
resetClcokInTimeData = Maps.newHashMap();
resetClcokInTimeData.put(newPonit,newClockTimeMap);
clcokInTimeData.add(index,resetClcokInTimeData);
resetClcokDTO.setTimeType(newtimeType);
resetClcokDTO.setClockTime(newClockTimeMap);
}
}else {
clcokInTimeData.remove(resetClcokInTimeData);
resetClcokInTimeData = Maps.newHashMap();
resetClcokInTimeData.put(newPonit,newClockTimeMap);
clcokInTimeData.add(index,resetClcokInTimeData);
resetClcokDTO.setTimeType(newtimeType);
resetClcokDTO.setClockTime(newClockTimeMap);
}
}else {
if (resetClcokInTimeData == beforeClcokInTimeData){
resetClcokInTime = afterClcokInTime;
resetClcokInTimeData = afterClcokInTimeData;
}else if (resetClcokInTimeData == afterClcokInTimeData){
resetClcokInTime=beforeClcokInTime;
resetClcokInTimeData = beforeClcokInTimeData;
if (resetClcokDTO == beforeClcokDTO){
resetClcokDTO = afterClcokInDTO;
}else if (resetClcokDTO == afterClcokInDTO){
resetClcokDTO = beforeClcokDTO;
}
if (!resetClcokInTimeData(analysisDate,resetClcokInTime,resetClcokInTimeData,clockInTimeList,needClockDateList,clcokInTimeData,scheduleResult)){
if (resetClcokInTimeData == beforeClcokInTimeData){
resetClcokInTime = afterClcokInTime;
resetClcokInTimeData = afterClcokInTimeData;
}else if (resetClcokInTimeData == afterClcokInTimeData){
resetClcokInTime=beforeClcokInTime;
resetClcokInTimeData = beforeClcokInTimeData;
if (!resetClcokInTimeData(analysisDate,resetClcokDTO,clockInTimeList,needClockDateList,clcokInTimeData,scheduleResult)){
if (resetClcokDTO == beforeClcokDTO){
resetClcokDTO = afterClcokInDTO;
}else if (resetClcokDTO == afterClcokInDTO){
resetClcokDTO = beforeClcokDTO;
}
resetClcokInTimeData.put(resetClcokInTime, null);
resetClcokDTO.setClockTime(null);
}
}
}
@ -770,35 +723,31 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
}
public boolean resetClcokInTimeData(String analysisDate,String resetClcokInTime,Map<String, Map<String, Object>> resetClcokInTimeData,List<Map<String, Object>> clockInTimeList, List<String> needClockDateList,List<Map<String, Map<String, Object>>> clcokInTimeData,List<Map<String, Object>> scheduleResult){
String restTime = resetClcokInTime.split("\\|")[0];
if (resetClcokInTime.split("\\|").length ==4 && !"0".equals(resetClcokInTime.split("\\|")[3])){
restTime = resetClcokInTime.split("\\|")[3];
public boolean resetClcokInTimeData(String analysisDate,ClockPointDTO resetClcokDTO,List<Map<String, Object>> clockInTimeList, List<String> needClockDateList,List<ClockPointDTO> clcokInTimeData,List<Map<String, Object>> scheduleResult){
String restTime = resetClcokDTO.getClassTime();
if (resetClcokDTO.getElasticTime() != null && !"".equals(resetClcokDTO.getElasticTime())){
restTime = resetClcokDTO.getElasticTime();
}
Map<String, Map<String, Object>> nearestClcokInTime = Utils.getNearestClcokInTimeCmd(restTime, clockInTimeList);
Map<ClockPointEnum, Map<String, Object>> nearestClcokInTime = Utils.getNearestClcokInTimeCmd(restTime, clockInTimeList);
//start开始打卡时间点end结束打卡时间点
String pointType = resetClcokInTime.split("\\|")[1];
ClockPointEnum pointType = resetClcokDTO.getPointType();
//empty:漏卡equal:打卡时间和班次时间相等before打卡时间在班次时间之前after打卡时间在班次时间之后
String timeType = resetClcokInTime.split("\\|")[2];
String time = resetClcokInTime.split("\\|")[0];
String newPonit = time+"|"+pointType;
String newtimeType = "";
if (timeType.equals(ClockPointEnum.BEFORE.getKey())){
newtimeType = ClockPointEnum.AFTER.getKey();
}else if (timeType.equals(ClockPointEnum.AFTER.getKey())){
newtimeType = ClockPointEnum.BEFORE.getKey();
ClockPointEnum timeType = resetClcokDTO.getTimeType();
String time = resetClcokDTO.getClassTime();
ClockPointEnum newtimeType = null;
if (timeType.equals(ClockPointEnum.BEFORE)){
newtimeType = ClockPointEnum.AFTER;
}else if (timeType.equals(ClockPointEnum.AFTER)){
newtimeType = ClockPointEnum.BEFORE;
}
if (nearestClcokInTime.get(newtimeType) != null){
newPonit = newPonit +"|"+newtimeType;
if (resetClcokInTime.split("\\|").length ==4){
newPonit = newPonit +"|"+resetClcokInTime.split("\\|")[3];
}
Map<String, Object> newClockTimeMap = nearestClcokInTime.get(newtimeType);
String newClockTime = newClockTimeMap.get("signdate")+ " "+newClockTimeMap.get("signtime");
int index = clcokInTimeData.indexOf(resetClcokInTimeData);
if (newtimeType.equals(ClockPointEnum.BEFORE.getKey())){
int index = clcokInTimeData.indexOf(resetClcokDTO);
if (newtimeType.equals(ClockPointEnum.BEFORE)){
if (pointType.equals(ClockPointEnum.START.getKey())){
//开始卡点
Map<String,Object> needClockIn = scheduleResult.stream().filter(e -> {
@ -827,16 +776,13 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
if ((index-1) >= 0){
//当重新需要打卡的时间戳与打卡时间之前的打卡集合时,进行比对
Map<String, Map<String, Object>> resetBeforeData = clcokInTimeData.get(index-1);
Map<String, Object> resetBeforeClcokInTimeMap = null;
for (Map.Entry<String, Map<String, Object>> resetBeforeEntry : resetBeforeData.entrySet()) {
resetBeforeClcokInTimeMap = resetBeforeEntry.getValue();
}
ClockPointDTO resetBeforeDTO = clcokInTimeData.get(index-1);
Map<String, Object> resetBeforeClcokInTimeMap = resetBeforeDTO.getClockTime();
if (newClockTimeMap == resetBeforeClcokInTimeMap){
newClockTimeMap = null;
}
}
}else if (newtimeType.equals(ClockPointEnum.AFTER.getKey())){
}else if (newtimeType.equals(ClockPointEnum.AFTER)){
if (pointType.equals(ClockPointEnum.END.getKey())){
//结束卡点
Map<String,Object> needClockIn = scheduleResult.stream().filter(e -> {
@ -863,10 +809,8 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
}
}
if (newClockTimeMap != null){
clcokInTimeData.remove(resetClcokInTimeData);
resetClcokInTimeData = Maps.newHashMap();
resetClcokInTimeData.put(newPonit,newClockTimeMap);
clcokInTimeData.add(index,resetClcokInTimeData);
resetClcokDTO.setTimeType(newtimeType);
resetClcokDTO.setClockTime(newClockTimeMap);
return true;
}
}

@ -0,0 +1,47 @@
package com.engine.attendance.attendanceanalysis.dto;
import com.engine.attendance.enums.ClockPointEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map;
/**
*
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ClockPointDTO {
/**
*
*/
private String classTime;
/**
*
* START
* END
*/
private ClockPointEnum pointType;
/**
*
*/
private ClockPointEnum timeType;
/**
*
*/
private String elasticTime;
/**
*
* ClassSegmentTypeEnum
*/
private String classSegmentType;
/**
*
*/
private Map<String, Object> clockTime;
}

@ -1,5 +1,7 @@
package com.engine.attendance.attendanceanalysis.service;
import com.engine.attendance.attendanceanalysis.dto.ClockPointDTO;
import java.util.List;
import java.util.Map;
@ -33,11 +35,11 @@ public interface UtilService {
* @param clcokInTimeData
* @return
*/
Map<String,Object> getNeedRecordClockInTime(List<Map<String,Map<String,Object>>> clcokInTimeData);
Map<String,Object> getNeedRecordClockInTime(List<ClockPointDTO> clcokInTimeData);
/**
*
*/
List<Map<String,Map<String,Object>>> getClockInPointCmd(Map<String,Object> params);
List<ClockPointDTO> getClockInPointCmd(Map<String,Object> params);
/**
*

@ -1,6 +1,7 @@
package com.engine.attendance.attendanceanalysis.service.impl;
import com.engine.attendance.attendanceanalysis.cmd.item.*;
import com.engine.attendance.attendanceanalysis.dto.ClockPointDTO;
import com.engine.attendance.attendanceanalysis.service.AbnormalAttendanceService;
import com.engine.attendance.enums.*;
import com.engine.common.util.Utils;
@ -34,7 +35,7 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
//班段类型
String bdlx = Util.null2String(classInfo.get("bdlx"));
//卡点
String point = Util.null2String(params.get("point"));
ClockPointDTO clcokInTimedto = (ClockPointDTO)params.get("point");
//分析日期
String analysisDate = Util.null2String(params.get("analysisDate"));
//班次
@ -54,12 +55,9 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
String clockInTime = clcokInTimeData.get("signdate")+" "+clcokInTimeData.get("signtime");
String classStartTime = "";
if (point.split("\\|").length > 3 && !"0".equals(point.split("\\|")[3])){
//弹性上班
classStartTime=point.split("\\|")[3];
}else {
classStartTime=point.split("\\|")[0];
String classStartTime = clcokInTimedto.getClassTime();
if (clcokInTimedto.getElasticTime() != null && !"".equals(clcokInTimedto.getElasticTime())){
classStartTime = clcokInTimedto.getElasticTime();
}
int between = Utils.removeRestTime(classStartTime,clockInTime,scheduleResult,analysisDate);
@ -239,7 +237,7 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
//人员
String userId = Util.null2String(params.get("userId"));
//卡点
String point = Util.null2String(params.get("point"));
ClockPointDTO clockPointDTO = (ClockPointDTO)params.get("point");
//请假集合
List<Map<String,Object>> askForLeaveList = (List<Map<String,Object>>)params.get("askForLeaveList");
//请假项目
@ -252,13 +250,11 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
List<Map<String,Object>> resultList = Lists.newArrayList();
String clockInTime = clcokInTimeData.get("signdate")+" "+clcokInTimeData.get("signtime");
String classEndTime = "";
if (point.split("\\|").length > 3 && !"0".equals(point.split("\\|")[3])){
//弹性下班
classEndTime=point.split("\\|")[3];
}else {
classEndTime=point.split("\\|")[0];
String classEndTime = clockPointDTO.getClassTime();
if (clockPointDTO.getElasticTime() != null && !"".equals(clockPointDTO.getElasticTime())){
classEndTime = clockPointDTO.getElasticTime();
}
int between = Utils.removeRestTime(clockInTime,classEndTime,scheduleResult,analysisDate);
Map<String,Object> earlyParams = Maps.newHashMap();

@ -1,7 +1,9 @@
package com.engine.attendance.attendanceanalysis.service.impl;
import com.engine.attendance.attendanceanalysis.cmd.*;
import com.engine.attendance.attendanceanalysis.cmd.getclockInpoint.AdjustByWorkOverTimeCmd;
import com.engine.attendance.attendanceanalysis.cmd.getclockInpoint.GetClockInPointCmd;
import com.engine.attendance.attendanceanalysis.dto.ClockPointDTO;
import com.engine.attendance.attendanceanalysis.service.UtilService;
import com.engine.attendance.component.persongroup.service.SchedulingResultsService;
import com.engine.attendance.component.persongroup.service.impl.SchedulingResultsServiceImpl;
@ -216,35 +218,30 @@ public class UtilServiceImpl extends Service implements UtilService {
}
@Override
public Map<String, Object> getNeedRecordClockInTime(List<Map<String,Map<String,Object>>> clcokInTimeData) {
public Map<String, Object> getNeedRecordClockInTime(List<ClockPointDTO> clcokInTimeData) {
Map<String, Object> resultMap = Maps.newHashMap();
int inIndex = 1;
int outIndex = 1;
int jcCloumns = 8;
for (Map<String,Map<String,Object>> clcokInTimeMap : clcokInTimeData){
//卡点
String point = "";
for (ClockPointDTO clockPointDTO : clcokInTimeData){
//当天打卡数据
Map<String,Object> clcokInTime = null;
for (Map.Entry<String,Map<String,Object>> entry :clcokInTimeMap.entrySet()){
point = entry.getKey();
clcokInTime = entry.getValue();
}
Map<String,Object> clcokInTime = clockPointDTO.getClockTime();
//需要计算的班次打卡时间点
String pointTime = point.split("\\|")[0];
String pointTime = clockPointDTO.getClassTime();
//start开始打卡时间点end结束打卡时间点
String pointType = point.split("\\|")[1];
ClockPointEnum pointType = clockPointDTO.getPointType();
//empty:漏卡equal:打卡时间和班次时间相等before打卡时间在班次时间之前after打卡时间在班次时间之后
String timeType = point.split("\\|")[2];
ClockPointEnum timeType = clockPointDTO.getTimeType();
if (ClockPointEnum.START.getKey().equals(pointType)){
if (ClockPointEnum.START.equals(pointType)){
//开始时间打卡
if (outIndex-1>inIndex){
inIndex = outIndex;
}
String key = "j"+inIndex;
String ckey = "c"+inIndex;
if (!ClockPointEnum.EMPTY.getKey().equals(timeType) && clcokInTime != null){
if (!ClockPointEnum.EMPTY.equals(timeType) && clcokInTime != null){
String time = clcokInTime.get("signdate")+" "+clcokInTime.get("signtime");
String value = time;
@ -261,7 +258,7 @@ public class UtilServiceImpl extends Service implements UtilService {
resultMap.put(key,"NULL");
}
inIndex++;
}else if (ClockPointEnum.END.getKey().equals(pointType)){
}else if (ClockPointEnum.END.equals(pointType)){
//结束时间打卡
if (inIndex-1>outIndex){
@ -269,7 +266,7 @@ public class UtilServiceImpl extends Service implements UtilService {
}
String key = "c"+outIndex;
String jkey = "j"+inIndex;
if (!ClockPointEnum.EMPTY.getKey().equals(timeType) && clcokInTime != null){
if (!ClockPointEnum.EMPTY.equals(timeType) && clcokInTime != null){
String time = clcokInTime.get("signdate")+" "+clcokInTime.get("signtime");
String value = time;
String jtime = Util.null2String(resultMap.get(jkey));
@ -307,11 +304,11 @@ public class UtilServiceImpl extends Service implements UtilService {
* @return
*/
@Override
public List<Map<String, Map<String, Object>>> getClockInPointCmd(Map<String,Object> params) {
public List<ClockPointDTO> getClockInPointCmd(Map<String,Object> params) {
Map<String,Object> resultMap = commandExecutor.execute(new GetClockInPointCmd(params));
return (List<Map<String,Map<String,Object>>>)resultMap.get("clcokInTimeData");
// params.putAll(resultMap);
// resultMap = commandExecutor.execute(new AdjustByWorkOverTimeCmd(params));
return (List<ClockPointDTO>)resultMap.get("clcokInTimeData");
}
/**

@ -1,6 +1,7 @@
package com.engine.attendance.attendanceanalysis.service.impl;
import com.engine.attendance.attendanceanalysis.cmd.item.WorkOvertimeItemCmd;
import com.engine.attendance.attendanceanalysis.dto.ClockPointDTO;
import com.engine.attendance.attendanceanalysis.service.WorkOverTimeService;
import com.engine.attendance.enums.*;
import com.engine.common.util.DateUtil;
@ -38,7 +39,7 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
//外出项目
Map<String,Map<String,Object>> evectionItems = (Map<String,Map<String,Object>>)params.get("evectionItems");
//打卡卡点
List<Map<String,Map<String,Object>>> clcokInTimeList = (List<Map<String,Map<String,Object>>>)params.get("clcokInTimeList");
List<ClockPointDTO> clcokInTimeDataList = (List<ClockPointDTO>)params.get("clcokInTimeData");
//请假后消除的异常
List<Map<String,Object>> offsetAskForLeaveAnomaly = (List<Map<String,Object>>)params.get("offsetAskForLeaveAnomaly");
//出差外出后消除的异常
@ -63,17 +64,12 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
long diffdays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
for (Map<String,Map<String,Object>> map :clcokInTimeList){
String point = "";
for (ClockPointDTO clockPointDTO :clcokInTimeDataList){
//当天打卡数据
Map<String,Object> clcokInTimeData = null;
for (Map.Entry<String,Map<String,Object>> entry :map.entrySet()){
point = entry.getKey();
clcokInTimeData = entry.getValue();
}
Map<String,Object> clcokInTime = clockPointDTO.getClockTime();
//需要计算的班次打卡时间点
String pointTime = point.split("\\|")[0];
clcokInTimeMap.put(pointTime.split(" ")[1],clcokInTimeData);
String pointTime = clockPointDTO.getClassTime();
clcokInTimeMap.put(pointTime,clcokInTime);
}
//人员
String userId = Util.null2String(params.get("userId"));
@ -85,11 +81,8 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
Map<String,Object> getWorkOverTimeParam = Maps.newHashMap();
Map<String,Object> workOverTimeItems = Maps.newHashMap();
//加班开始时间
String dtkssj = Util.null2String(scheduleMap.get("dtkssj"));
//加班结束时间
String dtjssj = Util.null2String(scheduleMap.get("dtjssj"));
String kssj = Utils.getkssjTime(scheduleMap,analysisDate);
//加班结束时间
String jssj = Utils.getjssjTime(scheduleMap,analysisDate);
//加班实际开始时间
@ -168,9 +161,9 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
*
*/
if (CheckBoxEnum.CHECKED.getKey().equals(ksjbbxydk)){
Map<String,Object> clcokInTimeData = clcokInTimeMap.get(dtkssj);
Map<String,Object> clcokInTimeData = clcokInTimeMap.get(kssj);
if (clcokInTimeData == null){
log.info("加班开始时间漏卡: {},clcokInTimeData:{}",dtkssj,clcokInTimeMap);
log.info("加班开始时间漏卡: {},clcokInTimeData:{}",kssj,clcokInTimeMap);
workOverTimeItems.put("item",workTimeBeLateItems.get(0).get("key"));
workOverTimeItems.put("itemduration","0");
resultLists.add(workOverTimeItems);
@ -186,9 +179,9 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
realityStartTime = kssj;
}
if (CheckBoxEnum.CHECKED.getKey().equals(jsjbbxydk)){
Map<String,Object> clcokInTimeData = clcokInTimeMap.get(dtjssj);
Map<String,Object> clcokInTimeData = clcokInTimeMap.get(jssj);
if (clcokInTimeData == null){
log.info("加班结束时间漏卡: {},clcokInTimeData:{}",dtjssj,clcokInTimeData);
log.info("加班结束时间漏卡: {},clcokInTimeData:{}",jssj,clcokInTimeData);
workOverTimeItems.put("item",workTimeBeLateItems.get(0).get("key"));
workOverTimeItems.put("itemduration","0");
resultLists.add(workOverTimeItems);
@ -220,7 +213,7 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
/**
*
*/
List<Map<String,Object>> beLateAbnormal = abnormalClockInList.stream().filter(e->e.get("pointTime").toString().split(" ")[1].equals(dtkssj)).collect(Collectors.toList());
List<Map<String,Object>> beLateAbnormal = abnormalClockInList.stream().filter(e->e.get("pointTime").equals(kssj)).collect(Collectors.toList());
double beLateTime = 0;
if (beLateAbnormal.size() >0){
String hsdw = Util.null2String(beLateAbnormal.get(0).get("hsdw"));
@ -243,7 +236,7 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
}else {
if (DateUtil.getTime(realityStartTime).compareTo(DateUtil.getTime(kssj)) >0){
beLateTime = DateUtil.getBetWeenMinutes(kssj,realityStartTime);
List<Map<String,Object>> collect1 = anomalyList.stream().filter(e->e.get("pointTime").toString().split(" ")[1].equals(dtkssj)).collect(Collectors.toList());
List<Map<String,Object>> collect1 = anomalyList.stream().filter(e->e.get("pointTime").equals(kssj)).collect(Collectors.toList());
if (!"".equals(jbwdhlfzs) && beLateTime < Integer.valueOf(jbwdhlfzs)){
beLateTime=0;
@ -258,7 +251,7 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
/**
* 退,退
*/
List<Map<String,Object>> leaveEarlyAbnormal = abnormalClockInList.stream().filter(e->e.get("pointTime").toString().split(" ")[1].equals(dtjssj)).collect(Collectors.toList());
List<Map<String,Object>> leaveEarlyAbnormal = abnormalClockInList.stream().filter(e->e.get("pointTime").equals(jssj)).collect(Collectors.toList());
double leaveElaryTime=0;
if (leaveEarlyAbnormal.size() > 0){
String hsdw = Util.null2String(leaveEarlyAbnormal.get(0).get("hsdw"));
@ -282,7 +275,7 @@ public class WorkOverTimeServiceImpl extends Service implements WorkOverTimeServ
}else {
if (DateUtil.getTime(realityEndime).compareTo(DateUtil.getTime(jssj)) <0){
leaveElaryTime = DateUtil.getBetWeenMinutes(realityEndime,jssj);
List<Map<String,Object>> collect2 = anomalyList.stream().filter(e->e.get("pointTime").toString().split(" ")[1].equals(dtjssj)).collect(Collectors.toList());
List<Map<String,Object>> collect2 = anomalyList.stream().filter(e->e.get("pointTime").equals(jssj)).collect(Collectors.toList());
if (!"".equals(jbzzhlfzs) && leaveElaryTime < Integer.valueOf(jbzzhlfzs)){
leaveElaryTime=0;
}

@ -41,11 +41,11 @@ public class AttendanceanalysisAction {
@Produces({"text/plain"})
public String getSchedulingData(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
Map<String,Object> paramMap = ParamUtil.request2Map(request);
Map<String,Object> paramMap = ParamUtil.request2Map(request);
// Map<String,Object> paramMap = Maps.newHashMap();
// paramMap.put("startDate","2024-05-08");
// paramMap.put("endDate","2024-05-08");
// paramMap.put("userIds","25");
// paramMap.put("startDate","2024-05-12");
// paramMap.put("endDate","2024-05-12");
// paramMap.put("userIds","23");
String startDate = Util.null2String(paramMap.get("startDate"));

@ -1,5 +1,6 @@
package com.engine.attendance.attendanceanalysis.wrapper;
import com.engine.attendance.attendanceanalysis.dto.ClockPointDTO;
import com.engine.attendance.attendanceanalysis.service.ComprehensiveWorkingHourService;
import com.engine.attendance.attendanceanalysis.service.UtilService;
import com.engine.attendance.attendanceanalysis.service.impl.ComprehensiveWorkingHourServiceImpl;
@ -210,10 +211,10 @@ public class AttendanceAnalysisWrapper extends Service {
clcokInTimeDataParam.put("clockInTimeList",clockInTimeList);
clcokInTimeDataParam.put("askForLeaveAndEvctionSchedule",askForLeaveAndEvctionSchedule);
//打卡卡点以及匹配的打卡时间
List<Map<String,Map<String,Object>>> clcokInTimeData = utilService.getClockInPointCmd(clcokInTimeDataParam);
List<ClockPointDTO> clcokInTimeData = utilService.getClockInPointCmd(clcokInTimeDataParam);
Map<String,Object> recordAbnormalParam = Maps.newHashMap();
recordAbnormalParam.put("clcokInTimeList",clcokInTimeData);
recordAbnormalParam.put("clcokInTimeData",clcokInTimeData);
recordAbnormalParam.put("attendanceItems",attendanceItems);
recordAbnormalParam.put("scheduleResult",scheduleResult);
recordAbnormalParam.put("analysisDate",analysisDate);

@ -1,6 +1,7 @@
package com.engine.attendance.attendanceanalysis.wrapper;
import com.engine.attendance.attendanceanalysis.dto.ClockPointDTO;
import com.engine.attendance.attendanceanalysis.service.*;
import com.engine.attendance.attendanceanalysis.service.impl.*;
import com.engine.attendance.enums.*;
@ -35,7 +36,7 @@ public class UpdateAttendanceResultWrapper extends Service {
* */
public List<Map<String,Object>> recordAbnormalClockIn(Map<String,Object> params){
//卡点
List<Map<String,Map<String,Object>>> clcokInTimeList = (List<Map<String,Map<String,Object>>>)params.get("clcokInTimeList");
List<ClockPointDTO> clcokInTimeDataList = (List<ClockPointDTO>)params.get("clcokInTimeData");
//考勤项目
List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)params.get("attendanceItems");
//排班
@ -59,38 +60,34 @@ public class UpdateAttendanceResultWrapper extends Service {
Map<String,List<Map<String, Object>>> endScheduleResult = scheduleResult.stream().collect(Collectors.groupingBy(e->e.get("dtjssj").toString()));
List<Map<String,Object>> resultList = Lists.newArrayList();
for (Map<String,Map<String,Object>> clcokInTimeMap :clcokInTimeList){
//卡点
String point = "";
for (ClockPointDTO clcokInTimedto :clcokInTimeDataList){
//当天打卡数据
Map<String,Object> clcokInTimeData = null;
for (Map.Entry<String,Map<String,Object>> entry :clcokInTimeMap.entrySet()){
point = entry.getKey();
clcokInTimeData = entry.getValue();
}
Map<String,Object> clcokInTimeData = clcokInTimedto.getClockTime();
//需要计算的班次打卡时间点
String pointTime = point.split("\\|")[0];
String pointTime = clcokInTimedto.getClassTime();
//start开始打卡时间点end结束打卡时间点
String pointType = point.split("\\|")[1];
ClockPointEnum pointType = clcokInTimedto.getPointType();
//empty:漏卡equal:打卡时间和班次时间相等before打卡时间在班次时间之前after打卡时间在班次时间之后
String timeType = point.split("\\|")[2];
ClockPointEnum timeType = clcokInTimedto.getTimeType();
//是否是请假、外出打卡
String evectionOrAskLeave = "";
if (point.split("\\|").length ==4){
evectionOrAskLeave = point.split("\\|")[3];
boolean ifevectionOrAskLeave = false;
if (ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey().equals(clcokInTimedto.getClassSegmentType()) ||
ClassSegmentTypeEnum.EVECTION.getKey().equals(clcokInTimedto.getClassSegmentType())){
ifevectionOrAskLeave = true;
}
//班次
Map<String, Object> classInfo = Maps.newHashMap();
if (ClockPointEnum.START.getKey().equals(pointType) && "".equals(evectionOrAskLeave)){
if (ClockPointEnum.START.equals(pointType) && !ifevectionOrAskLeave){
classInfo = startScheduleResult.get(pointTime.split(" ")[1]).get(0);
}else if (ClockPointEnum.END.getKey().equals(pointType) && "".equals(evectionOrAskLeave)){
}else if (ClockPointEnum.END.equals(pointType) && !ifevectionOrAskLeave){
classInfo = endScheduleResult.get(pointTime.split(" ")[1]).get(0);
}else if (ClockPointEnum.START.getKey().equals(pointType) && "0".equals(evectionOrAskLeave)){
}else if (ClockPointEnum.START.equals(pointType) && ifevectionOrAskLeave){
classInfo = endScheduleResult.get(pointTime.split(" ")[1]).get(0);
}else if (ClockPointEnum.END.getKey().equals(pointType) && "0".equals(evectionOrAskLeave)){
}else if (ClockPointEnum.END.equals(pointType) && ifevectionOrAskLeave){
classInfo = startScheduleResult.get(pointTime.split(" ")[1]).get(0);
}
if (ClockPointEnum.EMPTY.getKey().equals(timeType) || clcokInTimeData == null){
if (ClockPointEnum.EMPTY.equals(timeType) || clcokInTimeData == null){
//漏卡
Map<String,Object> missCardParams = Maps.newHashMap();
missCardParams.put("classInfo",classInfo);
@ -98,7 +95,7 @@ public class UpdateAttendanceResultWrapper extends Service {
missCardParams.put("attendanceItems",attendanceItems);
missCardParams.put("analysisDate",analysisDate);
missCardParams.put("userId",userId);
missCardParams.put("point",point);
missCardParams.put("point",clcokInTimedto);
missCardParams.put("scheduleResult",scheduleResult);
log.info("missCardParams classInfo: [{}],clcokInTimeData:[{}]",classInfo,clcokInTimeData);
List<Map<String,Object>> iforgetClockIn = forgetClockInService.forgetClockIn(missCardParams);
@ -108,7 +105,7 @@ public class UpdateAttendanceResultWrapper extends Service {
resultList.add(iforgetClockIn.get(0));
}
}else if (ClockPointEnum.START.getKey().equals(pointType) && ClockPointEnum.AFTER.getKey().equals(timeType)){
}else if (ClockPointEnum.START.equals(pointType) && ClockPointEnum.AFTER.equals(timeType)){
//迟到
Map<String,Object> beLateParams = Maps.newHashMap();
beLateParams.put("classInfo",classInfo);
@ -116,7 +113,7 @@ public class UpdateAttendanceResultWrapper extends Service {
beLateParams.put("attendanceItems",attendanceItems);
beLateParams.put("analysisDate",analysisDate);
beLateParams.put("userId",userId);
beLateParams.put("point",point);
beLateParams.put("point",clcokInTimedto);
beLateParams.put("askForLeaveList",askForLeaveList);
beLateParams.put("askForLeaveItems",askForLeaveItems);
beLateParams.put("evectionList",evectionList);
@ -129,7 +126,7 @@ public class UpdateAttendanceResultWrapper extends Service {
ifBeLate.get(0).put("bdlx",classInfo.get("bdlx"));
resultList.add(ifBeLate.get(0));
}
}else if (ClockPointEnum.END.getKey().equals(pointType) && ClockPointEnum.BEFORE.getKey().equals(timeType)){
}else if (ClockPointEnum.END.equals(pointType) && ClockPointEnum.BEFORE.equals(timeType)){
//早退
Map<String,Object> leaveEarlyParams = Maps.newHashMap();
leaveEarlyParams.put("classInfo",classInfo);
@ -137,7 +134,7 @@ public class UpdateAttendanceResultWrapper extends Service {
leaveEarlyParams.put("attendanceItems",attendanceItems);
leaveEarlyParams.put("analysisDate",analysisDate);
leaveEarlyParams.put("userId",userId);
leaveEarlyParams.put("point",point);
leaveEarlyParams.put("point",clcokInTimedto);
leaveEarlyParams.put("askForLeaveList",askForLeaveList);
leaveEarlyParams.put("askForLeaveItems",askForLeaveItems);
leaveEarlyParams.put("evectionList",evectionList);

@ -284,7 +284,7 @@ public class DateUtil {
*
*/
public static String getCurrentHalfYear(String date){
String season1 = date.split("-")[0]+"-06-31";
String season1 = date.split("-")[0]+"-06-30";
if (DateUtil.getTime(date).compareTo(DateUtil.getTime(season1)) <=0){
return season1;

@ -220,8 +220,8 @@ public class Utils<T> {
* @param clockInTimeList
* @return
*/
public static Map<String,Map<String,Object>> getNearestClcokInTimeCmd(String time,List<Map<String, Object>> clockInTimeList){
Map<String,Map<String,Object>> resultMap = Maps.newHashMap();
public static Map<ClockPointEnum,Map<String,Object>> getNearestClcokInTimeCmd(String time,List<Map<String, Object>> clockInTimeList){
Map<ClockPointEnum,Map<String,Object>> resultMap = Maps.newHashMap();
for (int i=0;i<clockInTimeList.size();i++){
String signDateTime = clockInTimeList.get(i).get("signdate") +" "+clockInTimeList.get(i).get("signtime");
int j=i+1;
@ -230,14 +230,14 @@ public class Utils<T> {
}
String afterSignDateTime = clockInTimeList.get(j).get("signdate") +" "+clockInTimeList.get(j).get("signtime");
if (i==0 && DateUtil.getTime(time).compareTo(DateUtil.getTime(signDateTime)) <0){
resultMap.put(ClockPointEnum.AFTER.getKey(),clockInTimeList.get(i));
resultMap.put(ClockPointEnum.AFTER,clockInTimeList.get(i));
}else if (i == clockInTimeList.size()-1 && DateUtil.getTime(time).compareTo(DateUtil.getTime(signDateTime)) >0){
resultMap.put(ClockPointEnum.BEFORE.getKey(),clockInTimeList.get(i));
resultMap.put(ClockPointEnum.BEFORE,clockInTimeList.get(i));
}else if (DateUtil.getTime(time).compareTo(DateUtil.getTime(signDateTime)) >0 && DateUtil.getTime(time).compareTo(DateUtil.getTime(afterSignDateTime)) <0){
resultMap.put(ClockPointEnum.BEFORE.getKey(),clockInTimeList.get(i));
resultMap.put(ClockPointEnum.AFTER.getKey(),clockInTimeList.get(j));
resultMap.put(ClockPointEnum.BEFORE,clockInTimeList.get(i));
resultMap.put(ClockPointEnum.AFTER,clockInTimeList.get(j));
}else if (DateUtil.getTime(time).compareTo(DateUtil.getTime(signDateTime)) == 0){
resultMap.put(ClockPointEnum.EQUAL.getKey(),clockInTimeList.get(i));
resultMap.put(ClockPointEnum.EQUAL,clockInTimeList.get(i));
}
}
return resultMap;

@ -7,7 +7,9 @@ import weaver.hrm.company.SubCompanyComInfo;
import java.util.Map;
public class Test extends beforlog{
public class
Test extends beforlog{
@org.junit.Test
public void testAnalysis() throws Exception{

@ -8,6 +8,7 @@ import com.engine.common.util.Utils;
import com.google.common.collect.Maps;
import org.junit.Test;
import java.util.List;
import java.util.Map;
public class Test1 extends beforlog{
@ -23,5 +24,17 @@ public class Test1 extends beforlog{
params.put("releaseDate","");
params.put("cover",1);
basicsetService.generateVocation(params);
}
public int getScheduleIndex(){
int j = -1;
for (int i =0;i<10;i++){
if (i == 2){
return i;
}
j = i;
}
return j;
}
}

Loading…
Cancel
Save