工序成本预算单据调整操作年月赋值锁定逻辑添加(测试

This commit is contained in:
xuhaihui 2025-06-05 14:07:19 +08:00
parent 23d8f38896
commit a4192ed5f2
1 changed files with 115 additions and 115 deletions

View File

@ -8,6 +8,7 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import kd.bos.bill.OperationStatus; import kd.bos.bill.OperationStatus;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
@ -84,13 +85,13 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
public void registerListener(EventObject e) { public void registerListener(EventObject e) {
super.registerListener(e); super.registerListener(e);
BasedataEdit unitproject = (BasedataEdit)this.getControl("unitproject"); BasedataEdit unitproject = (BasedataEdit) this.getControl("unitproject");
unitproject.addBeforeF7SelectListener(this); unitproject.addBeforeF7SelectListener(this);
BasedataEdit project = (BasedataEdit)this.getControl("project"); BasedataEdit project = (BasedataEdit) this.getControl("project");
project.addBeforeF7SelectListener(this); project.addBeforeF7SelectListener(this);
BasedataEdit boqEdit = (BasedataEdit)this.getControl("projectboq"); BasedataEdit boqEdit = (BasedataEdit) this.getControl("projectboq");
boqEdit.addBeforeF7SelectListener(this); boqEdit.addBeforeF7SelectListener(this);
TreeEntryGrid grid = (TreeEntryGrid)this.getControl("treeentryentity"); TreeEntryGrid grid = (TreeEntryGrid) this.getControl("treeentryentity");
grid.addRowClickListener(this); grid.addRowClickListener(this);
} }
@ -101,16 +102,16 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
protected void setsubEntryColor() { protected void setsubEntryColor() {
if (this.isAdjust()) { if (this.isAdjust()) {
SubEntryGrid subentryGrid = (SubEntryGrid)this.getView().getControl("subentryentity"); SubEntryGrid subentryGrid = (SubEntryGrid) this.getView().getControl("subentryentity");
int rowcount = this.getModel().getEntryRowCount("subentryentity"); int rowcount = this.getModel().getEntryRowCount("subentryentity");
for(int i = 0; i < rowcount; ++i) { for (int i = 0; i < rowcount; ++i) {
String oldentryid = TypeUtils.nullToString(this.getModel().getValue("oldentryid", i)); String oldentryid = TypeUtils.nullToString(this.getModel().getValue("oldentryid", i));
if (!"".equals(oldentryid) && !"0".equals(oldentryid)) { if (!"".equals(oldentryid) && !"0".equals(oldentryid)) {
BigDecimal oldAdjuAmount = (BigDecimal)this.getModel().getValue("oldamountre", i); BigDecimal oldAdjuAmount = (BigDecimal) this.getModel().getValue("oldamountre", i);
BigDecimal amountnew = (BigDecimal)this.getModel().getValue("amount", i); BigDecimal amountnew = (BigDecimal) this.getModel().getValue("amount", i);
BigDecimal price = (BigDecimal)this.getModel().getValue("price", i); BigDecimal price = (BigDecimal) this.getModel().getValue("price", i);
BigDecimal qty = (BigDecimal)this.getModel().getValue("qty", i); BigDecimal qty = (BigDecimal) this.getModel().getValue("qty", i);
if (amountnew.compareTo(BigDecimal.ZERO) == 0 && price.compareTo(BigDecimal.ZERO) == 0 && qty.compareTo(BigDecimal.ZERO) == 0) { if (amountnew.compareTo(BigDecimal.ZERO) == 0 && price.compareTo(BigDecimal.ZERO) == 0 && qty.compareTo(BigDecimal.ZERO) == 0) {
subentryGrid.setRowBackcolor("#9D9D9D", new int[]{i}); subentryGrid.setRowBackcolor("#9D9D9D", new int[]{i});
} else if (oldAdjuAmount.compareTo(amountnew) != 0) { } else if (oldAdjuAmount.compareTo(amountnew) != 0) {
@ -141,18 +142,18 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void beforeProjectSelected(BeforeF7SelectEvent ent) { protected void beforeProjectSelected(BeforeF7SelectEvent ent) {
ListShowParameter parameter = (ListShowParameter)ent.getFormShowParameter(); ListShowParameter parameter = (ListShowParameter) ent.getFormShowParameter();
QFilter filter = new QFilter("id", "!=", this.getModel().getDataEntity().getPkValue()); QFilter filter = new QFilter("id", "!=", this.getModel().getDataEntity().getPkValue());
List<Long> projectIds = new ArrayList(); List<Long> projectIds = new ArrayList();
DynamicObject[] aimcostbills = BusinessDataServiceHelper.load("ecco_aimcostbillcbs", "id,billno,billstatus,creator,modifier,auditor,auditdate,modifytime,createtime,org,treeentryentity.id,treeentryentity.pid,treeentryentity.isGroupNode,treeentryentity.cbs,treeentryentity.oldamount,treeentryentity.pdamount,treeentryentity.description,treeentryentity.isgua,treeentryentity.isleaf,treeentryentity.oldcbsentryid,treeentryentity.isdelete,name,project,unitproject,totalamount,remark,versionno,oldid,isenable,currency,editonunit,fiaccountorg,billhead_lk.id,billhead_lk.billhead_lk_stableid,billhead_lk.billhead_lk_sbillid,billhead_lk.billhead_lk_sid,beforeamt", new QFilter[]{filter}); DynamicObject[] aimcostbills = BusinessDataServiceHelper.load("ecco_aimcostbillcbs", "id,billno,billstatus,creator,modifier,auditor,auditdate,modifytime,createtime,org,treeentryentity.id,treeentryentity.pid,treeentryentity.isGroupNode,treeentryentity.cbs,treeentryentity.oldamount,treeentryentity.pdamount,treeentryentity.description,treeentryentity.isgua,treeentryentity.isleaf,treeentryentity.oldcbsentryid,treeentryentity.isdelete,name,project,unitproject,totalamount,remark,versionno,oldid,isenable,currency,editonunit,fiaccountorg,billhead_lk.id,billhead_lk.billhead_lk_stableid,billhead_lk.billhead_lk_sbillid,billhead_lk.billhead_lk_sid,beforeamt", new QFilter[]{filter});
DynamicObject[] var6 = aimcostbills; DynamicObject[] var6 = aimcostbills;
int var7 = aimcostbills.length; int var7 = aimcostbills.length;
for(int var8 = 0; var8 < var7; ++var8) { for (int var8 = 0; var8 < var7; ++var8) {
DynamicObject aimcostbill = var6[var8]; DynamicObject aimcostbill = var6[var8];
DynamicObject project = aimcostbill.getDynamicObject("project"); DynamicObject project = aimcostbill.getDynamicObject("project");
if (project != null && !project.getBoolean("editonunit")) { if (project != null && !project.getBoolean("editonunit")) {
projectIds.add((Long)project.getPkValue()); projectIds.add((Long) project.getPkValue());
} }
} }
@ -161,9 +162,9 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void beforeBoqSelected(BeforeF7SelectEvent beforef7selectevent) { protected void beforeBoqSelected(BeforeF7SelectEvent beforef7selectevent) {
boolean editOnUnit = (Boolean)this.getModel().getValue("editonunit"); boolean editOnUnit = (Boolean) this.getModel().getValue("editonunit");
DynamicObject unitproject = (DynamicObject)this.getModel().getValue("unitproject"); DynamicObject unitproject = (DynamicObject) this.getModel().getValue("unitproject");
ListShowParameter parameter = (ListShowParameter)beforef7selectevent.getFormShowParameter(); ListShowParameter parameter = (ListShowParameter) beforef7selectevent.getFormShowParameter();
if (editOnUnit && unitproject == null) { if (editOnUnit && unitproject == null) {
this.getView().showTipNotification(ResManager.loadKDString("请填写“单位工程”字段。", "AimcostcbsbillEditUI_0", "ec-ecco-formplugin", new Object[0])); this.getView().showTipNotification(ResManager.loadKDString("请填写“单位工程”字段。", "AimcostcbsbillEditUI_0", "ec-ecco-formplugin", new Object[0]));
beforef7selectevent.setCancel(true); beforef7selectevent.setCancel(true);
@ -173,7 +174,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
parameter.getListFilterParameter().getQFilters().add(qFilter); parameter.getListFilterParameter().getQFilters().add(qFilter);
} }
DynamicObject project = (DynamicObject)this.getModel().getValue("project"); DynamicObject project = (DynamicObject) this.getModel().getValue("project");
if (project != null) { if (project != null) {
QFilter qFilter = new QFilter("project", "=", project.getPkValue()); QFilter qFilter = new QFilter("project", "=", project.getPkValue());
parameter.getListFilterParameter().getQFilters().add(qFilter); parameter.getListFilterParameter().getQFilters().add(qFilter);
@ -184,8 +185,8 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void beforeUnitProjectSelected(BeforeF7SelectEvent beforef7selectevent) { protected void beforeUnitProjectSelected(BeforeF7SelectEvent beforef7selectevent) {
ListShowParameter parameter = (ListShowParameter)beforef7selectevent.getFormShowParameter(); ListShowParameter parameter = (ListShowParameter) beforef7selectevent.getFormShowParameter();
DynamicObject project = (DynamicObject)this.getModel().getValue("project"); DynamicObject project = (DynamicObject) this.getModel().getValue("project");
if (project != null) { if (project != null) {
QFilter qFilter = new QFilter("parent", "=", project.getPkValue()); QFilter qFilter = new QFilter("parent", "=", project.getPkValue());
List<Long> unitprojectIds = new ArrayList(); List<Long> unitprojectIds = new ArrayList();
@ -195,10 +196,10 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
DynamicObject[] var8 = aimcostbills; DynamicObject[] var8 = aimcostbills;
int var9 = aimcostbills.length; int var9 = aimcostbills.length;
for(int var10 = 0; var10 < var9; ++var10) { for (int var10 = 0; var10 < var9; ++var10) {
DynamicObject aimcostbill = var8[var10]; DynamicObject aimcostbill = var8[var10];
DynamicObject unitproject = aimcostbill.getDynamicObject("unitproject"); DynamicObject unitproject = aimcostbill.getDynamicObject("unitproject");
unitprojectIds.add((Long)unitproject.getPkValue()); unitprojectIds.add((Long) unitproject.getPkValue());
} }
qFilter.and(new QFilter("id", "not in", unitprojectIds)); qFilter.and(new QFilter("id", "not in", unitprojectIds));
@ -210,7 +211,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
protected DynamicObjectTreeNode dynamicObjectToTreeNode(DynamicObject cbsEntryinfo, DynamicObject cbsInfo) { protected DynamicObjectTreeNode dynamicObjectToTreeNode(DynamicObject cbsEntryinfo, DynamicObject cbsInfo) {
DynamicObjectTreeNode child = new DynamicObjectTreeNode(); DynamicObjectTreeNode child = new DynamicObjectTreeNode();
child.setId((Long)cbsEntryinfo.getPkValue()); child.setId((Long) cbsEntryinfo.getPkValue());
if (cbsEntryinfo.get("pid") != null && cbsEntryinfo.getLong("pid") != 0L) { if (cbsEntryinfo.get("pid") != null && cbsEntryinfo.getLong("pid") != 0L) {
child.setParentId(cbsEntryinfo.getLong("pid")); child.setParentId(cbsEntryinfo.getLong("pid"));
} else { } else {
@ -262,21 +263,18 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
newInfo.set("name", project.get("name")); newInfo.set("name", project.get("name"));
newInfo.set("project", project.get("project")); newInfo.set("project", project.get("project"));
newInfo.set("org", project.get("org")); newInfo.set("org", project.get("org"));
project = project.getDynamicObject("project"); DynamicObject project1 = project.getDynamicObject("project");
if (project != null) { if (project1 != null) {
BigDecimal allInContractAmt = this.getAllInContractAmt(project.getLong("id")); BigDecimal allInContractAmt = this.getAllInContractAmt(project1.getLong("id"));
this.getModel().setValue("totalincontamt", allInContractAmt); this.getModel().setValue("totalincontamt", allInContractAmt);
} }
if (project != null) { newInfo.set("unitproject", project.get("unitproject"));
newInfo.set("unitproject", project.get("unitproject")); newInfo.set("totalamount", project.get("totalamount"));
}
if (project != null) {
newInfo.set("totalamount", project.get("totalamount"));
}
newInfo.set("remark", project.get("remark")); newInfo.set("remark", project.get("remark"));
newInfo.set("editonunit", project.get("editonunit")); newInfo.set("editonunit", project.get("editonunit"));
newInfo.set("fiaccountorg", project.get("fiaccountorg")); newInfo.set("fiaccountorg", project.get("fiaccountorg"));
newInfo.set("zcgj_periodyear", project.get("zcgj_periodyear"));
this.versionNum = TypeUtils.string2Double(project.getString("versionno")) + 1.0; this.versionNum = TypeUtils.string2Double(project.getString("versionno")) + 1.0;
newInfo.set("versionno", this.versionNum); newInfo.set("versionno", this.versionNum);
newInfo.set("currency", project.get("currency")); newInfo.set("currency", project.get("currency"));
@ -290,21 +288,22 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
this.getView().updateView("org"); this.getView().updateView("org");
this.getView().updateView("versionno"); this.getView().updateView("versionno");
this.getView().updateView("currency"); this.getView().updateView("currency");
this.getView().updateView("zcgj_periodyear");
Map<Long, Long> cbsEntryIdMap = new HashMap(); Map<Long, Long> cbsEntryIdMap = new HashMap();
Map<String, String> idMap = new HashMap(16); Map<String, String> idMap = new HashMap(16);
DynamicObjectCollection cbsEntryColl = (DynamicObjectCollection)project.get("treeentryentity"); DynamicObjectCollection cbsEntryColl = (DynamicObjectCollection) project.get("treeentryentity");
DynamicObjectCollection entryColl = new DynamicObjectCollection(EcCommonUtils.getEntryDynamicObjectType("ecco_aimcostbillcbs", "treeentryentity"), newInfo); DynamicObjectCollection entryColl = new DynamicObjectCollection(EcCommonUtils.getEntryDynamicObjectType("ecco_aimcostbillcbs", "treeentryentity"), newInfo);
int seq = 0; int seq = 0;
for(int i = 0; i < cbsEntryColl.size(); ++i) { for (int i = 0; i < cbsEntryColl.size(); ++i) {
DynamicObject oldValue = (DynamicObject)cbsEntryColl.get(i); DynamicObject oldValue = (DynamicObject) cbsEntryColl.get(i);
if (!oldValue.getBoolean("isdelete")) { if (!oldValue.getBoolean("isdelete")) {
DynamicObject newValue = new DynamicObject(oldValue.getDynamicObjectType()); DynamicObject newValue = new DynamicObject(oldValue.getDynamicObjectType());
long entryId = orm.genLongId(EcCommonUtils.getEntryDynamicObjectType("ecco_aimcostbillcbs", "treeentryentity")); long entryId = orm.genLongId(EcCommonUtils.getEntryDynamicObjectType("ecco_aimcostbillcbs", "treeentryentity"));
newValue.set("id", entryId); newValue.set("id", entryId);
idMap.put(oldValue.getDynamicObject("cbs").getString("id"), String.valueOf(entryId)); idMap.put(oldValue.getDynamicObject("cbs").getString("id"), String.valueOf(entryId));
if (oldValue.get("pid") != null) { if (oldValue.get("pid") != null) {
newValue.set("pid", cbsEntryIdMap.get((Long)oldValue.get("pid"))); newValue.set("pid", cbsEntryIdMap.get((Long) oldValue.get("pid")));
} }
newValue.set("seq", seq++); newValue.set("seq", seq++);
@ -316,14 +315,14 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
newValue.set("isgua", oldValue.get("isgua")); newValue.set("isgua", oldValue.get("isgua"));
newValue.set("isleaf", cbs == null ? oldValue.get("isleaf") : cbs.get("isleaf")); newValue.set("isleaf", cbs == null ? oldValue.get("isleaf") : cbs.get("isleaf"));
newValue.set("oldcbsentryid", oldValue.getPkValue()); newValue.set("oldcbsentryid", oldValue.getPkValue());
cbsEntryIdMap.put((Long)oldValue.getPkValue(), (Long)newValue.getPkValue()); cbsEntryIdMap.put((Long) oldValue.getPkValue(), (Long) newValue.getPkValue());
DynamicObjectCollection oldResourceEntries = (DynamicObjectCollection)oldValue.get("subentryentity"); DynamicObjectCollection oldResourceEntries = (DynamicObjectCollection) oldValue.get("subentryentity");
if (!oldResourceEntries.isEmpty()) { if (!oldResourceEntries.isEmpty()) {
DynamicObjectCollection newResourceEntries = new DynamicObjectCollection(oldResourceEntries.getDynamicObjectType(), newValue); DynamicObjectCollection newResourceEntries = new DynamicObjectCollection(oldResourceEntries.getDynamicObjectType(), newValue);
int subseq = 0; int subseq = 0;
for(int j = 0; j < oldResourceEntries.size(); ++j) { for (int j = 0; j < oldResourceEntries.size(); ++j) {
DynamicObject oldreValue = (DynamicObject)oldResourceEntries.get(j); DynamicObject oldreValue = (DynamicObject) oldResourceEntries.get(j);
if (oldreValue.getBigDecimal("amount").compareTo(BigDecimal.ZERO) != 0 || oldreValue.getBigDecimal("price").compareTo(BigDecimal.ZERO) != 0 || oldreValue.getBigDecimal("qty").compareTo(BigDecimal.ZERO) != 0) { if (oldreValue.getBigDecimal("amount").compareTo(BigDecimal.ZERO) != 0 || oldreValue.getBigDecimal("price").compareTo(BigDecimal.ZERO) != 0 || oldreValue.getBigDecimal("qty").compareTo(BigDecimal.ZERO) != 0) {
DynamicObject newreValue = new DynamicObject(oldreValue.getDynamicObjectType()); DynamicObject newreValue = new DynamicObject(oldreValue.getDynamicObjectType());
newreValue.set("seq", subseq++); newreValue.set("seq", subseq++);
@ -357,6 +356,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
this.adjustAddNewCbs(project, entryColl, idMap); this.adjustAddNewCbs(project, entryColl, idMap);
this.getView().setEnable(false, new String[]{"project"}); this.getView().setEnable(false, new String[]{"project"});
this.getView().setEnable(false, new String[]{"editonunit"}); this.getView().setEnable(false, new String[]{"editonunit"});
this.getView().setEnable(false, new String[]{"zcgj_periodyear"});
this.getModel().updateEntryCache(entryColl); this.getModel().updateEntryCache(entryColl);
this.getView().updateView("treeentryentity"); this.getView().updateView("treeentryentity");
} }
@ -371,14 +371,14 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
DynamicObject[] var7 = procbss; DynamicObject[] var7 = procbss;
int i = procbss.length; int i = procbss.length;
for(int var9 = 0; var9 < i; ++var9) { for (int var9 = 0; var9 < i; ++var9) {
DynamicObject procbs = var7[var9]; DynamicObject procbs = var7[var9];
String procbsId = procbs.getString("id"); String procbsId = procbs.getString("id");
i = 0; i = 0;
int entryCollSize; int entryCollSize;
for(entryCollSize = entryColl.size(); i < entryCollSize; ++i) { for (entryCollSize = entryColl.size(); i < entryCollSize; ++i) {
DynamicObject entryCbsObj = ((DynamicObject)entryColl.get(i)).getDynamicObject("cbs"); DynamicObject entryCbsObj = ((DynamicObject) entryColl.get(i)).getDynamicObject("cbs");
if (procbsId.equals(entryCbsObj.getString("id"))) { if (procbsId.equals(entryCbsObj.getString("id"))) {
break; break;
} }
@ -392,10 +392,10 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
if (!newProCbsList.isEmpty()) { if (!newProCbsList.isEmpty()) {
ORM orm = ORM.create(); ORM orm = ORM.create();
for(i = 0; i < newProCbsList.size(); ++i) { for (i = 0; i < newProCbsList.size(); ++i) {
DynamicObject newValue = new DynamicObject(entryColl.getDynamicObjectType()); DynamicObject newValue = new DynamicObject(entryColl.getDynamicObjectType());
long treeEntryId = orm.genLongId(entryColl.getDynamicObjectType()); long treeEntryId = orm.genLongId(entryColl.getDynamicObjectType());
DynamicObject newCbs = (DynamicObject)newProCbsList.get(i); DynamicObject newCbs = (DynamicObject) newProCbsList.get(i);
idMap.put(newCbs.getString("id"), String.valueOf(treeEntryId)); idMap.put(newCbs.getString("id"), String.valueOf(treeEntryId));
newValue.set("cbs", newCbs); newValue.set("cbs", newCbs);
boolean isleaf = newCbs.getBoolean("isleaf"); boolean isleaf = newCbs.getBoolean("isleaf");
@ -428,7 +428,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
this.getView().updateView("treeentryentity"); this.getView().updateView("treeentryentity");
this.getView().updateView("subentryentity"); this.getView().updateView("subentryentity");
if (OperationStatus.ADDNEW.equals(this.getView().getFormShowParameter().getStatus())) { if (OperationStatus.ADDNEW.equals(this.getView().getFormShowParameter().getStatus())) {
BigDecimal beforeAmt = (BigDecimal)this.getModel().getValue("totalamount"); BigDecimal beforeAmt = (BigDecimal) this.getModel().getValue("totalamount");
this.getModel().setValue("beforeamt", beforeAmt); this.getModel().setValue("beforeamt", beforeAmt);
} }
} else { } else {
@ -450,13 +450,13 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
this.refershTreeEnable(); this.refershTreeEnable();
this.setSumToRow("treeentryentity", new String[]{"oldamount", "pdamount"}); this.setSumToRow("treeentryentity", new String[]{"oldamount", "pdamount"});
this.setsubEntryColor(); this.setsubEntryColor();
TreeEntryGrid treeEntry = (TreeEntryGrid)this.getView().getControl("treeentryentity"); TreeEntryGrid treeEntry = (TreeEntryGrid) this.getView().getControl("treeentryentity");
treeEntry.setCollapse(false); treeEntry.setCollapse(false);
} }
protected void setUnitProjectMustinput() { protected void setUnitProjectMustinput() {
boolean editOnUnit = (Boolean)this.getModel().getValue("editonunit"); boolean editOnUnit = (Boolean) this.getModel().getValue("editonunit");
BasedataEdit unitProjectEdit = (BasedataEdit)this.getView().getControl("unitproject"); BasedataEdit unitProjectEdit = (BasedataEdit) this.getView().getControl("unitproject");
unitProjectEdit.setMustInput(editOnUnit); unitProjectEdit.setMustInput(editOnUnit);
} }
@ -468,14 +468,14 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
} }
return this.getView().getFormShowParameter().getCustomParam("isadjust") == null ? false : (Boolean)this.getView().getFormShowParameter().getCustomParam("isadjust"); return this.getView().getFormShowParameter().getCustomParam("isadjust") == null ? false : (Boolean) this.getView().getFormShowParameter().getCustomParam("isadjust");
} }
protected void refershTreeEnable() { protected void refershTreeEnable() {
int rowcount = this.getModel().getEntryRowCount("treeentryentity"); int rowcount = this.getModel().getEntryRowCount("treeentryentity");
TreeEntryGrid grid = (TreeEntryGrid)this.getView().getControl("treeentryentity"); TreeEntryGrid grid = (TreeEntryGrid) this.getView().getControl("treeentryentity");
for(int i = 0; i < rowcount; ++i) { for (int i = 0; i < rowcount; ++i) {
if (this.isAdjust() && this.getModel().getValue("oldcbsentryid", i) != null && !"0".equals(TypeUtils.nullToString(this.getModel().getValue("oldcbsentryid", i)))) { if (this.isAdjust() && this.getModel().getValue("oldcbsentryid", i) != null && !"0".equals(TypeUtils.nullToString(this.getModel().getValue("oldcbsentryid", i)))) {
BigDecimal oldAmount = EcNumberHelper.toBigDecimal(this.getModel().getValue("oldamount", i)); BigDecimal oldAmount = EcNumberHelper.toBigDecimal(this.getModel().getValue("oldamount", i));
BigDecimal newAmount = EcNumberHelper.toBigDecimal(this.getModel().getValue("pdamount", i)); BigDecimal newAmount = EcNumberHelper.toBigDecimal(this.getModel().getValue("pdamount", i));
@ -494,7 +494,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
protected void fillTreeList(IDataModel model, DynamicObject[] objs, boolean isRoot, int rowIndex) { protected void fillTreeList(IDataModel model, DynamicObject[] objs, boolean isRoot, int rowIndex) {
if (objs != null && objs.length != 0) { if (objs != null && objs.length != 0) {
for(int i = 0; i < objs.length; ++i) { for (int i = 0; i < objs.length; ++i) {
// int rIndex = false; // int rIndex = false;
int rIndex; int rIndex;
if (isRoot) { if (isRoot) {
@ -503,7 +503,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
rIndex = model.insertEntryRow("treeentryentity", rowIndex); rIndex = model.insertEntryRow("treeentryentity", rowIndex);
} }
TreeEntryGrid grid = (TreeEntryGrid)this.getView().getControl("treeentryentity"); TreeEntryGrid grid = (TreeEntryGrid) this.getView().getControl("treeentryentity");
grid.getModel().updateCache(); grid.getModel().updateCache();
model.setValue("cbs", objs[i], rIndex); model.setValue("cbs", objs[i], rIndex);
model.setValue("isleaf", objs[i].get("isleaf"), rIndex); model.setValue("isleaf", objs[i].get("isleaf"), rIndex);
@ -548,15 +548,15 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
DynamicObject org; DynamicObject org;
DynamicObject currency; DynamicObject currency;
if (newValue != null) { if (newValue != null) {
org = (DynamicObject)newValue; org = (DynamicObject) newValue;
currency = CurrencyHelper.getCurrency((Long)org.getPkValue()); currency = CurrencyHelper.getCurrency((Long) org.getPkValue());
if (currency != null) { if (currency != null) {
this.getModel().setValue("currency", currency); this.getModel().setValue("currency", currency);
} }
} else { } else {
org = this.getModel().getDataEntity().getDynamicObject("org"); org = this.getModel().getDataEntity().getDynamicObject("org");
if (org != null) { if (org != null) {
currency = CurrencyHelper.getCurrency((Long)org.getPkValue()); currency = CurrencyHelper.getCurrency((Long) org.getPkValue());
if (currency != null) { if (currency != null) {
this.getModel().setValue("currency", currency); this.getModel().setValue("currency", currency);
} }
@ -568,16 +568,16 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
protected BigDecimal getAllInContractAmt(Long projectPk) { protected BigDecimal getAllInContractAmt(Long projectPk) {
DynamicObject[] contractBillCols = BusinessDataServiceHelper.load("ec_in_contract", "id,project,contstatus,totaloftaxamount,signamount,currency,stdcurrency,exchangedate", new QFilter[]{new QFilter("project", "=", projectPk), new QFilter("billstatus", "=", BillStatusEnum.AUDIT.getValue()), new QFilter("paydirection", "=", PayDirectionEnum.IN.getValue())}); DynamicObject[] contractBillCols = BusinessDataServiceHelper.load("ec_in_contract", "id,project,contstatus,totaloftaxamount,signamount,currency,stdcurrency,exchangedate", new QFilter[]{new QFilter("project", "=", projectPk), new QFilter("billstatus", "=", BillStatusEnum.AUDIT.getValue()), new QFilter("paydirection", "=", PayDirectionEnum.IN.getValue())});
BigDecimal allInContAmount = BigDecimal.ZERO; BigDecimal allInContAmount = BigDecimal.ZERO;
DynamicObject projectCurrencyObject = (DynamicObject)this.getModel().getValue("currency"); DynamicObject projectCurrencyObject = (DynamicObject) this.getModel().getValue("currency");
Long projCurrency = 0L; Long projCurrency = 0L;
if (projectCurrencyObject != null) { if (projectCurrencyObject != null) {
projCurrency = (Long)projectCurrencyObject.getPkValue(); projCurrency = (Long) projectCurrencyObject.getPkValue();
} }
for(int i = 0; i < contractBillCols.length; ++i) { for (int i = 0; i < contractBillCols.length; ++i) {
DynamicObject contractBill = contractBillCols[i]; DynamicObject contractBill = contractBillCols[i];
DynamicObject currency = (DynamicObject)contractBill.get("currency"); DynamicObject currency = (DynamicObject) contractBill.get("currency");
DynamicObject stdCurrency = (DynamicObject)contractBill.get("stdcurrency"); DynamicObject stdCurrency = (DynamicObject) contractBill.get("stdcurrency");
BigDecimal originaloftaxamount = contractBill.getBigDecimal("totaloftaxamount"); BigDecimal originaloftaxamount = contractBill.getBigDecimal("totaloftaxamount");
BigDecimal signamount = contractBill.getBigDecimal("signamount"); BigDecimal signamount = contractBill.getBigDecimal("signamount");
BigDecimal contAmount = null; BigDecimal contAmount = null;
@ -588,13 +588,13 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
contAmount = originaloftaxamount; contAmount = originaloftaxamount;
} }
} else if (currency != null && projectCurrencyObject != null) { } else if (currency != null && projectCurrencyObject != null) {
DynamicObject org = (DynamicObject)this.getModel().getValue("org"); DynamicObject org = (DynamicObject) this.getModel().getValue("org");
BigDecimal rate = BigDecimal.ONE; BigDecimal rate = BigDecimal.ONE;
if (org != null) { if (org != null) {
Long orgPk = org.getLong("id"); Long orgPk = org.getLong("id");
DynamicObject rateTable = CurrencyHelper.getExRateTable(orgPk); DynamicObject rateTable = CurrencyHelper.getExRateTable(orgPk);
if (rateTable != null) { if (rateTable != null) {
rate = CurrencyHelper.getExChangeRate((Long)currency.getPkValue(), projCurrency, rateTable.getLong("id"), contractBill.getDate("exchangedate")); rate = CurrencyHelper.getExChangeRate((Long) currency.getPkValue(), projCurrency, rateTable.getLong("id"), contractBill.getDate("exchangedate"));
} }
} }
@ -614,15 +614,15 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void amountChanged(ChangeData changeData) { protected void amountChanged(ChangeData changeData) {
boolean isimport = "true".equals(TypeUtils.nullToString((String)this.getView().getFormShowParameter().getCustomParam("isdeletesubentry"))); boolean isimport = "true".equals(TypeUtils.nullToString((String) this.getView().getFormShowParameter().getCustomParam("isdeletesubentry")));
if (!isimport) { if (!isimport) {
int parentRowIndex = changeData.getParentRowIndex(); int parentRowIndex = changeData.getParentRowIndex();
EntryGrid treeEntry = (EntryGrid)this.getView().getControl("treeentryentity"); EntryGrid treeEntry = (EntryGrid) this.getView().getControl("treeentryentity");
int[] selectrows = treeEntry.getSelectRows(); int[] selectrows = treeEntry.getSelectRows();
if (parentRowIndex >= 0) { if (parentRowIndex >= 0) {
DynamicObject treeEntryRowObj = this.getModel().getEntryRowEntity("treeentryentity", parentRowIndex); DynamicObject treeEntryRowObj = this.getModel().getEntryRowEntity("treeentryentity", parentRowIndex);
DynamicObjectCollection subentryentity = treeEntryRowObj.getDynamicObjectCollection("subentryentity"); DynamicObjectCollection subentryentity = treeEntryRowObj.getDynamicObjectCollection("subentryentity");
BigDecimal pdAmount = (BigDecimal)subentryentity.stream().map((o) -> { BigDecimal pdAmount = (BigDecimal) subentryentity.stream().map((o) -> {
return o.getBigDecimal("amount"); return o.getBigDecimal("amount");
}).reduce(BigDecimal.ZERO, BigDecimal::add); }).reduce(BigDecimal.ZERO, BigDecimal::add);
this.getModel().setValue("pdamount", pdAmount, parentRowIndex); this.getModel().setValue("pdamount", pdAmount, parentRowIndex);
@ -639,22 +639,22 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void qtyChanged(Object newValue, int rowIndex) { protected void qtyChanged(Object newValue, int rowIndex) {
BigDecimal qtynew = (BigDecimal)newValue; BigDecimal qtynew = (BigDecimal) newValue;
qtynew = qtynew == null ? BigDecimal.ZERO : qtynew; qtynew = qtynew == null ? BigDecimal.ZERO : qtynew;
BigDecimal price = (BigDecimal)this.getModel().getValue("price", rowIndex); BigDecimal price = (BigDecimal) this.getModel().getValue("price", rowIndex);
this.getModel().setValue("amount", qtynew.multiply(price), rowIndex); this.getModel().setValue("amount", qtynew.multiply(price), rowIndex);
} }
protected void priceChanged(Object newValue, int rowIndex) { protected void priceChanged(Object newValue, int rowIndex) {
BigDecimal pricenew = (BigDecimal)newValue; BigDecimal pricenew = (BigDecimal) newValue;
pricenew = pricenew == null ? BigDecimal.ZERO : pricenew; pricenew = pricenew == null ? BigDecimal.ZERO : pricenew;
BigDecimal qty = (BigDecimal)this.getModel().getValue("qty", rowIndex); BigDecimal qty = (BigDecimal) this.getModel().getValue("qty", rowIndex);
this.getModel().setValue("amount", pricenew.multiply(qty), rowIndex); this.getModel().setValue("amount", pricenew.multiply(qty), rowIndex);
} }
protected void resourceItemChanged(Object newValue, int rowIndex) { protected void resourceItemChanged(Object newValue, int rowIndex) {
if (newValue != null) { if (newValue != null) {
DynamicObject resourceItem = (DynamicObject)newValue; DynamicObject resourceItem = (DynamicObject) newValue;
String costType = CostTypeUtils.getCostType(resourceItem); String costType = CostTypeUtils.getCostType(resourceItem);
this.getModel().setValue("costitem", costType, rowIndex); this.getModel().setValue("costitem", costType, rowIndex);
} }
@ -662,9 +662,9 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void pdamountChanged(Object oldValue, Object newValue, int rowIndex) { protected void pdamountChanged(Object oldValue, Object newValue, int rowIndex) {
boolean isimport = "true".equals(TypeUtils.nullToString((String)this.getView().getFormShowParameter().getCustomParam("isimport"))); boolean isimport = "true".equals(TypeUtils.nullToString((String) this.getView().getFormShowParameter().getCustomParam("isimport")));
boolean isdeletesubentry = "true".equals(TypeUtils.nullToString((String)this.getView().getFormShowParameter().getCustomParam("isdeletesubentry"))); boolean isdeletesubentry = "true".equals(TypeUtils.nullToString((String) this.getView().getFormShowParameter().getCustomParam("isdeletesubentry")));
boolean isPdamountChange = "true".equals(TypeUtils.nullToString((String)this.getView().getFormShowParameter().getCustomParam("isPdamountChange"))); boolean isPdamountChange = "true".equals(TypeUtils.nullToString((String) this.getView().getFormShowParameter().getCustomParam("isPdamountChange")));
if (!isimport && !isdeletesubentry && !isPdamountChange) { if (!isimport && !isdeletesubentry && !isPdamountChange) {
this.getView().getFormShowParameter().setCustomParam("isPdamountChange", "true"); this.getView().getFormShowParameter().setCustomParam("isPdamountChange", "true");
DynamicObject row = this.getModel().getEntryRowEntity("treeentryentity", rowIndex); DynamicObject row = this.getModel().getEntryRowEntity("treeentryentity", rowIndex);
@ -685,12 +685,12 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void setSubEntrySumAmount() { protected void setSubEntrySumAmount() {
SubEntryGrid subentryGrid = (SubEntryGrid)this.getView().getControl("subentryentity"); SubEntryGrid subentryGrid = (SubEntryGrid) this.getView().getControl("subentryentity");
int rowcount = this.getModel().getEntryRowCount("subentryentity"); int rowcount = this.getModel().getEntryRowCount("subentryentity");
BigDecimal totalSubAmount = BigDecimal.ZERO; BigDecimal totalSubAmount = BigDecimal.ZERO;
for(int i = 0; i < rowcount; ++i) { for (int i = 0; i < rowcount; ++i) {
BigDecimal subEntryAmount = (BigDecimal)this.getModel().getValue("amount", i); BigDecimal subEntryAmount = (BigDecimal) this.getModel().getValue("amount", i);
totalSubAmount = EcNumberHelper.add(totalSubAmount, subEntryAmount); totalSubAmount = EcNumberHelper.add(totalSubAmount, subEntryAmount);
} }
@ -703,10 +703,10 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
protected void setSumToRow(String tbl, String[] cols) { protected void setSumToRow(String tbl, String[] cols) {
if (null != tbl && !"".equals(tbl)) { if (null != tbl && !"".equals(tbl)) {
EntryGrid treeEntry = (EntryGrid)this.getView().getControl(tbl); EntryGrid treeEntry = (EntryGrid) this.getView().getControl(tbl);
Map<String, String> floatButtomData = new HashMap(16); Map<String, String> floatButtomData = new HashMap(16);
for(int i = 0; i < cols.length; ++i) { for (int i = 0; i < cols.length; ++i) {
floatButtomData.put(cols[i], (String) null); floatButtomData.put(cols[i], (String) null);
} }
@ -714,8 +714,8 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
Set<String> setKey = mapSum.keySet(); Set<String> setKey = mapSum.keySet();
Iterator<String> iter = setKey.iterator(); Iterator<String> iter = setKey.iterator();
while(iter.hasNext()) { while (iter.hasNext()) {
String str = (String)iter.next(); String str = (String) iter.next();
DynamicObject currency = this.getModel().getDataEntity().getDynamicObject("currency"); DynamicObject currency = this.getModel().getDataEntity().getDynamicObject("currency");
floatButtomData.put(str, CurrencyFormatUtil.getAfterFormatString(currency, mapSum.get(str))); floatButtomData.put(str, CurrencyFormatUtil.getAfterFormatString(currency, mapSum.get(str)));
} }
@ -730,10 +730,10 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
int tblLength = this.getModel().getEntryRowCount(tbl); int tblLength = this.getModel().getEntryRowCount(tbl);
int colLength = cols.length; int colLength = cols.length;
for(int i = 0; i < tblLength; ++i) { for (int i = 0; i < tblLength; ++i) {
DynamicObject row = this.getModel().getEntryRowEntity(tbl, i); DynamicObject row = this.getModel().getEntryRowEntity(tbl, i);
if (row.get("isleaf") != null && Boolean.TRUE.equals(Boolean.valueOf(row.get("isleaf").toString()))) { if (row.get("isleaf") != null && Boolean.TRUE.equals(Boolean.valueOf(row.get("isleaf").toString()))) {
for(int j = 0; j < colLength; ++j) { for (int j = 0; j < colLength; ++j) {
if (row.get(cols[j]) != null) { if (row.get(cols[j]) != null) {
Object obj = EcNumberHelper.toBigDecimal(mapSum.get(cols[j])); Object obj = EcNumberHelper.toBigDecimal(mapSum.get(cols[j]));
Object dec = EcNumberHelper.toBigDecimal(row.get(cols[j])); Object dec = EcNumberHelper.toBigDecimal(row.get(cols[j]));
@ -752,7 +752,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
public void beforeDoOperation(BeforeDoOperationEventArgs beforedooperationeventargs) { public void beforeDoOperation(BeforeDoOperationEventArgs beforedooperationeventargs) {
super.beforeDoOperation(beforedooperationeventargs); super.beforeDoOperation(beforedooperationeventargs);
FormOperate formOperate = (FormOperate)beforedooperationeventargs.getSource(); FormOperate formOperate = (FormOperate) beforedooperationeventargs.getSource();
String key = formOperate.getOperateKey(); String key = formOperate.getOperateKey();
if ("newsubentry".equals(key)) { if ("newsubentry".equals(key)) {
this.beforeNewSubEntry(beforedooperationeventargs); this.beforeNewSubEntry(beforedooperationeventargs);
@ -784,7 +784,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void doShowBudget() { protected void doShowBudget() {
DynamicObject project = (DynamicObject)this.getModel().getValue("project"); DynamicObject project = (DynamicObject) this.getModel().getValue("project");
boolean isUnitProject = CBSBudgetUtil.projectIsUnit(project); boolean isUnitProject = CBSBudgetUtil.projectIsUnit(project);
if (isUnitProject && this.getModel().getValue("unitproject") == null) { if (isUnitProject && this.getModel().getValue("unitproject") == null) {
this.getView().showMessage(ResManager.loadKDString("单位工程未录入", "AimcostcbsbillEditUI_14", "ec-ecco-formplugin", new Object[0])); this.getView().showMessage(ResManager.loadKDString("单位工程未录入", "AimcostcbsbillEditUI_14", "ec-ecco-formplugin", new Object[0]));
@ -814,9 +814,9 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
this.getView().showTipNotification(ResManager.loadKDString("编码不能为空。", "AimcostcbsbillEditUI_3", "ec-ecco-formplugin", new Object[0])); this.getView().showTipNotification(ResManager.loadKDString("编码不能为空。", "AimcostcbsbillEditUI_3", "ec-ecco-formplugin", new Object[0]));
beforedooperationeventargs.setCancel(true); beforedooperationeventargs.setCancel(true);
} else { } else {
boolean editOnUnit = (Boolean)this.getModel().getValue("editonunit"); boolean editOnUnit = (Boolean) this.getModel().getValue("editonunit");
DynamicObject project = (DynamicObject)this.getModel().getValue("project"); DynamicObject project = (DynamicObject) this.getModel().getValue("project");
DynamicObject unitProject = (DynamicObject)this.getModel().getValue("unitproject"); DynamicObject unitProject = (DynamicObject) this.getModel().getValue("unitproject");
if (editOnUnit && unitProject == null) { if (editOnUnit && unitProject == null) {
this.getView().showTipNotification(ResManager.loadKDString("请填写“单位工程”字段。", "AimcostcbsbillEditUI_0", "ec-ecco-formplugin", new Object[0])); this.getView().showTipNotification(ResManager.loadKDString("请填写“单位工程”字段。", "AimcostcbsbillEditUI_0", "ec-ecco-formplugin", new Object[0]));
beforedooperationeventargs.setCancel(true); beforedooperationeventargs.setCancel(true);
@ -841,17 +841,17 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
// beforedooperationeventargs.setCancel(true); // beforedooperationeventargs.setCancel(true);
// } // }
List<Object> graySubEntryIds = (List)EcSerializeHelper.unserialize(this.getPageCache().get("subentry_grayids")); List<Object> graySubEntryIds = (List) EcSerializeHelper.unserialize(this.getPageCache().get("subentry_grayids"));
if (graySubEntryIds != null && !graySubEntryIds.isEmpty()) { if (graySubEntryIds != null && !graySubEntryIds.isEmpty()) {
DynamicObjectCollection entryEntity = this.getModel().getEntryEntity("treeentryentity"); DynamicObjectCollection entryEntity = this.getModel().getEntryEntity("treeentryentity");
int entryRow = 0; int entryRow = 0;
for(Iterator var12 = entryEntity.iterator(); var12.hasNext(); ++entryRow) { for (Iterator var12 = entryEntity.iterator(); var12.hasNext(); ++entryRow) {
DynamicObject entry = (DynamicObject)var12.next(); DynamicObject entry = (DynamicObject) var12.next();
Iterator var14 = entry.getDynamicObjectCollection("subentryentity").iterator(); Iterator var14 = entry.getDynamicObjectCollection("subentryentity").iterator();
while(var14.hasNext()) { while (var14.hasNext()) {
DynamicObject subEntry = (DynamicObject)var14.next(); DynamicObject subEntry = (DynamicObject) var14.next();
if (!graySubEntryIds.contains(subEntry.getPkValue())) { if (!graySubEntryIds.contains(subEntry.getPkValue())) {
boolean isCancel = false; boolean isCancel = false;
StringBuilder errorMessage = new StringBuilder(String.format(ResManager.loadKDString("请填写第%s行项目CBS对应预算成本清单分录的非灰色行", "AimcostcbsbillEditUI_6", "ec-ecco-formplugin", new Object[0]), entryRow + 1)); StringBuilder errorMessage = new StringBuilder(String.format(ResManager.loadKDString("请填写第%s行项目CBS对应预算成本清单分录的非灰色行", "AimcostcbsbillEditUI_6", "ec-ecco-formplugin", new Object[0]), entryRow + 1));
@ -889,7 +889,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void beforeDoNew() { protected void beforeDoNew() {
DynamicObject project = (DynamicObject)this.getModel().getValue("project"); DynamicObject project = (DynamicObject) this.getModel().getValue("project");
if (project != null) { if (project != null) {
this.getView().getFormShowParameter().setCustomParam("projectId", project.getPkValue()); this.getView().getFormShowParameter().setCustomParam("projectId", project.getPkValue());
} }
@ -897,12 +897,12 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void deleteSubRows() { protected void deleteSubRows() {
List<Object> graySubEntryIds = (List)EcSerializeHelper.unserialize(this.getPageCache().get("subentry_grayids")); List<Object> graySubEntryIds = (List) EcSerializeHelper.unserialize(this.getPageCache().get("subentry_grayids"));
if (graySubEntryIds == null) { if (graySubEntryIds == null) {
graySubEntryIds = new ArrayList(10); graySubEntryIds = new ArrayList(10);
} }
SubEntryGrid subentryGrid = (SubEntryGrid)this.getView().getControl("subentryentity"); SubEntryGrid subentryGrid = (SubEntryGrid) this.getView().getControl("subentryentity");
int[] selectrows = subentryGrid.getSelectRows(); int[] selectrows = subentryGrid.getSelectRows();
if (selectrows.length > 0) { if (selectrows.length > 0) {
if (this.isAdjust()) { if (this.isAdjust()) {
@ -910,7 +910,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
List<Integer> shijideleterows = new ArrayList(10); List<Integer> shijideleterows = new ArrayList(10);
BigDecimal subAmount = BigDecimal.ZERO; BigDecimal subAmount = BigDecimal.ZERO;
for(int i = 0; i < selectrows.length; ++i) { for (int i = 0; i < selectrows.length; ++i) {
if (this.getModel().getValue("amount", selectrows[i]) != null) { if (this.getModel().getValue("amount", selectrows[i]) != null) {
subAmount = EcNumberHelper.add(subAmount, this.getModel().getValue("amount", selectrows[i])); subAmount = EcNumberHelper.add(subAmount, this.getModel().getValue("amount", selectrows[i]));
} }
@ -920,7 +920,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
this.getModel().setValue("qty", BigDecimal.ZERO, selectrows[i]); this.getModel().setValue("qty", BigDecimal.ZERO, selectrows[i]);
this.getModel().setValue("amount", BigDecimal.ZERO, selectrows[i]); this.getModel().setValue("amount", BigDecimal.ZERO, selectrows[i]);
Object pkValue = this.getModel().getEntryRowEntity("subentryentity", selectrows[i]).getPkValue(); Object pkValue = this.getModel().getEntryRowEntity("subentryentity", selectrows[i]).getPkValue();
((List)graySubEntryIds).add(pkValue); ((List) graySubEntryIds).add(pkValue);
} else { } else {
shijideleterows.add(selectrows[i]); shijideleterows.add(selectrows[i]);
} }
@ -929,14 +929,14 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
this.getView().updateView("subentryentity"); this.getView().updateView("subentryentity");
int[] deleteRows = new int[shijideleterows.size()]; int[] deleteRows = new int[shijideleterows.size()];
for(int j = shijideleterows.size() - 1; j >= 0; --j) { for (int j = shijideleterows.size() - 1; j >= 0; --j) {
deleteRows[j] = (Integer)shijideleterows.get(j); deleteRows[j] = (Integer) shijideleterows.get(j);
} }
this.getModel().deleteEntryRows("subentryentity", deleteRows); this.getModel().deleteEntryRows("subentryentity", deleteRows);
this.getView().updateView("subentryentity"); this.getView().updateView("subentryentity");
this.setsubEntryColor(); this.setsubEntryColor();
EntryGrid treeEntry = (EntryGrid)this.getView().getControl("treeentryentity"); EntryGrid treeEntry = (EntryGrid) this.getView().getControl("treeentryentity");
int[] treeEntrySelectedRows = treeEntry.getSelectRows(); int[] treeEntrySelectedRows = treeEntry.getSelectRows();
if (treeEntrySelectedRows.length > 0) { if (treeEntrySelectedRows.length > 0) {
this.getView().updateView("treeentryentity"); this.getView().updateView("treeentryentity");
@ -961,14 +961,14 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
BigDecimal subAmount = BigDecimal.ZERO; BigDecimal subAmount = BigDecimal.ZERO;
int parentRowIndex; int parentRowIndex;
for(parentRowIndex = 0; parentRowIndex < selectrows.length; ++parentRowIndex) { for (parentRowIndex = 0; parentRowIndex < selectrows.length; ++parentRowIndex) {
if (this.getModel().getValue("amount", selectrows[parentRowIndex]) != null) { if (this.getModel().getValue("amount", selectrows[parentRowIndex]) != null) {
subAmount = EcNumberHelper.add(subAmount, this.getModel().getValue("amount", selectrows[parentRowIndex])); subAmount = EcNumberHelper.add(subAmount, this.getModel().getValue("amount", selectrows[parentRowIndex]));
} }
} }
parentRowIndex = this.getModel().getEntryCurrentRowIndex("treeentryentity"); parentRowIndex = this.getModel().getEntryCurrentRowIndex("treeentryentity");
EntryGrid treeEntry = (EntryGrid)this.getView().getControl("treeentryentity"); EntryGrid treeEntry = (EntryGrid) this.getView().getControl("treeentryentity");
if (parentRowIndex >= 0) { if (parentRowIndex >= 0) {
BigDecimal cbsOldAmount = EcNumberHelper.toBigDecimal(this.getModel().getValue("pdamount", parentRowIndex)); BigDecimal cbsOldAmount = EcNumberHelper.toBigDecimal(this.getModel().getValue("pdamount", parentRowIndex));
this.getModel().setValue("pdamount", EcNumberHelper.subtract(cbsOldAmount, subAmount), parentRowIndex); this.getModel().setValue("pdamount", EcNumberHelper.subtract(cbsOldAmount, subAmount), parentRowIndex);
@ -984,7 +984,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void beforeNewSubEntry(BeforeDoOperationEventArgs beforedooperationeventargs) { protected void beforeNewSubEntry(BeforeDoOperationEventArgs beforedooperationeventargs) {
TreeEntryGrid grid = (TreeEntryGrid)this.getControl("treeentryentity"); TreeEntryGrid grid = (TreeEntryGrid) this.getControl("treeentryentity");
int[] selectrow = grid.getSelectRows(); int[] selectrow = grid.getSelectRows();
if (selectrow.length > 0) { if (selectrow.length > 0) {
boolean isdelete = "true".equals(TypeUtils.nullToString(this.getModel().getValue("isdelete", selectrow[0]))); boolean isdelete = "true".equals(TypeUtils.nullToString(this.getModel().getValue("isdelete", selectrow[0])));
@ -1007,7 +1007,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) { public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
super.afterDoOperation(afterDoOperationEventArgs); super.afterDoOperation(afterDoOperationEventArgs);
FormOperate formOperate = (FormOperate)afterDoOperationEventArgs.getSource(); FormOperate formOperate = (FormOperate) afterDoOperationEventArgs.getSource();
String key = formOperate.getOperateKey(); String key = formOperate.getOperateKey();
if ("newsubentry".equals(key)) { if ("newsubentry".equals(key)) {
this.afterNewSubEntry(); this.afterNewSubEntry();
@ -1022,14 +1022,14 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void doFoldAll(boolean isFold) { protected void doFoldAll(boolean isFold) {
TreeEntryGrid treeGrid = (TreeEntryGrid)this.getControl("treeentryentity"); TreeEntryGrid treeGrid = (TreeEntryGrid) this.getControl("treeentryentity");
treeGrid.setCollapse(isFold); treeGrid.setCollapse(isFold);
} }
protected void afterDeleteSubEntry() { protected void afterDeleteSubEntry() {
int subRowcount = this.getModel().getEntryRowCount("subentryentity"); int subRowcount = this.getModel().getEntryRowCount("subentryentity");
if (subRowcount == 0) { if (subRowcount == 0) {
TreeEntryGrid grid = (TreeEntryGrid)this.getControl("treeentryentity"); TreeEntryGrid grid = (TreeEntryGrid) this.getControl("treeentryentity");
int[] selectrow = grid.getSelectRows(); int[] selectrow = grid.getSelectRows();
if (selectrow.length > 0) { if (selectrow.length > 0) {
DynamicObject entryRowEntity = this.getModel().getEntryRowEntity("treeentryentity", selectrow[0]); DynamicObject entryRowEntity = this.getModel().getEntryRowEntity("treeentryentity", selectrow[0]);
@ -1057,11 +1057,11 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
RowDataEntity[] var4 = rowDataEntities; RowDataEntity[] var4 = rowDataEntities;
int var5 = rowDataEntities.length; int var5 = rowDataEntities.length;
for(int var6 = 0; var6 < var5; ++var6) { for (int var6 = 0; var6 < var5; ++var6) {
RowDataEntity rowDataEntity = var4[var6]; RowDataEntity rowDataEntity = var4[var6];
int rowIndex = rowDataEntity.getRowIndex(); int rowIndex = rowDataEntity.getRowIndex();
int parentRowIndex = rowDataEntity.getParentRowIndex(); int parentRowIndex = rowDataEntity.getParentRowIndex();
DynamicObject parentCbs = (DynamicObject)this.getModel().getValue("cbs", parentRowIndex); DynamicObject parentCbs = (DynamicObject) this.getModel().getValue("cbs", parentRowIndex);
this.getModel().setValue("cbsre", parentCbs, rowIndex, parentRowIndex); this.getModel().setValue("cbsre", parentCbs, rowIndex, parentRowIndex);
} }
} }
@ -1070,7 +1070,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
protected void afterNewSubEntry() { protected void afterNewSubEntry() {
ORM orm = ORM.create(); ORM orm = ORM.create();
TreeEntryGrid grid = (TreeEntryGrid)this.getControl("treeentryentity"); TreeEntryGrid grid = (TreeEntryGrid) this.getControl("treeentryentity");
int[] selectrow = grid.getSelectRows(); int[] selectrow = grid.getSelectRows();
if (selectrow.length > 0) { if (selectrow.length > 0) {
boolean isGua = "true".equals(TypeUtils.nullToString(this.getModel().getValue("isgua", selectrow[0]))); boolean isGua = "true".equals(TypeUtils.nullToString(this.getModel().getValue("isgua", selectrow[0])));
@ -1085,7 +1085,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
int rowcount = this.getModel().getEntryRowCount("subentryentity"); int rowcount = this.getModel().getEntryRowCount("subentryentity");
for(int i = 0; i < rowcount; ++i) { for (int i = 0; i < rowcount; ++i) {
DynamicObject subEntity = this.getModel().getEntryRowEntity("subentryentity", i); DynamicObject subEntity = this.getModel().getEntryRowEntity("subentryentity", i);
if (subEntity.get("id") == null || subEntity.getLong("id") == 0L) { if (subEntity.get("id") == null || subEntity.getLong("id") == 0L) {
subEntity.set("id", orm.genLongId(subEntity.getDataEntityType())); subEntity.set("id", orm.genLongId(subEntity.getDataEntityType()));
@ -1107,10 +1107,10 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
if (messageBoxClosedEvent.getResult().equals(MessageBoxResult.Yes)) { if (messageBoxClosedEvent.getResult().equals(MessageBoxResult.Yes)) {
DynamicObjectCollection subentryColl = this.getModel().getEntryEntity("subentryentity"); DynamicObjectCollection subentryColl = this.getModel().getEntryEntity("subentryentity");
for(int i = 0; i < subentryColl.size(); ++i) { for (int i = 0; i < subentryColl.size(); ++i) {
DynamicObject subEntry = (DynamicObject)subentryColl.get(i); DynamicObject subEntry = (DynamicObject) subentryColl.get(i);
if (subEntry.get("projectboq") != null) { if (subEntry.get("projectboq") != null) {
subEntry.set("projectboq", (Object)null); subEntry.set("projectboq", (Object) null);
} }
} }
@ -1126,7 +1126,7 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B
} }
protected void setParentAmount(String table, String colname, int rowIndex, String parentId, BigDecimal oldAmount, BigDecimal newAmount) { protected void setParentAmount(String table, String colname, int rowIndex, String parentId, BigDecimal oldAmount, BigDecimal newAmount) {
for(int i = rowIndex - 1; i >= 0; --i) { for (int i = rowIndex - 1; i >= 0; --i) {
String parent = this.getModel().getEntryRowEntity(table, i).get("id").toString(); String parent = this.getModel().getEntryRowEntity(table, i).get("id").toString();
if (parent.equals(parentId)) { if (parent.equals(parentId)) {
if (oldAmount == null) { if (oldAmount == null) {