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
8451ba01
Commit
8451ba01
authored
Dec 27, 2022
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20221227
parent
0d47e3e4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
13 deletions
+79
-13
apps/inves_manage/statistic_analysis_view.py
+26
-13
apps/manage/view_org.py
+0
-0
apps/models.py
+53
-0
No files found.
apps/inves_manage/statistic_analysis_view.py
View file @
8451ba01
...
@@ -43,7 +43,8 @@ def get_data1(district_li, current_year):
...
@@ -43,7 +43,8 @@ def get_data1(district_li, current_year):
# 年度目标
# 年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
)))
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
))),
JcTarget
.
is_delete
==
0
)
.
first
()
)
.
first
()
if
not
jc_obj
:
if
not
jc_obj
:
year_target
=
0
year_target
=
0
...
@@ -117,7 +118,8 @@ def get_data3(district_li, current_year):
...
@@ -117,7 +118,8 @@ def get_data3(district_li, current_year):
# 年度目标
# 年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
)))
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
))),
JcTarget
.
is_delete
==
0
)
.
first
()
)
.
first
()
if
not
jc_obj
:
if
not
jc_obj
:
year_target
=
0
year_target
=
0
...
@@ -156,7 +158,8 @@ def get_data4(district_li, current_year):
...
@@ -156,7 +158,8 @@ def get_data4(district_li, current_year):
# 年度目标
# 年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
)))
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
))),
JcTarget
.
is_delete
==
0
)
.
first
()
)
.
first
()
if
not
jc_obj
:
if
not
jc_obj
:
year_target
=
0
year_target
=
0
...
@@ -197,7 +200,8 @@ def get_data5(district_li, current_year):
...
@@ -197,7 +200,8 @@ def get_data5(district_li, current_year):
# 年度目标
# 年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
)))
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
))),
JcTarget
.
is_delete
==
0
)
.
first
()
)
.
first
()
if
not
jc_obj
:
if
not
jc_obj
:
year_target
=
0
year_target
=
0
...
@@ -466,6 +470,7 @@ def export_jc_data1(data_time, path, pro_path):
...
@@ -466,6 +470,7 @@ def export_jc_data1(data_time, path, pro_path):
# 签约年度目标(亿元)
# 签约年度目标(亿元)
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
))),
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
))),
JcTarget
.
is_delete
==
0
,
JcTarget
.
district_name
.
like
(
'
%
{}
%
'
.
format
(
str
(
district
)))
if
district
!=
'全市'
else
text
(
''
))
.
first
()
JcTarget
.
district_name
.
like
(
'
%
{}
%
'
.
format
(
str
(
district
)))
if
district
!=
'全市'
else
text
(
''
))
.
first
()
sign_target
=
0
sign_target
=
0
if
jc_obj
:
if
jc_obj
:
...
@@ -520,7 +525,8 @@ def export_jc_data1(data_time, path, pro_path):
...
@@ -520,7 +525,8 @@ def export_jc_data1(data_time, path, pro_path):
# 新开工年度目标
# 新开工年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
)))
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
))),
JcTarget
.
is_delete
==
0
)
.
first
()
)
.
first
()
if
not
jc_obj
:
if
not
jc_obj
:
new_start_target
=
0
new_start_target
=
0
...
@@ -556,7 +562,8 @@ def export_jc_data1(data_time, path, pro_path):
...
@@ -556,7 +562,8 @@ def export_jc_data1(data_time, path, pro_path):
# 年度目标
# 年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
)))
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
))),
JcTarget
.
is_delete
==
0
)
.
first
()
)
.
first
()
if
not
jc_obj
:
if
not
jc_obj
:
gutou1_target
=
0
gutou1_target
=
0
...
@@ -592,7 +599,8 @@ def export_jc_data1(data_time, path, pro_path):
...
@@ -592,7 +599,8 @@ def export_jc_data1(data_time, path, pro_path):
# 年度目标
# 年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
,
JcTarget
.
district_name
==
district
,
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
)))
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
))),
JcTarget
.
is_delete
==
0
)
.
first
()
)
.
first
()
if
not
jc_obj
:
if
not
jc_obj
:
gutou0_target
=
0
gutou0_target
=
0
...
@@ -695,7 +703,9 @@ def export_jc_data2(data_time, path, pro_path):
...
@@ -695,7 +703,9 @@ def export_jc_data2(data_time, path, pro_path):
sign_money
=
sum
([
project_obj
.
investment_volume
/
10000
for
project_obj
in
project_obj_list
if
project_obj_list
])
sign_money
=
sum
([
project_obj
.
investment_volume
/
10000
for
project_obj
in
project_obj_list
if
project_obj_list
])
data_list
.
append
(
sign_money
)
data_list
.
append
(
sign_money
)
# 4属地签约任务(亿元)
# 4属地签约任务(亿元)
target_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
,
JcTarget
.
year
==
current_year
+
'年'
)
.
first
()
target_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
,
JcTarget
.
is_delete
==
0
,
JcTarget
.
year
==
current_year
+
'年'
)
.
first
()
if
target_obj
:
if
target_obj
:
target_money
=
target_obj
.
money_sign
target_money
=
target_obj
.
money_sign
else
:
else
:
...
@@ -1191,8 +1201,8 @@ def get_data():
...
@@ -1191,8 +1201,8 @@ def get_data():
data
.
update
({
"district"
:
district
})
data
.
update
({
"district"
:
district
})
# 年度目标
# 年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
current_year
)),
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
current_year
)),
JcTarget
.
district_name
.
like
(
JcTarget
.
is_delete
==
0
,
'
%
{}
%
'
.
format
(
str
(
district
)))
if
district
!=
'全市'
else
text
(
''
))
.
first
()
JcTarget
.
district_name
.
like
(
'
%
{}
%
'
.
format
(
str
(
district
)))
if
district
!=
'全市'
else
text
(
''
))
.
first
()
target
=
0
target
=
0
if
jc_obj
:
if
jc_obj
:
target
=
jc_obj
.
money_sign
target
=
jc_obj
.
money_sign
...
@@ -1266,7 +1276,8 @@ def get_data():
...
@@ -1266,7 +1276,8 @@ def get_data():
# 新开工年度目标
# 新开工年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
current_year
))
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
current_year
)),
JcTarget
.
is_delete
==
0
)
.
first
()
)
.
first
()
if
not
jc_obj
:
if
not
jc_obj
:
target
=
0
target
=
0
...
@@ -1308,7 +1319,8 @@ def get_data():
...
@@ -1308,7 +1319,8 @@ def get_data():
# 年度目标
# 年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
district_name
==
district
if
district
!=
'全市'
else
text
(
''
),
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
)))
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
str
(
current_year
))),
JcTarget
.
is_delete
==
0
)
.
first
()
)
.
first
()
if
not
jc_obj
:
if
not
jc_obj
:
gutou1_target
=
0
gutou1_target
=
0
...
@@ -1347,7 +1359,8 @@ def get_data():
...
@@ -1347,7 +1359,8 @@ def get_data():
# 年度目标
# 年度目标
jc_obj
=
JcTarget
.
query
.
filter
(
jc_obj
=
JcTarget
.
query
.
filter
(
JcTarget
.
district_name
==
district
,
JcTarget
.
district_name
==
district
,
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
current_year
))
JcTarget
.
year
.
like
(
'
%
{}
%
'
.
format
(
current_year
)),
JcTarget
.
is_delete
==
0
)
.
first
()
)
.
first
()
if
not
jc_obj
:
if
not
jc_obj
:
gutou0_target
=
0
gutou0_target
=
0
...
...
apps/manage/view_org.py
View file @
8451ba01
This diff is collapsed.
Click to expand it.
apps/models.py
View file @
8451ba01
...
@@ -1058,6 +1058,59 @@ class GovDepartment(db.Model):
...
@@ -1058,6 +1058,59 @@ class GovDepartment(db.Model):
goverment
=
db
.
relationship
(
'GovOrganization'
,
backref
=
db
.
backref
(
'government_departments'
))
# 政府1-N部门
goverment
=
db
.
relationship
(
'GovOrganization'
,
backref
=
db
.
backref
(
'government_departments'
))
# 政府1-N部门
# 政府机构之间的上下级统筹
followers
=
db
.
Table
(
'followers'
,
db
.
Column
(
'follower_id'
,
db
.
Integer
,
db
.
ForeignKey
(
'government.id'
),
primary_key
=
True
),
db
.
Column
(
'followed_id'
,
db
.
Integer
,
db
.
ForeignKey
(
'government.id'
),
primary_key
=
True
)
)
# 政府机构表(自关联多对多)
class
Government
(
db
.
Model
):
__tablename__
=
"government"
# 基本信息
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
,
autoincrement
=
True
)
pnums
=
db
.
Column
(
db
.
Integer
)
# 人数
charge
=
db
.
Column
(
db
.
String
(
255
))
# 机构负责人
charge_phone
=
db
.
Column
(
db
.
String
(
255
))
# 负责人电话
function
=
db
.
Column
(
db
.
Text
)
# 部门职能
name
=
db
.
Column
(
db
.
String
(
255
),
nullable
=
False
,
index
=
True
)
# 政府机构单位名称
# followed 我的下级,管制谁,followers 我的上级,谁管制我
followed
=
db
.
relationship
(
'Government'
,
secondary
=
followers
,
primaryjoin
=
(
followers
.
c
.
follower_id
==
id
),
secondaryjoin
=
(
followers
.
c
.
followed_id
==
id
),
backref
=
db
.
backref
(
'followers'
,
lazy
=
'dynamic'
),
lazy
=
'dynamic'
)
# 政府部门(政府-部门 一对多)
class
Section
(
db
.
Model
):
__tablename__
=
"section"
# 基本信息
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
,
autoincrement
=
True
)
pnums
=
db
.
Column
(
db
.
Integer
)
# 人数
charge
=
db
.
Column
(
db
.
String
(
255
))
# 部门负责人
charge_phone
=
db
.
Column
(
db
.
String
(
255
))
# 负责人电话
function
=
db
.
Column
(
db
.
Text
)
# 部门职能
name
=
db
.
Column
(
db
.
String
(
255
),
nullable
=
False
)
# 政府机构部门名称
# gid = db.Column(db.Integer) # 政府id
goverment_id
=
db
.
Column
(
db
.
Integer
,
db
.
ForeignKey
(
"government.id"
))
goverment
=
db
.
relationship
(
'Government'
,
backref
=
db
.
backref
(
'sections'
))
# 政府1-N部门
# 政府组(政府1-N部门1-N组)
class
Group
(
db
.
Model
):
__tablename__
=
"group"
# 基本信息
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
,
autoincrement
=
True
)
pnums
=
db
.
Column
(
db
.
Integer
)
# 人数
charge
=
db
.
Column
(
db
.
String
(
255
))
# 组负责人
charge_phone
=
db
.
Column
(
db
.
String
(
255
))
# 负责人电话
function
=
db
.
Column
(
db
.
Text
)
# 部门职能
name
=
db
.
Column
(
db
.
String
(
255
),
nullable
=
False
)
# 政府机构部门下组的名称
# sid = db.Column(db.Integer) # 部门id
section_id
=
db
.
Column
(
db
.
Integer
,
db
.
ForeignKey
(
"section.id"
))
section
=
db
.
relationship
(
'Section'
,
backref
=
db
.
backref
(
'groups'
))
# 部门1-N组
"""招商资源管理"""
"""招商资源管理"""
...
...
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