一、第一种 自己插入相关表数据
T_BD_AsstActType //辅助核算项目表
insert into T_BD_AsstActType(FID, FName_L1, FName_L2, FName_L3, FNumber, FDescription_L1, FDescription_L2, FDescription_L3, FSimpleName, FAssistantType, FIsSelfAsstActaiatem, FIsSystemAsstActItem, FRealtionDataObject, FCreatorID, FCreateTime, FLastUpdateUserID, FLastUpdateTime, FDefaultQueryName, FAsstHGAttribute, FMappingFieldName, FIsfreeze, FIsForCompany, FDefaultF7UI, FRealDataObjAlias_L1, FRealDataObjAlias_L2, FRealDataObjAlias_L3, FControlUnitID, FGlAsstActTypeGrpID, FGroupTableName, FGroupMappingFieldName, FIsMultilevel, FIsQty, FMeasureUnitID, FMeasureUnitGroupID, FPermissionItem, FCompanyID, FUseLongNumber)values
('YVoOB0QpZkeeNB/mT5E5V0c4VZA=', null, N'项目', N'项目', N'90003', null, null, null, null, 0, 0, 1, N'CT_CUS_Items', '256c221a-0106-1000-e000-10d7c0a813f413B7DE7F', {ts'2006-09-25 10:14:18'}, '256c221a-0106-1000-e000-10d7c0a813f413B7DE7F', {ts'2006-09-25 10:14:18'}, N'com.kingdee.eas.assetmamage.customeritems.app.ItemsQuery', N'Items', N'CFItemsID', 0, 1, null, null, N'项目', N'项目', '00000000-0000-0000-0000-000000000000CCE7AED4', null, N'T_CUS_ItemsTREE', N'FTreeID', 1, 0, null, null, null, '00000000-0000-0000-0000-000000000000CCE7AED4', 0);
gul端 凭证选择辅助账过滤事件
package com.kingdee.eas.assetmamage.customeritems;
import java.util.Enumeration;import com.kingdee.bos.dao.xml.impl.IStateManager;
import com.kingdee.bos.metadata.entity.*;
import com.kingdee.bos.metadata.query.util.CompareType;
import com.kingdee.eas.basedata.org.CompanyOrgUnitInfo;
import com.kingdee.eas.basedata.org.OrgType;
import com.kingdee.eas.common.client.SysContext;
import com.kingdee.eas.fi.gl.client.asstf7.DefaultProcessor;/*** * 凭证 辅助账核算项目过滤 gui**/
public class ItemsProcessor extends DefaultProcessor{/*** 过滤方法, Items实体 * @return*/@Overrideprotected FilterInfo getFilter() {FilterInfo filter = super.getFilter();FilterItemCollection fic = filter.getFilterItems();FilterItemInfo filterItemInfo = fic.get(0);String companyId = filterItemInfo.getCompareValue().toString();companyId=companyId.replace("[", "").replace("]","");// 编辑模式才需要设置,查询模式不需要该过滤if (getParam().isEditUI()) {FilterInfo newFilter = new FilterInfo();newFilter.getFilterItems().add(new FilterItemInfo("targetCompanyIds", "%"+companyId+"%", CompareType.LIKE));return newFilter;}return filter;}}
web端过滤事件
package com.kingdee.eas.assetmamage.customeritems;import java.util.Iterator;
import java.util.Set;import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.metadata.entity.FilterInfo;
import com.kingdee.bos.metadata.entity.FilterItemCollection;
import com.kingdee.bos.metadata.entity.FilterItemInfo;
import com.kingdee.bos.metadata.query.util.CompareType;
import com.kingdee.eas.basedata.master.auxacct.AsstActTypeInfo;
import com.kingdee.eas.basedata.org.CompanyOrgUnitInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.common.client.SysContext;
import com.kingdee.eas.fi.gl.app.asstf7.GLF7Parameter;
import com.kingdee.eas.fi.gl.app.asstf7.IAsstF7Filter;/*** * 凭证 辅助账核算项目过滤 web端**/
public class ItemsProcessorWeb implements IAsstF7Filter {@Overridepublic FilterInfo getFilter(Context ctx, AsstActTypeInfo asstActTypeInfo, GLF7Parameter param) throws BOSException, EASBizException {Set<String> companyIdSet = param.getCompanyIdSet();Iterator<String> iterator = companyIdSet.iterator();String companyId ="";while (iterator.hasNext()) {companyId = (String) iterator.next();System.out.println("公司id"+companyId);}// 编辑模式才需要设置,查询模式不需要该过滤if (param.isEditUI()) {FilterInfo newFilter = new FilterInfo();newFilter.getFilterItems().add(new FilterItemInfo("targetCompanyIds", "%"+companyId+"%", CompareType.LIKE));return newFilter;}return null;}}