|
@@ -62,20 +62,21 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
|
|
|
headers.put("Content-Type", "application/x-www-form-urlencoded");
|
|
headers.put("Content-Type", "application/x-www-form-urlencoded");
|
|
|
Map<String, Object> formParams = new HashMap<>();
|
|
Map<String, Object> formParams = new HashMap<>();
|
|
|
Map<String, Object> djbh = new HashMap<>();
|
|
Map<String, Object> djbh = new HashMap<>();
|
|
|
- djbh.put("djbh", bm);
|
|
|
|
|
|
|
+ djbh.put("khbm", bm);
|
|
|
result.put("data", djbh);
|
|
result.put("data", djbh);
|
|
|
String jsonStr = JSON.toJSONString(result);
|
|
String jsonStr = JSON.toJSONString(result);
|
|
|
|
|
|
|
|
formParams.put("jsons", jsonStr);
|
|
formParams.put("jsons", jsonStr);
|
|
|
|
|
|
|
|
System.out.println("====" + formParams);
|
|
System.out.println("====" + formParams);
|
|
|
- HttpResponse response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/")//todo 待完善接口
|
|
|
|
|
|
|
+ HttpResponse response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/hgdjydtbdeletecust")
|
|
|
.headerMap(headers, true)
|
|
.headerMap(headers, true)
|
|
|
.form(formParams)
|
|
.form(formParams)
|
|
|
.timeout(30000) // 30秒超时
|
|
.timeout(30000) // 30秒超时
|
|
|
.execute();
|
|
.execute();
|
|
|
|
|
|
|
|
String responseBody = response.body();
|
|
String responseBody = response.body();
|
|
|
|
|
+ System.out.println("====" + responseBody);
|
|
|
// 返回删除操作的格式
|
|
// 返回删除操作的格式
|
|
|
result.put("table", "KD_YD_CUSTOMER");
|
|
result.put("table", "KD_YD_CUSTOMER");
|
|
|
result.put("action", "del");
|
|
result.put("action", "del");
|
|
@@ -95,7 +96,9 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
|
|
|
|
|
|
|
|
// === 提取主表字段 ===
|
|
// === 提取主表字段 ===
|
|
|
String khmc = UtilMap.getString(formData, "textField_lqanqe6j");
|
|
String khmc = UtilMap.getString(formData, "textField_lqanqe6j");
|
|
|
|
|
+// String khmc = "测试1111222";
|
|
|
String khbm = UtilMap.getString(formData, "textField_meqhqqvg");
|
|
String khbm = UtilMap.getString(formData, "textField_meqhqqvg");
|
|
|
|
|
+// String khbm = "kh2121212";
|
|
|
String xssx = UtilMap.getString(formData, "selectField_megi74y7");
|
|
String xssx = UtilMap.getString(formData, "selectField_megi74y7");
|
|
|
String khxypj = UtilMap.getString(formData, "selectField_mewirdx4");
|
|
String khxypj = UtilMap.getString(formData, "selectField_mewirdx4");
|
|
|
String khsx = UtilMap.getString(formData, "selectField_megi74y8");
|
|
String khsx = UtilMap.getString(formData, "selectField_megi74y8");
|
|
@@ -104,7 +107,9 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
|
|
|
String khfz = UtilMap.getString(formData, "selectField_lqanqe6q");
|
|
String khfz = UtilMap.getString(formData, "selectField_lqanqe6q");
|
|
|
String fptt = UtilMap.getString(formData, "textField_llujklkr");
|
|
String fptt = UtilMap.getString(formData, "textField_llujklkr");
|
|
|
String nsdjh = UtilMap.getString(formData, "textField_meqhqqvm");
|
|
String nsdjh = UtilMap.getString(formData, "textField_meqhqqvm");
|
|
|
|
|
+// String nsdjh = "24234234";
|
|
|
String khyh = UtilMap.getString(formData, "textField_meqhqqvn");
|
|
String khyh = UtilMap.getString(formData, "textField_meqhqqvn");
|
|
|
|
|
+// String khyh = "建设银行";
|
|
|
String yhzh = UtilMap.getString(formData, "textField_meqhqqvs");
|
|
String yhzh = UtilMap.getString(formData, "textField_meqhqqvs");
|
|
|
String jxslx = UtilMap.getString(formData, "selectField_mis6kl56");
|
|
String jxslx = UtilMap.getString(formData, "selectField_mis6kl56");
|
|
|
String kplx = UtilMap.getString(formData, "selectField_lwopqbye");
|
|
String kplx = UtilMap.getString(formData, "selectField_lwopqbye");
|
|
@@ -120,6 +125,8 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
|
|
|
String qyxygl = UtilMap.getString(formData, "radioField_mfxs7rd2");
|
|
String qyxygl = UtilMap.getString(formData, "radioField_mfxs7rd2");
|
|
|
String mrsl = UtilMap.getString(formData, "selectField_mfxrryt3");
|
|
String mrsl = UtilMap.getString(formData, "selectField_mfxrryt3");
|
|
|
String sfl = UtilMap.getString(formData, "selectField_mfxrryt2");
|
|
String sfl = UtilMap.getString(formData, "selectField_mfxrryt2");
|
|
|
|
|
+ String sfjtkh = UtilMap.getString(formData, "radioField_mhe8e937");
|
|
|
|
|
+ String dyjtkh = UtilMap.getString(formData, "textField_mis6kl57");
|
|
|
|
|
|
|
|
// 构建主表数据
|
|
// 构建主表数据
|
|
|
Map<String, Object> customData = new HashMap<>();
|
|
Map<String, Object> customData = new HashMap<>();
|
|
@@ -135,7 +142,7 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
|
|
|
customData.put("nsdjh", nsdjh);
|
|
customData.put("nsdjh", nsdjh);
|
|
|
customData.put("khyh", khyh);
|
|
customData.put("khyh", khyh);
|
|
|
customData.put("yhzh", yhzh);
|
|
customData.put("yhzh", yhzh);
|
|
|
- customData.put("jxslx", jxslx);
|
|
|
|
|
|
|
+ customData.put("khlx", jxslx);
|
|
|
customData.put("kplx", kplx);
|
|
customData.put("kplx", kplx);
|
|
|
customData.put("kplxdh", kplxdh);
|
|
customData.put("kplxdh", kplxdh);
|
|
|
customData.put("kptxdz", kptxdz);
|
|
customData.put("kptxdz", kptxdz);
|
|
@@ -149,6 +156,8 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
|
|
|
customData.put("qyxygl", qyxygl);
|
|
customData.put("qyxygl", qyxygl);
|
|
|
customData.put("mrsl", mrsl);
|
|
customData.put("mrsl", mrsl);
|
|
|
customData.put("sfl", sfl);
|
|
customData.put("sfl", sfl);
|
|
|
|
|
+ customData.put("sfjtkh", sfjtkh);
|
|
|
|
|
+ customData.put("dyjtkh", dyjtkh);
|
|
|
|
|
|
|
|
// 处理子表数据
|
|
// 处理子表数据
|
|
|
List<Map<String, Object>> contactList = new ArrayList<>();
|
|
List<Map<String, Object>> contactList = new ArrayList<>();
|
|
@@ -165,6 +174,7 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
|
|
|
String zw = safeGetString(item, "textField_l3s6ubht");
|
|
String zw = safeGetString(item, "textField_l3s6ubht");
|
|
|
String gddh = safeGetString(item, "textField_mfxu5dnk");
|
|
String gddh = safeGetString(item, "textField_mfxu5dnk");
|
|
|
String bm = safeGetString(item, "textField_mfkp33s5");
|
|
String bm = safeGetString(item, "textField_mfkp33s5");
|
|
|
|
|
+// String bm = "LXR239234112";
|
|
|
String yx = safeGetString(item, "textField_lqbzc3gr");
|
|
String yx = safeGetString(item, "textField_lqbzc3gr");
|
|
|
|
|
|
|
|
// 添加到联系人列表
|
|
// 添加到联系人列表
|
|
@@ -190,16 +200,16 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
|
|
|
// 构建form参数
|
|
// 构建form参数
|
|
|
Map<String, Object> formParams = new HashMap<>();
|
|
Map<String, Object> formParams = new HashMap<>();
|
|
|
formParams.put("jsons", jsonStr);
|
|
formParams.put("jsons", jsonStr);
|
|
|
-// 发送请求
|
|
|
|
|
|
|
+ System.out.println("formParams"+formParams);
|
|
|
HttpResponse response = null;
|
|
HttpResponse response = null;
|
|
|
- if (action == "add") {
|
|
|
|
|
- response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/")//todo 修改接口
|
|
|
|
|
|
|
+ if ("add".equals(action)) {
|
|
|
|
|
+ response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/hgdjydtbcreatecust")
|
|
|
.headerMap(headers, true)
|
|
.headerMap(headers, true)
|
|
|
.form(formParams)
|
|
.form(formParams)
|
|
|
.timeout(30000) // 30秒超时
|
|
.timeout(30000) // 30秒超时
|
|
|
.execute();
|
|
.execute();
|
|
|
} else {
|
|
} else {
|
|
|
- response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/")
|
|
|
|
|
|
|
+ response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/hgdjydtbupdatecust")
|
|
|
.headerMap(headers, true)
|
|
.headerMap(headers, true)
|
|
|
.form(formParams)
|
|
.form(formParams)
|
|
|
.timeout(30000) // 30秒超时
|
|
.timeout(30000) // 30秒超时
|
|
@@ -207,40 +217,32 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String responseBody = response.body();
|
|
String responseBody = response.body();
|
|
|
|
|
+ System.out.println("responseBody" + responseBody);
|
|
|
try {
|
|
try {
|
|
|
// 一行代码提取
|
|
// 一行代码提取
|
|
|
- String jdbh = JSON.parseArray(responseBody)
|
|
|
|
|
- .getJSONObject(0)
|
|
|
|
|
- .getJSONObject("data")
|
|
|
|
|
- .getString("djbh");
|
|
|
|
|
|
|
+// String jdbh = JSON.parseArray(responseBody)
|
|
|
|
|
+// .getJSONObject(0)
|
|
|
|
|
+// .getJSONObject("data")
|
|
|
|
|
+// .getString("djbh");
|
|
|
String msg = JSON.parseArray(responseBody)
|
|
String msg = JSON.parseArray(responseBody)
|
|
|
.getJSONObject(0)
|
|
.getJSONObject(0)
|
|
|
.getString("msg");
|
|
.getString("msg");
|
|
|
|
|
+ String code = JSON.parseArray(responseBody)
|
|
|
|
|
+ .getJSONObject(0)
|
|
|
|
|
+ .getString("code");
|
|
|
ydClient.operateData(
|
|
ydClient.operateData(
|
|
|
YDParam.builder()
|
|
YDParam.builder()
|
|
|
.formInstanceId(formInstId)
|
|
.formInstanceId(formInstId)
|
|
|
- .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textareaField_mkxqgrvq, textField_mjs6fuwo", msg, jdbh)))
|
|
|
|
|
|
|
+ .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_ml08nk3y, textareaField_mkxqgrvq", code, msg)))
|
|
|
.useLatestVersion(true).build(),
|
|
.useLatestVersion(true).build(),
|
|
|
YDConf.FORM_OPERATION.update);
|
|
YDConf.FORM_OPERATION.update);
|
|
|
-// Map<String, Object> updatePayload = new HashMap<>();
|
|
|
|
|
-// updatePayload.put("tableField_mfkks8ww", updatedTableRowsForYD);
|
|
|
|
|
-// ydClient.operateData(
|
|
|
|
|
-// YDParam.builder()
|
|
|
|
|
-// .formInstanceId(formInstId)
|
|
|
|
|
-// .updateFormDataJson(JSONObject.toJSONString(updatePayload))
|
|
|
|
|
-// .useLatestVersion(true)
|
|
|
|
|
-// .build(),
|
|
|
|
|
-// YDConf.FORM_OPERATION.update
|
|
|
|
|
-// );
|
|
|
|
|
|
|
+//
|
|
|
log.info("回写数据到宜搭成功,formInstId: {}", formInstId);
|
|
log.info("回写数据到宜搭成功,formInstId: {}", formInstId);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.warn("回写数据到宜搭失败,formInstId: {}, 错误: {}", formInstId, e.getMessage());
|
|
log.warn("回写数据到宜搭失败,formInstId: {}, 错误: {}", formInstId, e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 构建返回结果
|
|
|
|
|
- result.put("table", "KD_YD_CUSTOMER");
|
|
|
|
|
- result.put("action", action != null ? action : "add");
|
|
|
|
|
result.put("data", customData);
|
|
result.put("data", customData);
|
|
|
|
|
|
|
|
log.info("客户信息同步成功: formInstId={}, khmc={}, khbm={}", formInstId, khmc, khbm);
|
|
log.info("客户信息同步成功: formInstId={}, khmc={}, khbm={}", formInstId, khmc, khbm);
|