Browse Source

Merge remote-tracking branch 'origin/pre' into dev

# Conflicts:
#	src/main/java/com/xjrsoft/module/ledger/mapper/WfSubscriptionMapper.java
#	src/main/java/com/xjrsoft/module/ledger/service/impl/WfSubscriptionServiceImpl.java
#	src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionExcelVo.java
#	src/main/java/com/xjrsoft/module/textbook/controller/TextbookController.java
#	src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java
#	src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimExportQueryVo.java
#	src/main/resources/mapper/textbook/TextbookMapper.xml
dzx 1 năm trước cách đây
mục cha
commit
d9fcfb4244

+ 5 - 0
src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionPageVo.java

@@ -62,4 +62,9 @@ public class WfSubscriptionPageVo {
     @ApiModelProperty("编号")
     private String number;
 
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("流程名称")
+    @ApiModelProperty("流程名称")
+    private String flowName;
+
 }

+ 1 - 3
src/main/java/com/xjrsoft/module/textbook/controller/TextbookController.java

@@ -194,9 +194,7 @@ public class TextbookController {
             baseSemesterLambdaQueryWrapper
                     .eq(BaseSemester::getId, dto.getBaseSemesterId());
             BaseSemester baseSemester = baseSemesterService.getOne(baseSemesterLambdaQueryWrapper);
-            if(baseSemester != null){
-                baseSemesterCn = baseSemester.getName();
-            }
+            baseSemesterCn = baseSemester.getName();
         }
         String headTitle = "重庆市铜梁职业教育中心" + baseSemesterCn + "教材征订表";
         List<List<String>> headList = new ArrayList<>();

+ 21 - 62
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java

@@ -22,7 +22,6 @@ import com.xjrsoft.common.enums.WarehouseModeEnum;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.utils.excel.ExcelFillCellMergePrevColUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
-import com.xjrsoft.module.base.entity.BaseClassroom;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.mapper.BaseClassMapper;
 import com.xjrsoft.module.base.service.IBaseClassService;
@@ -41,7 +40,10 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.io.ByteArrayOutputStream;
 import java.math.BigDecimal;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -603,67 +605,24 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
             WriteTable writeSheetHeadTable = EasyExcel.writerTable(tableIndex).needHead(Boolean.TRUE).head(sheetHeadList).registerWriteHandler(sheetHeadColumn).build();
             excelWriter.write(new ArrayList<>(), writeSheet, writeSheetHeadTable);
 
