|
|
|
@ -13,6 +13,7 @@ import com.deepoove.poi.XWPFTemplate; |
|
|
|
|
import com.deepoove.poi.config.Configure; |
|
|
|
|
import com.deepoove.poi.config.ConfigureBuilder; |
|
|
|
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; |
|
|
|
|
import digital.laboratory.platform.common.core.util.R; |
|
|
|
|
import digital.laboratory.platform.common.feign.RemoteTemplate2htmlService; |
|
|
|
|
import digital.laboratory.platform.common.feign.RemoteWord2PDFService; |
|
|
|
|
import digital.laboratory.platform.common.oss.service.OssFile; |
|
|
|
@ -77,6 +78,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
@Autowired |
|
|
|
|
private RemoteCabinetService remoteCabinetService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ReagentConsumableStashService reagentConsumableStashService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private OssFile ossFile; |
|
|
|
@ -135,7 +139,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
@Override//试剂耗材管理列表
|
|
|
|
|
public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryREVOList(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw, Integer warning) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (warning != null) { |
|
|
|
|
|
|
|
|
|
if (warning == 2) { |
|
|
|
@ -169,8 +172,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
return pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), reagentConsumableInventoryVOList); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, qw); |
|
|
|
|
|
|
|
|
|
List<ReagentConsumableInventoryVO> records = reagentConsumableInventoryVOPage.getRecords(); |
|
|
|
@ -227,8 +228,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override//分页查询标准物质
|
|
|
|
|
public Page<ReagentConsumableInventoryFullVO> getAllList(Integer current, Integer size, QueryWrapper<ReagentConsumableInventory> qw, Integer status, String number) { |
|
|
|
|
public IPage<ReferenceMaterialFullVO> getAllList(Page page, QueryWrapper<ReferenceMaterial> qw, Integer status, String number) { |
|
|
|
|
//如果扫码
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(number)) { |
|
|
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(Wrappers.<ReferenceMaterial>query().eq("number", number)); |
|
|
|
@ -243,142 +245,34 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
|
|
|
|
|
PageUtils pageUtils = new PageUtils(); |
|
|
|
|
|
|
|
|
|
Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOS); |
|
|
|
|
Page pages = pageUtils.getPages(page.getCurrent(), page.getSize(), reagentConsumableInventoryFullVOS); |
|
|
|
|
|
|
|
|
|
return pages; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// List<ReferenceMaterial> list = referenceMaterialService.list(qw);
|
|
|
|
|
//
|
|
|
|
|
// List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>();
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// for (ReferenceMaterial referenceMaterial : list) {
|
|
|
|
|
//
|
|
|
|
|
// ReagentConsumableInventory reagentConsumableInventory = this.getById(referenceMaterial.getReagentConsumableInventoryId());
|
|
|
|
|
//
|
|
|
|
|
// ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO();
|
|
|
|
|
//
|
|
|
|
|
// BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryFullVO);
|
|
|
|
|
//
|
|
|
|
|
// reagentConsumableInventoryFullVO.setNumber(referenceMaterial.getNumber());
|
|
|
|
|
//
|
|
|
|
|
// reagentConsumableInventoryFullVO.setBatchDetailsId(referenceMaterial.getBatchDetailsId());
|
|
|
|
|
//
|
|
|
|
|
// BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
|
|
|
|
|
//
|
|
|
|
|
// SupplierInformation supplierInformation = supplierInformationService.getById(batchDetails.getSupplierId());
|
|
|
|
|
|
|
|
|
|
IPage<ReferenceMaterialFullVO> referenceMaterialPage = baseMapper.getReferenceMaterialPage(page, qw); |
|
|
|
|
|
|
|
|
|
// List<ReferenceMaterialFullVO> referenceMaterialPageRecords = referenceMaterialPage.getRecords();
|
|
|
|
|
//
|
|
|
|
|
// LambdaQueryWrapper<StandardReserveSolution> standardReserveSolutionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
// LambdaQueryWrapper<StandardReserveSolution> standardReserveSolutionQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
//
|
|
|
|
|
// standardReserveSolutionLambdaQueryWrapper.eq(StandardReserveSolution::getReferenceId, referenceMaterial.getId());
|
|
|
|
|
// for (ReferenceMaterialFullVO referenceMaterialPageRecord : referenceMaterialPageRecords) {
|
|
|
|
|
// standardReserveSolutionQueryWrapper.eq(StandardReserveSolution::getReferenceMaterialId,referenceMaterialPageRecord.getReferenceMaterialId());
|
|
|
|
|
// StandardReserveSolution standardReserveSolution = standardReserveSolutionService.getOne(standardReserveSolutionQueryWrapper);
|
|
|
|
|
//
|
|
|
|
|
// StandardReserveSolution one1 = standardReserveSolutionService.getOne(standardReserveSolutionLambdaQueryWrapper);
|
|
|
|
|
// if (standardReserveSolution != null) {
|
|
|
|
|
//
|
|
|
|
|
// reagentConsumableInventoryFullVO.setSupplierName(supplierInformation.getSupplierName());
|
|
|
|
|
// reagentConsumableInventoryFullVO.setBatch(batchDetails.getBatch());
|
|
|
|
|
// reagentConsumableInventoryFullVO.setBatchNumber(batchDetails.getBatchNumber());
|
|
|
|
|
// reagentConsumableInventoryFullVO.setManufacturerId(batchDetails.getSupplierId());
|
|
|
|
|
// reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime());
|
|
|
|
|
// reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId());
|
|
|
|
|
// reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus());
|
|
|
|
|
// reagentConsumableInventoryFullVO.setStorageLife(Integer.valueOf(batchDetails.getLimitDate()));
|
|
|
|
|
// reagentConsumableInventoryFullVO.setFixedResult(referenceMaterial.getFixedResult());
|
|
|
|
|
// if (one1 != null) {
|
|
|
|
|
//
|
|
|
|
|
// reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration());
|
|
|
|
|
// reagentConsumableInventoryFullVO.setConfigurationDate(one1.getConfigurationDate());
|
|
|
|
|
// reagentConsumableInventoryFullVO.setSolutionNumbering(referenceMaterial.getNumber());
|
|
|
|
|
// reagentConsumableInventoryFullVO.setValidityPeriod(one1.getValidityPeriod());
|
|
|
|
|
// referenceMaterialPageRecord.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration());
|
|
|
|
|
// referenceMaterialPageRecord.setConfigurationDate(standardReserveSolution.getConfigurationDate());
|
|
|
|
|
// referenceMaterialPageRecord.setSolutionNumbering(standardReserveSolution.getSolutionNumbering());
|
|
|
|
|
// referenceMaterialPageRecord.setValidityPeriod(standardReserveSolution.getValidityPeriod());
|
|
|
|
|
// }
|
|
|
|
|
// reagentConsumableInventoryFullVOList.add(reagentConsumableInventoryFullVO);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// PageUtils pageUtils = new PageUtils();
|
|
|
|
|
////
|
|
|
|
|
// Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList);
|
|
|
|
|
//
|
|
|
|
|
// return pages;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
List<ReagentConsumableInventory> list = this.list(qw); |
|
|
|
|
|
|
|
|
|
ArrayList<ReferenceMaterial> referenceMaterialList = new ArrayList<>(); |
|
|
|
|
//通过仓库类信息,查找对应的该类所有标准物质
|
|
|
|
|
for (ReagentConsumableInventory reagentConsumableInventory : list) { |
|
|
|
|
|
|
|
|
|
if (reagentConsumableInventory.getTotalQuantity() >= 0) { |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
if (status != null) { |
|
|
|
|
|
|
|
|
|
referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getStatus, status). |
|
|
|
|
eq(ReferenceMaterial::getReagentConsumableInventoryId, reagentConsumableInventory.getReagentConsumableInventoryId()) |
|
|
|
|
.ne(ReferenceMaterial::getStatus, -4); |
|
|
|
|
} else { |
|
|
|
|
referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getReagentConsumableInventoryId, reagentConsumableInventory.getReagentConsumableInventoryId()) |
|
|
|
|
.ne(ReferenceMaterial::getStatus, -4); |
|
|
|
|
} |
|
|
|
|
List<ReferenceMaterial> list1 = referenceMaterialService.list(referenceMaterialLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
referenceMaterialList.addAll(list1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (referenceMaterialList.size() != 0) { |
|
|
|
|
//提供多余字段
|
|
|
|
|
for (ReferenceMaterial referenceMaterial : referenceMaterialList) { |
|
|
|
|
|
|
|
|
|
ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO(); |
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory byId = this.getById(referenceMaterial.getReagentConsumableInventoryId()); |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(byId, reagentConsumableInventoryFullVO); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryFullVO.setNumber(referenceMaterial.getNumber()); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryFullVO.setBatchDetailsId(referenceMaterial.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
SupplierInformation supplierInformation = supplierInformationService.getById(batchDetails.getSupplierId()); |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<StandardReserveSolution> standardReserveSolutionLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
standardReserveSolutionLambdaQueryWrapper.eq(StandardReserveSolution::getReferenceId, referenceMaterial.getId()); |
|
|
|
|
|
|
|
|
|
StandardReserveSolution one1 = standardReserveSolutionService.getOne(standardReserveSolutionLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryFullVO.setSupplierName(supplierInformation.getSupplierName()); |
|
|
|
|
reagentConsumableInventoryFullVO.setBatch(batchDetails.getBatch()); |
|
|
|
|
reagentConsumableInventoryFullVO.setBatchNumber(batchDetails.getBatchNumber()); |
|
|
|
|
reagentConsumableInventoryFullVO.setManufacturerId(batchDetails.getSupplierId()); |
|
|
|
|
reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime()); |
|
|
|
|
reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId()); |
|
|
|
|
reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus()); |
|
|
|
|
reagentConsumableInventoryFullVO.setFixedResult(referenceMaterial.getFixedResult()); |
|
|
|
|
if (one1 != null) { |
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration()); |
|
|
|
|
reagentConsumableInventoryFullVO.setConfigurationDate(one1.getConfigurationDate()); |
|
|
|
|
reagentConsumableInventoryFullVO.setSolutionNumbering(referenceMaterial.getNumber()); |
|
|
|
|
reagentConsumableInventoryFullVO.setValidityPeriod(one1.getValidityPeriod()); |
|
|
|
|
} |
|
|
|
|
reagentConsumableInventoryFullVOList.add(reagentConsumableInventoryFullVO); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PageUtils pageUtils = new PageUtils(); |
|
|
|
|
|
|
|
|
|
Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList); |
|
|
|
|
|
|
|
|
|
return pages; |
|
|
|
|
return referenceMaterialPage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -472,7 +366,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
// return list;
|
|
|
|
|
|
|
|
|
|
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
//找出对应的仓库信息
|
|
|
|
|
for (ReagentConsumableInventory reagentConsumableInventory : list) { |
|
|
|
|
|
|
|
|
@ -519,8 +412,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
} |
|
|
|
|
//-----------------------------
|
|
|
|
|
// 生成 word 版本的 采购目录
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String applyFileName = "标准物质一览表-" + id; |
|
|
|
|
|
|
|
|
|
ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
|
|
|
@ -648,6 +539,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
String templateFileName = "标准储备溶液标签模板.vm"; |
|
|
|
|
return remoteTemplate2htmlService.getHtml(templateFileName, data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<UserVO> getUserList() { |
|
|
|
|
|
|
|
|
@ -659,12 +551,24 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
public void inventoryEntry(List<ReagentConsumableInventoryDTO> reagentConsumableInventoryDTOList) { |
|
|
|
|
for (ReagentConsumableInventoryDTO reagentConsumableInventoryDTO : reagentConsumableInventoryDTOList) { |
|
|
|
|
|
|
|
|
|
String location = "F" + reagentConsumableInventoryDTO.getRoomNo().charAt(0) + "_试剂柜-" + reagentConsumableInventoryDTO |
|
|
|
|
String location = "F" + reagentConsumableInventoryDTO.getRoomNo().charAt(0) + "-" + reagentConsumableInventoryDTO.getRoomNo() + "_试剂柜-" + reagentConsumableInventoryDTO |
|
|
|
|
.getLocation().charAt(0) + "_" + reagentConsumableInventoryDTO.getLocation(); |
|
|
|
|
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); |
|
|
|
|
BeanUtils.copyProperties(reagentConsumableInventoryDTO, reagentConsumableInventory); |
|
|
|
|
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
reagentConsumableInventory.setWarningValue(1); |
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query() |
|
|
|
|
.eq("reagent_consumable_name", reagentConsumableInventoryDTO.getReagentConsumableName()) |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getBrand()),"brand", reagentConsumableInventoryDTO.getBrand()) |
|
|
|
|
.eq("category", reagentConsumableInventoryDTO.getCategory()) |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecificationAndModel()),"specification_and_model", reagentConsumableInventoryDTO.getSpecificationAndModel()) |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getStandardValueOrPurity()), "standard_value_or_purity", reagentConsumableInventoryDTO.getStandardValueOrPurity()) |
|
|
|
|
.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(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getPackagedCopies()), "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()) |
|
|
|
|
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getMinimumUnit()), "minimum_unit", reagentConsumableInventoryDTO.getMinimumUnit()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
BatchDetails batchDetails = new BatchDetails(); |
|
|
|
|
|
|
|
|
@ -684,8 +588,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
} else { |
|
|
|
|
batchDetails.setExpirationDate(LocalDate.now().plusYears(99)); |
|
|
|
|
} |
|
|
|
|
Cabinetcell cabinetCell = baseMapper.getCabinetCell(reagentConsumableInventoryDTO.getLocation()); |
|
|
|
|
|
|
|
|
|
R cell = remoteCabinetService.queryCellByRoomNoAndLocation(reagentConsumableInventoryDTO.getRoomNo(), reagentConsumableInventoryDTO.getLocation()); |
|
|
|
|
Cabinetcell cabinetCell = (Cabinetcell) cell.getData(); |
|
|
|
|
|
|
|
|
|
batchDetails.setLatticeId(cabinetCell.getId()); |
|
|
|
|
batchDetails.setBoxId(cabinetCell.getCabinetId()); |
|
|
|
@ -693,32 +598,119 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
batchDetails.setPurchaseTime(LocalDateTime.now()); |
|
|
|
|
batchDetails.setBatchNumber("/"); |
|
|
|
|
batchDetails.setBatchDetailsId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); |
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(reagentConsumableInventory); |
|
|
|
|
reagentConsumableInventory.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); |
|
|
|
|
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1); |
|
|
|
|
|
|
|
|
|
//导入标准物质
|
|
|
|
|
if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) { |
|
|
|
|
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); |
|
|
|
|
referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); |
|
|
|
|
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); |
|
|
|
|
referenceMaterial.setLocation(location); |
|
|
|
|
referenceMaterial.setStatus(0); |
|
|
|
|
referenceMaterial.setLatticeId(cabinetCell.getId()); |
|
|
|
|
referenceMaterial.setBoxId(cabinetCell.getCabinetId()); |
|
|
|
|
Calendar instance = Calendar.getInstance(); |
|
|
|
|
int year = instance.get(Calendar.YEAR); |
|
|
|
|
String roomNo = reagentConsumableInventoryDTO.getRoomNo(); |
|
|
|
|
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + roomNo.charAt(0) + "-1");//自动生成编号
|
|
|
|
|
referenceMaterial.setCode(referenceMaterial.getNumber()); |
|
|
|
|
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); |
|
|
|
|
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
referenceMaterialService.save(referenceMaterial); |
|
|
|
|
batchDetails.setRoomNo(reagentConsumableInventoryDTO.getRoomNo()); |
|
|
|
|
if (one != null) { |
|
|
|
|
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId())); |
|
|
|
|
if (batchDetailsList != null & batchDetailsList.size() > 0) { |
|
|
|
|
int x = batchDetailsList.size() + 1; |
|
|
|
|
batchDetails.setBatch("2023-" + x); |
|
|
|
|
one.setTotalQuantity(one.getTotalQuantity() + reagentConsumableInventoryDTO.getTotalQuantity()); |
|
|
|
|
this.updateById(one); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); |
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(one.getReagentConsumableId()); |
|
|
|
|
|
|
|
|
|
if (!one.getCategory().equals("标准物质")) { |
|
|
|
|
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query() |
|
|
|
|
.eq("room_no", reagentConsumableInventoryDTO.getRoomNo()) |
|
|
|
|
.eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId())); |
|
|
|
|
|
|
|
|
|
if (reagentConsumableStash != null) { |
|
|
|
|
reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + reagentConsumableInventoryDTO.getTotalQuantity()); |
|
|
|
|
batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId()); |
|
|
|
|
reagentConsumableStashService.updateById(reagentConsumableStash); |
|
|
|
|
} else { |
|
|
|
|
ReagentConsumableStash consumableStash = new ReagentConsumableStash(); |
|
|
|
|
BeanUtils.copyProperties(reagentConsumableInventoryDTO, consumableStash); |
|
|
|
|
consumableStash.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
consumableStash.setTotalQuantity(reagentConsumableInventoryDTO.getTotalQuantity()); |
|
|
|
|
consumableStash.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); |
|
|
|
|
batchDetails.setReagentConsumableStashId(consumableStash.getId()); |
|
|
|
|
reagentConsumableStashService.save(consumableStash); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) { |
|
|
|
|
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); |
|
|
|
|
referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); |
|
|
|
|
referenceMaterial.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); |
|
|
|
|
referenceMaterial.setLocation(location); |
|
|
|
|
referenceMaterial.setStatus(0); |
|
|
|
|
referenceMaterial.setLatticeId(cabinetCell.getId()); |
|
|
|
|
referenceMaterial.setBoxId(cabinetCell.getCabinetId()); |
|
|
|
|
Calendar instance = Calendar.getInstance(); |
|
|
|
|
int year = instance.get(Calendar.YEAR); |
|
|
|
|
String roomNo = reagentConsumableInventoryDTO.getRoomNo(); |
|
|
|
|
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + roomNo.charAt(0) + "-1");//自动生成编号
|
|
|
|
|
referenceMaterial.setCode(referenceMaterial.getNumber()); |
|
|
|
|
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); |
|
|
|
|
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
referenceMaterial.setReagentConsumableName(reagentConsumableInventoryDTO.getReagentConsumableName()); |
|
|
|
|
referenceMaterialService.save(referenceMaterial); |
|
|
|
|
this.updateCabinet(cabinetCell.getId(), referenceMaterial.getId(), 1); |
|
|
|
|
} |
|
|
|
|
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); |
|
|
|
|
BeanUtils.copyProperties(reagentConsumableInventoryDTO, reagentConsumableInventory); |
|
|
|
|
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
reagentConsumableInventory.setWarningValue(1); |
|
|
|
|
if (reagentConsumableInventoryDTO.getSpecificationAndModel().equals("/")) { |
|
|
|
|
reagentConsumableInventory.setSpecificationAndModel(""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); |
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(reagentConsumableInventory); |
|
|
|
|
reagentConsumableInventory.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); |
|
|
|
|
this.save(reagentConsumableInventory); |
|
|
|
|
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1); |
|
|
|
|
|
|
|
|
|
if (!reagentConsumableInventory.getCategory().equals("标准物质")){ |
|
|
|
|
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query() |
|
|
|
|
.eq("room_no", reagentConsumableInventoryDTO.getRoomNo()) |
|
|
|
|
.eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId())); |
|
|
|
|
|
|
|
|
|
if (reagentConsumableStash != null) { |
|
|
|
|
reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + reagentConsumableInventoryDTO.getTotalQuantity()); |
|
|
|
|
batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId()); |
|
|
|
|
reagentConsumableStashService.updateById(reagentConsumableStash); |
|
|
|
|
} else { |
|
|
|
|
ReagentConsumableStash consumableStash = new ReagentConsumableStash(); |
|
|
|
|
BeanUtils.copyProperties(reagentConsumableInventoryDTO, consumableStash); |
|
|
|
|
consumableStash.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
consumableStash.setTotalQuantity(reagentConsumableInventoryDTO.getTotalQuantity()); |
|
|
|
|
consumableStash.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); |
|
|
|
|
batchDetails.setReagentConsumableStashId(consumableStash.getId()); |
|
|
|
|
reagentConsumableStashService.save(consumableStash); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) { |
|
|
|
|
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); |
|
|
|
|
referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); |
|
|
|
|
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); |
|
|
|
|
referenceMaterial.setLocation(location); |
|
|
|
|
referenceMaterial.setStatus(0); |
|
|
|
|
referenceMaterial.setLatticeId(cabinetCell.getId()); |
|
|
|
|
referenceMaterial.setBoxId(cabinetCell.getCabinetId()); |
|
|
|
|
referenceMaterial.setReagentConsumableName(reagentConsumableInventoryDTO.getReagentConsumableName()); |
|
|
|
|
Calendar instance = Calendar.getInstance(); |
|
|
|
|
int year = instance.get(Calendar.YEAR); |
|
|
|
|
String roomNo = reagentConsumableInventoryDTO.getRoomNo(); |
|
|
|
|
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + roomNo.charAt(0) + "-1");//自动生成编号
|
|
|
|
|
referenceMaterial.setCode(referenceMaterial.getNumber()); |
|
|
|
|
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); |
|
|
|
|
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
referenceMaterialService.save(referenceMaterial); |
|
|
|
|
this.updateCabinet(cabinetCell.getId(), referenceMaterial.getId(), 1); |
|
|
|
|
} |
|
|
|
|
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1); |
|
|
|
|
} |
|
|
|
|
this.save(reagentConsumableInventory); |
|
|
|
|
batchDetailsService.save(batchDetails); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|