Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
ypt_mgw_local
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
苏星豪
ypt_mgw_local
Commits
fb70619c
提交
fb70619c
authored
10月 09, 2024
作者:
张颂恩
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
消费者扫码自动出库逻辑优化
上级
6ae71216
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
26 行增加
和
9 行删除
+26
-9
views.py
wx/views.py
+26
-9
没有找到文件。
wx/views.py
浏览文件 @
fb70619c
...
@@ -5691,20 +5691,35 @@ def wx_label_scan_record(request):
...
@@ -5691,20 +5691,35 @@ def wx_label_scan_record(request):
# http://localhost:8000/wx/label/scan_record/?uid=%22gAAAAABm69JXNwYZh4LL__7YjX-SG3xkbrJnMUycv-75qfkzQNN6NkfEKmR741XVASxtVAeCXptkOF4Fc12fz48Z0uMhZynaeQ%3D%3D%22&compid=199264&fwcode=129701910053&lat=20.0076&lng=110.29357
# http://localhost:8000/wx/label/scan_record/?uid=%22gAAAAABm69JXNwYZh4LL__7YjX-SG3xkbrJnMUycv-75qfkzQNN6NkfEKmR741XVASxtVAeCXptkOF4Fc12fz48Z0uMhZynaeQ%3D%3D%22&compid=199264&fwcode=129701910053&lat=20.0076&lng=110.29357
s_len
=
len
(
d
[
'stock_dev'
])
s_len
=
len
(
d
[
'stock_dev'
])
if
s_len
and
product_id
and
data
[
'label_pkg'
]
==
1
and
compid
==
'199264'
:
if
s_len
and
product_id
and
data
[
'label_pkg'
]
==
1
and
compid
==
'199264'
:
last_row
=
d
[
'stock_dev'
][
s_len
-
1
]
is_rk
=
False
print
(
last_row
)
is_ck
=
False
if
last_row
[
'voucher_type'
]
==
'成品入库'
:
rk_row
=
None
lbcode
=
fwcode
if
fwcode
.
startswith
(
'9'
):
cur
.
execute
(
f
"select code_a from label.lbl_abcode where code_b = '{fwcode}' "
)
r
=
cur
.
fetchone
()
if
r
and
r
[
0
]:
lbcode
=
r
[
0
]
for
stk
in
d
[
'stock_dev'
]:
if
stk
[
'voucher_type'
]
==
'成品入库'
and
(
stk
[
'label_code'
]
==
lbcode
or
stk
[
'label_code'
]
==
fwcode
or
stk
[
'package'
]
==
'箱标'
):
is_rk
=
True
rk_row
=
stk
if
stk
[
'voucher_type'
]
==
'销售出库'
and
stk
[
'label_code'
]
==
lbcode
:
is_ck
=
True
if
is_rk
and
not
is_ck
:
code
=
'ZDCK-'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y
%
m
%
d
%
H
%
M
%
S
%
f'
)[:
-
3
]
code
=
'ZDCK-'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y
%
m
%
d
%
H
%
M
%
S
%
f'
)[:
-
3
]
# 节流
# 节流
if
rd_wx
.
set
(
'ZDCK-'
+
fw
code
,
code
,
px
=
5000
,
nx
=
True
):
if
rd_wx
.
set
(
'ZDCK-'
+
lb
code
,
code
,
px
=
5000
,
nx
=
True
):
t
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
t
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
m2
=
hashlib
.
md5
((
sK
+
t
)
.
encode
(
'utf8'
))
m2
=
hashlib
.
md5
((
sK
+
t
)
.
encode
(
'utf8'
))
codes
=
[
fw
code
]
codes
=
[
lb
code
]
d
ata
=
{
postD
ata
=
{
"bill_number"
:
code
,
"bill_number"
:
code
,
"company_id"
:
last
_row
[
'company_id'
],
"company_id"
:
rk
_row
[
'company_id'
],
"to_company_id"
:
11013
,
"to_company_id"
:
11013
,
"user_id"
:
last
_row
[
'user_id'
],
"user_id"
:
rk
_row
[
'user_id'
],
"product_id"
:
product_id
,
"product_id"
:
product_id
,
"voucher_id"
:
2
,
"voucher_id"
:
2
,
"voucher_time"
:
t
,
"voucher_time"
:
t
,
...
@@ -5713,7 +5728,7 @@ def wx_label_scan_record(request):
...
@@ -5713,7 +5728,7 @@ def wx_label_scan_record(request):
"key"
:
m2
.
hexdigest
(),
"key"
:
m2
.
hexdigest
(),
}
}
request
.
method
=
'POST'
request
.
method
=
'POST'
request
.
_body
=
json
.
dumps
(
d
ata
)
request
.
_body
=
json
.
dumps
(
postD
ata
)
request
.
META
[
'CONTENT_TYPE'
]
=
'application/json'
request
.
META
[
'CONTENT_TYPE'
]
=
'application/json'
r
=
fg_update
(
request
)
r
=
fg_update
(
request
)
...
@@ -12196,6 +12211,8 @@ def channelredeem_online(request):
...
@@ -12196,6 +12211,8 @@ def channelredeem_online(request):
cid
=
str
(
u
.
company_id
)
cid
=
str
(
u
.
company_id
)
if
not
rd_wx
.
set
(
cid
+
':'
+
user_id
,
user_id
,
px
=
5000
,
nx
=
True
):
if
not
rd_wx
.
set
(
cid
+
':'
+
user_id
,
user_id
,
px
=
5000
,
nx
=
True
):
return
JsonResponse
({
'e'
:
'网络繁忙,请稍后再试'
})
return
JsonResponse
({
'e'
:
'网络繁忙,请稍后再试'
})
if
u
.
ancestor_id
==
238273
:
return
JsonResponse
({
'e'
:
'提现功能不可用'
})
if
method
==
'wx'
:
if
method
==
'wx'
:
if
not
wx_openid
or
not
user_id
or
not
amount
:
if
not
wx_openid
or
not
user_id
or
not
amount
:
data
[
'e'
]
=
'wxopenid,user id,amount required'
data
[
'e'
]
=
'wxopenid,user id,amount required'
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论