Commit 84acaea3 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

脚本优化

parent ac9c84ba
......@@ -454,45 +454,47 @@ def reagent_purchase_plan():
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
def main():
try:
# 获取低值的hosGoodsId
hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
get_GoodsPkgDef(hosGoodsId) # 获取单元包id
except:
print('流程五获取hosGoodsId出现错误,请检查脚本或者数据')
try:
low_vaule_purchase_plan()
except Exception as e:
print('低值采购计划提交出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
traceback.print_exc()
#审批
try:
approval_center()
except Exception as e:
print('审批采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
try:
hight_vaule_purchase_plan()
except Exception as e:
print('高值采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
try:
approval_center()
except Exception as e:
print('审批采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
try:
reagent_purchase_plan()
except Exception as e:
print('试剂采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
try:
approval_center()
except Exception as e:
print('审批采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
commonFuc().check_text_exist_result_text('succees','succees')
def main(type=1):
if type==1:
try:
# 获取低值的hosGoodsId
hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
get_GoodsPkgDef(hosGoodsId) # 获取单元包id
except:
print('流程五获取hosGoodsId出现错误,请检查脚本或者数据')
try:
low_vaule_purchase_plan()
except Exception as e:
print('低值采购计划提交出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
traceback.print_exc()
#审批
try:
approval_center()
except Exception as e:
print('审批采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
try:
hight_vaule_purchase_plan()
except Exception as e:
print('高值采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
try:
approval_center()
except Exception as e:
print('审批采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
try:
reagent_purchase_plan()
except Exception as e:
print('试剂采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
try:
approval_center()
except Exception as e:
print('审批采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e))
commonFuc().check_text_exist_result_text('succees','succees')
else:
print('type=2时不执行任何内容')
main()
\ No newline at end of file
......@@ -307,25 +307,32 @@ def check_buyWayText():
commonFuc().check_text_exist_result_text('error', 'succees')
try:
set_dept_lead() # 设置二级科室负责人
# 科室必须同步到外网,集中管控平台创建边仓才能选择到用户,"deptType":"0"
add_logic_stock()
# 设置产品出库渠道为边仓
goods_move()
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
def main1(type=1):
try:
if type==1:
set_dept_lead() # 设置二级科室负责人
# 科室必须同步到外网,集中管控平台创建边仓才能选择到用户,"deptType":"0"
add_logic_stock()
# 设置产品出库渠道为边仓
goods_move()
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
# # # 低值
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", "产品审核信息", 'message1')['hosGoodsId'], 2)
# # 试剂
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
BuyCarSubmit() # 请领车提交
for i in range(6): # 三个单据共审批6次
approval_center()
check_buyWayText()#验证出库渠道是否为边仓
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('aa')
except:
commonFuc().check_text_exist_result_text('error', 'succees')
# # # 低值
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", "产品审核信息", 'message1')['hosGoodsId'], 2)
# # 试剂
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
BuyCarSubmit() # 请领车提交
for i in range(6): # 三个单据共审批6次
approval_center()
check_buyWayText()#验证出库渠道是否为边仓
commonFuc().check_text_exist_result_text('succees', 'succees')
except:
commonFuc().check_text_exist_result_text('error', 'succees')
main1()
\ No newline at end of file
import json
import traceback
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from air_case.public1.public1.public1 import *
from common.db.sql.sql_del_branch_info import delData
from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command
from common.timeUtils import timeUtils
from airtest.core.api import using
from common.db.sql.sql_tools import *
__author__ = "xiaohesheng"
"""
case_tag:api,spd_core,,id2302,id2302-22,sit,on
python runner_test.py tag id2302-22 debug mdm3
"""
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_a1_流程一外网企业注册审批.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a1_流程一外网企业注册审批.air')
from a_a1_流程一外网企业注册审批 import test1
test1()
commonFuc().check_text_exist_result_text('succees','succees')
except:
commonFuc().check_text_exist_result_text('error','succees')
\ No newline at end of file
......@@ -17,12 +17,15 @@ __author__ = "xiaohesheng"
"""
case_tag:api,b6_spd3_core_business_flow_database_check,a_b3流程十请领业务流_二级库向边仓,id2303,id2303-13,sit,on
核心业务流:a_b3流程十请领业务流_二级库向边仓
python runner_test.py tag id2302-13 debug mdm3
python runner_test.py tag id2303-13 debug mdm3
"""
def check_mcms_dept_buy(type):
import pdb
pdb.set_trace()
if type==1:#低值
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
actual_value1 = tools_check_mcms_dept_buy(hos_goods_id)
branch_id=get_branch_id()
actual_value1 = tools_check_mcms_dept_buy(branch_id,hos_goods_id)
print(actual_value1)
# print('actual_value2',actual_value1)
actual_value2 = get_process_list2(actual_value1)
......@@ -43,32 +46,35 @@ def check_mcms_dept_buy(type):
try:
set_dept_lead() # 设置二级科室负责人
# set_dept_lead() # 设置二级科室负责人
# 科室必须同步到外网,集中管控平台创建边仓才能选择到用户,"deptType":"0"
pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b5_spd3_core_business_flow\\a_b3流程十请领业务流_二级库向边仓.air')
using(pro_path + r'\\air_case\\b5_spd3_core_business_flow\\a_b3流程十请领业务流_二级库向边仓.air')
from a_b3流程十请领业务流_二级库向边仓 import add_logic_stock
from a_b3流程十请领业务流_二级库向边仓 import goods_move
from a_b3流程十请领业务流_二级库向边仓 import second_dept_Request
from a_b3流程十请领业务流_二级库向边仓 import BuyCarSubmit
from a_b3流程十请领业务流_二级库向边仓 import check_buyWayText
add_logic_stock()
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_b3流程十请领业务流_二级库向边仓.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air')
# from a_b3流程十请领业务流_二级库向边仓 import add_logic_stock
# add_logic_stock()
# 设置产品出库渠道为边仓
goods_move()
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
# # # 低值
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
check_mcms_dept_buy(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", "产品审核信息", 'message3')['hosGoodsId'], 3)
BuyCarSubmit() # 请领车提交
for i in range(6): # 三个单据共审批6次
approval_center()
check_buyWayText()#验证出库渠道是否为边仓
commonFuc().check_text_exist_result_text('succees', 'succees')
# from a_b3流程十请领业务流_二级库向边仓 import goods_move
# from a_b3流程十请领业务流_二级库向边仓 import second_dept_Request
# from a_b3流程十请领业务流_二级库向边仓 import BuyCarSubmit
# from a_b3流程十请领业务流_二级库向边仓 import check_buyWayText
# add_logic_stock()
#
# # 设置产品出库渠道为边仓
# goods_move()
# updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
# # # # 低值
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
# check_mcms_dept_buy(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", "产品审核信息", 'message3')['hosGoodsId'], 3)
# BuyCarSubmit() # 请领车提交
# for i in range(6): # 三个单据共审批6次
# approval_center()
# check_buyWayText()#验证出库渠道是否为边仓
# commonFuc().check_text_exist_result_text('succees', 'succees')
except:
commonFuc().check_text_exist_result_text('error', 'succees')
......@@ -556,6 +556,14 @@ class commonFuc(object):
rootPath = os.path.split(curPath)[0]
return rootPath
# 获取当前项目的根目录的路径2
def get_pro_path2(self):
import os
curPath = os.path.abspath(os.path.dirname(__file__)) # 获取当前文件的所在目录的绝对路径
# print(os.path.split(curPath))
rootPath = os.path.split(curPath)[0]
rootPath1=rootPath.replace('\\','/')
return rootPath1
# 截图
def getPhoto(self,chrome):
import time
......
二级库请领产品信息:
list_a:
- &id001
- hosGoodsId: h034700004434
purMode: 60
- hosGoodsId: h034700004433
purMode: 10
grantRule:
id:
goodsName: 新型冠状病毒检测试剂)CVXH
goodsName: 一次性注射器_低值7QT@(
goodsSpec: G-31891
mdmGoodsCode: '11661387'
goodsCode: '00004434'
mdmGoodsCode: '11661386'
goodsCode: '00004433'
unit:
goodsMfrsName: 德国歌德公司 Geuder AG
miDjmc: ''
......@@ -18,7 +18,7 @@
pkgQty:
qty: 700.0
goodsImg: []
pkgDefId: fa18f079634e4978a3231c4b669794e1
pkgDefId: 0cef5dc580aa4b5dbe97ce2add7cbb21
buyPkgQty:
unitName: 100支/100
price: 99.9999
......@@ -34,14 +34,14 @@
targetStockName: 东土城路院区ftZkF中心库房
purchaseFlag: 1
tempFlag: 0
grantWay: 1
grantWay: 2
deptGoodsStatus:
codingType: 0
purModeText: 检验试剂
goodsGeneralName: 检测试剂
purModeText: 低值耗材
goodsGeneralName: 一次性注射器
provName: 国药集团公司ASrWh
noRecPkgQty: 3.0
noRecQty: 300.0
noRecPkgQty: 21.0
noRecQty: 2100.0
autoUnpack: 0
consumeQty:
consumePkgQty:
......
......@@ -75,9 +75,9 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
</tr>
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>3分2</td>
<td class='details-col-elapsed'>8</td>
<td class='details-col-elapsed'>8</td>
<td class='details-col-elapsed'>0分3</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -93,9 +93,58 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_b2流程九请领业务流_二级库向中心库_数据库验证/log.html' target='_blank'>a_b2流程九请领业务流_二级库向中心库_数据库验证</a></td>
<td class="details-col-elapsed"><a href='../log/器械注册人_企业注册提交_正常注册_境内/log.html' target='_blank'>器械注册人_企业注册提交_正常注册_境内</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">182.364</td>
<td class="details-col-elapsed">0.626</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/外网企业注册-器械注册人-所有输入项填写/log.html' target='_blank'>外网企业注册-器械注册人-所有输入项填写</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.379</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/外网企业注册-器械注册人-有附件/log.html' target='_blank'>外网企业注册-器械注册人-有附件</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.344</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/外网企业注册-器械注册人/log.html' target='_blank'>外网企业注册-器械注册人</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.385</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/外网企业注册提交接口_正常注册/log.html' target='_blank'>外网企业注册提交接口_正常注册</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.331</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/外网企业注册提交接口_注册企业已存在/log.html' target='_blank'>外网企业注册提交接口_注册企业已存在</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.372</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/生产厂商_企业注册提交_正常注册/log.html' target='_blank'>生产厂商_企业注册提交_正常注册</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.329</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/经销商_企业注册提交_正常注册/log.html' target='_blank'>经销商_企业注册提交_正常注册</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.327</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
......
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