From 4ccfc07215e56bfc3a5418530f60273926db2329 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Tue, 13 May 2025 17:25:59 +0800 Subject: [PATCH] =?UTF-8?q?-=20[x]=20=E5=A4=84=E7=90=86=E4=BB=98=E6=AC=BE?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=8E=A8=E9=80=81=E4=BB=98=E6=AC=BE=E5=8D=95?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=A4=B1=E6=95=88=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98(status=E6=A0=87=E8=AF=86=E6=94=B9?= =?UTF-8?q?=E4=B8=BAbillstatus;pay(push)=E6=93=8D=E4=BD=9C=E4=B8=BA?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=93=8D=E4=BD=9C,=E9=9C=80=E8=AF=A5?= =?UTF-8?q?=E6=96=B0=E5=A2=9Epushandsave)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - [ ] 认领单已提交审核,【关联预付款单】 按钮应该不能点击了 - [x] 付款申请,付款单,排程单新增字段:转账附言,转换规则中,进行携带 付款申请-->付款处理(转换规则__670682874575363072) 付款处理-->付款排程单(转换规则__915697385282231296) - [x] 优化付款单点击业务大类报错 - [x] 优化付款排程下推付款报错 - [x] 优化核算维度推送SAP取数逻辑(客户,供应商) - [x] 优化关联预付款单(认领单按钮),携带供应商,当前日期-1年 s --- .../fi/plugin/form/FeeControlApiPlugin.java | 10 +++ .../plugin/operate/PayBillSaveOperation.java | 2 +- .../operate/PaybillPushSapOperation.java | 75 +++++++++++-------- 3 files changed, 56 insertions(+), 31 deletions(-) diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/form/FeeControlApiPlugin.java b/main/java/shjh/jhzj7/fi/fi/plugin/form/FeeControlApiPlugin.java index f873f4a..503dbb5 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/form/FeeControlApiPlugin.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/form/FeeControlApiPlugin.java @@ -78,6 +78,16 @@ public class FeeControlApiPlugin extends AbstractFormPlugin implements Plugin { //【关联员工借款单】按钮进来,隐藏【供应商】 this.getView().setVisible(false, "shjh_supplier"); } + // 设置为三个月前 + Date date = new Date(); + date.setMonth(date.getMonth() - 12); + this.getView().getModel().setValue("shjh_startdate",date); + this.getView().updateView("shjh_startdate"); + String paymenttype = ""+this.getView().getParentView().getModel().getValue("paymenttype"); + if ("bd_supplier".equals(paymenttype)) { + this.getView().getModel().setValue("shjh_supplier",this.getView().getParentView().getModel().getValue("recbasepayer")); + } + this.getView().updateView("shjh_supplier"); } /** diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/operate/PayBillSaveOperation.java b/main/java/shjh/jhzj7/fi/fi/plugin/operate/PayBillSaveOperation.java index e8b078d..4af7849 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/operate/PayBillSaveOperation.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/operate/PayBillSaveOperation.java @@ -47,8 +47,8 @@ public class PayBillSaveOperation extends AbstractOperationServicePlugIn impleme } } - SaveServiceHelper.save(new DynamicObject[]{bill}); } + SaveServiceHelper.update(dataEntities); } } diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillPushSapOperation.java b/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillPushSapOperation.java index 612e0c9..a7a315e 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillPushSapOperation.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillPushSapOperation.java @@ -14,6 +14,7 @@ import kd.bos.entity.validate.ErrorLevel; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.QueryServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.sdk.plugin.Plugin; import shjh.jhzj7.fi.fi.utils.ApiUtils; @@ -216,7 +217,7 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl QFilter q1 = new QFilter("sourcebill", QCP.equals, bill.getPkValue()); QFilter q2 = new QFilter("billstatus",QCP.equals,"C"); DynamicObject gl_voucher = BusinessDataServiceHelper.loadSingle("gl_voucher", - "id,description,sourcebill,entries,entries.account,entries.debitlocal,entries.creditlocal,entries.entrydc,vouchertype", + "id,description,sourcebill,entries,entries.account,entries.debitlocal,entries.creditlocal,entries.entrydc,vouchertype,entries.assgrp", new QFilter[]{q1, q2}); if (null != gl_voucher) { //todo:对header 凭证类型重新赋值 @@ -226,37 +227,14 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl } DynamicObjectCollection entries = gl_voucher.getDynamicObjectCollection("entries"); if (!entries.isEmpty()) { + DynamicObject assgrpinfo; + String asstype; + DynamicObject glassistbd; + DynamicObject hsxminfo; for (DynamicObject entry : entries) { JSONObject IT_ITEMS = new JSONObject(); DynamicObject account = entry.getDynamicObject("account");//科目 if (null != account) { - //查找核算维度 - DynamicObjectCollection checkItems = account.getDynamicObjectCollection("checkitementry"); - if (checkItems!=null && checkItems.size()!=0){ - //是否已经反写 - boolean isMark=false; - for (DynamicObject checkItem : checkItems) { - //核算维度 - String assTactItemName = checkItem.getString("asstactitem.name"); - if (assTactItemName!=null){ - switch (assTactItemName){ - case "客户-获利段": - case "客户编码": - IT_ITEMS.put("KUNNR", customerOrsupnum);// 供应商编号_收款人id(付款单payee) - isMark=true; - break; - case "供应商": - IT_ITEMS.put("LIFNR", customerOrsupnum);// 客户编号_收款人id(付款单payee) - isMark=true; - break; - } - } - if (isMark){ - break; - } - } - } - //isbank boolean isbank = account.getBoolean("isbank"); if ("A".equals(shjhSourcesystem) &&!isbank) { continue;//非银行科目 @@ -269,6 +247,43 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl IT_ITEMS.put("SGTXT", SGTXT);//行项目文本_SAP会计科目行项目号(付款明细shjh_voucherentrynum) IT_ITEMS.put("KOSTL", KOSTL);//成本中心_成本中心(付款单shjh_costcenter) IT_ITEMS.put("PRCTR", PRCTR);//利润中心_利润中心(付款单shjh_pc) + assgrpinfo = entry.getDynamicObject("assgrp");//核算维度(弹性域) + if(assgrpinfo != null){ + DynamicObjectCollection gl_assist_bd = QueryServiceHelper.query("gl_assist_bd", "asstype,assval", + new QFilter[]{new QFilter("hg.id", QCP.equals, assgrpinfo.getPkValue())}); + + for (int j = 0; j < gl_assist_bd.size(); j++) { + glassistbd = gl_assist_bd.get(j); + asstype = glassistbd.getString("asstype");//核算项目类型-对应核算维度的字段名 + if("f000057".equals(asstype) || "f0001".equals(asstype)){ + //t_bas_flex_property 表中获取对应编号 客户-获利段 f0001 客户编码 f000057 + hsxminfo = QueryServiceHelper.queryOne("bd_customer", "id,name,number", + new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值 + IT_ITEMS.put("KUNNR",hsxminfo.getString("number"));//客户 + }else if("f000005".equals(asstype)){ + //供应商 f000005 + hsxminfo = QueryServiceHelper.queryOne("bd_supplier", "id,name,number", + new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值 + IT_ITEMS.put("LIFNR",hsxminfo.getString("number"));//供应商 + } + else if("f000012".equals(asstype)){ + //利润中心 f000012 + hsxminfo = QueryServiceHelper.queryOne("shjh_pc", "id,name,number", + new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值 + IT_ITEMS.put("PRCTR",hsxminfo.getString("number"));//利润中心_利润中心 + }else if("f000011".equals(asstype)){ + //成本中心 f000011 + hsxminfo = QueryServiceHelper.queryOne("bos_costcenter", "id,name,number", + new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值 + IT_ITEMS.put("KOSTL",hsxminfo.getString("number"));//成本中心_成本中心 + }else if("f000054".equals(asstype)){ + //原因码 f000054 + IT_ITEMS.put("RSTGR",glassistbd.getString("assval"));//成本中心_成本中心 + } + + } + } + // 获取借方金额 BigDecimal debitlocal = (BigDecimal) entry.get("debitlocal");//借方 // 获取贷方金额 @@ -315,10 +330,10 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl jsonObject.put("BUZEI", entry.getString("shjh_voucherentrynum"));//行编号 switch (payeetype) { case "bd_customer": - jsonObject.put("KUNNR", customerOrsupnum); // 供应商编号_收款人id(付款单payee) + jsonObject.put("KUNNR", customerOrsupnum); // 客户编号_收款人id(付款单payee) break; case "bd_supplier": - jsonObject.put("LIFNR", customerOrsupnum); // 客户编号_收款人id(付款单payee) + jsonObject.put("LIFNR", customerOrsupnum); // 供应商编号_收款人id(付款单payee) break; } String HKONT = "";