|
|
|
@ -246,9 +246,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM |
|
|
|
|
|
|
|
|
|
//目录中的试剂耗材是否存在试剂耗材类中,有则不管,无则添加
|
|
|
|
|
for (CatalogueDetails catalogueDetails : list) { |
|
|
|
|
|
|
|
|
|
ReagentConsumables one = reagentConsumablesService.getOne(Wrappers.<ReagentConsumables>query() |
|
|
|
|
|
|
|
|
|
.eq("reagent_consumable_name", catalogueDetails.getReagentConsumableName()) |
|
|
|
|
.eq("brand", catalogueDetails.getBrand()) |
|
|
|
|
.eq("category", catalogueDetails.getCategory()) |
|
|
|
@ -263,7 +261,6 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM |
|
|
|
|
.eq(StrUtil.isNotBlank(catalogueDetails.getDeviationOrUncertainty()), "deviation_or_uncertainty", catalogueDetails.getDeviationOrUncertainty()) |
|
|
|
|
.eq(StrUtil.isNotBlank(catalogueDetails.getMinimumUnit()), "minimum_unit", catalogueDetails.getMinimumUnit()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (one == null) { |
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(catalogueDetails); |
|
|
|
|
catalogueDetails.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); |
|
|
|
@ -278,13 +275,10 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM |
|
|
|
|
} else { |
|
|
|
|
purchaseCatalogue.setStatus(-3); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.updateById(purchaseCatalogue)) { |
|
|
|
|
return purchaseCatalogue; |
|
|
|
|
} else return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId) { |
|
|
|
|
|
|
|
|
@ -322,12 +316,10 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM |
|
|
|
|
catalogueDetailsLambdaQueryWrapper.like(CatalogueDetails::getReagentConsumableName, name); |
|
|
|
|
} |
|
|
|
|
if (category != null) { |
|
|
|
|
|
|
|
|
|
catalogueDetailsLambdaQueryWrapper.like(category == 1, CatalogueDetails::getCategory, "试剂"); |
|
|
|
|
catalogueDetailsLambdaQueryWrapper.like(category == 2, CatalogueDetails::getCategory, "耗材"); |
|
|
|
|
catalogueDetailsLambdaQueryWrapper.like(category == 3, CatalogueDetails::getCategory, "标准物质"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<CatalogueDetails> catalogueDetailsList = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
if (list == null & list.size() == 0) { |
|
|
|
@ -335,8 +327,6 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM |
|
|
|
|
throw new RuntimeException(String.format("未存在已发布的采购目录")); |
|
|
|
|
} |
|
|
|
|
Collections.sort(catalogueDetailsList, new Comparator<CatalogueDetails>() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public int compare(CatalogueDetails o1, CatalogueDetails o2) { |
|
|
|
|
return Integer.valueOf(o1.getPurchaseCatalogueNumber().substring(5)) - Integer.valueOf(o2.getPurchaseCatalogueNumber().substring(5)); |
|
|
|
@ -344,7 +334,6 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM |
|
|
|
|
}); |
|
|
|
|
return catalogueDetailsList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
//导入方法,验证填写内容是否有误
|
|
|
|
|
public PurchaseCatalogueVO getImport(List<PurchaseCatalogueDTO> purchaseCatalogueDTOList) { |
|
|
|
|