Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mancheng
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
Administrator
mancheng
Commits
01aa2987
Commit
01aa2987
authored
Apr 04, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230404
parent
bc164357
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
27 deletions
+22
-27
apps/models.py
+2
-5
apps/view_user/view_other.py
+0
-2
apps/view_xiaocx/view.py
+20
-20
No files found.
apps/models.py
View file @
01aa2987
...
@@ -1078,9 +1078,6 @@ class UserPolicy(BaseModel, db.Model):
...
@@ -1078,9 +1078,6 @@ class UserPolicy(BaseModel, db.Model):
policy_id
=
db
.
Column
(
db
.
Integer
,
db
.
ForeignKey
(
"indu_policy.id"
),
primary_key
=
True
)
policy_id
=
db
.
Column
(
db
.
Integer
,
db
.
ForeignKey
(
"indu_policy.id"
),
primary_key
=
True
)
# 后台管理用户
# 后台管理用户
class
Bstage
(
BaseModel
,
db
.
Model
):
class
Bstage
(
BaseModel
,
db
.
Model
):
__tablename__
=
"bstage"
__tablename__
=
"bstage"
...
@@ -1719,8 +1716,8 @@ class CustomerConsultation(db.Model):
...
@@ -1719,8 +1716,8 @@ class CustomerConsultation(db.Model):
land_area
=
db
.
Column
(
db
.
Text
,
comment
=
'拟落地区域'
)
land_area
=
db
.
Column
(
db
.
Text
,
comment
=
'拟落地区域'
)
linkman
=
db
.
Column
(
db
.
String
(
20
),
comment
=
'联系人'
)
linkman
=
db
.
Column
(
db
.
String
(
20
),
comment
=
'联系人'
)
link_mobile
=
db
.
Column
(
db
.
String
(
20
),
comment
=
'联系方式'
)
link_mobile
=
db
.
Column
(
db
.
String
(
20
),
comment
=
'联系方式'
)
consultation_time
=
db
.
Column
(
db
.
DateTime
,
default
=
''
,
comment
=
'咨询时间'
)
consultation_time
=
db
.
Column
(
db
.
DateTime
,
default
=
''
,
comment
=
'咨询
/回复
时间'
)
reply_time
=
db
.
Column
(
db
.
DateTime
,
default
=
''
,
comment
=
'回复时间'
)
#
reply_time = db.Column(db.DateTime, default='', comment='回复时间')
flag
=
db
.
Column
(
db
.
Integer
,
comment
=
'是否已回复 0否1是'
)
flag
=
db
.
Column
(
db
.
Integer
,
comment
=
'是否已回复 0否1是'
)
is_sync
=
db
.
Column
(
db
.
Integer
,
comment
=
'是否同步到平台 0否1是'
)
is_sync
=
db
.
Column
(
db
.
Integer
,
comment
=
'是否同步到平台 0否1是'
)
...
...
apps/view_user/view_other.py
View file @
01aa2987
...
@@ -345,8 +345,6 @@ def delete():
...
@@ -345,8 +345,6 @@ def delete():
if
not
all
([
id
,
classify
,
choice
]):
if
not
all
([
id
,
classify
,
choice
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"数据不全"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"数据不全"
)
# id = g.id
if
classify
==
1
:
if
classify
==
1
:
if
choice
==
"2"
:
if
choice
==
"2"
:
# 删除全国数据
# 删除全国数据
...
...
apps/view_xiaocx/view.py
View file @
01aa2987
import
re
import
requests
import
requests
from
flask
import
current_app
,
request
,
jsonify
from
flask
import
current_app
,
request
,
jsonify
from
apps.view_radar
import
api_radar
from
apps.models
import
*
from
apps.models
import
*
from
sqlalchemy
import
extract
,
or_
,
and_
from
sqlalchemy
import
extract
,
or_
,
and_
from
sqlalchemy.sql
import
func
from
apps.util
import
login_required
,
create_token
,
verify_token
from
apps.util
import
login_required
,
create_token
,
verify_token
from
apps.utils.response_code
import
RET
from
apps.utils.response_code
import
RET
from
datetime
import
datetime
#
from datetime import datetime
import
datetime
import
datetime
from
apps
import
db
,
constants
,
redis_store
from
apps
import
db
,
constants
,
redis_store
from
apps.utils.neo4j_conn
import
conn_neo4j
from
apps.view_xiaocx
import
api_xiaocx
from
apps.view_xiaocx
import
api_xiaocx
from
apps.utils.vxconfig
import
WxConfig
from
apps.inves_manage.siku_view
import
get_num
,
write_dynamic
from
apps.inves_manage.siku_view
import
get_num
,
write_dynamic
from
apps.view_choose.choose_view
import
global_region
,
global_land
,
global_factory
,
global_build
from
apps.view_choose.choose_view
import
global_region
,
global_land
,
global_factory
,
global_build
...
@@ -40,8 +34,6 @@ def search_all():
...
@@ -40,8 +34,6 @@ def search_all():
industry_id
=
''
industry_id
=
''
if
industry_name
:
if
industry_name
:
industry_id
=
IndustryChain
.
query
.
filter
(
IndustryChain
.
industry_name
.
like
(
"
%
{}
%
"
.
format
(
industry_name
)))
.
first
()
industry_id
=
IndustryChain
.
query
.
filter
(
IndustryChain
.
industry_name
.
like
(
"
%
{}
%
"
.
format
(
industry_name
)))
.
first
()
# if not district_name:
# district_name = get_district_name(token)
data_list
=
[]
data_list
=
[]
if
carrier_type_id
==
0
:
if
carrier_type_id
==
0
:
...
@@ -493,7 +485,7 @@ def consultation():
...
@@ -493,7 +485,7 @@ def consultation():
land_area
=
req_dict
.
get
(
"land_area"
)
land_area
=
req_dict
.
get
(
"land_area"
)
linkman
=
req_dict
.
get
(
"linkman"
)
linkman
=
req_dict
.
get
(
"linkman"
)
link_mobile
=
req_dict
.
get
(
"link_mobile"
)
link_mobile
=
req_dict
.
get
(
"link_mobile"
)
consultation_time
=
datetime
.
datetime
.
now
()
try
:
try
:
cons_obj
=
CustomerConsultation
()
cons_obj
=
CustomerConsultation
()
cons_obj
.
project_name
=
project_name
cons_obj
.
project_name
=
project_name
...
@@ -505,10 +497,11 @@ def consultation():
...
@@ -505,10 +497,11 @@ def consultation():
cons_obj
.
land_area
=
land_area
cons_obj
.
land_area
=
land_area
cons_obj
.
linkman
=
linkman
cons_obj
.
linkman
=
linkman
cons_obj
.
link_mobile
=
link_mobile
cons_obj
.
link_mobile
=
link_mobile
cons_obj
.
consultation_time
=
consultation_time
cons_obj
.
flag
=
0
cons_obj
.
flag
=
0
db
.
session
.
add
(
cons_obj
)
db
.
session
.
add
(
cons_obj
)
db
.
session
.
commit
()
db
.
session
.
commit
()
except
E
nterprise
as
e
:
except
E
xception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"Query error!"
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"Query error!"
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
'save successfully!'
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
'save successfully!'
)
...
@@ -538,10 +531,10 @@ def consultation_list():
...
@@ -538,10 +531,10 @@ def consultation_list():
"flag"
:
cons_obj
.
flag
,
"flag"
:
cons_obj
.
flag
,
"reply_content"
:
cons_obj
.
reply_content
,
"reply_content"
:
cons_obj
.
reply_content
,
"consultation_time"
:
cons_obj
.
consultation_time
,
"consultation_time"
:
cons_obj
.
consultation_time
,
"reply_time"
:
cons_obj
.
reply_time
,
#
"reply_time": cons_obj.reply_time,
}
for
cons_obj
in
cons_obj_list
]
}
for
cons_obj
in
cons_obj_list
]
except
E
nterprise
as
e
:
except
E
xception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"Query error!"
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"Query error!"
)
return
jsonify
(
code
=
RET
.
OK
,
data
=
{
"data"
:
data
,
"size"
:
cons_count
},
msg
=
'Data query success!'
)
return
jsonify
(
code
=
RET
.
OK
,
data
=
{
"data"
:
data
,
"size"
:
cons_count
},
msg
=
'Data query success!'
)
...
@@ -570,7 +563,7 @@ def consultation_detail():
...
@@ -570,7 +563,7 @@ def consultation_detail():
"flag"
:
cons_obj
.
flag
,
"flag"
:
cons_obj
.
flag
,
"reply_content"
:
cons_obj
.
reply_content
"reply_content"
:
cons_obj
.
reply_content
}
}
except
E
nterprise
as
e
:
except
E
xception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"Query error!"
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"Query error!"
)
return
jsonify
(
code
=
RET
.
OK
,
data
=
data
,
msg
=
'Data query success!'
)
return
jsonify
(
code
=
RET
.
OK
,
data
=
data
,
msg
=
'Data query success!'
)
...
@@ -585,9 +578,10 @@ def reply_consultation():
...
@@ -585,9 +578,10 @@ def reply_consultation():
_id
=
req_dict
.
get
(
"id"
)
_id
=
req_dict
.
get
(
"id"
)
is_sync
=
req_dict
.
get
(
"is_sync"
)
is_sync
=
req_dict
.
get
(
"is_sync"
)
token
=
request
.
headers
[
"token"
]
token
=
request
.
headers
[
"token"
]
consultation_time
=
datetime
.
datetime
.
now
()
upload_time
=
consultation_time
.
strftime
(
"
%
Y/
%
m/
%
d"
)
time_strf
=
consultation_time
.
strftime
(
"
%
Y
%
m
%
d"
)
upload_time
=
datetime
.
datetime
.
now
()
.
strftime
(
"
%
Y/
%
m/
%
d"
)
time_strf
=
datetime
.
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d"
)
try
:
try
:
user_obj
=
verify_token
(
token
)
user_obj
=
verify_token
(
token
)
upload_unity
=
user_obj
.
name
upload_unity
=
user_obj
.
name
...
@@ -595,9 +589,12 @@ def reply_consultation():
...
@@ -595,9 +589,12 @@ def reply_consultation():
mobile
=
user_obj
.
mobile
mobile
=
user_obj
.
mobile
cons_obj
=
CustomerConsultation
.
query
.
get
(
_id
)
cons_obj
=
CustomerConsultation
.
query
.
get
(
_id
)
cons_obj
.
reply_content
=
reply_content
if
reply_content
:
cons_obj
.
reply_content
=
reply_content
cons_obj
.
flag
=
1
# 已回复
cons_obj
.
consultation_time
=
consultation_time
# 回复时间
if
is_sync
==
1
:
if
is_sync
==
1
:
cons_obj
.
is_sync
=
1
cons_obj
.
is_sync
=
1
# 跟平台同步
db
.
session
.
commit
()
db
.
session
.
commit
()
if
is_sync
==
1
:
if
is_sync
==
1
:
...
@@ -664,7 +661,7 @@ def reply_consultation():
...
@@ -664,7 +661,7 @@ def reply_consultation():
time1
=
datetime
.
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
time1
=
datetime
.
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
write_dynamic
(
upload_people
,
project_id
,
'从晋城小程序导入了项目'
,
time1
)
write_dynamic
(
upload_people
,
project_id
,
'从晋城小程序导入了项目'
,
time1
)
except
E
nterprise
as
e
:
except
E
xception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"Error saving reply message!"
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"Error saving reply message!"
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
'The reply message is saved successfully.'
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
'The reply message is saved successfully.'
)
...
@@ -834,6 +831,7 @@ def collection_list():
...
@@ -834,6 +831,7 @@ def collection_list():
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
'User not logged in'
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
'User not logged in'
)
try
:
try
:
data
=
[]
if
name
==
'land'
:
if
name
==
'land'
:
obj_list
=
user_obj
.
carrier_land
obj_list
=
user_obj
.
carrier_land
data
=
[{
data
=
[{
...
@@ -910,6 +908,8 @@ def collection_list():
...
@@ -910,6 +908,8 @@ def collection_list():
}
for
obj
in
obj_list
]
}
for
obj
in
obj_list
]
else
:
else
:
pass
pass
data
=
sorted
(
data
,
key
=
lambda
x
:
x
[
'id'
],
reverse
=
True
)
return
jsonify
(
code
=
RET
.
OK
,
data
=
data
,
msg
=
'Query success'
)
return
jsonify
(
code
=
RET
.
OK
,
data
=
data
,
msg
=
'Query success'
)
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
...
@@ -971,7 +971,7 @@ def wechat_login():
...
@@ -971,7 +971,7 @@ def wechat_login():
"mobile"
:
mobile
,
"mobile"
:
mobile
,
"token"
:
token
"token"
:
token
}
}
except
E
nterprise
as
e
:
except
E
xception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DATAERR
,
msg
=
"数据异常!"
)
return
jsonify
(
code
=
RET
.
DATAERR
,
msg
=
"数据异常!"
)
return
jsonify
(
code
=
RET
.
OK
,
data
=
user_info
,
msg
=
"微信登录成功。"
)
return
jsonify
(
code
=
RET
.
OK
,
data
=
user_info
,
msg
=
"微信登录成功。"
)
...
...
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