|
@@ -65,6 +65,7 @@ import java.awt.Color;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.net.URLEncoder;
|
|
|
+import java.nio.charset.Charset;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.util.List;
|
|
|
import java.util.*;
|
|
@@ -554,7 +555,7 @@ public class AdmEquipmentController {
|
|
|
equipment.put(define.getCode(), tempCell.getStringCellValue().trim());
|
|
|
} else if ("INTEGER".equalsIgnoreCase(define.getDataType())) {
|
|
|
try {
|
|
|
- if (!CellType.NUMERIC.equals(tempCell.getCellTypeEnum())
|
|
|
+ if (!CellType.NUMERIC.equals(tempCell.getCellType())
|
|
|
|| StrUtil.isBlank(StrUtil.toString(CellUtil.getCellValue(tempCell,true)))) {
|
|
|
failurNum++;
|
|
|
this.setColor(workbook, 155, 227, 255, tempCell);
|
|
@@ -562,19 +563,19 @@ public class AdmEquipmentController {
|
|
|
continue;
|
|
|
}
|
|
|
tempCell.setCellType(CellType.STRING);
|
|
|
- equipment.put(define.getCode(), tempCell.getStringCellValue().trim());
|
|
|
+ equipment.putPOJO(define.getCode(), CellUtil.getCellValue(tempCell,CellType.STRING,true));
|
|
|
} catch (Exception e) {
|
|
|
failurNum++;
|
|
|
this.setColor(workbook, 155, 227, 255, tempCell);
|
|
|
changeFlag=false;
|
|
|
continue;
|
|
|
}
|
|
|
- } else if ("ENUM".equalsIgnoreCase(define.getDataType()) || "MENUM".equalsIgnoreCase(define.getDataType())) {
|
|
|
- if (CellType.NUMERIC.equals(tempCell.getCellTypeEnum())
|
|
|
+ } else if ("ENUM".equalsIgnoreCase(define.getDataType())) {
|
|
|
+ if (CellType.NUMERIC.equals(tempCell.getCellType())
|
|
|
&& StrUtil.isNotBlank(StrUtil.toString(CellUtil.getCellValue(tempCell,true)))) {
|
|
|
tempCell.setCellType(CellType.STRING);
|
|
|
- equipment.put(define.getCode(), tempCell.getStringCellValue().trim());
|
|
|
- } else if (CellType.STRING.equals(tempCell.getCellTypeEnum())
|
|
|
+ equipment.putPOJO(define.getCode(), CellUtil.getCellValue(tempCell,CellType.STRING,true));
|
|
|
+ } else if (CellType.STRING.equals(tempCell.getCellType())
|
|
|
&& StrUtil.isNotBlank(StrUtil.toString(CellUtil.getCellValue(tempCell,true)))) {
|
|
|
equipment.put(define.getCode(), tempCell.getStringCellValue().trim());
|
|
|
} else {
|
|
@@ -583,6 +584,20 @@ public class AdmEquipmentController {
|
|
|
changeFlag=false;
|
|
|
continue;
|
|
|
}
|
|
|
+ } else if ("MENUM".equalsIgnoreCase(define.getDataType())) {
|
|
|
+ if (CellType.NUMERIC.equals(tempCell.getCellType())
|
|
|
+ && StrUtil.isNotBlank(StrUtil.toString(CellUtil.getCellValue(tempCell,true)))) {
|
|
|
+ tempCell.setCellType(CellType.STRING);
|
|
|
+ equipment.putPOJO(define.getCode(), CollUtil.newArrayList(CellUtil.getCellValue(tempCell,CellType.STRING,true)));
|
|
|
+ } else if (CellType.STRING.equals(tempCell.getCellType())
|
|
|
+ && StrUtil.isNotBlank(StrUtil.toString(CellUtil.getCellValue(tempCell,true)))) {
|
|
|
+ equipment.putPOJO(define.getCode(), CollUtil.newArrayList(CellUtil.getCellValue(tempCell,CellType.STRING,true)));
|
|
|
+ } else {
|
|
|
+ failurNum++;
|
|
|
+ this.setColor(workbook, 155, 227, 255, tempCell);
|
|
|
+ changeFlag=false;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
} else if ("DATETIME".equalsIgnoreCase(define.getDataType())) {
|
|
|
try {
|
|
|
tempCell.setCellType(CellType.STRING);
|