EAS bos单据方法记录

 

 

1、设置序时簿背景颜色

    @Override
    protected void afterTableFillData(KDTDataRequestEvent e) {
    	// TODO Auto-generated method stub
    	super.afterTableFillData(e);
    	
    	for(int i = e.getFirstRow();i<=e.getLastRow();i++){
    		 IRow row = tblMain.getRow(i);
    		 ICell cell = row.getCell("bizDate");
    	     Boolean fivouchered = (Boolean) row.getCell("Fivouchered").getValue();
    		 Date bizDate = (Date) cell.getValue();
    		 row.getCell("bizDate");
    		 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
    		 try {
				Date parse = simpleDateFormat.parse("2021-01-30");
				if(bizDate.compareTo(parse)<=0){
					if(!fivouchered){
						row.getCell("Fivouchered").getStyleAttributes().setBackground(Color.gray);
					}
				}
			} catch (ParseException e1) {
				e1.printStackTrace();
			}
    		 
    	}
    	
    }

2、设置序时簿显示 不忽略0

	protected IQueryExecutor getQueryExecutor(IMetaDataPK pk,
			EntityViewInfo viewInfo) {
		IQueryExecutor queryExecutor = super.getQueryExecutor(pk, viewInfo);
		queryExecutor.option().isAutoIgnoreZero = false; // 不自动忽略数值零
		return queryExecutor;
	}

3、编辑界面分录表格点击事件

	@Override
	protected void kdtEntrys2_tableClicked(KDTMouseEvent e) throws Exception {
		 if(prmtcustomer.getValue() == null)throw new EASBizException(new NumericExceptionSubItem("0002","请先选择客户"));
	} 

 4、编辑界面页面全屏

super.onLoad();
		  Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		  setPreferredSize(new Dimension(screenSize.width-450,screenSize.height-300));

5、字段设置颜色

	 this.txtinvoicedAmt.setCustomForegroundColor( Color.red);

6、分录设置标题

this.kdtEntrys_detailPanel.setTitle("发票");  

7、刷新单据的序时簿界面   刷新编辑界面

//		     disposeUIWindow();
		     Object uiObj = this.getUIContext().get(UIContext.OWNER); // 刷新序时薄界面
				if (uiObj != null && uiObj instanceof HWReqBillListUI) {
					((HWReqBillListUI) uiObj).refreshList();
				}

this.setDataObject(getValue(new ObjectUuidPK(editData.getId()))); // 刷新该编辑界面

8、分录编辑F7  编辑结束事件

protected void kdtEntrys2_editStopped(KDTEditEvent e)

9、分录的f7过滤

	CustomerInfo customerInfo = (CustomerInfo) this.prmtcustomer.getValue();
		KDBizPromptBox prmtHfPerson = (KDBizPromptBox) kdtEntrys2.getColumn("TempInWarehsBill").getEditor().getComponent(); //获取表格特定列绑定的F7
		EntityViewInfo view = new EntityViewInfo();
		prmtHfPerson.setQueryInfo("com.kingdee.eas.wastedisposal.hwd.app.TempInWarehsBilChooseQuery");
		 FilterInfo filter = new FilterInfo(); //过滤条件
		filter.getFilterItems().add(new FilterItemInfo("customer.id", customerInfo.getId())); //条件1,#0
		//filter.getFilterItems().add(new FilterItemInfo("status", BizStatusEnum.NORMAL_VALUE)); //条件2,#1
		//filter.getFilterItems().add(new FilterItemInfo("status", BizStatusEnum.FROZEN_VALUE)); //条件3,#2
		//filter.setMaskString("#0 and (#1 or #2)"); //3个过滤条件设定关系
		view.setFilter(filter); 
		prmtHfPerson.setEntityViewInfo(view); //F7重新设定视图

