예제 #1
0
 def __copy_props__(src: dict, target: Company):
     target.id = src.get('id', '-')
     target.name = src.get('name',
                           '-').replace('<em>',
                                        '').replace('</em>', '')
     target.representative = src.get('legalPersonName', '-')
     target.address = src.get('regLocation', '-')
     target.region = src.get('base', '-')
     target.city = src.get('city', '-')
     target.district = src.get('district', '-')
     target.biz_status = src.get('regStatus', '-')
     target.credit_code = src.get('creditCode', '-')
     target.email = src.get('emails',
                            ['-']).split(';')[0].replace('\t', '')
     target.phone = src.get('phoneNum', '-')
     target.biz_scope = src.get('businessScope', '-')
     target.company_type = src.get('companyOrgType',
                                   '-').replace('\t', '')
     target.taxpayer_code = src.get('creditCode', '-')
     target.registered_capital = src.get('regCapital', '-')
     target.lat_long = str({
         'lat': src.get('latitude', '-'),
         'long': src.get('longitude', '-')
     })
     target.setup_time = src.get('estiblishTime', '-')[0:10]
예제 #2
0
 def __basic_info__(src: dict, target: Company):
     # 公司外部系统ID
     target.id = src.get('id', '-')
     # 公司名称
     target.name = src.get('name',
                           '-').replace('<em>',
                                        '').replace('</em>', '')
     # 公司简称
     target.short_name = src.get('alias', '-')
     # 公司法人
     target.representative = src.get('legalPersonName', '-')
     # 公司成立时间
     target.found_time = src.get('estiblishTime', '-')[0:10]
     # 公司地址
     target.company_address = src.get('regLocation', '-')
     # 公司注册地址
     target.register_address = src.get('regLocation', '-')
     # 公司所在省份,例:浙江,北京,广东
     target.province = src.get('base', '-')
     # 公司所在市
     target.city = src.get('city', '-')
     # 公司所在区
     target.district = src.get('district', '-')
     # 公司经营状态
     target.biz_status = src.get('regStatus', '-')
     # 公司地址经纬度坐标
     target.geoloc = str({
         'latitude': src.get('latitude', '-'),
         'longitude': src.get('longitude', '-')
     })
     # 公司邮箱列表
     target.emails = src.get('emails',
                             ['-']).split(';')[0].replace('\t', '')
     # 公司联系方式列表
     target.phones = src.get('phoneList', [])
     # 公司联系方式
     target.contact = src.get('phoneNum', '-')
     # 公司经营范围
     target.biz_scope = src.get('businessScope', '-')
     # 公司类型
     target.company_type = src.get('companyOrgType',
                                   '-').replace('\t', '')
     # 公司质量分数
     target.score = src.get('orginalScore', 0)
     # 公司注册资本
     target.register_capital = src.get('regCapital', '-')
     # 公司统一社会信用代码
     target.credit_code = src.get('creditCode', '-')
     # 公司纳税号
     target.taxpayer_code = src.get('taxCode')
     if not target.taxpayer_code:
         target.taxpayer_code = target.credit_code
     # 公司注册号
     target.register_code = src.get('regNumber', '-')
     # 公司组织机构代码
     target.organization_code = src.get('orgNumber', '-')
     # 公司标签列表
     target.tags = src.get('labelListV2', [])
     # 公司行业分类
     target.industry = src.get('categoryStr', '-')
예제 #3
0
 def assembly(cls, company: Company, raw_company: dict):
     company.name = raw_company.get('Name', '-')
     company.representative = raw_company.get('OperName', '-')
     company.address = raw_company.get('Address', '-')
     company.region = raw_company.get('AreaCode', '-')  # todo
     company.city = raw_company.get('AreaCode', '-')  # todo
     company.district = raw_company.get('AreaCode', '-')  # todo
     company.biz_status = raw_company.get('Status', '-')
     company.credit_code = raw_company.get('CreditCode', '-')
     company.email = raw_company.get('Email', '-')
     company.phone = raw_company.get('ContactNumber', '-')
     company.biz_scope = raw_company.get('Scope', '-')
     company.company_type = raw_company.get('EconKind', '-')
     company.taxpayer_code = raw_company.get('CreditCode', '-')
     company.registered_capital = raw_company.get('RegistCapi', '-')
     company.lat_long = str({
         'lat': raw_company.get('X', '-'),
         'long': raw_company.get('Y', '-')
     })
     company.setup_time = raw_company.get('StartDate', '-')