提交 d3720320 authored 作者: 韩忠玉's avatar 韩忠玉

interface for jg_sfa project

上级 61acf9c9
......@@ -40,6 +40,9 @@ from taskman import tasks
from inventory.models import Batch as StkBatch
# 2022-11-21 可变列表、字典要深拷贝
import copy
#2020-10-27 11位解密
......@@ -2493,7 +2496,7 @@ def query_label(request,company_id,vendor):
'kingdee': 'nc$tYal1C%)T0@)d1Wn' #金蝶
},
'1': { #酒鬼
'hand': 'hand$tYal1i%)20@)c1W', #汉得
'hand': 'hand$tYal1i%)20@)c1W', #汉得
'sfa': 'sfa$3rHl1K%(2t@1117' #SAF项目组
},
}
......@@ -2590,10 +2593,7 @@ def query_label(request,company_id,vendor):
else:
if company_id=='1' and vendor=='sfa':
# 2022-11-17 酒鬼酒中粮SFA项目组
data['result']['logistics_code'] = q.infor['wl']
data['result']['carton_code'] = q.infor['label_pk_code']
data['result']['product'] = {'external_code':p['external_code'], 'name':p['name']}
# 2022-11-17 酒鬼酒中粮SFA项目组
# 取经销商信息
s="select external_code,name from "+\
"(select company_to_id from stkdetails.c1 where label_pk_id="+pk+" and vtype_id=2 and is_delete=false order by id desc limit 1) s "+\
......@@ -2608,7 +2608,38 @@ def query_label(request,company_id,vendor):
else:
code=''
name=''
data['result']['customer']={'external_code':code,'name':name}
rls=q.get_relations()
# 主箱标
ck=q.infor['label_pk_code']
# 副箱标
atts=[]
for c in rls['cartons']:
if c['label']!=ck:
atts.append(c['label'])
if atts:
att=atts[0]
else:
att=''
d={
"prodCode": p['external_code'],
"prodName": p['name'],
"acctCode": code,
"acctName": name,
"cartonCode":ck ,
"cartonOtherCode": att,
}
if q.package['id']==1:
# 瓶标
d["logisticsCode"]=q.infor['wl']
data["result"]=d
else:
# 箱标
ds=[]
for c in rls['children']:
dd=copy.deepcopy(d)
dd["logisticsCode"]=c['label']
ds.append(dd)
data["result"]=ds
else:
#给第三方数据,删除产品ID,vendor,inboud_lot,inbound_aging,inbound_date
product_lot=''
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论