|
@@ -9,12 +9,13 @@ import com.ym.mec.web.dal.dto.StudentStatusCountUtilEntity;
|
|
import com.ym.mec.web.dal.entity.StudentAttendance;
|
|
import com.ym.mec.web.dal.entity.StudentAttendance;
|
|
import com.ym.mec.web.dal.enums.StudentAttendanceStatusEnum;
|
|
import com.ym.mec.web.dal.enums.StudentAttendanceStatusEnum;
|
|
import com.ym.mec.web.dal.page.StudentAttendanceQueryInfo;
|
|
import com.ym.mec.web.dal.page.StudentAttendanceQueryInfo;
|
|
-import com.ym.mec.web.dal.utilEntity.StudentAttendancePageInfo;
|
|
|
|
import com.ym.mec.web.service.StudentAttendanceService;
|
|
import com.ym.mec.web.service.StudentAttendanceService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentAttendance> implements StudentAttendanceService {
|
|
public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentAttendance> implements StudentAttendanceService {
|
|
@@ -37,28 +38,24 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public StudentAttendancePageInfo queryPage(QueryInfo queryInfo) {
|
|
|
|
|
|
+ public Map<String, Object> getCurrentCourseStudents(QueryInfo queryInfo) {
|
|
|
|
+ Map<String,Object> result=new HashMap<>();
|
|
|
|
+
|
|
PageInfo pageInfo = super.queryPage(queryInfo);
|
|
PageInfo pageInfo = super.queryPage(queryInfo);
|
|
- StudentAttendancePageInfo studentAttendancePageInfo = new StudentAttendancePageInfo();
|
|
|
|
|
|
|
|
- studentAttendancePageInfo.setPageNo(pageInfo.getPageNo());
|
|
|
|
- studentAttendancePageInfo.setOffset(pageInfo.getOffset());
|
|
|
|
- studentAttendancePageInfo.setLimit(pageInfo.getLimit());
|
|
|
|
- studentAttendancePageInfo.setTotalPage(pageInfo.getTotalPage());
|
|
|
|
- studentAttendancePageInfo.setTotal(pageInfo.getTotal());
|
|
|
|
- studentAttendancePageInfo.setRows(pageInfo.getRows());
|
|
|
|
|
|
+ result.put("pageInfo",pageInfo);
|
|
|
|
|
|
List<StudentStatusCountUtilEntity> stringIntegerMap = studentAttendanceDao.countStudentStatus(((StudentAttendanceQueryInfo) queryInfo).getClassId());
|
|
List<StudentStatusCountUtilEntity> stringIntegerMap = studentAttendanceDao.countStudentStatus(((StudentAttendanceQueryInfo) queryInfo).getClassId());
|
|
|
|
|
|
stringIntegerMap.forEach(studentStatusCount->{
|
|
stringIntegerMap.forEach(studentStatusCount->{
|
|
switch (studentStatusCount.getStudentStatus()){
|
|
switch (studentStatusCount.getStudentStatus()){
|
|
case LEAVE:
|
|
case LEAVE:
|
|
- studentAttendancePageInfo.setNumberOfLeavePeoples(studentStatusCount.getNumberOfStudent());
|
|
|
|
|
|
+ result.put("numberOfLeavePeoples",studentStatusCount.getNumberOfStudent());
|
|
break;
|
|
break;
|
|
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- return studentAttendancePageInfo;
|
|
|
|
|
|
+ return result;
|
|
}
|
|
}
|
|
}
|
|
}
|