Commit 6d6f4b3b by dong

fix20230721

parent db6ce03b
...@@ -489,6 +489,7 @@ def batch_export_project5(): ...@@ -489,6 +489,7 @@ def batch_export_project5():
# path = './apps/statics/project_file/' # path = './apps/statics/project_file/'
# pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径 # pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径
path = '/root/code/dist_jincheng/aaa_statics/project_file/'
pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径 pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径
if not select_id_list: if not select_id_list:
return jsonify(code=RET.PARAMERR, msg="参数不能为空!") return jsonify(code=RET.PARAMERR, msg="参数不能为空!")
...@@ -594,7 +595,7 @@ def batch_export_project5(): ...@@ -594,7 +595,7 @@ def batch_export_project5():
sheet.write(i + 1, j, target_data_list[i][j]) sheet.write(i + 1, j, target_data_list[i][j])
time_stamp = '{0:%Y%m%d%H%M%S}'.format(datetime.now()) time_stamp = '{0:%Y%m%d%H%M%S}'.format(datetime.now())
file_name = "招商引资项目表{}.xlsx".format(time_stamp) file_name = "招商引资项目表{}.xlsx".format(time_stamp)
excel.save(pro_path + file_name) excel.save(path + file_name)
return jsonify(code=RET.OK, url=pro_path + file_name, msg="导出/下载成功!") return jsonify(code=RET.OK, url=pro_path + file_name, msg="导出/下载成功!")
except Exception as e: except Exception as e:
current_app.logger.error(e) current_app.logger.error(e)
...@@ -1116,9 +1117,11 @@ def download_shanxi_data(): ...@@ -1116,9 +1117,11 @@ def download_shanxi_data():
req_dic = request.get_json() req_dic = request.get_json()
data_time = req_dic["data_time"] data_time = req_dic["data_time"]
path = './apps/statics/project_file/' # path = './apps/statics/project_file/'
pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径 # pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径
# pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径
path = '/root/code/dist_jincheng/aaa_statics/project_file/'
pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径
if not data_time: if not data_time:
return jsonify(code=RET.PARAMERR, msg="参数不能为空!") return jsonify(code=RET.PARAMERR, msg="参数不能为空!")
target_data_list = [] target_data_list = []
...@@ -1513,9 +1516,11 @@ def download_jc_data(): ...@@ -1513,9 +1516,11 @@ def download_jc_data():
req_dic = request.get_json() req_dic = request.get_json()
year = req_dic["year"] year = req_dic["year"]
path = './apps/statics/project_file/' # path = './apps/statics/project_file/'
pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径 # pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径
# pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径
path = '/root/code/dist_jincheng/aaa_statics/project_file/'
pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径
if not year: if not year:
return jsonify(code=RET.PARAMERR, msg="参数不能为空!") return jsonify(code=RET.PARAMERR, msg="参数不能为空!")
target_data_list = [] target_data_list = []
...@@ -1815,9 +1820,11 @@ def download_money_arrive(): ...@@ -1815,9 +1820,11 @@ def download_money_arrive():
req_dic = request.get_json() req_dic = request.get_json()
data_time = req_dic["data_time"] data_time = req_dic["data_time"]
path = './apps/statics/project_file/' # path = './apps/statics/project_file/'
pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径 # pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径
# pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径
path = '/root/code/dist_jincheng/aaa_statics/project_file/'
pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径
if not data_time: if not data_time:
return jsonify(code=RET.PARAMERR, msg="参数不能为空!") return jsonify(code=RET.PARAMERR, msg="参数不能为空!")
target_data_list = [] target_data_list = []
......
...@@ -1980,6 +1980,8 @@ def batch_export_project3(): ...@@ -1980,6 +1980,8 @@ def batch_export_project3():
# path = './apps/statics/project_file/' # path = './apps/statics/project_file/'
# pro_path = 'D:/中研项目代码/flask_jincheng/apps/statics/project_file/' # pro_path = 'D:/中研项目代码/flask_jincheng/apps/statics/project_file/'
# pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径 # pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径
path = '/root/code/dist_jincheng/aaa_statics/project_file/'
pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径 pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径
if not select_id_list: if not select_id_list:
...@@ -2085,7 +2087,7 @@ def batch_export_project3(): ...@@ -2085,7 +2087,7 @@ def batch_export_project3():
sheet.write(i + 1, j, target_data_list[i][j]) sheet.write(i + 1, j, target_data_list[i][j])
time_stamp = '{0:%Y%m%d%H%M%S}'.format(datetime.now()) time_stamp = '{0:%Y%m%d%H%M%S}'.format(datetime.now())
file_name = "签约库数据{}.xlsx".format(time_stamp) file_name = "签约库数据{}.xlsx".format(time_stamp)
excel.save(pro_path + file_name) excel.save(path + file_name)
# 记录项目动态 # 记录项目动态
for project_id in select_id_list: for project_id in select_id_list:
...@@ -2112,6 +2114,8 @@ def batch_export_project4(): ...@@ -2112,6 +2114,8 @@ def batch_export_project4():
# path = './apps/statics/project_file/' # path = './apps/statics/project_file/'
# pro_path = 'D:/中研项目代码/flask_jincheng/apps/statics/project_file/' # pro_path = 'D:/中研项目代码/flask_jincheng/apps/statics/project_file/'
# pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径 # pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径
path = '/root/code/dist_jincheng/aaa_statics/project_file/'
pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径 pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径
if not select_id_list: if not select_id_list:
...@@ -2212,7 +2216,7 @@ def batch_export_project4(): ...@@ -2212,7 +2216,7 @@ def batch_export_project4():
sheet.write(i + 1, j, target_data_list[i][j]) sheet.write(i + 1, j, target_data_list[i][j])
time_stamp = '{0:%Y%m%d%H%M%S}'.format(datetime.now()) time_stamp = '{0:%Y%m%d%H%M%S}'.format(datetime.now())
file_name = "开工库数据{}.xlsx".format(time_stamp) file_name = "开工库数据{}.xlsx".format(time_stamp)
excel.save(pro_path + file_name) excel.save(path + file_name)
# 记录项目动态 # 记录项目动态
for project_id in select_id_list: for project_id in select_id_list:
......
...@@ -10,6 +10,7 @@ from dateutil.relativedelta import relativedelta ...@@ -10,6 +10,7 @@ from dateutil.relativedelta import relativedelta
from flask import current_app, jsonify, request from flask import current_app, jsonify, request
from sqlalchemy import and_, or_ from sqlalchemy import and_, or_
import zipfile import zipfile
from apps import SERVER_NAME
from apps.models import * from apps.models import *
...@@ -1022,10 +1023,11 @@ def export_jc_data(): ...@@ -1022,10 +1023,11 @@ def export_jc_data():
req_dic = request.get_json() req_dic = request.get_json()
flag = req_dic['flag'] # 1县(市、区)、开发区指标,2开发区(示范区)指标 flag = req_dic['flag'] # 1县(市、区)、开发区指标,2开发区(示范区)指标
data_time = req_dic['data_time'] data_time = req_dic['data_time']
path = './apps/statics/project_file/' # path = './apps/statics/project_file/'
# pro_path = 'http://39.100.39.50:8008/aaa_statics/project_file/' # 项目路径 # pro_path = 'http://39.100.39.50:8008/aaa_statics/project_file/' # 项目路径
pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径 # pro_path = 'http://39.100.39.50:5050/statics/project_file/' # 项目路径
path = '/root/code/dist_jincheng/aaa_statics/project_file/'
pro_path = SERVER_NAME + '/aaa_statics/project_file/' # 项目路径
if flag == 1: if flag == 1:
res = export_jc_data1(data_time, path, pro_path) res = export_jc_data1(data_time, path, pro_path)
if res == 'error': if res == 'error':
......
...@@ -763,8 +763,11 @@ def batch_export_build(): ...@@ -763,8 +763,11 @@ def batch_export_build():
return jsonify(code=RET.SESSIONERR, msg="进行{}操作时用户信息校验失败,请重新登陆后尝试!".format(action_name)) return jsonify(code=RET.SESSIONERR, msg="进行{}操作时用户信息校验失败,请重新登陆后尝试!".format(action_name))
select_id_list = req_dic["select_id_list"] select_id_list = req_dic["select_id_list"]
path = './apps/statics/carrier_file/' # path = './apps/statics/carrier_file/'
pro_path = 'http://39.100.39.50:5050/statics/carrier_file/' # 项目路径 # pro_path = 'http://39.100.39.50:5050/statics/carrier_file/' # 项目路径
path = '/root/code/dist_jincheng/aaa_statics/carrier_file/'
pro_path = SERVER_NAME + '/aaa_statics/carrier_file/' # 项目路径
try: try:
if not select_id_list: if not select_id_list:
return jsonify(code=RET.PARAMERR, msg="参数不能为空!") return jsonify(code=RET.PARAMERR, msg="参数不能为空!")
...@@ -918,9 +921,11 @@ def batch_export_land(): ...@@ -918,9 +921,11 @@ def batch_export_land():
return jsonify(code=RET.SESSIONERR, msg="进行{}操作时用户信息校验失败,请重新登陆后尝试!".format(action_name)) return jsonify(code=RET.SESSIONERR, msg="进行{}操作时用户信息校验失败,请重新登陆后尝试!".format(action_name))
select_id_list = req_dic["select_id_list"] select_id_list = req_dic["select_id_list"]
path = './apps/statics/carrier_file/' # path = './apps/statics/carrier_file/'
pro_path = 'http://39.100.39.50:5050/statics/carrier_file/' # 项目路径 # pro_path = 'http://39.100.39.50:5050/statics/carrier_file/' # 项目路径
path = '/root/code/dist_jincheng/aaa_statics/carrier_file/'
pro_path = SERVER_NAME + '/aaa_statics/carrier_file/' # 项目路径
try: try:
if not select_id_list: if not select_id_list:
return jsonify(code=RET.PARAMERR, msg="参数不能为空!") return jsonify(code=RET.PARAMERR, msg="参数不能为空!")
...@@ -1062,9 +1067,12 @@ def batch_export_factory(): ...@@ -1062,9 +1067,12 @@ def batch_export_factory():
return jsonify(code=RET.SESSIONERR, msg="进行{}操作时用户信息校验失败,请重新登陆后尝试!".format(action_name)) return jsonify(code=RET.SESSIONERR, msg="进行{}操作时用户信息校验失败,请重新登陆后尝试!".format(action_name))
select_id_list = req_dic["select_id_list"] select_id_list = req_dic["select_id_list"]
path = './apps/statics/carrier_file/' # path = './apps/statics/carrier_file/'
# pro_path = 'http://192.168.31.154:5000/static/' # 项目路径 # pro_path = 'http://192.168.31.154:5000/static/' # 项目路径
pro_path = 'http://39.100.39.50:5050/statics/carrier_file/' # 项目路径 # pro_path = 'http://39.100.39.50:5050/statics/carrier_file/' # 项目路径
path = '/root/code/dist_jincheng/aaa_statics/carrier_file/'
pro_path = SERVER_NAME + '/aaa_statics/carrier_file/' # 项目路径
try: try:
if not select_id_list: if not select_id_list:
return jsonify(code=RET.PARAMERR, msg="参数不能为空!") return jsonify(code=RET.PARAMERR, msg="参数不能为空!")
......
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