diff --git "a/air_case/b5_spd3_core_business_flow/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256.air/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256.py" "b/air_case/b5_spd3_core_business_flow/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256.air/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256.py" index 59cbae3e6f35a8663aa71a179864d1d4cd41db71..01157a712f179dbbd6d7a5d192d9769f772ccf1a 100644 --- "a/air_case/b5_spd3_core_business_flow/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256.air/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256.py" +++ "b/air_case/b5_spd3_core_business_flow/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256.air/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256.py" @@ -1,5 +1,6 @@ # -*- encoding=utf8 -*- from air_case.public1.public1.public1 import * +from common.dateUtils import dateUtils from common.db.sql.sql_del_branch_info import delData from common.fileUtls import FileUtils from common.run_cmd_script import execute_command @@ -21,13 +22,46 @@ import time module = "b5_spd3_core_business_flow" +def add_dept(): + # 内网登录 + username = commonFuc().get_business_data(module, "username") + # print('医院名称',username) + password = commonFuc().get_business_data(module, "password") + # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + # 获取token和projectCode + token, projectCode, uxid, corpId, info = login_system(username, password).get_token() + # print( token,projectCode,uxid,corpId,info) + # c0_新增科室_特殊科室_设备科_中心库房 + branch_id = FileUtils().r_info8(module, '院区新增type2','message')["院区id"] + url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "dept_insert_url") -def test1(): - # 院区新增 - execute_command("python runner_test.py tag id2263-4 debug sit") - # 新增科室 - execute_command( - "python runner_test.py tag id2263-19,id2263-20,id2263-21,id2263-22,id2263-23,id2263-24,id2263-25,id2263-26 debug sit") + # 获取请求头信息 + 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, "payload14", branch_id) + print(request_body) + # # # 发送请求 + result = commonFuc().http_post(url, request_body, headers) + print('result', result) + # #断言 + checkDict = commonFuc().get_business_data(module, 'checkDict2') + commonFuc().check_result(checkDict, result) +def test1(type=1): + + if type==1: + # 院区新增 + execute_command("python runner_test.py tag id2263-4 debug sit") + # 新增科室 + execute_command( + "python runner_test.py tag id2263-19,id2263-20,id2263-21,id2263-22,id2263-23,id2263-24,id2263-25,id2263-26 debug sit") + else: + branch_add() + # 新增科室 + execute_command( + "python runner_test.py tag id2263-19,id2263-20,id2263-21,id2263-22,id2263-23,id2263-24,id2263-25,id2263-26 debug sit") # 一键导入所有产品 execute_command("python runner_test.py tag id2263-48 debug sit") #导入同步过来的新产品,防止因同步时间差导致新建的产品没有导入过来 @@ -292,13 +326,69 @@ def add_StockArea():#添加货位 commonFuc().check_text_exist(0, result) else: commonFuc().check_text_exist('error', result) + +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')['备份目录'] + # 恢复目录 + # 先删除文件夹 + import shutil, os + if os.path.exists(src): + shutil.rmtree(src) + FileUtils().copy_folder_backup(dst, src) +def branch_add(): + module='b2_herp3_bs' + # 内网登录 + username = commonFuc().get_business_data(module, "username") + # print('医院名称',username) + password = commonFuc().get_business_data(module, "password") + # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + # 获取token和projectCode + token, projectCode, uxid, corpId, info = login_system(username, password).get_token() + url=commonFuc().get_api_add_port_url()+commonFuc().get_business_data(module, "insert_url") + print('a4_院区新增',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")) + name=commonFuc().randomString(6)#核心业务流的长度后缀设置为6位 + #请求体 + request_body=commonFuc().get_business_data(module, "payload",name,name) + + # 发送请求 + result = commonFuc().http_post(url, request_body,headers) + print('result', result) + #断言 + code=commonFuc().analysis_json('code',result) + commonFuc().check_text_exist(0,result) + id1=commonFuc().analysis_json('id',commonFuc().analysis_json('data',result)) + name=commonFuc().analysis_json('name',commonFuc().analysis_json('data',result)) + + #备份当前data目录 + pro_path = commonFuc().get_pro_path2() + src=pro_path+r'/data' + dst=pro_path+r'/data'+ get_branch_name()+get_branch_id() + #将备份的目录路径写入到文件中 + info = (src, dst) + titlename = ('源目录', '备份目录') + FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '院区新增',titlename,'message29') + #备份data文件 + FileUtils().copy_folder_backup(src,dst) + + info = (id1, name) + titlename = ('院区id', '院区name') + FileUtils().w_info2(info,module,'院区新增') + def main(): try: # ==============删除业务数据和报表数据 # delData().Delete_business_Data()#删除业务数据 # delData().Del_reporter_data() # 删除报表数据 #==============删除业务数据和报表数据 - test1() + test1()#参数2是新增院区后缀为6位数的参数1是老模式 test2()# 科室添加产品信息(产品是从外网同步过来的) dept_query_all()# 科室查询,将科室id写入文件中 grants_user()#给用户授权 diff --git "a/air_case/b5_spd3_core_business_flow/a_a5\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2271_\346\217\220\344\272\244\351\207\207\350\264\255\350\256\241\345\210\222.air/a_a5\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2271_\346\217\220\344\272\244\351\207\207\350\264\255\350\256\241\345\210\222.py" "b/air_case/b5_spd3_core_business_flow/a_a5\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2271_\346\217\220\344\272\244\351\207\207\350\264\255\350\256\241\345\210\222.air/a_a5\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2271_\346\217\220\344\272\244\351\207\207\350\264\255\350\256\241\345\210\222.py" index dff2ed65d270a64780a7ea5fdfddf4b50c81ccfc..218f67811a7da7185f2f88eb09875005907a964b 100644 --- "a/air_case/b5_spd3_core_business_flow/a_a5\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2271_\346\217\220\344\272\244\351\207\207\350\264\255\350\256\241\345\210\222.air/a_a5\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2271_\346\217\220\344\272\244\351\207\207\350\264\255\350\256\241\345\210\222.py" +++ "b/air_case/b5_spd3_core_business_flow/a_a5\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2271_\346\217\220\344\272\244\351\207\207\350\264\255\350\256\241\345\210\222.air/a_a5\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2271_\346\217\220\344\272\244\351\207\207\350\264\255\350\256\241\345\210\222.py" @@ -1,7 +1,7 @@ # -*- 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, get_stockAreaId_new_fromDb 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等信息,使用创建的用户登录============结束 # 采购计划_低值 @@ -70,13 +70,15 @@ def low_vaule_purchase_plan(): 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"] + # deptname1 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'] + # areaCode =get_stockAreaId_new_fromDb(deptname1, 1) 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) + print('低值采购计划request_body', request_body) # new_request_body = request_body.replace("'", '"') # new_request_body = new_request_body.replace("None", 'null') # # print(new_request_body) @@ -291,6 +293,8 @@ def hight_vaule_purchase_plan(): 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"] + # deptname1 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'] + # areaCode = get_stockAreaId_new_fromDb(deptname1, 1) areaName = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["areaName"] recUser = uxid @@ -455,9 +459,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 diff --git "a/air_case/b5_spd3_core_business_flow/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227.air/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227.py" "b/air_case/b5_spd3_core_business_flow/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227.air/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227.py" index 8ec7cd72c55587e6cffd1dc75d495cc35f1364e5..8fce1216f557dee5c185c17ac8ebe52a197ddcec 100644 --- "a/air_case/b5_spd3_core_business_flow/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227.air/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227.py" +++ "b/air_case/b5_spd3_core_business_flow/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227.air/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227.py" @@ -117,9 +117,9 @@ def check_accept_order(type=1): sourceId = sourceOrderNo url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "check_wait_detail_url") - print('url', url) + print('check_wait_detail_urlurl', url) request_body = commonFuc().get_business_data(module, "payload1", sourceId, sourceType, billMode, branch_id) - + print('check_wait_detail_url,request_body', request_body) # print('request_body',request_body) # 发送请求 while True: diff --git "a/air_case/b5_spd3_core_business_flow/a_a9\346\265\201\347\250\213\345\205\255_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\350\264\237\347\273\223\347\256\227.air/a_a9\346\265\201\347\250\213\345\205\255_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\350\264\237\347\273\223\347\256\227.py" "b/air_case/b5_spd3_core_business_flow/a_a9\346\265\201\347\250\213\345\205\255_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\350\264\237\347\273\223\347\256\227.air/a_a9\346\265\201\347\250\213\345\205\255_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\350\264\237\347\273\223\347\256\227.py" index e3c6c38ed3aa899bc4fdf90752428124028475d7..1e19166e6d7df1591583bad0ec9b9bf480ba3351 100644 --- "a/air_case/b5_spd3_core_business_flow/a_a9\346\265\201\347\250\213\345\205\255_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\350\264\237\347\273\223\347\256\227.air/a_a9\346\265\201\347\250\213\345\205\255_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\350\264\237\347\273\223\347\256\227.py" +++ "b/air_case/b5_spd3_core_business_flow/a_a9\346\265\201\347\250\213\345\205\255_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\350\264\237\347\273\223\347\256\227.air/a_a9\346\265\201\347\250\213\345\205\255_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\350\264\237\347\273\223\347\256\227.py" @@ -40,6 +40,7 @@ def center_warehouse_return(): token, projectCode, uxid, corpId, info = login(username, password, 2) # 登录获取用户id等信息,使用创建的用户登录============结束 # 到库房明细查询,查询产品的udi码 + # get_udi_bydb(1) get_udi(1) url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_pick_submit_url") print('url', url) diff --git "a/air_case/b6_spd3_core_business_flow_database_check/a_b7\346\265\201\347\250\213\345\215\201\345\233\233\351\200\200\345\272\223\344\270\232\345\212\241_\346\266\210\350\200\227\351\200\200\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b7\346\265\201\347\250\213\345\215\201\345\233\233\351\200\200\345\272\223\344\270\232\345\212\241_\346\266\210\350\200\227\351\200\200\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" "b/air_case/b6_spd3_core_business_flow_database_check/a_b7\346\265\201\347\250\213\345\215\201\345\233\233\351\200\200\345\272\223\344\270\232\345\212\241_\346\266\210\350\200\227\351\200\200\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b7\346\265\201\347\250\213\345\215\201\345\233\233\351\200\200\345\272\223\344\270\232\345\212\241_\346\266\210\350\200\227\351\200\200\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" index 293c08668aa34d819046c55e8662b3f79bc370bd..8ccf9366d3ae8fd6ed88d8690f849b73dc356cb4 100644 --- "a/air_case/b6_spd3_core_business_flow_database_check/a_b7\346\265\201\347\250\213\345\215\201\345\233\233\351\200\200\345\272\223\344\270\232\345\212\241_\346\266\210\350\200\227\351\200\200\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b7\346\265\201\347\250\213\345\215\201\345\233\233\351\200\200\345\272\223\344\270\232\345\212\241_\346\266\210\350\200\227\351\200\200\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" +++ "b/air_case/b6_spd3_core_business_flow_database_check/a_b7\346\265\201\347\250\213\345\215\201\345\233\233\351\200\200\345\272\223\344\270\232\345\212\241_\346\266\210\350\200\227\351\200\200\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b7\346\265\201\347\250\213\345\215\201\345\233\233\351\200\200\345\272\223\344\270\232\345\212\241_\346\266\210\350\200\227\351\200\200\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" @@ -237,6 +237,92 @@ def check_mcms_psi_dept_batch_in(DR_ID1,DR_ID,type): +def check_mcms_psi_dept_batch_xhck(DR_ID,type,order_no): + branch_id = get_branch_id() + sql = " select * from mcms_psi_dept_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_dept_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) + source_detail_id = get_pick_detail_id(branch_id,type) + pick_detail_id=source_detail_id + + if type == 16 or type==10: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] + elif type == 20: + 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_dept_batch where pid='%s';" % DR_ID) + 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_dept_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(dept_name, 2) + 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_dept_batch where pid='%s';" % DR_ID) + last_modified = get_create_time("select last_modified from mcms_psi_dept_batch where pid='%s';" % DR_ID) + last_modified_user = create_user + if type == 16 or type==10: + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept_batch_xhck1', 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 + + ) + elif type == 20: + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept_batch_xhck2', 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 + + ) + else: + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept_batch_xhck3',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') + def check_mcms_psi_dept_batch(DR_ID,type,order_no): branch_id = get_branch_id() sql = " select * from mcms_psi_dept_batch where pid='%s';" % ( @@ -322,8 +408,6 @@ def check_mcms_psi_dept_batch(DR_ID,type,order_no): else: print('error') commonFuc().check_text_exist_result_text('error', 'succees') - - def check_mcms_psi_dept_out_and_in(type1=16,type2=10): branch_id = get_branch_id() if type1==20: @@ -534,7 +618,209 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10): print('error') commonFuc().check_text_exist_result_text('error', 'succees') +def check_mcms_psi_dept_XH_CK(type1=10,type2=16): + branch_id = get_branch_id() + sql = " select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_XH' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type1) + + actual = check_mcms_dept_buy_sql(sql) + print(actual) + + DR_ID=get_id(" select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_XH' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type1)) + sql = "select order_no from mcms_psi_dept where id='%s';" % DR_ID + 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')['deptid2'] + target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] + target_stock_id = get_stockId_fromdb(target_dept_name + '库房') + target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 2) + PICK_id = get_PICK_id(branch_id, type1) + source_id = PICK_id + 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) + buyBillId = get_buyBillId(branch_id, type1) + pickOrderNo = get_PICK_order_no(branch_id, type1) + buyOrderNo = get_buyOrderNo(branch_id, type1) + pickBillId = get_PICK_id(branch_id, type1) + psiDeptOutBillId = DR_ID + psiDeptOutOrderNo = 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_dept where id='%s';" % DR_ID) + last_modified = get_create_time("select last_modified from mcms_psi_dept where id='%s';" % DR_ID) + last_modified_user = create_user + accounter=create_user + account_date = process_tuple(get_create_time("select account_date from mcms_psi_dept where id='%s';" % DR_ID)) + if type1 == 10: + # 子表检查 + check_mcms_psi_dept_batch_xhck(DR_ID,type1,order_no) + his_charge_no=get_id(" select his_charge_no from his_order where branch_id='%s' and psi_dept_id='%s' order by create_time desc LIMIT 1;"%(branch_id,DR_ID)) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept_out_xhck1', DR_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,his_charge_no,accounter,account_date, + pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo + , create_user, create_time, last_modified, last_modified_user + + ) + elif type1 == 20: + # 子表检查 + check_mcms_psi_dept_batch(DR_ID,type1,order_no) + his_charge_no=get_id(" select his_charge_no from his_order where branch_id='%s' and psi_dept_id='%s' order by create_time desc LIMIT 1;"%(branch_id,DR_ID)) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept5', DR_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,his_charge_no,accounter,account_date, + pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo + , create_user, create_time, last_modified, last_modified_user) + else: + # 子表检查 + check_mcms_psi_dept_batch(DR_ID,type1,order_no) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept6', DR_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, psiDeptOutBillId, psiDeptOutOrderNo + , 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') + #检查拆包后生成的入库单============================================================ + + branch_id = get_branch_id() + if type1==20: + sql = " select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_XH' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type2) + else: + sql = " select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_CB' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type2) + actual = check_mcms_dept_buy_sql(sql) + print(actual) + if type1==20: + DR_ID1 = get_id( + " select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_XH' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type2)) + else: + DR_ID1 = get_id( + " select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_CB' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type2)) + sql = "select order_no from mcms_psi_dept where id='%s';" % DR_ID1 + order_no1 = 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')['deptid2'] + target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] + target_stock_id = get_stockId_fromdb(target_dept_name + '库房') + target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 2) + PICK_id = get_PICK_id(branch_id, type1) + source_id = DR_ID + 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) + buyBillId = get_buyBillId(branch_id, type1) + pickOrderNo = get_PICK_order_no(branch_id, type1) + buyOrderNo = get_buyOrderNo(branch_id, type1) + pickBillId = get_PICK_id(branch_id, type1) + psiDeptOutBillId = DR_ID + psiDeptOutOrderNo = order_no + psiDeptInBillId=DR_ID1 + psiDeptInOrderNo=order_no1 + 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_dept where id='%s';" % DR_ID1) + last_modified = get_create_time("select last_modified from mcms_psi_dept where id='%s';" % DR_ID1) + last_modified_user = create_user + accounter = create_user + source_no=order_no + last_auditor=create_user + last_audit_time= get_create_time("select last_audit_time from mcms_psi_dept where id='%s';" % DR_ID1) + account_date = process_tuple(get_create_time("select account_date from mcms_psi_dept where id='%s';" % DR_ID1)) + if type2 == 10: + # 子表检查 + check_mcms_psi_dept_batch_in(DR_ID1, DR_ID,type2) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept7', DR_ID1, order_no1, target_corp_id, target_branch_id, + target_dept_id, target_dept_name, target_stock_id + , target_area_code, source_id,source_no, source_corp_id, source_branch_id, + source_dept_id, source_dept_name, source_stock_id, source_area_code, + accounter, account_date, + pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo + , psiDeptInBillId,psiDeptInOrderNo,create_user, create_time, last_modified, last_modified_user, + last_auditor,last_audit_time + + + ) + elif type2 == 20: + # 子表检查 + check_mcms_psi_dept_batch_in(DR_ID1, DR_ID, type2) + his_charge_no = get_id( + " select his_charge_no from his_order where branch_id='%s'order by create_time desc LIMIT 1;" % branch_id) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept8', DR_ID1, order_no1, target_corp_id, target_branch_id, + target_dept_id, target_dept_name, target_stock_id + , target_area_code, source_corp_id, source_branch_id, + source_dept_id, source_dept_name, source_stock_id, + his_charge_no,accounter, account_date, + create_user, create_time, last_modified, last_modified_user + ) + else: + # 子表检查 + check_mcms_psi_dept_batch_in(DR_ID1, DR_ID, type2) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept9', DR_ID1, order_no1, target_corp_id, target_branch_id, + target_dept_id, target_dept_name, target_stock_id + , target_area_code, source_id,source_no, source_corp_id, source_branch_id, + source_dept_id, source_dept_name, source_stock_id, source_area_code, + accounter, account_date, + pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo + , psiDeptInBillId,psiDeptInOrderNo,create_user, create_time, last_modified, last_modified_user, + last_auditor,last_audit_time) + 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() @@ -543,17 +829,18 @@ sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b7流程十 using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b7流程十四退库业务_消耗退库.air') from a_b7流程十四退库业务_消耗退库 import sCan_grant,second_dept_consume_Out_Stock,second_dept_consume_in_Stock try: - updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库 - sCan_grant(1) # 低值扫码发放 - check_mcms_psi_dept_out_and_in(16,10) - sCan_grant(3) # 试剂扫码发放 - check_mcms_psi_dept_out_and_in(66,67) - second_dept_consume_Out_Stock(2) # 高值消耗出库 - second_dept_consume_in_Stock(2) # 高值消耗退货入库 - check_mcms_psi_dept_out_and_in(20, 20) #检查消耗出库单和消耗入库单 - - second_dept_consume_Out_Stock(1) # 低值消耗出库 + # updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库 + # sCan_grant(1) # 低值扫码发放 + # check_mcms_psi_dept_out_and_in(16,10) + # sCan_grant(3) # 试剂扫码发放 + # check_mcms_psi_dept_out_and_in(66,67) + # second_dept_consume_Out_Stock(2) # 高值消耗出库 + # second_dept_consume_in_Stock(2) # 高值消耗退货入库 + # check_mcms_psi_dept_out_and_in(20, 20) #检查高值消耗出库单和消耗入库单 + # second_dept_consume_Out_Stock(1) # 低值消耗出库 + second_dept_consume_in_Stock(1) # 低值消耗退回入库 + check_mcms_psi_dept_XH_CK(10,16) second_dept_consume_Out_Stock(3) # 试剂消耗出库 second_dept_consume_in_Stock(3) # 试剂消耗退回入库 commonFuc().check_text_exist_result_text('SUCCESS', 'SUCCESS') diff --git "a/air_case/demo/\344\272\247\345\223\201\346\243\200\346\237\245.air/\344\272\247\345\223\201\346\243\200\346\237\245.py" "b/air_case/demo/\344\272\247\345\223\201\346\243\200\346\237\245.air/\344\272\247\345\223\201\346\243\200\346\237\245.py" index 98898b79e5f9d3cada26cc09c8007c79a24d1f93..f10e7f40bf53db2701aa1a6b2b43cfb4159c880e 100644 --- "a/air_case/demo/\344\272\247\345\223\201\346\243\200\346\237\245.air/\344\272\247\345\223\201\346\243\200\346\237\245.py" +++ "b/air_case/demo/\344\272\247\345\223\201\346\243\200\346\237\245.air/\344\272\247\345\223\201\346\243\200\346\237\245.py" @@ -1,6 +1,5 @@ # -*- encoding=utf8 -*- from common.db.sql.sql_del_branch_info import delData -from common.db.sql.sql_tools import main2 from common.fileUtls import FileUtils from air_case.public1.public1.public1 import * @@ -34,27 +33,47 @@ import sys # 第一种方式=========================== +# # 第二种方式================================= +# hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] +# actual_value1 = main2(hos_goods_id) +# print(actual_value1) +# # print('actual_value2',actual_value1) +# actual_value2 = get_process_list2(actual_value1) +# print('actual_value2', actual_value2, type(actual_value2)) +# prov_hos_goods_id = '7be89fe4c5ee4689a5e249d3197b9947' +# expected_value2 = commonFuc().get_business_data('b5_spd3_core_business_flow', 'expected_value2', prov_hos_goods_id) +# expected_value2=get_process_list2(expected_value2) +# print('expected_value2', expected_value2, type(expected_value2)) +# actual_value2 = actual_value2.replace(" ", "") +# expected_value2 = expected_value2.replace(" ", "") +# print(actual_value2) +# print(expected_value2) +# +# print(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') # 第二种方式================================= -hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] -actual_value1 = main2(hos_goods_id) -print(actual_value1) -# print('actual_value2',actual_value1) -actual_value2 = get_process_list2(actual_value1) -print('actual_value2', actual_value2, type(actual_value2)) -prov_hos_goods_id = '7be89fe4c5ee4689a5e249d3197b9947' -expected_value2 = commonFuc().get_business_data('b5_spd3_core_business_flow', 'expected_value2', prov_hos_goods_id) -expected_value2=get_process_list2(expected_value2) -print('expected_value2', expected_value2, type(expected_value2)) -actual_value2 = actual_value2.replace(" ", "") -expected_value2 = expected_value2.replace(" ", "") -print(actual_value2) -print(expected_value2) - -print(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') -# 第二种方式================================= \ No newline at end of file + +# 备份当前data目录 +pro_path = commonFuc().get_pro_path2() +src = pro_path + r'/data' +dst = pro_path + r'/data' + get_branch_name()+get_branch_id() +#将备份的目录路径写入到文件中 +info = (src, dst) +titlename = ('源目录', '备份目录') +FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '备份路径',titlename,'message29') +#备份目录 +FileUtils().copy_folder_backup(src, dst) + +dst=FileUtils().r_info8('b5_spd3_core_business_flow', '备份路径','message29')['备份目录'] +#恢复目录 +#先删除文件夹 +import shutil,os +if os.path.exists(src): + shutil.rmtree(src) + +FileUtils().copy_folder_backup(dst,src) diff --git a/air_case/public1/public1/public1.py b/air_case/public1/public1/public1.py index e43c294c76a6d9c87d9273d074650470a1a77962..1e6e5176108e370442e164acb5b9b5629f1f8737 100644 --- a/air_case/public1/public1/public1.py +++ b/air_case/public1/public1/public1.py @@ -27,7 +27,6 @@ def get_process_list(request_body): def compare_text_index(text1, text2): - import difflib, re # 创建SequenceMatcher对象 matcher = difflib.SequenceMatcher(a=text1, b=text2) @@ -53,11 +52,11 @@ def get_process_list2(request_body): new_request_body = request_body.replace("'", '"') new_request_body1 = new_request_body.replace("\\", '\\\\') new_request_body2 = new_request_body1.replace("None", 'null') - new_request_body3= new_request_body2.replace("[", '') + new_request_body3 = new_request_body2.replace("[", '') new_request_body4 = new_request_body3.replace("]", '') - print('new_request_body4',new_request_body4) + print('new_request_body4', new_request_body4) try: - new_request_body4=json.dumps(new_request_body4)#格式化 + new_request_body4 = json.dumps(new_request_body4) # 格式化 request_body_json = json.loads(new_request_body4) except json.decoder.JSONDecodeError: print("JSONDecodeError: No valid JSON object could be decoded from the string.") @@ -65,7 +64,6 @@ def get_process_list2(request_body): return request_body_json - def get_branch_id(): return FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"] @@ -141,6 +139,7 @@ def approval_center(OBH_ID='OBhxxxxxxxxxxxxxxx'): else: commonFuc().check_text_exist('error', result) + def approval_center_all(OBH_ID='OBhxxxxxxxxxxxxxxx'): module = "b2_herp3_bs" # 登录获取用户id等信息,使用创建的用户登录===========开始 @@ -172,7 +171,7 @@ def approval_center_all(OBH_ID='OBhxxxxxxxxxxxxxxx'): print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result) data = commonFuc().analysis_json('data', result) total = commonFuc().analysis_json('total', data) - data1= commonFuc().analysis_json('data', data) + data1 = commonFuc().analysis_json('data', data) for i in data1: # code = commonFuc().analysis_json('code', result) # data = commonFuc().analysis_json('data', result) @@ -200,6 +199,7 @@ def approval_center_all(OBH_ID='OBhxxxxxxxxxxxxxxx'): else: commonFuc().check_text_exist('error', result) + def approval_center1(): module = "b2_herp3_bs" # 登录获取用户id等信息,使用创建的用户登录===========开始 @@ -400,10 +400,12 @@ def get_stockId(name, type=1): # 获取仓库id参数是库房名称 id3 = i['id'] print(id3) return id3 + + def get_stockId_fromdb(name): # 获取仓库id参数是库房名称 - stockId=process_tuple( - get_id("select id from mcms_stock_info where stock_name='%s'and branch_id='%s';" % (name,get_branch_id()))) + stockId = process_tuple( + get_id("select id from mcms_stock_info where stock_name='%s'and branch_id='%s';" % (name, get_branch_id()))) return stockId @@ -526,7 +528,9 @@ def set_dept_user(dept_id, deptName, type=1): # ====获取库区id===== 开始========== # stockAreaId = get_stockAreaId(dept_id, stockId) - stockAreaId=process_tuple(get_id("select id from mcms_stock_shelf where address='%s' and del_flag=0 order by CREATE_TIME desc LIMIT 1;"%(deptName))) + stockAreaId = process_tuple(get_id( + "select id from mcms_stock_shelf where address='%s' and del_flag=0 order by CREATE_TIME desc LIMIT 1;" % ( + deptName))) print(stockAreaId) # ====获取库区id===== 结束========== # dept_query_all() @@ -563,7 +567,7 @@ def set_dept_user(dept_id, deptName, type=1): # print('查询库区是否已经存在人员', result) # userCode = commonFuc().analysis_json('userCode', # commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))) - userCode=delData().del_mcms_stock_user(username1,dept_id) + userCode = delData().del_mcms_stock_user(username1, dept_id) # print('userCode',userCode) if userCode != username1: # 查询库区是否已经存在人员,不需要重复添加=============== @@ -647,8 +651,8 @@ def get_udi1(type=1): # 库存明细查询获取条码 # # # # 发送请求 result = commonFuc().http_post(url, request_body, headers) data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result)) - total=commonFuc().analysis_json('total', commonFuc().analysis_json('data', result)) - if total>=1: + total = commonFuc().analysis_json('total', commonFuc().analysis_json('data', result)) + if total >= 1: # pkgcode = data1['pkgCodeSee'] # pkgcode1 = pkgcode[0:20] # pkgcode2 = pkgcode[21:len(pkgcode)] @@ -725,21 +729,23 @@ def get_udi2(type=1): # 二级科室库存明细查询获取条码 if type == 1: hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'] GoodsId = hosGoodsId.replace(get_hosid(), '') - request_body = commonFuc().get_business_data(module, "payload17_2", GoodsId, get_branch_id(), deptid2,stockId2) + request_body = commonFuc().get_business_data(module, "payload17_2", GoodsId, get_branch_id(), deptid2, stockId2) elif type == 2: hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'] GoodsId = hosGoodsId.replace(get_hosid(), '') - request_body = commonFuc().get_business_data(module, "payload17_2_1", GoodsId, get_branch_id(), deptid2,stockId2) + request_body = commonFuc().get_business_data(module, "payload17_2_1", GoodsId, get_branch_id(), deptid2, + stockId2) elif type == 3: hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'] GoodsId = hosGoodsId.replace(get_hosid(), '') - request_body = commonFuc().get_business_data(module, "payload17_2_2", GoodsId, get_branch_id(), deptid2,stockId2) + request_body = commonFuc().get_business_data(module, "payload17_2_2", GoodsId, get_branch_id(), deptid2, + stockId2) elif type == 4: # 试剂单瓶条码 hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'] GoodsId = hosGoodsId.replace(get_hosid(), '') - request_body = commonFuc().get_business_data(module, "payload17_3", GoodsId, get_branch_id(), deptid2,stockId2) + request_body = commonFuc().get_business_data(module, "payload17_3", GoodsId, get_branch_id(), deptid2, stockId2) print('getudi_request_body', request_body) # # # # 发送请求 @@ -772,6 +778,7 @@ def get_udi2(type=1): # 二级科室库存明细查询获取条码 break return pkgCodeSee + def get_udi3(type=1): # 三级科室库存明细查询获取条码 # type=1低值 2高值 3试剂 module = "b5_spd3_core_business_flow" @@ -792,21 +799,23 @@ def get_udi3(type=1): # 三级科室库存明细查询获取条码 if type == 1: hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'] GoodsId = hosGoodsId.replace(get_hosid(), '') - request_body = commonFuc().get_business_data(module, "payload17_2", GoodsId, get_branch_id(), deptid3,stockId3) + request_body = commonFuc().get_business_data(module, "payload17_2", GoodsId, get_branch_id(), deptid3, stockId3) elif type == 2: hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'] GoodsId = hosGoodsId.replace(get_hosid(), '') - request_body = commonFuc().get_business_data(module, "payload17_2_1", GoodsId, get_branch_id(), deptid3,stockId3) + request_body = commonFuc().get_business_data(module, "payload17_2_1", GoodsId, get_branch_id(), deptid3, + stockId3) elif type == 3: hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'] GoodsId = hosGoodsId.replace(get_hosid(), '') - request_body = commonFuc().get_business_data(module, "payload17_2_2", GoodsId, get_branch_id(), deptid3,stockId3) + request_body = commonFuc().get_business_data(module, "payload17_2_2", GoodsId, get_branch_id(), deptid3, + stockId3) elif type == 4: # 试剂单瓶条码 hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'] GoodsId = hosGoodsId.replace(get_hosid(), '') - request_body = commonFuc().get_business_data(module, "payload17_3", GoodsId, get_branch_id(), deptid3,stockId3) + request_body = commonFuc().get_business_data(module, "payload17_3", GoodsId, get_branch_id(), deptid3, stockId3) print('getudi_request_body', request_body) # # # # 发送请求 @@ -839,6 +848,71 @@ def get_udi3(type=1): # 三级科室库存明细查询获取条码 break return pkgCodeSee + +def get_udi_bydb(type=1): # 通过数据库获取中心库退货出库扫条码 + if type == 1: + hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'] + elif type == 2: + hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'] + elif type == 3: + hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'] + else: + hosGoodsId = 'hosGoodsId' + deptname1 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'] + branch_id = get_branch_id() + area_code = get_stockAreaId_new_fromDb(deptname1, 1) + if type == 1: + sql = ( + " select id from mcms_pkg where branch_id='%s' and area_code='%s' and lock_status='0' and use_status='0' and hos_goods_id='%s' and pkg_type='16' and dept_name='%s';" % ( + branch_id, area_code, hosGoodsId, deptname1)) + elif type == 2: + sql = ( + " select id from mcms_pkg where branch_id='%s' and area_code='%s' and lock_status='0' and use_status='0' and hos_goods_id='%s' and pkg_type='20' and dept_name='%s';" % ( + branch_id, area_code,hosGoodsId, deptname1)) + elif type == 3: + sql = ( + " select id from mcms_pkg where branch_id='%s'and area_code='%s' and lock_status='0' and use_status='0' and hos_goods_id='%s' and pkg_type='66' and dept_name='%s';" % ( + branch_id, area_code,hosGoodsId, deptname1)) + else: + sql = 'sql' + print('sql', sql) + pkgCodeSee = get_id(sql) + pkgcode = pkgCodeSee + module = "b5_spd3_core_business_flow" + token, projectCode1, uxid1, corpId1, info1 = call_login() + # 获取请求头信息 + 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_pick_return_scan_url") + print('herpService_pick_return_scan_url', url) + branch_name = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_name"] + stockId = get_stockId(branch_name + '中心库房') + areaCode = FileUtils().r_info8("b2_herp3_bs", "shelfinfo", 'message7')['shelfCode'] + request_body = commonFuc().get_business_data(module, "payload18", areaCode, pkgcode, stockId) + print('request_body', request_body) + result = commonFuc().http_post(url, request_body, headers) + print('result', result) + code = commonFuc().analysis_json('code', result) + if code == 1001: + commonFuc().check_text_exist_result_text('error', 'succees') + # # 将条码信息写入文件 + data = commonFuc().analysis_json('data', result) + list_a = [] + list_b = [] + list_c = [] + list_a.append(data) + list_b.append(data) + list_c.append(data) + # print('list_a', len(list_a), list_a) + info = (list_a, list_b, list_c) + titlename = ('list_a', 'list_b', 'list_c') + # 将条码信息写入文件 + FileUtils().w_info8(info, module, '条码信息', titlename, 'message18') + return pkgcode + + def get_udi(type=1): # 退货出库扫条码 # type=1低值 2高值 3试剂 module = "b5_spd3_core_business_flow" @@ -897,8 +971,8 @@ def get_udi(type=1): # 退货出库扫条码 print('request_body', request_body) result = commonFuc().http_post(url, request_body, headers) print('result', result) - code=commonFuc().analysis_json('code',result) - if code==1001: + code = commonFuc().analysis_json('code', result) + if code == 1001: commonFuc().check_text_exist_result_text('error', 'succees') # # 将条码信息写入文件 data = commonFuc().analysis_json('data', result) @@ -1546,6 +1620,7 @@ def SaveCacheBatch2(headers): result = commonFuc().http_post(url, request_body4, headers) print('result', result) + def set_dept_lead1(): # 设置一级科室负责人 module = 'b2_herp3_bs' username = FileUtils().r_info8(module, '用户名信息', 'message3')["username1"] @@ -1584,6 +1659,7 @@ def set_dept_lead1(): # 设置一级科室负责人 else: commonFuc().check_text_exist('error', result) + def set_dept_lead(): # 设置二级科室负责人 module = 'b2_herp3_bs' username = FileUtils().r_info8(module, '用户名信息', 'message3')["username1"] @@ -1882,12 +1958,13 @@ def get_stockAreaId_new(dept_id, deptName, type=1): FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '库区信息', titlename, 'message22') return shelfCode + def get_stockAreaId_new_fromDb(deptName, type=1): module = "b2_herp3_bs" stockId = 'stockId' # 获取库房id========= 开始==== if type == 1: - # 中心库房名称 + # 中心库房名称 branch_name = FileUtils().r_info(module, '院区新增')["branch_name"] stockId = get_stockId_fromdb(branch_name + '中心库房') deptName = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'] @@ -1903,17 +1980,18 @@ def get_stockAreaId_new_fromDb(deptName, type=1): # ====获取库区id===== 开始========== - sql="select shelf_code from mcms_stock_shelf where stock_Id='%s'and address='%s';"%(stockId,deptName) + sql = "select shelf_code from mcms_stock_shelf where stock_Id='%s'and address='%s';" % (stockId, deptName) print(sql) - shelfCode=get_id(sql) + shelfCode = get_id(sql) return shelfCode + def get_stockAreaId2_new_fromDb(deptName, type=1): module = "b2_herp3_bs" stockId = 'stockId' # 获取库房id========= 开始==== if type == 1: - # 中心库房名称 + # 中心库房名称 branch_name = FileUtils().r_info(module, '院区新增')["branch_name"] stockId = get_stockId_fromdb(branch_name + '中心库房') # 二级库房名称 @@ -1927,11 +2005,13 @@ def get_stockAreaId2_new_fromDb(deptName, type=1): # 获取库房id==========结束============ # ====获取库区id===== 开始========== - sql="select stock_Id from mcms_stock_shelf where stock_Id='%s'and address='%s' order by create_time desc LIMIT 1;"%(stockId,deptName) + sql = "select stock_Id from mcms_stock_shelf where stock_Id='%s'and address='%s' order by create_time desc LIMIT 1;" % ( + stockId, deptName) print(sql) - shelfCode=get_id(sql) + shelfCode = get_id(sql) return shelfCode + def herpService_mcmsDeptGoodsInfo_getByProvIdPage(): # 高值跟台获取产品信息 module = "b5_spd3_core_business_flow" username = FileUtils().r_info8('b2_herp3_bs', '用户名信息', 'message3')["username1"] @@ -2490,7 +2570,7 @@ def reGetString(String, leftBinary="^", rightBinary="$"): return "没有匹配到内容,请检查左右边界" -def set_stockShelf_Linkman(deptId,stockAreaId): +def set_stockShelf_Linkman(deptId, stockAreaId): print('设置库区联系人') # # 登录获取用户id等信息,使用创建的用户登录===========开始 info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') @@ -2502,7 +2582,7 @@ def set_stockShelf_Linkman(deptId,stockAreaId): # # 获取token和projectCode token, projectCode, uxid, corpId, info = login_system(username, password).get_token() # 登录获取用户id等信息,使用创建的用户登录============结束 - module='b2_herp3_bs' + module = 'b2_herp3_bs' url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "basic_stockShelf_page_url") # # 获取请求头信息 @@ -2685,8 +2765,8 @@ def pickScan2(PICK_ID, udi_code, type=1): # 二级库出库拣货扫码 result = commonFuc().http_post(url, request_body, headers) # import pdb # pdb.set_trace() - code=commonFuc().analysis_json('code',result) - if code=='14030053': + code = commonFuc().analysis_json('code', result) + if code == '14030053': commonFuc().check_text_exist_result_text('error', 'SUCCESS') print('获取条码信息result', result) # 获取必要信息 @@ -2789,10 +2869,10 @@ def pickScan2(PICK_ID, udi_code, type=1): # 二级库出库拣货扫码 # # # # 发送请求 result = commonFuc().http_post(url, request_body, headers) print('result', '拣货扫码', result) - code=commonFuc().analysis_json('code',result) - if code==0: - print('拣货扫码','ok') - elif code==14030001: + code = commonFuc().analysis_json('code', result) + if code == 0: + print('拣货扫码', 'ok') + elif code == 14030001: print('单据已被扫码,请刷新页面数据', 'ok') else: commonFuc().check_text_exist_result_text('error', 'succees') @@ -3197,9 +3277,9 @@ def second_dept_one_key_in(type=2): while True: result = commonFuc().http_post(url, request_body, headers) total = commonFuc().analysis_json('total', commonFuc().analysis_json('data', result)) - if total>=1: + if total >= 1: break - elif total==0: + elif total == 0: return else: continue @@ -3258,11 +3338,11 @@ def second_dept_one_key_in(type=2): # # # # 发送请求 result = commonFuc().http_post(url, request_body, headers) print('一键入库result', result) - data=commonFuc().analysis_json('data',result) - code=commonFuc().analysis_json('code',result) - if code==1010: + data = commonFuc().analysis_json('data', result) + code = commonFuc().analysis_json('code', result) + if code == 1010: commonFuc().check_text_exist_result_text('error', 'succees') - elif len(data)>=1: + elif len(data) >= 1: commonFuc().check_text_exist_result_text('succees', 'succees') return data else: @@ -3506,6 +3586,7 @@ def dept_goods_distribute(detpid): # 科室添加产品信息(产品是从外 else: commonFuc().check_text_exist('error', result) + def get_login_user_uxid(): module = "b2_herp3_bs" # 登录获取用户id等信息,使用创建的用户登录===========开始 @@ -3521,6 +3602,7 @@ def get_login_user_uxid(): token1, projectCode1, uxid1, corpId1, info1 = login_system(username, password).get_token() return uxid1 + def get_login_user_uxid2(): module = "b5_spd3_core_business_flow" # 登录获取用户id等信息,使用创建的用户登录===========开始 @@ -3533,10 +3615,11 @@ def get_login_user_uxid2(): password = commonFuc().get_business_data(module, "password1") # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') # 获取token和projectCode - token1, projectCode1, uxid1, corpId1, info1 = login(username, password,1) + token1, projectCode1, uxid1, corpId1, info1 = login(username, password, 1) return uxid1 -def comparison_result(actual,expected): + +def comparison_result(actual, expected): actual_value1 = get_process_list2(actual) expected_value1 = get_process_list2(expected) actual_value2 = actual_value1.replace(" ", "") @@ -3554,19 +3637,25 @@ def comparison_result(actual,expected): else: print('error') commonFuc().check_text_exist_result_text('error', 'succees') + + def get_prov_id(): - return FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"] + return FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"] + def get_prov_name(): - return FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"] + return FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"] + def get_rec_org_id(type=1): - if type==1: + if type == 1: return FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1'] - elif type==2: + elif type == 2: return FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'] + + def get_rec_org_name(type=1): - if type==1: + if type == 1: return FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'] - elif type==2: - return FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] \ No newline at end of file + elif type == 2: + return FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] diff --git a/common/db/sql/sql_del_branch_info.py b/common/db/sql/sql_del_branch_info.py index 51063c917412c23e8a56be47d25ffffedd66893a..9a7b8866704e90946e7eb64c26aa170571cff556 100644 --- a/common/db/sql/sql_del_branch_info.py +++ b/common/db/sql/sql_del_branch_info.py @@ -9,13 +9,16 @@ from common.fileUtls import FileUtils class delData(object): - def Delete_branch_by_id(self): + def Delete_branch_by_id(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_branch_info where id = '%s';" % id - sql = "DELETE from mcms_branch_info where name like '%东土城路院区_____';" + if type==1: + sql = "DELETE from mcms_branch_info where name like '%东土城路院区_____';" + else: + sql = "DELETE from mcms_branch_info where name like '%东土城路院区______';" print(sql) cursor.execute(sql) cursor.execute("commit;") @@ -28,7 +31,10 @@ class delData(object): cursor = connection.cursor() # 删除新增的院区数据,减少垃圾数据的产生,保证脚本下次还可以正常运行,接口脚本每次都使用新增数据 # sql = "DELETE from mcms_branch_info where id = '%s';" % id - sql = "DELETE from mcms_branch_info where name like '%东土城路院区_____';" + if type == 1: + sql = "DELETE from mcms_branch_info where name like '%东土城路院区_____';" + else: + sql = "DELETE from mcms_branch_info where name like '%东土城路院区______';" print(sql) cursor.execute(sql) cursor.execute("commit;") @@ -136,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;") diff --git a/common/fileUtls.py b/common/fileUtls.py index 37eea378a9b102cdd2397d9ec7685646d340dafc..a5bfb31af46b8b9b4bf883b5e657086ffb726f05 100644 --- a/common/fileUtls.py +++ b/common/fileUtls.py @@ -306,8 +306,46 @@ class FileUtils(object): return None else: return None + def r_info9(self, module, keyname, message_no): + w_path = rootPath + os.sep + 'data' + os.sep + module + yamlpath = os.path.join(w_path, message_no) + try: + file_value = open(yamlpath, 'r', encoding='utf-8') + except: + file_value = open(yamlpath, 'w', encoding='utf-8') + file_value = open(yamlpath, 'r', encoding='utf-8') + result = yaml.load(file_value.read(), Loader=yaml.Loader) + if result is not None: + return result + else: + return None + def w_info9(self, module,content,message_no): + module = module + dict = content + + w_path = rootPath + os.sep + 'data' + os.sep + module + # print(w_path) + yamlpath = os.path.join(w_path, message_no) + # 写入到yaml文件 + with open(yamlpath, "a", encoding="utf-8") as f: + yaml.dump(dict, f, Dumper=yaml.RoundTripDumper, allow_unicode=True) + def copy_folder_backup(self,src,dst): + import shutil + import os + if os.path.exists(dst): + print(f"The backup directory '{dst}' already exists.") + return + + try: + shutil.copytree(src, dst) + print(f"Folder '{src}' backed up successfully to '{dst}'.") + except OSError as e: + print(f"Error: {e}") + # 使用方法 + # 假设你要备份的文件夹是 '/path/to/source',备份的目标文件夹是 '/path/to/backup' + # copy_folder_backup('/path/to/source', '/path/to/backup') if __name__ == '__main__': # info=("aaaa","bbbbbb","mdm3-pim") # FileUtils().w_info(info,"产品新增") diff --git a/data/b3_herp3_purchase/data b/data/b3_herp3_purchase/data index 4da6aa974da51c5bc17c70b427ab29cb17f9ed95..ec9c37e817ace6ed9bdf476a3c847f5e3022ce4d 100644 --- a/data/b3_herp3_purchase/data +++ b/data/b3_herp3_purchase/data @@ -71,9 +71,10 @@ json_headers2: { "X-APP-CODE":"%s" } "payload": '{"purPlanDetail":[{"hosGoodsId":"h034700001977","pkgDefId":"22513b84dad7418fb445e5de02fa88f0","pkgDefName":"大包","pkgDefQty":20,"planPkgQty":0},{"hosGoodsId":"h034700001977","pkgDefId":"3c2b4432415e46c4aebb018969c3dcc0","pkgDefName":"小包","pkgDefQty":15,"planPkgQty":0},{"hosGoodsId":"h034700001977","pkgDefId":"56b010aba2e04f978e3038c0f53d910c","pkgDefName":" 包","pkgDefQty":33,"planPkgQty":800},{"hosGoodsId":"h034700001977","pkgDefId":"f8ad68aae4a5406ab04316e46bbf38bd","pkgDefName":"包2","pkgDefQty":66,"planPkgQty":0}],"hosId":"h0347","branchId":"h0347-2011","mgrCorpName":"邹城市人民医院(test)","deptName":"","deptId":"d69a68df361a4289b2262e4ef75b55a5","recOrgId":"d69a68df361a4289b2262e4ef75b55a5","recOrgName":"","areaCode":"areah03470414","areaName":"A库区","recUser":"UID-050151","recPhone":"xhs1009","recAddr":"A","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true}' -"payload1_1_1": {"purPlanDetail":[{"hosGoodsId":"%s","pkgDefId":"%s","pkgDefName":"100","pkgDefQty":100,"planPkgQty":100}],"hosId":"%s","branchId":"%s","mgrCorpName":"%s","deptName":"","deptId":"%s","recOrgId":"%s","recOrgName":"","areaCode":"%s","areaName":"%s","recUser":"%s","recPhone":"xhs","recAddr":"自动化测试","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true} -"payload1_1_2": {"purPlanDetail":[{"hosGoodsId":"%s","pkgDefId":null,"pkgDefName":"包","pkgDefQty":1,"planPkgQty":100}],"hosId":"%s","branchId":"%s","mgrCorpName":"%s","deptName":"","deptId":"%s","recOrgId":"%s","recOrgName":"","areaCode":"%s","areaName":"%s","recUser":"%s","recPhone":"xhs","recAddr":"自动化测试","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true} -"payload1_1_3": {"purPlanDetail":[{"hosGoodsId":"%s","pkgDefId":"%s","pkgDefName":"100","pkgDefQty":100,"planPkgQty":100}],"hosId":"%s","branchId":"%s","mgrCorpName":"%s","deptName":"","deptId":"%s","recOrgId":"%s","recOrgName":"","areaCode":"%s","areaName":"%s","recUser":"%s","recPhone":"xhs","recAddr":"自动化测试","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true} +#"payload1_1_1": {"purPlanDetail":[{"hosGoodsId":"%s","pkgDefId":"%s","pkgDefName":"100","pkgDefQty":100,"planPkgQty":100}],"hosId":"%s","branchId":"%s","mgrCorpName":"%s","deptName":"","deptId":"%s","recOrgId":"%s","recOrgName":"","areaCode":"%s","areaName":"%s","recUser":"%s","recPhone":"xhs","recAddr":"自动化测试","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true} +"payload1_1_1": {"purPlanDetail":[{"hosGoodsId":"%s","pkgDefId":"%s","pkgDefName":"100","pkgDefQty":100,"planPkgQty":100,"codingType":0}],"hosId":"%s","branchId":"%s","mgrCorpName":"%s","deptName":"","deptId":"%s","recOrgId":"%s","recOrgName":"","areaCode":"%s","areaName":"%s","recUser":"%s","recPhone":"xhs","recAddr":"设备科001","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true} +"payload1_1_2": {"purPlanDetail":[{"hosGoodsId":"%s","pkgDefId":null,"pkgDefName":"包","pkgDefQty":1,"planPkgQty":100,"codingType":0}],"hosId":"%s","branchId":"%s","mgrCorpName":"%s","deptName":"","deptId":"%s","recOrgId":"%s","recOrgName":"","areaCode":"%s","areaName":"%s","recUser":"%s","recPhone":"xhs","recAddr":"自动化测试","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true} +"payload1_1_3": {"purPlanDetail":[{"hosGoodsId":"%s","pkgDefId":"%s","pkgDefName":"100","pkgDefQty":100,"planPkgQty":100,"codingType":0}],"hosId":"%s","branchId":"%s","mgrCorpName":"%s","deptName":"","deptId":"%s","recOrgId":"%s","recOrgName":"","areaCode":"%s","areaName":"%s","recUser":"%s","recPhone":"xhs","recAddr":"自动化测试","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true} "payload_1": '{"purPlanDetail":[{"hosGoodsId":"h034700001947","pkgDefId":null,"pkgDefName":"包","pkgDefQty":1,"planPkgQty":888}],"hosId":"h0347","branchId":"h0347-2011","mgrCorpName":"邹城市人民医院(test)","deptName":"","deptId":"d69a68df361a4289b2262e4ef75b55a5","recOrgId":"d69a68df361a4289b2262e4ef75b55a5","recOrgName":"","areaCode":"areah03470414","areaName":"A库区","recUser":"UID-050151","recPhone":"xhs1009","recAddr":"A","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true}' @@ -94,9 +95,9 @@ json_headers2: { "payload10": '{"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":999,"pkgDefQty":1,"provId":"p00001603","provName":"北京中杉金桥生物技术有限公司(test)","subProvId":"p56a4","subProvName":"国药集团浙江医疗器材有限公司","hosGoodsId":"h034700001757","purMode":20,"version":0,"pkgDefId":null,"purTaskId":null,"sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":true}' "payload11": {"pid":"%s","hosGoodsName":"","hosGoodsSpec":"","provName":"","purModes":[],"subProvName":""} "payload12": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":800,"pkgDefQty":33,"provId":"p10d95","provName":"浙江高仰医疗科技有限公司","subProvId":"p10d95","subProvName":"浙江高仰医疗科技有限公司","hosGoodsId":"h034700001977","purMode":10,"version":0,"pkgDefId":"56b010aba2e04f978e3038c0f53d910c","purTaskId":null,"sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":true} -"payload12_1_1": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":100,"pkgDefQty":100,"provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","hosGoodsId":"%s","purMode":10,"version":0,"pkgDefId":"%s","purTaskId":null,"sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":true} -"payload12_1_2": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":100,"pkgDefQty":1,"provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","hosGoodsId":"%s","purMode":20,"version":0,"pkgDefId":null,"purTaskId":null,"sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":true} -"payload12_1_3": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":100,"pkgDefQty":100,"provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","hosGoodsId":"%s","purMode":60,"version":0,"pkgDefId":"%s","purTaskId":null,"sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":true} +"payload12_1_1": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":100,"pkgDefQty":100,"provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","hosGoodsId":"%s","purMode":10,"version":0,"pkgDefId":"%s","purTaskId":null,"sourceId":null,"codingType":0}],"tempFlag":0,"version":0,"checkLcTaskQty":true} +"payload12_1_2": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":100,"pkgDefQty":1,"provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","hosGoodsId":"%s","purMode":20,"version":0,"pkgDefId":null,"purTaskId":null,"sourceId":null,"codingType":0}],"tempFlag":0,"version":0,"checkLcTaskQty":true} +"payload12_1_3": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":100,"pkgDefQty":100,"provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","hosGoodsId":"%s","purMode":60,"version":0,"pkgDefId":"%s","purTaskId":null,"sourceId":null,"codingType":0}],"tempFlag":0,"version":0,"checkLcTaskQty":true} "payload13": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":3,"planPkgQty":888,"pkgDefQty":1,"provId":"p10d95","provName":"浙江高仰医疗科技有限公司","subProvId":"p10d95","subProvName":"浙江高仰医疗科技有限公司","hosGoodsId":"h034700001947","purMode":20,"version":0,"pkgDefId":null,"purTaskId":null,"sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":true} "payload14": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":888,"pkgDefQty":1,"provId":"p000029d8","provName":"国药集团湖南分公司mkcQNd","subProvId":"p000029d7","subProvName":"国药集团湖北分公司mQDwR7","hosGoodsId":"h034700001859","purMode":60,"version":0,"pkgDefId":"26d93e6fecd24b6fa4bde8aeacfbf153","purTaskId":"5c85573c049141ff8df808dabc30d2b1","sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":false} diff --git a/data/b5_spd3_core_business_flow/message13 b/data/b5_spd3_core_business_flow/message13 index ceb438de0b26e3de9b119852e8303f4256a74118..d51522a2ba22c290e972fb219dd46dc70dc4eed2 100644 --- a/data/b5_spd3_core_business_flow/message13 +++ b/data/b5_spd3_core_business_flow/message13 @@ -3,33 +3,34 @@ - &id001 - id: hosId: h0347 - branchId: h0347-3745 + branchId: h0347-3738 deptId: taskType: 1 - sourceOrgId: p1e34a - sourceOrgName: 国药集团公司BCJj3 - sourceOrderNo: PSh0347202407120066 - billMode: '25' + sourceOrgId: p1e35e + sourceOrgName: 国药集团公司S57ui + sourceOrderNo: PSh0347202408010065 + billMode: '66' stockKind: purMode: - sourceId: PSh0347202407120066 + sourceId: PSh0347202408010065 sourceDetailId: sourceType: PSD sourceTypeName: 配送单 sourceVersion: 1 - planOrderNo: SSSQ202407120341 - purOrderNo: SSTZ202407120319 - recOrgId: e6a7862c7b3d49a69ab93979a8f32710 - recOrgName: 二级检验科002 - billRelationJson: '{"operationApplyOrderNo":"SSSQ202407120341","operationNoticeBillId":"Nh034720240712000002","distrBillId":"PSh0347202407120066","operationNoticeOrderNo":"SSTZ202407120319","distrOrderNo":"PSh0347202407120066","operationApplyBillId":"Oh034720240712000002"}' - taskDate: '2024-07-12 11:25:51' + planOrderNo: PLAN2024080134122 + purOrderNo: CG2024080122381 + recOrgId: 63c734f07fcc422ea80f49ca8e5bbd95 + recOrgName: 设备科001 + billRelationJson: '{"planBillId":"Ph034720240801030767","planOrderNo":"PLAN2024080134122","purOrderNo":"CG2024080122381","purBillId":"Ch034720240801000099","purBillDate":"2024-08-01 + 15:14:28","distrBillId":"PSh0347202408010065","distrOrderNo":"PSh0347202408010065"}' + taskDate: '2024-08-01 15:15:04' taskDateStart: taskDateEnd: billModeList: viewIdList: - supplierFlag: false + supplierFlag: true tbStatus: 20 - remark: + remark: '' pdaFlag: list_b: - *id001 diff --git a/data/b5_spd3_core_business_flow/message15 b/data/b5_spd3_core_business_flow/message15 index d43e019093ac11ed8954ea8b6777b956261f04b0..2adea03fd4e4535a83a17c5adc257b9f8f0635f4 100644 --- a/data/b5_spd3_core_business_flow/message15 +++ b/data/b5_spd3_core_business_flow/message15 @@ -1,3 +1,3 @@ 验收单号: - CHECK_NO1: CHECKh03472024073000037 - CHECK_NO2: CHECKh03472024073000037 + CHECK_NO1: CHECKh03472024080100056 + CHECK_NO2: CHECKh03472024080100056 diff --git a/data/b6_spd3_core_business_flow_database_check/data b/data/b6_spd3_core_business_flow_database_check/data index d47f6d04c283aa242f350c4b05ef78a654fe1869..7ee2b74fed6e6558b280d0262a9c4424b1f58b7a 100644 --- a/data/b6_spd3_core_business_flow_database_check/data +++ b/data/b6_spd3_core_business_flow_database_check/data @@ -19,12 +19,12 @@ "mcms_dept_buy_detail_approval_after1": '{"id": "%s", "pid": "%s", "order_no": "%s", "order_num": 1, "source_id": None, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "price": Decimal("99.999900"), "pur_mode": 20, "pkg_def_id": %s, "pkg_def_name": %s, "pkg_def_qty": Decimal("1.00"), "buy_pkg_qty": Decimal("1.00"), "buy_qty": Decimal("1.00"), "send_pkg_qty": "0", "send_qty": "0", "rec_pkg_qty": "0", "rec_qty": "0", "tb_status": 40, "close_type": 0, "remark": None, "close_remark": None, "close_time": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "re_order_no": None, "coding_type": 0}' "mcms_dept_buy_detail_approval_after2": '{"id": "%s", "pid": "%s", "order_no": "%s", "order_num": 1, "source_id": None, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "price": Decimal("99.999900"), "pur_mode": 60, "pkg_def_id": "%s", "pkg_def_name": "%s", "pkg_def_qty": Decimal("100.00"), "buy_pkg_qty": Decimal("1.00"), "buy_qty": Decimal("100.00"), "send_pkg_qty": "0", "send_qty": "0", "rec_pkg_qty": "0", "rec_qty": "0", "tb_status": 40, "close_type": 0, "remark": None, "close_remark": None, "close_time": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "re_order_no": None, "coding_type": 0}' - +#配送单 "mcms_dept_buy_direct_sending": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "3", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None}' "mcms_dept_buy_direct_sending2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "3", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 0, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None}' "mcms_dept_buy_direct_sending3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "3", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None}' - +#科室请领单审批后 "mcms_dept_buy_approval_after4": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "3", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": "22", "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 40, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s, "close_time": None, "old_order_no": None}' "mcms_dept_buy_approval_after5": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "3", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 0, "remark": "", "dept_audit_remark": "22", "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 40, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s, "close_time": None, "old_order_no": None}' "mcms_dept_buy_approval_after6": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "3", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": "22", "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 40, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s, "close_time": None, "old_order_no": None}' @@ -167,3 +167,11 @@ #拆包出库单子表试剂 "mcms_psi_dept_batch3_1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "pick_detail_id": "%s", "pur_mode": 60, "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("100.00"), "unit_name": "100支/100", "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_xhck1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "pick_detail_id": "%s", "pur_mode": 10, "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_xhck2": '{"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_xhck3": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "pick_detail_id": "%s", "pur_mode": 60, "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_xhck1": '{"id":"%s","order_no":"%s","bill_mode":"10","rec_type":"YND","psi_flag":-1,"psi_kind":"207","stock_kind":"CK_XH","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":1,"patient_id":"","patient_name":"","machine_id":null,"machine_name":null,"his_charge_no":"%s","remark":null,"tb_status":30,"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":1,"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}' diff --git a/main1/main_text.py b/main1/main_text.py index 4d39be02f587b213ca67313b740cebbeedd07dfb..ac21175314688e442a038d6ab13a82a5382a02dc 100644 --- a/main1/main_text.py +++ b/main1/main_text.py @@ -84,8 +84,19 @@ def main_text(): # sys.exit(0) def flow4(): # execute_command("python runner_test.py tag id2302-4 debug mdm3") - from execute import flow4 - flow4() + # from execute import flow4 + # flow4() + sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air') + using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air') + from a_a4_流程四_基础模块设置 import test1,test2,dept_query_all,grants_user,set_dept_lead1,add_StockArea,recover_dataFile + test1(2) # 参数2是新增院区后缀为6位数的参数1是老模式 + test2() # 科室添加产品信息(产品是从外网同步过来的) + dept_query_all() # 科室查询,将科室id写入文件中 + grants_user() # 给用户授权 + set_dept_lead1() # 设置一级科室负责人 + add_StockArea() # 添加库区 + recover_dataFile()#恢复备份的data目录 + commonFuc().check_text_exist_result_text('succees', 'succees') print('流程4执行完毕') # sys.exit(0) def flow5(): @@ -192,6 +203,7 @@ def main_text(): try: flow5() flow6() + time.sleep(20) flow7() flow8() flow9()