|
|
|
@ -2,6 +2,7 @@ package digital.laboratory.platform.reagent.service.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil; |
|
|
|
|
import cn.hutool.core.io.IoUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
@ -36,8 +37,12 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
import java.util.Calendar; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
@ -52,9 +57,6 @@ import java.util.List; |
|
|
|
|
@SuppressWarnings("all") |
|
|
|
|
public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardReserveSolutionMapper, StandardReserveSolution> implements StandardReserveSolutionService { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private StandardReserveSolutionService standardReserveSolutionService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private SolutionUseFormService solutionUseFormService; |
|
|
|
|
|
|
|
|
@ -87,7 +89,8 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
List<SolutionUseFormVO> solutionUseFormVOList = solutionUseFormService.getSolutionUseFormVOList(standardReserveSolutionVOById.getId()); |
|
|
|
|
|
|
|
|
|
if (solutionUseFormVOList != null) { |
|
|
|
|
standardReserveSolutionVOById.setSolutionUseFormVOList(solutionUseFormVOList);} |
|
|
|
|
standardReserveSolutionVOById.setSolutionUseFormVOList(solutionUseFormVOList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return standardReserveSolutionVOById; |
|
|
|
|
} |
|
|
|
@ -105,6 +108,9 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(standardReserveSolutionDTO, standardReserveSolution); |
|
|
|
|
|
|
|
|
|
standardReserveSolution.setReferenceMaterialScale(standardReserveSolutionDTO.getReferenceMaterialScale()); |
|
|
|
|
standardReserveSolution.setConstantVolume(standardReserveSolutionDTO.getConstantVolume()); |
|
|
|
|
|
|
|
|
|
standardReserveSolution.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
|
|
|
|
|
standardReserveSolution.setDispenserId(dlpUser.getId()); |
|
|
|
@ -112,24 +118,28 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
standardReserveSolution.setConfigurationDate(LocalDateTime.now()); |
|
|
|
|
|
|
|
|
|
standardReserveSolution.setStatus(0); |
|
|
|
|
//计算浓度
|
|
|
|
|
Double v = standardReserveSolution.getReferenceMaterialScale() / standardReserveSolution.getConstantVolume(); |
|
|
|
|
|
|
|
|
|
BigDecimal bigDecimal = new BigDecimal(v); |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
BigDecimal bigDecimal1 = bigDecimal.setScale(2); |
|
|
|
|
|
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName, standardReserveSolution.getSolutionName()); |
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration, standardReserveSolution.getConfigurationConcentration()); |
|
|
|
|
standardReserveSolution.setConfigurationConcentration(bigDecimal1.toString()); |
|
|
|
|
|
|
|
|
|
ReagentConsumables one = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper); |
|
|
|
|
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableName, standardReserveSolution.getSolutionName()); |
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getConfigurationConcentration, standardReserveSolution.getConfigurationConcentration()); |
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
|
//判断是否存在过该标准储备溶液,若未存在,则将其存入试剂耗材类
|
|
|
|
|
if (one == null) { |
|
|
|
|
|
|
|
|
|
ReagentConsumables reagentConsumables = new ReagentConsumables(); |
|
|
|
|
|
|
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId()); |
|
|
|
|
|
|
|
|
|
//创建一个标准储备溶液的种类对象
|
|
|
|
|
ReagentConsumables reagentConsumables1 = reagentConsumablesService.getById(byId.getReagentConsumableId()); |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(reagentConsumables1, reagentConsumables); |
|
|
|
|
|
|
|
|
|
reagentConsumables1.setReagentConsumableId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
reagentConsumables1.setReagentConsumableName(standardReserveSolution.getSolutionName()); |
|
|
|
|
reagentConsumables1.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration()); |
|
|
|
@ -138,166 +148,203 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
reagentConsumables1.setUpdateTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
|
|
reagentConsumablesService.save(reagentConsumables1); |
|
|
|
|
} |
|
|
|
|
//创建标准储备溶液的库存对象
|
|
|
|
|
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); |
|
|
|
|
|
|
|
|
|
if (standardReserveSolutionService.save(standardReserveSolution)) { |
|
|
|
|
BeanUtils.copyProperties(reagentConsumables1, reagentConsumableInventory); |
|
|
|
|
|
|
|
|
|
StandardReserveSolutionVO standardReserveSolutionVOById = standardReserveSolutionService.getStandardReserveSolutionVOById(standardReserveSolution.getId()); |
|
|
|
|
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
|
|
|
|
|
return standardReserveSolutionVOById; |
|
|
|
|
} else throw new RuntimeException(String.format("配置失败")); |
|
|
|
|
} |
|
|
|
|
reagentConsumableInventory.setStatus(1); |
|
|
|
|
|
|
|
|
|
@Override//标准储备溶液入库任务
|
|
|
|
|
@Transactional |
|
|
|
|
public IPage<StandardReserveSolutionVO> getStandardReserveSolutionVOList(IPage<StandardReserveSolution> page, QueryWrapper<StandardReserveSolution> qw) { |
|
|
|
|
reagentConsumableInventory.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration()); |
|
|
|
|
reagentConsumableInventory.setCreateTime(LocalDateTime.now()); |
|
|
|
|
reagentConsumableInventory.setUpdateTime(LocalDateTime.now()); |
|
|
|
|
reagentConsumableInventory.setTotalQuantity(0); |
|
|
|
|
|
|
|
|
|
IPage<StandardReserveSolutionVO> standardReserveSolutionVOPage = baseMapper.getStandardReserveSolutionVOPage(page, qw); |
|
|
|
|
//创建标准储备溶液对象
|
|
|
|
|
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); |
|
|
|
|
//获取当前年月日
|
|
|
|
|
LocalDate date = LocalDate.now(); // get the current date
|
|
|
|
|
//获取当前年月日
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
|
|
|
|
|
|
|
|
|
List<StandardReserveSolutionVO> records = standardReserveSolutionVOPage.getRecords(); |
|
|
|
|
String format = date.format(formatter); |
|
|
|
|
|
|
|
|
|
for (StandardReserveSolutionVO record : records) { |
|
|
|
|
String prefix = reagentConsumableInventory.getEnglishName() + "-" + format+"-"; |
|
|
|
|
|
|
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(record.getReferenceId()); |
|
|
|
|
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() |
|
|
|
|
.likeRight("number", prefix) |
|
|
|
|
.orderByDesc("number")); |
|
|
|
|
|
|
|
|
|
if (byId!=null) { |
|
|
|
|
record.setLocation(byId.getLocation()); |
|
|
|
|
record.setLatticeId(byId.getLatticeId()); |
|
|
|
|
int newNo = 1; |
|
|
|
|
|
|
|
|
|
if ((list != null) && (list.size() > 0)) { |
|
|
|
|
ReferenceMaterial referenceMaterial1 = list.get(0); |
|
|
|
|
String strMaxNo = StrUtil.removePrefixIgnoreCase(referenceMaterial1.getNumber(), prefix); |
|
|
|
|
try { |
|
|
|
|
int maxno = Integer.parseUnsignedInt(strMaxNo); |
|
|
|
|
newNo = maxno + 1; |
|
|
|
|
} catch (NumberFormatException e) { |
|
|
|
|
// 如果后缀有非数字, 则无视之, 重头编码
|
|
|
|
|
newNo = 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//创建标准溶液对象,并生成编号
|
|
|
|
|
referenceMaterial.setStatus(-4); |
|
|
|
|
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
referenceMaterial.setReagentConsumableId(reagentConsumableInventory.getReagentConsumableId()); |
|
|
|
|
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); |
|
|
|
|
referenceMaterial.setNumber(reagentConsumableInventory.getEnglishName() + "-" + format + "-" + newNo); |
|
|
|
|
|
|
|
|
|
ReferenceMaterial byId1 = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId()); |
|
|
|
|
|
|
|
|
|
return standardReserveSolutionVOPage; |
|
|
|
|
} |
|
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(byId.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
@Override//标准储备溶液配置入库
|
|
|
|
|
@Transactional |
|
|
|
|
public StandardReserveSolutionFullVO warehousingById(StandardReserveSolutionFullDTO standardReserveSolutionFullDTO) { |
|
|
|
|
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
String id = standardReserveSolutionFullDTO.getId(); |
|
|
|
|
referenceMaterialService.save(referenceMaterial); |
|
|
|
|
|
|
|
|
|
String location = standardReserveSolutionFullDTO.getLocation(); |
|
|
|
|
String latticeId = standardReserveSolutionFullDTO.getLatticeId(); |
|
|
|
|
String boxId = standardReserveSolutionFullDTO.getBoxId(); |
|
|
|
|
standardReserveSolution.setReferenceId(referenceMaterial.getId()); |
|
|
|
|
|
|
|
|
|
String warehousingRemarks = standardReserveSolutionFullDTO.getWarehousingRemarks(); |
|
|
|
|
//提供格子位置与标准储备溶液配置表ID
|
|
|
|
|
StandardReserveSolution byId = standardReserveSolutionService.getById(id); |
|
|
|
|
|
|
|
|
|
ReferenceMaterial byId1 = referenceMaterialService.getById(byId.getReferenceMaterialId()); |
|
|
|
|
standardReserveSolution.setSolutionNumbering(referenceMaterial.getNumber()); |
|
|
|
|
|
|
|
|
|
remoteCabinetService.updateCabinet(standardReserveSolutionFullDTO.getLatticeId(),byId1.getId(),"1"); |
|
|
|
|
if (reagentConsumableInventoryService.save(reagentConsumableInventory) && this |
|
|
|
|
.save(standardReserveSolution)) { |
|
|
|
|
StandardReserveSolutionFullVO byFullVOId = this.getByFullVOId(standardReserveSolution.getId()); |
|
|
|
|
return byFullVOId; |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(String.format("配置失败")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(byId1.getBatchDetailsId()); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
ReferenceMaterial byId1 = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId()); |
|
|
|
|
|
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName, byId.getSolutionName()); |
|
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(byId1.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration, byId.getConfigurationConcentration()); |
|
|
|
|
//查询出该标准储备溶液的对象
|
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper); |
|
|
|
|
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
LocalDate date = LocalDate.now(); // get the current date
|
|
|
|
|
//获取当前年月日
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumables.getReagentConsumableId()); |
|
|
|
|
//判断仓库是否存在过该标准储备溶液 (标准储备溶液ID与标准物质共用一个RMID,但标准储备溶液具有)
|
|
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
|
//若不存在,则创建一条该标准储备溶液的仓库信息记录表
|
|
|
|
|
if (one == null) { |
|
|
|
|
String format = date.format(formatter); |
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); |
|
|
|
|
//创建标准溶液对象,并生成编号
|
|
|
|
|
referenceMaterial.setStatus(-4); |
|
|
|
|
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
referenceMaterial.setReagentConsumableId(one.getReagentConsumableId()); |
|
|
|
|
referenceMaterial.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(reagentConsumables, reagentConsumableInventory); |
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
int year = calendar.get(Calendar.YEAR); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventory.setStatus(1); |
|
|
|
|
String prefix = one.getEnglishName() + "-" + format+"-"; |
|
|
|
|
|
|
|
|
|
reagentConsumableInventory.setConfigurationConcentration(byId.getConfigurationConcentration()); |
|
|
|
|
reagentConsumableInventory.setCreateTime(LocalDateTime.now()); |
|
|
|
|
reagentConsumableInventory.setUpdateTime(LocalDateTime.now()); |
|
|
|
|
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() |
|
|
|
|
.likeRight("number", prefix) |
|
|
|
|
.orderByDesc("number")); |
|
|
|
|
|
|
|
|
|
int newNo = 1; |
|
|
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); |
|
|
|
|
//获取当前年月日
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
if ((list != null) && (list.size() > 0)) { |
|
|
|
|
ReferenceMaterial referenceMaterial1 = list.get(0); |
|
|
|
|
String strMaxNo = StrUtil.removePrefixIgnoreCase(referenceMaterial1.getNumber(), prefix); |
|
|
|
|
try { |
|
|
|
|
int maxno = Integer.parseUnsignedInt(strMaxNo); |
|
|
|
|
newNo = maxno + 1; |
|
|
|
|
} catch (NumberFormatException e) { |
|
|
|
|
// 如果后缀有非数字, 则无视之, 重头编码
|
|
|
|
|
newNo = 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
referenceMaterial.setNumber(one.getEnglishName() + "-" + format + "-" + newNo); |
|
|
|
|
|
|
|
|
|
formatter.format(date); |
|
|
|
|
//创建标准溶液对象,并生成编号
|
|
|
|
|
referenceMaterial.setStatus(0); |
|
|
|
|
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
referenceMaterial.setReagentConsumableId(reagentConsumableInventory.getReagentConsumableId()); |
|
|
|
|
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); |
|
|
|
|
referenceMaterial.setNumber(reagentConsumableInventory.getEnglishName() + "-" + formatter.format(date)); |
|
|
|
|
referenceMaterial.setLatticeId(latticeId); |
|
|
|
|
referenceMaterial.setLocation(standardReserveSolutionFullDTO.getLocation()); |
|
|
|
|
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); |
|
|
|
|
referenceMaterial.setBoxId(boxId); |
|
|
|
|
|
|
|
|
|
byId.setReferenceId(referenceMaterial.getId()); |
|
|
|
|
standardReserveSolution.setReferenceId(referenceMaterial.getId()); |
|
|
|
|
|
|
|
|
|
referenceMaterialService.save(referenceMaterial); |
|
|
|
|
//将存储信息录入仓库表
|
|
|
|
|
|
|
|
|
|
reagentConsumableInventory.setTotalQuantity(1); |
|
|
|
|
reagentConsumableInventory.setStorageLife(byId.getValidityPeriod()); |
|
|
|
|
|
|
|
|
|
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); |
|
|
|
|
batchDetails.setLatticeId(latticeId); |
|
|
|
|
standardReserveSolution.setSolutionNumbering(referenceMaterial.getNumber()); |
|
|
|
|
|
|
|
|
|
byId.setSolutionNumbering(referenceMaterial.getNumber()); |
|
|
|
|
if (this.save(standardReserveSolution)) { |
|
|
|
|
|
|
|
|
|
byId.setStatus(1); |
|
|
|
|
StandardReserveSolutionVO standardReserveSolutionVOById = this.getStandardReserveSolutionVOById(standardReserveSolution.getId()); |
|
|
|
|
|
|
|
|
|
byId.setWarehousingRemarks(warehousingRemarks); |
|
|
|
|
return standardReserveSolutionVOById; |
|
|
|
|
} else throw new RuntimeException(String.format("配置失败")); |
|
|
|
|
|
|
|
|
|
if (reagentConsumableInventoryService.save(reagentConsumableInventory) && standardReserveSolutionService |
|
|
|
|
.updateById(byId)) { |
|
|
|
|
StandardReserveSolutionFullVO byFullVOId = standardReserveSolutionService.getByFullVOId(byId.getId()); |
|
|
|
|
return byFullVOId; |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(String.format("入库失败")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); |
|
|
|
|
//获取当前年月日
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
@Override//标准储备溶液入库任务
|
|
|
|
|
@Transactional |
|
|
|
|
public IPage<StandardReserveSolutionVO> getStandardReserveSolutionVOList(IPage<StandardReserveSolution> page, QueryWrapper<StandardReserveSolution> qw) { |
|
|
|
|
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-mm-dd"); |
|
|
|
|
IPage<StandardReserveSolutionVO> standardReserveSolutionVOPage = baseMapper.getStandardReserveSolutionVOPage(page, qw); |
|
|
|
|
|
|
|
|
|
formatter.format(date); |
|
|
|
|
//创建标准溶液对象,并生成编号
|
|
|
|
|
referenceMaterial.setStatus(0); |
|
|
|
|
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
referenceMaterial.setReagentConsumableId(one.getReagentConsumableId()); |
|
|
|
|
referenceMaterial.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); |
|
|
|
|
referenceMaterial.setNumber(one.getEnglishName() + "-" + formatter.format(date)); |
|
|
|
|
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); |
|
|
|
|
referenceMaterial.setLatticeId(latticeId); |
|
|
|
|
referenceMaterial.setLocation(standardReserveSolutionFullDTO.getLocation()); |
|
|
|
|
referenceMaterial.setBoxId(boxId); |
|
|
|
|
List<StandardReserveSolutionVO> records = standardReserveSolutionVOPage.getRecords(); |
|
|
|
|
|
|
|
|
|
byId.setReferenceId(referenceMaterial.getId()); |
|
|
|
|
for (StandardReserveSolutionVO record : records) { |
|
|
|
|
|
|
|
|
|
referenceMaterialService.save(referenceMaterial); |
|
|
|
|
//将存储信息录入仓库表
|
|
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(record.getReferenceId()); |
|
|
|
|
|
|
|
|
|
one.setTotalQuantity(one.getTotalQuantity() + 1); |
|
|
|
|
one.setStorageLife(byId.getValidityPeriod()); |
|
|
|
|
if (byId != null) { |
|
|
|
|
record.setLocation(byId.getLocation()); |
|
|
|
|
record.setLatticeId(byId.getLatticeId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return standardReserveSolutionVOPage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override//标准储备溶液配置入库
|
|
|
|
|
@Transactional |
|
|
|
|
public StandardReserveSolutionFullVO warehousingById(StandardReserveSolutionFullDTO standardReserveSolutionFullDTO) { |
|
|
|
|
|
|
|
|
|
String id = standardReserveSolutionFullDTO.getId(); |
|
|
|
|
|
|
|
|
|
String location = standardReserveSolutionFullDTO.getLocation(); |
|
|
|
|
String latticeId = standardReserveSolutionFullDTO.getLatticeId(); |
|
|
|
|
String boxId = standardReserveSolutionFullDTO.getBoxId(); |
|
|
|
|
|
|
|
|
|
String warehousingRemarks = standardReserveSolutionFullDTO.getWarehousingRemarks(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//提供格子位置与标准储备溶液配置表ID
|
|
|
|
|
StandardReserveSolution byId = this.getById(id); |
|
|
|
|
byId.setStatus(1); |
|
|
|
|
|
|
|
|
|
byId.setWarehousingRemarks(warehousingRemarks); |
|
|
|
|
//为标准储备溶液对象赋值位置信息
|
|
|
|
|
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(byId.getReferenceId()); |
|
|
|
|
|
|
|
|
|
referenceMaterialServiceById.setBoxId(boxId); |
|
|
|
|
referenceMaterialServiceById.setLocation(location); |
|
|
|
|
referenceMaterialServiceById.setLatticeId(latticeId); |
|
|
|
|
referenceMaterialServiceById.setStatus(0); |
|
|
|
|
|
|
|
|
|
referenceMaterialService.updateById(referenceMaterialServiceById); |
|
|
|
|
|
|
|
|
|
if (standardReserveSolutionService.updateById(byId) && reagentConsumableInventoryService.updateById(one)) { |
|
|
|
|
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterialServiceById.getReagentConsumableInventoryId()); |
|
|
|
|
|
|
|
|
|
StandardReserveSolutionFullVO byFullVOId = standardReserveSolutionService.getByFullVOId(byId.getId()); |
|
|
|
|
if (reagentConsumableInventory.getTotalQuantity() != null) { |
|
|
|
|
|
|
|
|
|
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + 1); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
reagentConsumableInventory.setTotalQuantity(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.updateById(byId) && reagentConsumableInventoryService.updateById(reagentConsumableInventory)) { |
|
|
|
|
|
|
|
|
|
StandardReserveSolutionFullVO byFullVOId = this.getByFullVOId(byId.getId()); |
|
|
|
|
return byFullVOId; |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(String.format("入库失败")); |
|
|
|
@ -307,7 +354,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
@Override//通过ID查找已入库的标准储备溶液信息
|
|
|
|
|
public StandardReserveSolutionFullVO getByFullVOId(String id) { |
|
|
|
|
|
|
|
|
|
StandardReserveSolutionVO standardReserveSolutionVOById = standardReserveSolutionService.getStandardReserveSolutionVOById(id); |
|
|
|
|
StandardReserveSolutionVO standardReserveSolutionVOById = this.getStandardReserveSolutionVOById(id); |
|
|
|
|
|
|
|
|
|
StandardReserveSolutionFullVO standardReserveSolutionFullVO = new StandardReserveSolutionFullVO(); |
|
|
|
|
|
|
|
|
@ -315,6 +362,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese |
|
|
|
|
|
|
|
|
|
return standardReserveSolutionFullVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void standardReserveSolutionTablePDF(StandardReserveSolutionVO standardReserveSolutionVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { |
|
|
|
|
System.out.println("standardReserveSolutionTablePDF................."); |
|
|
|
|