From e89469724cf5b2bef27d73546cf2d385801e4b5f Mon Sep 17 00:00:00 2001 From: zoujiangtao Date: Wed, 4 Dec 2024 14:42:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=EF=BC=9A=E9=82=B9?= =?UTF-8?q?=E6=B1=9F=E6=B6=9B=20=E4=BF=AE=E6=94=B9=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=9AAPI=E6=98=A0=E5=B0=84=E5=85=AC=E5=85=B1=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=20=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=EF=BC=9A2024/1?= =?UTF-8?q?2/04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/plugin/form/ApiMappingBillPlugin.java | 56 ++++++++++++++++--- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java index ef384c4..a8b3f46 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java @@ -120,6 +120,7 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin { // 将映射字段塞入对应JSON中 Object shkd_soufield = dynamicObject.get("shkd_soufield"); + logger.info("shkd_soufield: {}", shkd_soufield); Object value = null; if (shkd_soufield != null) { String[] parts = shkd_soufield.toString().split("\\."); @@ -153,14 +154,27 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin { DynamicObjectCollection dynamicObjectCollection1 = billObject.getDynamicObjectCollection(parts[0]); value = dynamicObjectCollection1.get(0).get(parts[1]); } else { - value = billObject.getDynamicObject(parts[0]).get(parts[1]); + DynamicObject object = billObject.getDynamicObject(parts[0]); + if (object != null) { + value = object.get(parts[1]); + } } } else if (parts.length == 3) { if ("entry".equals(parts[0])) { DynamicObjectCollection dynamicObjectCollection1 = billObject.getDynamicObjectCollection(parts[0]); - value = dynamicObjectCollection1.get(0).getDynamicObject(parts[1]).get(parts[2]); + DynamicObject object = dynamicObjectCollection1.get(0).getDynamicObject(parts[1]); + if (object != null) { + value = object.get(parts[2]); + } } else { - value = billObject.getDynamicObject(parts[0]).getDynamicObject(parts[1]).get(parts[2]); + DynamicObject object = billObject.getDynamicObject(parts[0]); + if (object != null) { + DynamicObject object1 = object.getDynamicObject(parts[1]); + if (object1 != null) { + value = object1.get(parts[2]); + + } + } } } } else { @@ -287,14 +301,26 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin { DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection(parts[0]); value = dynamicObjectCollection.get(0).get(parts[1]); } else { - value = dynamic.getDynamicObject(parts[0]).get(parts[1]); + DynamicObject object = dynamic.getDynamicObject(parts[0]); + if (object != null) { + value = object.get(parts[1]); + } } } else if (parts.length == 3) { if ("entry".equals(parts[0])) { DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection(parts[0]); - value = dynamicObjectCollection.get(0).getDynamicObject(parts[1]).get(parts[2]); + DynamicObject object = dynamicObjectCollection.get(0).getDynamicObject(parts[1]); + if (object != null) { + value = object.get(parts[2]); + } } else { - value = dynamic.getDynamicObject(parts[0]).getDynamicObject(parts[1]).get(parts[2]); + DynamicObject object = dynamic.getDynamicObject(parts[0]); + if (object != null) { + DynamicObject object1 = object.getDynamicObject(parts[1]); + if (object1 != null) { + value = object1.get(parts[2]); + } + } } } } else { @@ -363,14 +389,26 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin { DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection(parts[0]); value = dynamicObjectCollection.get(0).get(parts[1]); } else { - value = dynamic.getDynamicObject(parts[0]).get(parts[1]); + DynamicObject object = dynamic.getDynamicObject(parts[0]); + if (object != null) { + value = object.get(parts[1]); + } } } else if (parts.length == 3) { if ("entry".equals(parts[0])) { DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection(parts[0]); - value = dynamicObjectCollection.get(0).getDynamicObject(parts[1]).get(parts[2]); + DynamicObject object = dynamicObjectCollection.get(0).getDynamicObject(parts[1]); + if (object != null) { + value = object.get(parts[2]); + } } else { - value = dynamic.getDynamicObject(parts[0]).getDynamicObject(parts[1]).get(parts[2]); + DynamicObject object = dynamic.getDynamicObject(parts[0]); + if (object != null) { + DynamicObject object1 = object.getDynamicObject(parts[1]); + if (object1 != null) { + value = object1.get(parts[2]); + } + } } } } else {