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

脚本优化

parent ac9c84ba
...@@ -454,45 +454,47 @@ def reagent_purchase_plan(): ...@@ -454,45 +454,47 @@ 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 main(): def main(type=1):
try: if type==1:
# 获取低值的hosGoodsId try:
hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] # 获取低值的hosGoodsId
get_GoodsPkgDef(hosGoodsId) # 获取单元包id hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
except: get_GoodsPkgDef(hosGoodsId) # 获取单元包id
print('流程五获取hosGoodsId出现错误,请检查脚本或者数据') except:
try: print('流程五获取hosGoodsId出现错误,请检查脚本或者数据')
low_vaule_purchase_plan() try:
except Exception as e: low_vaule_purchase_plan()
print('低值采购计划提交出现错误,请检查脚本或者数据') except Exception as e:
print("发生异常:", str(e)) print('低值采购计划提交出现错误,请检查脚本或者数据')
traceback.print_exc() print("发生异常:", str(e))
#审批 traceback.print_exc()
try: #审批
approval_center() try:
except Exception as e: approval_center()
print('审批采购计划出现错误,请检查脚本或者数据') except Exception as e:
print("发生异常:", str(e)) print('审批采购计划出现错误,请检查脚本或者数据')
try: print("发生异常:", str(e))
hight_vaule_purchase_plan() try:
except Exception as e: hight_vaule_purchase_plan()
print('高值采购计划出现错误,请检查脚本或者数据') except Exception as e:
print("发生异常:", str(e)) print('高值采购计划出现错误,请检查脚本或者数据')
try: print("发生异常:", str(e))
approval_center() try:
except Exception as e: approval_center()
print('审批采购计划出现错误,请检查脚本或者数据') except Exception as e:
print("发生异常:", str(e)) print('审批采购计划出现错误,请检查脚本或者数据')
try: print("发生异常:", str(e))
reagent_purchase_plan() try:
except Exception as e: reagent_purchase_plan()
print('试剂采购计划出现错误,请检查脚本或者数据') except Exception as e:
print("发生异常:", str(e)) print('试剂采购计划出现错误,请检查脚本或者数据')
try: print("发生异常:", str(e))
approval_center() try:
except Exception as e: approval_center()
print('审批采购计划出现错误,请检查脚本或者数据') except Exception as e:
print("发生异常:", str(e)) print('审批采购计划出现错误,请检查脚本或者数据')
commonFuc().check_text_exist_result_text('succees','succees') print("发生异常:", str(e))
commonFuc().check_text_exist_result_text('succees','succees')
else:
print('type=2时不执行任何内容')
main() main()
\ No newline at end of file
...@@ -307,25 +307,32 @@ def check_buyWayText(): ...@@ -307,25 +307,32 @@ def check_buyWayText():
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
try:
set_dept_lead() # 设置二级科室负责人
# 科室必须同步到外网,集中管控平台创建边仓才能选择到用户,"deptType":"0"
add_logic_stock()
# 设置产品出库渠道为边仓 def main1(type=1):
goods_move() try:
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库 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')
# # # 低值 main1()
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1) \ No newline at end of file
# # 高值
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')
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" ...@@ -17,12 +17,15 @@ __author__ = "xiaohesheng"
""" """
case_tag:api,b6_spd3_core_business_flow_database_check,a_b3流程十请领业务流_二级库向边仓,id2303,id2303-13,sit,on case_tag:api,b6_spd3_core_business_flow_database_check,a_b3流程十请领业务流_二级库向边仓,id2303,id2303-13,sit,on
核心业务流:a_b3流程十请领业务流_二级库向边仓 核心业务流: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): def check_mcms_dept_buy(type):
import pdb
pdb.set_trace()
if type==1:#低值 if type==1:#低值
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] 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_value1)
# print('actual_value2',actual_value1) # print('actual_value2',actual_value1)
actual_value2 = get_process_list2(actual_value1) actual_value2 = get_process_list2(actual_value1)
...@@ -43,32 +46,35 @@ def check_mcms_dept_buy(type): ...@@ -43,32 +46,35 @@ def check_mcms_dept_buy(type):
try: try:
set_dept_lead() # 设置二级科室负责人 # set_dept_lead() # 设置二级科室负责人
# 科室必须同步到外网,集中管控平台创建边仓才能选择到用户,"deptType":"0" # 科室必须同步到外网,集中管控平台创建边仓才能选择到用户,"deptType":"0"
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path2()
sys.path.append(pro_path + r'\\air_case\\b5_spd3_core_business_flow\\a_b3流程十请领业务流_二级库向边仓.air') print('pro_path',pro_path)
using(pro_path + r'\\air_case\\b5_spd3_core_business_flow\\a_b3流程十请领业务流_二级库向边仓.air') # sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air')
from a_b3流程十请领业务流_二级库向边仓 import add_logic_stock using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air')
from a_b3流程十请领业务流_二级库向边仓 import goods_move # from a_b3流程十请领业务流_二级库向边仓 import add_logic_stock
from a_b3流程十请领业务流_二级库向边仓 import second_dept_Request # add_logic_stock()
from a_b3流程十请领业务流_二级库向边仓 import BuyCarSubmit
from a_b3流程十请领业务流_二级库向边仓 import check_buyWayText
add_logic_stock()
# 设置产品出库渠道为边仓 # from a_b3流程十请领业务流_二级库向边仓 import goods_move
goods_move() # from a_b3流程十请领业务流_二级库向边仓 import second_dept_Request
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库 # from a_b3流程十请领业务流_二级库向边仓 import BuyCarSubmit
# # # 低值 # from a_b3流程十请领业务流_二级库向边仓 import check_buyWayText
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1) # add_logic_stock()
check_mcms_dept_buy(1) #
# # 高值 # # 设置产品出库渠道为边仓
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2) # goods_move()
# # 试剂 # updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3) # # # # 低值
BuyCarSubmit() # 请领车提交 # second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
for i in range(6): # 三个单据共审批6次 # check_mcms_dept_buy(1)
approval_center() # # # 高值
check_buyWayText()#验证出库渠道是否为边仓 # second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2)
commonFuc().check_text_exist_result_text('succees', 'succees') # # # 试剂
# 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: except:
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
...@@ -556,6 +556,14 @@ class commonFuc(object): ...@@ -556,6 +556,14 @@ class commonFuc(object):
rootPath = os.path.split(curPath)[0] rootPath = os.path.split(curPath)[0]
return rootPath 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): def getPhoto(self,chrome):
import time import time
......
二级库请领产品信息: 二级库请领产品信息:
list_a: list_a:
- &id001 - &id001
- hosGoodsId: h034700004434 - hosGoodsId: h034700004433
purMode: 60 purMode: 10
grantRule: grantRule:
id: id:
goodsName: 新型冠状病毒检测试剂)CVXH goodsName: 一次性注射器_低值7QT@(
goodsSpec: G-31891 goodsSpec: G-31891
mdmGoodsCode: '11661387' mdmGoodsCode: '11661386'
goodsCode: '00004434' goodsCode: '00004433'
unit: unit:
goodsMfrsName: 德国歌德公司 Geuder AG goodsMfrsName: 德国歌德公司 Geuder AG
miDjmc: '' miDjmc: ''
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
pkgQty: pkgQty:
qty: 700.0 qty: 700.0
goodsImg: [] goodsImg: []
pkgDefId: fa18f079634e4978a3231c4b669794e1 pkgDefId: 0cef5dc580aa4b5dbe97ce2add7cbb21
buyPkgQty: buyPkgQty:
unitName: 100支/100 unitName: 100支/100
price: 99.9999 price: 99.9999
...@@ -34,14 +34,14 @@ ...@@ -34,14 +34,14 @@
targetStockName: 东土城路院区ftZkF中心库房 targetStockName: 东土城路院区ftZkF中心库房
purchaseFlag: 1 purchaseFlag: 1
tempFlag: 0 tempFlag: 0
grantWay: 1 grantWay: 2
deptGoodsStatus: deptGoodsStatus:
codingType: 0 codingType: 0
purModeText: 检验试剂 purModeText: 低值耗材
goodsGeneralName: 检测试剂 goodsGeneralName: 一次性注射器
provName: 国药集团公司ASrWh provName: 国药集团公司ASrWh
noRecPkgQty: 3.0 noRecPkgQty: 21.0
noRecQty: 300.0 noRecQty: 2100.0
autoUnpack: 0 autoUnpack: 0
consumeQty: consumeQty:
consumePkgQty: consumePkgQty:
......
...@@ -75,9 +75,9 @@ setInterval(updateTime, 1000); // 每秒更新一次时间 ...@@ -75,9 +75,9 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
</tr> </tr>
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>8</td>
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>8</td>
<td class='details-col-elapsed'>3分2</td> <td class='details-col-elapsed'>0分3</td>
<td class="details-col-elapsed">100.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -93,9 +93,58 @@ setInterval(updateTime, 1000); // 每秒更新一次时间 ...@@ -93,9 +93,58 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
</tr> </tr>
<tr width="600"> <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="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> <td class="details-col-elapsed">xiaohesheng</td>
</tr> </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