Commit ec5af70d authored by xiao-hesheng's avatar xiao-hesheng
Browse files

优化调整脚本

parent cc1fa8df
...@@ -403,20 +403,20 @@ def pick_execute(): ...@@ -403,20 +403,20 @@ def pick_execute():
# 拣货============================== # 拣货==============================
if billMode == '16': if billMode == '16':
udi_code = get_udi2(1) # 获取条码 低值1 高值2 试剂3 udi_code = get_udi2(1,token) # 获取条码 低值1 高值2 试剂3
elif billMode == '20': elif billMode == '20':
udi_code = get_udi2(2) # 获取条码 低值1 高值2 试剂3 udi_code = get_udi2(2,token) # 获取条码 低值1 高值2 试剂3
elif billMode == '66': elif billMode == '66':
udi_code = get_udi2(3) # 获取条码 低值1 高值2 试剂3 udi_code = get_udi2(3,token) # 获取条码 低值1 高值2 试剂3
else: else:
udi_code = 'udi_code' udi_code = 'udi_code'
print('udi_code', udi_code) print('udi_code', udi_code)
if billMode == '16': if billMode == '16':
targetAreaCode,sourceId=pickScan2(BH_ID, udi_code, 1) # 低值 targetAreaCode,sourceId=pickScan2(BH_ID, udi_code, 1,token) # 低值
elif billMode == '20': elif billMode == '20':
targetAreaCode,sourceId=pickScan2(BH_ID, udi_code, 2) # 高值 targetAreaCode,sourceId=pickScan2(BH_ID, udi_code, 2,token) # 高值
elif billMode == '66': elif billMode == '66':
targetAreaCode,sourceId= pickScan2(BH_ID, udi_code, 3) # 试剂 targetAreaCode,sourceId= pickScan2(BH_ID, udi_code, 3,token) # 试剂
else: else:
targetAreaCode='targetAreaCode' targetAreaCode='targetAreaCode'
sourceId='sourceId' sourceId='sourceId'
......
...@@ -787,10 +787,10 @@ def get_udi1(type=1): # 库存明细查询获取条码 ...@@ -787,10 +787,10 @@ def get_udi1(type=1): # 库存明细查询获取条码
# return pkgcode # return pkgcode
def get_udi2(type=1): # 二级科室库存明细查询获取条码 def get_udi2(type=1,token='token'): # 二级科室库存明细查询获取条码
# type=1低值 2高值 3试剂 # type=1低值 2高值 3试剂
module = "b5_spd3_core_business_flow" module = "b5_spd3_core_business_flow"
token, projectCode1, uxid1, corpId1, info1 = call_login() # token, projectCode1, uxid1, corpId1, info1 = call_login()
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_barcode_page_url") "herpService_stock_barcode_page_url")
print('get_udi', url) print('get_udi', url)
...@@ -802,28 +802,30 @@ def get_udi2(type=1): # 二级科室库存明细查询获取条码 ...@@ -802,28 +802,30 @@ def get_udi2(type=1): # 二级科室库存明细查询获取条码
# # 请求体 # # 请求体
request_body = 'request_body' request_body = 'request_body'
deptName2 = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid2"] deptName2 = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid2"]
stockId2 = get_stockId(deptName2 + '库房', 2) stockId2 = get_stockId_fromdb(deptName2 + '库房')
deptid2 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'] deptid2 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
areaCode=get_stockAreaId_new_fromDb(deptName2, 2)
if type == 1: if type == 1:
hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'] hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '') 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", areaCode,GoodsId, get_branch_id(), deptid2, stockId2)
elif type == 2: elif type == 2:
hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'] hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '') GoodsId = hosGoodsId.replace(get_hosid(), '')
request_body = commonFuc().get_business_data(module, "payload17_2_1", GoodsId, get_branch_id(), deptid2, request_body = commonFuc().get_business_data(module, "payload17_2_1", areaCode,GoodsId, get_branch_id(), deptid2,
stockId2) stockId2)
elif type == 3: elif type == 3:
hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'] hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '') GoodsId = hosGoodsId.replace(get_hosid(), '')
request_body = commonFuc().get_business_data(module, "payload17_2_2", GoodsId, get_branch_id(), deptid2, request_body = commonFuc().get_business_data(module, "payload17_2_2",areaCode, GoodsId, get_branch_id(), deptid2,
stockId2) stockId2)
elif type == 4: # 试剂单瓶条码 elif type == 4: # 试剂单瓶条码
hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'] hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '') 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",areaCode, GoodsId, get_branch_id(), deptid2, stockId2)
print('getudi_request_body', request_body) print('getudi_request_body', request_body)
# # # # 发送请求 # # # # 发送请求
...@@ -2823,16 +2825,16 @@ def pickScan(PICK_ID, udi_code, type=1): # 拣货扫码 ...@@ -2823,16 +2825,16 @@ def pickScan(PICK_ID, udi_code, type=1): # 拣货扫码
PICK_ID = commonFuc().analysis_json('data', result) PICK_ID = commonFuc().analysis_json('data', result)
def pickScan2(PICK_ID, udi_code, type=1): # 二级库出库拣货扫码 def pickScan2(PICK_ID, udi_code, type=1,token='token'): # 二级库出库拣货扫码
module = "b5_spd3_core_business_flow" module = "b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始 # # # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') # info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
username = info['username1'] # username = info['username1']
password = commonFuc().get_business_data("b2_herp3_bs", "password") # password = commonFuc().get_business_data("b2_herp3_bs", "password")
print('username,password', username, password) # print('username,password', username, password)
# # 获取token和projectCode # # # 获取token和projectCode
token, projectCode, uxid, corpId, info = login(username, password, 2) # token, projectCode, uxid, corpId, info = login(username, password, 2)
# 登录获取用户id等信息,使用创建的用户登录============结束 # # 登录获取用户id等信息,使用创建的用户登录============结束
headers = commonFuc().get_business_data(module, "json_headers2", headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token, commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE")) commonFuc().get_business_data(module, "X-APP-CODE"))
......
...@@ -110,10 +110,11 @@ json_headers2: { ...@@ -110,10 +110,11 @@ json_headers2: {
"payload16": {"invoiceBillIdList":["%s"],"payChannelEnum":"YGPT","hosId":"%s"} "payload16": {"invoiceBillIdList":["%s"],"payChannelEnum":"YGPT","hosId":"%s"}
"payload17": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":["","","","","",""],"goodsName":"%s","branchId":"%s","purModes":[],"ssccCode":"","deptId":"","deptQuery":false,"bottleId":"","billModes":null,"provId":"","goodsSpec":"","batchCode":"","mfrCode":""}} "payload17": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":["","","","","",""],"goodsName":"%s","branchId":"%s","purModes":[],"ssccCode":"","deptId":"","deptQuery":false,"bottleId":"","billModes":null,"provId":"","goodsSpec":"","batchCode":"","mfrCode":""}}
"payload17_1": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","branchId":"%s","purModes":[""],"ssccCode":"","deptId":"","deptQuery":false,"stockId":"","bottleId":"","billModes":null,"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}} "payload17_1": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","branchId":"%s","purModes":[""],"ssccCode":"","deptId":"","deptQuery":false,"stockId":"","bottleId":"","billModes":null,"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}}
"payload17_2": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":["",""],"goodsName":"%s","branchId":"%s","purModes":["10"],"ssccCode":"","deptId":"%s","deptQuery":true,"stockId":"%s","bottleId":"","billModes":null,"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}} "payload17_2": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":["%s",""],"goodsName":"%s","branchId":"%s","purModes":["10"],"ssccCode":"","deptId":"%s","deptQuery":true,"stockId":"%s","bottleId":"","billModes":null,"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}}
"payload17_2_1": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":["",""],"goodsName":"%s","branchId":"%s","purModes":["20"],"ssccCode":"","deptId":"%s","deptQuery":true,"stockId":"%s","bottleId":"","billModes":["20"],"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}} #"payload17_2_1": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":["%s",""],"goodsName":"%s","branchId":"%s","purModes":["20"],"ssccCode":"","deptId":"%s","deptQuery":true,"stockId":"%s","bottleId":"","billModes":["20"],"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}}
"payload17_2_2": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":["",""],"goodsName":"%s","branchId":"%s","purModes":["60"],"ssccCode":"","deptId":"%s","deptQuery":true,"stockId":"%s","bottleId":"","billModes":["66"],"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}} "payload17_2_1": {"pageNum":1,"pageSize":50,"queryObject":{"areaCode":"%s","goodsName":"%s","branchId":"%s","purModes":["20"],"ssccCode":"","deptId":"%s","deptQuery":true,"stockId":"%s","bottleId":"","billModes":["20"],"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}}
"payload17_3": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":["",""],"goodsName":"%s","branchId":"%s","purModes":["60"],"ssccCode":"","deptId":"%s","deptQuery":true,"stockId":"%s","bottleId":"","billModes":["67"],"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}} "payload17_2_2": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":["%s",""],"goodsName":"%s","branchId":"%s","purModes":["60"],"ssccCode":"","deptId":"%s","deptQuery":true,"stockId":"%s","bottleId":"","billModes":["66"],"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}}
"payload17_3": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":["%s",""],"goodsName":"%s","branchId":"%s","purModes":["60"],"ssccCode":"","deptId":"%s","deptQuery":true,"stockId":"%s","bottleId":"","billModes":["67"],"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}}
"payload18": {"areaCode":"%s","code":"%s","pickType":"TH","stockId":"%s"} "payload18": {"areaCode":"%s","code":"%s","pickType":"TH","stockId":"%s"}
"payload19": {"areaCode":"%s","reasonKind":"1","remark":"","barCodeList":[{"id":"%s","lastModified":null,"version":null,"createTime":"%s","createUser":null,"lastModifiedUser":null,"snCode":"%s","hosId":"%s","branchId":null,"stockId":"%s","areaCode":"%s","areaName":"%s","shelfCode":"%s","codeType":"%s","tagType":"%s","hosGoodsId":"%s","mdmGoodsCode":"%s","goodsCode":"%s","goodsDi":"%s","barName":"%s","batchCode":"%s","expdtDate":"%s","productDate":"%s","mfrCode":null,"mfrCodeSee":null,"pkgCode":"%s","pkgCodeSee":"%s","ssccCode":"%s","extInfo":null,"outId":null,"tbStatus":"%s","ext":{"distrDetailId":"%s","distrBillId":"%s","certificateCode":"","purBillId":"%s","pkgDefQty":"%s","pkgDefId":"%s","pkgDefName":"%s"},"sourceDetailId":null,"purMode":"%s","purModes":null,"price":null,"pid":null,"goodsMfrsName":"%s","mfrsName":null,"goodsSpec":"%s","unit":"%s","goodsName":"%s","pkgDefId":"%s","pkgDefQty":"%s","purDetailId":null,"pkgDefName":"%s","printNum":"%s","deptId":null,"deptName":null,"billId":null,"taskId":null,"made":"%s","provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","provHosGoodsId":null,"sourceType":null,"taskDate":null,"sourceOrderNo":null,"taskType":null,"detailId":null,"branchGoodsPkgDefList":null,"unitName":null,"areaCodeList":null,"diType":null,"mdmGoodsSpecCode":null,"hosGoodsCode":"%s","supplyId":null,"inSettlement":null,"spdGoodsCode":null,"codeKind":null,"brand":null,"miCode":null,"transferRatio":1,"miDjmc":null,"tbStatusList":null,"purModeText":null,"stockName":null,"tbStatusText":null,"pkgType":null,"bottleId":null,"pkgStatus":null,"qty":null,"packUnit":null,"minSaleQty":null,"rfidFlag":null,"mfrCodeFlag":null,"scanStatus":null,"scanId":null,"multiChargeFlag":null,"useFrequency":null,"chargeUnit":null,"lockStatus":null,"subSendFlag":"%s","onlyKey":"%s2fa9d44bf3b443f184ea457066259ee13332024-11-02100p1e171p1e171"}],"areaName":"%s","hosId":"%s","branchId":"%s","deptId":"%s","deptName":"%s","stockId":"%s","pickType":"TH"} "payload19": {"areaCode":"%s","reasonKind":"1","remark":"","barCodeList":[{"id":"%s","lastModified":null,"version":null,"createTime":"%s","createUser":null,"lastModifiedUser":null,"snCode":"%s","hosId":"%s","branchId":null,"stockId":"%s","areaCode":"%s","areaName":"%s","shelfCode":"%s","codeType":"%s","tagType":"%s","hosGoodsId":"%s","mdmGoodsCode":"%s","goodsCode":"%s","goodsDi":"%s","barName":"%s","batchCode":"%s","expdtDate":"%s","productDate":"%s","mfrCode":null,"mfrCodeSee":null,"pkgCode":"%s","pkgCodeSee":"%s","ssccCode":"%s","extInfo":null,"outId":null,"tbStatus":"%s","ext":{"distrDetailId":"%s","distrBillId":"%s","certificateCode":"","purBillId":"%s","pkgDefQty":"%s","pkgDefId":"%s","pkgDefName":"%s"},"sourceDetailId":null,"purMode":"%s","purModes":null,"price":null,"pid":null,"goodsMfrsName":"%s","mfrsName":null,"goodsSpec":"%s","unit":"%s","goodsName":"%s","pkgDefId":"%s","pkgDefQty":"%s","purDetailId":null,"pkgDefName":"%s","printNum":"%s","deptId":null,"deptName":null,"billId":null,"taskId":null,"made":"%s","provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","provHosGoodsId":null,"sourceType":null,"taskDate":null,"sourceOrderNo":null,"taskType":null,"detailId":null,"branchGoodsPkgDefList":null,"unitName":null,"areaCodeList":null,"diType":null,"mdmGoodsSpecCode":null,"hosGoodsCode":"%s","supplyId":null,"inSettlement":null,"spdGoodsCode":null,"codeKind":null,"brand":null,"miCode":null,"transferRatio":1,"miDjmc":null,"tbStatusList":null,"purModeText":null,"stockName":null,"tbStatusText":null,"pkgType":null,"bottleId":null,"pkgStatus":null,"qty":null,"packUnit":null,"minSaleQty":null,"rfidFlag":null,"mfrCodeFlag":null,"scanStatus":null,"scanId":null,"multiChargeFlag":null,"useFrequency":null,"chargeUnit":null,"lockStatus":null,"subSendFlag":"%s","onlyKey":"%s2fa9d44bf3b443f184ea457066259ee13332024-11-02100p1e171p1e171"}],"areaName":"%s","hosId":"%s","branchId":"%s","deptId":"%s","deptName":"%s","stockId":"%s","pickType":"TH"}
......
...@@ -8,22 +8,22 @@ ...@@ -8,22 +8,22 @@
taskType: 1 taskType: 1
sourceOrgId: p1e37e sourceOrgId: p1e37e
sourceOrgName: 国药集团公司sya!$ sourceOrgName: 国药集团公司sya!$
sourceOrderNo: PSh0347202408020030 sourceOrderNo: PSh0347202408020046
billMode: '66' billMode: '66'
stockKind: stockKind:
purMode: purMode:
sourceId: PSh0347202408020030 sourceId: PSh0347202408020046
sourceDetailId: sourceDetailId:
sourceType: PSD sourceType: PSD
sourceTypeName: 配送单 sourceTypeName: 配送单
sourceVersion: 1 sourceVersion: 1
planOrderNo: PLAN2024080234275 planOrderNo: PLAN2024080234290
purOrderNo: CG2024080222483 purOrderNo: CG2024080222499
recOrgId: ea59fe790acd41719499e7278b8bb50b recOrgId: ea59fe790acd41719499e7278b8bb50b
recOrgName: 二级检验科002 recOrgName: 二级检验科002
billRelationJson: '{"buyBillId":"Bh03472024080200046","planBillId":"Ph034720240802030920","planOrderNo":"PLAN2024080234275","buyOrderNo":"BUY2024080210287","purOrderNo":"CG2024080222483","purBillId":"Ch034720240802000059","purBillDate":"2024-08-02 billRelationJson: '{"buyBillId":"Bh03472024080200061","planBillId":"Ph034720240802030935","planOrderNo":"PLAN2024080234290","buyOrderNo":"BUY2024080210302","purOrderNo":"CG2024080222499","purBillId":"Ch034720240802000075","purBillDate":"2024-08-02
16:20:30","distrBillId":"PSh0347202408020030","distrOrderNo":"PSh0347202408020030"}' 16:37:23","distrBillId":"PSh0347202408020046","distrOrderNo":"PSh0347202408020046"}'
taskDate: '2024-08-02 16:21:10' taskDate: '2024-08-02 16:37:50'
taskDateStart: taskDateStart:
taskDateEnd: taskDateEnd:
billModeList: billModeList:
......
验收单号: 验收单号:
CHECK_NO1: CHECKh03472024080200030 CHECK_NO1: CHECKh03472024080200045
CHECK_NO2: CHECKh03472024080200030 CHECK_NO2: CHECKh03472024080200045
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