|
@@ -22,10 +22,7 @@ import com.qmth.distributed.print.common.contant.SystemConstant;
|
|
|
import com.qmth.distributed.print.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.distributed.print.common.util.ResultUtil;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
-import org.apache.poi.ss.usermodel.CellType;
|
|
|
-import org.apache.poi.ss.usermodel.Row;
|
|
|
-import org.apache.poi.ss.usermodel.Sheet;
|
|
|
-import org.apache.poi.ss.usermodel.Workbook;
|
|
|
+import org.apache.poi.ss.usermodel.*;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -411,33 +408,28 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
String code = fieldsDto.getCode();
|
|
|
int index = fieldsDto.getIndex();
|
|
|
String level = fieldsDto.getLevel();
|
|
|
+
|
|
|
+ Cell cell = row.getCell(index);
|
|
|
+ String cellValue = String.valueOf(ExcelUtil.convert(cell));
|
|
|
+
|
|
|
if ("学号".equals(name)) {
|
|
|
- row.getCell(index).setCellType(CellType.STRING);
|
|
|
- studentCode = row.getCell(index).getStringCellValue();
|
|
|
+ studentCode = cellValue;
|
|
|
} else if ("姓名".equals(name)) {
|
|
|
- row.getCell(index).setCellType(CellType.STRING);
|
|
|
- studentName = row.getCell(index).getStringCellValue();
|
|
|
+ studentName = cellValue;
|
|
|
} else if ("课程代码".equals(name)) {
|
|
|
- row.getCell(index).setCellType(CellType.STRING);
|
|
|
- courseCode = row.getCell(index).getStringCellValue();
|
|
|
+ courseCode = cellValue;
|
|
|
} else if ("课程名称".equals(name)) {
|
|
|
- row.getCell(index).setCellType(CellType.STRING);
|
|
|
- courseName = row.getCell(index).getStringCellValue();
|
|
|
+ courseName = cellValue;
|
|
|
} else if ("考点".equals(name)) {
|
|
|
- row.getCell(index).setCellType(CellType.STRING);
|
|
|
- examPlace = row.getCell(index).getStringCellValue();
|
|
|
+ examPlace = cellValue;
|
|
|
} else if ("考场".equals(name)) {
|
|
|
- row.getCell(index).setCellType(CellType.STRING);
|
|
|
- examRoom = row.getCell(index).getStringCellValue();
|
|
|
+ examRoom = cellValue;
|
|
|
} else if ("考试日期".equals(name)) {
|
|
|
- row.getCell(index).setCellType(CellType.STRING);
|
|
|
- examDate = row.getCell(index).getStringCellValue();
|
|
|
+ examDate = cellValue;
|
|
|
} else if ("考试时间".equals(name)) {
|
|
|
- row.getCell(index).setCellType(CellType.STRING);
|
|
|
- examTime = row.getCell(index).getStringCellValue();
|
|
|
+ examTime = cellValue;
|
|
|
} else if ("试卷编号".equals(name)) {
|
|
|
- row.getCell(index).setCellType(CellType.STRING);
|
|
|
- paperNumber = row.getCell(index).getStringCellValue();
|
|
|
+ paperNumber = cellValue;
|
|
|
} else {
|
|
|
if ("primary".equals(level)) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("有数据库不需要的必选字段 : " + name);
|
|
@@ -449,7 +441,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
secondaryField.setCode(code);
|
|
|
secondaryField.setName(name);
|
|
|
secondaryField.setEnable(true);
|
|
|
- secondaryField.setValue(row.getCell(index).getStringCellValue());
|
|
|
+ secondaryField.setValue(cellValue);
|
|
|
secondaryFieldList.add(secondaryField);
|
|
|
}
|
|
|
}
|