-            //对返回的集合进行处理
-            //现针对学期进行分组
-            Map<Long, List<TextbookClaimExportQueryVo>> groupedBySemester = customerList.stream()
-                    .collect(Collectors.groupingBy(TextbookClaimExportQueryVo::getBaseSemesterId));
-
-            Iterator<Map.Entry<Long, List<TextbookClaimExportQueryVo>>> groupedBySemesterIterator = groupedBySemester.entrySet().iterator();
-            while (groupedBySemesterIterator.hasNext()) {
-                Map.Entry<Long, List<TextbookClaimExportQueryVo>> groupedBySemesterEntry = groupedBySemesterIterator.next();
-                Long key = groupedBySemesterEntry.getKey();
-                List<TextbookClaimExportQueryVo> value = groupedBySemesterEntry.getValue();
-
-                Map<Long, List<TextbookClaimExportQueryVo>> groupedBySemesterByClass = value.stream()
-                        .collect(Collectors.groupingBy(TextbookClaimExportQueryVo::getClassId));
-
-                Iterator<Map.Entry<Long, List<TextbookClaimExportQueryVo>>> groupedBySemesterByClassIdIterator = groupedBySemesterByClass.entrySet().iterator();
-                while (groupedBySemesterByClassIdIterator.hasNext()) {
-                    Map.Entry<Long, List<TextbookClaimExportQueryVo>> entry = groupedBySemesterByClassIdIterator.next();
-                    Long k = entry.getKey();
-                    List<TextbookClaimExportQueryVo> v = entry.getValue();
-
-                    //这是一个table的表头
-                    List<List<String>> tableHeadList = new ArrayList<List<String>>();
-                    tableHeadList.add(new ArrayList<String>(){{
-                        add("日期:" + v.get(0).getBaseSemesterIdCn() + " 班级:" + v.get(0).getClassIdCn() + " 班主任:" + v.get(0).getHeadTeacherName() + " 教室:" + v.get(0).getClassRoomName() + " ");
-                    }});
-                    //table的表头合并策略
-                    ExcelFillCellMergePrevColUtil tableHeadColumn = new ExcelFillCellMergePrevColUtil();
-                    tableHeadColumn.add(++rowIndex, 0, 9);
-                    //这是一个table表头的table
-                    WriteTable writeTableHeadTable = EasyExcel.writerTable(++tableIndex).needHead(Boolean.TRUE).head(tableHeadList).registerWriteHandler(tableHeadColumn).build();
-                    excelWriter.write(new ArrayList<>(), writeSheet, writeTableHeadTable);
-                    // 这里必须指定需要头,table 会继承sheet的配置,sheet配置了不需要,table 默认也是不需要
-                    WriteTable writeContentTable = EasyExcel.writerTable(++tableIndex).needHead(Boolean.TRUE).build();
-                    // 第一次写入会创建头
-                    excelWriter.write(v, writeSheet, writeContentTable);
-                    //添加小计
-                    ExcelFillCellMergePrevColUtil column = new ExcelFillCellMergePrevColUtil();
-                    //column.add(lsit.size() + 1, 0, 1);
-
-                    rowIndex += (1 + v.size());
-                }
+            for (int i = 0; i < 3; i++){
+                //这是一个table的表头
+                List<List<String>> tableHeadList = new ArrayList<List<String>>();
+                tableHeadList.add(new ArrayList<String>(){{
+                    add("日期:2023春期 班级:23数控1班 班主任:路童话 教室:4502");
+                }});
+                //table的表头合并策略
+                ExcelFillCellMergePrevColUtil tableHeadColumn = new ExcelFillCellMergePrevColUtil();
+                tableHeadColumn.add(++rowIndex, 0, 9);
+                //这是一个table表头的table
+                WriteTable writeTableHeadTable = EasyExcel.writerTable(++tableIndex).needHead(Boolean.TRUE).head(tableHeadList).registerWriteHandler(tableHeadColumn).build();
+                excelWriter.write(new ArrayList<>(), writeSheet, writeTableHeadTable);
+                // 这里必须指定需要头,table 会继承sheet的配置,sheet配置了不需要,table 默认也是不需要
+                WriteTable writeContentTable = EasyExcel.writerTable(++tableIndex).needHead(Boolean.TRUE).build();
+                // 第一次写入会创建头
+                excelWriter.write(customerList, writeSheet, writeContentTable);
+                rowIndex += (1 + customerList.size());
             }
-
-//            for (int i = 0; i < 3; i++){
-//                //这是一个table的表头
-//                List<List<String>> tableHeadList = new ArrayList<List<String>>();
-//                tableHeadList.add(new ArrayList<String>(){{
-//                    add("日期:2023春期 班级:23数控1班 班主任:路童话 教室:4502");
-//                }});
-//                //table的表头合并策略
-//                ExcelFillCellMergePrevColUtil tableHeadColumn = new ExcelFillCellMergePrevColUtil();
-//                tableHeadColumn.add(++rowIndex, 0, 9);
-//                //这是一个table表头的table
-//                WriteTable writeTableHeadTable = EasyExcel.writerTable(++tableIndex).needHead(Boolean.TRUE).head(tableHeadList).registerWriteHandler(tableHeadColumn).build();
-//                excelWriter.write(new ArrayList<>(), writeSheet, writeTableHeadTable);
-//                // 这里必须指定需要头,table 会继承sheet的配置,sheet配置了不需要,table 默认也是不需要
-//                WriteTable writeContentTable = EasyExcel.writerTable(++tableIndex).needHead(Boolean.TRUE).build();
-//                // 第一次写入会创建头
-//                excelWriter.write(customerList, writeSheet, writeContentTable);
-//                rowIndex += (1 + customerList.size());
-//            }
         }
 
         // EasyExcel.write(bot, TextbookClaimExportQueryVo.class).automaticMergeHead(true).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);

+ 0 - 15
src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimExportQueryVo.java

