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.
34 lines
1.6 KiB
34 lines
1.6 KiB
# -*- coding: utf-8 -*-
|
|
"""票 05:seed-manifest 期望状态清单 + 复活剩余 seed 商机。"""
|
|
import io, sys, json
|
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
import pymysql
|
|
|
|
mf = json.load(open(r'e:\code\crm-backend-matt\.scratch\opportunity-e2e\seed-manifest.json', encoding='utf-8'))
|
|
print('== manifest 期望 ==')
|
|
for o in mf['opportunities']:
|
|
print(f"{o.get('name')} status={o.get('oppStatus')} id={o.get('id')}")
|
|
|
|
conn = pymysql.connect(host='8.129.84.155', port=3306, user='root', password='Itc@123456',
|
|
database='crm', charset='utf8mb4', autocommit=True)
|
|
cur = conn.cursor()
|
|
# 复活剩余软删 seed(AC/BC 保持关闭态 4、BP 保持暂缓态 3——名字即语义;BPL 公海待领取=1)
|
|
fix = [
|
|
('748556130615033856', 4), # e2e-A-关闭-老机房UPS替换
|
|
('748556134234718208', 3), # e2e-B-暂缓-剧场改造
|
|
('748556135216185344', 1), # e2e-B-公海-法院信息化(F14 claim-batch 需要 1)
|
|
('748556136101183488', 4), # e2e-B-关闭-厂房广播改造
|
|
]
|
|
print('== 复活 ==')
|
|
for oid, st in fix:
|
|
cur.execute('UPDATE opportunity SET deleted=0, opp_status=%s WHERE id=%s', (st, oid))
|
|
print(f'revived id={oid} -> status={st} (affected={cur.rowcount})')
|
|
# C1(高校实验室建设)曾被 E6 关到 4,F14 的 C1 用于 pause(2→3),复位 2
|
|
cur.execute("UPDATE opportunity SET opp_status=2 WHERE id='748556137065873408'")
|
|
print('C1 -> 2')
|
|
cur.execute("SELECT id, opp_name, opp_status, deleted FROM opportunity WHERE opp_name LIKE 'e2e-%' "
|
|
"ORDER BY create_time")
|
|
print('== 终态 ==')
|
|
for r in cur.fetchall():
|
|
print(r)
|
|
conn.close()
|
|
|