|
|
@@ -19,6 +19,7 @@ import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.attendance.dto.AttendanceStatisticDto;
|
|
|
import com.xjrsoft.module.attendance.dto.TeacherDetailsDto;
|
|
|
import com.xjrsoft.module.attendance.entity.AttendanceRuleCategory;
|
|
|
+import com.xjrsoft.module.attendance.entity.AttendanceUserRelation;
|
|
|
import com.xjrsoft.module.attendance.service.IAttendanceRuleCategoryService;
|
|
|
import com.xjrsoft.module.attendance.service.ITeacherAttendanceRecordService;
|
|
|
import com.xjrsoft.module.attendance.vo.TeacherStatisticsPageVo;
|
|
|
@@ -81,15 +82,30 @@ public class StatisticsController {
|
|
|
@GetMapping(value = "/teacher-statistics")
|
|
|
@ApiOperation(value = "教职工考勤统计")
|
|
|
@SaCheckPermission("statistics:detail")
|
|
|
- @XjrLog(value = "", saveResponseData = true)
|
|
|
+ @XjrLog(value = "教职工考勤统计", saveResponseData = true)
|
|
|
public RT<TeacherStatisticsVo> teacherStatistics(@Valid AttendanceStatisticDto dto) {
|
|
|
TeacherStatisticsVo statisticsVo = new TeacherStatisticsVo();
|
|
|
+
|
|
|
+ if(dto.getRuleCategoryId() == null){
|
|
|
+ AttendanceRuleCategory ruleCategory = ruleCategoryService.getOne(
|
|
|
+ new QueryWrapper<AttendanceRuleCategory>().lambda()
|
|
|
+ .eq(AttendanceRuleCategory::getIsDefaultShow, 1)
|
|
|
+ .eq(AttendanceRuleCategory::getRoleId, 2)
|
|
|
+ );
|
|
|
+ if(ruleCategory != null){
|
|
|
+ dto.setRuleCategoryId(ruleCategory.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//查询总人数
|
|
|
MPJLambdaWrapper<XjrUser> queryWrapper = MPJWrappers.<XjrUser>lambdaJoin()
|
|
|
- .disableSubLogicDel()
|
|
|
+ .disableLogicDel()
|
|
|
.eq(ObjectUtil.isNotNull(dto.getDeptId()), UserDeptRelation::getDeptId, dto.getDeptId())
|
|
|
+ .eq(AttendanceUserRelation::getAttendanceRuleCategoryId, dto.getRuleCategoryId())
|
|
|
.innerJoin(BaseTeacher.class, BaseTeacher::getUserId, XjrUser::getId)
|
|
|
- .innerJoin(UserDeptRelation.class, UserDeptRelation::getUserId, XjrUser::getId);
|
|
|
+ .innerJoin(UserDeptRelation.class, UserDeptRelation::getUserId, XjrUser::getId)
|
|
|
+ .innerJoin(AttendanceUserRelation.class, AttendanceUserRelation::getUserId, XjrUser::getId);
|
|
|
long allCount = xjrUserService.count(queryWrapper);
|
|
|
statisticsVo.setAllCount(allCount);
|
|
|
|