From c8989505df720b4054ffea9090059ec8fb0076fb Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Mon, 12 Jan 2026 17:11:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E5=87=BA=E8=B4=A2=E5=8A=A1=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E5=8D=95=E8=B4=B9=E7=94=A8=E9=A1=B9=E7=9B=AE=E5=88=86?= =?UTF-8?q?=E5=BD=95=E6=96=B0=E5=A2=9E=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/OutContractFinaceConfirmePlugin.java | 16 ++++++- ...ContractSettleFiConfirmWorkFlowPlugin.java | 42 ++++++++++++++----- ...utContractSettleInvalidWorkFlowPlugin.java | 42 ++++++++++++++----- ...tContractSettleReversalWorkFlowPlugin.java | 42 ++++++++++++++----- 4 files changed, 108 insertions(+), 34 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmePlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmePlugin.java index 833e742..b246267 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmePlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmePlugin.java @@ -128,8 +128,22 @@ public class OutContractFinaceConfirmePlugin extends AbstractBillPlugIn impleme expenseItemEntry.set("zcgj_expenseitemrem", dynamicObject.getString("remark"));//费用说明 expenseItemEntry.set("zcgj_cbs", dynamicObject.getDynamicObject("itemcbs"));//工序 } - this.getView().updateView("zcgj_expenseitementry"); + } else { + for (DynamicObject itemEntry : itementry) { + DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊 + for (DynamicObject processAllocEntity : processAllocEntityCollection) { + DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew(); + NewExpenseItemEntry.set("zcgj_cbs", processAllocEntity.get("zcgj_pa_process"));//工序 + NewExpenseItemEntry.set("zcgj_amountsum", processAllocEntity.get("zcgj_pa_amount"));//价税合计 + NewExpenseItemEntry.set("zcgj_expenseitemamt", processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额 + NewExpenseItemEntry.set("zcgj_rateval", processAllocEntity.get("zcgj_rateval"));//税率(%) + NewExpenseItemEntry.set("zcgj_taxamount", processAllocEntity.get("zcgj_taxamt"));//税额 + NewExpenseItemEntry.set("zcgj_expenseitemrem", processAllocEntity.get("zcgj_pa_remark"));//费用说明 + NewExpenseItemEntry.set("zcgj_expenseitem", processAllocEntity.get("zcgj_expenseitem"));//费用项目 + } + } } + this.getView().updateView("zcgj_expenseitementry"); } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleFiConfirmWorkFlowPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleFiConfirmWorkFlowPlugin.java index d2cb6b9..e026e02 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleFiConfirmWorkFlowPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleFiConfirmWorkFlowPlugin.java @@ -2,6 +2,7 @@ package zcgj.zcdev.zcdev.pr.plugin.workflow; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.utils.StringUtils; import kd.bos.entity.operate.result.OperationResult; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; @@ -104,19 +105,38 @@ public class OutContractSettleFiConfirmWorkFlowPlugin implements IWorkflowPlugin outFinaceconfirm.set("zcgj_isprepay", "20");//冲销预付-否 } + DynamicObject contract = outContractSettle.getDynamicObject("contract");//合同名称 + String priceType = contract.getString("zcgj_pricetype");//计价方式 DynamicObjectCollection expenseItemEntryCollection = outFinaceconfirm.getDynamicObjectCollection("zcgj_expenseitementry");//支出财务确认单-费用项目分录 expenseItemEntryCollection.clear(); - for (DynamicObject itemEntry : itementry) { - DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊 - for (DynamicObject processAllocEntity : processAllocEntityCollection) { - DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew(); - NewExpenseItemEntry.set("zcgj_cbs",processAllocEntity.get("zcgj_pa_process"));//工序 - NewExpenseItemEntry.set("zcgj_amountsum",processAllocEntity.get("zcgj_pa_amount"));//价税合计 - NewExpenseItemEntry.set("zcgj_expenseitemamt",processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额 - NewExpenseItemEntry.set("zcgj_rateval",processAllocEntity.get("zcgj_rateval"));//税率(%) - NewExpenseItemEntry.set("zcgj_taxamount",processAllocEntity.get("zcgj_taxamt"));//税额 - NewExpenseItemEntry.set("zcgj_expenseitemrem",processAllocEntity.get("zcgj_pa_remark"));//费用说明 - NewExpenseItemEntry.set("zcgj_expenseitem",processAllocEntity.get("zcgj_expenseitem"));//费用项目 + if (StringUtils.equals(priceType, "gddj")) { + //计价方式为综合单价 + for (DynamicObject itemEntry : itementry) { + DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊 + for (DynamicObject processAllocEntity : processAllocEntityCollection) { + DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew(); + NewExpenseItemEntry.set("zcgj_cbs", processAllocEntity.get("zcgj_pa_process"));//工序 + NewExpenseItemEntry.set("zcgj_amountsum", processAllocEntity.get("zcgj_pa_amount"));//价税合计 + NewExpenseItemEntry.set("zcgj_expenseitemamt", processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额 + NewExpenseItemEntry.set("zcgj_rateval", processAllocEntity.get("zcgj_rateval"));//税率(%) + NewExpenseItemEntry.set("zcgj_taxamount", processAllocEntity.get("zcgj_taxamt"));//税额 + NewExpenseItemEntry.set("zcgj_expenseitemrem", processAllocEntity.get("zcgj_pa_remark"));//费用说明 + NewExpenseItemEntry.set("zcgj_expenseitem", processAllocEntity.get("zcgj_expenseitem"));//费用项目 + } + } + } else { + for (DynamicObject dynamicObject : itementry) { + BigDecimal ofTaxAmount = dynamicObject.getBigDecimal("oftaxamount"); + if (ofTaxAmount.compareTo(BigDecimal.ZERO) == 0) { + continue; + } + DynamicObject expenseItemEntry = expenseItemEntryCollection.addNew(); + expenseItemEntry.set("zcgj_amountsum", ofTaxAmount);//价税合计 + expenseItemEntry.set("zcgj_expenseitemamt", dynamicObject.getBigDecimal("amount"));//费用不含税金额 + expenseItemEntry.set("zcgj_rateval", dynamicObject.getBigDecimal("rate"));//税率(%) + expenseItemEntry.set("zcgj_taxamount", dynamicObject.getBigDecimal("taxamt"));//税额 + expenseItemEntry.set("zcgj_expenseitemrem", dynamicObject.getString("remark"));//费用说明 + expenseItemEntry.set("zcgj_cbs", dynamicObject.getDynamicObject("itemcbs"));//工序 } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleInvalidWorkFlowPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleInvalidWorkFlowPlugin.java index ea27cd1..98be8dd 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleInvalidWorkFlowPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleInvalidWorkFlowPlugin.java @@ -2,6 +2,7 @@ package zcgj.zcdev.zcdev.pr.plugin.workflow; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.utils.StringUtils; import kd.bos.entity.operate.result.OperationResult; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; @@ -100,19 +101,38 @@ public class OutContractSettleInvalidWorkFlowPlugin implements IWorkflowPlugin { outFinaceconfirm.set("zcgj_isprepay", "20");//冲销预付-否 } + DynamicObject contract = outContractSettle.getDynamicObject("contract");//合同名称 + String priceType = contract.getString("zcgj_pricetype");//计价方式 DynamicObjectCollection expenseItemEntryCollection = outFinaceconfirm.getDynamicObjectCollection("zcgj_expenseitementry");//支出财务确认单-费用项目分录 expenseItemEntryCollection.clear(); - for (DynamicObject itemEntry : itementry) { - DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊 - for (DynamicObject processAllocEntity : processAllocEntityCollection) { - DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew(); - NewExpenseItemEntry.set("zcgj_cbs",processAllocEntity.get("zcgj_pa_process"));//工序 - NewExpenseItemEntry.set("zcgj_amountsum",processAllocEntity.get("zcgj_pa_amount"));//价税合计 - NewExpenseItemEntry.set("zcgj_expenseitemamt",processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额 - NewExpenseItemEntry.set("zcgj_rateval",processAllocEntity.get("zcgj_rateval"));//税率(%) - NewExpenseItemEntry.set("zcgj_taxamount",processAllocEntity.get("zcgj_taxamt"));//税额 - NewExpenseItemEntry.set("zcgj_expenseitemrem",processAllocEntity.get("zcgj_pa_remark"));//费用说明 - NewExpenseItemEntry.set("zcgj_expenseitem",processAllocEntity.get("zcgj_expenseitem"));//费用项目 + if (StringUtils.equals(priceType, "gddj")) { + //计价方式为综合单价 + for (DynamicObject itemEntry : itementry) { + DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊 + for (DynamicObject processAllocEntity : processAllocEntityCollection) { + DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew(); + NewExpenseItemEntry.set("zcgj_cbs", processAllocEntity.get("zcgj_pa_process"));//工序 + NewExpenseItemEntry.set("zcgj_amountsum", processAllocEntity.get("zcgj_pa_amount"));//价税合计 + NewExpenseItemEntry.set("zcgj_expenseitemamt", processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额 + NewExpenseItemEntry.set("zcgj_rateval", processAllocEntity.get("zcgj_rateval"));//税率(%) + NewExpenseItemEntry.set("zcgj_taxamount", processAllocEntity.get("zcgj_taxamt"));//税额 + NewExpenseItemEntry.set("zcgj_expenseitemrem", processAllocEntity.get("zcgj_pa_remark"));//费用说明 + NewExpenseItemEntry.set("zcgj_expenseitem", processAllocEntity.get("zcgj_expenseitem"));//费用项目 + } + } + } else { + for (DynamicObject dynamicObject : itementry) { + BigDecimal ofTaxAmount = dynamicObject.getBigDecimal("oftaxamount"); + if (ofTaxAmount.compareTo(BigDecimal.ZERO) == 0) { + continue; + } + DynamicObject expenseItemEntry = expenseItemEntryCollection.addNew(); + expenseItemEntry.set("zcgj_amountsum", ofTaxAmount);//价税合计 + expenseItemEntry.set("zcgj_expenseitemamt", dynamicObject.getBigDecimal("amount"));//费用不含税金额 + expenseItemEntry.set("zcgj_rateval", dynamicObject.getBigDecimal("rate"));//税率(%) + expenseItemEntry.set("zcgj_taxamount", dynamicObject.getBigDecimal("taxamt"));//税额 + expenseItemEntry.set("zcgj_expenseitemrem", dynamicObject.getString("remark"));//费用说明 + expenseItemEntry.set("zcgj_cbs", dynamicObject.getDynamicObject("itemcbs"));//工序 } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleReversalWorkFlowPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleReversalWorkFlowPlugin.java index 6cf755e..420a4f5 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleReversalWorkFlowPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleReversalWorkFlowPlugin.java @@ -2,6 +2,7 @@ package zcgj.zcdev.zcdev.pr.plugin.workflow; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.utils.StringUtils; import kd.bos.entity.operate.result.OperationResult; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; @@ -148,19 +149,38 @@ public class OutContractSettleReversalWorkFlowPlugin implements IWorkflowPlugin outFinaceconfirm.set("zcgj_isprepay", "20");//冲销预付-否 } + DynamicObject contract = outContractSettle.getDynamicObject("contract");//合同名称 + String priceType = contract.getString("zcgj_pricetype");//计价方式 DynamicObjectCollection expenseItemEntryCollection = outFinaceconfirm.getDynamicObjectCollection("zcgj_expenseitementry");//支出财务确认单-费用项目分录 expenseItemEntryCollection.clear(); - for (DynamicObject itemEntry : itementry) { - DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊 - for (DynamicObject processAllocEntity : processAllocEntityCollection) { - DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew(); - NewExpenseItemEntry.set("zcgj_cbs",processAllocEntity.get("zcgj_pa_process"));//工序 - NewExpenseItemEntry.set("zcgj_amountsum",processAllocEntity.get("zcgj_pa_amount"));//价税合计 - NewExpenseItemEntry.set("zcgj_expenseitemamt",processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额 - NewExpenseItemEntry.set("zcgj_rateval",processAllocEntity.get("zcgj_rateval"));//税率(%) - NewExpenseItemEntry.set("zcgj_taxamount",processAllocEntity.get("zcgj_taxamt"));//税额 - NewExpenseItemEntry.set("zcgj_expenseitemrem",processAllocEntity.get("zcgj_pa_remark"));//费用说明 - NewExpenseItemEntry.set("zcgj_expenseitem",processAllocEntity.get("zcgj_expenseitem"));//费用项目 + if (StringUtils.equals(priceType, "gddj")) { + //计价方式为综合单价 + for (DynamicObject itemEntry : itementry) { + DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊 + for (DynamicObject processAllocEntity : processAllocEntityCollection) { + DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew(); + NewExpenseItemEntry.set("zcgj_cbs", processAllocEntity.get("zcgj_pa_process"));//工序 + NewExpenseItemEntry.set("zcgj_amountsum", processAllocEntity.get("zcgj_pa_amount"));//价税合计 + NewExpenseItemEntry.set("zcgj_expenseitemamt", processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额 + NewExpenseItemEntry.set("zcgj_rateval", processAllocEntity.get("zcgj_rateval"));//税率(%) + NewExpenseItemEntry.set("zcgj_taxamount", processAllocEntity.get("zcgj_taxamt"));//税额 + NewExpenseItemEntry.set("zcgj_expenseitemrem", processAllocEntity.get("zcgj_pa_remark"));//费用说明 + NewExpenseItemEntry.set("zcgj_expenseitem", processAllocEntity.get("zcgj_expenseitem"));//费用项目 + } + } + } else { + for (DynamicObject dynamicObject : itementry) { + BigDecimal ofTaxAmount = dynamicObject.getBigDecimal("oftaxamount"); + if (ofTaxAmount.compareTo(BigDecimal.ZERO) == 0) { + continue; + } + DynamicObject expenseItemEntry = expenseItemEntryCollection.addNew(); + expenseItemEntry.set("zcgj_amountsum", ofTaxAmount);//价税合计 + expenseItemEntry.set("zcgj_expenseitemamt", dynamicObject.getBigDecimal("amount"));//费用不含税金额 + expenseItemEntry.set("zcgj_rateval", dynamicObject.getBigDecimal("rate"));//税率(%) + expenseItemEntry.set("zcgj_taxamount", dynamicObject.getBigDecimal("taxamt"));//税额 + expenseItemEntry.set("zcgj_expenseitemrem", dynamicObject.getString("remark"));//费用说明 + expenseItemEntry.set("zcgj_cbs", dynamicObject.getDynamicObject("itemcbs"));//工序 } }