main
杨海航 1 year ago
parent 1f131810e0
commit f3b09ebbf1
  1. 23
      src/main/java/digital/laboratory/platform/reagent/controller/AcceptanceRecordFormController.java
  2. 23
      src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
  3. 17
      src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java
  4. 12
      src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApplicationController.java
  5. 4
      src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java
  6. 3
      src/main/java/digital/laboratory/platform/reagent/entity/AngleMark.java
  7. 9
      src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java
  8. 3
      src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java
  9. 2
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java
  10. 3
      src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java
  11. 4
      src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java
  12. 2
      src/main/java/digital/laboratory/platform/reagent/service/ComplianceCheckService.java
  13. 7
      src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
  14. 4
      src/main/java/digital/laboratory/platform/reagent/service/impl/AcceptanceRecordFormServiceImpl.java
  15. 6
      src/main/java/digital/laboratory/platform/reagent/service/impl/AngleMarkServiceImpl.java
  16. 13
      src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java
  17. 2
      src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java
  18. 6
      src/main/java/digital/laboratory/platform/reagent/service/impl/ComplianceCheckServiceImpl.java
  19. 23
      src/main/java/digital/laboratory/platform/reagent/service/impl/DeliveryRegistrationFormServiceImpl.java
  20. 8
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java
  21. 270
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java
  22. 125
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReviewAndApproveServiceImpl.java
  23. 1
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java
  24. 62
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java
  25. 5
      src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryVO.java
  26. 4
      src/main/resources/mapper/BatchDetailsMapper.xml
  27. 5
      src/main/resources/mapper/OutgoingContentsMapper.xml
  28. 107
      src/main/resources/mapper/ReagentConsumableInventoryMapper.xml
  29. 1
      src/main/resources/mapper/ReagentConsumablesSetMapper.xml
  30. 1
      src/main/resources/mapper/ReferenceMaterialMapper.xml

