|
|
@ -466,10 +466,10 @@ public class UdiProductService extends ServiceImpl<UdiProductDao, UdiProductEnti
|
|
|
|
|
|
|
|
|
|
|
|
List<UdiProductEntity> byUuids = udiProductDao.findByUuids(updateLevelDrugRequest.getUuid());
|
|
|
|
List<UdiProductEntity> byUuids = udiProductDao.findByUuids(updateLevelDrugRequest.getUuid());
|
|
|
|
UdiProductEntity udiProductEntity1 = null;
|
|
|
|
UdiProductEntity udiProductEntity1 = null;
|
|
|
|
if (byUuids.size() == 1){
|
|
|
|
if (byUuids.size() == 1) {
|
|
|
|
//只有一条药品数据
|
|
|
|
//只有一条药品数据
|
|
|
|
udiProductEntity1 = byUuids.get(0);
|
|
|
|
udiProductEntity1 = byUuids.get(0);
|
|
|
|
if (udiProductEntity1!= null && udiProductEntity1.getNameCode() == null){
|
|
|
|
if (udiProductEntity1 != null && udiProductEntity1.getNameCode() == null) {
|
|
|
|
//更新
|
|
|
|
//更新
|
|
|
|
udiProductEntity1.setNameCode(updateLevelDrugRequest.getNameCode());
|
|
|
|
udiProductEntity1.setNameCode(updateLevelDrugRequest.getNameCode());
|
|
|
|
udiProductEntity1.setPackLevel(updateLevelDrugRequest.getPackLevel() + "");
|
|
|
|
udiProductEntity1.setPackLevel(updateLevelDrugRequest.getPackLevel() + "");
|
|
|
@ -505,6 +505,11 @@ public class UdiProductService extends ServiceImpl<UdiProductDao, UdiProductEnti
|
|
|
|
udiProductEntity1.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
udiProductEntity1.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
udiProductDao.insert(udiProductEntity1);
|
|
|
|
udiProductDao.insert(udiProductEntity1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IntUtil.value(udiProductEntity1.getPackLevel()) == 1) {
|
|
|
|
|
|
|
|
calculateDistCount(udiProductEntity1, udiRelevanceEntity);
|
|
|
|
|
|
|
|
calculateUseCount(udiProductEntity1, udiRelevanceEntity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//必须先提交后才能保存
|
|
|
|
//必须先提交后才能保存
|
|
|
|
UdiProductEntity udiProductEntity1 = udiProductDao.findByNameCode(updateLevelDrugRequest.getNameCode());
|
|
|
|
UdiProductEntity udiProductEntity1 = udiProductDao.findByNameCode(updateLevelDrugRequest.getNameCode());
|
|
|
|