提交内容:推送BIP数据公共类代码修改

备注:调整整体代码逻辑,推送逻辑
提交人:邹江涛
This commit is contained in:
zoujiangtao 2024-12-10 15:05:19 +08:00
parent 1e68b8d405
commit 4a534c6583
2 changed files with 7 additions and 6 deletions

View File

@ -177,7 +177,7 @@ public class ApiService {
new QFilter("shkd_targetsystem", QCP.equals, systemName)).toArray());
// 组装请求体数据
String requestBody = assembleRequestBody(objects[0]);
String requestBody = assembleRequestBody(dynamic, objects[0]);
logger.info("请求URL{}\n组装请求body{}", objects[0].getString("shkd_url"), requestBody);
// 调用接口获取响应数据
@ -186,12 +186,13 @@ public class ApiService {
/**
* 组装请求体数据
* @param dynamic API映射单据数据对象
* @param dynamic 推送数据对象
* @param mapping API映射对象数据
* @return
*/
public static String assembleRequestBody(DynamicObject dynamic) {
public static String assembleRequestBody(DynamicObject dynamic, DynamicObject mapping) {
// 获取数据表信息
DynamicObjectCollection dynamicObjectCollection = dynamic.getDynamicObjectCollection("entryentity");
DynamicObjectCollection dynamicObjectCollection = mapping.getDynamicObjectCollection("entryentity");
// 提取所有层级并存储在 Set
Set<Integer> tiers = new HashSet<>();
@ -214,7 +215,7 @@ public class ApiService {
}
// 获取组装body类型
String shkd_bodytype = dynamic.getString("shkd_bodytype");
String shkd_bodytype = mapping.getString("shkd_bodytype");
if ("数组".equals(shkd_bodytype)) {
JSONArray jsonArray = new JSONArray();
JSONObject json = new JSONObject();

View File

@ -91,7 +91,7 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin {
CodeEdit codeEdit = this.getView().getControl("shkd_codeeditap");
if ("shkd_generatejson".equals(itemKey)) {
String requestBody = ApiService.assembleRequestBody(dataEntity);
String requestBody = ApiService.assembleRequestBody(billObject, dataEntity);
codeEdit.setText(format(requestBody));
}