|
|
@ -372,13 +372,23 @@ def get_dangerous_list():
|
|
|
|
# @token_auth.login_required
|
|
|
|
# @token_auth.login_required
|
|
|
|
def save_drug_img_info():
|
|
|
|
def save_drug_img_info():
|
|
|
|
# 药剂类别
|
|
|
|
# 药剂类别
|
|
|
|
variety_id = request.values.get("variety_id")
|
|
|
|
# variety_id = request.values.get("variety_id")
|
|
|
|
medicament_id = request.values.get("medicament_id")
|
|
|
|
# medicament_id = request.values.get("medicament_id")
|
|
|
|
file_base64 = request.files.get("file")
|
|
|
|
if request.values.get("selected"):
|
|
|
|
|
|
|
|
medicament_list = json.loads(request.values.get("selected"))
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
medicament_list = [{
|
|
|
|
|
|
|
|
"variety_id": request.values.get("variety_id"),
|
|
|
|
|
|
|
|
"medicament_id": request.values.get("medicament_id"),
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
# try:
|
|
|
|
# try:
|
|
|
|
gaopaiyi_obj = GaoPaiYi()
|
|
|
|
gaopaiyi_obj = GaoPaiYi()
|
|
|
|
img_path = f"{Utils.UUID()}.jpg"
|
|
|
|
img_path = f"{Utils.UUID()}.jpg"
|
|
|
|
file_base64.save(os.path.join(gaopaiyi_obj.path, img_path))
|
|
|
|
file_base64.save(os.path.join(gaopaiyi_obj.path, img_path))
|
|
|
|
|
|
|
|
for medicament in medicament_list:
|
|
|
|
|
|
|
|
variety_id = medicament.get("variety_id")
|
|
|
|
|
|
|
|
medicament_id = medicament.get("medicament_id")
|
|
|
|
# 根据条码查询试剂信息
|
|
|
|
# 根据条码查询试剂信息
|
|
|
|
drug_info = BllMedicament().findEntity(
|
|
|
|
drug_info = BllMedicament().findEntity(
|
|
|
|
EntityMedicament.medicament_id == medicament_id)
|
|
|
|
EntityMedicament.medicament_id == medicament_id)
|
|
|
@ -405,12 +415,21 @@ def get_drug_img(img_path):
|
|
|
|
@token_auth.login_required
|
|
|
|
@token_auth.login_required
|
|
|
|
def use_gaopaiyi():
|
|
|
|
def use_gaopaiyi():
|
|
|
|
# 药剂类别
|
|
|
|
# 药剂类别
|
|
|
|
variety_id = request.values.get("variety_id")
|
|
|
|
# variety_id = request.values.get("variety_id")
|
|
|
|
medicament_id = request.values.get("medicament_id")
|
|
|
|
# medicament_id = request.values.get("medicament_id")
|
|
|
|
|
|
|
|
if request.values.get("selected"):
|
|
|
|
|
|
|
|
medicament_list = json.loads(request.values.get("selected"))
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
medicament_list = [{
|
|
|
|
|
|
|
|
"variety_id": request.values.get("variety_id"),
|
|
|
|
|
|
|
|
"medicament_id": request.values.get("medicament_id"),
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
pic_data = GaoPaiYi().getPic()
|
|
|
|
pic_data = GaoPaiYi().getPic()
|
|
|
|
if pic_data['code'] == 0:
|
|
|
|
if pic_data['code'] == 0:
|
|
|
|
|
|
|
|
for medicament in medicament_list:
|
|
|
|
|
|
|
|
variety_id = medicament.get("variety_id")
|
|
|
|
|
|
|
|
medicament_id = medicament.get("medicament_id")
|
|
|
|
# 根据条码查询试剂信息
|
|
|
|
# 根据条码查询试剂信息
|
|
|
|
drug_info = BllMedicament().findEntity(
|
|
|
|
drug_info = BllMedicament().findEntity(
|
|
|
|
EntityMedicament.medicament_id == medicament_id)
|
|
|
|
EntityMedicament.medicament_id == medicament_id)
|
|
|
|