Commit b2f1bc0c authored by xiao-hesheng's avatar xiao-hesheng
Browse files

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

parent 900e3a85
...@@ -4,6 +4,7 @@ import traceback ...@@ -4,6 +4,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_tools import get_id, process_tuple
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
...@@ -46,7 +47,9 @@ def second_dept_Request(hosGoodsId, type): ...@@ -46,7 +47,9 @@ def second_dept_Request(hosGoodsId, type):
# 高值 # 高值
# hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'] # hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '') GoodsId = hosGoodsId.replace(get_hosid(), '')
areaCode = get_stockAreaId_new(deptid2, deptname2, 2) # areaCode = get_stockAreaId_new(deptid2, deptname2, 2)
areaCode =process_tuple(get_id("select shelf_code from mcms_stock_shelf where address='二级检验科002'and shelf_name='默认库区'order by create_time desc LIMIT 1;"))
request_body = commonFuc().get_business_data(module, "payload39", GoodsId, get_hosid(), deptid2, areaCode) request_body = commonFuc().get_business_data(module, "payload39", GoodsId, get_hosid(), deptid2, areaCode)
print('我要请领_手工请领_列表查询', 'request_body', request_body) print('我要请领_手工请领_列表查询', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
...@@ -72,6 +75,7 @@ def second_dept_Request(hosGoodsId, type): ...@@ -72,6 +75,7 @@ def second_dept_Request(hosGoodsId, type):
goodsGeneralName = commonFuc().analysis_json('goodsGeneralName', data1) goodsGeneralName = commonFuc().analysis_json('goodsGeneralName', data1)
provName = commonFuc().analysis_json('provName', data1) provName = commonFuc().analysis_json('provName', data1)
pkgDefId = commonFuc().analysis_json('pkgDefId', data1) pkgDefId = commonFuc().analysis_json('pkgDefId', data1)
pkgDefName= commonFuc().analysis_json('pkgDefName', data1)
# 信息写入文件 # 信息写入文件
list_a = [] list_a = []
list_b = [] list_b = []
...@@ -88,27 +92,50 @@ def second_dept_Request(hosGoodsId, type): ...@@ -88,27 +92,50 @@ def second_dept_Request(hosGoodsId, type):
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_buy_createBuyCar_url") "herpService_buy_createBuyCar_url")
print('添加到请领车=================', url) print('添加到请领车=================', url)
# if type == 1:
# request_body = commonFuc().get_business_data(module, "payload40", hosGoodsId, goodsName, goodsSpec,
# mdmGoodsCode,
# goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price,
# deptId,
# areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
# targetStockName, purModeText, goodsGeneralName, provName)
# elif type == 2:
# request_body = commonFuc().get_business_data(module, "payload41", hosGoodsId, goodsName, goodsSpec,
# mdmGoodsCode,
# goodsCode, unit, purMode, goodsMfrsName, unitName, price, deptId,
# areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
# targetStockName, purModeText, goodsGeneralName, provName)
# elif type == 3:
# request_body = commonFuc().get_business_data(module, "payload42", hosGoodsId, goodsName, goodsSpec,
# mdmGoodsCode,
# goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price,
# deptId,
# areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
# targetStockName, purModeText, goodsGeneralName, provName)
#
# request_body = get_process_list(request_body)
if type == 1: if type == 1:
request_body = commonFuc().get_business_data(module, "payload40", hosGoodsId, goodsName, goodsSpec, request_body = commonFuc().get_business_data(module, "payload40", hosGoodsId, purMode, goodsName, goodsSpec,
mdmGoodsCode, mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price, goodsCode, unit, goodsMfrsName, pkgDefName, pkgDefId, unitName,
price,
deptId, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId, areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName) targetStockName, purModeText, goodsGeneralName, provName)
elif type == 2: elif type == 2:
request_body = commonFuc().get_business_data(module, "payload41", hosGoodsId, goodsName, goodsSpec, request_body = commonFuc().get_business_data(module, "payload41", hosGoodsId, purMode, goodsName, goodsSpec,
mdmGoodsCode, mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, unitName, price, deptId, goodsCode, unit, goodsMfrsName, unitName, price, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId, areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName) targetStockName, purModeText, goodsGeneralName, provName)
elif type == 3: elif type == 3:
request_body = commonFuc().get_business_data(module, "payload42", hosGoodsId, goodsName, goodsSpec, request_body = commonFuc().get_business_data(module, "payload42", hosGoodsId, purMode, goodsName, goodsSpec,
mdmGoodsCode, mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price, goodsCode, unit, goodsMfrsName, pkgDefName, pkgDefId, unitName,
price,
deptId, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId, areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName) targetStockName, purModeText, goodsGeneralName, provName)
request_body = get_process_list(request_body) request_body = get_process_list(request_body)
print('添加到请领车', 'request_body', request_body) print('添加到请领车', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
......
...@@ -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 process_tuple, get_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
...@@ -99,7 +100,9 @@ def second_dept_Request(hosGoodsId, type): ...@@ -99,7 +100,9 @@ def second_dept_Request(hosGoodsId, type):
# 高值 # 高值
# hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'] # hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '') GoodsId = hosGoodsId.replace(get_hosid(), '')
areaCode = get_stockAreaId_new(deptid2, deptname2, 2) # areaCode = get_stockAreaId_new(deptid2, deptname2, 2)
areaCode =process_tuple(get_id("select shelf_code from mcms_stock_shelf where address='二级检验科002'and shelf_name='默认库区'order by create_time desc LIMIT 1;"))
request_body = commonFuc().get_business_data(module, "payload39", GoodsId, get_hosid(), deptid2, areaCode) request_body = commonFuc().get_business_data(module, "payload39", GoodsId, get_hosid(), deptid2, areaCode)
print('我要请领_手工请领_列表查询', 'request_body', request_body) print('我要请领_手工请领_列表查询', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
...@@ -125,6 +128,7 @@ def second_dept_Request(hosGoodsId, type): ...@@ -125,6 +128,7 @@ def second_dept_Request(hosGoodsId, type):
goodsGeneralName = commonFuc().analysis_json('goodsGeneralName', data1) goodsGeneralName = commonFuc().analysis_json('goodsGeneralName', data1)
provName = commonFuc().analysis_json('provName', data1) provName = commonFuc().analysis_json('provName', data1)
pkgDefId = commonFuc().analysis_json('pkgDefId', data1) pkgDefId = commonFuc().analysis_json('pkgDefId', data1)
pkgDefName= commonFuc().analysis_json('pkgDefName', data1)
# 信息写入文件 # 信息写入文件
list_a = [] list_a = []
list_b = [] list_b = []
...@@ -142,22 +146,24 @@ def second_dept_Request(hosGoodsId, type): ...@@ -142,22 +146,24 @@ def second_dept_Request(hosGoodsId, type):
"herpService_buy_createBuyCar_url") "herpService_buy_createBuyCar_url")
print('添加到请领车=================', url) print('添加到请领车=================', url)
if type == 1: if type == 1:
request_body = commonFuc().get_business_data(module, "payload40", hosGoodsId, goodsName, goodsSpec, request_body = commonFuc().get_business_data(module, "payload40", hosGoodsId, purMode, goodsName, goodsSpec,
mdmGoodsCode, mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price, goodsCode, unit, goodsMfrsName, pkgDefName, pkgDefId, unitName,
price,
deptId, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId, areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName) targetStockName, purModeText, goodsGeneralName, provName)
elif type == 2: elif type == 2:
request_body = commonFuc().get_business_data(module, "payload41", hosGoodsId, goodsName, goodsSpec, request_body = commonFuc().get_business_data(module, "payload41", hosGoodsId, purMode, goodsName, goodsSpec,
mdmGoodsCode, mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, unitName, price, deptId, goodsCode, unit, goodsMfrsName, unitName, price, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId, areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName) targetStockName, purModeText, goodsGeneralName, provName)
elif type == 3: elif type == 3:
request_body = commonFuc().get_business_data(module, "payload42", hosGoodsId, goodsName, goodsSpec, request_body = commonFuc().get_business_data(module, "payload42", hosGoodsId, purMode, goodsName, goodsSpec,
mdmGoodsCode, mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price, goodsCode, unit, goodsMfrsName, pkgDefName, pkgDefId, unitName,
price,
deptId, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId, areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName) targetStockName, purModeText, goodsGeneralName, provName)
......
...@@ -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 process_tuple, get_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
...@@ -100,7 +101,8 @@ def second_dept_Request(hosGoodsId, type): ...@@ -100,7 +101,8 @@ def second_dept_Request(hosGoodsId, type):
# 高值 # 高值
# hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'] # hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '') GoodsId = hosGoodsId.replace(get_hosid(), '')
areaCode = get_stockAreaId_new(deptid2, deptname2, 2) # areaCode = get_stockAreaId_new(deptid2, deptname2, 2)
areaCode =process_tuple(get_id("select shelf_code from mcms_stock_shelf where address='二级检验科002'and shelf_name='默认库区'order by create_time desc LIMIT 1;"))
request_body = commonFuc().get_business_data(module, "payload39", GoodsId, get_hosid(), deptid2, areaCode) request_body = commonFuc().get_business_data(module, "payload39", GoodsId, get_hosid(), deptid2, areaCode)
print('我要请领_手工请领_列表查询', 'request_body', request_body) print('我要请领_手工请领_列表查询', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
...@@ -126,6 +128,7 @@ def second_dept_Request(hosGoodsId, type): ...@@ -126,6 +128,7 @@ def second_dept_Request(hosGoodsId, type):
goodsGeneralName = commonFuc().analysis_json('goodsGeneralName', data1) goodsGeneralName = commonFuc().analysis_json('goodsGeneralName', data1)
provName = commonFuc().analysis_json('provName', data1) provName = commonFuc().analysis_json('provName', data1)
pkgDefId = commonFuc().analysis_json('pkgDefId', data1) pkgDefId = commonFuc().analysis_json('pkgDefId', data1)
pkgDefName= commonFuc().analysis_json('pkgDefName', data1)
# 信息写入文件 # 信息写入文件
list_a = [] list_a = []
list_b = [] list_b = []
...@@ -143,22 +146,24 @@ def second_dept_Request(hosGoodsId, type): ...@@ -143,22 +146,24 @@ def second_dept_Request(hosGoodsId, type):
"herpService_buy_createBuyCar_url") "herpService_buy_createBuyCar_url")
print('添加到请领车=================', url) print('添加到请领车=================', url)
if type == 1: if type == 1:
request_body = commonFuc().get_business_data(module, "payload40", hosGoodsId, goodsName, goodsSpec, request_body = commonFuc().get_business_data(module, "payload40", hosGoodsId, purMode, goodsName, goodsSpec,
mdmGoodsCode, mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price, goodsCode, unit, goodsMfrsName, pkgDefName, pkgDefId, unitName,
price,
deptId, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId, areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName) targetStockName, purModeText, goodsGeneralName, provName)
elif type == 2: elif type == 2:
request_body = commonFuc().get_business_data(module, "payload41", hosGoodsId, goodsName, goodsSpec, request_body = commonFuc().get_business_data(module, "payload41", hosGoodsId, purMode, goodsName, goodsSpec,
mdmGoodsCode, mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, unitName, price, deptId, goodsCode, unit, goodsMfrsName, unitName, price, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId, areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName) targetStockName, purModeText, goodsGeneralName, provName)
elif type == 3: elif type == 3:
request_body = commonFuc().get_business_data(module, "payload42", hosGoodsId, goodsName, goodsSpec, request_body = commonFuc().get_business_data(module, "payload42", hosGoodsId, purMode, goodsName, goodsSpec,
mdmGoodsCode, mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price, goodsCode, unit, goodsMfrsName, pkgDefName, pkgDefId, unitName,
price,
deptId, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId, areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName) targetStockName, purModeText, goodsGeneralName, provName)
...@@ -835,7 +840,7 @@ def main(): ...@@ -835,7 +840,7 @@ def main():
# 从下面开始,上面的暂时注释 # 从下面开始,上面的暂时注释
goods_move2() # 设置产品出库渠道为直送 goods_move2() # 设置产品出库渠道为直送
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
for i in range(1): for i in range(6):
# # 低值 # # 低值
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)
# # 高值 # # 高值
......
...@@ -139,19 +139,20 @@ def second_dept_Request(hosGoodsId, type): ...@@ -139,19 +139,20 @@ def second_dept_Request(hosGoodsId, type):
print('添加到请领车', 'request_body', request_body) print('添加到请领车', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('添加到请领车,result', result) print('添加到请领车,result', result)
return token
# 添加到请领车============================================= # 添加到请领车=============================================
def BuyCarSubmit(): def BuyCarSubmit(token):
module = "b5_spd3_core_business_flow" module = "b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始 # # # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') # info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
username = info['username1'] # username = info['username1']
password = commonFuc().get_business_data("b2_herp3_bs", "password") # password = commonFuc().get_business_data("b2_herp3_bs", "password")
print('username,password', username, password) # print('username,password', username, password)
# # 获取token和projectCode # # # 获取token和projectCode
token, projectCode, uxid, corpId, info = login(username, password, 2) # token, projectCode, uxid, corpId, info = login(username, password, 2)
# 登录获取用户id等信息,使用创建的用户登录============结束 # # 登录获取用户id等信息,使用创建的用户登录============结束
# 我要请领_手工请领_列表查询=========================== # 我要请领_手工请领_列表查询===========================
headers = commonFuc().get_business_data(module, "json_headers2", headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token, commonFuc().get_business_data(module, "json_contentType"), token,
...@@ -189,6 +190,17 @@ def BuyCarSubmit(): ...@@ -189,6 +190,17 @@ def BuyCarSubmit():
print('请领车提交,result', result) print('请领车提交,result', result)
# 请领车提交=============================================== # 请领车提交===============================================
# 创建领车交易================================================= # 创建领车交易=================================================
# url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
# "herpService_validBuyCarSubmit_url")
# print('创建领车交易=================', url)
#
# billExpdtDate = timeUtils().get_time_add(30, 2)
# 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('validBuyCarSubmit', 'request_body', request_body)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_buy_createBuyBill_url") "herpService_buy_createBuyBill_url")
print('创建领车交易=================', url) print('创建领车交易=================', url)
...@@ -433,8 +445,8 @@ def main(): ...@@ -433,8 +445,8 @@ def main():
# # # 高值 # # # 高值
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)
# # # 试剂 # # # 试剂
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3) token=second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
BuyCarSubmit() # 请领车提交 BuyCarSubmit(token) # 请领车提交
for i in range(6): # 三个单据共审批6次 for i in range(6): # 三个单据共审批6次
approval_center() approval_center()
updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库
......
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