From c1da10a18c6738f9e411281675e6e037d0aec9a7 Mon Sep 17 00:00:00 2001 From: wcq <744800102@qq.com> Date: Thu, 3 Aug 2023 17:08:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- docker-compose.yml | 12 +- mods/router.py | 4 +- .../company_rate/crud.py | 6 +- .../company_rate/models.py | 0 .../company_rate/pytypes/BjRateRes.py | 0 .../company_rate/rate_utils/config.py | 94 ++ .../company_rate/rate_utils/utils.py | 90 ++ .../company_rate/router.py | 0 .../company_rate/schemas.py | 0 .../company_rate/utils.py | 0 .../company_submit/crud.py | 0 .../company_submit/models.py | 0 .../company_submit/router.py | 0 .../company_submit/schemas.py | 0 .../company_user/crud.py | 0 .../company_user/models.py | 0 .../company_user/router.py | 0 .../company_user/schemas.py | 0 .../form_file/crud.py | 0 .../form_file/model.py | 0 .../form_file/router.py | 0 .../form_file/schemas.py | 0 mods/{cmebiz_rate => smebiz_rate}/router.py | 2 +- static/bj_model.json | 1161 +---------------- static/model/smebiz/model.json | 479 +++++++ static/model/smebiz/model_params.json | 72 + utils/api_data_utils.py | 19 +- 28 files changed, 816 insertions(+), 1125 deletions(-) rename mods/{cmebiz_rate => smebiz_rate}/company_rate/crud.py (96%) rename mods/{cmebiz_rate => smebiz_rate}/company_rate/models.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_rate/pytypes/BjRateRes.py (100%) create mode 100644 mods/smebiz_rate/company_rate/rate_utils/config.py create mode 100644 mods/smebiz_rate/company_rate/rate_utils/utils.py rename mods/{cmebiz_rate => smebiz_rate}/company_rate/router.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_rate/schemas.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_rate/utils.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_submit/crud.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_submit/models.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_submit/router.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_submit/schemas.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_user/crud.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_user/models.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_user/router.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/company_user/schemas.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/form_file/crud.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/form_file/model.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/form_file/router.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/form_file/schemas.py (100%) rename mods/{cmebiz_rate => smebiz_rate}/router.py (88%) create mode 100644 static/model/smebiz/model.json create mode 100644 static/model/smebiz/model_params.json diff --git a/.idea/misc.xml b/.idea/misc.xml index 3ee3f4c..1e5facf 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 77c9a10..45de4e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,6 +20,7 @@ services: - TZ=Asia/Shanghai depends_on: - db + - redis db: image: postgres @@ -33,7 +34,16 @@ services: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" # Map PostgreSQL port 5432 to host port 5432 - + redis: + image: redis:latest + command: ["redis-server", "--appendonly", "yes"] + volumes: + - redis_data:/data + ports: + - "6379:6379" + networks: + - app + - networks: app: external: true diff --git a/mods/router.py b/mods/router.py index c27362f..6ad7590 100644 --- a/mods/router.py +++ b/mods/router.py @@ -1,8 +1,8 @@ from fastapi import APIRouter from .user.router import router as user_router -from .cmebiz_rate.router import router as cmebiz_rate_router +from .smebiz_rate.router import router as smebiz_rate_router router = APIRouter(prefix="") router.include_router(user_router) -router.include_router(cmebiz_rate_router) +router.include_router(smebiz_rate_router) diff --git a/mods/cmebiz_rate/company_rate/crud.py b/mods/smebiz_rate/company_rate/crud.py similarity index 96% rename from mods/cmebiz_rate/company_rate/crud.py rename to mods/smebiz_rate/company_rate/crud.py index 68d6f0f..c0c161b 100644 --- a/mods/cmebiz_rate/company_rate/crud.py +++ b/mods/smebiz_rate/company_rate/crud.py @@ -12,7 +12,8 @@ from . import schemas from .models import CompanyRate from ..form_file import crud as FormFileCrud from .pytypes.BjRateRes import BjRateRes -from .utils import load_api_data, excel_data_to_model_data_bj, cal_tiaozhengxiang +from .utils import excel_data_to_model_data_bj, cal_tiaozhengxiang +from .rate_utils.utils import load_api_data bj_model_dict = {} man_data_dict = {} @@ -133,7 +134,8 @@ def parse_file_data_to_db(db: Session, item_id): def load_api_data_to_db(db: Session, item_id): item = company_rate_get(db, item_id) if item: - item.api_data = json.dumps(load_api_data(item.company_name, json.loads(item.wj_data) if item.wj_data else {})) + # item.api_data = json.dumps(load_api_data(item.company_name, json.loads(item.wj_data) if item.wj_data else {})) + item.api_data = json.dumps(load_api_data(item.company_name)) marge_data_by_item(db, item) db.commit() db.refresh(item) diff --git a/mods/cmebiz_rate/company_rate/models.py b/mods/smebiz_rate/company_rate/models.py similarity index 100% rename from mods/cmebiz_rate/company_rate/models.py rename to mods/smebiz_rate/company_rate/models.py diff --git a/mods/cmebiz_rate/company_rate/pytypes/BjRateRes.py b/mods/smebiz_rate/company_rate/pytypes/BjRateRes.py similarity index 100% rename from mods/cmebiz_rate/company_rate/pytypes/BjRateRes.py rename to mods/smebiz_rate/company_rate/pytypes/BjRateRes.py diff --git a/mods/smebiz_rate/company_rate/rate_utils/config.py b/mods/smebiz_rate/company_rate/rate_utils/config.py new file mode 100644 index 0000000..1cea34b --- /dev/null +++ b/mods/smebiz_rate/company_rate/rate_utils/config.py @@ -0,0 +1,94 @@ +API_DATA_COLUMNS = [ + "成立年限", + "公司类型", + "近三年股东变更次数", + "最近10条企业舆情负面占比", + "开庭公告(被告-合同纠纷、劳动争议)", + "纳税信用等级", + "双随机抽查结果", + "经营异常", + "欠税公告", + "行政处罚(警告、通报批评、罚款)", + "行政处罚(没收违法所得、没收非法财务...)", + "被执行人", + "失信被执行人", + "税收违法", + "严重违法", + # 报告所需字段 + "企业中文名称", + "所属国民经济行业", + "英文名称", + "工商注册号", + "组织机构代码", + "统一社会信用代码", + "注册资本", + "企业类型", + "注册地址", + "成立日期", + "核准日期", + "营业期限终止日期", + "法定代表人", + "经营地址", + "邮政编码", + "联系电话", + "传真号码", + "电子邮箱", + "企业网址", + "经营范围", + "主要产品", + "历史沿革", + "股权结构", + "高管构成", + "企业资质", + "企业商标", + "企业专利", + "企业软件著作权", + "企业供应商", + "企业招投标情况", +] + +劳动仲裁案由 = ["劳动争议", "劳动合同纠纷", "确认劳动关系纠纷", "集体合同纠纷", "劳务派遣合同纠纷", + "非全日制用工纠纷", "追索劳动报酬纠纷", "经济补偿金纠纷", "竞业限制纠纷", "社会保险纠纷", + "养老保险待遇纠纷", "工伤保险待遇纠纷", "医疗保险待遇纠纷", "生育保险待遇纠纷", "失业保险待遇纠纷", + "福利待遇纠纷"] +合同纠纷案由 = ["合同纠纷", "缔约过失责任纠纷", "预约合同纠纷", "确认合同效力纠纷", "确认合同有效纠纷", + "确认合同无效纠纷", "债权人代位权纠纷", "债权人撤销权纠纷", "债权转让合同纠纷", "债务转移合同纠纷", + "债权债务概括转移合同纠纷", "债务加入纠纷", "悬赏广告纠纷", "买卖合同纠纷", "分期付款买卖合同纠纷", + "凭样品买卖合同纠纷", "试用买卖合同纠纷", "所有权保留买卖合同纠纷", "招标投标买卖合同纠纷", + "互易纠纷", "国际货物买卖合同纠纷", "信息网络买卖合同纠纷", "拍卖合同纠纷", + "建设用地使用权合同纠纷", "建设用地使用权出让合同纠纷", "建设用地使用权转让合同纠纷", + "临时用地合同纠纷", "探矿权转让合同纠纷", "采矿权转让合同纠纷", "房地产开发经营合同纠纷", + "委托代建合同纠纷", "合资、合作开发房地产合同纠纷", "项目转让合同纠纷", "房屋买卖合同纠纷", + "商品房预约合同纠纷", "商品房预售合同纠纷", "商品房销售合同纠纷", "商品房委托代理销售合同纠纷", + "经济适用房转让合同纠纷", "农村房屋买卖合同纠纷", "民事主体间房屋拆迁补偿合同纠纷", + "供用电合同纠纷", "供用水合同纠纷", "供用气合同纠纷", "供用热力合同纠纷", "排污权交易纠纷", + "用能权交易纠纷", "用水权交易纠纷", "碳排放权交易纠纷", "碳汇交易纠纷", "赠与合同纠纷", + "公益事业捐赠合同纠纷", "附义务赠与合同纠纷", "借款合同纠纷", "金融借款合同纠纷", "同业拆借纠纷", + "民间借贷纠纷", "小额借款合同纠纷", "金融不良债权转让合同纠纷", "金融不良债权追偿纠纷", + "保证合同纠纷", "抵押合同纠纷", "质押合同纠纷", "定金合同纠纷", "进出口押汇纠纷", + "储蓄存款合同纠纷", "银行卡纠纷", "借记卡纠纷", "信用卡纠纷", "租赁合同纠纷", "土地租赁合同纠纷", + "房屋租赁合同纠纷", "车辆租赁合同纠纷", "建筑设备租赁合同纠纷", "融资租赁合同纠纷", "保理合同纠纷", + "承揽合同纠纷", "加工合同纠纷", "定作合同纠纷", "修理合同纠纷", "复制合同纠纷", "测试合同纠纷", + "检验合同纠纷", "铁路机车、车辆建造合同纠纷", "建设工程合同纠纷", "建设工程勘察合同纠纷", + "建设工程设计合同纠纷", "建设工程施工合同纠纷", "建设工程价款优先受偿权纠纷", + "建设工程分包合同纠纷", "建设工程监理合同纠纷", "装饰装修合同纠纷", "铁路修建合同纠纷", + "农村建房施工合同纠纷", "运输合同纠纷", "公路旅客运输合同纠纷", "公路货物运输合同纠纷", + "水路旅客运输合同纠纷", "水路货物运输合同纠纷", "航空旅客运输合同纠纷", "航空货物运输合同纠纷", + "出租汽车运输合同纠纷", "管道运输合同纠纷", "城市公交运输合同纠纷", "联合运输合同纠纷", + "多式联运合同纠纷", "铁路货物运输合同纠纷", "铁路旅客运输合同纠纷", "铁路行李运输合同纠纷", + "铁路包裹运输合同纠纷", "国际铁路联运合同纠纷", "保管合同纠纷", "仓储合同纠纷", "委托合同纠纷", + "进出口代理合同纠纷", "货运代理合同纠纷", "民用航空运输销售代理合同纠纷", + "诉讼、仲裁、人民调解代理合同纠纷", "销售代理合同纠纷", "委托理财合同纠纷", "金融委托理财合同纠纷", + "民间委托理财合同纠纷", "物业服务合同纠纷", "行纪合同纠纷", "中介合同纠纷", "补偿贸易纠纷", + "借用合同纠纷", "典当纠纷", "合伙合同纠纷", "种植、养殖回收合同纠纷", "彩票、奖券纠纷", + "中外合作勘探开发自然资源合同纠纷", "农业承包合同纠纷", "林业承包合同纠纷", "渔业承包合同纠纷", + "牧业承包合同纠纷", "土地承包经营权合同纠纷", "土地承包经营权转让合同纠纷", + "土地承包经营权互换合同纠纷", "土地经营权入股合同纠纷", "土地经营权抵押合同纠纷", + "土地经营权出租合同纠纷", "居住权合同纠纷", "服务合同纠纷", "电信服务合同纠纷", "邮政服务合同纠纷", + "快递服务合同纠纷", "医疗服务合同纠纷", "法律服务合同纠纷", "旅游合同纠纷", "房地产咨询合同纠纷", + "房地产价格评估合同纠纷", "旅店服务合同纠纷", "财会服务合同纠纷", "餐饮服务合同纠纷", + "娱乐服务合同纠纷", "有线电视服务合同纠纷", "网络服务合同纠纷", "教育培训合同纠纷", + "家政服务合同纠纷", "庆典服务合同纠纷", "殡葬服务合同纠纷", "农业技术服务合同纠纷", + "农机作业服务合同纠纷", "保安服务合同纠纷", "银行结算合同纠纷", "演出合同纠纷", "劳务合同纠纷", + "离退休人员返聘合同纠纷", "广告合同纠纷", "展览合同纠纷", "追偿权纠纷", "居间合同纠纷", + "农村土地承包合同纠纷", "合伙协议纠纷", "房屋拆迁安置补偿合同纠纷"] diff --git a/mods/smebiz_rate/company_rate/rate_utils/utils.py b/mods/smebiz_rate/company_rate/rate_utils/utils.py new file mode 100644 index 0000000..f6d56b2 --- /dev/null +++ b/mods/smebiz_rate/company_rate/rate_utils/utils.py @@ -0,0 +1,90 @@ +from datetime import datetime + +from context.common import tianyancha_api +from mods.smebiz_rate.company_rate.rate_utils.config import 合同纠纷案由, 劳动仲裁案由 + + +def filter_bg(data: [], company_name): + new_data = [] + for item in data: + add = False + for i in item['defendant']: + if company_name in i['name']: + add = True + if add: + new_data.append(item) + + return new_data + + +def load_api_data(company_name): + 司法风险, _ = tianyancha_api.get("司法风险", {"keyword": company_name}) + # 资质证书, 资质证书数量 = tianyancha_api.get("资质证书", {"keyword": company_name}) + # 历史经营异常数量 = tianyancha_api.get_total("历史经营异常", {"keyword": company_name}) + 双随机抽查, 双随机抽查数量 = tianyancha_api.get("双随机抽查", {"keyword": company_name}) + 双随机抽查详情 = [tianyancha_api.get("双随机抽查详情", {"businessId": item['taskList'][0]['businessId']})[0] for + item in 双随机抽查] + 质押比例, _ = tianyancha_api.get("质押比例", {"keyword": company_name}) + # 破产重整数量 = tianyancha_api.get_total("破产重整", {"keyword": company_name}) + # 司法拍卖数量 = tianyancha_api.get_total("司法拍卖", {"keyword": company_name}) + 企业基本信息, _ = tianyancha_api.get("企业基本信息", {"keyword": company_name}) + # 企业专利信息数量 = tianyancha_api.get_total("企业专利信息", {"keyword": company_name}) + # 知识产权出质, _ = tianyancha_api.get("知识产权出质", {"keyword": company_name}) + 税务评级, _ = tianyancha_api.get("税务评级", {"keyword": company_name}) + 进出口信用, _ = tianyancha_api.get("进出口信用", {"keyword": company_name}) + 税收违法数量 = tianyancha_api.get_total("税收违法", {"keyword": company_name}) + 欠税公告数量 = tianyancha_api.get_total("欠税公告", {"keyword": company_name}) + # 行政许可数量 = tianyancha_api.get_total("行政许可", {"keyword": company_name}) + 行政处罚数量 = tianyancha_api.get_total("行政处罚", {"keyword": company_name}) + 经营异常数量 = tianyancha_api.get_total("经营异常", {"keyword": company_name}) + 严重违法数量 = tianyancha_api.get_total("严重违法", {"keyword": company_name}) + # 终本案件数量 = tianyancha_api.get_total("终本案件", {"keyword": company_name}) + 失信被执行人数量 = tianyancha_api.get_total("失信被执行人", {"keyword": company_name}) + 被执行人数量 = tianyancha_api.get_total("被执行人", {"keyword": company_name}) + 限制消费令数量 = tianyancha_api.get_total("限制消费令", {"keyword": company_name}) + 股权变更, _ = tianyancha_api.get("股权变更", {"keyword": company_name}) + 新闻舆情, _ = tianyancha_api.get("新闻舆情", {"name": company_name}, page=1) + + 成立年限 = datetime.now().year - datetime.fromtimestamp( + 企业基本信息['estiblishTime'] / 1000).year if 企业基本信息 else 0 + 公司类型 = 企业基本信息['companyOrgType'] + + 开庭公告_劳动争议 = len( + [item["caseReason"] for item in filter_bg(司法风险['ktAnnouncementList'], company_name) if + item['caseReason'] in 劳动仲裁案由]) if 司法风险 else 0 + + 开庭公告_被告_合同纠纷 = len( + [item["caseReason"] for item in 司法风险['ktAnnouncementList'] if + item["caseReason"] and item["caseReason"] in 合同纠纷案由]) if 司法风险 else 0 + + 纳税信用等级 = 税务评级[0]['grade'] if 税务评级 else "M" + + 双随机抽查结果 = '合格' + for item in 双随机抽查详情: + for child in item: + if child['checkResult'] != '未发现问题': + 双随机抽查结果 = '批评和处罚' + break + now = datetime.now() + 近三年股东变更次数 = len([item for item in 股权变更 if + datetime.fromtimestamp(item['change_time'] / 1000) > now.replace(year=now.year - 3)]) + + 最近10条企业舆情负面占比 = len([item for item in 新闻舆情 if item['emotion'] == -1]) / 10 * 100 + data = { + "成立年限": 成立年限, + "公司类型": 公司类型, + # "股东性质": None, + "近三年股东变更次数": 近三年股东变更次数, + "最近10条企业舆情负面占比": 最近10条企业舆情负面占比, + "开庭公告(被告-合同纠纷、劳动争议)": 开庭公告_劳动争议 + 开庭公告_被告_合同纠纷, + "纳税信用等级": 纳税信用等级, + "双随机抽查结果": 双随机抽查结果, + "经营异常": 经营异常数量, + "欠税公告": 欠税公告数量, + "行政处罚": 行政处罚数量, + "被执行人": 被执行人数量, + "失信被执行人": 失信被执行人数量, + "税收违法": 税收违法数量, + "严重违法": 严重违法数量 + } + return data diff --git a/mods/cmebiz_rate/company_rate/router.py b/mods/smebiz_rate/company_rate/router.py similarity index 100% rename from mods/cmebiz_rate/company_rate/router.py rename to mods/smebiz_rate/company_rate/router.py diff --git a/mods/cmebiz_rate/company_rate/schemas.py b/mods/smebiz_rate/company_rate/schemas.py similarity index 100% rename from mods/cmebiz_rate/company_rate/schemas.py rename to mods/smebiz_rate/company_rate/schemas.py diff --git a/mods/cmebiz_rate/company_rate/utils.py b/mods/smebiz_rate/company_rate/utils.py similarity index 100% rename from mods/cmebiz_rate/company_rate/utils.py rename to mods/smebiz_rate/company_rate/utils.py diff --git a/mods/cmebiz_rate/company_submit/crud.py b/mods/smebiz_rate/company_submit/crud.py similarity index 100% rename from mods/cmebiz_rate/company_submit/crud.py rename to mods/smebiz_rate/company_submit/crud.py diff --git a/mods/cmebiz_rate/company_submit/models.py b/mods/smebiz_rate/company_submit/models.py similarity index 100% rename from mods/cmebiz_rate/company_submit/models.py rename to mods/smebiz_rate/company_submit/models.py diff --git a/mods/cmebiz_rate/company_submit/router.py b/mods/smebiz_rate/company_submit/router.py similarity index 100% rename from mods/cmebiz_rate/company_submit/router.py rename to mods/smebiz_rate/company_submit/router.py diff --git a/mods/cmebiz_rate/company_submit/schemas.py b/mods/smebiz_rate/company_submit/schemas.py similarity index 100% rename from mods/cmebiz_rate/company_submit/schemas.py rename to mods/smebiz_rate/company_submit/schemas.py diff --git a/mods/cmebiz_rate/company_user/crud.py b/mods/smebiz_rate/company_user/crud.py similarity index 100% rename from mods/cmebiz_rate/company_user/crud.py rename to mods/smebiz_rate/company_user/crud.py diff --git a/mods/cmebiz_rate/company_user/models.py b/mods/smebiz_rate/company_user/models.py similarity index 100% rename from mods/cmebiz_rate/company_user/models.py rename to mods/smebiz_rate/company_user/models.py diff --git a/mods/cmebiz_rate/company_user/router.py b/mods/smebiz_rate/company_user/router.py similarity index 100% rename from mods/cmebiz_rate/company_user/router.py rename to mods/smebiz_rate/company_user/router.py diff --git a/mods/cmebiz_rate/company_user/schemas.py b/mods/smebiz_rate/company_user/schemas.py similarity index 100% rename from mods/cmebiz_rate/company_user/schemas.py rename to mods/smebiz_rate/company_user/schemas.py diff --git a/mods/cmebiz_rate/form_file/crud.py b/mods/smebiz_rate/form_file/crud.py similarity index 100% rename from mods/cmebiz_rate/form_file/crud.py rename to mods/smebiz_rate/form_file/crud.py diff --git a/mods/cmebiz_rate/form_file/model.py b/mods/smebiz_rate/form_file/model.py similarity index 100% rename from mods/cmebiz_rate/form_file/model.py rename to mods/smebiz_rate/form_file/model.py diff --git a/mods/cmebiz_rate/form_file/router.py b/mods/smebiz_rate/form_file/router.py similarity index 100% rename from mods/cmebiz_rate/form_file/router.py rename to mods/smebiz_rate/form_file/router.py diff --git a/mods/cmebiz_rate/form_file/schemas.py b/mods/smebiz_rate/form_file/schemas.py similarity index 100% rename from mods/cmebiz_rate/form_file/schemas.py rename to mods/smebiz_rate/form_file/schemas.py diff --git a/mods/cmebiz_rate/router.py b/mods/smebiz_rate/router.py similarity index 88% rename from mods/cmebiz_rate/router.py rename to mods/smebiz_rate/router.py index af3a2ff..8bf5eac 100644 --- a/mods/cmebiz_rate/router.py +++ b/mods/smebiz_rate/router.py @@ -2,7 +2,7 @@ from fastapi import APIRouter from .form_file import router as form_file_router from .company_rate import router as company_rate_router from .company_user import router as company_user_router -router = APIRouter(prefix="/cmebiz_rate") +router = APIRouter(prefix="/smebiz_rate") router.include_router(form_file_router.router) router.include_router(company_rate_router.router) router.include_router(company_user_router.router) diff --git a/static/bj_model.json b/static/bj_model.json index c069acf..5b43745 100644 --- a/static/bj_model.json +++ b/static/bj_model.json @@ -1,915 +1,13 @@ { "model": { - "name": "保健业模型", + "name": "中小商业企业信用评级模型", "columns": [ - { - "name": "公司战略(绿色、双碳、科教、人才、创新驱动、乡村振兴、新型城镇化、可持续发展、应对人口老龄化、就业优先、国家安全、金融安全)", - "key": "公司战略(绿色、双碳、科教、人才、创新驱动、乡村振兴、新型城镇化、可持续发展、应对人口老龄化、就业优先、国家安全、金融安全)", - "type": "int" - }, - { - "name": "成立年限", - "key": "成立年限", - "type": "int" - }, - { - "name": "近三年股东变更次数", - "key": "近三年股东变更次数", - "type": "enum", - "config": { - "options": [ - "3次以上", - "小于3" - ] - } - }, - { - "name": "董事会人数", - "key": "董事会人数", - "type": "int" - }, - { - "name": "独立董事占比", - "key": "独立董事占比", - "type": "float" - }, - { - "name": "董事会会议次数", - "key": "董事会会议次数", - "type": "int" - }, - { - "name": "董事会出席率(平均数)", - "key": "董事会出席率(平均数)", - "type": "float" - }, - { - "name": "监事会人数", - "key": "监事会人数", - "type": "int" - }, - { - "name": "知名商标或品牌数量", - "key": "知名商标或品牌数量", - "type": "int" - }, - { - "name": "产品系列数量", - "key": "产品系列数量", - "type": "int" - }, - { - "name": "产品种类数量", - "key": "产品种类数量", - "type": "int" - }, - { - "name": "牵头行业标准和规范制定数量", - "key": "牵头行业标准和规范制定数量", - "type": "int" - }, - { - "name": "参与行业标准和规范制定数量", - "key": "参与行业标准和规范制定数量", - "type": "int" - }, - { - "name": "研发投入占营业收入的比重", - "key": "研发投入占营业收入的比重", - "type": "float" - }, - { - "name": "新产品数量", - "key": "新产品数量", - "type": "int" - }, - { - "name": "风险管理部门员工人数", - "key": "风险管理部门员工人数", - "type": "int" - }, - { - "name": "风险管理覆盖部门(市场、作业、行政、人力、财务、合规、技术研发、其他)", - "key": "风险管理覆盖部门(市场、作业、行政、人力、财务、合规、技术研发、其他)", - "type": "int" - }, - { - "name": "营业收入", - "key": "营业收入", - "type": "float" - }, - { - "name": "总资产", - "key": "总资产", - "type": "float" - }, - { - "name": "毛利率", - "key": "毛利率", - "type": "float" - }, - { - "name": "净资产收益率", - "key": "净资产收益率", - "type": "float" - }, - { - "name": "总资产报酬率", - "key": "总资产报酬率", - "type": "float" - }, - { - "name": "流动比率", - "key": "流动比率", - "type": "float" - }, - { - "name": "速动比率", - "key": "速动比率", - "type": "float" - }, - { - "name": "应收账款周转率", - "key": "应收账款周转率", - "type": "float" - }, - { - "name": "总资产周转率", - "key": "总资产周转率", - "type": "float" - }, - { - "name": "资产负债率", - "key": "资产负债率", - "type": "float" - }, - { - "name": "经营性净现金流/流动负债", - "key": "经营性净现金流/流动负债", - "type": "float" - }, - { - "name": "劳动仲裁", - "key": "劳动仲裁", - "type": "int" - }, - { - "name": "开庭公告(案由为劳动争议)", - "key": "开庭公告(案由为劳动争议)", - "type": "int" - }, - { - "name": "社会保险", - "key": "社会保险", - "type": "enum", - "config": { - "options": [ - "六险二金", - "六险一金", - "五险二金", - "五险一金", - "四险二金", - "四险一金", - "其他" - ] - } - }, - { - "name": "死亡数量", - "key": "死亡数量", - "type": "enum", - "config": { - "options": [ - "1及以上", - "0" - ] - } - }, - { - "name": "工伤数量", - "key": "工伤数量", - "type": "enum", - "config": { - "options": [ - "1及以上", - "0" - ] - } - }, - { - "name": "资质证书数量", - "key": "资质证书数量", - "type": "int" - }, - { - "name": "历史经营异常", - "key": "历史经营异常", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "自身合同违约次数", - "key": "自身合同违约次数", - "type": "enum", - "config": { - "options": [ - "1及以上", - "0" - ] - } - }, - { - "name": "开庭公告(案由为合同纠纷)", - "key": "开庭公告(案由为合同纠纷)", - "type": "int" - }, - { - "name": "双随机抽查结果", - "key": "双随机抽查结果", - "type": "enum", - "config": { - "options": [ - "合格", - "批评和处罚" - ] - } - }, - { - "name": "食品安全", - "key": "食品安全", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "假冒化妆品", - "key": "假冒化妆品", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "投诉率", - "key": "投诉率", - "type": "float" - }, - { - "name": "股权质押比例", - "key": "股权质押比例", - "type": "float" - }, - { - "name": "自身违约次数", - "key": "自身违约次数", - "type": "enum", - "config": { - "options": [ - "1及以上", - "0" - ] - } - }, - { - "name": "自身违约金额", - "key": "自身违约金额", - "type": "enum", - "config": { - "options": [ - "不为0", - "0" - ] - } - }, - { - "name": "破产重整", - "key": "破产重整", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "司法拍卖", - "key": "司法拍卖", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "担保代偿比例", - "key": "担保代偿比例", - "type": "float" - }, - { - "name": "数据安全投入占比", - "key": "数据安全投入占比", - "type": "float" - }, - { - "name": "供应商实收资本", - "key": "供应商实收资本", - "type": "float" - }, - { - "name": "专利信息", - "key": "专利信息", - "type": "enum", - "config": { - "options": [ - "1及以上", - "0" - ] - } - }, - { - "name": "知产出质", - "key": "知产出质", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "纳税信用等级", - "key": "纳税信用等级", - "type": "enum", - "config": { - "options": [ - "A", - "B", - "M", - "C", - "D" - ] - } - }, - { - "name": "海关信用等级", - "key": "海关信用等级", - "type": "enum", - "config": { - "options": [ - "认证企业", - "一般信用企业", - "失信企业" - ] - } - }, - { - "name": "税收违法", - "key": "税收违法", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "欠税公告", - "key": "欠税公告", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "行政许可数量", - "key": "行政许可数量", - "type": "int" - }, - { - "name": "行政处罚数量", - "key": "行政处罚数量", - "type": "int" - }, - { - "name": "非正常户", - "key": "非正常户", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "经营异常", - "key": "经营异常(公示信息隐瞒真实情况/弄虚作假、登记的住所/经营场所无法联系企业、未在规定期限公示年度报告、未按规定公示企业信息、未在登记所从事经营活动、商事主体名称不适宜、其他原因)", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "严重违法", - "key": "严重违法", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "黑名单", - "key": "黑名单", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "环保处罚", - "key": "环保处罚", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "近三年信用修复次数", - "key": "近三年信用修复次数", - "type": "string" - }, - { - "name": "立案信息", - "key": "立案信息", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "终本案件", - "key": "终本案件", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "失信被执行人", - "key": "失信被执行人", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "被执行人", - "key": "被执行人", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "限制高消费", - "key": "限制高消费", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "股权冻结", - "key": "股权冻结", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "限制出境", - "key": "限制出境", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - } ] }, "企业填报数据": { "问卷": { "type": "fromColumns", "columns": [ - { - "name": "公司全称", - "key": "公司全称", - "type": "string" - }, - { - "name": "统一社会信用代码", - "key": "统一社会信用代码", - "type": "string" - }, - { - "name": "2020~2022年公司股东变更次数", - "key": "2020~2022年公司股东变更次数", - "type": "enum", - "config": { - "options": [ - "3次以上", - "小于3" - ] - } - }, - { - "name": "是否设立董事会", - "key": "是否设立董事会", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "董事会人数", - "key": "董事会人数", - "type": "int" - }, - { - "name": "独立董事人数", - "key": "独立董事人数", - "type": "int" - }, - { - "name": "董事会会议次数", - "key": "董事会会议次数", - "type": "int" - }, - { - "name": "董事会出席率", - "key": "董事会出席率", - "type": "float" - }, - { - "name": "是否设立监事会", - "key": "是否设立监事会", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "监事会人数", - "key": "监事会人数", - "type": "int" - }, - { - "name": "非职工监事委派单位", - "key": "非职工监事委派单位", - "type": "enum", - "config": { - "options": [ - "内部选举", - "股东" - ] - } - }, - { - "name": "是否设立党委会", - "key": "是否设立党委会", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "公司战略符合哪些", - "key": "公司战略符合哪些", - "type": "set", - "config": { - "options": [ - "绿色", - "双碳", - "科教", - "人才", - "创新驱动", - "乡村振兴", - "新型城镇化", - "可持续发展", - "应对人口老龄化", - "就业优先", - "国家安全", - "金融安全," - ] - } - }, - { - "name": "是否将风险管理纳入公司战略", - "key": "是否将风险管理纳入公司战略", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "是否设立风险管理部门", - "key": "是否设立风险管理部门", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "公司风险管理体系覆盖哪些部门", - "key": "公司风险管理体系覆盖哪些部门", - "type": "enum", - "config": { - "options": [ - "市场", - "作业", - "行政", - "人力", - "财务", - "合规", - "技术研发", - "其他" - ] - } - }, - { - "name": "2022年末数字化或智能化的风险控制方式覆盖比例", - "key": "2022年末数字化或智能化的风险控制方式覆盖比例", - "type": "float" - }, - { - "name": "2022年公司数据安全投入金额", - "key": "2022年公司数据安全投入金额", - "type": "float" - }, - { - "name": "为公司提供数据安全的供应商名称", - "key": "为公司提供数据安全的供应商名称", - "type": "string" - }, - { - "name": "2022年产品研发投入金额", - "key": "2022年产品研发投入金额", - "type": "float" - }, - { - "name": "2022年末公司产品系列", - "key": "2022年末公司产品系列", - "type": "int" - }, - { - "name": "2022年末公司产品种类", - "key": "2022年末公司产品种类", - "type": "int" - }, - { - "name": "2022年末公司产品数量", - "key": "2022年末公司产品数量", - "type": "int" - }, - { - "name": "2022年公司新产品数量", - "key": "2022年公司新产品数量", - "type": "int" - }, - { - "name": "公司是否曾被纳入黑名单", - "key": "公司是否曾被纳入黑名单", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "近三年公司信用修复次数", - "key": "近三年公司信用修复次数", - "type": "int" - }, - { - "name": "公司获得的国家级荣誉数量", - "key": "公司获得的国家级荣誉数量", - "type": "int" - }, - { - "name": "公司获得的省级荣誉数量", - "key": "公司获得的省级荣誉数量", - "type": "int" - }, - { - "name": "公司注册商标数量", - "key": "公司注册商标数量", - "type": "int" - }, - { - "name": "知名商标或品牌数量(例如驰名商标)", - "key": "知名商标或品牌数量(例如驰名商标)", - "type": "int" - }, - { - "name": "国家级商标或品牌数量", - "key": "国家级商标或品牌数量", - "type": "int" - }, - { - "name": "省级商标或品牌数量", - "key": "省级商标或品牌数量", - "type": "int" - }, - { - "name": "2022年公司缴纳的社会保险", - "key": "2022年公司缴纳的社会保险", - "type": "int" - }, - { - "name": "公司缴纳的社会保险种类", - "key": "公司缴纳的社会保险种类", - "config": { - "options": [ - "六险二金", - "六险一金", - "五险二金", - "五险一金", - "四险二金", - "四险一金", - "其他" - ] - } - }, - { - "name": "2022年公司员工因公死亡数量", - "key": "2022年公司员工因公死亡数量", - "type": "int" - }, - { - "name": "2022年公司员工工伤数量", - "key": "2022年公司员工工伤数量", - "type": "int" - }, - { - "name": "2022年公司提供服务次数", - "key": "2022年公司提供服务次数", - "type": "int" - }, - { - "name": "2022年公司被客户投诉次数", - "key": "2022年公司被客户投诉次数", - "type": "int" - }, - { - "name": "2020~2022年公司信贷、债券、非标融资违约次数", - "key": "2020~2022年公司信贷、债券、非标融资违约次数", - "type": "int" - }, - { - "name": "2020~2022年公司信贷、债券、非标融资违约金额", - "key": "2020~2022年公司信贷、债券、非标融资违约金额", - "type": "float" - }, - { - "name": "2022年公司因关联方违约代偿的金额", - "key": "2022年公司因关联方违约代偿的金额", - "type": "float" - }, - { - "name": "2022年公司应为关联方代偿金额(为关联方提供担保,且该关联方发生违约的金额)", - "key": "2022年公司应为关联方代偿金额(为关联方提供担保,且该关联方发生违约的金额)", - "type": "float" - }, - { - "name": "2020年公司股东或关联方给予公司的资金支持金额", - "key": "2020年公司股东或关联方给予公司的资金支持金额", - "type": "float" - }, - { - "name": "2021年公司股东或关联方给予公司的资金支持金额", - "key": "2021年公司股东或关联方给予公司的资金支持金额", - "type": "float" - }, - { - "name": "2022年公司股东或关联方给予公司的资金支持金额", - "key": "2022年公司股东或关联方给予公司的资金支持金额", - "type": "float" - }, - { - "name": "2020年公司关联交易金额", - "key": "2020年公司关联交易金额", - "type": "float" - }, - { - "name": "2021年公司关联交易金额", - "key": "2021年公司关联交易金额", - "type": "float" - }, - { - "name": "2022年公司关联交易金额", - "key": "2022年公司关联交易金额", - "type": "float" - }, - { - "name": "公司是否参与行业标准和规范制定", - "key": "公司是否参与行业标准和规范制定", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "name": "牵头制定的行业标准名称", - "key": "牵头制定的行业标准名称", - "type": "string" - }, - { - "name": "牵头制定的规范名称", - "key": "牵头制定的规范名称", - "type": "string" - }, - { - "name": "参与制定的行业标准名称", - "key": "参与制定的行业标准名称", - "type": "string" - }, - { - "name": "参与制定的规范名称", - "key": "参与制定的规范名称", - "type": "string" - } ] }, "财报": { @@ -1023,98 +121,46 @@ "天眼查": { "type": "fromModel", "params": [ - "劳动仲裁", - "开庭公告(案由为劳动争议)", - "资质证书数量", - "历史经营异常", - "开庭公告(案由为合同纠纷)", - "双随机抽查结果", - "破产重整", - "司法拍卖", - "专利信息", + "成立年限", + "公司类型", + "近三年股东变更次数", + "最近10条企业舆情负面占比", + "开庭公告(被告-合同纠纷、劳动争议)", "纳税信用等级", - "海关信用等级", - "税收违法", + "双随机抽查结果", + "经营异常", "欠税公告", - "行政许可数量", - "行政处罚数量", - "经营异常(公示信息隐瞒真实情况/弄虚作假、登记的住所/经营场所无法联系企业、未在规定期限公示年度报告、未按规定公示企业信息、未在登记所从事经营活动、商事主体名称不适宜、其他原因)", - "严重违法", - "立案信息", - "终本案件", + "行政处罚(警告、通报批评、罚款)", + "行政处罚(没收违法所得、没收非法财务...)", "被执行人", "失信被执行人", - "限制高消费" + "税收违法", + "严重违法" ], "columns": [ { - "key": "劳动仲裁", - "name": "劳动仲裁", + "key": "成立年限", + "name": "成立年限", "type": "int" }, { - "key": "开庭公告(案由为劳动争议)", - "name": "开庭公告(案由为劳动争议)", - "type": "int" - }, - { - "key": "资质证书数量", - "name": "资质证书数量", - "type": "int" - }, - { - "key": "历史经营异常", - "name": "历史经营异常", - "type": "int" - }, - { - "key": "开庭公告(案由为合同纠纷)", - "name": "开庭公告(案由为合同纠纷)", - "type": "int" - }, - { - "key": "双随机抽查结果", - "name": "双随机抽查结果", + "key": "公司类型", + "name": "公司类型", "type": "enum", "config": { "options": [ - "合格", - "不合格" ] } }, { - "key": "破产重整", - "name": "破产重整", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } + "key": "近三年股东变更次数", + "name": "近三年股东变更次数", + "type": "int" }, { - "key": "司法拍卖", - "name": "司法拍卖", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "key": "专利信息", - "name": "专利信息", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } + "key": "最近10条企业舆情负面占比", + "name": "最近10条企业舆情负面占比", + "type": "float" }, { "key": "纳税信用等级", @@ -1131,131 +177,60 @@ } }, { - "key": "海关信用等级", - "name": "海关信用等级", - "type": "enum", - "config": { - "options": [ - "认证企业", - "一般企业", - "失信企业" - ] - } - }, - { - "key": "税收违法", - "name": "税收违法", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "key": "欠税公告", - "name": "欠税公告", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } - }, - { - "key": "行政许可数量", - "name": "行政许可数量", + "key": "开庭公告(被告-合同纠纷、劳动争议)", + "name": "开庭公告(被告-合同纠纷、劳动争议)", "type": "int" }, { - "key": "行政处罚数量", - "name": "行政处罚数量", + "key": "双随机抽查结果", + "name": "双随机抽查结果", "type": "enum", "config": { "options": [ - "是", - "否" + "合格", + "不合格" ] } }, { "key": "经营异常", "name": "经营异常", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } + "type": "int" }, { - "key": "严重违法", - "name": "严重违法", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } + "key": "欠税公告", + "name": "欠税公告", + "type": "int" }, { - "key": "立案信息", - "name": "立案信息", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } + "key": "行政处罚(警告、通报批评、罚款)", + "name": "行政处罚(警告、通报批评、罚款)", + "type": "int" }, { - "key": "终本案件", - "name": "终本案件", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } + "key": "行政处罚(没收违法所得、没收非法财务...)", + "name": "行政处罚(没收违法所得、没收非法财务...)", + "type": "int" }, { "key": "被执行人", "name": "被执行人", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } + "type": "int" }, { "key": "失信被执行人", "name": "失信被执行人", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } + "type": "int" }, { - "key": "限制高消费", - "name": "限制高消费", - "type": "enum", - "config": { - "options": [ - "是", - "否" - ] - } + "key": "税收违法", + "name": "税收违法", + "type": "int" + }, + { + "key": "严重违法", + "name": "严重违法", + "type": "int" } ] } @@ -1263,45 +238,7 @@ "尽调核实数据": { "定性指标": { "columns": [ - { - "name": "国家级和省级荣誉数量", - "key": "国家级和省级荣誉数量", - "type": "int" - }, - { - "name": "是否提供征信报告", - "key": "是否提供征信报告", - "type": "enum", - "config":{ - "options": ["是","否"] - } - }, - { - "name": "财务数据是否经过审计", - "key": "财务数据是否经过审计", - "type": "enum", - "config":{ - "options": ["是","否"] - } - }, - { - "name": "企业提供的数据数量/应提供数据数量小于90%或是财务数据填报缺少", - "key": "企业提供的数据数量/应提供数据数量小于90%或是财务数据填报缺少", - "type": "enum", - "config":{ - "options": ["是","否"] - } - }, - { - "name": "关联交易/营业收入", - "key": "关联交易/营业收入", - "type": "int" - }, - { - "name": "公司股东或关联方给予的资金支持金额/流动负债", - "key": "公司股东或关联方给予的资金支持金额/流动负债", - "type": "int" - } + ] } } diff --git a/static/model/smebiz/model.json b/static/model/smebiz/model.json new file mode 100644 index 0000000..d676a0e --- /dev/null +++ b/static/model/smebiz/model.json @@ -0,0 +1,479 @@ +{ + "model": { + "name": "中小商业企业信用评级模型", + "columns": [ + ] + }, + "企业填报数据": { + "问卷": { + "type": "fromColumns", + "columns": [ + { + "name": "企业名称", + "key": "企业名称", + "type": "string" + }, + { + "name": "联系人名称", + "key": "联系人名称", + "type": "string" + }, + { + "name": "股东性质", + "key": "股东性质", + "type": "enum" + }, + { + "name": "主营业务", + "key": "主营业务", + "type": "string" + }, + { + "name": "高管平均从业年限", + "key": "高管平均从业年限", + "type": "int" + }, + { + "name": "是否设置董事会", + "key": "是否设置董事会", + "type": "enum" + }, + { + "name": "董事会人数", + "key": "董事会人数", + "type": "int" + }, + { + "name": "是否设置监事会", + "key": "是否设置监事会", + "type": "enum" + }, + { + "name": "监事人数", + "key": "监事人数", + "type": "int" + }, + { + "name": "年度公司股东或关联方给予公司的资金支持金额", + "key": "年度公司股东或关联方给予公司的资金支持金额", + "type": "int" + }, + { + "name": "管理人员人数", + "key": "管理人员人数", + "type": "int" + }, + { + "name": "职能人员人数", + "key": "职能人员人数", + "type": "int" + }, + { + "name": "销售人员人数", + "key": "销售人员人数", + "type": "int" + }, + { + "name": "技术服务人员人数", + "key": "技术服务人员人数", + "type": "int" + }, + { + "name": "本科及以上人员人数", + "key": "本科及以上人员人数", + "type": "int" + }, + { + "name": "专科及以下人员人数", + "key": "专科及以下人员人数", + "type": "int" + }, + { + "name": "年末员工总数", + "key": "年末员工总数", + "type": "int" + }, + { + "name": "年度离职人数", + "key": "年度离职人数", + "type": "int" + }, + { + "name": "年末在职员工年内参与培训人数", + "key": "年末在职员工年内参与培训人数", + "type": "int" + }, + { + "name": "员工周均工作天数", + "key": "员工周均工作天数", + "type": "int" + }, + { + "name": "员工日均工作时长", + "key": "员工日均工作时长", + "type": "int" + }, + { + "name": "年度因公伤亡人次", + "key": "年度因公伤亡人次", + "type": "int" + }, + { + "name": "人民币开户银行名称", + "key": "人民币开户银行名称", + "type": "string" + }, + { + "name": "人民币开户银行账号", + "key": "人民币开户银行账号", + "type": "string" + }, + { + "name": "外币开户银行名称", + "key": "外币开户银行名称", + "type": "string" + }, + { + "name": "外币开户银行账号", + "key": "外币开户银行账号", + "type": "string" + }, + { + "name": "贷款卡编号", + "key": "贷款卡编号", + "type": "string" + }, + { + "name": "经营场所建筑面积", + "key": "经营场所建筑面积", + "type": "string" + }, + { + "name": "经营场所位置", + "key": "经营场所位置", + "type": "string" + }, + { + "name": "经营场所权属关系", + "key": "经营场所权属关系", + "type": "string" + }, + { + "name": "拥有质量管理制度", + "key": "拥有质量管理制度", + "type": "enum" + }, + { + "name": "拥有财务管理制度", + "key": "拥有财务管理制度", + "type": "enum" + }, + { + "name": "拥有合同管理制度", + "key": "拥有合同管理制度", + "type": "enum" + }, + { + "name": "拥有人力资源管理制度", + "key": "拥有人力资源管理制度", + "type": "enum" + }, + { + "name": "工商信用记录", + "key": "工商信用记录", + "type": "string" + }, + { + "name": "海关信用记录", + "key": "海关信用记录", + "type": "string" + }, + { + "name": "银行信用记录", + "key": "银行信用记录", + "type": "string" + }, + { + "name": "法院信用记录", + "key": "法院信用记录", + "type": "string" + }, + { + "name": "生产安全信息", + "key": "生产安全信息", + "type": "string" + }, + { + "name": "社会责任实施", + "key": "社会责任实施", + "type": "string" + }, + { + "name": "销售产品金额", + "key": "销售产品金额", + "type": "int" + }, + { + "name": "退回产品金额", + "key": "退回产品金额", + "type": "int" + }, + { + "name": "发生过客户隐私泄露", + "key": "发生过客户隐私泄露", + "type": "enum" + }, + { + "name": "对外服务总次数(包括电话咨询、客户支持、产品售后等)", + "key": "对外服务总次数(包括电话咨询、客户支持、产品售后等)", + "type": "int" + }, + { + "name": "客户有效投诉次数", + "key": "客户有效投诉次数", + "type": "int" + }, + { + "name": "投诉解决次数", + "key": "投诉解决次数", + "type": "int" + }, + { + "name": "投诉响应时间", + "key": "投诉响应时间", + "type": "int" + } + ] + }, + "财报": { + "type": "fromColumns", + "columns": [ + { + "name": "数据是否经过审计", + "key": "数据是否经过审计", + "type": "enum", + "config": { + "options": [ + "是", + "否" + ] + } + }, + { + "name": "资产负债表", + "key": "资产负债表", + "type": "label" + }, + { + "name": "总资产", + "key": "总资产", + "type": "float" + }, + { + "name": "净资产", + "key": "净资产", + "type": "float" + }, + { + "name": "流动资产", + "key": "流动资产", + "type": "float" + }, + { + "name": "流动负债", + "key": "流动负债", + "type": "float" + }, + { + "name": "总负债", + "key": "总负债", + "type": "float" + }, + { + "name": "存货", + "key": "存货", + "type": "float" + }, + { + "name": "预付账款", + "key": "预付账款", + "type": "float" + }, + { + "name": "应收票据", + "key": "应收票据", + "type": "float" + }, + { + "name": "应收账款", + "key": "应收账款", + "type": "float" + }, + { + "name": "利润表", + "key": "利润表", + "type": "label" + }, + { + "name": "营业收入", + "key": "营业收入", + "type": "float" + }, + { + "name": "主营业务成本", + "key": "主营业务成本", + "type": "float" + }, + { + "name": "利润总额", + "key": "利润总额", + "type": "float" + }, + { + "name": "净利润", + "key": "净利润", + "type": "float" + }, + { + "name": "计入财务费用的利息支出", + "key": "计入财务费用的利息支出", + "type": "float" + }, + { + "name": "现金流量表", + "key": "现金流量表", + "type": "label" + }, + { + "name": "经营性净现金流", + "key": "经营性净现金流", + "type": "float" + } + ] + } + }, + "三方接口数据": { + "天眼查": { + "type": "fromModel", + "params": [ + "成立年限", + "公司类型", + "近三年股东变更次数", + "最近10条企业舆情负面占比", + "开庭公告(被告-合同纠纷、劳动争议)", + "纳税信用等级", + "双随机抽查结果", + "经营异常", + "欠税公告", + "行政处罚(警告、通报批评、罚款)", + "行政处罚(没收违法所得、没收非法财务...)", + "被执行人", + "失信被执行人", + "税收违法", + "严重违法" + ], + "columns": [ + { + "key": "成立年限", + "name": "成立年限", + "type": "int" + }, + { + "key": "公司类型", + "name": "公司类型", + "type": "enum", + "config": { + "options": [ + ] + } + }, + { + "key": "近三年股东变更次数", + "name": "近三年股东变更次数", + "type": "int" + }, + { + "key": "最近10条企业舆情负面占比", + "name": "最近10条企业舆情负面占比", + "type": "float" + }, + { + "key": "纳税信用等级", + "name": "纳税信用等级", + "type": "enum", + "config": { + "options": [ + "A", + "B", + "M", + "C", + "D" + ] + } + }, + { + "key": "开庭公告(被告-合同纠纷、劳动争议)", + "name": "开庭公告(被告-合同纠纷、劳动争议)", + "type": "int" + }, + { + "key": "双随机抽查结果", + "name": "双随机抽查结果", + "type": "enum", + "config": { + "options": [ + "合格", + "不合格" + ] + } + }, + { + "key": "经营异常", + "name": "经营异常", + "type": "int" + }, + { + "key": "欠税公告", + "name": "欠税公告", + "type": "int" + }, + { + "key": "行政处罚(警告、通报批评、罚款)", + "name": "行政处罚(警告、通报批评、罚款)", + "type": "int" + }, + { + "key": "行政处罚(没收违法所得、没收非法财务...)", + "name": "行政处罚(没收违法所得、没收非法财务...)", + "type": "int" + }, + { + "key": "被执行人", + "name": "被执行人", + "type": "int" + }, + { + "key": "失信被执行人", + "name": "失信被执行人", + "type": "int" + }, + { + "key": "税收违法", + "name": "税收违法", + "type": "int" + }, + { + "key": "严重违法", + "name": "严重违法", + "type": "int" + } + ] + } + }, + "尽调核实数据": { + "定性指标": { + "columns": [ + ] + } + } +} \ No newline at end of file diff --git a/static/model/smebiz/model_params.json b/static/model/smebiz/model_params.json new file mode 100644 index 0000000..49c4006 --- /dev/null +++ b/static/model/smebiz/model_params.json @@ -0,0 +1,72 @@ +{ + "公司战略(绿色、双碳、科教、人才、创新驱动、乡村振兴、新型城镇化、可持续发展、应对人口老龄化、就业优先、国家安全、金融安全)": null, + "成立年限": null, + "近三年股东变更次数": null, + "董事会人数": null, + "独立董事占比": null, + "董事会会议次数": null, + "董事会出席率(平均数)": null, + "监事会人数": null, + "知名商标或品牌数量": null, + "产品系列数量": null, + "产品种类数量": null, + "牵头行业标准和规范制定数量": null, + "参与行业标准和规范制定数量": null, + "研发投入占营业收入的比重": null, + "新产品数量": null, + "风险管理部门员工人数": null, + "风险管理覆盖部门(市场、作业、行政、人力、财务、合规、技术研发、其他)": null, + "营业收入": null, + "总资产": null, + "毛利率": null, + "净资产收益率": null, + "总资产报酬率": null, + "流动比率": null, + "速动比率": null, + "应收账款周转率": null, + "总资产周转率": null, + "资产负债率": null, + "经营性净现金流/流动负债": null, + "劳动仲裁": null, + "开庭公告(案由为劳动争议)": null, + "社会保险": null, + "死亡数量": null, + "工伤数量": null, + "资质证书数量": null, + "历史经营异常": null, + "自身合同违约次数": null, + "开庭公告(案由为合同纠纷)": null, + "双随机抽查结果": null, + "食品安全": null, + "假冒化妆品": null, + "投诉率": null, + "股权质押比例": null, + "自身违约次数": null, + "自身违约金额": null, + "破产重整": null, + "司法拍卖": null, + "担保代偿比例": null, + "数据安全投入占比": null, + "供应商实收资本": null, + "专利信息": null, + "知产出质": null, + "纳税信用等级": null, + "海关信用等级": null, + "税收违法": null, + "欠税公告": null, + "行政许可数量": null, + "行政处罚数量": null, + "非正常户": null, + "经营异常(公示信息隐瞒真实情况/弄虚作假、登记的住所/经营场所无法联系企业、未在规定期限公示年度报告、未按规定公示企业信息、未在登记所从事经营活动、商事主体名称不适宜、其他原因)": null, + "严重违法": null, + "黑名单": null, + "环保处罚": null, + "近三年信用修复次数": null, + "立案信息": null, + "终本案件": null, + "失信被执行人": null, + "被执行人": null, + "限制高消费": null, + "股权冻结": null, + "限制出境": null +} \ No newline at end of file diff --git a/utils/api_data_utils.py b/utils/api_data_utils.py index 9ed2209..42fab8f 100644 --- a/utils/api_data_utils.py +++ b/utils/api_data_utils.py @@ -6,7 +6,6 @@ import json import math from copy import deepcopy from datetime import datetime -from pathlib import Path from typing import Dict, Any, Union, List import requests @@ -42,6 +41,15 @@ error_code_dic = { } api_config = { + "股权变更": { + "type": "list", + "url": "http://open.api.tianyancha.com/services/open/ic/holderChange/2.0" + }, + # 注意参数是name + "新闻舆情": { + "type": "list", + "url": "http://open.api.tianyancha.com/services/open/ps/news/2.0" + }, "司法风险": { "type": "dict", "url": "http://open.api.tianyancha.com/services/open/cb/judicial/2.0" @@ -160,7 +168,7 @@ class TianyanchaApi: def __init__(self, token: str, mongo_connect: MongoConnect = None, - list_max_count=500, + list_max_count=100, mongo_db_name="天眼查", api_config: Dict[str, Dict] = api_config ): @@ -172,11 +180,9 @@ class TianyanchaApi: self.list_max_count = list_max_count def get_data_core(self, full_url, query_info={}): - print(full_url) if self.mongo_connect: item = self.mongo_connect.db[self.mongo_db_name].find_one({"url": full_url}) if item: - print('item', item) print("请求缓存成功") return JsDict(item['data']) headers = {'Authorization': self.token} @@ -198,7 +204,7 @@ class TianyanchaApi: # raise Exception(error_code_dic[data['error_code']]) - def get(self, name, query: dict, query_info: dict = {}): + def get(self, name, query: dict, query_info: dict = {}, page=None): total = 0 url_config = self.config.get(name) if not url_config: @@ -206,7 +212,8 @@ class TianyanchaApi: url = url_config['url'] full_url = make_query_url(url, query) if url_config["type"] == "list": - data, total = self.get_list_core(full_url, {**query, **query_info}, url_config.get('list_max_count')) + data, total = self.get_list_core(full_url, {**query, **query_info}, + page * 20 if page else url_config.get('list_max_count')) else: data = self.get_data_core(full_url, {**query, **query_info}) return data, total