Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
cb3d0196
Commit
cb3d0196
authored
Jul 13, 2020
by
张云飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zyf
parent
db4ad417
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
ic-name/hanshujisuan.py
+25
-16
No files found.
ic-name/hanshujisuan.py
View file @
cb3d0196
...
...
@@ -22,7 +22,7 @@ ES_PORT = ""
# dbdict = os.environ
environDict
=
os
.
environ
# environDict = json.loads(dbdict.get('ZYF'))
print
(
'获取环境变量'
)
# print('获取环境变量',environDict
)
# if environDict:
# print(environDict, "---------------------------")
# DB_HOST = environDict.get('DB_HOST')
...
...
@@ -51,7 +51,7 @@ print(DB_HOST,DB_HOST,DB_PORT,ES_PORT)
print
(
type
(
DB_PORT
),
type
(
ES_PORT
))
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'
# 获取游标
cursor
=
conn
.
cursor
()
...
...
@@ -132,7 +132,7 @@ def getFrountStrByStr(val, str):
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
)
# 获取游标
cursor
=
conn
.
cursor
()
...
...
@@ -147,7 +147,7 @@ def getSensitiveByLike(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"
if
type
!=
None
and
type
!=
""
:
sql
+=
" and type ={}"
.
format
(
type
)
...
...
@@ -168,7 +168,7 @@ def gsbSensitiveMnggetList(type, pinyin, 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'
if
title
!=
None
and
title
!=
""
:
sql
+=
" and '{}' like CONCAT('
%
',title,'
%
')"
.
format
(
title
)
...
...
@@ -185,7 +185,7 @@ def getBrandByLike(title):
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'
if
keyword
!=
None
and
keyword
!=
""
:
sql
+=
" and keyword = '{}'"
.
format
(
keyword
)
...
...
@@ -202,7 +202,7 @@ def comNameForBidMnggetList(keyword):
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'
if
type
!=
None
and
type
!=
""
:
sql
+=
" and LevelType ={}"
.
format
(
type
)
...
...
@@ -221,7 +221,7 @@ def getCityByLike(title, type):
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'
if
type
!=
None
and
type
!=
""
:
sql
+=
" and LevelType ={}"
.
format
(
type
)
...
...
@@ -435,7 +435,7 @@ def getLeveltwo(j):
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")'
%
(
seltime
,
cityname
,
keyword
,
btname
,
orgname
,
qccjson
)
cursor
=
conn
.
cursor
()
...
...
@@ -1047,6 +1047,7 @@ def inputinfo(cityname, keyword, btname, url, orgname, setcity, appkey, AppKey,
def
heming
(
eventdict
):
print
(
eventdict
)
# 查询数据方式,1:公司宝,2:企查查,3:混合模式
search_type
=
eventdict
[
'search_type'
]
# search_type = 1
...
...
@@ -1054,15 +1055,23 @@ def heming(eventdict):
keyword
=
eventdict
[
"keyword"
]
# 汉唐,字号
btname
=
eventdict
[
"btname"
]
# 科技,行业类型
orgname
=
eventdict
[
"orgname"
]
# 有限公司,公司类型,默认:有限公司,可能有股份有限公司,集团公司等等,需要王驰给与建议
sitcity
=
str
(
eventdict
[
"sitcity"
])
sitcity
=
eventdict
[
"sitcity"
]
print
(
type
(
sitcity
),
sitcity
,
'------------------------------'
)
# 有限公司,公司类型,默认:有限公司,可能有股份有限公司,集团公司等等,需要王驰给与建议
if
sitcity
==
2
:
keywords
=
keyword
+
"("
+
cityname
+
")"
+
btname
+
orgname
elif
sitcity
==
3
:
keywords
=
keyword
+
btname
+
"("
+
cityname
+
")"
+
orgname
else
:
keywords
=
cityname
+
keyword
+
btname
+
orgname
try
:
if
sitcity
==
2
:
print
(
'222222222222222222222222'
)
keywords
=
keyword
+
"("
+
cityname
+
")"
+
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
)
Brandlist
=
getBrandByLike
(
keyword
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment