Quellcode durchsuchen

2.2代码提交

“lqy vor 2 Tagen
Ursprung
Commit
1ef3c0fd16

+ 17 - 22
mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdCustomerServiceImpl.java

@@ -124,6 +124,8 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
             String qyxygl = UtilMap.getString(formData, "radioField_mfxs7rd2");
             String mrsl = UtilMap.getString(formData, "selectField_mfxrryt3");
             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<>();
@@ -139,7 +141,7 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
             customData.put("nsdjh", nsdjh);
             customData.put("khyh", khyh);
             customData.put("yhzh", yhzh);
-            customData.put("jxslx", jxslx);
+            customData.put("khlx", jxslx);
             customData.put("kplx", kplx);
             customData.put("kplxdh", kplxdh);
             customData.put("kptxdz", kptxdz);
@@ -153,7 +155,8 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
             customData.put("qyxygl", qyxygl);
             customData.put("mrsl", mrsl);
             customData.put("sfl", sfl);
-
+            customData.put("sfjtkh", sfjtkh);
+            customData.put("dyjtkh", dyjtkh);
             // 处理子表数据
             List<Map<String, Object>> contactList = new ArrayList<>();
             List<Map> tableField = (List<Map>) formData.get("tableField_mfkks8ww");
@@ -196,14 +199,14 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
                 formParams.put("jsons", jsonStr);
 // 发送请求
                 HttpResponse response = null;
-                if (action == "add") {
-                    response = HttpRequest.post(kdHost+"/xk/dyzn/WsBasedyzn.asmx/")//todo 修改接口
+                if ("add".equals(action)) {
+                    response = HttpRequest.post(kdHost+"/xk/dyzn/WsBasedyzn.asmx/hgdjydtbcreatecust")
                             .headerMap(headers, true)
                             .form(formParams)
                             .timeout(30000)  // 30秒超时
                             .execute();
                 } else {
-                    response = HttpRequest.post(kdHost+"/xk/dyzn/WsBasedyzn.asmx/")
+                    response = HttpRequest.post(kdHost+"/xk/dyzn/WsBasedyzn.asmx/hgdjydtbupdatecust")
                             .headerMap(headers, true)
                             .form(formParams)
                             .timeout(30000)  // 30秒超时
@@ -213,29 +216,23 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
                 String responseBody = response.body();
                 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)
                             .getJSONObject(0)
                             .getString("msg");
+                    String code = JSON.parseArray(responseBody)
+                            .getJSONObject(0)
+                            .getString("code");
                     ydClient.operateData(
                             YDParam.builder()
                                     .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(),
                             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);
                 } catch (Exception e) {
                     log.warn("回写数据到宜搭失败,formInstId: {}, 错误: {}", formInstId, e.getMessage());
@@ -243,8 +240,6 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
             }
 
             // 构建返回结果
-            result.put("table", "KD_YD_CUSTOMER");
-            result.put("action", action != null ? action : "add");
             result.put("data", customData);
 
             log.info("客户信息同步成功: formInstId={}, khmc={}, khbm={}", formInstId, khmc, khbm);