Commit 49b4993d by dong

fix20230314

parent 6c5649c5
...@@ -278,7 +278,7 @@ def upload_project_data2(): ...@@ -278,7 +278,7 @@ def upload_project_data2():
table = data.sheets()[0] table = data.sheets()[0]
names = data.sheet_names() # 返回book中所有工作表的名字 names = data.sheet_names() # 返回book中所有工作表的名字
status = data.sheet_loaded(names[0]) # 检查sheet1是否导入完毕 status = data.sheet_loaded(names[0]) # 检查sheet1是否导入完毕
print(status) # print(status)
nrows = table.nrows # 获取该sheet中的有效行数 nrows = table.nrows # 获取该sheet中的有效行数
except Exception as e: except Exception as e:
current_app.logger.error(e) current_app.logger.error(e)
...@@ -564,7 +564,7 @@ def batch_export_project5(): ...@@ -564,7 +564,7 @@ def batch_export_project5():
sheet_name = k sheet_name = k
sheet = excel.add_sheet(sheet_name) sheet = excel.add_sheet(sheet_name)
head_list = v head_list = v
print(head_list) # print(head_list)
for j in range(len(head_list)): for j in range(len(head_list)):
sheet.write(0, j, head_list[j]) sheet.write(0, j, head_list[j])
# 写入数据,从第二行(i+1) # 写入数据,从第二行(i+1)
...@@ -814,7 +814,7 @@ def upload_shanxi_data(): ...@@ -814,7 +814,7 @@ def upload_shanxi_data():
return jsonify(code=RET.SESSIONERR, msg="进行操作时用户信息校验失败,请重新登陆后尝试!") return jsonify(code=RET.SESSIONERR, msg="进行操作时用户信息校验失败,请重新登陆后尝试!")
# 上传的文件 # 上传的文件
file = request.files['file'] file = request.files['file']
print(file.filename) # 打印文件名 # print(file.filename) # 打印文件名
data_time = request.form['data_time'] data_time = request.form['data_time']
# file_name = file.filename # file_name = file.filename
upload_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") upload_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
...@@ -824,7 +824,7 @@ def upload_shanxi_data(): ...@@ -824,7 +824,7 @@ def upload_shanxi_data():
table = data.sheets()[0] table = data.sheets()[0]
names = data.sheet_names() # 返回book中所有工作表的名字 names = data.sheet_names() # 返回book中所有工作表的名字
status = data.sheet_loaded(names[0]) # 检查sheet1是否导入完毕 status = data.sheet_loaded(names[0]) # 检查sheet1是否导入完毕
print(status) # print(status)
nrows = table.nrows # 获取该sheet中的有效行数 nrows = table.nrows # 获取该sheet中的有效行数
except Exception as e: except Exception as e:
current_app.logger.error(e) current_app.logger.error(e)
......
...@@ -1819,7 +1819,7 @@ def batch_export_project1(): ...@@ -1819,7 +1819,7 @@ def batch_export_project1():
sheet_name = k sheet_name = k
sheet = excel.add_sheet(sheet_name) sheet = excel.add_sheet(sheet_name)
head_list = v head_list = v
print(head_list) # print(head_list)
for j in range(len(head_list)): for j in range(len(head_list)):
sheet.write(0, j, head_list[j]) sheet.write(0, j, head_list[j])
# 写入数据,从第二行(i+1) # 写入数据,从第二行(i+1)
...@@ -1936,7 +1936,7 @@ def batch_export_project2(): ...@@ -1936,7 +1936,7 @@ def batch_export_project2():
sheet_name = k sheet_name = k
sheet = excel.add_sheet(sheet_name) sheet = excel.add_sheet(sheet_name)
head_list = v head_list = v
print(head_list) # print(head_list)
for j in range(len(head_list)): for j in range(len(head_list)):
sheet.write(0, j, head_list[j]) sheet.write(0, j, head_list[j])
# 写入数据,从第二行(i+1) # 写入数据,从第二行(i+1)
...@@ -2066,7 +2066,7 @@ def batch_export_project3(): ...@@ -2066,7 +2066,7 @@ def batch_export_project3():
sheet_name = k sheet_name = k
sheet = excel.add_sheet(sheet_name) sheet = excel.add_sheet(sheet_name)
head_list = v head_list = v
print(head_list) # print(head_list)
for j in range(len(head_list)): for j in range(len(head_list)):
sheet.write(0, j, head_list[j]) sheet.write(0, j, head_list[j])
# 写入数据,从第二行(i+1) # 写入数据,从第二行(i+1)
......
...@@ -1008,7 +1008,7 @@ class User(BaseModel, db.Model): ...@@ -1008,7 +1008,7 @@ class User(BaseModel, db.Model):
s = Serializer(Config.SECRET_KEY, expires_in=Config.TOKEN_EXPIRATION) s = Serializer(Config.SECRET_KEY, expires_in=Config.TOKEN_EXPIRATION)
# 接收用户id转换与编码 # 接收用户id转换与编码
token = s.dumps({"id": user_id}).decode('ascii') token = s.dumps({"id": user_id}).decode('ascii')
print(token) # print(token)
return token return token
......
...@@ -378,8 +378,6 @@ def project(): ...@@ -378,8 +378,6 @@ def project():
i = 0 i = 0
for project in project_list: for project in project_list:
i += 1 i += 1
print(i)
print(i)
if i > 7: if i > 7:
pass pass
else: else:
......
...@@ -142,13 +142,6 @@ def back_login(): ...@@ -142,13 +142,6 @@ def back_login():
role_name = '超级管理员' role_name = '超级管理员'
if role == 2: if role == 2:
role_name = '系统运维员' role_name = '系统运维员'
# operation_message = "{}通过后台登录成功了!".format(role_name)
# upload_time = datetime.now()
# log = OperationLog(read_type=0, operation_people_id=user.id, operation_time=upload_time, operation_people=name,
# section=role_name,
# operation_message=operation_message, action='使用密码登录后台管理系统成功')
# db.session.add(log)
# db.session.commit()
return jsonify(code=RET.OK, msg="登录成功", token=token, flag=3) return jsonify(code=RET.OK, msg="登录成功", token=token, flag=3)
......
...@@ -414,7 +414,9 @@ def company_list(): ...@@ -414,7 +414,9 @@ def company_list():
company_count = company_obj.count() company_count = company_obj.count()
data = [{ data = [{
"id": company_obj.id, "id": company_obj.id,
"name": company_obj.company_name "name": company_obj.company_name,
"product_all": company_obj.product_all,
"c_name": company_obj.c_name
} for company_obj in company_obj_list] } for company_obj in company_obj_list]
except Exception as e: except Exception as e:
......
...@@ -18,9 +18,12 @@ def handle(): ...@@ -18,9 +18,12 @@ def handle():
# 读取企业数据表的资质 # 读取企业数据表的资质
i = 1 i = 1
# for company_obj in company_obj_list: # for company_obj in company_obj_list:
for id in range(16, 5944047): for id in range(305515, 5944047):
company_obj = Enterprise.query.get(id) try:
if not company_obj: company_obj = Enterprise.query.get(id)
if not company_obj:
continue
except:
continue continue
grade_li = [] grade_li = []
......
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