def update_branch3(cursor, connect, gs_basic_id, gs_py_id, select_sql, update_sql, QGGS, name): update_total, insert_total = 0, 0 try: now_time = time.time() select_string = select_sql % gs_basic_id last_time = cursor.execute(select_string) if last_time == 0: recordstotal, total, insert_total, update_total = Get_BranchInfo( gs_py_id).get_info(None, gs_basic_id, cursor, connect, url, QGGS, name) flag = jude_status(recordstotal, total) elif int(last_time) == 1: last_time = cursor.fetchall()[0][0] interval = caculate_time(str(now_time), str(last_time)) if interval < 2592000: flag = None else: recordstotal, total, update_total, insert_total = Get_BranchInfo( gs_py_id).get_info(None, gs_basic_id, cursor, connect, url, QGGS, name) flag = jude_status(recordstotal, total, update_total, insert_total) except Exception, e: flag = 100000006 logging.error('%s error %s' % (name, e))
def get_pbreport_info(self, year, anCheId, province): flag = -1 try: url_list = self.get_preport_url(anCheId) baseurl = url_list["base"] baseinfo, runinfo = self.get_pbaseinfo(baseurl) report_id = self.update_base(self.gs_basic_id, baseinfo, year, self.cursor, self.connect, province) self.update_frun(year, report_id, self.gs_basic_id, self.cursor, self.connect, province, runinfo) records, total, insert_total, update_total = Get_BranchInfo( self.gs_py_id).get_info(report_id, self.gs_basic_id, self.cursor, self.connect, url_list["web"], QGGS_report_web.Web, "reportweb%s" % year) self.judge_status(web_py, records, total) records, total, insert_total, update_total = Get_BranchInfo( self.gs_py_id).get_info(report_id, self.gs_basic_id, self.cursor, self.connect, url_list["web"], QGGS_report_permit.Permit, "reportpermit%s" % year) self.judge_status(permit_py, records, total) flag = 1 except Exception, e: flag = 100000006 logging.error('report error %s' % e)
def get_freport_info(self, year, anCheId, province): flag = -1 try: url_list = self.get_freport_url(anCheId) baseurl = url_list["base"] baseinfo, runinfo = self.get_fbaseinfo(baseurl) report_id = self.update_base(self.gs_basic_id, baseinfo, year, self.cursor, self.connect, province) self.update_frun(year, report_id, self.gs_basic_id, self.cursor, self.connect, province, runinfo) records, total, insert_total, update_total = Get_BranchInfo( self.gs_py_id).get_info(report_id, self.gs_basic_id, self.cursor, self.connect, url_list["web"], QGGS_report_web.Web, "reportweb%s" % year) records, total, insert_total, update_total = Get_BranchInfo( self.gs_py_id).get_info(report_id, self.gs_basic_id, self.cursor, self.connect, url_list["web"], QGGS_report_permit.Permit, "reportpermit%s" % year) info = QGGS_report_lab.name(url_list["society"]) if len(info) > 0: QGGS_report_lab.update_to_db(report_id, self.gs_basic_id, self.gs_py_id, self.cursor, self.connect, info, province) flag = 1 except Exception, e: flag = 100000006 logging.error('report error %s' % e)
def get_report_info(self, year, anCheId, province): url_list = self.get_report_url(anCheId) baseurl = url_list["baseinfo"] baseinfo, runinfo = self.get_baseinfo(baseurl) report_id = self.update_base(self.gs_basic_id, baseinfo, year, self.cursor, self.connect, province) self.update_run(year, report_id, self.gs_basic_id, self.cursor, self.connect, province, runinfo) records, total = Get_BranchInfo(self.gs_py_id).get_info( report_id, self.gs_basic_id, self.cursor, self.connect, url_list["web"], QGGS_report_web, "reportweb%s" % year) self.judge_status(web_py, records, total) records, total = Get_BranchInfo(self.gs_py_id).get_info( report_id, self.gs_basic_id, self.cursor, self.connect, url_list["invest"], QGGS_report_invest, "reportinvest%s" % year) self.judge_status(invest_py, records, total) records, total = Get_BranchInfo(self.gs_py_id).get_info( report_id, self.gs_basic_id, self.cursor, self.connect, url_list["share"], QGGS_report_shareholder, "reportshare%s" % year) self.judge_status(share_py, records, total) records, total = Get_BranchInfo(self.gs_py_id).get_info( report_id, self.gs_basic_id, self.cursor, self.connect, url_list["schange"], QGGS_report_schange, "reportschange%s" % year) self.judge_status(schange_py, records, total) info = QGGS_report_lab.name(url_list["society"]) if len(info) > 0: QGGS_report_lab.update_to_db(report_id, self.gs_basic_id, self.cursor, self.connect, info, province)
def get_report_info(self, year, anCheId, province): flag = -1 try: url_list = self.get_report_url(anCheId) baseurl = url_list["baseinfo"] baseinfo, runinfo = self.get_baseinfo(baseurl) report_id = self.update_base(self.gs_basic_id, baseinfo, year, self.cursor, self.connect, province) self.update_run(year, report_id, self.gs_basic_id, self.cursor, self.connect, province, runinfo) records, total, insert_total, update_total = Get_BranchInfo( self.gs_py_id).get_info(report_id, self.gs_basic_id, self.cursor, self.connect, url_list["web"], QGGS_report_web.Web, "reportweb%s" % year) self.judge_status(web_py, records, total) records, total, insert_total, update_total = Get_BranchInfo( self.gs_py_id).get_info(report_id, self.gs_basic_id, self.cursor, self.connect, url_list["invest"], QGGS_report_invest.Invest, "reportinvest%s" % year) self.judge_status(invest_py, records, total) records, total, insert_total, update_total = Get_BranchInfo( self.gs_py_id).get_info(report_id, self.gs_basic_id, self.cursor, self.connect, url_list["share"], QGGS_report_shareholder.Share, "reportshare%s" % year) self.judge_status(share_py, records, total) records, total, insert_total, update_total = Get_BranchInfo( self.gs_py_id).get_info(report_id, self.gs_basic_id, self.cursor, self.connect, url_list["schange"], QGGS_report_schange.Schange, "reportschange%s" % year) self.judge_status(schange_py, records, total) info = QGGS_report_lab.name(url_list["society"]) if len(info) > 0: QGGS_report_lab.update_to_db(report_id, self.gs_basic_id, self.gs_py_id, self.cursor, self.connect, info, province) flag = 1 except Exception, e: logging.info('report error %s' % e) flag = 100000006
def update_branch1(cursor, connect, gs_basic_id, gs_py_id, update_sql, QGGS, name): try: recordstotal, total = Get_BranchInfo(gs_py_id).get_info( None, gs_basic_id, cursor, connect, url[name], QGGS, name) flag = jude_status(recordstotal, total) except Exception, e: logging.info('%s error :%s' % (name, e)) flag = 100000005
def get_freport_info(self, year, anCheId, province): url_list = self.get_freport_url(anCheId) baseurl = url_list["base"] baseinfo, runinfo = self.get_fbaseinfo(baseurl) report_id = self.update_base(self.gs_basic_id, baseinfo, year, self.cursor, self.connect, province) self.update_frun(year, report_id, self.gs_basic_id, self.cursor, self.connect, province, runinfo) records, total = Get_BranchInfo(self.gs_py_id).get_info( report_id, self.gs_basic_id, self.cursor, self.connect, url_list["web"], QGGS_report_web, "reportweb%s" % year) self.judge_status(web_py, records, total) records, total = Get_BranchInfo(self.gs_py_id).get_info( report_id, self.gs_basic_id, self.cursor, self.connect, url_list["web"], QGGS_report_permit, "reportpermit%s" % year) self.judge_status(permit_py, records, total) info = QGGS_report_lab.name(url_list["society"]) if len(info) > 0: QGGS_report_lab.update_to_db(report_id, self.gs_basic_id, self.gs_py_id, self.cursor, self.connect, info, province)
def update_person(cursor, connect, gs_basic_id, gs_py_id, update_py, update_sql, QGGS, name): #用于获取最新的执行时间 execute_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) print 'the execute_time is %s' % execute_time try: recordstotal, total = Get_BranchInfo(gs_py_id).get_info( None, gs_basic_id, cursor, connect, url[name], QGGS, name) flag = jude_status(recordstotal, total) except Exception, e: flag = 100000005 logging('person errror:%s ' % e)