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
6f332410
Commit
6f332410
authored
Dec 23, 2022
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20221223
parent
ce824d1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
53 deletions
+58
-53
apps/view_choose/fill_data.py
+58
-53
No files found.
apps/view_choose/fill_data.py
View file @
6f332410
...
...
@@ -1452,12 +1452,12 @@ def carrier_edit_land():
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"进行{}操作时用户信息校验失败,请重新登陆后尝试!"
.
format
(
action_name
))
if
role_id
==
3
:
# 如果是办事员可以编辑自己提报的内容
pass
if
role_id
==
2
:
# 市直部门这区县领导可以编辑该部门所有办事员提报的内容
pass
if
role_id
==
1
:
# 局领导能看到所有审核通过的内容
return
jsonify
(
code
=
RET
.
THIRDERR
,
msg
=
"局领导不能编辑数据。"
)
#
if role_id == 3: # 如果是办事员可以编辑自己提报的内容
#
pass
#
if role_id == 2: # 市直部门这区县领导可以编辑该部门所有办事员提报的内容
#
pass
#
if role_id == 1: # 局领导能看到所有审核通过的内容
#
return jsonify(code=RET.THIRDERR, msg="局领导不能编辑数据。")
land_id
=
req_dic
[
'land_id'
]
district_name
=
req_dic
[
'district_name'
]
land_name
=
req_dic
[
'land_name'
]
...
...
@@ -2329,7 +2329,6 @@ def show_log():
req_dic
=
request
.
get_json
()
pop_flag
=
req_dic
[
'pop_flag'
]
# ture or false
filter_time
=
req_dic
[
'filter_time'
]
# token = req_dic['token']
token
=
request
.
headers
[
'token'
]
action_name
=
'获取日志信息'
try
:
...
...
@@ -2344,55 +2343,61 @@ def show_log():
try
:
log_num
=
''
if
filter_time
:
if
role_id
==
3
:
# 如果是办事员智能看到自己提报的内容
log_obj
=
OperationLog
.
query
.
filter
(
and_
(
OperationLog
.
operation_time
.
like
(
'
%
{}
%
'
.
format
(
filter_time
)),
OperationLog
.
operation_people_id
==
user_id
))
if
role_id
==
2
:
# 市直部门这区县领导智能看到该部门所有办事员提报的内容
log_obj
=
OperationLog
.
query
.
filter
(
and_
(
OperationLog
.
operation_time
.
like
(
'
%
{}
%
'
.
format
(
filter_time
)),
OperationLog
.
operation_people_belong
==
belong_unit
))
if
role_id
==
1
:
# 局领导能看到所有审核通过和自己驳回的内容
log_obj
=
OperationLog
.
query
.
filter
(
OperationLog
.
operation_time
.
like
(
'
%
{}
%
'
.
format
(
filter_time
)))
# if role_id == 3: # 如果是办事员智能看到自己提报的内容
# log_obj = OperationLog.query.filter(and_(OperationLog.operation_time.like('%{}%'.format(filter_time)),
# OperationLog.operation_people_id == user_id))
# if role_id == 2: # 市直部门这区县领导智能看到该部门所有办事员提报的内容
# log_obj = OperationLog.query.filter(and_(OperationLog.operation_time.like('%{}%'.format(filter_time)),
# OperationLog.operation_people_belong == belong_unit))
# if role_id == 1: # 局领导能看到所有审核通过和自己驳回的内容
# log_obj = OperationLog.query.filter(OperationLog.operation_time.like('%{}%'.format(filter_time)))
# log_obj_list = log_obj.order_by(
# OperationLog.operation_time.desc()).paginate(page, per_page).items
log_obj
=
OperationLog
.
query
.
filter
(
OperationLog
.
operation_time
.
like
(
'
%
{}
%
'
.
format
(
filter_time
)))
log_obj_list
=
log_obj
.
order_by
(
OperationLog
.
operation_time
.
desc
())
.
paginate
(
page
,
per_page
)
.
items
else
:
if
role_id
==
3
:
# 如果是办事员智能看到自己提报的内容
log_obj
=
OperationLog
.
query
.
filter
(
OperationLog
.
operation_people_id
==
user_id
)
log_num
=
log_obj
.
count
()
if
pop_flag
:
month_day
=
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-01 00:00:00"
)
login_time_obj
=
OperationLog
.
query
.
filter
(
OperationLog
.
operation_people_id
==
user_id
,
OperationLog
.
action
.
like
(
'
%
登录
%
'
),
OperationLog
.
operation_time
>=
month_day
)
.
all
()
if
len
(
login_time_obj
)
==
1
:
current_month
=
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-26 00:00:00"
)
log_obj1
=
OperationLog
.
query
.
filter
(
OperationLog
.
operation_people_id
==
user_id
,
OperationLog
.
action
==
'导入'
,
OperationLog
.
operation_time
<
current_month
)
.
all
()
if
not
log_obj1
:
# 记录日志
upload_time
=
datetime
.
now
()
current_year
=
datetime
.
now
()
.
year
operation_message
=
"请及时上传{}年{}月土地、商业楼宇、标准厂房数据;如无请忽略。"
.
format
(
str
(
current_year
),
current_month
)
log
=
OperationLog
(
read_type
=
0
,
operation_people_id
=
user_id
,
operation_time
=
upload_time
,
operation_people
=
user_name
,
section
=
section
,
operation_message
=
operation_message
,
operation_mobile
=
''
,
action
=
'使用密码登录成功'
)
db
.
session
.
add
(
log
)
db
.
session
.
commit
()
return
jsonify
(
code
=
RET
.
WARNING
,
msg
=
'25号之前还未上传数据!'
)
else
:
return
jsonify
(
code
=
RET
.
OK
,
msg
=
'本月不是第一次登录,无需提示!'
)
if
role_id
==
2
:
# 市直部门这区县领导智能看到该部门所有办事员提报的内容
log_obj
=
OperationLog
.
query
.
filter
(
OperationLog
.
operation_people_belong
==
belong_unit
)
log_num
=
log_obj
.
count
()
if
role_id
==
1
:
# 局领导能看到所有审核通过和自己驳回的内容
log_obj
=
OperationLog
.
query
.
filter
()
log_num
=
log_obj
.
count
()
log_obj_list
=
log_obj
.
order_by
(
OperationLog
.
operation_time
.
desc
())
.
paginate
(
page
,
per_page
)
.
items
# if role_id == 3: # 如果是办事员智能看到自己提报的内容
# log_obj = OperationLog.query.filter(OperationLog.operation_people_id == user_id)
# log_num = log_obj.count()
# if pop_flag:
# month_day = datetime.now().strftime("%Y-%m-01 00:00:00")
# login_time_obj = OperationLog.query.filter(OperationLog.operation_people_id == user_id,
# OperationLog.action.like('%登录%'),
# OperationLog.operation_time >= month_day).all()
# if len(login_time_obj) == 1:
# current_month = datetime.now().strftime("%Y-%m-26 00:00:00")
# log_obj1 = OperationLog.query.filter(OperationLog.operation_people_id == user_id,
# OperationLog.action == '导入',
# OperationLog.operation_time < current_month).all()
# if not log_obj1:
# # 记录日志
# upload_time = datetime.now()
# current_year = datetime.now().year
# operation_message = "请及时上传{}年{}月土地、商业楼宇、标准厂房数据;如无请忽略。".format(str(current_year), current_month)
# log = OperationLog(read_type=0, operation_people_id=user_id, operation_time=upload_time,
# operation_people=user_name,
# section=section,
# operation_message=operation_message, operation_mobile='',
# action='使用密码登录成功')
# db.session.add(log)
# db.session.commit()
# return jsonify(code=RET.WARNING, msg='25号之前还未上传数据!')
# else:
# return jsonify(code=RET.OK, msg='本月不是第一次登录,无需提示!')
#
# if role_id == 2: # 市直部门这区县领导智能看到该部门所有办事员提报的内容
# log_obj = OperationLog.query.filter(OperationLog.operation_people_belong == belong_unit)
# log_num = log_obj.count()
#
# if role_id == 1: # 局领导能看到所有审核通过和自己驳回的内容
# log_obj = OperationLog.query.filter()
# log_num = log_obj.count()
# log_obj_list = log_obj.order_by(
# OperationLog.operation_time.desc()).paginate(page, per_page).items
log_obj
=
OperationLog
.
query
.
filter
()
log_num
=
log_obj
.
count
()
log_obj_list
=
log_obj
.
order_by
(
OperationLog
.
operation_time
.
desc
())
.
paginate
(
page
,
per_page
)
.
items
print
(
log_obj_list
)
if
log_obj_list
:
data
=
[{
...
...
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