Эх сурвалжийг харах

优化合并规则;调试线上json格式问题

luojiehua 2 жил өмнө
parent
commit
23acc194e9

+ 3 - 2
BaseDataMaintenance/maintenance/dataflow_mq.py

@@ -1165,7 +1165,7 @@ class Dataflow_init(Dataflow):
                 _d = {document_tmp_partitionkey:_data.get(document_tmp_partitionkey),
                       document_tmp_docid:_data.get(document_tmp_docid),
                       document_tmp_status:0}
-                _document = Document(_d)
+                _document = Document_tmp(_d)
                 page_attachments = _data.get(document_tmp_attachment_path,"[]")
 
                 _document_html = Document_html(_data)
@@ -1180,6 +1180,7 @@ class Dataflow_init(Dataflow):
                     _data[document_tmp_status] = status
                     send_succeed = send_msg_toacmq(self.pool_mq,json.dumps(_document_html.getProperties(),cls=MyEncoder),self.mq_extract)
                 if send_succeed:
+                    _document.setValue(document_tmp_status,1,True)
                     _document.update_row(self.ots_client)
                 else:
                     log("send_msg_error2222")
@@ -1192,7 +1193,7 @@ class Dataflow_init(Dataflow):
                     _d = {document_tmp_partitionkey:_data.get(document_tmp_partitionkey),
                           document_tmp_docid:_data.get(document_tmp_docid),
                           document_tmp_status:0}
-                    _document = Document(_d)
+                    _document = Document_tmp(_d)
                     page_attachments = _data.get(document_tmp_attachment_path,"[]")
 
                     _document_html = Document_html(_data)

+ 11 - 161
BaseDataMaintenance/test/ab.py

@@ -1,6 +1,7 @@
 
 
 from BaseDataMaintenance.model.ots.document_extract2 import *
+from BaseDataMaintenance.model.ots.document_tmp import *
 
 from BaseDataMaintenance.dataSource.source import getConnect_ots
 
@@ -14,167 +15,16 @@ print(test_str)
 
 _d = {document_extract2_docid:docid,
       document_extract2_partitionkey:docid%500+1,
-      "test_str":test_str}
-_extract = Document_extract(_d)
-
-
-_json = '''{
-    "attachmentTypes": "xls",
-    "bidway": "公开招标",
-    "candidate": "",
-    "code": [
-        "8110-XJ-2212-25925",
-        "GG-221215-01433",
-        "200000205415",
-        "200000205774"
-    ],
-    "cost_time": {
-        "attrs": 10.43,
-        "codename": 0.7,
-        "deposit": 0.0,
-        "district": 0.08,
-        "moneygrade": 0.0,
-        "nerToken": 0.76,
-        "person": 10.31,
-        "prem": 2.04,
-        "preprocess": 6.62,
-        "product": 0.35,
-        "product_attrs": 0.01,
-        "roleRuleFinal": 0.01,
-        "rolegrade": 0.0,
-        "rule": 0.01,
-        "rule_channel": 0.26,
-        "tableToText": 5.75,
-        "tendereeRuleRecall": 0.01,
-        "time": 0.41,
-        "total_unit_money": 0.0
-    },
-    "demand_info": {
-        "data": [],
-        "header": [],
-        "header_col": []
-    },
-    "deposit_patment_way": "",
-    "district": {
-        "area": "西南",
-        "city": "未知",
-        "district": "未知",
-        "is_in_text": false,
-        "province": "云南"
-    },
-    "docchannel": {
-        "docchannel": "招标公告",
-        "doctype": "采招数据",
-        "life_docchannel": "招标公告"
-    },
-    "docid": "",
-    "doctitle_refine": "",
-    "exist_table": 1,
-    "extract_count": 3,
-    "fail_reason": "",
-    "fingerprint": "md5=c0e93670c3c537c43429fce633536233",
-    "industry": {
-        "class": "零售批发",
-        "class_name": "其他交通运输设备",
-        "subclass": "专用设备"
-    },
-    "match_enterprise": [],
-    "match_enterprise_type": 0,
-    "moneysource": "",
-    "name": "双腿链条索具&DSL-WLL3TON\\\\载荷3t",
-    "nlp_enterprise": [
-        "云南锡业集团物流有限公司",
-        "云南锡业集团"
-    ],
-    "nlp_enterprise_attachment": [],
-    "person_review": [],
-    "prem": {
-        "Project": {
-            "code": "",
-            "roleList": [
-                {
-                    "address": "",
-                    "linklist": [
-                        [
-                            "郑雯",
-                            ""
-                        ]
-                    ],
-                    "role_money": {
-                        "discount_ratio": "",
-                        "downward_floating_ratio": "",
-                        "floating_ratio": "",
-                        "money": 0,
-                        "money_unit": ""
-                    },
-                    "role_name": "tenderee",
-                    "role_text": "云南锡业集团物流有限公司",
-                    "serviceTime": ""
-                }
-            ],
-            "tendereeMoney": 0,
-            "tendereeMoneyUnit": ""
-        }
-    },
-    "process_time": "2022-12-19 17:02:23",
-    "product": [
-        "吊链"
-    ],
-    "product_attrs": {
-        "data": [
-            {
-                "brand": "",
-                "product": "双腿链条索具&DSL-WLL3TON/载荷3t",
-                "quantity": "4",
-                "quantity_unit": "付",
-                "specs": "DSL-WLL3TON/载荷3T",
-                "unitPrice": ""
-            },
-            {
-                "brand": "",
-                "product": "四钩吊链&2t/链长500mm",
-                "quantity": "1",
-                "quantity_unit": "个",
-                "specs": "2T/链长500MM",
-                "unitPrice": ""
-            }
-        ],
-        "header": [
-            "标的名称_数量_单位___规格型号"
-        ],
-        "header_col": [
-            "标的编码_标的名称_规格型号_单位_数量"
-        ]
-    },
-    "serviceTime": "",
-    "success": true,
-    "time_bidclose": "",
-    "time_bidopen": "2022-12-19",
-    "time_bidstart": "",
-    "time_commencement": "",
-    "time_completion": "",
-    "time_earnestMoneyEnd": "",
-    "time_earnestMoneyStart": "",
-    "time_getFileEnd": "",
-    "time_getFileStart": "",
-    "time_listingEnd": "",
-    "time_listingStart": "",
-    "time_publicityEnd": "",
-    "time_publicityStart": "",
-    "time_registrationEnd": "2022-12-19",
-    "time_registrationStart": "",
-    "time_release": "2022-12-15",
-    "total_tendereeMoney": 0,
-    "total_tendereeMoneyUnit": "",
-    "version_date": "2022-12-13"
-}
-'''
-
-_extract.setValue(document_extract2_extract_json,"{}",True)
-_extract.setValue(document_extract2_industry_json,"{}",True)
-_extract.setValue(document_extract2_status,1,True)
-_extract.setValue(document_extract2_extract_json,_json,True)
-_extract.update_row(ots_client)
+      document_tmp_status:0}
+_dtmp = Document_tmp(_d)
+_dtmp.update_row(ots_client)
+
+# _extract = Document_extract(_d)
+# _extract.setValue(document_extract2_extract_json,"{}",True)
+# _extract.setValue(document_extract2_industry_json,"{}",True)
+# _extract.setValue(document_extract2_status,1,True)
+# _extract.setValue(document_extract2_extract_json,_json,True)
+# _extract.update_row(ots_client)
 
 #
 # _p.update_row(ots_client)