支出合同继承修改系统代码,添加资源规格型号赋值逻辑
This commit is contained in:
parent
ef611e9932
commit
8bf871646e
|
@ -2,6 +2,10 @@ package zcgj.zcdev.zcdev.pr.plugin.form;
|
|||
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.metadata.IDataEntityProperty;
|
||||
import kd.bos.dataentity.metadata.clr.DataEntityPropertyCollection;
|
||||
import kd.bos.dataentity.metadata.dynamicobject.DynamicObjectType;
|
||||
import kd.bos.dataentity.metadata.dynamicobject.DynamicProperty;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.events.BizDataEventArgs;
|
||||
import kd.bos.entity.datamodel.events.ChangeData;
|
||||
|
@ -11,55 +15,86 @@ import kd.bos.form.control.TreeEntryGrid;
|
|||
import kd.bos.form.field.BasedataEdit;
|
||||
import kd.bos.orm.ORM;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.ec.contract.common.utils.ISVHelper;
|
||||
import kd.ec.contract.formplugin.ContractTreeListingPlugin;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 支出合同继承修改系统代码
|
||||
*/
|
||||
public class ContractTreeListExtPlugin extends ContractTreeListingPlugin {
|
||||
@Override
|
||||
protected void listingShowCloumn(String listModelId) {
|
||||
super.listingShowCloumn(listModelId);
|
||||
Object contractType = this.getModel().getValue("contracttype");
|
||||
if(contractType != null) {
|
||||
Object contractType = this.getModel().getValue("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
DynamicObject dynamicObject = (DynamicObject) contractType;
|
||||
String number = dynamicObject.getString("number");
|
||||
if(number.equals("wzcg01")||number.equals("sbcg")||number.equals("ZCHLX02")) {
|
||||
this.getView().setVisible(false, new String[]{"treecbsnumber", "treecbsname","cbs","isincost"});
|
||||
this.getView().setEnable(false,"isincost");
|
||||
this.getModel().setValue("isincost",false);
|
||||
}else if(number.equals("jjfb")){
|
||||
this.getView().setEnable(false,"isincost");
|
||||
this.getModel().setValue("isincost",true);
|
||||
BasedataEdit basedataEdit = (BasedataEdit)this.getControl("cbs");
|
||||
if (number.equals("jjfb")) {
|
||||
//合同类型-基建分包
|
||||
this.getView().setEnable(false, "isincost");
|
||||
this.getModel().setValue("isincost", true);
|
||||
BasedataEdit basedataEdit = (BasedataEdit) this.getControl("cbs");
|
||||
basedataEdit.setMustInput(false);
|
||||
} else if(number.equals("wzcg01")||number.equals("sbcg")||number.equals("ZCHLX02")) {
|
||||
//合同类型-物资采购类(已禁用)或设备采购或物资采购
|
||||
this.getView().setVisible(false, new String[]{"treecbsnumber", "treecbsname", "cbs", "isincost"});//成本分解结构/成本分解结构名称/项目成本分解结构/计入成本
|
||||
this.getView().setEnable(false, "isincost");//计入成本
|
||||
this.getModel().setValue("isincost", false);//计入成本
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void initTreeListEntry(int rowIndex) {
|
||||
this.getModel().deleteEntryData("treelistentry");
|
||||
DynamicObjectCollection subListEntry = this.getModel().getEntryEntity("sublistentry");
|
||||
DynamicObjectCollection treeListEntry = this.getModel().getEntryEntity("treelistentry");
|
||||
DynamicObjectType dt = treeListEntry.getDynamicObjectType();
|
||||
if (subListEntry != null) {
|
||||
DynamicObjectType subListEntryType = subListEntry.getDynamicObjectType();
|
||||
DataEntityPropertyCollection properties = subListEntryType.getProperties();
|
||||
|
||||
@Override
|
||||
public void afterCreateNewData(EventObject e) {
|
||||
super.afterCreateNewData(e);
|
||||
System.out.println();
|
||||
for(int i = 0; i < subListEntry.size(); ++i) {
|
||||
DynamicObject listing = new DynamicObject(dt);
|
||||
Iterator var9 = properties.iterator();
|
||||
|
||||
while(var9.hasNext()) {
|
||||
IDataEntityProperty property = (IDataEntityProperty)var9.next();
|
||||
String name = property.getName();
|
||||
if (!name.endsWith("_id")) {
|
||||
String treeName = ISVHelper.key2TreeKey(name);
|
||||
DynamicProperty treeProp = dt.getProperty(treeName);
|
||||
if (treeProp != null) {
|
||||
listing.set(treeName, ((DynamicObject)subListEntry.get(i)).get(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String pid = "0";
|
||||
if (((DynamicObject)subListEntry.get(i)).get("listparentid") != null && !"".equals(((DynamicObject)subListEntry.get(i)).get("listparentid"))) {
|
||||
pid = String.valueOf(((DynamicObject)subListEntry.get(i)).get("listparentid"));
|
||||
}
|
||||
|
||||
listing.set("pid", pid);
|
||||
listing.set("id", ((DynamicObject)subListEntry.get(i)).getString("id"));
|
||||
listing.set("zcgj_treeresitemmodel", ((DynamicObject)subListEntry.get(i)).getString("zcgj_treeresitemmodel2"));
|
||||
treeListEntry.add(listing);
|
||||
TreeEntryGrid grid = (TreeEntryGrid)this.getControl("treelistentry");
|
||||
grid.setCollapse(false);
|
||||
}
|
||||
|
||||
this.getModel().updateEntryCache(treeListEntry);
|
||||
this.getView().updateView("treelistentry");
|
||||
this.setTreeEntryGirlSumAmt(rowIndex);
|
||||
}
|
||||
}
|
||||
public void afterBindData(EventObject e) {
|
||||
super.afterBindData(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setView(IFormView formView) {
|
||||
super.setView(formView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createNewData(BizDataEventArgs e) {
|
||||
super.createNewData(e);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
super.initialize();
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
public void propertyChanged(PropertyChangedArgs e) {
|
||||
super.propertyChanged(e);
|
||||
|
|
Loading…
Reference in New Issue