@ -84,18 +84,19 @@ public class AcceptanceRecordFormController {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
//通过标准物质ID查询该标准物质类的验收记录
if (rid != null) {
//只能从标准物质ID——》逐级查询出验收记录ID
AcceptanceRecordFormVO acceptanceRecordFormVO =
acceptanceRecordFormService.getAcceptanceRecordFormVO
(warehousingContentService.getById
(warehousingBatchListService.getById
(batchDetailsService.getById
(referenceMaterialService.getById(rid)).getWarehousingBatchListId()).getWarehousingContentId()).getAcceptanceRecordFormId());
if (acceptanceRecordFormVO.getStatus() == 6) {
if (StrUtil.isNotBlank(rid)) {
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(rid);
BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
WarehousingBatchList warehousingBatchList = warehousingBatchListService.getById(batchDetails.getWarehousingBatchListId());
if (warehousingBatchList != null) {
WarehousingContent warehousingContent = warehousingContentService.getById(warehousingBatchList.getWarehousingContentId());
if (warehousingContent != null) {
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(warehousingContent.getAcceptanceRecordFormId());
if (acceptanceRecordFormVO != null && acceptanceRecordFormVO.getStatus() == 6) {
return R.ok(acceptanceRecordFormVO);
} else return R.failed(null);
} else return R.ok(null);
}
}
}
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordFormId);
return R.ok(acceptanceRecordFormVO);

@ -83,23 +83,24 @@ public class ReagentConsumableInventoryController {
@ApiOperation(value = "标准物质列表", notes = "标准物质列表")
@GetMapping("/RList")
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
public R<Page<ReagentConsumableInventoryFullVO>> getReagentConsumableInventoryPage(Integer current, Integer size, String reagentConsumableName, Integer referenceMaterialStatus, HttpServletRequest theHttpServletRequest) {
public R<IPage<ReferenceMaterialFullVO>> getReagentConsumableInventoryPage(Page page, String reagentConsumableName, Integer referenceMaterialStatus, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
QueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryQueryWrapper = new QueryWrapper<>();
QueryWrapper<ReferenceMaterial> referenceMaterialQueryWrapper = new QueryWrapper<>();
String number = reagentConsumableName;
if (reagentConsumableName != null) {
reagentConsumableInventoryQueryWrapper.like("reagent_consumable_name", reagentConsumableName).or()
.like("species", reagentConsumableName);
}
Page<ReagentConsumableInventoryFullVO> allList = reagentConsumableInventoryService.getAllList(current, size, reagentConsumableInventoryQueryWrapper, referenceMaterialStatus, number);
referenceMaterialQueryWrapper
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.ne(referenceMaterialStatus==null,"status",-4)
.eq(referenceMaterialStatus != null, "status", referenceMaterialStatus)
.or()
.ne(referenceMaterialStatus==null,"status",-4)
.like(StrUtil.isNotBlank(reagentConsumableName), "number", reagentConsumableName)
.eq(referenceMaterialStatus != null, "status", referenceMaterialStatus);
IPage<ReferenceMaterialFullVO> allList = reagentConsumableInventoryService.getAllList(page, referenceMaterialQueryWrapper, referenceMaterialStatus, number);
return R.ok(allList);
// return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory)));
}
@ -164,7 +165,7 @@ public class ReagentConsumableInventoryController {
.like(StrUtil.isNotBlank(reagentConsumableName), "remark", reagentConsumableName)
.like(warning != null && warning == 1, "warning_information", "库存不足")
.eq("category", "耗材")
.eq("category", "耗材").or()
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.like(warning != null && warning == 1, "species", "库存不足")

@ -1,10 +1,12 @@
package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
@ -14,6 +16,7 @@ import digital.laboratory.platform.reagent.service.RequisitionRecordService;
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
import digital.laboratory.platform.reagent.vo.RequisitionRecordVO;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -21,10 +24,12 @@ import lombok.RequiredArgsConstructor;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.web.bind.annotation.*;
import javax.activation.MimetypesFileTypeMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.Principal;
import java.time.LocalDate;
import java.util.List;
/**
@ -54,26 +59,25 @@ public class RequisitionRecordController {
@SysLog("试剂耗材领用申请表打印")
@PostMapping("/print")
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_print')")
public void bizGetPDFInventory(String []idList, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
public void bizGetPDFInventory(String[] idList, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
List<RequisitionRecordVO> voList = requisitionRecordService.getRequisitionRecordVO(idList);
if (voList.isEmpty()) {
throw new RuntimeException("未查询到相关信息");
}
String id = IdWorker.get32UUID().toUpperCase();
String applyFileName = "试剂耗材领用记录表-"+id ;
String applyFileName = "试剂耗材领用记录表-" + id;
String pdfFilePath = "document" + "/" + "requisitionRecord" + "/" + id + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
requisitionRecordService.rquisitionRecordTablePDF(voList, id, theHttpServletRequest, httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
httpServletResponse.setContentType(new MimetypesFileTypeMap().getContentType(applyFileName));
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
@ -84,19 +88,20 @@ public class RequisitionRecordController {
* 分页查询
*
* @param page 分页对象
* @param requisitionRecord (试剂耗材领用记录表)
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_requisition_record_get')" )
public R<IPage<RequisitionRecordVO>> getRequisitionRecordPage(Page<RequisitionRecord> page, String name, RequisitionRecord requisitionRecord, HttpServletRequest theHttpServletRequest) {
public R<IPage<RequisitionRecordVO>> getRequisitionRecordPage(Page<RequisitionRecord> page, String name, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<RequisitionRecordVO> requisitionRecordSList = requisitionRecordService.getRequisitionRecordVOPage(page, Wrappers.<RequisitionRecord>query()
.like(StrUtil.isNotBlank(name), "reagent_consumable_name", name)
.orderByDesc("date_of_claim")
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
);
return R.ok(requisitionRecordSList);
// return R.ok(requisitionRecordService.page(page, Wrappers.query(requisitionRecord)));

@ -86,7 +86,7 @@ public class StandardMaterialApplicationController {
return R.ok(standardMaterialApplicationVO);
//return R.ok(standardMaterialApplicationService.getById(standardMaterialApplicationId));
}
}
/**
* 分页查询
@ -102,7 +102,8 @@ public class StandardMaterialApplicationController {
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getPage(page, Wrappers.<StandardMaterialApplication>query()
.like(StrUtil.isNotBlank(name), "reference_substance_name", name)
.like(StrUtil.isNotBlank(name), "reference_substance_name", name).or()
.like(StrUtil.isNotBlank(name), "reference_material_number", name)
.orderByDesc("date_of_claim")
);
return R.ok(standardMaterialApplicationSList);
@ -153,7 +154,14 @@ public class StandardMaterialApplicationController {
.like(StrUtil.isNotBlank(name), "reference_substance_name", name)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
.orderByDesc("create_time").or()
.eq("status", 1)
.eq(StrUtil.isNotBlank(rid), "reference_material_id", rid)
.like(StrUtil.isNotBlank(name), "reference_material_number", name)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
.orderByDesc("create_time")
);
return R.ok(standardMaterialApplicationSList);
// return R.ok(standardMaterialApplicationService.page(page, Wrappers.query(standardMaterialApplication)));

@ -40,7 +40,7 @@ public class ApplicationForUseDTO {
@ApiModelProperty(value = "(领用物品明细ID)")
private String reagentConsumableSetId;
@ApiModelProperty(value = "(领用物品仓库ID)")
private String reagentConsumableStashId;
}

@ -13,6 +13,9 @@ public class AngleMark {
@ApiModelProperty(value = "审核审批角标")
private Integer review = 0;
@ApiModelProperty(value = "采购计划")
private Integer procurementApplyList = 0;
@ApiModelProperty(value = "采购清单角标")
private Integer PurchaseList = 0;

@ -85,6 +85,15 @@ public class BatchDetails extends BaseEntity {
@ApiModelProperty(value="签收批次ID")
private String warehousingBatchListId;
@ApiModelProperty(value="仓库号(房间号)")
private String roomNo;
@ApiModelProperty(value="试剂耗材名称")
private String reagentConsumableName;
@ApiModelProperty(value="试剂耗材仓库ID")
private String reagentConsumableStashId;
@TableId(value = "batch_details_id", type = IdType.ASSIGN_UUID)
@ApiModelProperty(value="batchDetailsId")
private String batchDetailsId;

@ -90,5 +90,8 @@ public class OutgoingContents extends BaseEntity {
@ApiModelProperty(value="id")
private String id;
@ApiModelProperty(value = "(领用物品仓库ID)")
private String reagentConsumableStashId;
}

@ -84,5 +84,7 @@ public class ReagentConsumablesSet extends BaseEntity {
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "(领用物品仓库ID)")
private String reagentConsumableStashId;
}

@ -62,4 +62,7 @@ public class ReferenceMaterial extends BaseEntity {
@ApiModelProperty(value="保管人名称")
private String custodianName;
@ApiModelProperty(value="标准物质名称")
private String reagentConsumableName;
}

@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import digital.laboratory.platform.reagent.entity.Cabinetcell;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
import digital.laboratory.platform.reagent.vo.ReferenceMaterialFullVO;
import digital.laboratory.platform.reagent.vo.UserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -29,4 +31,6 @@ public interface ReagentConsumableInventoryMapper extends BaseMapper<ReagentCons
List<UserVO> getUserList();
Cabinetcell getCabinetCell(String location);
IPage<ReferenceMaterialFullVO> getReferenceMaterialPage (IPage<ReagentConsumableInventory>page, @Param (Constants.WRAPPER) QueryWrapper<ReferenceMaterial> qw);
}

@ -29,7 +29,7 @@ public interface ComplianceCheckService extends IService<ComplianceCheck> {
@Transactional
//新增标准物质符合性检查
ComplianceCheck addCheck(ComplianceCheckDTO complianceCheckDTO, DLPUser dlpUser);
ComplianceCheck addCheck(ComplianceCheckDTO complianceCheckDTO, String userId);
List<ComplianceCheck> addCheckList(List<ComplianceCheckDTO> list, DLPUser dlpUser);

@ -7,10 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.reagent.dto.ReagentConsumableInventoryDTO;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO;
import digital.laboratory.platform.reagent.vo.UserVO;
import digital.laboratory.platform.reagent.vo.*;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
@ -32,7 +29,7 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
ReagentConsumableInventory reduceById(String reagentConsumableId, Integer quantity);
Page<ReagentConsumableInventoryFullVO> getAllList(Integer current, Integer size, QueryWrapper<ReagentConsumableInventory> qw,Integer status,String number);
IPage<ReferenceMaterialFullVO> getAllList(Page page, QueryWrapper<ReferenceMaterial> qw, Integer status, String number);
ReagentConsumableInventoryFullVO getByCode(String id);

@ -234,6 +234,10 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
AcceptanceRecordFormVO acceptanceRecordFormVO = baseMapper.getAcceptanceRecordFormVO(acceptanceRecordFormId);//查询单个验收记录表
if (acceptanceRecordFormVO == null) {
return null;
}
ReagentConsumables byId = reagentConsumablesService.getById(acceptanceRecordFormVO.getReagentConsumableId());//查询试剂耗材信息
acceptanceRecordFormVO.setReagentConsumables(byId);

@ -33,6 +33,8 @@ public class AngleMarkServiceImpl extends ServiceImpl<AngleMarkMapper, AngleMark
private WarehousingRecordFormService warehousingRecordFormService;
@Autowired
private StandardReserveSolutionService standardReserveSolutionService;
@Autowired
private CentralizedRequestService centralizedRequestService;
@Override
@ -111,6 +113,10 @@ public class AngleMarkServiceImpl extends ServiceImpl<AngleMarkMapper, AngleMark
.eq("commit_status", 0).or()
.eq("commit_status", -2)).size());}
if (dlpUser.getPermissions().contains("reagent_purchasing_plan_commit")) {
angleMark.setProcurementApplyList(centralizedRequestService.list(Wrappers.<CentralizedRequest>query()
.eq("status", 6)).size());}
return angleMark;
}

@ -64,13 +64,12 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
applicationForUseVO.setReagentConsumablesSetVOList(list);
}
return applicationForUseVO;
}
@Override//分页查询
public IPage<ApplicationForUseVO> getApplicationForUseVOPage(IPage<ApplicationForUse> page, QueryWrapper<ApplicationForUse> qw) {
IPage<ApplicationForUseVO> applicationForUseVOPage = baseMapper.getApplicationForUseVOPage(page, qw);
List<ApplicationForUseVO> records = applicationForUseVOPage.getRecords();
@ -81,7 +80,6 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
BeanUtils.copyProperties(applicationForUseVO, record);
}
return applicationForUseVOPage;
}
@ -107,6 +105,11 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
reagentConsumablesSet.setApplicationForUseId(byId.getId());
if (applicationForUseDTO.getReagentConsumableStashId() != null) {
reagentConsumablesSet.setReagentConsumableStashId(applicationForUseDTO.getReagentConsumableStashId());
}
if (applicationForUseDTO.getReferenceMaterialId() != null) {
reagentConsumablesSet.setReferenceMaterialId(applicationForUseDTO.getReferenceMaterialId());
@ -129,8 +132,6 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
return applicationForUseVO;
} else return null;
}
//录入领用申请表
}
@ -175,7 +176,6 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
} else return null;
}
@Override//提交领用申请记录
@Transactional
public ApplicationForUseVO commitApplication(String id, DLPUser dlpUser) {
@ -197,7 +197,6 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
ApplicationForUseVO applicationForUseVO = this.getApplicationForUseVO(applicationForUse.getId());
return applicationForUseVO;
}
@Override//通过ID删除领用申请表(标准物质领用/归还登记表)

@ -19,6 +19,7 @@ import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.CentralizedRequestDTO;
import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.CentralizedRequestMapper;
import digital.laboratory.platform.reagent.mapper.PurchasingPlanMapper;
import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.vo.*;
import feign.Response;
@ -77,6 +78,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
private RemoteWord2PDFService remoteWord2PDFService;
@Transactional
@Override//增加集中采购申请
public CentralizedRequest addRequest(List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser) {

@ -107,14 +107,14 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
@Transactional
@Override//自动新增符合性检查
public ComplianceCheck addCheck(ComplianceCheckDTO complianceCheckDTO, DLPUser dlpUser) {
public ComplianceCheck addCheck(ComplianceCheckDTO complianceCheckDTO, String userId) {
ComplianceCheck complianceCheck = new ComplianceCheck();
complianceCheck.setId(IdWorker.get32UUID().toUpperCase());
BeanUtils.copyProperties(complianceCheckDTO, complianceCheck);
complianceCheck.setCreateBy(userId);
complianceCheck.setReagentConsumableName(reagentConsumablesService.getById(complianceCheckDTO.getReagentConsumableId()).getReagentConsumableName());
complianceCheck.setStatus(-1);
@ -133,7 +133,7 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
for (ComplianceCheckDTO complianceCheckDTO : list) {
ComplianceCheck complianceCheck = this.addCheck(complianceCheckDTO, dlpUser);
ComplianceCheck complianceCheck = this.addCheck(complianceCheckDTO, dlpUser.getId());
complianceCheck.setReagentConsumableName(reagentConsumablesService.getById(complianceCheckDTO.getReagentConsumableId()).getReagentConsumableName());

@ -69,6 +69,9 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
@Autowired
private RemoteCabinetService remoteCabinetService;
@Autowired
private ReagentConsumableStashService reagentConsumableStashService;
@Override
@Transactional//创建出库任务
@ -98,7 +101,6 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
OutgoingContents outgoingContents = new OutgoingContents();//出库明细
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>();
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(reagentConsumablesSet.getReferenceMaterialId());//标准物质
outgoingContents.setReferenceMaterialId(referenceMaterial.getId());//标准物质ID
outgoingContents.setId(IdWorker.get32UUID().toUpperCase());
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());//关联出库登记表
@ -117,14 +119,13 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
outgoingContentsList.add(outgoingContents);//集合
} else {
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())
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_stash_id", reagentConsumablesSet.getReagentConsumableStashId())
.orderByAsc("create_time")
.gt("quantity", 0));
.ne("quantity", 0));
//新建批次集合,用于存放需出库的物品批次
List<BatchDetails> batchDetails = new ArrayList<>();
@ -175,7 +176,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
}
@Override//提交出库登记表
@GlobalTransactional
@Transactional
public DeliveryRegistrationForm commitForm(List<OutgoingContentsDTO> outgoingContentsDTOS, DLPUser dlpUser) {
DeliveryRegistrationForm deliveryRegistrationForm = this.getById(outgoingContentsDTOS.get(0).getDeliveryRegistrationFormId());//得到出库登记表
@ -253,7 +254,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
}
referenceMaterial.setStatus(-3);//改变状态
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息
// reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息
referenceMaterialService.updateById(referenceMaterial);
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId());//批次信息
@ -309,7 +310,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
}
referenceMaterial.setStatus(-3);
referenceMaterialService.updateById(referenceMaterial);
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息
// reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId());
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() - outgoingContentsDTO.getQuantity());//修改库存数量
reagentConsumableInventoryService.updateById(reagentConsumableInventory);
@ -337,16 +338,20 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity());
if (batchDetails.getQuantity() == 0) {
batchDetails.setServiceStatus(-1);
// reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),-1);
}
batchDetailsService.updateById(batchDetails);
}
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getById(batchDetails.getReagentConsumableStashId());
reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() - outgoingContentsDTO.getQuantity());
reagentConsumableStashService.updateById(reagentConsumableStash);
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("出库数量不能超过库存量"));
}
@ -361,7 +366,7 @@ 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, applicationForUse.getRecipientId());//新增符合性检查
}
outgoingContentsList.add(outgoingContents);
}

@ -356,23 +356,17 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
for (PurchaseCatalogueDTO purchaseCatalogueDTO : purchaseCatalogueDTOList) {
if (StrUtil.isNotBlank(purchaseCatalogueDTO.getBrand()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getEnglishName()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getCategory()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getEnglishName()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getPackagedCopies()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getReagentConsumableName()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getSpecies()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getSpecificationAndModel()) &
purchaseCatalogueDTO.getUnitPrice() != 0 &
StrUtil.isNotBlank(purchaseCatalogueDTO.getAlias()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getStorageCondition()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getRemark()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getMinimumUnit()) &
StrUtil.isNotBlank(purchaseCatalogueDTO.getCasNumber())
StrUtil.isNotBlank(purchaseCatalogueDTO.getMinimumUnit())
) {
i++;
} else {
message = message + "\n" + "第" + i + "条数据有误,请改正后重新导入";
i++;
}

@ -13,6 +13,7 @@ import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.config.ConfigureBuilder;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.feign.RemoteTemplate2htmlService;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.oss.service.OssFile;
@ -77,6 +78,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Autowired
private RemoteCabinetService remoteCabinetService;
@Autowired
private ReagentConsumableStashService reagentConsumableStashService;
@Autowired
private OssFile ossFile;
@ -135,7 +139,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Override//试剂耗材管理列表
public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryREVOList(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw, Integer warning) {
if (warning != null) {
if (warning == 2) {
@ -169,8 +172,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
return pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), reagentConsumableInventoryVOList);
}
}
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, qw);
List<ReagentConsumableInventoryVO> records = reagentConsumableInventoryVOPage.getRecords();
@ -227,8 +228,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Override//分页查询标准物质
public Page<ReagentConsumableInventoryFullVO> getAllList(Integer current, Integer size, QueryWrapper<ReagentConsumableInventory> qw, Integer status, String number) {
public IPage<ReferenceMaterialFullVO> getAllList(Page page, QueryWrapper<ReferenceMaterial> qw, Integer status, String number) {
//如果扫码
if (StrUtil.isNotBlank(number)) {
ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(Wrappers.<ReferenceMaterial>query().eq("number", number));
@ -243,142 +245,34 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
PageUtils pageUtils = new PageUtils();
Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOS);
Page pages = pageUtils.getPages(page.getCurrent(), page.getSize(), reagentConsumableInventoryFullVOS);
return pages;
}
}
// List<ReferenceMaterial> list = referenceMaterialService.list(qw);
//
// List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>();
//
//
// for (ReferenceMaterial referenceMaterial : list) {
//
// ReagentConsumableInventory reagentConsumableInventory = this.getById(referenceMaterial.getReagentConsumableInventoryId());
//
// ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO();
//
// BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryFullVO);
//
// reagentConsumableInventoryFullVO.setNumber(referenceMaterial.getNumber());
//
// reagentConsumableInventoryFullVO.setBatchDetailsId(referenceMaterial.getBatchDetailsId());
//
// BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
//
// SupplierInformation supplierInformation = supplierInformationService.getById(batchDetails.getSupplierId());
//
// LambdaQueryWrapper<StandardReserveSolution> standardReserveSolutionLambdaQueryWrapper = new LambdaQueryWrapper<>();
//
// standardReserveSolutionLambdaQueryWrapper.eq(StandardReserveSolution::getReferenceId, referenceMaterial.getId());
IPage<ReferenceMaterialFullVO> referenceMaterialPage = baseMapper.getReferenceMaterialPage(page, qw);
// List<ReferenceMaterialFullVO> referenceMaterialPageRecords = referenceMaterialPage.getRecords();
//
// StandardReserveSolution one1 = standardReserveSolutionService.getOne(standardReserveSolutionLambdaQueryWrapper);
// LambdaQueryWrapper<StandardReserveSolution> standardReserveSolutionQueryWrapper = new LambdaQueryWrapper<>();
//
// reagentConsumableInventoryFullVO.setSupplierName(supplierInformation.getSupplierName());
// reagentConsumableInventoryFullVO.setBatch(batchDetails.getBatch());
// reagentConsumableInventoryFullVO.setBatchNumber(batchDetails.getBatchNumber());
// reagentConsumableInventoryFullVO.setManufacturerId(batchDetails.getSupplierId());
// reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime());
// reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId());
// reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus());
// reagentConsumableInventoryFullVO.setStorageLife(Integer.valueOf(batchDetails.getLimitDate()));
// reagentConsumableInventoryFullVO.setFixedResult(referenceMaterial.getFixedResult());
// if (one1 != null) {
// for (ReferenceMaterialFullVO referenceMaterialPageRecord : referenceMaterialPageRecords) {
// standardReserveSolutionQueryWrapper.eq(StandardReserveSolution::getReferenceMaterialId,referenceMaterialPageRecord.getReferenceMaterialId());
// StandardReserveSolution standardReserveSolution = standardReserveSolutionService.getOne(standardReserveSolutionQueryWrapper);
//
// reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration());
// reagentConsumableInventoryFullVO.setConfigurationDate(one1.getConfigurationDate());
// reagentConsumableInventoryFullVO.setSolutionNumbering(referenceMaterial.getNumber());
// reagentConsumableInventoryFullVO.setValidityPeriod(one1.getValidityPeriod());
// }
// reagentConsumableInventoryFullVOList.add(reagentConsumableInventoryFullVO);
// if (standardReserveSolution != null) {
//
//
// referenceMaterialPageRecord.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration());
// referenceMaterialPageRecord.setConfigurationDate(standardReserveSolution.getConfigurationDate());
// referenceMaterialPageRecord.setSolutionNumbering(standardReserveSolution.getSolutionNumbering());
// referenceMaterialPageRecord.setValidityPeriod(standardReserveSolution.getValidityPeriod());
// }
// PageUtils pageUtils = new PageUtils();
////
// Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList);
//
// return pages;
// }
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>();
List<ReagentConsumableInventory> list = this.list(qw);
ArrayList<ReferenceMaterial> referenceMaterialList = new ArrayList<>();
//通过仓库类信息,查找对应的该类所有标准物质
for (ReagentConsumableInventory reagentConsumableInventory : list) {
if (reagentConsumableInventory.getTotalQuantity() >= 0) {
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>();
if (status != null) {
referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getStatus, status).
eq(ReferenceMaterial::getReagentConsumableInventoryId, reagentConsumableInventory.getReagentConsumableInventoryId())
.ne(ReferenceMaterial::getStatus, -4);
} else {
referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getReagentConsumableInventoryId, reagentConsumableInventory.getReagentConsumableInventoryId())
.ne(ReferenceMaterial::getStatus, -4);
}
List<ReferenceMaterial> list1 = referenceMaterialService.list(referenceMaterialLambdaQueryWrapper);
referenceMaterialList.addAll(list1);
}
}
if (referenceMaterialList.size() != 0) {
//提供多余字段
for (ReferenceMaterial referenceMaterial : referenceMaterialList) {
ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO();
ReagentConsumableInventory byId = this.getById(referenceMaterial.getReagentConsumableInventoryId());
BeanUtils.copyProperties(byId, reagentConsumableInventoryFullVO);
reagentConsumableInventoryFullVO.setNumber(referenceMaterial.getNumber());
reagentConsumableInventoryFullVO.setBatchDetailsId(referenceMaterial.getBatchDetailsId());
BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
SupplierInformation supplierInformation = supplierInformationService.getById(batchDetails.getSupplierId());
LambdaQueryWrapper<StandardReserveSolution> standardReserveSolutionLambdaQueryWrapper = new LambdaQueryWrapper<>();
standardReserveSolutionLambdaQueryWrapper.eq(StandardReserveSolution::getReferenceId, referenceMaterial.getId());
StandardReserveSolution one1 = standardReserveSolutionService.getOne(standardReserveSolutionLambdaQueryWrapper);
reagentConsumableInventoryFullVO.setSupplierName(supplierInformation.getSupplierName());
reagentConsumableInventoryFullVO.setBatch(batchDetails.getBatch());
reagentConsumableInventoryFullVO.setBatchNumber(batchDetails.getBatchNumber());
reagentConsumableInventoryFullVO.setManufacturerId(batchDetails.getSupplierId());
reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime());
reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId());
reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus());
reagentConsumableInventoryFullVO.setFixedResult(referenceMaterial.getFixedResult());
if (one1 != null) {
reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration());
reagentConsumableInventoryFullVO.setConfigurationDate(one1.getConfigurationDate());
reagentConsumableInventoryFullVO.setSolutionNumbering(referenceMaterial.getNumber());
reagentConsumableInventoryFullVO.setValidityPeriod(one1.getValidityPeriod());
}
reagentConsumableInventoryFullVOList.add(reagentConsumableInventoryFullVO);
}
}
PageUtils pageUtils = new PageUtils();
Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList);
return pages;
return referenceMaterialPage;
}
@ -472,7 +366,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
// return list;
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>();
//找出对应的仓库信息
for (ReagentConsumableInventory reagentConsumableInventory : list) {
@ -519,8 +412,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
}
//-----------------------------
// 生成 word 版本的 采购目录
String applyFileName = "标准物质一览表-" + id;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
@ -648,6 +539,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
String templateFileName = "标准储备溶液标签模板.vm";
return remoteTemplate2htmlService.getHtml(templateFileName, data);
}
@Override
public List<UserVO> getUserList() {
@ -659,12 +551,24 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
public void inventoryEntry(List<ReagentConsumableInventoryDTO> reagentConsumableInventoryDTOList) {
for (ReagentConsumableInventoryDTO reagentConsumableInventoryDTO : reagentConsumableInventoryDTOList) {
String location = "F" + reagentConsumableInventoryDTO.getRoomNo().charAt(0) + "_试剂柜-" + reagentConsumableInventoryDTO
String location = "F" + reagentConsumableInventoryDTO.getRoomNo().charAt(0) + "-" + reagentConsumableInventoryDTO.getRoomNo() + "_试剂柜-" + reagentConsumableInventoryDTO
.getLocation().charAt(0) + "_" + reagentConsumableInventoryDTO.getLocation();
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory();
BeanUtils.copyProperties(reagentConsumableInventoryDTO, reagentConsumableInventory);
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase());
reagentConsumableInventory.setWarningValue(1);
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query()
.eq("reagent_consumable_name", reagentConsumableInventoryDTO.getReagentConsumableName())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getBrand()),"brand", reagentConsumableInventoryDTO.getBrand())
.eq("category", reagentConsumableInventoryDTO.getCategory())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecificationAndModel()),"specification_and_model", reagentConsumableInventoryDTO.getSpecificationAndModel())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getStandardValueOrPurity()), "standard_value_or_purity", reagentConsumableInventoryDTO.getStandardValueOrPurity())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getCasNumber()), "cas_number", reagentConsumableInventoryDTO.getCasNumber())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecies()), "species", reagentConsumableInventoryDTO.getSpecies())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getEnglishName()), "english_name", reagentConsumableInventoryDTO.getEnglishName())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getPackagedCopies()), "packaged_copies", reagentConsumableInventoryDTO.getPackagedCopies())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getAlias()), "alias", reagentConsumableInventoryDTO.getAlias())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getPurityGrade()), "purity_grade", reagentConsumableInventoryDTO.getPurityGrade())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getDeviationOrUncertainty()), "deviation_or_uncertainty", reagentConsumableInventoryDTO.getDeviationOrUncertainty())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getMinimumUnit()), "minimum_unit", reagentConsumableInventoryDTO.getMinimumUnit())
);
BatchDetails batchDetails = new BatchDetails();
@ -684,8 +588,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
} else {
batchDetails.setExpirationDate(LocalDate.now().plusYears(99));
}
Cabinetcell cabinetCell = baseMapper.getCabinetCell(reagentConsumableInventoryDTO.getLocation());
R cell = remoteCabinetService.queryCellByRoomNoAndLocation(reagentConsumableInventoryDTO.getRoomNo(), reagentConsumableInventoryDTO.getLocation());
Cabinetcell cabinetCell = (Cabinetcell) cell.getData();
batchDetails.setLatticeId(cabinetCell.getId());
batchDetails.setBoxId(cabinetCell.getCabinetId());
@ -693,12 +598,97 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
batchDetails.setPurchaseTime(LocalDateTime.now());
batchDetails.setBatchNumber("/");
batchDetails.setBatchDetailsId(IdWorker.get32UUID().toUpperCase());
batchDetails.setRoomNo(reagentConsumableInventoryDTO.getRoomNo());
if (one != null) {
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId()));
if (batchDetailsList != null & batchDetailsList.size() > 0) {
int x = batchDetailsList.size() + 1;
batchDetails.setBatch("2023-" + x);
one.setTotalQuantity(one.getTotalQuantity() + reagentConsumableInventoryDTO.getTotalQuantity());
this.updateById(one);
}
batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId());
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(one.getReagentConsumableId());
if (!one.getCategory().equals("标准物质")) {
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query()
.eq("room_no", reagentConsumableInventoryDTO.getRoomNo())
.eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId()));
if (reagentConsumableStash != null) {
reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + reagentConsumableInventoryDTO.getTotalQuantity());
batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId());
reagentConsumableStashService.updateById(reagentConsumableStash);
} else {
ReagentConsumableStash consumableStash = new ReagentConsumableStash();
BeanUtils.copyProperties(reagentConsumableInventoryDTO, consumableStash);
consumableStash.setId(IdWorker.get32UUID().toUpperCase());
consumableStash.setTotalQuantity(reagentConsumableInventoryDTO.getTotalQuantity());
consumableStash.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
batchDetails.setReagentConsumableStashId(consumableStash.getId());
reagentConsumableStashService.save(consumableStash);
}
}
if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) {
ReferenceMaterial referenceMaterial = new ReferenceMaterial();
referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId());
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();
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + roomNo.charAt(0) + "-1");//自动生成编号
referenceMaterial.setCode(referenceMaterial.getNumber());
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setReagentConsumableName(reagentConsumableInventoryDTO.getReagentConsumableName());
referenceMaterialService.save(referenceMaterial);
this.updateCabinet(cabinetCell.getId(), referenceMaterial.getId(), 1);
}
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1);
} else {
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory();
BeanUtils.copyProperties(reagentConsumableInventoryDTO, reagentConsumableInventory);
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase());
reagentConsumableInventory.setWarningValue(1);
if (reagentConsumableInventoryDTO.getSpecificationAndModel().equals("/")) {
reagentConsumableInventory.setSpecificationAndModel("");
}
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(reagentConsumableInventory);
reagentConsumableInventory.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
this.save(reagentConsumableInventory);
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1);
//导入标准物质
if (!reagentConsumableInventory.getCategory().equals("标准物质")){
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query()
.eq("room_no", reagentConsumableInventoryDTO.getRoomNo())
.eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId()));
if (reagentConsumableStash != null) {
reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + reagentConsumableInventoryDTO.getTotalQuantity());
batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId());
reagentConsumableStashService.updateById(reagentConsumableStash);
} else {
ReagentConsumableStash consumableStash = new ReagentConsumableStash();
BeanUtils.copyProperties(reagentConsumableInventoryDTO, consumableStash);
consumableStash.setId(IdWorker.get32UUID().toUpperCase());
consumableStash.setTotalQuantity(reagentConsumableInventoryDTO.getTotalQuantity());
consumableStash.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
batchDetails.setReagentConsumableStashId(consumableStash.getId());
reagentConsumableStashService.save(consumableStash);
}
}
if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) {
ReferenceMaterial referenceMaterial = new ReferenceMaterial();
referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
@ -707,6 +697,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
referenceMaterial.setStatus(0);
referenceMaterial.setLatticeId(cabinetCell.getId());
referenceMaterial.setBoxId(cabinetCell.getCabinetId());
referenceMaterial.setReagentConsumableName(reagentConsumableInventoryDTO.getReagentConsumableName());
Calendar instance = Calendar.getInstance();
int year = instance.get(Calendar.YEAR);
String roomNo = reagentConsumableInventoryDTO.getRoomNo();
@ -715,10 +706,11 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterialService.save(referenceMaterial);
this.updateCabinet(cabinetCell.getId(), referenceMaterial.getId(), 1);
}
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1);
}
this.save(reagentConsumableInventory);
batchDetailsService.save(batchDetails);
}
}

@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.ReviewAndApproveMapper;
import digital.laboratory.platform.reagent.mapper.*;
import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,9 +21,6 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
@Autowired
private DecentralizedRequestService decentralizedRequestService;
@Autowired
private PurchasingPlanService purchasingPlanService;
@Autowired
private AcceptanceRecordFormService acceptanceRecordFormService;
@ -51,6 +48,44 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
@Autowired
private CentralizedRequestService centralizedRequestService;
@Autowired
private PurchasingPlanService purchasingPlanService;
@Autowired
private CentralizedRequestMapper centralizedRequestMapper;
@Autowired
private PurchasingPlanMapper purchasingPlanMapper;
@Autowired
private DecentralizedRequestMapper decentralizedRequestMapper;
@Autowired
private AcceptanceRecordFormMapper acceptanceRecordFormMapper;
@Autowired
private ComplianceCheckMapper complianceCheckMapper;
@Autowired
private CheckScheduleMapper checkScheduleMapper;
@Autowired
private PeriodVerificationImplementationMapper periodVerificationImplementationMapper;
@Autowired
private PurchaseCatalogueMapper purchaseCatalogueMapper;
@Autowired
private StandardMaterialApprovalFormMapper standardMaterialApprovalFormMapper;
@Autowired
private EvaluationFormMapper evaluationFormMapper;
@Autowired
private InstructionBookMapper instructionBookMapper;
@Override
// 进行审核的列表
public ReviewAndApprove getReviewAndApproveList(DLPUser dlpUser) {
@ -91,7 +126,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (CentralizedRequest centralizedRequest : list) {
CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(centralizedRequest.getId());
CentralizedRequestVO centralizedRequestVO = centralizedRequestMapper.getCentralizedRequestVO(centralizedRequest.getId());
centralizedRequestVOList.add(centralizedRequestVO);
}
@ -112,7 +147,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (DecentralizedRequest decentralizedRequest : decentralizedRequestList) {
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizedRequest.getId());
DecentralizedRequestVO requestById = decentralizedRequestMapper.getDecentralizedRequest(decentralizedRequest.getId());
decentralizedRequestVOList.add(requestById);
}
@ -132,7 +167,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (DecentralizedRequest decentralizedRequest : decentralizedRequestList) {
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizedRequest.getId());
DecentralizedRequestVO requestById = decentralizedRequestMapper.getDecentralizedRequest(decentralizedRequest.getId());
decentralizedRequestVOList.add(requestById);
}
@ -152,7 +187,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (DecentralizedRequest decentralizedRequest : decentralizedRequestList) {
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizedRequest.getId());
DecentralizedRequestVO requestById = decentralizedRequestMapper.getDecentralizedRequest(decentralizedRequest.getId());
decentralizedRequestVOList.add(requestById);
}
@ -171,7 +206,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (DecentralizedRequest decentralizedRequest : decentralizedRequestList) {
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizedRequest.getId());
DecentralizedRequestVO requestById = decentralizedRequestMapper.getDecentralizedRequest(decentralizedRequest.getId());
decentralizedRequestVOList.add(requestById);
}
@ -190,7 +225,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (PurchaseCatalogue purchaseCatalogue : list) {
PurchaseCatalogueVO purchaseCatalogueVO = purchaseCatalogueService.getPurchaseCatalogueVO(purchaseCatalogue.getPurchaseCatalogueId());
PurchaseCatalogueVO purchaseCatalogueVO = purchaseCatalogueMapper.getPurchaseCatalogueVO(purchaseCatalogue.getPurchaseCatalogueId());
purchaseCatalogueVOArrayList.add(purchaseCatalogueVO);
}
@ -210,7 +245,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (PurchaseCatalogue purchaseCatalogue : list) {
PurchaseCatalogueVO purchaseCatalogueVO = purchaseCatalogueService.getPurchaseCatalogueVO(purchaseCatalogue.getPurchaseCatalogueId());
PurchaseCatalogueVO purchaseCatalogueVO = purchaseCatalogueMapper.getPurchaseCatalogueVO(purchaseCatalogue.getPurchaseCatalogueId());
purchaseCatalogueVOArrayList.add(purchaseCatalogueVO);
@ -231,7 +266,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (PurchasingPlan purchasingPlan : list) {
PurchasingPlanVO purchasingPlanVO = purchasingPlanService.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());
PurchasingPlanVO purchasingPlanVO = purchasingPlanMapper.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());
purchasingPlanVOS1.add(purchasingPlanVO);
}
@ -250,7 +285,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (PurchasingPlan purchasingPlan : list) {
PurchasingPlanVO purchasingPlanVO = purchasingPlanService.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());
PurchasingPlanVO purchasingPlanVO = purchasingPlanMapper.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());
purchasingPlanVOS1.add(purchasingPlanVO);
}
@ -270,7 +305,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (AcceptanceRecordForm acceptanceRecordForm : list) {
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormMapper.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
acceptanceRecordFormVOS1.add(acceptanceRecordFormVO);
}
@ -291,7 +326,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (AcceptanceRecordForm acceptanceRecordForm : list) {
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormMapper.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
acceptanceRecordFormVOS1.add(acceptanceRecordFormVO);
}
@ -312,7 +347,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (AcceptanceRecordForm acceptanceRecordForm : list) {
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormMapper.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
acceptanceRecordFormVOS1.add(acceptanceRecordFormVO);
}
@ -332,7 +367,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (ComplianceCheck complianceCheck : list) {
ComplianceCheckVO complianceCheckVO = complianceCheckService.getComplianceCheckVO(complianceCheck.getId());
ComplianceCheckVO complianceCheckVO = complianceCheckMapper.getComplianceCheckVO(complianceCheck.getId());
complianceCheckVOS1.add(complianceCheckVO);
}
@ -352,7 +387,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (ComplianceCheck complianceCheck : list) {
ComplianceCheckVO complianceCheckVO = complianceCheckService.getComplianceCheckVO(complianceCheck.getId());
ComplianceCheckVO complianceCheckVO = complianceCheckMapper.getComplianceCheckVO(complianceCheck.getId());
complianceCheckVOS1.add(complianceCheckVO);
}
@ -371,7 +406,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (CheckSchedule checkSchedule : list) {
CheckScheduleVO checkScheduleVO = checkScheduleService.getCheckScheduleVO(checkSchedule.getId());
CheckScheduleVO checkScheduleVO = checkScheduleMapper.getCheckScheduleVO(checkSchedule.getId());
checkScheduleVOS1.add(checkScheduleVO);
}
@ -390,7 +425,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (PeriodVerificationImplementation periodVerificationImplementation : list) {
PeriodVerificationImplementationVO periodVerificationImplementationVO = periodVerificationImplementationService.getPeriodVerificationImplementationVO(periodVerificationImplementation.getId());
PeriodVerificationImplementationVO periodVerificationImplementationVO = periodVerificationImplementationMapper.getPeriodVerificationImplementationVO(periodVerificationImplementation.getId());
periodVerificationImplementationVOS1.add(periodVerificationImplementationVO);
}
@ -410,7 +445,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (StandardMaterialApprovalForm standardMaterialApprovalForm : list) {
StandardMaterialApprovalFormVO vo = standardMaterialApprovalFormService.getVO(standardMaterialApprovalForm.getId());
StandardMaterialApprovalFormVO vo = standardMaterialApprovalFormMapper.getVO(standardMaterialApprovalForm.getId());
standardMaterialApprovalFormVOS1.add(vo);
}
@ -429,7 +464,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (StandardMaterialApprovalForm standardMaterialApprovalForm : list) {
StandardMaterialApprovalFormVO vo = standardMaterialApprovalFormService.getVO(standardMaterialApprovalForm.getId());
StandardMaterialApprovalFormVO vo = standardMaterialApprovalFormMapper.getVO(standardMaterialApprovalForm.getId());
standardMaterialApprovalFormVOS1.add(vo);
}
@ -448,7 +483,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (EvaluationForm evaluationForm : list) {
EvaluationFormVO formById = evaluationFormService.getFormById(evaluationForm.getId());
EvaluationFormVO formById = evaluationFormMapper.getEvaluationForm(evaluationForm.getId());
evaluationFormVOS1.add(formById);
}
@ -466,7 +501,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (EvaluationForm evaluationForm : list) {
EvaluationFormVO formById = evaluationFormService.getFormById(evaluationForm.getId());
EvaluationFormVO formById = evaluationFormMapper.getEvaluationForm(evaluationForm.getId());
evaluationFormVOS1.add(formById);
}
@ -485,7 +520,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (InstructionBook instructionBook : list) {
InstructionBookVO vo = instructionBookService.getVO(instructionBook.getReferenceMaterialTypeId());
InstructionBookVO vo = instructionBookMapper.getInstructionBookVO(instructionBook.getReferenceMaterialTypeId());
instructionBookVOS1.add(vo);
}
@ -547,7 +582,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (CentralizedRequest centralizedRequest : list) {
CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(centralizedRequest.getId());
CentralizedRequestVO centralizedRequestVO = centralizedRequestMapper.getCentralizedRequestVO(centralizedRequest.getId());
centralizedRequestVOList.add(centralizedRequestVO);
}
@ -567,7 +602,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (DecentralizedRequest decentralizedRequest : decentralizedRequestList) {
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizedRequest.getId());
DecentralizedRequestVO requestById = decentralizedRequestMapper.getDecentralizedRequest(decentralizedRequest.getId());
decentralizedRequestVOList.add(requestById);
}
@ -587,7 +622,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (DecentralizedRequest decentralizedRequest : decentralizedRequestList) {
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizedRequest.getId());
DecentralizedRequestVO requestById = decentralizedRequestMapper.getDecentralizedRequest(decentralizedRequest.getId());
decentralizedRequestVOList.add(requestById);
}
@ -607,7 +642,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (DecentralizedRequest decentralizedRequest : decentralizedRequestList) {
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizedRequest.getId());
DecentralizedRequestVO requestById = decentralizedRequestMapper.getDecentralizedRequest(decentralizedRequest.getId());
decentralizedRequestVOList.add(requestById);
}
@ -626,7 +661,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (DecentralizedRequest decentralizedRequest : decentralizedRequestList) {
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizedRequest.getId());
DecentralizedRequestVO requestById = decentralizedRequestMapper.getDecentralizedRequest(decentralizedRequest.getId());
decentralizedRequestVOList.add(requestById);
}
@ -645,7 +680,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (PurchaseCatalogue purchaseCatalogue : list) {
PurchaseCatalogueVO purchaseCatalogueVO = purchaseCatalogueService.getPurchaseCatalogueVO(purchaseCatalogue.getPurchaseCatalogueId());
PurchaseCatalogueVO purchaseCatalogueVO = purchaseCatalogueMapper.getPurchaseCatalogueVO(purchaseCatalogue.getPurchaseCatalogueId());
purchaseCatalogueVOArrayList.add(purchaseCatalogueVO);
}
@ -666,7 +701,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (PurchasingPlan purchasingPlan : list) {
PurchasingPlanVO purchasingPlanVO = purchasingPlanService.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());
PurchasingPlanVO purchasingPlanVO = purchasingPlanMapper.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());
purchasingPlanVOS1.add(purchasingPlanVO);
}
@ -685,7 +720,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (PurchasingPlan purchasingPlan : list) {
PurchasingPlanVO purchasingPlanVO = purchasingPlanService.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());
PurchasingPlanVO purchasingPlanVO = purchasingPlanMapper.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());
purchasingPlanVOS1.add(purchasingPlanVO);
}
@ -705,7 +740,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (AcceptanceRecordForm acceptanceRecordForm : list) {
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormMapper.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
acceptanceRecordFormVOS1.add(acceptanceRecordFormVO);
}
@ -726,7 +761,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (AcceptanceRecordForm acceptanceRecordForm : list) {
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormMapper.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
acceptanceRecordFormVOS1.add(acceptanceRecordFormVO);
}
@ -747,7 +782,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (AcceptanceRecordForm acceptanceRecordForm : list) {
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormMapper.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
acceptanceRecordFormVOS1.add(acceptanceRecordFormVO);
}
@ -767,7 +802,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (ComplianceCheck complianceCheck : list) {
ComplianceCheckVO complianceCheckVO = complianceCheckService.getComplianceCheckVO(complianceCheck.getId());
ComplianceCheckVO complianceCheckVO = complianceCheckMapper.getComplianceCheckVO(complianceCheck.getId());
complianceCheckVOS1.add(complianceCheckVO);
}
@ -787,7 +822,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (ComplianceCheck complianceCheck : list) {
ComplianceCheckVO complianceCheckVO = complianceCheckService.getComplianceCheckVO(complianceCheck.getId());
ComplianceCheckVO complianceCheckVO = complianceCheckMapper.getComplianceCheckVO(complianceCheck.getId());
complianceCheckVOS1.add(complianceCheckVO);
}
@ -806,7 +841,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (CheckSchedule checkSchedule : list) {
CheckScheduleVO checkScheduleVO = checkScheduleService.getCheckScheduleVO(checkSchedule.getId());
CheckScheduleVO checkScheduleVO = checkScheduleMapper.getCheckScheduleVO(checkSchedule.getId());
checkScheduleVOS1.add(checkScheduleVO);
}
@ -825,7 +860,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (PeriodVerificationImplementation periodVerificationImplementation : list) {
PeriodVerificationImplementationVO periodVerificationImplementationVO = periodVerificationImplementationService.getPeriodVerificationImplementationVO(periodVerificationImplementation.getId());
PeriodVerificationImplementationVO periodVerificationImplementationVO = periodVerificationImplementationMapper.getPeriodVerificationImplementationVO(periodVerificationImplementation.getId());
periodVerificationImplementationVOS1.add(periodVerificationImplementationVO);
}
@ -845,7 +880,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (StandardMaterialApprovalForm standardMaterialApprovalForm : list) {
StandardMaterialApprovalFormVO vo = standardMaterialApprovalFormService.getVO(standardMaterialApprovalForm.getId());
StandardMaterialApprovalFormVO vo = standardMaterialApprovalFormMapper.getVO(standardMaterialApprovalForm.getId());
standardMaterialApprovalFormVOS1.add(vo);
}
@ -864,7 +899,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (StandardMaterialApprovalForm standardMaterialApprovalForm : list) {
StandardMaterialApprovalFormVO vo = standardMaterialApprovalFormService.getVO(standardMaterialApprovalForm.getId());
StandardMaterialApprovalFormVO vo = standardMaterialApprovalFormMapper.getVO(standardMaterialApprovalForm.getId());
standardMaterialApprovalFormVOS1.add(vo);
}
@ -883,7 +918,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (EvaluationForm evaluationForm : list) {
EvaluationFormVO formById = evaluationFormService.getFormById(evaluationForm.getId());
EvaluationFormVO formById = evaluationFormMapper.getEvaluationForm(evaluationForm.getId());
evaluationFormVOS1.add(formById);
}
@ -902,7 +937,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (EvaluationForm evaluationForm : list) {
EvaluationFormVO formById = evaluationFormService.getFormById(evaluationForm.getId());
EvaluationFormVO formById = evaluationFormMapper.getEvaluationForm(evaluationForm.getId());
evaluationFormVOS1.add(formById);
}
@ -921,7 +956,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
for (InstructionBook instructionBook : list) {
InstructionBookVO vo = instructionBookService.getVO(instructionBook.getReferenceMaterialTypeId());
InstructionBookVO vo = instructionBookMapper.getInstructionBookVO(instructionBook.getReferenceMaterialTypeId());
instructionBookVOS1.add(vo);
}

@ -194,6 +194,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
referenceMaterial.setReagentConsumableId(reagentConsumableInventory.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
referenceMaterial.setNumber(prefix + newNo);
referenceMaterial.setReagentConsumableName(reagentConsumableInventory.getReagentConsumableName());
ReferenceMaterial byId1 = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId());

@ -94,6 +94,10 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
private PurchaseListService purchaseListService;
@Autowired
private AcceptanceSignForService acceptanceSignForService;
@Autowired
private ReagentConsumableStashService reagentConsumableStashService;
@GlobalTransactional//查看采购入库
public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) {
@ -110,9 +114,12 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
@Override//录入入库明细
public WarehousingRecordFormVO addFormById(WarehousingRecordFormDTO warehousingRecordFormDTO, DLPUser dlpUser) {
if (warehousingRecordFormDTO.getDateOfProduction()==null){//如果没有生产日期,默认当前时间为生产日期
if (warehousingRecordFormDTO.getDateOfProduction() == null) {//如果没有生产日期,默认当前时间为生产日期
warehousingRecordFormDTO.setDateOfProduction(LocalDate.now());
}
if ((warehousingRecordFormDTO.getWarningValue() == null)) {
warehousingRecordFormDTO.setWarningValue(1);
}
//必须选择存放位置才能入库
if (warehousingRecordFormDTO.getLatticeId().isEmpty() & warehousingRecordFormDTO.getLocation().isEmpty() &
warehousingRecordFormDTO.getBoxId().isEmpty()) {
@ -122,6 +129,8 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
String latticeId = warehousingRecordFormDTO.getLatticeId();//格子ID
String boxId = warehousingRecordFormDTO.getBoxId();//柜子ID
String location = warehousingRecordFormDTO.getLocation();//位置信息
String roomNo = location.substring(3, 6);
//建立签收物品批次信息
WarehousingBatchList warehousingBatchList = new WarehousingBatchList();
BeanUtils.copyProperties(warehousingRecordFormDTO, warehousingBatchList);
@ -192,6 +201,8 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
batchDetails.setLatticeId(latticeId);//赋值位置信息
batchDetails.setLocation(location);
batchDetails.setBoxId(boxId);
batchDetails.setRoomNo(roomNo);//房间号
batchDetails.setReagentConsumableName(reagentConsumables.getReagentConsumableName());
//如果未填写存储期限,则默认为可以一直存储
if (warehousingRecordFormDTO.getExpirationDate() != null) {
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate());
@ -201,11 +212,24 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
batchDetails.setQuantity(quantity); //录入数量
batchDetails.setWarehousingBatchListId(warehousingBatchList.getId());//关联签收批次
if (!reagentConsumables.getCategory().equals("标准物质")) {
ReagentConsumableStash reagentConsumableStash = new ReagentConsumableStash();
BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableStash);
reagentConsumableStash.setId(IdWorker.get32UUID().toUpperCase());
reagentConsumableStash.setRoomNo(roomNo);
reagentConsumableStash.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId());
reagentConsumableStash.setTotalQuantity(quantity);
reagentConsumableStashService.save(reagentConsumableStash);
}
warehousingBatchList.setBatchId(batchDetails.getBatchDetailsId());//关联签收批次
if (reagentConsumables.getCategory().equals("试剂") | reagentConsumables.getCategory().equals("耗材")) {
//更新格子信息(试剂耗材传入类ID)
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),1);
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(), 1);
}
reagentConsumableInventory.setTotalQuantity(quantity);//数量
@ -222,8 +246,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
referenceMaterial.setLocation(location);
referenceMaterial.setLatticeId(latticeId);
referenceMaterial.setBoxId(boxId);
referenceMaterial.setReagentConsumableName(reagentConsumables.getReagentConsumableName());
//更新格子信息(标准物质传入对象ID)
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(), 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()
@ -273,7 +298,28 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
batchDetails.setLocation(location);
batchDetails.setLatticeId(latticeId);
batchDetails.setBoxId(boxId);
batchDetails.setRoomNo(roomNo);//房间号
batchDetails.setReagentConsumableName(reagentConsumables.getReagentConsumableName());
if (!reagentConsumables.getCategory().equals("标准物质")) {
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query()
.eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId())
.eq("room_no", roomNo));
if (reagentConsumableStash == null) {
ReagentConsumableStash newReagentConsumableStash = new ReagentConsumableStash();
BeanUtils.copyProperties(one, newReagentConsumableStash);
newReagentConsumableStash.setId(IdWorker.get32UUID().toUpperCase());
newReagentConsumableStash.setRoomNo(roomNo);
newReagentConsumableStash.setTotalQuantity(quantity);
batchDetails.setReagentConsumableStashId(newReagentConsumableStash.getId());
reagentConsumableStashService.save(newReagentConsumableStash);
} else {
reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + quantity);
batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId());
reagentConsumableStashService.updateById(reagentConsumableStash);
}
}
int year = Calendar.getInstance().get(Calendar.YEAR);
Integer years = Integer.valueOf(year);//进行包装,方便运算
@ -290,7 +336,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
}
if (one.getCategory().equals("试剂") | one.getCategory().equals("耗材")) {
//更新格子信息(试剂耗材传入类ID)
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),1);
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(), 1);
}
one.setTotalQuantity(one.getTotalQuantity() + batchDetails.getQuantity());
one.setWarningValue(warehousingRecordFormDTO.getWarningValue());
@ -307,8 +353,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId());
referenceMaterial.setBoxId(warehousingRecordFormDTO.getBoxId());
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName());
referenceMaterial.setReagentConsumableName(reagentConsumables.getReagentConsumableName());
//更新格子信息(试剂耗材传入类ID)
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(), 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()
@ -412,7 +459,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
WarehousingRecordFormVO warehousingRecordFormVO = this.getWarehousingRecordFormVO(warehousingRecordFormId);//签收单VO
return warehousingRecordFormVO;
}
@Override
public IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm> qw) {
@ -437,8 +483,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
}
return warehousingRecordFormVOPage;
}
}

@ -21,5 +21,10 @@ public class ReagentConsumableInventoryVO extends ReagentConsumableInventory {
@ApiModelProperty(value="是否有指导书")
private boolean instructionBook;
@ApiModelProperty(value="房间号")
private String roomNo;
}

@ -31,6 +31,8 @@
<result property="boxId" column="box_id"/>
<result property="warningInformation" column="warning_information"/>
<result property="warehousingBatchListId" column="warehousing_batch_list_id"/>
<result property="roomNo" column="room_no"/>
<result property="reagentConsumableName" column="reagent_consumable_name"/>
<result property="reagentConsumableStashId" column="reagent_consumable_stash_id"/>
</resultMap>
</mapper>

@ -24,10 +24,7 @@
<result property="boxId" column="box_id"/>
<result property="code" column="code"/>
<result property="reagentConsumablesSetId" column="reagent_consumables_set_id"/>
<result property="reagentConsumableStashId" column="reagent_consumable_stash_id"/>
</resultMap>
</mapper>

@ -53,7 +53,8 @@
<select id="getReagentConsumableInventoryVOPage" resultMap="reagentConsumableInventoryVO"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO">
select *
from reagent_consumable_inventory ${ew.customSqlSegment}
from reagent_consumable_inventory
${ew.customSqlSegment}
</select>
<select id="getUserList" resultType="digital.laboratory.platform.reagent.vo.UserVO">
@ -62,13 +63,111 @@
</select>
<select id="getRoomInfo" resultType="digital.laboratory.platform.reagent.entity.Cabinetcell">
SELECT id FROM b_cabinet WHERE room_no = #{roomNo}
SELECT id
FROM b_cabinet
WHERE room_no = #{roomNo}
</select>
<select id="getCabinetCell" resultType="digital.laboratory.platform.reagent.entity.Cabinetcell">
<select id="getCabinetCell" parameterType="String"
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 = '706')
WHERE cabinet_Id in (SELECT id FROM dlp_cabinet.b_cabinet WHERE room_no = '707')
and location = #{location}
</select>
<!-- <sql id="getReferenceMaterialPageSQL">-->
<!-- SELECT r1.*, r2.*, b1.*-->
<!-- FROM reference_material r1,-->
<!-- reagent_consumable_inventory r2,-->
<!-- batch_details b1-->
<!-- WHERE r1.reagent_consumable_inventory_id = r2.reagent_consumable_inventory_id-->
<!-- and r1.batch_details_id = b1.batch_details_id-->
<!-- </sql> -->
<select id="getReferenceMaterialPage" resultType="digital.laboratory.platform.reagent.vo.ReferenceMaterialFullVO">
SELECT rmp.*,
(select rci.specification_and_model
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as specification_and_model,
(select rci.`code`
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as `code`,
(select rci.category
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as category,
(select rci.brand
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as brand,
(select rci.deviation_or_uncertainty
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as deviation_or_uncertainty,
(select rci.instruction_book_id
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as instruction_book_id,
(select rci.species
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as species,
(select rci.alias
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as alias,
(select rci.remark
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as remark,
(select rci.configuration_concentration
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as configuration_concentration,
(select rci.storage_life
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as storage_life,
(select rci.warning_information
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as warning_information,
(select r1.`status` from reference_material r1 where r1.id = rmp.id) as reference_material_status,
(select r1.`id` from reference_material r1 where r1.id = rmp.id) as reference_material_id,
(select bd.batch
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as batch,
(select bd.fixed_result
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as fixed_result,
(select bd.purchase_time
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as purchase_time,
(select bd.batch_number
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as batch_number,
(select bd.supplier_id
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as manufacturer_id,
(select srs.configuration_concentration
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as configuration_concentration,
(select srs.configuration_date
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as configuration_date,
(select srs.solution_numbering
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as solution_numbering,
(select srs.validity_period
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as validity_period
FROM reference_material rmp
${ew.customSqlSegment}
</select>
</mapper>

@ -19,5 +19,6 @@
<result property="referenceMaterialId" column="reference_material_id"/>
<result property="quantityDelivered" column="quantity_delivered"/>
<result property="outgoingContentId" column="outgoing_content_id"/>
<result property="reagentConsumableStashId" column="reagent_consumable_stash_id"/>
</resultMap>
</mapper>

@ -22,6 +22,7 @@
<result property="code" column="code"/>
<result property="fixedResult" column="fixed_result"/>
<result property="serviceStatus" column="service_status"/>
<result property="reagentConsumableName" column="reagent_consumable_name"/>
</resultMap>

Loading…
Cancel
Save