试剂详情bug

duizhaopin
apan_youxiang@163.com 2 years ago
parent 40b3445b1f
commit a804307892

@ -43,6 +43,9 @@ class Utils(object):
return str(round(float(round(float(num) / all_num, fl)) * 100)) + "%" return str(round(float(round(float(num) / all_num, fl)) * 100)) + "%"
# return str(round(float(round(math.ceil(num) / all_num, fl)) * 100)) + "%" # return str(round(float(round(math.ceil(num) / all_num, fl)) * 100)) + "%"
def model_to_dict(cls):
return {c.name: getattr(cls, c.name, None) for c in cls.__table__.columns}
#获取唯一识别码 #获取唯一识别码
def UUID(): def UUID():
return str(uuid.uuid1()) return str(uuid.uuid1())

@ -128,10 +128,9 @@ def drug_use_retur_list():
@token_auth.login_required @token_auth.login_required
def get_drug_info(): def get_drug_info():
bar_code = request.values.get("bar_code") bar_code = request.values.get("bar_code")
data_list = BllMedicament().get_bar_code_drug_info(bar_code=bar_code) data = BllMedicament().findEntity(EntityMedicament.bar_code == bar_code)
if data_list: if data:
data_info = data_list[0] return jsonify(Utils.true_return(data=Utils.model_to_dict(data)))
return jsonify(Utils.true_return(data=Utils.msyql_table_model(data_info)))
else: else:
return jsonify(Utils.false_return(msg="条码有误")) return jsonify(Utils.false_return(msg="条码有误"))

Loading…
Cancel
Save