Merge remote-tracking branch 'origin/master'

master
shijie 4 years ago
commit e16ccd2824
  1. 5
      src/main/java/com/yipin/liuwanr/controller/ExperimentallearningController.java
  2. 14
      src/main/java/com/yipin/liuwanr/service/ExperimentallearningService.java

@ -23,14 +23,13 @@ public class ExperimentallearningController {
* @return
*/
@GetMapping("/queryExperimentallearning")
Response queryExperimentallearning(@RequestParam Integer studentId,@RequestParam Integer courseId,
@RequestParam Integer pageNo,@RequestParam Integer pageSize) {
Response queryExperimentallearning(@RequestParam Integer studentId,@RequestParam Integer courseId) {
Response resp = new Response();
if(StringUtils.isEmpty(studentId)){
resp.setStatus(300);
resp.setMessage("学生信息为空");
}else {
HashMap<String, Object> ret = service.queryProject(studentId,courseId,pageNo, pageSize);
HashMap<String, Object> ret = service.queryProject(studentId,courseId);
int status = (int) ret.get("retcode");
if (status == 200) {
resp.setStatus(status);

@ -39,11 +39,10 @@ public class ExperimentallearningService {
* @param courseId
* @return
*/
public HashMap<String, Object> queryProject(Integer studentId, Integer courseId,Integer pageNo,Integer pageSize) {
public HashMap<String, Object> queryProject(Integer studentId, Integer courseId) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
if(!StringUtils.isEmpty(courseId)&&!StringUtils.isEmpty(studentId)){
PageHelper.startPage(pageNo, pageSize);
Integer experimentalClassId=mapper.queryExperimentalClassId(courseId,studentId);
List<Integer> projectIds = mapper.queryIsAttendance(studentId, courseId);
List<Project_Management> projects = mapper.getBycourseId(experimentalClassId,courseId);
@ -60,16 +59,7 @@ public class ExperimentallearningService {
projects.set(i, project);
}
}
PageInfo<Project_Management> info=new PageInfo<Project_Management>(projects);
int total1 = (int) info.getTotal();
int totalPages;
totalPages = total1 / pageSize;
if (total1 % pageSize != 0){
totalPages ++;
}
long total = total1;
resp.put("retvalue", new PageResult(total,projects,totalPages));
resp.put("retvalue", projects);
}
resp.put("retcode", 200);
}catch(Exception e){

Loading…
Cancel
Save