@@ -20,26 +20,11 @@ public class TextbookClaimExportQueryVo {
     @ExcelIgnore
     private Long baseSemesterId;
 
-    @ExcelIgnore
-    private String baseSemesterIdCn;
-
     @ExcelIgnore
     private Long classId;
 
-    @ExcelIgnore
-    private String classIdCn;
-
-    @ExcelIgnore
-    private String headTeacherName;
-
-    @ExcelIgnore
-    private String classRoomName;
-
     @ExcelIgnore
     private Long textbookId;
-
-    @ExcelIgnore
-    private String textbookIdCn;
     /**
      * 教材类型(xjr_dictionary_item[textbook_type])
      */

+ 11 - 20
src/main/resources/mapper/textbook/TextbookMapper.xml

@@ -186,13 +186,13 @@
         <if test="dto.textbookType != null and dto.textbookType != ''">
             and t1.textbook_type = #{dto.textbookType}
         </if>
-        <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
+        <if test="dto.baseSemesterId != null">
             and t1.base_semester_id = #{dto.baseSemesterId}
         </if>
-        <if test="dto.subjectGroupId != null and dto.subjectGroupId > 0">
+        <if test="dto.subjectGroupId != null">
             and t1.subject_group_id = #{dto.subjectGroupId}
         </if>
-        <if test="dto.courseSubjectId != null and dto.courseSubjectId > 0">
+        <if test="dto.courseSubjectId != null">
             and t1.course_subject_id = #{dto.courseSubjectId}
         </if>
         <if test="dto.bookName != null and dto.bookName != ''">
@@ -238,13 +238,13 @@
         <if test="dto.textbookType != null and dto.textbookType != ''">
             and t8.textbook_type = #{dto.textbookType}
         </if>
-        <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
+        <if test="dto.baseSemesterId != null">
             and t8.base_semester_id = #{dto.baseSemesterId}
         </if>
-        <if test="dto.subjectGroupId != null and dto.subjectGroupId > 0">
+        <if test="dto.subjectGroupId != null">
             and t8.subject_group_id = #{dto.subjectGroupId}
         </if>
-        <if test="dto.courseSubjectId != null and dto.courseSubjectId > 0">
+        <if test="dto.courseSubjectId != null">
             and t8.course_subject_id = #{dto.courseSubjectId}
         </if>
         <if test="dto.bookName != null and dto.bookName != ''">
@@ -271,24 +271,20 @@
                 left join wf_textbook_claim_item t1 on t1.wf_textbook_claim_id = t.id
                 left join textbook t2 on t2.id = t1.textbook_id
             where claim_type = 'claim_student'
-            <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
+            <if test="dto.baseSemesterId != null">
                 amd t.base_semester_id = #{dto.baseSemesterId}
             </if>
-            <if test="dto.classId != null and dto.classId > 0">
+            <if test="dto.classId != null">
                 and t.class_id = #{dto.classId}
             </if>
-            <if test="dto.textbookId != null and dto.textbookId > 0">
+            <if test="dto.textbookId != null">
                 and t1.textbook_id = #{dto.textbookId}
             </if>
             group by t.base_semester_id, t.class_id, t1.textbook_id
         )
         select
             t.base_semester_id,
-            t6.name as baseSemesterIdCn,
             t.class_id,
-            t3.name as classIdCn,
-            t4.name as headTeacherName,
-            t5.name as classRoomName,
             t.textbook_id,
             t2.name as textbookTypeCn,
             t1.book_name,
@@ -302,18 +298,14 @@
         from textbook_class t
             left join textbook t1 on t1.id = t.textbook_id
             left join xjr_dictionary_detail t2 on t2.code = t1.textbook_type
-            left join base_class t3 on t3.id = t.class_id
-            LEFT JOIN xjr_user t4 ON t4.id = t3.teacher_id
-            LEFT JOIN base_classroom t5 ON t5.id = t3.classroom_id
-            LEFT JOIN base_semester t6 ON t6.id = t.base_semester_id
         <where>
             <if test="dto.textbookType != null and dto.textbookType != ''">
                 and t1.textbook_type = #{dto.textbookType}
             </if>
-            <if test="dto.subjectGroupId != null and dto.subjectGroupId > 0">
+            <if test="dto.subjectGroupId != null">
                 and t1.subject_group_id = #{dto.subjectGroupId}
             </if>
-            <if test="dto.courseSubjectId != null and dto.courseSubjectId > 0">
+            <if test="dto.courseSubjectId != null">
                 and t1.course_subject_id = #{dto.courseSubjectId}
             </if>
             <if test="dto.bookName != null and dto.bookName != ''">
@@ -326,6 +318,5 @@
                 and t1.issn like concat('%', #{dto.issn}, '%')
             </if>
         </where>
-        ORDER by t2.name desc
     </select>
 </mapper>