| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- import json
- import Utils
- from Config import mysql_pool, conn, headers, page, size
- start_time = Utils.data_time()
- print("开始时间(精确到毫秒)[证券公司私募投资基金]:", start_time)
- # 因为这里数据一条人员信息amac_member_user中包含了对应的多个证书,所以需要先循环把证书拿出来
- def savetodb(data):
- # 判断是否为空,为空则跳过直接返回
- if data is None: return
- person_record = []
- for item in data:
- # 构建人员信息记录
- this_data = {
- 'id': item.get("id"),
- 'product_id': item.get("productId"),
- 'product_name': item.get("productName"),
- 'product_code': item.get("productCode"),
- 'user_tenant_id': item.get("userTenantId"),
- 'mgr_name': item.get("mgrName"),
- 'found_date': item.get("foundDate"),
- 'registered_date': item.get("registeredDate"),
- 'cast_product': item.get("castProduct"),
- 'fund_type': item.get("fundType"),
- 'org_form': item.get("orgForm"),
- 'fund_status': item.get("fundStatus"),
- 'tuo_guan': item.get("tuoGuan"),
- 'trustee': item.get("trustee"),
- 'delmark': item.get("delmark")
- }
- person_record.append(this_data)
- # 批量插入
- mysql_pool.insert('amac_securities_private_investment_funds', person_record)
- this_page = page
- this_size = size
- payload = json.dumps({})
- # 证券公司私募投资基金
- http_url = "/amac-infodisc/api/pof/subfund"
- Utils.get_page_result(http_url, this_page, this_size, payload, headers, conn, savetodb, __file__)
- print(f"结束时间(精确到毫秒): {Utils.data_time()} - {start_time}")
|