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
38b556cc
Commit
38b556cc
authored
Dec 22, 2022
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20221222
parent
8f02934c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
28 deletions
+30
-28
apps/inves_manage/project_manager.py
+18
-8
apps/inves_manage/siku_view.py
+11
-19
apps/models.py
+1
-1
No files found.
apps/inves_manage/project_manager.py
View file @
38b556cc
...
...
@@ -315,22 +315,34 @@ def upload_project_data2():
if
not
project_name
:
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
'项目名称不能为空!'
)
project_obj_list
=
ProjectManagement
.
query
.
all
()
# 构造项目编号
# 按照上传年份 + 县(市、区)、开发区 + 序数词格式生成;县(市、区)、开发区其中编号为:
# 城区140502、泽州县140525、高平市140581、阳城县140522
# 陵川县140524、沁水县140521、晋城经济技术开发区140526;
# 例如2022140502002代表2022年城区的第二个项目;
prefix_dic
=
{
"城区"
:
"140502"
,
"泽州县"
:
"140525"
,
"高平市"
:
"140581"
,
"阳城县"
:
"140522"
,
"陵川县"
:
"140524"
,
"沁水县"
:
"140521"
,
"晋城经济技术开发区"
:
"140526"
}
time_strf
=
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d"
)
max_project_num
=
''
project_obj_list
=
ProjectManagement
.
query
.
all
()
if
project_obj_list
:
max_project_num
=
max
([
project_obj
.
project_num
for
project_obj
in
project_obj_list
])
max_project_num
=
max
([
project_obj
.
project_num
for
project_obj
in
project_obj_list
if
project_obj
.
project_num
.
startswith
(
prefix_dic
[
district
])
])
if
max_project_num
:
max_project_num
=
max_project_num
[
8
:]
max_project_num
=
max_project_num
[
10
:]
num
=
get_num
(
max_project_num
)
if
num
==
'error'
:
# return jsonify(code=RET.DATAERR, msg='编号超出三位的规定范围,请联系管理员')
return
'error'
project_num
=
time_strf
+
num
project_num
=
time_strf
+
prefix_dic
[
district
]
+
num
else
:
project_num
=
time_strf
+
'001'
project_num
=
time_strf
+
prefix_dic
[
district
]
+
'001'
industry_level
=
''
if
industry1
and
industry2
:
industry_level
=
get_industry_level
(
industry1
,
industry2
)
...
...
@@ -431,8 +443,6 @@ def batch_export_project5():
data_list
.
append
(
attract_name
)
investor_name
=
project_obj
.
investor_name
data_list
.
append
(
investor_name
)
# investor_district = project_obj.investor_district
# data_list.append(investor_district)
country
=
project_obj
.
country
data_list
.
append
(
country
)
provence
=
project_obj
.
provence
...
...
apps/inves_manage/siku_view.py
View file @
38b556cc
...
...
@@ -70,14 +70,14 @@ def upload_xiansuo_project(row_content, time_strf, upload_time, upload_unity, up
remark
=
row_content
[
14
]
# 备注
project_obj_list
=
SikuProject
.
query
.
all
()
# 项目编号
max_project_num
=
''
project_num_list
=
''
if
project_obj_list
:
max_project_num
=
max
([
project_obj
.
project_num
for
project_obj
in
project_obj_list
])
if
max_project_num
:
max_project_num
=
max_project_num
[
8
:]
project_num_list
=
[
project_obj
.
project_num
for
project_obj
in
project_obj_list
if
(
project_obj
.
project_num
)
.
startswith
(
time_strf
)]
if
project_num_list
:
max_project_num
=
max
(
project_num_list
)[
8
:]
num
=
get_num
(
max_project_num
)
if
num
==
'error'
:
# return jsonify(code=RET.DATAERR, msg='编号超出三位的规定范围,请联系管理员')
return
'error'
project_num
=
time_strf
+
num
else
:
...
...
@@ -662,14 +662,15 @@ def add_project():
# 项目编号
project_obj_list
=
SikuProject
.
query
.
all
()
max_project_num
=
''
project_num_list
=
''
if
project_obj_list
:
max_project_num
=
max
([
project_obj
.
project_num
for
project_obj
in
project_obj_list
])
if
max_project_num
:
max_project_num
=
max_project_num
[
8
:]
project_num_list
=
[
project_obj
.
project_num
for
project_obj
in
project_obj_list
if
(
project_obj
.
project_num
)
.
startswith
(
time_strf
)]
if
project_num_list
:
max_project_num
=
max
(
project_num_list
)[
8
:]
num
=
get_num
(
max_project_num
)
if
num
==
'error'
:
return
jsonify
(
code
=
RET
.
DATAERR
,
msg
=
'编号超出三位的规定范围,请联系管理员'
)
return
'error'
project_num
=
time_strf
+
num
else
:
project_num
=
time_strf
+
'001'
...
...
@@ -791,15 +792,6 @@ def upload_project_data1():
add_num
=
0
rep_project_li
=
[]
rep_project_num
=
0
# row_list = [table.row_values(i) for i in range(4, nrows)]
# rows = len(row_list)
# total_num = rows
# for i in range(0, rows):
# row_content = row_list[i]
# if not row_content:
# return jsonify(code=RET.NODATA,
# msg="{}表格内无有效数据!".format('线索库' if data_type == 1 else '对接库' if data_type == 2
# else '签约库' if data_type == 3 else '开工库' if data_type == 4 else ''))
if
int
(
data_type
)
==
1
:
# 上传线索库
row_list
=
[
table
.
row_values
(
i
)
for
i
in
range
(
4
,
nrows
)]
rows
=
len
(
row_list
)
...
...
apps/models.py
View file @
38b556cc
...
...
@@ -918,8 +918,8 @@ class User(BaseModel, db.Model):
# 个人中心的信息
function
=
db
.
Column
(
db
.
Text
,
comment
=
'工作职能 ---个人中心'
)
flag
=
db
.
Column
(
db
.
Integer
,
comment
=
'普通1,政府2'
)
# status = db.Column(db.Integer, comment='通过1,在审2,驳回3')
status
=
db
.
Column
(
db
.
Integer
,
comment
=
'0禁止,1在用'
)
# status = db.Column(db.Integer, comment='通过1,在审2,驳回3')
# bused = db.Column(db.Integer) # 账户有无组织
# 政府信息
position
=
db
.
Column
(
db
.
String
(
30
),
comment
=
'现任职务(职务)'
)
...
...
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