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.
33 lines
1.6 KiB
33 lines
1.6 KiB
|
15 hours ago
|
# -*- coding: utf-8 -*-
|
||
|
|
"""F-14 三跑 UPDATE_ONLY 任务构成:u=2 的两行是谁 / unchanged / fail 7 行构成 / transfer3 星级"""
|
||
|
|
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 = 751737854471700480
|
||
|
|
print('== UPDATE_ONLY 任务完整计数 ==')
|
||
|
|
cur.execute("SELECT id,status,total_count,insert_count,update_count,fail_count,suspect_count,"
|
||
|
|
"unchanged_count FROM customer_import_task WHERE id=%s", (TASK,))
|
||
|
|
for x in cur.fetchall():
|
||
|
|
print(json.dumps({k: str(v) for k, v in x.items()}, ensure_ascii=False))
|
||
|
|
|
||
|
|
print('== fail 明细(sheet/row/identity)==')
|
||
|
|
cur.execute("SELECT sheet_name,row_num,customer_identity,LEFT(fail_reason,40) 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)[:200])
|
||
|
|
|
||
|
|
print('== transfer2 / transfer3 现星级(cleanup 后应还原)==')
|
||
|
|
cur.execute("SELECT id,customer_no,customer_name,customer_star_level s FROM customer "
|
||
|
|
"WHERE id IN (SELECT customer_id FROM customer_oplog WHERE 1=0) OR "
|
||
|
|
"customer_no IN ('KH202609030018','KH202609030019')")
|
||
|
|
for x in cur.fetchall():
|
||
|
|
print(json.dumps({k: str(v) for k, v in x.items()}, ensure_ascii=False))
|
||
|
|
conn.close()
|
||
|
|
print('DONE')
|