Browse Source

3.3.0 fix

xiaofei 1 year ago
parent
commit
d05bb33b9f

+ 13 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -9,6 +9,9 @@ import com.google.common.reflect.TypeToken;
 import com.google.gson.Gson;
 import com.itextpdf.text.DocumentException;
 import com.qmth.boot.api.exception.ApiException;
+import com.qmth.boot.tools.excel.ExcelReader;
+import com.qmth.boot.tools.excel.enums.ExcelType;
+import com.qmth.boot.tools.excel.model.DataMap;
 import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.bean.examRule.CodeNameEnableValue;
 import com.qmth.distributed.print.business.bean.examRule.FieldsDto;
@@ -671,6 +674,14 @@ public class TaskLogicServiceImpl implements TaskLogicService {
             throw ExceptionResultEnum.ERROR.exception("印刷计划不存在");
         }
 
+//        ExcelReader excelReader = ExcelReader.create(ExcelType.XLS, inputStream, 1);
+//        List<DataMap> dataMapList = excelReader.getDataMapList();
+//
+//
+//        if (dataMapList.size() > 0) {
+//            return null;
+//        }
+
         String printPlanName = examPrintPlan.getName();
         if (!tbTaskService.countByPrintPlanIdAndEntityId(schoolId, printPlanId, null)) {
             throw ExceptionResultEnum.ERROR.exception("印刷计划[" + printPlanName + "]正在生成pdf文件,无法导入考务数据");
@@ -707,7 +718,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
             throw ExceptionResultEnum.ERROR.exception("表格第二行为表头,不能为空,且第一列必须为\"学号\"");
         }
         // 获取sheet行数
-        int totalRows = sheet.getPhysicalNumberOfRows();
+        int totalRows = sheet.getLastRowNum() + 1;
         // 获取sheet列数(列数从第二行开始记录,因为第一行是说明内容)
         int totalCells = 0;
         if (totalRows > 2 && sheet.getRow(1) != null) {
@@ -777,7 +788,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
             // excel中的数据错误
             StringJoiner errorRowDate = new StringJoiner(";\r\n");
             Row row = sheet.getRow(r);
-            if (ExcelUtil.isRowAllCellEmpty(row, head)) {
+            if (row == null || ExcelUtil.isRowAllCellEmpty(row, head)) {
                 // excel中整行为空,直接跳过
                 continue;
             }

+ 2 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanAnswerController.java

@@ -1,5 +1,6 @@
 package com.qmth.distributed.print.api.mark;
 
+import com.qmth.boot.api.annotation.Aac;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -71,6 +72,7 @@ public class ScanAnswerController {
 	
     @ApiOperation(value = "查询答题卡扫描详情")
     @RequestMapping(value = "query", method = RequestMethod.POST)
+	@Aac(auth = false)
     public Result query(@Validated AnswerQueryDomain query) {
         return ResultUtil.ok(markStudentService.query(query));
     }

+ 5 - 0
pom.xml

@@ -164,6 +164,11 @@
                 <artifactId>core-sms</artifactId>
                 <version>${qmth.boot.version}</version>
             </dependency>
+            <dependency>
+                <groupId>com.qmth.boot</groupId>
+                <artifactId>tools-poi</artifactId>
+                <version>${qmth.boot.version}</version>
+            </dependency>
 <!--            <dependency>-->
 <!--                <groupId>io.springfox</groupId>-->
 <!--                <artifactId>springfox-swagger-ui</artifactId>-->

+ 4 - 0
teachcloud-common/pom.xml

@@ -54,6 +54,10 @@
             <groupId>com.qmth.boot</groupId>
             <artifactId>core-sms</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.qmth.boot</groupId>
+            <artifactId>tools-poi</artifactId>
+        </dependency>
         <dependency>
             <groupId>io.netty</groupId>
             <artifactId>netty-all</artifactId>

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/ScanPaperPage.java

@@ -23,7 +23,7 @@ import io.swagger.annotations.ApiModel;
  * @author xf
  * @since 2023-09-22
  */
-@TableName("scan_paper_page")
+@TableName(value = "scan_paper_page", autoResultMap = true)
 @ApiModel(value = "ScanPaperPage对象", description = "")
 public class ScanPaperPage implements Serializable {
 

+ 4 - 4
teachcloud-mark/src/main/resources/mapper/ScanPaperPageMapper.xml

@@ -7,10 +7,10 @@
         <id column="id" property="id" />
         <result column="paper_id" property="paperId" />
         <result column="page_index" property="pageIndex" />
-        <result column="absent" property="absent" jdbcType="BLOB" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
-        <result column="breach" property="breach" jdbcType="BLOB" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" />
-        <result column="question" property="question"  jdbcType="BLOB" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
-        <result column="selective" property="selective"  jdbcType="BLOB" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
+        <result column="absent" property="absent" jdbcType="VARCHAR" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
+        <result column="breach" property="breach" jdbcType="VARCHAR" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" />
+        <result column="question" property="question"  jdbcType="VARCHAR" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
+        <result column="selective" property="selective"  jdbcType="VARCHAR" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
         <result column="sheet_path" property="sheetPath" />
         <result column="recog_data" property="recogData" />
         <result column="creator_id" property="creatorId" />