10、分录字段设置小数显示位数、设置锁定

 	kdtEntrys.getColumn("price").getStyleAttributes().setNumberFormat("#,##0.##########"); 
		kdtEntrys.getColumn("taxPrice").getStyleAttributes().setNumberFormat("#,##0.##########"); 
  kdtEntrys.getColumn("amount").getStyleAttributes().setLocked(false);
			  kdtEntrys.getColumn("taxAmount").getStyleAttributes().setLocked(false);
			  kdtEntrys.getColumn("invoicedAmt").getStyleAttributes().setLocked(false);

11、bean方法中处理凭证反写

   @Override
	   protected void _reverseSave(Context ctx, IObjectPK srcBillPK,
	   		IObjectValue srcBillVO, BOTBillOperStateEnum billOperStateEnum,
	   		IObjectValue relationInfo) throws BOSException, EASBizException {
	   	   reverseSave(ctx, srcBillPK, srcBillVO, billOperStateEnum, relationInfo);
	   	 super._reverseSave(ctx, srcBillPK, srcBillVO, billOperStateEnum, relationInfo);
	   }
	       
	      
	      
	      public static void reverseSave(Context ctx, IObjectPK srcBillPK, IObjectValue srcBillVO, BOTBillOperStateEnum bOTBillOperStateEnum, IObjectValue bOTRelationInfo) throws BOSException, EASBizException {
	   		BOTRelationInfo relation = (BOTRelationInfo) bOTRelationInfo;
	   		BOSObjectType bosType = BOSUuid.read(relation.getDestObjectID()).getType();
	   		if (bosType.equals((new VoucherInfo()).getBOSType())) {
	   			CoreBillBaseInfo model = (CoreBillBaseInfo) srcBillVO;
	   			// 删除凭证
	   			if (bOTBillOperStateEnum.equals(BOTBillOperStateEnum.DELETE)) {
	   				//model.put(FLD_FIVOUCHERED, new Integer(0));
	   				// 以下设置单据的凭证信息
	   				model.put("VOUCHERNUMBER", null);
	   				//model.put(FLD_VOUCHERDATE, null);
	   			}
	   			// 生成凭证
	   			else {
	   				String voucherID = relation.getDestObjectID();
	   				VoucherInfo voucherInfo = (VoucherInfo) VoucherFactory.getLocalInstance(ctx).getValue(new ObjectStringPK(voucherID));
	   				 //model.put(FLD_FIVOUCHERED, voucherInfo.getNumber() );
	   				// 以下设置单据的凭证信息
	   				  model.put("VOUCHERNUMBER", voucherInfo.getNumber());
	   				// model.put(FLD_VOUCHERDATE, voucherInfo.getBookedDate());
	   			}
	   			BOSObjectType bosObjectType = srcBillVO.getBOSType();
	   			ICoreBillBase iCoreBillBase = (ICoreBillBase) BOSObjectFactory.createBOSObject(ctx, bosObjectType);
	   			iCoreBillBase.reverseSave(srcBillPK, (CoreBillBaseInfo) srcBillVO);
	   		}
	   	}

12、序时簿设置字段精度显示

 	  this.tblMain.getColumn("entrys.noTaxPrice").getStyleAttributes().setNumberFormat("0.########"); 
this.tblMain.getColumn("entrys.noTaxPrice").setWidth(160);

13、标准F7 比如物料 客户 供应商 实现

职员两种效果

    HashMap map = new HashMap();
	    map.put(PersonF7UI.ALL_ADMIN, "YES");
	    map.put(PersonF7UI.DEFAULT_SHOW_ALL, "YES");
	    prmtbusinessManager.setSelector(new PersonPromptBox(null, map));
		
	//第二种    
	    prmtbusinessManager.setQueryInfo("com.kingdee.eas.basedata.person.app.F7PersonQuery");  
	    FIPersonPromptBox personf7 = new FIPersonPromptBox(this);  
	    prmtbusinessManager.setSelector(personf7); 

//第三种
 prmtfirstParty.setHasCUDefaultFilter(true);
 
  FIPersonPromptBox personf7 = new FIPersonPromptBox(this);  
   prmtbusinessManager.setSelector(personf7); 
