From 5429de0196797a2274d6b0740d9bea97a8695026 Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Fri, 7 Nov 2025 16:12:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0worker=5Fmonth=5Fattendance?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=80=83=E5=8B=A4=E6=97=B6=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=BF=BD=E7=95=A5=E5=91=98=E5=B7=A5=E6=89=93=E5=8D=A1=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E2=80=9C=E8=BF=9B/=E5=87=BA=E2=80=9D=E6=96=B9?= =?UTF-8?q?=E5=90=91=E6=A0=87=E8=AF=86=EF=BC=8C1=E5=BF=BD=E7=95=A50?= =?UTF-8?q?=E4=B8=8D=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/project/entity/ProjectConfig.java | 5 +++++ ...rMonthAttendanceStatisticsServiceImpl.java | 20 ++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) 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;