Commit 289ce599 authored by 赵啸非's avatar 赵啸非

修改本月统计

parent 77267dbb
......@@ -193,10 +193,14 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
StaffQuery staffQuery = new StaffQuery();
staffQuery.setSource(1);
int totalPersonNum = staffService.count(staffQuery, this.getContext());
homeStatInfo.setTotalPersonNum(totalPersonNum);
staffQuery.setSource(1);
Integer totalAttendPersonNum = staffService.count(staffQuery, this.getContext());
int totalDeptNum = deptService.count(new DeptQuery(), getContext());
homeStatInfo.setTotalDeptNum(totalDeptNum);
......@@ -222,11 +226,11 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.format(new Date(), "yyyy-MM"), totalCache);
}*/
Long totalCache = cacheService.hget(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.yesterday().toDateStr(), Long.class);
/* Long totalCache = cacheService.hget(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.yesterday().toDateStr(), Long.class);
if (ObjectUtils.isEmpty(totalCache)) {
totalCache = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count();
cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.yesterday().toDateStr(), totalCache);
}
}*/
//迟到次数
......@@ -278,10 +282,10 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
//异常考勤记录
//未考勤
// long noAtt=lackOfCards;
long att = totalCache - lackOfCardsAttend - levealPersonNum;
long att = totalAttendPersonNum - lackOfCardsAttend;
// long att = totalAttend - lackOfCardsAttend;
if (att != 0L) {
BigDecimal bigDecimal = new BigDecimal(att).divide(new BigDecimal(totalCache), 4, BigDecimal.ROUND_CEILING).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_CEILING);
BigDecimal bigDecimal = new BigDecimal(att).divide(new BigDecimal(totalAttendPersonNum), 4, BigDecimal.ROUND_CEILING).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_CEILING);
homeStatInfo.setAttendRadio(bigDecimal.toString() + "%");
} else {
homeStatInfo.setAttendRadio("0%");
......@@ -291,7 +295,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
homeStatInfo.setLatePersonNum(beLate);
homeStatInfo.setLeftEarlyPersonNum(leaveEarly);
homeStatInfo.setMissCardPersonNum(lackOfCards);
homeStatInfo.setAttendPersonNum(totalCache);
homeStatInfo.setAttendPersonNum(totalAttendPersonNum);
data.put("homeStat", homeStatInfo);
data.put("token", token);
......
......@@ -17,7 +17,7 @@ public class HomeStatInfo {
private Integer totalDeptNum;
private Long attendPersonNum=0L;
private Integer attendPersonNum=0;
private String attendRadio;
/**
......
......@@ -65,7 +65,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
} else {
day = 0;
}
syncDoorEvents();
Date beginDateTime=DateUtil.parseDateTime(DateUtil.today()+" 08:00:00");
Date endDateTime=DateUtil.parseDateTime(DateUtil.today()+" 20:30:00");
boolean in = DateUtil.isIn(new Date(), beginDateTime, endDateTime);
if(in){
syncDoorEvents();
}
//calculateAttendByDay();
}
......
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