Commit 6d1656bf by dong

fix20221118

parent 233866e2
......@@ -649,6 +649,12 @@ def add_project():
)
db.session.add(new_project_obj)
db.session.commit()
# 记录项目动态
project_id = new_project_obj.id
time1 = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
write_dynamic(upload_people, project_id, '新增了 {} 项目。'.format(project_name), time1)
return jsonify(code=RET.OK, msg='新增成功!')
except Exception as e:
return jsonify(code=RET.DATAERR, msg='新增失败!')
......@@ -671,11 +677,18 @@ def batch_del():
try:
for select_id in select_id_list:
project_obj = SikuProject.query.get(select_id)
project_name = project_obj.project_name
if not project_obj:
return jsonify(code=RET.NODATA, msg="查无此项目!")
project_obj.is_delete = 1
db.session.commit()
# 记录项目动态
for project_id in select_id_list:
time1 = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
write_dynamic(user_name, project_id, '删除了 {} 项目。'.format(project_name), time1)
continue
return jsonify(code=RET.OK, msg="批量删除成功!")
except Exception as e:
current_app.logger.error(e)
......@@ -1505,7 +1518,7 @@ def batch_export_project1():
current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="用户信息校验失败,请重新登陆后尝试!")
select_id_list = req_dic["select_id_list"]
path = './apps/statics/project_file/'
path = './apps/static/project_file/'
# pro_path = 'D:/中研项目代码/flask_jincheng/apps/statics/project_file/'
pro_path = 'http://39.100.39.50:5050/static/project_file/' # 项目路径
if not select_id_list:
......@@ -1600,7 +1613,7 @@ def batch_export_project2():
current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="用户信息校验失败,请重新登陆后尝试!")
select_id_list = req_dic["select_id_list"]
path = './apps/statics/project_file/'
path = './apps/static/project_file/'
# pro_path = 'D:/中研项目代码/flask_jincheng/apps/statics/project_file/'
pro_path = 'http://39.100.39.50:5050/static/project_file/' # 项目路径
if not select_id_list:
......@@ -1710,7 +1723,7 @@ def batch_export_project3():
current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="用户信息校验失败,请重新登陆后尝试!")
select_id_list = req_dic["select_id_list"]
path = './apps/statics/project_file/'
path = './apps/static/project_file/'
# pro_path = 'D:/中研项目代码/flask_jincheng/apps/statics/project_file/'
pro_path = 'http://39.100.39.50:5050/static/project_file/' # 项目路径
if not select_id_list:
......@@ -1834,7 +1847,7 @@ def batch_export_project4():
current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="用户信息校验失败,请重新登陆后尝试!")
select_id_list = req_dic["select_id_list"]
path = './apps/statics/project_file/'
path = './apps/static/project_file/'
# pro_path = 'D:/中研项目代码/flask_jincheng/apps/statics/project_file/'
pro_path = 'http://39.100.39.50:5050/static/project_file/' # 项目路径
if not select_id_list:
......
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