|
|
@ -16,7 +16,9 @@ import digital.laboratory.platform.reagent.service.*; |
|
|
|
import digital.laboratory.platform.reagent.vo.DeliveryRegistrationFormVO; |
|
|
|
import digital.laboratory.platform.reagent.vo.DeliveryRegistrationFormVO; |
|
|
|
import digital.laboratory.platform.reagent.vo.OutgoingContentsVO; |
|
|
|
import digital.laboratory.platform.reagent.vo.OutgoingContentsVO; |
|
|
|
import digital.laboratory.platform.reagent.vo.ReagentConsumablesSetVO; |
|
|
|
import digital.laboratory.platform.reagent.vo.ReagentConsumablesSetVO; |
|
|
|
|
|
|
|
import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData; |
|
|
|
import digital.laboratory.platform.sys.feign.RemoteCabinetService; |
|
|
|
import digital.laboratory.platform.sys.feign.RemoteCabinetService; |
|
|
|
|
|
|
|
import io.seata.spring.annotation.GlobalTransactional; |
|
|
|
import io.swagger.models.auth.In; |
|
|
|
import io.swagger.models.auth.In; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -84,92 +86,81 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg |
|
|
|
//得到领用集合
|
|
|
|
//得到领用集合
|
|
|
|
LambdaQueryWrapper<ReagentConsumablesSet> reagentConsumablesSetLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<ReagentConsumablesSet> reagentConsumablesSetLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
reagentConsumablesSetLambdaQueryWrapper.eq(ReagentConsumablesSet::getApplicationForUseId, applicationForUse.getId()); |
|
|
|
reagentConsumablesSetLambdaQueryWrapper.eq(ReagentConsumablesSet::getApplicationForUseId, applicationForUse.getId()); |
|
|
|
List<ReagentConsumablesSet> list = reagentConsumablesSetService.list(reagentConsumablesSetLambdaQueryWrapper); |
|
|
|
List<ReagentConsumablesSet> list = reagentConsumablesSetService.list(reagentConsumablesSetLambdaQueryWrapper);//领用申请明细
|
|
|
|
|
|
|
|
|
|
|
|
List<OutgoingContents> outgoingContentsList = new ArrayList<>(); |
|
|
|
List<OutgoingContents> outgoingContentsList = new ArrayList<>();//出库明细集合
|
|
|
|
//循环领用集合,创建出库集合
|
|
|
|
//循环领用集合,创建出库集合
|
|
|
|
for (ReagentConsumablesSet reagentConsumablesSet : list) { |
|
|
|
for (ReagentConsumablesSet reagentConsumablesSet : list) { |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumables one = reagentConsumablesService.getById(reagentConsumablesSet.getReagentConsumableId()); |
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(reagentConsumablesSet.getReagentConsumableId());//试剂耗材信息
|
|
|
|
|
|
|
|
|
|
|
|
if (one.getCategory().equals("标准物质") | one.getCategory().equals("标准储备溶液")) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OutgoingContents outgoingContents = new OutgoingContents(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reagentConsumables.getCategory().equals("标准物质") | reagentConsumables.getCategory().equals("标准储备溶液")) { |
|
|
|
|
|
|
|
OutgoingContents outgoingContents = new OutgoingContents();//出库明细
|
|
|
|
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(reagentConsumablesSet.getReferenceMaterialId());//标准物质
|
|
|
|
|
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(reagentConsumablesSet.getReferenceMaterialId()); |
|
|
|
outgoingContents.setReferenceMaterialId(referenceMaterial.getId());//标准物质ID
|
|
|
|
|
|
|
|
|
|
|
|
outgoingContents.setReferenceMaterialId(referenceMaterial.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
outgoingContents.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
outgoingContents.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId()); |
|
|
|
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());//关联出库登记表
|
|
|
|
outgoingContents.setQuantity(reagentConsumablesSet.getQuantity()); |
|
|
|
outgoingContents.setQuantity(reagentConsumablesSet.getQuantity());//领用申请数量
|
|
|
|
outgoingContents.setRemarks(reagentConsumablesSet.getRemarks()); |
|
|
|
outgoingContents.setRemarks(reagentConsumablesSet.getRemarks());//备注
|
|
|
|
outgoingContents.setOutboundUse(reagentConsumablesSet.getPurpose()); |
|
|
|
outgoingContents.setOutboundUse(reagentConsumablesSet.getPurpose()); |
|
|
|
outgoingContents.setReagentConsumableId(reagentConsumablesSet.getReagentConsumableId()); |
|
|
|
outgoingContents.setReagentConsumableId(reagentConsumablesSet.getReagentConsumableId());//试剂耗材ID
|
|
|
|
outgoingContents.setReagentConsumableType(one.getCategory()); |
|
|
|
outgoingContents.setReagentConsumableType(reagentConsumables.getCategory());//试剂耗材类别
|
|
|
|
outgoingContents.setReferenceMaterialNumber(referenceMaterial.getNumber()); |
|
|
|
outgoingContents.setReferenceMaterialNumber(referenceMaterial.getNumber());//标准物质编号
|
|
|
|
outgoingContents.setBatchDetailsId(reagentConsumablesSet.getBatchDetailsId()); |
|
|
|
outgoingContents.setBatchDetailsId(reagentConsumablesSet.getBatchDetailsId());//批次ID
|
|
|
|
outgoingContents.setLocation(referenceMaterial.getLocation()); |
|
|
|
outgoingContents.setLocation(referenceMaterial.getLocation());//位置信息
|
|
|
|
outgoingContents.setLatticeId(referenceMaterial.getLatticeId()); |
|
|
|
outgoingContents.setLatticeId(referenceMaterial.getLatticeId());//格子ID
|
|
|
|
outgoingContents.setBoxId(referenceMaterial.getBoxId()); |
|
|
|
outgoingContents.setBoxId(referenceMaterial.getBoxId());//柜子ID
|
|
|
|
outgoingContents.setCode(referenceMaterial.getNumber()); |
|
|
|
outgoingContents.setCode(referenceMaterial.getNumber());//扫码出库编号
|
|
|
|
outgoingContents.setReagentConsumablesSetId(reagentConsumablesSet.getId()); |
|
|
|
outgoingContents.setReagentConsumablesSetId(reagentConsumablesSet.getId());//关联领用申请明细
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
outgoingContentsList.add(outgoingContents);//集合
|
|
|
|
outgoingContentsList.add(outgoingContents); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
String reagentConsumableId = reagentConsumablesSet.getReagentConsumableId(); |
|
|
|
String reagentConsumableId = reagentConsumablesSet.getReagentConsumableId();//试剂耗材ID
|
|
|
|
|
|
|
|
//库存试剂耗材
|
|
|
|
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getOne(Wrappers.<ReagentConsumableInventory>query().eq("reagent_consumable_id", reagentConsumableId)); |
|
|
|
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getOne(Wrappers.<ReagentConsumableInventory>query().eq("reagent_consumable_id", reagentConsumableId)); |
|
|
|
|
|
|
|
//所有批次集合
|
|
|
|
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", reagentConsumableInventory.getReagentConsumableInventoryId()) |
|
|
|
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", reagentConsumableInventory.getReagentConsumableInventoryId()) |
|
|
|
.orderByAsc("create_time") |
|
|
|
.orderByAsc("create_time") |
|
|
|
.gt("quantity", 0)); |
|
|
|
.gt("quantity", 0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新建批次集合,用于存放需出库的物品批次
|
|
|
|
List<BatchDetails> batchDetails = new ArrayList<>(); |
|
|
|
List<BatchDetails> batchDetails = new ArrayList<>(); |
|
|
|
|
|
|
|
//领用数量
|
|
|
|
Integer quantity = reagentConsumablesSet.getQuantity(); |
|
|
|
Integer quantity = reagentConsumablesSet.getQuantity(); |
|
|
|
|
|
|
|
//数量,用于计算所需各个批次出库数量
|
|
|
|
Integer batchQuantity = 0; |
|
|
|
Integer batchQuantity = 0; |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < batchDetailsList.size(); i++) { |
|
|
|
for (int i = 0; i < batchDetailsList.size(); i++) { |
|
|
|
|
|
|
|
//从最老的批次开始,如果这个批次的数量满足出库数量,则跳出循环
|
|
|
|
batchQuantity += batchDetailsList.get(i).getQuantity(); |
|
|
|
batchQuantity += batchDetailsList.get(i).getQuantity(); |
|
|
|
|
|
|
|
|
|
|
|
batchDetails.add(batchDetailsList.get(i)); |
|
|
|
batchDetails.add(batchDetailsList.get(i)); |
|
|
|
|
|
|
|
|
|
|
|
if (batchQuantity >= quantity) { |
|
|
|
if (batchQuantity >= quantity) { |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//循环应出库的对应所有批次
|
|
|
|
for (int i = 0; i < batchDetails.size(); i++) { |
|
|
|
for (int i = 0; i < batchDetails.size(); i++) { |
|
|
|
|
|
|
|
|
|
|
|
OutgoingContents outgoingContents = new OutgoingContents(); |
|
|
|
OutgoingContents outgoingContents = new OutgoingContents(); |
|
|
|
outgoingContents.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
outgoingContents.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId()); |
|
|
|
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());//
|
|
|
|
outgoingContents.setQuantity(batchDetails.get(i).getQuantity()); |
|
|
|
outgoingContents.setQuantity(batchDetails.get(i).getQuantity()); |
|
|
|
outgoingContents.setRemarks(reagentConsumablesSet.getRemarks()); |
|
|
|
outgoingContents.setRemarks(reagentConsumablesSet.getRemarks()); |
|
|
|
outgoingContents.setOutboundUse(reagentConsumablesSet.getPurpose()); |
|
|
|
outgoingContents.setOutboundUse(reagentConsumablesSet.getPurpose()); |
|
|
|
outgoingContents.setReagentConsumableId(reagentConsumablesSet.getReagentConsumableId()); |
|
|
|
outgoingContents.setReagentConsumableId(reagentConsumablesSet.getReagentConsumableId()); |
|
|
|
outgoingContents.setReagentConsumableType(one.getCategory()); |
|
|
|
outgoingContents.setReagentConsumableType(reagentConsumables.getCategory()); |
|
|
|
outgoingContents.setBatchDetailsId(batchDetails.get(i).getBatchDetailsId()); |
|
|
|
outgoingContents.setBatchDetailsId(batchDetails.get(i).getBatchDetailsId()); |
|
|
|
outgoingContents.setLocation(batchDetails.get(i).getLocation()); |
|
|
|
outgoingContents.setLocation(batchDetails.get(i).getLocation()); |
|
|
|
outgoingContents.setLatticeId(batchDetails.get(i).getLatticeId()); |
|
|
|
outgoingContents.setLatticeId(batchDetails.get(i).getLatticeId()); |
|
|
|
outgoingContents.setBoxId(batchDetails.get(i).getBoxId()); |
|
|
|
outgoingContents.setBoxId(batchDetails.get(i).getBoxId()); |
|
|
|
outgoingContents.setCode(one.getCode()); |
|
|
|
outgoingContents.setCode(reagentConsumables.getCode()); |
|
|
|
outgoingContents.setReagentConsumablesSetId(reagentConsumablesSet.getId()); |
|
|
|
outgoingContents.setReagentConsumablesSetId(reagentConsumablesSet.getId()); |
|
|
|
|
|
|
|
//遍历至最后一个批次时,要计算出这个批次该出库的数量
|
|
|
|
if (i == batchDetails.size() - 1) { |
|
|
|
if (i == batchDetails.size() - 1) { |
|
|
|
|
|
|
|
|
|
|
|
Integer x = quantity - (batchQuantity - batchDetailsList.get(i).getQuantity()); |
|
|
|
Integer x = quantity - (batchQuantity - batchDetailsList.get(i).getQuantity()); |
|
|
|
|
|
|
|
|
|
|
|
outgoingContents.setQuantity(x); |
|
|
|
outgoingContents.setQuantity(x); |
|
|
|
} |
|
|
|
} |
|
|
|
outgoingContentsList.add(outgoingContents); |
|
|
|
outgoingContentsList.add(outgoingContents); |
|
|
@ -184,63 +175,49 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override//提交出库登记表
|
|
|
|
@Override//提交出库登记表
|
|
|
|
@Transactional |
|
|
|
@GlobalTransactional |
|
|
|
public DeliveryRegistrationForm commitForm(List<OutgoingContentsDTO> outgoingContentsDTOS, DLPUser dlpUser) { |
|
|
|
public DeliveryRegistrationForm commitForm(List<OutgoingContentsDTO> outgoingContentsDTOS, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
//得到出库登记表
|
|
|
|
DeliveryRegistrationForm deliveryRegistrationForm = this.getById(outgoingContentsDTOS.get(0).getDeliveryRegistrationFormId());//得到出库登记表
|
|
|
|
DeliveryRegistrationForm byId = this.getById(outgoingContentsDTOS.get(0).getDeliveryRegistrationFormId()); |
|
|
|
deliveryRegistrationForm.setStatus(1);//状态
|
|
|
|
|
|
|
|
deliveryRegistrationForm.setDepositorId(dlpUser.getId());//出库人//
|
|
|
|
byId.setStatus(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byId.setDepositorId(dlpUser.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<OutgoingContents> outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<OutgoingContents> outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, deliveryRegistrationForm.getId()); |
|
|
|
outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, byId.getId()); |
|
|
|
|
|
|
|
//删除修改之前的内容(防止领用为X种,但实际出库只有n种,导致领用出库不一致)
|
|
|
|
//删除修改之前的内容(防止领用为X种,但实际出库只有n种,导致领用出库不一致)
|
|
|
|
outgoingContentsService.removeBatchByIds(outgoingContentsService.list(outgoingContentsLambdaQueryWrapper)); |
|
|
|
outgoingContentsService.removeBatchByIds(outgoingContentsService.list(outgoingContentsLambdaQueryWrapper)); |
|
|
|
|
|
|
|
|
|
|
|
List<StandardMaterialApplication> standardMaterialApplications = new ArrayList<>(); |
|
|
|
List<StandardMaterialApplication> standardMaterialApplications = new ArrayList<>();//标准物质领用归还登记表集合//
|
|
|
|
|
|
|
|
|
|
|
|
List<OutgoingContents> outgoingContentsList = new ArrayList<>(); |
|
|
|
List<OutgoingContents> outgoingContentsList = new ArrayList<>();//出库明细集合
|
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ApplicationForUse> applicationForUseLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<ApplicationForUse> applicationForUseLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
applicationForUseLambdaQueryWrapper.eq(ApplicationForUse::getDeliveryRegistrationFormId, deliveryRegistrationForm.getId()); |
|
|
|
|
|
|
|
ApplicationForUse applicationForUse = applicationForUseService.getOne(applicationForUseLambdaQueryWrapper);//查询领用申请表
|
|
|
|
|
|
|
|
|
|
|
|
applicationForUseLambdaQueryWrapper.eq(ApplicationForUse::getDeliveryRegistrationFormId, byId.getId()); |
|
|
|
applicationForUse.setClaimCode("");//要将领取码置空
|
|
|
|
//查询领用申请表
|
|
|
|
applicationForUse.setStatus(2);//状态:已出库
|
|
|
|
ApplicationForUse one = applicationForUseService.getOne(applicationForUseLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
one.setClaimCode(""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
one.setStatus(2); |
|
|
|
applicationForUseService.updateById(applicationForUse); |
|
|
|
|
|
|
|
|
|
|
|
applicationForUseService.updateById(one); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (OutgoingContentsDTO outgoingContentsDTO : outgoingContentsDTOS) { |
|
|
|
for (OutgoingContentsDTO outgoingContentsDTO : outgoingContentsDTOS) { |
|
|
|
//传入出库数量,区分出库数量与领用数量
|
|
|
|
//传入出库数量,区分出库数量与领用数量
|
|
|
|
ReagentConsumablesSet reagentConsumablesSet = reagentConsumablesSetService.getById(outgoingContentsDTO.getReagentConsumablesSetId()); |
|
|
|
ReagentConsumablesSet reagentConsumablesSet = reagentConsumablesSetService.getById(outgoingContentsDTO.getReagentConsumablesSetId()); |
|
|
|
|
|
|
|
//因为这里领取的一种物品,可能会对应多个批次,多个数量,但是对于领用人来说,只关心出库总数量
|
|
|
|
if (reagentConsumablesSet.getQuantityDelivered() == null) { |
|
|
|
if (reagentConsumablesSet.getQuantityDelivered() == null) { |
|
|
|
|
|
|
|
reagentConsumablesSet.setQuantityDelivered(outgoingContentsDTO.getQuantity());//
|
|
|
|
reagentConsumablesSet.setQuantityDelivered(outgoingContentsDTO.getQuantity()); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
//一个批次对应一个出库明细,出库多个批次的情况下,要将每个批次的数量相加
|
|
|
|
reagentConsumablesSet.setQuantityDelivered(reagentConsumablesSet.getQuantityDelivered() + outgoingContentsDTO.getQuantity()); |
|
|
|
reagentConsumablesSet.setQuantityDelivered(reagentConsumablesSet.getQuantityDelivered() + outgoingContentsDTO.getQuantity()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
reagentConsumablesSetService.updateById(reagentConsumablesSet); |
|
|
|
reagentConsumablesSetService.updateById(reagentConsumablesSet); |
|
|
|
|
|
|
|
|
|
|
|
OutgoingContents outgoingContents = new OutgoingContents(); |
|
|
|
OutgoingContents outgoingContents = new OutgoingContents(); |
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(outgoingContentsDTO, outgoingContents); |
|
|
|
BeanUtils.copyProperties(outgoingContentsDTO, outgoingContents); |
|
|
|
|
|
|
|
|
|
|
|
outgoingContents.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
outgoingContents.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(outgoingContents.getReagentConsumableId()); |
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(outgoingContents.getReagentConsumableId()); |
|
|
|
|
|
|
|
|
|
|
|
outgoingContents.setReagentConsumableType(reagentConsumables.getCategory()); |
|
|
|
outgoingContents.setReagentConsumableType(reagentConsumables.getCategory()); |
|
|
|
|
|
|
|
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId()); |
|
|
|
outgoingContents.setDeliveryRegistrationFormId(byId.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
outgoingContents.setReferenceMaterialNumber(outgoingContentsDTO.getNumber()); |
|
|
|
outgoingContents.setReferenceMaterialNumber(outgoingContentsDTO.getNumber()); |
|
|
|
|
|
|
|
|
|
|
|
if (reagentConsumables.getCategory().equals("标准物质")) { |
|
|
|
if (reagentConsumables.getCategory().equals("标准物质")) { |
|
|
@ -248,80 +225,69 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg |
|
|
|
StandardMaterialApplication standardMaterialApplication = new StandardMaterialApplication(); |
|
|
|
StandardMaterialApplication standardMaterialApplication = new StandardMaterialApplication(); |
|
|
|
|
|
|
|
|
|
|
|
standardMaterialApplication.setStandardMaterialApplicationId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
standardMaterialApplication.setStandardMaterialApplicationId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
standardMaterialApplication.setPurpose(outgoingContents.getOutboundUse()); |
|
|
|
standardMaterialApplication.setPurpose(outgoingContents.getOutboundUse());//用途
|
|
|
|
standardMaterialApplication.setDateOfClaim(LocalDateTime.now()); |
|
|
|
standardMaterialApplication.setDateOfClaim(LocalDateTime.now());//领用日期
|
|
|
|
standardMaterialApplication.setRecipientId(one.getRecipientId()); |
|
|
|
standardMaterialApplication.setRecipientId(applicationForUse.getRecipientId());//领用人
|
|
|
|
standardMaterialApplication.setReferenceSubstanceId(reagentConsumables.getReagentConsumableId()); |
|
|
|
standardMaterialApplication.setReferenceSubstanceId(reagentConsumables.getReagentConsumableId());//试剂耗材类ID
|
|
|
|
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel()); |
|
|
|
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel());//规格型号
|
|
|
|
standardMaterialApplication.setRequisitionedQuantity(outgoingContents.getQuantity()); |
|
|
|
standardMaterialApplication.setRequisitionedQuantity(outgoingContents.getQuantity());//领用数量
|
|
|
|
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel()); |
|
|
|
standardMaterialApplication.setApplicationForUseId(applicationForUse.getId());//关联领用申请ID
|
|
|
|
standardMaterialApplication.setApplicationForUseId(one.getId()); |
|
|
|
standardMaterialApplication.setReferenceMaterialId(outgoingContentsDTO.getReferenceMaterialId());//标准物质ID
|
|
|
|
standardMaterialApplication.setReferenceMaterialId(outgoingContentsDTO.getReferenceMaterialId()); |
|
|
|
standardMaterialApplication.setAdministratorId(dlpUser.getId());//出库人ID
|
|
|
|
standardMaterialApplication.setAdministratorId(dlpUser.getId()); |
|
|
|
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber());//标准物质编号
|
|
|
|
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber()); |
|
|
|
standardMaterialApplication.setIsReturn(outgoingContentsDTO.getOutboundUse());//是否用完
|
|
|
|
|
|
|
|
standardMaterialApplication.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());//关联出库申请ID
|
|
|
|
|
|
|
|
standardMaterialApplication.setReferenceSubstanceName(reagentConsumables.getReagentConsumableName());//试剂耗材名称
|
|
|
|
|
|
|
|
|
|
|
|
standardMaterialApplications.add(standardMaterialApplication); |
|
|
|
standardMaterialApplications.add(standardMaterialApplication); |
|
|
|
standardMaterialApplication.setIsReturn(outgoingContentsDTO.getOutboundUse()); |
|
|
|
if (outgoingContentsDTO.getOutboundUse() == 2) {//已用完,无需归还
|
|
|
|
standardMaterialApplication.setDeliveryRegistrationFormId(byId.getId()); |
|
|
|
|
|
|
|
standardMaterialApplication.setReferenceSubstanceName(reagentConsumables.getReagentConsumableName()); |
|
|
|
|
|
|
|
if (outgoingContentsDTO.getOutboundUse() == 2) { |
|
|
|
|
|
|
|
standardMaterialApplication.setStatus(-1); |
|
|
|
standardMaterialApplication.setStatus(-1); |
|
|
|
standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString()); |
|
|
|
standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
standardMaterialApplication.setStatus(0); |
|
|
|
standardMaterialApplication.setStatus(0); |
|
|
|
} |
|
|
|
} |
|
|
|
ReferenceMaterial byId1 = referenceMaterialService.getById(outgoingContentsDTO.getReferenceMaterialId()); |
|
|
|
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(outgoingContentsDTO.getReferenceMaterialId()); |
|
|
|
if (byId1.getStatus() == -3) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (referenceMaterial.getStatus() == -3) { |
|
|
|
throw new RuntimeException(String.format("该物品已被其他工作人员领用")); |
|
|
|
throw new RuntimeException(String.format("该物品已被其他工作人员领用")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
byId1.setStatus(-3); |
|
|
|
referenceMaterial.setStatus(-3);//改变状态
|
|
|
|
|
|
|
|
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息
|
|
|
|
referenceMaterialService.updateById(byId1); |
|
|
|
referenceMaterialService.updateById(referenceMaterial); |
|
|
|
|
|
|
|
|
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()); |
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId());//批次信息
|
|
|
|
|
|
|
|
|
|
|
|
if (batchDetails != null) { |
|
|
|
if (batchDetails != null) { |
|
|
|
|
|
|
|
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity());//减少这个批次的数量
|
|
|
|
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity()); |
|
|
|
if (batchDetails.getQuantity() == 0) {//这个批次已被领用完
|
|
|
|
|
|
|
|
|
|
|
|
if (batchDetails.getQuantity() == 0) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
batchDetails.setServiceStatus(-1); |
|
|
|
batchDetails.setServiceStatus(-1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
batchDetailsService.updateById(batchDetails); |
|
|
|
batchDetailsService.updateById(batchDetails); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//查找出对应的仓库信息,将库存量减少
|
|
|
|
//查找出对应的仓库信息,将库存量减少
|
|
|
|
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.reduceById(outgoingContents.getReagentConsumableId(), outgoingContents.getQuantity()); |
|
|
|
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.reduceById(outgoingContents.getReagentConsumableId(), outgoingContents.getQuantity()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reagentConsumableInventory.getTotalQuantity() < 0) { |
|
|
|
if (reagentConsumableInventory.getTotalQuantity() < 0) { |
|
|
|
|
|
|
|
|
|
|
|
throw new RuntimeException(String.format("出库数量不能超过库存量")); |
|
|
|
throw new RuntimeException(String.format("出库数量不能超过库存量")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else if (reagentConsumables.getCategory().equals("标准储备溶液")) { |
|
|
|
} else if (reagentConsumables.getCategory().equals("标准储备溶液")) { |
|
|
|
|
|
|
|
|
|
|
|
StandardReserveSolution reference_id = standardReserveSolutionService.getOne(Wrappers.<StandardReserveSolution>query().eq("reference_id", outgoingContentsDTO.getReferenceMaterialId())); |
|
|
|
StandardReserveSolution reference_id = standardReserveSolutionService.getOne(Wrappers.<StandardReserveSolution>query().eq("reference_id", outgoingContentsDTO.getReferenceMaterialId())); |
|
|
|
|
|
|
|
|
|
|
|
//创建标准物质领用/归还登记表
|
|
|
|
//创建标准物质领用/归还登记表
|
|
|
|
StandardMaterialApplication standardMaterialApplication = new StandardMaterialApplication(); |
|
|
|
StandardMaterialApplication standardMaterialApplication = new StandardMaterialApplication(); |
|
|
|
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber()); |
|
|
|
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber()); |
|
|
|
standardMaterialApplication.setStandardMaterialApplicationId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
standardMaterialApplication.setStandardMaterialApplicationId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
standardMaterialApplication.setPurpose(outgoingContents.getOutboundUse()); |
|
|
|
standardMaterialApplication.setPurpose(outgoingContents.getOutboundUse()); |
|
|
|
standardMaterialApplication.setDateOfClaim(LocalDateTime.now()); |
|
|
|
standardMaterialApplication.setDateOfClaim(LocalDateTime.now()); |
|
|
|
standardMaterialApplication.setRecipientId(one.getRecipientId()); |
|
|
|
standardMaterialApplication.setRecipientId(applicationForUse.getRecipientId()); |
|
|
|
standardMaterialApplication.setReferenceSubstanceId(reagentConsumables.getReagentConsumableId()); |
|
|
|
standardMaterialApplication.setReferenceSubstanceId(reagentConsumables.getReagentConsumableId()); |
|
|
|
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel()); |
|
|
|
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel()); |
|
|
|
standardMaterialApplication.setRequisitionedQuantity(outgoingContents.getQuantity()); |
|
|
|
standardMaterialApplication.setRequisitionedQuantity(outgoingContents.getQuantity()); |
|
|
|
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel()); |
|
|
|
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel()); |
|
|
|
standardMaterialApplication.setApplicationForUseId(one.getId()); |
|
|
|
standardMaterialApplication.setApplicationForUseId(applicationForUse.getId()); |
|
|
|
standardMaterialApplication.setDeliveryRegistrationFormId(byId.getId()); |
|
|
|
standardMaterialApplication.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId()); |
|
|
|
standardMaterialApplication.setReferenceSubstanceName(reference_id.getSolutionName()); |
|
|
|
standardMaterialApplication.setReferenceSubstanceName(reference_id.getSolutionName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (outgoingContentsDTO.getOutboundUse() == 2) { |
|
|
|
if (outgoingContentsDTO.getOutboundUse() == 2) { |
|
|
|
standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString()); |
|
|
|
standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString()); |
|
|
|
standardMaterialApplication.setStatus(1); |
|
|
|
standardMaterialApplication.setStatus(1); |
|
|
@ -333,37 +299,25 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg |
|
|
|
standardMaterialApplications.add(standardMaterialApplication); |
|
|
|
standardMaterialApplications.add(standardMaterialApplication); |
|
|
|
//录入标准储备溶液使用记录
|
|
|
|
//录入标准储备溶液使用记录
|
|
|
|
SolutionUseForm solutionUseForm = solutionUseFormService.useById(outgoingContentsDTO.getReferenceMaterialId(), dlpUser); |
|
|
|
SolutionUseForm solutionUseForm = solutionUseFormService.useById(outgoingContentsDTO.getReferenceMaterialId(), dlpUser); |
|
|
|
|
|
|
|
solutionUseForm.setStandardMaterialApplicationId(standardMaterialApplication.getStandardMaterialApplicationId());//关联标准物质领用归还登记表
|
|
|
|
solutionUseForm.setStandardMaterialApplicationId(standardMaterialApplication.getStandardMaterialApplicationId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
solutionUseFormService.updateById(solutionUseForm); |
|
|
|
solutionUseFormService.updateById(solutionUseForm); |
|
|
|
//通过标准物质ID,查找出对应的仓库信息,将库存量减少
|
|
|
|
//通过标准物质ID,查找出对应的仓库信息,将库存量减少
|
|
|
|
String referenceMaterialId = outgoingContentsDTO.getReferenceMaterialId(); |
|
|
|
String referenceMaterialId = outgoingContentsDTO.getReferenceMaterialId(); |
|
|
|
|
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(referenceMaterialId); |
|
|
|
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(referenceMaterialId); |
|
|
|
|
|
|
|
|
|
|
|
if (referenceMaterial.getStatus() == -3) { |
|
|
|
if (referenceMaterial.getStatus() == -3) { |
|
|
|
|
|
|
|
|
|
|
|
throw new RuntimeException(String.format("该物品已被其他工作人员领用")); |
|
|
|
throw new RuntimeException(String.format("该物品已被其他工作人员领用")); |
|
|
|
} |
|
|
|
} |
|
|
|
referenceMaterial.setStatus(-3); |
|
|
|
referenceMaterial.setStatus(-3); |
|
|
|
|
|
|
|
|
|
|
|
referenceMaterialService.updateById(referenceMaterial); |
|
|
|
referenceMaterialService.updateById(referenceMaterial); |
|
|
|
|
|
|
|
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息
|
|
|
|
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId()); |
|
|
|
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId()); |
|
|
|
|
|
|
|
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() - outgoingContentsDTO.getQuantity());//修改库存数量
|
|
|
|
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() - outgoingContentsDTO.getQuantity()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryService.updateById(reagentConsumableInventory); |
|
|
|
reagentConsumableInventoryService.updateById(reagentConsumableInventory); |
|
|
|
|
|
|
|
|
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()); |
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
|
|
if (batchDetails != null) { |
|
|
|
if (batchDetails != null) { |
|
|
|
|
|
|
|
|
|
|
|
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity()); |
|
|
|
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity()); |
|
|
|
|
|
|
|
if (batchDetails.getQuantity() == 0) {//这个批次已经被领用完
|
|
|
|
if (batchDetails.getQuantity() == 0) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
batchDetails.setServiceStatus(-1); |
|
|
|
batchDetails.setServiceStatus(-1); |
|
|
|
} |
|
|
|
} |
|
|
|
batchDetailsService.updateById(batchDetails); |
|
|
|
batchDetailsService.updateById(batchDetails); |
|
|
@ -371,9 +325,9 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg |
|
|
|
if (reagentConsumableInventory.getTotalQuantity() < 0) { |
|
|
|
if (reagentConsumableInventory.getTotalQuantity() < 0) { |
|
|
|
throw new RuntimeException(String.format("出库数量不能超过库存量")); |
|
|
|
throw new RuntimeException(String.format("出库数量不能超过库存量")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
RequisitionRecord requisitionRecord = requisitionRecordService.addRecord(outgoingContents); |
|
|
|
//如果不是标准物质
|
|
|
|
|
|
|
|
RequisitionRecord requisitionRecord = requisitionRecordService.addRecord(outgoingContents);//试剂耗材领用申请表
|
|
|
|
//查找对应的批次ID,将批次数量减少
|
|
|
|
//查找对应的批次ID,将批次数量减少
|
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()); |
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()); |
|
|
|
/* |
|
|
|
/* |
|
|
@ -381,24 +335,18 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg |
|
|
|
if (batchDetails != null) { |
|
|
|
if (batchDetails != null) { |
|
|
|
//减少对应批次数量
|
|
|
|
//减少对应批次数量
|
|
|
|
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity()); |
|
|
|
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity()); |
|
|
|
|
|
|
|
|
|
|
|
if (batchDetails.getQuantity() == 0) { |
|
|
|
if (batchDetails.getQuantity() == 0) { |
|
|
|
|
|
|
|
|
|
|
|
batchDetails.setServiceStatus(-1); |
|
|
|
batchDetails.setServiceStatus(-1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
batchDetailsService.updateById(batchDetails); |
|
|
|
batchDetailsService.updateById(batchDetails); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
requisitionRecord.setDateOfClaim(LocalDateTime.now());//领用日期
|
|
|
|
requisitionRecord.setDateOfClaim(LocalDateTime.now()); |
|
|
|
requisitionRecord.setRecipientId(applicationForUse.getRecipientId());//领用人ID
|
|
|
|
requisitionRecord.setRecipientId(one.getRecipientId()); |
|
|
|
requisitionRecord.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());//出库登记表ID
|
|
|
|
requisitionRecord.setDeliveryRegistrationFormId(byId.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requisitionRecordService.updateById(requisitionRecord); |
|
|
|
requisitionRecordService.updateById(requisitionRecord); |
|
|
|
//查找出对应的仓库信息,将库存量减少
|
|
|
|
//查找出对应的仓库信息,将库存量减少
|
|
|
|
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.reduceById(outgoingContents.getReagentConsumableId(), outgoingContents.getQuantity()); |
|
|
|
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.reduceById(outgoingContents.getReagentConsumableId(), outgoingContents.getQuantity()); |
|
|
|
|
|
|
|
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),-1); |
|
|
|
if (reagentConsumableInventory.getTotalQuantity() < 0) { |
|
|
|
if (reagentConsumableInventory.getTotalQuantity() < 0) { |
|
|
|
throw new RuntimeException(String.format("出库数量不能超过库存量")); |
|
|
|
throw new RuntimeException(String.format("出库数量不能超过库存量")); |
|
|
|
} |
|
|
|
} |
|
|
@ -413,120 +361,88 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg |
|
|
|
complianceCheckDTO.setReagentConsumableNumber(outgoingContentsDTO.getNumber()); |
|
|
|
complianceCheckDTO.setReagentConsumableNumber(outgoingContentsDTO.getNumber()); |
|
|
|
complianceCheckDTO.setBatchDetailsId(batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()).getBatchDetailsId()); |
|
|
|
complianceCheckDTO.setBatchDetailsId(batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()).getBatchDetailsId()); |
|
|
|
complianceCheckDTO.setReferenceMaterialId(outgoingContentsDTO.getReferenceMaterialId()); |
|
|
|
complianceCheckDTO.setReferenceMaterialId(outgoingContentsDTO.getReferenceMaterialId()); |
|
|
|
complianceCheckService.addCheck(complianceCheckDTO, dlpUser); |
|
|
|
complianceCheckService.addCheck(complianceCheckDTO, dlpUser);//新增符合性检查
|
|
|
|
} |
|
|
|
} |
|
|
|
outgoingContentsList.add(outgoingContents); |
|
|
|
outgoingContentsList.add(outgoingContents); |
|
|
|
} |
|
|
|
} |
|
|
|
if (standardMaterialApplications.size() != 0) { |
|
|
|
if (standardMaterialApplications.size() != 0) { |
|
|
|
standardMaterialApplicationService.saveBatch(standardMaterialApplications); |
|
|
|
standardMaterialApplicationService.saveBatch(standardMaterialApplications); |
|
|
|
} |
|
|
|
} |
|
|
|
if (outgoingContentsService.saveBatch(outgoingContentsList) && this.updateById(byId)) { |
|
|
|
if (outgoingContentsService.saveBatch(outgoingContentsList) && this.updateById(deliveryRegistrationForm)) { |
|
|
|
return byId; |
|
|
|
return deliveryRegistrationForm; |
|
|
|
} else throw new RuntimeException(String.format("提交失败")); |
|
|
|
} else throw new RuntimeException(String.format("提交失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override//分页查询
|
|
|
|
@Override//分页查询
|
|
|
|
public Page<DeliveryRegistrationFormVO> getDeliveryRegistrationFormVOPage(Page page, QueryWrapper<DeliveryRegistrationForm> qw) { |
|
|
|
public Page<DeliveryRegistrationFormVO> getDeliveryRegistrationFormVOPage(Page page, QueryWrapper<DeliveryRegistrationForm> qw) { |
|
|
|
|
|
|
|
|
|
|
|
Page deliveryRegistrationFormVOPage = baseMapper.getDeliveryRegistrationFormVOPage(page, qw); |
|
|
|
Page deliveryRegistrationFormVOPage = baseMapper.getDeliveryRegistrationFormVOPage(page, qw); |
|
|
|
|
|
|
|
|
|
|
|
return deliveryRegistrationFormVOPage; |
|
|
|
return deliveryRegistrationFormVOPage; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override//通过ID查询出库内容
|
|
|
|
@Override//通过ID查询出库内容
|
|
|
|
public DeliveryRegistrationFormVO getDeliveryRegistrationFormVOById(String deliveryRegistrationFormId) { |
|
|
|
public DeliveryRegistrationFormVO getDeliveryRegistrationFormVOById(String deliveryRegistrationFormId) { |
|
|
|
|
|
|
|
//得到VO
|
|
|
|
DeliveryRegistrationFormVO deliveryRegistrationFormVOById = baseMapper.getDeliveryRegistrationFormVOById(deliveryRegistrationFormId); |
|
|
|
DeliveryRegistrationFormVO deliveryRegistrationFormVOById = baseMapper.getDeliveryRegistrationFormVOById(deliveryRegistrationFormId); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<OutgoingContents> outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<OutgoingContents> outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
|
|
outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, deliveryRegistrationFormVOById.getId()); |
|
|
|
outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, deliveryRegistrationFormVOById.getId()); |
|
|
|
|
|
|
|
//出库明细
|
|
|
|
List<OutgoingContents> list = outgoingContentsService.list(outgoingContentsLambdaQueryWrapper); |
|
|
|
List<OutgoingContents> list = outgoingContentsService.list(outgoingContentsLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
List<OutgoingContentsVO> outgoingContentsVOS = new ArrayList<>(); |
|
|
|
List<OutgoingContentsVO> outgoingContentsVOS = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
if (list.size() != 0) { |
|
|
|
if (list.size() != 0) { |
|
|
|
|
|
|
|
//为出库明细关联试剂耗材信息与供应商信息
|
|
|
|
for (OutgoingContents outgoingContents : list) { |
|
|
|
for (OutgoingContents outgoingContents : list) { |
|
|
|
|
|
|
|
|
|
|
|
OutgoingContentsVO outgoingContentsVO = new OutgoingContentsVO(); |
|
|
|
OutgoingContentsVO outgoingContentsVO = new OutgoingContentsVO(); |
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(outgoingContents, outgoingContentsVO); |
|
|
|
BeanUtils.copyProperties(outgoingContents, outgoingContentsVO); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, outgoingContents.getReagentConsumableId()); |
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, outgoingContents.getReagentConsumableId()); |
|
|
|
|
|
|
|
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
|
|
|
|
outgoingContentsVO.setReagentConsumableInventory(reagentConsumableInventory);//试剂耗材信息
|
|
|
|
|
|
|
|
BatchDetails batchDetails = batchDetailsService.getById(outgoingContents.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
if (batchDetails != null) { |
|
|
|
|
|
|
|
outgoingContentsVO.setBatch(batchDetails.getBatch());//批次
|
|
|
|
outgoingContentsVO.setReagentConsumableInventory(one); |
|
|
|
outgoingContentsVO.setSupplierName(supplierInformationService.getById(batchDetails.getSupplierId()).getSupplierName());//供应商名称
|
|
|
|
|
|
|
|
|
|
|
|
BatchDetails byId = batchDetailsService.getById(outgoingContents.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (byId != null) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
outgoingContentsVO.setBatch(byId.getBatch()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
outgoingContentsVO.setSupplierName(supplierInformationService.getById(byId.getSupplierId()).getSupplierName()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
outgoingContentsVOS.add(outgoingContentsVO); |
|
|
|
outgoingContentsVOS.add(outgoingContentsVO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
deliveryRegistrationFormVOById.setOutgoingContentsList(outgoingContentsVOS); |
|
|
|
deliveryRegistrationFormVOById.setOutgoingContentsList(outgoingContentsVOS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return deliveryRegistrationFormVOById; |
|
|
|
return deliveryRegistrationFormVOById; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override//通过ID查询出库内容
|
|
|
|
@Override//通过输入领用码的方式查询出库内容
|
|
|
|
public DeliveryRegistrationFormVO getDeliveryRegistrationFormVOByCode(String claimCode) { |
|
|
|
public DeliveryRegistrationFormVO getDeliveryRegistrationFormVOByCode(String claimCode) { |
|
|
|
|
|
|
|
|
|
|
|
if (!StrUtil.isNotBlank(claimCode)) { |
|
|
|
if (!StrUtil.isNotBlank(claimCode)) { |
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
ApplicationForUse applicationForUse = applicationForUseService.getOne(Wrappers.<ApplicationForUse>query() |
|
|
|
ApplicationForUse applicationForUse = applicationForUseService.getOne(Wrappers.<ApplicationForUse>query() |
|
|
|
.eq("claim_code", claimCode)); |
|
|
|
.eq("claim_code", claimCode)); |
|
|
|
|
|
|
|
|
|
|
|
if (applicationForUse == null) { |
|
|
|
if (applicationForUse == null) { |
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DeliveryRegistrationFormVO deliveryRegistrationFormVOById = baseMapper.getDeliveryRegistrationFormVOById(applicationForUse.getDeliveryRegistrationFormId()); |
|
|
|
DeliveryRegistrationFormVO deliveryRegistrationFormVOById = baseMapper.getDeliveryRegistrationFormVOById(applicationForUse.getDeliveryRegistrationFormId()); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<OutgoingContents> outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<OutgoingContents> outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
|
|
outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, deliveryRegistrationFormVOById.getId()); |
|
|
|
outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, deliveryRegistrationFormVOById.getId()); |
|
|
|
|
|
|
|
|
|
|
|
List<OutgoingContents> list = outgoingContentsService.list(outgoingContentsLambdaQueryWrapper); |
|
|
|
List<OutgoingContents> list = outgoingContentsService.list(outgoingContentsLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
List<OutgoingContentsVO> outgoingContentsVOS = new ArrayList<>(); |
|
|
|
List<OutgoingContentsVO> outgoingContentsVOS = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
if (list.size() != 0) { |
|
|
|
if (list.size() != 0) { |
|
|
|
|
|
|
|
//为出库明细关联试剂耗材信息与供应商信息
|
|
|
|
for (OutgoingContents outgoingContents : list) { |
|
|
|
for (OutgoingContents outgoingContents : list) { |
|
|
|
|
|
|
|
|
|
|
|
OutgoingContentsVO outgoingContentsVO = new OutgoingContentsVO(); |
|
|
|
OutgoingContentsVO outgoingContentsVO = new OutgoingContentsVO(); |
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(outgoingContents, outgoingContentsVO); |
|
|
|
BeanUtils.copyProperties(outgoingContents, outgoingContentsVO); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, outgoingContents.getReagentConsumableId()); |
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, outgoingContents.getReagentConsumableId()); |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
outgoingContentsVO.setReagentConsumableInventory(one); |
|
|
|
outgoingContentsVO.setReagentConsumableInventory(one); |
|
|
|
|
|
|
|
|
|
|
|
outgoingContentsVOS.add(outgoingContentsVO); |
|
|
|
outgoingContentsVOS.add(outgoingContentsVO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
deliveryRegistrationFormVOById.setOutgoingContentsList(outgoingContentsVOS); |
|
|
|
deliveryRegistrationFormVOById.setOutgoingContentsList(outgoingContentsVOS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return deliveryRegistrationFormVOById; |
|
|
|
return deliveryRegistrationFormVOById; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|