main
杨海航 2 years ago
parent dd5a23fb67
commit 1f131810e0
  1. 2
      src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApplication.java
  2. 2
      src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApprovalForm.java
  3. 1
      src/main/java/digital/laboratory/platform/reagent/mapper/CheckScheduleMapper.java
  4. 3
      src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
  5. 286
      src/main/java/digital/laboratory/platform/reagent/service/impl/DeliveryRegistrationFormServiceImpl.java
  6. 41
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java
  7. 9
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApplicationServiceImpl.java
  8. 16
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApprovalFormServiceImpl.java
  9. 5
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java
  10. 28
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java
  11. 24
      src/main/resources/mapper/CheckScheduleMapper.xml
  12. 2
      src/main/resources/mapper/ReagentConsumableInventoryMapper.xml

@ -38,7 +38,7 @@ public class StandardMaterialApplication extends BaseEntity {
/** /**
* (状态) * (状态)
*/ */
@ApiModelProperty(value="(状态)") @ApiModelProperty(value="(状态0:待归还 1:已归还 -1 无需归还)")
private Integer status; private Integer status;
/** /**

@ -181,7 +181,7 @@ public class StandardMaterialApprovalForm extends BaseEntity {
@ApiModelProperty(value="(备注)") @ApiModelProperty(value="(备注)")
private String remarks; private String remarks;
@ApiModelProperty(value="(申请内容)") @ApiModelProperty(value="(申请内容)1:停用 2:报废销毁 3:恢复使用 4:降级使用")
private Integer applicationContent; private Integer applicationContent;
/** /**

@ -21,6 +21,5 @@ import org.apache.ibatis.annotations.Param;
public interface CheckScheduleMapper extends BaseMapper<CheckSchedule> { public interface CheckScheduleMapper extends BaseMapper<CheckSchedule> {
IPage <CheckScheduleVO> getCheckScheduleVOPage (IPage<CheckSchedule> page,@Param(Constants.WRAPPER) QueryWrapper<CheckSchedule> qw); IPage <CheckScheduleVO> getCheckScheduleVOPage (IPage<CheckSchedule> page,@Param(Constants.WRAPPER) QueryWrapper<CheckSchedule> qw);
CheckScheduleVO getCheckScheduleVO (String checkScheduleId); CheckScheduleVO getCheckScheduleVO (String checkScheduleId);
} }

@ -59,4 +59,7 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
@Transactional @Transactional
//盘点导入,需提供柜子系统数据 //盘点导入,需提供柜子系统数据
void inventoryEntry(List<ReagentConsumableInventoryDTO> reagentConsumableInventoryDTOList); void inventoryEntry(List<ReagentConsumableInventoryDTO> reagentConsumableInventoryDTOList);
//更新柜子系统方法,柜子ID、物品ID、入库OR出库 (opCode 1 or -1)
void updateCabinet(String latticeId, String itemId, int opCode);
} }

@ -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;
} }

@ -31,7 +31,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -649,7 +648,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
String templateFileName = "标准储备溶液标签模板.vm"; String templateFileName = "标准储备溶液标签模板.vm";
return remoteTemplate2htmlService.getHtml(templateFileName, data); return remoteTemplate2htmlService.getHtml(templateFileName, data);
} }
@Override @Override
public List<UserVO> getUserList() { public List<UserVO> getUserList() {
@ -660,6 +658,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@GlobalTransactional//盘点导入,需提供柜子系统数据 @GlobalTransactional//盘点导入,需提供柜子系统数据
public void inventoryEntry(List<ReagentConsumableInventoryDTO> reagentConsumableInventoryDTOList) { public void inventoryEntry(List<ReagentConsumableInventoryDTO> reagentConsumableInventoryDTOList) {
for (ReagentConsumableInventoryDTO reagentConsumableInventoryDTO : reagentConsumableInventoryDTOList) { for (ReagentConsumableInventoryDTO reagentConsumableInventoryDTO : reagentConsumableInventoryDTOList) {
String location = "F" + reagentConsumableInventoryDTO.getRoomNo().charAt(0) + "_试剂柜-" + reagentConsumableInventoryDTO
.getLocation().charAt(0) + "_" + reagentConsumableInventoryDTO.getLocation();
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory();
BeanUtils.copyProperties(reagentConsumableInventoryDTO, reagentConsumableInventory); BeanUtils.copyProperties(reagentConsumableInventoryDTO, reagentConsumableInventory);
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase());
@ -685,54 +686,54 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
} }
Cabinetcell cabinetCell = baseMapper.getCabinetCell(reagentConsumableInventoryDTO.getLocation()); Cabinetcell cabinetCell = baseMapper.getCabinetCell(reagentConsumableInventoryDTO.getLocation());
ArrayList<CellAndStoreSupplyData> cellAndStoreSupplyDataArrayList = new ArrayList<>();//柜子数组
CellAndStoreSupplyData cellAndStoreSupplyData = new CellAndStoreSupplyData();
cellAndStoreSupplyData.setCellStatus("1");
cellAndStoreSupplyData.setCellId(cabinetCell.getId());
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add(reagentConsumableInventory.getReagentConsumableInventoryId());
cellAndStoreSupplyData.setStoreSupplyList(arrayList);
cellAndStoreSupplyDataArrayList.add(cellAndStoreSupplyData);
remoteCabinetService.takeOrSaveGoodsFromCabinet(cellAndStoreSupplyDataArrayList, 1);
//获取柜子信息
batchDetails.setLatticeId(cabinetCell.getId()); batchDetails.setLatticeId(cabinetCell.getId());
batchDetails.setBoxId(cabinetCell.getCabinetId()); batchDetails.setBoxId(cabinetCell.getCabinetId());
batchDetails.setLocation(reagentConsumableInventoryDTO.getRoomNo() + "-" + reagentConsumableInventoryDTO.getLocation()); batchDetails.setLocation(location);
batchDetails.setPurchaseTime(LocalDateTime.now()); batchDetails.setPurchaseTime(LocalDateTime.now());
batchDetails.setBatchNumber("/"); batchDetails.setBatchNumber("/");
batchDetails.setBatchDetailsId(IdWorker.get32UUID().toUpperCase()); batchDetails.setBatchDetailsId(IdWorker.get32UUID().toUpperCase());
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(reagentConsumableInventory); ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(reagentConsumableInventory);
reagentConsumableInventory.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); reagentConsumableInventory.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1);
//导入标准物质 //导入标准物质
if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) { if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) {
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); ReferenceMaterial referenceMaterial = new ReferenceMaterial();
referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
referenceMaterial.setLocation(reagentConsumableInventoryDTO.getLocation()); referenceMaterial.setLocation(location);
referenceMaterial.setStatus(0); referenceMaterial.setStatus(0);
referenceMaterial.setLatticeId(cabinetCell.getId()); referenceMaterial.setLatticeId(cabinetCell.getId());
referenceMaterial.setBoxId(cabinetCell.getCabinetId()); referenceMaterial.setBoxId(cabinetCell.getCabinetId());
Calendar instance = Calendar.getInstance(); Calendar instance = Calendar.getInstance();
int year = instance.get(Calendar.YEAR); int year = instance.get(Calendar.YEAR);
String roomNo = reagentConsumableInventoryDTO.getRoomNo(); String roomNo = reagentConsumableInventoryDTO.getRoomNo();
String substring = roomNo.substring(0, 1); referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + roomNo.charAt(0) + "-1");//自动生成编号
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + substring + "-1");//自动生成编号
referenceMaterial.setCode(referenceMaterial.getNumber()); referenceMaterial.setCode(referenceMaterial.getNumber());
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterialService.save(referenceMaterial); referenceMaterialService.save(referenceMaterial);
} }
this.save(reagentConsumableInventory); this.save(reagentConsumableInventory);
batchDetailsService.save(batchDetails); batchDetailsService.save(batchDetails);
// remoteCabinetService.updateCabinet(reagentConsumableInventoryDTO.getLatticeId(), reagentConsumableInventory.getReagentConsumableInventoryId(), "1");
} }
} }
@Override
//更新柜子系统方法,柜子ID、物品ID、入库OR出库 (opCode 1 or -1)
public void updateCabinet(String latticeId, String itemId, int opCode) {
ArrayList<CellAndStoreSupplyData> cellAndStoreSupplyDataArrayList = new ArrayList<>();//柜子数组
CellAndStoreSupplyData cellAndStoreSupplyData = new CellAndStoreSupplyData();
cellAndStoreSupplyData.setCellStatus("1");
cellAndStoreSupplyData.setCellId(latticeId);
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add(itemId);
cellAndStoreSupplyData.setStoreSupplyList(arrayList);
cellAndStoreSupplyDataArrayList.add(cellAndStoreSupplyData);
remoteCabinetService.takeOrSaveGoodsFromCabinet(cellAndStoreSupplyDataArrayList, opCode);
}
} }

@ -21,6 +21,7 @@ import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
import digital.laboratory.platform.sys.feign.RemoteCabinetService; import digital.laboratory.platform.sys.feign.RemoteCabinetService;
import feign.Response; import feign.Response;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -77,10 +78,8 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
private RemoteWord2PDFService remoteWord2PDFService; private RemoteWord2PDFService remoteWord2PDFService;
@Override//归还标准物质 @Override//归还标准物质
@Transactional @GlobalTransactional
public StandardMaterialApplication returnById(StandardMaterialApplicationDTO standardMaterialApplicationDTO) { public StandardMaterialApplication returnById(StandardMaterialApplicationDTO standardMaterialApplicationDTO) {
StandardMaterialApplication byId = this.getById(standardMaterialApplicationDTO.getStandardMaterialApplicationId()); StandardMaterialApplication byId = this.getById(standardMaterialApplicationDTO.getStandardMaterialApplicationId());
@ -118,7 +117,8 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
referenceMaterial.setStatus(-2); referenceMaterial.setStatus(-2);
} }
} else { } else {
referenceMaterial.setStatus(0);} referenceMaterial.setStatus(0);
}
BatchDetails byId2 = batchDetailsService.getById(referenceMaterial.getBatchDetailsId()); BatchDetails byId2 = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
byId2.setQuantity(byId2.getQuantity() + 1); byId2.setQuantity(byId2.getQuantity() + 1);
ReagentConsumableInventory byId1 = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId()); ReagentConsumableInventory byId1 = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId());
@ -129,6 +129,7 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
batchDetailsService.updateById(byId2); batchDetailsService.updateById(byId2);
reagentConsumableInventoryService.updateById(byId1); reagentConsumableInventoryService.updateById(byId1);
remoteCabinetService.updateCabinet(standardMaterialApplicationDTO.getLatticeId(), referenceMaterial.getId(), "1"); remoteCabinetService.updateCabinet(standardMaterialApplicationDTO.getLatticeId(), referenceMaterial.getId(), "1");
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(), referenceMaterial.getId(), 1);
} }
referenceMaterialService.updateById(referenceMaterial); referenceMaterialService.updateById(referenceMaterial);

@ -15,15 +15,15 @@ import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile; import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO; import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm;
import digital.laboratory.platform.reagent.entity.SupplierInformation;
import digital.laboratory.platform.reagent.mapper.StandardMaterialApprovalFormMapper; import digital.laboratory.platform.reagent.mapper.StandardMaterialApprovalFormMapper;
import digital.laboratory.platform.reagent.service.ReagentConsumableInventoryService;
import digital.laboratory.platform.reagent.service.ReferenceMaterialService; import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService; import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService;
import digital.laboratory.platform.reagent.service.SupplierInformationService; import digital.laboratory.platform.reagent.service.SupplierInformationService;
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO; import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO;
import feign.Response; import feign.Response;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.commons.io.output.ByteArrayOutputStream;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -58,6 +58,9 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
@Autowired @Autowired
private RemoteWord2PDFService remoteWord2PDFService; private RemoteWord2PDFService remoteWord2PDFService;
@Autowired
private ReagentConsumableInventoryService reagentConsumableInventoryService;
@Override//提交表单 @Override//提交表单
public StandardMaterialApprovalForm commitById(StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser) { public StandardMaterialApprovalForm commitById(StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser) {
@ -126,6 +129,7 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
} }
@Override//审批 @Override//审批
@GlobalTransactional
public StandardMaterialApprovalForm approveById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public StandardMaterialApprovalForm approveById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
StandardMaterialApprovalForm byId1 = this.getById(auditAndApproveDTO.getUuId()); StandardMaterialApprovalForm byId1 = this.getById(auditAndApproveDTO.getUuId());
@ -157,19 +161,15 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
}else if (byId1.getApplicationContent()==2){ }else if (byId1.getApplicationContent()==2){
ReferenceMaterial byId = referenceMaterialService.getById(byId1.getReferenceMaterialId()); ReferenceMaterial byId = referenceMaterialService.getById(byId1.getReferenceMaterialId());
byId.setStatus(-4); byId.setStatus(-4);
reagentConsumableInventoryService.updateCabinet(byId.getLatticeId(),byId.getId(),-1);
referenceMaterialService.updateById(byId); referenceMaterialService.updateById(byId);
} }
else { else {
ReferenceMaterial byId = referenceMaterialService.getById(byId1.getReferenceMaterialId()); ReferenceMaterial byId = referenceMaterialService.getById(byId1.getReferenceMaterialId());
byId.setStatus(0); byId.setStatus(0);
byId.setServiceStatus(0); byId.setServiceStatus(0);
referenceMaterialService.updateById(byId); referenceMaterialService.updateById(byId);
} }

@ -26,6 +26,7 @@ import digital.laboratory.platform.reagent.vo.*;
import digital.laboratory.platform.sys.feign.RemoteCabinetService; import digital.laboratory.platform.sys.feign.RemoteCabinetService;
import feign.Response; import feign.Response;
//import io.seata.spring.annotation.GlobalTransactional; //import io.seata.spring.annotation.GlobalTransactional;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -302,7 +303,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
} }
@Override//标准储备溶液配置入库 @Override//标准储备溶液配置入库
@Transactional @GlobalTransactional
public StandardReserveSolutionFullVO warehousingById(StandardReserveSolutionFullDTO standardReserveSolutionFullDTO) { public StandardReserveSolutionFullVO warehousingById(StandardReserveSolutionFullDTO standardReserveSolutionFullDTO) {
String id = standardReserveSolutionFullDTO.getId(); String id = standardReserveSolutionFullDTO.getId();
@ -330,7 +331,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
referenceMaterialService.updateById(referenceMaterialServiceById); referenceMaterialService.updateById(referenceMaterialServiceById);
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterialServiceById.getReagentConsumableInventoryId()); ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterialServiceById.getReagentConsumableInventoryId());
reagentConsumableInventoryService.updateCabinet(referenceMaterialServiceById.getLatticeId(),referenceMaterialServiceById.getId(),1);
if (reagentConsumableInventory.getTotalQuantity() != null) { if (reagentConsumableInventory.getTotalQuantity() != null) {
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + 1); reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + 1);

@ -14,8 +14,10 @@ import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.WarehousingRecordFormMapper; import digital.laboratory.platform.reagent.mapper.WarehousingRecordFormMapper;
import digital.laboratory.platform.reagent.service.*; import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.vo.*; import digital.laboratory.platform.reagent.vo.*;
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.seata.spring.annotation.GlobalTransactional;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -92,8 +94,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
private PurchaseListService purchaseListService; private PurchaseListService purchaseListService;
@Autowired @Autowired
private AcceptanceSignForService acceptanceSignForService; private AcceptanceSignForService acceptanceSignForService;
@GlobalTransactional//查看采购入库
@Override//查看采购入库
public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) { public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) {
WarehousingRecordForm byId = this.getById(warehousingFormId); WarehousingRecordForm byId = this.getById(warehousingFormId);
@ -105,9 +106,13 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
} }
@Transactional @GlobalTransactional
@Override//录入入库明细 @Override//录入入库明细
public WarehousingRecordFormVO addFormById(WarehousingRecordFormDTO warehousingRecordFormDTO, DLPUser dlpUser) { public WarehousingRecordFormVO addFormById(WarehousingRecordFormDTO warehousingRecordFormDTO, DLPUser dlpUser) {
if (warehousingRecordFormDTO.getDateOfProduction()==null){//如果没有生产日期,默认当前时间为生产日期
warehousingRecordFormDTO.setDateOfProduction(LocalDate.now());
}
//必须选择存放位置才能入库 //必须选择存放位置才能入库
if (warehousingRecordFormDTO.getLatticeId().isEmpty() & warehousingRecordFormDTO.getLocation().isEmpty() & if (warehousingRecordFormDTO.getLatticeId().isEmpty() & warehousingRecordFormDTO.getLocation().isEmpty() &
warehousingRecordFormDTO.getBoxId().isEmpty()) { warehousingRecordFormDTO.getBoxId().isEmpty()) {
@ -167,8 +172,12 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
if (warehousingRecordFormDTO.getCode() != null) { if (warehousingRecordFormDTO.getCode() != null) {
reagentConsumableInventory.setCode(warehousingRecordFormDTO.getCode()); reagentConsumableInventory.setCode(warehousingRecordFormDTO.getCode());
reagentConsumables.setCode(warehousingRecordFormDTO.getCode()); reagentConsumables.setCode(warehousingRecordFormDTO.getCode());
reagentConsumablesService.updateById(reagentConsumables); } else {
reagentConsumableInventory.setCode("");
reagentConsumables.setCode("");
} }
reagentConsumablesService.updateById(reagentConsumables);
BatchDetails batchDetails = new BatchDetails();//创建批次信息 BatchDetails batchDetails = new BatchDetails();//创建批次信息
int year = Calendar.getInstance().get(Calendar.YEAR);//获取当前年 int year = Calendar.getInstance().get(Calendar.YEAR);//获取当前年
@ -196,7 +205,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
if (reagentConsumables.getCategory().equals("试剂") | reagentConsumables.getCategory().equals("耗材")) { if (reagentConsumables.getCategory().equals("试剂") | reagentConsumables.getCategory().equals("耗材")) {
//更新格子信息(试剂耗材传入类ID) //更新格子信息(试剂耗材传入类ID)
remoteCabinetService.updateCabinet(latticeId, warehousingContent.getReagentConsumableId(), "1"); reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),1);
} }
reagentConsumableInventory.setTotalQuantity(quantity);//数量 reagentConsumableInventory.setTotalQuantity(quantity);//数量
@ -214,7 +223,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
referenceMaterial.setLatticeId(latticeId); referenceMaterial.setLatticeId(latticeId);
referenceMaterial.setBoxId(boxId); referenceMaterial.setBoxId(boxId);
//更新格子信息(标准物质传入对象ID) //更新格子信息(标准物质传入对象ID)
remoteCabinetService.updateCabinet(latticeId, referenceMaterial.getId(), "1"); reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(), referenceMaterial.getId(),1);
//生成编号 //生成编号
String prefix = reagentConsumables.getAlias() + "-" + year + "-" + location.charAt(1) + "-"; String prefix = reagentConsumables.getAlias() + "-" + year + "-" + location.charAt(1) + "-";
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
@ -281,7 +290,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
} }
if (one.getCategory().equals("试剂") | one.getCategory().equals("耗材")) { if (one.getCategory().equals("试剂") | one.getCategory().equals("耗材")) {
//更新格子信息(试剂耗材传入类ID) //更新格子信息(试剂耗材传入类ID)
remoteCabinetService.updateCabinet(latticeId, warehousingContent.getReagentConsumableId(), "1"); reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),1);
} }
one.setTotalQuantity(one.getTotalQuantity() + batchDetails.getQuantity()); one.setTotalQuantity(one.getTotalQuantity() + batchDetails.getQuantity());
one.setWarningValue(warehousingRecordFormDTO.getWarningValue()); one.setWarningValue(warehousingRecordFormDTO.getWarningValue());
@ -299,7 +308,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
referenceMaterial.setBoxId(warehousingRecordFormDTO.getBoxId()); referenceMaterial.setBoxId(warehousingRecordFormDTO.getBoxId());
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName()); referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName());
//更新格子信息(试剂耗材传入类ID) //更新格子信息(试剂耗材传入类ID)
remoteCabinetService.updateCabinet(latticeId, referenceMaterial.getId(), "1"); reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(), referenceMaterial.getId(),1);
//生成编号 //生成编号
String prefix = reagentConsumables.getAlias() + "-" + year + "-" + location.charAt(1) + "-"; String prefix = reagentConsumables.getAlias() + "-" + year + "-" + location.charAt(1) + "-";
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
@ -323,16 +332,13 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
} }
reagentConsumableInventoryService.updateById(one); reagentConsumableInventoryService.updateById(one);
batchDetailsService.save(batchDetails); batchDetailsService.save(batchDetails);
} }
warehousingContentService.updateById(warehousingContent); warehousingContentService.updateById(warehousingContent);
warehousingBatchListService.save(warehousingBatchList); warehousingBatchListService.save(warehousingBatchList);
//至此,签收结束,下面将判断签收单是否完成 //至此,签收结束,下面将判断签收单是否完成
String warehousingRecordFormId = warehousingContent.getWarehousingRecordFormId(); String warehousingRecordFormId = warehousingContent.getWarehousingRecordFormId();
List<WarehousingContent> list = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", warehousingRecordFormId)); List<WarehousingContent> list = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", warehousingRecordFormId));
WarehousingRecordForm warehousingRecordForm = this.getById(warehousingRecordFormId); WarehousingRecordForm warehousingRecordForm = this.getById(warehousingRecordFormId);

@ -31,15 +31,15 @@
</resultMap> </resultMap>
<sql id="getCheckScheduleVOSQL"> <sql id="getCheckScheduleVOSQL">
SELECT cs.*, SELECT csv.*,
( (
select department select department
from dlp_base.sys_user from dlp_base.sys_user
where user_id = cs.create_by) as department where user_id = csv.create_by) as department
, ,
(SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=cs.technical_director_id ) as technical_director_name, (SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=csv.technical_director_id ) as technical_director_name,
(SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=cs.manager_id ) as manager_mame (SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=csv.manager_id ) as manager_mame
FROM check_schedule cs FROM check_schedule csv
</sql> </sql>
<select id="getCheckScheduleVOPage" resultMap="checkScheduleVO" resultType="digital.laboratory.platform.reagent.vo.CheckScheduleVO"> <select id="getCheckScheduleVOPage" resultMap="checkScheduleVO" resultType="digital.laboratory.platform.reagent.vo.CheckScheduleVO">
@ -48,23 +48,23 @@
</select> </select>
<select id="getCheckScheduleVO" resultMap="checkScheduleVO" resultType="digital.laboratory.platform.reagent.vo.CheckScheduleVO" > <select id="getCheckScheduleVO" resultMap="checkScheduleVO" resultType="digital.laboratory.platform.reagent.vo.CheckScheduleVO" >
SELECT cs.*, SELECT csv.*,
( (
select department select department
from dlp_base.sys_user from dlp_base.sys_user
where user_id = cs.create_by) as department where user_id = csv.create_by) as department
, ,
(SELECT user.name (SELECT user.name
FROM dlp_base.sys_user user FROM dlp_base.sys_user user
WHERE user.user_id=cs.technical_director_id ) as technical_director_name WHERE user.user_id=csv.technical_director_id ) as technical_director_name
, ( , (
SELECT user.name SELECT user.name
FROM dlp_base.sys_user user FROM dlp_base.sys_user user
WHERE user.user_id=cs.manager_id ) as manager_mame, WHERE user.user_id=csv.manager_id ) as manager_mame,
(SELECT user.name (SELECT user.name
FROM dlp_base.sys_user user FROM dlp_base.sys_user user
WHERE user.user_id=cs.create_by ) as create_name WHERE user.user_id=csv.create_by ) as create_name
FROM check_schedule cs FROM check_schedule csv
WHERE cs.id = #{checkScheduleId} WHERE csv.id = #{checkScheduleId}
</select> </select>
</mapper> </mapper>

@ -68,7 +68,7 @@
<select id="getCabinetCell" resultType="digital.laboratory.platform.reagent.entity.Cabinetcell"> <select id="getCabinetCell" resultType="digital.laboratory.platform.reagent.entity.Cabinetcell">
SELECT * SELECT *
FROM dlp_cabinet.b_cabinetcell FROM dlp_cabinet.b_cabinetcell
WHERE cabinet_Id in (SELECT id FROM dlp_cabinet.b_cabinet WHERE room_no = '707') WHERE cabinet_Id in (SELECT id FROM dlp_cabinet.b_cabinet WHERE room_no = '706')
and location = #{location} and location = #{location}
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save