diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java index 46736f4..2af9795 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java @@ -110,7 +110,9 @@ public class ReportDocumentFileController extends AbstractFileUploadController i version = mainDO.getDocumentVersion(); } ReportDocumentFileDO entity = reportDocumentFileService.getByMainIdAndVersion(mainId, version); - + if(entity == null){ + return CommonResult.success(null); + } Long fileId = entity.getFileId(); CommonResult fileRet = fileApi.getFile(fileId); FileRespDTO file = fileRet.getData(); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java index 1db1f8d..e03b720 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java @@ -411,7 +411,10 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService String colKey = parseNumToString(colIndex, 2); t.put(colPrefix + colKey, fieldName); //查询当前字段的检出限 - JSONObject fieldObj = firstData.getJSONObject(field); + JSONObject fieldObj = null; + if(firstData != null && !ObjectUtils.isEmpty(field)){ + fieldObj = firstData.getJSONObject(field); + } String rangeVal = ""; if (fieldObj != null) { rangeVal = fieldObj.getString(rangeKey); @@ -516,7 +519,9 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService if (FIELD_FIXED.equals(fieldType)) //这里只处理动态列。固定列在 addDataToRowList 处理 continue; String field = fieldDO.getField(); - JSONObject fieldObj = s.getJSONObject(field); + JSONObject fieldObj = new JSONObject(); + if(s != null) + fieldObj = s.getJSONObject(field); String fieldValue = ""; if (fieldObj != null) fieldValue = fieldObj.getString("fieldValue");