|
@@ -57,6 +57,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
private StudentExtracurricularExercisesSituationDao studentExtracurricularExercisesSituationDao;
|
|
|
@Autowired
|
|
|
private StudentExtracurricularExercisesSituationService studentExtracurricularExercisesSituationService;
|
|
|
+ @Autowired
|
|
|
+ private ClassGroupDao classGroupDao;
|
|
|
|
|
|
private static ThreadLocal<Set<Integer>> organIds = new ThreadLocal<Set<Integer>>(){
|
|
|
@Override
|
|
@@ -292,6 +294,16 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
Date date = new Date();
|
|
|
|
|
|
List<IndexErrInfoDto> all = new ArrayList<>();
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
|
|
|
+ //如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
|
|
|
+ List<Long> classGroupIds = null;
|
|
|
+ Integer educationUserId = null;
|
|
|
+ if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
|
|
|
+ //获取教务老师关联的班级列表
|
|
|
+ classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
|
|
|
+ educationUserId = sysUser.getId();
|
|
|
+ }
|
|
|
|
|
|
if(IndexErrorType.MUSIC_PATROL.equals(errorType)){
|
|
|
IndexErrInfoDto<IndexErrInfoDto> one = new IndexErrInfoDto<>();
|
|
@@ -299,11 +311,11 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
one.setDesc(IndexErrorType.MUSIC_PATROL.getMsg());
|
|
|
List<IndexErrInfoDto> oneChild = new ArrayList<>();
|
|
|
|
|
|
- oneChild.add(new IndexErrInfoDto(IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE, IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE.getMsg(), indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds), null));
|
|
|
+ oneChild.add(new IndexErrInfoDto(IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE, IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE.getMsg(), indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds,educationUserId), null));
|
|
|
int errInspection = indexBaseMonthDataDao.queryErrInspection(organIds,startTime);
|
|
|
oneChild.add(new IndexErrInfoDto(IndexErrorType.MUSIC_PATROL_ITEM, IndexErrorType.MUSIC_PATROL_ITEM.getMsg(),errInspection, null));
|
|
|
|
|
|
- IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIds);
|
|
|
+ IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIds,educationUserId);
|
|
|
noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_CLASS_MUSIC_GROUP_STUDENT_INFO.getMsg());
|
|
|
oneChild.add(noClassMusicGroupStudentInfo);
|
|
|
|
|
@@ -319,8 +331,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
two.setDesc(IndexErrorType.STUDENT_INFO.getMsg());
|
|
|
List<IndexErrInfoDto> twoChild = new ArrayList<>();
|
|
|
|
|
|
- twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIds), indexBaseMonthDataDao.getNoPaymentMusicGroup(organIds)));
|
|
|
- List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds);
|
|
|
+ twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIds,educationUserId), Arrays.asList(educationUserId)));
|
|
|
+ List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds,educationUserId);
|
|
|
twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(), quitGroupNum));
|
|
|
// int attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),startTime);
|
|
|
// twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), attendanceInfo, null));
|
|
@@ -345,14 +357,14 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
int lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIdsStr,monthStr);
|
|
|
threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary, null));
|
|
|
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
|
|
|
Integer userId = null;
|
|
|
if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
|
|
|
userId = sysUser.getId();
|
|
|
}
|
|
|
-
|
|
|
- int courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds);
|
|
|
+ int courseTimeError = 0;
|
|
|
+ if(classGroupIds == null || classGroupIds.size() > 0){
|
|
|
+ courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds,classGroupIds);
|
|
|
+ }
|
|
|
threeChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TIME_ERROR, IndexErrorType.COURSE_TIME_ERROR.getMsg(), courseTimeError, null));
|
|
|
|
|
|
int inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr,startTime,userId);
|
|
@@ -375,10 +387,14 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
four.setDesc(IndexErrorType.ATTENDANCE_SERVE.getMsg());
|
|
|
List<IndexErrInfoDto> fourChild = new ArrayList<>();
|
|
|
|
|
|
- int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime);
|
|
|
+ int attendanceError = 0;
|
|
|
+ int noAttendance = 0;
|
|
|
+ if(classGroupIds == null || classGroupIds.size() > 0){
|
|
|
+ attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime,classGroupIds);
|
|
|
+ noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime,classGroupIds);
|
|
|
+ }
|
|
|
fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), attendanceError, null));
|
|
|
|
|
|
- int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime);
|
|
|
fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_NOT_A_CLASS, IndexErrorType.TEACHER_NOT_A_CLASS.getMsg(), noAttendance, null));
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
@@ -441,9 +457,19 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
if(StringUtils.isNotBlank(organIdsStr)){
|
|
|
organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
|
|
|
}
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
|
|
|
+ //如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
|
|
|
+ List<Long> classGroupIds = null;
|
|
|
+ Integer educationUserId = null;
|
|
|
+ if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
|
|
|
+ //获取教务老师关联的班级列表
|
|
|
+ classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
|
|
|
+ educationUserId = sysUser.getId();
|
|
|
+ }
|
|
|
Date date = new Date();
|
|
|
boolean flag1 = false;
|
|
|
- int countLessThenThreeClassGroupNum = indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds);
|
|
|
+ int countLessThenThreeClassGroupNum = indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds,educationUserId);
|
|
|
if(countLessThenThreeClassGroupNum > 0){
|
|
|
flag1 = true;
|
|
|
}
|
|
@@ -454,7 +480,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
}
|
|
|
}
|
|
|
if(!flag1){
|
|
|
- IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIds);
|
|
|
+ IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIds,educationUserId);
|
|
|
if(Objects.nonNull(noClassMusicGroupStudentInfo) && noClassMusicGroupStudentInfo.getNum() > 0){
|
|
|
flag1 = true;
|
|
|
}
|
|
@@ -462,13 +488,13 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
resultMap.put("musicPatrol",flag1);
|
|
|
boolean flag2 = false;
|
|
|
if(!flag2){
|
|
|
- int countNoPaymentStudentNum = indexBaseMonthDataDao.countNoPaymentStudentNum(organIds);
|
|
|
+ int countNoPaymentStudentNum = indexBaseMonthDataDao.countNoPaymentStudentNum(organIds,educationUserId);
|
|
|
if(countNoPaymentStudentNum > 0){
|
|
|
flag2 = true;
|
|
|
}
|
|
|
}
|
|
|
if(!flag2){
|
|
|
- List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds);
|
|
|
+ List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds,educationUserId);
|
|
|
if(quitGroupNum.size() > 0){
|
|
|
flag2 = true;
|
|
|
}
|
|
@@ -488,14 +514,15 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
flag3 = true;
|
|
|
}
|
|
|
}
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
|
|
|
Integer userId = null;
|
|
|
if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
|
|
|
userId = sysUser.getId();
|
|
|
}
|
|
|
if(!flag3){
|
|
|
- int courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds);
|
|
|
+ int courseTimeError = 0;
|
|
|
+ if(classGroupIds == null || classGroupIds.size() > 0){
|
|
|
+ courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds,classGroupIds);
|
|
|
+ }
|
|
|
if(courseTimeError > 0){
|
|
|
flag3 = true;
|
|
|
}
|
|
@@ -522,13 +549,19 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
|
|
|
boolean flag4 = false;
|
|
|
if(!flag4){
|
|
|
- int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime);
|
|
|
+ int attendanceError = 0;
|
|
|
+ if(classGroupIds == null || classGroupIds.size() > 0){
|
|
|
+ attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime,classGroupIds);
|
|
|
+ }
|
|
|
if(attendanceError > 0){
|
|
|
flag4 = true;
|
|
|
}
|
|
|
}
|
|
|
if(!flag4){
|
|
|
- int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime);
|
|
|
+ int noAttendance = 0;
|
|
|
+ if(classGroupIds == null || classGroupIds.size() > 0){
|
|
|
+ noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime,classGroupIds);
|
|
|
+ }
|
|
|
if(noAttendance > 0){
|
|
|
flag4 = true;
|
|
|
}
|