Przeglądaj źródła

1.29代码提交

“lqy 5 dni temu
rodzic
commit
63a63d4866

+ 61 - 3
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;
@@ -50,13 +53,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("http://113.45.187.194:70/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");
@@ -162,8 +181,47 @@ 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 (action == "add") {
+                    response = HttpRequest.post("http://113.45.187.194:70/xk/dyzn/WsBasedyzn.asmx/")//todo 修改接口
+                            .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();
                 try {
+                    // 一行代码提取
+                    String jdbh = JSON.parseArray(responseBody)
+                            .getJSONObject(0)
+                            .getJSONObject("data")
+                            .getString("djbh");
+                    String msg = JSON.parseArray(responseBody)
+                            .getJSONObject(0)
+                            .getString("msg");
+                    ydClient.operateData(
+                            YDParam.builder()
+                                    .formInstanceId(formInstId)
+                                    .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textareaField_mkxqgrvq, textField_mjs6fuwo", msg, jdbh)))
+                                    .useLatestVersion(true).build(),
+                            YDConf.FORM_OPERATION.update);
 //                    Map<String, Object> updatePayload = new HashMap<>();
 //                    updatePayload.put("tableField_mfkks8ww", updatedTableRowsForYD);
 //                    ydClient.operateData(

+ 0 - 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);
                         // 返回删除结果

+ 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);

+ 1 - 1
mjava-huagao/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: prod
+    active: dev
   servlet:
     multipart:
       max-file-size: 100MB

+ 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);
         }