|
|
|
@ -18,7 +18,6 @@ import digital.laboratory.platform.common.feign.RemoteTemplate2htmlService; |
|
|
|
|
import digital.laboratory.platform.common.feign.RemoteWord2PDFService; |
|
|
|
|
import digital.laboratory.platform.common.oss.service.OssFile; |
|
|
|
|
import digital.laboratory.platform.reagent.dto.ReagentConsumableInventoryDTO; |
|
|
|
|
import digital.laboratory.platform.reagent.utils.IntegerUtils; |
|
|
|
|
import digital.laboratory.platform.reagent.utils.PageUtils; |
|
|
|
|
import digital.laboratory.platform.reagent.entity.*; |
|
|
|
|
import digital.laboratory.platform.reagent.mapper.ReagentConsumableInventoryMapper; |
|
|
|
@ -28,6 +27,7 @@ import digital.laboratory.platform.sys.entity.CabinetCell; |
|
|
|
|
import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData; |
|
|
|
|
import digital.laboratory.platform.sys.feign.RemoteCabinetService; |
|
|
|
|
import feign.Response; |
|
|
|
|
import io.seata.spring.annotation.GlobalTransactional; |
|
|
|
|
import org.apache.commons.io.output.ByteArrayOutputStream; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@ -562,7 +562,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
Calendar instance = Calendar.getInstance(); |
|
|
|
|
int year = instance.get(Calendar.YEAR); |
|
|
|
|
|
|
|
|
|
IntegerUtils integerUtils = new IntegerUtils(); |
|
|
|
|
for (ReagentConsumableInventoryDTO reagentConsumableInventoryDTO : reagentConsumableInventoryDTOList) { |
|
|
|
|
Integer quantity = reagentConsumableInventoryDTO.getTotalQuantity() * reagentConsumableInventoryDTO.getPackagedCopies(); |
|
|
|
|
SupplierInformation supplier = supplierInformationService.getOne(Wrappers.<SupplierInformation>query().eq("supplier_name", reagentConsumableInventoryDTO.getSupplierName())); |
|
|
|
@ -570,6 +569,32 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
String location = "F" + reagentConsumableInventoryDTO.getRoomNo().charAt(0) + "-" + reagentConsumableInventoryDTO.getRoomNo() + "_试剂柜-" + reagentConsumableInventoryDTO |
|
|
|
|
.getLocation().charAt(0) + "_" + reagentConsumableInventoryDTO.getLocation(); |
|
|
|
|
|
|
|
|
|
if (!StrUtil.isNotBlank(reagentConsumableInventoryDTO.getStandardValueOrPurity())) { |
|
|
|
|
reagentConsumableInventoryDTO.setStandardValueOrPurity(""); |
|
|
|
|
} |
|
|
|
|
if (!StrUtil.isNotBlank(reagentConsumableInventoryDTO.getDeviationOrUncertainty())) { |
|
|
|
|
reagentConsumableInventoryDTO.setDeviationOrUncertainty(""); |
|
|
|
|
} |
|
|
|
|
if (!StrUtil.isNotBlank(reagentConsumableInventoryDTO.getEnglishName())) { |
|
|
|
|
reagentConsumableInventoryDTO.setEnglishName(""); |
|
|
|
|
} |
|
|
|
|
if (!StrUtil.isNotBlank(reagentConsumableInventoryDTO.getCasNumber())) { |
|
|
|
|
reagentConsumableInventoryDTO.setCasNumber(""); |
|
|
|
|
} |
|
|
|
|
if (!StrUtil.isNotBlank(reagentConsumableInventoryDTO.getCode())) { |
|
|
|
|
reagentConsumableInventoryDTO.setCode(""); |
|
|
|
|
} |
|
|
|
|
if (!StrUtil.isNotBlank(reagentConsumableInventoryDTO.getPurityGrade())) { |
|
|
|
|
reagentConsumableInventoryDTO.setPurityGrade(""); |
|
|
|
|
} |
|
|
|
|
if (!StrUtil.isNotBlank(reagentConsumableInventoryDTO.getRemark())) { |
|
|
|
|
reagentConsumableInventoryDTO.setRemark(""); |
|
|
|
|
} |
|
|
|
|
if (!StrUtil.isNotBlank(reagentConsumableInventoryDTO.getAlias())) { |
|
|
|
|
reagentConsumableInventoryDTO.setAlias(""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query() |
|
|
|
|
.eq("reagent_consumable_name", reagentConsumableInventoryDTO.getReagentConsumableName()) |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getBrand()), "brand", reagentConsumableInventoryDTO.getBrand()) |
|
|
|
@ -579,7 +604,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getCasNumber()), "cas_number", reagentConsumableInventoryDTO.getCasNumber()) |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecies()), "species", reagentConsumableInventoryDTO.getSpecies()) |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getEnglishName()), "english_name", reagentConsumableInventoryDTO.getEnglishName()) |
|
|
|
|
.eq(reagentConsumableInventoryDTO.getPackagedCopies()!=null, "packaged_copies", reagentConsumableInventoryDTO.getPackagedCopies()) |
|
|
|
|
.eq(reagentConsumableInventoryDTO.getPackagedCopies() != null, "packaged_copies", reagentConsumableInventoryDTO.getPackagedCopies()) |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getAlias()), "alias", reagentConsumableInventoryDTO.getAlias()) |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getPurityGrade()), "purity_grade", reagentConsumableInventoryDTO.getPurityGrade()) |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getDeviationOrUncertainty()), "deviation_or_uncertainty", reagentConsumableInventoryDTO.getDeviationOrUncertainty()) |
|
|
|
@ -674,18 +699,13 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
BeanUtils.copyProperties(reagentConsumableInventoryDTO, reagentConsumableInventory); |
|
|
|
|
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
reagentConsumableInventory.setWarningValue(1); |
|
|
|
|
if (reagentConsumableInventoryDTO.getSpecificationAndModel().equals("/")) { |
|
|
|
|
if (reagentConsumableInventoryDTO.getPackages() != null) { |
|
|
|
|
if (reagentConsumableInventoryDTO.getSpecificationAndModel().equals("/")) { |
|
|
|
|
reagentConsumableInventory.setSpecificationAndModel(reagentConsumableInventoryDTO.getPackages()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (reagentConsumableInventoryDTO.getPackages() != null) { |
|
|
|
|
reagentConsumableInventory.setSpecificationAndModel(reagentConsumableInventoryDTO.getSpecificationAndModel() + "," + reagentConsumableInventoryDTO.getPackages()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (reagentConsumableInventoryDTO.getPackages() != null) { |
|
|
|
|
reagentConsumableInventory.setSpecificationAndModel(reagentConsumableInventory.getSpecificationAndModel() + "," + reagentConsumableInventoryDTO.getPackages()); |
|
|
|
|
} |
|
|
|
|
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); |
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(reagentConsumableInventory); |
|
|
|
|
reagentConsumableInventory.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); |
|
|
|
@ -772,4 +792,24 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
System.out.println("总个数" + orgFullVOS.size()); |
|
|
|
|
return orgFullVOS; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@GlobalTransactional |
|
|
|
|
public boolean updateLocation(BatchDetails batchDetails) { |
|
|
|
|
|
|
|
|
|
BatchDetails oldBatchDetails = batchDetailsService.getById(batchDetails.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
this.updateCabinet(oldBatchDetails.getLatticeId(), oldBatchDetails.getReagentConsumableInventoryId(), -1);//清除原来位置信息ID
|
|
|
|
|
|
|
|
|
|
oldBatchDetails.setLocation(batchDetails.getLocation()); |
|
|
|
|
oldBatchDetails.setBoxId(batchDetails.getBoxId()); |
|
|
|
|
oldBatchDetails.setLocation(batchDetails.getLocation()); |
|
|
|
|
oldBatchDetails.setRoomNo(batchDetails.getLocation().substring(3, 6)); |
|
|
|
|
|
|
|
|
|
if (batchDetailsService.updateById(oldBatchDetails)) { |
|
|
|
|
this.updateCabinet(oldBatchDetails.getLatticeId(), oldBatchDetails.getReagentConsumableInventoryId(), 1); |
|
|
|
|
return true; |
|
|
|
|
} else return false; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|