|
@@ -1716,6 +1716,7 @@ def generate_packages_properties(list_docs):
|
|
win_tenderer = _d.get(project_win_tenderer,"")
|
|
win_tenderer = _d.get(project_win_tenderer,"")
|
|
win_bid_price = _d.get(project_win_bid_price,"")
|
|
win_bid_price = _d.get(project_win_bid_price,"")
|
|
|
|
|
|
|
|
+
|
|
if sub_project_name=="Project":
|
|
if sub_project_name=="Project":
|
|
|
|
|
|
win_exists = False
|
|
win_exists = False
|
|
@@ -2203,16 +2204,19 @@ def update_projects_by_project(project_dict,projects):
|
|
set_delete_uuid = set()
|
|
set_delete_uuid = set()
|
|
set_nlp_enterprise = set()
|
|
set_nlp_enterprise = set()
|
|
set_nlp_enterprise_attachment = set()
|
|
set_nlp_enterprise_attachment = set()
|
|
|
|
+ set_update_uuid = set()
|
|
for _proj in projects:
|
|
for _proj in projects:
|
|
_docids = _proj.get(project_docids,"")
|
|
_docids = _proj.get(project_docids,"")
|
|
_codes = _proj.get(project_project_codes,"")
|
|
_codes = _proj.get(project_project_codes,"")
|
|
_product = _proj.get(project_product,"")
|
|
_product = _proj.get(project_product,"")
|
|
_uuid = _proj.get(project_uuid,"")
|
|
_uuid = _proj.get(project_uuid,"")
|
|
|
|
+ update_uuid = _proj.get("project_uuid","")
|
|
delete_uuid = _proj.get(project_delete_uuid,"")
|
|
delete_uuid = _proj.get(project_delete_uuid,"")
|
|
set_docid = set_docid | set(_docids.split(","))
|
|
set_docid = set_docid | set(_docids.split(","))
|
|
set_code = set_code | set(_codes.split(","))
|
|
set_code = set_code | set(_codes.split(","))
|
|
set_product = set_product | set(_product.split(","))
|
|
set_product = set_product | set(_product.split(","))
|
|
set_uuid = set_uuid | set(_uuid.split(","))
|
|
set_uuid = set_uuid | set(_uuid.split(","))
|
|
|
|
+ set_update_uuid = set_update_uuid | set(update_uuid.split(","))
|
|
set_delete_uuid = set_delete_uuid | set(delete_uuid.split(","))
|
|
set_delete_uuid = set_delete_uuid | set(delete_uuid.split(","))
|
|
try:
|
|
try:
|
|
set_nlp_enterprise |= set(json.loads(_proj.get(project_nlp_enterprise,"[]")))
|
|
set_nlp_enterprise |= set(json.loads(_proj.get(project_nlp_enterprise,"[]")))
|
|
@@ -2225,6 +2229,7 @@ def update_projects_by_project(project_dict,projects):
|
|
|
|
|
|
set_uuid = set_uuid | set(project_dict.get(project_uuid,"").split(","))
|
|
set_uuid = set_uuid | set(project_dict.get(project_uuid,"").split(","))
|
|
set_delete_uuid = set_delete_uuid | set(project_dict.get(project_delete_uuid,"").split(","))
|
|
set_delete_uuid = set_delete_uuid | set(project_dict.get(project_delete_uuid,"").split(","))
|
|
|
|
+ set_update_uuid = set_update_uuid | set(project_dict.get("project_uuid","").split(","))
|
|
|
|
|
|
try:
|
|
try:
|
|
set_nlp_enterprise |= set(json.loads(project_dict.get(project_nlp_enterprise,"[]")))
|
|
set_nlp_enterprise |= set(json.loads(project_dict.get(project_nlp_enterprise,"[]")))
|
|
@@ -2238,6 +2243,7 @@ def update_projects_by_project(project_dict,projects):
|
|
append_dict[project_product] = ",".join([a for a in list(set_product) if a!=""][:30])
|
|
append_dict[project_product] = ",".join([a for a in list(set_product) if a!=""][:30])
|
|
append_dict[project_uuid] = ",".join([a for a in list(set_uuid) if a!=""])
|
|
append_dict[project_uuid] = ",".join([a for a in list(set_uuid) if a!=""])
|
|
append_dict[project_delete_uuid] = ",".join([a for a in list(set_delete_uuid) if a!=""])
|
|
append_dict[project_delete_uuid] = ",".join([a for a in list(set_delete_uuid) if a!=""])
|
|
|
|
+ append_dict["update_uuid"] = ",".join([a for a in list(set_update_uuid) if a!=""])
|
|
append_dict[project_nlp_enterprise] = json.dumps(list(set_nlp_enterprise)[:100],ensure_ascii=False)
|
|
append_dict[project_nlp_enterprise] = json.dumps(list(set_nlp_enterprise)[:100],ensure_ascii=False)
|
|
append_dict[project_nlp_enterprise_attachment] = json.dumps(list(set_nlp_enterprise_attachment)[:100],ensure_ascii=False)
|
|
append_dict[project_nlp_enterprise_attachment] = json.dumps(list(set_nlp_enterprise_attachment)[:100],ensure_ascii=False)
|
|
|
|
|
|
@@ -2928,12 +2934,24 @@ def to_project_json(projects):
|
|
list_proj = []
|
|
list_proj = []
|
|
for _proj in projects:
|
|
for _proj in projects:
|
|
_uuid = _proj.get(project_uuid,"")
|
|
_uuid = _proj.get(project_uuid,"")
|
|
|
|
+ update_uuid = _proj.get("update_uuid","")
|
|
|
|
+ _project_uuid = _proj.get("project_uuid","")
|
|
if "enterprise" in _proj:
|
|
if "enterprise" in _proj:
|
|
_proj.pop("enterprise")
|
|
_proj.pop("enterprise")
|
|
list_uuid = [a for a in _uuid.split(",") if a!=""]
|
|
list_uuid = [a for a in _uuid.split(",") if a!=""]
|
|
|
|
+ list_update_uuid = [a for a in update_uuid.split(",") if a!=""]
|
|
|
|
+ if _project_uuid:
|
|
|
|
+ list_update_uuid.append(_project_uuid)
|
|
|
|
+ list_update_uuid = list(set(list_update_uuid))
|
|
if len(list_uuid)>0:
|
|
if len(list_uuid)>0:
|
|
_proj["keep_uuid"] = list_uuid[0]
|
|
_proj["keep_uuid"] = list_uuid[0]
|
|
_proj["delete_uuid"] = ",".join(list_uuid[1:])
|
|
_proj["delete_uuid"] = ",".join(list_uuid[1:])
|
|
|
|
+ list_update_uuid.extend(list_uuid[1:])
|
|
|
|
+ _proj["update_uuid"] = ",".join(list_update_uuid)
|
|
|
|
+ elif len(list_update_uuid)>0:
|
|
|
|
+ _proj["keep_uuid"] = list_update_uuid[0]
|
|
|
|
+ _proj["delete_uuid"] = _proj.get("delete_uuid","")
|
|
|
|
+ _proj["update_uuid"] = ",".join(list_update_uuid[1:])
|
|
else:
|
|
else:
|
|
_proj["keep_uuid"] = _proj.get("keep_uuid","")
|
|
_proj["keep_uuid"] = _proj.get("keep_uuid","")
|
|
to_delete = _proj.get("to_delete","")
|
|
to_delete = _proj.get("to_delete","")
|
|
@@ -2944,6 +2962,8 @@ def to_project_json(projects):
|
|
list_proj.append(_proj)
|
|
list_proj.append(_proj)
|
|
if project_uuid in _proj:
|
|
if project_uuid in _proj:
|
|
_proj.pop(project_uuid)
|
|
_proj.pop(project_uuid)
|
|
|
|
+ if "project_uuid" in _proj:
|
|
|
|
+ _proj.pop("project_uuid")
|
|
return json.dumps(list_proj,cls=MyEncoder,ensure_ascii=False)
|
|
return json.dumps(list_proj,cls=MyEncoder,ensure_ascii=False)
|
|
|
|
|
|
def get_page_time_dis(page_time,n_page_time):
|
|
def get_page_time_dis(page_time,n_page_time):
|