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 c9653fd..7621c06 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 @@ -131,6 +131,7 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin @Override public void propertyChanged(PropertyChangedArgs e) { super.propertyChanged(e); + boolean checkbox= this.getModel().getDataEntity().getBoolean("zcgj_hsjell"); String propName = e.getProperty().getName(); ChangeData changeData = e.getChangeSet()[0]; int rowIndex = changeData.getRowIndex(); @@ -141,22 +142,28 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin BigDecimal oldValue = (BigDecimal)changeData.getOldValue(); if(oldValue.compareTo(new BigDecimal(0)) == 0){ BigDecimal initialValue = (BigDecimal) changeData.getNewValue(); - this.getView().getPageCache().put("currentprice", initialValue.toString()); + this.getModel().setValue("zcgj_cachepricefield", initialValue,rowIndex,parentRowIndex); +// BigDecimal initialValue = (BigDecimal) changeData.getNewValue(); +// this.getView().getPageCache().put("currentprice", initialValue.toString()); return; } - String initialValue = this.getView().getPageCache().get("currentprice"); - BigDecimal initialvalue = new BigDecimal(initialValue); + BigDecimal initialValue = (BigDecimal)this.getModel().getValue("zcgj_cachepricefield", rowIndex, parentRowIndex); + +// String initialValue = this.getView().getPageCache().get("currentprice"); +// BigDecimal initialvalue = new BigDecimal(initialValue); BigDecimal newValue = (BigDecimal)changeData.getNewValue(); - PriceChangedWarn(initialvalue,newValue,rowIndex,parentRowIndex); - } else if (StringUtils.equals(propName, "thisqty") || StringUtils.equals(propName, "thisoftaxmount")) { + PriceChangedWarn(initialValue,newValue,rowIndex,parentRowIndex); + } else if (checkbox && (StringUtils.equals(propName, "thisqty") || StringUtils.equals(propName, "thisoftaxmount"))) { BigDecimal oldValue = (BigDecimal)changeData.getOldValue(); if(oldValue.compareTo(new BigDecimal(0)) == 0){ BigDecimal initialValue = (BigDecimal) changeData.getNewValue(); this.getView().getPageCache().put("currentprice", initialValue.toString()); return; } - String initialValue = this.getView().getPageCache().get("currentprice"); - BigDecimal initialvalue = new BigDecimal(initialValue); + BigDecimal initialValue = (BigDecimal)this.getModel().getValue("zcgj_cachepricefield", rowIndex, parentRowIndex); +// +// String initialValue = this.getView().getPageCache().get("currentprice"); +// BigDecimal initialvalue = new BigDecimal(initialValue); BigDecimal thisqty = (BigDecimal)this.getModel().getValue("thisqty", rowIndex, parentRowIndex); BigDecimal thisoftaxmount =(BigDecimal) this.getModel().getValue("thisoftaxmount", rowIndex, parentRowIndex); BigDecimal totalqty =(BigDecimal) this.getModel().getValue("totalqty", rowIndex, parentRowIndex); @@ -177,7 +184,7 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin listentry.set("currenttaxamt",curtaxprice.multiply(totalqty).subtract(currentprice.multiply(totalqty))); listentry.set("currentoftax",curtaxprice.multiply(totalqty)); this.getView().updateView("listentry"); - PriceChangedWarn(initialvalue,currentprice,rowIndex, parentRowIndex); + PriceChangedWarn(initialValue,currentprice,rowIndex, parentRowIndex); } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InContractMeasurementBillEditPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InContractMeasurementBillEditPlugin.java index 3cae691..c29f3ab 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InContractMeasurementBillEditPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InContractMeasurementBillEditPlugin.java @@ -182,35 +182,38 @@ public class InContractMeasurementBillEditPlugin extends InContractMeasureBillEd super.propertyChanged(e); String propName = e.getProperty().getName(); ChangeData changeData = e.getChangeSet()[0]; - + boolean checkbox= this.getModel().getDataEntity().getBoolean("zcgj_hsjell"); int rowIndex = changeData.getRowIndex(); int parentRowIndex = changeData.getParentRowIndex(); if (StringUtils.equals(propName, "zcgj_hsjell")) { doLockFieldWithPriceAdjustMode((PriceAdjustModeEnum)null); } else if (StringUtils.equals(propName,"currentprice")) { // 获取初始单价 - BigDecimal initialPrice = (BigDecimal) this.getModel().getValue("currentprice", rowIndex, parentRowIndex); +// BigDecimal initialPrice = (BigDecimal) this.getModel().getValue("currentprice", rowIndex, parentRowIndex); BigDecimal oldValue = (BigDecimal)changeData.getOldValue(); if(oldValue.compareTo(new BigDecimal(0)) == 0){ BigDecimal initialValue = (BigDecimal) changeData.getNewValue(); - this.getView().getPageCache().put("currentprice", initialValue.toString()); + this.getModel().setValue("zcgj_cachepricefield", initialValue,rowIndex,parentRowIndex); +// BigDecimal initialValue = (BigDecimal) changeData.getNewValue(); +// this.getView().getPageCache().put("currentprice", initialValue.toString()); return; } - String initialValue = this.getView().getPageCache().get("currentprice"); - BigDecimal initialvalue = new BigDecimal(initialValue); +// String initialValue = this.getView().getPageCache().get("currentprice"); + BigDecimal initialValue = (BigDecimal)this.getModel().getValue("zcgj_cachepricefield", rowIndex, parentRowIndex); +// BigDecimal initialvalue = new BigDecimal(initialValue); BigDecimal newValue = (BigDecimal)changeData.getNewValue(); - PriceChangedWarn(initialvalue,newValue,rowIndex,parentRowIndex); - } else if ( StringUtils.equals(propName, "thisoftaxmount")) {//StringUtils.equals(propName, "thisqty") || - BigDecimal initialPrice = (BigDecimal) this.getModel().getValue("currentprice", rowIndex, parentRowIndex); + PriceChangedWarn(initialValue,newValue,rowIndex,parentRowIndex); + } else if ( checkbox && StringUtils.equals(propName, "thisoftaxmount")) {//StringUtils.equals(propName, "thisqty") || +// BigDecimal initialPrice = (BigDecimal) this.getModel().getValue("currentprice", rowIndex, parentRowIndex); BigDecimal oldValue = (BigDecimal)changeData.getOldValue(); if(oldValue.compareTo(new BigDecimal(0)) == 0){ - BigDecimal initialValue = (BigDecimal) changeData.getNewValue(); - this.getView().getPageCache().put("currentprice", initialValue.toString()); +// BigDecimal initialValue = (BigDecimal) changeData.getNewValue(); +// this.getView().getPageCache().put("currentprice", initialValue.toString()); return; } - String initialValue = this.getView().getPageCache().get("currentprice"); - BigDecimal initialvalue = new BigDecimal(initialValue); - +// String initialValue = this.getView().getPageCache().get("currentprice"); +// BigDecimal initialvalue = new BigDecimal(initialValue); + BigDecimal initialValue = (BigDecimal)this.getModel().getValue("zcgj_cachepricefield", rowIndex, parentRowIndex); BigDecimal thisqty = (BigDecimal)this.getModel().getValue("thisqty", rowIndex, parentRowIndex);//本期计量数量 BigDecimal thisoftaxmount =(BigDecimal) this.getModel().getValue("thisoftaxmount", rowIndex, parentRowIndex);//本期计量含税金额 BigDecimal totalqty =(BigDecimal) this.getModel().getValue("totalqty", rowIndex, parentRowIndex);//数量 @@ -238,7 +241,7 @@ public class InContractMeasurementBillEditPlugin extends InContractMeasureBillEd // this.getModel().setValue("currenttaxamt",curtaxprice.multiply(totalqty).subtract(currentprice.multiply(totalqty)),rowIndex, parentRowIndex); // this.getModel().setValue("currentoftax",curtaxprice.multiply(totalqty),rowIndex, parentRowIndex); this.getView().updateView(); - PriceChangedWarn(initialvalue,currentprice,rowIndex, parentRowIndex); + PriceChangedWarn(initialValue,currentprice,rowIndex, parentRowIndex); } // String resname = (String)this.getModel().getValue("resname", rowIndex, parentRowIndex); // PriceChangedWarn(oldPrice,currentprice,rowIndex, parentRowIndex);