diff --git a/src/main/java/com/zhgd/xmgl/modules/project/entity/ProjectConfig.java b/src/main/java/com/zhgd/xmgl/modules/project/entity/ProjectConfig.java index 295591fbb..48adc5aec 100644 --- a/src/main/java/com/zhgd/xmgl/modules/project/entity/ProjectConfig.java +++ b/src/main/java/com/zhgd/xmgl/modules/project/entity/ProjectConfig.java @@ -76,4 +76,9 @@ public class ProjectConfig implements Serializable { private java.lang.Integer workTicketBindCamera; @ApiModelProperty(value = "1开启人脸录入时的人脸检测识别功能0不开启") private java.lang.Integer enableWorkerFaceCheck; + /** + * worker_month_attendance统计考勤时是否忽略员工打卡时的“进/出”方向标识,1忽略0不忽略 + */ + @ApiModelProperty(value = "worker_month_attendance统计考勤时是否忽略员工打卡时的“进/出”方向标识,1忽略0不忽略") + private java.lang.Integer ignoreWorkerMonthAttendanceInOut; } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerMonthAttendanceStatisticsServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerMonthAttendanceStatisticsServiceImpl.java index 56185a5f6..587e995aa 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerMonthAttendanceStatisticsServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerMonthAttendanceStatisticsServiceImpl.java @@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.worker.service.impl; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -10,7 +11,9 @@ import com.zhgd.jeecg.common.mybatis.EntityMap; import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl; import com.zhgd.xmgl.modules.govtapi.GovtOpenApiService; import com.zhgd.xmgl.modules.project.entity.Project; +import com.zhgd.xmgl.modules.project.entity.ProjectConfig; import com.zhgd.xmgl.modules.project.mapper.ProjectMapper; +import com.zhgd.xmgl.modules.project.service.IProjectConfigService; import com.zhgd.xmgl.modules.worker.entity.WorkerAttendanceRule; import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; import com.zhgd.xmgl.modules.worker.entity.WorkerMonthAttendanceDuration; @@ -21,7 +24,6 @@ import com.zhgd.xmgl.util.DateUtils; import com.zhgd.xmgl.util.EnvironmentUtil; import com.zhgd.xmgl.util.JxlExcelUtils; import com.zhgd.xmgl.util.ReflectUtils; -import lombok.extern.log4j.Log4j; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.math.NumberUtils; @@ -529,6 +531,9 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl getWorkerAttendanceType(String personSn, Long workerAttendanceRuleId, String passTime) { @@ -562,11 +567,14 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl list = workerAttendanceMapper.selectOneWorkerAttendance(param); if (list != null && !list.isEmpty()) { + ProjectConfig config = projectConfigService.getOne(new LambdaQueryWrapper() + .eq(ProjectConfig::getProjectSn, list.get(0).get("projectSn"))); + boolean ignoreInOut = config != null && Objects.equals(config.getIgnoreWorkerMonthAttendanceInOut(), 1); String maxTime = null; for (int i = 0; i < list.size(); i++) { EntityMap map = list.get(i); //2:出 - if (map.get("passType") != null && map.get("createTime") != null && NumberUtils.toInt(map.get("passType").toString()) == 2) { + if (map.get("createTime") != null && (ignoreInOut || (map.get("passType") != null && NumberUtils.toInt(map.get("passType").toString()) == 2))) { maxTime = map.get("createTime").toString(); break; } @@ -575,9 +583,11 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl= 0; i--) { Map map = list.get(i); //1:进 - if (map.get("passType") != null && map.get("createTime") != null && NumberUtils.toInt(map.get("passType").toString()) == 1) { - minTime = map.get("createTime").toString(); - break; + if (map.get("createTime") != null && (ignoreInOut || (map.get("passType") != null && NumberUtils.toInt(map.get("passType").toString()) == 1))) { + if (!Objects.equals(maxTime, map.get("createTime").toString())) { + minTime = map.get("createTime").toString(); + break; + } } } String startTimes = null;