Sfoglia il codice sorgente

修复多标段中标公告合到单标段招标时uuid一样的错误

luojiehua 4 mesi fa
parent
commit
103f856aea

+ 1 - 1
BaseDataMaintenance/maintenance/dataflow.py

@@ -4577,7 +4577,7 @@ if __name__ == '__main__':
     # test_attachment_interface()
     df_dump = Dataflow_dumplicate(start_delete_listener=False)
     # df_dump.start_flow_dumplicate()
-    df_dump.test_dumplicate(583554643
+    df_dump.test_dumplicate(583564377
                             )
     # compare_dumplicate_check()
     # df_dump.test_merge([391898061

+ 19 - 1
BaseDataMaintenance/maxcompute/documentMerge.py

@@ -3111,8 +3111,10 @@ def update_document_from_dynamic(_proj):
 def to_project_json(projects):
 
     list_proj = []
+    used_uuid = set()
     for _proj in projects:
         _uuid = _proj.get(project_uuid,"")
+
         update_uuid = _proj.get("update_uuid","")
         _project_uuid = _proj.get("project_uuid","")
         if "enterprise" in _proj:
@@ -3123,7 +3125,12 @@ def to_project_json(projects):
             list_update_uuid.append(_project_uuid)
         list_update_uuid = list(set(list_update_uuid))
         if len(list_uuid)>0:
-            _proj["keep_uuid"] = list_uuid[0]
+            _proj["keep_uuid"] = ""
+            for _uuid in list_uuid:
+                if _uuid not in used_uuid:
+                    used_uuid.add(_uuid)
+                    _proj["keep_uuid"] = list_uuid[0]
+
             _proj["delete_uuid"] = ",".join(list_uuid[1:])
             list_update_uuid.extend(list_uuid[1:])
             _proj["update_uuid"] = ",".join(list_update_uuid)
@@ -3144,6 +3151,17 @@ def to_project_json(projects):
         if "project_uuid" in _proj:
             _proj.pop("project_uuid")
         update_document_from_dynamic(_proj)
+    for _proj in projects:
+        delete_uuid = _proj.get("delete_uuid","")
+        _find = False
+        l_uuid = []
+        for _uuid in delete_uuid.split(","):
+            if _uuid in used_uuid:
+                _find = True
+            else:
+                l_uuid.append(_uuid)
+        if _find:
+            _proj["delete_uuid"] = ",".join(l_uuid)
     return json.dumps(list_proj,cls=MyEncoder,ensure_ascii=False)
 
 def get_page_time_dis(page_time,n_page_time):