F7 专用选择界面的设置
public void setF7Selector() throws Exception 
{ 
KDBizPromptBox bizPromptBox = new KDBizPromptBox();// 
CoreUIObject ui = null;// 父界面对象
CompanyOrgUnitInfo companyInfo = null; // 当前财务组织
// 客户
bizPromptBox.setSelector(new GeneralKDPromptSelectorAdaptor(bizPromptBox, new 
F7CustomerTreeDetailListUI(), ui)); 
// 供应商
bizPromptBox.setSelector(new GeneralKDPromptSelectorAdaptor(bizPromptBox, new 
F7SupplierTreeDetailListUI(), ui)); 
// 物料
bizPromptBox.setSelector(new GeneralKDPromptSelectorAdaptor(bizPromptBox, new 
F7MaterialTreeListUI(), ui)); 
// 职员
HashMap map = new HashMap(); 
map.put(PersonF7UI.ALL_ADMIN, "YES"); 
bizPromptBox.setSelector(new PersonPromptBox(ui, map)); 
// 公司
CompanyF7 org = new CompanyF7(ui); 
org.setRootUnitID(""); 
bizPromptBox.setSelector(new CompanyF7(ui)); 
// 成本中心
bizPromptBox.setSelector(new CostCenterF7(ui)); 
// 行政组织
bizPromptBox.setSelector(new AdminF7(ui)); 
// 采购组织
bizPromptBox.setSelector(new PurchaseF7(ui)); 
// 库存组织
bizPromptBox.setSelector(new StorageF7(ui)); 
// 销售组织
bizPromptBox.setSelector(new SaleF7(ui)); 
// 利润中心组织
bizPromptBox.setSelector(new ProfitCenterF7(ui)); 
final KDBizPromptBox objPrmt = new KDBizPromptBox();  
 F7BaseSelector selector = null;//new F7BaseSelector(this, null, objPrmt);  
 objPrmt.setVisible(true);  
 objPrmt.setEditable(true);  
         objPrmt.setEditFormat("$number$");  
         objPrmt.setCommitFormat("$number$;$name$");  
         objPrmt.setDisplayFormat("$name$");            
 if(tblName.equalsIgnoreCase("T_BD_Customer")){//客户  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.master.cssp.app.F7CustomerQuery");  
 selector = new F7CustomerSimpleSelector(this, objPrmt);  
 objPrmt.setSelector(selector);  
 }else if(tblName.equalsIgnoreCase("T_BD_Supplier")){//供应商  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.master.cssp.app.F7SupplierQuery");  
 selector = new F7SupplierSimpleSelector(this, objPrmt);    
 objPrmt.setSelector(selector);  
 }else if(tblName.equalsIgnoreCase("T_BD_AccountBanks")){//银行帐户  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.assistant.app.F7AccountBankQuery");  
 }else if(tblName.equalsIgnoreCase("T_ORG_Company")){//公司  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.org.app.CompanyQuery");  
 }else if(tblName.equalsIgnoreCase("T_BD_Material")){//物料  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.master.material.app.F7MaterialBaseInfoQuery");  
 }else if(tblName.equalsIgnoreCase("T_BD_Person")){//职员  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.person.app.F7PersonQuery");  
 FIPersonPromptBox personf7 = new FIPersonPromptBox(this);  
 objPrmt.setSelector(personf7);  
 }else if(tblName.equalsIgnoreCase("T_ORG_CostCenter")){//成本中心  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.org.app.CostCenterOrgUnitQuery4AsstAcct");  
 }else if(tblName.equalsIgnoreCase("T_BD_Project")){//项目  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.assistant.app.F7ProjectQuery");  
 }else if(tblName.equalsIgnoreCase("T_BD_GeneralAsstActType")){//自定义核算项     
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.master.auxacct.app.F7GeneralAsstActTypeQuery");  
 AuxAccountUtils.assignGeneralBizPromptBox(objPrmt, grp.getId().toString(), true, this);  
 //GLf7Utils.assignSelector(objPrmt, grp, aat.getHgAttribute(), at.isForCompany(), false, null, this, at.isUseLongNumber());  
 }else {//其他  
   
 }

14、F7控件设置cu过滤

	 prmtfirstParty.setHasCUDefaultFilter(true);

15、获取分录合计

	IRow footRow = kdtEntrys.getFootManager().getFootRow(0);
		BigDecimal amount = new BigDecimal(footRow.getCell("amount").getValue().toString());
		BigDecimal qty = new BigDecimal(footRow.getCell("qty").getValue().toString());

16、查询扩展报表的发布路径


select * from t_bas_definereport where fname_l2 like '%低%'

17、数据库插入web菜单

  // 客户话菜单
      geninsert  select * from T_PM_MainMenuItem where  FName_L2='自定义项目'
     
     //web菜单
      geninsert select  * from T_JP_Page   where  FID='18581f64-696f-4975-81cd-410991d6c5d1'

18、F7弹框界面 银行账号脱敏实现  复制标准query修改

( SELECT CONCAT ( CONCAT ( LEFT ( CFBANKACCOUNT , 4 ) , '*******' ) , CONCAT ( '*******' , right ( CFBANKACCOUNT , 4 ) ) ) as bankAccount FROM T_BC_CollectionAccount where CFBANKACCOUNT = #0 )

19、下拉框监听

 @Override
public void onLoad() throws Exception {
	super.onLoad();
    bizTypeListener();
}


/**
  * 下拉列表监听
  * 该方法需放入 onLoad() 方法中
  */
 public void bizTypeListener() {
	bizType.addItemListener(new ItemListener(){
		@Override
		public void itemStateChanged(ItemEvent e) {
			/**
			 * bizType 单据界面下拉列表控件名称
			 * getSelectedItem() 获取下拉列表选中的值
			 * AcpBizType 自定义的枚举类
			 */
			AcpBizType type = (AcpBizType) bizType.getSelectedItem();
		}
	 });
 }

20、EAS BOS 代码隐藏分录列、锁定列、锁定单元格 

kdtEntry.getColumn("unit").getStyleAttributes().setHided(true);//隐藏列
kdtEntry.getColumn("unit").getStyleAttributes().setLocked(true);//锁定列使不可编辑
 
kdtEntry.getCell(rowIndex, "unit").getStyleAttributes().setLocked(true);//锁定单元格
 

21、设置字段必填 及必填背景色

	 txtsettlementAmount.setBackground(new Color(255,255,220)); 
	    	 txtsettlementedAmount.setRequired(true);

22、分录设置必填  及 背景色

	kdtEntrys.getColumn("price").setRequired(true);
			kdtEntrys.getColumn("price").getStyleAttributes().setBackground(new Color(255,255,220));

23、 含税金额  不含税金额  税率计算逻辑


	    //数量  不含税单价    税率   监听
	    if ("qty".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey())|| "price".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey())|| "tax".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey()) ) {
	    	BigDecimal price = kdtEntrys.getCell(rowIndex, "price").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "price").getValue();
	    	BigDecimal qty = kdtEntrys.getCell(rowIndex, "qty").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "qty").getValue();
	    	
	    	//含税单价=不含税价格*(1+税率)
	    	BigDecimal tax = kdtEntrys.getCell(rowIndex, "tax").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "tax").getValue();
	        BigDecimal taxrate = tax.divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP);
	    	BigDecimal taxPrice = price.multiply(new BigDecimal("1").add(taxrate)).setScale(10,BigDecimal.ROUND_HALF_UP);
	    	
	    	//税额=不含税价格*税率*数量
			BigDecimal taxAmt = price.multiply(taxrate).multiply(qty).setScale(2,BigDecimal.ROUND_HALF_UP); 
			
			//含税金额=含税单价*数量
			BigDecimal payment = taxPrice.multiply(qty).setScale(2,BigDecimal.ROUND_HALF_UP);
			
			//不含税金额 =金额-税额
			BigDecimal amt = payment.subtract(taxAmt);
			
			kdtEntrys.getCell(rowIndex, "taxPrice").setValue(taxPrice);
			kdtEntrys.getCell(rowIndex, "taxAmt").setValue(taxAmt);
			kdtEntrys.getCell(rowIndex, "amt").setValue(amt);
			kdtEntrys.getCell(rowIndex, "payment").setValue(payment);
	    }
		
		//数量  含税单价   监听
	    if ("qty".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey())|| "taxPrice".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey()) ) {
	    	BigDecimal taxPrice = kdtEntrys.getCell(rowIndex, "taxPrice").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "taxPrice").getValue();
	    	BigDecimal qty = kdtEntrys.getCell(rowIndex, "qty").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "qty").getValue();
			BigDecimal payment=qty.multiply(taxPrice).setScale(2, BigDecimal.ROUND_HALF_UP);  //开票金额  开票金额=含税单价*数量
			  
			//不含税价格=含税单价/(1+税率)
	    	BigDecimal tax = kdtEntrys.getCell(rowIndex, "tax").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "tax").getValue();
		    BigDecimal taxrate = tax.divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP);
			BigDecimal price=taxPrice.divide (new BigDecimal("1").add(taxrate),10,BigDecimal.ROUND_HALF_UP);
			
			//税额=含税单价/(1+税率)*税率*数量
			//税额=不含税价格*税率*数量
			BigDecimal taxAmt = price.multiply(taxrate).multiply(qty).setScale(2,BigDecimal.ROUND_HALF_UP);
			
			//不含税金额 =金额-税额
			BigDecimal amt = payment.subtract(taxAmt);
		    
			kdtEntrys.getCell(rowIndex, "price").setValue(price);
			kdtEntrys.getCell(rowIndex, "taxAmt").setValue(taxAmt);
			kdtEntrys.getCell(rowIndex, "amt").setValue(amt);
			kdtEntrys.getCell(rowIndex, "payment").setValue(payment);
		 }
		

