diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java b/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java index 5672ae8..6aa3c86 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java @@ -309,8 +309,8 @@ public class CentralizedRequestController { @ApiOperation(value = "标准物质采购申请表打印", notes = "标准物质采购申请表打印") @SysLog("标准物质采购申请表打印") @PostMapping("/print") - @PreAuthorize("@pms.hasPermission('purchase_request_print')") - public void bizGetPDFInventory(String id, String type,HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { + @PreAuthorize("@pms.hasPermission('purchase_request_print')") + public void bizGetPDFInventory(String id, String type, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -325,7 +325,7 @@ public class CentralizedRequestController { String pdfFilePath = "document" + "/" + "purchaseRequest" + "/" + id + "/" + applyFileName + ".pdf"; try { //直接调用pdf方法 - centralizedRequestService.purchaseRequestTablePDF(voList,id,type, theHttpServletRequest, httpServletResponse); + centralizedRequestService.purchaseRequestTablePDF(voList, id, type, theHttpServletRequest, httpServletResponse); ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream()); httpServletResponse.setContentType(applyFileName); } catch (Exception e) { @@ -333,6 +333,14 @@ public class CentralizedRequestController { e.printStackTrace(); } } + + @PostMapping("/lead") + public R leadPurchase(@RequestBody List requestDTOS, HttpServletRequest theHttpServletRequest) { + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + CentralizedRequest centralizedRequest = centralizedRequestService.leadPurchase(requestDTOS, dlpUser); + return R.ok(centralizedRequest); + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java index 77574dc..6e11fc6 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java @@ -85,17 +85,7 @@ public class ReagentConsumableInventoryController { @GetMapping("/RList") // @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')") public R> getReagentConsumableInventoryPage(Page page, String reagentConsumableName, Integer referenceMaterialStatus) { - QueryWrapper referenceMaterialQueryWrapper = new QueryWrapper<>(); - String number = reagentConsumableName; - referenceMaterialQueryWrapper - .and(qw -> qw - .ne(referenceMaterialStatus == null, "status", -4) - .eq(referenceMaterialStatus != null, "status", referenceMaterialStatus)) - .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName) - .or() - .like(StrUtil.isNotBlank(reagentConsumableName), "number", reagentConsumableName); - - IPage allList = reagentConsumableInventoryService.getStandardAllList(page, referenceMaterialQueryWrapper, referenceMaterialStatus, number); + IPage allList = reagentConsumableInventoryService.getStandardAllList(page, reagentConsumableName, referenceMaterialStatus); return R.ok(allList); } diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java index cf6213f..0060a26 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java @@ -64,13 +64,11 @@ public class WarehousingRecordFormController { * @param warehousingRecordFormId id * @return R */ - @ApiOperation(value = "通过id查询入库信息", notes = "通过id查询入库信息") + @ApiOperation(value = "通过id查询入库信息", notes = "参数:warehousingRecordFormId:入库ID" + "\n" + "opCode:(null:查询所有,1:查询未签收完成,-1:查询已签收完成)" + "\n" + " keywords:试剂耗材名称查询参数" + "\n" + "category:试剂耗材类别查询参数") @GetMapping() @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_get')") - public R getById(String warehousingRecordFormId, HttpServletRequest theHttpServletRequest) { - - WarehousingRecordFormVO warehousingRecordFormVO = warehousingRecordFormService.getWarehousingRecordFormVO(warehousingRecordFormId); - + public R getById(String warehousingRecordFormId, Integer opCode, String keywords, String category) { + WarehousingRecordFormVO warehousingRecordFormVO = warehousingRecordFormService.getWarehousingRecordFormVO(warehousingRecordFormId, opCode, keywords, category); return R.ok(warehousingRecordFormVO); } @@ -110,7 +108,6 @@ public class WarehousingRecordFormController { .le(endTime != null, "create_time", endTime) .eq("status", 1) .orderByDesc("create_time")); - return R.ok(warehousingContentVOPage); } @@ -131,4 +128,11 @@ public class WarehousingRecordFormController { warehousingRecordFormService.addFormById(warehousingRecordFormDTO, dlpUser); return R.ok("签收成功"); } + + + @ApiOperation(value = "查询入库单中已签收的物品信息", notes = "查询入库单中已签收的物品信息") + @GetMapping("/batch/list") + public R getBatchList(String warehousingRecordFormId, String keywords) { + return R.ok(warehousingRecordFormService.getBatchList(warehousingRecordFormId, keywords), "数据查询成功!"); + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/CentralizedRequestDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/CentralizedRequestDTO.java index b6ba37d..1431774 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/CentralizedRequestDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/CentralizedRequestDTO.java @@ -14,25 +14,30 @@ import lombok.NoArgsConstructor; public class CentralizedRequestDTO { - @ApiModelProperty(value="集中采购申请ID") - private String centralizedRequestId; + @ApiModelProperty(value = "集中采购申请ID") + private String centralizedRequestId; - @ApiModelProperty(value="采购目录编号") - private String purchaseCatalogueNumber; + @ApiModelProperty(value = "采购目录编号") + private String purchaseCatalogueNumber; - @ApiModelProperty(value="申请数量") - private Integer numberOfApplications; + @ApiModelProperty(value = "申请数量") + private Integer numberOfApplications; - @ApiModelProperty(value="试剂耗材ID") - private String reagentConsumableId; + @ApiModelProperty(value = "试剂耗材ID") + private String reagentConsumableId; - @ApiModelProperty(value="备注") - private String remarks; + @ApiModelProperty(value = "备注") + private String remarks; - @ApiModelProperty(value="集中采购申请明细Id") - private String detailsOfCentralizedId; + @ApiModelProperty(value = "集中采购申请明细Id") + private String detailsOfCentralizedId; - @ApiModelProperty(value="用途/购买理由") - private String purpose; + @ApiModelProperty(value = "用途/购买理由") + private String purpose; + private String specificationAndModel; + + private String reagentConsumableName; + + private Double unitPrice; } diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/PurchaseCatalogueDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/PurchaseCatalogueDTO.java index 160fd1f..4085764 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/PurchaseCatalogueDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/PurchaseCatalogueDTO.java @@ -15,7 +15,6 @@ public class PurchaseCatalogueDTO { @ApiModelProperty(value="纯度等级") private String purityGrade; - /** * (品牌) */ @@ -75,7 +74,7 @@ public class PurchaseCatalogueDTO { @ApiModelProperty(value = "CAS 号") private String casNumber; - @ApiModelProperty(value = "CAS 号") + @ApiModelProperty(value = "编码") private String code; diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/ReagentConsumableInventoryDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/ReagentConsumableInventoryDTO.java index ec140ac..1f0544e 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/ReagentConsumableInventoryDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/ReagentConsumableInventoryDTO.java @@ -2,13 +2,14 @@ package digital.laboratory.platform.reagent.dto; import com.amazonaws.services.s3.S3ResourceType; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; +import digital.laboratory.platform.reagent.entity.ReagentConsumables; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.time.LocalDate; @Data -public class ReagentConsumableInventoryDTO extends ReagentConsumableInventory { +public class ReagentConsumableInventoryDTO extends ReagentConsumables { @ApiModelProperty(value = "(位置信息)") @@ -38,4 +39,6 @@ public class ReagentConsumableInventoryDTO extends ReagentConsumableInventory { @ApiModelProperty(value = "(规格)") private String packages; + private Integer totalQuantity; + } diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java b/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java index 2a24b17..2098b08 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java @@ -25,8 +25,6 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) @ApiModel(value = "(采购目录明细)") public class CatalogueDetails extends BaseEntity { - - /** * 纯度等级 */ diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java index c8a1149..32fba92 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java @@ -26,37 +26,6 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) @ApiModel(value = "试剂耗材库存") public class ReagentConsumableInventory extends BaseEntity { - @ApiModelProperty(value="纯度等级") - private String purityGrade; - - @ApiModelProperty(value = "CAS-号") - private String casNumber; - - @ApiModelProperty(value = "物品编码") - private String code; - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - private String reagentConsumableName; - /** - * (品牌) - */ - @ApiModelProperty(value = "(品牌)") - private String brand; - - /** - * (类别) - */ - @ApiModelProperty(value = "(类别)") - private String category; - - - /** - * 偏差/不确定度 - */ - @ApiModelProperty(value = "偏差/不确定度") - private String deviationOrUncertainty; /** * (指导书ID) @@ -70,93 +39,26 @@ public class ReagentConsumableInventory extends BaseEntity { @ApiModelProperty(value = "(试剂耗材Id)") private String reagentConsumableId; - /** - * (规格型号) - */ - @ApiModelProperty(value = "(规格型号)") - private String specificationAndModel; - - /** - * (种类) - */ - @ApiModelProperty(value = "(种类)") - private String species; - - /** - * (标准值/纯度) - */ - @ApiModelProperty(value = "(标准值/纯度)") - private String standardValueOrPurity; - - /** - * (技术参数) - */ - @ApiModelProperty(value = "(技术参数)") - private String technicalParameter; - /** * (总数量) */ @ApiModelProperty(value = "(总数量)") private Integer totalQuantity; - /** - * (包装份数) - */ - @ApiModelProperty(value = "(包装份数)") - private Integer packagedCopies; - /** * reagentConsumableInventoryId */ @TableId(value = "reagent_consumable_inventory_id", type = IdType.ASSIGN_UUID) @ApiModelProperty(value = "reagentConsumableInventoryId") - private String reagentConsumableInventoryId; - /** - * 单价 - */ - @ApiModelProperty(value = "单价") - private Double unitPrice; - - /** - * 别名 - */ - @ApiModelProperty(value = "别名") - private String alias; - - /** - * 存储条件 - */ - @ApiModelProperty(value = "存储条件") - private String storageCondition; - /** * 备注 */ @ApiModelProperty(value = "备注") private String remark; + + /** - * 包装单位 - */ - @ApiModelProperty(value = "包装单位") - private String minimumUnit; - /** - * (溶液浓度) - */ - @ApiModelProperty(value = "(溶液浓度)") - private double configurationConcentration; - /** - * 英文名 - */ - @ApiModelProperty(value = "英文名") - private String englishName; - /** - * 存储期限 - */ - @ApiModelProperty(value = "存储期限") - private Integer storageLife; -/** * 状态 */ @ApiModelProperty(value = "状态") @@ -165,10 +67,13 @@ public class ReagentConsumableInventory extends BaseEntity { /** * (预警值) */ - @ApiModelProperty(value="(预警值)") + @ApiModelProperty(value = "(预警值)") private Integer warningValue; - @ApiModelProperty(value="(预警信息)") - private String warningInformation; + /** + * (预警信息) + */ + @ApiModelProperty(value = "(预警信息)") + private String warningInformation; } diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java index 7251622..8c7c61c 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java @@ -130,5 +130,7 @@ public class ReagentConsumables extends BaseEntity { @ApiModelProperty(value="reagentConsumableId") private String reagentConsumableId; + @ApiModelProperty(value = "存储期限") + private Integer storageLife; } diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java index e4e5788..4982970 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java @@ -81,9 +81,6 @@ public class WarehousingContent extends BaseEntity { @ApiModelProperty(value = "采购清单明细ID") private String purchaseListDetailsId; - @ApiModelProperty(value = "预警值") - private Integer warningValue; - @ApiModelProperty(value = "上次存放位置") private String lastStorageLocation; diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java index 3aeb7cf..b517487 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java @@ -22,7 +22,7 @@ import java.util.List; @Mapper public interface ReagentConsumableInventoryMapper extends BaseMapper { - IPage getReagentConsumableInventoryVOPage(IPage page, @Param("warning") Integer warning,@Param("keywords") String keywords,@Param("reagentCategory") Integer reagentCategory); + IPage getReagentConsumableInventoryVOPage(IPage page, @Param("warning") Integer warning, @Param("keywords") String keywords, @Param("reagentCategory") Integer reagentCategory); IPage getReagentConsumableInventoryFullVOPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); @@ -33,11 +33,20 @@ public interface ReagentConsumableInventoryMapper extends BaseMapper getOrgList(); - IPage getReferenceMaterialPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + IPage getReferenceMaterialPage(IPage page, @Param("status") Integer status, @Param("reagentConsumableName") String reagentConsumableName); + IPage getReagentConsumablePage(IPage page, @Param("name") String name); List getReagentConsumableList(); + List getRciListByCategory(List list); + + IPage getRemListById();//标准物质 + + IPage getRmListById();//试剂耗材 + String getCellName(String id); + + ReagentConsumableInventoryVO getRciById(@Param("reagentConsumableInventoryId") String reagentConsumableInventoryId, @Param("reagentConsumableId") String reagentConsumableId); } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingBatchListMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingBatchListMapper.java index 13effdc..764bb0a 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingBatchListMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingBatchListMapper.java @@ -1,9 +1,13 @@ package digital.laboratory.platform.reagent.mapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; import digital.laboratory.platform.reagent.entity.WarehousingBatchList; import digital.laboratory.platform.reagent.vo.WarehousingBatchListVO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -16,6 +20,6 @@ import java.util.List; @Mapper public interface WarehousingBatchListMapper extends BaseMapper { - List getWarehousingBatchListVOList(String warehousingContentId); + List getWarehousingBatchListVOList(@Param(value = "warehousingRecordFormId") String warehousingRecordFormId, @Param(value = "keywords") String keywords); } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingContentMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingContentMapper.java index 18c8675..50d2f07 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingContentMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingContentMapper.java @@ -9,6 +9,7 @@ import digital.laboratory.platform.reagent.entity.WarehousingContent; import digital.laboratory.platform.reagent.vo.WarehousingContentVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.springframework.security.core.parameters.P; import org.yaml.snakeyaml.scanner.Constant; import java.util.List; @@ -16,6 +17,7 @@ import java.util.List; @Mapper public interface WarehousingContentMapper extends BaseMapper { - List getWarehousingContentVOList(String signingRecordFormId); - IPage getWarehousingContentVOPage(Page page, @Param(Constants.WRAPPER)QueryWrapper qw); + List getWarehousingContentVOList(@Param(value = "warehousingRecordFormId") String warehousingRecordFormId, @Param(value = "opCode") Integer opCode, @Param(value = "keywords") String keywords, @Param(value = "category") String category); + + IPage getWarehousingContentVOPage(Page page, @Param(Constants.WRAPPER) QueryWrapper qw); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java b/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java index 2dee9bf..d9f14aa 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java @@ -24,7 +24,9 @@ import java.util.List; public interface CentralizedRequestService extends IService { CentralizedRequest addRequest(List centralizedRequestDTOList, DLPUser dlpUser); - CentralizedRequest commitRequest(String id,DLPUser dlpUser); + CentralizedRequest leadPurchase(List requestDTOS, DLPUser dlpUser); + + CentralizedRequest commitRequest(String id, DLPUser dlpUser); DetailsOfCentralized editDetailsById(CentralizedRequestDTO centralizedRequestDto); diff --git a/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java b/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java index 844287f..1da9f4f 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java @@ -33,7 +33,7 @@ public interface ReagentConsumableInventoryService extends IService getStandardAllList(Page page, QueryWrapper qw, Integer status, String number); + IPage getStandardAllList(Page page, String reagentConsumableName, Integer referenceMaterialStatus); ReagentConsumableInventoryFullVO getByCode(String id); diff --git a/src/main/java/digital/laboratory/platform/reagent/service/WarehousingBatchListService.java b/src/main/java/digital/laboratory/platform/reagent/service/WarehousingBatchListService.java index 110264e..b66b9ed 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/WarehousingBatchListService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/WarehousingBatchListService.java @@ -14,7 +14,7 @@ import java.util.List; */ public interface WarehousingBatchListService extends IService { - List getWarehousingBatchListVOList(String warehousingContentId); + List getWarehousingBatchListVOList(String warehousingContentId,String keywords); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/WarehousingContentService.java b/src/main/java/digital/laboratory/platform/reagent/service/WarehousingContentService.java index 4bc6319..4b4afe0 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/WarehousingContentService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/WarehousingContentService.java @@ -12,7 +12,7 @@ import java.util.List; public interface WarehousingContentService extends IService { - List getWarehousingContentVOList(String warehousingRecordFormId); + List getWarehousingContentVOList(String warehousingRecordFormId, Integer oopCode, String keywords, String category); IPage getWarehousingContentVOPage(Page page, QueryWrapper qw); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java b/src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java index bca493e..2ff6bae 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java @@ -8,6 +8,7 @@ import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.reagent.dto.WarehousingRecordFormDTO; import digital.laboratory.platform.reagent.entity.WarehousingBatchList; import digital.laboratory.platform.reagent.entity.WarehousingRecordForm; +import digital.laboratory.platform.reagent.vo.WarehousingBatchListVO; import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO; import org.springframework.transaction.annotation.Transactional; @@ -24,7 +25,10 @@ public interface WarehousingRecordFormService extends IService getSigningRecordFormVOList (QueryWrapper qw); - WarehousingRecordFormVO getWarehousingRecordFormVO (String warehousingFormId); + WarehousingRecordFormVO getWarehousingRecordFormVO (String warehousingRecordFormId, Integer opCode, String keywords, String type); + + List getBatchList(String warehousingRecordFormId,String keywords); + @Transactional void addFormById(WarehousingRecordFormDTO warehousingRecordFormDTO, DLPUser dlpUser); IPage getWarehousingRecordFormVOPage(Page page, QueryWrapperqw); diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java index 217c799..42e1c50 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java @@ -26,20 +26,13 @@ public class CatalogueDetailsServiceImpl extends ServiceImpl getCatalogueDetailsList(String purchaseCatalogueId) { - - LambdaQueryWrapper catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); - List list = this.list(Wrappers.query().eq("purchase_catalogue_id",purchaseCatalogueId).orderByDesc("purchase_catalogue_number")); - Collections.sort(list, new Comparator() { - - @Override public int compare(CatalogueDetails o1, CatalogueDetails o2) { return Integer.valueOf(o1.getPurchaseCatalogueNumber().substring(5)) - Integer.valueOf(o2.getPurchaseCatalogueNumber().substring(5)); } }); return list; - } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java index 3a3643b..7ec99f7 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java @@ -3,7 +3,6 @@ package digital.laboratory.platform.reagent.service.impl; import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; @@ -20,7 +19,6 @@ 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; @@ -83,92 +81,91 @@ public class CentralizedRequestServiceImpl extends ServiceImpl centralizedRequestDTOList, DLPUser dlpUser) { - String centralizedRequestId = centralizedRequestDTOList.get(0).getCentralizedRequestId(); - List detailsOfCentralizedList = new ArrayList<>(); - if (centralizedRequestId == null) { - CentralizedRequest centralizedRequest = new CentralizedRequest(); - centralizedRequest.setApplicantId(dlpUser.getId()); - centralizedRequest.setId(IdWorker.get32UUID().toUpperCase()); //获取申请时间 //未提交 centralizedRequest.setStatus(0); - centralizedRequest.setApplicantName(dlpUser.getName()); - for (CentralizedRequestDTO centralizedRequestDTO : centralizedRequestDTOList) { - DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized(); - BeanUtils.copyProperties(centralizedRequestDTO, detailsOfCentralized); - detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase()); - detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getId()); - detailsOfCentralizedList.add(detailsOfCentralized); - - } - if (this.save(centralizedRequest) && detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) { return centralizedRequest; } else return null; - - //将DTO赋值给明细表 - - } else { - CentralizedRequest centralizedRequest = this.getById(centralizedRequestId); - - for (CentralizedRequestDTO centralizedRequestDTO : centralizedRequestDTOList) { - DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized(); - BeanUtils.copyProperties(centralizedRequestDTO, detailsOfCentralized); - detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase()); - detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getId()); - detailsOfCentralizedList.add(detailsOfCentralized); - } - if (detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) { - return centralizedRequest; - } else return null; } } + @Override + public CentralizedRequest leadPurchase(List requestDTOS, DLPUser dlpUser) { + CentralizedRequest centralizedRequest = new CentralizedRequest(); + centralizedRequest.setId(IdWorker.get32UUID().toUpperCase()); + centralizedRequest.setApplicantId(dlpUser.getId()); + centralizedRequest.setStatus(1); + centralizedRequest.setApplicantName(dlpUser.getName()); + centralizedRequest.setDateOfApplication(LocalDateTime.now()); + List detailsOfCentralizeds = new ArrayList<>(); + for (CentralizedRequestDTO requestDTO : requestDTOS) { + List list = reagentConsumablesService.list(Wrappers.lambdaQuery().eq(ReagentConsumables::getReagentConsumableName, requestDTO.getReagentConsumableName()).eq(ReagentConsumables::getSpecificationAndModel, requestDTO.getSpecificationAndModel()).eq(ReagentConsumables::getUnitPrice, requestDTO.getUnitPrice())); + if (list.size() > 1) { + throw new RuntimeException(String.format("重复的数据" + requestDTO.getReagentConsumableName() + "~~~~~~~~" + requestDTO.getSpecificationAndModel())); + } + if (list.size() == 0) { + throw new RuntimeException(String.format("错误的数据") + requestDTO.getReagentConsumableName() + "~~~~~~~~" + requestDTO.getSpecificationAndModel()); + } + ReagentConsumables reagentConsumables = list.get(0); + requestDTO.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); + DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized(); + BeanUtils.copyProperties(requestDTOS, detailsOfCentralized); + detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase()); + detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getId()); + detailsOfCentralized.setPurpose("检验所需"); + detailsOfCentralized.setReagentConsumableId(requestDTO.getReagentConsumableId()); + detailsOfCentralized.setNumberOfApplications(requestDTO.getNumberOfApplications()); + detailsOfCentralizeds.add(detailsOfCentralized); + } + if (this.save(centralizedRequest) && detailsOfCentralizedService.saveBatch(detailsOfCentralizeds)) { + return centralizedRequest; + } else { + return null; + } + } @Override//提交申请 public CentralizedRequest commitRequest(String id, DLPUser dlpUser) { - CentralizedRequest byId = this.getById(id); - byId.setStatus(1); - byId.setDateOfApplication(LocalDateTime.now()); - this.updateById(byId); - return byId; + CentralizedRequest centralizedRequest = this.getById(id); + centralizedRequest.setStatus(1); + centralizedRequest.setDateOfApplication(LocalDateTime.now()); + this.updateById(centralizedRequest); + return centralizedRequest; } @Override//修改申请 public DetailsOfCentralized editDetailsById(CentralizedRequestDTO centralizedRequestDto) { - DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(centralizedRequestDto.getDetailsOfCentralizedId()); - BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized); - if (detailsOfCentralizedService.updateById(detailsOfCentralized)) { return detailsOfCentralized; } else return null; @@ -177,13 +174,9 @@ public class CentralizedRequestServiceImpl extends ServiceImpl detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>(); - - detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getCentralizedRequestId, centralizedRequestId); - - List list = detailsOfCentralizedService.list(detailsOfCentralizedLambdaQueryWrapper); - - if (list.size() != 0) { - - detailsOfCentralizedService.removeBatchByIds(list); - + List list = detailsOfCentralizedService.list(Wrappers.lambdaQuery().eq(DetailsOfCentralized::getCentralizedRequestId, centralizedRequestId)); + if (list != null && list.size() > 0) { + return detailsOfCentralizedService.removeBatchByIds(list) && this.removeById(centralizedRequestId); + } else { + return this.removeById(centralizedRequestId); } - return this.removeById(centralizedRequestId); - } - @Override public IPage getCentralizedRequestVOPage(IPage page, QueryWrapper qw) { - IPage r = baseMapper.getCentralizedRequestVOPage(page, qw); - return r; + IPage centralizedRequestVOPage = baseMapper.getCentralizedRequestVOPage(page, qw); + return centralizedRequestVOPage; } @Override public List getCentralizedRequestVOList(QueryWrapper qw) { - - LambdaQueryWrapper centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); //查询状态为1的采购申请:已提交 - centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus, 1); - - List list = this.list(centralizedRequestLambdaQueryWrapper); + List list = this.list(Wrappers.lambdaQuery().eq(CentralizedRequest::getStatus, 1)); ArrayList centralizedRequestVOArrayList = new ArrayList<>(); - for (CentralizedRequest centralizedRequest : list) { CentralizedRequestVO centralizedRequestVO = new CentralizedRequestVO(); BeanUtils.copyProperties(centralizedRequest, centralizedRequestVO); centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId())); centralizedRequestVOArrayList.add(centralizedRequestVO); } - return centralizedRequestVOArrayList; } @Override// public CentralizedRequestVO getCentralizedRequestVO(String centralizedRequestId) { - CentralizedRequestVO centralizedRequestVO = baseMapper.getCentralizedRequestVO(centralizedRequestId); - List detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestId); - centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList); - return centralizedRequestVO; } @Override public List getVOList(QueryWrapper qw) { - - List centralizedRequestVOArrayList = baseMapper.getVOList(qw); - -// for (CentralizedRequestVO centralizedRequestVO : centralizedRequestVOArrayList) { -// -// List detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId()); -// -// centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList); -// } - - return centralizedRequestVOArrayList; + return baseMapper.getVOList(qw); } @Override @@ -286,23 +250,14 @@ public class CentralizedRequestServiceImpl extends ServiceImpl getPurchaseRequestPrintList(String id, String type) { ArrayList purchaseRequestPrintVOList = new ArrayList<>(); - if (type.equals("集中采购申请")) { - CentralizedRequestVO centralizedRequest = this.getCentralizedRequestVO(id); - if (centralizedRequest.getStatus() != 4) { - throw new RuntimeException(String.format("当前采购还未被制定为清单,无法打印")); } - List detailsOfCentralizedVOList = centralizedRequest.getDetailsOfCentralizedVOList(); - - for (DetailsOfCentralizedVO detailsOfCentralized : detailsOfCentralizedVOList) { - ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId()); - if (reagentConsumables.getCategory().equals("标准物质")) { PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); purchaseRequestPrintVO.setApplicantName(centralizedRequest.getApplicantName()); @@ -319,29 +274,20 @@ public class CentralizedRequestServiceImpl extends ServiceImpl reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); - reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, outgoingContents.getReagentConsumableId()); - ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); - outgoingContentsVO.setReagentConsumableInventory(reagentConsumableInventory);//试剂耗材信息 + + ReagentConsumableInventoryVO vo = reagentConsumableInventoryMapper.getRciById(null, outgoingContents.getReagentConsumableId()); + outgoingContentsVO.setReagentConsumableInventory(vo);//试剂耗材信息 BatchDetails batchDetails = batchDetailsService.getById(outgoingContents.getBatchDetailsId()); if (batchDetails != null) { diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java index a4889e1..f79f7fd 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java @@ -31,65 +31,19 @@ public class DetailsOfCentralizedServiceImpl extends ServiceImpl getDetailsOfCentralizedVOList(String centralizedRequestId) { - List list = baseMapper.getDetailsOfCentralizedVOList(centralizedRequestId); - - for (DetailsOfCentralizedVO detailsOfCentralizedVO : list) { - - ReagentConsumables byId = reagentConsumablesService.getById(detailsOfCentralizedVO.getReagentConsumableId()); - - detailsOfCentralizedVO.setBrand(byId.getBrand()); - detailsOfCentralizedVO.setCategory(byId.getCategory()); - detailsOfCentralizedVO.setSpecificationAndModel(byId.getSpecificationAndModel()); - + ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralizedVO.getReagentConsumableId()); + detailsOfCentralizedVO.setBrand(reagentConsumables.getBrand()); + detailsOfCentralizedVO.setCategory(reagentConsumables.getCategory()); + detailsOfCentralizedVO.setSpecificationAndModel(reagentConsumables.getSpecificationAndModel()); } return list; } - @Override public List getDetailsOfCentralizedList(String procurementContentId) { - -// LambdaQueryWrapper detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>(); -// -// detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getProcurementContentId, purchasingPlanId); -// -// List list = this.list(detailsOfCentralizedLambdaQueryWrapper); -// -// List detailsOfCentralizedVOS = new ArrayList<>(); -// -// for (DetailsOfCentralized detailsOfCentralized : list) { -// -// CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(detailsOfCentralized.getCentralizedRequestId()); -// -// LambdaQueryWrapper reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); -// -// reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableId, detailsOfCentralized.getReagentConsumableId()); -// -// ReagentConsumables one = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper); -// -// DetailsOfCentralizedVO detailsOfCentralizedVO = new DetailsOfCentralizedVO(); -// -// BeanUtils.copyProperties(detailsOfCentralized, detailsOfCentralizedVO); -// -// detailsOfCentralizedVO.setReplacementReagentConsumableName(one.getReagentConsumableName()); -// -// detailsOfCentralizedVO.setDepartment(centralizedRequestVO.getDepartment()); -// -// detailsOfCentralizedVO.setApplicantName(centralizedRequestVO.getApplicantName()); -// -// detailsOfCentralizedVOS.add(detailsOfCentralizedVO); -// detailsOfCentralizedVO.setSpecies(one.getSpecies()); -// detailsOfCentralizedVO.setDeviationOrUncertainty(one.getDeviationOrUncertainty()); -// detailsOfCentralizedVO.setMinimumUnit(one.getMinimumUnit()); -// detailsOfCentralizedVO.setPackagedCopies(one.getPackagedCopies().toString()); -// detailsOfCentralizedVO.setStandardValueOrPurity(one.getStandardValueOrPurity()); -// } return baseMapper.getDetailsOfCentralizedVOPlanList(procurementContentId); } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java index 0a5ae66..ac9feac 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java @@ -47,26 +47,19 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl purchaseCatalogueDTOList) { - PurchaseCatalogue purchaseCatalogue = new PurchaseCatalogue(); - purchaseCatalogue.setPurchaseCatalogueId(IdWorker.get32UUID().toUpperCase()); - purchaseCatalogue.setStatus(0); - List catalogueDetailsList = new ArrayList<>(); - Integer i = 1; - for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) { CatalogueDetails catalogueDetails = new CatalogueDetails(); BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails); catalogueDetails.setCatalogueDetailsId(IdWorker.get32UUID().toUpperCase()); catalogueDetails.setPurchaseCatalogueId(purchaseCatalogue.getPurchaseCatalogueId()); - String yyyy = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy"); - catalogueDetails.setPurchaseCatalogueNumber(yyyy + "-" + i.toString()); + catalogueDetails.setPurchaseCatalogueNumber(LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy") + "-" + i.toString()); i++; catalogueDetailsList.add(catalogueDetails); typeTableService.addSpecies(catalogueDetails.getCategory(), catalogueDetails.getSpecies()); @@ -80,132 +73,86 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); - - catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId); - - List list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); - - if (list.size() > 0 & list != null) { - catalogueDetailsService.removeBatchByIds(list); + List list = catalogueDetailsService.list(Wrappers.lambdaQuery().eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId)); + if (list != null && list.size() > 0) { + return catalogueDetailsService.removeBatchByIds(list) && this.removeById(purchaseCatalogueId); + } else { + return this.removeById(purchaseCatalogueId); } - return - this.removeById(purchaseCatalogueId); } @Override public CatalogueDetails addDetails(PurchaseCatalogueDTO purchaseCatalogueDTO) { - CatalogueDetails catalogueDetails = new CatalogueDetails(); - - PurchaseCatalogueVO purchaseCatalogueVO = this.getPurchaseCatalogueVO(purchaseCatalogueDTO.getPurchaseCatalogueId()); - - int size = purchaseCatalogueVO.getCatalogueDetailsListList().size(); - BeanUtils.copyProperties(purchaseCatalogueDTO, catalogueDetails); - String yyyy = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy"); - - catalogueDetails.setPurchaseCatalogueNumber(yyyy + "-" + size + 1); - + catalogueDetails.setPurchaseCatalogueNumber(yyyy + "-" + catalogueDetailsService.list(Wrappers.lambdaQuery() + .eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueDTO.getPurchaseCatalogueId())).size() + 1); if (catalogueDetailsService.save(catalogueDetails)) { - return catalogueDetails; } else return null; } @Override public IPage getPurchaseCatalogueVOPage(IPage page, QueryWrapper qw) { - IPage purchaseCatalogueVOPage = baseMapper.getPurchaseCatalogueVOPage(page, qw); - List records = purchaseCatalogueVOPage.getRecords(); - for (PurchaseCatalogueVO record : records) { - - PurchaseCatalogue byId = this.getById(record.getPurchaseCatalogueId()); - - LambdaQueryWrapper catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); - - catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, byId.getPurchaseCatalogueId()); - - List list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); - + List list = catalogueDetailsService.list(Wrappers.lambdaQuery() + .eq(CatalogueDetails::getPurchaseCatalogueId, record.getPurchaseCatalogueId())); record.setQuantity(list.size()); } - return purchaseCatalogueVOPage; } @Override public List getPurchaseCatalogueVOList(QueryWrapper qw) { - - List purchaseCatalogueVOList = baseMapper.getPurchaseCatalogueVOList(qw); - - return purchaseCatalogueVOList; + return baseMapper.getPurchaseCatalogueVOList(qw); } @Override//通过ID查询 public PurchaseCatalogueVO getPurchaseCatalogueVO(String purchaseCatalogueId) { - PurchaseCatalogueVO purchaseCatalogueVO = baseMapper.getPurchaseCatalogueVO(purchaseCatalogueId); - List catalogueDetailsList = catalogueDetailsService.getCatalogueDetailsList(purchaseCatalogueId); - purchaseCatalogueVO.setCatalogueDetailsListList(catalogueDetailsList); - purchaseCatalogueVO.setQuantity(catalogueDetailsList.size()); - return purchaseCatalogueVO; } @Override//提交目录 @Transactional public PurchaseCatalogue commitById(List purchaseCatalogueDTOList, DLPUser dlpUser) { - Set permissions = dlpUser.getPermissions(); - - if (purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId().equals("") | purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId() == null) { - + if (!StrUtil.isNotBlank(purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId())) { PurchaseCatalogue purchaseCatalogue = this.addCatalogue(dlpUser, purchaseCatalogueDTOList); - if (permissions.contains("reagent_purchase_catalogue_primary")) { - purchaseCatalogue.setStatus(2); } else { purchaseCatalogue.setStatus(1); } purchaseCatalogue.setCommitTime(LocalDateTime.now()); - if (this.updateById(purchaseCatalogue)) { return purchaseCatalogue; } else return null; } else { - PurchaseCatalogue purchaseCatalogue = this.getById(purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId() - ); + PurchaseCatalogue purchaseCatalogue = this.getById(purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId()); if (permissions.contains("reagent_purchase_catalogue_primary")) { - purchaseCatalogue.setStatus(2); } else { purchaseCatalogue.setStatus(1); } purchaseCatalogue.setCommitTime(LocalDateTime.now()); - if (this.updateById(purchaseCatalogue)) { return purchaseCatalogue; } else return null; @@ -215,33 +162,24 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); - - catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogue.getPurchaseCatalogueId()); - - List list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); + List list = catalogueDetailsService.list(Wrappers.lambdaQuery() + .eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogue.getPurchaseCatalogueId())); //目录中的试剂耗材是否存在试剂耗材类中,有则不管,无则添加 for (CatalogueDetails catalogueDetails : list) { - ReagentConsumables one = reagentConsumablesService.getOne(Wrappers.query() + ReagentConsumables reagentConsumable = reagentConsumablesService.getOne(Wrappers.query() .eq("reagent_consumable_name", catalogueDetails.getReagentConsumableName()) .eq("brand", catalogueDetails.getBrand()) .eq("category", catalogueDetails.getCategory()) .eq("specification_and_model", catalogueDetails.getSpecificationAndModel()) + .eq("unit_price", catalogueDetails.getUnitPrice()) .eq(StrUtil.isNotBlank(catalogueDetails.getStandardValueOrPurity()), "standard_value_or_purity", catalogueDetails.getStandardValueOrPurity()) .eq(StrUtil.isNotBlank(catalogueDetails.getCasNumber()), "cas_number", catalogueDetails.getCasNumber()) .eq(StrUtil.isNotBlank(catalogueDetails.getSpecies()), "species", catalogueDetails.getSpecies()) @@ -251,17 +189,20 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl getList(String name, Integer category) { - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("status", 4); - QueryWrapper queryWrapper1 = queryWrapper.orderByDesc("update_time"); - List list = this.list(queryWrapper1); - - if (list.size() == 0) { - return null; - } - PurchaseCatalogue purchaseCatalogue = list.get(0); - - LambdaQueryWrapper catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); - - catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogue.getPurchaseCatalogueId()); - - if (StrUtil.isNotBlank(name)) { - - catalogueDetailsLambdaQueryWrapper.like(CatalogueDetails::getReagentConsumableName, name); - } - if (category != null) { - catalogueDetailsLambdaQueryWrapper.like(category == 1, CatalogueDetails::getCategory, "试剂"); - catalogueDetailsLambdaQueryWrapper.like(category == 2, CatalogueDetails::getCategory, "耗材"); - catalogueDetailsLambdaQueryWrapper.like(category == 3, CatalogueDetails::getCategory, "标准物质"); - } - List catalogueDetailsList = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); - + List list = this.list(Wrappers.lambdaQuery().eq(PurchaseCatalogue::getStatus, 4) + .orderByDesc(PurchaseCatalogue::getUpdateTime)); if (list == null & list.size() == 0) { throw new RuntimeException(String.format("未存在已发布的采购目录")); } + PurchaseCatalogue purchaseCatalogue = list.get(0); + List catalogueDetailsList = catalogueDetailsService.list(Wrappers.lambdaQuery() + .eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogue.getPurchaseCatalogueId()) + .like(StrUtil.isNotBlank(name), CatalogueDetails::getReagentConsumableName, name) + .eq(category != null && category == 1, CatalogueDetails::getCategory, "试剂") + .eq(category != null && category == 2, CatalogueDetails::getCategory, "耗材") + .eq(category != null && category == 3, CatalogueDetails::getCategory, "标准物质") + ); Collections.sort(catalogueDetailsList, new Comparator() { @Override public int compare(CatalogueDetails o1, CatalogueDetails o2) { @@ -326,11 +248,9 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl purchaseCatalogueDTOList) { - int i = 1; String message = ""; try { - for (PurchaseCatalogueDTO purchaseCatalogueDTO : purchaseCatalogueDTOList) { if (StrUtil.isNotBlank(purchaseCatalogueDTO.getBrand()) & @@ -351,29 +271,20 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl catalogueDetailsList = new ArrayList<>(); - for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) { - CatalogueDetails catalogueDetails = new CatalogueDetails(); - BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails); - catalogueDetailsList.add(catalogueDetails); } - purchaseCatalogueVO.setCatalogueDetailsListList(catalogueDetailsList); - return purchaseCatalogueVO; } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java index 4d4b34a..90411e8 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java @@ -178,7 +178,6 @@ public class PurchaseListServiceImpl extends ServiceImpl batchDetailsList = batchDetailsService.list(Wrappers.query().eq("reagent_consumable_inventory_id", reagentConsumableInventory.getReagentConsumableInventoryId()) .orderByDesc("create_time")); - warehousingContent.setWarningValue(reagentConsumableInventory.getWarningValue()); //如果存在批次信息,则提供上次位置信息,以便用户存放物品 if (batchDetailsList.size() != 0 && batchDetailsList != null) { warehousingContent.setLastStorageLocation(batchDetailsList.get(0).getLocation());//位置信息 diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java index 9aeafda..6efd4a3 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java @@ -123,18 +123,13 @@ public class PurchasingPlanServiceImpl extends ServiceImpl getReagentConsumableInventoryRMVOList(IPage page, Integer warning, String keywords) { Integer reagentCategory = 1; - if (warning != null && warning == 2) { - return this.getReagentConsumableInventoryWarningPage((Page) page, reagentCategory); - } +// if (warning != null && warning == 2) { +// return this.getReagentConsumableInventoryWarningPage((Page) page, reagentCategory); +// } IPage reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, warning, keywords, reagentCategory); return reagentConsumableInventoryVOPage; } @@ -122,36 +122,43 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl getReagentConsumableInventoryREVOList(IPage page, Integer warning, String keywords) { Integer reagentCategory = 0; - if (warning != null && warning == 2) { - return this.getReagentConsumableInventoryWarningPage((Page) page, reagentCategory); - } +// if (warning != null && warning == 2) { +// return this.getReagentConsumableInventoryWarningPage((Page) page, reagentCategory); +// } IPage reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, warning, keywords, reagentCategory); return reagentConsumableInventoryVOPage; } //查询即将到期的试剂耗材、标准物质:reagentCategory:0代表试剂耗材,1代表标准物质、标准储备溶液 public IPage getReagentConsumableInventoryWarningPage(Page page, Integer reagentCategory) { - List reagentConsumableInventoryVOList = new ArrayList<>(); - List list = batchDetailsService.list(Wrappers.query().eq("warning_information", "即将过期").or().eq("warning_information", "已过期").or().eq("warning_information", "即将到达存储期限").or().eq("warning_information", "已超过存储期限")); - //查找具有到期批次物品的试剂耗材\标准物质类信息 - if (list != null && list.size() != 0) { - for (BatchDetails batchDetails : list) { - ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); - if (reagentCategory == 0) { - reagentConsumableInventory = this.getOne(new LambdaQueryWrapper().eq(ReagentConsumableInventory::getReagentConsumableInventoryId, batchDetails.getReagentConsumableInventoryId()).ne(ReagentConsumableInventory::getCategory, "标准物质").ne(ReagentConsumableInventory::getCategory, "标准储备溶液")); - } else { - reagentConsumableInventory = this.getOne(new LambdaQueryWrapper().eq(ReagentConsumableInventory::getReagentConsumableInventoryId, batchDetails.getReagentConsumableInventoryId()).ne(ReagentConsumableInventory::getCategory, "试剂").ne(ReagentConsumableInventory::getCategory, "耗材")); - } - if (reagentConsumableInventory != null) { - ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO(); - BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryVO); - reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId())); - reagentConsumableInventoryVOList.add(reagentConsumableInventoryVO); - } - } + if (reagentCategory == 0) { + IPage reagentConsumableInventoryVOIPage = baseMapper.getRmListById(); + if (reagentConsumableInventoryVOIPage != null) { + return reagentConsumableInventoryVOIPage; + } else return null; + } else { + IPage reagentConsumableInventoryVOIPage = baseMapper.getRemListById(); + if (reagentConsumableInventoryVOIPage != null) { + return reagentConsumableInventoryVOIPage; + } else return null; } - PageUtils pageUtils = new PageUtils(); - return pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), reagentConsumableInventoryVOList); +// List reagentConsumableInventoryVOList = new ArrayList<>(); +// List list = batchDetailsService.list(Wrappers.query().eq("warning_information", "即将过期").or().eq("warning_information", "已过期").or().eq("warning_information", "即将到达存储期限").or().eq("warning_information", "已超过存储期限")); +// //查找具有到期批次物品的试剂耗材\标准物质类信息 +// if (list != null && list.size() != 0) { +// for (BatchDetails batchDetails : list) { +// ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); +// +//// if (reagentConsumableInventory != null) { +// ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO(); +// BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryVO); +// reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId())); +// reagentConsumableInventoryVOList.add(reagentConsumableInventoryVO); +// } +// } +// } +// PageUtils pageUtils = new PageUtils(); +// return pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), reagentConsumableInventoryVOList); } @Override//入库增加库存 @@ -196,7 +203,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl getStandardAllList(Page page, QueryWrapper qw, Integer status, String number) { + public IPage getStandardAllList(Page page, String reagentConsumableName, Integer referenceMaterialStatus) { // //如果扫码 // if (StrUtil.isNotBlank(number)) { // ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(Wrappers.query().eq("number", number)); @@ -210,7 +217,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl referenceMaterialPage = baseMapper.getReferenceMaterialPage(page, qw); + IPage referenceMaterialPage = baseMapper.getReferenceMaterialPage(page, referenceMaterialStatus, reagentConsumableName); return referenceMaterialPage; } @@ -224,10 +231,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl list = standardMaterialApplicationService.list(new LambdaQueryWrapper().eq(StandardMaterialApplication::getReferenceMaterialId, id).orderByDesc(StandardMaterialApplication::getDateOfClaim)); - R userR = remoteUserService.innerGetById(list.get(0).getRecipientId()); - reagentConsumableInventoryFullVO.setHolderName(userR.getData().getName()); - reagentConsumableInventoryFullVO.setHolderId(userR.getData().getUserId()); + if (list.size() > 0) { + R userR = remoteUserService.innerGetById(list.get(0).getRecipientId()); + reagentConsumableInventoryFullVO.setHolderName(userR.getData().getName()); + reagentConsumableInventoryFullVO.setHolderId(userR.getData().getUserId()); + } if (one1 != null) { reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration()); @@ -341,7 +349,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImplquery().eq("reagent_consumable_id", id)); - - if (byId != null & one != null) { - byId.setCode(code); - one.setCode(code); - - this.updateById(one); - reagentConsumablesService.updateById(byId); + ReagentConsumables reagentConsumables = reagentConsumablesService.getById(id); + if (reagentConsumables != null) { + reagentConsumables.setCode(code); + reagentConsumablesService.updateById(reagentConsumables); } - } @Override @@ -525,7 +525,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImplquery().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(reagentConsumableInventoryDTO.getPackagedCopies() != null, "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())); + ReagentConsumables oldReagentConsumables = reagentConsumablesService.getOne(Wrappers.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(reagentConsumableInventoryDTO.getPackagedCopies() != null, "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(); batchDetails.setServiceStatus(1); batchDetails.setQuantity(quantity); @@ -559,18 +559,18 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl batchDetailsList = batchDetailsService.list(Wrappers.query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId())); + if (oldReagentConsumables != null) { + ReagentConsumableInventory inventory = this.getOne(Wrappers.lambdaQuery().eq(ReagentConsumableInventory::getReagentConsumableId, oldReagentConsumables.getReagentConsumableId())); + List batchDetailsList = batchDetailsService.list(Wrappers.query().eq("reagent_consumable_inventory_id", inventory.getReagentConsumableInventoryId())); if (batchDetailsList != null & batchDetailsList.size() > 0) { int x = batchDetailsList.size() + 1; batchDetails.setBatch("2023-" + x); - one.setTotalQuantity(one.getTotalQuantity() + quantity); - this.updateById(one); + inventory.setTotalQuantity(inventory.getTotalQuantity() + quantity); + this.updateById(inventory); } - batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); - ReagentConsumables reagentConsumables = reagentConsumablesService.getById(one.getReagentConsumableId()); - if (!one.getCategory().equals("标准物质")) { - ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.query().eq("room_no", reagentConsumableInventoryDTO.getRoomNo()).eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId())); + batchDetails.setReagentConsumableInventoryId(inventory.getReagentConsumableInventoryId()); + if (!oldReagentConsumables.getCategory().equals("标准物质")) { + ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.query().eq("room_no", reagentConsumableInventoryDTO.getRoomNo()).eq("reagent_consumable_id", oldReagentConsumables.getReagentConsumableId())); if (reagentConsumableStash != null) { reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + quantity); batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId()); @@ -580,15 +580,15 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImplquery().eq("room_no", reagentConsumableInventoryDTO.getRoomNo()).eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId())); if (reagentConsumableStash != null) { reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + quantity); @@ -738,11 +740,15 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl locationInfoVOList = locationInfoService.getListById(id); HashMap objectObjectHashMap = new HashMap<>(); objectObjectHashMap.put("batchDetails", batchDetailsVO); - objectObjectHashMap.put("reagentConsumableInventory", reagentConsumableInventory); + objectObjectHashMap.put("reagentConsumableInventory", vo); objectObjectHashMap.put("locationInfoVOList", locationInfoVOList); return objectObjectHashMap; diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java index fe5347a..688b6c2 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java @@ -102,7 +102,6 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); - - reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableName, standardReserveSolution.getSolutionName()); - reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getConfigurationConcentration, standardReserveSolution.getConfigurationConcentration()); + ReagentConsumables reagentConsumables = reagentConsumablesService.getOne(Wrappers.lambdaQuery().eq(ReagentConsumables::getReagentConsumableName, standardReserveSolution.getSolutionName()).eq(ReagentConsumables::getConfigurationConcentration, standardReserveSolution.getConfigurationConcentration())); - ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); //判断是否存在过该标准储备溶液,若未存在,则将其存入试剂耗材类 - if (one == null) { - - ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId()); + if (reagentConsumables == null) { + ReferenceMaterial material = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId()); //创建一个标准储备溶液的种类对象 - ReagentConsumables reagentConsumables1 = reagentConsumablesService.getById(byId.getReagentConsumableId()); + ReagentConsumables reagentConsumablesByRem = reagentConsumablesService.getById(material.getReagentConsumableId()); - reagentConsumables1.setReagentConsumableId(IdWorker.get32UUID().toUpperCase()); - reagentConsumables1.setReagentConsumableName(standardReserveSolution.getSolutionName()); - reagentConsumables1.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration()); - reagentConsumables1.setCategory("标准储备溶液"); - reagentConsumables1.setCreateTime(LocalDateTime.now()); - reagentConsumables1.setUpdateTime(LocalDateTime.now()); + reagentConsumablesByRem.setReagentConsumableId(IdWorker.get32UUID().toUpperCase()); + reagentConsumablesByRem.setReagentConsumableName(standardReserveSolution.getSolutionName()); + reagentConsumablesByRem.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration()); + reagentConsumablesByRem.setCategory("标准储备溶液"); + reagentConsumablesByRem.setCreateTime(LocalDateTime.now()); + reagentConsumablesByRem.setUpdateTime(LocalDateTime.now()); - reagentConsumablesService.save(reagentConsumables1); + reagentConsumablesService.save(reagentConsumablesByRem); //创建标准储备溶液的库存对象 ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); - - BeanUtils.copyProperties(reagentConsumables1, reagentConsumableInventory); - + reagentConsumableInventory.setReagentConsumableId(reagentConsumablesByRem.getReagentConsumableId()); reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); - reagentConsumableInventory.setStatus(1); - - reagentConsumableInventory.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration()); reagentConsumableInventory.setCreateTime(LocalDateTime.now()); reagentConsumableInventory.setUpdateTime(LocalDateTime.now()); reagentConsumableInventory.setTotalQuantity(0); @@ -165,9 +153,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl list = referenceMaterialService.list(Wrappers.query() .likeRight("number", prefix) @@ -192,21 +178,15 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpllambdaQuery().eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumables.getReagentConsumableId())); ReferenceMaterial referenceMaterial = new ReferenceMaterial(); - LocalDate date = LocalDate.now(); // get the current date //获取当前年月日 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); @@ -235,16 +213,13 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl list = referenceMaterialService.list(Wrappers.query() .likeRight("number", prefix) @@ -338,6 +313,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl getWarehousingBatchListVOList(String warehousingContentId) { - - List warehousingBatchListVOList = baseMapper.getWarehousingBatchListVOList(warehousingContentId); - - ArrayList rvos = new ArrayList<>(); - - for (WarehousingBatchListVO warehousingBatchListVO : warehousingBatchListVOList) { - - if (warehousingBatchListVO.getBatchId() != null) { - - List batch_details_id = referenceMaterialService.list(Wrappers.query().eq("batch_details_id", warehousingBatchListVO.getBatchId()) - ); - - for (ReferenceMaterial referenceMaterial : batch_details_id) { - - if (reagentConsumablesService.getById(referenceMaterial.getReagentConsumableId()).getCategory().equals("标准物质")) { - - RVO rvo = new RVO(); - rvo.setId(referenceMaterial.getId()); - rvo.setNumber(referenceMaterial.getNumber()); - rvos.add(rvo); - } - } - } - warehousingBatchListVO.setIdList(rvos); - } + public List getWarehousingBatchListVOList(String warehousingRecordFormId,String keywords) { + + List warehousingBatchListVOList = baseMapper.getWarehousingBatchListVOList(warehousingRecordFormId, keywords); + +// ArrayList rvos = new ArrayList<>(); +// +// for (WarehousingBatchListVO warehousingBatchListVO : warehousingBatchListVOList) { +// +// if (warehousingBatchListVO.getBatchId() != null) { +// List batch_details_id = referenceMaterialService.list(Wrappers.query().eq("batch_details_id", warehousingBatchListVO.getBatchId())); +// for (ReferenceMaterial referenceMaterial : batch_details_id) { +// if (reagentConsumablesService.getById(referenceMaterial.getReagentConsumableId()).getCategory().equals("标准物质")) { +// RVO rvo = new RVO(); +// rvo.setId(referenceMaterial.getId()); +// rvo.setNumber(referenceMaterial.getNumber()); +// rvos.add(rvo); +// } +// } +// } +// warehousingBatchListVO.setIdList(rvos); +// } return warehousingBatchListVOList; } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingContentServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingContentServiceImpl.java index 06e26c6..2f005c2 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingContentServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingContentServiceImpl.java @@ -26,53 +26,18 @@ public class WarehousingContentServiceImpl extends ServiceImpl getWarehousingContentVOList(String warehousingRecordFormId) { - - List warehousingContentVOList = baseMapper.getWarehousingContentVOList(warehousingRecordFormId); - - for (WarehousingContentVO warehousingContentVO : warehousingContentVOList) { - - List warehousingBatchListVOList = warehousingBatchListService.getWarehousingBatchListVOList(warehousingContentVO.getId()); - - warehousingContentVO.setWarehousingBatchListVOList(warehousingBatchListVOList); - - ReagentConsumables byId = reagentConsumablesService.getById(warehousingContentVO.getReagentConsumableId()); - - warehousingContentVO.setCategory(byId.getCategory()); - warehousingContentVO.setBrand(byId.getBrand()); - warehousingContentVO.setSpecificationAndModel(byId.getSpecificationAndModel()); - warehousingContentVO.setStandardValueOrPurity(byId.getStandardValueOrPurity()); - warehousingContentVO.setDeviationOrUncertainty(byId.getDeviationOrUncertainty()); - warehousingContentVO.setUnitPrice(byId.getUnitPrice()); - if (warehousingContentVO.getWarningValue() == null) { - ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(Wrappers.query().eq("reagent_consumable_id", byId.getReagentConsumableId())); - if (one != null) { - warehousingContentVO.setWarningValue(one.getWarningValue());} - } - } + public List getWarehousingContentVOList(String warehousingRecordFormId, Integer oopCode, String keywords, String category) { + List warehousingContentVOList = baseMapper.getWarehousingContentVOList(warehousingRecordFormId, oopCode, keywords, category); return warehousingContentVOList; } +// public List getBatchList(String warehousingRecordFormId){ +// +// } @Override public IPage getWarehousingContentVOPage(Page page, QueryWrapper qw) { - - IPage warehousingContentVOPage = baseMapper.getWarehousingContentVOPage(page, qw); - - List records = warehousingContentVOPage.getRecords(); - - for (WarehousingContentVO record : records) { - - List warehousingBatchListVOList = warehousingBatchListService.getWarehousingBatchListVOList(record.getId()); - - record.setWarehousingBatchListVOList(warehousingBatchListVOList); - } - return warehousingContentVOPage; + return baseMapper.getWarehousingContentVOPage(page, qw); } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java index e5dd2ed..2c3361a 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java @@ -11,18 +11,19 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.reagent.dto.WarehousingRecordFormDTO; import digital.laboratory.platform.reagent.entity.*; +import digital.laboratory.platform.reagent.mapper.WarehousingBatchListMapper; +import digital.laboratory.platform.reagent.mapper.WarehousingContentMapper; 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; -import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; @@ -98,16 +99,36 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl warehousingContentVOList = warehousingContentMapper.getWarehousingContentVOList(warehousingRecordFormId, opCode, keywords, category); +// List warehousingBatchListVOList = warehousingBatchListMapper.getWarehousingBatchListVOList(warehousingRecordFormId, keywords); +// for (int i = 0; i < warehousingContentVOList.size(); i++) { +// if (i == 0) { +// warehousingContentVOList.get(i).setWarehousingBatchListVOList(warehousingBatchListVOList); +// } else { +// List warehousingBatchListVOS = new ArrayList<>(); +// warehousingContentVOList.get(i).setWarehousingBatchListVOList(warehousingBatchListVOS); +// } +// } + vo.setWarehousingContentVOList(warehousingContentVOList); + return vo; } + @Override + public List getBatchList(String warehousingRecordFormId, String keywords) { + return warehousingBatchListMapper.getWarehousingBatchListVOList(warehousingRecordFormId, keywords); + } @GlobalTransactional @Override//录入入库明细 @@ -144,21 +165,18 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl warehousingContent.getTotalQuantity()) { - throw new RuntimeException(String.format("入库数量不能大于采购数量")); - } warehousingBatchList.setBatch(warehousingBatchListService.list(Wrappers.query().eq("warehousing_content_id", warehousingBatchList.getWarehousingContentId())).size() + 1); - warehousingContent.setLastStorageLocation(warehousingRecordFormDTO.getLocation());//记录存放位置信息,以便下次签收同样物品时可以回显位置信息 warehousingContent.setBoxId(boxId);//柜子ID warehousingContent.setLatticeId(latticeId);//格子ID - warehousingContent.setWarehousingQuantity(warehousingContent.getWarehousingQuantity() + warehousingBatchList.getQuantity());//修改签收数量 - - if (warehousingRecordFormDTO.getCode() != null) {//如果填入物品编码,则记录,以便下次签收回显 + //判断采购数量与签收数量 + if (warehousingContent.getWarehousingQuantity() > warehousingContent.getTotalQuantity()) { + throw new RuntimeException(String.format("入库数量不能大于采购数量")); + } + if (StrUtil.isNotBlank(warehousingRecordFormDTO.getCode())) {//如果填入物品编码,则记录,以便下次签收回显 warehousingContent.setCode(warehousingRecordFormDTO.getCode()); } @@ -171,13 +189,12 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl getWarehousingRecordFormVOPage(Page page, QueryWrapper qw) { IPage warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page, qw);//查询签收单列表 diff --git a/src/main/java/digital/laboratory/platform/reagent/task/MaturityCalculation.java b/src/main/java/digital/laboratory/platform/reagent/task/MaturityCalculation.java index e3a7358..31d680c 100644 --- a/src/main/java/digital/laboratory/platform/reagent/task/MaturityCalculation.java +++ b/src/main/java/digital/laboratory/platform/reagent/task/MaturityCalculation.java @@ -1,11 +1,14 @@ package digital.laboratory.platform.reagent.task; +import cn.hutool.core.date.LocalDateTimeUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import digital.laboratory.platform.reagent.entity.BatchDetails; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.StandardReserveSolution; +import digital.laboratory.platform.reagent.mapper.ReagentConsumableInventoryMapper; import digital.laboratory.platform.reagent.service.*; +import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; @@ -15,6 +18,7 @@ import org.springframework.stereotype.Component; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.List; @Configuration @@ -32,9 +36,11 @@ public class MaturityCalculation { private final ReferenceMaterialService referenceMaterialService; + private final ReagentConsumableInventoryMapper reagentConsumableInventoryMapper; @Scheduled(cron = "1 0 0 * * ? ") public void calculate() { + System.out.println("~~~~~~~~~~~~~~执行检测系统有效期情况~~~~~~~~~~~~~~"); //查找出有库存量的物品所有批次信息(状态为1) List list1 = batchDetailsService.list(Wrappers.query().eq("service_status", 1)); String warningInformation = null; @@ -56,13 +62,9 @@ public class MaturityCalculation { .eq("status", 1)); for (StandardReserveSolution standardReserveSolution : list) { - ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId()); - standardReserveSolutionService.updateById(standardReserveSolution); - } - periodVerificationPlanService.getPlan(); System.out.println("期间核查计划自动更新"); } @@ -70,46 +72,39 @@ public class MaturityCalculation { @Scheduled(cron = "0 0/1 * * * ? ") public void inventoryReminder() { - + System.out.println("~~~~~~~~~~~~~~执行检测系统库存情况~~~~~~~~~~~~~~"+ LocalDateTimeUtil.format(LocalDateTime.now(),"yyyy-MM-dd HH:mm:ss")); List list2 = standardReserveSolutionService.list(Wrappers.query() .eq("status", 1)); for (StandardReserveSolution standardReserveSolution : list2) { - ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId()); if (referenceMaterialServiceById.getStatus() == -4) { - standardReserveSolution.setWarningInformation("已全部使用完毕或已报废"); } - } - - List list = reagentConsumableInventoryService.list(Wrappers.query().ne("category", "标准储备溶液")); + List item = new ArrayList<>(); + item.add("试剂"); + item.add("耗材"); + item.add("标准物质"); + List list = reagentConsumableInventoryMapper.getRciListByCategory(item); for (ReagentConsumableInventory reagentConsumableInventory : list) { - if (reagentConsumableInventory.getTotalQuantity() == 0) { - reagentConsumableInventory.setWarningInformation("暂无库存"); } - if (reagentConsumableInventory.getTotalQuantity() <= reagentConsumableInventory.getWarningValue()) { - reagentConsumableInventory.setWarningInformation("库存不足"); - } else { reagentConsumableInventory.setWarningInformation("库存充足"); } reagentConsumableInventoryService.updateById(reagentConsumableInventory); } - - List list1 = reagentConsumableInventoryService.list(Wrappers.query().eq("category", "标准储备溶液")); - - for (ReagentConsumableInventory reagentConsumableInventory : list1) { - - reagentConsumableInventory.setWarningInformation("无"); - - reagentConsumableInventoryService.updateById(reagentConsumableInventory); - } +// List item1 = new ArrayList<>(); +// item1.add("标准储备溶液"); +// List list1 = reagentConsumableInventoryMapper.getRciListByCategory(item1); +// for (ReagentConsumableInventory reagentConsumableInventory : list1) { +// reagentConsumableInventory.setWarningInformation("无"); +// reagentConsumableInventoryService.updateById(reagentConsumableInventory); +// } } } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/RVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/RVO.java deleted file mode 100644 index dfa62cf..0000000 --- a/src/main/java/digital/laboratory/platform/reagent/vo/RVO.java +++ /dev/null @@ -1,9 +0,0 @@ -package digital.laboratory.platform.reagent.vo; - -import lombok.Data; - -@Data -public class RVO { - private String id; - private String number; -} diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java index 420aaa2..9bfc314 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java @@ -1,5 +1,7 @@ package digital.laboratory.platform.reagent.vo; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -90,5 +92,102 @@ public class ReagentConsumableInventoryFullVO extends ReagentConsumableInventory private String holderId; + @ApiModelProperty(value="纯度等级") + private String purityGrade; + /** + * 品牌 + */ + @ApiModelProperty(value="品牌") + private String brand; + + @ApiModelProperty(value = "CAS-号") + private String casNumber; + + @ApiModelProperty(value = "物品编码") + private String code; + /** + * 类别 + */ + @ApiModelProperty(value="类别") + private String category; + + /** + * 偏差/不确定度 + */ + @ApiModelProperty(value="偏差/不确定度") + private String deviationOrUncertainty; + + /** + * 名称 + */ + @ApiModelProperty(value="名称") + private String reagentConsumableName; + + /** + * 种类 + */ + @ApiModelProperty(value="种类") + private String species; + + /** + * 英文名 + */ + @ApiModelProperty(value="英文名") + private String englishName; + + /** + * 规格型号 + */ + @ApiModelProperty(value="规格型号") + private String specificationAndModel; + /** + * 包装份数 + */ + @ApiModelProperty(value="包装份数") + private Integer packagedCopies; + /** + * (标准值/纯度) + */ + @ApiModelProperty(value="(标准值/纯度)") + private String standardValueOrPurity; + + /** + * (技术参数) + */ + @ApiModelProperty(value="(技术参数)") + private String technicalParameter; + + /** + * 单价 + */ + @ApiModelProperty(value="单价") + private Double unitPrice; + + /** + * 别名 + */ + @ApiModelProperty(value="别名") + private String alias; + + /** + * 存储条件 + */ + @ApiModelProperty(value="存储条件") + private String storageCondition; + + /** + * 备注 + */ + @ApiModelProperty(value="备注") + private String remark; + /** + * 包装单位 + */ + @ApiModelProperty(value="包装单位") + private String minimumUnit; + + @ApiModelProperty(value = "存储期限") + private Integer storageLife; + } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryVO.java index 6d5eda3..907fdc3 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryVO.java @@ -1,5 +1,7 @@ package digital.laboratory.platform.reagent.vo; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -24,6 +26,108 @@ public class ReagentConsumableInventoryVO extends ReagentConsumableInventory { @ApiModelProperty(value="房间号") private String roomNo; + @ApiModelProperty(value="纯度等级") + private String purityGrade; + /** + * 品牌 + */ + @ApiModelProperty(value="品牌") + private String brand; + + @ApiModelProperty(value = "CAS-号") + private String casNumber; + + @ApiModelProperty(value = "物品编码") + private String code; + /** + * 类别 + */ + @ApiModelProperty(value="类别") + private String category; + + /** + * 偏差/不确定度 + */ + @ApiModelProperty(value="偏差/不确定度") + private String deviationOrUncertainty; + + /** + * 名称 + */ + @ApiModelProperty(value="名称") + private String reagentConsumableName; + + /** + * 种类 + */ + @ApiModelProperty(value="种类") + private String species; + + /** + * 英文名 + */ + @ApiModelProperty(value="英文名") + private String englishName; + + /** + * 规格型号 + */ + @ApiModelProperty(value="规格型号") + private String specificationAndModel; + /** + * 包装份数 + */ + @ApiModelProperty(value="包装份数") + private Integer packagedCopies; + /** + * (标准值/纯度) + */ + @ApiModelProperty(value="(标准值/纯度)") + private String standardValueOrPurity; + + /** + * (技术参数) + */ + @ApiModelProperty(value="(技术参数)") + private String technicalParameter; + + /** + * 单价 + */ + @ApiModelProperty(value="单价") + private Double unitPrice; + + /** + * 别名 + */ + @ApiModelProperty(value="别名") + private String alias; + + /** + * 存储条件 + */ + @ApiModelProperty(value="存储条件") + private String storageCondition; + + /** + * 备注 + */ + @ApiModelProperty(value="备注") + private String remark; + /** + * 包装单位 + */ + @ApiModelProperty(value="包装单位") + private String minimumUnit; + /** + * 溶液浓度 + */ + @ApiModelProperty(value="溶液浓度") + private double configurationConcentration; + + @ApiModelProperty(value = "存储期限") + private Integer storageLife; + diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingBatchListVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingBatchListVO.java index c02da9d..81dc6f3 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingBatchListVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingBatchListVO.java @@ -1,6 +1,7 @@ package digital.laboratory.platform.reagent.vo; +import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.WarehousingBatchList; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -10,9 +11,13 @@ import java.util.List; @Data public class WarehousingBatchListVO extends WarehousingBatchList { - @ApiModelProperty(value="入库人名称") + @ApiModelProperty(value = "入库人名称") private String depositorName; - - private List idList; + private List idList; + private String reagentConsumableName; + private String reagentConsumableId; + private String standardValueOrPurity; + private String specificationAndModel; + private String category; } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingContentVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingContentVO.java index 18d087d..e86b5bc 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingContentVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingContentVO.java @@ -28,17 +28,17 @@ public class WarehousingContentVO extends WarehousingContent { @ApiModelProperty(value = "(规格型号)") private String specificationAndModel; - @ApiModelProperty(value="(标准值/纯度)") + @ApiModelProperty(value = "(标准值/纯度)") private String standardValueOrPurity; - @ApiModelProperty(value="单价") + @ApiModelProperty(value = "单价") private Double unitPrice; - @ApiModelProperty(value="偏差/不确定度") + @ApiModelProperty(value = "偏差/不确定度") private String deviationOrUncertainty; - - + @ApiModelProperty(value = "预警值") + private Integer warningValue; } diff --git a/src/main/resources/mapper/ReagentConsumableInventoryMapper.xml b/src/main/resources/mapper/ReagentConsumableInventoryMapper.xml index aef6009..353d2ca 100644 --- a/src/main/resources/mapper/ReagentConsumableInventoryMapper.xml +++ b/src/main/resources/mapper/ReagentConsumableInventoryMapper.xml @@ -7,47 +7,31 @@ - - - - + - - - - - - - - - - - - - - - - - - + - + select b.*, (select s.supplier_name from supplier_information s where s.id = b.supplier_id) as supplier_name + from batch_details b + where b.quantity != 0 and b.reagent_consumable_inventory_id = #{reagent_consumable_inventory_id} + order by b.batch asc @@ -92,34 +76,42 @@ resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO"> SELECT bd.*, r1.*, - (SELECT s1.supplier_name FROM supplier_information s1 WHERE s1.id = bd.supplier_id) as supplier_name - FROM batch_details bd, - reagent_consumable_inventory r1 - WHERE bd.reagent_consumable_inventory_id = r1.reagent_consumable_inventory_id + s1.supplier_name, + rm.* + FROM batch_details bd + LEFT JOIN reagent_consumable_inventory r1 ON bd.reagent_consumable_inventory_id = + r1.reagent_consumable_inventory_id + LEFT JOIN reagent_consumables rm ON rm.reagent_consumable_id = r1.reagent_consumable_id + LEFT JOIN supplier_information s1 ON s1.id = bd.supplier_id; - AND r1.`reagent_consumable_name` = #{name} + AND rm.`reagent_consumable_name` = #{name} - AND r1.`category` = #{category} + AND rm.`category` = #{category} @@ -138,136 +130,141 @@ - - - - - - - - - - + + + + + + + + diff --git a/src/main/resources/mapper/WarehousingBatchListMapper.xml b/src/main/resources/mapper/WarehousingBatchListMapper.xml index 315a976..d078437 100644 --- a/src/main/resources/mapper/WarehousingBatchListMapper.xml +++ b/src/main/resources/mapper/WarehousingBatchListMapper.xml @@ -32,13 +32,44 @@ + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/WarehousingContentMapper.xml b/src/main/resources/mapper/WarehousingContentMapper.xml index 1fe3db2..0dfc84f 100644 --- a/src/main/resources/mapper/WarehousingContentMapper.xml +++ b/src/main/resources/mapper/WarehousingContentMapper.xml @@ -29,32 +29,144 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + select rm.id, rm.number, rm.reagent_consumable_name + from reference_material rm + where rm.batch_details_id = #{batch_id} + order by number asc + + + + + + - SELECT wc.*, (select si.supplier_name from supplier_information si where si.id = wc.supplier_id) as supplier_name, - (select user.name from dlp_base.sys_user user where user.user_id=wc.update_by ) as applicant_name, - (select rc.category from reagent_consumables rc where rc.reagent_consumable_id = wc.reagent_consumable_id) AS category, - (select rc.specification_and_model from reagent_consumables rc where rc.reagent_consumable_id = wc.reagent_consumable_id) AS specification_and_model, - (select rc.brand from reagent_consumables rc where rc.reagent_consumable_id = wc.reagent_consumable_id) AS brand, - (select rc.standard_value_or_purity from reagent_consumables rc where rc.reagent_consumable_id = wc.reagent_consumable_id) AS standard_value_or_purity + (select user.name from dlp_base.sys_user user + where user.user_id=wc.update_by ) as applicant_name + , ( + select rc.category + from reagent_consumables rc + where rc.reagent_consumable_id = wc.reagent_consumable_id) AS category + , ( + select rc.specification_and_model + from reagent_consumables rc + where rc.reagent_consumable_id = wc.reagent_consumable_id) AS specification_and_model + , ( + select rc.brand + from reagent_consumables rc + where rc.reagent_consumable_id = wc.reagent_consumable_id) AS brand + , ( + select rc.standard_value_or_purity + from reagent_consumables rc + where rc.reagent_consumable_id = wc.reagent_consumable_id) AS standard_value_or_purity FROM warehousing_content wc ${ew.customSqlSegment}