Commit 62294e7b authored by xiao-hesheng's avatar xiao-hesheng
Browse files

优化调整脚本

parent 37904ae4
......@@ -329,6 +329,7 @@ def add_StockArea():#添加货位
def recover_dataFile():
delData().Delete_branch_by_id(2)
delData().Delete_probeInfo_other(2)
pro_path = commonFuc().get_pro_path2()
src = pro_path + r'/data'
dst=FileUtils().r_info8('b5_spd3_core_business_flow', '备份路径','message29')['备份目录']
......@@ -338,7 +339,7 @@ def recover_dataFile():
if os.path.exists(src):
shutil.rmtree(src)
FileUtils().copy_folder_backup(dst, src)
def branch_add(token):
def branch_add():
module='b2_herp3_bs'
# 内网登录
username = commonFuc().get_business_data(module, "username")
......@@ -369,7 +370,7 @@ def branch_add(token):
#备份当前data目录
pro_path = commonFuc().get_pro_path2()
src=pro_path+r'/data'
dst=pro_path+r'/data'+ timeUtils().get_time_hms(5)
dst=pro_path+r'/data'+ get_branch_name()+get_branch_id()
#将备份的目录路径写入到文件中
info = (src, dst)
titlename = ('源目录', '备份目录')
......
# -*- encoding=utf8 -*-
import traceback
from air_case.public1.public1.public1 import get_hosid, get_branch_id
from air_case.public1.public1.public1 import get_hosid, get_branch_id, login
from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command
......@@ -22,21 +22,21 @@ import time
module = "b5_spd3_core_business_flow"
def login():
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()
return token, projectCode, uxid, corpId, info
# 登录获取用户id等信息,使用创建的用户登录============结束
# def login():
# 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()
# return token, projectCode, uxid, corpId, info
# # 登录获取用户id等信息,使用创建的用户登录============结束
# 采购计划_低值
......@@ -455,9 +455,62 @@ def reagent_purchase_plan():
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
def goods_move3(): # 设置请领出库渠道为中心库
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
username = info['username1']
password = commonFuc().get_business_data("b2_herp3_bs", "password")
print('username,password', username, password)
# # 获取token和projectCode
token, projectCode, uxid, corpId, info = login(username, password, 2)
# 登录获取用户id等信息,使用创建的用户登录============结束
module = "b2_herp3_bs"
# 设置请领出库渠道为中心库
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "updateSettleType_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"))
for i in range(1, 4):
info = FileUtils().r_info8('b5_spd3_core_business_flow', "产品审核信息", 'message%s' % i)
hosGoodsId = info['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '')
branchGoodsId = SERACH_goods_id(GoodsId)
# #请求体
request_body = commonFuc().get_business_data(module, "payload47_3", branchGoodsId, hosGoodsId, get_branch_id())
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('goods_move,result', result)
def SERACH_goods_id(GoodsId):
# 在请领出库渠道直送中搜索产品
module = 'b5_spd3_core_business_flow'
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
username = info['username1']
password = commonFuc().get_business_data("b2_herp3_bs", "password")
print('username,password', username, password)
# # 获取token和projectCode
token, projectCode, uxid, corpId, info = login(username, password, 2)
# 登录获取用户id等信息,使用创建的用户登录============结束\
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_mcmsBranchGoodsInfo_page_url")
dept1 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
# hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId']
# GoodsId = hosGoodsId.replace(get_hosid(), '')
request_body = commonFuc().get_business_data(module, "payload53_3", GoodsId, get_hosid(), get_branch_id(), dept1)
result = commonFuc().http_post(url, request_body, headers)
branchGoodsId = commonFuc().analysis_json('id', commonFuc().analysis_json('data', commonFuc().analysis_json('data',
result)))
return branchGoodsId
def main():
try:
goods_move3()
# 获取低值的hosGoodsId
hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
get_GoodsPkgDef(hosGoodsId) # 获取单元包id
......
......@@ -40,7 +40,7 @@ def center_warehouse_return():
token, projectCode, uxid, corpId, info = login(username, password, 2)
# 登录获取用户id等信息,使用创建的用户登录============结束
# 到库房明细查询,查询产品的udi码
get_udi(1)
get_udi_bydb(1)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_pick_submit_url")
print('url', url)
headers = commonFuc().get_business_data(module, "json_headers2",
......
......@@ -61,7 +61,7 @@ import sys
# 备份当前data目录
pro_path = commonFuc().get_pro_path2()
src = pro_path + r'/data'
dst = pro_path + r'/data' + timeUtils().get_time_hms(5)
dst = pro_path + r'/data' + get_branch_name()+get_branch_id()
#将备份的目录路径写入到文件中
info = (src, dst)
titlename = ('源目录', '备份目录')
......
This diff is collapsed.
......@@ -142,12 +142,15 @@ class delData(object):
# print('多余库房信息删除成功 ')
cursor.close()
def Delete_probeInfo_other(self):
def Delete_probeInfo_other(self,type=1):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
cursor = connection.cursor()
# 删除多余库房信息
sql = "delete from mcms_stock_info where stock_name like '%东土城路院区_____中心库房';"
if type==1:
sql = "delete from mcms_stock_info where stock_name like '%东土城路院区_____中心库房';"
else:
sql = "delete from mcms_stock_info where stock_name like '%东土城路院区______中心库房';"
print(sql)
cursor.execute(sql)
cursor.execute("commit;")
......
验收单号:
CHECK_NO1: CHECKh03472024080100006
CHECK_NO2: CHECKh03472024080100006
CHECK_NO1: CHECKh03472024080100018
CHECK_NO2: CHECKh03472024080100018
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