Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
99fa5809
Commit
99fa5809
authored
Oct 09, 2024
by
xiao-hesheng
Browse files
流程五脚本提交
parent
f201bb40
Changes
1
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_a6流程五_中心库入库结算_正结算2_外网配送_数据库验证.air/a_a6流程五_中心库入库结算_正结算2_外网配送_数据库验证.py
View file @
99fa5809
...
@@ -29,7 +29,7 @@ def check_hdi_distr(type=16):
...
@@ -29,7 +29,7 @@ def check_hdi_distr(type=16):
from
common.db.sql.sql_tools_out
import
check_mcms_pur_plan_sql
,
get_id
from
common.db.sql.sql_tools_out
import
check_mcms_pur_plan_sql
,
get_id
branch_id
=
get_branch_id
()
branch_id
=
get_branch_id
()
# 验证配送单主表
# 验证配送单主表
sql
=
"select * from hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
sql
=
"select * from
spd_hdiorder_test2.
hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
)
branch_id
,
type
)
# 获取实际值
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql
)
actual
=
check_mcms_pur_plan_sql
(
sql
)
...
@@ -41,11 +41,11 @@ def check_hdi_distr(type=16):
...
@@ -41,11 +41,11 @@ def check_hdi_distr(type=16):
branch_id
,
type
))
branch_id
,
type
))
# 查询配送单主键
# 查询配送单主键
distr_main_key
=
get_id
(
distr_main_key
=
get_id
(
"select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
"select id from
spd_hdiorder_test2.
hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
branch_id
,
type
))
# 查询配送单order_no
# 查询配送单order_no
distr_order_no
=
get_id
(
distr_order_no
=
get_id
(
"select order_no from hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
"select order_no from
spd_hdiorder_test2.
hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
distr_main_key
,
type
))
distr_main_key
,
type
))
# 从采购订单获取source_id
# 从采购订单获取source_id
source_id
=
get_id
(
source_id
=
get_id
(
...
@@ -59,7 +59,7 @@ def check_hdi_distr(type=16):
...
@@ -59,7 +59,7 @@ def check_hdi_distr(type=16):
print
(
sql
)
print
(
sql
)
buyBillId
=
process_tuple
(
get_dept_buy_id
(
sql
))
buyBillId
=
process_tuple
(
get_dept_buy_id
(
sql
))
bill_relation_json
=
get_id
(
bill_relation_json
=
get_id
(
"select bill_relation_json from hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
"select bill_relation_json from
spd_hdiorder_test2.
hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
distr_main_key
,
type
))
distr_main_key
,
type
))
print
(
bill_relation_json
)
print
(
bill_relation_json
)
purBillDate
=
reGetString
(
bill_relation_json
,
r
'purBillDate":"'
,
r
'""distrBillId'
)
purBillDate
=
reGetString
(
bill_relation_json
,
r
'purBillDate":"'
,
r
'""distrBillId'
)
...
@@ -69,7 +69,7 @@ def check_hdi_distr(type=16):
...
@@ -69,7 +69,7 @@ def check_hdi_distr(type=16):
create_user
=
distrUser
create_user
=
distrUser
create_user_name
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
create_user_name
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
create_time
=
get_create_time
(
create_time
=
get_create_time
(
"select create_time from hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
"select create_time from
spd_hdiorder_test2.
hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
branch_id
,
type
))
last_modified_user
=
distrUser
last_modified_user
=
distrUser
if
type
==
16
:
if
type
==
16
:
...
@@ -259,13 +259,13 @@ def check_hdi_distr(type=16):
...
@@ -259,13 +259,13 @@ def check_hdi_distr(type=16):
def
check_hdi_distr_detail
(
distr_main_key
,
type
,
purchase_id
):
def
check_hdi_distr_detail
(
distr_main_key
,
type
,
purchase_id
):
sql
=
"select * from hdi_distr_detail where pid = '%s';"
%
distr_main_key
sql
=
"select * from
spd_hdiorder_test2.
hdi_distr_detail where pid = '%s';"
%
distr_main_key
# 获取实际值
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql
)
actual
=
check_mcms_pur_plan_sql
(
sql
)
print
(
'actual'
,
actual
)
print
(
'actual'
,
actual
)
# 获取子表主键
# 获取子表主键
distr_detail_main_key
=
get_id
(
distr_detail_main_key
=
get_id
(
"select id from hdi_distr_detail where pid = '%s';"
%
(
"select id from
spd_hdiorder_test2.
hdi_distr_detail where pid = '%s';"
%
(
distr_main_key
))
distr_main_key
))
source_id
=
purchase_id
source_id
=
purchase_id
source_detail_id
=
get_id
(
"select id from mcms_purchase_detail where pid='%s'"
%
purchase_id
)
source_detail_id
=
get_id
(
"select id from mcms_purchase_detail where pid='%s'"
%
purchase_id
)
...
@@ -283,10 +283,10 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
...
@@ -283,10 +283,10 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
goods_gg
=
get_goods_gg
(
hos_goods_id
)
goods_gg
=
get_goods_gg
(
hos_goods_id
)
mfrs_id
=
get_goods_mfrs_id
(
hos_goods_id
)
mfrs_id
=
get_goods_mfrs_id
(
hos_goods_id
)
expdt_date
=
get_expdt_date
(
expdt_date
=
get_expdt_date
(
"select expdt_date from hdi_distr_detail where pid = '%s';"
%
(
"select expdt_date from
spd_hdiorder_test2.
hdi_distr_detail where pid = '%s';"
%
(
distr_main_key
))
distr_main_key
))
product_date
=
get_expdt_date
(
product_date
=
get_expdt_date
(
"select product_date from hdi_distr_detail where pid = '%s';"
%
(
"select product_date from
spd_hdiorder_test2.
hdi_distr_detail where pid = '%s';"
%
(
distr_main_key
))
distr_main_key
))
pkg_def_id
=
process_tuple
(
pkg_def_id
=
process_tuple
(
get_id
(
"select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;"
%
hos_goods_id
))
get_id
(
"select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;"
%
hos_goods_id
))
...
@@ -320,10 +320,10 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
...
@@ -320,10 +320,10 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
erpCode
=
mdm_goods_code
# 11661563
erpCode
=
mdm_goods_code
# 11661563
create_user
=
get_login_user_uxid2
()
create_user
=
get_login_user_uxid2
()
create_time
=
get_create_time
(
create_time
=
get_create_time
(
"select create_time from hdi_distr_detail where id = '%s';"
%
(
"select create_time from
spd_hdiorder_test2.
hdi_distr_detail where id = '%s';"
%
(
distr_detail_main_key
))
distr_detail_main_key
))
last_modified
=
get_create_time
(
last_modified
=
get_create_time
(
"select last_modified from hdi_distr_detail where id = '%s';"
%
(
"select last_modified from
spd_hdiorder_test2.
hdi_distr_detail where id = '%s';"
%
(
distr_detail_main_key
))
distr_detail_main_key
))
last_modified_user
=
create_user
last_modified_user
=
create_user
if
type
==
16
:
if
type
==
16
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment