Explorar o código

Merge remote-tracking branch 'origin/master'

lfx hai 2 días
pai
achega
dfb1a078a8
Modificáronse 20 ficheiros con 554 adicións e 188 borrados
  1. 5 5
      mjava-huagao/src/main/java/com/malk/huagao/schedule/YdScheduleTask.java
  2. 4 0
      mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdHuaGaoServiceImpl.java
  3. 71 7
      mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdCustomerReferrerServiceImpl.java
  4. 74 17
      mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdCustomerServiceImpl.java
  5. 72 17
      mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdDeliveryServiceImpl.java
  6. 4 2
      mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdMaterialServiceImpl.java
  7. 9 3
      mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdOrderServiceImpl.java
  8. 40 18
      mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdOutboundServiceImpl.java
  9. 35 52
      mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdReceivableServiceImpl.java
  10. 26 20
      mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdTransferServiceImpl.java
  11. 9 5
      mjava-huagao/src/main/resources/application-dev.yml
  12. 11 7
      mjava-huagao/src/main/resources/application-prod.yml
  13. 11 7
      mjava-huagao/src/main/resources/application-prod2.yml
  14. 6 0
      mjava-lianan/src/main/java/com/malk/lianan/controller/LianAnGyPayController.java
  15. 19 0
      mjava-lianan/src/main/java/com/malk/lianan/schedule/LianAnScheduleTask.java
  16. 2 0
      mjava-lianan/src/main/java/com/malk/lianan/service/LianAnGyPayService.java
  17. 5 0
      mjava-lianan/src/main/java/com/malk/lianan/service/LianAnService.java
  18. 107 13
      mjava-lianan/src/main/java/com/malk/lianan/service/impl/LianAnGyServiceImpl.java
  19. 20 0
      mjava-lianan/src/main/java/com/malk/lianan/service/impl/LianAnServiceImpl.java
  20. 24 15
      mjava-lilin/src/main/java/com/malk/lilin/Service/impl/LiLinServiceImpl.java

+ 5 - 5
mjava-huagao/src/main/java/com/malk/huagao/schedule/YdScheduleTask.java

@@ -126,7 +126,7 @@ private YdHuaGaoService ydHuaGaoService;
 
 
 
-    @Scheduled(cron = "0 0/15 * * * ?")
+//    @Scheduled(cron = "0 0/15 * * * ?")
     public void synckdYdOutbound() {
         log.info("定时同步-出库单");
         try {
@@ -137,7 +137,7 @@ private YdHuaGaoService ydHuaGaoService;
         }
     }
 
-    @Scheduled(cron = "0 0/15 * * * ?")
+//    @Scheduled(cron = "0 0/15 * * * ?")
     public void syncKdYdReceivable() {
         log.info("定时同步-应收单");
         try {
@@ -148,7 +148,7 @@ private YdHuaGaoService ydHuaGaoService;
         }
     }
 //    @Scheduled(fixedRate = 5 * 60 * 1000)
-    @Scheduled(cron = "0 0/15 * * * ?")
+//    @Scheduled(cron = "0 0/15 * * * ?")
     public void synckdYdMaterial() {
         log.info("定时同步-物料信息");
         try {
@@ -159,7 +159,7 @@ private YdHuaGaoService ydHuaGaoService;
         }
     }
 
-    @Scheduled(cron = "0 0/15 * * * ?")
+//    @Scheduled(cron = "0 0/15 * * * ?")
     public void synckdYdPayment() {
         log.info("定时同步-synckdYdPayment");
         try {
@@ -170,7 +170,7 @@ private YdHuaGaoService ydHuaGaoService;
         }
     }
 
