Browse Source

学生确认教材领取记录列表(分页)

大数据与最优化研究所 7 months ago
parent
commit
44a82324d5

+ 6 - 6
src/main/java/com/xjrsoft/module/form/controller/FormExecuteController.java

@@ -222,14 +222,14 @@ public class FormExecuteController {
         return R.ok(formExecuteService.workFlowInfo(dto));
     }
 
-    //    @GetMapping(value = "/export")
-//    @ApiOperation(value = "导出")
-//    @XjrLog(value = "导出表单数据")
-//    public ResponseEntity<byte[]> export(@Valid FormExecuteListDto dto) throws IOException {
-    @PostMapping(value = "/export")
+    @GetMapping(value = "/export")
     @ApiOperation(value = "导出")
     @XjrLog(value = "导出表单数据")
-    public ResponseEntity<byte[]> export(@Valid @RequestBody FormExecuteListDto dto) throws IOException {
+    public ResponseEntity<byte[]> export(@Valid FormExecuteListDto dto) throws IOException {
+//    @PostMapping(value = "/export")
+//    @ApiOperation(value = "导出")
+//    @XjrLog(value = "导出表单数据")
+//    public ResponseEntity<byte[]> export(@Valid @RequestBody FormExecuteListDto dto) throws IOException {
         FormRelease formRelease = formReleaseService.getById(dto.getReleaseId());
         FormReleaseConfig formReleaseConfig = JSONUtil.toBean(formRelease.getConfigJson(), FormReleaseConfig.class);
         // 配置excel第一行字段名

+ 24 - 3
src/main/java/com/xjrsoft/module/textbook/controller/TextbookStudentClaimController.java

@@ -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);
     }

+ 2 - 1
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookStudentClaimServiceImpl.java

@@ -541,7 +541,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
                 .values()); // 转换回 List
 
         // 根据 baseSemesterIdCN 排序
-        lastMergedDistinctList.sort(Comparator.comparing(TextbookStudentSemesterVo::getBaseSemesterIdCN));
+        lastMergedDistinctList.sort(Comparator.comparing(TextbookStudentSemesterVo::getBaseSemesterIdCN).reversed());
 
         return lastMergedDistinctList;
     }
@@ -1215,6 +1215,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
                 .leftJoin(Textbook.class, Textbook::getId, WfTextbookClaimItem::getTextbookId)
                 .eq(WfTextbookClaim::getBaseSemesterId, dto.getBaseSemesterId())
                 .eq(WfTextbookClaim::getClassId, dto.getClassId())
+                .eq(WfTextbookClaim::getWorkflowStatus, 1)
         ;
         return wfTextbookClaimItemMapper.selectJoinList(TeacherConfirmBatchTextbookListVo.class, wfTextbookClaimItemMPJLambdaWrapper);
     }

+ 14 - 1
src/main/java/com/xjrsoft/module/textbook/vo/TextbookStudentClaimPageVo.java

@@ -28,12 +28,25 @@ public class TextbookStudentClaimPageVo {
      * 教材管理编号
      */
     @ApiModelProperty("教材管理编号")
-    private Long textbookId;
+    private String textbookId;
     /**
      * 书名
      */
     @ApiModelProperty("书名")
     private String bookName;
+
+    @ApiModelProperty("课程编号(base_course_subject)")
+    private String courseSubjectIdCn;
+
+    /**
+     * 出版社
+     */
+    @ApiModelProperty("出版社")
+    private String publishingHouse;
+
+    @ApiModelProperty("教材分类(xjr_dictionary_item[textbook_type])")
+    private String textbookTypeCn;
+
     /**
      * 定价(元)
      */

+ 1 - 0
src/main/resources/sqlScript/20250421_sql.sql

@@ -0,0 +1 @@
+ALTER TABLE professional_title ADD UNIQUE (professional_title_no);