Przeglądaj źródła

fix:课表列表当前页超过总页数报错

Joburgess 4 lat temu
rodzic
commit
f72b6c7f82

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -4392,7 +4392,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         }
         if (count > 0) {
             pageInfo.setTotal(count);
-            params.put("offset", pageInfo.getOffset());
+			MapUtil.populateMap(params, queryInfo);
             results = courseScheduleDao.endFindCourseSchedules(params);
             List<Long> courseScheduleIds = results.stream().map(CourseScheduleEndDto::getId).collect(Collectors.toList());
             //Map<Long, String> studentIdMap = MapUtil.convertIntegerMap(courseScheduleStudentPaymentDao.getStudentIdMap(courseScheduleIds));

+ 3 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/page/PageInfo.java

@@ -132,6 +132,9 @@ public class PageInfo<T> implements Serializable {
 	public void setTotal(int total) {
 		this.total = total;
 		this.totalPage=new BigDecimal(total).divide(new BigDecimal(limit),0,BigDecimal.ROUND_CEILING).intValue();
+		if(this.pageNo>total){
+			this.pageNo = total;
+		}
 	}
 
 	public List<T> getRows() {