24、eas里客户端保存,提交里增加校验规则和必填

protected void verifyInput(ActionEvent e) 

25、客户端按钮相关

25.1 代码增加按钮

 

 package com.kingdee.eas.fi.ar.client;

import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.ctrl.swing.KDWorkButton;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.bos.util.BOSUuid;
import com.kingdee.eas.base.permission.UserInfo;
import com.kingdee.eas.base.wssc.BillImageFacadeFactory;
import com.kingdee.eas.basedata.org.CompanyOrgUnitInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.common.client.SysContext;
import com.kingdee.eas.custom.jiahengscm.businessdoc.JhAgreementCollection;
import com.kingdee.eas.custom.jiahengscm.businessdoc.JhAgreementFactory;
import com.kingdee.eas.custom.jiahengscm.businessdoc.PurchasecontractInfo;
import com.kingdee.eas.fi.ar.OtherBillFactory;
import com.kingdee.eas.fi.ar.OtherBillInfo;
import com.kingdee.eas.fi.arap.util.invoice.IncomeInvoiceClientUtils;
import com.kingdee.eas.tm.im.OPTypeEnum;
import com.kingdee.eas.tm.im.PwySettingFactory;
import com.kingdee.eas.tm.im.PwySettingInfo;
import com.kingdee.eas.util.SysUtil;
import com.kingdee.eas.util.client.EASResource;
import com.kingdee.eas.util.client.MsgBox;
import com.kingdee.util.StringUtils;

