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