Bläddra i källkod

修复附件数据处理异常问题,修复合并时掺杂拟在建和审批项目的问题

luojiehua 1 år sedan
förälder
incheckning
1777e9d8d3

+ 4 - 3
BaseDataMaintenance/dataSource/interface.py

@@ -37,10 +37,11 @@ def getAttachDealInterface(_data,_type,path="",restry=1,kwargs={},url=interface_
                         "type":_type}
             if len(kwargs.keys())>0:
                 _json.update(kwargs)
-            headers = {"Content-Type":"application/json"}
 
-            log(str(_json))
-            _resp = requests.post(url,data=_json,timeout=timeout,headers=headers)
+
+            _json["timeout"] = 10000
+            with requests.Session() as sess:
+                _resp = sess.post(url,data=_json,timeout=timeout)
 
             if _resp.status_code==200:
                 _result = json.loads(_resp.content.decode())

+ 47 - 0
BaseDataMaintenance/maxcompute/documentMerge.py

@@ -3113,6 +3113,53 @@ class f_generate_project_with_attrs_json(BaseUDTF):
             project_json = to_project_json([_group])
             self.forward(project_json)
 
+@annotate('string,string -> string,string,bigint,bigint')
+class f_fix_merge_filter(BaseUDTF):
+    '''
+    将多个组拆解成多条记录
+    '''
+
+    def __init__(self):
+        import logging
+        import json
+        global json,logging
+        logging.basicConfig(level = logging.INFO,format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+
+    def process(self,uuid,docids):
+        if docids is not None:
+            list_docid = [int(a) for a in docids.split(",")]
+            new_list_docid = []
+
+            for docid in list_docid:
+                if docid< 39400549900:
+                    new_list_docid.append(str(docid))
+            if len(new_list_docid)==0:
+                self.forward(uuid,docids,0,500)
+            else:
+                if len(list_docid)!=len(new_list_docid):
+                    self.forward(uuid,",".join(new_list_docid),len(new_list_docid),201)
+
+@annotate('string -> bigint,bigint')
+class f_fix_merge_rerun_document(BaseUDTF):
+    '''
+    将多个组拆解成多条记录
+    '''
+
+    def __init__(self):
+        import logging
+        import json
+        global json,logging
+        logging.basicConfig(level = logging.INFO,format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+
+    def process(self,docids):
+        if docids is not None:
+            list_docid = [int(a) for a in docids.split(",")]
+            docid = list_docid[0]
+            partitionkey = docid%500+1
+
+            self.forward(partitionkey,docid)
+
+
 @annotate('string -> string')
 class f_generate_project_with_delete_uuid(BaseUDTF):
     '''

+ 3 - 3
BaseDataMaintenance/model/ots/document.py

@@ -306,9 +306,9 @@ def turn_document_status():
         bool_query = BoolQuery(
             must_queries=[
                 # MatchPhraseQuery("doctitle","珠海城市职业技术学院2022年05月至2022年06月政府采购意向"),
-                WildcardQuery("web_source_no","14763*"),
-                RangeQuery("status",401,451),
-                NestedQuery("page_attachments",ExistsQuery("page_attachments.fileMd5")),
+                # WildcardQuery("web_source_no","14763*"),
+                RangeQuery("status",0,1),
+                # NestedQuery("page_attachments",ExistsQuery("page_attachments.fileMd5")),
                 # TermQuery("docid",397656324)
                 # BoolQuery(should_queries=[
                 #                           # TermQuery("tenderee","山西利民工业有限责任公司"),