|
@@ -339,7 +339,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> getIndexErrData(String organIdsStr) {
|
|
|
+ public Map<String, Object> getIndexErrData(String organIdsStr, IndexErrorType errorType) {
|
|
|
Set<Integer> organIds = null;
|
|
|
if(StringUtils.isNotBlank(organIdsStr)){
|
|
|
organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
|
|
@@ -348,69 +348,75 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
|
|
|
List<IndexErrInfoDto> all = new ArrayList<>();
|
|
|
|
|
|
- IndexErrInfoDto<IndexErrInfoDto> one = new IndexErrInfoDto<>();
|
|
|
- one.setErrorType(IndexErrorType.MUSIC_PATROL);
|
|
|
- one.setDesc(IndexErrorType.MUSIC_PATROL.getMsg());
|
|
|
- List<IndexErrInfoDto> oneChild = new ArrayList<>();
|
|
|
+ if(IndexErrorType.MUSIC_PATROL.equals(errorType)){
|
|
|
+ IndexErrInfoDto<IndexErrInfoDto> one = new IndexErrInfoDto<>();
|
|
|
+ one.setErrorType(IndexErrorType.MUSIC_PATROL);
|
|
|
+ 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), indexBaseMonthDataDao.getLessThenThreeMusicGroup(organIds)));
|
|
|
- List<Long> errInspection = indexBaseMonthDataDao.queryErrInspection(organIds);
|
|
|
- oneChild.add(new IndexErrInfoDto(IndexErrorType.MUSIC_PATROL_ITEM, IndexErrorType.MUSIC_PATROL_ITEM.getMsg(),errInspection.size(), errInspection));
|
|
|
+ oneChild.add(new IndexErrInfoDto(IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE, IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE.getMsg(), indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds), indexBaseMonthDataDao.getLessThenThreeMusicGroup(organIds)));
|
|
|
+ List<Long> errInspection = indexBaseMonthDataDao.queryErrInspection(organIds);
|
|
|
+ oneChild.add(new IndexErrInfoDto(IndexErrorType.MUSIC_PATROL_ITEM, IndexErrorType.MUSIC_PATROL_ITEM.getMsg(),errInspection.size(), errInspection));
|
|
|
|
|
|
- one.setNum(oneChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
|
|
|
- one.setResult(oneChild);
|
|
|
- all.add(one);
|
|
|
+ one.setNum(oneChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
|
|
|
+ one.setResult(oneChild);
|
|
|
+ all.add(one);
|
|
|
+ }
|
|
|
|
|
|
+ Date firstDayOfMonth = DateUtil.getFirstDayOfMonth(DateUtil.addMonths(date, -1));
|
|
|
|
|
|
- IndexErrInfoDto<IndexErrInfoDto> two = new IndexErrInfoDto<>();
|
|
|
- two.setErrorType(IndexErrorType.STUDENT_INFO);
|
|
|
- two.setDesc(IndexErrorType.STUDENT_INFO.getMsg());
|
|
|
- List<IndexErrInfoDto> twoChild = new ArrayList<>();
|
|
|
+ if(IndexErrorType.STUDENT_INFO.equals(errorType)){
|
|
|
|
|
|
- Date firstDayOfMonth = DateUtil.getFirstDayOfMonth(DateUtil.addMonths(date, -1));
|
|
|
+ IndexErrInfoDto<IndexErrInfoDto> two = new IndexErrInfoDto<>();
|
|
|
+ two.setErrorType(IndexErrorType.STUDENT_INFO);
|
|
|
+ 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_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(), quitGroupNum));
|
|
|
- List<Long> attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),firstDayOfMonth);
|
|
|
- twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), attendanceInfo.size(), attendanceInfo));
|
|
|
- List<Long> attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode(),null);
|
|
|
- twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), attendanceInfo1.size(), attendanceInfo1));
|
|
|
- two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
|
|
|
- two.setResult(twoChild);
|
|
|
- all.add(two);
|
|
|
|
|
|
+ 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_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(), quitGroupNum));
|
|
|
+ List<Long> attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),firstDayOfMonth);
|
|
|
+ twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), attendanceInfo.size(), attendanceInfo));
|
|
|
+ List<Long> attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode(),null);
|
|
|
+ twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), attendanceInfo1.size(), attendanceInfo1));
|
|
|
+ two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
|
|
|
+ two.setResult(twoChild);
|
|
|
+ all.add(two);
|
|
|
+ }
|
|
|
|
|
|
- IndexErrInfoDto<IndexErrInfoDto> three = new IndexErrInfoDto<>();
|
|
|
- three.setErrorType(IndexErrorType.TEACHER_INFO);
|
|
|
- three.setDesc(IndexErrorType.TEACHER_INFO.getMsg());
|
|
|
- List<IndexErrInfoDto> threeChild = new ArrayList<>();
|
|
|
+ if(IndexErrorType.TEACHER_INFO.equals(errorType)){
|
|
|
+ IndexErrInfoDto<IndexErrInfoDto> three = new IndexErrInfoDto<>();
|
|
|
+ three.setErrorType(IndexErrorType.TEACHER_INFO);
|
|
|
+ three.setDesc(IndexErrorType.TEACHER_INFO.getMsg());
|
|
|
+ List<IndexErrInfoDto> threeChild = new ArrayList<>();
|
|
|
|
|
|
- List<Long> attendanceError = indexBaseMonthDataDao.getAttendanceError(organIdsStr,firstDayOfMonth);
|
|
|
- threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), attendanceError.size(), attendanceError));
|
|
|
+ List<Long> attendanceError = indexBaseMonthDataDao.getAttendanceError(organIdsStr,firstDayOfMonth);
|
|
|
+ threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), attendanceError.size(), attendanceError));
|
|
|
|
|
|
- List<Long> noAttendance = indexBaseMonthDataDao.getNoAttendance(organIdsStr,firstDayOfMonth);
|
|
|
- threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_NOT_A_CLASS, IndexErrorType.TEACHER_NOT_A_CLASS.getMsg(), noAttendance.size(), noAttendance));
|
|
|
+ List<Long> noAttendance = indexBaseMonthDataDao.getNoAttendance(organIdsStr,firstDayOfMonth);
|
|
|
+ threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_NOT_A_CLASS, IndexErrorType.TEACHER_NOT_A_CLASS.getMsg(), noAttendance.size(), noAttendance));
|
|
|
|
|
|
- List<Long> teacherLeave = indexBaseMonthDataDao.queryTeacherLeave(organIdsStr);
|
|
|
- threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_LEAVE, IndexErrorType.TEACHER_LEAVE.getMsg(),teacherLeave.size(), teacherLeave));
|
|
|
+ List<Long> teacherLeave = indexBaseMonthDataDao.queryTeacherLeave(organIdsStr);
|
|
|
+ threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_LEAVE, IndexErrorType.TEACHER_LEAVE.getMsg(),teacherLeave.size(), teacherLeave));
|
|
|
|
|
|
- String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
|
|
|
- List<Long> lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIdsStr,monthStr);
|
|
|
- threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary.size(), lowTeacherSalary));
|
|
|
+ String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
|
|
|
+ List<Long> lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIdsStr,monthStr);
|
|
|
+ threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary.size(), lowTeacherSalary));
|
|
|
|
|
|
- List<Long> inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr);
|
|
|
- threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM, IndexErrorType.INSPECTION_ITEM.getMsg(),inspectionItem.size(), inspectionItem));
|
|
|
+ List<Long> inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr);
|
|
|
+ threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM, IndexErrorType.INSPECTION_ITEM.getMsg(),inspectionItem.size(), inspectionItem));
|
|
|
|
|
|
- List<Long> inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organIdsStr);
|
|
|
- threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM_PLAN, IndexErrorType.INSPECTION_ITEM_PLAN.getMsg(),inspectionItemPlan.size(), inspectionItemPlan));
|
|
|
+ List<Long> inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organIdsStr);
|
|
|
+ threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM_PLAN, IndexErrorType.INSPECTION_ITEM_PLAN.getMsg(),inspectionItemPlan.size(), inspectionItemPlan));
|
|
|
|
|
|
- List<Long> studentVisit = indexBaseMonthDataDao.queryStudentVisit(organIdsStr);
|
|
|
- threeChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_VISIT, IndexErrorType.STUDENT_VISIT.getMsg(),studentVisit.size(), studentVisit));
|
|
|
+ List<Long> studentVisit = indexBaseMonthDataDao.queryStudentVisit(organIdsStr);
|
|
|
+ threeChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_VISIT, IndexErrorType.STUDENT_VISIT.getMsg(),studentVisit.size(), studentVisit));
|
|
|
|
|
|
- three.setNum(threeChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
|
|
|
- three.setResult(threeChild);
|
|
|
- all.add(three);
|
|
|
+ three.setNum(threeChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
|
|
|
+ three.setResult(threeChild);
|
|
|
+ all.add(three);
|
|
|
+ }
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(2);
|
|
|
result.put("totalNum", all.stream().mapToInt(IndexErrInfoDto::getNum).sum());
|