Quellcode durchsuchen

教材相关流程优化

大数据与最优化研究所 vor 5 Monaten
Ursprung
Commit
6e7f53b6da

+ 7 - 5
src/main/java/com/xjrsoft/module/textbook/controller/TextbookController.java

@@ -14,6 +14,7 @@ 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.BaseClassCourse;
 import com.xjrsoft.module.base.entity.BaseCourseSubject;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.service.IBaseSemesterService;
@@ -80,11 +81,11 @@ public class TextbookController {
                 .selectAs(BaseCourseSubject::getName, TextbookSubscriptionListVo::getCourseSubjectIdCn)
                 .selectSum(BaseClassMajorSet::getTotalStudent, TextbookSubscriptionListVo::getStudentSubscriptionNumber)
                 .select(Textbook.class, x -> VoToColumnUtil.fieldsToColumns(TextbookSubscriptionListVo.class).contains(x.getProperty()))
-                .leftJoin(TextbookClassRelation.class, TextbookClassRelation::getTextbookId, Textbook::getId)
-                .leftJoin(BaseClassMajorSet.class, BaseClassMajorSet::getClassId, TextbookClassRelation::getClassId)
+                .leftJoin(BaseClassCourse.class, BaseClassCourse::getCourseId, Textbook::getCourseSubjectId)
+                .leftJoin(BaseClassMajorSet.class, BaseClassMajorSet::getClassId, BaseClassCourse::getClassId)
                 .leftJoin(BaseCourseSubject.class, BaseCourseSubject::getId, Textbook::getCourseSubjectId)
-                .eq(dto.getBaseSemesterId() != null && dto.getBaseSemesterId() > 0, Textbook::getBaseSemesterId, dto.getBaseSemesterId())
-                .in(!classIdList.isEmpty(),TextbookClassRelation::getClassId, classIdList)
+                .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);
@@ -98,8 +99,9 @@ public class TextbookController {
         return RT.ok(pageOutput);
     }
 
+    // TODO 学生确认领取教材列表
     @GetMapping(value = "/page-consumption")
-    @ApiOperation(value="教材管理列表(分页,学生收费用)")
+    @ApiOperation(value="学生确认领取教材列表(分页,学生收费用)")
     @SaCheckPermission("textbook:detail")
     public RT<PageOutput<TextbookConsumptionPageVo>> pageConsumption(@Valid TextbookConsumptionPageDto dto){
         MPJLambdaWrapper<Textbook> textbookMPJLambdaWrapper = new MPJLambdaWrapper<>();

+ 1 - 1
src/main/resources/mapper/base/BaseClassCourse.xml

@@ -35,7 +35,7 @@
         LEFT JOIN xjr_department t4 ON t4.id = t.org_id
         WHERE t.delete_mark = 0
         <if test="dto.className != null and dto.className != ''">
-            and t.name = #{dto.className}
+            and t.name = like concat('%', #{dto.className}, '%')
         </if>
         <if test="dto.deptId != null">
             and t4.id = #{dto.deptId}