修改人:邹江涛

修改内容:API映射公共单据
修改时间:2024/12/04
This commit is contained in:
zoujiangtao 2024-12-04 14:42:54 +08:00
parent 0dfe66c8d2
commit e89469724c
1 changed files with 47 additions and 9 deletions

View File

@ -120,6 +120,7 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin {
// 将映射字段塞入对应JSON中 // 将映射字段塞入对应JSON中
Object shkd_soufield = dynamicObject.get("shkd_soufield"); Object shkd_soufield = dynamicObject.get("shkd_soufield");
logger.info("shkd_soufield: {}", shkd_soufield);
Object value = null; Object value = null;
if (shkd_soufield != null) { if (shkd_soufield != null) {
String[] parts = shkd_soufield.toString().split("\\."); String[] parts = shkd_soufield.toString().split("\\.");
@ -153,14 +154,27 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin {
DynamicObjectCollection dynamicObjectCollection1 = billObject.getDynamicObjectCollection(parts[0]); DynamicObjectCollection dynamicObjectCollection1 = billObject.getDynamicObjectCollection(parts[0]);
value = dynamicObjectCollection1.get(0).get(parts[1]); value = dynamicObjectCollection1.get(0).get(parts[1]);
} else { } 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) { } else if (parts.length == 3) {
if ("entry".equals(parts[0])) { if ("entry".equals(parts[0])) {
DynamicObjectCollection dynamicObjectCollection1 = billObject.getDynamicObjectCollection(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 { } 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 { } else {
@ -287,14 +301,26 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin {
DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection(parts[0]); DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection(parts[0]);
value = dynamicObjectCollection.get(0).get(parts[1]); value = dynamicObjectCollection.get(0).get(parts[1]);
} else { } 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) { } else if (parts.length == 3) {
if ("entry".equals(parts[0])) { if ("entry".equals(parts[0])) {
DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection(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 { } 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 { } else {
@ -363,14 +389,26 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin {
DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection(parts[0]); DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection(parts[0]);
value = dynamicObjectCollection.get(0).get(parts[1]); value = dynamicObjectCollection.get(0).get(parts[1]);
} else { } 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) { } else if (parts.length == 3) {
if ("entry".equals(parts[0])) { if ("entry".equals(parts[0])) {
DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection(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 { } 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 { } else {