|
|
|
@ -7,10 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; |
|
|
|
|
import digital.laboratory.platform.reagent.dto.StandardReserveSolutionDTO; |
|
|
|
|
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; |
|
|
|
|
import digital.laboratory.platform.reagent.entity.ReagentConsumables; |
|
|
|
|
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; |
|
|
|
|
import digital.laboratory.platform.reagent.entity.StandardReserveSolution; |
|
|
|
|
import digital.laboratory.platform.reagent.dto.StandardReserveSolutionFullDTO; |
|
|
|
|
import digital.laboratory.platform.reagent.entity.*; |
|
|
|
|
import digital.laboratory.platform.reagent.mapper.StandardReserveSolutionMapper; |
|
|
|
|
import digital.laboratory.platform.reagent.service.*; |
|
|
|
|
import digital.laboratory.platform.reagent.vo.LocationVO; |
|
|
|
@ -24,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
@ -60,6 +59,9 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
@Autowired |
|
|
|
|
private ReferenceMaterialService referenceMaterialService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private BatchDetailsService batchDetailsService; |
|
|
|
|
|
|
|
|
|
@Override//通过ID查询标准溶液的配置记录
|
|
|
|
|
public StandardReserveSolutionVO getStandardReserveSolutionVOById(String id) { |
|
|
|
|
|
|
|
|
@ -74,7 +76,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
|
|
|
|
|
@Override//配置标准储备溶液
|
|
|
|
|
@Transactional |
|
|
|
|
public StandardReserveSolution addById(StandardReserveSolutionDTO standardReserveSolutionDTO, DLPUser dlpUser) { |
|
|
|
|
public StandardReserveSolutionVO addById(StandardReserveSolutionDTO standardReserveSolutionDTO, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
StandardReserveSolution standardReserveSolution = new StandardReserveSolution(); |
|
|
|
|
|
|
|
|
@ -90,12 +92,12 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName,standardReserveSolution.getSolutionName()); |
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration,standardReserveSolution.getConfigurationConcentration()); |
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName, standardReserveSolution.getSolutionName()); |
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration, standardReserveSolution.getConfigurationConcentration()); |
|
|
|
|
|
|
|
|
|
ReagentConsumables one = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper); |
|
|
|
|
//判断是否存在过该标准储备溶液,若未存在,则将其存入试剂耗材类
|
|
|
|
|
if (one==null){ |
|
|
|
|
if (one == null) { |
|
|
|
|
|
|
|
|
|
ReagentConsumables reagentConsumables = new ReagentConsumables(); |
|
|
|
|
|
|
|
|
@ -103,21 +105,25 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
|
|
|
|
|
ReagentConsumables reagentConsumables1 = reagentConsumablesService.getById(byId.getReagentConsumableId()); |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(reagentConsumables1,reagentConsumables); |
|
|
|
|
BeanUtils.copyProperties(reagentConsumables1, reagentConsumables); |
|
|
|
|
|
|
|
|
|
reagentConsumables1.setReagentConsumableId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
reagentConsumables1.setReagentConsumableName(standardReserveSolution.getSolutionName()); |
|
|
|
|
reagentConsumables1.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration()); |
|
|
|
|
reagentConsumables1.setCategory("标准储备溶液"); |
|
|
|
|
|
|
|
|
|
reagentConsumablesService.save(reagentConsumables1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (standardReserveSolutionService.save(standardReserveSolution)) { |
|
|
|
|
return standardReserveSolution; |
|
|
|
|
|
|
|
|
|
StandardReserveSolutionVO standardReserveSolutionVOById = standardReserveSolutionService.getStandardReserveSolutionVOById(standardReserveSolution.getId()); |
|
|
|
|
|
|
|
|
|
return standardReserveSolutionVOById; |
|
|
|
|
} else throw new RuntimeException(String.format("配置失败")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override//标准储备溶液入库任务(查询的为状态为0的标准储备溶液)
|
|
|
|
|
@Override//标准储备溶液入库任务
|
|
|
|
|
public IPage<StandardReserveSolutionVO> getStandardReserveSolutionVOList(IPage<StandardReserveSolution> page, QueryWrapper<StandardReserveSolution> qw) { |
|
|
|
|
|
|
|
|
|
IPage<StandardReserveSolutionVO> standardReserveSolutionVOPage = baseMapper.getStandardReserveSolutionVOPage(page, qw); |
|
|
|
@ -126,15 +132,26 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override//标准储备溶液配置入库
|
|
|
|
|
public StandardReserveSolutionVO warehousingById(String solutionId, String latticeId) { |
|
|
|
|
@Transactional |
|
|
|
|
public StandardReserveSolutionFullVO warehousingById(StandardReserveSolutionFullDTO standardReserveSolutionFullDTO) { |
|
|
|
|
|
|
|
|
|
String id = standardReserveSolutionFullDTO.getId(); |
|
|
|
|
|
|
|
|
|
String latticeId = standardReserveSolutionFullDTO.getLatticeId(); |
|
|
|
|
|
|
|
|
|
String warehousingRemarks = standardReserveSolutionFullDTO.getWarehousingRemarks(); |
|
|
|
|
//提供格子位置与标准储备溶液配置表ID
|
|
|
|
|
StandardReserveSolution byId = standardReserveSolutionService.getById(solutionId); |
|
|
|
|
StandardReserveSolution byId = standardReserveSolutionService.getById(id); |
|
|
|
|
|
|
|
|
|
ReferenceMaterial byId1 = referenceMaterialService.getById(byId.getReferenceMaterialId()); |
|
|
|
|
|
|
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(byId1.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName,byId.getSolutionName()); |
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName, byId.getSolutionName()); |
|
|
|
|
|
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration,byId.getConfigurationConcentration()); |
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration, byId.getConfigurationConcentration()); |
|
|
|
|
//查询出该标准储备溶液的对象
|
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
@ -150,11 +167,17 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(reagentConsumables, reagentConsumableInventory); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventory.setStatus(1); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventory.setConfigurationConcentration(byId.getConfigurationConcentration()); |
|
|
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); |
|
|
|
|
//获取当前年月日
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); |
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-mm-dd"); |
|
|
|
|
|
|
|
|
|
formatter.format(date); |
|
|
|
|
//创建标准溶液对象,并生成编号
|
|
|
|
@ -163,6 +186,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
referenceMaterial.setReagentConsumableId(reagentConsumableInventory.getReagentConsumableId()); |
|
|
|
|
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); |
|
|
|
|
referenceMaterial.setNumber(reagentConsumableInventory.getEnglishName() + "-" + formatter.format(date)); |
|
|
|
|
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
referenceMaterialService.save(referenceMaterial); |
|
|
|
|
|
|
|
|
@ -170,9 +194,13 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
reagentConsumableInventory.setTotalQuantity(1); |
|
|
|
|
reagentConsumableInventory.setStorageLife(byId.getValidityPeriod()); |
|
|
|
|
|
|
|
|
|
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); |
|
|
|
|
|
|
|
|
|
byId.setStatus(1); |
|
|
|
|
|
|
|
|
|
if (reagentConsumableInventoryService.save(reagentConsumableInventory)&&standardReserveSolutionService |
|
|
|
|
byId.setWarehousingRemarks(warehousingRemarks); |
|
|
|
|
|
|
|
|
|
if (reagentConsumableInventoryService.save(reagentConsumableInventory) && standardReserveSolutionService |
|
|
|
|
.updateById(byId)) { |
|
|
|
|
StandardReserveSolutionFullVO byFullVOId = standardReserveSolutionService.getByFullVOId(byId.getId()); |
|
|
|
|
return byFullVOId; |
|
|
|
@ -186,7 +214,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
//获取当前年月日
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); |
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-mm-dd"); |
|
|
|
|
|
|
|
|
|
formatter.format(date); |
|
|
|
|
//创建标准溶液对象,并生成编号
|
|
|
|
@ -195,6 +223,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
referenceMaterial.setReagentConsumableId(one.getReagentConsumableId()); |
|
|
|
|
referenceMaterial.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); |
|
|
|
|
referenceMaterial.setNumber(one.getEnglishName() + "-" + formatter.format(date)); |
|
|
|
|
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
referenceMaterialService.save(referenceMaterial); |
|
|
|
|
//将存储信息录入仓库表
|
|
|
|
@ -205,6 +234,9 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
|
|
|
|
|
byId.setStatus(1); |
|
|
|
|
|
|
|
|
|
byId.setWarehousingRemarks(warehousingRemarks); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (standardReserveSolutionService.updateById(byId) && reagentConsumableInventoryService.updateById(one)) { |
|
|
|
|
|
|
|
|
|
StandardReserveSolutionFullVO byFullVOId = standardReserveSolutionService.getByFullVOId(byId.getId()); |
|
|
|
@ -222,8 +254,10 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
StandardReserveSolutionFullVO standardReserveSolutionFullVO = new StandardReserveSolutionFullVO(); |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
//更新库存信息
|
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, standardReserveSolutionVOById.getReferenceMaterialId()); |
|
|
|
|
|
|
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolutionVOById.getReferenceMaterialId()); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableName, standardReserveSolutionVOById.getSolutionName()); |
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getConfigurationConcentration, standardReserveSolutionVOById.getConfigurationConcentration()); |
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
@ -232,6 +266,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
|
|
|
|
|
LocationVO locationById = latticeFormService.getLocationById(latticeId); |
|
|
|
|
//赋值FullVO对象
|
|
|
|
|
BeanUtils.copyProperties(standardReserveSolutionVOById,standardReserveSolutionFullVO); |
|
|
|
|
standardReserveSolutionFullVO.setStorageRoomFormName(locationById.getStorageRoomFormName()); |
|
|
|
|
standardReserveSolutionFullVO.setCabinetFormNumber(locationById.getCabinetFormNumber()); |
|
|
|
|
standardReserveSolutionFullVO.setLatticeFormNumber(locationById.getLatticeFormNumber()); |
|
|
|
@ -241,5 +276,4 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
return standardReserveSolutionFullVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|