|
|
@@ -40,13 +40,21 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
|
|
|
|
|
|
@Override
|
|
|
public Page<BaseStudentInfoPageVo> getMobilePage(Page<BaseStudentInfoPageVo> page, BaseStudentInfoPageDto dto) {
|
|
|
+
|
|
|
+ List<String> roleList = StpUtil.getRoleList();
|
|
|
+
|
|
|
long teacherId = StpUtil.getLoginIdAsLong();
|
|
|
List<BaseClass> classList = baseClassMapper.selectList(
|
|
|
new QueryWrapper<BaseClass>().lambda().eq(BaseClass::getTeacherId, teacherId)
|
|
|
);
|
|
|
-
|
|
|
- if(classList != null && !classList.isEmpty()){
|
|
|
- dto.setTeacherId(teacherId);
|
|
|
+ if(roleList.size() == 1 && roleList.contains("CLASSTE")){
|
|
|
+ if(classList != null && !classList.isEmpty()){
|
|
|
+ dto.setTeacherId(teacherId);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(classList != null && !classList.isEmpty() && dto.getClassId() == null){
|
|
|
+ dto.setClassId(classList.get(0).getId());
|
|
|
+ }
|
|
|
}
|
|
|
return baseStudentSchoolRollMapper.getMobilePage(page, dto);
|
|
|
}
|
|
|
@@ -76,7 +84,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
|
|
|
new QueryWrapper<BaseClass>().lambda().eq(BaseClass::getTeacherId, teacherId)
|
|
|
);
|
|
|
|
|
|
- if(classList != null && !classList.isEmpty()){
|
|
|
+ if (classList != null && !classList.isEmpty()) {
|
|
|
dto.setTeacherId(teacherId);
|
|
|
}
|
|
|
|
|
|
@@ -86,22 +94,39 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
|
|
|
BaseStudentInfoPageDataVo result = new BaseStudentInfoPageDataVo();
|
|
|
for (BaseStudentInfoCategoryVo categoryVo : genderCount) {
|
|
|
totalCount = totalCount + categoryVo.getNumber();
|
|
|
- if("男".equals(GenderDictionaryEnum.getValue(categoryVo.getCategory()))){
|
|
|
+ if ("男".equals(GenderDictionaryEnum.getValue(categoryVo.getCategory()))) {
|
|
|
result.setMaleCount(categoryVo.getNumber());
|
|
|
- }else if("女".equals(GenderDictionaryEnum.getValue(categoryVo.getCategory()))){
|
|
|
+ } else if ("女".equals(GenderDictionaryEnum.getValue(categoryVo.getCategory()))) {
|
|
|
result.setFemaleCount(categoryVo.getNumber());
|
|
|
}
|
|
|
}
|
|
|
result.setTotalCount(totalCount);
|
|
|
List<BaseStudentInfoCategoryVo> studyStatusCount = baseStudentSchoolRollMapper.getStudyStatusCount(dto);
|
|
|
+ int stayCount = 0;
|
|
|
+ int notStayCount = 0;
|
|
|
for (BaseStudentInfoCategoryVo categoryVo : studyStatusCount) {
|
|
|
- if(StudyStatusEnum.InResidence.getCode().equals(categoryVo.getCategory())){
|
|
|
- result.setStayCount(categoryVo.getNumber());
|
|
|
- }else if(StudyStatusEnum.AttendDaySchool.getCode().equals(categoryVo.getCategory())){
|
|
|
- result.setNotStayCount(categoryVo.getNumber());
|
|
|
+ if (StudyStatusEnum.InResidence.getCode().equals(categoryVo.getCategory())) {
|
|
|
+ stayCount = stayCount + categoryVo.getNumber();
|
|
|
+
|
|
|
+ if ("男".equals(GenderDictionaryEnum.getValue(categoryVo.getGender()))) {
|
|
|
+ result.setMaleStayCount(categoryVo.getNumber());
|
|
|
+ } else if ("女".equals(GenderDictionaryEnum.getValue(categoryVo.getGender()))) {
|
|
|
+ result.setFemaleStayCount(categoryVo.getNumber());
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if (StudyStatusEnum.AttendDaySchool.getCode().equals(categoryVo.getCategory())) {
|
|
|
+ notStayCount = notStayCount + categoryVo.getNumber();
|
|
|
+
|
|
|
+ if ("男".equals(GenderDictionaryEnum.getValue(categoryVo.getGender()))) {
|
|
|
+ result.setMaleNotStayCount(categoryVo.getNumber());
|
|
|
+ } else if ("女".equals(GenderDictionaryEnum.getValue(categoryVo.getGender()))) {
|
|
|
+ result.setFemaleNotStayCount(categoryVo.getNumber());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ result.setStayCount(stayCount);
|
|
|
+ result.setNotStayCount(notStayCount);
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
}
|