Commit 44cd809b authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增采购计划模块脚本

parent 2c3447a4
# -*- encoding=utf8 -*-
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_b0_手工采购计划_低值产品_提交,id2297,id2297-10,sit,on
内网:a_b0_手工采购计划_低值产品_提交
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_b0_手工采购计划_低值产品_提交
用例名称:a_b0_手工采购计划_低值产品_提交
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
username = commonFuc().get_business_data(module, "username")
# print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# print( token,projectCode,uxid,corpId,info)
# 获取暂存的单号
pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b3_herp3_purchase\\a_a5_手工采购计划_低值产品_暂存.air')
using(pro_path + r'\\air_case\\b3_herp3_purchase\\a_a5_手工采购计划_低值产品_暂存.air')
from a_a5_手工采购计划_低值产品_暂存 import test1
pid = test1()
# 获取采购计划详情中的id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_purPlan_listVo_url")
print(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"))
print('headers', headers)
# # 请求体
request_body = commonFuc().get_business_data(module, "payload11", pid)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
data = commonFuc().analysis_json('data', result)
id1 = commonFuc().analysis_json('id', data[0])
# =====================================
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_purPlan_submitPurPlan_url")
print(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"))
print('headers', headers)
# # 请求体
request_body = commonFuc().get_business_data(module, "payload12", pid, id1)
# print('request_body', request_body)
# new_request_body = request_body.replace("'", '"')
# new_request_body = new_request_body.replace("None", 'null')
# # print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# print('request_body_json', request_body_json)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultbbbbbbbbbbbbbbbbbbbb', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0 and data == None:
commonFuc().check_text_exist(0, result)
print(data)
return data
else:
commonFuc().check_text_exist('error', result)
test1()
"herpService_purPlan_insert_url": "/api/herpService/purPlan/insert" "herpService_purPlan_insert_url": "/api/herpService/purPlan/insert"
"herpService_purPlan_listVoPage_url": "/api/herpService/purPlan/listVoPage" "herpService_purPlan_listVoPage_url": "/api/herpService/purPlan/listVoPage"
"mcmsBranchGoodsInfo_url": "/api/herpService/basic/mcmsBranchGoodsInfo/page" "mcmsBranchGoodsInfo_url": "/api/herpService/basic/mcmsBranchGoodsInfo/page"
"herpService_purPlan_submitPurPlan_url": "/api/herpService/purPlan/submitPurPlan"
"herpService_purPlan_listVo_url": "/api/herpService/purPlan/listVo"
data1: "10,20,60" data1: "10,20,60"
data2: "00001986,一次性医药包-低值,一次性医药包" data2: "00001986,一次性医药包-低值,一次性医药包"
...@@ -39,6 +40,8 @@ json_headers2: { ...@@ -39,6 +40,8 @@ json_headers2: {
"payload_9_1": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"","purModes":["10"],"provName":"%s","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50} "payload_9_1": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"","purModes":["10"],"provName":"%s","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_9_2": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"","purModes":[],"provName":"%s","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50} "payload_9_2": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"","purModes":[],"provName":"%s","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_2_2": '{"purPlanDetail":[{"hosGoodsId":"h034700001761","pkgDefId":"0b4451f1086f4c25b5eac5bf22f45c0b","pkgDefName":"支","pkgDefQty":333,"planPkgQty":33},{"hosGoodsId":"h034700001771","pkgDefId":null,"pkgDefName":"包","pkgDefQty":1,"planPkgQty":33},{"hosGoodsId":"h034700001859","pkgDefId":"26d93e6fecd24b6fa4bde8aeacfbf153","pkgDefName":"盒","pkgDefQty":1,"planPkgQty":33}],"hosId":"h0347","branchId":"h0347-2011","mgrCorpName":"邹城市人民医院(test)","deptName":"","deptId":"d69a68df361a4289b2262e4ef75b55a5","recOrgId":"d69a68df361a4289b2262e4ef75b55a5","recOrgName":"","areaCode":"areah03470414","areaName":"A库区","recUser":"UID-050151","recPhone":"xhs1009","recAddr":"A","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":false}' "payload_2_2": '{"purPlanDetail":[{"hosGoodsId":"h034700001761","pkgDefId":"0b4451f1086f4c25b5eac5bf22f45c0b","pkgDefName":"支","pkgDefQty":333,"planPkgQty":33},{"hosGoodsId":"h034700001771","pkgDefId":null,"pkgDefName":"包","pkgDefQty":1,"planPkgQty":33},{"hosGoodsId":"h034700001859","pkgDefId":"26d93e6fecd24b6fa4bde8aeacfbf153","pkgDefName":"盒","pkgDefQty":1,"planPkgQty":33}],"hosId":"h0347","branchId":"h0347-2011","mgrCorpName":"邹城市人民医院(test)","deptName":"","deptId":"d69a68df361a4289b2262e4ef75b55a5","recOrgId":"d69a68df361a4289b2262e4ef75b55a5","recOrgName":"","areaCode":"areah03470414","areaName":"A库区","recUser":"UID-050151","recPhone":"xhs1009","recAddr":"A","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":false}'
"payload10": '{"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":999,"pkgDefQty":1,"provId":"p00001603","provName":"北京中杉金桥生物技术有限公司(test)","subProvId":"p56a4","subProvName":"国药集团浙江医疗器材有限公司","hosGoodsId":"h034700001757","purMode":20,"version":0,"pkgDefId":null,"purTaskId":null,"sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":true}'
"payload11": {"pid":"%s","hosGoodsName":"","hosGoodsSpec":"","provName":"","purModes":[],"subProvName":""}
"payload12": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":800,"pkgDefQty":33,"provId":"p10d95","provName":"浙江高仰医疗科技有限公司","subProvId":"p10d95","subProvName":"浙江高仰医疗科技有限公司","hosGoodsId":"h034700001977","purMode":10,"version":0,"pkgDefId":"56b010aba2e04f978e3038c0f53d910c","purTaskId":null,"sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":true}
checkDict2: {"code": 0,'msg': None,'data':1} checkDict2: {"code": 0,'msg': None,'data':1}
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>9</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>9</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分12</td> <td class='details-col-elapsed'>0分1秒</td>
<td class="details-col-elapsed">100.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -72,65 +72,9 @@ ...@@ -72,65 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a1_手工采购计划_添加产品页面_列表查询_查询全部/log.html' target='_blank'>a_a1_手工采购计划_添加产品页面_列表查询_查询全部</a></td> <td class="details-col-elapsed"><a href='../log/a_b0_手工采购计划_低值产品_提交/log.html' target='_blank'>a_b0_手工采购计划_低值产品_提交</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">0.838</td> <td class="details-col-elapsed">1.794</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a2_手工采购计划_添加产品页面_列表查询_条件查询_精确查询/log.html' target='_blank'>a_a2_手工采购计划_添加产品页面_列表查询_条件查询_精确查询</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">2.7</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a3_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询/log.html' target='_blank'>a_a3_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">4.443</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a4_手工采购计划_添加产品页面_列表查询_条件查询_异常查询/log.html' target='_blank'>a_a4_手工采购计划_添加产品页面_列表查询_条件查询_异常查询</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.09</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a5_手工采购计划_低值产品_暂存/log.html' target='_blank'>a_a5_手工采购计划_低值产品_暂存</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.643</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a6_手工采购计划_高值产品_暂存/log.html' target='_blank'>a_a6_手工采购计划_高值产品_暂存</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.358</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a7_手工采购计划_试剂产品_暂存/log.html' target='_blank'>a_a7_手工采购计划_试剂产品_暂存</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.451</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a8_手工采购计划_混合明细产品_暂存/log.html' target='_blank'>a_a8_手工采购计划_混合明细产品_暂存</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.609</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a9_采购计划_列表查询_查询全部/log.html' target='_blank'>a_a9_采购计划_列表查询_查询全部</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.697</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