From 4bb5f6f8ecdf8314fd14abafd9c7c36041a15683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwyx12345678=E2=80=9D?= <2816059288@qq.com> Date: Thu, 27 Jun 2024 16:22:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=94=B6=E6=AC=BE=EF=BC=9B?= =?UTF-8?q?=E8=B4=B9=E7=94=A8=E6=94=AF=E4=BB=98=E5=85=AC=E5=8F=B8=E5=B8=A6?= =?UTF-8?q?=E5=8A=A8=E8=B4=B9=E7=94=A8=E6=89=BF=E6=8B=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kd/fi/er/botp/ConvertBillPlugln.java | 105 ++++++++++++++++++ .../CommonCostCenterBillFormPlugin.java | 8 +- .../formplugin/CommonCostCompanyPlugin.java | 43 +++++++ .../formplugin/GenerateSKClickPlugln.java | 51 +++++++++ 4 files changed, 203 insertions(+), 4 deletions(-) create mode 100644 shkd-cosmic-debug/src/main/java/kd/fi/er/botp/ConvertBillPlugln.java create mode 100644 shkd-cosmic-debug/src/main/java/shkd/fi/er/plugin/formplugin/CommonCostCompanyPlugin.java create mode 100644 shkd-cosmic-debug/src/main/java/shkd/fi/er/plugin/formplugin/GenerateSKClickPlugln.java diff --git a/shkd-cosmic-debug/src/main/java/kd/fi/er/botp/ConvertBillPlugln.java b/shkd-cosmic-debug/src/main/java/kd/fi/er/botp/ConvertBillPlugln.java new file mode 100644 index 0000000..6573572 --- /dev/null +++ b/shkd-cosmic-debug/src/main/java/kd/fi/er/botp/ConvertBillPlugln.java @@ -0,0 +1,105 @@ +package kd.fi.er.botp; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.ExtendedDataEntity; +import kd.bos.entity.ExtendedDataEntitySet; +import kd.bos.entity.botp.plugin.AbstractConvertPlugIn; +import kd.bos.entity.botp.plugin.args.AfterConvertEventArgs; +import kd.bos.entity.botp.runtime.ConvertConst; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.scm.pds.common.util.TemplateUtil; +import kd.sdk.plugin.Plugin; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 单据转换插件 + */ +public class ConvertBillPlugln extends AbstractConvertPlugIn implements Plugin { + @Override + public void afterConvert(AfterConvertEventArgs e) { + super.afterConvert(e); + //采购合同 + ExtendedDataEntitySet targetExtDataEntitySet = e.getTargetExtDataEntitySet(); + ExtendedDataEntity[] entities = targetExtDataEntitySet.FindByEntityKey(getTgtMainType().getName()); + for (ExtendedDataEntity entity : entities) { + List srcRows = (List) entity.getValue(ConvertConst.ConvExtDataKey_SourceRows); + DynamicObject srcRow = srcRows.get(0); + Object sourceBillPK = e.getFldProperties().get("id").getValue(srcRow); + ////付款处理单据 + DynamicObject contract = entity.getDataEntity(); + //对公报销 + DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(sourceBillPK, getSrcMainType().getName()); + DynamicObjectCollection accountentry = dynamicObject.getDynamicObjectCollection("accountentry"); + BigDecimal orireceiveamount = accountentry.get(0).getBigDecimal("orireceiveamount"); //实付金额 + + DynamicObjectCollection writeoffmoney = dynamicObject.getDynamicObjectCollection("writeoffmoney"); //预付 + DynamicObjectCollection expenseentryentity = dynamicObject.getDynamicObjectCollection("expenseentryentity"); //预付 + + BigDecimal yuf = BigDecimal.ZERO; //预付金额 + for(int i=0;i