Commit 664a2eaf authored by xiao-hesheng's avatar xiao-hesheng
Browse files

流程七脚本编写

parent 45205b44
# -*- encoding=utf8 -*-
import json
import traceback
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from air_case.public1.public1.public1 import *
from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command
from common.timeUtils import timeUtils
from airtest.core.api import using
__author__ = "xiaohesheng"
"""
case_tag:api,spd_core,a_b1流程八_高值跟台业务流程,id2302,id2302-11,sit,on
主数据平台:a_b1流程八_高值跟台业务流程
python runner_test.py tag id2302-11 debug mdm3
"""
def operationApply(): # 高值跟台申请
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等信息,使用创建的用户登录============结束
# 跟台手术申请,列表查询=========
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_operationApply_listPage_url")
print('url', 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"))
request_body = commonFuc().get_business_data(module, "payload22", corpId, corpId)
print('request_body', 'ccccccc', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 跟台手术申请,列表查询=============
# 跟台手术申请提交============
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_operationApply_submit_url")
print('url', url)
stockAreaId = get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],
FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'], 2)
expireDate = timeUtils.get_time_add(1, 2)
operDate = timeUtils.get_time_add(1, 2)
# 从文件中获取必要信息
info = FileUtils().r_info8(module, "产品信息", 'message19')
# print('info', info)
list_a = info['list_a']
print('list_a', type(list_a), len(list_a))
provId = commonFuc().analysis_json('provId', list_a)
provCode = provId
provName = commonFuc().analysis_json('provName', list_a)
hosGoodsId = commonFuc().analysis_json('hosGoodsId', list_a)
hosGoodsCode = commonFuc().analysis_json('hosGoodsCode', list_a)
subProvId = commonFuc().analysis_json('subProvId', list_a)
subProvName = commonFuc().analysis_json('subProvName', list_a)
goodsName = commonFuc().analysis_json('goodsName', list_a)
goodsSpec= commonFuc().analysis_json('goodsSpec', list_a)
goodsMfrsId= commonFuc().analysis_json('goodsMfrsId', list_a)
goodsMfrsName= commonFuc().analysis_json('goodsMfrsName', list_a)
unit= commonFuc().analysis_json('unit', list_a)
price= commonFuc().analysis_json('price', list_a)
request_body = commonFuc().get_business_data(module, "payload24", stockAreaId, expireDate, operDate, provId,
provCode, provName, hosGoodsId, hosGoodsCode, provId, subProvId,
subProvName, goodsName,goodsSpec,goodsMfrsId,goodsMfrsName,unit,price)
result = commonFuc().http_post(url, request_body, headers)
print('跟台手术申请提交result', result)
# 跟台手术申请提交============
try:
set_dept_lead()#设置科室负责人
# 设置默认科室,切换到二级科室,使用科室管理功能
updateUserLoginDefaultRange(get_listUserMgrRangePage(2))
# get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'],2)
herpService_mcmsDeptGoodsInfo_getByProvIdPage()
operationApply()
approval_center()
updateUserLoginDefaultRange(get_listUserMgrRangePage(1))
approval_center()
#内网查询手术通知单号
orderno=Search_OrderNO()
# height_value_order_dp(orderno)
commonFuc().check_text_exist_result_text('succeed', 'succeed')
except:
commonFuc().check_text_exist_result_text('error', '1')
......@@ -1119,7 +1119,7 @@ def updateUserLoginDefaultRange(roleid):
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,
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data('b5_spd3_core_business_flow',
"platformService_updateUserLoginDefaultRange_url")
url = url + roleid
print(url)
......@@ -1140,10 +1140,10 @@ def get_listUserMgrRangePage(type=1): # 查询权限id
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,
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data('b5_spd3_core_business_flow',
"platformService_listUserMgrRangePage_url")
request_body = commonFuc().get_business_data('b2_herp3_bs', "payload66", uxid)
request_body = commonFuc().get_business_data('b5_spd3_core_business_flow', "payload23", uxid)
result = commonFuc().http_post(url, request_body, headers)
data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))
if type == 1:
......
企业信息:
e_id: CR202404300135
cname: 国药集团公司3Et(V
e_id: CR202404300166
cname: 国药集团公司&7H!M
医院信息:
h_id: 湖南省人民医院0@OKR
h_name: 湖南省人民医院0@OKR
h_id: 湖南省人民医院h0dXo
h_name: 湖南省人民医院h0dXo
产品审核信息:
MSPid: MSP2404300036_1
MSPid: MSP2404300041_1
hosId: h0347
hosGoodsId: h034700003290
provGoodsid: provGood-99220399
goodsAuditBillId: MSP2404300036
targetId: MSP2404300036_1
hosGoodsId: h034700003295
provGoodsid: provGood-99220404
goodsAuditBillId: MSP2404300041
targetId: MSP2404300041_1
院区新增:
branch_id: h0347-3553
branch_name: 东土城路院区n3&rd
branch_id: h0347-3554
branch_name: 东土城路院区szT8i
科室信息:
dept2_id: 81537101bb3b49848877bcf17ac603bc
dept2_id: 220fcaa711924c4da079b76cb9b74e17
dept2_name: 二级检验科002
......@@ -18,6 +18,11 @@
"herpService_stock_hdiBarcode_scan_url": "/api/herpService/stock/hdiBarcode/scan/"
"herpService_stock_review_pass_submit_url": "/api/herpService/stock/out/review/pass/submit"
"herpService_mcmsOutBalance_listVoPage_url": "/api/herpService/mcmsOutBalance/listVoPage"
"platformService_listUserMgrRangePage_url": "/api/herpService/mcmsOutBalance/listVoPage"
"platformService_updateUserLoginDefaultRange_url": "/api/platformService/userOnline/updateUserLoginDefaultRange/"
"herpService_mcmsDeptGoodsInfo_getByProvIdPage_url": "/api/herpService/basic/mcmsDeptGoodsInfo/getByProvIdPage"
"herpService_operationApply_listPage_url": "/api/herpService/operationApply/listPage"
"herpService_operationApply_submit_url": "/api/herpService/operationApply/submit"
"username": "xhs1009"
......@@ -55,4 +60,7 @@ json_headers2: {
"payload19": {"areaCode":"%s","reasonKind":"1","remark":"","barCodeList":[{"id":"%s","lastModified":null,"version":null,"createTime":"%s","createUser":null,"lastModifiedUser":null,"snCode":"%s","hosId":"%s","branchId":null,"stockId":"%s","areaCode":"%s","areaName":"%s","shelfCode":"%s","codeType":"%s","tagType":"%s","hosGoodsId":"%s","mdmGoodsCode":"%s","goodsCode":"%s","goodsDi":"%s","barName":"%s","batchCode":"%s","expdtDate":"%s","productDate":"%s","mfrCode":null,"mfrCodeSee":null,"pkgCode":"%s","pkgCodeSee":"%s","ssccCode":"%s","extInfo":null,"outId":null,"tbStatus":"%s","ext":{"distrDetailId":"%s","distrBillId":"%s","certificateCode":"","purBillId":"%s","pkgDefQty":"%s","pkgDefId":"%s","pkgDefName":"%s"},"sourceDetailId":null,"purMode":"%s","purModes":null,"price":null,"pid":null,"goodsMfrsName":"%s","mfrsName":null,"goodsSpec":"%s","unit":"%s","goodsName":"%s","pkgDefId":"%s","pkgDefQty":"%s","purDetailId":null,"pkgDefName":"%s","printNum":"%s","deptId":null,"deptName":null,"billId":null,"taskId":null,"made":"%s","provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","provHosGoodsId":null,"sourceType":null,"taskDate":null,"sourceOrderNo":null,"taskType":null,"detailId":null,"branchGoodsPkgDefList":null,"unitName":null,"areaCodeList":null,"diType":null,"mdmGoodsSpecCode":null,"hosGoodsCode":"%s","supplyId":null,"inSettlement":null,"spdGoodsCode":null,"codeKind":null,"brand":null,"miCode":null,"transferRatio":1,"miDjmc":null,"tbStatusList":null,"purModeText":null,"stockName":null,"tbStatusText":null,"pkgType":null,"bottleId":null,"pkgStatus":null,"qty":null,"packUnit":null,"minSaleQty":null,"rfidFlag":null,"mfrCodeFlag":null,"scanStatus":null,"scanId":null,"multiChargeFlag":null,"useFrequency":null,"chargeUnit":null,"lockStatus":null,"subSendFlag":"%s","onlyKey":"%s2fa9d44bf3b443f184ea457066259ee13332024-11-02100p1e171p1e171"}],"areaName":"%s","hosId":"%s","branchId":"%s","deptId":"%s","deptName":"%s","stockId":"%s","pickType":"TH"}
"payload20": {"pageNum":1,"pageSize":50,"orderBy":"pick.priority desc, pick.create_time desc","queryObject":{"billMode":"","pickerName":"","orderNo":"","sourceId":"","targetDeptName":"","priorityList":[],"branchId":"%s","hosId":"%s","deptId":"%s","tbStatus":30,"permission":true}}
"payload21": {"batchList":[{"id":"%s","lastModified":null,"version":null,"createTime":"%s","createUser":null,"lastModifiedUser":null,"snCode":"%s","hosId":"%s","branchId":null,"stockId":"%s","areaCode":"%s","areaName":"%s","shelfCode":"%s","codeType":"%s","tagType":"%s","hosGoodsId":"%s","mdmGoodsCode":"%s","goodsCode":"%s","goodsDi":"%s","barName":"%s","batchCode":"%s","expdtDate":"%s","productDate":"%s","mfrCode":null,"mfrCodeSee":null,"pkgCode":"%s","pkgCodeSee":"%s","ssccCode":"%s","extInfo":null,"outId":null,"tbStatus":"%s","ext":{"distrDetailId":"%s","distrBillId":"%s","certificateCode":"","purBillId":"%s","pkgDefQty":"%s","pkgDefId":"%s","pkgDefName":"%s"},"sourceDetailId":null,"purMode":"%s","purModes":null,"price":null,"pid":null,"goodsMfrsName":"%s","mfrsName":null,"goodsSpec":"%s","unit":"%s","goodsName":"%s","pkgDefId":"%s","pkgDefQty":"%s","purDetailId":null,"pkgDefName":"%s","printNum":0,"deptId":null,"deptName":null,"billId":null,"taskId":null,"made":"%s","provId":null,"provName":null,"subProvId":null,"subProvName":null,"provHosGoodsId":null,"sourceType":null,"taskDate":null,"sourceOrderNo":null,"taskType":null,"detailId":null,"branchGoodsPkgDefList":null,"unitName":null,"areaCodeList":null,"diType":null,"mdmGoodsSpecCode":null,"hosGoodsCode":"%s","supplyId":null,"inSettlement":null,"spdGoodsCode":null,"codeKind":null,"brand":null,"miCode":null,"transferRatio":1,"miDjmc":null,"tbStatusList":null,"purModeText":null,"stockName":null,"tbStatusText":null,"pkgType":null,"bottleId":null,"pkgStatus":null,"qty":null,"packUnit":null,"minSaleQty":null,"rfidFlag":null,"mfrCodeFlag":null,"scanStatus":null,"scanId":null,"multiChargeFlag":null,"useFrequency":null,"chargeUnit":null,"lockStatus":null}],"sourceId":"%s","sourceType":"TH","sourceVersion":"0","remark":"","reviewAll":0}
"payload22": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","settleMonth":"","hosId":"%s"},"hosId":"%s"}
\ No newline at end of file
"payload22": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","settleMonth":"","hosId":"%s"},"hosId":"%s"}
"payload23": {"pageNum":1,"pageSize":50,"queryObject":{"userId":"%s","keyword":""}}
"payload25": {"pageNum":1,"pageSize":50,"queryObject":{"subProvName":"","goodsName":"%s","goodsSpec":"","provId":"%s"}}
"payload24": {"recAddressId":"%s","expireDate":"%s 14:03:47","remark":"自动化测试","patientInHosId":"123456","patientName":"张三","sex":1,"age":44,"operName":"血管扩张术","operDoctor":"李四","operDate":"%s 14:04:13","bedNum":"2","oprationHouse":"设备科一手术间","surDeptName":"","recAddress":"默认库区","provGoodsVOList":[{"id":null,"lastModified":null,"version":null,"createTime":null,"createUser":null,"lastModifiedUser":null,"hosId":null,"provId":"%s","subProvId":null,"clientType":null,"invitationCode":null,"contactWay":null,"contactUser":null,"tbStatus":null,"activeFlag":null,"auditor":null,"auditTime":null,"auditComment":null,"provCode":"%s","provName":"%s","subProvName":null,"goodsVOList":[{"hosGoodsId":"%s","hosGoodsCode":"%s","provId":"%s","subProvId":"%s","subProvName":"%s","goodsName":"%s","goodsSpec":"%s","goodsGeneralName":null,"goodsMfrsId":"%s","goodsMfrsName":"%s","unit":"%s","price":"%s","miCode":"","miDjmc":"","goodsNum":1}]}]}
\ No newline at end of file
......@@ -56,7 +56,7 @@
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1分48</td>
<td class='details-col-elapsed'>0分22</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -72,9 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a9流程六_中心库入库结算_负结算/log.html' target='_blank'>a_a9流程六_中心库入库结算_负结算</a></td>
<td class="details-col-elapsed"><a href='../log/a_b1流程八_高值跟台业务流程/log.html' target='_blank'>a_b1流程八_高值跟台业务流程</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">108.71</td>
<td class="details-col-elapsed">22.219</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