提交 ec5a5b3f authored 作者: Chris Harris's avatar Chris Harris

update: 酒鬼sfa接口返回替换后码值,修复utils.views下语法错误

上级 30003839
......@@ -3906,7 +3906,18 @@ def query_label(request,company_id,vendor):
if q.package['id'] in [1,100]:
# 瓶标
d["logisticsCode"]=q.infor['wl']
data["result"]=d
# 2025-04-27 如果有替换显示为替换后的码值
cur.execute(f"SELECT code0, code FROM label.lbl_replace_details WHERE code0 IN ('{d.get('cartonCode')}', '{d.get('cartonOtherCode')}', '{d.get('C005')}', '{d.get('logisticsCode')}');")
replacement = {i[0]: i[1] for i in cur.fetchall()}
d['cartonCode'] = replacement.get(d.get('cartonCode'))\
if replacement.get(d.get('cartonCode')) else d['cartonCode']
d['cartonOtherCode'] = replacement.get(d.get('cartonOtherCode'))\
if replacement.get(d.get('cartonOtherCode')) else d['cartonOtherCode']
d['C005'] = replacement.get(d.get('C005')) \
if replacement.get(d.get('C005')) else d['C005']
d['logisticsCode'] = replacement.get(d.get('logisticsCode')) \
if replacement.get(d.get('logisticsCode')) else d['logisticsCode']
data["result"] = d
else:
# 箱标
ds=[]
......
......@@ -1994,7 +1994,7 @@ def BatchAction(batch,action,user_id):
tm=batch.tm_confirm.strftime('%Y-%m-%d %H:%M:%S')
elif action=='concelconfirm':
# 单据确认
batch.tm_confirm=None()
batch.tm_confirm=None
batch.save()
tm=''
elif action=='cancelpostion':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论