|
@@ -524,7 +524,8 @@ class BaseDataMonitor():
|
|
last_date = timeAdd(current_date,-1,"%Y-%m-%d")
|
|
last_date = timeAdd(current_date,-1,"%Y-%m-%d")
|
|
check_count = 20000
|
|
check_count = 20000
|
|
query = BoolQuery(must_queries=[
|
|
query = BoolQuery(must_queries=[
|
|
- RangeQuery("status",201,301)
|
|
|
|
|
|
+ RangeQuery("status",201,301),
|
|
|
|
+ RangeQuery("docchannel",0,300)
|
|
])
|
|
])
|
|
list_doc = []
|
|
list_doc = []
|
|
queue_docid = Queue()
|
|
queue_docid = Queue()
|
|
@@ -566,14 +567,16 @@ class BaseDataMonitor():
|
|
if len(_doc.get("projects",[]))>=2:
|
|
if len(_doc.get("projects",[]))>=2:
|
|
multi_count += 1
|
|
multi_count += 1
|
|
list_multi.append(str(_doc.get("docid")))
|
|
list_multi.append(str(_doc.get("docid")))
|
|
- if _doc.get("docchannel") in (101,118,119,120):
|
|
|
|
|
|
+ if _doc.get("docchannel") in (101,118,119,120,121,122):
|
|
zhongbiao_count += 1
|
|
zhongbiao_count += 1
|
|
if len(_doc.get("projects",[]))==1:
|
|
if len(_doc.get("projects",[]))==1:
|
|
_project = _doc.get("projects")[0]
|
|
_project = _doc.get("projects")[0]
|
|
if _project.get("zhao_biao_page_time","")!="":
|
|
if _project.get("zhao_biao_page_time","")!="":
|
|
zhongbiao_find_zhaobiao += 1
|
|
zhongbiao_find_zhaobiao += 1
|
|
|
|
|
|
- if not_find_count>0 or multi_count>0 or zhongbiao_find_zhaobiao/zhongbiao_count<0.8:
|
|
|
|
|
|
+ _ratio = zhongbiao_find_zhaobiao/zhongbiao_count if zhongbiao_count>0 else 0
|
|
|
|
+
|
|
|
|
+ if not_find_count>0 or multi_count>0 or _ratio<0.8:
|
|
if not_find_count>0 or multi_count>0:
|
|
if not_find_count>0 or multi_count>0:
|
|
current_time = getCurrent_date(format="%Y-%m-%d_%H%M%S")
|
|
current_time = getCurrent_date(format="%Y-%m-%d_%H%M%S")
|
|
logname = os.path.join(self.current_path,"log","%s.log"%current_time)
|
|
logname = os.path.join(self.current_path,"log","%s.log"%current_time)
|
|
@@ -581,7 +584,7 @@ class BaseDataMonitor():
|
|
f.write(",".join(list_notfind))
|
|
f.write(",".join(list_notfind))
|
|
f.write("\n")
|
|
f.write("\n")
|
|
f.write(",".join(list_multi))
|
|
f.write(",".join(list_multi))
|
|
- _msg = "公告合并报警:近%d条成品公告,有%d条未生成项目,有%d条公告找到多个项目,详见%s;其中有%d条中标公告且找到招标公告数为%d,比率为%.3f"%(check_count,not_find_count,multi_count,logname,zhongbiao_count,zhongbiao_find_zhaobiao,zhongbiao_find_zhaobiao/zhongbiao_count)
|
|
|
|
|
|
+ _msg = "公告合并报警:近%d条成品公告,有%d条未生成项目,有%d条公告找到多个项目,详见%s;其中有%d条中标公告且找到招标公告数为%d,比率为%.3f"%(check_count,not_find_count,multi_count,logname,zhongbiao_count,zhongbiao_find_zhaobiao,_ratio)
|
|
sentMsgToDD(_msg,ACCESS_TOKEN_DATAWORKS)
|
|
sentMsgToDD(_msg,ACCESS_TOKEN_DATAWORKS)
|
|
# sendEmail(smtp_host,smtp_username,smtp_password,self.recieviers,_msg)
|
|
# sendEmail(smtp_host,smtp_username,smtp_password,self.recieviers,_msg)
|
|
else:
|
|
else:
|
|
@@ -608,17 +611,19 @@ class BaseDataMonitor():
|
|
def start_monitor(self):
|
|
def start_monitor(self):
|
|
#数据监控
|
|
#数据监控
|
|
|
|
|
|
- scheduler = BlockingScheduler()
|
|
|
|
-
|
|
|
|
- # scheduler.add_job(self.monitor_attachment,"cron",minute="*/10")
|
|
|
|
- scheduler.add_job(self.monitor_extract,"cron",minute="*/10")
|
|
|
|
- scheduler.add_job(self.monitor_proposedBuilding,"cron",hour="*/3")
|
|
|
|
- # scheduler.add_job(self.monitor_dumplicate,"cron",minute="*/10")
|
|
|
|
- scheduler.add_job(self.monitor_sychr,"cron",minute="*/10")
|
|
|
|
- scheduler.add_job(self.monitor_preproject,"cron",hour="8")
|
|
|
|
- scheduler.add_job(self.monitor_merge,"cron",hour="*/1")
|
|
|
|
- scheduler.add_job(self.monitor_init,"cron",hour="*/3")
|
|
|
|
- scheduler.start()
|
|
|
|
|
|
+ # scheduler = BlockingScheduler()
|
|
|
|
+ #
|
|
|
|
+ # # scheduler.add_job(self.monitor_attachment,"cron",minute="*/10")
|
|
|
|
+ # scheduler.add_job(self.monitor_extract,"cron",minute="*/10")
|
|
|
|
+ # scheduler.add_job(self.monitor_proposedBuilding,"cron",hour="*/3")
|
|
|
|
+ # # scheduler.add_job(self.monitor_dumplicate,"cron",minute="*/10")
|
|
|
|
+ # scheduler.add_job(self.monitor_sychr,"cron",minute="*/10")
|
|
|
|
+ # scheduler.add_job(self.monitor_preproject,"cron",hour="8")
|
|
|
|
+ # scheduler.add_job(self.monitor_merge,"cron",hour="*/1")
|
|
|
|
+ # scheduler.add_job(self.monitor_init,"cron",hour="*/3")
|
|
|
|
+ # scheduler.start()
|
|
|
|
+
|
|
|
|
+ self.monitor_merge()
|
|
|
|
|
|
def start_attach_monitor(self):
|
|
def start_attach_monitor(self):
|
|
#附件监控
|
|
#附件监控
|