def __getFlatten(self): # 扁平化处理 oDM = DictMerge() for k in self.dict_data: oDM.set(self.dict_data[k]) dict_data = oDM.get() return dict_data
def __getResult(self, operator_data): # 整合结果集 # 1 通讯录数据 dict_data = {} address_data = DictMerge() address_data.set(operator_data.get('address')) address_data.set(self.address_vscontact) address_data.set(self.address_vsuser) dict_data['address'] = address_data.get() loan_data = DictMerge() loan_data.set(self.loan) dict_data['loan'] = loan_data.get() summary_data = DictMerge() summary_data.set(self.loan_total_all) dict_data['summary_data'] = summary_data.get() detail_tag_data = DictMerge() detail_tag_data.set(self.detail_tag) dict_data['detail_tag'] = detail_tag_data.get() address_tag_data = DictMerge() address_tag_data.set(self.address_tag) dict_data['address_tag'] = address_tag_data.get() ss_report_data = DictMerge() ss_report_data.set(operator_data.get('ss_report')) dict_data['ss_report'] = ss_report_data.get() mh_report_data = DictMerge() mh_report_data.set(operator_data.get('mh_report')) dict_data['mh_report'] = mh_report_data.get() report_data = DictMerge() report_data.set(operator_data.get('report')) dict_data['report'] = report_data.get() detail_data = DictMerge() detail_data.set(operator_data.get('detail')) detail_data.set(self.detail_vsaddress) dict_data['detail'] = detail_data.get() detail_other_data = DictMerge() detail_other_data.set(operator_data.get('detail_other')) dict_data['detail_other'] = detail_other_data.get() contact_data = DictMerge() contact_data.set(self.detail_vscontact) #contact_data.set(self.contact_due_data) dict_data['contact'] = contact_data.get() other_data = DictMerge() other_data.set(self.other_data) dict_data['other_data'] = other_data.get() return dict_data
def __getResult(self, operator_data): # 整合结果集 # 1 通讯录数据 dict_data = {} address_data = DictMerge() address_data.set(operator_data.get('address')) address_data.set(self.address_vscontact) address_data.set(self.address_vsuser) dict_data['address'] = address_data.get() dict_data['addr_loan'] = self.address_vsloan ss_report_data = DictMerge() ss_report_data.set(operator_data.get('ss_report')) dict_data['ss_report'] = ss_report_data.get() report_data = DictMerge() report_data.set(operator_data.get('report')) dict_data['report'] = report_data.get() detail_data = DictMerge() detail_data.set(operator_data.get('detail')) detail_data.set(self.detail_vsaddress) dict_data['detail'] = detail_data.get() detail_other_data = DictMerge() detail_other_data.set(operator_data.get('detail_other')) dict_data['detail_other'] = detail_other_data.get() contact_data = DictMerge() contact_data.set(self.detail_vscontact) contact_data.set(self.contact_due_data) dict_data['contact'] = contact_data.get() # 5 db数据 vsdb = DictMerge() vsdb.set(self.detail_vsauth) vsdb.set(self.detail_vsinvest) dict_data['vsdb'] = vsdb.get() # 6 黑名单数据 dict_data['black'] = self.black_data # 7 整合结果 dict_data = self.__mergeData(self.user_id, self.request_id, self.aid, dict_data) return dict_data
def getOperatorData(self, address_list, record): # 1 运营商数据 source = 0 detail_data = detail_other_data = None if record is not None: source = record.get('source') report_url = record.get('report_url') detail_url = record.get('detail_url') self.detail_url_log = detail_url report_data = analysis_report(source, report_url) detail_data, detail_other_data = self.__analysis_detail(detail_url) try: #通话详单标签追加 self._addNumberLabel() except Exception as e: logger.info("number_label: 通话详单错误:%s" % e) # 2 报告数据,仅聚信立有效 dict_data = {} dict_data['ss_report'] = {} dict_data['report'] = {} if source in [1, 2]: dict_data['report'] = report_data elif source == 4: dict_data['ss_report'] = report_data # 3 通讯录 address_data = self.__analysis_address(address_list) address_analysis = DictMerge() address_analysis.set(address_data) dict_data['address'] = address_analysis.get() # 4 详情数据 detail_analysis = DictMerge() detail_analysis.set(detail_data) dict_data['detail'] = detail_analysis.get() # 5 详情其它表字段 detail_other_analysis = DictMerge() detail_other_analysis.set(detail_other_data) repInfo = {} if source in [1, 2] and report_data.get('report_use_time'): repInfo['phone_register_month'] = report_data.get( 'report_use_time') elif source in [4, 5, 6] and report_data.get('phone_register_month'): repInfo['phone_register_month'] = report_data.get( 'phone_register_month') detail_other_analysis.set(repInfo) dict_data['detail_other'] = detail_other_analysis.get() return dict_data