Commit e3b2d16c authored by 肖 和生's avatar 肖 和生
Browse files

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

parents 51935eb6 3b691846
...@@ -859,7 +859,8 @@ def main(): ...@@ -859,7 +859,8 @@ def main():
approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号试剂', 'message12')) approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号试剂', 'message12'))
approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号', 'message7')) approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号', 'message7'))
approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号高值', 'message11')) approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号高值', 'message11'))
#外网配送前再检查一下是否有单据未审批
approval_center_all()
order_dp(1) # 1低值 order_dp(1) # 1低值
order_dp(2) # 2高值 order_dp(2) # 2高值
order_dp(3) # 3试剂 order_dp(3) # 3试剂
......
# -*- encoding=utf8 -*- # -*- encoding=utf8 -*-
import traceback import traceback
from air_case.public1.public1.public1 import updateUserLoginDefaultRange, get_listUserMgrRangePage, call_login
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command from common.run_cmd_script import execute_command
...@@ -21,478 +22,55 @@ import time ...@@ -21,478 +22,55 @@ import time
module = "b6_spd3_core_business_flow_database_check" module = "b6_spd3_core_business_flow_database_check"
def login(): pro_path = commonFuc().get_pro_path2()
module = "b2_herp3_bs" print('pro_path', pro_path)
# 登录获取用户id等信息,使用创建的用户登录===========开始 sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a5流程五_中心库入库结算_正结算1_提交采购计划.air')
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a5流程五_中心库入库结算_正结算1_提交采购计划.air')
print(info) from a_a5流程五_中心库入库结算_正结算1_提交采购计划 import goods_move3,get_GoodsPkgDef, low_vaule_purchase_plan, approval_center, hight_vaule_purchase_plan,reagent_purchase_plan
username1 = info['username1']
username = username1
## 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()
return token, projectCode, uxid, corpId, info
# 登录获取用户id等信息,使用创建的用户登录============结束
# 采购计划_低值
def low_vaule_purchase_plan():
module = "b3_herp3_purchase"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
print(info)
username1 = info['username1']
username = username1
## 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()
# 登录获取用户id等信息,使用创建的用户登录============结束
# 获取暂存的单号=======================================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_purPlan_insert_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)
hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
pkgDefId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品包装信息', 'message6')["unitPackageid1"]
# 获取院区id
branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
hosId = branch_id[0:5]
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
hospital_name = commonFuc().get_business_data(module, 'hospital_name')
areaCode = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["shelfCode"]
areaName = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["areaName"]
recUser = uxid
# # 请求体
request_body = commonFuc().get_business_data(module, "payload1_1_1", hosGoodsId, pkgDefId, hosId, branch_id,
hospital_name, deptid1, deptid1, areaCode, areaName, recUser)
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('result', result)
pid = commonFuc().analysis_json('data', result) # 采购计划号
# 获取暂存的单号==========================================================
# 获取采购计划详情中的id
url = commonFuc().get_api_add_port_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])
orderNo = commonFuc().analysis_json('orderNo', data[0])
print('orderNo',orderNo)
titlename=('orderNo1','orderNo2')
info=(orderNo,orderNo)
FileUtils().w_info8(info,'b5_spd3_core_business_flow', '采购计划单号', titlename, 'message7')
# =====================================
url = commonFuc().get_api_add_port_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)
provId = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
provName = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
subProvId = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
subProvName = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
# # 请求体
request_body = commonFuc().get_business_data(module, "payload12_1_1", pid, id1, provId, provName, subProvId,
subProvName, hosGoodsId, pkgDefId)
# 发送请求
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)
else:
commonFuc().check_text_exist('error', result)
def approval_center():
module = "b2_herp3_bs"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
print(info)
username1 = info['username1']
username = username1
## 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()
# 登录获取用户id等信息,使用创建的用户登录============结束
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "apprCenter_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, "payload50_6")
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', result)
data1 = commonFuc().analysis_json('data', data)
commonFuc().check_text_exist(0, result)
taskId = commonFuc().analysis_json('taskId', data1[0])
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "approvalBatch_url")
# 请求体
request_body = commonFuc().get_business_data(module, "payload50_7", taskId)
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', result)
if code >= 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
def get_GoodsPkgDef(hosGoodsId):
# 获取院区产品id==================开始
module = "b2_herp3_bs"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
print(info)
username1 = info['username1']
username = username1
## 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()
# 登录获取用户id等信息,使用创建的用户登录===========结束
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "mcmsBranchGoodsInfo_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"))
# 获取院区id
branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
hos_id = branch_id[0:5]
print(hos_id)
# hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
GoodsId = hosGoodsId.replace(hos_id, '')
print(GoodsId)
deptid1 = FileUtils().r_info8(module, '所有科室id', 'message6')["deptid1"]
# #请求体
request_body = commonFuc().get_business_data(module, "payload39_1_1", branch_id, hos_id, GoodsId, deptid1)
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
total = commonFuc().analysis_json('total', commonFuc().analysis_json('data', result))
data = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))
branchGoodsId = commonFuc().analysis_json('branchGoodsId', data)
hosGoodsId = commonFuc().analysis_json('hosGoodsId', data)
# 获取院区产品id ===========结束
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "branchGoodsPkgDef_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"))
# 获取院区id
branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# #请求体
request_body = commonFuc().get_business_data(module, "payload42_2", hos_id, branch_id, branchGoodsId)
print('request_body', request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
unitPackageid = commonFuc().analysis_json('id', commonFuc().analysis_json('data', result))
print('unitPackageid', unitPackageid)
info = (unitPackageid, unitPackageid)
titlename = ('unitPackageid1', 'unitPackageid2')
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '产品包装信息', titlename, 'message6')
#高值采购计划
def hight_vaule_purchase_plan():
module = "b3_herp3_purchase"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
print(info)
username1 = info['username1']
username = username1
## 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()
# 登录获取用户id等信息,使用创建的用户登录============结束
# 获取暂存的单号=======================================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_purPlan_insert_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)
hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
pkgDefId = None
# 获取院区id
branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
hosId = branch_id[0:5]
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
hospital_name = commonFuc().get_business_data(module, 'hospital_name')
areaCode = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["shelfCode"]
areaName = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["areaName"]
recUser = uxid
# # 请求体
request_body = commonFuc().get_business_data(module, "payload1_1_2", hosGoodsId, hosId, branch_id,
hospital_name, deptid1, deptid1, areaCode, areaName, recUser)
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('result', result)
pid = commonFuc().analysis_json('data', result) # 采购计划号
# 获取暂存的单号==========================================================
# 获取采购计划详情中的id
url = commonFuc().get_api_add_port_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])
orderNo = commonFuc().analysis_json('orderNo', data[0])
print('orderNo',orderNo)
titlename=('orderNo1','orderNo2')
info=(orderNo,orderNo)
FileUtils().w_info8(info,'b5_spd3_core_business_flow', '采购计划单号高值', titlename, 'message11')
# =====================================
url = commonFuc().get_api_add_port_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)
provId = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
provName = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
subProvId = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
subProvName = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
# # 请求体
request_body = commonFuc().get_business_data(module, "payload12_1_2", pid, id1, provId, provName, subProvId,
subProvName, hosGoodsId)
# 发送请求
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)
else:
commonFuc().check_text_exist('error', result)
#试剂采购计划
def reagent_purchase_plan():
module = "b3_herp3_purchase"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
print(info)
username1 = info['username1']
username = username1
## 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()
# 登录获取用户id等信息,使用创建的用户登录============结束
# 获取暂存的单号=======================================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_purPlan_insert_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)
hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
get_GoodsPkgDef(hosGoodsId) # 获取单元包id
pkgDefId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品包装信息', 'message6')["unitPackageid1"]
# 获取院区id
branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
hosId = branch_id[0:5]
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
hospital_name = commonFuc().get_business_data(module, 'hospital_name')
areaCode = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["shelfCode"]
areaName = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["areaName"]
recUser = uxid
# # 请求体
request_body = commonFuc().get_business_data(module, "payload1_1_3", hosGoodsId,pkgDefId, hosId, branch_id,
hospital_name, deptid1, deptid1, areaCode, areaName, recUser)
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('result', result)
pid = commonFuc().analysis_json('data', result) # 采购计划号
# 获取暂存的单号==========================================================
# 获取采购计划详情中的id
url = commonFuc().get_api_add_port_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])
orderNo = commonFuc().analysis_json('orderNo', data[0])
print('orderNo', orderNo)
titlename = ('orderNo1', 'orderNo2')
info = (orderNo, orderNo)
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '采购计划单号试剂', titlename, 'message12')
# =====================================
url = commonFuc().get_api_add_port_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)
provId = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
provName = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
subProvId = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
subProvName = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
# # 请求体
request_body = commonFuc().get_business_data(module, "payload12_1_3", pid, id1, provId, provName, subProvId,
subProvName, hosGoodsId,pkgDefId)
# 发送请求
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)
else:
commonFuc().check_text_exist('error', result)
def main(): def main():
token, projectCode1, uxid1, corpId1, info1 = call_login(2)
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是1级库
try: try:
goods_move3(token)
# 获取低值的hosGoodsId # 获取低值的hosGoodsId
hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
get_GoodsPkgDef(hosGoodsId) # 获取单元包id get_GoodsPkgDef(hosGoodsId,token) # 获取单元包id
except: except:
print('流程五获取hosGoodsId出现错误,请检查脚本或者数据') print('流程五获取hosGoodsId出现错误,请检查脚本或者数据')
try: try:
low_vaule_purchase_plan() low_vaule_purchase_plan(token,uxid1)
except Exception as e: except Exception as e:
print('低值采购计划提交出现错误,请检查脚本或者数据') print('低值采购计划提交出现错误,请检查脚本或者数据')
print("发生异常:", str(e)) print("发生异常:", str(e))
traceback.print_exc() traceback.print_exc()
#审批 #审批
try: try:
approval_center() approval_center(token)
except Exception as e: except Exception as e:
print('审批采购计划出现错误,请检查脚本或者数据') print('审批采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e)) print("发生异常:", str(e))
try: try:
hight_vaule_purchase_plan() hight_vaule_purchase_plan(token,uxid1)
except Exception as e: except Exception as e:
print('高值采购计划出现错误,请检查脚本或者数据') print('高值采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e)) print("发生异常:", str(e))
try: try:
approval_center() approval_center(token)
except Exception as e: except Exception as e:
print('审批采购计划出现错误,请检查脚本或者数据') print('审批采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e)) print("发生异常:", str(e))
try: try:
reagent_purchase_plan() reagent_purchase_plan(token,uxid1)
except Exception as e: except Exception as e:
print('试剂采购计划出现错误,请检查脚本或者数据') print('试剂采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e)) print("发生异常:", str(e))
try: try:
approval_center() approval_center(token)
except Exception as e: except Exception as e:
print('审批采购计划出现错误,请检查脚本或者数据') print('审批采购计划出现错误,请检查脚本或者数据')
print("发生异常:", str(e)) print("发生异常:", str(e))
commonFuc().check_text_exist_result_text('succees','succees') commonFuc().check_text_exist_result_text('succees','succees')
main() main()
\ No newline at end of file
...@@ -18,206 +18,193 @@ case_tag:api,b6_spd3_core_business_flow_database_check,a_b0流程七_中心库 ...@@ -18,206 +18,193 @@ case_tag:api,b6_spd3_core_business_flow_database_check,a_b0流程七_中心库
python runner_test.py tag id2303-10 debug mdm3 python runner_test.py tag id2303-10 debug mdm3
""" """
def check_mcms_psi_out(type=2):
print('检查中心库出库单')
if type == 1:
bill_mode = 16
elif type == 2:
bill_mode = 25
else:
bill_mode = 66
branch_id = get_branch_id()
sql = "select * from mcms_psi where source_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TH' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
sql = "select id from mcms_psi where source_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TH' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
id = get_id(sql)
sql = "select order_no from mcms_psi where source_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TH' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
order_no = get_id(sql)
target_corp_id = get_hosid()
target_branch_id =get_branch_id()
target_dept_id =FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
target_dept_name =FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_name = get_branch_name() + "中心库房"
target_stock_id = get_stockId_fromdb(get_branch_name()+'中心库房')
target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 1)
source_id =get_id("select id from mcms_psi_dept where target_branch_id='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;"%branch_id)
source_no = None
source_repl_id = None
source_corp_id = get_hosid()
source_branch_id = get_branch_id()
source_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
source_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
source_stock_id = get_stockId_fromdb(source_dept_name+'库房')
source_area_code = get_stockAreaId_new_fromDb(source_dept_name, 2)
accounter = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
account_date = get_create_time("select account_date from mcms_psi where id='%s';" % id)
buyBillId = get_buyBillId(branch_id, bill_mode)
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
pickBillId = get_PICK_id_KS_TK(branch_id, bill_mode)
pickOrderNo =get_id("select order_no from mcms_pick where id='%s';"%pickBillId)
def test1(): planBillId = get_planBillId(hos_goods_id)
# 提交采购计划 psiOutBillId = get_id("select id from mcms_psi_dept where target_branch_id='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;"%branch_id)
execute_command("python runner_test.py tag id2302-5 debug mdm3") psiOutOrderNo =get_id("select order_no from mcms_psi_dept where id='%s';"%psiOutBillId)
# 外网配送
execute_command("python runner_test.py tag id2302-6 debug mdm3") buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
# 内网验收入库结算 purOrderNo = get_purOrderNo(branch_id, bill_mode)
execute_command("python runner_test.py tag id2302-7 debug mdm3") purBillId = get_purBillId(branch_id, bill_mode)
bill_relation_json = get_purBillDate2(branch_id, bill_mode)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
# 中心库退货 distrBillId = get_distrBillId(branch_id, bill_mode)
def center_warehouse_return(): distrOrderNo = get_distrOrderNo(branch_id, bill_mode)
module = "b5_spd3_core_business_flow" checkBillId = source_id
# # 登录获取用户id等信息,使用创建的用户登录===========开始 sql = "select order_no from mcms_check where id='%s';" % checkBillId
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') checkOrderNo = get_id(sql)
username = info['username1'] psiInBillId = id
password = commonFuc().get_business_data("b2_herp3_bs", "password") psiInOrderNo = order_no
print('username,password', username, password) create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
# # 获取token和projectCode create_time = get_create_time("select create_time from mcms_psi where id='%s';" % id)
token, projectCode, uxid, corpId, info = login(username, password, 2) last_modified = get_create_time("select last_modified from mcms_psi where id='%s';" % id)
# 登录获取用户id等信息,使用创建的用户登录============结束 last_modified_user = create_user
# 到库房明细查询,查询产品的udi码
get_udi(1)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_pick_submit_url") check_mcms_psi_batch_out2(id, type, order_no, source_id)
print('url', url) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi_out_0913', id,
headers = commonFuc().get_business_data(module, "json_headers2", order_no, target_corp_id, target_branch_id, target_dept_id,
commonFuc().get_business_data(module, "json_contentType"), token, target_dept_name, target_stock_id
commonFuc().get_business_data(module, "X-APP-CODE")) , target_area_code, source_id,
#从文件中获取必要信息 source_corp_id, source_branch_id, source_dept_id, source_dept_name
info = FileUtils().r_info8(module, "条码信息", 'message18') , source_stock_id, source_area_code, accounter, account_date,
# print('info', info) pickOrderNo, pickBillId,
list_a = info['list_a'] psiOutBillId, psiOutOrderNo,psiInBillId,psiInOrderNo,
print('list_a', list_a[0], type(list_a), len(list_a)) create_user
UTid = 'UT' , create_time, last_modified, last_modified_user)
areaCode = 'areaCode'
createTime = 'createTime' # 对比预期值和实际值是否一致
hosId = 'hosId' actual_value1 = get_process_list2(actual)
stockId = 'stockId' expected_value1 = get_process_list2(expected)
areaCode = 'areaCode' actual_value2 = actual_value1.replace(" ", "")
areaName = 'areaName' expected_value2 = expected_value1.replace(" ", "")
shelfCode = 'shelfCode' # print('actual_value2',actual_value2)
codeType = 'codeType' print('expected_value2')
tagType = 'tagType' print(expected_value2)
hosGoodsId = 'hosGoodsId' print('actual_value2')
mdmGoodsCode = 'mdmGoodsCode' print(actual_value2)
goodsCode = 'goodsCode' result = (compare_text_index(actual_value2, expected_value2))
goodsDi = 'goodsDi'
barName = 'barName'
batchCode = 'batchCode'
expdtDate = 'expdtDate'
productDate = 'productDate'
pkgCode = 'pkgCode'
pkgCodeSee = 'pkgCodeSee'
ssccCode = 'ssccCode'
tbStatus = 'tbStatus'
pkgDefQty = 'pkgDefQty'
purBillId = 'purBillId'
distrBillId = 'distrBillId'
inStockTime = 'inStockTime'
distrDetailId = 'distrDetailId'
purMode = 'purMode'
goodsMfrsName = 'goodsMfrsName'
goodsSpec = 'goodsSpec'
unit = 'unit'
goodsName = 'goodsName'
printNum = 'printNum'
made = 'made'
provId = 'provId'
provName = 'provName'
subProvId = 'subProvId'
subProvName = 'subProvName'
hosGoodsCode = 'hosGoodsCode'
subSendFlag = 'subSendFlag'
onlyKey = 'onlyKey'
pkgDefId = 'pkgDefId'
pkgDefName = 'pkgDefName'
print('aaaaaaaaaaaaaaaaaaaaaaaaa', list_a[0])
list_b = list_a[0]
for i in list_b:
print(i)
UTid = i['id']
areaCode = i['areaCode']
createTime = i['createTime']
hosId = i['hosId']
stockId = i['stockId']
areaCode = i['areaCode']
areaName = i['areaName']
shelfCode = i['shelfCode']
codeType = i['codeType']
tagType = i['tagType']
hosGoodsId = i['hosGoodsId']
mdmGoodsCode = i['mdmGoodsCode']
goodsCode = i['goodsCode']
goodsDi = i['goodsDi']
barName = i['barName']
batchCode = i['batchCode']
expdtDate = i['expdtDate']
productDate = i['productDate']
pkgCode = i['pkgCode']
pkgCodeSee = i['pkgCodeSee']
ssccCode = i['ssccCode']
tbStatus = i['tbStatus']
onlyKey = i['hosGoodsId']
ext = i['ext']
print('ext', ext)
distrDetailId = ext['distrDetailId']
distrBillId = ext['distrBillId']
purBillId = ext['purBillId']
pkgDefQty = ext['pkgDefQty']
pkgDefId = ext['pkgDefId']
pkgDefName = ext['pkgDefName']
purMode = i['purMode']
goodsMfrsName = i['goodsMfrsName']
goodsSpec = i['goodsSpec']
unit = i['unit']
goodsName = i['goodsName']
pkgDefId = i['pkgDefId']
pkgDefQty = i['pkgDefQty']
pkgDefName = i['pkgDefName']
printNum = i['printNum']
made = i['made']
provId = i['provId']
provName = i['provName']
subProvId = i['subProvId']
subProvName = i['subProvName']
hosGoodsCode = i['hosGoodsCode']
subSendFlag = i['subSendFlag']
areaName = i['areaName']
hosId = i['hosId']
break
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid1"]
# # 请求体
request_body = commonFuc().get_business_data(module, "payload19", areaCode, UTid, createTime, UTid, hosId, stockId,
areaCode, areaName, shelfCode, codeType, tagType, hosGoodsId,
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate,
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus, distrDetailId,
distrBillId, purBillId, pkgDefQty, pkgDefId, pkgDefName, purMode,
goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty,
pkgDefName, printNum, made, provId, provName, subProvId, subProvName,
hosGoodsCode, subSendFlag, onlyKey, areaName, hosId, get_branch_id(),
deptid1, deptName, stockId)
print('request_body', 'ccccccc', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
PICK_ID = commonFuc().analysis_json('data', result)
# =====================出库复核列表查询获取pickid===============
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_pick_return_page_url")
print('url', url)
request_body = commonFuc().get_business_data(module, "payload20", get_branch_id(), get_hosid(), deptid1)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result) print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_batch_out2(DR_ID, type, order_no, source_id1):
if type == 1:
bill_mode = 16
elif type == 2:
bill_mode = 25
else:
bill_mode = 66
branch_id = get_branch_id()
sql = " select * from mcms_psi_batch where pid='%s';" % (
DR_ID)
actual = check_mcms_dept_buy_sql(sql)
print('actual', actual)
batch_main_key = get_id("select id from mcms_psi_batch where pid='%s';" % DR_ID)
pid = DR_ID
# order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
sql="select id from mcms_psi_dept where target_branch_id='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;"%branch_id
source_detail_id =get_id(sql)
source_detail_id=source_detail_id+'0001'
pick_detail_id = None
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
goods_code = get_goods_code1(hos_goods_id)
pkg_def_id = get_pkg_def_id(hos_goods_id)
picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker = get_login_user_uxid_bydb(picker_name)
source_batch_id = get_id("select source_batch_id from mcms_psi_batch where pid='%s';" % DR_ID)
distrBillId = get_distrBillId(branch_id, bill_mode)
target_batch_id = source_batch_id
if check_batch_id(source_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
barcode_id = get_id("select barcode_id from mcms_psi_batch where pid='%s';" % DR_ID)
if check_barcode_id(barcode_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
shelf_code = get_stockAreaId_new_fromDb(get_branch_name(), 1)
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi_batch where pid='%s';" % DR_ID)
last_modified = get_create_time("select last_modified from mcms_psi_batch where pid='%s';" % DR_ID)
last_modified_user = None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_out_0913', batch_main_key, pid, order_no, source_detail_id
, pick_detail_id,hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified, last_modified_user
)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
# =====================出库复核列表查询获取pickid===============
# =======================查看出库单详细信息===============
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_pick_checkReview_url")
url = url + ' '.join(PICK_ID) + '?pickedFlag=true'
print('url', url)
# # # # 发送请求
result = commonFuc().http_get(url, headers)
print('查看出库单详细信息result', result)
# =======================查看出库单详细信息===============
# ========================扫码复核
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_hdiBarcode_scan_url")
url = url + pkgCode
print('url', url)
# # # # 发送请求
result = commonFuc().http_get(url, headers)
print('扫码复核result', result)
data = commonFuc().analysis_json('data', result)
UT_id = commonFuc().analysis_json('id', data)
createTime = commonFuc().analysis_json('createTime', data)
snCode = commonFuc().analysis_json('snCode', data)
tbStatus=commonFuc().analysis_json('tbStatus', data)
print(UT_id)
# ========================扫码复核
# ========出库复核提交==========
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_review_pass_submit_url")
print('url', url)
sourceId = ' '.join(PICK_ID)
# 请求体
request_body = commonFuc().get_business_data(module, "payload21", UT_id, createTime, snCode, hosId, stockId,
areaCode, areaName, shelfCode, codeType, tagType, hosGoodsId,
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate,
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus, distrDetailId,
distrBillId, purBillId, pkgDefQty, pkgDefId, pkgDefName, purMode,
goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty,
pkgDefName, made, hosGoodsCode, sourceId)
print('request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('herpService_stock_review_pass_submit_urlresult', result)
# ========出库复核提交
pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b0流程七_中心库入库结算_正负结算.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b0流程七_中心库入库结算_正负结算.air')
from a_b0流程七_中心库入库结算_正负结算 import center_warehouse_return
try: try:
# test1() # 提交采购计划 # 外网配送 # 内网验收入库结算 # test1() # 提交采购计划 # 外网配送 # 内网验收入库结算
...@@ -228,11 +215,15 @@ try: ...@@ -228,11 +215,15 @@ try:
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'],2) set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'],2)
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid3'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid3'],3) set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid3'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid3'],3)
center_warehouse_return()#中心库退货 center_warehouse_return()#中心库退货
time.sleep(6)
check_mcms_psi_out(1) #验证出库单数据据数据(低值)
OBh_ID=settle() # 生成结算单 OBh_ID=settle() # 生成结算单
# print(OBh_ID) # print(OBh_ID)
# 调用审批结算单 # 调用审批结算单
approval_center(OBh_ID) approval_center(OBh_ID)
invoice(3,OBh_ID)#type=2 传递结算单号,外网查询开票 invoice(3,OBh_ID)#type=2 传递结算单号,外网查询开票
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
except: except Exception as e:
commonFuc().check_text_exist_result_text('error', '1') # 打印错误信息
print(f"发生错误: {e}")
commonFuc().check_text_exist_result_text('error', 'succees')
\ No newline at end of file
...@@ -6,7 +6,7 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_ ...@@ -6,7 +6,7 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_
from air_case.public1.public1.public1 import * from air_case.public1.public1.public1 import *
from common.db.sql.sql_tools import check_mcms_dept_buy_sql, get_login_user_uxid_bydb, get_create_time, get_goods_code1, \ from common.db.sql.sql_tools import check_mcms_dept_buy_sql, get_login_user_uxid_bydb, get_create_time, get_goods_code1, \
get_goods_name, get_dept_buy_id, get_ext_info, check_mcms_pur_plan_sql, get_mdm_goods_code1, get_goods_gg, \ get_goods_name, get_dept_buy_id, get_ext_info, check_mcms_pur_plan_sql, get_mdm_goods_code1, get_goods_gg, \
get_goods_mfrs_id, get_expdt_date, get_supply_id get_goods_mfrs_id, get_expdt_date, get_supply_id, get_id
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command from common.run_cmd_script import execute_command
...@@ -616,8 +616,8 @@ def check_hdi_distr_detail(distr_main_key, type): ...@@ -616,8 +616,8 @@ def check_hdi_distr_detail(distr_main_key, type):
operationNoticeBillId = source_id operationNoticeBillId = source_id
operationNoticeBillDetailId = source_detail_id operationNoticeBillDetailId = source_detail_id
operationApplyBillDetailId = get_id( operationApplyBillDetailId = get_id(
"select id from spd3_herp_test2.mcms_operation_apply where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % branch_id) "select id from spd3_herp_test2.mcms_operation_apply_list where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % hos_goods_id)
operationApplyBillDetailId = operationApplyBillDetailId.replace("O", "") # operationApplyBillDetailId = operationApplyBillDetailId.replace("O", "")
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr_detail_0911', distr_detail_main_key, distr_main_key, source_id, 'hdi_distr_detail_0911', distr_detail_main_key, distr_main_key, source_id,
source_detail_id, pur_detail_id source_detail_id, pur_detail_id
...@@ -1583,9 +1583,9 @@ def check_mcms_psi_dept_out(type=25): ...@@ -1583,9 +1583,9 @@ def check_mcms_psi_dept_out(type=25):
source_id = get_PICK_id_KS_TK(branch_id,bill_mode) source_id = get_PICK_id_KS_TK(branch_id,bill_mode)
source_no = get_id("select order_no from mcms_psi_dept where id='%s';" % source_id) source_no = get_id("select order_no from mcms_psi_dept where id='%s';" % source_id)
# 获取order_no # 获取order_no
# sql = " select order_no from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;" % ( sql = " select order_no from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;" % (
# branch_id, bill_mode) branch_id, bill_mode)
order_no = None order_no = get_id(sql)
target_corp_id = get_hosid() target_corp_id = get_hosid()
target_branch_id = get_branch_id() target_branch_id = get_branch_id()
target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1'] target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
...@@ -1601,11 +1601,12 @@ def check_mcms_psi_dept_out(type=25): ...@@ -1601,11 +1601,12 @@ def check_mcms_psi_dept_out(type=25):
source_stock_id = get_stockId_fromdb(source_dept_name + '库房') source_stock_id = get_stockId_fromdb(source_dept_name + '库房')
source_area_code = get_stockAreaId_new_fromDb(source_dept_name, 2) source_area_code = get_stockAreaId_new_fromDb(source_dept_name, 2)
buyBillId = get_buyBillId(branch_id, bill_mode) buyBillId = get_buyBillId(branch_id, bill_mode)
pickOrderNo = get_PICK_order_no(branch_id, bill_mode) pickBillId = get_PICK_id_KS_TK(branch_id, bill_mode)
sql="select order_no from mcms_pick where id='%s';"%pickBillId
pickOrderNo = get_id(sql)
buyOrderNo = get_buyOrderNo(branch_id, bill_mode) buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
pickBillId = get_PICK_id(branch_id, bill_mode) psiDeptOutBillId = id
psiDeptOutBillId = source_id psiDeptOutOrderNo = order_no
psiDeptOutOrderNo = source_no
if type == 16: if type == 16:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 25: elif type == 25:
...@@ -1643,26 +1644,15 @@ def check_mcms_psi_dept_out(type=25): ...@@ -1643,26 +1644,15 @@ def check_mcms_psi_dept_out(type=25):
# 子表检查 # 子表检查
check_mcms_psi_dept_batch_out(id, type, hos_goods_id) check_mcms_psi_dept_batch_out(id, type, hos_goods_id)
operationApplyOrderNo = get_id(
"select order_no from spd3_herp_test2.mcms_operation_apply where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
operationNoticeBillId = get_id(
"select id from spd3_herp_test2.mcms_operation_notice where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
operationNoticeOrderNo = get_id(
"select order_no from spd3_herp_test2.mcms_operation_notice where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
operationApplyBillId = get_id(
"select id from spd3_herp_test2.mcms_operation_apply where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
psiOutBillId=get_id("select id from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_QL' order by CREATE_TIME desc LIMIT 1;"%(branch_id,bill_mode))
psiOutOrderNo=get_id("select order_no from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_QL' order by CREATE_TIME desc LIMIT 1;"%(branch_id,bill_mode))
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_out_0913', id, order_no, target_corp_id, target_branch_id, 'mcms_psi_dept_out_0913', id, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
, target_area_code, source_id, source_no, source_repl_id, , target_area_code, source_id,
source_corp_id, source_branch_id, source_corp_id, source_branch_id,
source_dept_id, source_dept_name, source_stock_id, source_area_code, source_dept_id, source_dept_name, source_stock_id, source_area_code,
accounter, account_date, operationApplyOrderNo, operationNoticeBillId, distrBillId, accounter, account_date, pickOrderNo, pickBillId, psiDeptOutBillId,
operationNoticeOrderNo, distrOrderNo, operationApplyBillId, checkBillId, checkOrderNo, psiDeptOutOrderNo,
psiInBillId, psiInOrderNo, psiOutBillId, psiOutOrderNo, psiDeptInBillId,
psiDeptInOrderNo,
create_user, create_time, last_modified, last_modified_user) create_user, create_time, last_modified, last_modified_user)
...@@ -2064,6 +2054,189 @@ def check_mcms_psi_dept_batch_xhrk(DR_ID,source_ID,type,order_no): ...@@ -2064,6 +2054,189 @@ def check_mcms_psi_dept_batch_xhrk(DR_ID,source_ID,type,order_no):
else: else:
print('error') print('error')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_out(type=2):
print('检查中心库出库单')
if type == 1:
bill_mode = 16
elif type == 2:
bill_mode = 25
else:
bill_mode = 66
branch_id = get_branch_id()
sql = "select * from mcms_psi where source_branch_id='%s' and bill_mode='%s' and stock_kind='RK_TK' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
sql = "select id from mcms_psi where source_branch_id='%s' and bill_mode='%s' and stock_kind='RK_TK' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
id = get_id(sql)
sql = "select order_no from mcms_psi where source_branch_id='%s' and bill_mode='%s' and stock_kind='RK_TK' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
order_no = get_id(sql)
target_corp_id = get_hosid()
target_branch_id =get_branch_id()
target_dept_id =FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
target_dept_name =FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_name = get_branch_name() + "中心库房"
target_stock_id = get_stockId_fromdb(get_branch_name()+'中心库房')
target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 1)
source_id =get_id("select id from mcms_psi_dept where target_branch_id='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;"%branch_id)
source_no = None
source_repl_id = None
source_corp_id = get_hosid()
source_branch_id = get_branch_id()
source_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
source_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
source_stock_id = get_stockId_fromdb(source_dept_name+'库房')
source_area_code = get_stockAreaId_new_fromDb(source_dept_name, 2)
accounter = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
account_date = get_create_time("select account_date from mcms_psi where id='%s';" % id)
buyBillId = get_buyBillId(branch_id, bill_mode)
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
pickBillId = get_PICK_id_KS_TK(branch_id, bill_mode)
pickOrderNo =get_id("select order_no from mcms_pick where id='%s';"%pickBillId)
planBillId = get_planBillId(hos_goods_id)
psiOutBillId = get_id("select id from mcms_psi_dept where target_branch_id='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;"%branch_id)
psiOutOrderNo =get_id("select order_no from mcms_psi_dept where id='%s';"%psiOutBillId)
buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
purOrderNo = get_purOrderNo(branch_id, bill_mode)
purBillId = get_purBillId(branch_id, bill_mode)
bill_relation_json = get_purBillDate2(branch_id, bill_mode)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
distrBillId = get_distrBillId(branch_id, bill_mode)
distrOrderNo = get_distrOrderNo(branch_id, bill_mode)
checkBillId = source_id
sql = "select order_no from mcms_check where id='%s';" % checkBillId
checkOrderNo = get_id(sql)
psiInBillId = id
psiInOrderNo = order_no
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_psi where id='%s';" % id)
last_modified_user = create_user
check_mcms_psi_batch_out2(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi_out_0913', id,
order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
, target_area_code, source_id,
source_corp_id, source_branch_id, source_dept_id, source_dept_name
, source_stock_id, source_area_code, accounter, account_date,
pickOrderNo, pickBillId,
psiOutBillId, psiOutOrderNo,psiInBillId,psiInOrderNo,
create_user
, create_time, last_modified, last_modified_user)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_batch_out2(DR_ID, type, order_no, source_id1):
if type == 1:
bill_mode = 16
elif type == 2:
bill_mode = 25
else:
bill_mode = 66
branch_id = get_branch_id()
sql = " select * from mcms_psi_batch where pid='%s';" % (
DR_ID)
actual = check_mcms_dept_buy_sql(sql)
print('actual', actual)
batch_main_key = get_id("select id from mcms_psi_batch where pid='%s';" % DR_ID)
pid = DR_ID
# order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
sql="select id from mcms_psi_dept where target_branch_id='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;"%branch_id
source_detail_id =get_id(sql)
source_detail_id=source_detail_id+'0001'
pick_detail_id = None
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
goods_code = get_goods_code1(hos_goods_id)
pkg_def_id = get_pkg_def_id(hos_goods_id)
picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker = get_login_user_uxid_bydb(picker_name)
source_batch_id = get_id("select source_batch_id from mcms_psi_batch where pid='%s';" % DR_ID)
distrBillId = get_distrBillId(branch_id, bill_mode)
target_batch_id = source_batch_id
if check_batch_id(source_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
barcode_id = get_id("select barcode_id from mcms_psi_batch where pid='%s';" % DR_ID)
if check_barcode_id(barcode_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
shelf_code = get_stockAreaId_new_fromDb(get_branch_name(), 1)
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi_batch where pid='%s';" % DR_ID)
last_modified = get_create_time("select last_modified from mcms_psi_batch where pid='%s';" % DR_ID)
last_modified_user = None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_out_0913', batch_main_key, pid, order_no, source_detail_id
, pick_detail_id,hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified, last_modified_user
)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
pro_path = commonFuc().get_pro_path2() pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path) print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟台业务流程.air') sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟台业务流程.air')
...@@ -2071,46 +2244,50 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟 ...@@ -2071,46 +2244,50 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟
from a_b1流程八_高值跟台业务流程 import dept2_set, operationApply, second_dept_in_warehouse, out_return_gt from a_b1流程八_高值跟台业务流程 import dept2_set, operationApply, second_dept_in_warehouse, out_return_gt
try: try:
# dept2_set() dept2_set()
# # # # # 设置默认科室,切换到二级科室,使用科室管理功能 # # # # 设置默认科室,切换到二级科室,使用科室管理功能
# updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
# herpService_mcmsDeptGoodsInfo_getByProvIdPage() herpService_mcmsDeptGoodsInfo_getByProvIdPage()
# time.sleep(6) time.sleep(6)
# operationApply() # 手术跟台申请单提交 operationApply() # 手术跟台申请单提交
# time.sleep(6) time.sleep(6)
# check_mcms_operation_apply()# 手术跟台申请单数据库检查 check_mcms_operation_apply()# 手术跟台申请单数据库检查
# approval_center() # 二级科室审批审批手术跟台申请单 approval_center() # 二级科室审批审批手术跟台申请单
# updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库 updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
# approval_center1() # 中心库再次审批手术跟台申请单 approval_center1() # 中心库再次审批手术跟台申请单
# time.sleep(6) time.sleep(6)
# check_mcms_operation_apply_approval_after() # 手术跟台申请单审批后的数据库检查 check_mcms_operation_apply_approval_after() # 手术跟台申请单审批后的数据库检查
# # #内网查询手术通知单号 # #内网查询手术通知单号
# updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库 updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
# time.sleep(6) time.sleep(6)
# check_mcms_operation_notice()# 手术通知单数据库检查 check_mcms_operation_notice()# 手术通知单数据库检查
# time.sleep(6) time.sleep(6)
# orderno = Search_OrderNO() # 手术通知单接口查询单号 orderno = Search_OrderNO() # 手术通知单接口查询单号
# height_value_order_dp(orderno) # 高值跟台外网配送 height_value_order_dp(orderno) # 高值跟台外网配送
# time.sleep(6) time.sleep(6)
# check_hdi_distr() # 外网配送单数据库检查 check_hdi_distr() # 外网配送单数据库检查
# time.sleep(6) time.sleep(6)
# check_accept_order() # 内网验收 check_accept_order() # 内网验收
# time.sleep(6) time.sleep(6)
# check_mcms_check(2)#高值跟台验收检查验收表数据 check_mcms_check(2)#高值跟台验收检查验收表数据
# #这里验收后会自动生成出入库单,批次信息,需要同步验证入库单和批次信息 #这里验收后会自动生成出入库单,批次信息,需要同步验证入库单和批次信息
# check_mcms_psi(2) # 调用函数检查中心库入库单和出库单数据库写值 check_mcms_psi(2) # 调用函数检查中心库入库单和出库单数据库写值
# # 检查批次信息 # 检查批次信息
# check_mcms_hos_batch(2) check_mcms_hos_batch(2)
# updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
# second_dept_in_warehouse() # 二级科室入库 second_dept_in_warehouse() # 二级科室入库
# time.sleep(6) time.sleep(6)
# check_mcms_psi_dept_in() # 检查二级库入库单数据库表数据 check_mcms_psi_dept_in() # 检查二级库入库单数据库表数据
# updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库 updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
# out_return_gt() # 跟台退货出库_中心库处理 out_return_gt() # 跟台退货出库_中心库处理
# time.sleep(6) time.sleep(6)
# #这里的业务会产生二级库消耗出库和消耗退货入库单据,和二级库出库数据 #这里的业务会产生二级库消耗出库和消耗退货入库单据,和二级库出库数据
# check_mcms_psi_dept_XH_CK() check_mcms_psi_dept_XH_CK()
time.sleep(6)
check_mcms_psi_dept_out()# 检查二级库退库出库单数据库表数据 check_mcms_psi_dept_out()# 检查二级库退库出库单数据库表数据
# 检查中心库出库单
time.sleep(2)
check_mcms_psi_out()
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
except Exception as e: except Exception as e:
# 打印错误信息 # 打印错误信息
......
...@@ -2431,6 +2431,8 @@ def main(): ...@@ -2431,6 +2431,8 @@ def main():
check_mcms_purchase_out_and_in(1) #1主表 check_mcms_purchase_out_and_in(1) #1主表
print('检查同步到外网的采购订单数据跟内网的是否一致') print('检查同步到外网的采购订单数据跟内网的是否一致')
check_mcms_purchase_out_and_in(2) #2子表 check_mcms_purchase_out_and_in(2) #2子表
# 外网配送前再检查一下是否有单据未审批
approval_center_all()
order_dp(1) # 1低值 配送单发货 order_dp(1) # 1低值 配送单发货
time.sleep(6) time.sleep(6)
order_dp(2) # 2高值 配送单发货 order_dp(2) # 2高值 配送单发货
......
...@@ -58,22 +58,34 @@ import sys ...@@ -58,22 +58,34 @@ import sys
# commonFuc().check_text_exist_result_text('error', 'succees') # commonFuc().check_text_exist_result_text('error', 'succees')
# 第二种方式================================= # 第二种方式=================================
# 备份当前data目录 # # 备份当前data目录
pro_path = commonFuc().get_pro_path2() # pro_path = commonFuc().get_pro_path2()
src = pro_path + r'/data' # src = pro_path + r'/data'
dst = pro_path + r'/data' + get_branch_name()+get_branch_id() # dst = pro_path + r'/data' + get_branch_name()+get_branch_id()
#将备份的目录路径写入到文件中 # #将备份的目录路径写入到文件中
info = (src, dst) # info = (src, dst)
titlename = ('源目录', '备份目录') # titlename = ('源目录', '备份目录')
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '备份路径',titlename,'message29') # FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '备份路径',titlename,'message29')
#备份目录 # #备份目录
FileUtils().copy_folder_backup(src, dst) # FileUtils().copy_folder_backup(src, dst)
#
dst=FileUtils().r_info8('b5_spd3_core_business_flow', '备份路径','message29')['备份目录'] # dst=FileUtils().r_info8('b5_spd3_core_business_flow', '备份路径','message29')['备份目录']
#恢复目录 # #恢复目录
#先删除文件夹 # #先删除文件夹
import shutil,os # import shutil,os
if os.path.exists(src): # if os.path.exists(src):
shutil.rmtree(src) # shutil.rmtree(src)
#
# FileUtils().copy_folder_backup(dst,src)
FileUtils().copy_folder_backup(dst,src) list1=get_all_goodsinfo()
print(len(list1))
for i in list1:
# print(i)
# print(type(i))
str1 = str(i)
new_str1 = str1.replace('(', '')
new_str1 = new_str1.replace(')', '')
new_str1 = new_str1.replace("'", '"')
# new_str1 = new_str1.replace("'", '')
print(new_str1)
...@@ -276,6 +276,8 @@ def approval_center_all(OBH_ID='OBhxxxxxxxxxxxxxxx'): ...@@ -276,6 +276,8 @@ def approval_center_all(OBH_ID='OBhxxxxxxxxxxxxxxx'):
total = commonFuc().analysis_json('total', result) total = commonFuc().analysis_json('total', result)
if code >= 0: if code >= 0:
commonFuc().check_text_exist(0, result) commonFuc().check_text_exist(0, result)
elif code=='14070024':
commonFuc().check_text_exist('error', result)
else: else:
commonFuc().check_text_exist('error', result) commonFuc().check_text_exist('error', result)
......
...@@ -699,3 +699,14 @@ def get_last_auditor(order_no): ...@@ -699,3 +699,14 @@ def get_last_auditor(order_no):
# except Exception as e: # except Exception as e:
# # 打印错误信息 # # 打印错误信息
# print(f"发生错误: {e}") # print(f"发生错误: {e}")
def get_all_goodsinfo():
db, cursor = get_sql_conn()
sql="select * from mcms_goods_info;"
res_dict =get_dict_data_sql(cursor, sql)
print('res_dict', res_dict)
cursor.close()
db.close()
return res_dict
...@@ -344,3 +344,9 @@ ...@@ -344,3 +344,9 @@
"mcms_psi_dept_batch_0913": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "pick_detail_id": "%s", "pur_mode": 20, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "source_batch_id": "%s", "target_batch_id": "%s", "settle_flag": 0, "psi_price": Decimal("99.9999"), "qty": Decimal("1.00"), "unit_name": "1支", "barcode_id": "%s", "sub_barcode_id": None, "shelf_code": "%s-A-01-01", "tb_status": 0, "charge_flag": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}' "mcms_psi_dept_batch_0913": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "pick_detail_id": "%s", "pur_mode": 20, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "source_batch_id": "%s", "target_batch_id": "%s", "settle_flag": 0, "psi_price": Decimal("99.9999"), "qty": Decimal("1.00"), "unit_name": "1支", "barcode_id": "%s", "sub_barcode_id": None, "shelf_code": "%s-A-01-01", "tb_status": 0, "charge_flag": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
#跟台二级库出库单到中心库主表 #跟台二级库出库单到中心库主表
"mcms_psi_dept_out_0913": '{"id":"%s","order_no":"%s","bill_mode":"25","rec_type":"YND","psi_flag":-1,"psi_kind":"203","stock_kind":"CK_TK","target_corp_id":"%s","target_branch_id":"%s","target_dept_id":"%s","target_dept_name":"%s","target_stock_id":"%s","target_area_code":"%s","target_area_name":"自动化测试","source_id":"%s","source_no":null,"source_repl_id":null,"source_corp_id":"%s","source_branch_id":"%s","source_dept_id":"%s","source_dept_name":"%s","source_stock_id":"%s","source_area_code":"%s","source_area_name":"默认库区","consume_type":0,"patient_id":null,"patient_name":null,"machine_id":null,"machine_name":null,"his_charge_no":null,"remark":null,"tb_status":40,"accounter":"%s","account_date":"%s","bill_relation_json":"{"pickOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}","create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":"%s","version":2,"last_auditor":null,"last_audit_time":null,"reject_reason":null,"reject_user":null,"reject_time":null,"initial_order":null,"source_type":"SG","target_coding_type":null}' "mcms_psi_dept_out_0913": '{"id":"%s","order_no":"%s","bill_mode":"25","rec_type":"YND","psi_flag":-1,"psi_kind":"203","stock_kind":"CK_TK","target_corp_id":"%s","target_branch_id":"%s","target_dept_id":"%s","target_dept_name":"%s","target_stock_id":"%s","target_area_code":"%s","target_area_name":"自动化测试","source_id":"%s","source_no":null,"source_repl_id":null,"source_corp_id":"%s","source_branch_id":"%s","source_dept_id":"%s","source_dept_name":"%s","source_stock_id":"%s","source_area_code":"%s","source_area_name":"默认库区","consume_type":0,"patient_id":null,"patient_name":null,"machine_id":null,"machine_name":null,"his_charge_no":null,"remark":null,"tb_status":40,"accounter":"%s","account_date":"%s","bill_relation_json":"{"pickOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}","create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":"%s","version":2,"last_auditor":null,"last_audit_time":null,"reject_reason":null,"reject_user":null,"reject_time":null,"initial_order":null,"source_type":"SG","target_coding_type":null}'
#跟台中心库出库子表
"mcms_psi_batch_out_0913": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":%s,"pur_mode":20,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("1.00"),"unit_name":"1支","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":0,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":%s,"version":0}'
#跟台中心库出库主表
"check_mcms_psi_out_0913": '{"id":"%s","order_no":"%s","bill_mode":"25","rec_type":"YND","psi_flag":1,"psi_kind":"103","stock_kind":"RK_TK","target_corp_id":"%s","target_branch_id":"%s","target_dept_id":"%s","target_dept_name":"%s","target_stock_id":"%s","target_area_code":"%s","target_area_name":"自动化测试","source_id":"%s","source_no":null,"source_repl_id":null,"source_corp_id":"%s","source_branch_id":"%s","source_dept_id":"%s","source_dept_name":"%s","source_stock_id":"%s","source_area_code":"%s","source_area_name":"默认库区","remark":null,"tb_status":30,"accounter":"%s","account_date":%s,"bill_relation_json":"{"pickOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%s"}","reject_time":null,"reject_remark":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":"%s","version":1,"last_auditor":null,"last_audit_time":null,"reject_user":null,"initial_order":null,"source_type":"SG","reject_reason":null,"receipt_status":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