fix(pl): 修复客户品类证件额度选证与回显问题。
优先消耗有到期日的证件,补齐品类产品选择与运输证适用品类回显,避免新规则安排与建档展示失败。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b0c1bca683
commit
e8cda33a3c
10 files changed
+330
-44
No files matched your search
@@ -2,9 +2,8 @@
|
||||
"""为客户+品类证件额度联调造数(测试库)。
|
||||
|
||||
造:客户、报价(accepted)、合同(executing)+ 合同产品、
|
||||
2 张购买证(10吨早到期 / 100吨晚到期)、2 张运输证(引用对应购买证)、期初 opening。
|
||||
|
||||
不造:品类↔系统产品关联(由用户在界面配置)。
|
||||
2 张购买证(10吨早到期 / 100吨晚到期)、2 张运输证(引用对应购买证)、期初 opening、
|
||||
品类↔种子产品关联(否则新规则选证会因「产品未配置证用品类」失败)。
|
||||
|
||||
用法:
|
||||
cd backend && source venv/bin/activate
|
||||
@@ -118,6 +117,7 @@ def main() -> int:
|
||||
print(f'category_id={category_id}')
|
||||
print(f'vehicle={VEHICLE}')
|
||||
print(f'purchase early 10 / late 100 ; transport pair each')
|
||||
ids['category_product'] = uid('cat-prod')
|
||||
|
||||
# cleanup previous seed with same ids
|
||||
cleanup_tables = [
|
||||
@@ -125,6 +125,7 @@ def main() -> int:
|
||||
('pl_transport_cert_purchase_ref', 'id', [ids['ref_early'], ids['ref_late']]),
|
||||
('pl_transport_cert', 'id', [ids['transport_early'], ids['transport_late']]),
|
||||
('pl_purchase_cert', 'id', [ids['purchase_early'], ids['purchase_late']]),
|
||||
('pl_cert_category_product', 'id', [ids['category_product']]),
|
||||
('crm_contract_product', 'id', [ids['contract_product']]),
|
||||
('crm_contract', 'id', [ids['contract']]),
|
||||
('crm_quote_product', 'id', [ids['quote_product']]),
|
||||
@@ -204,6 +205,18 @@ def main() -> int:
|
||||
)
|
||||
print('+ contract', contract_no, 'product_row', ids['contract_product'])
|
||||
|
||||
# 品类 ↔ 种子产品(选证按产品反查品类;缺关联则安排必败)
|
||||
cur.execute(
|
||||
"""
|
||||
INSERT INTO pl_cert_category_product
|
||||
(id, category_id, product_id, scope_status,
|
||||
tenant_no, create_dept_id, create_by, create_time, update_time, del_flag)
|
||||
VALUES (%s,%s,%s,'active',%s,'',%s,%s,%s,0)
|
||||
""",
|
||||
(ids['category_product'], category_id, PRODUCT_ID, TENANT, OWNER_USER_ID, now, now),
|
||||
)
|
||||
print('+ category_product', PRODUCT_ID, '->', category_id)
|
||||
|
||||
def insert_purchase(pid, cert_no, total, valid_to, face='98% 工业硫酸'):
|
||||
cur.execute(
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user