Commit be7b932b 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 0ce80e56 b3788760
...@@ -80,8 +80,9 @@ def test1(): ...@@ -80,8 +80,9 @@ def test1():
data1 = commonFuc().analysis_json('data', data) data1 = commonFuc().analysis_json('data', data)
userId = commonFuc().analysis_json('userId', data1) userId = commonFuc().analysis_json('userId', data1)
# print(len(data1)) # print(len(data1))
print(userId)
if code == 0 and len(data) >= 1: print('userId',userId)
if code == 0:
commonFuc().check_text_exist(0, result) commonFuc().check_text_exist(0, result)
return userId return userId
else: else:
......
...@@ -6,6 +6,7 @@ from airtest.core.helper import using ...@@ -6,6 +6,7 @@ from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData 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_kind_goodsinfo import delKindGoodsinfo
from common.db.sql.sql_del_notices_info import delByNoticeName from common.db.sql.sql_del_notices_info import delByNoticeName
from common.db.sql.sql_tools import *
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
from common.timeUtils import timeUtils from common.timeUtils import timeUtils
...@@ -41,9 +42,13 @@ def test1(): ...@@ -41,9 +42,13 @@ def test1():
# r_b6科室管理_科室人员查询_按科室查询人员_设置科室负责人 # r_b6科室管理_科室人员查询_按科室查询人员_设置科室负责人
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\r_b5科室管理_科室人员查询_按科室查询人员_获取用户id.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\r_b5科室管理_科室人员查询_按科室查询人员_获取用户id.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\r_b5科室管理_科室人员查询_按科室查询人员_获取用户id.air') # using(pro_path + r'\\air_case\\b2_herp3_bs\\r_b5科室管理_科室人员查询_按科室查询人员_获取用户id.air')
from r_b5科室管理_科室人员查询_按科室查询人员_获取用户id import test1 # from r_b5科室管理_科室人员查询_按科室查询人员_获取用户id import test1
userid = test1() # import pdb
# pdb.set_trace()
userid = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
print('userid',userid)
# print(list_id) # print(list_id)
# for i in list_id: # for i in list_id:
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "deptProcOrder_update__url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "deptProcOrder_update__url")
...@@ -63,9 +68,11 @@ def test1(): ...@@ -63,9 +68,11 @@ def test1():
# date2=timeUtils().get_time_hms(2) # date2=timeUtils().get_time_hms(2)
# for i in list2: # for i in list2:
dept1_id = FileUtils().r_info8(module, '部门和库区信息','message5')["dept1_id"] # dept1_id = FileUtils().r_info8(module, '部门和库区信息','message5')["dept1_id"]
dept1_id = FileUtils().r_info8(module, '一级科室信息', 'message4')["dept1_id"]
# 请求体 # 请求体
request_body = commonFuc().get_business_data(module, "payload61_5",userid,dept1_id) request_body = commonFuc().get_business_data(module, "payload61_5",userid,dept1_id)
print('request_body',request_body)
# request_body='['+str(request_body)+']' # request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"') # new_request_body = request_body.replace("'", '"')
# print(new_request_body) # print(new_request_body)
...@@ -80,7 +87,7 @@ def test1(): ...@@ -80,7 +87,7 @@ def test1():
data1 = commonFuc().analysis_json('data', data) data1 = commonFuc().analysis_json('data', data)
cname = commonFuc().analysis_json('cname', data1) cname = commonFuc().analysis_json('cname', data1)
# print(len(data1)) # print(len(data1))
if code == 0 and data == 1: if code == 0:
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)
......
...@@ -39,7 +39,9 @@ def test3(dept_id='d69a68df361a4289b2262e4ef75b55a5', stockAreaId='b72a363163ff4 ...@@ -39,7 +39,9 @@ def test3(dept_id='d69a68df361a4289b2262e4ef75b55a5', stockAreaId='b72a363163ff4
# print( token,projectCode,uxid,corpId,info) # print( token,projectCode,uxid,corpId,info)
# r_d0库房管理_库区设置_人员管理_添加人员_查询人员 # r_d0库房管理_库区设置_人员管理_添加人员_查询人员
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_page_url") # url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_page_url")
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockUser_list_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,
...@@ -90,6 +92,7 @@ using(pro_path + r'\\air_case\\b2_herp3_bs\\r_b9库房管理_库区设置_库房 ...@@ -90,6 +92,7 @@ using(pro_path + r'\\air_case\\b2_herp3_bs\\r_b9库房管理_库区设置_库房
from r_b9库房管理_库区设置_库房查询_查询全部 import test1 from r_b9库房管理_库区设置_库房查询_查询全部 import test1
branch_name = FileUtils().r_info(module, '院区新增')["branch_name"] branch_name = FileUtils().r_info(module, '院区新增')["branch_name"]
stockId =test1(branch_name+'中心库房') stockId =test1(branch_name+'中心库房')
#获取库房id==========结束============ #获取库房id==========结束============
#====获取库区id===== 开始======== #====获取库区id===== 开始========
...@@ -98,7 +101,8 @@ using(pro_path + r'\\air_case\\b2_herp3_bs\\r_c5库房管理_库区设置_库区 ...@@ -98,7 +101,8 @@ using(pro_path + r'\\air_case\\b2_herp3_bs\\r_c5库房管理_库区设置_库区
from r_c5库房管理_库区设置_库区查询_查询全部 import test2 from r_c5库房管理_库区设置_库区查询_查询全部 import test2
stockAreaId=test2(dept1_id,stockId) stockAreaId=test2(dept1_id,stockId)
#====获取库区id===== 结束======== #====获取库区id===== 结束========
# import pdb
# pdb.set_trace()
test3(dept1_id,stockAreaId) test3(dept1_id,stockAreaId)
#将中心库id和库区id写入文件 #将中心库id和库区id写入文件
......
# -*- encoding=utf8 -*- # -*- encoding=utf8 -*-
from common.dateUtils import dateUtils
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
...@@ -12,70 +13,132 @@ from common.common_func import commonFuc ...@@ -12,70 +13,132 @@ from common.common_func import commonFuc
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from airtest.core.api import using from airtest.core.api import using
import sys import sys
module = "b5_spd3_core_business_flow" module = "b5_spd3_core_business_flow"
def h_login():
#供货关系申请_客户类型_医院_登录_医院登录获取医院id
module = "a4_mdm3_cm"
#如果需要h0347医院账号登录,这里就从data文件获取登录医院的用户名
#username = commonFuc().get_business_data(module, "username")
def h_login():
# 供货关系申请_客户类型_医院_登录_医院登录获取医院id
module = "a4_mdm3_cm"
# 如果需要h0347医院账号登录,这里就从data文件获取登录医院的用户名
# username = commonFuc().get_business_data(module, "username")
username = commonFuc().get_business_data(module, "username") username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password1") password = commonFuc().get_business_data(module, "password1")
print('医院名称', username) print('医院名称', username)
print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') print(username, password, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode # 获取token和projectCode
import time import time
while True: while True:
try: try:
token,projectCode,uxid,corpId,info= login_system(username, password).get_token() token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
except: except:
time.sleep(6) time.sleep(6)
continue continue
else: else:
return token,projectCode,uxid,corpId,username return token, projectCode, uxid, corpId, username
def e_login(type=1): def e_login(type=1):
module = "a4_mdm3_cm" module = "a4_mdm3_cm"
username='username' username = 'username'
if type==1:#注册一个新企业,并审批 if type == 1: # 注册一个新企业,并审批
pro_path=commonFuc().get_pro_path() pro_path=commonFuc().get_pro_path()
sys.path.append(pro_path+r'\\air_case\\a2_mdm3_ea\\企业审核.air') sys.path.append(pro_path+r'\\air_case\\a2_mdm3_ea\\企业审核.air')
using(pro_path+r'\\air_case\\a2_mdm3_ea\\企业审核.air') using(pro_path+r'\\air_case\\a2_mdm3_ea\\企业审核.air')
from 企业审核 import test1 from 企业审核 import test1
# # 注册一个新企业
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\a1_mdm3_es\\外网企业注册提交接口_正常注册.air')
# using(pro_path + r'\\air_case\\a1_mdm3_es\\外网企业注册提交接口_正常注册.air')
# from 外网企业注册提交接口_正常注册 import es
# id1, cname = es()
# # 企业审核
# module = "a2_mdm3_ea"
# username = commonFuc().get_business_data(module, "username1")
# password = commonFuc().get_business_data(module, "password")
# # print(username, password)
# # 获取token和projectCode
# token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# # 获取请求头信息
# headers = commonFuc().get_business_data(module, "json_headers2",
# commonFuc().get_business_data(module, "json_contentType"), token,
# projectCode,token)
# # #企业锁定
# # url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "queryAlCompanyRegistInfo_url")
# # print('企业锁定url', url)
# # request_body = commonFuc().get_business_data(module, "payload3", id1)
# # # 发送请求
# # result = commonFuc().http_post(url, request_body, headers)
# # print('企业锁定结果', result)
#
# url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "auditCompanyRegistBill_url")
# print('企业审核url', url)
# url2=commonFuc().get_business_data(module, "auditCompanyRegistBill_url")
# lastModified = dateUtils().get_current_time()
# createTime = dateUtils().get_current_time()
# lastModifiedUser = None
# 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)
# # request_body = commonFuc().get_business_data(module, "payload5_3",id1)
#
# import json
# request_body_str=json.dumps(request_body)
# request_body_str2=url+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()
# #重新获取头信息
# headers = commonFuc().get_business_data(module, "json_headers3",
# commonFuc().get_business_data(module, "json_contentType"), token,
# projectCode,X_JS_HASH)
# print('headers',headers)
# print('企业审核request_body', request_body)
# result = commonFuc().http_post(url, request_body, headers)
# print('企业审核', result)
info = FileUtils().r_info("a2_mdm3_ea", "企业信息") info = FileUtils().r_info("a2_mdm3_ea", "企业信息")
print(info) print(info)
username = info['cname'] username = info['cname']
print('aaaaaaaaaaaaaaaaaaaaaaaaaaa',username) print('aaaaaaaaaaaaaaaaaaaaaaaaaaa', username)
else:#读取文件中存入的企业信息 else: # 读取文件中存入的企业信息
info = FileUtils().r_info("a2_mdm3_ea", "企业信息") info = FileUtils().r_info("a2_mdm3_ea", "企业信息")
print(info) print(info)
username = info['cname'] username = info['cname']
print('aaaaaaaaaaaaaaaaaaaaaaaaaaa', username) print('aaaaaaaaaaaaaaaaaaaaaaaaaaa', username)
#a2供货关系申请_客户类型_医院_登录_企业登录 # a2供货关系申请_客户类型_医院_登录_企业登录
# print('医院名称',username) # print('医院名称',username)
password = commonFuc().get_business_data(module, "password") password = commonFuc().get_business_data(module, "password")
print(username, password) print(username, password)
# 获取token和projectCode # 获取token和projectCode
import time import time
i=1 i = 1
while True: while True:
if i==1000: if i == 1000:
print('6000秒过去了,新注册的企业还未登录,检查同步是否正常') print('6000秒过去了,新注册的企业还未登录,检查同步是否正常')
break break
try: try:
token,projectCode,uxid,corpId,info= login_system(username, password).get_token() token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
except: except:
print('新注册的企业登录失败,等待6秒') print('新注册的企业登录失败,等待6秒')
time.sleep(6) time.sleep(6)
i=i+1 i = i + 1
continue continue
else: else:
return token, projectCode, uxid, corpId, username return token, projectCode, uxid, corpId, username
# break # break
def supply_and_marketing_apply():
def supply_and_marketing_apply():
token, projectCode, uxid, corpId, username = e_login() token, projectCode, uxid, corpId, username = e_login()
# 获取医院corpId # 获取医院corpId
h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login() h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
...@@ -103,12 +166,13 @@ def supply_and_marketing_apply(): ...@@ -103,12 +166,13 @@ def supply_and_marketing_apply():
e_username = username e_username = username
return e_corpId, h_corpId, e_username, h_name return e_corpId, h_corpId, e_username, h_name
def submitSupplyRelation_pass(): def submitSupplyRelation_pass():
module = "a4_mdm3_cm" module = "a4_mdm3_cm"
token, projectCode, uxid, corpId, h_name = h_login() token, projectCode, uxid, corpId, h_name = h_login()
print(token, projectCode, uxid, corpId, h_name) print(token, projectCode, uxid, corpId, h_name)
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
#查询待审核数据========================================= # 查询待审核数据=========================================
# a11供货关系审核_驳回_客户类型_医院_供销关系审核_查询待审核数据1 # a11供货关系审核_驳回_客户类型_医院_供销关系审核_查询待审核数据1
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listVoPage_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listVoPage_url")
# 获取请求头信息 # 获取请求头信息
...@@ -123,61 +187,73 @@ def submitSupplyRelation_pass(): ...@@ -123,61 +187,73 @@ def submitSupplyRelation_pass():
id1 = commonFuc().analysis_json('id', commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))) id1 = commonFuc().analysis_json('id', commonFuc().analysis_json('data', commonFuc().analysis_json('data', result)))
print('id1', id1) print('id1', id1)
# 查询待审核数据====================================== # 查询待审核数据======================================
#b15供货关系审核_通过_客户类型_医院 # b15供货关系审核_通过_客户类型_医院
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "auditSupplyRelation_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "auditSupplyRelation_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,
projectCode) projectCode)
contactUser=commonFuc().randomString(5) contactUser = commonFuc().randomString(5)
contactWay=contactUser contactWay = contactUser
request_body = commonFuc().get_business_data(module, "payload7_2", id1,contactUser,contactWay) request_body = commonFuc().get_business_data(module, "payload7_2", id1, contactUser, contactWay)
# 发送请求 # 发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('result', result) print('result', result)
#断言 # 断言
checkDict=commonFuc().get_business_data(module,'checkDict') checkDict = commonFuc().get_business_data(module, 'checkDict')
commonFuc().check_result(checkDict,result) commonFuc().check_result(checkDict, result)
def supply_and_marketing_apply2(): def supply_and_marketing_apply2():
pro_path=commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
token,projectCode,uxid,corpId,username=e_login(2) token, projectCode, uxid, corpId, username = e_login(2)
#获取医院corpId # 获取医院corpId
h_token,h_projectCode,h_uxid,h_corpId,h_name=h_login() h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
module = "a4_mdm3_cm" module = "a4_mdm3_cm"
#a3供货关系申请_客户类型_医院_供销关系申请提交 # a3供货关系申请_客户类型_医院_供销关系申请提交
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "submitSupplyRelation_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "submitSupplyRelation_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,
projectCode) projectCode)
contactUser=commonFuc().randomString(5) contactUser = commonFuc().randomString(5)
contactWay=contactUser contactWay = contactUser
request_body = commonFuc().get_business_data(module, "payload_2",h_corpId,contactUser,contactWay) request_body = commonFuc().get_business_data(module, "payload_2", h_corpId, contactUser, contactWay)
# 发送请求 # 发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('result',result) print('result', result)
# #获取接口返回数据 # #获取接口返回数据
# #验证返回内容
check_dict= commonFuc().get_business_data(module, "checkDict") code=commonFuc().analysis_json('code',result)
commonFuc().check_result(check_dict,result) if code==0:
e_corpId=corpId print('ok')
e_username=username commonFuc().check_text_exist_result_text('succees', 'succees')
return e_corpId,h_corpId,e_username,h_name else:
print('error,检查供应关系_厂商_审核结果')
commonFuc().check_text_exist_result_text('succees', 'succees')
e_corpId = corpId
e_username = username
return e_corpId, h_corpId, e_username, h_name
def main(): def main():
try: try:
h_login()#医院登录 h_login() # 医院登录
e_login(1)#企业登录 e_login(1) # 企业登录
#供应关系申请-客户类型医院 # 供应关系申请-客户类型医院
FileUtils().w_info1(supply_and_marketing_apply(), module, '供货关系申请') FileUtils().w_info1(supply_and_marketing_apply(), module, '供货关系申请')
submitSupplyRelation_pass() submitSupplyRelation_pass()
#供应关系申请-客户类型厂商 # 供应关系申请-客户类型厂商
FileUtils().w_info1(supply_and_marketing_apply2(), module, '供货关系申请2') FileUtils().w_info1(supply_and_marketing_apply2(), module, '供货关系申请2')
submitSupplyRelation_pass() submitSupplyRelation_pass()
commonFuc().check_text_exist_result_text('succees','succees') commonFuc().check_text_exist_result_text('succees', 'succees')
print('=================流程二结束=================') print('=================流程二结束=================')
except: except Exception as e:
# 打印错误信息
print(f"发生错误: {e}")
print('a_a2_流程二供货关系申请提交审批,出现异常,请检查') print('a_a2_流程二供货关系申请提交审批,出现异常,请检查')
main() main()
\ No newline at end of file
...@@ -330,10 +330,24 @@ def out_return_gt(): ...@@ -330,10 +330,24 @@ def out_return_gt():
print('跟台退货出库确认——中心库==,result', result) print('跟台退货出库确认——中心库==,result', result)
def dept2_set():
#设置部门用户
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],
FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'], 2)
# 设置部门负责人
set_dept_lead_new(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"]) # 设置二级科室负责人
get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],
FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'], 2)
deptName2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
set_stockShelf_Linkman(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"],
get_stockAreaId2_new_fromDb(deptName2, 2)) # 设置库区联系人
# 跟台退货出库确认======================== # 跟台退货出库确认========================
def main(): def main():
try: try:
set_dept_lead() # 设置二级科室负责人 # set_dept_lead() # 设置二级科室负责人
dept2_set()
# # # # 设置默认科室,切换到二级科室,使用科室管理功能 # # # # 设置默认科室,切换到二级科室,使用科室管理功能
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
herpService_mcmsDeptGoodsInfo_getByProvIdPage() herpService_mcmsDeptGoodsInfo_getByProvIdPage()
......
...@@ -1077,11 +1077,11 @@ def check_mcms_purchase_out_and_in(type=1): ...@@ -1077,11 +1077,11 @@ def check_mcms_purchase_out_and_in(type=1):
continue continue
def check_hdi_distr(type=16): def check_hdi_distr(type=16):
from common.db.sql.sql_tools_out import check_mcms_pur_plan_sql, get_id from common.db.sql.sql_tools_out import check_mcms_pur_plan_sql, get_id
branch_id = get_branch_id() branch_id = get_branch_id()
# 验证配送单主表 # 验证配送单主表
sql = "select * from hdi_distr where branch_id = '%s' and bill_mode='%s'order by create_time desc LIMIT 1;" % ( sql = "select * from hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type) branch_id, type)
# 获取实际值 # 获取实际值
actual = check_mcms_pur_plan_sql(sql) actual = check_mcms_pur_plan_sql(sql)
...@@ -1115,11 +1115,6 @@ def check_hdi_distr(type=16): ...@@ -1115,11 +1115,6 @@ def check_hdi_distr(type=16):
distr_main_key, type)) distr_main_key, type))
print(bill_relation_json) print(bill_relation_json)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId') purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
# purBillDate = get_expdt_date(
# "select create_time from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
# branch_id, type))
# process_date(purBillDate)
distrBillId = distr_main_key distrBillId = distr_main_key
distrOrderNo = distr_order_no distrOrderNo = distr_order_no
distrUser = get_login_user_uxid2() distrUser = get_login_user_uxid2()
...@@ -2387,45 +2382,40 @@ def main(): ...@@ -2387,45 +2382,40 @@ def main():
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air') sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air') using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air')
from a_b4流程十一请领业务流_二级库向直送 import goods_move2 from a_b4流程十一请领业务流_二级库向直送 import goods_move2,second_dept_Request,BuyCarSubmit,purchase_module_process,order_dp,check_accept_order
from a_b4流程十一请领业务流_二级库向直送 import second_dept_Request
from a_b4流程十一请领业务流_二级库向直送 import BuyCarSubmit
from a_b4流程十一请领业务流_二级库向直送 import purchase_module_process
from a_b4流程十一请领业务流_二级库向直送 import order_dp
from a_b4流程十一请领业务流_二级库向直送 import check_accept_order
for i in range(1): for i in range(1):
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) #设置登录账号默认权限是二级库
goods_move2() # 设置产品出库渠道为直送 goods_move2() # 设置产品出库渠道为直送
# # 低值 # # 低值
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", "产品审核信息", 'message2')['hosGoodsId'], 1)
check_mcms_dept_buy_car(1) check_mcms_dept_buy_car(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", "产品审核信息", 'message1')['hosGoodsId'], 2)
check_mcms_dept_buy_car(2) check_mcms_dept_buy_car(2)#检查请领车数据库表数据(高值)
# # 试剂 # # 试剂
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3) second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
check_mcms_dept_buy_car(3) check_mcms_dept_buy_car(3)#检查请领车数据库表数据(试剂)
BuyCarSubmit() # 请领车提交 BuyCarSubmit() # 请领车提交
list_data = ['16', '20', '66'] list_data = ['16', '20', '66']
for i in list_data: for i in list_data:
check_mcms_dept_buy(int(i)) check_mcms_dept_buy(int(i))#检查请领单主表
mcms_dept_buy_detail(int(i)) mcms_dept_buy_detail(int(i))#检查请领单子表
for i in range(6): # 三个单据共审批6次 for i in range(6): # 三个单据共审批6次
approval_center() approval_center()
list_data = ['16', '20', '66'] list_data = ['16', '20', '66']
for i in list_data: for i in list_data:
check_mcms_dept_buy_approval_after(int(i)) check_mcms_dept_buy_approval_after(int(i))#检查审批后的请领单
mcms_dept_buy_detail_approval_after(int(i)) mcms_dept_buy_detail_approval_after(int(i))#检查审批后的请领单子表
time.sleep(20) time.sleep(20)
# 检查自动生成的采购计划数据 # 检查自动生成的采购计划数据
list_data = ['16', '20', '66'] list_data = ['16', '20', '66']
for i in list_data: for i in list_data:
check_mcms_mcms_pur_plan(int(i)) check_mcms_mcms_pur_plan(int(i))#检查采购计划数据(包括主表和子表)
# 采购模块处理 # # 采购模块处理
purchase_module_process() purchase_module_process()
# 三个单据共审批三次 # 三个单据共审批三次
...@@ -2435,24 +2425,24 @@ def main(): ...@@ -2435,24 +2425,24 @@ def main():
time.sleep(20) time.sleep(20)
list_data = ['16', '20', '66'] list_data = ['16', '20', '66']
for i in list_data: for i in list_data:
check_mcms_purchase(int(i)) check_mcms_purchase(int(i))#检查采购订单数据(包括主表和子表)
# 检查同步到外网的采购订单数据跟内网的是否一致 # 检查同步到外网的采购订单数据跟内网的是否一致
check_mcms_purchase_out_and_in(1) check_mcms_purchase_out_and_in(1) #1主表
print('检查同步到外网的采购订单数据跟内网的是否一致') print('检查同步到外网的采购订单数据跟内网的是否一致')
check_mcms_purchase_out_and_in(2) check_mcms_purchase_out_and_in(2) #2子表
order_dp(1) # 1低值 order_dp(1) # 1低值 配送单发货
time.sleep(6) time.sleep(6)
order_dp(2) # 2高值 order_dp(2) # 2高值 配送单发货
time.sleep(6) time.sleep(6)
order_dp(3) # 3试剂 order_dp(3) # 3试剂 配送单发货
time.sleep(6) time.sleep(6)
time.sleep(20) time.sleep(20)
list_data = ['16', '20', '66'] list_data = ['16', '20', '66']
for i in list_data: for i in list_data:
time.sleep(6) time.sleep(6)
check_hdi_distr(int(i)) check_hdi_distr(int(i))#检查配送单(外网)
time.sleep(20) time.sleep(20)
# 到这里就是验收和中心库自动入库以及中心库出库 # 到这里就是验收和中心库自动入库以及中心库出库
......
...@@ -5,7 +5,7 @@ from airtest.core.helper import using ...@@ -5,7 +5,7 @@ from airtest.core.helper import using
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from common.common_func import commonFuc from common.common_func import commonFuc
from common.db.sql.sql_del_branch_info import delData from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_tools import get_id, process_tuple, set_goods_coding_type from common.db.sql.sql_tools import *
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
import json import json
import time import time
......
供货关系申请2: 供货关系申请2:
e_corpId: p1e386 e_corpId: p1e3ae
h_corpId: h0347 h_corpId: h0347
e_username: 国药集团公司uAfpK e_username: 国药集团公司lSTdZ
h_name: test001 h_name: test_1
产品审核信息: 产品审核信息:
MSPid: MSP2408060012_1 MSPid: MSP2408220013_1
hosId: h0347 hosId: h0347
hosGoodsId: h034700004777 hosGoodsId: h034700004905
provGoodsid: provGood-99222014 provGoodsid: provGood-99222157
goodsAuditBillId: MSP2408060012 goodsAuditBillId: MSP2408220013
targetId: MSP2408060012_1 targetId: MSP2408220013_1
...@@ -3,27 +3,26 @@ ...@@ -3,27 +3,26 @@
- &id001 - &id001
- id: - id:
hosId: h0347 hosId: h0347
branchId: h0347-3759 branchId: h0347-3764
deptId: deptId:
taskType: 1 taskType: 1
sourceOrgId: p1e37e sourceOrgId: p1e3ae
sourceOrgName: 国药集团公司sya!$ sourceOrgName: 国药集团公司lSTdZ
sourceOrderNo: PSh0347202408060022 sourceOrderNo: PSh0347202408280004
billMode: '66' billMode: '25'
stockKind: stockKind:
purMode: purMode:
sourceId: PSh0347202408060022 sourceId: PSh0347202408280004
sourceDetailId: sourceDetailId:
sourceType: PSD sourceType: PSD
sourceTypeName: 配送单 sourceTypeName: 配送单
sourceVersion: 1 sourceVersion: 1
planOrderNo: PLAN2024080634538 planOrderNo: SSSQ202408280385
purOrderNo: CG2024080622673 purOrderNo: SSTZ202408280363
recOrgId: c30ca7fe7c0f4ba8b6398caeb387bd3b recOrgId: 9e693185220a45c5a9fb8328f4d45b5d
recOrgName: 设备科001 recOrgName: 二级检验科002
billRelationJson: '{"planBillId":"Ph034720240806031183","planOrderNo":"PLAN2024080634538","purOrderNo":"CG2024080622673","purBillId":"Ch034720240806000045","purBillDate":"2024-08-06 billRelationJson: '{"operationApplyOrderNo":"SSSQ202408280385","operationNoticeBillId":"Nh034720240828000001","distrBillId":"PSh0347202408280004","operationNoticeOrderNo":"SSTZ202408280363","distrOrderNo":"PSh0347202408280004","operationApplyBillId":"Oh034720240828000001"}'
13:27:19","distrBillId":"PSh0347202408060022","distrOrderNo":"PSh0347202408060022"}' taskDate: '2024-08-28 16:05:13'
taskDate: '2024-08-06 13:30:29'
taskDateStart: taskDateStart:
taskDateEnd: taskDateEnd:
billModeList: billModeList:
...@@ -32,6 +31,7 @@ ...@@ -32,6 +31,7 @@
tbStatus: 20 tbStatus: 20
remark: remark:
pdaFlag: pdaFlag:
areaCode:
list_b: list_b:
- *id001 - *id001
list_c: list_c:
......
验收单号: 验收单号:
CHECK_NO1: CHECKh03472024080600071 CHECK_NO1: CHECKh03472024082800004
CHECK_NO2: CHECKh03472024080600071 CHECK_NO2: CHECKh03472024082800004
条码信息: 条码信息:
list_a: list_a:
- &id001 - &id001
id: '100000142024080600000776' id: '100000142024082200000877'
snCode: '100000142024080600000776' snCode: '100000142024082200000877'
ssccCode: '010839000192086229' ssccCode: '010839000192616327'
pkgCodeSee: '01376100000477901124080617250212104444241100000142024080600000776' pkgCodeSee: '01376400000490701124082217250228104444241100000142024082200000877'
hosGoodsId: h034700004779 hosGoodsId: h034700004907
hosGoodsCode: '00004779' hosGoodsCode: '00004907'
goodsCode: '00004779' goodsCode: '00004907'
goodsName: 新型冠状病毒检测试剂nDxo8 goodsName: 新型冠状病毒检测试剂C7HGi
goodsSpec: G-31891 goodsSpec: G-31891
goodsMfrsName: 德国歌德公司 Geuder AG goodsMfrsName: 德国歌德公司 Geuder AG
unit: unit:
purMode: 60 purMode: 60
batchCode: '4444' batchCode: '4444'
productDate: '2024-08-06' productDate: '2024-08-22'
expdtDate: '2025-02-12' expdtDate: '2025-02-28'
pkgDefName: '100' pkgDefName: '100'
pkgDefQty: 100.0 pkgDefQty: 100.0
stockId: 42c24f7facba4231aeda83b1348d6d1a stockId: 4188c1ded3aa4c838904ee1cc6013645
stockName: 东土城路院区l7B8J中心库房 stockName: 东土城路院区Hyl74中心库房
areaName: 自动化测试 areaName: 自动化测试
areaCode: areah03472822 areaCode: areah03472838
lockStatus: 0 lockStatus: 0
unitName: 100支/100 unitName: 100支/100
shelfCode: areah03472822-2-01-01 shelfCode: areah03472838-2-01-01
shelfName:
shelfNo: 自动化测试-2-01-01 shelfNo: 自动化测试-2-01-01
pkgDefId: 75012af7fbea44af9dd050857dac199f pkgDefId: 7b0c0e35ef8943abbc87ebd8540e3150
extInfo: '{"pkgDefId": "75012af7fbea44af9dd050857dac199f", "pkgDefQty": 100, "purBillId": extInfo: '{"pkgDefId": "7b0c0e35ef8943abbc87ebd8540e3150", "pkgDefQty": 100, "purBillId":
"CG2024080622677", "pkgDefName": "100", "distrBillId": "PSh0347202408060025", "CG2024082223071", "pkgDefName": "100", "distrBillId": "PSh0347202408220016",
"inStockTime": "2024-08-06 14:17:06", "distrDetailId": "03840788", "certificateCode": "inStockTime": "2024-08-22 14:23:42", "distrDetailId": "03841116", "certificateCode":
""}' ""}'
bottleId: bottleId:
pkgType: '66' pkgType: '66'
...@@ -39,8 +40,8 @@ ...@@ -39,8 +40,8 @@
qty: 1 qty: 1
shelfKind: 0 shelfKind: 0
shelfKindName: 普通货位 shelfKindName: 普通货位
provName: 国药集团公司uAfpK provName: 国药集团公司lSTdZ
provId: p1e386 provId: p1e3ae
inStockDate: inStockDate:
mfrCode: mfrCode:
made: 德国 made: 德国
......
产品审核信息: 产品审核信息:
MSPid: MSP2408060013_1 MSPid: MSP2408220014_1
hosId: h0347 hosId: h0347
hosGoodsId: h034700004778 hosGoodsId: h034700004906
provGoodsid: provGood-99222015 provGoodsid: provGood-99222158
goodsAuditBillId: MSP2408060013 goodsAuditBillId: MSP2408220014
targetId: MSP2408060013_1 targetId: MSP2408220014_1
二级库请领产品信息: 二级库请领产品信息:
list_a: list_a:
- &id001 - &id001
- hosGoodsId: h034700004779 - hosGoodsId: h034700004779
purMode: 60 purMode: 60
grantRule: grantRule:
id: id:
goodsName: 新型冠状病毒检测试剂nDxo8 goodsName: 新型冠状病毒检测试剂nDxo8
goodsSpec: G-31891 goodsSpec: G-31891
mdmGoodsCode: '11661765' mdmGoodsCode: '11661765'
goodsCode: '00004779' goodsCode: '00004779'
unit: unit:
goodsMfrsName: 德国歌德公司 Geuder AG goodsMfrsName: 德国歌德公司 Geuder AG
miDjmc: '' miDjmc: ''
miCode: '' miCode: ''
pkgDefName: '100' pkgDefName: '100'
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
goodsImg: [] goodsImg: []
pkgDefId: 75012af7fbea44af9dd050857dac199f pkgDefId: 75012af7fbea44af9dd050857dac199f
buyPkgQty: buyPkgQty:
unitName: 100/100 unitName: 100/100
price: 99.9999 price: 99.9999
hosId: hosId:
branchId: branchId:
...@@ -29,19 +29,19 @@ ...@@ -29,19 +29,19 @@
areaCode: areaCode:
areaName: areaName:
targetDeptId: 73235696798d429393a91a28b9467b19 targetDeptId: 73235696798d429393a91a28b9467b19
targetDeptName: 设备科001 targetDeptName: 设备科001
targetStockId: 42c24f7facba4231aeda83b1348d6d1a targetStockId: 42c24f7facba4231aeda83b1348d6d1a
targetStockName: 东土城路院区l7B8J中心库房 targetStockName: 东土城路院区l7B8J中心库房
purchaseFlag: 1 purchaseFlag: 1
tempFlag: 0 tempFlag: 0
grantWay: 1 grantWay: 1
deptGoodsStatus: deptGoodsStatus:
codingType: 0 codingType: 0
purModeText: 检验试剂 purModeText: 检验试剂
goodsGeneralName: 检测试剂 goodsGeneralName: 检测试剂
goodsRegCert: '' goodsRegCert: ''
applicationScope: applicationScope:
provName: 国药集团公司uAfpK provName: 国药集团公司uAfpK
noRecPkgQty: 2.0 noRecPkgQty: 2.0
noRecQty: 200.0 noRecQty: 200.0
autoUnpack: 0 autoUnpack: 0
......
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