/**
 * 出纳应收单
 * @author mz
 *
 */
public class OtherBillEditUICTEx   extends   OtherBillEditUI  {

	public OtherBillEditUICTEx() throws Exception {
		super();
	}
	
	
	/**
	 * 初始化工具栏
	 */
	@Override
	public void initUIToolBarLayout() {
		super.initUIToolBarLayout();
		addViewPiaoButton();  
        
	}
 
	
	/**
	 * 添加查看影像按钮
	 */
	private void addViewPiaoButton() {
		KDWorkButton  getdata = new KDWorkButton();
		getdata.setText("查看所有影像"); //按钮名称
		getdata.setIcon(EASResource.getIcon("imgTbtn_showpicture")); //图标
		getdata.setVisible(true); //设置可见
		getdata.setEnabled(true); //设置可用
		getdata.setToolTipText("查看所有影像");//鼠标放上去显示文字描述
		toolBar.add(getdata, 60); //添加到工具栏
		//注册点击事件
		getdata.addActionListener(new ActionListener(){
			@Override
		    public void actionPerformed(ActionEvent e) {
		        try {
	            viewRealionpiao();
		        } catch (Exception ex) {
		        	handUIException(ex);
		        }
		    }

		});
	}
	
	 //查看影像
    public void actionViewPiao_actionPerformed(ActionEvent e) throws Exception {
//    	super.actionViewPiao_actionPerformed(e);
    	if(!isPwySetting()){
    		MsgBox.showInfo("当前公司未对发票云进行配置!");
    		abort();
    	}
	      if ((editData != null) && (editData.getId() != null)) {
	        Map params = new HashMap();
	        params.put("billId", editData.getId().toString());
	        params.put("companyId", editData.getCU().getId().toString());
	        params.put("billNumber", editData.getNumber());
	     //   params.put("invoiceCode", txtinvoiceCode.getText());
	       // params.put("invoiceNumber", txtinvoiceNumber.getText());
	        params.put("isFromAp", Boolean.valueOf(true));
	        params.put("isIntegratedByPWY", true);
	        Map ret = IncomeInvoiceClientUtils.viewInvoiceImage(params);
	        String msg = (String)ret.get("msg");
	        if ((msg != null) && (msg.trim().length() > 0)) {
	          MsgBox.showInfo(msg);
	        }
	      }
    }
25.2  审批界面放出 添加的按钮

public class PurInWarehsBillEditUICTEx     extends  PurInWarehsBillEditUI implements   IWorkflowUISupport  {

