Commit 37be800f authored by xiao-hesheng's avatar xiao-hesheng
Browse files

数据库验证流程十脚本编写

parent 9fc2fac2
# -*- encoding=utf8 -*- # -*- encoding=utf8 -*-
import traceback import traceback
from air_case.public1.public1.public1 import get_hosid, get_branch_id
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
...@@ -454,6 +455,59 @@ def reagent_purchase_plan(): ...@@ -454,6 +455,59 @@ def reagent_purchase_plan():
commonFuc().check_text_exist(0, result) commonFuc().check_text_exist(0, result)
else: else:
commonFuc().check_text_exist('error', result) commonFuc().check_text_exist('error', result)
def goods_move3(): # 设置请领出库渠道为中心库
# # 登录获取用户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等信息,使用创建的用户登录============结束
module = "b2_herp3_bs"
# 设置请领出库渠道为中心库
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "updateSettleType_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"))
for i in range(1, 4):
info = FileUtils().r_info8('b5_spd3_core_business_flow', "产品审核信息", 'message%s' % i)
hosGoodsId = info['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '')
branchGoodsId = SERACH_goods_id(GoodsId)
# #请求体
request_body = commonFuc().get_business_data(module, "payload47_3", branchGoodsId, hosGoodsId, get_branch_id())
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('goods_move,result', result)
def SERACH_goods_id(GoodsId):
# 在请领出库渠道边仓中搜索产品
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 main(): def main():
try: try:
# 获取低值的hosGoodsId # 获取低值的hosGoodsId
......
...@@ -284,6 +284,7 @@ json_headers2: { ...@@ -284,6 +284,7 @@ json_headers2: {
"payload46": {"queryObject": {"goodsName": "","goodsMfrsName": "","purModes": [],"hosId": "h0347","branchId": "%s","grantRule": 1,"goodsSpec": "xhs"},"pageNum": 1, "pageSize": 50} "payload46": {"queryObject": {"goodsName": "","goodsMfrsName": "","purModes": [],"hosId": "h0347","branchId": "%s","grantRule": 1,"goodsSpec": "xhs"},"pageNum": 1, "pageSize": 50}
"payload47": {"branchGoodsIds": ["%s"],"hosGoodsIds": ["%s"],"grantRule": 2,"branchId": "%s"} "payload47": {"branchGoodsIds": ["%s"],"hosGoodsIds": ["%s"],"grantRule": 2,"branchId": "%s"}
"payload47_2": {"branchGoodsIds": ["%s"],"hosGoodsIds": ["%s"],"grantRule": 3,"branchId": "%s"} "payload47_2": {"branchGoodsIds": ["%s"],"hosGoodsIds": ["%s"],"grantRule": 3,"branchId": "%s"}
"payload47_3": {"branchGoodsIds": ["%s"],"hosGoodsIds": ["%s"],"grantRule": 1,"branchId": "%s"}
"payload48": {"branchGoodsIds": ["%s"],"hosGoodsIds": ["%s"],"grantRule": 3,"branchId": "%s"} "payload48": {"branchGoodsIds": ["%s"],"hosGoodsIds": ["%s"],"grantRule": 3,"branchId": "%s"}
"payload49": {"queryObject": {"goodsName": "","provName": "","purModes": [],"hosId": "h0347","settleType": 1,"goodsSpec": "" },"pageNum": 1,"pageSize": 100} "payload49": {"queryObject": {"goodsName": "","provName": "","purModes": [],"hosId": "h0347","settleType": 1,"goodsSpec": "" },"pageNum": 1,"pageSize": 100}
......
...@@ -197,7 +197,15 @@ def main_text(): ...@@ -197,7 +197,15 @@ def main_text():
flow16() flow16()
flow17() flow17()
flow18() flow18()
def flow11_flow18():
flow11()
flow12()
flow13()
flow14()
flow15()
flow16()
flow17()
flow18()
def confirm(): def confirm():
result = tkinter.messagebox.askokcancel("确认", "您确定要执行此操作吗?") result = tkinter.messagebox.askokcancel("确认", "您确定要执行此操作吗?")
...@@ -233,7 +241,9 @@ def main_text(): ...@@ -233,7 +241,9 @@ def main_text():
Button(root, text='一键执行', anchor='center', width=8, height=2,command=flow0).grid(row=5,column=2) Button(root, text='一键执行', anchor='center', width=8, height=2,command=flow0).grid(row=5,column=2)
Button(root, text='流程五开始\n一键执行', anchor='center', width=8, height=2,command=flow5_flow18).grid(row=5,column=4) Button(root, text='流程五开始\n一键执行', anchor='center', width=8, height=2,command=flow5_flow18).grid(row=5,column=4)
Button(root, text='删除垃圾\n数据', anchor='center', width=8, height=2,command=del_data).grid(row=5,column=6) Button(root, text='删除垃圾\n数据', anchor='center', width=8, height=2,command=del_data).grid(row=5,column=6)
Button(root, text='从jenkins\n下载data\n数据', anchor='center', width=8, height=2,command=download_data).grid(row=5,column=8) Button(root, text='流程十一开始\n一键执行', anchor='center', width=8, height=2,command=flow11_flow18).grid(row=5,column=8)
Button(root, text='从jenkins\n下载data\n数据', anchor='center', width=8, height=2,command=download_data).grid(row=5,column=10)
Button(root, text='退 出', anchor='center', width=8, height=2,command=exit).grid(row=5,column=10) Button(root, text='退 出', anchor='center', width=8, height=2,command=exit).grid(row=5,column=10)
# Button(root, text='anchor', anchor='e', width=30, height=4).pack() # Button(root, text='anchor', anchor='e', width=30, height=4).pack()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment