|
@@ -795,11 +795,14 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
if packDict[packageName]["roleList"][i].money_prob==0 : # 2021/7/20第一次更新金额
|
|
if packDict[packageName]["roleList"][i].money_prob==0 : # 2021/7/20第一次更新金额
|
|
packDict[packageName]["roleList"][i].money = money.entity_text
|
|
packDict[packageName]["roleList"][i].money = money.entity_text
|
|
packDict[packageName]["roleList"][i].money_prob = money_prob
|
|
packDict[packageName]["roleList"][i].money_prob = money_prob
|
|
|
|
+ packDict[packageName]["roleList"][i].money_unit = money.money_unit
|
|
elif money_prob>packDict[packageName]["roleList"][i].money_prob+0.2 or money.notes in ['大写']: # 2021/7/20改为优先选择大写金额,
|
|
elif money_prob>packDict[packageName]["roleList"][i].money_prob+0.2 or money.notes in ['大写']: # 2021/7/20改为优先选择大写金额,
|
|
# print('已连接金额概率:money_prob:',packDict[packageName]["roleList"][i].money_prob)
|
|
# print('已连接金额概率:money_prob:',packDict[packageName]["roleList"][i].money_prob)
|
|
# print('链接金额备注 ',money.notes, money.entity_text, money.values)
|
|
# print('链接金额备注 ',money.notes, money.entity_text, money.values)
|
|
packDict[packageName]["roleList"][i].money = money.entity_text
|
|
packDict[packageName]["roleList"][i].money = money.entity_text
|
|
packDict[packageName]["roleList"][i].money_prob = money_prob
|
|
packDict[packageName]["roleList"][i].money_prob = money_prob
|
|
|
|
+ packDict[packageName]["roleList"][i].money_unit = money.money_unit
|
|
|
|
+ # print('链接中的金额:{0}, 单位:{1}'.format(money.entity_text, money.money_unit))
|
|
return packDict
|
|
return packDict
|
|
|
|
|
|
#根据实体名称得到角色
|
|
#根据实体名称得到角色
|
|
@@ -1826,6 +1829,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
|
|
|
|
set_tenderer_money = set()
|
|
set_tenderer_money = set()
|
|
list_tenderer_money = [] #2021/7/16 新增列表,倒序保存所有中标金额
|
|
list_tenderer_money = [] #2021/7/16 新增列表,倒序保存所有中标金额
|
|
|
|
+ unit_list = [] #2021/8/17 新增,保存金额单位
|
|
|
|
|
|
#遍历所有实体
|
|
#遍历所有实体
|
|
while(p_entity>=0):
|
|
while(p_entity>=0):
|
|
@@ -1835,6 +1839,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
if str(entity.label)=="1":
|
|
if str(entity.label)=="1":
|
|
set_tenderer_money.add(float(entity.entity_text))
|
|
set_tenderer_money.add(float(entity.entity_text))
|
|
list_tenderer_money.append(float(entity.entity_text)) # 2021/7/16 新增列表,倒序保存所有中标金额
|
|
list_tenderer_money.append(float(entity.entity_text)) # 2021/7/16 新增列表,倒序保存所有中标金额
|
|
|
|
+ unit_list.append(entity.money_unit)
|
|
# if str(entity.label)=="0":
|
|
# if str(entity.label)=="0":
|
|
if str(entity.label)=="0" and entity.notes!='总投资':
|
|
if str(entity.label)=="0" and entity.notes!='总投资':
|
|
'''
|
|
'''
|
|
@@ -1855,8 +1860,10 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
# PackDict["Project"]["tendereeMoney"] = float(entity.entity_text)
|
|
# PackDict["Project"]["tendereeMoney"] = float(entity.entity_text)
|
|
if entity.values[entity.label]>on_value:
|
|
if entity.values[entity.label]>on_value:
|
|
PackDict["Project"]["tendereeMoney"] = float(entity.entity_text)
|
|
PackDict["Project"]["tendereeMoney"] = float(entity.entity_text)
|
|
|
|
+ PackDict["Project"]["tendereeMoneyUnit"] = entity.money_unit
|
|
else:
|
|
else:
|
|
PackDict[packageName]["tendereeMoney"] = float(entity.entity_text)
|
|
PackDict[packageName]["tendereeMoney"] = float(entity.entity_text)
|
|
|
|
+ PackDict[packageName]["tendereeMoneyUnit"] = entity.money_unit
|
|
#add pointer_tendereeMoney
|
|
#add pointer_tendereeMoney
|
|
packagePointer.pointer_tendereeMoney = entity
|
|
packagePointer.pointer_tendereeMoney = entity
|
|
p_entity -= 1
|
|
p_entity -= 1
|
|
@@ -1888,6 +1895,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
#只找到一个中标人和中标金额
|
|
#只找到一个中标人和中标金额
|
|
if len(set_tenderer_money)==1 and len(set_tenderer_role)==1:
|
|
if len(set_tenderer_money)==1 and len(set_tenderer_role)==1:
|
|
list(set_tenderer_role)[0].money = list(set_tenderer_money)[0]
|
|
list(set_tenderer_role)[0].money = list(set_tenderer_money)[0]
|
|
|
|
+ list(set_tenderer_role)[0].money_unit = unit_list[0]
|
|
# print('一个中标人一个金额:', list(set_tenderer_money)[0])
|
|
# print('一个中标人一个金额:', list(set_tenderer_money)[0])
|
|
#找到一个中标人和多个招标金额
|
|
#找到一个中标人和多个招标金额
|
|
if len(set_tenderer_money)>1 and len(set_tenderer_role)==1:
|
|
if len(set_tenderer_money)>1 and len(set_tenderer_role)==1:
|
|
@@ -1904,9 +1912,11 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
# list(set_tenderer_role)[0].money = _maxMoney
|
|
# list(set_tenderer_role)[0].money = _maxMoney
|
|
if min(list_tenderer_money)>200000 and list_tenderer_money[-1]/min(list_tenderer_money)>9000:
|
|
if min(list_tenderer_money)>200000 and list_tenderer_money[-1]/min(list_tenderer_money)>9000:
|
|
list(set_tenderer_role)[0].money = min(list_tenderer_money)
|
|
list(set_tenderer_role)[0].money = min(list_tenderer_money)
|
|
|
|
+ list(set_tenderer_role)[0].money_unit = unit_list[list_tenderer_money.index(min(list_tenderer_money))]
|
|
# print('一人多金额 且最小的大于20万第一个金额比最小金额大几千倍的最小中标金额:', min(list_tenderer_money))
|
|
# print('一人多金额 且最小的大于20万第一个金额比最小金额大几千倍的最小中标金额:', min(list_tenderer_money))
|
|
else:
|
|
else:
|
|
list(set_tenderer_role)[0].money = list_tenderer_money[-1] # 2021/7/16 修改 不是单价合计方式取第一个中标金额
|
|
list(set_tenderer_role)[0].money = list_tenderer_money[-1] # 2021/7/16 修改 不是单价合计方式取第一个中标金额
|
|
|
|
+ list(set_tenderer_role)[0].money_unit = unit_list[-1] # 金额单位
|
|
# print('一人多金额 取第一个中标金额:', list_tenderer_money[-1])
|
|
# print('一人多金额 取第一个中标金额:', list_tenderer_money[-1])
|
|
#每个包都只找到一个金额
|
|
#每个包都只找到一个金额
|
|
_flag_pack_money = True
|
|
_flag_pack_money = True
|
|
@@ -1955,13 +1965,14 @@ def initPackageAttr(RoleList,PackageSet):
|
|
@summary: 根据拿到的roleList和packageSet初始化接口返回的数据
|
|
@summary: 根据拿到的roleList和packageSet初始化接口返回的数据
|
|
'''
|
|
'''
|
|
packDict = dict()
|
|
packDict = dict()
|
|
- packDict["Project"] = {"code":"","tendereeMoney":0,"roleList":[]}
|
|
|
|
|
|
+ packDict["Project"] = {"code":"","tendereeMoney":0,"roleList":[], 'tendereeMoneyUnit':''}
|
|
for item in list(PackageSet):
|
|
for item in list(PackageSet):
|
|
- packDict[item] = {"code":"","tendereeMoney":0,"roleList":[]}
|
|
|
|
|
|
+ packDict[item] = {"code":"","tendereeMoney":0,"roleList":[], 'tendereeMoneyUnit':''}
|
|
for item in RoleList:
|
|
for item in RoleList:
|
|
if packDict[item.packageName]["code"] =="":
|
|
if packDict[item.packageName]["code"] =="":
|
|
packDict[item.packageName]["code"] = item.packageCode
|
|
packDict[item.packageName]["code"] = item.packageCode
|
|
- packDict[item.packageName]["roleList"].append(Role(item.role_name,item.entity_text,0,0,0.0,[]))
|
|
|
|
|
|
+ # packDict[item.packageName]["roleList"].append(Role(item.role_name,item.entity_text,0,0,0.0,[]))
|
|
|
|
+ packDict[item.packageName]["roleList"].append(Role(item.role_name,item.entity_text,0,0,0.0,[])) #Role(角色名称,实体名称,角色阈值,金额,金额阈值,连接列表,金额单位)
|
|
return packDict
|
|
return packDict
|
|
|
|
|
|
def getPackageRoleMoney(list_sentence,list_entity):
|
|
def getPackageRoleMoney(list_sentence,list_entity):
|
|
@@ -2016,7 +2027,8 @@ def getOtherAttributes(list_entity):
|
|
"time_bidclose":"",
|
|
"time_bidclose":"",
|
|
"serviceTime":"",
|
|
"serviceTime":"",
|
|
"product":[],
|
|
"product":[],
|
|
- "total_tendereeMoney":0}
|
|
|
|
|
|
+ "total_tendereeMoney":0,
|
|
|
|
+ "total_tendereeMoneyUnit":''}
|
|
for entity in list_entity:
|
|
for entity in list_entity:
|
|
if entity.entity_type == 'bidway':
|
|
if entity.entity_type == 'bidway':
|
|
dict_other["bidway"] = turnBidWay(entity.entity_text)
|
|
dict_other["bidway"] = turnBidWay(entity.entity_text)
|
|
@@ -2036,6 +2048,7 @@ def getOtherAttributes(list_entity):
|
|
dict_other["product"].append(entity.entity_text)
|
|
dict_other["product"].append(entity.entity_text)
|
|
elif entity.entity_type=='money' and entity.notes=='总投资' and dict_other["total_tendereeMoney"]<float(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)
|
|
dict_other["total_tendereeMoney"] = float(entity.entity_text)
|
|
|
|
+ dict_other["total_tendereeMoneyUnit"] = entity.money_unit
|
|
dict_other["product"] = list(set(dict_other["product"]))
|
|
dict_other["product"] = list(set(dict_other["product"]))
|
|
return dict_other
|
|
return dict_other
|
|
|
|
|