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 9fd9c28..24246ae 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 @@ -121,14 +121,15 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService JSONObject dataJson = JSONObject.parseObject(documentContent); if(dataJson == null) continue; - String usage = dataJson.getString("usage"); - if(!"report".equals( usage) && ! "ingredient_report".equals(usage)) + if(!dataJson.containsKey(field)) continue; - if(dataJson.containsKey(field)){ - if(!hasFields.contains( fieldName)){ - fieldList.add(fieldDO); - hasFields.add(fieldName); - } + if(!hasFields.contains( fieldName)){ + JSONObject valueJson = dataJson.getJSONObject(field); + String usage = valueJson.getString("usage"); + if(!"report".equals( usage) && ! "ingredient_report".equals(usage)) + continue; + fieldList.add(fieldDO); + hasFields.add(fieldName); } } }