Commit 8c36742d authored by 肖 和生's avatar 肖 和生
Browse files

Merge remote-tracking branch 'remotes/origin/master' into core_flow

# Conflicts:
#	air_case/b5_spd3_core_business_flow/a_a2_流程二供货关系申请提交审批.air/a_a2_流程二供货关系申请提交审批.py
parents 4cdce018 4aae0274
...@@ -25,7 +25,7 @@ id1,cname=es() ...@@ -25,7 +25,7 @@ id1,cname=es()
""" """
#企业注册提交接口_认领 #企业注册提交接口_认领
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url")
username = commonFuc().get_business_data(module, "username") username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password") password = commonFuc().get_business_data(module, "password")
# print(username, password) # print(username, password)
# 获取token和projectCode # 获取token和projectCode
......
...@@ -25,12 +25,14 @@ id1=global_var_id ...@@ -25,12 +25,14 @@ id1=global_var_id
输出:"rtn_msg": "企业被锁定" 输出:"rtn_msg": "企业被锁定"
""" """
#企业注册提交接口_锁定_开始 #企业注册提交接口_锁定_开始
username = commonFuc().get_business_data(module, "username") username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password") password = commonFuc().get_business_data(module, "password")
# 获取token和projectCode # 获取token和projectCode
token,projectCode,uxid,corpId,info= login_system(username, password).get_token() token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "queryAlCompanyRegistInfo_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "queryAlCompanyRegistInfo_url")
print('企业锁定url',url)
#获取请求头信息 #获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2", headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token, commonFuc().get_business_data(module, "json_contentType"), token,
...@@ -38,6 +40,7 @@ headers = commonFuc().get_business_data(module, "json_headers2", ...@@ -38,6 +40,7 @@ headers = commonFuc().get_business_data(module, "json_headers2",
request_body = commonFuc().get_business_data(module, "payload3",id1) request_body = commonFuc().get_business_data(module, "payload3",id1)
# 发送请求 # 发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('企业锁定结果',result)
#获取接口返回数据 #获取接口返回数据
code = commonFuc().analysis_json('code', result) code = commonFuc().analysis_json('code', result)
#断言实际结果中是否包含预期结果的内容 #断言实际结果中是否包含预期结果的内容
......
# -*- encoding=utf8 -*- # -*- encoding=utf8 -*-
from common.dateUtils import dateUtils
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
...@@ -14,9 +15,9 @@ from airtest.core.api import using ...@@ -14,9 +15,9 @@ from airtest.core.api import using
import sys import sys
pro_path=commonFuc().get_pro_path() pro_path=commonFuc().get_pro_path()
sys.path.append(pro_path+r'\\air_case\\a2_mdm3_ea\\a企业认领.air') sys.path.append(pro_path+r'\\air_case\\a2_mdm3_ea\\a企业锁定.air')
using(pro_path+r'\\air_case\\a2_mdm3_ea\\a企业认领.air') using(pro_path+r'\\air_case\\a2_mdm3_ea\\a企业锁定.air')
from a企业认领 import * from a企业锁定 import *
# print('global_var_id',global_var_id) # print('global_var_id',global_var_id)
id1=global_var_id id1=global_var_id
cname=global_var_cname cname=global_var_cname
...@@ -29,7 +30,7 @@ def test1(): ...@@ -29,7 +30,7 @@ def test1():
输出:"rtn_msg": "{"code": 0,'msg': None,'data':'审核通过'}" 输出:"rtn_msg": "{"code": 0,'msg': None,'data':'审核通过'}"
""" """
# 企业注册提交接口_审核通过_开始 # 企业注册提交接口_审核通过_开始
username = commonFuc().get_business_data(module, "username") username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password") password = commonFuc().get_business_data(module, "password")
# print(username, password) # print(username, password)
# 获取token和projectCode # 获取token和projectCode
...@@ -40,10 +41,24 @@ def test1(): ...@@ -40,10 +41,24 @@ def test1():
projectCode, token) projectCode, token)
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "auditCompanyRegistBill_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "auditCompanyRegistBill_url")
request_body = commonFuc().get_business_data(module, "payload5",id1) print('企业审核url',url)
lastModified=dateUtils().get_current_time()
createTime=dateUtils().get_current_time()
lastModifiedUser=uxid
userLoginCode=cname
userName=cname
email=cname
erpCode=cname
registSourceProject=cname
request_body = commonFuc().get_business_data(module, "payload5_1", id1, lastModified, createTime,
userLoginCode, userName, cname, email, erpCode,
registSourceProject)
# request_body = commonFuc().get_business_data(module, "payload5_2",id1)
print('企业审核request_body',request_body)
# 发送请求 # 发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
# print('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',result) print('企业审核',result)
#获取接口返回数据 #获取接口返回数据
code = commonFuc().analysis_json('code', result) code = commonFuc().analysis_json('code', result)
check_dict1 = commonFuc().get_business_data(module, "checkDict1") check_dict1 = commonFuc().get_business_data(module, "checkDict1")
......
...@@ -255,7 +255,7 @@ def check_mcms_pick(type=16): ...@@ -255,7 +255,7 @@ def check_mcms_pick(type=16):
source_id = get_buyBillId(branch_id, type) source_id = get_buyBillId(branch_id, type)
dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1'] dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'] dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_id = get_stockId_fromdb(dept_name + '中心库房') stock_id = get_stockId_fromdb(get_branch_name() + '中心库房')
area_code = get_stockAreaId_new_fromDb(dept_name, 1) area_code = get_stockAreaId_new_fromDb(dept_name, 1)
target_dept_id = FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_corpId'] target_dept_id = FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_corpId']
target_dept_name = FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_username'] target_dept_name = FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_username']
......
# -*- encoding=utf8 -*- # -*- encoding=utf8 -*-
from air_case.public1.public1.public1 import get_X_JS_HASH
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
""" """
...@@ -43,6 +45,13 @@ class login_system(): ...@@ -43,6 +45,13 @@ class login_system():
commonFuc().get_business_data(self.module, "json_contentType")) commonFuc().get_business_data(self.module, "json_contentType"))
# print(headers) # print(headers)
# 发送登录请求 # 发送登录请求
login_url2= commonFuc().get_business_data(self.module, "login_url")
X_JS_HASH=get_X_JS_HASH(request_body,login_url2)
X_APP_CODE='hdi.pc'
# 重新获取头信息
headers = commonFuc().get_business_data(self.module, "json_headers3",
commonFuc().get_business_data(self.module, "json_contentType"),
X_APP_CODE, X_JS_HASH)
result = commonFuc().http_post(login_url, request_body, headers) result = commonFuc().http_post(login_url, request_body, headers)
token = commonFuc().analysis_json('token', result) token = commonFuc().analysis_json('token', result)
uxid = commonFuc().analysis_json('uxid', result) uxid = commonFuc().analysis_json('uxid', result)
...@@ -58,6 +67,12 @@ class login_system(): ...@@ -58,6 +67,12 @@ class login_system():
request_body = commonFuc().get_business_data(self.module, "payload2", token, uxid, projectCode) request_body = commonFuc().get_business_data(self.module, "payload2", token, uxid, projectCode)
# print(request_body) # print(request_body)
# 发送平台登录请求 # 发送平台登录请求
login_url2 = commonFuc().get_business_data(self.module, "platform_login_url")
X_JS_HASH = get_X_JS_HASH(request_body, login_url2)
# 重新获取头信息
headers = commonFuc().get_business_data(self.module, "json_headers4",
commonFuc().get_business_data(self.module, "json_contentType"),
token,X_APP_CODE, X_JS_HASH)
result = commonFuc().http_post(platform_login_url, request_body, headers) result = commonFuc().http_post(platform_login_url, request_body, headers)
print('平台登录接口结果', result) print('平台登录接口结果', result)
......
...@@ -485,6 +485,16 @@ def get_stockId_fromdb(name): # 获取仓库id参数是库房名称 ...@@ -485,6 +485,16 @@ def get_stockId_fromdb(name): # 获取仓库id参数是库房名称
get_id("select id from mcms_stock_info where stock_name='%s'and branch_id='%s';" % (name, get_branch_id()))) get_id("select id from mcms_stock_info where stock_name='%s'and branch_id='%s';" % (name, get_branch_id())))
return stockId return stockId
def get_X_JS_HASH(request_body,url2):
import json
request_body_str = json.dumps(request_body)
request_body_str2 = url2 + request_body_str
data = request_body_str2
import hashlib
byte_str = data.encode('utf-8')
hash_object = hashlib.sha256(byte_str)
X_JS_HASH = hash_object.hexdigest()
return X_JS_HASH
def dept_query_all(): # 科室查询,将科室id写入文件中 def dept_query_all(): # 科室查询,将科室id写入文件中
module = "b2_herp3_bs" module = "b2_herp3_bs"
......
...@@ -6,8 +6,10 @@ ...@@ -6,8 +6,10 @@
"upCompanyList_url": "/api/mdmService/mdmCompany/upCompanyList" "upCompanyList_url": "/api/mdmService/mdmCompany/upCompanyList"
"auditCompanyRegistBill_url": "/api/mdmService/companyRegistBill/auditCompanyRegistBill" "auditCompanyRegistBill_url": "/api/mdmService/companyRegistBill/auditCompanyRegistBill"
"updateByIdCompanyRegistBill_url": "/api/mdmService/companyRegistBill/updateById/" "updateByIdCompanyRegistBill_url": "/api/mdmService/companyRegistBill/updateById/"
"username": "test_1" "username": "test_1"
"password": "1qaz!QAZ" "password": "1qaz!QAZ"
"username1": "001f90380"
json_contentType: "application/json" json_contentType: "application/json"
json_headers: { json_headers: {
...@@ -20,6 +22,13 @@ json_headers2: { ...@@ -20,6 +22,13 @@ json_headers2: {
"X-APP-CODE":"%s", "X-APP-CODE":"%s",
"X-SESSION-ID":"%s" "X-SESSION-ID":"%s"
} }
json_headers3: {
"Content-Type": "%s",
"token": "%s",
"X-APP-CODE":"%s",
"X-JS-HASH":"%s",
"Host":"spdtest.cmic.com.cn"
}
"payload1": { "payload1": {
"id": "%s", "id": "%s",
"isLocked": 1 "isLocked": 1
...@@ -51,6 +60,72 @@ json_headers2: { ...@@ -51,6 +60,72 @@ json_headers2: {
"id":"%s" "id":"%s"
} }
"payload5_1": {"id":"%s","lastModified":"%s","version":0,"createTime":"%s","createUser":null,"lastModifiedUser":null,"userLoginCode":"%s","userLoginPsw":"v/kTXSwg4s7FA7eIxX+S+w==","userName":"%s","cname":"%s","shortName":"","upCompanyId":"","compKind":"0","compFunction":"2","area":"","province":null,"city":null,"areaCode":null,"legal":"","address":"","isAbroad":1,"nation":null,"registContactUser":"","registContactWay":"","email":"%s@sina.com","hosProperty":null,"hosLevel":null,"erpCode":"%s","regCode":null,"jyxkCode":null,"jyxkbaCode":null,"scxkzCode":null,"scbapzCode":null,"isLocked":0,"auditStatus":10,"auditStartTime":null,"auditEndTime":null,"auditor":null,"auditComment":null,"registSourceProject":"%s","dataEntrance":"注册","importTaskMfrsId":null,"createUserCorpId":null,"hosSpdType":null,"organizationCode":null,"spdProjectCode":"h0347","adminRole":"role-prov-template","clientType":1,"provId":"","isDrugProv":null,"isDrugLic":null,"isApparatusProv":null,"isApparatusRegister":null,"userRole":"role-00530","companyRegistBizscopeVos":[],"certVOList":[],"upCompanyName":null,"basCode":null,"shortPyinyin":null,"spdProjectName":"邹城市人民医院(test)","areaText":""}
"payload5_2": {"id":"%s","lastModified":"2024-08-22 08:41:20","version":0,"createTime":"2024-08-22 08:41:20","createUser":null,"lastModifiedUser":null,"userLoginCode":"国药集团公司Ef96F","userLoginPsw":"v/kTXSwg4s7FA7eIxX+S+w==","userName":"国药集团公司Ef96F","cname":"国药集团公司Ef96F","shortName":"","upCompanyId":"","compKind":"0","compFunction":"2","area":"","province":null,"city":null,"areaCode":null,"legal":"","address":"","isAbroad":1,"nation":null,"registContactUser":"","registContactWay":"","email":"国药集团公司Ef96F@sina.com","hosProperty":null,"hosLevel":null,"erpCode":"国药集团公司Ef96F","regCode":null,"jyxkCode":null,"jyxkbaCode":null,"scxkzCode":null,"scbapzCode":null,"isLocked":0,"auditStatus":10,"auditStartTime":null,"auditEndTime":null,"auditor":null,"auditComment":null,"registSourceProject":"国药集团公司Ef96F","dataEntrance":"注册","importTaskMfrsId":null,"createUserCorpId":null,"hosSpdType":null,"organizationCode":null,"spdProjectCode":"h0347","adminRole":"role-prov-template","clientType":1,"provId":"","isDrugProv":null,"isDrugLic":null,"isApparatusProv":null,"isApparatusRegister":null,"userRole":"role-00530","companyRegistBizscopeVos":[],"certVOList":[],"upCompanyName":null,"basCode":null,"shortPyinyin":null,"spdProjectName":"邹城市人民医院(test)","areaText":""}
"payload5_3": {
"id": "%s",
"lastModified": "2024-08-22 09:17:05",
"version": 0,
"createTime": "2024-08-22 09:17:05",
"createUser": null,
"lastModifiedUser": null,
"userLoginCode": "国药集团公司fhJSX",
"userLoginPsw": "v/kTXSwg4s7FA7eIxX+S+w==",
"userName": "国药集团公司fhJSX",
"cname": "国药集团公司fhJSX",
"shortName": "",
"upCompanyId": "",
"compKind": "0",
"compFunction": "2",
"area": "",
"province": null,
"city": null,
"areaCode": null,
"legal": "",
"address": "",
"isAbroad": 1,
"nation": null,
"registContactUser": "",
"registContactWay": "",
"email": "国药集团公司fhJSX@sina.com",
"hosProperty": null,
"hosLevel": null,
"erpCode": "国药集团公司fhJSX",
"regCode": null,
"jyxkCode": null,
"jyxkbaCode": null,
"scxkzCode": null,
"scbapzCode": null,
"isLocked": 0,
"auditStatus": 10,
"auditStartTime": null,
"auditEndTime": null,
"auditor": null,
"auditComment": null,
"registSourceProject": "国药集团公司fhJSX",
"dataEntrance": "注册",
"importTaskMfrsId": null,
"createUserCorpId": null,
"hosSpdType": null,
"organizationCode": null,
"spdProjectCode": "h0347",
"adminRole": "role-prov-template",
"clientType": 1,
"provId": "",
"isDrugProv": null,
"isDrugLic": null,
"isApparatusProv": null,
"isApparatusRegister": null,
"userRole": "role-00530",
"companyRegistBizscopeVos": [],
"certVOList": [],
"upCompanyName": null,
"basCode": null,
"shortPyinyin": null,
"spdProjectName": "邹城市人民医院(test)",
"areaText": ""
}
"payload6": { "payload6": {
"id": "%s", "id": "%s",
"isLocked": 0, "isLocked": 0,
......
...@@ -13,6 +13,17 @@ json_headers2: { ...@@ -13,6 +13,17 @@ json_headers2: {
"token": "%s", "token": "%s",
"X-APP-CODE":"%s" "X-APP-CODE":"%s"
} }
json_headers3: {
"Content-Type": "%s",
"X-APP-CODE":"%s",
"X-JS-HASH":"%s"
}
json_headers4: {
"Content-Type": "%s",
"token": "%s",
"X-APP-CODE":"%s",
"X-JS-HASH":"%s"
}
"payload": { "payload": {
"username": "%s", "username": "%s",
"passwd": "%s", "passwd": "%s",
...@@ -26,7 +37,8 @@ json_headers2: { ...@@ -26,7 +37,8 @@ json_headers2: {
"uxid": "%s", "uxid": "%s",
"projectCode": "%s", "projectCode": "%s",
"traceId": null, "traceId": null,
"jsHash": null "jsHash": null,
"pwdSecureInfo":null
} }
checkDict: {"code": 0,'msg': None} checkDict: {"code": 0,'msg': None}
......
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