	public PurInWarehsBillEditUICTEx() throws Exception {
		super();
		// TODO 自动生成的构造函数存根
	}
 
	
	 
	/**
	 * 
	 */
	@Override
	public IWorkflowUIEnhancement getWorkflowUIEnhancement() {
	    
		  PurInWarehsBillWorkflowUIEnhancement purInWarehsBillWorkflowUIEnhancement = new  PurInWarehsBillWorkflowUIEnhancement();
		  return  purInWarehsBillWorkflowUIEnhancement;
	}
public class PurInWarehsBillWorkflowUIEnhancement  extends DefaultWorkflowUIEnhancement {
	
	
	@Override
	public List getApporveToolButtons(CoreUIObject uiObject) {
		 
		
		PurInWarehsBillEditUI  purInWarehsBillEditUI=(PurInWarehsBillEditUI)uiObject;
		
		KDToolBar uiToolBar = purInWarehsBillEditUI.getUIToolBar();
		 
		ArrayList<KDWorkButton> arrayList = new  ArrayList<KDWorkButton>();
		
		Component[] components = uiToolBar.getComponents();
		for (int i = 0; i < components.length; i++) {
			Component component = components[i];
			    
			 if(  component  instanceof  KDWorkButton  ) {
				 KDWorkButton btn=  (KDWorkButton)component;
				 if(  btn.getText().equalsIgnoreCase("查看影像")) {
					 arrayList.add(btn);
				 }
			 }
		}
		
		return   arrayList ;
	}
	
}

26、建立关联关系代码

