Commit 9495ea21 by dong

fix20221222

parent 38b556cc
...@@ -329,16 +329,15 @@ def upload_project_data2(): ...@@ -329,16 +329,15 @@ def upload_project_data2():
"沁水县": "140521", "沁水县": "140521",
"晋城经济技术开发区": "140526" "晋城经济技术开发区": "140526"
} }
time_strf = datetime.now().strftime("%Y%m%d") time_strf = datetime.now().strftime("%Y")
max_project_num = '' project_num_li = ''
project_obj_list = ProjectManagement.query.all() project_obj_list = ProjectManagement.query.all()
if project_obj_list: if 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])]) project_num_li = [project_obj.project_num for project_obj in project_obj_list if project_obj.project_num.startswith(time_strf + prefix_dic[district])]
if max_project_num: if project_num_li:
max_project_num = max_project_num[10:] max_project_num = max(project_num_li)[10:]
num = get_num(max_project_num) num = get_num(max_project_num)
if num == 'error': if num == 'error':
# return jsonify(code=RET.DATAERR, msg='编号超出三位的规定范围,请联系管理员')
return 'error' return 'error'
project_num = time_strf + prefix_dic[district] + num project_num = time_strf + prefix_dic[district] + num
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment