|
@@ -367,8 +367,8 @@ def get_dict_entity_prob(list_entity,on_value=0.5):
|
|
|
_key_prob = _key+"$text$"+entity.entity_text
|
|
|
if in_attachment == True:
|
|
|
role_prob = 0.8 if role_prob>0.8 else role_prob #附件的概率修改低点
|
|
|
- if entity.entity_text in identified_role:
|
|
|
- continue
|
|
|
+ # if entity.entity_text in identified_role: # 2023/7/3 注释掉,选取概率最大的作为连接概率
|
|
|
+ # continue
|
|
|
if _key_prob in dict_pack_entity_prob:
|
|
|
# new_prob = role_prob+dict_pack_entity_prob[_key_prob][1] if role_prob>0.9 else max(role_prob, dict_pack_entity_prob[_key_prob][1])
|
|
|
# dict_pack_entity_prob[_key_prob] = [entity.entity_text, new_prob] #公司同角色多次出现概率累计
|
|
@@ -584,13 +584,13 @@ def getPackagesFromArticle(list_sentence, list_entity):
|
|
|
# '((施工|监理|监测|勘察|设计|劳务)(标段)?[0-9一二三四五六七八九十ⅠⅡⅢⅣⅤⅥⅦa-zA-Z]{,4}(标段?|包))|(([a-zA-Z]包[:)]?)?第?[0-9一二三四五六七八九十ⅠⅡⅢⅣⅤⅥⅦa-zA-Z]{1,4}标[段包]?)|((标[段号的包项]|([标分子]|合同|项目|采购|()包|包[组件号])[0-9一二三四五六七八九十ⅠⅡⅢⅣⅤⅥⅦA-Za-z]{1,4})|(([,;。、:(]|第)[0-9一二三四五六七八九十ⅠⅡⅢⅣⅤⅥⅦ]{1,4}分?包)|([a-zA-Z][0-9]{,3}分?[包标])|.{,1}((包组|包件|包号|分?包|标[段号的包]|子项目)编?号?[::]?[a-zA-Z0-9一二三四五六七八九十ⅠⅡⅢⅣⅤⅥⅦ-]+)|[,;。、:(]包[0-9一二三四五六七八九十ⅠⅡⅢⅣⅤⅥⅦ]{1,4}[^\w]') # 标号
|
|
|
|
|
|
package_number_pattern = re.compile(
|
|
|
- '((施工|监理|监测|勘察|设计|劳务)(标段)?:?第?([一二三四五六七八九十]+|[ⅠⅡⅢⅣⅤⅥⅦ]+|[a-zA-Z0-9]+\-?[a-zA-Z0-9-]*)?[分子]?(标[段包项]?|包[组件标]?|合同[包段]))\
|
|
|
-|(([a-zA-Z]包[:()]?)?第?([一二三四五六七八九十]+|[ⅠⅡⅢⅣⅤⅥⅦ]+|[a-zA-Z0-9]+\-?[a-zA-Z0-9-]*)[分子]?(标[段包项]?|合同[包段]))\
|
|
|
-|(([,;。、:(]|第)?([一二三四五六七八九十]+|[ⅠⅡⅢⅣⅤⅥⅦ]+|[a-zA-Z0-9]+\-?[a-zA-Z0-9-]*)[分子]?(标[段包项]?|包[组件标]?|合同[包段]))\
|
|
|
-|((标[段包项]|标段(包)|包[组件标]|[标分子(]包)(\[|【)?:?([一二三四五六七八九十]+|[ⅠⅡⅢⅣⅤⅥⅦ]+|[a-zA-Z0-9]+\-?[a-zA-Z0-9-]*))\
|
|
|
-|[,;。、:(](标的?|项目|子项目?)(\[|【)?:?([一二三四五六七八九十]+|[0-9]+)\
|
|
|
-|((([标分子(]|合同|项目|采购)包|[,。]标的|子项目|[分子]标|标[段包项]|包[组件标]?)编?号[::]?[a-zA-Z0-9一二三四五六七八九十ⅠⅡⅢⅣⅤⅥⅦ-]+)\
|
|
|
-|[,;。、:(]?(合同|分|子)?包:?([一二三四五六七八九十]+|[ⅠⅡⅢⅣⅤⅥⅦ]+|[a-zA-Z0-9]+\-?[a-zA-Z0-9-]*)')
|
|
|
+ '((施工|监理|监测|勘察|设计|劳务)(标段)?:?第?([一二三四五六七八九十]{1,3}|[ⅠⅡⅢⅣⅤⅥⅦ]{1,3}|[a-zA-Z0-9]{1,9}\-?[a-zA-Z0-9-]{,9})?[分子]?(标[段包项]?|包[组件标]?|合同[包段]))\
|
|
|
+|(([a-zA-Z]包[:()]?)?第?([一二三四五六七八九十]{1,3}|[ⅠⅡⅢⅣⅤⅥⅦ]{1,3}|[a-zA-Z0-9]{1,9}\-?[a-zA-Z0-9-]{,9})[分子]?(标[段包项]?|合同[包段]))\
|
|
|
+|(([,;。、:(]|第)?([一二三四五六七八九十]{1,3}|[ⅠⅡⅢⅣⅤⅥⅦ]{1,3}|[a-zA-Z0-9]{1,9}\-?[a-zA-Z0-9-]{,9})[分子]?(标[段包项]?|包[组件标]?|合同[包段]))\
|
|
|
+|((标[段包项]|标段(包)|包[组件标]|[标分子(]包)(\[|【)?:?([一二三四五六七八九十]{1,3}|[ⅠⅡⅢⅣⅤⅥⅦ]{1,3}|[a-zA-Z0-9]{1,9}\-?[a-zA-Z0-9-]{,9}))\
|
|
|
+|[,;。、:(](标的?|项目|子项目?)(\[|【)?:?([一二三四五六七八九十]+|[0-9]{1,9})\
|
|
|
+|((([标分子(]|合同|项目|采购)包|[,。]标的|子项目|[分子]标|标[段包项]|包[组件标]?)编?号[::]?[a-zA-Z0-9一二三四五六七八九十ⅠⅡⅢⅣⅤⅥⅦ-]{1,9})\
|
|
|
+|[,;。、:(]?(合同|分|子)?包:?([一二三四五六七八九十]{1,3}|[ⅠⅡⅢⅣⅤⅥⅦ]{1,3}|[a-zA-Z0-9]{1,9}\-?[a-zA-Z0-9-]{,9})')
|
|
|
|
|
|
other_package_pattern = re.compile(
|
|
|
'((项目|物资|设备|场次|标段|标的|产品)(名称)?)[::]([^,。]{2,50}?)[,。]') # # 2020/11/23 大网站规则 调整 package_N_name_pattern, package_N_name_pattern 中的项目 改为 子项目
|
|
@@ -598,7 +598,7 @@ def getPackagesFromArticle(list_sentence, list_entity):
|
|
|
model_pattern = re.compile('(型号|序号)[::]([^,。]{2,20})[,。]') # 2020/11/23 大网站规则 调整
|
|
|
number_pattern = re.compile("[0-9A-Za-z一二三四五六七八九十ⅠⅡⅢⅣⅤⅥⅦ]{1,4}")
|
|
|
|
|
|
- package_code_pattern = re.compile("(?:编号[::]?\s*)([-\dA-Za-z\(\)]+)")
|
|
|
+ package_code_pattern = re.compile("(?:编号[::]?\s*)([-\dA-Za-z\(\)]{1,20})")
|
|
|
# 纯数字类型的包号统一,例如:'01','1'
|
|
|
re_digital = re.compile("^\d+$")
|
|
|
|
|
@@ -935,9 +935,9 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_senten
|
|
|
yuan = []
|
|
|
for it in list_entity:
|
|
|
if it.entity_type == "money" and float(it.entity_text)>5000:
|
|
|
- if it.money_unit == '万元':
|
|
|
+ if it.money_unit == '万元' or float(it.entity_text)>5000000000:
|
|
|
wanyuan.append(it)
|
|
|
- elif it.money_unit == '元':
|
|
|
+ if it.money_unit == '元' or float(it.entity_text)<5000000:
|
|
|
yuan.append(it)
|
|
|
if wanyuan != [] and yuan != []:
|
|
|
for m1 in wanyuan:
|
|
@@ -945,7 +945,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_senten
|
|
|
if Decimal(m1.entity_text)/Decimal(m2.entity_text) == 10000:
|
|
|
m1.entity_text = m2.entity_text
|
|
|
|
|
|
-
|
|
|
+
|
|
|
#遍历所有实体
|
|
|
# while(p_entity<len(list_entity)):
|
|
|
# entity = list_entity[p_entity]
|
|
@@ -1137,7 +1137,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_senten
|
|
|
byNotTenderer_match_nums = 0 #跟在中投标人后面的属性
|
|
|
for after_index in range(ent_idx + 1, min(len(temp_entity_list), ent_idx + 4)):
|
|
|
after_entity = temp_entity_list[after_index]
|
|
|
- if entity.in_attachment != after_entity.in_attachment:
|
|
|
+ if entity.in_attachment != after_entity.in_attachment: # 正文与附件的不能相连
|
|
|
break
|
|
|
if after_entity.entity_type == link_attribute:
|
|
|
distance = (tokens_num_dict[after_entity.sentence_index] + after_entity.begin_index) - (
|
|
@@ -2593,6 +2593,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_senten
|
|
|
unit_list = [] #2021/8/17 新增,保存金额单位
|
|
|
|
|
|
#遍历所有实体
|
|
|
+ max_prob = 0 # 保存招标金额最大概率
|
|
|
while(p_entity>=0):
|
|
|
entity = list_entity[p_entity]
|
|
|
if entity.entity_type=="money":
|
|
@@ -2607,17 +2608,17 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_senten
|
|
|
|
|
|
if packageName == "Project":
|
|
|
# if PackDict["Project"]["tendereeMoney"]<float(entity.entity_text):
|
|
|
- # PackDict["Project"]["tendereeMoney"] = float(entity.entity_text)
|
|
|
+ # PackDict["Project"]["tendereeMoney"] = str(Decimal(entity.entity_text))
|
|
|
if entity.notes=="保证金" and "bond" not in PackDict["Project"]:
|
|
|
- PackDict["Project"]["bond"] = float(entity.entity_text)
|
|
|
+ PackDict["Project"]["bond"] = str(Decimal(entity.entity_text))
|
|
|
elif entity.notes=="成本警戒线" and "cost_warning" not in PackDict["Project"]:
|
|
|
- PackDict["Project"]["cost_warning"] = float(entity.entity_text)
|
|
|
+ PackDict["Project"]["cost_warning"] = str(Decimal(entity.entity_text))
|
|
|
|
|
|
else:
|
|
|
if entity.notes == "保证金" and "bond" not in PackDict[packageName]:
|
|
|
- PackDict[packageName]["bond"] = float(entity.entity_text)
|
|
|
+ PackDict[packageName]["bond"] = str(Decimal(entity.entity_text))
|
|
|
elif entity.notes == "成本警戒线" and "cost_warning" not in PackDict[packageName]:
|
|
|
- PackDict[packageName]["cost_warning"] = float(entity.entity_text)
|
|
|
+ PackDict[packageName]["cost_warning"] = str(Decimal(entity.entity_text))
|
|
|
|
|
|
elif entity.values[entity.label]>=on_value:
|
|
|
if str(entity.label)=="1":
|
|
@@ -2641,12 +2642,14 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_senten
|
|
|
|
|
|
if packageName=="Project":
|
|
|
# if PackDict["Project"]["tendereeMoney"]<float(entity.entity_text):
|
|
|
- # PackDict["Project"]["tendereeMoney"] = float(entity.entity_text)
|
|
|
- if entity.values[entity.label]>on_value:
|
|
|
- PackDict["Project"]["tendereeMoney"] = float(entity.entity_text)
|
|
|
+ # PackDict["Project"]["tendereeMoney"] = str(Decimal(entity.entity_text))
|
|
|
+ # if entity.values[entity.label]>on_value:
|
|
|
+ if entity.values[entity.label]>max_prob: # 选择最大概率招标金额
|
|
|
+ PackDict["Project"]["tendereeMoney"] = str(Decimal(entity.entity_text))
|
|
|
PackDict["Project"]["tendereeMoneyUnit"] = entity.money_unit
|
|
|
+ max_prob = entity.values[entity.label]
|
|
|
else:
|
|
|
- PackDict[packageName]["tendereeMoney"] = float(entity.entity_text)
|
|
|
+ PackDict[packageName]["tendereeMoney"] = str(Decimal(entity.entity_text))
|
|
|
PackDict[packageName]["tendereeMoneyUnit"] = entity.money_unit
|
|
|
#add pointer_tendereeMoney
|
|
|
packagePointer.pointer_tendereeMoney = entity
|
|
@@ -2720,7 +2723,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_senten
|
|
|
# 2021/7/16 #增加判断中标金额是否远大于招标金额逻辑
|
|
|
for pack in PackDict.keys():
|
|
|
for i in range(len(PackDict[pack]["roleList"])):
|
|
|
- if PackDict[pack]["tendereeMoney"] > 0:
|
|
|
+ if float(PackDict[pack]["tendereeMoney"]) > 0:
|
|
|
# print('金额数据类型:',type(PackDict[pack]["roleList"][i].money))
|
|
|
if float(PackDict[pack]["roleList"][i].money) >10000000 and \
|
|
|
float(PackDict[pack]["roleList"][i].money)/float(PackDict[pack]["tendereeMoney"])>=1000:
|
|
@@ -2729,7 +2732,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_senten
|
|
|
# 2022/04/01 #增加判断中标金额是否远小于招标金额逻辑,比例相差10000倍左右(中标金额“万”单位丢失或未识别)
|
|
|
for pack in PackDict.keys():
|
|
|
for i in range(len(PackDict[pack]["roleList"])):
|
|
|
- if PackDict[pack]["tendereeMoney"] > 0 and float(PackDict[pack]["roleList"][i].money) > 0.:
|
|
|
+ if float(PackDict[pack]["tendereeMoney"]) > 0 and float(PackDict[pack]["roleList"][i].money) > 0.:
|
|
|
if float(PackDict[pack]["roleList"][i].money) < 1000 and \
|
|
|
float(PackDict[pack]["tendereeMoney"])/float(PackDict[pack]["roleList"][i].money)>=9995 and \
|
|
|
float(PackDict[pack]["tendereeMoney"])/float(PackDict[pack]["roleList"][i].money)<11000:
|
|
@@ -3352,8 +3355,8 @@ def getOtherAttributes(list_entity):
|
|
|
dict_other["person_review"].append(entity.entity_text)
|
|
|
elif entity.entity_type=='product' and entity.entity_text not in dict_other["product"]: #顺序去重保留
|
|
|
dict_other["product"].append(entity.entity_text)
|
|
|
- elif entity.entity_type=='money' and entity.notes=='总投资' and dict_other["total_tendereeMoney"]<float(entity.entity_text):
|
|
|
- dict_other["total_tendereeMoney"] = float(entity.entity_text)
|
|
|
+ elif entity.entity_type=='money' and entity.notes=='总投资' and float(dict_other["total_tendereeMoney"])<float(entity.entity_text):
|
|
|
+ dict_other["total_tendereeMoney"] = str(Decimal(entity.entity_text))
|
|
|
dict_other["total_tendereeMoneyUnit"] = entity.money_unit
|
|
|
if list_serviceTime:
|
|
|
list_serviceTime.sort(key=lambda x:x.prob,reverse=True)
|
|
@@ -3406,8 +3409,8 @@ def correct_rolemoney(prem, total_product_money, list_articles): # 2022/9/26修
|
|
|
content += attachment
|
|
|
else:
|
|
|
content = list_articles[0].content
|
|
|
- if len(re.findall('win_tenderer|second_tenderer|third_tenderer', str(prem[0]['prem'])))==1 and re.search('(中标|成交|合同))?(总?金额|[单报总]?价):', content) == None: # 只有一个中标角色且没有明确中标金额表达的
|
|
|
- if total_product_money>0:
|
|
|
+ if len(re.findall('win_tenderer|second_tenderer|third_tenderer', str(prem[0]['prem'])))==1 and re.search('(中标|成交|合同))?(总?金额|[报总]?价):', content) == None: # 只有一个中标角色且没有明确中标金额表达的
|
|
|
+ if total_product_money>0 and total_product_money<5000000000:
|
|
|
for value in prem[0]['prem'].values():
|
|
|
for l in value['roleList']:
|
|
|
try:
|
|
@@ -3436,7 +3439,101 @@ def correct_rolemoney(prem, total_product_money, list_articles): # 2022/9/26修
|
|
|
except Exception as e:
|
|
|
print('修正中标价格报错:%s' % e)
|
|
|
|
|
|
-def limit_maximum_amount(prem, industry):
|
|
|
+def limit_maximum_amount(dic, list_entity):
|
|
|
+ '''
|
|
|
+ 通过关键词、行业、公告类别等设置最高最低角色金额
|
|
|
+ :param dic: 最终返回所有字段结果字典
|
|
|
+ :param list_entity: 实体列表
|
|
|
+ :return:
|
|
|
+ '''
|
|
|
+ title = dic.get('doctitle_refine', '')
|
|
|
+ name = dic.get('name', '')
|
|
|
+ product = ','.join(dic.get('product', []))
|
|
|
+ text = "%s;%s;%s"%(title, name, product)
|
|
|
+ doctype = dic.get('docchannel', {}).get('doctype', '') # 公告类型
|
|
|
+ industry = dic['industry'].get('class_name', '')
|
|
|
+ category = dic['industry'].get('class', '') # 行业门类
|
|
|
+ moneys = [float(it.entity_text) for it in list_entity if it.entity_type=='money' and re.search('^\d+(\.\d+)?', it.entity_text) and 5000<float(it.entity_text)<5000000]
|
|
|
+ maximum_amount = 10000000000
|
|
|
+ minximum_amount = 100
|
|
|
+ if re.search('监理|造价咨询|设计|勘察|招标代理中介服务|工程审计', text) and re.search('施工|总承包|ppp', text.replace('施工监理', '监理'))==None:
|
|
|
+ # print('监理设计等限额')
|
|
|
+ maximum_amount = 1000000000
|
|
|
+ minximum_amount = 200
|
|
|
+ elif re.search('施工|总承包|ppp|公路|道路|桥梁|铁路|土地使用权|地块|棚改|征地拆迁|棚户区改造|土地征收|建设用地|社会保险', text) or category in ['金融业', '建筑业'] or doctype == '土地矿产':
|
|
|
+ # print('施工、铁路等限额')
|
|
|
+ if industry in ['科研、医疗、教育用房', '住宅、商业用房', '场馆、站港用房','工业、生产用房','专业施工']:
|
|
|
+ maximum_amount = 20000000000
|
|
|
+ minximum_amount = 200
|
|
|
+ elif industry in ['修缮工程', '电气安装', '管道和设备安装', '建筑装饰和装修业', '建筑物拆除和场地准备活动']:
|
|
|
+ maximum_amount = 10000000000
|
|
|
+ minximum_amount = 100
|
|
|
+ else:
|
|
|
+ maximum_amount = 50000000000
|
|
|
+ minximum_amount = 500
|
|
|
+ elif re.search('(办公|体育)(用品|设备|器材)|耗材|打印机|复印机|打印纸|粉盒|墨粉|复印纸|网上超市|电子卖场|家电|配电箱采购|配件|备件', text) or category in ['零售批发']:
|
|
|
+ # print('商品采购限额')
|
|
|
+ maximum_amount = 80000000
|
|
|
+ minximum_amount = 10
|
|
|
+ elif re.search('修理|维修|(安保|保安|安全|保洁|物业|后勤|管理|代理|中介|印刷)服务', text):
|
|
|
+ # print('维修限额')
|
|
|
+ maximum_amount = 50000000
|
|
|
+ elif re.search('(速递|快递|邮政|邮寄)(物流)?服务', text):
|
|
|
+ # print('快递限额')
|
|
|
+ maximum_amount = 80000000
|
|
|
+ minximum_amount = 10
|
|
|
+ # print('maximum_amount:', maximum_amount)
|
|
|
+ for value in dic['prem'].values():
|
|
|
+ for l in value['roleList']:
|
|
|
+ if l["role_name"] in ['win_tenderer', 'second_tenderer', 'third_tenderer']:
|
|
|
+ date = float(re.search('(\d+)天', l.get('serviceTime', '')).group(1)) if re.search('(\d+)天', l.get('serviceTime', '')) else 0
|
|
|
+ if 0 < date < 180 and float(l["role_money"]['money']) > 10000000000: # 工期小于180天且金额大于百亿的,错误
|
|
|
+ l["role_money"]['money'] = str(Decimal(l["role_money"]['money']) / 10000)
|
|
|
+ # print('工期纠正百亿以上金额 ')
|
|
|
+ elif float(l["role_money"]['money']) > maximum_amount:
|
|
|
+ flag = 1
|
|
|
+ for money in moneys:
|
|
|
+ if float(l["role_money"]['money'])/money == 10000 and l['role_money']['money_unit'] == '万元':
|
|
|
+ l["role_money"]['money'] = str(Decimal(l["role_money"]['money']) / 10000)
|
|
|
+ # print('万倍关系纠正连接金额')
|
|
|
+ flag = 0
|
|
|
+ break
|
|
|
+ if flag and l["role_money"]['money_unit'] == '万元' or re.search('^\d{11,}(\.0)?$', str(l["role_money"]['money'])):
|
|
|
+ l["role_money"]['money'] = str(Decimal(l["role_money"]['money']) / 10000)
|
|
|
+ # print('行业限额纠正连接金额')
|
|
|
+ # elif flag and l["role_money"]['money_unit'] == '元':
|
|
|
+ # l["role_money"]['money'] = 0
|
|
|
+ elif 0<float(l["role_money"]['money']) < minximum_amount:
|
|
|
+ if l["role_money"]['money_unit'] == '元' and re.search('^\d{1,2}\.\d{4,6}$', str(l["role_money"]['money'])):
|
|
|
+ # print('单位元小金额且格式类似万元的乘以万倍')
|
|
|
+ l["role_money"]['money'] = str(Decimal(l["role_money"]['money']) * 10000)
|
|
|
+ else:
|
|
|
+ # print('中标金额小于限额:%d元 去除' % minximum_amount)
|
|
|
+ l["role_money"]['money'] = 0
|
|
|
+
|
|
|
+ if float(value['tendereeMoney']) > maximum_amount:
|
|
|
+ flag = 1
|
|
|
+ for money in moneys:
|
|
|
+ if float(value['tendereeMoney'])/money == 10000 and l['role_money']['money_unit'] == '万元':
|
|
|
+ value['tendereeMoney'] = str(Decimal(value['tendereeMoney'])/10000)
|
|
|
+ # print('万倍关系纠正连接金额')
|
|
|
+ flag = 0
|
|
|
+ break
|
|
|
+ if flag and value['tendereeMoneyUnit'] == '万元' or re.search('^\d{11,}(\.0)?$', str(value['tendereeMoney'])):
|
|
|
+ value['tendereeMoney'] = str(Decimal(value['tendereeMoney']) / 10000)
|
|
|
+ # print('行业限额纠正连接金额')
|
|
|
+ # elif flag and value['tendereeMoneyUnit'] == '元':
|
|
|
+ # value['tendereeMoney'] = 0
|
|
|
+ elif 0<float(value['tendereeMoney']) < minximum_amount:
|
|
|
+ if value['tendereeMoneyUnit'] == '元' and re.search('^\d{1,2}\.\d{4,6}$', str(value['tendereeMoney'])):
|
|
|
+ # print('单位元小金额且格式类似万元的乘以万倍')
|
|
|
+ value['tendereeMoney'] = str(Decimal(value['tendereeMoney']) * 10000)
|
|
|
+ else:
|
|
|
+ # print('招标金额小于限额:%d元 去除' % minximum_amount)
|
|
|
+ value['tendereeMoney'] = 0
|
|
|
+
|
|
|
+
|
|
|
+def limit_maximum_amount_backup(prem, industry):
|
|
|
indu = industry['industry'].get('class_name', '')
|
|
|
indu_amount = {
|
|
|
'计算机设备': 200000000,
|
|
@@ -3602,7 +3699,7 @@ def update_prem(old_prem, new_prem):
|
|
|
for d2 in v['roleList']:
|
|
|
if d2 not in tmp_l: # 把新预测有,旧没有的角色添加上去
|
|
|
old_prem[k]['roleList'].append(d2)
|
|
|
- if len(old_prem)>1 and 'Project' in old_prem:
|
|
|
+ if len(new_prem)>1 and 'Project' in old_prem and 'win_tenderer' in str(new_prem): # 表格提取到中标人的,去掉project包中标人
|
|
|
for d in old_prem['Project']['roleList']:
|
|
|
if d['role_name'] in ['win_tenderer', 'second_tenderer', 'third_tenderer']:
|
|
|
old_prem['Project']['roleList'].remove(d) # 提取到其他包,去掉 project 里面的中标角色
|