Commit d261530c authored by 姬鋆屾's avatar 姬鋆屾
parents c4bb2c2d 1a0aebd0
...@@ -193,10 +193,14 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -193,10 +193,14 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
StaffQuery staffQuery = new StaffQuery(); StaffQuery staffQuery = new StaffQuery();
staffQuery.setSource(1);
int totalPersonNum = staffService.count(staffQuery, this.getContext()); int totalPersonNum = staffService.count(staffQuery, this.getContext());
homeStatInfo.setTotalPersonNum(totalPersonNum); homeStatInfo.setTotalPersonNum(totalPersonNum);
staffQuery.setSource(1);
Integer totalAttendPersonNum = staffService.count(staffQuery, this.getContext());
int totalDeptNum = deptService.count(new DeptQuery(), getContext()); int totalDeptNum = deptService.count(new DeptQuery(), getContext());
homeStatInfo.setTotalDeptNum(totalDeptNum); homeStatInfo.setTotalDeptNum(totalDeptNum);
...@@ -222,11 +226,11 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -222,11 +226,11 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.format(new Date(), "yyyy-MM"), totalCache); 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)) { if (ObjectUtils.isEmpty(totalCache)) {
totalCache = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count(); totalCache = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count();
cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.yesterday().toDateStr(), totalCache); cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.yesterday().toDateStr(), totalCache);
} }*/
//迟到次数 //迟到次数
...@@ -269,19 +273,20 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -269,19 +273,20 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
//总打卡记录 //总打卡记录
long totalAttend = attendanceRecordEntities.parallelStream().flatMap(item -> item.getAttendanceRecordDetailList().parallelStream()).count(); /* long totalAttend = attendanceRecordEntities.parallelStream().flatMap(item -> item.getAttendanceRecordDetailList().parallelStream()).count();
long lackOfCardsAttend = attendanceRecordEntities.parallelStream() long lackOfCardsAttend = attendanceRecordEntities.parallelStream()
.flatMap(item -> item.getAttendanceRecordDetailList().stream()) .flatMap(item -> item.getAttendanceRecordDetailList().stream())
.filter(f -> GoWorkResultEnum.缺卡.getValue() == f.getGoWorkResult() || OffWorkResultEnum.缺卡.getValue() == f.getOffWorkResult()) .filter(f -> GoWorkResultEnum.缺卡.getValue() == f.getGoWorkResult() || OffWorkResultEnum.缺卡.getValue() == f.getOffWorkResult())
.count(); .count();*/
//异常考勤记录 //异常考勤记录
//未考勤 //未考勤
// long noAtt=lackOfCards; // long noAtt=lackOfCards;
long att = totalCache - lackOfCardsAttend - levealPersonNum; long att = totalAttendPersonNum - lackOfCards;
// long att = totalAttend - lackOfCardsAttend; // long att = totalAttend - lackOfCardsAttend;
if (att != 0L) { 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() + "%"); homeStatInfo.setAttendRadio(bigDecimal.toString() + "%");
} else { } else {
homeStatInfo.setAttendRadio("0%"); homeStatInfo.setAttendRadio("0%");
...@@ -291,7 +296,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -291,7 +296,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
homeStatInfo.setLatePersonNum(beLate); homeStatInfo.setLatePersonNum(beLate);
homeStatInfo.setLeftEarlyPersonNum(leaveEarly); homeStatInfo.setLeftEarlyPersonNum(leaveEarly);
homeStatInfo.setMissCardPersonNum(lackOfCards); homeStatInfo.setMissCardPersonNum(lackOfCards);
homeStatInfo.setAttendPersonNum(totalCache); homeStatInfo.setAttendPersonNum(totalAttendPersonNum);
data.put("homeStat", homeStatInfo); data.put("homeStat", homeStatInfo);
data.put("token", token); data.put("token", token);
......
...@@ -17,7 +17,7 @@ public class HomeStatInfo { ...@@ -17,7 +17,7 @@ public class HomeStatInfo {
private Integer totalDeptNum; private Integer totalDeptNum;
private Long attendPersonNum=0L; private Integer attendPersonNum=0;
private String attendRadio; private String attendRadio;
/** /**
......
...@@ -65,7 +65,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService { ...@@ -65,7 +65,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
} else { } else {
day = 0; 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(); //calculateAttendByDay();
} }
......
...@@ -177,7 +177,7 @@ public class FixWorkAttendance extends AttendanceWorkAbstract { ...@@ -177,7 +177,7 @@ public class FixWorkAttendance extends AttendanceWorkAbstract {
//判断考勤时间是否在下班打卡区间内 //判断考勤时间是否在下班打卡区间内
boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter); boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter);
if (goInTime == false && offInTime == false) { if (goInTime == false && offInTime == false) {
log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate())); // log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
continue; continue;
} }
if (goInTime) { if (goInTime) {
......
...@@ -183,7 +183,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract { ...@@ -183,7 +183,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
//判断考勤时间是否在下班打卡区间内 //判断考勤时间是否在下班打卡区间内
boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter); boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter);
if (goInTime == false && offInTime == false) { if (goInTime == false && offInTime == false) {
log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate())); // log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
continue; continue;
} }
if (goInTime) { if (goInTime) {
......
...@@ -136,6 +136,20 @@ public class DeptServiceImpl extends AbstractCRUDServiceImpl<DeptDao, DeptEntity ...@@ -136,6 +136,20 @@ public class DeptServiceImpl extends AbstractCRUDServiceImpl<DeptDao, DeptEntity
@Override @Override
public List<DeptTreeSelect> buildDeptTreeSelect(List<DeptEntity> list) { public List<DeptTreeSelect> buildDeptTreeSelect(List<DeptEntity> list) {
for (Iterator<DeptEntity> iterator = list.iterator(); iterator.hasNext(); ) {
DeptEntity deptEntity = iterator.next();
List<StaffEntity> staffEntities = staffService.find(new StaffQuery().deptId(deptEntity.getId()));
List<Map<String, Object>> personList = new ArrayList<>();
staffEntities.forEach(item -> {
Map<String, Object> map = new HashMap<>();
map.put("staffId", item.getId());
map.put("staffName", item.getName());
map.put("deptId", item.getDeptId());
personList.add(map);
});
deptEntity.setPersonList(personList);
}
//获取父节点 //获取父节点
List<DeptEntity> returnList = list.stream().filter(t -> t.getParentId() == 0).map( List<DeptEntity> returnList = list.stream().filter(t -> t.getParentId() == 0).map(
m -> { m -> {
......
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