// // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) // package com.kingdee.shr.base.syssetting.app.io.fileImport; import com.kingdee.bos.BOSException; import com.kingdee.bos.BOSObjectFactory; import com.kingdee.bos.Context; import com.kingdee.bos.ICommonBOSType; import com.kingdee.bos.dao.IObjectValue; import com.kingdee.bos.dao.ormapping.ObjectUuidPK; import com.kingdee.bos.metadata.IMetaDataLoader; import com.kingdee.bos.metadata.MetaDataLoaderFactory; import com.kingdee.bos.metadata.MetaDataPK; import com.kingdee.bos.metadata.entity.EntityObjectInfo; import com.kingdee.bos.metadata.entity.EntityViewInfo; import com.kingdee.bos.metadata.entity.FilterInfo; import com.kingdee.bos.metadata.entity.FilterItemInfo; import com.kingdee.bos.metadata.entity.SelectorItemCollection; import com.kingdee.bos.metadata.entity.SelectorItemInfo; import com.kingdee.eas.common.EASBizException; import com.kingdee.eas.ep.CoreBillBaseCustomInfo; import com.kingdee.eas.ep.DataBaseCustomInfo; import com.kingdee.eas.framework.CoreBaseCollection; import com.kingdee.eas.framework.CoreBaseInfo; import com.kingdee.eas.framework.ICoreBase; import com.kingdee.eas.hr.base.app.filter.StructureConfigConvertHelper; import com.kingdee.eas.hr.emp.PersonCredentialsTypeInfo; import com.kingdee.shr.base.syssetting.BaseItemCustomInfo; import com.kingdee.shr.base.syssetting.ml.SHRWebResource; import com.kingdee.shr.base.syssetting.util.LocaleUtils; import com.kingdee.shr.base.syssetting.web.dynamic.model.DynamicModelInfo; import com.kingdee.shr.baseconfig.QueryConfigFieldInfo; import com.kingdee.shr.baseconfig.StructureConfigFilterColumnCollection; import com.kingdee.shr.baseconfig.StructureConfigFilterColumnInfo; import com.kingdee.shr.baseconfig.StructureConfigInfo; import com.kingdee.shr.shrimport.SHRImportTypeEnum; import com.kingdee.util.StringUtils; import com.kingdee.util.enums.Enum; import com.kingdee.util.enums.IntEnum; import com.kingdee.util.enums.StringEnum; import java.lang.reflect.Constructor; import java.sql.Timestamp; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.apache.log4j.Logger; public class DynamicModelHelper { private Context ctx = null; private String scheme = null; private SHRImportTypeEnum importTypeEnum = null; private static Logger logger = Logger.getLogger(DynamicModelHelper.class); private Map importPropNameAndEntityPropMap = null; private Map entityInfoMap = null; private Map entityICoreBase = null; private String mainEntityFullName = null; private String mainEntityShortName = null; private boolean multiImport; private com.kingdee.shr.base.syssetting.app.io.fileImport.BaseRowInfo currentRow = null; private String currentBillid = null; public DynamicModelHelper(String scheme, Context ctx, Map columnMap, SHRImportTypeEnum importType) throws BOSException, EASBizException { this.ctx = ctx; this.scheme = scheme; this.importPropNameAndEntityPropMap = new HashMap(); this.importTypeEnum = importType; StructureConfigInfo main = StructureConfigConvertHelper.getMain(this.ctx, this.scheme); if (main == null) { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "unable_get_primary_entity", this.ctx)); } else { this.mainEntityFullName = main.getEntityName(); this.entityInfoMap = new HashMap(); Iterator> iter = columnMap.entrySet().iterator(); this.multiImport = true; com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo = null; ArrayList temp = new ArrayList(); while(iter.hasNext()) { columnInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo)((Entry)iter.next()).getValue(); if (!this.handleColumnInfo(columnInfo)) { temp.add(columnInfo); } } Iterator tempIter = temp.iterator(); while(tempIter.hasNext()) { columnInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo)tempIter.next(); this.handleColumnInfo(columnInfo); } } } private boolean handleColumnInfo(com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo) throws EASBizException, BOSException { return this.handleColumnInfo(columnInfo, true); } public void setCurrentBillid(String billId) { this.currentBillid = billId; } private boolean handleColumnInfo(com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo, boolean convertColumn) throws EASBizException, BOSException { String shortName = this.getEntityShortNameByPropName(columnInfo.getPropName()); com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo importEntityInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo)this.entityInfoMap.get(shortName); if (importEntityInfo == null) { if (convertColumn) { columnInfo = this.convertColumnInfo(columnInfo); return this.handleColumnInfo(columnInfo, false); } importEntityInfo = this.getImportEntityInfo(columnInfo.getPropName()); if (importEntityInfo == null) { return false; } this.entityInfoMap.put(shortName, importEntityInfo); if (importEntityInfo.getEntityFullName().equals(this.mainEntityFullName)) { this.mainEntityShortName = shortName; importEntityInfo.setMainEntity(true); } if (this.multiImport && !importEntityInfo.isMainEntity() && !importEntityInfo.isMultiRow()) { this.multiImport = false; } } importEntityInfo.addImportColumn(columnInfo); return true; } private com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo convertColumnInfo(com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo) throws BOSException { String propName = columnInfo.getPropName(); if (logger.isDebugEnabled()) { logger.debug("debugxg1" + propName); } QueryConfigFieldInfo fieldInfo = StructureConfigConvertHelper.getQueryFieldByKey(this.ctx, this.scheme, propName); if (fieldInfo == null) { return columnInfo; } else { StructureConfigInfo configInfo = fieldInfo.getFactField().getStructureConfig(); if (!configInfo.isBaseData()) { return columnInfo; } else { StructureConfigInfo parentConfigInfo = configInfo.getParent(); if (parentConfigInfo.isBaseData()) { return columnInfo; } else { if (logger.isDebugEnabled()) { logger.debug("debugxg2" + propName); } configInfo = StructureConfigConvertHelper.getStructureConfigByID(this.ctx, configInfo.getId().toString(), this.scheme); String tempRelationName = this.getRelationName(configInfo); if (logger.isDebugEnabled()) { logger.debug("debugxg3" + parentConfigInfo.getId() + "|" + parentConfigInfo.getName()); } String parentShortName = parentConfigInfo.getClientNumber().toUpperCase(); com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo tempColumnInfo = new com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo(parentShortName + "." + tempRelationName, columnInfo.getName(), columnInfo.isNecessary(), 0, (String)null); tempColumnInfo.setColumnIndex(columnInfo.getColumnIndex()); return tempColumnInfo; } } } } private String getEntityShortNameByPropName(String propName) { String[] strs = propName.split("\\."); return strs.length > 0 ? strs[0].toUpperCase() : propName.toUpperCase(); } private com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo getImportEntityInfo(String propName) throws BOSException, EASBizException { QueryConfigFieldInfo fieldInfo = StructureConfigConvertHelper.getQueryFieldByKey(this.ctx, this.scheme, propName); StructureConfigInfo configInfo = null; String tempRelationName; if (fieldInfo == null) { String[] split = propName.split("\\."); tempRelationName = ""; if (split.length > 0) { tempRelationName = split[0]; } configInfo = StructureConfigConvertHelper.getStructureConfigByNumber(this.ctx, tempRelationName, this.scheme); if (configInfo == null) { return null; } } com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo = new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo(); if (configInfo == null) { configInfo = fieldInfo.getFactField().getStructureConfig(); configInfo = StructureConfigConvertHelper.getStructureConfigByID(this.ctx, configInfo.getId().toString(), configInfo.getScheme().getNumber()); } entityInfo.setEntityAliasName(configInfo.getAlias()); entityInfo.setConfigInfo(configInfo); entityInfo.setEntityFullName(configInfo.getEntityName()); entityInfo.setMultiRow(configInfo.isMultiRow()); if (configInfo.isMultiRow() && configInfo.isSupportSingleView()) { entityInfo.setSingleShowCondition(configInfo.getSingleCondition()); } entityInfo.setSingleFields(configInfo.getSingleFields()); if (configInfo.getParent() != null) { tempRelationName = this.getRelationName(configInfo); entityInfo.setRelationName(tempRelationName); } return entityInfo; } private String getRelationName(StructureConfigInfo configInfo) { String tempRelationName = null; StructureConfigFilterColumnCollection filterColumnList = configInfo.getFilterColumn(); int i = 0; for(int size = filterColumnList.size(); i < size; ++i) { StructureConfigFilterColumnInfo filterColumn = filterColumnList.get(i); if (filterColumn.getParentColumn() != null && "id".equalsIgnoreCase(filterColumn.getClientColumn())) { tempRelationName = filterColumn.getParentColumn(); break; } if (filterColumn.getParentColumn() != null && "id".equalsIgnoreCase(filterColumn.getParentColumn())) { tempRelationName = filterColumn.getClientColumn(); break; } if (filterColumn.getParentColumn() != null && "person".equalsIgnoreCase(filterColumn.getParentColumn()) && "person".equalsIgnoreCase(filterColumn.getClientColumn())) { return filterColumn.getParentColumn(); } } return tempRelationName; } public void setRow(com.kingdee.shr.base.syssetting.app.io.fileImport.BaseRowInfo row) { this.currentRow = row; } public ICoreBase getEntityInterface(String entityName) { if (this.entityICoreBase == null) { this.entityICoreBase = new HashMap(); } ICoreBase coreBase = (ICoreBase)this.entityICoreBase.get(entityName); if (coreBase == null) { MetaDataPK entityPK = MetaDataPK.create(entityName); try { coreBase = (ICoreBase)BOSObjectFactory.createCommonBOSObject(this.ctx, entityPK); this.entityICoreBase.put(entityName, coreBase); } catch (BOSException var5) { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "get_api_instance_error", this.ctx), var5); } } return coreBase; } public DynamicModelInfo convertRowToDynamicModel(com.kingdee.shr.base.syssetting.app.io.fileImport.BaseRowInfo row) throws com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException { this.currentRow = row; return this.convertRowToDynamicModel(); } public DynamicModelInfo convertRowToDynamicModel() { if (this.currentRow == null) { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "row_data_isempty", this.ctx)); } else { com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo mainEntityInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo)this.entityInfoMap.get(this.mainEntityShortName); CoreBaseInfo mainCoreBaseInfo = this.loadMainEntityInfo(mainEntityInfo); if (mainCoreBaseInfo == null) { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "entity_not_found", this.ctx)); } else { this.currentBillid = mainCoreBaseInfo.getId().toString(); DynamicModelInfo dyModelInfo = new DynamicModelInfo(); HashMap valueMap = new HashMap(); HashMap hasData = new HashMap(); valueMap.put(mainEntityInfo.getEntityFullName(), mainCoreBaseInfo); hasData.put(mainEntityInfo.getEntityFullName(), true); dyModelInfo.setValueMap(valueMap); Iterator> iter = this.entityInfoMap.entrySet().iterator(); com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo = null; while(iter.hasNext()) { entityInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo)((Entry)iter.next()).getValue(); if (!valueMap.containsKey(entityInfo.getEntityFullName())) { CoreBaseInfo baseInfo = this.loadEntityInfo(entityInfo); // start xiaoxin 员工证件信息新增导入时,不根据证件类型做唯一校验更新数据,进入新增操作 if(baseInfo instanceof PersonCredentialsTypeInfo && importTypeEnum.getValue()==10){ baseInfo = null; } // end xiaoxin if (baseInfo == null) { SelectorItemCollection coll = this.getLoadSelectorColl(entityInfo.getImportColumn()); if (coll.size() == 0) { hasData.put(entityInfo.getEntityFullName(), false); } } else { valueMap.put(entityInfo.getEntityFullName(), baseInfo); hasData.put(entityInfo.getEntityFullName(), true); } } } this.verifyOrCreateBlankBaseInfo(dyModelInfo, hasData); this.assignInfoSaveValue(dyModelInfo, hasData); this.currentBillid = null; return dyModelInfo; } } } private void verifyOrCreateBlankBaseInfo(DynamicModelInfo dyModelInfo, HashMap hasData) { HashMap valueMap = dyModelInfo.getValueMap(); StringBuffer errorMsg = new StringBuffer(); Iterator> iter = this.entityInfoMap.entrySet().iterator(); com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo = null; IObjectValue baseInfo = null; String tempEntityFullName = null; while(true) { String emsg; do { do { if (!iter.hasNext()) { emsg = errorMsg.toString(); if (!StringUtils.isEmpty(emsg)) { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(emsg); } return; } entityInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo)((Entry)iter.next()).getValue(); } while(entityInfo.isMainEntity()); tempEntityFullName = entityInfo.getEntityFullName(); } while(hasData.get(tempEntityFullName) != null && !(Boolean)hasData.get(tempEntityFullName)); baseInfo = (IObjectValue)valueMap.get(tempEntityFullName); switch(this.importTypeEnum.getValue()) { case 10: if (baseInfo == null) { baseInfo = this.createInfo(tempEntityFullName); valueMap.put(tempEntityFullName, baseInfo); } else { // start xiaoxin 员工证件信息导入时不根据证件类型做唯一校验 if(!(baseInfo instanceof PersonCredentialsTypeInfo)){ emsg = MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "add_fails_already_exist", this.ctx), entityInfo.getEntityAliasName()); errorMsg.append(emsg); } // emsg = MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "add_fails_already_exist", this.ctx), entityInfo.getEntityAliasName()); // errorMsg.append(emsg); // end xioaxin } break; case 20: if (baseInfo == null) { emsg = MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "cover_fails_not_load", this.ctx), entityInfo.getEntityAliasName()); errorMsg.append(emsg); } else { CoreBaseInfo coreBaseInfo = this.createInfo(tempEntityFullName); coreBaseInfo.setId(((CoreBaseInfo)baseInfo).getId()); valueMap.put(tempEntityFullName, coreBaseInfo); } break; case 30: if (baseInfo == null) { emsg = MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "update_fails_not_load", this.ctx), entityInfo.getEntityAliasName()); errorMsg.append(emsg); } break; case 40: if (baseInfo == null) { baseInfo = this.createInfo(tempEntityFullName); valueMap.put(tempEntityFullName, baseInfo); } } } } private void assignInfoSaveValue(DynamicModelInfo dyModelInfo, HashMap hasData) { HashMap tempObjMap = dyModelInfo.getValueMap(); LinkedHashMap saveModelMap = new LinkedHashMap(); Iterator> iter = this.entityInfoMap.entrySet().iterator(); com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo = null; IObjectValue coreBase = null; com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo tempColumnInfo = null; Object tempValue = null; boolean hasUpdate = this.importTypeEnum.getValue() == 40 || this.importTypeEnum.getValue() == 30; while(true) { Boolean has; do { if (!iter.hasNext()) { if (tempObjMap.containsKey(this.mainEntityFullName)) { saveModelMap.put(this.mainEntityFullName, tempObjMap.get(this.mainEntityFullName)); tempObjMap.remove(this.mainEntityFullName); } saveModelMap.putAll(tempObjMap); dyModelInfo.setSaveModelMap(saveModelMap); return; } entityInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo)((Entry)iter.next()).getValue(); has = (Boolean)hasData.get(entityInfo.getEntityFullName()); } while(has != null && !has); coreBase = (IObjectValue)tempObjMap.get(entityInfo.getEntityFullName()); boolean tempBoolean = hasUpdate && coreBase.get(coreBase.getPKField()) != null; List columnInfoList = entityInfo.getImportColumn(); boolean isPersonEntity = this.isPersonEntity(entityInfo.getEntityFullName()); int i = 0; for(int size = columnInfoList.size(); i < size; ++i) { tempColumnInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo)columnInfoList.get(i); if (!isPersonEntity || !"person.name".equals(tempColumnInfo.getPropName()) && !"person.number".equals(tempColumnInfo.getPropName())) { String valString; if (tempBoolean) { valString = this.currentRow.getValueOfStringByIndex(tempColumnInfo.getColumnIndex()); if (StringUtils.isEmpty(valString)) { continue; } if (com.kingdee.shr.base.syssetting.app.io.fileImport.ValueCovertUtils.UPDATE_BLANK_FLAG.equals(valString)) { tempValue = null; } } tempValue = this.currentRow.getValueOfObjectByIndex(tempColumnInfo.getColumnIndex()); valString = this.getEntityPropName(tempColumnInfo.getPropName()); coreBase.put(valString, tempValue); if (1 == tempColumnInfo.getDataType()) { coreBase.put(valString + "_" + LocaleUtils.locale_l1.getDisplayName(), tempValue); coreBase.put(valString + "_" + LocaleUtils.locale_l2.getDisplayName(), tempValue); coreBase.put(valString + "_" + LocaleUtils.locale_l3.getDisplayName(), tempValue); } } } String tempRelate = entityInfo.getRelationName(); if (!StringUtils.isEmpty(tempRelate)) { IObjectValue mainValue = (IObjectValue)tempObjMap.get(this.mainEntityFullName); if (mainValue != null) { coreBase.put(tempRelate, mainValue); } } } } private CoreBaseInfo loadEntityInfo(com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo) { FilterInfo filter = null; SelectorItemCollection coll = this.getLoadSelectorColl(entityInfo.getImportColumn()); if (coll.size() == 0) { return null; } else { List keyColumn = entityInfo.getKeyColumn(); if (keyColumn != null && keyColumn.size() > 0) { filter = new FilterInfo(); this.getLoadFilterInfo(filter, keyColumn); } if (!StringUtils.isEmpty(entityInfo.getRelationName())) { if (filter == null) { filter = new FilterInfo(); } filter.getFilterItems().add(new FilterItemInfo(entityInfo.getRelationName(), this.currentBillid)); } if (filter == null) { return null; } else { EntityViewInfo view = new EntityViewInfo(); view.setFilter(filter); try { ICoreBase iCoreBase = this.getEntityInterface(entityInfo.getEntityFullName()); CoreBaseCollection coreBaseColl = iCoreBase.getCollection(view); int size = coreBaseColl.size(); if (size == 0) { return null; } else if (size == 1) { return coreBaseColl.get(0); } else { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_entity_fails_mult", this.ctx), entityInfo.entityAliasName)); } } catch (BOSException var9) { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_existing_entity_fails", this.ctx), entityInfo.entityAliasName), var9); } } } } private CoreBaseInfo loadMainEntityInfo(com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo) { if (!StringUtils.isEmpty(this.currentBillid)) { try { ICoreBase iCoreBase = this.getEntityInterface(entityInfo.getEntityFullName()); CoreBaseInfo coreBase = iCoreBase.getValue(new ObjectUuidPK(this.currentBillid)); return coreBase; } catch (EASBizException var13) { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(var13.getMessage(), var13); } catch (BOSException var14) { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_existing_entity_error", this.ctx), var14); } } else { FilterInfo filter = null; if (this.isPersonEntity(entityInfo.getEntityFullName())) { filter = new FilterInfo(); String number = this.currentRow.getValueOfString("person.number"); String name = this.currentRow.getValueOfString("person.name"); if (!StringUtils.isEmpty(name)) { filter.getFilterItems().add(new FilterItemInfo(this.getEntityPropName("person.name"), name)); } if (!StringUtils.isEmpty(number)) { filter.getFilterItems().add(new FilterItemInfo(this.getEntityPropName("person.number"), number)); } EntityViewInfo view = new EntityViewInfo(); view.setFilter(filter); try { ICoreBase iCoreBase = this.getEntityInterface(entityInfo.getEntityFullName()); CoreBaseCollection coreBaseColl = iCoreBase.getCollection(view); int size = coreBaseColl.size(); if (size == 0) { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "unable_load_entity", this.ctx, new Object[]{entityInfo.getEntityAliasName()})); } else if (size == 1) { return coreBaseColl.get(0); } else { CoreBaseInfo base = null; int count = 0; for(int i = 0; i < size; ++i) { CoreBaseInfo baseInfo = coreBaseColl.get(i); if ((StringUtils.isEmpty(name) || name.equals(baseInfo.getString("name"))) && (StringUtils.isEmpty(number) || number.equals(baseInfo.getString("number")))) { base = baseInfo; ++count; } } if (count == 1) { return base; } else { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_mult_entity", this.ctx, new Object[]{entityInfo.getEntityAliasName()})); } } } catch (BOSException var15) { throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_existing_entity_fails", this.ctx, new Object[]{entityInfo.getEntityAliasName()}), var15); } } else { return this.loadEntityInfo(entityInfo); } } } private boolean isPersonEntity(String entityFullName) { return "com.kingdee.eas.basedata.person.app.Person".equals(entityFullName); } private FilterInfo getLoadFilterInfo(FilterInfo filter, List keyColumn) { com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo = null; int i = 0; for(int size = keyColumn.size(); i < size; ++i) { columnInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo)keyColumn.get(i); String key = columnInfo.getPropName(); String entityPropName = this.getEntityPropName(key); Object value = this.currentRow.getValueOfObjectByIndex(columnInfo.getColumnIndex()); if (value instanceof String) { filter.getFilterItems().add(new FilterItemInfo(entityPropName, value)); } else if (value instanceof Timestamp) { filter.getFilterItems().add(new FilterItemInfo(entityPropName, value)); } else if (value instanceof Date) { filter.getFilterItems().add(new FilterItemInfo(entityPropName, value)); } else if (value instanceof Enum) { if (value instanceof StringEnum) { StringEnum en = (StringEnum)value; filter.getFilterItems().add(new FilterItemInfo(entityPropName, en.getValue())); } else if (value instanceof IntEnum) { IntEnum en = (IntEnum)value; filter.getFilterItems().add(new FilterItemInfo(entityPropName, en.getValue())); } } else if (value instanceof CoreBaseInfo) { CoreBaseInfo coreBaseInfo = (CoreBaseInfo)value; filter.getFilterItems().add(new FilterItemInfo(entityPropName, coreBaseInfo.getId())); } else { filter.getFilterItems().add(new FilterItemInfo(entityPropName, value)); } } return filter; } private SelectorItemCollection getLoadSelectorColl(List columnList) { com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo = null; SelectorItemCollection coll = new SelectorItemCollection(); int i = 0; for(int size = columnList.size(); i < size; ++i) { columnInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo)columnList.get(i); String key = columnInfo.getPropName(); String entityPropName = this.getEntityPropName(key); String value = this.currentRow.getValueOfStringByIndex(columnInfo.getColumnIndex()); if (!StringUtils.isEmpty(value)) { coll.add(new SelectorItemInfo(entityPropName)); } } return coll; } private String getEntityPropName(String importPropName) { String entityPropName = (String)this.importPropNameAndEntityPropMap.get(importPropName); if (entityPropName == null) { String[] strs = importPropName.split("\\."); if (strs.length > 1) { entityPropName = strs[1]; } this.importPropNameAndEntityPropMap.put(importPropName, entityPropName); } return entityPropName; } private CoreBaseInfo createInfo(String entityFullName) { IMetaDataLoader loader = MetaDataLoaderFactory.getMetaDataLoader(this.ctx); MetaDataPK metaDataPK = MetaDataPK.create(entityFullName); EntityObjectInfo eoInfo = loader.getEntity(metaDataPK); String valueClassName = eoInfo.getObjectValueClass(); CoreBaseInfo info = null; try { Class c = Class.forName(valueClassName); Constructor cst = c.getConstructor(); info = (CoreBaseInfo)cst.newInstance(); if (info instanceof DataBaseCustomInfo) { ((DataBaseCustomInfo)info).setBOSType(eoInfo.getType()); } else if (info instanceof BaseItemCustomInfo) { ((BaseItemCustomInfo)info).setBOSType(eoInfo.getType()); } else if (info instanceof CoreBillBaseCustomInfo) { ((CoreBillBaseCustomInfo)info).setBOSType(eoInfo.getType()); } else if (eoInfo.isDynamic() && info instanceof ICommonBOSType) { ICommonBOSType commonObject = (ICommonBOSType)info; commonObject.setBOSType(eoInfo.getType()); commonObject.setPK(metaDataPK); } return info; } catch (Exception var10) { com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException importException = new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "creat_object_fails", this.ctx), var10); throw importException; } } }