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
1341c47b
Commit
1341c47b
authored
Jul 19, 2024
by
xiao-hesheng
Browse files
数据库验证流程十一脚本编写
parent
538f5e78
Changes
4
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_b4流程十一请领业务流_二级库向直送_数据库验证.air/a_b4流程十一请领业务流_二级库向直送_数据库验证.py
View file @
1341c47b
...
...
@@ -8,7 +8,9 @@ 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
,
get_dept_buy_id
,
\
check_mcms_dept_buy_sql
,
get_mdm_goods_code
,
get_expdt_date
,
check_mcms_pur_plan_sql
,
check_in_check_mcms_purchase
,
\
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_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_distrOrderNo
from
common.db.sql.sql_tools_out
import
check_out_check_mcms_purchase
from
common.fileUtls
import
FileUtils
...
...
@@ -49,7 +51,7 @@ def check_mcms_dept_buy_car(type=1):
print
(
'create_time'
,
create_time
,
'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;
"""
%
(
branch_id
,
hos_goods_id
)
#要验证的sql,取自数据库的表中
#
要验证的sql,取自数据库的表中
actual_value1
=
check_mcms_dept_buy_car_sql
(
sql
)
print
(
actual_value1
)
deptid2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
...
...
@@ -838,7 +840,7 @@ def check_mcms_purchase(type=16):
)
elif
type
==
20
:
#检查采购订单子表
#
检查采购订单子表
check_mcms_purchase_detail
(
id1
,
type
,
order_no
)
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message1'
)[
"hosGoodsId"
]
planBillId
=
process_tuple
(
...
...
@@ -873,7 +875,7 @@ def check_mcms_purchase(type=16):
create_time
,
last_modified
,
last_auditor
,
last_audit_time
)
elif
type
==
66
:
#检查采购订单子表数据
#
检查采购订单子表数据
check_mcms_purchase_detail
(
id1
,
type
,
order_no
)
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
planBillId
=
process_tuple
(
...
...
@@ -960,19 +962,20 @@ def check_mcms_purchase_detail(id, type, OrderNo):
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message1'
)[
"hosGoodsId"
]
else
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
source_id
=
get_id
(
"select source_id from mcms_purchase_detail where pid='%s' order by create_time desc LIMIT 1;"
%
id
)
if
check_source_id
(
hos_goods_id
,
source_id
)
==
True
:
source_id
=
get_id
(
"select source_id from mcms_purchase_detail where pid='%s' order by create_time desc LIMIT 1;"
%
id
)
if
check_source_id
(
hos_goods_id
,
source_id
)
==
True
:
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
supply_id
=
get_supply_id
(
hos_goods_id
)
pkg_def_id
=
get_pkg_def_id
(
hos_goods_id
)
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
supply_id
=
get_supply_id
(
hos_goods_id
)
pkg_def_id
=
get_pkg_def_id
(
hos_goods_id
)
planBillId
=
process_tuple
(
get_id
(
"select pid from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
get_id
(
"select pid from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
sql
=
"select id from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
get_branch_id
(),
type
)
print
(
sql
)
...
...
@@ -982,21 +985,24 @@ def check_mcms_purchase_detail(id, type, OrderNo):
planDetailId
=
get_id
(
"select id from spd3_herp_test2.mcms_pur_plan_detail where pid='%s';"
%
planBillId
)
source_id
=
planDetailId
goodsGg
=
get_goods_gg
(
hos_goods_id
)
goodsCode
=
get_goods_code1
(
hos_goods_id
)
goodsName
=
get_goods_name
(
hos_goods_id
)
create_user
=
get_login_user_uxid
()
create_time
=
get_create_time
(
"select create_time from mcms_purchase_detail where id='%s';"
%
detail_main_key
)
last_modified
=
create_time
last_modified_user
=
create_user
source_id
=
planDetailId
goodsGg
=
get_goods_gg
(
hos_goods_id
)
goodsCode
=
get_goods_code1
(
hos_goods_id
)
goodsName
=
get_goods_name
(
hos_goods_id
)
create_user
=
get_login_user_uxid
()
create_time
=
get_create_time
(
"select create_time from mcms_purchase_detail where id='%s';"
%
detail_main_key
)
last_modified
=
create_time
last_modified_user
=
create_user
if
type
==
16
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_purchase_detail'
,
detail_main_key
,
pid
,
OrderNo
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
supply_id
,
pkg_def_id
,
planBillId
,
buyDetailId
,
planDetailId
,
goodsGg
,
goodsCode
,
goodsName
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
'mcms_purchase_detail'
,
detail_main_key
,
pid
,
OrderNo
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
supply_id
,
pkg_def_id
,
planBillId
,
buyDetailId
,
planDetailId
,
goodsGg
,
goodsCode
,
goodsName
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
20
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
...
...
@@ -1153,7 +1159,7 @@ def check_hdi_distr(type=16):
pur_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
rec_org_id
=
process_tuple
(
get_id
(
"select id from spd3_herp_test2.sys_org where branch_id='%s' and ename='%s';"
%
(
branch_id
,
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
])))
branch_id
,
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
])))
rec_org_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
last_modified
=
create_time
...
...
@@ -1300,14 +1306,13 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
source_id
=
purchase_id
source_detail_id
=
get_id
(
"select id from mcms_purchase_detail where pid='%s'"
%
purchase_id
)
pur_detail_id
=
source_detail_id
if
type
==
16
:
if
type
==
16
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
elif
type
==
20
:
elif
type
==
20
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message1'
)[
"hosGoodsId"
]
else
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
goods_name
=
get_goods_name
(
hos_goods_id
)
...
...
@@ -1348,13 +1353,13 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
purBillId
=
id1
distrDetailId
=
distr_detail_main_key
distrBillId
=
distr_main_key
erpCode
=
mdm_goods_code
#
11661563
erpCode
=
mdm_goods_code
#
11661563
create_user
=
get_login_user_uxid2
()
create_time
=
get_create_time
(
"select create_time from hdi_distr_detail where id = '%s';"
%
(
distr_detail_main_key
))
last_modified
=
create_time
last_modified_user
=
create_user
last_modified
=
create_time
last_modified_user
=
create_user
if
type
==
16
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'hdi_distr_detail'
,
distr_detail_main_key
,
distr_main_key
,
source_id
,
...
...
@@ -1363,8 +1368,9 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
mfrs_id
,
expdt_date
,
product_date
,
pkg_def_id
,
supply_id
,
sub_prov_id
,
sub_prov_name
,
planBillId
,
buyDetailId
,
planDetailId
,
purDetailId
,
purBillId
,
distrDetailId
,
distrBillId
,
goods_gg
,
goods_code
,
goods_name
,
erpCode
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
20
:
distrBillId
,
goods_gg
,
goods_code
,
goods_name
,
erpCode
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
20
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'hdi_distr_detail2'
,
distr_detail_main_key
,
distr_main_key
,
source_id
,
source_detail_id
,
pur_detail_id
...
...
@@ -1374,7 +1380,7 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
buyDetailId
,
planDetailId
,
purDetailId
,
purBillId
,
distrDetailId
,
distrBillId
,
goods_gg
,
goods_code
,
goods_name
,
erpCode
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
66
:
elif
type
==
66
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'hdi_distr_detail3'
,
distr_detail_main_key
,
distr_main_key
,
source_id
,
source_detail_id
,
pur_detail_id
...
...
@@ -1385,17 +1391,89 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
distrBillId
,
goods_gg
,
goods_code
,
goods_name
,
erpCode
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected
=
None
expected
=
None
comparison_result
(
actual
,
expected
)
comparison_result
(
actual
,
expected
)
def
check_mcms_check
(
type
=
1
):
if
type
==
1
:
bill_mode
=
16
elif
type
==
2
:
bill_mode
=
20
else
:
bill_mode
=
66
print
(
'检查验收单数据库写值'
)
check_no
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'验收单号'
,
'message15'
)[
'CHECK_NO1'
]
check_no
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'验收单号'
,
'message15'
)[
'CHECK_NO1'
]
sql
=
"select * from mcms_check where id = '%s';"
%
check_no
order_no
=
get_id
(
"select order_no from mcms_check where id = '%s';"
%
check_no
)
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql
)
print
(
'actual'
,
actual
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check'
,
check_no
)
if
type
==
1
:
source_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'低值配送单号'
,
'message10'
)[
'distrBillId1'
]
elif
type
==
2
:
source_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'高值配送单号'
,
'message10'
)[
'distrBillId1'
]
else
:
source_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'试剂配送单号'
,
'message10'
)[
'distrBillId1'
]
source_no
=
source_id
prov_id
=
get_prov_id
()
prov_name
=
get_prov_name
()
rec_org_id
=
get_rec_org_id
(
2
)
rec_org_name
=
get_rec_org_name
(
2
)
dept_id
=
rec_org_id
dept_name
=
rec_org_name
branch_id
=
get_branch_id
()
buyBillId
=
get_buyBillId
(
branch_id
,
bill_mode
)
buyOrderNo
=
get_buyOrderNo
(
branch_id
,
bill_mode
)
if
type
==
1
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
elif
type
==
2
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message1'
)[
"hosGoodsId"
]
else
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
planBillId
=
get_planBillId
(
hos_goods_id
)
planOrderNo
=
get_planOrderNo
(
hos_goods_id
)
purOrderNo
=
get_purOrderNo
(
branch_id
,
bill_mode
)
purBillId
=
get_purBillId
(
branch_id
,
bill_mode
)
bill_relation_json
=
get_purBillDate
(
branch_id
,
bill_mode
)
purBillDate
=
reGetString
(
bill_relation_json
,
r
'purBillDate":"'
,
r
'""distrBillId'
)
distrBillId
=
get_distrBillId
(
branch_id
,
bill_mode
)
distrOrderNo
=
get_distrOrderNo
(
branch_id
,
bill_mode
)
checkBillId
=
check_no
checkOrderNo
=
order_no
create_user
=
get_login_user_uxid
()
sql
=
"select create_time from mcms_check where id='%s';"
%
check_no
create_time
=
get_create_time
(
sql
)
last_modified
=
create_time
last_modified_user
=
create_user
if
type
==
1
:
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
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
purBillDate
,
distrBillId
,
distrOrderNo
,
checkBillId
,
checkOrderNo
,
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_check1'
,
check_no
,
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
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
purBillDate
,
distrBillId
,
distrOrderNo
,
checkBillId
,
checkOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
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
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
purBillDate
,
distrBillId
,
distrOrderNo
,
checkBillId
,
checkOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
# 对比预期值和实际值是否一致
comparison_result
(
actual
,
expected
)
try
:
...
...
@@ -1404,8 +1482,6 @@ try:
sys
.
path
.
append
(
pro_path
+
r
'/air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air'
)
using
(
pro_path
+
r
'//air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air'
)
from
a_b4流程十一请领业务流_二级库向直送
import
goods_move2
from
a_b4流程十一请领业务流_二级库向直送
import
second_dept_Request
...
...
@@ -1447,8 +1523,10 @@ try:
# # 采购模块处理
# purchase_module_process()
#
# for i in range(3): # 三个单据共审批3次
# approval_center()
# 三个单据共审批三次
# 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', '采购计划单号高值', 'message11'))
# time.sleep(20)
# list_data = ['16', '20', '66']
# for i in list_data:
...
...
@@ -1468,16 +1546,18 @@ try:
# list_data = ['16', '20', '66']
# for i in list_data:
# check_hdi_distr(int(i))
#上面调通了
# 上面暂时注释========================================
# check_accept_order(1) # 低值
check_mcms_check
(
1
)
#调用函数检查验收单数据库写值
# check_mcms_check(1) # 调用函数检查验收单数据库写值
# 上面暂时注释========================================
check_accept_order
(
2
)
# 高值
check_accept_order
(
3
)
# 试剂
#这里验收后会自动生成入库单,批次信息,需要同步验证入库单和批次信息
#根据验收单号到mcms_psi表查询入库单
# check_accept_order(2) # 高值
# check_mcms_check(2) # 调用函数检查验收单数据库写值
# check_accept_order(3) # 试剂
check_mcms_check
(
3
)
# 调用函数检查验收单数据库写值
# 这里验收后会自动生成入库单,批次信息,需要同步验证入库单和批次信息
# 根据验收单号到mcms_psi表查询入库单
#
# check_accept_order(2) # 高值
...
...
air_case/public1/public1/public1.py
View file @
1341c47b
...
...
@@ -3483,4 +3483,20 @@ def comparison_result(actual,expected):
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
\ No newline at end of file
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
get_prov_id
():
return
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
def
get_prov_name
():
return
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
def
get_rec_org_id
(
type
=
1
):
if
type
==
1
:
return
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
elif
type
==
2
:
return
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
def
get_rec_org_name
(
type
=
1
):
if
type
==
1
:
return
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
elif
type
==
2
:
return
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
\ No newline at end of file
common/db/sql/sql_tools.py
View file @
1341c47b
import
pymysql
from
air_case.public1.public1.public1
import
*
from
common.fileUtls
import
FileUtils
...
...
@@ -245,7 +246,63 @@ def check_source_id(hos_goods_id,source_id):
return
True
else
:
return
False
def
get_buyBillId
(
branch_id
,
bill_mode
):
sql
=
"select id from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
bill_mode
)
print
(
sql
)
return
process_tuple
(
get_dept_buy_id
(
sql
))
def
get_buyOrderNo
(
branch_id
,
bill_mode
):
sql
=
"select order_no from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
bill_mode
)
print
(
sql
)
return
process_tuple
(
get_dept_buy_id
(
sql
))
def
get_purOrderNo
(
branch_id
,
bill_mode
):
sql
=
"select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
bill_mode
)
# print(sql)
id1
=
process_tuple
(
get_dept_buy_id
(
sql
))
sql
=
"select order_no from mcms_purchase where branch_id='%s' and bill_mode='%s'and id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
bill_mode
,
id1
)
print
(
sql
)
return
process_tuple
(
get_dept_buy_id
(
sql
))
def
get_purBillId
(
branch_id
,
bill_mode
):
sql
=
"select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
bill_mode
)
# print(sql)
return
process_tuple
(
get_dept_buy_id
(
sql
))
def
get_planBillId
(
hos_goods_id
):
planBillId
=
process_tuple
(
get_id
(
"select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
return
planBillId
def
get_planOrderNo
(
hos_goods_id
):
return
process_tuple
(
get_id
(
"select order_no from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
def
get_purBillDate
(
branch_id
,
bill_mode
):
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;"
%
(
branch_id
,
bill_mode
))
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;"
%
(
distr_main_key
,
bill_mode
))
# print(bill_relation_json)
return
bill_relation_json
def
get_distrBillId
(
branch_id
,
bill_mode
):
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;"
%
(
branch_id
,
bill_mode
))
return
distr_main_key
def
get_distrOrderNo
(
branch_id
,
bill_mode
):
# 查询配送单order_no
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;"
%
(
get_distrBillId
(
branch_id
,
bill_mode
),
bill_mode
))
return
distr_order_no
def
check_in_check_mcms_purchase
(
sql
):
db
,
cursor
=
get_sql_conn
()
cursor
.
execute
(
sql
)
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
1341c47b
...
...
@@ -54,4 +54,7 @@
"hdi_distr_detail3": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "60", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "4444", "expdt_date": %s, "product_date": %s, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("100.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":60,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"mcms_check": '{"id": "CHECKh03472024071800038", "order_no": "YS240718038", "bill_mode": "16", "hos_id": "h0347", "branch_id": "h0347-3755", "source_id": "PSh0347202407180060", "source_no": "PSh0347202407180060", "source_type": "PSD", "tb_status": 20, "prov_id": "p1e35e", "prov_name": "国药集团公司S57ui", "rec_org_id": "b12c7c6ca56e4b46b418b319cbadbea5", "rec_org_name": "二级检验科002", "dept_id": "b12c7c6ca56e4b46b418b319cbadbea5", "dept_name": "二级检验科002", "bill_relation_json": "{"buyBillId":"Bh03472024071800077","planBillId":"Ph034720240718029854","planOrderNo":"PLAN2024071833209","buyOrderNo":"BUY2024071809575","purOrderNo":"CG2024071821688","purBillId":"Ch034720240718000123","purBillDate":"2024-07-18 18:48:22","distrBillId":"PSh0347202407180060","distrOrderNo":"PSh0347202407180060","checkBillId":"CHECKh03472024071800038","checkOrderNo":"YS240718038"}", "create_user": "h0347_UID-051420", "create_time": datetime.datetime(2024, 7, 18, 18, 50, 20), "last_modified": datetime.datetime(2024, 7, 18, 18, 50, 20), "last_modified_user": "h0347_UID-051420", "version": 1, "initial_order": None, "remark": ""}'
\ No newline at end of file
"mcms_check": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "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": ""}'
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