Преглед на файлове

教材征订明细调整

dzx преди 2 месеца
родител
ревизия
192a176b86
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      src/main/java/com/xjrsoft/module/textbook/controller/TextbookStudentClaimController.java

+ 5 - 1
src/main/java/com/xjrsoft/module/textbook/controller/TextbookStudentClaimController.java

@@ -62,10 +62,14 @@ public class TextbookStudentClaimController {
     @ApiOperation(value="学生教材认领记录列表(分页)")
     @SaCheckPermission("textbookstudentclaim:detail")
     public RT<PageOutput<TextbookStudentClaimPageVo>> page(@Valid TextbookStudentClaimPageDto dto){
+        long userId = StpUtil.getLoginIdAsLong();
         LambdaQueryWrapper<TextbookStudentClaim> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper
                 .orderByDesc(TextbookStudentClaim::getId)
-                .select(TextbookStudentClaim.class,x -> VoToColumnUtil.fieldsToColumns(TextbookStudentClaimPageVo.class).contains(x.getProperty()));
+                .select(TextbookStudentClaim.class,x -> VoToColumnUtil.fieldsToColumns(TextbookStudentClaimPageVo.class).contains(x.getProperty()))
+                .eq(dto.getStudentUserId() != null, TextbookStudentClaim::getStudentUserId, dto.getStudentUserId())
+                .eq(TextbookStudentClaim::getIsClaim, 1)
+        ;
         IPage<TextbookStudentClaim> page = textbookStudentClaimService.page(ConventPage.getPage(dto), queryWrapper);
         PageOutput<TextbookStudentClaimPageVo> pageOutput = ConventPage.getPageOutput(page, TextbookStudentClaimPageVo.class);
         return RT.ok(pageOutput);