Commit bab0f438 by 岳巧源

modify json

parent de9657e4
Showing with 10 additions and 7 deletions
......@@ -31,7 +31,7 @@ def liexin():
database="liexin"
)
cursor = db.cursor()
cursor.execute("select tax_title, business_license, tax_id, user_sn, company_address, consignee_province, consignee_city, consignee_district, consignee_address from lie_taxinfo")
cursor.execute("select tax_title, business_license, tax_id, user_sn, company_address, consignee_province, consignee_city, consignee_district, consignee_address, uc_id from lie_taxinfo")
result = cursor.fetchall()
for row in result:
tax_title = row[0]
......@@ -43,6 +43,7 @@ def liexin():
consignee_city = row[6]
consignee_district = row[7]
consignee_address = row[8]
uc_id = row[9]
detail_address = ""
sql = "select region_name from lie_region where region_id in " + "(" + str(consignee_province) + "," + str(consignee_city) + "," + str(consignee_district) + ") " + "order by field (" + "region_id" + "," + str(consignee_province) + "," + str(consignee_city) + "," + str(consignee_district) + ")"
cursor.execute(sql)
......@@ -52,7 +53,7 @@ def liexin():
continue
detail_address += address_result[i][0]
detail_address += consignee_address
json_map = {
"company_name_cn": tax_title, # tax_title
"business_license": business_license, # business_license
......@@ -63,19 +64,19 @@ def liexin():
{
"source_id": "tax_id_" + str(tax_id),
"source_code": user_sn,
"address_type": "", # ????? 直接写“发票地址”这几个汉字么?
"address_type": "发票地址",
"address": company_address
},
{
"source_id": "consignee_address_" + str(tax_id),
"source_code": user_sn,
"address_type": "", # ????? 直接写“收票地址”这几个汉字么?
"address_type": "收票地址",
"address": detail_address
},
{
"source_id": "user_address_" + str(tax_id),
"source_code": user_sn,
"address_type": "", # ????? 直接写“客户地址”这几个汉字么?
"address_type": "客户地址",
"address": ""
}
]
......@@ -115,12 +116,14 @@ def crm():
"address_data": [
{
"source_id": "company_" + str(id), # id
"source_code": "", # ???? 为空
"address_type": "", # 这个不确定
"source_code": "",
"address_type": "公司地址",
"address": com_addr # com_addr
}
]
}
if com_addr == "":
json_map["address_data"] = []
post_data_to_update_address(json_map)
print("-------------------------crm已更新!--------------------------------")
cursor.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment