|
|
@@ -80,24 +80,12 @@ public class TextbookController {
|
|
|
@SaCheckPermission("textbook:detail")
|
|
|
public RT<PageOutput<TextbookSubscriptionListVo>> pageSubscription(@Valid TextbookSubscriptionListDto dto){
|
|
|
List<String> classIdList = new ArrayList<>();
|
|
|
- if(dto.getClassIds() != null && !dto.getClassIds().equals("")){
|
|
|
+ if(dto.getClassIds() != null && !"".equals(dto.getClassIds())){
|
|
|
String[] classIdArr = dto.getClassIds().split(",");
|
|
|
classIdList = Arrays.asList(classIdArr);
|
|
|
}
|
|
|
-
|
|
|
- MPJLambdaWrapper<Textbook> textbookMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
|
|
- textbookMPJLambdaWrapper
|
|
|
- .select(Textbook::getId)
|
|
|
- .selectAs(Textbook::getId,TextbookSubscriptionListVo::getTextbookId)
|
|
|
- .selectAs(BaseCourseSubject::getName, TextbookSubscriptionListVo::getCourseName)
|
|
|
- .select(Textbook.class, x -> VoToColumnUtil.fieldsToColumns(TextbookSubscriptionListVo.class).contains(x.getProperty()))
|
|
|
- .leftJoin(BaseClassCourse.class, BaseClassCourse::getCourseId, Textbook::getCourseSubjectId)
|
|
|
- .leftJoin(BaseCourseSubject.class, BaseCourseSubject::getId, Textbook::getCourseSubjectId)
|
|
|
- .eq(dto.getBaseSemesterId() != null && dto.getBaseSemesterId() > 0, BaseClassCourse::getBaseSemesterId, dto.getBaseSemesterId())
|
|
|
- .in(!classIdList.isEmpty(),BaseClassCourse::getClassId, classIdList)
|
|
|
- .groupBy(Textbook::getId)
|
|
|
- ;
|
|
|
- IPage<TextbookSubscriptionListVo> page = textbookService.selectJoinListPage(ConventPage.getPage(dto),TextbookSubscriptionListVo.class,textbookMPJLambdaWrapper);
|
|
|
+ dto.setClassIdList(classIdList);
|
|
|
+ IPage<TextbookSubscriptionListVo> page = textbookService.getSubscriptionPageByClass(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
|
|
|
//获取所有班级的总人数
|
|
|
LambdaQueryWrapper<BaseClassMajorSet> baseClassMajorSetLambdaQueryWrapper = new LambdaQueryWrapper<>();
|