Commit b5082e9c authored by 赵啸非's avatar 赵啸非

修改本月统计

parent c238252f
...@@ -44,7 +44,7 @@ fi ...@@ -44,7 +44,7 @@ fi
if [ -e "$BASEDIR" ] if [ -e "$BASEDIR" ]
then then
JAVA_OPTS="-Xms256M -Xmx512M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH" JAVA_OPTS="-Xms512M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH"
fi fi
CLASSPATH=$CLASSPATH_PREFIX: CLASSPATH=$CLASSPATH_PREFIX:
......
...@@ -7,12 +7,14 @@ import com.alibaba.fastjson.JSON; ...@@ -7,12 +7,14 @@ import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DataUtil; import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.system.user.model.UserEntity; import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity; import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordHikQuery; import com.mortals.xhx.module.attendance.model.AttendanceRecordHikQuery;
import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService; import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService;
...@@ -22,6 +24,7 @@ import com.mortals.xhx.module.hik.door.service.IHikDoorService; ...@@ -22,6 +24,7 @@ import com.mortals.xhx.module.hik.door.service.IHikDoorService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -49,6 +52,8 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService { ...@@ -49,6 +52,8 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
private IHikDoorService hikDoorService; private IHikDoorService hikDoorService;
private Integer day; private Integer day;
@Autowired
private ICacheService cacheService;
@Override @Override
...@@ -179,6 +184,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService { ...@@ -179,6 +184,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
// recordHikService.save(saveRecordList); // recordHikService.save(saveRecordList);
} }
log.info("saveRecordList size:{}", saveRecordList.size()); log.info("saveRecordList size:{}", saveRecordList.size());
AttendanceRecordHikQuery hikQuery = new AttendanceRecordHikQuery();
hikQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
hikQuery.setAttendanceDateEnd(DateUtil.today());
Long totalCache = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count();
cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.format(new Date(), "yyyy-MM"), totalCache);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment