|
@@ -16,10 +16,16 @@ import com.ym.mec.web.dal.entity.StudentAttendance;
|
|
|
import com.ym.mec.web.dal.enums.StudentAttendanceStatusEnum;
|
|
|
import com.ym.mec.web.dal.page.StudentAttendanceQueryInfo;
|
|
|
import com.ym.mec.web.service.StudentAttendanceService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
|
-@Service
|
|
|
-public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentAttendance> implements StudentAttendanceService {
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
+@Service
|
|
|
+public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentAttendance> implements StudentAttendanceService {
|
|
|
+
|
|
|
@Autowired
|
|
|
private StudentAttendanceDao studentAttendanceDao;
|
|
|
|
|
@@ -38,30 +44,24 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public StudentAttendancePageInfo queryPage(QueryInfo queryInfo) {
|
|
|
- PageInfo<StudentAttendance> pageInfo = super.queryPage(queryInfo);
|
|
|
- StudentAttendancePageInfo studentAttendancePageInfo = new StudentAttendancePageInfo();
|
|
|
+ public Map<String, Object> getCurrentCourseStudents(QueryInfo queryInfo) {
|
|
|
+ Map<String,Object> result=new HashMap<>();
|
|
|
+
|
|
|
+ PageInfo pageInfo = super.queryPage(queryInfo);
|
|
|
|
|
|
- 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());
|
|
|
|
|
|
- stringIntegerMap.forEach(studentStatusCount -> {
|
|
|
- switch (studentStatusCount.getStudentStatus()) {
|
|
|
- case LEAVE:
|
|
|
- studentAttendancePageInfo.setNumberOfLeavePeoples(studentStatusCount.getNumberOfStudent());
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ stringIntegerMap.forEach(studentStatusCount->{
|
|
|
+ switch (studentStatusCount.getStudentStatus()){
|
|
|
+ case LEAVE:
|
|
|
+ result.put("numberOfLeavePeoples",studentStatusCount.getNumberOfStudent());
|
|
|
+ break;
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- return studentAttendancePageInfo;
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|