From d1aa5e8c5b96fe16dc7a6cd6ce42a047128c483d Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Tue, 17 Dec 2024 09:34:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=B8=85=E5=8D=95=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java index c43cd54..cda65de 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java @@ -54,9 +54,10 @@ public class ResourceFilterExtPlugin extends ResourceItemListPlugin { Map customParams = formShowParameter.getCustomParams(); Object contractType = customParams.get("contractType"); String firstOpen = this.getPageCache().get("firstOpen"); - if (firstOpen == null) { - this.getPageCache().put("firstOpen", "false"); + if (firstOpen != null) { +// this.getPageCache().put("firstOpen", "false"); // contractType = "ck"; +// this.getPageCache().remove("firstOpen"); if (contractType != null) { if (contractType.toString().equals("wzcg")) {//物资采购 this.getView().setVisible(true, new String[]{"flexpanelmaterial"}); From 5af47982cdb22275a4dd8e1c2ce905c7b82c7a37 Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Tue, 17 Dec 2024 11:14:09 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InContractSettlementValidator.java | 35 ++++++++----------- .../OutContractSettlementValidator.java | 11 ++---- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/InContractSettlementValidator.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/InContractSettlementValidator.java index 051c05f..3420bdb 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/InContractSettlementValidator.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/InContractSettlementValidator.java @@ -19,32 +19,27 @@ public class InContractSettlementValidator extends InContractSettleValidator { ExtendedDataEntity[] var2 = dataEntities; int var3 = dataEntities.length; - for(int var4 = 0; var4 < var3; ++var4) { + for (int var4 = 0; var4 < var3; ++var4) { ExtendedDataEntity dataEntity = var2[var4]; BigDecimal settleOfTaxAmount = dataEntity.getDataEntity().getBigDecimal("settleoftaxamount"); DynamicObject contractTemp = dataEntity.getDataEntity().getDynamicObject("contract"); if (contractTemp == null) { return; } - long id = dataEntity.getDataEntity().getLong("id"); - QFilter f1 = new QFilter("id", "=", id); - DynamicObject incontractsettle = BusinessDataServiceHelper.loadSingle("ec_in_contract_settle", new QFilter[]{f1}); - if(incontractsettle!=null){ - DynamicObjectCollection itementry = incontractsettle.getDynamicObjectCollection("itementry"); - if(itementry == null) { - if(itementry.isEmpty()) { - this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0])); - } - DynamicObject contract = BusinessDataServiceHelper.loadSingle(dataEntity.getDataEntity().getDynamicObject("contract").getPkValue(), "ec_in_contract"); - BigDecimal totalSettleOfTaxAmount = contract.getBigDecimal("totalsettleoftaxamount"); - BigDecimal totalOfTaxAmount = contract.getBigDecimal("totaloftaxamount"); - DynamicObject contractType = contract.getDynamicObject("contracttype"); - DynamicObject contractAttr = contractType == null ? null : contractType.getDynamicObject("contattr"); - boolean validateAmount = true; - if (contractAttr != null) { - contractAttr = BusinessDataServiceHelper.loadSingle(contractAttr.getPkValue(), "ec_contattr"); - validateAmount = !StringUtils.equals("09", contractAttr.getString("basictype")); - } + DynamicObjectCollection itementry = dataEntity.getDataEntity().getDynamicObjectCollection("itementry"); + if (itementry != null) { + if (itementry.size() == 0) { + this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0])); + } + DynamicObject contract = BusinessDataServiceHelper.loadSingle(dataEntity.getDataEntity().getDynamicObject("contract").getPkValue(), "ec_in_contract"); + BigDecimal totalSettleOfTaxAmount = contract.getBigDecimal("totalsettleoftaxamount"); + BigDecimal totalOfTaxAmount = contract.getBigDecimal("totaloftaxamount"); + DynamicObject contractType = contract.getDynamicObject("contracttype"); + DynamicObject contractAttr = contractType == null ? null : contractType.getDynamicObject("contattr"); + boolean validateAmount = true; + if (contractAttr != null) { + contractAttr = BusinessDataServiceHelper.loadSingle(contractAttr.getPkValue(), "ec_contattr"); + validateAmount = !StringUtils.equals("09", contractAttr.getString("basictype")); } } // DynamicObjectCollection payitemdetailap = incontractsettle.getDynamicObjectCollection("payitemdetailap"); diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettlementValidator.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettlementValidator.java index cfa3005..b83a873 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettlementValidator.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettlementValidator.java @@ -17,12 +17,8 @@ public class OutContractSettlementValidator extends OutContractSettleValidator { { BigDecimal settleOfTaxAmount = dataEntity.getDataEntity().getBigDecimal("settleoftaxamount"); DynamicObject contractTemp = dataEntity.getDataEntity().getDynamicObject("contract"); - long id = dataEntity.getDataEntity().getLong("id"); - QFilter f1 = new QFilter("id", "=", id); - DynamicObject incontractsettle = BusinessDataServiceHelper.loadSingle("ec_in_contract_settle", new QFilter[]{f1}); - if(incontractsettle!=null){ - DynamicObjectCollection itementry = incontractsettle.getDynamicObjectCollection("itementry"); -// DynamicObjectCollection payitemdetailap = incontractsettle.getDynamicObjectCollection("payitemdetailap"); + + DynamicObjectCollection itementry = dataEntity.getDataEntity().getDynamicObjectCollection("itementry"); if(itementry.isEmpty()) { this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0])); } @@ -48,9 +44,6 @@ public class OutContractSettlementValidator extends OutContractSettleValidator { return true; } } - } - } - return true; } } From 050dcde6c8c9d80a26980cacbd1c92525ba6056a Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Tue, 17 Dec 2024 14:33:58 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java index cda65de..51fb31c 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java @@ -28,7 +28,7 @@ public class ResourceFilterExtPlugin extends ResourceItemListPlugin { // contractType="ck"; if (contractType != null) { - if (contractType.toString().equals("wzcg")) {//物资采购 + if (contractType.toString().equals("wzcg01")) {//物资采购 this.setResourceTypeStyle("material"); this.afterSelectedTag("material"); } else if (contractType.toString().equals("sbcg")) {//设备采购 @@ -59,7 +59,7 @@ public class ResourceFilterExtPlugin extends ResourceItemListPlugin { // contractType = "ck"; // this.getPageCache().remove("firstOpen"); if (contractType != null) { - if (contractType.toString().equals("wzcg")) {//物资采购 + if (contractType.toString().equals("wzcg01")) {//物资采购 this.getView().setVisible(true, new String[]{"flexpanelmaterial"}); this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelequipment", "flexpanelturnover","flexpanelother"}); } else if (contractType.toString().equals("sbcg")) {//设备采购 From 0612c52985297cef49cd5e584c2d267217c13a40 Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Tue, 17 Dec 2024 17:12:21 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ContractEeasurementBillPlugin.java | 96 ++++++++-------- .../plugin/form/ContractSettleBillPlugin.java | 104 +++++++++--------- .../plugin/form/ResourceFilterExtPlugin.java | 3 +- 3 files changed, 102 insertions(+), 101 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java index cd3ba53..405798a 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java @@ -77,9 +77,9 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin } } - @Override - public void propertyChanged(PropertyChangedArgs e) { - super.propertyChanged(e); +// @Override +// public void propertyChanged(PropertyChangedArgs e) { +// super.propertyChanged(e); // String name = e.getProperty().getName(); // ChangeData changeData = e.getChangeSet()[0]; // int rowIndex = changeData.getRowIndex(); @@ -88,49 +88,49 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin // BigDecimal currentprice = BigDecimal.ZERO;//当前单价 // BigDecimal qty = BigDecimal.ZERO;//数量 // BigDecimal taxrate = BigDecimal.ZERO;//税率 -// if(name.equals("curtaxprice")||name.equals("currentprice")) { -// if (parentRowIndex>=0&&rowIndex>=0){ -// Object curtaxpriceobj = this.getModel().getValue("curtaxprice", rowIndex, parentRowIndex); -// if (curtaxpriceobj != null) { -// curtaxprice = (BigDecimal) curtaxpriceobj; -// } -// Object currentpriceobj = this.getModel().getValue("currentprice", rowIndex, parentRowIndex); -// if (currentpriceobj != null) { -// currentprice = (BigDecimal) currentpriceobj; -// ; -// } -// Object totalqtyibj = this.getModel().getValue("totalqty", rowIndex, parentRowIndex); -// if (totalqtyibj != null) { -// qty = (BigDecimal) totalqtyibj; -// } -// Object entrytaxrateobj = this.getModel().getValue("entrytaxrate", rowIndex, parentRowIndex); -// if (entrytaxrateobj != null) { -// BigDecimal entrytaxrate = (BigDecimal) entrytaxrateobj; -// taxrate = entrytaxrate.divide(new BigDecimal(100)).add(new BigDecimal(1)); -// } -// if (name.equals("curtaxprice") && curtaxprice.compareTo(new BigDecimal(0))>0) { -// BigDecimal divide = curtaxprice.divide(taxrate,6, RoundingMode.HALF_UP);//当前单价 -// BigDecimal multiply = divide.multiply(qty);//当前金额 -// BigDecimal multiply1 = curtaxprice.multiply(qty);//当前价税合计 -// BigDecimal subtract = multiply1.subtract(multiply);//当前税额 -//// this.getModel().getDataEntity().set("currentprice",divide, rowIndex, parentRowIndex); -// this.getModel().setValue("currentprice",divide, rowIndex, parentRowIndex);//当前单价 -// this.getModel().setValue("currentamt", multiply,rowIndex, parentRowIndex);//当前金额 -// this.getModel().setValue("currenttaxamt", subtract,rowIndex, parentRowIndex);//当前税额 -// this.getModel().setValue("currentoftax", multiply1,rowIndex, parentRowIndex);//当前价税合计 -// } else if (name.equals("currentprice")&¤tprice.compareTo(new BigDecimal(0))>0) { -// BigDecimal divide = currentprice.multiply(taxrate);//当前含税单价 -// BigDecimal multiply = currentprice.multiply(qty);//当前金额 -// BigDecimal multiply1 = divide.multiply(qty);//当前价税合计 -// BigDecimal subtract = multiply1.subtract(multiply);//当前税额 -// this.getModel().setValue("curtaxprice",divide, rowIndex, parentRowIndex);//当前含税单价 -// this.getModel().setValue("currentamt", multiply,rowIndex, parentRowIndex);//当前金额 -// this.getModel().setValue("currenttaxamt",multiply1, rowIndex, parentRowIndex);//当前税额 -// this.getModel().setValue("currentoftax",subtract, rowIndex, parentRowIndex);//当前价税合计 -// } -// this.getView().updateView(); -// } -// -// } - } +//// if(name.equals("curtaxprice")||name.equals("currentprice")) { +//// if (parentRowIndex>=0&&rowIndex>=0){ +//// Object curtaxpriceobj = this.getModel().getValue("curtaxprice", rowIndex, parentRowIndex); +//// if (curtaxpriceobj != null) { +//// curtaxprice = (BigDecimal) curtaxpriceobj; +//// } +//// Object currentpriceobj = this.getModel().getValue("currentprice", rowIndex, parentRowIndex); +//// if (currentpriceobj != null) { +//// currentprice = (BigDecimal) currentpriceobj; +//// ; +//// } +//// Object totalqtyibj = this.getModel().getValue("totalqty", rowIndex, parentRowIndex); +//// if (totalqtyibj != null) { +//// qty = (BigDecimal) totalqtyibj; +//// } +//// Object entrytaxrateobj = this.getModel().getValue("entrytaxrate", rowIndex, parentRowIndex); +//// if (entrytaxrateobj != null) { +//// BigDecimal entrytaxrate = (BigDecimal) entrytaxrateobj; +//// taxrate = entrytaxrate.divide(new BigDecimal(100)).add(new BigDecimal(1)); +//// } +//// if (name.equals("curtaxprice") && curtaxprice.compareTo(new BigDecimal(0))>0) { +//// BigDecimal divide = curtaxprice.divide(taxrate,6, RoundingMode.HALF_UP);//当前单价 +//// BigDecimal multiply = divide.multiply(qty);//当前金额 +//// BigDecimal multiply1 = curtaxprice.multiply(qty);//当前价税合计 +//// BigDecimal subtract = multiply1.subtract(multiply);//当前税额 +////// this.getModel().getDataEntity().set("currentprice",divide, rowIndex, parentRowIndex); +//// this.getModel().setValue("currentprice",divide, rowIndex, parentRowIndex);//当前单价 +//// this.getModel().setValue("currentamt", multiply,rowIndex, parentRowIndex);//当前金额 +//// this.getModel().setValue("currenttaxamt", subtract,rowIndex, parentRowIndex);//当前税额 +//// this.getModel().setValue("currentoftax", multiply1,rowIndex, parentRowIndex);//当前价税合计 +//// } else if (name.equals("currentprice")&¤tprice.compareTo(new BigDecimal(0))>0) { +//// BigDecimal divide = currentprice.multiply(taxrate);//当前含税单价 +//// BigDecimal multiply = currentprice.multiply(qty);//当前金额 +//// BigDecimal multiply1 = divide.multiply(qty);//当前价税合计 +//// BigDecimal subtract = multiply1.subtract(multiply);//当前税额 +//// this.getModel().setValue("curtaxprice",divide, rowIndex, parentRowIndex);//当前含税单价 +//// this.getModel().setValue("currentamt", multiply,rowIndex, parentRowIndex);//当前金额 +//// this.getModel().setValue("currenttaxamt",multiply1, rowIndex, parentRowIndex);//当前税额 +//// this.getModel().setValue("currentoftax",subtract, rowIndex, parentRowIndex);//当前价税合计 +//// } +//// this.getView().updateView(); +//// } +//// +//// } +// } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractSettleBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractSettleBillPlugin.java index 80ba2a2..1c5c903 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractSettleBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractSettleBillPlugin.java @@ -26,16 +26,16 @@ public class ContractSettleBillPlugin extends AbstractBillPlugIn implements Plug @Override public void afterCreateNewData(EventObject e) { super.afterCreateNewData(e); - Object changetype = this.getModel().getValue("changetype"); - if(changetype!=null){ - if(changetype.toString().equals("03")){ - this.getView().setVisible(true,"zcgj_partb"); - this.getView().setVisible(true,"zcgj_otherpart"); - }else { - this.getView().setVisible(false,"zcgj_partb"); - this.getView().setVisible(false,"zcgj_otherpart"); - } - } +// Object changetype = this.getModel().getValue("changetype"); +// if(changetype!=null){ +// if(changetype.toString().equals("03")){ +// this.getView().setVisible(true,"zcgj_partb"); +// this.getView().setVisible(true,"zcgj_otherpart"); +// }else { +// this.getView().setVisible(false,"zcgj_partb"); +// this.getView().setVisible(false,"zcgj_otherpart"); +// } +// } } @Override @@ -44,7 +44,7 @@ public class ContractSettleBillPlugin extends AbstractBillPlugIn implements Plug // 注册按钮点击事件 // this.addClickListeners("bar_audit"); // this.addItemClickListeners("bar_audit"); -// Button button = this.getView().getControl("bar_audit"); +// Button button = this.getView().getControl("bar_save"); // button.addClickListener(this); } @@ -67,35 +67,35 @@ public class ContractSettleBillPlugin extends AbstractBillPlugIn implements Plug String key = source.getKey(); if (StringUtils.equals("bar_audit", key)) { // 在此添加业务逻辑 - Object changetype = this.getModel().getValue("changetype"); - if (changetype != null) { - if (changetype.toString().equals("03")) { - Object contract = this.getModel().getValue("contract"); - DynamicObject contractInfo = (DynamicObject) contract; - String billName = contractInfo.getDataEntityType().getName(); - DynamicObject zcgjpartb = (DynamicObject)this.getModel().getValue("zcgj_partb"); - Object zcgjOtherpart = this.getModel().getValue("zcgj_otherpart"); - if (billName.equals("ec_out_contract_f7")) { - QFilter f1 = new QFilter("number", "=", contractInfo.getString("number")); - DynamicObject outContractF7 = BusinessDataServiceHelper.loadSingle("ec_out_contract_f7", new QFilter[]{f1}); - outContractF7.set("partb",zcgjpartb); - OperationResult saveOperationResult = SaveServiceHelper.saveOperate("ec_out_contract_f7", new DynamicObject[]{outContractF7}, null);//支出合同F7实体 - - QFilter f2 = new QFilter("billno", "=", contractInfo.getString("number")); - DynamicObject outContract = BusinessDataServiceHelper.loadSingle("ec_out_contract", new QFilter[]{f2}); - outContract.set("partb",zcgjpartb); - if(zcgjOtherpart!=null){ - DynamicObjectCollection otherpart = (DynamicObjectCollection) this.getModel().getValue("zcgj_otherpart"); - outContract.set("otherpart",otherpart); - outContract.set("ismulticontract",true); - } - OperationResult saveOperationResult1 = SaveServiceHelper.saveOperate("ec_out_contract", new DynamicObject[]{outContractF7}, null);//支出合同实体 - System.out.println(saveOperationResult1); - }else{ - - } - } - } +// Object changetype = this.getModel().getValue("changetype"); +// if (changetype != null) { +// if (changetype.toString().equals("03")) { +// Object contract = this.getModel().getValue("contract"); +// DynamicObject contractInfo = (DynamicObject) contract; +// String billName = contractInfo.getDataEntityType().getName(); +// DynamicObject zcgjpartb = (DynamicObject)this.getModel().getValue("zcgj_partb"); +// Object zcgjOtherpart = this.getModel().getValue("zcgj_otherpart"); +// if (billName.equals("ec_out_contract_f7")) { +// QFilter f1 = new QFilter("number", "=", contractInfo.getString("number")); +// DynamicObject outContractF7 = BusinessDataServiceHelper.loadSingle("ec_out_contract_f7", new QFilter[]{f1}); +// outContractF7.set("partb",zcgjpartb); +// OperationResult saveOperationResult = SaveServiceHelper.saveOperate("ec_out_contract_f7", new DynamicObject[]{outContractF7}, null);//支出合同F7实体 +// +// QFilter f2 = new QFilter("billno", "=", contractInfo.getString("number")); +// DynamicObject outContract = BusinessDataServiceHelper.loadSingle("ec_out_contract", new QFilter[]{f2}); +// outContract.set("partb",zcgjpartb); +// if(zcgjOtherpart!=null){ +// DynamicObjectCollection otherpart = (DynamicObjectCollection) this.getModel().getValue("zcgj_otherpart"); +// outContract.set("otherpart",otherpart); +// outContract.set("ismulticontract",true); +// } +// OperationResult saveOperationResult1 = SaveServiceHelper.saveOperate("ec_out_contract", new DynamicObject[]{outContractF7}, null);//支出合同实体 +// System.out.println(saveOperationResult1); +// }else{ +// +// } +// } +// } evt.setCancel(true); // 取消后续处理,将不会再触发click事件 } } @@ -104,17 +104,17 @@ public class ContractSettleBillPlugin extends AbstractBillPlugIn implements Plug public void propertyChanged(PropertyChangedArgs e) { super.propertyChanged(e); String name = e.getProperty().getName(); - if(name.equals("changetype")){ - Object changetype = this.getModel().getValue("changetype"); - if(changetype!=null){ - if(changetype.toString().equals("03")){ - this.getView().setVisible(true,"zcgj_partb"); - this.getView().setVisible(true,"zcgj_otherpart"); - }else { - this.getView().setVisible(false,"zcgj_partb"); - this.getView().setVisible(false,"zcgj_otherpart"); - } - } - } +// if(name.equals("changetype")){ +// Object changetype = this.getModel().getValue("changetype"); +// if(changetype!=null){ +// if(changetype.toString().equals("03")){ +// this.getView().setVisible(true,"zcgj_partb"); +// this.getView().setVisible(true,"zcgj_otherpart"); +// }else { +// this.getView().setVisible(false,"zcgj_partb"); +// this.getView().setVisible(false,"zcgj_otherpart"); +// } +// } +// } } } \ No newline at end of file diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java index 51fb31c..6de9cf0 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java @@ -65,7 +65,8 @@ public class ResourceFilterExtPlugin extends ResourceItemListPlugin { } else if (contractType.toString().equals("sbcg")) {//设备采购 this.getView().setVisible(true, new String[]{"flexpanelequipment"}); this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelmaterial", "flexpanelturnover","flexpanelother"}); - }else if (contractType.toString().equals("qtcc") || contractType.toString().equals("lwlcc")) {//产出物 + }else if (contractType.toString().equals("qtcc") || contractType.toString().equals("lwlcc")|| contractType.toString().equals("ck")|| + contractType.toString().equals("zyfbcc")|| contractType.toString().equals("jjbc")) {//产出物 this.getView().setVisible(true, new String[]{"flexpanelturnover"}); this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelequipment", "flexpanelmaterial","flexpanelother"}); } From 5fe89369d620176daa8f5997dc594ca601ea2836 Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Tue, 17 Dec 2024 18:03:25 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20=20?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ContractEeasurementBillPlugin.java | 75 +++++++++++++------ .../plugin/form/ResourceFilterExtPlugin.java | 3 +- 2 files changed, 53 insertions(+), 25 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java index 405798a..95a0397 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java @@ -8,6 +8,7 @@ import kd.bos.form.CloseCallBack; import kd.bos.form.ShowFormHelper; import kd.bos.list.ListShowParameter; import kd.bos.orm.query.QFilter; +import kd.ec.contract.common.enums.PriceAdjustModeEnum; import kd.ec.contract.formplugin.ContractMeasureBillEditPlugin; import java.math.BigDecimal; @@ -22,25 +23,25 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin @Override protected void onThisQtyChanged(ChangeData changeData) { - BigDecimal qty = this.defaultZeroBigDecimal((BigDecimal)changeData.getNewValue()); + BigDecimal qty = this.defaultZeroBigDecimal((BigDecimal) changeData.getNewValue()); int rowIndex = changeData.getRowIndex(); int parentRowIndex = changeData.getParentRowIndex(); - BigDecimal totalqty = (BigDecimal)this.getModel().getValue("totalqty", rowIndex, parentRowIndex); - BigDecimal preQty = (BigDecimal)this.getModel().getValue("preqty", rowIndex, parentRowIndex); + BigDecimal totalqty = (BigDecimal) this.getModel().getValue("totalqty", rowIndex, parentRowIndex); + BigDecimal preQty = (BigDecimal) this.getModel().getValue("preqty", rowIndex, parentRowIndex); BigDecimal balanceQty = totalqty.subtract(preQty); - if (qty.compareTo(balanceQty) > 0) { -// this.getView().showMessage(String.format(ResManager.loadKDString("本期计量数量不能超过%s(总数量-期初累计计量数量)。", "ContractMeasureBillEditPlugin_4", "ec-contract-formplugin", new Object[0]), balanceQty.intValue())); -// this.getModel().setValue("thisqty", BigDecimal.ZERO, rowIndex, parentRowIndex); - } else { - this.getModel().setValue("lstqty", preQty.add(qty), rowIndex, parentRowIndex); - BigDecimal taxPrice = (BigDecimal)this.getModel().getValue("curtaxprice", rowIndex, parentRowIndex); - BigDecimal amount = taxPrice.multiply(qty); - this.getModel().setValue("thisoftaxmount", amount, rowIndex, parentRowIndex); - if (this.isInContract()) { - this.countPercent(rowIndex, parentRowIndex); - } - +// if (qty.compareTo(balanceQty) > 0) { +//// this.getView().showMessage(String.format(ResManager.loadKDString("本期计量数量不能超过%s(总数量-期初累计计量数量)。", "ContractMeasureBillEditPlugin_4", "ec-contract-formplugin", new Object[0]), balanceQty.intValue())); +//// this.getModel().setValue("thisqty", BigDecimal.ZERO, rowIndex, parentRowIndex); +// } else { + this.getModel().setValue("lstqty", preQty.add(qty), rowIndex, parentRowIndex); + BigDecimal taxPrice = (BigDecimal) this.getModel().getValue("curtaxprice", rowIndex, parentRowIndex); + BigDecimal amount = taxPrice.multiply(qty); + this.getModel().setValue("thisoftaxmount", amount, rowIndex, parentRowIndex); + if (this.isInContract()) { + this.countPercent(rowIndex, parentRowIndex); } + +// } } @Override @@ -54,8 +55,8 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin List listingIds = new ArrayList(); int rowIndex; - for(rowIndex = 0; rowIndex < rowCount; ++rowIndex) { - DynamicObject listing = (DynamicObject)this.getModel().getValue("listing", rowIndex); + for (rowIndex = 0; rowIndex < rowCount; ++rowIndex) { + DynamicObject listing = (DynamicObject) this.getModel().getValue("listing", rowIndex); if (listing != null) { // listingIds.add(listing.getPkValue()); } @@ -63,9 +64,9 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin qFilters.add(new QFilter("id", "not in", listingIds)); rowIndex = this.getModel().getEntryCurrentRowIndex("listmodelentry"); - String listModelId = (String)this.getModel().getValue("listmodelid", rowIndex); + String listModelId = (String) this.getModel().getValue("listmodelid", rowIndex); qFilters.add(new QFilter("listingmodel", "=", StringUtils.isNotBlank(listModelId) ? Long.parseLong(listModelId) : 0L)); - DynamicObject contract = (DynamicObject)this.getModel().getValue("contract"); + DynamicObject contract = (DynamicObject) this.getModel().getValue("contract"); if (contract != null) { qFilters.add(new QFilter("contractid", "=", contract.getLong("id"))); } @@ -77,9 +78,35 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin } } -// @Override -// public void propertyChanged(PropertyChangedArgs e) { -// super.propertyChanged(e); + @Override + public void propertyChanged(PropertyChangedArgs e) { + super.propertyChanged(e); + + String propName = e.getProperty().getName(); + ChangeData changeData = e.getChangeSet()[0]; + if (StringUtils.equals(propName, "contract")) { + this.onContractChanged(changeData); + } else if (StringUtils.equals(propName, "period")) { + this.onPeriodChanged(changeData); + } else if (!StringUtils.equals(propName, "begindate") && !StringUtils.equals(propName, "enddate")) { + if (StringUtils.equals(propName, "thisqty")) { + this.onThisQtyChanged(changeData); + } else if (StringUtils.equals(propName, "thisamount")) { + this.onThisAmountChanged(changeData); + } else if (StringUtils.equals(propName, "thisoftaxmount")) { + this.onThisOfTaxAmountChanged(changeData); + } else if (StringUtils.equals(propName, "thistax")) { + this.onThisTaxChanged(changeData); + } else if (StringUtils.equals(propName, "ismeasurebymatin")) { + this.isMeasureByMaterialInChanged(changeData); + } else if (StringUtils.equals(propName, PriceAdjustModeEnum.ADJUST_AMOUNT.getValue())) { + this.onAdjustAmountChange(changeData); + } else if (StringUtils.equals(propName, PriceAdjustModeEnum.ADJUST_TAX.getValue())) { + this.onAdjustTaxChange(changeData); + } + } else { + this.onDateChanged(changeData, propName); + } // String name = e.getProperty().getName(); // ChangeData changeData = e.getChangeSet()[0]; // int rowIndex = changeData.getRowIndex(); @@ -131,6 +158,6 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin //// this.getView().updateView(); //// } //// -//// } -// } +// } + } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java index 6de9cf0..b2da35d 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java @@ -34,7 +34,8 @@ public class ResourceFilterExtPlugin extends ResourceItemListPlugin { } else if (contractType.toString().equals("sbcg")) {//设备采购 this.setResourceTypeStyle("equipment"); this.afterSelectedTag("equipment"); - }else if (contractType.toString().equals("qtcc") || contractType.toString().equals("lwlcc")) {//产出物 + }else if (contractType.toString().equals("qtcc") || contractType.toString().equals("lwlcc")|| contractType.toString().equals("ck")|| + contractType.toString().equals("zyfbcc")|| contractType.toString().equals("jjbc")) {//产出物 this.setResourceTypeStyle("turnover"); this.afterSelectedTag("turnover"); }else {