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
ef56659b
Commit
ef56659b
authored
Sep 18, 2024
by
xiao-hesheng
Browse files
流程七脚本提交
parent
07933652
Changes
3
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_b0流程七_中心库入库结算_正负结算.air/a_b0流程七_中心库入库结算_正负结算.py
View file @
ef56659b
...
...
@@ -220,6 +220,7 @@ def center_warehouse_return():
def
main
():
try
:
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是1级库
# test1() # 提交采购计划 # 外网配送 # 内网验收入库结算
# 先查询所有的部门信息写入文件
dept_query_all
()
...
...
air_case/b6_spd3_core_business_flow_database_check/a_b0流程七_中心库入库结算_正负结算_数据库验证.air/a_b0流程七_中心库入库结算_正负结算_数据库验证.py
View file @
ef56659b
...
...
@@ -4,6 +4,7 @@ import traceback
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
air_case.public1.public1.public1
import
*
from
common.db.sql.sql_tools
import
get_id
from
common.fileUtls
import
FileUtils
from
common.run_cmd_script
import
execute_command
...
...
@@ -39,7 +40,7 @@ def check_mcms_psi_out(type=2):
branch_id
,
bill_mode
)
order_no
=
get_id
(
sql
)
target_corp_id
=
get_hosid
()
target_branch_id
=
get_branch_id
()
target_branch_id
=
None
target_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
target_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
stock_name
=
get_branch_name
()
+
"中心库房"
...
...
@@ -134,17 +135,18 @@ def check_mcms_psi_batch_out2(DR_ID, type, order_no, source_id1):
print
(
'actual'
,
actual
)
batch_main_key
=
get_id
(
"select id from mcms_psi_batch where pid='%s';"
%
DR_ID
)
pid
=
DR_ID
# order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
sql
=
"select id from mcms_psi_dept where target_branch_id='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;"
%
branch_id
source_detail_id
=
get_id
(
sql
)
source_detail_id
=
source_detail_id
+
'0001'
pick_detail_id
=
None
order_no
=
get_id
(
"select order_no from mcms_psi_batch where id='%s';"
%
batch_main_key
)
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"
]
sql
=
"select id from mcms_pick_detail where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
hos_goods_id
source_detail_id
=
get_id
(
sql
)
pick_detail_id
=
source_detail_id
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
pkg_def_id
=
get_pkg_def_id
(
hos_goods_id
)
...
...
@@ -172,7 +174,7 @@ def check_mcms_psi_batch_out2(DR_ID, type, order_no, source_id1):
last_modified_user
=
None
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_psi_batch_out_091
3
'
,
batch_main_key
,
pid
,
order_no
,
source_detail_id
'mcms_psi_batch_out_091
8
'
,
batch_main_key
,
pid
,
order_no
,
source_detail_id
,
pick_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
source_batch_id
,
target_batch_id
,
barcode_id
,
shelf_code
,
create_user
,
create_time
,
last_modified
,
last_modified_user
...
...
@@ -207,16 +209,16 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b0流程七_中心库
from
a_b0流程七_中心库入库结算_正负结算
import
center_warehouse_return
try
:
#
test1() # 提交采购计划 # 外网配送 # 内网验收入库结算
# 先查询所有的部门信息写入文件
dept_query_all
()
# 设置库房人员,根据传入的科室id和科室名称来设置库房
# 中心库type=1 二级type=2三级type=3
set_dept_user
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
],
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
],
2
)
set_dept_user
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid3'
],
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid3'
],
3
)
center_warehouse_return
()
#中心库退货
time
.
sleep
(
6
)
check_mcms_psi_out
(
1
)
#验证出库单数据
据
数据(低值)
#
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是1级库
#
# 先查询所有的部门信息写入文件
#
dept_query_all()
#
# 设置库房人员,根据传入的科室id和科室名称来设置库房
#
#
参数说明:
中心库type=1 二级
库
type=2三级
库
type=3
#
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'],2)
#
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid3'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid3'],3)
#
center_warehouse_return()#中心库退货
#
time.sleep(6)
check_mcms_psi_out
(
1
)
#验证出库单数据
库
数据(低值)
OBh_ID
=
settle
()
# 生成结算单
# print(OBh_ID)
# 调用审批结算单
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
ef56659b
...
...
@@ -346,7 +346,11 @@
"mcms_psi_dept_out_0913": '{"id":"%s","order_no":"%s","bill_mode":"25","rec_type":"YND","psi_flag":-1,"psi_kind":"203","stock_kind":"CK_TK","target_corp_id":"%s","target_branch_id":"%s","target_dept_id":"%s","target_dept_name":"%s","target_stock_id":"%s","target_area_code":"%s","target_area_name":"自动化测试","source_id":"%s","source_no":null,"source_repl_id":null,"source_corp_id":"%s","source_branch_id":"%s","source_dept_id":"%s","source_dept_name":"%s","source_stock_id":"%s","source_area_code":"%s","source_area_name":"默认库区","consume_type":0,"patient_id":null,"patient_name":null,"machine_id":null,"machine_name":null,"his_charge_no":null,"remark":null,"tb_status":40,"accounter":"%s","account_date":"%s","bill_relation_json":"{"pickOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}","create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":"%s","version":2,"last_auditor":null,"last_audit_time":null,"reject_reason":null,"reject_user":null,"reject_time":null,"initial_order":null,"source_type":"SG","target_coding_type":null}'
#跟台中心库出库子表
"mcms_psi_batch_out_0913": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":%s,"pur_mode":
2
0,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("1.00"),"unit_name":"1支","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":0,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":%s,"version":0}'
"mcms_psi_batch_out_0913": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":%s,"pur_mode":
1
0,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("1.00"),"unit_name":"1支","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":0,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":%s,"version":0}'
#跟台中心库出库主表
"check_mcms_psi_out_0913": '{"id":"%s","order_no":"%s","bill_mode":"25","rec_type":"YND","psi_flag":1,"psi_kind":"103","stock_kind":"RK_TK","target_corp_id":"%s","target_branch_id":"%s","target_dept_id":"%s","target_dept_name":"%s","target_stock_id":"%s","target_area_code":"%s","target_area_name":"自动化测试","source_id":"%s","source_no":null,"source_repl_id":null,"source_corp_id":"%s","source_branch_id":"%s","source_dept_id":"%s","source_dept_name":"%s","source_stock_id":"%s","source_area_code":"%s","source_area_name":"默认库区","remark":null,"tb_status":30,"accounter":"%s","account_date":%s,"bill_relation_json":"{"pickOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%s"}","reject_time":null,"reject_remark":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":"%s","version":1,"last_auditor":null,"last_audit_time":null,"reject_user":null,"initial_order":null,"source_type":"SG","reject_reason":null,"receipt_status":0}'
#中心库退货出库子表
"mcms_psi_batch_out_0918": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":"%s","pur_mode":10,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("1.00"),"unit_name":"100支/100","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":1,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":%s,"version":0}'
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