-    @Scheduled(cron = "0 0/15 * * * ?")
+//    @Scheduled(cron = "0 0/15 * * * ?")
     public void synckdYdTRANSFER() {
         log.info("定时同步-synckdYdTRANSFER");
         try {

+ 4 - 0
mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdHuaGaoServiceImpl.java

@@ -88,6 +88,10 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
         WeekFields weekFields = WeekFields.of(Locale.getDefault());
         int weekOfMonth = today.get(weekFields.weekOfMonth());//当前日期是当月的第几周
 
+        /*int year = 2026;//获取当前年份
+        int month = 1;//当前月份
+        int weekOfMonth = 4;//当前日期是当月的第几周*/
+
         try {
             //删除宜搭当周序列号主档数据
             log.info("开始删除序列号主档数据:{}年,{}月,{}周",year,month,weekOfMonth);

+ 71 - 7
mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdCustomerReferrerServiceImpl.java

@@ -1,5 +1,9 @@
 package com.malk.huagao.service.impl;
 
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.malk.huagao.entity.KdYdCustomerLiaison;
 import com.malk.huagao.entity.KdYdCustomerReferrer;
@@ -42,13 +46,29 @@ public class KdYdCustomerReferrerServiceImpl extends ServiceImpl<KdYdCustomerRef
         try {
             MDC.put("MDC_KEY_PID", "1003");
             String formInstId = UtilMap.getString(map, "formInstId");
-            String action = UtilMap.getString(map, "action");
+            String action = UtilMap.getString(map, "type");
 
             // 处理特殊操作类型
             if ("del".equals(action)) {
                 String bm = UtilMap.getString(map, "bm");
-                //todo 删除逻辑
 
+                Map<String, String> headers = new HashMap<>();
+                headers.put("Content-Type", "application/x-www-form-urlencoded");
+                Map<String, Object> formParams = new HashMap<>();
+                Map<String, Object> djbh = new HashMap<>();
+                djbh.put("djbh", bm);
+                result.put("data", djbh);
+                String jsonStr = JSON.toJSONString(result);
+                formParams.put("jsons", jsonStr);
+
+                System.out.println("====" + formParams);
+                HttpResponse response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/")
+                        .headerMap(headers, true)
+                        .form(formParams)
+                        .timeout(30000)  // 30秒超时
+                        .execute();
+
+                String responseBody = response.body();
                 // 返回删除操作的格式
                 result.put("table", "KD_YD_CUSTOMER_REFERRER");
                 result.put("action", "del");
@@ -67,9 +87,14 @@ public class KdYdCustomerReferrerServiceImpl extends ServiceImpl<KdYdCustomerRef
 
             // 提取表单字段
             String mc = UtilMap.getString(formData, "textField_mgqbiouh");
+//            String mc = "张三11";
             String sfzh = UtilMap.getString(formData, "textField_mgqbioux");
+//            String sfzh = "1656455654";
             String sjh = UtilMap.getString(formData, "textField_mgqbioui");
+//            String sjh = "1656455654";
             String bm = UtilMap.getString(formData, "serialNumberField_mhiycezm");
+//            String bm = "TJR202615000";
+
             String xsy = UtilMap.getString(formData, "employeeField_mgqbiouz").replace("[\"", "").replace("\"]", "").trim();
 
             // 构建返回数据
@@ -80,12 +105,51 @@ public class KdYdCustomerReferrerServiceImpl extends ServiceImpl<KdYdCustomerRef
             cusRefData.put("bm", bm);
             cusRefData.put("xsy", xsy);
 
-            // 设置返回结果
-            result.put("table", "KD_YD_CUSTOMER_REFERRER");
-            result.put("action", action != null ? action : "add"); // 默认add操作
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Content-Type", "application/x-www-form-urlencoded");
+
             result.put("data", cusRefData);
-            //todo 添加数据到金蝶数据库
-            // 添加日志记录
+// 将result转换为JSON字符串
+            String jsonStr = JSON.toJSONString(result);
+// 构建form参数
+            Map<String, Object> formParams = new HashMap<>();
+            formParams.put("jsons", jsonStr);
+// 发送请求
+            System.out.println("formParams====" + formParams);
+            HttpResponse response = null;
+            if ("add".equals(action)) {
+                response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/hgdjydtbcreatecusttjr")
+                        .headerMap(headers, true)
+                        .form(formParams)
+                        .timeout(30000)  // 30秒超时
+                        .execute();
+            } else {
+                response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/")
+                        .headerMap(headers, true)
+                        .form(formParams)
+                        .timeout(30000)  // 30秒超时
+                        .execute();
+            }
+
+            String responseBody = response.body();
+            System.out.println("res"+responseBody);
+            try {
+                String code = JSON.parseArray(responseBody)
+                        .getJSONObject(0)
+                        .getString("code");
+                String msg = JSON.parseArray(responseBody)
+                        .getJSONObject(0)
+                        .getString("msg");
+                System.out.println("msg"+msg);
+                ydClient.operateData(
+                        YDParam.builder()
+                                .formInstanceId(formInstId)
+                                .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_ml08nk3y, textareaField_mkxqgrvq",code, msg)))
+                                .useLatestVersion(true).build(),
+                        YDConf.FORM_OPERATION.update);
+            } catch (Exception e) {
+                System.out.println("解析JSON失败: " + e.getMessage());
+            }
             log.info("客户推荐人信息同步成功: formInstId={}, mc={}, bm={}", formInstId, mc, bm);
 
         } catch (Exception e) {

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

@@ -1,5 +1,8 @@
 package com.malk.huagao.service.impl;
 
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -18,6 +21,7 @@ import com.malk.utils.UtilMap;
 import lombok.extern.slf4j.Slf4j;
 import org.slf4j.MDC;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
@@ -43,6 +47,9 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
     @Autowired
     private KdYdCustomerLiaisonMapper kdYdCustomerLiaisonMapper;
 
+    @Value(value = "${kd.host}")
+    private String kdHost;
+
     @Override
     public Map<String, Object> insertCustomer(Map map) {
         Map<String, Object> result = new HashMap<>();
@@ -50,13 +57,29 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
         try {
             MDC.put("MDC_KEY_PID", "1003");
             String formInstId = UtilMap.getString(map, "formInstId");
-            String action = UtilMap.getString(map, "action");
+            String action = UtilMap.getString(map, "type");
 
             // 处理特殊操作类型
             if ("del".equals(action)) {
                 String bm = UtilMap.getString(map, "bm");
-                //todo 删除逻辑
+                Map<String, String> headers = new HashMap<>();
+                headers.put("Content-Type", "application/x-www-form-urlencoded");
+                Map<String, Object> formParams = new HashMap<>();
+                Map<String, Object> djbh = new HashMap<>();
+                djbh.put("djbh", bm);
+                result.put("data", djbh);
+                String jsonStr = JSON.toJSONString(result);
+
+                formParams.put("jsons", jsonStr);
 
+                System.out.println("====" + formParams);
+                HttpResponse response = HttpRequest.post(kdHost+"/xk/dyzn/WsBasedyzn.asmx/")//todo 待完善接口
+                        .headerMap(headers, true)
+                        .form(formParams)
+                        .timeout(30000)  // 30秒超时
+                        .execute();
+
+                String responseBody = response.body();
                 // 返回删除操作的格式
                 result.put("table", "KD_YD_CUSTOMER");
                 result.put("action", "del");
@@ -101,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<>();
@@ -116,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);
@@ -130,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");
@@ -162,18 +188,51 @@ public class KdYdCustomerServiceImpl extends ServiceImpl<KdYdCustomerMapper, KdY
                 // 将联系人列表添加到主数据
                 customData.put("contactList", contactList);
 
-                // 回写数据到宜搭
+                Map<String, String> headers = new HashMap<>();
+                headers.put("Content-Type", "application/x-www-form-urlencoded");
+
+                result.put("data", customData);
+// 将result转换为JSON字符串
+                String jsonStr = JSON.toJSONString(result);
+// 构建form参数
+                Map<String, Object> formParams = new HashMap<>();
+                formParams.put("jsons", jsonStr);
+// 发送请求
+                HttpResponse response = null;
+                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/hgdjydtbupdatecust")
+                            .headerMap(headers, true)
+                            .form(formParams)
+                            .timeout(30000)  // 30秒超时
+                            .execute();
+                }
+
+                String responseBody = response.body();
                 try {
-//                    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
-//                    );
+                    // 一行代码提取
+//                    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("textField_ml08nk3y, textareaField_mkxqgrvq", code, msg)))
+                                    .useLatestVersion(true).build(),
+                            YDConf.FORM_OPERATION.update);
+//
                     log.info("回写数据到宜搭成功,formInstId: {}", formInstId);
                 } catch (Exception e) {
                     log.warn("回写数据到宜搭失败,formInstId: {}, 错误: {}", formInstId, e.getMessage());
@@ -181,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);

+ 72 - 17
mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdDeliveryServiceImpl.java

@@ -1,5 +1,7 @@
 package com.malk.huagao.service.impl;
 
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -54,13 +56,29 @@ public class KdYdDeliveryServiceImpl extends ServiceImpl<KdYdDeliveryMapper, KdY
         try {
             MDC.put("MDC_KEY_PID", "1003");
             String formInstId = UtilMap.getString(map, "formInstId");
-            String action = UtilMap.getString(map, "action");
+            String action = UtilMap.getString(map, "type");
 
             // 处理特殊操作类型
             if ("del".equals(action)) {
                 String bm = UtilMap.getString(map, "bm");
-                //todo 删除逻辑
 
+                Map<String, String> headers = new HashMap<>();
+                headers.put("Content-Type", "application/x-www-form-urlencoded");
+                Map<String, Object> formParams = new HashMap<>();
+                Map<String, Object> djbh = new HashMap<>();
+                djbh.put("djbh", bm);
+                result.put("data", djbh);
+                String jsonStr = JSON.toJSONString(result);
+                formParams.put("jsons", jsonStr);
+
+                HttpResponse response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/hgdjydtbdeletefhtzd")
+                        .headerMap(headers, true)
+                        .form(formParams)
+                        .timeout(30000)  // 30秒超时
+                        .execute();
+
+                String responseBody = response.body();
+                System.out.println("responseBody===="+responseBody);
                 // 返回删除操作的格式
                 result.put("table", "KD_YD_DELIVERY");
                 result.put("action", "del");
@@ -92,7 +110,15 @@ public class KdYdDeliveryServiceImpl extends ServiceImpl<KdYdDeliveryMapper, KdY
             String xslx = UtilMap.getString(formData, "selectField_mgrn6p2d");
             String bzfs = UtilMap.getString(formData, "selectField_mf6a0h5y");
             String bz = UtilMap.getString(formData, "textareaField_mejnamfb");
-            LocalDateTime hhsj = parseTimestamp(UtilMap.getString(formData, "dateField_mf6a0h67"));
+//            LocalDateTime hhsj = parseTimestamp(UtilMap.getString(formData, "dateField_mf6a0h67"));
+            LocalDateTime hhsj = Optional.ofNullable(
+                            parseTimestamp(UtilMap.getString(formData, "dateField_mf6a0h67"))
+                    )
+                    .orElseGet(() -> LocalDateTime.now()
+                            .withHour(17)
+                            .withMinute(0)
+                            .withSecond(0)
+                            .withNano(0));
             String ysfs = UtilMap.getString(formData, "selectField_mf6a0h5z");
             String hdfs = UtilMap.getString(formData, "selectField_mf6a0h60");
             String kdgs = UtilMap.getString(formData, "selectField_mf6a0h61");
@@ -170,24 +196,53 @@ public class KdYdDeliveryServiceImpl extends ServiceImpl<KdYdDeliveryMapper, KdY
             deliveryData.put("fkfs", fkfs);
             deliveryData.put("DeliveryList", deliveryList);
 
-            // 设置返回结果
-            result.put("table", "KD_YD_DELIVERY");
-            result.put("action", action != null ? action : "add");
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Content-Type", "application/x-www-form-urlencoded");
+
             result.put("data", deliveryData);
+// 将result转换为JSON字符串
+            String jsonStr = JSON.toJSONString(result);
+// 构建form参数
+            Map<String, Object> formParams = new HashMap<>();
+            formParams.put("jsons", jsonStr);
+            System.out.println("formParams==="+formParams);
+// 发送请求
+            HttpResponse response = null;
+            if ("add".equals(action)) {
+                response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/hgdjydtbcreatefhtzd")
+                        .headerMap(headers, true)
+                        .form(formParams)
+                        .timeout(30000)  // 30秒超时
+                        .execute();
+            } else {
+                response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/")
+                        .headerMap(headers, true)
+                        .form(formParams)
+                        .timeout(30000)  // 30秒超时
+                        .execute();
+            }
 
-            // 添加日志记录
-            log.info("发货通知单同步成功: formInstId={}, djbh={}, kh={}", formInstId, djbh, kh);
+            String responseBody = response.body();
+            System.out.println("responseBody===="+responseBody);
 
-            // 如果需要回写到表单,可以在这里操作
-        /*
-        ydClient.operateData(
-            YDParam.builder()
-                .formInstanceId(formInstId)
-                .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_mgrqnxmm", "需要回写的值")))
-                .useLatestVersion(true).build(),
-            YDConf.FORM_OPERATION.update);
-        */
+            try {
 
+                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("textField_ml08nk3y, textareaField_mkz9u4p9", code, msg)))
+                                .useLatestVersion(true).build(),
+                        YDConf.FORM_OPERATION.update);
+
+            } catch (Exception e) {
+                System.out.println("解析JSON失败: " + e.getMessage());
+            }
         } catch (Exception e) {
             log.error("发货通知单同步异常", e);
             result.put("table", "KD_YD_DELIVERY");

+ 4 - 2
mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdMaterialServiceImpl.java

@@ -146,8 +146,6 @@ public class KdYdMaterialServiceImpl extends ServiceImpl<KdYdMaterialMapper, KdY
                     try {
                         Object deleteResult = ydClient.operateData(YDParam.builder()
                                 .formUuid("FORM-E64114E9F2C9426E91F92886EDFFA2C08Q90")
-                                .appType("APP_VQDMMWS6OR1VHL8VMFD3")
-                                .systemToken("XE766X81JHKXK4Z27SYOI86CPCLQ3J1LV7ODMH2")
                                 .formInstanceIdList(list)
                                 .build(), YDConf.FORM_OPERATION.delete_batch);
                         // 返回删除结果
@@ -199,6 +197,8 @@ public class KdYdMaterialServiceImpl extends ServiceImpl<KdYdMaterialMapper, KdY
                     String wlmc = safeGetStringValue(kdYdMaterial, "wlmc");
                     String xh = safeGetStringValue(kdYdMaterial, "xh");
                     String gg = safeGetStringValue(kdYdMaterial, "gg");
+                    String kssj = safeGetStringValue(kdYdMaterial, "kssj");
+                    String jzsj = safeGetStringValue(kdYdMaterial, "jzsj");
 
                     // 修复:安全处理FMATERIALID,可能为字符串或数字
                     Object fmaterialidObj = kdYdMaterial.get("FMATERIALID");
@@ -268,6 +268,8 @@ public class KdYdMaterialServiceImpl extends ServiceImpl<KdYdMaterialMapper, KdY
                     updateFormData.put("textField_mfxbtcdo", jbdw);
                     updateFormData.put("textField_mfxbtcdp", ssxl);
                     updateFormData.put("textField_mejl9nrs", jx);
+                    updateFormData.put("dateField_ml4ikfa0", kssj);
+                    updateFormData.put("dateField_ml4ikfa1", jzsj);
 
                     if (sd != null) {
                         updateFormData.put("numberField_mfxbtceb", sd);

+ 9 - 3
mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdOrderServiceImpl.java

@@ -117,10 +117,13 @@ public class KdYdOrderServiceImpl extends ServiceImpl<KdYdOrderMapper, KdYdOrder
                 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", msg)))
+                                .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_ml08nk3y, textareaField_mkxqgrvq", code, msg)))
                                 .useLatestVersion(true).build(),
                         YDConf.FORM_OPERATION.update);
                 // 返回作废操作的格式
@@ -308,7 +311,7 @@ public class KdYdOrderServiceImpl extends ServiceImpl<KdYdOrderMapper, KdYdOrder
             formParams.put("jsons", jsonStr);
 // 发送请求
             HttpResponse response = null;
-            if (actionType == "add") {
+            if ("add".equals(actionType)) {
                 response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/hgdjydtbxsdd")
                         .headerMap(headers, true)
                         .form(formParams)
@@ -332,10 +335,13 @@ public class KdYdOrderServiceImpl extends ServiceImpl<KdYdOrderMapper, KdYdOrder
                 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, textField_mjs6fuwo", code, msg, jdbh)))
                                 .useLatestVersion(true).build(),
                         YDConf.FORM_OPERATION.update);
 

+ 40 - 18
mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdOutboundServiceImpl.java

@@ -141,7 +141,7 @@ public class KdYdOutboundServiceImpl extends ServiceImpl<KdYdOutboundMapper, KdY
                 try {
                     String djbh = String.valueOf(tableItem.get("djbh"));
                     List<Map<String, Object>> tableList1 = UtilMap.getList(tableItem, "tableList");
-                    Integer deliveryId = UtilMap.getInt(tableItem, "deliveryId");
+                    String  deliveryId = UtilMap.getString(tableItem, "deliveryId");
 
                     // 检查明细数据是否存在
                     if (tableList1 == null || tableList1.isEmpty()) {
@@ -160,7 +160,7 @@ public class KdYdOutboundServiceImpl extends ServiceImpl<KdYdOutboundMapper, KdY
                     // 处理明细数据
                     for (Map item1 : tableList1) {
                         HashMap<String, String> tablemap = new HashMap<>();
-                        tablemap.put("textField_mg34txgm", String.valueOf(tableItem.get("djbh")));
+//                        tablemap.put("textField_mg34txgm", String.valueOf(tableItem.get("djbh")));
                         tablemap.put("textField_mejnamff", String.valueOf(item1.get("wlbm")));
                         tablemap.put("textField_mejnamfg", String.valueOf(item1.get("wlmc")));
                         tablemap.put("textField_mg34txh1", String.valueOf(item1.get("tpsb")));
@@ -187,13 +187,12 @@ public class KdYdOutboundServiceImpl extends ServiceImpl<KdYdOutboundMapper, KdY
                         tablemap.put("textField_mejnamf6", String.valueOf(item1.get("sjr")));
                         tablemap.put("textField_mejnamf7", String.valueOf(item1.get("sjdh")));
                         tablemap.put("textareaField_mf6a0h5e", String.valueOf(item1.get("sjdz")));
-                        tablemap.put("textField_mejnamfx", String.valueOf(item1.get("sxl")));
+                        tablemap.put("textField_mejnamfx", String.valueOf(item1.get("ssxl")));
                         tablemap.put("textField_mf6a0h6u", String.valueOf(item1.get("gg")));
                         tablemap.put("textField_mhlqeoas", String.valueOf(item1.get("zbq")));
 
                         // 处理日期字段
                         tablemap.put("dateField_mg34txhb", safeConvertDateTimeToString(item1.get("fwdqr")));
-                        tablemap.put("textField_mf6a0h6w", String.valueOf(item1.get("xlh")));
                         tablemap.put("textField_mhlqeoat", String.valueOf(item1.get("zbqsf")));
                         tablemap.put("textField_mf6a0h6x", String.valueOf(item1.get("kddh")));
                         tablemap.put("textField_mf6a0h6y", String.valueOf(item1.get("jx")));
@@ -222,7 +221,7 @@ public class KdYdOutboundServiceImpl extends ServiceImpl<KdYdOutboundMapper, KdY
 
                     // 查询发货单数据
                     String fhdformInstanceId = null;
-                    String fhdbh = String.valueOf(tableItem.get("fhdbh"));
+                    String fhdbh = null;
                     if (deliveryId != null) {
                         try {
                             log.debug("开始查询发货单数据: deliveryId={}", deliveryId);
@@ -358,26 +357,49 @@ public class KdYdOutboundServiceImpl extends ServiceImpl<KdYdOutboundMapper, KdY
     }
 
     // 辅助方法:安全转换日期时间为字符串
+//    private String safeConvertDateTimeToString(Object dateTime) {
+//        try {
+//            if (dateTime == null) {
+//                return "";
+//            }
+//
+//            if (dateTime instanceof java.time.LocalDateTime) {
+//                java.time.LocalDateTime dt = (java.time.LocalDateTime) dateTime;
+//                return String.valueOf(dt.atZone(java.time.ZoneId.systemDefault()).toInstant().toEpochMilli());
+//            }
+//
+//            return String.valueOf(dateTime);
+//        } catch (Exception e) {
+//            log.warn("转换日期时间异常: dateTime={}", dateTime);
+//            return "";
+//        }
+//    }
+    /**
+     * 最简化日期转换
+     */
     private String safeConvertDateTimeToString(Object dateTime) {
         try {
-            if (dateTime == null) {
-                return "";
+            if (dateTime instanceof LocalDateTime) {
+                return String.valueOf(((LocalDateTime) dateTime)
+                        .atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
             }
-
-            if (dateTime instanceof java.time.LocalDateTime) {
-                java.time.LocalDateTime dt = (java.time.LocalDateTime) dateTime;
-                return String.valueOf(dt.atZone(java.time.ZoneId.systemDefault()).toInstant().toEpochMilli());
+            if (dateTime instanceof Date) return String.valueOf(((Date) dateTime).getTime());
+            if (dateTime instanceof Long) return String.valueOf(dateTime);
+            if (dateTime instanceof Integer) {
+                long t = ((Integer) dateTime).longValue();
+                return String.valueOf(t < 10000000000L ? t * 1000L : t);
+            }
+            if (dateTime instanceof String) {
+                String s = ((String) dateTime).trim();
+                if (s.matches("\\d+")) {
+                    return String.valueOf(s.length() == 10 ? Long.parseLong(s) * 1000L : Long.parseLong(s));
+                }
             }
-
-            return String.valueOf(dateTime);
-        } catch (Exception e) {
-            log.warn("转换日期时间异常: dateTime={}", dateTime);
             return "";
-        }
+        } catch (Exception e) { return ""; }
     }
-
     private Object getfhdAss(String title, String id) {
-        return UtilMap.map("appType, formUuid, formType, instanceId, title, subTitle", "APP_VQDMMWS6OR1VHL8VMFD3", "FORM-A7F03ACEE01D4F609550C86BF7FE87D35M6I", "receipt", id, title, "");
+        return UtilMap.map("appType, formUuid, formType, instanceId, title, subTitle", "APP_VQDMMWS6OR1VHL8VMFD3", "FORM-FAE2575E112644ED914CAB4FEC9309F32AVR", "receipt", id, title, "");
     }
     private static LocalDateTime parseTimestamp(String timestampStr) {
         if (timestampStr == null || timestampStr.trim().isEmpty()) return null;

+ 35 - 52
mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdReceivableServiceImpl.java

@@ -243,7 +243,7 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
                     String djbh = String.valueOf(receivableItem.get("djbh"));
                     List<Map<String, Object>> tableListData = UtilMap.getList(receivableItem, "tableList");
                     List<Map<String, Object>> paymentListData = UtilMap.getList(receivableItem, "paymentList");
-                    Long receivableId = UtilMap.getLong(receivableItem, "receivableId");
+//                    String  receivableId = UtilMap.getString(receivableItem, "receivableId");
 
                     // 检查应收单明细数据是否存在
                     if (tableListData == null || tableListData.isEmpty()) {
@@ -256,13 +256,12 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
                     }
 
                     // 处理应收单明细
-                    int count = 1;
+
                     ArrayList<Object> tableList = new ArrayList<>();
                     for (Map<String, Object> detailItem : tableListData) {
                         HashMap<Object, Object> tablemap = new HashMap<>();
 
                         // 使用辅助方法安全获取和格式化数据
-                        tablemap.put("textField_mgt4w4ip", count);
                         tablemap.put("textField_mf6el3zy", String.valueOf(detailItem.get("wlbm")));
                         tablemap.put("textField_mf6el3zz", String.valueOf(detailItem.get("wlmc")));
                         tablemap.put("textField_mejmtic5", String.valueOf(detailItem.get("ggxh")));
@@ -271,7 +270,7 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
                         tablemap.put("numberField_mf6el402", safeFormatBigDecimal(detailItem.get("dj")));
                         tablemap.put("numberField_mejmticb", safeFormatBigDecimal(detailItem.get("hsdj")));
                         tablemap.put("numberField_mf6el403", safeFormatBigDecimal(detailItem.get("sl")));
-                        tablemap.put("numberField_mejmtic7", safeFormatBigDecimal(detailItem.get("jshj")));
+                        tablemap.put("numberField_mejmtic7", safeFormatBigDecimal(detailItem.get("jshj1")));
                         tablemap.put("textField_mf6el409", String.valueOf(detailItem.get("kcdw")));
                         tablemap.put("textField_mf6el408", String.valueOf(detailItem.get("ph")));
                         tablemap.put("numberField_mf6el406", safeFormatBigDecimal(detailItem.get("se")));
@@ -286,7 +285,7 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
                         tablemap.put("textField_mf6el40b", String.valueOf(detailItem.get("gg")));
                         tablemap.put("numberField_mf6el405", safeFormatBigDecimal(detailItem.get("zke")));
 
-                        count++;
+
                         tableList.add(tablemap);
                     }
 
@@ -298,21 +297,7 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
 
                             // 处理日期字段
                             Object endTimeObj = paymentItem.get("endTime");
-                            if (endTimeObj instanceof LocalDateTime) {
-                                long timestamp = ((LocalDateTime) endTimeObj).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
-                                tablemap1.put("dateField_mhiui6v9", timestamp);
-                            } else if (endTimeObj instanceof String) {
-                                // 尝试解析字符串日期
-                                try {
-                                    LocalDateTime dateTime = LocalDateTime.parse((String) endTimeObj,
-                                            DateTimeFormatter.ISO_LOCAL_DATE_TIME);
-                                    long timestamp = dateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
-                                    tablemap1.put("dateField_mhiui6v9", timestamp);
-                                } catch (Exception e) {
-                                    log.warn("无法解析日期字符串: {}", endTimeObj);
-                                }
-                            }
-
+                            tablemap1.put("dateField_mhiui6v9", safeConvertDateTimeToString(endTimeObj));
                             tablemap1.put("textField_mhiui6va", String.valueOf(paymentItem.get("xsddh")));
                             tablemap1.put("numberField_mhiui6v8", safeFormatBigDecimal(paymentItem.get("ysje")));
                             tablemap1.put("numberField_mhiui6v6", safeFormatBigDecimal(paymentItem.get("ysbl")));
@@ -374,18 +359,11 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
                     updateData.put("selectField_mev13l3r", String.valueOf(receivableItem.get("sktj")));
 
                     // 处理主表日期字段
-                    Object endTimeObj = receivableItem.get("endTime");
-                    if (endTimeObj instanceof LocalDateTime) {
-                        updateData.put("dateField_mejmtic3",
-                                ((LocalDateTime) endTimeObj).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
-                    }
+                    Object endTimeObj1 = receivableItem.get("endTime");
+                        updateData.put("dateField_mejmtic3", safeConvertDateTimeToString(endTimeObj1));
 
                     Object businessTimeObj = receivableItem.get("businessTime");
-                    if (businessTimeObj instanceof LocalDateTime) {
-                        updateData.put("dateField_mejmtic2",
-                                ((LocalDateTime) businessTimeObj).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
-                    }
-
+                        updateData.put("dateField_mejmtic2", safeConvertDateTimeToString(endTimeObj1));
                     updateData.put("numberField_mejmtic8", safeFormatBigDecimal(receivableItem.get("jshj")));
                     updateData.put("textField_mejmml3k", String.valueOf(receivableItem.get("kh")));
                     updateData.put("textField_mhjy9hzh", String.valueOf(receivableItem.get("xsy")));
@@ -412,7 +390,7 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
                     singleResult.put("paymentCount", tableListPay.size());
                     successCount++;
 
-                    log.info("应收单同步成功: djbh={}, receivableId={}", djbh, receivableId);
+//                    log.info("应收单同步成功: djbh={}, receivableId={}", djbh, receivableId);
 
                 } catch (Exception e) {
                     String djbh = String.valueOf(receivableItem.get("djbh"));
@@ -459,7 +437,7 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
         HashMap<String, Object> result = new HashMap<>();
 
         try {
-            MDC.put("MDC_KEY_PID", "1006");
+            MDC.put("MDC_KEY_PID", "1003");
             List<Map<String, Object>> kdYdPaymentReceiptDels = UtilMap.getList(json, "data");
             String action = UtilMap.getString(json, "action");
             String table = UtilMap.getString(json, "table");
@@ -547,7 +525,7 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
                 try {
                     String djbh = String.valueOf(paymentItem.get("djbh"));
                     List<Map<String, Object>> tableListData = UtilMap.getList(paymentItem, "tableList");
-                    Long paymentReceiptId = UtilMap.getLong(paymentItem, "paymentReceiptId");
+//                    String  paymentReceiptId = UtilMap.getString(paymentItem, "paymentReceiptId");
 
                     // 检查明细数据是否存在
                     if (tableListData == null || tableListData.isEmpty()) {
@@ -634,22 +612,8 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
 
                     // 处理日期字段
                     Object ywrqObj = paymentItem.get("ywrq");
-                    if (ywrqObj != null) {
-                        if (ywrqObj instanceof LocalDateTime) {
-                            long timestamp = ((LocalDateTime) ywrqObj).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
-                            updateMap.put("dateField_mh9woan5", timestamp);
-                        } else if (ywrqObj instanceof String) {
-                            // 尝试解析字符串日期
-                            try {
-                                LocalDateTime dateTime = LocalDateTime.parse((String) ywrqObj,
-                                        DateTimeFormatter.ISO_LOCAL_DATE_TIME);
-                                long timestamp = dateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
-                                updateMap.put("dateField_mh9woan5", timestamp);
-                            } catch (Exception e) {
-                                log.warn("无法解析日期字符串: {}", ywrqObj);
-                            }
-                        }
-                    }
+                                updateMap.put("dateField_mh9woan5", safeConvertDateTimeToString(ywrqObj));
+
 
                     updateMap.put("textField_mh9woanp", String.valueOf(paymentItem.get("wldwlx")));
                     updateMap.put("textField_mh9woanq", String.valueOf(paymentItem.get("wldw")));
@@ -672,10 +636,9 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
                     singleResult.put("operationResult", operationResult);
                     singleResult.put("status", "success");
                     singleResult.put("ddformInstanceId", ddformInstanceId);
-                    singleResult.put("paymentReceiptId", paymentReceiptId);
                     successCount++;
 
-                    log.info("收款单同步成功: djbh={}, paymentReceiptId={}", djbh, paymentReceiptId);
+//                    log.info("收款单同步成功: djbh={}, paymentReceiptId={}", djbh, paymentReceiptId);
 
                 } catch (Exception e) {
                     String djbh = String.valueOf(paymentItem.get("djbh"));
@@ -715,7 +678,27 @@ public class KdYdReceivableServiceImpl extends ServiceImpl<KdYdReceivableMapper,
 
         return result;
     }
-
+    private String safeConvertDateTimeToString(Object dateTime) {
+        try {
+            if (dateTime instanceof LocalDateTime) {
+                return String.valueOf(((LocalDateTime) dateTime)
+                        .atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
+            }
+            if (dateTime instanceof Date) return String.valueOf(((Date) dateTime).getTime());
+            if (dateTime instanceof Long) return String.valueOf(dateTime);
+            if (dateTime instanceof Integer) {
+                long t = ((Integer) dateTime).longValue();
+                return String.valueOf(t < 10000000000L ? t * 1000L : t);
+            }
+            if (dateTime instanceof String) {
+                String s = ((String) dateTime).trim();
+                if (s.matches("\\d+")) {
+                    return String.valueOf(s.length() == 10 ? Long.parseLong(s) * 1000L : Long.parseLong(s));
+                }
+            }
+            return "";
+        } catch (Exception e) { return ""; }
+    }
     // 辅助方法 - 安全格式化 BigDecimal 为字符串(保留2位小数)
     private String safeFormatBigDecimalToString(Object value) {
         if (value == null) {

+ 26 - 20
mjava-huagao/src/main/java/com/malk/huagao/service/impl/KdYdTransferServiceImpl.java

@@ -259,10 +259,7 @@ public class KdYdTransferServiceImpl extends ServiceImpl<KdYdTransferMapper, KdY
                 try {
                     String djbh = String.valueOf(transferItem.get("djbh"));
                     List<Map<String, Object>> tableListData = UtilMap.getList(transferItem, "tableList");
-                    Long transferId = UtilMap.getLong(transferItem, "transferId");
-
-//                    singleResult.put("djbh", djbh);
-//                    singleResult.put("transferId", transferId);
+                    String  transferId = UtilMap.getString(transferItem, "transferId");
 
                     // 检查明细数据是否存在
                     if (tableListData == null || tableListData.isEmpty()) {
@@ -310,6 +307,7 @@ public class KdYdTransferServiceImpl extends ServiceImpl<KdYdTransferMapper, KdY
                                     .collect(Collectors.toList());
 
                             tableListxlh.addAll(currentXlhList);
+                            tableList.add(tablemap);
                         }
                     }
 
@@ -408,7 +406,7 @@ public class KdYdTransferServiceImpl extends ServiceImpl<KdYdTransferMapper, KdY
                     }
                     if (fhdbh != null && fhdformInstanceId != null) {
                         updateMap.put("associationFormField_mjzervdt",
-                                Collections.singletonList(getddAss(fhdbh, fhdformInstanceId)));
+                                Collections.singletonList(getfhdAss(fhdbh, fhdformInstanceId)));
                     }
 
                     // 添加订单相关字段(如果所有字段都存在)
@@ -433,21 +431,9 @@ public class KdYdTransferServiceImpl extends ServiceImpl<KdYdTransferMapper, KdY
                     updateMap.put("textField_miptelgd", String.valueOf(transferItem.get("cgy")));
                     updateMap.put("selectField_mhubzsa7", String.valueOf(transferItem.get("dchzlx")));
                     updateMap.put("textField_mhubzsa6", String.valueOf(transferItem.get("ywlx")));
-
                     // 处理日期字段
                     Object rq = transferItem.get("rq");
-                    if (rq != null) {
-                        if (rq instanceof LocalDateTime) {
-                            String rqMillis = String.valueOf(((LocalDateTime) rq)
-                                    .atZone(ZoneId.systemDefault())
-                                    .toInstant()
-                                    .toEpochMilli());
-                            updateMap.put("dateField_mhubzsab", rqMillis);
-                        } else if (rq instanceof String) {
-                            updateMap.put("dateField_mhubzsab", rq);
-                        }
-                    }
-
+                            updateMap.put("dateField_mhubzsab", safeConvertDateTimeToString(rq));
                     updateMap.put("selectField_mhubzsa9", String.valueOf(transferItem.get("drhzlx")));
                     updateMap.put("selectField_mhubzsaa", String.valueOf(transferItem.get("dbfx")));
                     updateMap.put("selectField_mhubzsac", String.valueOf(transferItem.get("dbdlx")));
@@ -508,7 +494,27 @@ public class KdYdTransferServiceImpl extends ServiceImpl<KdYdTransferMapper, KdY
         }
         return result;
     }
-
+//    private String safeConvertDateTimeToString(Object dateTime) {
+//        try {
+//            if (dateTime instanceof LocalDateTime) {
+//                return String.valueOf(((LocalDateTime) dateTime)
+//                        .atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
+//            }
+//            if (dateTime instanceof Date) return String.valueOf(((Date) dateTime).getTime());
+//            if (dateTime instanceof Long) return String.valueOf(dateTime);
+//            if (dateTime instanceof Integer) {
+//                long t = ((Integer) dateTime).longValue();
+//                return String.valueOf(t < 10000000000L ? t * 1000L : t);
+//            }
+//            if (dateTime instanceof String) {
+//                String s = ((String) dateTime).trim();
+//                if (s.matches("\\d+")) {
+//                    return String.valueOf(s.length() == 10 ? Long.parseLong(s) * 1000L : Long.parseLong(s));
+//                }
+//            }
+//            return "";
+//        } catch (Exception e) { return ""; }
+//    }
     // 辅助方法 - 安全转换 BigDecimal 为字符串
     private String safeConvertBigDecimalToString(Object value) {
         if (value == null) {
@@ -563,7 +569,7 @@ public class KdYdTransferServiceImpl extends ServiceImpl<KdYdTransferMapper, KdY
         return UtilMap.map("appType, formUuid, formType, instanceId, title, subTitle", "APP_VQDMMWS6OR1VHL8VMFD3", "FORM-B62CAE3075CE4098B17BB86C90FFA21C9B7C", "receipt", id, title, "");
     }
     private Object getfhdAss(String title, String id) {
-        return UtilMap.map("appType, formUuid, formType, instanceId, title, subTitle", "APP_VQDMMWS6OR1VHL8VMFD3", "FORM-A7F03ACEE01D4F609550C86BF7FE87D35M6I", "receipt", id, title, "");
+        return UtilMap.map("appType, formUuid, formType, instanceId, title, subTitle", "APP_VQDMMWS6OR1VHL8VMFD3", "FORM-FAE2575E112644ED914CAB4FEC9309F32AVR", "receipt", id, title, "");
     }
     private String safeGetString(Map formData, String key) {
         Object val = formData.get(key);

+ 9 - 5
mjava-huagao/src/main/resources/application-dev.yml

@@ -16,7 +16,7 @@ spring:
   datasource:
     driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
     #trustServerCertificate=true 临时绕过证书验证的风险
-    url: jdbc:sqlserver://113.45.187.194:1433;databaseName=dingding;encrypt=true;trustServerCertificate=true;
+    url: jdbc:sqlserver://61.174.28.154:1433;databaseName=dingding;encrypt=true;trustServerCertificate=true;
     username: hgdd
     password: hgdd@2025
 
@@ -48,15 +48,15 @@ aliwork:
 
 kingdee:
   # 第三方系统登录授权的账套ID
-  X-KDApi-AcctID: 626cda24137359
+  X-KDApi-AcctID: 697ecdcc4267e8
   # 第三方系统登录授权的用户
   X-KDApi-UserName: dingding
   # 第三方系统登录授权的应用ID
-  X-KDApi-AppID: 322503_566rSdHtylkb4+XoW1XoRdVGSqW85LOs
+  X-KDApi-AppID: 335775_R16NTZiFTpq/2+1vR74KQbSs2K0b0oms
   # 第三方系统登录授权的应用密钥
-  X-KDApi-AppSec: 7eaf6845da0540e6b8f328541b36dff6
+  X-KDApi-AppSec: ce7e0211058a428ca858d332e7f80f4d
   # 服务Url地址(公有云统一走网关sdk底层已处理,无需传X-KDApi-ServerUrl,下面这行需要注释)
-  X-KDApi-ServerUrl: http://113.45.187.194:81/k3cloud/
+  X-KDApi-ServerUrl: http://61.174.28.154:81/k3cloud/
   # 账套语系,默认2052
   # X-KDApi-LCID: 2052
   # 组织编码,启用多组织时配置对应的组织编码才有效
@@ -70,6 +70,10 @@ eqb:
   downloadFilePath: C:\\Users\\EDY\\Desktop\\项目\\华高\\电子签\\files\\
   signatoryPsnId: c3fb35cb7e574baf97ed9f8917c6327b #签署人 陈伟东
 
+#金蝶方开发服务
+kd:
+  host: https://61.174.28.154:70
+
 
 
 

+ 11 - 7
mjava-huagao/src/main/resources/application-prod.yml

@@ -2,7 +2,7 @@ server:
   port: 7708
   servlet:
     context-path: /huagao
-  host: http://mes.huagaochina.com:7708
+  host: http://61.174.28.154:7708
 
 enable:
   scheduling: true
@@ -16,7 +16,7 @@ spring:
   datasource:
     driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
     #trustServerCertificate=true 临时绕过证书验证的风险
-    url: jdbc:sqlserver://113.45.187.194:1433;databaseName=dingding;encrypt=true;trustServerCertificate=true;
+    url: jdbc:sqlserver://172.16.24.19:1433;databaseName=dingding;encrypt=true;trustServerCertificate=true;
     username: hgdd
     password: hgdd@2025
 
@@ -48,15 +48,15 @@ aliwork:
 
 kingdee:
   # 第三方系统登录授权的账套ID
-  X-KDApi-AcctID: 626cda24137359
+  X-KDApi-AcctID: 697ecdcc4267e8
   # 第三方系统登录授权的用户
   X-KDApi-UserName: dingding
   # 第三方系统登录授权的应用ID
-  X-KDApi-AppID: 322503_566rSdHtylkb4+XoW1XoRdVGSqW85LOs
+  X-KDApi-AppID: 335775_R16NTZiFTpq/2+1vR74KQbSs2K0b0oms
   # 第三方系统登录授权的应用密钥
-  X-KDApi-AppSec: 7eaf6845da0540e6b8f328541b36dff6
+  X-KDApi-AppSec: ce7e0211058a428ca858d332e7f80f4d
   # 服务Url地址(公有云统一走网关sdk底层已处理,无需传X-KDApi-ServerUrl,下面这行需要注释)
-  X-KDApi-ServerUrl: http://113.45.187.194:81/k3cloud/
+  X-KDApi-ServerUrl: http://61.174.28.154:81/k3cloud/
   # 账套语系,默认2052
   # X-KDApi-LCID: 2052
   # 组织编码,启用多组织时配置对应的组织编码才有效
@@ -68,4 +68,8 @@ kingdee:
 
 eqb:
   downloadFilePath: /home/server/huagao/files/
-  signatoryPsnId: c3fb35cb7e574baf97ed9f8917c6327b #签署人 陈伟东
+  signatoryPsnId: c3fb35cb7e574baf97ed9f8917c6327b #签署人 陈伟东
+
+#金蝶方开发服务
+kd:
+  host: http://172.16.24.173:70

+ 11 - 7
mjava-huagao/src/main/resources/application-prod2.yml

@@ -3,7 +3,7 @@ server:
   port: 7708
   servlet:
     context-path: /huagao
-    host: http://mes.huagaochina.com:7708
+    host: http://61.174.28.154:7708
 
 enable:
   scheduling: true
@@ -17,7 +17,7 @@ spring:
   datasource:
     driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
     #trustServerCertificate=true 临时绕过证书验证的风险
-    url: jdbc:sqlserver://113.45.187.194:1433;databaseName=dingding;encrypt=true;trustServerCertificate=true;
+    url: jdbc:sqlserver://172.16.24.19:1433;databaseName=dingding;encrypt=true;trustServerCertificate=true;
     username: hgdd
     password: hgdd@2025
 
@@ -49,15 +49,15 @@ aliwork:
 
 kingdee:
   # 第三方系统登录授权的账套ID
-  X-KDApi-AcctID: 626cda24137359
+  X-KDApi-AcctID: 697ecdcc4267e8
   # 第三方系统登录授权的用户
   X-KDApi-UserName: dingding
   # 第三方系统登录授权的应用ID
-  X-KDApi-AppID: 322503_566rSdHtylkb4+XoW1XoRdVGSqW85LOs
+  X-KDApi-AppID: 335775_R16NTZiFTpq/2+1vR74KQbSs2K0b0oms
   # 第三方系统登录授权的应用密钥
-  X-KDApi-AppSec: 7eaf6845da0540e6b8f328541b36dff6
+  X-KDApi-AppSec: ce7e0211058a428ca858d332e7f80f4d
   # 服务Url地址(公有云统一走网关sdk底层已处理,无需传X-KDApi-ServerUrl,下面这行需要注释)
-  X-KDApi-ServerUrl: http://113.45.187.194:81/k3cloud/
+  X-KDApi-ServerUrl: http://61.174.28.154:81/k3cloud/
   # 账套语系,默认2052
   # X-KDApi-LCID: 2052
   # 组织编码,启用多组织时配置对应的组织编码才有效
@@ -69,4 +69,8 @@ kingdee:
 
 eqb:
   downloadFilePath: /home/server/huagao/files/
-  signatoryPsnId: c3fb35cb7e574baf97ed9f8917c6327b #签署人 陈伟东
+  signatoryPsnId: c3fb35cb7e574baf97ed9f8917c6327b #签署人 陈伟东
+
+#金蝶方开发服务
+kd:
+  host: http://172.16.24.173:70

+ 6 - 0
mjava-lianan/src/main/java/com/malk/lianan/controller/LianAnGyPayController.java

@@ -104,4 +104,10 @@ public class LianAnGyPayController {
         return lianAnGyPayService.salaryPay(map);
     }
 
+    //通用报销
+    @PostMapping("reimburse")
+    public McR reimburse(@RequestBody Map map){
+        return lianAnGyPayService.reimburse(map);
+    }
+
 }

+ 19 - 0
mjava-lianan/src/main/java/com/malk/lianan/schedule/LianAnScheduleTask.java

@@ -0,0 +1,19 @@
+package com.malk.lianan.schedule;
+
+import com.malk.lianan.service.LianAnService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+
+@Slf4j
+@Configuration
+@EnableScheduling
+@ConditionalOnProperty(name = {"enable.scheduling"})
+public class LianAnScheduleTask {
+    @Autowired
+    private LianAnService lianAnService;
+
+}

+ 2 - 0
mjava-lianan/src/main/java/com/malk/lianan/service/LianAnGyPayService.java

@@ -12,4 +12,6 @@ public interface LianAnGyPayService {
     void callback(Map result);
 
     McR salaryPay(Map map);
+
+    McR reimburse(Map map);
 }

+ 5 - 0
mjava-lianan/src/main/java/com/malk/lianan/service/LianAnService.java

@@ -0,0 +1,5 @@
+package com.malk.lianan.service;
+
+public interface LianAnService {
+
+}

+ 107 - 13
mjava-lianan/src/main/java/com/malk/lianan/service/impl/LianAnGyServiceImpl.java

@@ -15,6 +15,7 @@ import com.malk.service.aliwork.YDClient;
 import com.malk.utils.UtilDateTime;
 import com.malk.utils.UtilMap;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.logging.log4j.util.Strings;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
@@ -115,8 +116,8 @@ public class LianAnGyServiceImpl implements LianAnGyPayService {
             paymentRec.put("PrivateAmount",privateAmount);
             paymentRec.put("ReceiveAccountNo",receiveAccountNo);
             paymentRec.put("ReceiveAccountName",receiveAccountName);
-            paymentRec.put("PayUse",payUse);
-            paymentRec.put("Purpose",payUse);
+            paymentRec.put("PayUse","付款");//摘要长度上限20
+            paymentRec.put("Purpose","付款");
 
             paymentRecList.add(paymentRec);
         }
@@ -168,7 +169,9 @@ public class LianAnGyServiceImpl implements LianAnGyPayService {
 
         String payAmount = UtilMap.getDouble(formData, "numberField_mjqt1xrt").toString();
 
-        String payUse = UtilMap.getString(formData, "textareaField_mjsl53kh");//摘要
+        String fymx = UtilMap.getString(formData, "textareaField_mjsl53kh");//费用明细
+
+        String purpose = UtilMap.getString(formData, "selectField_mjzgprmw");//付款类型 用途
 
         int retryNum = UtilMap.getInt(formData, "numberField_mkf5q51o");//重试次数
 
@@ -185,8 +188,9 @@ public class LianAnGyServiceImpl implements LianAnGyPayService {
         item.put("PayCurrencyType","CNY");//币种(为空,默认: CNY 有付款账号时,不能为 空)
         item.put("PayCurrencyName","人民币");//币种名称(为空,默认:人民币, 有付款账号时,不能为空)
         item.put("WhetherUrgent",whetherUrgentValue);//是否加急 1.是 2.否
-        item.put("PayUse",payUse);
-        item.put("Purpose",payUse);
+        item.put("Remark",fymx);//附言
+        item.put("PayUse",purpose);//摘要长度上限20
+        item.put("Purpose",purpose);
 
         Map paymentRec = new HashMap();
         paymentRec.put("ReceiveAccountNo",skfyhzh);
@@ -244,12 +248,26 @@ public class LianAnGyServiceImpl implements LianAnGyPayService {
                     String relPaymentDate2 = UtilMap.getString(map, "RelPaymentDate");
                     String failReasons2 = UtilMap.getString(resultInfo, "FailReasons");
 
-                    //更新付款明细
-                    ydClient.operateData(YDParam.builder()
+                    //查询付款明细
+                    List<Map> data = (List<Map>) ydClient.queryData(YDParam.builder()
                             .searchCondition(JSONObject.toJSONString(UtilMap.map("textField_mjs6mcfn, textField_mk128ce5", billsPayOrderNo, billsPayOrderNo2)))
-                            .formUuid("FORM-2D646B4D1C1F4628A0DEA1072656901143Y9")
-                            .formDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mjs6mcgg, dateField_mkdm7y7c, textareaField_mjs6mcgf",PayStatusName2,DateUtil.parse(relPaymentDate2, "yyyy-MM-dd").getTime(),failReasons2)))
-                            .build(), YDConf.FORM_OPERATION.upsert);
+                            .formUuid("FORM-2D646B4D1C1F4628A0DEA1072656901143Y9").build(), YDConf.FORM_QUERY.retrieve_list).getData();
+
+                    //付款明细逐条更新 防止集成自动化并发
+                    for (Map datum : data) {
+                        String detailFormInstId = UtilMap.getString(datum, "formInstanceId");
+
+                        ydClient.operateData(YDParam.builder()
+                                .formInstanceId(detailFormInstId)
+                                .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mjs6mcgg, dateField_mkdm7y7c, textareaField_mjs6mcgf",PayStatusName2, Strings.isNotBlank(relPaymentDate2) ? DateUtil.parse(relPaymentDate2, "yyyy-MM-dd").getTime() : null,failReasons2)))
+                                .build(), YDConf.FORM_OPERATION.update);
+
+                        try {
+                            Thread.sleep(3000);
+                        } catch (InterruptedException e) {
+                            throw new RuntimeException(e);
+                        }
+                    }
                 }
             }else {
                 //无付款明细
@@ -267,9 +285,7 @@ public class LianAnGyServiceImpl implements LianAnGyPayService {
                             .formDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mjs6mcgg, dateField_mkdm7y7c, textareaField_mjs6mcgf",payStatusName,DateUtil.parse(relPaymentDate, "yyyy-MM-dd").getTime(),failReasons)))
                             .build(), YDConf.FORM_OPERATION.upsert);
                 }
-
             }
-
         }else {
             //付款单生成失败
             String failReasons = UtilMap.getString(resultInfo, "FailReasons");
@@ -332,7 +348,7 @@ public class LianAnGyServiceImpl implements LianAnGyPayService {
         String note = UtilMap.getString(formData, "textareaField_mkdsowjj");//备注
         item.put("Remark",note);//备注
         String payUse = UtilMap.getString(formData, "textareaField_mjmc84h9");//费用明细
-        item.put("PayUse",payUse);
+        item.put("PayUse","工资");//摘要长度上限20
         item.put("Purpose","工资");
 
         List<Map> batchPrivateRecList = new ArrayList<>();
@@ -369,6 +385,84 @@ public class LianAnGyServiceImpl implements LianAnGyPayService {
         return McR.success();
     }
 
+    @Override
+    public McR reimburse(Map map) {
+        String formInstId = UtilMap.getString(map, "formInstId");
+
+        Map item = new HashMap();
+
+        Map formData = ydClient.queryData(YDParam.builder()
+                .formInstanceId(formInstId)
+                .build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
+
+        String fkgs = UtilMap.getString(formData, "textField_mjzgymw0");//付款公司
+        String fkfyhzh = UtilMap.getString(formData, "textField_mjzgymw1");//付款方银行账号
+
+        int retryNUM = UtilMap.getInt(formData, "numberField_mkp4wc2r");//重试次数
+
+        if (retryNUM > 0){
+            item.put("BillsPayOrderNo",formInstId + "_" + retryNUM);//外部系统单据编号
+        }else {
+            item.put("BillsPayOrderNo",formInstId);//外部系统单据编号
+        }
+
+        //时间戳转化为yyyy-MM-dd
+        long fkrq = UtilMap.getLong(formData, "dateField_mkdsowjd");
+        String fkrqStr = DateUtil.format(new Date(fkrq), "yyyy-MM-dd");
+        item.put("PaymentDate",fkrqStr);//付款日期(期望支付日期)
+        item.put("BusinessTypeCode",GYPAY_API_TYPE_NO);//业务类型编号
+        item.put("BusinessTypeName",GYPAY_API_TYPE_NAME);//业务类型名称
+        item.put("PayOrgName",fkgs);//付款单位名称
+        item.put("PayAccountNo",fkfyhzh);//付款方银行账号
+        String payChannel = UtilMap.getString(formData, "selectField_mjm87v3v");
+        String payChannelValue = "";
+        //支付方式 1.直联支付 2.线下支付 3.全额支付 4.差额支付
+        switch (payChannel){
+            case "直联支付":payChannelValue = "1";break;
+            case "线下支付":payChannelValue = "2";break;
+            default:break;
+        }
+        item.put("PayChannel",payChannelValue);
+        item.put("SumPayAmount",UtilMap.getDouble(formData, "numberField_mkdsowjo").toString());//合计付款金额
+        item.put("PayCurrencyType","CNY");//币种(为空,默认: CNY 有付款账号时,不能为 空)
+
+        item.put("PayCurrencyName","人民币");//币种名称(为空,默认:人民币, 有付款账号时,不能为空)
+        String whetherUrgent = UtilMap.getString(formData, "radioField_mkdsowje");
+        item.put("WhetherUrgent","是".equals(whetherUrgent) ? 1 : 2);//是否加急 1.是 2.否
+        String note = UtilMap.getString(formData, "textareaField_mkdsowjj");//备注
+        item.put("Note",note);//备注
+
+        List<Map> paymentRecList = new ArrayList<>();
+
+        List<Map> details = UtilMap.getList(formData, "tableField_mjm9e1zc");
+        for (Map detail : details) {
+            String billsPayOrderNo = UtilMap.getString(detail,"textField_mk1278lu");//收款方单据编号
+            String privateAmount = UtilMap.getDouble(detail,"numberField_mjm9e1zl").toString();//付款金额
+            String receiveAccountNo = UtilMap.getString(detail,"textField_mjm9e1zf");//收款方银行账号
+            String receiveAccountName = UtilMap.getString(detail,"textField_mjm9e1zg");//收款方账户名称
+            String payUse = UtilMap.getString(detail,"textareaField_mjsl53kh");//费用明细
+
+            Map paymentRec = new HashMap();
+            paymentRec.put("BillsPayOrderNo",billsPayOrderNo);
+            paymentRec.put("PrivateAmount",privateAmount);
+            paymentRec.put("ReceiveAccountNo",receiveAccountNo);
+            paymentRec.put("ReceiveAccountName",receiveAccountName);
+            paymentRec.put("PayUse","报销");//摘要长度上限20
+            paymentRec.put("Purpose","报销");
+
+            paymentRecList.add(paymentRec);
+        }
+
+        item.put("PaymentRecList",paymentRecList);
+
+        Map<String,Object> data = UtilMap.map("ParamSet", Arrays.asList(item));
+
+        Map result = gyPost("T0022", data);
+
+
+        return McR.success();
+    }
+
     private Map gyPost(String MesgNo,Map<String,Object> data){
         log.info("data:{}",data);
 

+ 20 - 0
mjava-lianan/src/main/java/com/malk/lianan/service/impl/LianAnServiceImpl.java

@@ -0,0 +1,20 @@
+package com.malk.lianan.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.malk.lianan.service.LianAnService;
+import com.malk.server.aliwork.YDConf;
+import com.malk.server.aliwork.YDParam;
+import com.malk.service.aliwork.YDClient;
+import com.malk.utils.UtilMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class LianAnServiceImpl implements LianAnService {
+    @Autowired
+    private YDClient ydClient;
+
+}

+ 24 - 15
mjava-lilin/src/main/java/com/malk/lilin/Service/impl/LiLinServiceImpl.java

@@ -535,12 +535,15 @@ public class LiLinServiceImpl implements LiLinService {
 
             for (Map<String, Object> row : tableField) {
                 String instructionId = String.valueOf(row.get("textField_mdnuob9a")); // 子表电子凭证号
-                String projectInfo = String.valueOf(row.get("textField_m9lfmh1o")); // 项目名称
-                String projectCode = String.valueOf(row.get("textField_m9lfmh1p")); // 项目编号
-                String businessSegment = String.valueOf(row.get("selectField_mkash8u9")); // 板块名称
-                String businessProjectStatus = String.valueOf(row.get("selectField_mkash8ua")); // 项目状态
                 String payAmount = String.valueOf(row.get("numberField_m8yf6gn1")); // 子表金额
-                String projectManager = String.valueOf(row.get("employeeField_m9lfmh1r")).replace("[\"", "").replace("\"]", "").trim(); // 项目负责人
+                String projectInfo = getStringValue(row, "textField_m9lfmh1o"); // 项目名称
+                String projectCode = getStringValue(row, "textField_m9lfmh1p"); // 项目编号
+                String businessSegment = getStringValue(row, "selectField_mkash8u9"); // 板块名称
+                String businessProjectStatus = getStringValue(row, "selectField_mkash8ua"); // 项目状态
+
+// 对于employeeField_m9lfmh1r字段的特殊处理
+                String projectManagerRaw = getStringValue(row, "employeeField_m9lfmh1r");
+                String projectManager = projectManagerRaw.replace("[\"", "").replace("\"]", "").trim(); // 项目负责人
 
                 // 构建 projectInfo
                 Map<String, Object> metaJson1 = new HashMap<>();
@@ -593,11 +596,12 @@ public class LiLinServiceImpl implements LiLinService {
             // 不是物流付款单:使用主表字段,发起一次支付
             String instructionId = String.valueOf(data.get("serialNumberField_m9ze3rjd")); // 主表电子凭证号
             String payAmount = String.valueOf(data.get("numberField_m9ze3rk4")); // 主表金额
-            String projectManager = String.valueOf(data.get("employeeField_mi647wos")).replace("[\"", "").replace("\"]", "").trim(); // 项目负责人
-            String projectCode = String.valueOf(data.get("textField_madmzxce"));
-            String businessSegment = String.valueOf(data.get("selectField_mjqhty52")); // 业务板块
-            String businessProjectStatus = String.valueOf(data.get("selectField_m9ks0c66")); // 项目状态
-            String projectInfo = String.valueOf(data.get("textField_mayubz25"));
+            String projectManager = getStringValue(data, "employeeField_mi647wos")
+                    .replace("[\"", "").replace("\"]", "").trim(); // 项目负责人
+            String projectCode = getStringValue(data, "textField_madmzxce");
+            String businessSegment = getStringValue(data, "selectField_mjqhty52"); // 业务板块
+            String businessProjectStatus = getStringValue(data, "selectField_m9ks0c66"); // 项目状态
+            String projectInfo = getStringValue(data, "textField_mayubz25");
 //            String projectInfo = xmbh + "-" + xmmc;
 
             Map<String, Object> metaJson1 = new HashMap<>();
@@ -1357,11 +1361,16 @@ public class LiLinServiceImpl implements LiLinService {
             JSONObject item = subBankStatementList1.getJSONObject(i);
             Map<String, Object> mapItem = new HashMap<>();
             mapItem.put("id", item.getInteger("id"));
-            mapItem.put("projectInfo", item.getString("projectInfo"));
-            mapItem.put("businessSegment", item.getString("businessSegment"));
-            mapItem.put("businessProjectStatus", item.getString("businessProjectStatus"));
-            mapItem.put("projectManager", item.getString("projectManager"));
-            mapItem.put("projectCode", item.getString("projectCode"));
+            String projectInfo = item.getString("projectInfo");
+            mapItem.put("projectInfo", projectInfo != null ? projectInfo : "");
+            String businessSegment = item.getString("businessSegment");
+            mapItem.put("businessSegment", businessSegment != null ? businessSegment : "");
+            String businessProjectStatus = item.getString("businessProjectStatus");
+            mapItem.put("businessProjectStatus", businessProjectStatus != null ? businessProjectStatus : "");
+            String projectManager = item.getString("projectManager");
+            mapItem.put("projectManager", projectManager != null ? projectManager : "");
+            String projectCode = item.getString("projectCode");
+            mapItem.put("projectCode", projectCode != null ? projectCode : "");
             result.add(mapItem);
         }