Пример #1
0
        /// <summary>
        /// 根据信息记录ID和需要校验的值查询另一个信息若存在则查询存在信息记录中某个值
        /// </summary>
        /// yand    16。09.27
        /// <param name="infoTypeID">信息记录ID</param>
        /// <param name="value">校验条件</param>
        /// <param name="value2">校验条件2</param>
        /// <param name="segmentRuleID">需要获取的字段值</param>
        /// <returns></returns>
        public string InfoValueValidate(int infoTypeID, int fileId, KeyValuePair <string, string> value, string value2, string segmentRuleID)
        {
            string            result     = string.Empty;
            List <ReportInfo> reportList = new Report().List(fileId);
            var list = new List <string>();
            List <Dictionary <string, string> > ListDic = new List <Dictionary <string, string> >();

            foreach (var reportInfo in reportList)
            {
                // 获取报文文件下该类型的信息记录集合
                List <InformationRecordInfo> informationRecordList = new DAL.BankCredit.InformationRecordMapper().FindInformationListByInfoTypeIdAndReportId(infoTypeID, reportInfo.ReportID);
                if (informationRecordList != null)
                {
                    foreach (var informationRecord in informationRecordList)
                    {
                        Dictionary <string, string> dic = new Dictionary <string, string>();
                        // JSON 字符串
                        var content    = informationRecord.Context;
                        var infoTypeId = informationRecord.InfoTypeID;
                        // 根据查询条件查询是否存在该条件对应的记录
                        bool findResult = new CommonUtil().FindInfo(content, value2);
                        if (findResult)
                        {
                            //借据放款日期
                            result = new CommonUtil().GetValue(content, segmentRuleID);
                        }
                    }
                }
            }
            return(result);
        }
Пример #2
0
        /// <summary>
        /// 查找报文文件下面含有该数据元对应的值
        /// </summary>
        /// yand   16.09.27
        /// <param name="typeId">信息记录ID</param>
        /// <param name="fileId">报文文件ID</param>
        /// <param name="metaCode">需要获取数据元对应的值</param>
        /// <param name="dataSegmentParagraphCode">数据段标识</param>
        /// <returns></returns>
        public List <string> Dictionary(int typeId, int fileId, int metaCode, string dataSegmentParagraphCode)
        {
            List <ReportInfo> reportList = new Report().List(fileId);
            var list = new List <string>();
            List <Dictionary <string, string> > ListDic = new List <Dictionary <string, string> >();

            foreach (var reportInfo in reportList)
            {
                // 获取报文文件下该类型的信息记录集合
                List <InformationRecordInfo> informationRecordList = new DAL.BankCredit.InformationRecordMapper().FindInformationListByInfoTypeIdAndReportId(typeId, reportInfo.ReportID);

                if (informationRecordList != null)
                {
                    foreach (var informationRecord in informationRecordList)
                    {
                        Dictionary <string, string> dic = new Dictionary <string, string>();
                        // JSON 字符串
                        var content    = informationRecord.Context;
                        var infoTypeId = informationRecord.InfoTypeID;
                        // 根据信息记录类型ID和数据元ID获取数据段规则实体
                        var segmentRulesInfo = new SegmentRules().GetSegmentRulesByInfoTypeIdAndMetaCodeAndCode(infoTypeId, metaCode, dataSegmentParagraphCode);

                        // 获取信息记录中数据段中数据元规则对应的值
                        var temp = new CommonUtil().GetValues(content, dataSegmentParagraphCode, segmentRulesInfo.SegmentRulesId.ToString());
                        list.Add(temp);
                    }
                }
            }
            return(list);
        }
Пример #3
0
        /// <summary>
        /// 160规则校验
        /// </summary>
        /// <param name="infoTypeId">还款信息记录ID</param>
        /// <param name="fileID">该展期对应的报文文件ID</param>
        /// <param name="value">展期信息记录中对应的借据编号</param>
        /// <returns></returns>
        public string Validate160(int infoTypeId, int fileID, string value)
        {
            string            result     = string.Empty;
            List <ReportInfo> reportList = new Report().List(fileID);
            var list = new List <string>();
            List <Dictionary <string, string> > ListDic = new List <Dictionary <string, string> >();

            foreach (var reportInfo in reportList)
            {
                // 获取信息记录集合
                List <InformationRecordInfo> informationRecordList = new DAL.BankCredit.InformationRecordMapper().FindInformationListByInfoTypeIdAndReportId(infoTypeId, reportInfo.ReportID);
                // 该展期信息记录对应的业务借据信息记录下无还款信息记录时
                if (informationRecordList == null)
                {
                    //借据信息记录ID
                    int typeId = 11;
                    //获取借据信息中借据余额(groupId表示段标识)
                    string groupId = "F524";
                    List <InformationRecordInfo> informationRecord = new DAL.BankCredit.InformationRecordMapper().FindInformationListByInfoTypeIdAndReportId(typeId, reportInfo.ReportID);
                    if (informationRecord != null)
                    {
                        foreach (var infoRecord in informationRecord)
                        {
                            bool findResult = new CommonUtil().FindInfo(infoRecord.Context, value);
                            if (findResult)
                            {
                                result = new CommonUtil().GetValue(infoRecord.Context, groupId);
                            }
                        }
                    }
                }
            }
            return(result);
        }