diff --git a/CompanyData/CompanyDataImpl.py b/CompanyData/CompanyDataImpl.py index df7d7eb..7e37db4 100644 --- a/CompanyData/CompanyDataImpl.py +++ b/CompanyData/CompanyDataImpl.py @@ -1,9 +1,9 @@ import json import requests -from CompanyData.CompanyDataObj import CompanyData, BasicInfo, ShareHolder from DBHelper.MongoHelper import MongoHelper from Utils.ErrorUtil import LogConditionCheckFailed +from CompanyData.CompanyDataObj import CompanyData, BasicInfo, ShareHolder class CompanyDataImpl(CompanyData): @@ -91,8 +91,15 @@ class CompanyDataImpl(CompanyData): self.share_holder.append(share_holder) + self.db_tfse.upsert_single_data( + "企业数据", + "企业数据_更新汇总", + {"企业ID": self.cid}, + self.dict_to_save() + ) + def __main__(): - # prepare_business_data() + prepare_business_data() prepare_share_holders() __main__() diff --git a/CompanyData/CompanyDataObj.py b/CompanyData/CompanyDataObj.py index c0d3d85..1c719c0 100644 --- a/CompanyData/CompanyDataObj.py +++ b/CompanyData/CompanyDataObj.py @@ -5,19 +5,19 @@ from Utils.ValidateUtil import ValidateAttr class BasicInfo(SpecObject): """基本工商信息""" - status = ValidateAttr(field="status", type=str) - legal_person = ValidateAttr(field="legal_person", type=str) - company_type = ValidateAttr(field="company_type", type=str) - taxpayer_id = ValidateAttr(field="taxpayer_id", type=str) - business_scope = ValidateAttr(field="business_scope", type=str) - registered_capital = ValidateAttr(field="registered_capital", type=str) - paid_capital = ValidateAttr(field="paid_capital", type=str) - registered_address = ValidateAttr(field="registered_address", type=str) - registration_authority = ValidateAttr(field="registration_authority", type=str) - industry = ValidateAttr(field="industry", type=str) - staff_size = ValidateAttr(field="staff_size", type=str) - people_insured_num = ValidateAttr(field="people_insured_num", type=int) - micro_company = ValidateAttr(field="micro_company", type=str) + status = ValidateAttr(field="status", type=str, default=None) + legal_person = ValidateAttr(field="legal_person", type=str, default=None) + company_type = ValidateAttr(field="company_type", type=str, default=None) + taxpayer_id = ValidateAttr(field="taxpayer_id", type=str, default=None) + business_scope = ValidateAttr(field="business_scope", type=str, default=None) + registered_capital = ValidateAttr(field="registered_capital", type=str, default=None) + paid_capital = ValidateAttr(field="paid_capital", type=str, default=None) + registered_address = ValidateAttr(field="registered_address", type=str, default=None) + registration_authority = ValidateAttr(field="registration_authority", type=str, default=None) + industry = ValidateAttr(field="industry", type=str, default=None) + staff_size = ValidateAttr(field="staff_size", type=str, default=None) + people_insured_num = ValidateAttr(field="people_insured_num", type=int, default=None) + micro_company = ValidateAttr(field="micro_company", type=str, default=None) fields_map = { "status": "企业状态", @@ -40,7 +40,7 @@ class ShareHolder(SpecObject): """股东信息""" name = ValidateAttr(field='name', type=str) - share_holder_type = ValidateAttr(field='share_holder_type', type=str) + share_holder_type = ValidateAttr(field='share_holder_type', type=str, default=None) share_holding_ratio = ValidateAttr(field="share_holding_ratio", type=str, default=None) subscription_amount = ValidateAttr(field="subscription_amount", type=str, default=None) subscription_date = ValidateAttr(field="subscription_date", type=str, default=None) @@ -64,7 +64,7 @@ class MainMembers(SpecObject): """主要成员""" name = ValidateAttr(field="name", type=str) - job_title = ValidateAttr(field="job_title", type=list) + job_title = ValidateAttr(field="job_title", type=list, default=None) fields_map = { "name": "姓名",