液体用量密度保存

duizhaopin
tangxuan 2 years ago
parent dcc6897cb5
commit db7d37a98d

@ -387,7 +387,7 @@ class BllMedicament(Repository):
client_code=entityClient.client_code,
variety_id=entityDrug.variety_id,
medicament_id=entityDrug.medicament_id,
price=entityDrug.price,
price=float(entityDrug.price) if entityDrug.price else 0,
use_quantity=float(lastRemain) - float(entityDrug.remain if entityDrug.remain else 0),
record_type=DrugRecordType.Return,
record_remain=float(entityDrug.remain),
@ -397,6 +397,13 @@ class BllMedicament(Repository):
create_user_name=entityUser.real_name,
)
# 液体用量数据保存
medicament_variety_obj = BllMedicamentVariety().findEntity(
EntityMedicamentVariety.variety_id == entityDrug.variety_id)
if medicament_variety_obj.net_weight_unit == 'ml' and medicament_variety_obj.density:
use_volume = (float(lastRemain) - float(
entityDrug.remain if entityDrug.remain else 0)) / medicament_variety_obj.density
entityDrugRecord.use_volume = use_volume
self.session.add(entityDrugRecord)
entityVariety = BllMedicamentVariety().findEntity(entityDrug.variety_id)
if(entityDrug.remain != 0):

Loading…
Cancel
Save