baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)
This commit is contained in:
commit
c2b0e7be0d
6522 files changed
+3530643
No files matched your search
Executable
+26
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import pandas as pd
|
||||
|
||||
db = pd.read_csv('db_bom2.csv', dtype=str)
|
||||
db['code'] = db['ChildMaterialId'].astype(str).str.strip()
|
||||
db['parent'] = db['ParentMaterialId'].astype(str).str.strip()
|
||||
|
||||
out = []
|
||||
# 数据库中 9000013420-A01 的4个子件
|
||||
kids = db[db['parent'] == '9000013420-A01']
|
||||
out.append(f"数据库 9000013420-A01 子件数: {len(kids)}")
|
||||
for _, r in kids.iterrows():
|
||||
out.append(f" {r['code']} {r['MaterialName']} Level={r['Level']}")
|
||||
|
||||
# 这4个子件在数据库其他地方是否也出现(比如 1.11.2 直接子件)
|
||||
for c in kids['code']:
|
||||
hits = db[(db['code'] == c) & (db['parent'] != '9000013420-A01')]
|
||||
if len(hits) > 0:
|
||||
for _, h in hits.iterrows():
|
||||
out.append(f" {c} 也出现在 父级={h['parent']} (Level={h['Level']})")
|
||||
else:
|
||||
out.append(f" {c} 仅出现在 9000013420-A01 下")
|
||||
|
||||
with open('cmp_3420.txt', 'w', encoding='utf-8') as f:
|
||||
f.write('\n'.join(out))
|
||||
print("done")
|
||||
Reference in new issue
Block a user