|
@@ -5,12 +5,14 @@ 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.OutInStatusEnum;
|
|
|
import com.xjrsoft.common.enums.StudyStatusEnum;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.attendance.dto.AttendanceStatisticDto;
|
|
|
import com.xjrsoft.module.attendance.vo.TeacherStatisticsVo;
|
|
|
import com.xjrsoft.module.attendance.vo.VisitorInfoVo;
|
|
|
+import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.concat.service.IXjrUserService;
|
|
|
import com.xjrsoft.module.organization.entity.UserDeptRelation;
|
|
|
import com.xjrsoft.module.outint.entity.CarOutInRecord;
|
|
@@ -115,7 +117,7 @@ public class StatisticsController {
|
|
|
.le(CarOutInRecord::getRecordTime, endTime)
|
|
|
.eq("DATE_FORMAT(record_time, '%Y-%m-%d')", endTime.toLocalDate())
|
|
|
.ge(dto.getTimePeriod() == 2 && amEndTime != null, CarOutInRecord::getRecordTime, amEndTime)
|
|
|
- .eq(CarOutInRecord::getStatus, 0)
|
|
|
+ .eq(CarOutInRecord::getStatus, OutInStatusEnum.enter.getCode())
|
|
|
.orderByAsc(CarOutInRecord::getRecordTime)
|
|
|
);
|
|
|
|
|
@@ -165,10 +167,11 @@ public class StatisticsController {
|
|
|
MPJLambdaWrapper<XjrUser> queryWrapper = MPJWrappers.<XjrUser>lambdaJoin()
|
|
|
.disableSubLogicDel()
|
|
|
.distinct()
|
|
|
- .eq(ObjectUtil.isNotNull(dto.getGradeId()), BaseStudentSchoolRoll::getGradeId, dto.getGradeId())
|
|
|
+ .eq(ObjectUtil.isNotNull(dto.getGradeId()), BaseClass::getGradeId, dto.getGradeId())
|
|
|
.eq(BaseStudentSchoolRoll::getArchivesStatus, "FB2901")
|
|
|
.eq(ObjectUtil.isNotNull(dto.getClassId()), BaseStudentSchoolRoll::getClassId, dto.getClassId())
|
|
|
.innerJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, XjrUser::getId)
|
|
|
+ .innerJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId)
|
|
|
.innerJoin(BaseStudent.class, BaseStudent::getUserId, XjrUser::getId);
|
|
|
long allCount = xjrUserService.count(queryWrapper);
|
|
|
|
|
@@ -191,9 +194,15 @@ public class StatisticsController {
|
|
|
}
|
|
|
|
|
|
List<StudentOutInRecord> outInRecords = studentOutInRecordService.list(
|
|
|
- new QueryWrapper<StudentOutInRecord>().lambda()
|
|
|
- .between(StudentOutInRecord::getRecordTime, startTime, endTime)
|
|
|
- .eq(StudentOutInRecord::getStatus, 1)
|
|
|
+ new MPJLambdaWrapper<StudentOutInRecord>()
|
|
|
+ .select(StudentOutInRecord.class, x -> VoToColumnUtil.fieldsToColumns(StudentOutInRecord.class).contains(x.getProperty()))
|
|
|
+ .innerJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, StudentOutInRecord::getUserId)
|
|
|
+ .innerJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId)
|
|
|
+ .le(StudentOutInRecord::getRecordTime, endTime)
|
|
|
+ .eq("DATE_FORMAT(record_time, '%Y-%m-%d')", endTime.toLocalDate())
|
|
|
+ .eq(StudentOutInRecord::getStatus, OutInStatusEnum.enter.getCode())
|
|
|
+ .eq(ObjectUtil.isNotNull(dto.getClassId()), BaseStudentSchoolRoll::getClassId, dto.getClassId())
|
|
|
+ .eq(ObjectUtil.isNotNull(dto.getGradeId()), BaseClass::getGradeId, dto.getGradeId())
|
|
|
);
|
|
|
//实到人数
|
|
|
Set<Long> collect = outInRecords.stream().map(StudentOutInRecord::getUserId).collect(Collectors.toSet());
|