Commit 0d242292 by 蒋勇

d

parent c287fd34
......@@ -35,7 +35,7 @@ def CreatBdictFromJson(GetAllinfo):
# print(dict_all)
# 获取传入的参数
GetAllinfo = GetAllinfo
GetAllinfo_new = eval(GetAllinfo.get("ri", None)) # 如果key不存在,会返回None,因此需进行判断
GetAllinfo_new =GetAllinfo.get("ri", None) # 如果key不存在,会返回None,因此需进行判断
for factors_name, value in dict_all.items():
try:
dict_all[factors_name]["status"] = GetAllinfo_new[factors_name]
......
......@@ -31,10 +31,26 @@ def GetComanyinfoFromES(companyname):
es = Elasticsearch([esip], http_auth=(esuser, espassword), port=esport, timeout=15000)
companyinfo = es.search(index="bigdata_ic_gsb_company_op",
body={"query": {"bool": {"must": {"term": {"company_name.raw": companyname}}}}})
companylist = {}
companylist = {
"companyname": companyname,
"legal_person":"-",
"cred_code":"-",
"province":"-",
"city":"-",
"reg_location":"-",
"establish_time":"-",
"company_cate_1":"-",
"company_org_type":"-",
"reg_institute":"-",
"reg_capital":"-",
"reg_status":"-",
"from_time":"-",
"to_time":"-",
"approved_time":"-",
"business_scope":"-"
}
if companyinfo["hits"]["hits"]:
for row in companyinfo["hits"]["hits"]:
companyname = row['_source']["company_name"] # 公司名称
legal_person = row['_source']["legal_person"] # 法定代表人
if legal_person is None:
legal_person = "_"
......@@ -102,6 +118,4 @@ def GetComanyinfoFromES(companyname):
companylist["to_time"] = to_time
companylist["approved_time"] = approved_time
companylist["business_scope"] = business_scope
return companylist
# a=GetComanyinfoFromES("用友网络科技股份有限公司")
# print(a)
\ No newline at end of file
return companylist
......@@ -186,9 +186,9 @@ def UpdateTaskRptUrl(batchid, rptUrl):
companyInfo_New = json.loads(UpdateInfo.text)# 访问接口返回的信息
print(companyInfo_New)
if companyInfo_New["msg"]=="操作成功":
return batchid+"报告已更新完成"
return str(batchid)+"报告已更新完成"
else:
return batchid+"报告更新失败"
return str(batchid)+"报告更新失败"
......@@ -217,5 +217,4 @@ def report():
return "请输入检测公司名称"
server.run(host='0.0.0.0', port=80, debug=True)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment