|
|
@ -1,7 +1,7 @@ |
|
|
|
package digital.laboratory.platform.reagent.service.impl; |
|
|
|
package digital.laboratory.platform.reagent.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil; |
|
|
|
|
|
|
|
import cn.hutool.core.io.IoUtil; |
|
|
|
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.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -15,10 +15,11 @@ import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; |
|
|
|
import digital.laboratory.platform.common.feign.RemoteTemplate2htmlService; |
|
|
|
import digital.laboratory.platform.common.feign.RemoteTemplate2htmlService; |
|
|
|
import digital.laboratory.platform.common.feign.RemoteWord2PDFService; |
|
|
|
import digital.laboratory.platform.common.feign.RemoteWord2PDFService; |
|
|
|
import digital.laboratory.platform.common.oss.service.OssFile; |
|
|
|
import digital.laboratory.platform.common.oss.service.OssFile; |
|
|
|
import digital.laboratory.platform.reagent.config.PageUtils; |
|
|
|
import digital.laboratory.platform.reagent.utils.PageUtils; |
|
|
|
import digital.laboratory.platform.reagent.entity.*; |
|
|
|
import digital.laboratory.platform.reagent.entity.*; |
|
|
|
import digital.laboratory.platform.reagent.mapper.ReagentConsumableInventoryMapper; |
|
|
|
import digital.laboratory.platform.reagent.mapper.ReagentConsumableInventoryMapper; |
|
|
|
import digital.laboratory.platform.reagent.service.*; |
|
|
|
import digital.laboratory.platform.reagent.service.*; |
|
|
|
|
|
|
|
import digital.laboratory.platform.reagent.utils.QRCodeUtils; |
|
|
|
import digital.laboratory.platform.reagent.vo.*; |
|
|
|
import digital.laboratory.platform.reagent.vo.*; |
|
|
|
import feign.Response; |
|
|
|
import feign.Response; |
|
|
|
import org.apache.commons.io.output.ByteArrayOutputStream; |
|
|
|
import org.apache.commons.io.output.ByteArrayOutputStream; |
|
|
@ -30,7 +31,6 @@ import org.springframework.stereotype.Service; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
@ -45,9 +45,6 @@ import java.util.Map; |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
@SuppressWarnings("all") |
|
|
|
@SuppressWarnings("all") |
|
|
|
public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentConsumableInventoryMapper, ReagentConsumableInventory> implements ReagentConsumableInventoryService { |
|
|
|
public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentConsumableInventoryMapper, ReagentConsumableInventory> implements ReagentConsumableInventoryService { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ReagentConsumableInventoryService reagentConsumableInventoryService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private BatchDetailsService batchDetailsService; |
|
|
|
private BatchDetailsService batchDetailsService; |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
@ -78,7 +75,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private OssFile ossFile; |
|
|
|
private OssFile ossFile; |
|
|
|
|
|
|
|
|
|
|
|
@Override//试剂耗材/标准物质标准物质管理列表
|
|
|
|
@Override//标准物质标准物质管理列表
|
|
|
|
public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw, Integer warning) { |
|
|
|
public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw, Integer warning) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -97,7 +94,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
if (list.size() != 0) { |
|
|
|
if (list.size() != 0) { |
|
|
|
for (BatchDetails batchDetails : list) { |
|
|
|
for (BatchDetails batchDetails : list) { |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory byId = reagentConsumableInventoryService.getById(batchDetails.getReagentConsumableInventoryId()); |
|
|
|
ReagentConsumableInventory byId = this.getById(batchDetails.getReagentConsumableInventoryId()); |
|
|
|
ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO(); |
|
|
|
ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO(); |
|
|
|
BeanUtils.copyProperties(byId, reagentConsumableInventoryVO); |
|
|
|
BeanUtils.copyProperties(byId, reagentConsumableInventoryVO); |
|
|
|
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId())); |
|
|
|
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId())); |
|
|
@ -148,7 +145,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
if (list.size() != 0) { |
|
|
|
if (list.size() != 0) { |
|
|
|
for (BatchDetails batchDetails : list) { |
|
|
|
for (BatchDetails batchDetails : list) { |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory byId = reagentConsumableInventoryService.getById(batchDetails.getReagentConsumableInventoryId()); |
|
|
|
ReagentConsumableInventory byId = this.getById(batchDetails.getReagentConsumableInventoryId()); |
|
|
|
ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO(); |
|
|
|
ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO(); |
|
|
|
BeanUtils.copyProperties(byId, reagentConsumableInventoryVO); |
|
|
|
BeanUtils.copyProperties(byId, reagentConsumableInventoryVO); |
|
|
|
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId())); |
|
|
|
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId())); |
|
|
@ -189,12 +186,12 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumableId); |
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumableId); |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
ReagentConsumableInventory one = this.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
one.setTotalQuantity(one.getTotalQuantity() + quantity); |
|
|
|
one.setTotalQuantity(one.getTotalQuantity() + quantity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reagentConsumableInventoryService.updateById(one)) { |
|
|
|
if (this.updateById(one)) { |
|
|
|
|
|
|
|
|
|
|
|
return one; |
|
|
|
return one; |
|
|
|
} else throw new RuntimeException(String.format("库存添加失败")); |
|
|
|
} else throw new RuntimeException(String.format("库存添加失败")); |
|
|
@ -207,7 +204,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumableId); |
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumableId); |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
ReagentConsumableInventory one = this.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
one.setTotalQuantity(one.getTotalQuantity() - quantity); |
|
|
|
one.setTotalQuantity(one.getTotalQuantity() - quantity); |
|
|
|
|
|
|
|
|
|
|
@ -216,7 +213,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
one.setWarningInformation("库存不足"); |
|
|
|
one.setWarningInformation("库存不足"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (reagentConsumableInventoryService.updateById(one)) { |
|
|
|
if (this.updateById(one)) { |
|
|
|
|
|
|
|
|
|
|
|
return one; |
|
|
|
return one; |
|
|
|
} else throw new RuntimeException(String.format("库存减少失败")); |
|
|
|
} else throw new RuntimeException(String.format("库存减少失败")); |
|
|
@ -224,11 +221,85 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override//分页查询标准物质
|
|
|
|
@Override//分页查询标准物质
|
|
|
|
public Page<ReagentConsumableInventoryFullVO> getAllList(Integer current, Integer size, QueryWrapper<ReagentConsumableInventory> qw, Integer status) { |
|
|
|
public Page<ReagentConsumableInventoryFullVO> getAllList(Integer current, Integer size, QueryWrapper<ReagentConsumableInventory> qw,Integer status,String number) { |
|
|
|
|
|
|
|
//如果扫码
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(number)){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(Wrappers.<ReferenceMaterial>query().eq("number", number)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (referenceMaterial!=null) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventoryFullVO byCode = this.getByCode(referenceMaterial.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOS = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryFullVOS.add(byCode); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PageUtils pageUtils = new PageUtils(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Page pages = pageUtils.getPages(current, size, 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());
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// 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.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());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// reagentConsumableInventoryFullVOList.add(reagentConsumableInventoryFullVO);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// PageUtils pageUtils = new PageUtils();
|
|
|
|
|
|
|
|
////
|
|
|
|
|
|
|
|
// Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// return pages;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>(); |
|
|
|
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list(qw); |
|
|
|
List<ReagentConsumableInventory> list = this.list(qw); |
|
|
|
|
|
|
|
|
|
|
|
ArrayList<ReferenceMaterial> referenceMaterialList = new ArrayList<>(); |
|
|
|
ArrayList<ReferenceMaterial> referenceMaterialList = new ArrayList<>(); |
|
|
|
//通过仓库类信息,查找对应的该类所有标准物质
|
|
|
|
//通过仓库类信息,查找对应的该类所有标准物质
|
|
|
@ -259,7 +330,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO(); |
|
|
|
ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO(); |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory byId = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId()); |
|
|
|
ReagentConsumableInventory byId = this.getById(referenceMaterial.getReagentConsumableInventoryId()); |
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(byId, reagentConsumableInventoryFullVO); |
|
|
|
BeanUtils.copyProperties(byId, reagentConsumableInventoryFullVO); |
|
|
|
|
|
|
|
|
|
|
@ -284,7 +355,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime()); |
|
|
|
reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime()); |
|
|
|
reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId()); |
|
|
|
reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId()); |
|
|
|
reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus()); |
|
|
|
reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus()); |
|
|
|
reagentConsumableInventoryFullVO.setStorageLife(Integer.valueOf(batchDetails.getLimitDate())); |
|
|
|
|
|
|
|
reagentConsumableInventoryFullVO.setFixedResult(referenceMaterial.getFixedResult()); |
|
|
|
reagentConsumableInventoryFullVO.setFixedResult(referenceMaterial.getFixedResult()); |
|
|
|
if (one1 != null) { |
|
|
|
if (one1 != null) { |
|
|
|
|
|
|
|
|
|
|
@ -301,7 +371,50 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
|
|
|
|
|
|
|
Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList); |
|
|
|
Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList); |
|
|
|
|
|
|
|
|
|
|
|
return pages; |
|
|
|
return pages;} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override//通过ID,获取标准物质所有信息
|
|
|
|
|
|
|
|
public ReagentConsumableInventoryFullVO getByCode(String id) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return reagentConsumableInventoryFullVO; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -309,7 +422,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<ReagentConsumableInventoryFullVO> getAllRM(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw) { |
|
|
|
public IPage<ReagentConsumableInventoryFullVO> getAllRM(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw) { |
|
|
|
|
|
|
|
|
|
|
|
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list(qw); |
|
|
|
List<ReagentConsumableInventory> list = this.list(qw); |
|
|
|
|
|
|
|
|
|
|
|
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOS = new ArrayList<>(); |
|
|
|
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOS = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
@ -347,7 +460,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw) { |
|
|
|
public List<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw) { |
|
|
|
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list(qw); |
|
|
|
List<ReagentConsumableInventory> list = this.list(qw); |
|
|
|
// return list;
|
|
|
|
// return list;
|
|
|
|
|
|
|
|
|
|
|
|
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>(); |
|
|
|
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>(); |
|
|
@ -461,45 +574,73 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumables byId = reagentConsumablesService.getById(id); |
|
|
|
ReagentConsumables byId = reagentConsumablesService.getById(id); |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(Wrappers.<ReagentConsumableInventory>query() |
|
|
|
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query() |
|
|
|
.eq("reagent_consumable_id", id)); |
|
|
|
.eq("reagent_consumable_id", id)); |
|
|
|
|
|
|
|
|
|
|
|
if (byId != null & one != null) { |
|
|
|
if (byId != null & one != null) { |
|
|
|
byId.setCode(code); |
|
|
|
byId.setCode(code); |
|
|
|
one.setCode(code); |
|
|
|
one.setCode(code); |
|
|
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryService.updateById(one); |
|
|
|
this.updateById(one); |
|
|
|
reagentConsumablesService.updateById(byId); |
|
|
|
reagentConsumablesService.updateById(byId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
//标准物质条形码打印
|
|
|
|
public void setRMCode(String id, String code) { |
|
|
|
public String buildCodeLabelContent(String id) { |
|
|
|
|
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (referenceMaterial != null) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
referenceMaterial.setCode(code); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
referenceMaterialService.updateById(referenceMaterial); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
//标准物质二维码打印
|
|
|
|
|
|
|
|
public String buildCodeLabelContent(String id) { |
|
|
|
|
|
|
|
//录入二维码信息
|
|
|
|
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(id); |
|
|
|
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
referenceMaterialServiceById.setCode(referenceMaterialServiceById.getNumber()); |
|
|
|
|
|
|
|
referenceMaterialService.updateById(referenceMaterialServiceById); |
|
|
|
|
|
|
|
|
|
|
|
if (referenceMaterialServiceById == null) { |
|
|
|
if (referenceMaterialServiceById == null) { |
|
|
|
|
|
|
|
|
|
|
|
throw new RuntimeException(String.format("请先入库后再进行打印条码")); |
|
|
|
throw new RuntimeException(String.format("请先入库后再进行打印条码")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//获取打印信息
|
|
|
|
Map<String, Object> data = new HashMap<>(); |
|
|
|
Map<String, Object> data = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
referenceMaterialServiceById.setCode(LocalDateTimeUtil.format(LocalDateTime.now(), "yyyyMMddHHmmssSSS")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
referenceMaterialService.updateById(referenceMaterialServiceById); |
|
|
|
referenceMaterialService.updateById(referenceMaterialServiceById); |
|
|
|
ReagentConsumables byId = reagentConsumablesService.getById(referenceMaterialServiceById.getReagentConsumableId()); |
|
|
|
ReagentConsumables byId = reagentConsumablesService.getById(referenceMaterialServiceById.getReagentConsumableId()); |
|
|
|
String reagentConsumableName = byId.getReagentConsumableName(); |
|
|
|
String reagentConsumableName = byId.getReagentConsumableName(); |
|
|
|
ReferenceMaterialVO referenceMaterial = new ReferenceMaterialVO(); |
|
|
|
ReferenceMaterialVO referenceMaterial = new ReferenceMaterialVO(); |
|
|
|
|
|
|
|
BatchDetails byId1 = batchDetailsService.getById(referenceMaterialServiceById.getBatchDetailsId()); |
|
|
|
BeanUtils.copyProperties(referenceMaterialServiceById, referenceMaterial); |
|
|
|
BeanUtils.copyProperties(referenceMaterialServiceById, referenceMaterial); |
|
|
|
referenceMaterial.setCodeName(referenceMaterial.getNumber() + "-" + referenceMaterialServiceById.getCode()); |
|
|
|
//完善打印信息
|
|
|
|
|
|
|
|
referenceMaterial.setReferenceMaterialName(byId.getReagentConsumableName()); |
|
|
|
|
|
|
|
referenceMaterial.setTime(byId1.getExpirationDate()); |
|
|
|
data.put("referenceMaterial", referenceMaterial); |
|
|
|
data.put("referenceMaterial", referenceMaterial); |
|
|
|
|
|
|
|
|
|
|
|
String templateFileName = "标准物质标签模板.vm"; |
|
|
|
String templateFileName = "标准物质标签模板.vm"; |
|
|
|
|
|
|
|
|
|
|
|
return remoteTemplate2htmlService.getHtml(templateFileName, data); |
|
|
|
return remoteTemplate2htmlService.getHtml(templateFileName, data); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String printSolutionTag(String id) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StandardReserveSolutionVO standardReserveSolutionVOById = standardReserveSolutionService.getStandardReserveSolutionVOById(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> data = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String qrCodeImageBase64 = QRCodeUtils.getQRCodeImageBase64(standardReserveSolutionVOById.getSolutionName(), 12, 12); |
|
|
|
|
|
|
|
data.put("standardReserveSolution", standardReserveSolutionVOById); |
|
|
|
|
|
|
|
String templateFileName = "标准储备溶液标签模板.vm"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return remoteTemplate2htmlService.getHtml(templateFileName, data); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|