update
This commit is contained in:
+1
-1
@@ -38,7 +38,7 @@ public class StandardMaterialApplication extends BaseEntity {
|
||||
/**
|
||||
* (状态)
|
||||
*/
|
||||
@ApiModelProperty(value="(状态)")
|
||||
@ApiModelProperty(value="(状态0:待归还 1:已归还 -1 无需归还)")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ public class StandardMaterialApprovalForm extends BaseEntity {
|
||||
@ApiModelProperty(value="(备注)")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value="(申请内容)")
|
||||
@ApiModelProperty(value="(申请内容)1:停用 2:报废销毁 3:恢复使用 4:降级使用")
|
||||
private Integer applicationContent;
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,6 +21,5 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface CheckScheduleMapper extends BaseMapper<CheckSchedule> {
|
||||
|
||||
IPage <CheckScheduleVO> getCheckScheduleVOPage (IPage<CheckSchedule> page,@Param(Constants.WRAPPER) QueryWrapper<CheckSchedule> qw);
|
||||
|
||||
CheckScheduleVO getCheckScheduleVO (String checkScheduleId);
|
||||
}
|
||||
|
||||
+3
@@ -59,4 +59,7 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
|
||||
@Transactional
|
||||
//盘点导入,需提供柜子系统数据
|
||||
void inventoryEntry(List<ReagentConsumableInventoryDTO> reagentConsumableInventoryDTOList);
|
||||
|
||||
//更新柜子系统方法,柜子ID、物品ID、入库OR出库 (opCode 1 or -1)
|
||||
void updateCabinet(String latticeId, String itemId, int opCode);
|
||||
}
|
||||
|
||||
+100
-184
@@ -16,7 +16,9 @@ import digital.laboratory.platform.reagent.service.*;
|
||||
import digital.laboratory.platform.reagent.vo.DeliveryRegistrationFormVO;
|
||||
import digital.laboratory.platform.reagent.vo.OutgoingContentsVO;
|
||||
import digital.laboratory.platform.reagent.vo.ReagentConsumablesSetVO;
|
||||
import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData;
|
||||
import digital.laboratory.platform.sys.feign.RemoteCabinetService;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -84,92 +86,81 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
//得到领用集合
|
||||
LambdaQueryWrapper<ReagentConsumablesSet> reagentConsumablesSetLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
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) {
|
||||
|
||||
ReagentConsumables one = reagentConsumablesService.getById(reagentConsumablesSet.getReagentConsumableId());
|
||||
|
||||
if (one.getCategory().equals("标准物质") | one.getCategory().equals("标准储备溶液")) {
|
||||
|
||||
OutgoingContents outgoingContents = new OutgoingContents();
|
||||
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(reagentConsumablesSet.getReagentConsumableId());//试剂耗材信息
|
||||
|
||||
if (reagentConsumables.getCategory().equals("标准物质") | reagentConsumables.getCategory().equals("标准储备溶液")) {
|
||||
OutgoingContents outgoingContents = new OutgoingContents();//出库明细
|
||||
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(reagentConsumablesSet.getReferenceMaterialId());//标准物质
|
||||
|
||||
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(reagentConsumablesSet.getReferenceMaterialId());
|
||||
|
||||
outgoingContents.setReferenceMaterialId(referenceMaterial.getId());
|
||||
|
||||
outgoingContents.setReferenceMaterialId(referenceMaterial.getId());//标准物质ID
|
||||
outgoingContents.setId(IdWorker.get32UUID().toUpperCase());
|
||||
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());
|
||||
outgoingContents.setQuantity(reagentConsumablesSet.getQuantity());
|
||||
outgoingContents.setRemarks(reagentConsumablesSet.getRemarks());
|
||||
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());//关联出库登记表
|
||||
outgoingContents.setQuantity(reagentConsumablesSet.getQuantity());//领用申请数量
|
||||
outgoingContents.setRemarks(reagentConsumablesSet.getRemarks());//备注
|
||||
outgoingContents.setOutboundUse(reagentConsumablesSet.getPurpose());
|
||||
outgoingContents.setReagentConsumableId(reagentConsumablesSet.getReagentConsumableId());
|
||||
outgoingContents.setReagentConsumableType(one.getCategory());
|
||||
outgoingContents.setReferenceMaterialNumber(referenceMaterial.getNumber());
|
||||
outgoingContents.setBatchDetailsId(reagentConsumablesSet.getBatchDetailsId());
|
||||
outgoingContents.setLocation(referenceMaterial.getLocation());
|
||||
outgoingContents.setLatticeId(referenceMaterial.getLatticeId());
|
||||
outgoingContents.setBoxId(referenceMaterial.getBoxId());
|
||||
outgoingContents.setCode(referenceMaterial.getNumber());
|
||||
outgoingContents.setReagentConsumablesSetId(reagentConsumablesSet.getId());
|
||||
outgoingContents.setReagentConsumableId(reagentConsumablesSet.getReagentConsumableId());//试剂耗材ID
|
||||
outgoingContents.setReagentConsumableType(reagentConsumables.getCategory());//试剂耗材类别
|
||||
outgoingContents.setReferenceMaterialNumber(referenceMaterial.getNumber());//标准物质编号
|
||||
outgoingContents.setBatchDetailsId(reagentConsumablesSet.getBatchDetailsId());//批次ID
|
||||
outgoingContents.setLocation(referenceMaterial.getLocation());//位置信息
|
||||
outgoingContents.setLatticeId(referenceMaterial.getLatticeId());//格子ID
|
||||
outgoingContents.setBoxId(referenceMaterial.getBoxId());//柜子ID
|
||||
outgoingContents.setCode(referenceMaterial.getNumber());//扫码出库编号
|
||||
outgoingContents.setReagentConsumablesSetId(reagentConsumablesSet.getId());//关联领用申请明细
|
||||
|
||||
|
||||
outgoingContentsList.add(outgoingContents);
|
||||
outgoingContentsList.add(outgoingContents);//集合
|
||||
} else {
|
||||
|
||||
String reagentConsumableId = reagentConsumablesSet.getReagentConsumableId();
|
||||
|
||||
String reagentConsumableId = reagentConsumablesSet.getReagentConsumableId();//试剂耗材ID
|
||||
//库存试剂耗材
|
||||
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())
|
||||
.orderByAsc("create_time")
|
||||
.gt("quantity", 0));
|
||||
|
||||
|
||||
//新建批次集合,用于存放需出库的物品批次
|
||||
List<BatchDetails> batchDetails = new ArrayList<>();
|
||||
|
||||
//领用数量
|
||||
Integer quantity = reagentConsumablesSet.getQuantity();
|
||||
|
||||
//数量,用于计算所需各个批次出库数量
|
||||
Integer batchQuantity = 0;
|
||||
|
||||
for (int i = 0; i < batchDetailsList.size(); i++) {
|
||||
|
||||
//从最老的批次开始,如果这个批次的数量满足出库数量,则跳出循环
|
||||
batchQuantity += batchDetailsList.get(i).getQuantity();
|
||||
|
||||
batchDetails.add(batchDetailsList.get(i));
|
||||
|
||||
if (batchQuantity >= quantity) {
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//循环应出库的对应所有批次
|
||||
for (int i = 0; i < batchDetails.size(); i++) {
|
||||
|
||||
OutgoingContents outgoingContents = new OutgoingContents();
|
||||
outgoingContents.setId(IdWorker.get32UUID().toUpperCase());
|
||||
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());
|
||||
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());//
|
||||
outgoingContents.setQuantity(batchDetails.get(i).getQuantity());
|
||||
outgoingContents.setRemarks(reagentConsumablesSet.getRemarks());
|
||||
outgoingContents.setOutboundUse(reagentConsumablesSet.getPurpose());
|
||||
outgoingContents.setReagentConsumableId(reagentConsumablesSet.getReagentConsumableId());
|
||||
outgoingContents.setReagentConsumableType(one.getCategory());
|
||||
outgoingContents.setReagentConsumableType(reagentConsumables.getCategory());
|
||||
outgoingContents.setBatchDetailsId(batchDetails.get(i).getBatchDetailsId());
|
||||
outgoingContents.setLocation(batchDetails.get(i).getLocation());
|
||||
outgoingContents.setLatticeId(batchDetails.get(i).getLatticeId());
|
||||
outgoingContents.setBoxId(batchDetails.get(i).getBoxId());
|
||||
outgoingContents.setCode(one.getCode());
|
||||
outgoingContents.setCode(reagentConsumables.getCode());
|
||||
outgoingContents.setReagentConsumablesSetId(reagentConsumablesSet.getId());
|
||||
|
||||
//遍历至最后一个批次时,要计算出这个批次该出库的数量
|
||||
if (i == batchDetails.size() - 1) {
|
||||
|
||||
Integer x = quantity - (batchQuantity - batchDetailsList.get(i).getQuantity());
|
||||
|
||||
outgoingContents.setQuantity(x);
|
||||
}
|
||||
outgoingContentsList.add(outgoingContents);
|
||||
@@ -184,63 +175,49 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
}
|
||||
|
||||
@Override//提交出库登记表
|
||||
@Transactional
|
||||
@GlobalTransactional
|
||||
public DeliveryRegistrationForm commitForm(List<OutgoingContentsDTO> outgoingContentsDTOS, DLPUser dlpUser) {
|
||||
|
||||
//得到出库登记表
|
||||
DeliveryRegistrationForm byId = this.getById(outgoingContentsDTOS.get(0).getDeliveryRegistrationFormId());
|
||||
|
||||
byId.setStatus(1);
|
||||
|
||||
byId.setDepositorId(dlpUser.getId());
|
||||
DeliveryRegistrationForm deliveryRegistrationForm = this.getById(outgoingContentsDTOS.get(0).getDeliveryRegistrationFormId());//得到出库登记表
|
||||
deliveryRegistrationForm.setStatus(1);//状态
|
||||
deliveryRegistrationForm.setDepositorId(dlpUser.getId());//出库人//
|
||||
|
||||
LambdaQueryWrapper<OutgoingContents> outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, byId.getId());
|
||||
outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, deliveryRegistrationForm.getId());
|
||||
//删除修改之前的内容(防止领用为X种,但实际出库只有n种,导致领用出库不一致)
|
||||
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<>();
|
||||
applicationForUseLambdaQueryWrapper.eq(ApplicationForUse::getDeliveryRegistrationFormId, deliveryRegistrationForm.getId());
|
||||
ApplicationForUse applicationForUse = applicationForUseService.getOne(applicationForUseLambdaQueryWrapper);//查询领用申请表
|
||||
|
||||
applicationForUseLambdaQueryWrapper.eq(ApplicationForUse::getDeliveryRegistrationFormId, byId.getId());
|
||||
//查询领用申请表
|
||||
ApplicationForUse one = applicationForUseService.getOne(applicationForUseLambdaQueryWrapper);
|
||||
applicationForUse.setClaimCode("");//要将领取码置空
|
||||
applicationForUse.setStatus(2);//状态:已出库
|
||||
|
||||
one.setClaimCode("");
|
||||
|
||||
one.setStatus(2);
|
||||
|
||||
applicationForUseService.updateById(one);
|
||||
applicationForUseService.updateById(applicationForUse);
|
||||
|
||||
for (OutgoingContentsDTO outgoingContentsDTO : outgoingContentsDTOS) {
|
||||
//传入出库数量,区分出库数量与领用数量
|
||||
ReagentConsumablesSet reagentConsumablesSet = reagentConsumablesSetService.getById(outgoingContentsDTO.getReagentConsumablesSetId());
|
||||
|
||||
//因为这里领取的一种物品,可能会对应多个批次,多个数量,但是对于领用人来说,只关心出库总数量
|
||||
if (reagentConsumablesSet.getQuantityDelivered() == null) {
|
||||
|
||||
reagentConsumablesSet.setQuantityDelivered(outgoingContentsDTO.getQuantity());
|
||||
reagentConsumablesSet.setQuantityDelivered(outgoingContentsDTO.getQuantity());//
|
||||
} else {
|
||||
//一个批次对应一个出库明细,出库多个批次的情况下,要将每个批次的数量相加
|
||||
reagentConsumablesSet.setQuantityDelivered(reagentConsumablesSet.getQuantityDelivered() + outgoingContentsDTO.getQuantity());
|
||||
}
|
||||
|
||||
reagentConsumablesSetService.updateById(reagentConsumablesSet);
|
||||
|
||||
OutgoingContents outgoingContents = new OutgoingContents();
|
||||
|
||||
BeanUtils.copyProperties(outgoingContentsDTO, outgoingContents);
|
||||
|
||||
outgoingContents.setId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(outgoingContents.getReagentConsumableId());
|
||||
|
||||
outgoingContents.setReagentConsumableType(reagentConsumables.getCategory());
|
||||
|
||||
outgoingContents.setDeliveryRegistrationFormId(byId.getId());
|
||||
|
||||
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());
|
||||
outgoingContents.setReferenceMaterialNumber(outgoingContentsDTO.getNumber());
|
||||
|
||||
if (reagentConsumables.getCategory().equals("标准物质")) {
|
||||
@@ -248,80 +225,69 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
StandardMaterialApplication standardMaterialApplication = new StandardMaterialApplication();
|
||||
|
||||
standardMaterialApplication.setStandardMaterialApplicationId(IdWorker.get32UUID().toUpperCase());
|
||||
standardMaterialApplication.setPurpose(outgoingContents.getOutboundUse());
|
||||
standardMaterialApplication.setDateOfClaim(LocalDateTime.now());
|
||||
standardMaterialApplication.setRecipientId(one.getRecipientId());
|
||||
standardMaterialApplication.setReferenceSubstanceId(reagentConsumables.getReagentConsumableId());
|
||||
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel());
|
||||
standardMaterialApplication.setRequisitionedQuantity(outgoingContents.getQuantity());
|
||||
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel());
|
||||
standardMaterialApplication.setApplicationForUseId(one.getId());
|
||||
standardMaterialApplication.setReferenceMaterialId(outgoingContentsDTO.getReferenceMaterialId());
|
||||
standardMaterialApplication.setAdministratorId(dlpUser.getId());
|
||||
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber());
|
||||
standardMaterialApplication.setPurpose(outgoingContents.getOutboundUse());//用途
|
||||
standardMaterialApplication.setDateOfClaim(LocalDateTime.now());//领用日期
|
||||
standardMaterialApplication.setRecipientId(applicationForUse.getRecipientId());//领用人
|
||||
standardMaterialApplication.setReferenceSubstanceId(reagentConsumables.getReagentConsumableId());//试剂耗材类ID
|
||||
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel());//规格型号
|
||||
standardMaterialApplication.setRequisitionedQuantity(outgoingContents.getQuantity());//领用数量
|
||||
standardMaterialApplication.setApplicationForUseId(applicationForUse.getId());//关联领用申请ID
|
||||
standardMaterialApplication.setReferenceMaterialId(outgoingContentsDTO.getReferenceMaterialId());//标准物质ID
|
||||
standardMaterialApplication.setAdministratorId(dlpUser.getId());//出库人ID
|
||||
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber());//标准物质编号
|
||||
standardMaterialApplication.setIsReturn(outgoingContentsDTO.getOutboundUse());//是否用完
|
||||
standardMaterialApplication.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());//关联出库申请ID
|
||||
standardMaterialApplication.setReferenceSubstanceName(reagentConsumables.getReagentConsumableName());//试剂耗材名称
|
||||
|
||||
standardMaterialApplications.add(standardMaterialApplication);
|
||||
standardMaterialApplication.setIsReturn(outgoingContentsDTO.getOutboundUse());
|
||||
standardMaterialApplication.setDeliveryRegistrationFormId(byId.getId());
|
||||
standardMaterialApplication.setReferenceSubstanceName(reagentConsumables.getReagentConsumableName());
|
||||
if (outgoingContentsDTO.getOutboundUse() == 2) {
|
||||
if (outgoingContentsDTO.getOutboundUse() == 2) {//已用完,无需归还
|
||||
standardMaterialApplication.setStatus(-1);
|
||||
standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString());
|
||||
} else {
|
||||
standardMaterialApplication.setStatus(0);
|
||||
}
|
||||
ReferenceMaterial byId1 = referenceMaterialService.getById(outgoingContentsDTO.getReferenceMaterialId());
|
||||
if (byId1.getStatus() == -3) {
|
||||
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(outgoingContentsDTO.getReferenceMaterialId());
|
||||
|
||||
if (referenceMaterial.getStatus() == -3) {
|
||||
throw new RuntimeException(String.format("该物品已被其他工作人员领用"));
|
||||
}
|
||||
|
||||
byId1.setStatus(-3);
|
||||
referenceMaterial.setStatus(-3);//改变状态
|
||||
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息
|
||||
referenceMaterialService.updateById(referenceMaterial);
|
||||
|
||||
referenceMaterialService.updateById(byId1);
|
||||
|
||||
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId());
|
||||
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId());//批次信息
|
||||
|
||||
if (batchDetails != null) {
|
||||
|
||||
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity());
|
||||
|
||||
if (batchDetails.getQuantity() == 0) {
|
||||
|
||||
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity());//减少这个批次的数量
|
||||
if (batchDetails.getQuantity() == 0) {//这个批次已被领用完
|
||||
batchDetails.setServiceStatus(-1);
|
||||
}
|
||||
|
||||
batchDetailsService.updateById(batchDetails);
|
||||
}
|
||||
|
||||
//查找出对应的仓库信息,将库存量减少
|
||||
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.reduceById(outgoingContents.getReagentConsumableId(), outgoingContents.getQuantity());
|
||||
|
||||
|
||||
if (reagentConsumableInventory.getTotalQuantity() < 0) {
|
||||
|
||||
throw new RuntimeException(String.format("出库数量不能超过库存量"));
|
||||
}
|
||||
|
||||
} else if (reagentConsumables.getCategory().equals("标准储备溶液")) {
|
||||
|
||||
StandardReserveSolution reference_id = standardReserveSolutionService.getOne(Wrappers.<StandardReserveSolution>query().eq("reference_id", outgoingContentsDTO.getReferenceMaterialId()));
|
||||
|
||||
//创建标准物质领用/归还登记表
|
||||
StandardMaterialApplication standardMaterialApplication = new StandardMaterialApplication();
|
||||
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber());
|
||||
standardMaterialApplication.setStandardMaterialApplicationId(IdWorker.get32UUID().toUpperCase());
|
||||
standardMaterialApplication.setPurpose(outgoingContents.getOutboundUse());
|
||||
standardMaterialApplication.setDateOfClaim(LocalDateTime.now());
|
||||
standardMaterialApplication.setRecipientId(one.getRecipientId());
|
||||
standardMaterialApplication.setRecipientId(applicationForUse.getRecipientId());
|
||||
standardMaterialApplication.setReferenceSubstanceId(reagentConsumables.getReagentConsumableId());
|
||||
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel());
|
||||
standardMaterialApplication.setRequisitionedQuantity(outgoingContents.getQuantity());
|
||||
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel());
|
||||
standardMaterialApplication.setApplicationForUseId(one.getId());
|
||||
standardMaterialApplication.setDeliveryRegistrationFormId(byId.getId());
|
||||
standardMaterialApplication.setApplicationForUseId(applicationForUse.getId());
|
||||
standardMaterialApplication.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());
|
||||
standardMaterialApplication.setReferenceSubstanceName(reference_id.getSolutionName());
|
||||
|
||||
|
||||
if (outgoingContentsDTO.getOutboundUse() == 2) {
|
||||
standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString());
|
||||
standardMaterialApplication.setStatus(1);
|
||||
@@ -333,37 +299,25 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
standardMaterialApplications.add(standardMaterialApplication);
|
||||
//录入标准储备溶液使用记录
|
||||
SolutionUseForm solutionUseForm = solutionUseFormService.useById(outgoingContentsDTO.getReferenceMaterialId(), dlpUser);
|
||||
|
||||
solutionUseForm.setStandardMaterialApplicationId(standardMaterialApplication.getStandardMaterialApplicationId());
|
||||
|
||||
solutionUseForm.setStandardMaterialApplicationId(standardMaterialApplication.getStandardMaterialApplicationId());//关联标准物质领用归还登记表
|
||||
solutionUseFormService.updateById(solutionUseForm);
|
||||
//通过标准物质ID,查找出对应的仓库信息,将库存量减少
|
||||
String referenceMaterialId = outgoingContentsDTO.getReferenceMaterialId();
|
||||
|
||||
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(referenceMaterialId);
|
||||
|
||||
if (referenceMaterial.getStatus() == -3) {
|
||||
|
||||
throw new RuntimeException(String.format("该物品已被其他工作人员领用"));
|
||||
}
|
||||
referenceMaterial.setStatus(-3);
|
||||
|
||||
referenceMaterialService.updateById(referenceMaterial);
|
||||
|
||||
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息
|
||||
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId());
|
||||
|
||||
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() - outgoingContentsDTO.getQuantity());
|
||||
|
||||
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() - outgoingContentsDTO.getQuantity());//修改库存数量
|
||||
reagentConsumableInventoryService.updateById(reagentConsumableInventory);
|
||||
|
||||
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId());
|
||||
|
||||
if (batchDetails != null) {
|
||||
|
||||
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity());
|
||||
|
||||
if (batchDetails.getQuantity() == 0) {
|
||||
|
||||
if (batchDetails.getQuantity() == 0) {//这个批次已经被领用完
|
||||
batchDetails.setServiceStatus(-1);
|
||||
}
|
||||
batchDetailsService.updateById(batchDetails);
|
||||
@@ -371,9 +325,9 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
if (reagentConsumableInventory.getTotalQuantity() < 0) {
|
||||
throw new RuntimeException(String.format("出库数量不能超过库存量"));
|
||||
}
|
||||
|
||||
} else {
|
||||
RequisitionRecord requisitionRecord = requisitionRecordService.addRecord(outgoingContents);
|
||||
//如果不是标准物质
|
||||
RequisitionRecord requisitionRecord = requisitionRecordService.addRecord(outgoingContents);//试剂耗材领用申请表
|
||||
//查找对应的批次ID,将批次数量减少
|
||||
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId());
|
||||
/*
|
||||
@@ -381,24 +335,18 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
if (batchDetails != null) {
|
||||
//减少对应批次数量
|
||||
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity());
|
||||
|
||||
if (batchDetails.getQuantity() == 0) {
|
||||
|
||||
batchDetails.setServiceStatus(-1);
|
||||
}
|
||||
|
||||
batchDetailsService.updateById(batchDetails);
|
||||
}
|
||||
|
||||
requisitionRecord.setDateOfClaim(LocalDateTime.now());
|
||||
requisitionRecord.setRecipientId(one.getRecipientId());
|
||||
requisitionRecord.setDeliveryRegistrationFormId(byId.getId());
|
||||
|
||||
|
||||
requisitionRecord.setDateOfClaim(LocalDateTime.now());//领用日期
|
||||
requisitionRecord.setRecipientId(applicationForUse.getRecipientId());//领用人ID
|
||||
requisitionRecord.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());//出库登记表ID
|
||||
requisitionRecordService.updateById(requisitionRecord);
|
||||
//查找出对应的仓库信息,将库存量减少
|
||||
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.reduceById(outgoingContents.getReagentConsumableId(), outgoingContents.getQuantity());
|
||||
|
||||
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),-1);
|
||||
if (reagentConsumableInventory.getTotalQuantity() < 0) {
|
||||
throw new RuntimeException(String.format("出库数量不能超过库存量"));
|
||||
}
|
||||
@@ -413,120 +361,88 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
complianceCheckDTO.setReagentConsumableNumber(outgoingContentsDTO.getNumber());
|
||||
complianceCheckDTO.setBatchDetailsId(batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()).getBatchDetailsId());
|
||||
complianceCheckDTO.setReferenceMaterialId(outgoingContentsDTO.getReferenceMaterialId());
|
||||
complianceCheckService.addCheck(complianceCheckDTO, dlpUser);
|
||||
complianceCheckService.addCheck(complianceCheckDTO, dlpUser);//新增符合性检查
|
||||
}
|
||||
outgoingContentsList.add(outgoingContents);
|
||||
}
|
||||
if (standardMaterialApplications.size() != 0) {
|
||||
standardMaterialApplicationService.saveBatch(standardMaterialApplications);
|
||||
}
|
||||
if (outgoingContentsService.saveBatch(outgoingContentsList) && this.updateById(byId)) {
|
||||
return byId;
|
||||
if (outgoingContentsService.saveBatch(outgoingContentsList) && this.updateById(deliveryRegistrationForm)) {
|
||||
return deliveryRegistrationForm;
|
||||
} else throw new RuntimeException(String.format("提交失败"));
|
||||
}
|
||||
|
||||
@Override//分页查询
|
||||
public Page<DeliveryRegistrationFormVO> getDeliveryRegistrationFormVOPage(Page page, QueryWrapper<DeliveryRegistrationForm> qw) {
|
||||
|
||||
Page deliveryRegistrationFormVOPage = baseMapper.getDeliveryRegistrationFormVOPage(page, qw);
|
||||
|
||||
return deliveryRegistrationFormVOPage;
|
||||
}
|
||||
|
||||
@Override//通过ID查询出库内容
|
||||
public DeliveryRegistrationFormVO getDeliveryRegistrationFormVOById(String deliveryRegistrationFormId) {
|
||||
|
||||
//得到VO
|
||||
DeliveryRegistrationFormVO deliveryRegistrationFormVOById = baseMapper.getDeliveryRegistrationFormVOById(deliveryRegistrationFormId);
|
||||
|
||||
LambdaQueryWrapper<OutgoingContents> outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, deliveryRegistrationFormVOById.getId());
|
||||
|
||||
//出库明细
|
||||
List<OutgoingContents> list = outgoingContentsService.list(outgoingContentsLambdaQueryWrapper);
|
||||
|
||||
List<OutgoingContentsVO> outgoingContentsVOS = new ArrayList<>();
|
||||
|
||||
if (list.size() != 0) {
|
||||
|
||||
//为出库明细关联试剂耗材信息与供应商信息
|
||||
for (OutgoingContents outgoingContents : list) {
|
||||
|
||||
OutgoingContentsVO outgoingContentsVO = new OutgoingContentsVO();
|
||||
|
||||
BeanUtils.copyProperties(outgoingContents, outgoingContentsVO);
|
||||
|
||||
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
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);
|
||||
|
||||
outgoingContentsVO.setReagentConsumableInventory(one);
|
||||
|
||||
BatchDetails byId = batchDetailsService.getById(outgoingContents.getBatchDetailsId());
|
||||
|
||||
if (byId != null) {
|
||||
|
||||
outgoingContentsVO.setBatch(byId.getBatch());
|
||||
|
||||
outgoingContentsVO.setSupplierName(supplierInformationService.getById(byId.getSupplierId()).getSupplierName());
|
||||
if (batchDetails != null) {
|
||||
outgoingContentsVO.setBatch(batchDetails.getBatch());//批次
|
||||
outgoingContentsVO.setSupplierName(supplierInformationService.getById(batchDetails.getSupplierId()).getSupplierName());//供应商名称
|
||||
}
|
||||
|
||||
outgoingContentsVOS.add(outgoingContentsVO);
|
||||
}
|
||||
|
||||
deliveryRegistrationFormVOById.setOutgoingContentsList(outgoingContentsVOS);
|
||||
}
|
||||
|
||||
return deliveryRegistrationFormVOById;
|
||||
}
|
||||
|
||||
@Override//通过ID查询出库内容
|
||||
@Override//通过输入领用码的方式查询出库内容
|
||||
public DeliveryRegistrationFormVO getDeliveryRegistrationFormVOByCode(String claimCode) {
|
||||
|
||||
if (!StrUtil.isNotBlank(claimCode)) {
|
||||
|
||||
return null;
|
||||
}
|
||||
ApplicationForUse applicationForUse = applicationForUseService.getOne(Wrappers.<ApplicationForUse>query()
|
||||
.eq("claim_code", claimCode));
|
||||
|
||||
if (applicationForUse == null) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
DeliveryRegistrationFormVO deliveryRegistrationFormVOById = baseMapper.getDeliveryRegistrationFormVOById(applicationForUse.getDeliveryRegistrationFormId());
|
||||
|
||||
LambdaQueryWrapper<OutgoingContents> outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, deliveryRegistrationFormVOById.getId());
|
||||
|
||||
List<OutgoingContents> list = outgoingContentsService.list(outgoingContentsLambdaQueryWrapper);
|
||||
|
||||
List<OutgoingContentsVO> outgoingContentsVOS = new ArrayList<>();
|
||||
|
||||
if (list.size() != 0) {
|
||||
|
||||
//为出库明细关联试剂耗材信息与供应商信息
|
||||
for (OutgoingContents outgoingContents : list) {
|
||||
|
||||
OutgoingContentsVO outgoingContentsVO = new OutgoingContentsVO();
|
||||
|
||||
BeanUtils.copyProperties(outgoingContents, outgoingContentsVO);
|
||||
|
||||
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, outgoingContents.getReagentConsumableId());
|
||||
|
||||
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper);
|
||||
|
||||
outgoingContentsVO.setReagentConsumableInventory(one);
|
||||
|
||||
outgoingContentsVOS.add(outgoingContentsVO);
|
||||
}
|
||||
|
||||
deliveryRegistrationFormVOById.setOutgoingContentsList(outgoingContentsVOS);
|
||||
}
|
||||
|
||||
return deliveryRegistrationFormVOById;
|
||||
}
|
||||
|
||||
|
||||
+21
-20
@@ -31,7 +31,6 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -649,7 +648,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
|
||||
String templateFileName = "标准储备溶液标签模板.vm";
|
||||
return remoteTemplate2htmlService.getHtml(templateFileName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserVO> getUserList() {
|
||||
|
||||
@@ -660,6 +658,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
|
||||
@GlobalTransactional//盘点导入,需提供柜子系统数据
|
||||
public void inventoryEntry(List<ReagentConsumableInventoryDTO> reagentConsumableInventoryDTOList) {
|
||||
for (ReagentConsumableInventoryDTO reagentConsumableInventoryDTO : reagentConsumableInventoryDTOList) {
|
||||
|
||||
String location = "F" + reagentConsumableInventoryDTO.getRoomNo().charAt(0) + "_试剂柜-" + reagentConsumableInventoryDTO
|
||||
.getLocation().charAt(0) + "_" + reagentConsumableInventoryDTO.getLocation();
|
||||
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory();
|
||||
BeanUtils.copyProperties(reagentConsumableInventoryDTO, reagentConsumableInventory);
|
||||
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase());
|
||||
@@ -685,54 +686,54 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
|
||||
}
|
||||
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.setBoxId(cabinetCell.getCabinetId());
|
||||
batchDetails.setLocation(reagentConsumableInventoryDTO.getRoomNo() + "-" + reagentConsumableInventoryDTO.getLocation());
|
||||
batchDetails.setLocation(location);
|
||||
batchDetails.setPurchaseTime(LocalDateTime.now());
|
||||
batchDetails.setBatchNumber("/");
|
||||
batchDetails.setBatchDetailsId(IdWorker.get32UUID().toUpperCase());
|
||||
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
|
||||
ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(reagentConsumableInventory);
|
||||
reagentConsumableInventory.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
|
||||
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1);
|
||||
|
||||
//导入标准物质
|
||||
if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) {
|
||||
ReferenceMaterial referenceMaterial = new ReferenceMaterial();
|
||||
referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
|
||||
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
|
||||
referenceMaterial.setLocation(reagentConsumableInventoryDTO.getLocation());
|
||||
referenceMaterial.setLocation(location);
|
||||
referenceMaterial.setStatus(0);
|
||||
referenceMaterial.setLatticeId(cabinetCell.getId());
|
||||
referenceMaterial.setBoxId(cabinetCell.getCabinetId());
|
||||
Calendar instance = Calendar.getInstance();
|
||||
int year = instance.get(Calendar.YEAR);
|
||||
String roomNo = reagentConsumableInventoryDTO.getRoomNo();
|
||||
String substring = roomNo.substring(0, 1);
|
||||
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + substring + "-1");//自动生成编号
|
||||
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + roomNo.charAt(0) + "-1");//自动生成编号
|
||||
referenceMaterial.setCode(referenceMaterial.getNumber());
|
||||
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
|
||||
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
|
||||
referenceMaterialService.save(referenceMaterial);
|
||||
|
||||
}
|
||||
this.save(reagentConsumableInventory);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
+11
-10
@@ -21,6 +21,7 @@ import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
|
||||
|
||||
import digital.laboratory.platform.sys.feign.RemoteCabinetService;
|
||||
import feign.Response;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -71,16 +72,14 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
|
||||
|
||||
@Autowired
|
||||
|
||||
private RemoteCabinetService remoteCabinetService;
|
||||
private RemoteCabinetService remoteCabinetService;
|
||||
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override//归还标准物质
|
||||
@Transactional
|
||||
@GlobalTransactional
|
||||
public StandardMaterialApplication returnById(StandardMaterialApplicationDTO standardMaterialApplicationDTO) {
|
||||
|
||||
StandardMaterialApplication byId = this.getById(standardMaterialApplicationDTO.getStandardMaterialApplicationId());
|
||||
@@ -113,22 +112,24 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
|
||||
}
|
||||
|
||||
} else {
|
||||
if (referenceMaterial.getServiceStatus()!=null){
|
||||
if (referenceMaterial.getServiceStatus()==-2){
|
||||
if (referenceMaterial.getServiceStatus() != null) {
|
||||
if (referenceMaterial.getServiceStatus() == -2) {
|
||||
referenceMaterial.setStatus(-2);
|
||||
}
|
||||
}else {
|
||||
referenceMaterial.setStatus(0);}
|
||||
} else {
|
||||
referenceMaterial.setStatus(0);
|
||||
}
|
||||
BatchDetails byId2 = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
|
||||
byId2.setQuantity(byId2.getQuantity() + 1);
|
||||
ReagentConsumableInventory byId1 = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId());
|
||||
byId1.setTotalQuantity(byId1.getTotalQuantity() + 1);
|
||||
if (byId2.getQuantity()>0){
|
||||
if (byId2.getQuantity() > 0) {
|
||||
byId2.setServiceStatus(1);
|
||||
}
|
||||
batchDetailsService.updateById(byId2);
|
||||
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);
|
||||
|
||||
+8
-8
@@ -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.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO;
|
||||
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
|
||||
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm;
|
||||
import digital.laboratory.platform.reagent.entity.SupplierInformation;
|
||||
import digital.laboratory.platform.reagent.entity.*;
|
||||
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.StandardMaterialApprovalFormService;
|
||||
import digital.laboratory.platform.reagent.service.SupplierInformationService;
|
||||
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO;
|
||||
import feign.Response;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -58,6 +58,9 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
@Autowired
|
||||
private ReagentConsumableInventoryService reagentConsumableInventoryService;
|
||||
|
||||
@Override//提交表单
|
||||
public StandardMaterialApprovalForm commitById(StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser) {
|
||||
|
||||
@@ -126,6 +129,7 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
|
||||
}
|
||||
|
||||
@Override//审批
|
||||
@GlobalTransactional
|
||||
public StandardMaterialApprovalForm approveById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
|
||||
|
||||
StandardMaterialApprovalForm byId1 = this.getById(auditAndApproveDTO.getUuId());
|
||||
@@ -157,19 +161,15 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
|
||||
|
||||
}else if (byId1.getApplicationContent()==2){
|
||||
ReferenceMaterial byId = referenceMaterialService.getById(byId1.getReferenceMaterialId());
|
||||
|
||||
byId.setStatus(-4);
|
||||
|
||||
reagentConsumableInventoryService.updateCabinet(byId.getLatticeId(),byId.getId(),-1);
|
||||
referenceMaterialService.updateById(byId);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
ReferenceMaterial byId = referenceMaterialService.getById(byId1.getReferenceMaterialId());
|
||||
|
||||
byId.setStatus(0);
|
||||
byId.setServiceStatus(0);
|
||||
|
||||
referenceMaterialService.updateById(byId);
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -26,6 +26,7 @@ import digital.laboratory.platform.reagent.vo.*;
|
||||
import digital.laboratory.platform.sys.feign.RemoteCabinetService;
|
||||
import feign.Response;
|
||||
//import io.seata.spring.annotation.GlobalTransactional;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -302,7 +303,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
|
||||
}
|
||||
|
||||
@Override//标准储备溶液配置入库
|
||||
@Transactional
|
||||
@GlobalTransactional
|
||||
public StandardReserveSolutionFullVO warehousingById(StandardReserveSolutionFullDTO standardReserveSolutionFullDTO) {
|
||||
|
||||
String id = standardReserveSolutionFullDTO.getId();
|
||||
@@ -330,7 +331,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
|
||||
referenceMaterialService.updateById(referenceMaterialServiceById);
|
||||
|
||||
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterialServiceById.getReagentConsumableInventoryId());
|
||||
|
||||
reagentConsumableInventoryService.updateCabinet(referenceMaterialServiceById.getLatticeId(),referenceMaterialServiceById.getId(),1);
|
||||
if (reagentConsumableInventory.getTotalQuantity() != null) {
|
||||
|
||||
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + 1);
|
||||
|
||||
+18
-12
@@ -14,8 +14,10 @@ import digital.laboratory.platform.reagent.entity.*;
|
||||
import digital.laboratory.platform.reagent.mapper.WarehousingRecordFormMapper;
|
||||
import digital.laboratory.platform.reagent.service.*;
|
||||
import digital.laboratory.platform.reagent.vo.*;
|
||||
import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData;
|
||||
import digital.laboratory.platform.sys.feign.RemoteCabinetService;
|
||||
//import io.seata.spring.annotation.GlobalTransactional;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -92,8 +94,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
private PurchaseListService purchaseListService;
|
||||
@Autowired
|
||||
private AcceptanceSignForService acceptanceSignForService;
|
||||
|
||||
@Override//查看采购入库
|
||||
@GlobalTransactional//查看采购入库
|
||||
public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) {
|
||||
|
||||
WarehousingRecordForm byId = this.getById(warehousingFormId);
|
||||
@@ -105,9 +106,13 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@GlobalTransactional
|
||||
@Override//录入入库明细
|
||||
public WarehousingRecordFormVO addFormById(WarehousingRecordFormDTO warehousingRecordFormDTO, DLPUser dlpUser) {
|
||||
|
||||
if (warehousingRecordFormDTO.getDateOfProduction()==null){//如果没有生产日期,默认当前时间为生产日期
|
||||
warehousingRecordFormDTO.setDateOfProduction(LocalDate.now());
|
||||
}
|
||||
//必须选择存放位置才能入库
|
||||
if (warehousingRecordFormDTO.getLatticeId().isEmpty() & warehousingRecordFormDTO.getLocation().isEmpty() &
|
||||
warehousingRecordFormDTO.getBoxId().isEmpty()) {
|
||||
@@ -167,8 +172,12 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
if (warehousingRecordFormDTO.getCode() != null) {
|
||||
reagentConsumableInventory.setCode(warehousingRecordFormDTO.getCode());
|
||||
reagentConsumables.setCode(warehousingRecordFormDTO.getCode());
|
||||
reagentConsumablesService.updateById(reagentConsumables);
|
||||
} else {
|
||||
reagentConsumableInventory.setCode("");
|
||||
reagentConsumables.setCode("");
|
||||
}
|
||||
reagentConsumablesService.updateById(reagentConsumables);
|
||||
|
||||
BatchDetails batchDetails = new BatchDetails();//创建批次信息
|
||||
|
||||
int year = Calendar.getInstance().get(Calendar.YEAR);//获取当前年
|
||||
@@ -196,7 +205,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
|
||||
if (reagentConsumables.getCategory().equals("试剂") | reagentConsumables.getCategory().equals("耗材")) {
|
||||
//更新格子信息(试剂耗材传入类ID)
|
||||
remoteCabinetService.updateCabinet(latticeId, warehousingContent.getReagentConsumableId(), "1");
|
||||
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),1);
|
||||
}
|
||||
reagentConsumableInventory.setTotalQuantity(quantity);//数量
|
||||
|
||||
@@ -214,7 +223,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
referenceMaterial.setLatticeId(latticeId);
|
||||
referenceMaterial.setBoxId(boxId);
|
||||
//更新格子信息(标准物质传入对象ID)
|
||||
remoteCabinetService.updateCabinet(latticeId, referenceMaterial.getId(), "1");
|
||||
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(), referenceMaterial.getId(),1);
|
||||
//生成编号
|
||||
String prefix = reagentConsumables.getAlias() + "-" + year + "-" + location.charAt(1) + "-";
|
||||
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("耗材")) {
|
||||
//更新格子信息(试剂耗材传入类ID)
|
||||
remoteCabinetService.updateCabinet(latticeId, warehousingContent.getReagentConsumableId(), "1");
|
||||
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),1);
|
||||
}
|
||||
one.setTotalQuantity(one.getTotalQuantity() + batchDetails.getQuantity());
|
||||
one.setWarningValue(warehousingRecordFormDTO.getWarningValue());
|
||||
@@ -299,7 +308,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
referenceMaterial.setBoxId(warehousingRecordFormDTO.getBoxId());
|
||||
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName());
|
||||
//更新格子信息(试剂耗材传入类ID)
|
||||
remoteCabinetService.updateCabinet(latticeId, referenceMaterial.getId(), "1");
|
||||
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(), referenceMaterial.getId(),1);
|
||||
//生成编号
|
||||
String prefix = reagentConsumables.getAlias() + "-" + year + "-" + location.charAt(1) + "-";
|
||||
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
|
||||
@@ -323,18 +332,15 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
|
||||
}
|
||||
reagentConsumableInventoryService.updateById(one);
|
||||
|
||||
batchDetailsService.save(batchDetails);
|
||||
}
|
||||
|
||||
|
||||
warehousingContentService.updateById(warehousingContent);
|
||||
warehousingBatchListService.save(warehousingBatchList);
|
||||
|
||||
//至此,签收结束,下面将判断签收单是否完成
|
||||
|
||||
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);
|
||||
|
||||
PurchaseList purchaseList = purchaseListService.getById(purchaseListDetailsService.getById(warehousingContent.getPurchaseListDetailsId()).getPurchaseListId());//查询采购清单
|
||||
|
||||
@@ -31,15 +31,15 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="getCheckScheduleVOSQL">
|
||||
SELECT cs.*,
|
||||
SELECT csv.*,
|
||||
(
|
||||
select department
|
||||
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=cs.manager_id ) as manager_mame
|
||||
FROM check_schedule cs
|
||||
(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=csv.manager_id ) as manager_mame
|
||||
FROM check_schedule csv
|
||||
</sql>
|
||||
|
||||
<select id="getCheckScheduleVOPage" resultMap="checkScheduleVO" resultType="digital.laboratory.platform.reagent.vo.CheckScheduleVO">
|
||||
@@ -48,23 +48,23 @@
|
||||
</select>
|
||||
|
||||
<select id="getCheckScheduleVO" resultMap="checkScheduleVO" resultType="digital.laboratory.platform.reagent.vo.CheckScheduleVO" >
|
||||
SELECT cs.*,
|
||||
SELECT csv.*,
|
||||
(
|
||||
select department
|
||||
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
|
||||
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,
|
||||
WHERE user.user_id=csv.manager_id ) as manager_mame,
|
||||
(SELECT user.name
|
||||
FROM dlp_base.sys_user user
|
||||
WHERE user.user_id=cs.create_by ) as create_name
|
||||
FROM check_schedule cs
|
||||
WHERE cs.id = #{checkScheduleId}
|
||||
WHERE user.user_id=csv.create_by ) as create_name
|
||||
FROM check_schedule csv
|
||||
WHERE csv.id = #{checkScheduleId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<select id="getCabinetCell" resultType="digital.laboratory.platform.reagent.entity.Cabinetcell">
|
||||
SELECT *
|
||||
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}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user