|
|
|
@ -15,6 +15,7 @@ import com.gaotao.modules.pms.service.QcBaseInfoService; |
|
|
|
import com.gaotao.modules.sys.entity.SysUserEntity; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.ss.usermodel.CellType; |
|
|
|
import org.apache.poi.xssf.usermodel.XSSFRow; |
|
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet; |
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
|
@ -1540,6 +1541,10 @@ public class QcBaseInfoServiceImpl implements QcBaseInfoService { |
|
|
|
// 读取是否默认 |
|
|
|
String defaultFlag = "N"; |
|
|
|
if (row.getCell(4) != null) { |
|
|
|
try { |
|
|
|
// 先检查单元格类型,避免空白单元格调用getStringCellValue报错 |
|
|
|
CellType cellType = row.getCell(4).getCellType(); |
|
|
|
if (cellType != CellType.BLANK) { |
|
|
|
String defaultStr = row.getCell(4).getStringCellValue().trim(); |
|
|
|
if ("是".equals(defaultStr) || "Y".equalsIgnoreCase(defaultStr)) { |
|
|
|
defaultFlag = "Y"; |
|
|
|
@ -1552,6 +1557,11 @@ public class QcBaseInfoServiceImpl implements QcBaseInfoService { |
|
|
|
defaultOperationDesc = operationDesc; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
// 是否默认列读取失败不影响导入,使用默认值N |
|
|
|
log.warn("第{}行是否默认列读取失败,使用默认值N: {}", j + 1, e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 构建参数 |
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
|