You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.6 KiB

15 hours ago
# -*- coding: utf-8 -*-
"""F-14 二跑深挖:fail 8 行明细 + customer 最近落库行(r1 到底落成什么)"""
import sys, io, json
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
import pymysql
conn = pymysql.connect(host='8.129.84.155', user='root', password='Itc@123456',
database='crm', charset='utf8mb4', autocommit=True,
cursorclass=pymysql.cursors.DictCursor)
cur = conn.cursor()
TASK = 751734253355532288
print('== 主任务 fail 全 8 行 ==')
cur.execute("SELECT sheet_name,row_num,customer_identity,LEFT(fail_reason,70) fr "
"FROM customer_import_fail WHERE task_id=%s ORDER BY sheet_name DESC,row_num", (TASK,))
for x in cur.fetchall():
print(json.dumps({k: str(v) for k, v in x.items()}, ensure_ascii=False)[:220])
print()
print('== customer 最近 6 行(任何来源)==')
cur.execute("SELECT id,customer_no,customer_name,customer_star_level s,relation_star_level r,"
"is_biz_negotiated b,create_time FROM customer ORDER BY id DESC LIMIT 6")
for x in cur.fetchall():
print(json.dumps({k: str(v) for k, v in x.items()}, ensure_ascii=False)[:220])
print()
print('== 本轮 new_name 对应行(PFX导入-新增-{TS},TS=092x)==')
cur.execute("SELECT id,customer_no,customer_name,customer_star_level s,relation_star_level r,"
"is_biz_negotiated b FROM customer WHERE customer_name LIKE '%导入-新增-092%' "
"OR customer_name LIKE '%导入-新增-091%' ORDER BY id DESC LIMIT 4")
for x in cur.fetchall():
print(json.dumps({k: str(v) for k, v in x.items()}, ensure_ascii=False)[:220])
conn.close()
print('DONE')