2021-12-09 01:29:35 +08:00
|
|
|
import json
|
|
|
|
|
2021-12-01 10:31:39 +08:00
|
|
|
from flask import Blueprint, request
|
|
|
|
|
2021-12-08 16:17:58 +08:00
|
|
|
from common import verify_token
|
2022-06-09 14:30:11 +08:00
|
|
|
from tyc import save_full_data, company_baseinfo, corporate_shareholders, principal_officer, save_guarantee_risk_info
|
2021-12-01 10:31:39 +08:00
|
|
|
|
2021-12-08 16:11:25 +08:00
|
|
|
tyc = Blueprint('tyc', __name__)
|
2021-12-01 10:31:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
# 保存天眼查全量数据
|
2021-12-08 16:11:25 +08:00
|
|
|
@tyc.route('/drag_data', methods=['POST'])
|
2021-12-08 16:17:58 +08:00
|
|
|
@verify_token
|
2021-12-01 10:31:39 +08:00
|
|
|
def upload_tyc_data():
|
2021-12-09 01:29:35 +08:00
|
|
|
name = json.loads(request.data)['企业名称']
|
2021-12-01 14:09:33 +08:00
|
|
|
res = save_full_data(name)
|
2021-12-08 14:12:09 +08:00
|
|
|
if res == '保存成功':
|
|
|
|
return {"info": res}, 200
|
|
|
|
else:
|
2021-12-08 17:07:37 +08:00
|
|
|
return {"info": res}, 210
|
2022-06-02 13:52:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
@tyc.route('/basic_info', methods=['POST'])
|
|
|
|
@verify_token
|
|
|
|
def upload_basic_data():
|
|
|
|
"""保存企业基本信息"""
|
|
|
|
name = json.loads(request.data)['企业名称']
|
|
|
|
res = company_baseinfo(name)
|
|
|
|
if res == '保存成功':
|
|
|
|
return {"info": res}, 200
|
|
|
|
else:
|
|
|
|
return {"info": res}, 210
|
2022-06-02 16:07:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
@tyc.route('/shareholders_info', methods=['POST'])
|
|
|
|
@verify_token
|
|
|
|
def upload_shareholders_data():
|
|
|
|
"""保存企业股东"""
|
|
|
|
name = json.loads(request.data)['企业名称']
|
|
|
|
res = corporate_shareholders(name)
|
2022-06-08 14:20:26 +08:00
|
|
|
if res == '保存成功':
|
|
|
|
return {"info": res}, 200
|
|
|
|
else:
|
|
|
|
return {"info": res}, 210
|
|
|
|
|
|
|
|
|
|
|
|
@tyc.route('/main_staff', methods=['POST'])
|
|
|
|
@verify_token
|
2022-06-08 15:41:06 +08:00
|
|
|
def upload_staff_data():
|
2022-06-08 14:20:26 +08:00
|
|
|
"""保存主要人员"""
|
|
|
|
name = json.loads(request.data)['企业名称']
|
|
|
|
res = principal_officer(name)
|
2022-06-09 14:30:11 +08:00
|
|
|
if res == '保存成功':
|
|
|
|
return {"info": res}, 200
|
|
|
|
else:
|
|
|
|
return {"info": res}, 210
|
|
|
|
|
|
|
|
|
|
|
|
@tyc.route('/guarantee_risk_info', methods=['POST'])
|
|
|
|
@verify_token
|
|
|
|
def upload_risk_info():
|
|
|
|
"""保存担保所需风险信息"""
|
2022-06-13 14:12:13 +08:00
|
|
|
data = json.loads(request.data)
|
|
|
|
name, scope, limit = data['企业名称'], data['数据范围'], data['时间范围']
|
|
|
|
res = save_guarantee_risk_info(name, scope, limit)
|
2022-06-02 16:07:33 +08:00
|
|
|
if res == '保存成功':
|
|
|
|
return {"info": res}, 200
|
|
|
|
else:
|
|
|
|
return {"info": res}, 210
|