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

新增自动请领排程脚本

parent 400da0cd
...@@ -46,6 +46,7 @@ def test1(): ...@@ -46,6 +46,7 @@ def test1():
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"] # branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
str = commonFuc().get_business_data(module, 'data3') str = commonFuc().get_business_data(module, 'data3')
list2 = list(str.split(",")) list2 = list(str.split(","))
list2.append('001')
print(list2) print(list2)
# #获取日期 # #获取日期
# date1=timeUtils().get_time_hms(2) # date1=timeUtils().get_time_hms(2)
...@@ -73,6 +74,5 @@ def test1(): ...@@ -73,6 +74,5 @@ def test1():
else: else:
commonFuc().check_text_exist('error', result) commonFuc().check_text_exist('error', result)
test1() test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
from common.db.sql.sql_del_notices_info import delByNoticeName
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,r_a4科室管理_自动请领排程_列表查询_获取id,id2263,id2263-206,sit,on
内网:r_a4科室管理_自动请领排程_列表查询_获取id
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:r_a4科室管理_自动请领排程_列表查询_获取id
用例名称:r_a4科室管理_自动请领排程_列表查询_获取id
输入:""
输出:"rtn_msg": {"code": 0, "msg": null, "data":[]}
"""
# 内网登录
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)
# r_a4科室管理_自动请领排程_列表查询_获取id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "deptProcOrder_page_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"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload60")
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
# print(len(data1))
list_id=[]
if code == 0 and len(data) >= 1:
total=commonFuc().analysis_json('total', data)
for i in range(total):
id1=commonFuc().analysis_json('id', data1[i])
print(id1)
list_id.append(id1)
commonFuc().check_text_exist(0, result)
print(list_id)
return list_id
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
from common.db.sql.sql_del_notices_info import delByNoticeName
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,r_a5科室管理_自动请领排程_编辑排程,id2263,id2263-207,sit,on
内网:r_a5科室管理_自动请领排程_编辑排程
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:r_a4科室管理_自动请领排程_列表查询_获取id
用例名称:r_a4科室管理_自动请领排程_列表查询_获取id
输入:""
输出:"rtn_msg": {"code": 0, "msg": null, "data":[]}
"""
# 内网登录
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)
# r_a5科室管理_自动请领排程_编辑排程
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "deptProcOrder_updateById_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"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\r_a4科室管理_自动请领排程_列表查询_获取id.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\r_a4科室管理_自动请领排程_列表查询_获取id.air')
from r_a4科室管理_自动请领排程_列表查询_获取id import test1
id1 = test1()
print(id1)
# 请求体
request_body = commonFuc().get_business_data(module, "payload60_4",id1[0])
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
# print(len(data1))
if code == 0 and data == 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
from common.db.sql.sql_del_notices_info import delByNoticeName
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,r_a6科室管理_自动请领排程_删除排程,id2263,id2263-208,sit,on
内网:r_a6科室管理_自动请领排程_删除排程
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:r_a6科室管理_自动请领排程_删除排程
用例名称:r_a6科室管理_自动请领排程_删除排程
输入:""
输出:"rtn_msg": {"code": 0, "msg": null, "data":[]}
"""
# 内网登录
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)
# r_a6科室管理_自动请领排程_删除排程
pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\r_a4科室管理_自动请领排程_列表查询_获取id.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\r_a4科室管理_自动请领排程_列表查询_获取id.air')
from r_a4科室管理_自动请领排程_列表查询_获取id import test1
list_id = test1()
print(list_id)
for i in list_id:
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "deptProcOrder_deleteById_url")
url=url+i+'?id='+i
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"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
# request_body = commonFuc().get_business_data(module, "payload60_4")
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_delte(url,headers)
# print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
# print(len(data1))
if code == 0 and data == 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
...@@ -84,6 +84,8 @@ ...@@ -84,6 +84,8 @@
"basic_stockInfo_stockTree": "/api/herpService/basic/stockInfo/stockTree" "basic_stockInfo_stockTree": "/api/herpService/basic/stockInfo/stockTree"
"deptProcOrder_page_url": "/api/herpService/basic/deptProcOrder/page" "deptProcOrder_page_url": "/api/herpService/basic/deptProcOrder/page"
"deptProcOrder_insert_url": "/api/herpService/basic/deptProcOrder/insert" "deptProcOrder_insert_url": "/api/herpService/basic/deptProcOrder/insert"
"deptProcOrder_updateById_url": "/api/herpService/basic/deptProcOrder/updateById"
"deptProcOrder_deleteById_url": "/api/herpService/basic/deptProcOrder/deleteById/"
data1: '条码,high_info,check_detail,高值打码,out_stock,goods_change_baseInfo,center_out_stock_pkg,mcms_centre_out_stock,pkg_info,mcms_dept_out_stock,barcode_common,mcms_centre_in_stock,goods_change_price,mcms_dept_in_stock,check_detail_pkg,center_out_stock_high,center_out_stock_high,high_consume,shelf_code,barcode_common_pkg,check_detail_high,balance_bill,barcode_rfid,bottle_info,验收单明细打印,产品信息变更,中心库出库单低值,医院中心库出库单,包信息,医院科室出库单,高值纸质条码打印,医院中心库入库单,产品调价,医院科室入库单,低值验收单,中心库出库单高值,高值耗材使用登记表,货位码,单元包纸质条码打印,高值验收单,结算单打印,高值RFID条码打印,单瓶码打印' data1: '条码,high_info,check_detail,高值打码,out_stock,goods_change_baseInfo,center_out_stock_pkg,mcms_centre_out_stock,pkg_info,mcms_dept_out_stock,barcode_common,mcms_centre_in_stock,goods_change_price,mcms_dept_in_stock,check_detail_pkg,center_out_stock_high,center_out_stock_high,high_consume,shelf_code,barcode_common_pkg,check_detail_high,balance_bill,barcode_rfid,bottle_info,验收单明细打印,产品信息变更,中心库出库单低值,医院中心库出库单,包信息,医院科室出库单,高值纸质条码打印,医院中心库入库单,产品调价,医院科室入库单,低值验收单,中心库出库单高值,高值耗材使用登记表,货位码,单元包纸质条码打印,高值验收单,结算单打印,高值RFID条码打印,单瓶码打印'
data2: 'code,医院标识,code1,code1,erpCode,JDE编码修改,GOODS_CHANGE_STATUS,产品信息变更状态,GOODS_CHARGE_COST,是否计入成本,GOODS_KIND_TYPE,产品分类类型,MFRS_KIND,企业职能,miCode,医保编码修改,NOTICE_RANGE_KIND,公告通知范围,PUR_MODE,耗材类型,YWMS,业务模式,CORP_TYPE,主体类别,PROGRAM_TYPE,程序端,GRAIN,参数粒度,ENV,发布环境,PROJECT_GROUP,系统分组,RETURN_REASON_TYPE,退货原因,NEWCPFL,新产品分类,ZZLX,企业证照类型,68FL,68器械分类,18FL,18器械分类,GOODS_START_STOP,产品启停,YYDJ,医院等级,GOODS_TEMP,产品临采,GLJB,耗材管理级别,GOODS_PURCHASE,产品是否采购,HIS_CODE_CHANGE,HIS编码修改,MI_CODE_CHANGE,医保型号修改,MI_GOODS_GG_CHANGE,医保产品规格,MI_GOODS_XH_CHANGE,医保型号修改,GOODS_CHARGE,产品是否计费,GOODS_BAR_CODE,产品管理模式,GOODS_PUR_MODE,耗材类型,GOODS_CHANGE_PRICE,产品调价类型,GOODS_BAR_CODE_STRATEGY,UDI管理策略,FOCUS_CONTROL_TYPE,重点管控分类,MANUAL_PICK_REASON,手工出库原因,RFID_LABEL_CHANGE,RFID标签管理,ALLOT_PICK_REASON,调拨出库原因,MAGRE_PICK_REASON,移库出库原因' data2: 'code,医院标识,code1,code1,erpCode,JDE编码修改,GOODS_CHANGE_STATUS,产品信息变更状态,GOODS_CHARGE_COST,是否计入成本,GOODS_KIND_TYPE,产品分类类型,MFRS_KIND,企业职能,miCode,医保编码修改,NOTICE_RANGE_KIND,公告通知范围,PUR_MODE,耗材类型,YWMS,业务模式,CORP_TYPE,主体类别,PROGRAM_TYPE,程序端,GRAIN,参数粒度,ENV,发布环境,PROJECT_GROUP,系统分组,RETURN_REASON_TYPE,退货原因,NEWCPFL,新产品分类,ZZLX,企业证照类型,68FL,68器械分类,18FL,18器械分类,GOODS_START_STOP,产品启停,YYDJ,医院等级,GOODS_TEMP,产品临采,GLJB,耗材管理级别,GOODS_PURCHASE,产品是否采购,HIS_CODE_CHANGE,HIS编码修改,MI_CODE_CHANGE,医保型号修改,MI_GOODS_GG_CHANGE,医保产品规格,MI_GOODS_XH_CHANGE,医保型号修改,GOODS_CHARGE,产品是否计费,GOODS_BAR_CODE,产品管理模式,GOODS_PUR_MODE,耗材类型,GOODS_CHANGE_PRICE,产品调价类型,GOODS_BAR_CODE_STRATEGY,UDI管理策略,FOCUS_CONTROL_TYPE,重点管控分类,MANUAL_PICK_REASON,手工出库原因,RFID_LABEL_CHANGE,RFID标签管理,ALLOT_PICK_REASON,调拨出库原因,MAGRE_PICK_REASON,移库出库原因'
...@@ -428,6 +430,7 @@ json_headers2: { ...@@ -428,6 +430,7 @@ json_headers2: {
"payload60_1": {"branchId":"h0347-2011","deptId":"96c4d23bff8541599eb1a7f5f813e421","orderNum":1,"intervalType":"0","intervalNum":"1","intervalWeek":"","id":"","hosId":"h0347"} "payload60_1": {"branchId":"h0347-2011","deptId":"96c4d23bff8541599eb1a7f5f813e421","orderNum":1,"intervalType":"0","intervalNum":"1","intervalWeek":"","id":"","hosId":"h0347"}
"payload60_2": {"branchId":"h0347-2011","deptId":"b3753145b3ba4c7da96b5cdf6c3d436b","orderNum":1,"intervalType":"1","intervalNum":"1","intervalWeek":65,"id":"","hosId":"h0347"} "payload60_2": {"branchId":"h0347-2011","deptId":"b3753145b3ba4c7da96b5cdf6c3d436b","orderNum":1,"intervalType":"1","intervalNum":"1","intervalWeek":65,"id":"","hosId":"h0347"}
"payload60_3": {"pageNum":1,"pageSize":50,"orderBy":"","queryObject":{"ename":"%s","branchId":"h0347-2011","hosId":"h0347"}} "payload60_3": {"pageNum":1,"pageSize":50,"orderBy":"","queryObject":{"ename":"%s","branchId":"h0347-2011","hosId":"h0347"}}
"payload60_4": {"id":"%s","branchId":"h0347-2011","deptId":"96c4d23bff8541599eb1a7f5f813e421","orderNum":2,"intervalType":"0","intervalNum":2,"intervalWeek":"","hosId":"h0347"}
checkDict: {"code": 0,'msg': None,'data': True} checkDict: {"code": 0,'msg': None,'data': True}
checkDict1: { checkDict1: {
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分51</td> <td class='details-col-elapsed'>0分5秒</td>
<td class="details-col-elapsed">100.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/r_a3科室管理_自动请领排程_列表查询_条件查询_异常/log.html' target='_blank'>r_a3科室管理_自动请领排程_列表查询_条件查询_异常</a></td> <td class="details-col-elapsed"><a href='../log/r_a6科室管理_自动请领排程_删除排程/log.html' target='_blank'>r_a6科室管理_自动请领排程_删除排程</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">51.478</td> <td class="details-col-elapsed">5.194</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