Commit f53f9e57 authored by wanli's avatar wanli

update

parent 110522f3
......@@ -27,6 +27,9 @@ deploy/
build/
venv/
node_modules
frontend_backup
logs/*.log
logs/*.log.*
*.db
......@@ -49,6 +52,9 @@ backend/backupData.json
config.ini
*.epk
tools/build_out/logs
tools/build_out/logs/*
release/
release.*
......
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-06-22 12:40:53
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \evm-store\backend\app\signal_manager.py
'''
#!/usr/bin/env python
# -*- coding: utf_8 -*-
......@@ -9,6 +17,7 @@ class SignalManager(object):
actionBackupDatabase = PySignal()
actionApplicationBuild = PySignal()
actionGetConvertString = PySignal()
actionOpqcp = PySignal()
# 登录模块
actionLogin = PySignal()
......
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-06-22 13:38:34
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \evm-store\backend\controller\api_manager.py
'''
#!/usr/bin/env python
# -*- coding: utf_8 -*-
import os
import time
import json
import logging
import traceback
import subprocess
import uuid
from datetime import datetime
from pony.orm import *
from model import fullStackDB
from app.setting import config
from model.user import User
from utils import md5_salt
from utils.ccode import convert_string
......@@ -49,4 +59,28 @@ class ApiManager(object):
def get_escape_text(self, data):
return convert_string(data['string'])
def opqcp(self, params):
target_file = os.path.normpath(os.sep.join([config.get("UPLOAD_PATH"), params.get("filename")]))
print("--------->", params, target_file)
print(os.stat(target_file))
# dtNowString = datetime.now().strftime("%Y%m%d%H%M%S%f")
# fn, ex = os.path.splitext(params.get("filename"))
output_path = os.path.dirname(target_file)
print("#######", output_path)
# command = ["./opqcp", target_file, output_path]
# ret = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8", timeout=5)
# if ret.returncode == 0:
# print("success:", ret)
# else:
# print("error:", ret)
ret = target_file
return True, ret
apiManager = ApiManager()
......@@ -29,11 +29,15 @@ def stopApp():
f.write(json.dumps(ret, indent=4))
return ret
def actionShowReport():
fpath = os.sep.join([os.getcwd(), "results", "TPC-E_dm.pdf"])
with open(fpath, "rb") as f:
ret = f.read()
return ret
@api.route("/opqcp", methods=['POST'])
def action_opqcp():
params = request.json
print(params)
signalManager.actionOpqcp.emit(params)
return response_result(ResponseCode.OK)
@api.route("/updatePassword", methods=['POST'])
@validate_schema(UpdatePasswordSchema)
......@@ -49,11 +53,10 @@ def update_password():
def upload_file():
try:
result = None
message = None
binfile = request.files.get("binfile")
if not binfile:
return response_result(ResponseCode.REQUEST_ERROR, msg=message)
return response_result(ResponseCode.REQUEST_ERROR, msg="upload field name error")
obj = dict()
obj['filename'] = binfile.filename
......@@ -83,10 +86,10 @@ def upload_file():
"uuid": str(uuid.uuid4()), # 附件唯一编号
"filename": obj['filename'], # 附件名称
"filesize": os.path.getsize(saveFile), # 附件大小
"filepath": os.sep.join([config.get("UPLOAD_DIR"), relative_path, filename]).replace("\\", "/"), # 附件存储路径
}, "upload file [%s] successfully!" % obj['filename']
"filepath": os.sep.join([relative_path, filename]).replace("\\", "/"), # 附件存储路径
}
return response_result(ResponseCode.OK, data=result)
return response_result(ResponseCode.OK, data=result, msg="upload file [%s] successfully!" % obj['filename'])
except Exception as e:
traceback.print_exc()
logger.error(str(e))
......
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