|
|
@@ -4,12 +4,17 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.annotation.XjrLog;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+import com.xjrsoft.module.base.entity.BaseCourseSubject;
|
|
|
+import com.xjrsoft.module.base.entity.CourseSubjectDetail;
|
|
|
+import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
import com.xjrsoft.module.textbook.dto.*;
|
|
|
+import com.xjrsoft.module.textbook.entity.Textbook;
|
|
|
import com.xjrsoft.module.textbook.entity.TextbookStudentClaim;
|
|
|
import com.xjrsoft.module.textbook.service.ITextbookStudentClaimService;
|
|
|
import com.xjrsoft.module.textbook.vo.*;
|
|
|
@@ -56,14 +61,30 @@ public class TextbookStudentClaimController {
|
|
|
@SaCheckPermission("textbookstudentclaim:detail")
|
|
|
@XjrLog(value = "学生确认教材领取记录列表(分页)")
|
|
|
public RT<PageOutput<TextbookStudentClaimPageVo>> page(@Valid TextbookStudentClaimPageDto dto) {
|
|
|
- LambdaQueryWrapper<TextbookStudentClaim> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ MPJLambdaWrapper<TextbookStudentClaim> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
queryWrapper
|
|
|
- .orderByDesc(TextbookStudentClaim::getId)
|
|
|
+ .disableSubLogicDel()
|
|
|
+ .select(TextbookStudentClaim::getId)
|
|
|
.select(TextbookStudentClaim.class, x -> VoToColumnUtil.fieldsToColumns(TextbookStudentClaimPageVo.class).contains(x.getProperty()))
|
|
|
+ .innerJoin(Textbook.class, Textbook::getId, TextbookStudentClaim::getTextbookId,
|
|
|
+ wrapper -> wrapper
|
|
|
+ .selectAs(Textbook::getBookName, TextbookStudentClaimPageVo::getBookName)
|
|
|
+ .selectAs(Textbook::getPublishingHouse, TextbookStudentClaimPageVo::getPublishingHouse)
|
|
|
+ .leftJoin(BaseCourseSubject.class, BaseCourseSubject::getId, Textbook::getCourseSubjectId,
|
|
|
+ wrap -> wrap
|
|
|
+ .selectAs(BaseCourseSubject::getName, TextbookStudentClaimPageVo::getCourseSubjectIdCn)
|
|
|
+ )
|
|
|
+ .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, Textbook::getTextbookType,
|
|
|
+ wrap -> wrap
|
|
|
+ .selectAs(DictionaryDetail::getName, TextbookStudentClaimPageVo::getTextbookTypeCn)
|
|
|
+ )
|
|
|
+ )
|
|
|
+ .eq(dto.getBaseSemesterId() != null, TextbookStudentClaim::getBaseSemesterId, dto.getBaseSemesterId())
|
|
|
.eq(dto.getStudentUserId() != null, TextbookStudentClaim::getStudentUserId, dto.getStudentUserId())
|
|
|
.eq(TextbookStudentClaim::getIsClaim, 1)
|
|
|
+ .orderByDesc(TextbookStudentClaim::getId)
|
|
|
;
|
|
|
- IPage<TextbookStudentClaim> page = textbookStudentClaimService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
+ IPage<TextbookStudentClaimPageVo> page = textbookStudentClaimService.selectJoinListPage(ConventPage.getPage(dto), TextbookStudentClaimPageVo.class, queryWrapper);
|
|
|
PageOutput<TextbookStudentClaimPageVo> pageOutput = ConventPage.getPageOutput(page, TextbookStudentClaimPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
|
}
|