From 887d2f761ce20bbd5db3fd45dd1176447498b5da Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Thu, 3 Jul 2025 19:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=B9=E7=94=A8=E6=89=80=E5=B1=9E=E5=B9=B4?= =?UTF-8?q?=E6=9C=88=20=E6=8E=92=E7=A8=8B=E5=90=88=E5=B9=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0log=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fi/fi/plugin/operate/PaybillOperation.java | 18 +++++++++++++++--- .../operate/SchedulebillMergeOperation.java | 3 ++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillOperation.java b/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillOperation.java index 53f7bc8..bfa9993 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillOperation.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillOperation.java @@ -179,8 +179,13 @@ public class PaybillOperation extends AbstractOperationServicePlugIn implements public static JSONArray buildBody(DynamicObject bill) { bill = BusinessDataServiceHelper.loadSingle(bill.getPkValue(), "cas_paybill"); JSONArray body = new JSONArray(); - // 付款明细 + //付款单-付款明细分录 DynamicObjectCollection Lists = bill.getDynamicObjectCollection("entry"); + //付款单-业务日期 bizdate + Date billbizdate = bill.getDate("bizdate"); + //付款单-费用所属年月 shjh_fyssny + Date fyssnydate = bill.getDate("shjh_fyssny"); + for (DynamicObject obj : Lists) { JSONObject jsonObject = new JSONObject(); Double e_actamt = Double.valueOf(String.valueOf(obj.getBigDecimal("e_actamt"))); // 含税金额_实付金额 @@ -189,9 +194,16 @@ public class PaybillOperation extends AbstractOperationServicePlugIn implements jsonObject.put("FM_ClaimAmt", e_actamt); jsonObject.put("FM_ExcluAmt", excluamt);//未税金额 jsonObject.put("FM_VatAmt", taxamt); - Date entrybizdate = obj.getDate("entrybizdate"); + // 将 Date 对象转换为 LocalDate 对象 - LocalDate localDate = entrybizdate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate localDate; + if(fyssnydate != null){ + //费用所属年月不为空时,推送给费控的年月按此日期来 + localDate = fyssnydate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + }else{ + localDate = billbizdate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + } + // 提取年份 int year = localDate.getYear(); // 提取月份 diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/operate/SchedulebillMergeOperation.java b/main/java/shjh/jhzj7/fi/fi/plugin/operate/SchedulebillMergeOperation.java index 698a94d..61c6bae 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/operate/SchedulebillMergeOperation.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/operate/SchedulebillMergeOperation.java @@ -20,7 +20,6 @@ import kd.sdk.plugin.Plugin; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; /** * 排程单据合并/解除 @@ -112,6 +111,7 @@ public class SchedulebillMergeOperation extends AbstractOperationServicePlugIn i //排程任务池列表界面上增加一键合并按钮,点击后,将来源系统为sap的按照合并规则进行合并 并将合并状态置为true String operationKey = e.getOperationKey(); if ("shjh_pcbillhb".equals(operationKey)) { + log.info("shjh_pcbillhb 排程合并操作开始"); DynamicObject[] dataEntities = e.getDataEntities(); // 提前加载所有 bill 对象 DynamicObject[] loadedBills = loadAllBills(dataEntities); @@ -171,6 +171,7 @@ public class SchedulebillMergeOperation extends AbstractOperationServicePlugIn i } sb.append("单据编号为").append(billno).append("的单据:生成合并单").append(key).append("成功\n "); } + log.info(sb.toString());//将最终结果log输出 OperateErrorInfo operateErrorInfo = new OperateErrorInfo(); operateErrorInfo.setMessage(sb.toString()); operateErrorInfo.setErrorLevel(ErrorLevel.Error.name());