试剂详情bug

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

@ -42,6 +42,9 @@ class Utils(object):
def classify(num, all_num, fl=2):
return str(round(float(round(float(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():

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

Loading…
Cancel
Save