/// <summary> /// 根据段ID获取段中元素实体 /// </summary> /// yand 16.07.04 /// zouql 16.09.20 新增RuleType /// <param name="DataSegmentId">段ID</param> /// <returns></returns> public List <ComponentInfo> ComponentList(int DataSegmentId) { List <ComponentInfo> componentList = new List <ComponentInfo>(); // 获取数据段规则 List <SegmentRulesInfo> segmentRulesList = segmentRuleMapper.List(DataSegmentId); List <MetaInfo> metaList = new List <MetaInfo>(); for (int i = 0; i < segmentRulesList.Count; i++) { // 获取数据元 MetaInfo metaInfo = metaMapper.Find(segmentRulesList[i].MetaCode); metaInfo.RuleType = new RuleType().Get(metaInfo.RuleType.RuleTypeId); // 获取HTML标签 List <HtmlElementInfo> htmlElementList = new DAL.BankCredit.HtmlElementMapper().Find(segmentRulesList[i].MetaCode); MetaComponentsInfo GetMetaComponentsInfoByCode = new DataRule().GetMetaComponentsInfoByCode(segmentRulesList[i].MetaCode); // 一个数据元可能对应多个标签 for (int j = 0; j < htmlElementList.Count; j++) { ComponentInfo componentInfo = new ComponentInfo(); componentInfo.HtmlElement = htmlElementList[j].Html; componentInfo.HtmlelementId = htmlElementList[j].HtmlElementID; componentInfo.Type = GetMetaComponentsInfoByCode.Type; componentInfo.IsRequired = segmentRulesList[i].IsRequired; componentInfo.Length = metaInfo.DatasLength; componentInfo.MetaName = metaInfo.Name; componentInfo.DataType = metaInfo.DataType; componentInfo.MetaCode = metaInfo.MetaCode; componentInfo.SegmentRulesId = segmentRulesList[i].SegmentRulesId; componentInfo.Description = segmentRulesList[i].Description; componentInfo.RuleType = metaInfo.RuleType ?? new RuleTypeInfo(); componentList.Add(componentInfo); } } return(componentList); }
/// <summary> /// 查询集合 /// </summary> /// yaoy 16.07.04 /// <param name="dataSegmentId"></param> /// <returns></returns> public List <SegmentRulesInfo> List(int dataSegmentId) { return(SegmentRulesMapper.List(dataSegmentId)); }