|
@@ -0,0 +1,452 @@
|
|
|
+
|
|
|
+from BaseDataMaintenance.dataSource.source import getConnect_ots
|
|
|
+from tablestore import *
|
|
|
+from BaseDataMaintenance.model.ots.major_project import *
|
|
|
+from BaseDataMaintenance.common.Utils import *
|
|
|
+
|
|
|
+from queue import Queue
|
|
|
+
|
|
|
+from BaseDataMaintenance.common.multiThread import MultiThreadHandler
|
|
|
+import pandas as pd
|
|
|
+from BaseDataMaintenance.model.ots.enterprise import Enterprise
|
|
|
+import random
|
|
|
+from apscheduler.schedulers.blocking import BlockingScheduler
|
|
|
+
|
|
|
+def get_stage_pattern():
|
|
|
+ # stage_dict = {
|
|
|
+ # "审批阶段": "审批|批复|(可行性|节能|全过程|社会稳定风险|建议书|施工图|专项法律)(评估|研究|方案|)(报告书?|造价|编制|审查|服务)+",
|
|
|
+ # "设计阶段": "设计|勘察|勘查",
|
|
|
+ # "环评阶段": "环评|(环境影响|水土保持)(评估|研究|方案|)(报告书?|造价|编制|审查|服务)+",
|
|
|
+ # "施工准备": "监理",
|
|
|
+ # "施工在建": "施工"
|
|
|
+ # }
|
|
|
+
|
|
|
+ stage_dict = {
|
|
|
+ "立项阶段": "立项|项目投资",
|
|
|
+ "可研阶段": "可行性研究|可研",
|
|
|
+ "环评阶段": "环境评价|环境影响|环境评测|环评",
|
|
|
+ "稳评阶段": "稳定风险|社会稳定|风险评估",
|
|
|
+ "咨询阶段": "(水影响|能源|交通影响|地质灾害|地址灾害|地震安全性|地震安全性|气象|雷击风险|安全|海洋|森林环境)(评[价估测])|水土保持|(水|交|灾|震|能|气|安|海|林)评",
|
|
|
+ "造价阶段": "(决算书|预算|结算|造价|决算)(编制|咨询)",
|
|
|
+ "设计阶段": "(施工图(纸|)|初步|项目|工程|工程方案)设计|测绘",
|
|
|
+ # "勘察阶段": "(勘察|勘查)设计|勘察技术|勘查|勘察",
|
|
|
+ "施工图审": "(施工图(纸|)|防雷|消防|人防)审查",
|
|
|
+ "施工许可": "施工许可证",
|
|
|
+ "施工准备": "施工准备|监理|资格预审|资审",
|
|
|
+ "施工在建": "施工",
|
|
|
+ "竣工阶段": "竣工公告|验收公告",
|
|
|
+ # "EPC总承包": "总承包|EPC"
|
|
|
+ }
|
|
|
+ # stage_dict = {
|
|
|
+ # "立项阶段": stage_dict_child.get("立项阶段"),
|
|
|
+ # "可研阶段": stage_dict_child.get("可研阶段"),
|
|
|
+ # "环评阶段": stage_dict_child.get("环评阶段") + "|" + stage_dict_child.get("稳评阶段") + "|" + stage_dict_child.get("咨询阶段"),
|
|
|
+ # "设计阶段": stage_dict_child.get("造价阶段") + "|" + stage_dict_child.get("设计阶段"),
|
|
|
+ # "施工准备": stage_dict_child.get("施工图审") + "|" + stage_dict_child.get("施工许可") + "|" + stage_dict_child.get("施工准备"),
|
|
|
+ # "施工在建": stage_dict_child.get("施工在建"),
|
|
|
+ # "竣工阶段": stage_dict_child.get("竣工阶段")
|
|
|
+ # }
|
|
|
+
|
|
|
+
|
|
|
+ stage_priority_dict = {
|
|
|
+ "立项阶段": 1,
|
|
|
+ "可研阶段": 3,
|
|
|
+ "环评阶段": 3,
|
|
|
+ "稳评阶段": 3,
|
|
|
+ "咨询阶段": 2,
|
|
|
+ "造价阶段": 2,
|
|
|
+ "设计阶段": 4,
|
|
|
+ "勘察阶段": 4,
|
|
|
+ "施工图审": 2,
|
|
|
+ "施工许可": 2,
|
|
|
+ "施工准备": 3,
|
|
|
+ "施工在建": 5,
|
|
|
+ "竣工阶段": 3,
|
|
|
+ "EPC总承包": 4
|
|
|
+ }
|
|
|
+
|
|
|
+ # stage_priority_dict = {
|
|
|
+ # "立项阶段": 1,
|
|
|
+ # "可研阶段": 2,
|
|
|
+ # "环评阶段": 2,
|
|
|
+ # "设计阶段": 2,
|
|
|
+ # "施工准备": 3,
|
|
|
+ # "施工在建": 4,
|
|
|
+ # "竣工阶段": 2,
|
|
|
+ # }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ list_stage_v = []
|
|
|
+ for k,v in stage_dict.items():
|
|
|
+ list_stage_v.append("(?P<%s>%s)"%(k,v))
|
|
|
+ stage_pattern = "|".join(list_stage_v)
|
|
|
+ return stage_pattern, stage_priority_dict
|
|
|
+
|
|
|
+def extract_legal_stage(content, _pattern, priority_dict):
|
|
|
+ # 判断这几类直接返回
|
|
|
+ if not content:
|
|
|
+ return None
|
|
|
+ if re.search("拍卖|转让|产权|出让|租赁|招租", content) is not None:
|
|
|
+ return None
|
|
|
+ # 替换混淆词
|
|
|
+ _content = re.sub("设计院|设计总院", "", content)
|
|
|
+
|
|
|
+ list_stage = []
|
|
|
+ for stage_search in re.finditer(_pattern, _content):
|
|
|
+ for k,v in stage_search.groupdict().items():
|
|
|
+ if v is not None:
|
|
|
+ list_stage.append([k, priority_dict.get(k)])
|
|
|
+ if len(list_stage)>0:
|
|
|
+ list_stage.sort(key=lambda x: x[1])
|
|
|
+ return list_stage[0][0]
|
|
|
+ return None
|
|
|
+
|
|
|
+def read_industry_keyword(_path):
|
|
|
+ df = pd.read_excel(_path)
|
|
|
+ list_data = []
|
|
|
+ for _kw,_industry,_idf in zip(df["关键词"],df["行业"],df["权重"]):
|
|
|
+ _dict = {"keyword":_kw,
|
|
|
+ "industry":_industry,
|
|
|
+ "idf":_idf}
|
|
|
+ list_data.append(_dict)
|
|
|
+ return list_data
|
|
|
+
|
|
|
+def getKeywordPattern(list_industry_keyword):
|
|
|
+ list_keyword = []
|
|
|
+ for _ik in list_industry_keyword:
|
|
|
+ list_keyword.append(_ik.get("keyword",""))
|
|
|
+ return "|".join([re.escape(i) for i in list_keyword])
|
|
|
+
|
|
|
+def getDict_keyword(list_industry_keywrod):
|
|
|
+ dict_keyword = {}
|
|
|
+ for _ik in list_industry_keywrod:
|
|
|
+ dict_keyword[_ik.get("keyword")] = _ik
|
|
|
+ return dict_keyword
|
|
|
+
|
|
|
+
|
|
|
+def extract_industry(dict_keyword,_pattern,content):
|
|
|
+ dict_industry_prob = {}
|
|
|
+ list_keyword = re.findall(_pattern,content)
|
|
|
+ for word in list_keyword:
|
|
|
+ if word!="":
|
|
|
+ _ik = dict_keyword.get(word)
|
|
|
+ if _ik is not None:
|
|
|
+ _industry = _ik.get("industry")
|
|
|
+ _idf = _ik.get("idf",0)
|
|
|
+ if _industry not in dict_industry_prob:
|
|
|
+ dict_industry_prob[_industry] = 0
|
|
|
+ dict_industry_prob[_industry] += _idf
|
|
|
+ _industry = "未知"
|
|
|
+ max_prob = 0
|
|
|
+ for k,v in dict_industry_prob.items():
|
|
|
+ if v>max_prob:
|
|
|
+ max_prob = v
|
|
|
+ _industry = k
|
|
|
+ return _industry
|
|
|
+
|
|
|
+def getWinTenderer(sub_docs_json,ots_client):
|
|
|
+ _win_tenderer = ""
|
|
|
+ _win_tenderer_contact_person = ""
|
|
|
+ _win_tenderer_contact_phone = ""
|
|
|
+ if sub_docs_json is None or sub_docs_json=="":
|
|
|
+ pass
|
|
|
+ else:
|
|
|
+ sub_docs = json.loads(sub_docs_json)
|
|
|
+ for _doc in sub_docs:
|
|
|
+ if _doc.get("win_tenderer","")!="":
|
|
|
+ _win_tenderer = _doc.get("win_tenderer","")
|
|
|
+ _win_tenderer_contact_person = _doc.get("win_tenderer_manager","")
|
|
|
+ _win_tenderer_contact_phone = _doc.get("win_tenderer_phone","")
|
|
|
+ break
|
|
|
+ # if _win_tenderer!="":
|
|
|
+ # try:
|
|
|
+ #
|
|
|
+ # en = Enterprise({"name":_win_tenderer})
|
|
|
+ # en.fix_columns(ots_client,["contacts"],False)
|
|
|
+ # list_contacts = json.loads(en.getProperties().get("contacts","[]"))
|
|
|
+ # list_contacts.sort(key=lambda x:x.get("score",0))
|
|
|
+ # if len(list_contacts)>0:
|
|
|
+ # _win_tenderer_contact_person = list_contacts[0].get("contact_person","")
|
|
|
+ # _win_tenderer_contact_phone = list_contacts[0].get("phone_no","")
|
|
|
+ # if _win_tenderer_contact_phone=="":
|
|
|
+ # _win_tenderer_contact_phone = list_contacts[0].get("mobile_no","")
|
|
|
+ #
|
|
|
+ # except Exception as e:
|
|
|
+ # pass
|
|
|
+ return _win_tenderer,_win_tenderer_contact_person,_win_tenderer_contact_phone
|
|
|
+
|
|
|
+def getIndustry(dict_industry):
|
|
|
+ list_industry = []
|
|
|
+ for k,v in dict_industry.items():
|
|
|
+ list_industry.append([k,v])
|
|
|
+ list_industry.sort(key=lambda x:x[1],reverse=True)
|
|
|
+ industry = "未知"
|
|
|
+ if len(list_industry)>0:
|
|
|
+ industry = list_industry[0][0]
|
|
|
+ if industry=="未知":
|
|
|
+ if len(list_industry)>1:
|
|
|
+ industry = list_industry[1][0]
|
|
|
+ return industry
|
|
|
+
|
|
|
+def dynamicDumplicate(list_dynamic):
|
|
|
+ _set = set()
|
|
|
+ l_d = []
|
|
|
+ for _dynamic in list_dynamic:
|
|
|
+ _key = "%s-%s"%(_dynamic.get("project_stage",""),_dynamic.get("page_time",""))
|
|
|
+ if _key in _set:
|
|
|
+ continue
|
|
|
+ _set.add(_key)
|
|
|
+ l_d.append(_dynamic)
|
|
|
+ return l_d
|
|
|
+
|
|
|
+def dynamicDumplicate2(list_dynamic):
|
|
|
+ _set = set()
|
|
|
+ l_d = []
|
|
|
+ list_dynamic.sort(key=lambda x:x.get("page_time",""))
|
|
|
+ list_dynamic.sort(key=lambda x:1 if x.get("docchannel","") in (101,119,120) else 0,reverse=True)
|
|
|
+ for _dynamic in list_dynamic:
|
|
|
+ _stage = _dynamic.get("project_stage","")
|
|
|
+ _channel = _dynamic.get("docchannel","")+_dynamic.get("sp_type","")
|
|
|
+ _key = _stage+_channel
|
|
|
+ if _key in _set or _key=="" or _key is None:
|
|
|
+ continue
|
|
|
+ _set.add(_key)
|
|
|
+ l_d.append(_dynamic)
|
|
|
+ return l_d
|
|
|
+
|
|
|
+
|
|
|
+def getMaxStage(list_dynamic,stage_order):
|
|
|
+ max_stage_index = -1
|
|
|
+ _stage = "未知"
|
|
|
+ for _dynamic in list_dynamic:
|
|
|
+ project_stage = _dynamic.get("project_stage")
|
|
|
+ if project_stage is None:
|
|
|
+ continue
|
|
|
+ if list(stage_order).count(project_stage)>0:
|
|
|
+ _index = list(stage_order).index(project_stage)
|
|
|
+ if _index>max_stage_index:
|
|
|
+ max_stage_index = _index
|
|
|
+ _stage = project_stage
|
|
|
+ return _stage
|
|
|
+
|
|
|
+class MajorUnion():
|
|
|
+
|
|
|
+ def __init__(self):
|
|
|
+ self.ots_client = getConnect_ots()
|
|
|
+ self.search_columns = [major_project_project_name,major_project_province,major_project_project_stage,major_project_plan_start_time]
|
|
|
+
|
|
|
+
|
|
|
+ self.stage_pattern,self.stage_priority_dict = get_stage_pattern()
|
|
|
+ self.current_path = os.path.abspath(os.path.dirname(__file__))
|
|
|
+
|
|
|
+ self.list_industry_keyword = read_industry_keyword(os.path.join(self.current_path,"major_project_industry_keyword.xlsx"))
|
|
|
+ self.keyword_pattern = getKeywordPattern(self.list_industry_keyword)
|
|
|
+ self.dict_keyword = getDict_keyword(self.list_industry_keyword)
|
|
|
+
|
|
|
+ self.stage_order = ["立项阶段",
|
|
|
+ "可研阶段",
|
|
|
+ "环评阶段",
|
|
|
+ "稳评阶段",
|
|
|
+ "咨询阶段",
|
|
|
+ "造价阶段",
|
|
|
+ "设计阶段",
|
|
|
+ "勘察阶段",
|
|
|
+ "施工图审",
|
|
|
+ "施工许可",
|
|
|
+ "施工准备",
|
|
|
+ "施工在建",
|
|
|
+ "竣工阶段",
|
|
|
+ "EPC总承包"
|
|
|
+ ]
|
|
|
+
|
|
|
+
|
|
|
+ def producer(self):
|
|
|
+ bool_query = BoolQuery(must_queries=[
|
|
|
+ # RangeQuery(major_project_status,1,50,True,True),
|
|
|
+ TermQuery(major_project_id,"013dbe9c24fcd80d155ec9e1d8d9eebe")
|
|
|
+ ]
|
|
|
+ )
|
|
|
+
|
|
|
+ task_queue = Queue()
|
|
|
+
|
|
|
+ rows,next_token,total_count,is_all_succeed = self.ots_client.search("major_project","major_project_index",
|
|
|
+ SearchQuery(bool_query,sort=Sort(sorters=[FieldSort("status")]),get_total_count=True,limit=100),
|
|
|
+ ColumnsToGet(self.search_columns,ColumnReturnType.SPECIFIED))
|
|
|
+ log("major producer total count:%d"%(total_count))
|
|
|
+ list_data = getRow_ots(rows)
|
|
|
+ for _data in list_data:
|
|
|
+ task_queue.put(_data)
|
|
|
+
|
|
|
+ while next_token:
|
|
|
+ rows,next_token,total_count,is_all_succeed = self.ots_client.search("major_project","major_project_index",
|
|
|
+ SearchQuery(bool_query,next_token=next_token,get_total_count=True,limit=100),
|
|
|
+ ColumnsToGet(self.search_columns,ColumnReturnType.SPECIFIED))
|
|
|
+ list_data = getRow_ots(rows)
|
|
|
+ for _data in list_data:
|
|
|
+ task_queue.put(_data)
|
|
|
+ if task_queue.qsize()>=1000:
|
|
|
+ break
|
|
|
+ return task_queue
|
|
|
+
|
|
|
+ def set_status_to_adult(self,_major):
|
|
|
+ _major.setValue(major_project_status,random.randint(201,300),True)
|
|
|
+
|
|
|
+ def comsumer(self):
|
|
|
+
|
|
|
+ def _handle(item,result_queue):
|
|
|
+ # _major = MajorProject(item)
|
|
|
+ # _major.setValue(major_project_status,1,True)
|
|
|
+ # _major.update_row(self.ots_client)
|
|
|
+ # return
|
|
|
+
|
|
|
+ project_name = item.get(major_project_project_name,"")
|
|
|
+ province = item.get(major_project_province,"")
|
|
|
+ _major = MajorProject(item)
|
|
|
+ if project_name=="":
|
|
|
+ #修改status
|
|
|
+ self.set_status_to_adult(_major)
|
|
|
+ _major.update_row(self.ots_client)
|
|
|
+ return
|
|
|
+
|
|
|
+ list_dynamics = []
|
|
|
+
|
|
|
+ if len(project_name)>6:
|
|
|
+ bool_query_sp = BoolQuery(must_queries=[
|
|
|
+ MatchPhraseQuery("page_content",project_name),
|
|
|
+ MatchPhraseQuery("province",province)
|
|
|
+ ])
|
|
|
+ else:
|
|
|
+ bool_query_sp = BoolQuery(must_queries=[
|
|
|
+ MatchPhraseQuery("page_title",project_name),
|
|
|
+ MatchPhraseQuery("province",province)
|
|
|
+ ])
|
|
|
+
|
|
|
+ rows,next_token,total_count,is_all_succeed = self.ots_client.search("t_shen_pi_xiang_mu","t_shen_pi_xiang_mu_index",
|
|
|
+ SearchQuery(bool_query_sp,limit=100),
|
|
|
+ ColumnsToGet(["province","page_title","page_content","page_time","sp_type"],ColumnReturnType.SPECIFIED))
|
|
|
+ list_data = getRow_ots(rows)
|
|
|
+ dict_industry = {}
|
|
|
+ for _data in list_data:
|
|
|
+ _content = _data.get("page_title","")+_data.get("page_content","")
|
|
|
+ _stage = extract_legal_stage(_content,self.stage_pattern,self.stage_priority_dict)
|
|
|
+ _dynamic = {"docid":str(_data.get("id")),
|
|
|
+ "doctype":2,
|
|
|
+ "doctitle":_data.get("page_title",""),
|
|
|
+ "page_time":_data.get("page_time",""),
|
|
|
+ "sp_type":str(_data.get("sp_type","")),
|
|
|
+ "project_stage":_stage}
|
|
|
+ list_dynamics.append(_dynamic)
|
|
|
+ _industry = extract_industry(self.dict_keyword,self.keyword_pattern,_content)
|
|
|
+ if _industry not in dict_industry:
|
|
|
+ dict_industry[_industry] = 0
|
|
|
+ dict_industry[_industry] += 1
|
|
|
+
|
|
|
+
|
|
|
+ log("%s search sp %d"%(item.get("id"),len(list_data)))
|
|
|
+
|
|
|
+
|
|
|
+ if len(project_name)>6:
|
|
|
+ bool_query_doc = BoolQuery(must_queries=[
|
|
|
+ BoolQuery(should_queries=[
|
|
|
+ MatchPhraseQuery("doctitle",project_name),
|
|
|
+ MatchPhraseQuery("doctextcon",project_name),
|
|
|
+ MatchPhraseQuery("attachmenttextcon",project_name),
|
|
|
+ ]),
|
|
|
+ WildcardQuery("province","%s*"%province),
|
|
|
+ RangeQuery("status",201,300,True,True)
|
|
|
+
|
|
|
+ ],must_not_queries=[
|
|
|
+ TermQuery("docchannel",106),
|
|
|
+ TermQuery("docchannel",107)
|
|
|
+ ])
|
|
|
+ else:
|
|
|
+ bool_query_doc = BoolQuery(must_queries=[
|
|
|
+ BoolQuery(should_queries=[
|
|
|
+ MatchPhraseQuery("doctitle",project_name),
|
|
|
+ ]),
|
|
|
+ WildcardQuery("province","%s*"%province),
|
|
|
+ RangeQuery("status",201,300,True,True)
|
|
|
+
|
|
|
+ ],must_not_queries=[
|
|
|
+ TermQuery("docchannel",106),
|
|
|
+ TermQuery("docchannel",107)
|
|
|
+ ])
|
|
|
+ rows,next_token,total_count,is_all_succeed = self.ots_client.search("document","document_index",
|
|
|
+ SearchQuery(bool_query_doc,limit=100),
|
|
|
+ ColumnsToGet(["doctitle","doctextcon","attachmenttextcon","page_time","docchannel","bidway","sub_docs_json","project_name"],ColumnReturnType.SPECIFIED))
|
|
|
+ list_data = getRow_ots(rows)
|
|
|
+
|
|
|
+ log("%s search doc %d"%(item.get("id"),len(list_data)))
|
|
|
+ for _data in list_data:
|
|
|
+ _content = _data.get("doctitle","")+_data.get("doctextcon","")+_data.get("attachmenttextcon","")
|
|
|
+ stage_content = _data.get("doctitle","")+_data.get("project_name","")
|
|
|
+ win_tenderer,win_tenderer_manager,win_tenderer_phone = getWinTenderer(_data.get("sub_docs_json"),self.ots_client)
|
|
|
+ _stage = extract_legal_stage(stage_content,self.stage_pattern,self.stage_priority_dict)
|
|
|
+ _dynamic = {"docid":str(_data.get("docid")),
|
|
|
+ "doctype":1,
|
|
|
+ "doctitle":_data.get("doctitle",""),
|
|
|
+ "page_time":_data.get("page_time",""),
|
|
|
+ "docchannel":_data.get("docchannel",""),
|
|
|
+ "bidway":str(_data.get("bidway","")),
|
|
|
+ "project_stage":_stage,
|
|
|
+ "win_tenderer":win_tenderer,
|
|
|
+ "win_tenderer_manager":win_tenderer_manager,
|
|
|
+ "win_tenderer_phone":win_tenderer_phone}
|
|
|
+ list_dynamics.append(_dynamic)
|
|
|
+ _industry = extract_industry(self.dict_keyword,self.keyword_pattern,_content)
|
|
|
+ if _industry not in dict_industry:
|
|
|
+ dict_industry[_industry] = 0
|
|
|
+ dict_industry[_industry] += 1
|
|
|
+ # print(list_data)
|
|
|
+ # print(list_dynamics)
|
|
|
+ list_dynamics_all = dynamicDumplicate(list_dynamics)
|
|
|
+ industry = getIndustry(dict_industry)
|
|
|
+ all_project_dynamics = json.dumps(list_dynamics_all,ensure_ascii=False)
|
|
|
+ all_project_dynamic_number = len(list_dynamics_all)
|
|
|
+
|
|
|
+ list_dynamics = dynamicDumplicate2(list_dynamics_all)
|
|
|
+ list_dynamics.sort(key=lambda x:x.get("page_time",""),reverse=True)
|
|
|
+ project_dynamic_number = len(list_dynamics)
|
|
|
+ project_dynamics = json.dumps(list_dynamics,ensure_ascii=False)
|
|
|
+ # project_stage = getMaxStage(list_dynamics,self.stage_order)
|
|
|
+ current_stage = item.get(major_project_project_stage,"")
|
|
|
+ project_stage = "未知"
|
|
|
+ latest_page_time = ""
|
|
|
+
|
|
|
+ if len(list_dynamics)>0:
|
|
|
+ list_dynamics.sort(key=lambda x:x.get("page_time",""),reverse=True)
|
|
|
+ latest_page_time = list_dynamics[0].get("page_time","")
|
|
|
+ project_stage = list_dynamics[0].get("project_stage","未知")
|
|
|
+ current_date = getCurrent_date(format="%Y")
|
|
|
+ plan_start_time = item.get(major_project_plan_start_time,"")
|
|
|
+ if (re.search("储备|前期|预备",current_stage) is not None or current_stage=="" or current_stage=="未知") and project_stage=="未知" and plan_start_time>=current_date:
|
|
|
+ project_stage = "预备阶段"
|
|
|
+
|
|
|
+ _major.setValue(major_project_industry,industry,True)
|
|
|
+ _major.setValue(major_project_project_dynamics,project_dynamics,True)
|
|
|
+ _major.setValue(major_project_project_dynamic_number,project_dynamic_number,True)
|
|
|
+ _major.setValue(major_project_project_stage,project_stage,True)
|
|
|
+ _major.setValue(major_project_latest_page_time,latest_page_time,True)
|
|
|
+ _major.setValue(major_project_update_time,getCurrent_date(format="%Y-%m-%d %H:%M:%S"),True)
|
|
|
+ _major.setValue(major_project_all_project_dynamics,all_project_dynamics,True)
|
|
|
+ _major.setValue(major_project_all_project_dynamic_number,all_project_dynamic_number,True)
|
|
|
+ self.set_status_to_adult(_major)
|
|
|
+ _major.update_row(self.ots_client)
|
|
|
+
|
|
|
+ task_queue = self.producer()
|
|
|
+
|
|
|
+ mt = MultiThreadHandler(task_queue,_handle,None,30)
|
|
|
+ mt.run()
|
|
|
+
|
|
|
+ def start_union(self):
|
|
|
+ scheduler = BlockingScheduler()
|
|
|
+ scheduler.add_job(self.comsumer,"cron",minute="*/1")
|
|
|
+ scheduler.start()
|
|
|
+
|
|
|
+def start_major_union():
|
|
|
+ mu = MajorUnion()
|
|
|
+ mu.start_union()
|
|
|
+if __name__ == '__main__':
|
|
|
+ mu = MajorUnion()
|
|
|
+ mu.comsumer()
|