Commit cb3d0196 by 张云飞

zyf

parent db4ad417
...@@ -22,7 +22,7 @@ ES_PORT = "" ...@@ -22,7 +22,7 @@ ES_PORT = ""
# dbdict = os.environ # dbdict = os.environ
environDict = os.environ environDict = os.environ
# environDict = json.loads(dbdict.get('ZYF')) # environDict = json.loads(dbdict.get('ZYF'))
print('获取环境变量') # print('获取环境变量',environDict)
# if environDict: # if environDict:
# print(environDict, "---------------------------") # print(environDict, "---------------------------")
# DB_HOST = environDict.get('DB_HOST') # DB_HOST = environDict.get('DB_HOST')
...@@ -51,7 +51,7 @@ print(DB_HOST,DB_HOST,DB_PORT,ES_PORT) ...@@ -51,7 +51,7 @@ print(DB_HOST,DB_HOST,DB_PORT,ES_PORT)
print(type(DB_PORT),type(ES_PORT)) print(type(DB_PORT),type(ES_PORT))
def findByType(): def findByType():
conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="fc") conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="brg-icname-config")
sql = 'SELECT * FROM gsb_newcity' sql = 'SELECT * FROM gsb_newcity'
# 获取游标 # 获取游标
cursor = conn.cursor() cursor = conn.cursor()
...@@ -132,7 +132,7 @@ def getFrountStrByStr(val, str): ...@@ -132,7 +132,7 @@ def getFrountStrByStr(val, str):
def getSensitiveByLike(title): def getSensitiveByLike(title):
conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="fc") conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="brg-icname-config")
sql = 'SELECT * FROM gsb_sensitive WHERE INSTR(title,"{}") or INSTR("{}",title)'.format(title, title) sql = 'SELECT * FROM gsb_sensitive WHERE INSTR(title,"{}") or INSTR("{}",title)'.format(title, title)
# 获取游标 # 获取游标
cursor = conn.cursor() cursor = conn.cursor()
...@@ -147,7 +147,7 @@ def getSensitiveByLike(title): ...@@ -147,7 +147,7 @@ def getSensitiveByLike(title):
def gsbSensitiveMnggetList(type, pinyin, title): def gsbSensitiveMnggetList(type, pinyin, title):
conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="fc") conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="brg-icname-config")
sql = "SELECT * FROM gsb_sensitive WHERE 1 = 1" sql = "SELECT * FROM gsb_sensitive WHERE 1 = 1"
if type != None and type != "": if type != None and type != "":
sql += " and type ={}".format(type) sql += " and type ={}".format(type)
...@@ -168,7 +168,7 @@ def gsbSensitiveMnggetList(type, pinyin, title): ...@@ -168,7 +168,7 @@ def gsbSensitiveMnggetList(type, pinyin, title):
def getBrandByLike(title): def getBrandByLike(title):
conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="fc") conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="brg-icname-config")
sql = 'SELECT * FROM gsb_brand WHERE 1 = 1' sql = 'SELECT * FROM gsb_brand WHERE 1 = 1'
if title != None and title != "": if title != None and title != "":
sql += " and '{}' like CONCAT('%',title,'%')".format(title) sql += " and '{}' like CONCAT('%',title,'%')".format(title)
...@@ -185,7 +185,7 @@ def getBrandByLike(title): ...@@ -185,7 +185,7 @@ def getBrandByLike(title):
def comNameForBidMnggetList(keyword): def comNameForBidMnggetList(keyword):
conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="fc") conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="brg-icname-config")
sql = 'SELECT * FROM gsb_comnameforbid WHERE 1 = 1' sql = 'SELECT * FROM gsb_comnameforbid WHERE 1 = 1'
if keyword != None and keyword != "": if keyword != None and keyword != "":
sql += " and keyword = '{}'".format(keyword) sql += " and keyword = '{}'".format(keyword)
...@@ -202,7 +202,7 @@ def comNameForBidMnggetList(keyword): ...@@ -202,7 +202,7 @@ def comNameForBidMnggetList(keyword):
def getCityByLike(title, type): def getCityByLike(title, type):
conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="fc") conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="brg-icname-config")
sql = 'SELECT * FROM gsb_newcity WHERE 1 = 1' sql = 'SELECT * FROM gsb_newcity WHERE 1 = 1'
if type != None and type != "": if type != None and type != "":
sql += " and LevelType ={}".format(type) sql += " and LevelType ={}".format(type)
...@@ -221,7 +221,7 @@ def getCityByLike(title, type): ...@@ -221,7 +221,7 @@ def getCityByLike(title, type):
def getCitys(type, pinyin, title): def getCitys(type, pinyin, title):
conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="fc") conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="brg-icname-config")
sql = 'SELECT * FROM gsb_newcity WHERE 1 = 1' sql = 'SELECT * FROM gsb_newcity WHERE 1 = 1'
if type != None and type != "": if type != None and type != "":
sql += " and LevelType ={}".format(type) sql += " and LevelType ={}".format(type)
...@@ -435,7 +435,7 @@ def getLeveltwo(j): ...@@ -435,7 +435,7 @@ def getLeveltwo(j):
def qccdb(seltime, cityname, keyword, btname, orgname, qccjson): def qccdb(seltime, cityname, keyword, btname, orgname, qccjson):
conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="fc") conn = pymysql.connect(host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PWD, db="brg-icname-config")
sql = 'INSERT INTO qcclog(seltime,cityname,keyword,btname,orgname,qccjson) VALUES ("%s","%s","%s","%s","%s","%s")' % ( sql = 'INSERT INTO qcclog(seltime,cityname,keyword,btname,orgname,qccjson) VALUES ("%s","%s","%s","%s","%s","%s")' % (
seltime, cityname, keyword, btname, orgname, qccjson) seltime, cityname, keyword, btname, orgname, qccjson)
cursor = conn.cursor() cursor = conn.cursor()
...@@ -1047,6 +1047,7 @@ def inputinfo(cityname, keyword, btname, url, orgname, setcity, appkey, AppKey, ...@@ -1047,6 +1047,7 @@ def inputinfo(cityname, keyword, btname, url, orgname, setcity, appkey, AppKey,
def heming(eventdict): def heming(eventdict):
print(eventdict)
# 查询数据方式,1:公司宝,2:企查查,3:混合模式 # 查询数据方式,1:公司宝,2:企查查,3:混合模式
search_type = eventdict['search_type'] search_type = eventdict['search_type']
# search_type = 1 # search_type = 1
...@@ -1054,15 +1055,23 @@ def heming(eventdict): ...@@ -1054,15 +1055,23 @@ def heming(eventdict):
keyword = eventdict["keyword"] # 汉唐,字号 keyword = eventdict["keyword"] # 汉唐,字号
btname = eventdict["btname"] # 科技,行业类型 btname = eventdict["btname"] # 科技,行业类型
orgname = eventdict["orgname"] # 有限公司,公司类型,默认:有限公司,可能有股份有限公司,集团公司等等,需要王驰给与建议 orgname = eventdict["orgname"] # 有限公司,公司类型,默认:有限公司,可能有股份有限公司,集团公司等等,需要王驰给与建议
sitcity = str(eventdict["sitcity"]) sitcity = eventdict["sitcity"]
print(type(sitcity),sitcity,'------------------------------')
# 有限公司,公司类型,默认:有限公司,可能有股份有限公司,集团公司等等,需要王驰给与建议 # 有限公司,公司类型,默认:有限公司,可能有股份有限公司,集团公司等等,需要王驰给与建议
if sitcity == 2: try:
keywords = keyword + "(" + cityname + ")" + btname + orgname if sitcity == 2:
elif sitcity == 3: print('222222222222222222222222')
keywords = keyword + btname + "(" + cityname + ")" + orgname
else: keywords = keyword + "(" + cityname + ")" + btname + orgname
keywords = cityname + keyword + btname + orgname elif sitcity == 3:
keywords = keyword + btname + "(" + cityname + ")" + orgname
else:
print('11111111111111111111111')
keywords = cityname + keyword + btname + orgname
except Exception as e:
print('qqqqqqqqqqqqqqqqqqqqqqqqqq')
# 地区在字号中的位置 # 地区在字号中的位置
senlist = getSensitiveByLike(keyword) senlist = getSensitiveByLike(keyword)
Brandlist = getBrandByLike(keyword) Brandlist = getBrandByLike(keyword)
......
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