|
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
+import com.xjrsoft.common.enums.StudyStatusEnum;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.module.attendance.dto.AttendanceStatisticDto;
|
|
|
import com.xjrsoft.module.attendance.vo.TeacherStatisticsVo;
|
|
@@ -150,6 +151,9 @@ public class StatisticsController {
|
|
|
.innerJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, XjrUser::getId)
|
|
|
.innerJoin(BaseStudent.class, BaseStudent::getUserId, XjrUser::getId);
|
|
|
long allCount = xjrUserService.count(queryWrapper);
|
|
|
+
|
|
|
+ queryWrapper.eq(BaseStudentSchoolRoll::getStduyStatus, StudyStatusEnum.AttendDaySchool.getCode());
|
|
|
+ long attendDaySchoolCount = xjrUserService.count(queryWrapper);
|
|
|
statisticsVo.setAllCount(allCount);
|
|
|
if(dto.getDate() != null && !"".equals(dto.getDate())){
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE;
|
|
@@ -199,8 +203,8 @@ public class StatisticsController {
|
|
|
//计算出勤率
|
|
|
if(statisticsVo.getAllCount() != null && statisticsVo.getAllCount() != 0){
|
|
|
//最后通过总人数-实到人数-请假人数计算出缺勤人数
|
|
|
- statisticsVo.setAbsenteeismCount(statisticsVo.getAllCount() - statisticsVo.getLeaveCount() - statisticsVo.getActualCount());
|
|
|
- BigDecimal divide = BigDecimal.valueOf(statisticsVo.getActualCount()).divide(BigDecimal.valueOf(statisticsVo.getAllCount()), 4, RoundingMode.HALF_UP);
|
|
|
+ statisticsVo.setAbsenteeismCount(attendDaySchoolCount - statisticsVo.getLeaveCount() - statisticsVo.getActualCount());
|
|
|
+ BigDecimal divide = BigDecimal.valueOf(statisticsVo.getActualCount()).divide(BigDecimal.valueOf(attendDaySchoolCount), 4, RoundingMode.HALF_UP);
|
|
|
statisticsVo.setAttendanceRate(divide.doubleValue() + "");
|
|
|
}else{
|
|
|
statisticsVo.setAttendanceRate("0");
|