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
d5a42857
Commit
d5a42857
authored
Jul 22, 2024
by
肖 和生
Browse files
Merge remote-tracking branch 'remotes/origin/master' into core_flow
parents
1fb5c382
a4412127
Changes
5
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_b4流程十一请领业务流_二级库向直送_数据库验证.air/a_b4流程十一请领业务流_二级库向直送_数据库验证.py
View file @
d5a42857
...
@@ -10,7 +10,7 @@ from common.db.sql.sql_tools import get_create_time, check_mcms_dept_buy_car_sql
...
@@ -10,7 +10,7 @@ from common.db.sql.sql_tools import get_create_time, check_mcms_dept_buy_car_sql
get_expdt_date1
,
process_date
,
get_mdm_goods_code1
,
get_goods_code1
,
get_goods_name
,
get_goods_gg
,
\
get_expdt_date1
,
process_date
,
get_mdm_goods_code1
,
get_goods_code1
,
get_goods_name
,
get_goods_gg
,
\
get_goods_mfrs_id
,
get_supply_id
,
check_mcms_pur_sql
,
check_source_id
,
get_pkg_def_id
,
get_buyBillId
,
\
get_goods_mfrs_id
,
get_supply_id
,
check_mcms_pur_sql
,
check_source_id
,
get_pkg_def_id
,
get_buyBillId
,
\
get_planBillId
,
get_planOrderNo
,
get_buyOrderNo
,
get_purOrderNo
,
get_purBillId
,
get_purBillDate
,
get_distrBillId
,
\
get_planBillId
,
get_planOrderNo
,
get_buyOrderNo
,
get_purOrderNo
,
get_purBillId
,
get_purBillDate
,
get_distrBillId
,
\
get_distrOrderNo
get_distrOrderNo
,
get_distr_detail_id
from
common.db.sql.sql_tools_out
import
check_out_check_mcms_purchase
from
common.db.sql.sql_tools_out
import
check_out_check_mcms_purchase
from
common.fileUtls
import
FileUtils
from
common.fileUtls
import
FileUtils
...
@@ -1358,7 +1358,9 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
...
@@ -1358,7 +1358,9 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
create_time
=
get_create_time
(
create_time
=
get_create_time
(
"select create_time from hdi_distr_detail where id = '%s';"
%
(
"select create_time from hdi_distr_detail where id = '%s';"
%
(
distr_detail_main_key
))
distr_detail_main_key
))
last_modified
=
create_time
last_modified
=
get_create_time
(
"select last_modified from hdi_distr_detail where id = '%s';"
%
(
distr_detail_main_key
))
last_modified_user
=
create_user
last_modified_user
=
create_user
if
type
==
16
:
if
type
==
16
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
...
@@ -1393,7 +1395,24 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
...
@@ -1393,7 +1395,24 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
else
:
else
:
expected
=
None
expected
=
None
comparison_result
(
actual
,
expected
)
# comparison_result(actual, expected)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
actual_value2
=
actual_value1
.
replace
(
" "
,
""
)
expected_value2
=
expected_value1
.
replace
(
" "
,
""
)
# print('actual_value2',actual_value2)
print
(
'expected_value2'
)
print
(
expected_value2
)
print
(
'actual_value2'
)
print
(
actual_value2
)
result
=
(
compare_text_index
(
actual_value2
,
expected_value2
))
print
(
'result'
,
result
)
if
actual_value2
==
expected_value2
:
print
(
'ok'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_check
(
type
=
1
):
def
check_mcms_check
(
type
=
1
):
...
@@ -1423,9 +1442,9 @@ def check_mcms_check(type=1):
...
@@ -1423,9 +1442,9 @@ def check_mcms_check(type=1):
rec_org_name
=
get_rec_org_name
(
2
)
rec_org_name
=
get_rec_org_name
(
2
)
dept_id
=
rec_org_id
dept_id
=
rec_org_id
dept_name
=
rec_org_name
dept_name
=
rec_org_name
branch_id
=
get_branch_id
()
branch_id
=
get_branch_id
()
buyBillId
=
get_buyBillId
(
branch_id
,
bill_mode
)
buyBillId
=
get_buyBillId
(
branch_id
,
bill_mode
)
buyOrderNo
=
get_buyOrderNo
(
branch_id
,
bill_mode
)
buyOrderNo
=
get_buyOrderNo
(
branch_id
,
bill_mode
)
if
type
==
1
:
if
type
==
1
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
elif
type
==
2
:
elif
type
==
2
:
...
@@ -1434,27 +1453,32 @@ def check_mcms_check(type=1):
...
@@ -1434,27 +1453,32 @@ def check_mcms_check(type=1):
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
planBillId
=
get_planBillId
(
hos_goods_id
)
planBillId
=
get_planBillId
(
hos_goods_id
)
planOrderNo
=
get_planOrderNo
(
hos_goods_id
)
planOrderNo
=
get_planOrderNo
(
hos_goods_id
)
purOrderNo
=
get_purOrderNo
(
branch_id
,
bill_mode
)
purOrderNo
=
get_purOrderNo
(
branch_id
,
bill_mode
)
purBillId
=
get_purBillId
(
branch_id
,
bill_mode
)
purBillId
=
get_purBillId
(
branch_id
,
bill_mode
)
bill_relation_json
=
get_purBillDate
(
branch_id
,
bill_mode
)
bill_relation_json
=
get_purBillDate
(
branch_id
,
bill_mode
)
purBillDate
=
reGetString
(
bill_relation_json
,
r
'purBillDate":"'
,
r
'""distrBillId'
)
purBillDate
=
reGetString
(
bill_relation_json
,
r
'purBillDate":"'
,
r
'""distrBillId'
)
distrBillId
=
get_distrBillId
(
branch_id
,
bill_mode
)
distrBillId
=
get_distrBillId
(
branch_id
,
bill_mode
)
distrOrderNo
=
get_distrOrderNo
(
branch_id
,
bill_mode
)
distrOrderNo
=
get_distrOrderNo
(
branch_id
,
bill_mode
)
checkBillId
=
check_no
checkBillId
=
check_no
checkOrderNo
=
order_no
checkOrderNo
=
order_no
create_user
=
get_login_user_uxid
()
create_user
=
get_login_user_uxid
()
sql
=
"select create_time from mcms_check where id='%s';"
%
check_no
sql
=
"select create_time from mcms_check where id='%s';"
%
check_no
create_time
=
get_create_time
(
sql
)
create_time
=
get_create_time
(
sql
)
last_modified
=
create_time
sql
=
"select last_modified from mcms_check where id='%s';"
%
check_no
last_modified_user
=
create_user
last_modified
=
get_create_time
(
sql
)
if
type
==
1
:
last_modified_user
=
create_user
if
type
==
1
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check'
,
check_no
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check'
,
check_no
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
purBillDate
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
distrBillId
,
distrOrderNo
,
checkBillId
,
checkOrderNo
,
create_user
,
create_time
,
last_modified
,
purBillDate
,
distrBillId
,
distrOrderNo
,
checkBillId
,
checkOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
last_modified_user
)
elif
type
==
2
:
elif
type
==
2
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check1'
,
check_no
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check1'
,
check_no
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
...
@@ -1464,6 +1488,7 @@ def check_mcms_check(type=1):
...
@@ -1464,6 +1488,7 @@ def check_mcms_check(type=1):
create_time
,
last_modified
,
create_time
,
last_modified
,
last_modified_user
)
last_modified_user
)
else
:
else
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check2'
,
check_no
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check2'
,
check_no
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
...
@@ -1473,7 +1498,93 @@ def check_mcms_check(type=1):
...
@@ -1473,7 +1498,93 @@ def check_mcms_check(type=1):
create_time
,
last_modified
,
create_time
,
last_modified
,
last_modified_user
)
last_modified_user
)
# 对比预期值和实际值是否一致
# 对比预期值和实际值是否一致
comparison_result
(
actual
,
expected
)
# comparison_result(actual, expected)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
actual_value2
=
actual_value1
.
replace
(
" "
,
""
)
expected_value2
=
expected_value1
.
replace
(
" "
,
""
)
# print('actual_value2',actual_value2)
print
(
'expected_value2'
)
print
(
expected_value2
)
print
(
'actual_value2'
)
print
(
actual_value2
)
result
=
(
compare_text_index
(
actual_value2
,
expected_value2
))
print
(
'result'
,
result
)
if
actual_value2
==
expected_value2
:
print
(
'ok'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
):
print
(
'数据库检查验收单子表'
)
if
type
==
1
:
bill_mode
=
16
elif
type
==
2
:
bill_mode
=
20
else
:
bill_mode
=
66
sql
=
"select * from mcms_check_batch where pid='%s'"
%
check_no
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql
)
print
(
'actual'
,
actual
)
id
=
get_id
(
"select id from mcms_check_batch where pid='%s'"
%
check_no
)
pid
=
check_no
branch_id
=
get_branch_id
()
distr_detail_id
=
get_distr_detail_id
(
branch_id
,
bill_mode
)
source_detail_id
=
distr_detail_id
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
sql
=
"select id from hdi_barcode where code_type='%s'order by create_time desc LIMIT 1;"
%
bill_mode
barcode_id
=
get_id
(
sql
)
create_user
=
get_login_user_uxid
()
create_time
=
get_create_time
(
"select create_time from mcms_check_batch where pid='%s'"
%
check_no
)
last_modified
=
get_create_time
(
"select last_modified from mcms_check_batch where pid='%s'"
%
check_no
)
last_modified_user
=
create_user
if
type
==
1
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check_batch'
,
id
,
pid
,
order_no
,
source_detail_id
,
distr_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
2
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check_batch1'
,
id
,
pid
,
order_no
,
source_detail_id
,
distr_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check_batch2'
,
id
,
pid
,
order_no
,
source_detail_id
,
distr_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
# 对比预期值和实际值是否一致
# comparison_result(actual, expected)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
actual_value2
=
actual_value1
.
replace
(
" "
,
""
)
expected_value2
=
expected_value1
.
replace
(
" "
,
""
)
# print('actual_value2',actual_value2)
print
(
'expected_value2'
)
print
(
expected_value2
)
print
(
'actual_value2'
)
print
(
actual_value2
)
result
=
(
compare_text_index
(
actual_value2
,
expected_value2
))
print
(
'result'
,
result
)
if
actual_value2
==
expected_value2
:
print
(
'ok'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
try
:
try
:
...
@@ -1491,71 +1602,76 @@ try:
...
@@ -1491,71 +1602,76 @@ try:
from
a_b4流程十一请领业务流_二级库向直送
import
check_accept_order
from
a_b4流程十一请领业务流_二级库向直送
import
check_accept_order
for
i
in
range
(
1
):
for
i
in
range
(
1
):
#
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
#
goods_move2() # 设置产品出库渠道为直送
goods_move2
()
# 设置产品出库渠道为直送
# #
#
低值
# # 低值
#
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message2'
)[
'hosGoodsId'
],
1
)
#
check_mcms_dept_buy_car(1)
check_mcms_dept_buy_car
(
1
)
# #
#
高值
# # 高值
#
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2)
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message1'
)[
'hosGoodsId'
],
2
)
#
check_mcms_dept_buy_car(2)
check_mcms_dept_buy_car
(
2
)
# #
#
试剂
# # 试剂
#
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message3'
)[
'hosGoodsId'
],
3
)
#
check_mcms_dept_buy_car(3)
check_mcms_dept_buy_car
(
3
)
#
BuyCarSubmit() # 请领车提交
BuyCarSubmit
()
# 请领车提交
#
#
list_data = ['16', '20', '66']
list_data
=
[
'16'
,
'20'
,
'66'
]
#
for i in list_data:
for
i
in
list_data
:
#
check_mcms_dept_buy(int(i))
check_mcms_dept_buy
(
int
(
i
))
#
mcms_dept_buy_detail(int(i))
mcms_dept_buy_detail
(
int
(
i
))
#
for i in range(6): # 三个单据共审批6次
for
i
in
range
(
6
):
# 三个单据共审批6次
#
approval_center()
approval_center
()
#
list_data = ['16', '20', '66']
list_data
=
[
'16'
,
'20'
,
'66'
]
#
for i in list_data:
for
i
in
list_data
:
#
check_mcms_dept_buy_approval_after(int(i))
check_mcms_dept_buy_approval_after
(
int
(
i
))
#
mcms_dept_buy_detail_approval_after(int(i))
mcms_dept_buy_detail_approval_after
(
int
(
i
))
#
#
time.sleep(20)
time
.
sleep
(
20
)
#
#
检查自动生成的采购计划数据
# 检查自动生成的采购计划数据
#
list_data = ['16', '20', '66']
list_data
=
[
'16'
,
'20'
,
'66'
]
#
for i in list_data:
for
i
in
list_data
:
#
check_mcms_mcms_pur_plan(int(i))
check_mcms_mcms_pur_plan
(
int
(
i
))
#
#
采购模块处理
# 采购模块处理
#
purchase_module_process()
purchase_module_process
()
#
# 三个单据共审批三次
# 三个单据共审批三次
# approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号试剂', 'message12'))
approval_center
(
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'采购计划单号试剂'
,
'message12'
))
# approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号', 'message7'))
approval_center
(
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'采购计划单号'
,
'message7'
))
# approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号高值', 'message11'))
approval_center
(
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'采购计划单号高值'
,
'message11'
))
# time.sleep(20)
time
.
sleep
(
20
)
# list_data = ['16', '20', '66']
list_data
=
[
'16'
,
'20'
,
'66'
]
# for i in list_data:
for
i
in
list_data
:
# check_mcms_purchase(int(i))
check_mcms_purchase
(
int
(
i
))
#
# #检查同步到外网的采购订单数据跟内网的是否一致
# 检查同步到外网的采购订单数据跟内网的是否一致
# check_mcms_purchase_out_and_in(1)
check_mcms_purchase_out_and_in
(
1
)
# print('检查同步到外网的采购订单数据跟内网的是否一致')
print
(
'检查同步到外网的采购订单数据跟内网的是否一致'
)
# check_mcms_purchase_out_and_in(2)
check_mcms_purchase_out_and_in
(
2
)
# order_dp(1) # 1低值
order_dp
(
1
)
# 1低值
# time.sleep(6)
time
.
sleep
(
6
)
# order_dp(2) # 2高值
order_dp
(
2
)
# 2高值
# time.sleep(6)
time
.
sleep
(
6
)
# order_dp(3) # 3试剂
order_dp
(
3
)
# 3试剂
# time.sleep(6)
time
.
sleep
(
6
)
# time.sleep(20)
time
.
sleep
(
20
)
# list_data = ['16', '20', '66']
list_data
=
[
'16'
,
'20'
,
'66'
]
# for i in list_data:
for
i
in
list_data
:
# check_hdi_distr(int(i))
time
.
sleep
(
6
)
check_hdi_distr
(
int
(
i
))
# check_accept_order(1) # 低值
time
.
sleep
(
20
)
# check_mcms_check(1) # 调用函数检查验收单数据库写值
check_accept_order
(
1
)
# 低值
time
.
sleep
(
6
)
# 上面暂时注释========================================
# 上面暂时注释========================================
check_mcms_check
(
1
)
# 调用函数检查验收单数据库写值
# check_accept_order(2) # 高值
check_accept_order
(
2
)
# 高值
# check_mcms_check(2) # 调用函数检查验收单数据库写值
time
.
sleep
(
6
)
# check_accept_order(3) # 试剂
check_mcms_check
(
2
)
# 调用函数检查验收单数据库写值
check_accept_order
(
3
)
# 试剂
time
.
sleep
(
6
)
check_mcms_check
(
3
)
# 调用函数检查验收单数据库写值
check_mcms_check
(
3
)
# 调用函数检查验收单数据库写值
# 这里验收后会自动生成入库单,批次信息,需要同步验证入库单和批次信息
# 这里验收后会自动生成入库单,批次信息,需要同步验证入库单和批次信息
# 根据验收单号到mcms_psi表查询入库单
# 根据验收单号到mcms_psi表查询入库单
...
...
air_case/b6_spd3_core_business_flow_database_check/a_b5流程十二请领业务流_二级库向二级库_数据库验证.air/a_b5流程十二请领业务流_二级库向二级库_数据库验证.py
View file @
d5a42857
...
@@ -5,6 +5,7 @@ import traceback
...
@@ -5,6 +5,7 @@ import traceback
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
air_case.public1.public1.public1
import
*
from
air_case.public1.public1.public1
import
*
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_tools
import
get_create_time
,
check_mcms_dept_buy_car_sql
from
common.fileUtls
import
FileUtils
from
common.fileUtls
import
FileUtils
from
common.run_cmd_script
import
execute_command
from
common.run_cmd_script
import
execute_command
...
@@ -20,390 +21,99 @@ python runner_test.py tag id2303-15 debug mdm3
...
@@ -20,390 +21,99 @@ python runner_test.py tag id2303-15 debug mdm3
"""
"""
def
SERACH_goods_id
(
GoodsId
):
def
check_mcms_dept_buy_car
(
type
=
1
):
# 在请领出库渠道边仓中搜索产品
hos_goods_id
=
'hos_goods_id'
module
=
'b5_spd3_core_business_flow'
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
username
=
info
[
'username1'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
print
(
'username,password'
,
username
,
password
)
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束\
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_mcmsBranchGoodsInfo_page_url"
)
dept1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
# hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId']
# GoodsId = hosGoodsId.replace(get_hosid(), '')
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload53_2"
,
GoodsId
,
get_hosid
(),
get_branch_id
(),
dept1
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
branchGoodsId
=
commonFuc
().
analysis_json
(
'id'
,
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result
)))
return
branchGoodsId
def
second_dept_Request
(
hosGoodsId
,
type
):
module
=
"b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
username
=
info
[
'username1'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
print
(
'username,password'
,
username
,
password
)
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束
# 我要请领_手工请领_列表查询===========================
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_buy_queryGoodsInfoPage_url"
)
print
(
'我要请领_手工请领_列表查询================='
,
url
)
deptid2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
]
deptname2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
]
# 高值
# hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
GoodsId
=
hosGoodsId
.
replace
(
get_hosid
(),
''
)
areaCode
=
get_stockAreaId_new
(
deptid2
,
deptname2
,
2
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload39"
,
GoodsId
,
get_hosid
(),
deptid2
,
areaCode
)
print
(
'我要请领_手工请领_列表查询'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'我要请领_手工请领_列表查询,result'
,
result
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
goodsName
=
commonFuc
().
analysis_json
(
'goodsName'
,
data1
)
goodsSpec
=
commonFuc
().
analysis_json
(
'goodsSpec'
,
data1
)
mdmGoodsCode
=
commonFuc
().
analysis_json
(
'mdmGoodsCode'
,
data1
)
goodsCode
=
commonFuc
().
analysis_json
(
'goodsCode'
,
data1
)
unit
=
commonFuc
().
analysis_json
(
'unit'
,
data1
)
purMode
=
commonFuc
().
analysis_json
(
'purMode'
,
data1
)
goodsMfrsName
=
commonFuc
().
analysis_json
(
'goodsMfrsName'
,
data1
)
unitName
=
commonFuc
().
analysis_json
(
'unitName'
,
data1
)
price
=
commonFuc
().
analysis_json
(
'price'
,
data1
)
deptId
=
commonFuc
().
analysis_json
(
'deptId'
,
data1
)
# areaCode=commonFuc().analysis_json('areaCode',data1)
areaName
=
'默认库区'
targetDeptId
=
commonFuc
().
analysis_json
(
'targetDeptId'
,
data1
)
targetDeptName
=
commonFuc
().
analysis_json
(
'targetDeptName'
,
data1
)
targetStockId
=
commonFuc
().
analysis_json
(
'targetStockId'
,
data1
)
targetStockName
=
commonFuc
().
analysis_json
(
'targetStockName'
,
data1
)
purModeText
=
commonFuc
().
analysis_json
(
'purModeText'
,
data1
)
goodsGeneralName
=
commonFuc
().
analysis_json
(
'goodsGeneralName'
,
data1
)
provName
=
commonFuc
().
analysis_json
(
'provName'
,
data1
)
pkgDefId
=
commonFuc
().
analysis_json
(
'pkgDefId'
,
data1
)
# 信息写入文件
list_a
=
[]
list_b
=
[]
list_c
=
[]
list_a
.
append
(
data1
)
list_b
.
append
(
data1
)
list_c
.
append
(
data1
)
# print('list_a', len(list_a), list_a)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
FileUtils
().
w_info8
(
info
,
module
,
'二级库向二级库请领产品信息'
,
titlename
,
'message23'
)
# 我要请领_手工请领_列表查询===========================
# 添加到请领车=============================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_buy_createBuyCar_url"
)
print
(
'添加到请领车================='
,
url
)
if
type
==
1
:
if
type
==
1
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload40"
,
hosGoodsId
,
goodsName
,
goodsSpec
,
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
mdmGoodsCode
,
goodsCode
,
unit
,
purMode
,
goodsMfrsName
,
pkgDefId
,
unitName
,
price
,
deptId
,
areaCode
,
areaName
,
targetDeptId
,
targetDeptName
,
targetStockId
,
targetStockName
,
purModeText
,
goodsGeneralName
,
provName
)
elif
type
==
2
:
elif
type
==
2
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload41"
,
hosGoodsId
,
goodsName
,
goodsSpec
,
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message1'
)[
"hosGoodsId"
]
mdmGoodsCode
,
goodsCode
,
unit
,
purMode
,
goodsMfrsName
,
unitName
,
price
,
deptId
,
areaCode
,
areaName
,
targetDeptId
,
targetDeptName
,
targetStockId
,
targetStockName
,
purModeText
,
goodsGeneralName
,
provName
)
elif
type
==
3
:
elif
type
==
3
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload42"
,
hosGoodsId
,
goodsName
,
goodsSpec
,
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
mdmGoodsCode
,
branch_id
=
get_branch_id
()
goodsCode
,
unit
,
purMode
,
goodsMfrsName
,
pkgDefId
,
unitName
,
price
,
# 获取create_time的值
deptId
,
create_time
=
get_create_time
(
areaCode
,
areaName
,
targetDeptId
,
targetDeptName
,
targetStockId
,
"select create_time from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s'order by create_time desc LIMIT 1;"
%
(
targetStockName
,
purModeText
,
goodsGeneralName
,
provName
)
branch_id
,
hos_goods_id
))
request_body
=
get_process_list
(
request_body
)
print
(
'create_time'
,
create_time
)
print
(
'添加到请领车'
,
'request_body'
,
request_body
)
id
=
get_id
(
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
"select id from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
print
(
'添加到请领车,result'
,
result
)
branch_id
,
hos_goods_id
))
# 添加到请领车=============================================
print
(
'id'
,
id
)
create_user
=
get_id
(
"select create_user from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' order by create_time desc LIMIT 1;;"
%
(
def
BuyCarSubmit
():
branch_id
,
hos_goods_id
))
module
=
"b5_spd3_core_business_flow"
print
(
'create_time'
,
create_time
,
'id'
,
id
)
# # 登录获取用户id等信息,使用创建的用户登录===========开始
sql
=
"""select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s' order by create_time desc LIMIT 1;
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
"""
%
(
branch_id
,
hos_goods_id
)
username
=
info
[
'username1'
]
# 要验证的sql,取自数据库的表中
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
actual_value1
=
check_mcms_dept_buy_car_sql
(
sql
)
print
(
'username,password'
,
username
,
password
)
print
(
actual_value1
)
# # 获取token和projectCode
deptid2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
deptname2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
# 登录获取用户id等信息,使用创建的用户登录============结束
areaCode
=
get_stockAreaId_new_fromDb
(
deptname2
,
2
)
# 我要请领_手工请领_列表查询===========================
areaName
=
'默认库区'
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
# 读取文件中的信息
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"二级库请领产品信息"
,
'message21'
)
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
list_a
=
info
[
'list_a'
]
# 请领车查询===============================================
mdm_goods_code
=
commonFuc
().
analysis_json
(
'mdmGoodsCode'
,
list_a
)
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
pur_mode
=
commonFuc
().
analysis_json
(
'purMode'
,
list_a
)
"herpService_buy_queryBuyCarPage_url"
)
goodsCode
=
commonFuc
().
analysis_json
(
'goodsCode'
,
list_a
)
print
(
'请领车查询================='
,
url
)
pkgDefId
=
commonFuc
().
analysis_json
(
'pkgDefId'
,
list_a
)
deptid2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
]
pkgDefName
=
commonFuc
().
analysis_json
(
'pkgDefName'
,
list_a
)
deptname2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
]
last_modified_user
=
create_user
areaCode
=
get_stockAreaId_new
(
deptid2
,
deptname2
,
2
)
last_modified
=
create_time
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload43"
,
areaCode
,
get_hosid
(),
deptid2
)
# print('actual_value1',actual_value1)
actual_value2
=
get_process_list2
(
actual_value1
)
print
(
'请领车查询'
,
'request_body'
,
request_body
)
# print('actual_value2')
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
# print( actual_value2)
print
(
'请领车查询,result'
,
result
)
# prov_hos_goods_id = '8d6273b7bca84dd8aace12b9422d7fd6'
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
expected_value2
=
'expected_value2'
list_id
=
[]
if
type
==
1
or
type
==
3
:
for
i
in
data
:
expected_value2
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
id
=
commonFuc
().
analysis_json
(
'id'
,
i
)
'check_mcms_dept_buy_car_low_value'
,
id
,
get_hosid
(),
branch_id
,
list_id
.
append
(
id
)
deptid2
,
# 请领车查询===============================================
deptname2
,
areaCode
,
areaName
,
hos_goods_id
,
mdm_goods_code
,
# 请领车提交===============================================
goodsCode
,
pur_mode
,
pkgDefId
,
pkgDefName
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
"herpService_buy_validBuyCarSubmit_url"
)
elif
type
==
2
:
print
(
'请领车提交================='
,
url
)
expected_value2
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_dept_buy_car_high_value'
,
id
,
get_hosid
(),
billExpdtDate
=
timeUtils
().
get_time_add
(
30
,
2
)
branch_id
,
print
(
'billExpdtDate'
,
billExpdtDate
)
deptid2
,
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload44"
,
billExpdtDate
,
get_branch_id
(),
list_id
[
0
],
deptname2
,
areaCode
,
areaName
,
hos_goods_id
,
mdm_goods_code
,
list_id
[
1
],
list_id
[
2
])
goodsCode
,
pur_mode
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
print
(
'请领车提交'
,
'request_body'
,
request_body
)
# print('expected_value2', expected_value2)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
# expected_value2=get_process_list2(expected_value2)
print
(
'请领车提交,result'
,
result
)
actual_value2
=
actual_value2
.
replace
(
" "
,
""
)
# 请领车提交===============================================
expected_value2
=
expected_value2
.
replace
(
" "
,
""
)
# 创建领车交易=================================================
# print('actual_value2',actual_value2)
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
print
(
'expected_value2'
)
"herpService_buy_createBuyBill_url"
)
print
(
expected_value2
)
print
(
'创建领车交易================='
,
url
)
print
(
'actual_value2'
)
print
(
actual_value2
)
billExpdtDate
=
timeUtils
().
get_time_add
(
30
,
2
)
result
=
(
compare_text_index
(
actual_value2
,
expected_value2
))
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload44"
,
billExpdtDate
,
get_branch_id
(),
list_id
[
0
],
list_id
[
1
],
list_id
[
2
])
print
(
'创建领车交易'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'创建领车交易,result'
,
result
)
currentTaskList
=
commonFuc
().
analysis_json
(
'currentTaskList'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
def
add_dept2
():
module
=
'b2_herp3_bs'
# 内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
# print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# print( token,projectCode,uxid,corpId,info)
# c3_新增科室_特殊科室_二级库房
branch_id
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_id"
]
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"dept_insert_url"
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload15_2"
,
get_branch_id
(),
get_hosid
())
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
def
add_new_deptinfo
():
module
=
"b2_herp3_bs"
# 内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
# print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# print( token,projectCode,uxid,corpId,info)
# b9_科室管理_科室登记_科室查询
branch_id
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_id"
]
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"deptPage_url"
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload13"
,
branch_id
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
print
(
'result'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
if
actual_value2
==
expected_value2
:
total
=
commonFuc
().
analysis_json
(
'total'
,
data
)
print
(
'ok'
)
if
total
==
5
:
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
print
(
'error'
)
# 将deptid写入文件
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
print
(
'data1'
,
data1
)
info
=
[]
for
i
in
data1
:
deptid
=
commonFuc
().
analysis_json
(
'id'
,
i
)
info
.
append
(
deptid
)
titlename
=
[
'deptid1'
,
'deptid2'
,
'deptid3'
,
'deptid4'
,
'deptid5'
]
FileUtils
().
w_info8
(
info
,
module
,
'所有科室id'
,
titlename
,
'message6'
)
info1
=
[]
for
i
in
data1
:
ename
=
commonFuc
().
analysis_json
(
'ename'
,
i
)
info1
.
append
(
ename
)
FileUtils
().
w_info8
(
info1
,
module
,
'所有科室name'
,
titlename
,
'message6'
)
def
edit_goods_target
(
currentDeptId
,
targetDeptId
):
module
=
"b2_herp3_bs"
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
username
=
info
[
'username1'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
print
(
'username,password'
,
username
,
password
)
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"basic_mcmsDeptGoodsInfo_page_url"
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload58_13_1"
,
currentDeptId
,
get_hosid
())
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'科室产品列表查询'
,
result
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
for
i
in
data1
:
shelfCode
=
commonFuc
().
analysis_json
(
'shelfCode'
,
i
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
i
)
pkgDefId
=
commonFuc
().
analysis_json
(
'pkgDefId'
,
i
)
purMode
=
commonFuc
().
analysis_json
(
'purMode'
,
i
)
tbStatus
=
commonFuc
().
analysis_json
(
'tbStatus'
,
i
)
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_basic_mcmsDeptGoodsInfo_url"
)
url
=
url
+
id1
result
=
commonFuc
().
http_get
(
url
,
headers
)
print
(
'获取产品详情信息'
,
result
)
data2
=
commonFuc
().
analysis_json
(
'data'
,
result
)
packetQty
=
commonFuc
().
analysis_json
(
'packetQty'
,
data2
)
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"basic_mcmsDeptGoodsInfo_updateById"
)
if
purMode
==
60
or
purMode
==
10
:
# 低值和试剂
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload58_10_1"
,
id1
,
pkgDefId
,
targetDeptId
,
shelfCode
,
packetQty
,
tbStatus
)
elif
purMode
==
20
:
# 高值
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload58_10_2"
,
id1
,
targetDeptId
,
shelfCode
,
tbStatus
)
print
(
'编辑产品请领渠道request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'编辑产品请领渠道result'
,
result
)
def
pick_execute
():
module
=
"b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
username
=
info
[
'username1'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
print
(
'username,password'
,
username
,
password
)
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束
# 生成拣货单列表查询===============================================
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
url1
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_stock_out_buyPage_url"
)
print
(
'请领出库列表页面================='
,
url1
)
request_body1
=
commonFuc
().
get_business_data
(
module
,
"payload46_1"
,
get_branch_id
())
print
(
'请领出库列表页面'
,
'request_body'
,
request_body1
)
result1
=
commonFuc
().
http_post
(
url1
,
request_body1
,
headers
)
print
(
'请领出库列表页面,result1'
,
result1
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result1
))
for
i
in
data1
:
# 获取id
BH_ID
=
commonFuc
().
analysis_json
(
'id'
,
i
)
version
=
commonFuc
().
analysis_json
(
'version'
,
i
)
deptBuyDetailVOList
=
commonFuc
().
analysis_json
(
'deptBuyDetailVOList'
,
i
)
purMode
=
commonFuc
().
analysis_json
(
'purMode'
,
deptBuyDetailVOList
)
# 生成拣货单列表查询===============================================
# 生成拣货单列表锁定===============================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_stock_out_use_updateLock_url"
)
print
(
'请领出库列表列表页面锁定================='
,
url
)
# version=int(version)+1
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload49_1"
,
BH_ID
,
version
)
print
(
'请领出库列表列表页面锁定'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'请领出库列表列表页面锁定,result1'
,
result
)
# 生成拣货单列表锁定===============================================
# 拣货==============================
if
purMode
==
10
:
udi_code
=
get_udi2
(
1
)
# 获取条码 低值1 高值2 试剂3
elif
purMode
==
20
:
udi_code
=
get_udi2
(
2
)
# 获取条码 低值1 高值2 试剂3
elif
purMode
==
60
:
udi_code
=
get_udi2
(
3
)
# 获取条码 低值1 高值2 试剂3
else
:
udi_code
=
'udi_code'
print
(
'udi_code'
,
udi_code
)
if
purMode
==
10
:
targetAreaCode
,
sourceId
=
pickScan2
(
BH_ID
,
udi_code
,
1
)
# 低值
elif
purMode
==
20
:
targetAreaCode
,
sourceId
=
pickScan2
(
BH_ID
,
udi_code
,
2
)
# 高值
elif
purMode
==
60
:
targetAreaCode
,
sourceId
=
pickScan2
(
BH_ID
,
udi_code
,
3
)
# 试剂
else
:
targetAreaCode
=
'targetAreaCode'
sourceId
=
'sourceId'
# 提交领用出库单
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_stock_out_use_submit_url"
)
print
(
'提交拣货执行单================='
,
url
)
if
purMode
==
10
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_1"
,
targetAreaCode
,
sourceId
)
elif
purMode
==
20
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_2"
,
targetAreaCode
,
sourceId
)
elif
purMode
==
60
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_3"
,
targetAreaCode
,
sourceId
)
print
(
'提交拣货执行单'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
' 提交拣货执行单,result1'
,
result
)
# 复核===================================
try
:
try
:
pro_path
=
commonFuc
().
get_pro_path2
()
print
(
'pro_path'
,
pro_path
)
sys
.
path
.
append
(
pro_path
+
r
'/air_case/b5_spd3_core_business_flow/a_b5流程十二请领业务流_二级库向二级库.air'
)
using
(
pro_path
+
r
'//air_case/b5_spd3_core_business_flow/a_b5流程十二请领业务流_二级库向二级库.air'
)
from
a_b5流程十二请领业务流_二级库向二级库
import
add_dept2
from
a_b5流程十二请领业务流_二级库向二级库
import
add_new_deptinfo
,
edit_goods_target
,
second_dept_Request
from
a_b5流程十二请领业务流_二级库向二级库
import
BuyCarSubmit
,
pick_execute
from
a_b5流程十二请领业务流_二级库向二级库
import
purchase_module_process
from
a_b5流程十二请领业务流_二级库向二级库
import
order_dp
from
a_b5流程十二请领业务流_二级库向二级库
import
check_accept_order
add_dept2
()
# 新增一个二级科室
add_dept2
()
# 新增一个二级科室
add_new_deptinfo
()
# 写入科室信息到文件中
add_new_deptinfo
()
# 写入科室信息到文件中
grants_user_new
()
# 新增授权
grants_user_new
()
# 新增授权
...
@@ -416,7 +126,12 @@ try:
...
@@ -416,7 +126,12 @@ try:
set_dept_lead_new
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid5"
])
# 设置二级科室负责人
set_dept_lead_new
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid5"
])
# 设置二级科室负责人
get_stockAreaId_new
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
],
get_stockAreaId_new
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
],
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
],
2
)
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
],
2
)
set_stockShelf_Linkman
()
#设置库区联系人
# 设置库区联系人
deptName5
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
]
set_stockShelf_Linkman
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid5"
],
get_stockAreaId2_new_fromDb
(
deptName5
,
2
))
#新建科室产品分配
#新建科室产品分配
dept_goods_distribute
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
])
dept_goods_distribute
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
])
#编辑产品请领目标为二级检验科002
#编辑产品请领目标为二级检验科002
...
@@ -427,6 +142,7 @@ try:
...
@@ -427,6 +142,7 @@ try:
updateUserLoginDefaultRange
(
get_listUserMgrRangePage1
(
5
))
# 设置登录账号默认权限是新二级库
updateUserLoginDefaultRange
(
get_listUserMgrRangePage1
(
5
))
# 设置登录账号默认权限是新二级库
# # # 低值
# # # 低值
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message2'
)[
'hosGoodsId'
],
1
)
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message2'
)[
'hosGoodsId'
],
1
)
check_mcms_dept_buy_car
(
1
)
# # # 高值
# # # 高值
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message1'
)[
'hosGoodsId'
],
2
)
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message1'
)[
'hosGoodsId'
],
2
)
# # # 试剂
# # # 试剂
...
...
air_case/public1/public1/public1.py
View file @
d5a42857
...
@@ -2356,20 +2356,20 @@ def check_accept_order():
...
@@ -2356,20 +2356,20 @@ def check_accept_order():
break
break
# ==============================查看订单详情==================
# ==============================查看订单详情==================
# ========设置验收全部合格
# ========设置验收全部合格
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"check_barcode_save_url"
)
url
2
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"check_barcode_save_url"
)
print
(
'check_barcode_save_url'
,
url
)
print
(
'check_barcode_save_url'
,
url
2
)
sourceBillId
=
sourceId
sourceBillId
=
sourceId
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload2"
,
sourceBillId
,
viewId
)
request_body
2
=
commonFuc
().
get_business_data
(
module
,
"payload2"
,
sourceBillId
,
viewId
)
print
(
'设置验收全部合格request_body'
,
request_body
)
print
(
'设置验收全部合格request_body
2
'
,
request_body
2
)
# 发送请求
# 发送请求
time
.
sleep
(
6
)
time
.
sleep
(
6
)
while
True
:
while
True
:
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
2
=
commonFuc
().
http_post
(
url
,
request_body
2
,
headers
)
print
(
'result'
,
result
)
print
(
'result
2
'
,
result
2
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
2
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
2
)
print
(
code
)
print
(
code
)
if
code
==
0
and
len
(
data
)
>=
1
:
if
code
==
0
and
len
(
data
)
>=
1
:
break
break
...
@@ -2411,7 +2411,10 @@ def check_accept_order():
...
@@ -2411,7 +2411,10 @@ def check_accept_order():
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
if
code
==
0
:
if
code
==
0
:
break
break
else
:
result2
=
commonFuc
().
http_post
(
url
,
request_body2
,
headers
)
print
(
'result2'
,
result2
)
continue
info
=
(
CHECK_NO
,
CHECK_NO
)
info
=
(
CHECK_NO
,
CHECK_NO
)
titlename
=
(
'CHECK_NO1'
,
'CHECK_NO2'
)
titlename
=
(
'CHECK_NO1'
,
'CHECK_NO2'
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'验收单号'
,
titlename
,
'message15'
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'验收单号'
,
titlename
,
'message15'
)
...
...
common/db/sql/sql_tools.py
View file @
d5a42857
...
@@ -155,6 +155,7 @@ def get_expdt_date1(sql):
...
@@ -155,6 +155,7 @@ def get_expdt_date1(sql):
db
,
cursor
=
get_sql_conn
()
db
,
cursor
=
get_sql_conn
()
cursor
.
execute
(
sql
)
cursor
.
execute
(
sql
)
results
=
cursor
.
fetchone
()
results
=
cursor
.
fetchone
()
cursor
.
close
()
return
results
return
results
def
get_id
(
sql
):
def
get_id
(
sql
):
db
,
cursor
=
get_sql_conn
()
db
,
cursor
=
get_sql_conn
()
...
@@ -297,6 +298,13 @@ def get_distrBillId(branch_id,bill_mode):
...
@@ -297,6 +298,13 @@ def get_distrBillId(branch_id,bill_mode):
"select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
"select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
bill_mode
))
branch_id
,
bill_mode
))
return
distr_main_key
return
distr_main_key
def
get_distr_detail_id
(
branch_id
,
bill_mode
):
distr_main_key
=
get_distrBillId
(
branch_id
,
bill_mode
)
distr_detail_id
=
get_id
(
"select id from hdi_distr_detail a where pid='%s' order by create_time desc LIMIT 1;"
%
(
distr_main_key
))
return
distr_detail_id
def
get_distrOrderNo
(
branch_id
,
bill_mode
):
def
get_distrOrderNo
(
branch_id
,
bill_mode
):
# 查询配送单order_no
# 查询配送单order_no
distr_order_no
=
get_id
(
distr_order_no
=
get_id
(
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
d5a42857
...
@@ -58,3 +58,6 @@
...
@@ -58,3 +58,6 @@
"mcms_check1": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "hos_id": "%s", "branch_id": "%s", "source_id": "%s", "source_no": "%s", "source_type": "PSD", "tb_status": 20, "prov_id": "%s", "prov_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "dept_id": "%s", "dept_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "initial_order": None, "remark": ""}'
"mcms_check1": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "hos_id": "%s", "branch_id": "%s", "source_id": "%s", "source_no": "%s", "source_type": "PSD", "tb_status": 20, "prov_id": "%s", "prov_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "dept_id": "%s", "dept_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "initial_order": None, "remark": ""}'
"mcms_check2": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "hos_id": "%s", "branch_id": "%s", "source_id": "%s", "source_no": "%s", "source_type": "PSD", "tb_status": 20, "prov_id": "%s", "prov_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "dept_id": "%s", "dept_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "initial_order": None, "remark": ""}'
"mcms_check2": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "hos_id": "%s", "branch_id": "%s", "source_id": "%s", "source_no": "%s", "source_type": "PSD", "tb_status": 20, "prov_id": "%s", "prov_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "dept_id": "%s", "dept_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "initial_order": None, "remark": ""}'
"mcms_check_batch": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "distr_detail_id": "%s", "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "barcode_id": "%s", "sub_barcode_id": None, "qty": Decimal("100.00"), "reject_qty": Decimal("0.00"), "reject_reason": None, "settlement": 1, "tb_status": 1, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
"mcms_check_batch1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "distr_detail_id": "%s", "pur_mode": 20, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "barcode_id": "%s", "sub_barcode_id": None, "qty": Decimal("1.00"), "reject_qty": Decimal("0.00"), "reject_reason": None, "settlement": 1, "tb_status": 1, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
"mcms_check_batch2": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "distr_detail_id": "%s", "pur_mode": 60, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "barcode_id": "%s", "sub_barcode_id": None, "qty": Decimal("100.00"), "reject_qty": Decimal("0.00"), "reject_reason": None, "settlement": 1, "tb_status": 1, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
\ No newline at end of file
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