From 91f82c191dcbbf4ce0acfb1013b2bf4fd874c3cc Mon Sep 17 00:00:00 2001 From: zoujiangtao Date: Tue, 10 Dec 2024 10:26:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=86=85=E5=AE=B9=EF=BC=9AAP?= =?UTF-8?q?I=E6=98=A0=E5=B0=84=E5=85=AC=E5=85=B1=E5=8D=95=E6=8D=AE=20?= =?UTF-8?q?=E5=A4=87=E6=B3=A8=EF=BC=9A=E5=85=B3=E4=BA=8E=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9=20=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BA=BA=EF=BC=9A=E9=82=B9=E6=B1=9F=E6=B6=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/plugin/form/ApiMappingBillPlugin.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java index 732c5bc..d76e623 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java @@ -191,7 +191,7 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin { } in.close(); // 替换 \n 为实际的换行符 - formattedContent = content.toString().replace("\\n", "\n").replace("\\",""); + formattedContent = content.toString().replace("\\n", "\n").replace("\\", ""); } else { formattedContent = "响应失败"; } @@ -360,6 +360,12 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin { } else { value = "2";//收入 } + } else if ("bizdate".equals(parts[0])) { + Date bizdate = billObject.getDate("bizdate"); + // 创建一个SimpleDateFormat对象,指定格式为"yyyy-MM-dd" + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + // 格式化Date对象为字符串 + value = sdf.format(bizdate); } else { value = billObject.get(parts[0]); } @@ -399,14 +405,8 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin { String tartype = dynamicObject.getString("shkd_tartype"); - if ("String".equals(tartype)) { + if ("String".equals(tartype) || "Date".equals(tartype)) { jsonObject.put(key, value); - } else if ("Date".equals(tartype)) { - // 创建一个Date对象 - Date date = new Date((Long) value); - // 创建一个SimpleDateFormat对象,指定格式为"yyyy-MM-dd" - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - jsonObject.put(key, sdf.format(date)); } else if ("Integer".equals(tartype)) { jsonObject.put(key, Integer.parseInt(value.toString())); } else if ("BigDecimal".equals(tartype)) {