	public  void    createRelation(  String  srcObjectID, String  destObjectID, boolean  flag ) throws BOSException {
		  IBOTRelation iBOTRelation = BOTRelationFactory.getRemoteInstance();
		  EntityViewInfo view = new EntityViewInfo();
	      FilterInfo filter = new FilterInfo();
	      filter.getFilterItems().add(new FilterItemInfo("srcObjectID",  srcObjectID, CompareType.EQUALS));
	      filter.getFilterItems().add(new FilterItemInfo("destObjectID", destObjectID, CompareType.EQUALS));
	      view.setFilter(filter);
		  BOTRelationCollection collection = iBOTRelation.getCollection(view);
		  
		 if(flag) {
			  //建立关联关系
			  if(collection.size()>0 ) {
				  iBOTRelation.delete(new ObjectUuidPK(collection.get(0).getId()));
			    }
			  if(collection.size()<=0) {
				   BOTRelationInfo relationInfo = new BOTRelationInfo();
				   relationInfo.setSrcObjectID(srcObjectID);
				   relationInfo.setDestObjectID(destObjectID);
				   relationInfo.setSrcEntityID( BOSUuid.read(srcObjectID).getType().toString());
				   relationInfo.setDestEntityID(BOSUuid.read(destObjectID).getType().toString());
				   relationInfo.setIsEffected(true);
				   relationInfo.setOperatorID("user_存货记账-凭证");
				   iBOTRelation.addnew(relationInfo);
			    }
		 }else {
			  //删除关联关系
			  if(collection.size()>0) {
				  iBOTRelation.delete(new ObjectUuidPK(collection.get(0).getId()));
			   }
		   }
	   }
	

27、序时簿设置 显示表头、分录切换显示

    @Override
    public void onLoad() throws Exception {
           	this.actionImportData.setVisible(true);
          	this.actionImportData.setEnabled(true);
          	this.btn_submit.setEnabled(true);
          	this.menuItemSwitchView.setVisible(true);
          	this.menuItemSwitchView.setEnabled(true);
          	this.menuItemSwitchView.setSelected(true);
          	super.onLoad();
          	List headQueryFields = getHeadQueryFiledNames();
      		String[] headFielNames = new String[headQueryFields.size()];
      		SelectorItemCollection selector2 = this.getMainQuery().getSelector();
      		this.getMainQuery().setSelector(selector2);
      		this.getMainQuery().setRemoveEntry(true);
      		this.getMainTable().putBindContents("mainQuery", headFielNames);
          }
          public List getHeadQueryFiledNames() {
      		List headQueryFields = new ArrayList();
      		try {
      			String[] fieldCollection = getQueryInfo().getHeaderSelectorFields();
      			if (fieldCollection != null) {
      				for (int index = 0; index < fieldCollection.length; ++index) {
      					headQueryFields.add(fieldCollection[index].toUpperCase());
      				}
      			}
      		} catch (Exception e) {
      			logger.error(e);
      		}
      		return headQueryFields;
      	}
      
      

28、分录字段F7 设置显示格式

    KDBizPromptBox kdtEntry_account_PromptBox = new KDBizPromptBox();
	    kdtEntry_account_PromptBox.setQueryInfo("com.kingdee.eas.ma.base.BgAccountQuery");  //设置该F7绑定的查询query
	    kdtEntry_account_PromptBox.setVisible(true);
	    kdtEntry_account_PromptBox.setEditable(true);
	    kdtEntry_account_PromptBox.setDisplayFormat("$number$");
	    kdtEntry_account_PromptBox.setEditFormat("$number$");
	    kdtEntry_account_PromptBox.setCommitFormat("$number$");
	    KDTDefaultCellEditor kdtEntry_account_CellEditor = new KDTDefaultCellEditor(kdtEntry_account_PromptBox);
	    this.kdtEntrys.getColumn("budgetAccount").setEditor(kdtEntry_account_CellEditor);
	    ObjectValueRender kdtEntry_account_OVR = new ObjectValueRender();
	    kdtEntry_account_OVR.setFormat(new BizDataFormat("$number$;$name$"));//实现该功能这行代码是重点
	    this.kdtEntrys.getColumn("budgetAccount").setRenderer(kdtEntry_account_OVR);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值