增加了入库时的查询

main
杨海航 9 months ago
parent eea58efd8b
commit cf82b9a110
  1. 14
      src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java
  2. 12
      src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
  3. 16
      src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java
  4. 33
      src/main/java/digital/laboratory/platform/reagent/dto/CentralizedRequestDTO.java
  5. 3
      src/main/java/digital/laboratory/platform/reagent/dto/PurchaseCatalogueDTO.java
  6. 5
      src/main/java/digital/laboratory/platform/reagent/dto/ReagentConsumableInventoryDTO.java
  7. 2
      src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java
  8. 111
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java
  9. 2
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java
  10. 3
      src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java
  11. 13
      src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java
  12. 6
      src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingBatchListMapper.java
  13. 6
      src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingContentMapper.java
  14. 4
      src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java
  15. 2
      src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
  16. 2
      src/main/java/digital/laboratory/platform/reagent/service/WarehousingBatchListService.java
  17. 2
      src/main/java/digital/laboratory/platform/reagent/service/WarehousingContentService.java
  18. 6
      src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java
  19. 7
      src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java
  20. 152
      src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java
  21. 18
      src/main/java/digital/laboratory/platform/reagent/service/impl/DeliveryRegistrationFormServiceImpl.java
  22. 54
      src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java
  23. 171
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java
  24. 1
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java
  25. 6
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java
  26. 140
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java
  27. 68
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java
  28. 48
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingBatchListServiceImpl.java
  29. 47
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingContentServiceImpl.java
  30. 64
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java
  31. 43
      src/main/java/digital/laboratory/platform/reagent/task/MaturityCalculation.java
  32. 9
      src/main/java/digital/laboratory/platform/reagent/vo/RVO.java
  33. 99
      src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java
  34. 104
      src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryVO.java
  35. 11
      src/main/java/digital/laboratory/platform/reagent/vo/WarehousingBatchListVO.java
  36. 10
      src/main/java/digital/laboratory/platform/reagent/vo/WarehousingContentVO.java
  37. 275
      src/main/resources/mapper/ReagentConsumableInventoryMapper.xml
  38. 39
      src/main/resources/mapper/WarehousingBatchListMapper.xml
  39. 138
      src/main/resources/mapper/WarehousingContentMapper.xml

@ -309,8 +309,8 @@ public class CentralizedRequestController {
@ApiOperation(value = "标准物质采购申请表打印", notes = "标准物质采购申请表打印") @ApiOperation(value = "标准物质采购申请表打印", notes = "标准物质采购申请表打印")
@SysLog("标准物质采购申请表打印") @SysLog("标准物质采购申请表打印")
@PostMapping("/print") @PostMapping("/print")
@PreAuthorize("@pms.hasPermission('purchase_request_print')") @PreAuthorize("@pms.hasPermission('purchase_request_print')")
public void bizGetPDFInventory(String id, String type,HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { public void bizGetPDFInventory(String id, String type, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord................."); System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@ -325,7 +325,7 @@ public class CentralizedRequestController {
String pdfFilePath = "document" + "/" + "purchaseRequest" + "/" + id + "/" + applyFileName + ".pdf"; String pdfFilePath = "document" + "/" + "purchaseRequest" + "/" + id + "/" + applyFileName + ".pdf";
try { try {
//直接调用pdf方法 //直接调用pdf方法
centralizedRequestService.purchaseRequestTablePDF(voList,id,type, theHttpServletRequest, httpServletResponse); centralizedRequestService.purchaseRequestTablePDF(voList, id, type, theHttpServletRequest, httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream()); ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName); httpServletResponse.setContentType(applyFileName);
} catch (Exception e) { } catch (Exception e) {
@ -333,6 +333,14 @@ public class CentralizedRequestController {
e.printStackTrace(); e.printStackTrace();
} }
} }
@PostMapping("/lead")
public R leadPurchase(@RequestBody List<CentralizedRequestDTO> requestDTOS, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
CentralizedRequest centralizedRequest = centralizedRequestService.leadPurchase(requestDTOS, dlpUser);
return R.ok(centralizedRequest);
}
} }

@ -85,17 +85,7 @@ public class ReagentConsumableInventoryController {
@GetMapping("/RList") @GetMapping("/RList")
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')") // @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
public R<IPage<ReferenceMaterialFullVO>> getReagentConsumableInventoryPage(Page page, String reagentConsumableName, Integer referenceMaterialStatus) { public R<IPage<ReferenceMaterialFullVO>> getReagentConsumableInventoryPage(Page page, String reagentConsumableName, Integer referenceMaterialStatus) {
QueryWrapper<ReferenceMaterial> referenceMaterialQueryWrapper = new QueryWrapper<>(); IPage<ReferenceMaterialFullVO> allList = reagentConsumableInventoryService.getStandardAllList(page, reagentConsumableName, referenceMaterialStatus);
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<ReferenceMaterialFullVO> allList = reagentConsumableInventoryService.getStandardAllList(page, referenceMaterialQueryWrapper, referenceMaterialStatus, number);
return R.ok(allList); return R.ok(allList);
} }

@ -64,13 +64,11 @@ public class WarehousingRecordFormController {
* @param warehousingRecordFormId id * @param warehousingRecordFormId id
* @return R * @return R
*/ */
@ApiOperation(value = "通过id查询入库信息", notes = "通过id查询入库信息") @ApiOperation(value = "通过id查询入库信息", notes = "参数:warehousingRecordFormId:入库ID" + "\n" + "opCode:(null:查询所有,1:查询未签收完成,-1:查询已签收完成)" + "\n" + " keywords:试剂耗材名称查询参数" + "\n" + "category:试剂耗材类别查询参数")
@GetMapping() @GetMapping()
@PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_get')") @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_get')")
public R<WarehousingRecordFormVO> getById(String warehousingRecordFormId, HttpServletRequest theHttpServletRequest) { public R<WarehousingRecordFormVO> getById(String warehousingRecordFormId, Integer opCode, String keywords, String category) {
WarehousingRecordFormVO warehousingRecordFormVO = warehousingRecordFormService.getWarehousingRecordFormVO(warehousingRecordFormId, opCode, keywords, category);
WarehousingRecordFormVO warehousingRecordFormVO = warehousingRecordFormService.getWarehousingRecordFormVO(warehousingRecordFormId);
return R.ok(warehousingRecordFormVO); return R.ok(warehousingRecordFormVO);
} }
@ -110,7 +108,6 @@ public class WarehousingRecordFormController {
.le(endTime != null, "create_time", endTime) .le(endTime != null, "create_time", endTime)
.eq("status", 1) .eq("status", 1)
.orderByDesc("create_time")); .orderByDesc("create_time"));
return R.ok(warehousingContentVOPage); return R.ok(warehousingContentVOPage);
} }
@ -131,4 +128,11 @@ public class WarehousingRecordFormController {
warehousingRecordFormService.addFormById(warehousingRecordFormDTO, dlpUser); warehousingRecordFormService.addFormById(warehousingRecordFormDTO, dlpUser);
return R.ok("签收成功"); return R.ok("签收成功");
} }
@ApiOperation(value = "查询入库单中已签收的物品信息", notes = "查询入库单中已签收的物品信息")
@GetMapping("/batch/list")
public R getBatchList(String warehousingRecordFormId, String keywords) {
return R.ok(warehousingRecordFormService.getBatchList(warehousingRecordFormId, keywords), "数据查询成功!");
}
} }

@ -14,25 +14,30 @@ import lombok.NoArgsConstructor;
public class CentralizedRequestDTO { public class CentralizedRequestDTO {
@ApiModelProperty(value="集中采购申请ID") @ApiModelProperty(value = "集中采购申请ID")
private String centralizedRequestId; private String centralizedRequestId;
@ApiModelProperty(value="采购目录编号") @ApiModelProperty(value = "采购目录编号")
private String purchaseCatalogueNumber; private String purchaseCatalogueNumber;
@ApiModelProperty(value="申请数量") @ApiModelProperty(value = "申请数量")
private Integer numberOfApplications; private Integer numberOfApplications;
@ApiModelProperty(value="试剂耗材ID") @ApiModelProperty(value = "试剂耗材ID")
private String reagentConsumableId; private String reagentConsumableId;
@ApiModelProperty(value="备注") @ApiModelProperty(value = "备注")
private String remarks; private String remarks;
@ApiModelProperty(value="集中采购申请明细Id") @ApiModelProperty(value = "集中采购申请明细Id")
private String detailsOfCentralizedId; private String detailsOfCentralizedId;
@ApiModelProperty(value="用途/购买理由") @ApiModelProperty(value = "用途/购买理由")
private String purpose; private String purpose;
private String specificationAndModel;
private String reagentConsumableName;
private Double unitPrice;
} }

@ -15,7 +15,6 @@ public class PurchaseCatalogueDTO {
@ApiModelProperty(value="纯度等级") @ApiModelProperty(value="纯度等级")
private String purityGrade; private String purityGrade;
/** /**
* (品牌) * (品牌)
*/ */
@ -75,7 +74,7 @@ public class PurchaseCatalogueDTO {
@ApiModelProperty(value = "CAS 号") @ApiModelProperty(value = "CAS 号")
private String casNumber; private String casNumber;
@ApiModelProperty(value = "CAS 号") @ApiModelProperty(value = "编码")
private String code; private String code;

@ -2,13 +2,14 @@ package digital.laboratory.platform.reagent.dto;
import com.amazonaws.services.s3.S3ResourceType; import com.amazonaws.services.s3.S3ResourceType;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.time.LocalDate; import java.time.LocalDate;
@Data @Data
public class ReagentConsumableInventoryDTO extends ReagentConsumableInventory { public class ReagentConsumableInventoryDTO extends ReagentConsumables {
@ApiModelProperty(value = "(位置信息)") @ApiModelProperty(value = "(位置信息)")
@ -38,4 +39,6 @@ public class ReagentConsumableInventoryDTO extends ReagentConsumableInventory {
@ApiModelProperty(value = "(规格)") @ApiModelProperty(value = "(规格)")
private String packages; private String packages;
private Integer totalQuantity;
} }

@ -25,8 +25,6 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "(采购目录明细)") @ApiModel(value = "(采购目录明细)")
public class CatalogueDetails extends BaseEntity { public class CatalogueDetails extends BaseEntity {
/** /**
* 纯度等级 * 纯度等级
*/ */

@ -26,37 +26,6 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "试剂耗材库存") @ApiModel(value = "试剂耗材库存")
public class ReagentConsumableInventory extends BaseEntity { 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) * (指导书ID)
@ -70,93 +39,26 @@ public class ReagentConsumableInventory extends BaseEntity {
@ApiModelProperty(value = "(试剂耗材Id)") @ApiModelProperty(value = "(试剂耗材Id)")
private String reagentConsumableId; 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 = "(总数量)") @ApiModelProperty(value = "(总数量)")
private Integer totalQuantity; private Integer totalQuantity;
/**
* (包装份数)
*/
@ApiModelProperty(value = "(包装份数)")
private Integer packagedCopies;
/** /**
* reagentConsumableInventoryId * reagentConsumableInventoryId
*/ */
@TableId(value = "reagent_consumable_inventory_id", type = IdType.ASSIGN_UUID) @TableId(value = "reagent_consumable_inventory_id", type = IdType.ASSIGN_UUID)
@ApiModelProperty(value = "reagentConsumableInventoryId") @ApiModelProperty(value = "reagentConsumableInventoryId")
private String reagentConsumableInventoryId; private String reagentConsumableInventoryId;
/**
* 单价
*/
@ApiModelProperty(value = "单价")
private Double unitPrice;
/**
* 别名
*/
@ApiModelProperty(value = "别名")
private String alias;
/**
* 存储条件
*/
@ApiModelProperty(value = "存储条件")
private String storageCondition;
/** /**
* 备注 * 备注
*/ */
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; 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 = "状态") @ApiModelProperty(value = "状态")
@ -165,10 +67,13 @@ public class ReagentConsumableInventory extends BaseEntity {
/** /**
* (预警值) * (预警值)
*/ */
@ApiModelProperty(value="(预警值)") @ApiModelProperty(value = "(预警值)")
private Integer warningValue; private Integer warningValue;
@ApiModelProperty(value="(预警信息)") /**
private String warningInformation; * (预警信息)
*/
@ApiModelProperty(value = "(预警信息)")
private String warningInformation;
} }

@ -130,5 +130,7 @@ public class ReagentConsumables extends BaseEntity {
@ApiModelProperty(value="reagentConsumableId") @ApiModelProperty(value="reagentConsumableId")
private String reagentConsumableId; private String reagentConsumableId;
@ApiModelProperty(value = "存储期限")
private Integer storageLife;
} }

@ -81,9 +81,6 @@ public class WarehousingContent extends BaseEntity {
@ApiModelProperty(value = "采购清单明细ID") @ApiModelProperty(value = "采购清单明细ID")
private String purchaseListDetailsId; private String purchaseListDetailsId;
@ApiModelProperty(value = "预警值")
private Integer warningValue;
@ApiModelProperty(value = "上次存放位置") @ApiModelProperty(value = "上次存放位置")
private String lastStorageLocation; private String lastStorageLocation;

@ -22,7 +22,7 @@ import java.util.List;
@Mapper @Mapper
public interface ReagentConsumableInventoryMapper extends BaseMapper<ReagentConsumableInventory> { public interface ReagentConsumableInventoryMapper extends BaseMapper<ReagentConsumableInventory> {
IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryVOPage(IPage<ReagentConsumableInventory> page, @Param("warning") Integer warning,@Param("keywords") String keywords,@Param("reagentCategory") Integer reagentCategory); IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryVOPage(IPage<ReagentConsumableInventory> page, @Param("warning") Integer warning, @Param("keywords") String keywords, @Param("reagentCategory") Integer reagentCategory);
IPage<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFullVOPage(IPage<ReagentConsumableInventory> page, @Param(Constants.WRAPPER) QueryWrapper<ReagentConsumableInventory> qw); IPage<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFullVOPage(IPage<ReagentConsumableInventory> page, @Param(Constants.WRAPPER) QueryWrapper<ReagentConsumableInventory> qw);
@ -33,11 +33,20 @@ public interface ReagentConsumableInventoryMapper extends BaseMapper<ReagentCons
List<OrgVO> getOrgList(); List<OrgVO> getOrgList();
IPage<ReferenceMaterialFullVO> getReferenceMaterialPage(IPage<ReagentConsumableInventory> page, @Param(Constants.WRAPPER) QueryWrapper<ReferenceMaterial> qw); IPage<ReferenceMaterialFullVO> getReferenceMaterialPage(IPage<ReagentConsumableInventory> page, @Param("status") Integer status, @Param("reagentConsumableName") String reagentConsumableName);
IPage<ReagentConsumableInventoryFullVO> getReagentConsumablePage(IPage<ReagentConsumableInventory> page, @Param("name") String name); IPage<ReagentConsumableInventoryFullVO> getReagentConsumablePage(IPage<ReagentConsumableInventory> page, @Param("name") String name);
List<ReagentConsumableInventoryFullVO> getReagentConsumableList(); List<ReagentConsumableInventoryFullVO> getReagentConsumableList();
List<ReagentConsumableInventoryVO> getRciListByCategory(List<String> list);
IPage<ReagentConsumableInventoryVO> getRemListById();//标准物质
IPage<ReagentConsumableInventoryVO> getRmListById();//试剂耗材
String getCellName(String id); String getCellName(String id);
ReagentConsumableInventoryVO getRciById(@Param("reagentConsumableInventoryId") String reagentConsumableInventoryId, @Param("reagentConsumableId") String reagentConsumableId);
} }

@ -1,9 +1,13 @@
package digital.laboratory.platform.reagent.mapper; 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.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import digital.laboratory.platform.reagent.entity.WarehousingBatchList; import digital.laboratory.platform.reagent.entity.WarehousingBatchList;
import digital.laboratory.platform.reagent.vo.WarehousingBatchListVO; import digital.laboratory.platform.reagent.vo.WarehousingBatchListVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -16,6 +20,6 @@ import java.util.List;
@Mapper @Mapper
public interface WarehousingBatchListMapper extends BaseMapper<WarehousingBatchList> { public interface WarehousingBatchListMapper extends BaseMapper<WarehousingBatchList> {
List<WarehousingBatchListVO> getWarehousingBatchListVOList(String warehousingContentId); List<WarehousingBatchListVO> getWarehousingBatchListVOList(@Param(value = "warehousingRecordFormId") String warehousingRecordFormId, @Param(value = "keywords") String keywords);
} }

@ -9,6 +9,7 @@ import digital.laboratory.platform.reagent.entity.WarehousingContent;
import digital.laboratory.platform.reagent.vo.WarehousingContentVO; import digital.laboratory.platform.reagent.vo.WarehousingContentVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;
import org.yaml.snakeyaml.scanner.Constant; import org.yaml.snakeyaml.scanner.Constant;
import java.util.List; import java.util.List;
@ -16,6 +17,7 @@ import java.util.List;
@Mapper @Mapper
public interface WarehousingContentMapper extends BaseMapper<WarehousingContent> { public interface WarehousingContentMapper extends BaseMapper<WarehousingContent> {
List<WarehousingContentVO> getWarehousingContentVOList(String signingRecordFormId); List<WarehousingContentVO> getWarehousingContentVOList(@Param(value = "warehousingRecordFormId") String warehousingRecordFormId, @Param(value = "opCode") Integer opCode, @Param(value = "keywords") String keywords, @Param(value = "category") String category);
IPage<WarehousingContentVO> getWarehousingContentVOPage(Page page, @Param(Constants.WRAPPER)QueryWrapper<WarehousingContent> qw);
IPage<WarehousingContentVO> getWarehousingContentVOPage(Page page, @Param(Constants.WRAPPER) QueryWrapper<WarehousingContent> qw);
} }

@ -24,7 +24,9 @@ import java.util.List;
public interface CentralizedRequestService extends IService<CentralizedRequest> { public interface CentralizedRequestService extends IService<CentralizedRequest> {
CentralizedRequest addRequest(List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser); CentralizedRequest addRequest(List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser);
CentralizedRequest commitRequest(String id,DLPUser dlpUser); CentralizedRequest leadPurchase(List<CentralizedRequestDTO> requestDTOS, DLPUser dlpUser);
CentralizedRequest commitRequest(String id, DLPUser dlpUser);
DetailsOfCentralized editDetailsById(CentralizedRequestDTO centralizedRequestDto); DetailsOfCentralized editDetailsById(CentralizedRequestDTO centralizedRequestDto);

@ -33,7 +33,7 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
ReagentConsumableInventory reduceById(String reagentConsumableId, Integer quantity); ReagentConsumableInventory reduceById(String reagentConsumableId, Integer quantity);
IPage<ReferenceMaterialFullVO> getStandardAllList(Page page, QueryWrapper<ReferenceMaterial> qw, Integer status, String number); IPage<ReferenceMaterialFullVO> getStandardAllList(Page page, String reagentConsumableName, Integer referenceMaterialStatus);
ReagentConsumableInventoryFullVO getByCode(String id); ReagentConsumableInventoryFullVO getByCode(String id);

@ -14,7 +14,7 @@ import java.util.List;
*/ */
public interface WarehousingBatchListService extends IService<WarehousingBatchList> { public interface WarehousingBatchListService extends IService<WarehousingBatchList> {
List<WarehousingBatchListVO> getWarehousingBatchListVOList(String warehousingContentId); List<WarehousingBatchListVO> getWarehousingBatchListVOList(String warehousingContentId,String keywords);
} }

@ -12,7 +12,7 @@ import java.util.List;
public interface WarehousingContentService extends IService<WarehousingContent> { public interface WarehousingContentService extends IService<WarehousingContent> {
List<WarehousingContentVO> getWarehousingContentVOList(String warehousingRecordFormId); List<WarehousingContentVO> getWarehousingContentVOList(String warehousingRecordFormId, Integer oopCode, String keywords, String category);
IPage<WarehousingContentVO> getWarehousingContentVOPage(Page page, QueryWrapper<WarehousingContent> qw); IPage<WarehousingContentVO> getWarehousingContentVOPage(Page page, QueryWrapper<WarehousingContent> qw);
} }

@ -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.dto.WarehousingRecordFormDTO;
import digital.laboratory.platform.reagent.entity.WarehousingBatchList; import digital.laboratory.platform.reagent.entity.WarehousingBatchList;
import digital.laboratory.platform.reagent.entity.WarehousingRecordForm; import digital.laboratory.platform.reagent.entity.WarehousingRecordForm;
import digital.laboratory.platform.reagent.vo.WarehousingBatchListVO;
import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO; import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -24,7 +25,10 @@ public interface WarehousingRecordFormService extends IService<WarehousingRecord
// List<SigningRecordFormVO> getSigningRecordFormVOList (QueryWrapper<SigningRecordForm> qw); // List<SigningRecordFormVO> getSigningRecordFormVOList (QueryWrapper<SigningRecordForm> qw);
WarehousingRecordFormVO getWarehousingRecordFormVO (String warehousingFormId); WarehousingRecordFormVO getWarehousingRecordFormVO (String warehousingRecordFormId, Integer opCode, String keywords, String type);
List<WarehousingBatchListVO> getBatchList(String warehousingRecordFormId,String keywords);
@Transactional @Transactional
void addFormById(WarehousingRecordFormDTO warehousingRecordFormDTO, DLPUser dlpUser); void addFormById(WarehousingRecordFormDTO warehousingRecordFormDTO, DLPUser dlpUser);
IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm>qw); IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm>qw);

@ -26,20 +26,13 @@ public class CatalogueDetailsServiceImpl extends ServiceImpl<CatalogueDetailsMap
@Override @Override
public List<CatalogueDetails> getCatalogueDetailsList(String purchaseCatalogueId) { public List<CatalogueDetails> getCatalogueDetailsList(String purchaseCatalogueId) {
LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
List<CatalogueDetails> list = this.list(Wrappers.<CatalogueDetails>query().eq("purchase_catalogue_id",purchaseCatalogueId).orderByDesc("purchase_catalogue_number")); List<CatalogueDetails> list = this.list(Wrappers.<CatalogueDetails>query().eq("purchase_catalogue_id",purchaseCatalogueId).orderByDesc("purchase_catalogue_number"));
Collections.sort(list, new Comparator<CatalogueDetails>() { Collections.sort(list, new Comparator<CatalogueDetails>() {
@Override @Override
public int compare(CatalogueDetails o1, CatalogueDetails o2) { public int compare(CatalogueDetails o1, CatalogueDetails o2) {
return Integer.valueOf(o1.getPurchaseCatalogueNumber().substring(5)) - Integer.valueOf(o2.getPurchaseCatalogueNumber().substring(5)); return Integer.valueOf(o1.getPurchaseCatalogueNumber().substring(5)) - Integer.valueOf(o2.getPurchaseCatalogueNumber().substring(5));
} }
}); });
return list; return list;
} }
} }

@ -3,7 +3,6 @@ package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.StrUtil; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; 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.dto.CentralizedRequestDTO;
import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.CentralizedRequestMapper; 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.service.*;
import digital.laboratory.platform.reagent.vo.*; import digital.laboratory.platform.reagent.vo.*;
import feign.Response; import feign.Response;
@ -83,92 +81,91 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
@Transactional @Transactional
@Override//增加集中采购申请 @Override//增加集中采购申请
public CentralizedRequest addRequest(List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser) { public CentralizedRequest addRequest(List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser) {
String centralizedRequestId = centralizedRequestDTOList.get(0).getCentralizedRequestId(); String centralizedRequestId = centralizedRequestDTOList.get(0).getCentralizedRequestId();
List<DetailsOfCentralized> detailsOfCentralizedList = new ArrayList<>(); List<DetailsOfCentralized> detailsOfCentralizedList = new ArrayList<>();
if (centralizedRequestId == null) { if (centralizedRequestId == null) {
CentralizedRequest centralizedRequest = new CentralizedRequest(); CentralizedRequest centralizedRequest = new CentralizedRequest();
centralizedRequest.setApplicantId(dlpUser.getId()); centralizedRequest.setApplicantId(dlpUser.getId());
centralizedRequest.setId(IdWorker.get32UUID().toUpperCase()); centralizedRequest.setId(IdWorker.get32UUID().toUpperCase());
//获取申请时间 //获取申请时间
//未提交 //未提交
centralizedRequest.setStatus(0); centralizedRequest.setStatus(0);
centralizedRequest.setApplicantName(dlpUser.getName()); centralizedRequest.setApplicantName(dlpUser.getName());
for (CentralizedRequestDTO centralizedRequestDTO : centralizedRequestDTOList) { for (CentralizedRequestDTO centralizedRequestDTO : centralizedRequestDTOList) {
DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized(); DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized();
BeanUtils.copyProperties(centralizedRequestDTO, detailsOfCentralized); BeanUtils.copyProperties(centralizedRequestDTO, detailsOfCentralized);
detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase()); detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase());
detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getId()); detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getId());
detailsOfCentralizedList.add(detailsOfCentralized); detailsOfCentralizedList.add(detailsOfCentralized);
} }
if (this.save(centralizedRequest) && detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) { if (this.save(centralizedRequest) && detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) {
return centralizedRequest; return centralizedRequest;
} else return null; } else return null;
//将DTO赋值给明细表 //将DTO赋值给明细表
} else { } else {
CentralizedRequest centralizedRequest = this.getById(centralizedRequestId); CentralizedRequest centralizedRequest = this.getById(centralizedRequestId);
for (CentralizedRequestDTO centralizedRequestDTO : centralizedRequestDTOList) { for (CentralizedRequestDTO centralizedRequestDTO : centralizedRequestDTOList) {
DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized(); DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized();
BeanUtils.copyProperties(centralizedRequestDTO, detailsOfCentralized); BeanUtils.copyProperties(centralizedRequestDTO, detailsOfCentralized);
detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase()); detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase());
detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getId()); detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getId());
detailsOfCentralizedList.add(detailsOfCentralized); detailsOfCentralizedList.add(detailsOfCentralized);
} }
if (detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) { if (detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) {
return centralizedRequest; return centralizedRequest;
} else return null; } else return null;
} }
} }
@Override
public CentralizedRequest leadPurchase(List<CentralizedRequestDTO> 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<DetailsOfCentralized> detailsOfCentralizeds = new ArrayList<>();
for (CentralizedRequestDTO requestDTO : requestDTOS) {
List<ReagentConsumables> list = reagentConsumablesService.list(Wrappers.<ReagentConsumables>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//提交申请 @Override//提交申请
public CentralizedRequest commitRequest(String id, DLPUser dlpUser) { public CentralizedRequest commitRequest(String id, DLPUser dlpUser) {
CentralizedRequest byId = this.getById(id); CentralizedRequest centralizedRequest = this.getById(id);
byId.setStatus(1); centralizedRequest.setStatus(1);
byId.setDateOfApplication(LocalDateTime.now()); centralizedRequest.setDateOfApplication(LocalDateTime.now());
this.updateById(byId); this.updateById(centralizedRequest);
return byId; return centralizedRequest;
} }
@Override//修改申请 @Override//修改申请
public DetailsOfCentralized editDetailsById(CentralizedRequestDTO centralizedRequestDto) { public DetailsOfCentralized editDetailsById(CentralizedRequestDTO centralizedRequestDto) {
DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(centralizedRequestDto.getDetailsOfCentralizedId()); DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(centralizedRequestDto.getDetailsOfCentralizedId());
BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized); BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized);
if (detailsOfCentralizedService.updateById(detailsOfCentralized)) { if (detailsOfCentralizedService.updateById(detailsOfCentralized)) {
return detailsOfCentralized; return detailsOfCentralized;
} else return null; } else return null;
@ -177,13 +174,9 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
@Override//增加明细 @Override//增加明细
public DetailsOfCentralized addDetailsById(CentralizedRequestDTO centralizedRequestDto) { public DetailsOfCentralized addDetailsById(CentralizedRequestDTO centralizedRequestDto) {
DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized(); DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized();
detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase()); detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase());
BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized); BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized);
if (detailsOfCentralizedService.save(detailsOfCentralized)) { if (detailsOfCentralizedService.save(detailsOfCentralized)) {
return detailsOfCentralized; return detailsOfCentralized;
} else return null; } else return null;
@ -192,75 +185,46 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
@Override//删除申请 @Override//删除申请
@Transactional @Transactional
public Boolean delRequestById(String centralizedRequestId) { public Boolean delRequestById(String centralizedRequestId) {
List<DetailsOfCentralized> list = detailsOfCentralizedService.list(Wrappers.<DetailsOfCentralized>lambdaQuery().eq(DetailsOfCentralized::getCentralizedRequestId, centralizedRequestId));
LambdaQueryWrapper<DetailsOfCentralized> detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>(); if (list != null && list.size() > 0) {
return detailsOfCentralizedService.removeBatchByIds(list) && this.removeById(centralizedRequestId);
detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getCentralizedRequestId, centralizedRequestId); } else {
return this.removeById(centralizedRequestId);
List<DetailsOfCentralized> list = detailsOfCentralizedService.list(detailsOfCentralizedLambdaQueryWrapper);
if (list.size() != 0) {
detailsOfCentralizedService.removeBatchByIds(list);
} }
return this.removeById(centralizedRequestId);
} }
@Override @Override
public IPage<CentralizedRequestVO> getCentralizedRequestVOPage(IPage<CentralizedRequest> page, QueryWrapper<CentralizedRequest> qw) { public IPage<CentralizedRequestVO> getCentralizedRequestVOPage(IPage<CentralizedRequest> page, QueryWrapper<CentralizedRequest> qw) {
IPage<CentralizedRequestVO> r = baseMapper.getCentralizedRequestVOPage(page, qw); IPage<CentralizedRequestVO> centralizedRequestVOPage = baseMapper.getCentralizedRequestVOPage(page, qw);
return r; return centralizedRequestVOPage;
} }
@Override @Override
public List<CentralizedRequestVO> getCentralizedRequestVOList(QueryWrapper<CentralizedRequest> qw) { public List<CentralizedRequestVO> getCentralizedRequestVOList(QueryWrapper<CentralizedRequest> qw) {
LambdaQueryWrapper<CentralizedRequest> centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>();
//查询状态为1的采购申请:已提交 //查询状态为1的采购申请:已提交
centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus, 1); List<CentralizedRequest> list = this.list(Wrappers.<CentralizedRequest>lambdaQuery().eq(CentralizedRequest::getStatus, 1));
List<CentralizedRequest> list = this.list(centralizedRequestLambdaQueryWrapper);
ArrayList<CentralizedRequestVO> centralizedRequestVOArrayList = new ArrayList<>(); ArrayList<CentralizedRequestVO> centralizedRequestVOArrayList = new ArrayList<>();
for (CentralizedRequest centralizedRequest : list) { for (CentralizedRequest centralizedRequest : list) {
CentralizedRequestVO centralizedRequestVO = new CentralizedRequestVO(); CentralizedRequestVO centralizedRequestVO = new CentralizedRequestVO();
BeanUtils.copyProperties(centralizedRequest, centralizedRequestVO); BeanUtils.copyProperties(centralizedRequest, centralizedRequestVO);
centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId())); centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId()));
centralizedRequestVOArrayList.add(centralizedRequestVO); centralizedRequestVOArrayList.add(centralizedRequestVO);
} }
return centralizedRequestVOArrayList; return centralizedRequestVOArrayList;
} }
@Override// @Override//
public CentralizedRequestVO getCentralizedRequestVO(String centralizedRequestId) { public CentralizedRequestVO getCentralizedRequestVO(String centralizedRequestId) {
CentralizedRequestVO centralizedRequestVO = baseMapper.getCentralizedRequestVO(centralizedRequestId); CentralizedRequestVO centralizedRequestVO = baseMapper.getCentralizedRequestVO(centralizedRequestId);
List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestId); List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestId);
centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList); centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList);
return centralizedRequestVO; return centralizedRequestVO;
} }
@Override @Override
public List<CentralizedRequestVO> getVOList(QueryWrapper<CentralizedRequest> qw) { public List<CentralizedRequestVO> getVOList(QueryWrapper<CentralizedRequest> qw) {
return baseMapper.getVOList(qw);
List<CentralizedRequestVO> centralizedRequestVOArrayList = baseMapper.getVOList(qw);
// for (CentralizedRequestVO centralizedRequestVO : centralizedRequestVOArrayList) {
//
// List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId());
//
// centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList);
// }
return centralizedRequestVOArrayList;
} }
@Override @Override
@ -286,23 +250,14 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
@Override @Override
public List<PurchaseRequestPrintVO> getPurchaseRequestPrintList(String id, String type) { public List<PurchaseRequestPrintVO> getPurchaseRequestPrintList(String id, String type) {
ArrayList<PurchaseRequestPrintVO> purchaseRequestPrintVOList = new ArrayList<>(); ArrayList<PurchaseRequestPrintVO> purchaseRequestPrintVOList = new ArrayList<>();
if (type.equals("集中采购申请")) { if (type.equals("集中采购申请")) {
CentralizedRequestVO centralizedRequest = this.getCentralizedRequestVO(id); CentralizedRequestVO centralizedRequest = this.getCentralizedRequestVO(id);
if (centralizedRequest.getStatus() != 4) { if (centralizedRequest.getStatus() != 4) {
throw new RuntimeException(String.format("当前采购还未被制定为清单,无法打印")); throw new RuntimeException(String.format("当前采购还未被制定为清单,无法打印"));
} }
List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = centralizedRequest.getDetailsOfCentralizedVOList(); List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = centralizedRequest.getDetailsOfCentralizedVOList();
for (DetailsOfCentralizedVO detailsOfCentralized : detailsOfCentralizedVOList) { for (DetailsOfCentralizedVO detailsOfCentralized : detailsOfCentralizedVOList) {
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId()); ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId());
if (reagentConsumables.getCategory().equals("标准物质")) { if (reagentConsumables.getCategory().equals("标准物质")) {
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO();
purchaseRequestPrintVO.setApplicantName(centralizedRequest.getApplicantName()); purchaseRequestPrintVO.setApplicantName(centralizedRequest.getApplicantName());
@ -319,29 +274,20 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
} }
} else { } else {
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(id); DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(id);
if (requestById.getStatus() != 6) { if (requestById.getStatus() != 6) {
throw new RuntimeException(String.format("当前采购还未被制定为清单,无法打印")); throw new RuntimeException(String.format("当前采购还未被制定为清单,无法打印"));
} }
for (DecentralizeDetails decentralizeDetails : requestById.getDecentralizeDetailsVOList()) { for (DecentralizeDetails decentralizeDetails : requestById.getDecentralizeDetailsVOList()) {
if (decentralizeDetails.getCategory().equals("标准物质")) { if (decentralizeDetails.getCategory().equals("标准物质")) {
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO();
BeanUtils.copyProperties(decentralizeDetails, purchaseRequestPrintVO); BeanUtils.copyProperties(decentralizeDetails, purchaseRequestPrintVO);
purchaseRequestPrintVO.setPurpose(decentralizeDetails.getPurpose()); purchaseRequestPrintVO.setPurpose(decentralizeDetails.getPurpose());
purchaseRequestPrintVO.setApplicantName(requestById.getApplicantName()); purchaseRequestPrintVO.setApplicantName(requestById.getApplicantName());
purchaseRequestPrintVO.setRemarks(decentralizeDetails.getRemarks()); purchaseRequestPrintVO.setRemarks(decentralizeDetails.getRemarks());
purchaseRequestPrintVO.setSubtotal(purchaseRequestPrintVO.getUnitPrice() * purchaseRequestPrintVO.getQuantity()); purchaseRequestPrintVO.setSubtotal(purchaseRequestPrintVO.getUnitPrice() * purchaseRequestPrintVO.getQuantity());
//查找出供应商名称 //查找出供应商名称
purchaseRequestPrintVO.setSupplierName(supplierInformationService.getById(purchaseListDetailsService.getById(decentralizeDetails.getPurchaseListDetailsId()).getSupplierId()).getSupplierName()); purchaseRequestPrintVO.setSupplierName(supplierInformationService.getById(purchaseListDetailsService.getById(decentralizeDetails.getPurchaseListDetailsId()).getSupplierId()).getSupplierName());
purchaseRequestPrintVOList.add(purchaseRequestPrintVO); purchaseRequestPrintVOList.add(purchaseRequestPrintVO);
} }
} }
@ -357,7 +303,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
double total = 0; double total = 0;
for (PurchaseRequestPrintVO purchaseRequestPrintVO : voList) { for (PurchaseRequestPrintVO purchaseRequestPrintVO : voList) {
purchaseRequestPrintVO.setI(x); purchaseRequestPrintVO.setI(x);
if (!StrUtil.isNotBlank(purchaseRequestPrintVO.getRemarks())){ if (!StrUtil.isNotBlank(purchaseRequestPrintVO.getRemarks())) {
purchaseRequestPrintVO.setRemarks("无"); purchaseRequestPrintVO.setRemarks("无");
} }
total = total + purchaseRequestPrintVO.getSubtotal(); total = total + purchaseRequestPrintVO.getSubtotal();

@ -12,9 +12,11 @@ import digital.laboratory.platform.reagent.dto.ComplianceCheckDTO;
import digital.laboratory.platform.reagent.dto.OutgoingContentsDTO; import digital.laboratory.platform.reagent.dto.OutgoingContentsDTO;
import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.DeliveryRegistrationFormMapper; import digital.laboratory.platform.reagent.mapper.DeliveryRegistrationFormMapper;
import digital.laboratory.platform.reagent.mapper.ReagentConsumableInventoryMapper;
import digital.laboratory.platform.reagent.service.*; import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.vo.DeliveryRegistrationFormVO; import digital.laboratory.platform.reagent.vo.DeliveryRegistrationFormVO;
import digital.laboratory.platform.reagent.vo.OutgoingContentsVO; import digital.laboratory.platform.reagent.vo.OutgoingContentsVO;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
import digital.laboratory.platform.reagent.vo.ReagentConsumablesSetVO; import digital.laboratory.platform.reagent.vo.ReagentConsumablesSetVO;
import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData; import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData;
import digital.laboratory.platform.sys.feign.RemoteCabinetService; import digital.laboratory.platform.sys.feign.RemoteCabinetService;
@ -72,6 +74,9 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
@Autowired @Autowired
private ReagentConsumableStashService reagentConsumableStashService; private ReagentConsumableStashService reagentConsumableStashService;
@Autowired
private ReagentConsumableInventoryMapper reagentConsumableInventoryMapper;
@Override @Override
@Transactional//创建出库任务 @Transactional//创建出库任务
@ -252,7 +257,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
if (referenceMaterial.getStatus() == -3) { if (referenceMaterial.getStatus() == -3) {
throw new RuntimeException(String.format("该物品已被其他工作人员领用")); throw new RuntimeException(String.format("该物品已被其他工作人员领用"));
} }
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1); reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(), referenceMaterial.getId(), -1);
referenceMaterial.setStatus(-3);//改变状态 referenceMaterial.setStatus(-3);//改变状态
referenceMaterial.setServiceStatus(-3); referenceMaterial.setServiceStatus(-3);
// reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息 // reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息
@ -311,7 +316,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
} }
referenceMaterial.setStatus(-3); referenceMaterial.setStatus(-3);
referenceMaterial.setServiceStatus(-3); referenceMaterial.setServiceStatus(-3);
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1); reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(), referenceMaterial.getId(), -1);
referenceMaterialService.updateById(referenceMaterial); referenceMaterialService.updateById(referenceMaterial);
// reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息 // reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(),referenceMaterial.getId(),-1);//清除这个格子上的物品信息
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId()); ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId());
@ -341,7 +346,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity()); batchDetails.setQuantity(batchDetails.getQuantity() - outgoingContentsDTO.getQuantity());
if (batchDetails.getQuantity() == 0) { if (batchDetails.getQuantity() == 0) {
batchDetails.setServiceStatus(-1); batchDetails.setServiceStatus(-1);
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(),batchDetails.getReagentConsumableInventoryId(),-1); reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), batchDetails.getReagentConsumableInventoryId(), -1);
// reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),-1); // reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumables.getReagentConsumableId(),-1);
} }
batchDetailsService.updateById(batchDetails); batchDetailsService.updateById(batchDetails);
@ -405,10 +410,9 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
OutgoingContentsVO outgoingContentsVO = new OutgoingContentsVO(); OutgoingContentsVO outgoingContentsVO = new OutgoingContentsVO();
BeanUtils.copyProperties(outgoingContents, outgoingContentsVO); BeanUtils.copyProperties(outgoingContents, outgoingContentsVO);
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, outgoingContents.getReagentConsumableId()); ReagentConsumableInventoryVO vo = reagentConsumableInventoryMapper.getRciById(null, outgoingContents.getReagentConsumableId());
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); outgoingContentsVO.setReagentConsumableInventory(vo);//试剂耗材信息
outgoingContentsVO.setReagentConsumableInventory(reagentConsumableInventory);//试剂耗材信息
BatchDetails batchDetails = batchDetailsService.getById(outgoingContents.getBatchDetailsId()); BatchDetails batchDetails = batchDetailsService.getById(outgoingContents.getBatchDetailsId());
if (batchDetails != null) { if (batchDetails != null) {

@ -31,65 +31,19 @@ public class DetailsOfCentralizedServiceImpl extends ServiceImpl<DetailsOfCentra
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@Autowired
private CentralizedRequestService centralizedRequestService;
@Override @Override
public List<DetailsOfCentralizedVO> getDetailsOfCentralizedVOList(String centralizedRequestId) { public List<DetailsOfCentralizedVO> getDetailsOfCentralizedVOList(String centralizedRequestId) {
List<DetailsOfCentralizedVO> list = baseMapper.getDetailsOfCentralizedVOList(centralizedRequestId); List<DetailsOfCentralizedVO> list = baseMapper.getDetailsOfCentralizedVOList(centralizedRequestId);
for (DetailsOfCentralizedVO detailsOfCentralizedVO : list) { for (DetailsOfCentralizedVO detailsOfCentralizedVO : list) {
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralizedVO.getReagentConsumableId());
ReagentConsumables byId = reagentConsumablesService.getById(detailsOfCentralizedVO.getReagentConsumableId()); detailsOfCentralizedVO.setBrand(reagentConsumables.getBrand());
detailsOfCentralizedVO.setCategory(reagentConsumables.getCategory());
detailsOfCentralizedVO.setBrand(byId.getBrand()); detailsOfCentralizedVO.setSpecificationAndModel(reagentConsumables.getSpecificationAndModel());
detailsOfCentralizedVO.setCategory(byId.getCategory());
detailsOfCentralizedVO.setSpecificationAndModel(byId.getSpecificationAndModel());
} }
return list; return list;
} }
@Override @Override
public List<DetailsOfCentralizedVO> getDetailsOfCentralizedList(String procurementContentId) { public List<DetailsOfCentralizedVO> getDetailsOfCentralizedList(String procurementContentId) {
// LambdaQueryWrapper<DetailsOfCentralized> detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>();
//
// detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getProcurementContentId, purchasingPlanId);
//
// List<DetailsOfCentralized> list = this.list(detailsOfCentralizedLambdaQueryWrapper);
//
// List<DetailsOfCentralizedVO> detailsOfCentralizedVOS = new ArrayList<>();
//
// for (DetailsOfCentralized detailsOfCentralized : list) {
//
// CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(detailsOfCentralized.getCentralizedRequestId());
//
// LambdaQueryWrapper<ReagentConsumables> 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); return baseMapper.getDetailsOfCentralizedVOPlanList(procurementContentId);
} }
} }

@ -47,26 +47,19 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
private CategoryTableServiceImpl typeTableService; private CategoryTableServiceImpl typeTableService;
@Override//新增采购目录 @Override//新增采购目录
@Transactional @Transactional(rollbackFor = Exception.class)
public PurchaseCatalogue addCatalogue(DLPUser dlpUser, List<PurchaseCatalogueDTO> purchaseCatalogueDTOList) { public PurchaseCatalogue addCatalogue(DLPUser dlpUser, List<PurchaseCatalogueDTO> purchaseCatalogueDTOList) {
PurchaseCatalogue purchaseCatalogue = new PurchaseCatalogue(); PurchaseCatalogue purchaseCatalogue = new PurchaseCatalogue();
purchaseCatalogue.setPurchaseCatalogueId(IdWorker.get32UUID().toUpperCase()); purchaseCatalogue.setPurchaseCatalogueId(IdWorker.get32UUID().toUpperCase());
purchaseCatalogue.setStatus(0); purchaseCatalogue.setStatus(0);
List<CatalogueDetails> catalogueDetailsList = new ArrayList<>(); List<CatalogueDetails> catalogueDetailsList = new ArrayList<>();
Integer i = 1; Integer i = 1;
for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) { for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) {
CatalogueDetails catalogueDetails = new CatalogueDetails(); CatalogueDetails catalogueDetails = new CatalogueDetails();
BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails); BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails);
catalogueDetails.setCatalogueDetailsId(IdWorker.get32UUID().toUpperCase()); catalogueDetails.setCatalogueDetailsId(IdWorker.get32UUID().toUpperCase());
catalogueDetails.setPurchaseCatalogueId(purchaseCatalogue.getPurchaseCatalogueId()); catalogueDetails.setPurchaseCatalogueId(purchaseCatalogue.getPurchaseCatalogueId());
String yyyy = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy"); catalogueDetails.setPurchaseCatalogueNumber(LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy") + "-" + i.toString());
catalogueDetails.setPurchaseCatalogueNumber(yyyy + "-" + i.toString());
i++; i++;
catalogueDetailsList.add(catalogueDetails); catalogueDetailsList.add(catalogueDetails);
typeTableService.addSpecies(catalogueDetails.getCategory(), catalogueDetails.getSpecies()); typeTableService.addSpecies(catalogueDetails.getCategory(), catalogueDetails.getSpecies());
@ -80,132 +73,86 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
@Override//修改采购目录 @Override//修改采购目录
public CatalogueDetails editCatalogue(PurchaseCatalogueDTO purchaseCatalogueDTO) { public CatalogueDetails editCatalogue(PurchaseCatalogueDTO purchaseCatalogueDTO) {
CatalogueDetails catalogueDetails = catalogueDetailsService.getById(purchaseCatalogueDTO.getCatalogueDetailsId());
CatalogueDetails byId = catalogueDetailsService.getById(purchaseCatalogueDTO.getCatalogueDetailsId()); BeanUtils.copyProperties(purchaseCatalogueDTO, catalogueDetails);
if (catalogueDetailsService.updateById(catalogueDetails)) {
BeanUtils.copyProperties(purchaseCatalogueDTO, byId); return catalogueDetails;
if (catalogueDetailsService.updateById(byId)) {
return byId;
} else return null; } else return null;
} }
@Override//删除采购目录 @Override//删除采购目录
@Transactional @Transactional(rollbackFor = Exception.class)
public Boolean delCatalogue(String purchaseCatalogueId) { public Boolean delCatalogue(String purchaseCatalogueId) {
List<CatalogueDetails> list = catalogueDetailsService.list(Wrappers.<CatalogueDetails>lambdaQuery().eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId));
LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); if (list != null && list.size() > 0) {
return catalogueDetailsService.removeBatchByIds(list) && this.removeById(purchaseCatalogueId);
catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId); } else {
return this.removeById(purchaseCatalogueId);
List<CatalogueDetails> list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);
if (list.size() > 0 & list != null) {
catalogueDetailsService.removeBatchByIds(list);
} }
return
this.removeById(purchaseCatalogueId);
} }
@Override @Override
public CatalogueDetails addDetails(PurchaseCatalogueDTO purchaseCatalogueDTO) { public CatalogueDetails addDetails(PurchaseCatalogueDTO purchaseCatalogueDTO) {
CatalogueDetails catalogueDetails = new CatalogueDetails(); CatalogueDetails catalogueDetails = new CatalogueDetails();
PurchaseCatalogueVO purchaseCatalogueVO = this.getPurchaseCatalogueVO(purchaseCatalogueDTO.getPurchaseCatalogueId());
int size = purchaseCatalogueVO.getCatalogueDetailsListList().size();
BeanUtils.copyProperties(purchaseCatalogueDTO, catalogueDetails); BeanUtils.copyProperties(purchaseCatalogueDTO, catalogueDetails);
String yyyy = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy"); String yyyy = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy");
catalogueDetails.setPurchaseCatalogueNumber(yyyy + "-" + catalogueDetailsService.list(Wrappers.<CatalogueDetails>lambdaQuery()
catalogueDetails.setPurchaseCatalogueNumber(yyyy + "-" + size + 1); .eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueDTO.getPurchaseCatalogueId())).size() + 1);
if (catalogueDetailsService.save(catalogueDetails)) { if (catalogueDetailsService.save(catalogueDetails)) {
return catalogueDetails; return catalogueDetails;
} else return null; } else return null;
} }
@Override @Override
public IPage<PurchaseCatalogueVO> getPurchaseCatalogueVOPage(IPage<PurchaseCatalogue> page, QueryWrapper<PurchaseCatalogue> qw) { public IPage<PurchaseCatalogueVO> getPurchaseCatalogueVOPage(IPage<PurchaseCatalogue> page, QueryWrapper<PurchaseCatalogue> qw) {
IPage<PurchaseCatalogueVO> purchaseCatalogueVOPage = baseMapper.getPurchaseCatalogueVOPage(page, qw); IPage<PurchaseCatalogueVO> purchaseCatalogueVOPage = baseMapper.getPurchaseCatalogueVOPage(page, qw);
List<PurchaseCatalogueVO> records = purchaseCatalogueVOPage.getRecords(); List<PurchaseCatalogueVO> records = purchaseCatalogueVOPage.getRecords();
for (PurchaseCatalogueVO record : records) { for (PurchaseCatalogueVO record : records) {
List<CatalogueDetails> list = catalogueDetailsService.list(Wrappers.<CatalogueDetails>lambdaQuery()
PurchaseCatalogue byId = this.getById(record.getPurchaseCatalogueId()); .eq(CatalogueDetails::getPurchaseCatalogueId, record.getPurchaseCatalogueId()));
LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, byId.getPurchaseCatalogueId());
List<CatalogueDetails> list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);
record.setQuantity(list.size()); record.setQuantity(list.size());
} }
return purchaseCatalogueVOPage; return purchaseCatalogueVOPage;
} }
@Override @Override
public List<PurchaseCatalogueVO> getPurchaseCatalogueVOList(QueryWrapper<PurchaseCatalogue> qw) { public List<PurchaseCatalogueVO> getPurchaseCatalogueVOList(QueryWrapper<PurchaseCatalogue> qw) {
return baseMapper.getPurchaseCatalogueVOList(qw);
List<PurchaseCatalogueVO> purchaseCatalogueVOList = baseMapper.getPurchaseCatalogueVOList(qw);
return purchaseCatalogueVOList;
} }
@Override//通过ID查询 @Override//通过ID查询
public PurchaseCatalogueVO getPurchaseCatalogueVO(String purchaseCatalogueId) { public PurchaseCatalogueVO getPurchaseCatalogueVO(String purchaseCatalogueId) {
PurchaseCatalogueVO purchaseCatalogueVO = baseMapper.getPurchaseCatalogueVO(purchaseCatalogueId); PurchaseCatalogueVO purchaseCatalogueVO = baseMapper.getPurchaseCatalogueVO(purchaseCatalogueId);
List<CatalogueDetails> catalogueDetailsList = catalogueDetailsService.getCatalogueDetailsList(purchaseCatalogueId); List<CatalogueDetails> catalogueDetailsList = catalogueDetailsService.getCatalogueDetailsList(purchaseCatalogueId);
purchaseCatalogueVO.setCatalogueDetailsListList(catalogueDetailsList); purchaseCatalogueVO.setCatalogueDetailsListList(catalogueDetailsList);
purchaseCatalogueVO.setQuantity(catalogueDetailsList.size()); purchaseCatalogueVO.setQuantity(catalogueDetailsList.size());
return purchaseCatalogueVO; return purchaseCatalogueVO;
} }
@Override//提交目录 @Override//提交目录
@Transactional @Transactional
public PurchaseCatalogue commitById(List<PurchaseCatalogueDTO> purchaseCatalogueDTOList, DLPUser dlpUser) { public PurchaseCatalogue commitById(List<PurchaseCatalogueDTO> purchaseCatalogueDTOList, DLPUser dlpUser) {
Set<String> permissions = dlpUser.getPermissions(); Set<String> permissions = dlpUser.getPermissions();
if (!StrUtil.isNotBlank(purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId())) {
if (purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId().equals("") | purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId() == null) {
PurchaseCatalogue purchaseCatalogue = this.addCatalogue(dlpUser, purchaseCatalogueDTOList); PurchaseCatalogue purchaseCatalogue = this.addCatalogue(dlpUser, purchaseCatalogueDTOList);
if (permissions.contains("reagent_purchase_catalogue_primary")) { if (permissions.contains("reagent_purchase_catalogue_primary")) {
purchaseCatalogue.setStatus(2); purchaseCatalogue.setStatus(2);
} else { } else {
purchaseCatalogue.setStatus(1); purchaseCatalogue.setStatus(1);
} }
purchaseCatalogue.setCommitTime(LocalDateTime.now()); purchaseCatalogue.setCommitTime(LocalDateTime.now());
if (this.updateById(purchaseCatalogue)) { if (this.updateById(purchaseCatalogue)) {
return purchaseCatalogue; return purchaseCatalogue;
} else return null; } else return null;
} else { } else {
PurchaseCatalogue purchaseCatalogue = this.getById(purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId() PurchaseCatalogue purchaseCatalogue = this.getById(purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId());
);
if (permissions.contains("reagent_purchase_catalogue_primary")) { if (permissions.contains("reagent_purchase_catalogue_primary")) {
purchaseCatalogue.setStatus(2); purchaseCatalogue.setStatus(2);
} else { } else {
purchaseCatalogue.setStatus(1); purchaseCatalogue.setStatus(1);
} }
purchaseCatalogue.setCommitTime(LocalDateTime.now()); purchaseCatalogue.setCommitTime(LocalDateTime.now());
if (this.updateById(purchaseCatalogue)) { if (this.updateById(purchaseCatalogue)) {
return purchaseCatalogue; return purchaseCatalogue;
} else return null; } else return null;
@ -215,33 +162,24 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
@Override//审核 @Override//审核
@Transactional @Transactional
public PurchaseCatalogue primaryAuditCatalogue(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) { public PurchaseCatalogue primaryAuditCatalogue(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) {
PurchaseCatalogue purchaseCatalogue = this.getById(auditAndApproveDto.getUuId()); PurchaseCatalogue purchaseCatalogue = this.getById(auditAndApproveDto.getUuId());
purchaseCatalogue.setAuditOpinion(auditAndApproveDto.getAuditOpinion()); purchaseCatalogue.setAuditOpinion(auditAndApproveDto.getAuditOpinion());
purchaseCatalogue.setAuditResult(auditAndApproveDto.getAuditResult()); purchaseCatalogue.setAuditResult(auditAndApproveDto.getAuditResult());
purchaseCatalogue.setAuditorId(dlpUser.getId()); purchaseCatalogue.setAuditorId(dlpUser.getId());
purchaseCatalogue.setAuditTime(LocalDateTime.now()); purchaseCatalogue.setAuditTime(LocalDateTime.now());
if (purchaseCatalogue.getAuditResult() == true) { if (purchaseCatalogue.getAuditResult() == true) {
//审核通过后,将采购目录添加的试剂耗材,录入至试剂耗材类 //审核通过后,将采购目录添加的试剂耗材,录入至试剂耗材类
LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); List<CatalogueDetails> list = catalogueDetailsService.list(Wrappers.<CatalogueDetails>lambdaQuery()
.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogue.getPurchaseCatalogueId()));
catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogue.getPurchaseCatalogueId());
List<CatalogueDetails> list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);
//目录中的试剂耗材是否存在试剂耗材类中,有则不管,无则添加 //目录中的试剂耗材是否存在试剂耗材类中,有则不管,无则添加
for (CatalogueDetails catalogueDetails : list) { for (CatalogueDetails catalogueDetails : list) {
ReagentConsumables one = reagentConsumablesService.getOne(Wrappers.<ReagentConsumables>query() ReagentConsumables reagentConsumable = reagentConsumablesService.getOne(Wrappers.<ReagentConsumables>query()
.eq("reagent_consumable_name", catalogueDetails.getReagentConsumableName()) .eq("reagent_consumable_name", catalogueDetails.getReagentConsumableName())
.eq("brand", catalogueDetails.getBrand()) .eq("brand", catalogueDetails.getBrand())
.eq("category", catalogueDetails.getCategory()) .eq("category", catalogueDetails.getCategory())
.eq("specification_and_model", catalogueDetails.getSpecificationAndModel()) .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.getStandardValueOrPurity()), "standard_value_or_purity", catalogueDetails.getStandardValueOrPurity())
.eq(StrUtil.isNotBlank(catalogueDetails.getCasNumber()), "cas_number", catalogueDetails.getCasNumber()) .eq(StrUtil.isNotBlank(catalogueDetails.getCasNumber()), "cas_number", catalogueDetails.getCasNumber())
.eq(StrUtil.isNotBlank(catalogueDetails.getSpecies()), "species", catalogueDetails.getSpecies()) .eq(StrUtil.isNotBlank(catalogueDetails.getSpecies()), "species", catalogueDetails.getSpecies())
@ -251,17 +189,20 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
.eq(StrUtil.isNotBlank(catalogueDetails.getPurityGrade()), "purity_grade", catalogueDetails.getPurityGrade()) .eq(StrUtil.isNotBlank(catalogueDetails.getPurityGrade()), "purity_grade", catalogueDetails.getPurityGrade())
.eq(StrUtil.isNotBlank(catalogueDetails.getDeviationOrUncertainty()), "deviation_or_uncertainty", catalogueDetails.getDeviationOrUncertainty()) .eq(StrUtil.isNotBlank(catalogueDetails.getDeviationOrUncertainty()), "deviation_or_uncertainty", catalogueDetails.getDeviationOrUncertainty())
.eq(StrUtil.isNotBlank(catalogueDetails.getMinimumUnit()), "minimum_unit", catalogueDetails.getMinimumUnit()) .eq(StrUtil.isNotBlank(catalogueDetails.getMinimumUnit()), "minimum_unit", catalogueDetails.getMinimumUnit())
.eq(StrUtil.isNotBlank(catalogueDetails.getStorageCondition()), "storage_condition", catalogueDetails.getStorageCondition())
.eq(StrUtil.isNotBlank(catalogueDetails.getRemark()), "remark", catalogueDetails.getRemark())
.eq(StrUtil.isNotBlank(catalogueDetails.getCode()), "code", catalogueDetails.getCode())
); );
if (one == null) {
ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(catalogueDetails); if (reagentConsumable == null) {
catalogueDetails.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); ReagentConsumables addReagentConsumables = reagentConsumablesService.addReagentConsumables(catalogueDetails);
catalogueDetails.setReagentConsumableId(addReagentConsumables.getReagentConsumableId());
catalogueDetailsService.updateById(catalogueDetails); catalogueDetailsService.updateById(catalogueDetails);
} else { } else {
catalogueDetails.setReagentConsumableId(one.getReagentConsumableId()); catalogueDetails.setReagentConsumableId(reagentConsumable.getReagentConsumableId());
catalogueDetailsService.updateById(catalogueDetails); catalogueDetailsService.updateById(catalogueDetails);
} }
} }
purchaseCatalogue.setStatus(6); purchaseCatalogue.setStatus(6);
} else { } else {
purchaseCatalogue.setStatus(-3); purchaseCatalogue.setStatus(-3);
@ -273,11 +214,8 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
@Override @Override
public PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId) { public PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId) {
PurchaseCatalogue purchaseCatalogue = this.getById(purchaseCatalogueId); PurchaseCatalogue purchaseCatalogue = this.getById(purchaseCatalogueId);
purchaseCatalogue.setStatus(4); purchaseCatalogue.setStatus(4);
if (this.updateById(purchaseCatalogue)) { if (this.updateById(purchaseCatalogue)) {
return purchaseCatalogue; return purchaseCatalogue;
} else return null; } else return null;
@ -285,35 +223,19 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
@Override//查询已发布的采购目录 @Override//查询已发布的采购目录
public List<CatalogueDetails> getList(String name, Integer category) { public List<CatalogueDetails> getList(String name, Integer category) {
List<PurchaseCatalogue> list = this.list(Wrappers.<PurchaseCatalogue>lambdaQuery().eq(PurchaseCatalogue::getStatus, 4)
QueryWrapper<PurchaseCatalogue> queryWrapper = new QueryWrapper<>(); .orderByDesc(PurchaseCatalogue::getUpdateTime));
queryWrapper.eq("status", 4);
QueryWrapper<PurchaseCatalogue> queryWrapper1 = queryWrapper.orderByDesc("update_time");
List<PurchaseCatalogue> list = this.list(queryWrapper1);
if (list.size() == 0) {
return null;
}
PurchaseCatalogue purchaseCatalogue = list.get(0);
LambdaQueryWrapper<CatalogueDetails> 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<CatalogueDetails> catalogueDetailsList = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);
if (list == null & list.size() == 0) { if (list == null & list.size() == 0) {
throw new RuntimeException(String.format("未存在已发布的采购目录")); throw new RuntimeException(String.format("未存在已发布的采购目录"));
} }
PurchaseCatalogue purchaseCatalogue = list.get(0);
List<CatalogueDetails> catalogueDetailsList = catalogueDetailsService.list(Wrappers.<CatalogueDetails>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<CatalogueDetails>() { Collections.sort(catalogueDetailsList, new Comparator<CatalogueDetails>() {
@Override @Override
public int compare(CatalogueDetails o1, CatalogueDetails o2) { public int compare(CatalogueDetails o1, CatalogueDetails o2) {
@ -326,11 +248,9 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
@Override @Override
//导入方法,验证填写内容是否有误 //导入方法,验证填写内容是否有误
public PurchaseCatalogueVO getImport(List<PurchaseCatalogueDTO> purchaseCatalogueDTOList) { public PurchaseCatalogueVO getImport(List<PurchaseCatalogueDTO> purchaseCatalogueDTOList) {
int i = 1; int i = 1;
String message = ""; String message = "";
try { try {
for (PurchaseCatalogueDTO purchaseCatalogueDTO : purchaseCatalogueDTOList) { for (PurchaseCatalogueDTO purchaseCatalogueDTO : purchaseCatalogueDTOList) {
if (StrUtil.isNotBlank(purchaseCatalogueDTO.getBrand()) & if (StrUtil.isNotBlank(purchaseCatalogueDTO.getBrand()) &
@ -351,29 +271,20 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
} }
} catch (RuntimeException e) { } catch (RuntimeException e) {
throw new RuntimeException(message); throw new RuntimeException(message);
} }
if (StrUtil.isNotBlank(message)) { if (StrUtil.isNotBlank(message)) {
throw new RuntimeException(message); throw new RuntimeException(message);
} }
PurchaseCatalogueVO purchaseCatalogueVO = new PurchaseCatalogueVO(); PurchaseCatalogueVO purchaseCatalogueVO = new PurchaseCatalogueVO();
List<CatalogueDetails> catalogueDetailsList = new ArrayList<>(); List<CatalogueDetails> catalogueDetailsList = new ArrayList<>();
for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) { for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) {
CatalogueDetails catalogueDetails = new CatalogueDetails(); CatalogueDetails catalogueDetails = new CatalogueDetails();
BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails); BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails);
catalogueDetailsList.add(catalogueDetails); catalogueDetailsList.add(catalogueDetails);
} }
purchaseCatalogueVO.setCatalogueDetailsListList(catalogueDetailsList); purchaseCatalogueVO.setCatalogueDetailsListList(catalogueDetailsList);
return purchaseCatalogueVO; return purchaseCatalogueVO;
} }

@ -178,7 +178,6 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
//所有批次信息 //所有批次信息
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", reagentConsumableInventory.getReagentConsumableInventoryId()) List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", reagentConsumableInventory.getReagentConsumableInventoryId())
.orderByDesc("create_time")); .orderByDesc("create_time"));
warehousingContent.setWarningValue(reagentConsumableInventory.getWarningValue());
//如果存在批次信息,则提供上次位置信息,以便用户存放物品 //如果存在批次信息,则提供上次位置信息,以便用户存放物品
if (batchDetailsList.size() != 0 && batchDetailsList != null) { if (batchDetailsList.size() != 0 && batchDetailsList != null) {
warehousingContent.setLastStorageLocation(batchDetailsList.get(0).getLocation());//位置信息 warehousingContent.setLastStorageLocation(batchDetailsList.get(0).getLocation());//位置信息

@ -123,18 +123,13 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
flag = true; flag = true;
//合并相同的采购内容,若存在相同的采购物品,则无需创建计划明细,将采购申请明细与该计划明细关联即可 //合并相同的采购内容,若存在相同的采购物品,则无需创建计划明细,将采购申请明细与该计划明细关联即可
if (list.size() != 0) { if (list.size() != 0) {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
if (list.get(i).getReagentConsumableId().equals(purchasingPlanDTO.getReagentConsumableId())) { if (list.get(i).getReagentConsumableId().equals(purchasingPlanDTO.getReagentConsumableId())) {
list.get(i).setUnitPrice(reagentConsumables.getUnitPrice());//获取单价 list.get(i).setUnitPrice(reagentConsumables.getUnitPrice());//获取单价
//Set采购数量 //Set采购数量
list.get(i).setQuantityPurchased(list.get(i).getQuantityPurchased() + purchasingPlanDTO.getNumberOfApplications());//合并之前的数量加上被合并对象的数量 list.get(i).setQuantityPurchased(list.get(i).getQuantityPurchased() + purchasingPlanDTO.getNumberOfApplications());//合并之前的数量加上被合并对象的数量
list.get(i).setSubtotal(list.get(i).getQuantityPurchased() * list.get(i).getUnitPrice());//计算小计 list.get(i).setSubtotal(list.get(i).getQuantityPurchased() * list.get(i).getUnitPrice());//计算小计
//添加采购申请明细的采购数量 //添加采购申请明细的采购数量
detailsOfCentralized.setQuantityPurchased(detailsOfCentralized.getNumberOfApplications()); detailsOfCentralized.setQuantityPurchased(detailsOfCentralized.getNumberOfApplications());
detailsOfCentralized.setProcurementContentId(list.get(i).getProcurementContentId()); detailsOfCentralized.setProcurementContentId(list.get(i).getProcurementContentId());
detailsOfCentralizedService.updateById(detailsOfCentralized); detailsOfCentralizedService.updateById(detailsOfCentralized);
@ -153,7 +148,6 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
procurementContent.setUnitPrice(reagentConsumables.getUnitPrice());//单价 procurementContent.setUnitPrice(reagentConsumables.getUnitPrice());//单价
procurementContent.setSubtotal(procurementContent.getUnitPrice() * procurementContent.getQuantityPurchased());//小计 procurementContent.setSubtotal(procurementContent.getUnitPrice() * procurementContent.getQuantityPurchased());//小计
detailsOfCentralized.setProcurementContentId(procurementContent.getProcurementContentId());//采购申请明细关联采购计划明细 detailsOfCentralized.setProcurementContentId(procurementContent.getProcurementContentId());//采购申请明细关联采购计划明细
detailsOfCentralizedService.updateById(detailsOfCentralized); detailsOfCentralizedService.updateById(detailsOfCentralized);
list.add(procurementContent);//将计划明细添加至集合 list.add(procurementContent);//将计划明细添加至集合

@ -112,9 +112,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Override//标准物质标准物质管理列表 @Override//标准物质标准物质管理列表
public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(IPage<ReagentConsumableInventory> page, Integer warning, String keywords) { public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(IPage<ReagentConsumableInventory> page, Integer warning, String keywords) {
Integer reagentCategory = 1; Integer reagentCategory = 1;
if (warning != null && warning == 2) { // if (warning != null && warning == 2) {
return this.getReagentConsumableInventoryWarningPage((Page) page, reagentCategory); // return this.getReagentConsumableInventoryWarningPage((Page) page, reagentCategory);
} // }
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, warning, keywords, reagentCategory); IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, warning, keywords, reagentCategory);
return reagentConsumableInventoryVOPage; return reagentConsumableInventoryVOPage;
} }
@ -122,36 +122,43 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Override//试剂耗材管理列表 @Override//试剂耗材管理列表
public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryREVOList(IPage<ReagentConsumableInventory> page, Integer warning, String keywords) { public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryREVOList(IPage<ReagentConsumableInventory> page, Integer warning, String keywords) {
Integer reagentCategory = 0; Integer reagentCategory = 0;
if (warning != null && warning == 2) { // if (warning != null && warning == 2) {
return this.getReagentConsumableInventoryWarningPage((Page) page, reagentCategory); // return this.getReagentConsumableInventoryWarningPage((Page) page, reagentCategory);
} // }
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, warning, keywords, reagentCategory); IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, warning, keywords, reagentCategory);
return reagentConsumableInventoryVOPage; return reagentConsumableInventoryVOPage;
} }
//查询即将到期的试剂耗材、标准物质:reagentCategory:0代表试剂耗材,1代表标准物质、标准储备溶液 //查询即将到期的试剂耗材、标准物质:reagentCategory:0代表试剂耗材,1代表标准物质、标准储备溶液
public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryWarningPage(Page page, Integer reagentCategory) { public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryWarningPage(Page page, Integer reagentCategory) {
List<ReagentConsumableInventoryVO> reagentConsumableInventoryVOList = new ArrayList<>(); if (reagentCategory == 0) {
List<BatchDetails> list = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("warning_information", "即将过期").or().eq("warning_information", "已过期").or().eq("warning_information", "即将到达存储期限").or().eq("warning_information", "已超过存储期限")); IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOIPage = baseMapper.getRmListById();
//查找具有到期批次物品的试剂耗材\标准物质类信息 if (reagentConsumableInventoryVOIPage != null) {
if (list != null && list.size() != 0) { return reagentConsumableInventoryVOIPage;
for (BatchDetails batchDetails : list) { } else return null;
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); } else {
if (reagentCategory == 0) { IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOIPage = baseMapper.getRemListById();
reagentConsumableInventory = this.getOne(new LambdaQueryWrapper<ReagentConsumableInventory>().eq(ReagentConsumableInventory::getReagentConsumableInventoryId, batchDetails.getReagentConsumableInventoryId()).ne(ReagentConsumableInventory::getCategory, "标准物质").ne(ReagentConsumableInventory::getCategory, "标准储备溶液")); if (reagentConsumableInventoryVOIPage != null) {
} else { return reagentConsumableInventoryVOIPage;
reagentConsumableInventory = this.getOne(new LambdaQueryWrapper<ReagentConsumableInventory>().eq(ReagentConsumableInventory::getReagentConsumableInventoryId, batchDetails.getReagentConsumableInventoryId()).ne(ReagentConsumableInventory::getCategory, "试剂").ne(ReagentConsumableInventory::getCategory, "耗材")); } else return null;
}
if (reagentConsumableInventory != null) {
ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO();
BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryVO);
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId()));
reagentConsumableInventoryVOList.add(reagentConsumableInventoryVO);
}
}
} }
PageUtils pageUtils = new PageUtils(); // List<ReagentConsumableInventoryVO> reagentConsumableInventoryVOList = new ArrayList<>();
return pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), reagentConsumableInventoryVOList); // List<BatchDetails> list = batchDetailsService.list(Wrappers.<BatchDetails>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//入库增加库存 @Override//入库增加库存
@ -196,7 +203,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Override//分页查询标准物质 @Override//分页查询标准物质
public IPage<ReferenceMaterialFullVO> getStandardAllList(Page page, QueryWrapper<ReferenceMaterial> qw, Integer status, String number) { public IPage<ReferenceMaterialFullVO> getStandardAllList(Page page, String reagentConsumableName, Integer referenceMaterialStatus) {
// //如果扫码 // //如果扫码
// if (StrUtil.isNotBlank(number)) { // if (StrUtil.isNotBlank(number)) {
// ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(Wrappers.<ReferenceMaterial>query().eq("number", number)); // ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(Wrappers.<ReferenceMaterial>query().eq("number", number));
@ -210,7 +217,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
// //
// } // }
// } // }
IPage<ReferenceMaterialFullVO> referenceMaterialPage = baseMapper.getReferenceMaterialPage(page, qw); IPage<ReferenceMaterialFullVO> referenceMaterialPage = baseMapper.getReferenceMaterialPage(page, referenceMaterialStatus, reagentConsumableName);
return referenceMaterialPage; return referenceMaterialPage;
} }
@ -224,10 +231,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
throw new RuntimeException(String.format("未能查询到该ID对应的标准物质")); throw new RuntimeException(String.format("未能查询到该ID对应的标准物质"));
} }
ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO(); ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO();
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(referenceMaterial.getReagentConsumableId());
ReagentConsumableInventory byId = this.getById(referenceMaterial.getReagentConsumableInventoryId()); BeanUtils.copyProperties(reagentConsumables, reagentConsumableInventoryFullVO);
BeanUtils.copyProperties(byId, reagentConsumableInventoryFullVO);
reagentConsumableInventoryFullVO.setNumber(referenceMaterial.getNumber()); reagentConsumableInventoryFullVO.setNumber(referenceMaterial.getNumber());
reagentConsumableInventoryFullVO.setBatchDetailsId(referenceMaterial.getBatchDetailsId()); reagentConsumableInventoryFullVO.setBatchDetailsId(referenceMaterial.getBatchDetailsId());
BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId()); BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
@ -247,9 +253,11 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
List<StandardMaterialApplication> list = standardMaterialApplicationService.list(new LambdaQueryWrapper<StandardMaterialApplication>().eq(StandardMaterialApplication::getReferenceMaterialId, id).orderByDesc(StandardMaterialApplication::getDateOfClaim)); List<StandardMaterialApplication> list = standardMaterialApplicationService.list(new LambdaQueryWrapper<StandardMaterialApplication>().eq(StandardMaterialApplication::getReferenceMaterialId, id).orderByDesc(StandardMaterialApplication::getDateOfClaim));
R<SysUser> userR = remoteUserService.innerGetById(list.get(0).getRecipientId()); if (list.size() > 0) {
reagentConsumableInventoryFullVO.setHolderName(userR.getData().getName()); R<SysUser> userR = remoteUserService.innerGetById(list.get(0).getRecipientId());
reagentConsumableInventoryFullVO.setHolderId(userR.getData().getUserId()); reagentConsumableInventoryFullVO.setHolderName(userR.getData().getName());
reagentConsumableInventoryFullVO.setHolderId(userR.getData().getUserId());
}
if (one1 != null) { if (one1 != null) {
reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration()); reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration());
@ -341,7 +349,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
System.out.println("referenceMaterialTablePDF................."); System.out.println("referenceMaterialTablePDF.................");
for (ReferenceMaterialVO referenceMaterialVO : voList) { for (ReferenceMaterialVO referenceMaterialVO : voList) {
referenceMaterialVO.setTime(LocalDateTimeUtil.format(referenceMaterialVO.getCreateTime(),"yyyy-MM-dd")); referenceMaterialVO.setTime(LocalDateTimeUtil.format(referenceMaterialVO.getCreateTime(), "yyyy-MM-dd"));
} }
int x = 1; int x = 1;
@ -386,7 +394,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray()); ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close(); fosWord.close();
ossFile.fileSave("document" + "/" + "referenceMaterial" + "/" + id + "/" + applyFileName + ".docx",fisWord); ossFile.fileSave("document" + "/" + "referenceMaterial" + "/" + id + "/" + applyFileName + ".docx", fisWord);
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord); //MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
// MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord); // MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
@ -411,19 +419,11 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
//试剂/耗材扫描物品编码进行持久化 //试剂/耗材扫描物品编码进行持久化
@Override @Override
public void setCode(String id, String code) { public void setCode(String id, String code) {
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(id);
ReagentConsumables byId = reagentConsumablesService.getById(id); if (reagentConsumables != null) {
reagentConsumables.setCode(code);
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query().eq("reagent_consumable_id", id)); reagentConsumablesService.updateById(reagentConsumables);
if (byId != null & one != null) {
byId.setCode(code);
one.setCode(code);
this.updateById(one);
reagentConsumablesService.updateById(byId);
} }
} }
@Override @Override
@ -525,7 +525,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
reagentConsumableInventoryDTO.setAlias(""); reagentConsumableInventoryDTO.setAlias("");
} }
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query().eq("reagent_consumable_name", reagentConsumableInventoryDTO.getReagentConsumableName()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getBrand()), "brand", reagentConsumableInventoryDTO.getBrand()).eq("category", reagentConsumableInventoryDTO.getCategory()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecificationAndModel()), "specification_and_model", reagentConsumableInventoryDTO.getSpecificationAndModel()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getStandardValueOrPurity()), "standard_value_or_purity", reagentConsumableInventoryDTO.getStandardValueOrPurity()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getCasNumber()), "cas_number", reagentConsumableInventoryDTO.getCasNumber()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecies()), "species", reagentConsumableInventoryDTO.getSpecies()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getEnglishName()), "english_name", reagentConsumableInventoryDTO.getEnglishName()).eq(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.<ReagentConsumables>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 batchDetails = new BatchDetails();
batchDetails.setServiceStatus(1); batchDetails.setServiceStatus(1);
batchDetails.setQuantity(quantity); batchDetails.setQuantity(quantity);
@ -559,18 +559,18 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
batchDetails.setBatchNumber("/"); batchDetails.setBatchNumber("/");
batchDetails.setBatchDetailsId(IdWorker.get32UUID().toUpperCase()); batchDetails.setBatchDetailsId(IdWorker.get32UUID().toUpperCase());
batchDetails.setRoomNo(reagentConsumableInventoryDTO.getRoomNo()); batchDetails.setRoomNo(reagentConsumableInventoryDTO.getRoomNo());
if (one != null) { if (oldReagentConsumables != null) {
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId())); ReagentConsumableInventory inventory = this.getOne(Wrappers.<ReagentConsumableInventory>lambdaQuery().eq(ReagentConsumableInventory::getReagentConsumableId, oldReagentConsumables.getReagentConsumableId()));
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", inventory.getReagentConsumableInventoryId()));
if (batchDetailsList != null & batchDetailsList.size() > 0) { if (batchDetailsList != null & batchDetailsList.size() > 0) {
int x = batchDetailsList.size() + 1; int x = batchDetailsList.size() + 1;
batchDetails.setBatch("2023-" + x); batchDetails.setBatch("2023-" + x);
one.setTotalQuantity(one.getTotalQuantity() + quantity); inventory.setTotalQuantity(inventory.getTotalQuantity() + quantity);
this.updateById(one); this.updateById(inventory);
} }
batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); batchDetails.setReagentConsumableInventoryId(inventory.getReagentConsumableInventoryId());
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(one.getReagentConsumableId()); if (!oldReagentConsumables.getCategory().equals("标准物质")) {
if (!one.getCategory().equals("标准物质")) { ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query().eq("room_no", reagentConsumableInventoryDTO.getRoomNo()).eq("reagent_consumable_id", oldReagentConsumables.getReagentConsumableId()));
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query().eq("room_no", reagentConsumableInventoryDTO.getRoomNo()).eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId()));
if (reagentConsumableStash != null) { if (reagentConsumableStash != null) {
reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + quantity); reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + quantity);
batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId()); batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId());
@ -580,15 +580,15 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
BeanUtils.copyProperties(reagentConsumableInventoryDTO, consumableStash); BeanUtils.copyProperties(reagentConsumableInventoryDTO, consumableStash);
consumableStash.setId(IdWorker.get32UUID().toUpperCase()); consumableStash.setId(IdWorker.get32UUID().toUpperCase());
consumableStash.setTotalQuantity(quantity); consumableStash.setTotalQuantity(quantity);
consumableStash.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); consumableStash.setReagentConsumableId(oldReagentConsumables.getReagentConsumableId());
batchDetails.setReagentConsumableStashId(consumableStash.getId()); batchDetails.setReagentConsumableStashId(consumableStash.getId());
reagentConsumableStashService.save(consumableStash); reagentConsumableStashService.save(consumableStash);
} }
} }
if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) { if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) {
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); ReferenceMaterial referenceMaterial = new ReferenceMaterial();
referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); referenceMaterial.setReagentConsumableId(oldReagentConsumables.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); referenceMaterial.setReagentConsumableInventoryId(inventory.getReagentConsumableInventoryId());
referenceMaterial.setLocation(location); referenceMaterial.setLocation(location);
referenceMaterial.setStatus(0); referenceMaterial.setStatus(0);
referenceMaterial.setLatticeId(cabinetCell.getId()); referenceMaterial.setLatticeId(cabinetCell.getId());
@ -604,28 +604,30 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
referenceMaterialService.save(referenceMaterial); referenceMaterialService.save(referenceMaterial);
this.updateCabinet(cabinetCell.getId(), referenceMaterial.getId(), 1); this.updateCabinet(cabinetCell.getId(), referenceMaterial.getId(), 1);
} }
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1); this.updateCabinet(cabinetCell.getId(), oldReagentConsumables.getReagentConsumableId(), 1);
} else { } else {
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory();
BeanUtils.copyProperties(reagentConsumableInventoryDTO, reagentConsumableInventory); ReagentConsumables reagentConsumables = new ReagentConsumables();
BeanUtils.copyProperties(reagentConsumableInventoryDTO, reagentConsumables);
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase());
reagentConsumableInventory.setWarningValue(1); reagentConsumableInventory.setWarningValue(1);
if (reagentConsumableInventoryDTO.getPackages() != null) { if (reagentConsumableInventoryDTO.getPackages() != null) {
if (reagentConsumableInventoryDTO.getSpecificationAndModel().equals("/")) { if (reagentConsumableInventoryDTO.getSpecificationAndModel().equals("/")) {
reagentConsumableInventory.setSpecificationAndModel(reagentConsumableInventoryDTO.getPackages()); reagentConsumables.setSpecificationAndModel(reagentConsumableInventoryDTO.getPackages());
} else { } else {
reagentConsumableInventory.setSpecificationAndModel(reagentConsumableInventoryDTO.getSpecificationAndModel() + "," + reagentConsumableInventoryDTO.getPackages()); reagentConsumables.setSpecificationAndModel(reagentConsumableInventoryDTO.getSpecificationAndModel() + "," + reagentConsumableInventoryDTO.getPackages());
} }
} }
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(reagentConsumableInventory); reagentConsumables.setReagentConsumableId(IdWorker.get32UUID().toUpperCase());
reagentConsumablesService.save(reagentConsumables);
reagentConsumableInventory.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); reagentConsumableInventory.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
reagentConsumableInventory.setTotalQuantity(quantity); reagentConsumableInventory.setTotalQuantity(quantity);
this.save(reagentConsumableInventory); this.save(reagentConsumableInventory);
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1); this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1);
if (!reagentConsumableInventory.getCategory().equals("标准物质")) { if (!reagentConsumables.getCategory().equals("标准物质")) {
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query().eq("room_no", reagentConsumableInventoryDTO.getRoomNo()).eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId())); ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query().eq("room_no", reagentConsumableInventoryDTO.getRoomNo()).eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId()));
if (reagentConsumableStash != null) { if (reagentConsumableStash != null) {
reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + quantity); reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + quantity);
@ -738,11 +740,15 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
BeanUtils.copyProperties(batchDetails, batchDetailsVO); BeanUtils.copyProperties(batchDetails, batchDetailsVO);
batchDetailsVO.setSupplierName(supplierInformationService.getById(batchDetails.getSupplierId()).getSupplierName()); batchDetailsVO.setSupplierName(supplierInformationService.getById(batchDetails.getSupplierId()).getSupplierName());
ReagentConsumableInventory reagentConsumableInventory = this.getById(batchDetails.getReagentConsumableInventoryId()); ReagentConsumableInventory reagentConsumableInventory = this.getById(batchDetails.getReagentConsumableInventoryId());
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(reagentConsumableInventory.getReagentConsumableId());
ReagentConsumableInventoryVO vo = new ReagentConsumableInventoryVO();
BeanUtils.copyProperties(reagentConsumableInventory, vo);
BeanUtils.copyProperties(reagentConsumables, vo);
List<LocationInfoVO> locationInfoVOList = locationInfoService.getListById(id); List<LocationInfoVO> locationInfoVOList = locationInfoService.getListById(id);
HashMap<String, Object> objectObjectHashMap = new HashMap<>(); HashMap<String, Object> objectObjectHashMap = new HashMap<>();
objectObjectHashMap.put("batchDetails", batchDetailsVO); objectObjectHashMap.put("batchDetails", batchDetailsVO);
objectObjectHashMap.put("reagentConsumableInventory", reagentConsumableInventory); objectObjectHashMap.put("reagentConsumableInventory", vo);
objectObjectHashMap.put("locationInfoVOList", locationInfoVOList); objectObjectHashMap.put("locationInfoVOList", locationInfoVOList);
return objectObjectHashMap; return objectObjectHashMap;

@ -102,7 +102,6 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
public StandardReserveSolutionVO addById(StandardReserveSolutionDTO standardReserveSolutionDTO, DLPUser dlpUser) { public StandardReserveSolutionVO addById(StandardReserveSolutionDTO standardReserveSolutionDTO, DLPUser dlpUser) {
if (referenceMaterialService.getById(standardReserveSolutionDTO.getReferenceMaterialId()).getStatus() != -3) { if (referenceMaterialService.getById(standardReserveSolutionDTO.getReferenceMaterialId()).getStatus() != -3) {
throw new RuntimeException(String.format("请先领用标准物质后,再进行操作")); throw new RuntimeException(String.format("请先领用标准物质后,再进行操作"));
} }
@ -110,7 +109,6 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
StandardReserveSolution standardReserveSolution = new StandardReserveSolution(); StandardReserveSolution standardReserveSolution = new StandardReserveSolution();
BeanUtils.copyProperties(standardReserveSolutionDTO, standardReserveSolution); BeanUtils.copyProperties(standardReserveSolutionDTO, standardReserveSolution);
standardReserveSolution.setReferenceMaterialScale(standardReserveSolutionDTO.getReferenceMaterialScale()); standardReserveSolution.setReferenceMaterialScale(standardReserveSolutionDTO.getReferenceMaterialScale());
standardReserveSolution.setConstantVolume(standardReserveSolutionDTO.getConstantVolume()); standardReserveSolution.setConstantVolume(standardReserveSolutionDTO.getConstantVolume());
@ -126,37 +124,27 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
standardReserveSolution.setConfigurationConcentration(v); standardReserveSolution.setConfigurationConcentration(v);
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); ReagentConsumables reagentConsumables = reagentConsumablesService.getOne(Wrappers.<ReagentConsumables>lambdaQuery().eq(ReagentConsumables::getReagentConsumableName, standardReserveSolution.getSolutionName()).eq(ReagentConsumables::getConfigurationConcentration, standardReserveSolution.getConfigurationConcentration()));
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableName, standardReserveSolution.getSolutionName());
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getConfigurationConcentration, standardReserveSolution.getConfigurationConcentration());
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper);
//判断是否存在过该标准储备溶液,若未存在,则将其存入试剂耗材类 //判断是否存在过该标准储备溶液,若未存在,则将其存入试剂耗材类
if (one == null) { if (reagentConsumables == null) {
ReferenceMaterial material = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId());
ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId());
//创建一个标准储备溶液的种类对象 //创建一个标准储备溶液的种类对象
ReagentConsumables reagentConsumables1 = reagentConsumablesService.getById(byId.getReagentConsumableId()); ReagentConsumables reagentConsumablesByRem = reagentConsumablesService.getById(material.getReagentConsumableId());
reagentConsumables1.setReagentConsumableId(IdWorker.get32UUID().toUpperCase()); reagentConsumablesByRem.setReagentConsumableId(IdWorker.get32UUID().toUpperCase());
reagentConsumables1.setReagentConsumableName(standardReserveSolution.getSolutionName()); reagentConsumablesByRem.setReagentConsumableName(standardReserveSolution.getSolutionName());
reagentConsumables1.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration()); reagentConsumablesByRem.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration());
reagentConsumables1.setCategory("标准储备溶液"); reagentConsumablesByRem.setCategory("标准储备溶液");
reagentConsumables1.setCreateTime(LocalDateTime.now()); reagentConsumablesByRem.setCreateTime(LocalDateTime.now());
reagentConsumables1.setUpdateTime(LocalDateTime.now()); reagentConsumablesByRem.setUpdateTime(LocalDateTime.now());
reagentConsumablesService.save(reagentConsumables1); reagentConsumablesService.save(reagentConsumablesByRem);
//创建标准储备溶液的库存对象 //创建标准储备溶液的库存对象
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory();
reagentConsumableInventory.setReagentConsumableId(reagentConsumablesByRem.getReagentConsumableId());
BeanUtils.copyProperties(reagentConsumables1, reagentConsumableInventory);
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase());
reagentConsumableInventory.setStatus(1); reagentConsumableInventory.setStatus(1);
reagentConsumableInventory.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration());
reagentConsumableInventory.setCreateTime(LocalDateTime.now()); reagentConsumableInventory.setCreateTime(LocalDateTime.now());
reagentConsumableInventory.setUpdateTime(LocalDateTime.now()); reagentConsumableInventory.setUpdateTime(LocalDateTime.now());
reagentConsumableInventory.setTotalQuantity(0); reagentConsumableInventory.setTotalQuantity(0);
@ -165,9 +153,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); ReferenceMaterial referenceMaterial = new ReferenceMaterial();
referenceMaterial.setMass(standardReserveSolutionDTO.getConstantVolume()); referenceMaterial.setMass(standardReserveSolutionDTO.getConstantVolume());
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolutionDTO.getReferenceMaterialId()); String prefix = material.getNumber() + "-";
String prefix = referenceMaterialServiceById.getNumber() + "-";
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
.likeRight("number", prefix) .likeRight("number", prefix)
@ -192,21 +178,15 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
referenceMaterial.setReagentConsumableId(reagentConsumableInventory.getReagentConsumableId()); referenceMaterial.setReagentConsumableId(reagentConsumableInventory.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
referenceMaterial.setNumber(prefix + newNo); referenceMaterial.setNumber(prefix + newNo);
referenceMaterial.setReagentConsumableName(reagentConsumableInventory.getReagentConsumableName()); referenceMaterial.setReagentConsumableName(standardReserveSolution.getSolutionName());
referenceMaterial.setReferenceMaterialUnit("ml"); referenceMaterial.setReferenceMaterialUnit("ml");
referenceMaterial.setMass(standardReserveSolutionDTO.getConstantVolume()); referenceMaterial.setMass(standardReserveSolutionDTO.getConstantVolume());
ReferenceMaterial byId1 = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId());
BatchDetails batchDetails = batchDetailsService.getById(byId.getBatchDetailsId());
BatchDetails batchDetails = batchDetailsService.getById(material.getBatchDetailsId());
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
referenceMaterialService.save(referenceMaterial); referenceMaterialService.save(referenceMaterial);
standardReserveSolution.setReferenceId(referenceMaterial.getId()); standardReserveSolution.setReferenceId(referenceMaterial.getId());
standardReserveSolution.setSolutionNumbering(referenceMaterial.getNumber()); standardReserveSolution.setSolutionNumbering(referenceMaterial.getNumber());
if (reagentConsumableInventoryService.save(reagentConsumableInventory) && this if (reagentConsumableInventoryService.save(reagentConsumableInventory) && this
@ -219,12 +199,10 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
} else { } else {
ReferenceMaterial byId1 = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId()); ReferenceMaterial material = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId());
BatchDetails batchDetails = batchDetailsService.getById(material.getBatchDetailsId());
BatchDetails batchDetails = batchDetailsService.getById(byId1.getBatchDetailsId()); ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getOne(Wrappers.<ReagentConsumableInventory>lambdaQuery().eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumables.getReagentConsumableId()));
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); ReferenceMaterial referenceMaterial = new ReferenceMaterial();
LocalDate date = LocalDate.now(); // get the current date LocalDate date = LocalDate.now(); // get the current date
//获取当前年月日 //获取当前年月日
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@ -235,16 +213,13 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
referenceMaterial.setStatus(-5); referenceMaterial.setStatus(-5);
referenceMaterial.setMass(standardReserveSolutionDTO.getConstantVolume()); referenceMaterial.setMass(standardReserveSolutionDTO.getConstantVolume());
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setReagentConsumableId(one.getReagentConsumableId()); referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
referenceMaterial.setReferenceMaterialUnit("ml"); referenceMaterial.setReferenceMaterialUnit("ml");
referenceMaterial.setMass(standardReserveSolutionDTO.getConstantVolume()); referenceMaterial.setMass(standardReserveSolutionDTO.getConstantVolume());
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolutionDTO.getReferenceMaterialId()); String prefix = material.getNumber() + "-";
String prefix = referenceMaterialServiceById.getNumber() + "-";
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
.likeRight("number", prefix) .likeRight("number", prefix)
@ -338,6 +313,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterialServiceById.getReagentConsumableInventoryId()); ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterialServiceById.getReagentConsumableInventoryId());
reagentConsumableInventoryService.updateCabinet(referenceMaterialServiceById.getLatticeId(), referenceMaterialServiceById.getId(), 1); reagentConsumableInventoryService.updateCabinet(referenceMaterialServiceById.getLatticeId(), referenceMaterialServiceById.getId(), 1);
reagentConsumableInventory.setWarningInformation("/");
if (reagentConsumableInventory.getTotalQuantity() != null) { if (reagentConsumableInventory.getTotalQuantity() != null) {
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + 1); reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + 1);

@ -9,7 +9,6 @@ import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
import digital.laboratory.platform.reagent.service.ReferenceMaterialService; import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
import digital.laboratory.platform.reagent.service.WarehousingBatchListService; import digital.laboratory.platform.reagent.service.WarehousingBatchListService;
import digital.laboratory.platform.reagent.service.WarehousingContentService; import digital.laboratory.platform.reagent.service.WarehousingContentService;
import digital.laboratory.platform.reagent.vo.RVO;
import digital.laboratory.platform.reagent.vo.WarehousingBatchListVO; import digital.laboratory.platform.reagent.vo.WarehousingBatchListVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -39,32 +38,27 @@ public class WarehousingBatchListServiceImpl extends ServiceImpl<WarehousingBatc
@Override @Override
public List<WarehousingBatchListVO> getWarehousingBatchListVOList(String warehousingContentId) { public List<WarehousingBatchListVO> getWarehousingBatchListVOList(String warehousingRecordFormId,String keywords) {
List<WarehousingBatchListVO> warehousingBatchListVOList = baseMapper.getWarehousingBatchListVOList(warehousingContentId); List<WarehousingBatchListVO> warehousingBatchListVOList = baseMapper.getWarehousingBatchListVOList(warehousingRecordFormId, keywords);
ArrayList<RVO> rvos = new ArrayList<>(); // ArrayList<RVO> rvos = new ArrayList<>();
//
for (WarehousingBatchListVO warehousingBatchListVO : warehousingBatchListVOList) { // for (WarehousingBatchListVO warehousingBatchListVO : warehousingBatchListVOList) {
//
if (warehousingBatchListVO.getBatchId() != null) { // if (warehousingBatchListVO.getBatchId() != null) {
// List<ReferenceMaterial> batch_details_id = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query().eq("batch_details_id", warehousingBatchListVO.getBatchId()));
List<ReferenceMaterial> batch_details_id = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query().eq("batch_details_id", warehousingBatchListVO.getBatchId()) // for (ReferenceMaterial referenceMaterial : batch_details_id) {
); // if (reagentConsumablesService.getById(referenceMaterial.getReagentConsumableId()).getCategory().equals("标准物质")) {
// RVO rvo = new RVO();
for (ReferenceMaterial referenceMaterial : batch_details_id) { // rvo.setId(referenceMaterial.getId());
// rvo.setNumber(referenceMaterial.getNumber());
if (reagentConsumablesService.getById(referenceMaterial.getReagentConsumableId()).getCategory().equals("标准物质")) { // rvos.add(rvo);
// }
RVO rvo = new RVO(); // }
rvo.setId(referenceMaterial.getId()); // }
rvo.setNumber(referenceMaterial.getNumber()); // warehousingBatchListVO.setIdList(rvos);
rvos.add(rvo); // }
}
}
}
warehousingBatchListVO.setIdList(rvos);
}
return warehousingBatchListVOList; return warehousingBatchListVOList;
} }
} }

@ -26,53 +26,18 @@ public class WarehousingContentServiceImpl extends ServiceImpl<WarehousingConten
@Autowired @Autowired
private WarehousingBatchListService warehousingBatchListService; private WarehousingBatchListService warehousingBatchListService;
@Autowired
private ReagentConsumablesService reagentConsumablesService;
@Autowired
private ReagentConsumableInventoryService reagentConsumableInventoryService;
@Override @Override
public List<WarehousingContentVO> getWarehousingContentVOList(String warehousingRecordFormId) { public List<WarehousingContentVO> getWarehousingContentVOList(String warehousingRecordFormId, Integer oopCode, String keywords, String category) {
List<WarehousingContentVO> warehousingContentVOList = baseMapper.getWarehousingContentVOList(warehousingRecordFormId, oopCode, keywords, category);
List<WarehousingContentVO> warehousingContentVOList = baseMapper.getWarehousingContentVOList(warehousingRecordFormId);
for (WarehousingContentVO warehousingContentVO : warehousingContentVOList) {
List<WarehousingBatchListVO> 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.<ReagentConsumableInventory>query().eq("reagent_consumable_id", byId.getReagentConsumableId()));
if (one != null) {
warehousingContentVO.setWarningValue(one.getWarningValue());}
}
}
return warehousingContentVOList; return warehousingContentVOList;
} }
// public List<WarehousingBatchListVO> getBatchList(String warehousingRecordFormId){
//
// }
@Override @Override
public IPage<WarehousingContentVO> getWarehousingContentVOPage(Page page, QueryWrapper<WarehousingContent> qw) { public IPage<WarehousingContentVO> getWarehousingContentVOPage(Page page, QueryWrapper<WarehousingContent> qw) {
return baseMapper.getWarehousingContentVOPage(page, qw);
IPage<WarehousingContentVO> warehousingContentVOPage = baseMapper.getWarehousingContentVOPage(page, qw);
List<WarehousingContentVO> records = warehousingContentVOPage.getRecords();
for (WarehousingContentVO record : records) {
List<WarehousingBatchListVO> warehousingBatchListVOList = warehousingBatchListService.getWarehousingBatchListVOList(record.getId());
record.setWarehousingBatchListVOList(warehousingBatchListVOList);
}
return warehousingContentVOPage;
} }
} }

@ -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.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.dto.WarehousingRecordFormDTO; import digital.laboratory.platform.reagent.dto.WarehousingRecordFormDTO;
import digital.laboratory.platform.reagent.entity.*; 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.mapper.WarehousingRecordFormMapper;
import digital.laboratory.platform.reagent.service.*; import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.vo.*; import digital.laboratory.platform.reagent.vo.*;
import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData;
import digital.laboratory.platform.sys.feign.RemoteCabinetService; import digital.laboratory.platform.sys.feign.RemoteCabinetService;
//import io.seata.spring.annotation.GlobalTransactional; //import io.seata.spring.annotation.GlobalTransactional;
import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
@ -98,16 +99,36 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
@Autowired @Autowired
private ReagentConsumableStashService reagentConsumableStashService; private ReagentConsumableStashService reagentConsumableStashService;
@Resource
private WarehousingContentMapper warehousingContentMapper;
@Resource
private WarehousingBatchListMapper warehousingBatchListMapper;
@GlobalTransactional//查看采购入库 @GlobalTransactional//查看采购入库
public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) { @Override
WarehousingRecordForm byId = this.getById(warehousingFormId); public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingRecordFormId, Integer opCode, String keywords, String category) {
WarehousingRecordFormVO warehousingRecordFormVO = new WarehousingRecordFormVO(); WarehousingRecordForm form = this.getById(warehousingRecordFormId);
BeanUtils.copyProperties(byId, warehousingRecordFormVO); WarehousingRecordFormVO vo = new WarehousingRecordFormVO();
BeanUtils.copyProperties(form, vo);
//查询出签收物品明细,将明细添加至签收记录VO //查询出签收物品明细,将明细添加至签收记录VO
warehousingRecordFormVO.setWarehousingContentVOList(warehousingContentService.getWarehousingContentVOList(warehousingFormId)); List<WarehousingContentVO> warehousingContentVOList = warehousingContentMapper.getWarehousingContentVOList(warehousingRecordFormId, opCode, keywords, category);
return warehousingRecordFormVO; // List<WarehousingBatchListVO> warehousingBatchListVOList = warehousingBatchListMapper.getWarehousingBatchListVOList(warehousingRecordFormId, keywords);
// for (int i = 0; i < warehousingContentVOList.size(); i++) {
// if (i == 0) {
// warehousingContentVOList.get(i).setWarehousingBatchListVOList(warehousingBatchListVOList);
// } else {
// List<WarehousingBatchListVO> warehousingBatchListVOS = new ArrayList<>();
// warehousingContentVOList.get(i).setWarehousingBatchListVOList(warehousingBatchListVOS);
// }
// }
vo.setWarehousingContentVOList(warehousingContentVOList);
return vo;
} }
@Override
public List<WarehousingBatchListVO> getBatchList(String warehousingRecordFormId, String keywords) {
return warehousingBatchListMapper.getWarehousingBatchListVOList(warehousingRecordFormId, keywords);
}
@GlobalTransactional @GlobalTransactional
@Override//录入入库明细 @Override//录入入库明细
@ -144,21 +165,18 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
Integer quantity = warehousingRecordFormDTO.getQuantity() * Integer.valueOf(reagentConsumables.getPackagedCopies());//入库数量=购买数量x包装份数 Integer quantity = warehousingRecordFormDTO.getQuantity() * Integer.valueOf(reagentConsumables.getPackagedCopies());//入库数量=购买数量x包装份数
//判断采购数量与签收数量
if (warehousingContent.getWarehousingQuantity() > warehousingContent.getTotalQuantity()) {
throw new RuntimeException(String.format("入库数量不能大于采购数量"));
}
warehousingBatchList.setBatch(warehousingBatchListService.list(Wrappers.<WarehousingBatchList>query().eq("warehousing_content_id", warehousingBatchList.getWarehousingContentId())).size() + 1); warehousingBatchList.setBatch(warehousingBatchListService.list(Wrappers.<WarehousingBatchList>query().eq("warehousing_content_id", warehousingBatchList.getWarehousingContentId())).size() + 1);
warehousingContent.setLastStorageLocation(warehousingRecordFormDTO.getLocation());//记录存放位置信息,以便下次签收同样物品时可以回显位置信息 warehousingContent.setLastStorageLocation(warehousingRecordFormDTO.getLocation());//记录存放位置信息,以便下次签收同样物品时可以回显位置信息
warehousingContent.setBoxId(boxId);//柜子ID warehousingContent.setBoxId(boxId);//柜子ID
warehousingContent.setLatticeId(latticeId);//格子ID warehousingContent.setLatticeId(latticeId);//格子ID
warehousingContent.setWarehousingQuantity(warehousingContent.getWarehousingQuantity() + warehousingBatchList.getQuantity());//修改签收数量 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()); warehousingContent.setCode(warehousingRecordFormDTO.getCode());
} }
@ -171,13 +189,12 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
reagentConsumableInventory.setStatus(1);//状态 1为正常 reagentConsumableInventory.setStatus(1);//状态 1为正常
reagentConsumableInventory.setCreateTime(LocalDateTime.now()); reagentConsumableInventory.setCreateTime(LocalDateTime.now());
reagentConsumableInventory.setUpdateTime(LocalDateTime.now()); reagentConsumableInventory.setUpdateTime(LocalDateTime.now());
reagentConsumableInventory.setWarningValue(warehousingRecordFormDTO.getWarningValue());//预警值 reagentConsumableInventory.setWarningValue(warehousingRecordFormDTO.getWarningValue());//预警值
//如果供应商未提供物品编码,则需在入库时扫描标签录入编码 //如果供应商未提供物品编码,则需在入库时扫描标签录入编码
if (StrUtil.isNotBlank(warehousingRecordFormDTO.getCode())) { if (StrUtil.isNotBlank(warehousingRecordFormDTO.getCode())) {
reagentConsumableInventory.setCode(warehousingRecordFormDTO.getCode());
reagentConsumables.setCode(warehousingRecordFormDTO.getCode()); reagentConsumables.setCode(warehousingRecordFormDTO.getCode());
} else { } else {
reagentConsumableInventory.setCode("");
reagentConsumables.setCode(""); reagentConsumables.setCode("");
} }
reagentConsumablesService.updateById(reagentConsumables); reagentConsumablesService.updateById(reagentConsumables);
@ -208,7 +225,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
if (!reagentConsumables.getCategory().equals("标准物质")) { if (!reagentConsumables.getCategory().equals("标准物质")) {
ReagentConsumableStash reagentConsumableStash = new ReagentConsumableStash(); ReagentConsumableStash reagentConsumableStash = new ReagentConsumableStash();
BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableStash); BeanUtils.copyProperties(reagentConsumables, reagentConsumableStash);
reagentConsumableStash.setId(IdWorker.get32UUID().toUpperCase()); reagentConsumableStash.setId(IdWorker.get32UUID().toUpperCase());
reagentConsumableStash.setRoomNo(roomNo); reagentConsumableStash.setRoomNo(roomNo);
reagentConsumableStash.setReagentConsumableId(reagentConsumables.getReagentConsumableId()); reagentConsumableStash.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
@ -267,7 +284,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
} else { } else {
//如果仓库存在该物品 //如果仓库存在该物品
if (warehousingRecordFormDTO.getCode() != null) { if (warehousingRecordFormDTO.getCode() != null) {
one.setCode(warehousingRecordFormDTO.getCode());
reagentConsumables.setCode(warehousingContent.getCode()); reagentConsumables.setCode(warehousingContent.getCode());
reagentConsumablesService.updateById(reagentConsumables); reagentConsumablesService.updateById(reagentConsumables);
} }
@ -299,7 +315,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
.eq("room_no", roomNo)); .eq("room_no", roomNo));
if (reagentConsumableStash == null) { if (reagentConsumableStash == null) {
ReagentConsumableStash newReagentConsumableStash = new ReagentConsumableStash(); ReagentConsumableStash newReagentConsumableStash = new ReagentConsumableStash();
BeanUtils.copyProperties(one, newReagentConsumableStash); BeanUtils.copyProperties(reagentConsumables, newReagentConsumableStash);
newReagentConsumableStash.setId(IdWorker.get32UUID().toUpperCase()); newReagentConsumableStash.setId(IdWorker.get32UUID().toUpperCase());
newReagentConsumableStash.setRoomNo(roomNo); newReagentConsumableStash.setRoomNo(roomNo);
newReagentConsumableStash.setTotalQuantity(quantity); newReagentConsumableStash.setTotalQuantity(quantity);
@ -324,14 +340,14 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
Integer x = batchDetailsList.size() + 1; Integer x = batchDetailsList.size() + 1;
batchDetails.setBatch(year + "-" + x); batchDetails.setBatch(year + "-" + x);
} }
if (one.getCategory().equals("试剂") | one.getCategory().equals("耗材")) { if (reagentConsumables.getCategory().equals("试剂") | reagentConsumables.getCategory().equals("耗材")) {
//更新格子信息(试剂耗材传入类ID) //更新格子信息(试剂耗材传入类ID)
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), one.getReagentConsumableInventoryId(), 1); reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), one.getReagentConsumableInventoryId(), 1);
} }
one.setTotalQuantity(one.getTotalQuantity() + batchDetails.getQuantity()); one.setTotalQuantity(one.getTotalQuantity() + batchDetails.getQuantity());
one.setWarningValue(warehousingRecordFormDTO.getWarningValue()); one.setWarningValue(warehousingRecordFormDTO.getWarningValue());
if (one.getCategory().equals("标准物质")) { if (reagentConsumables.getCategory().equals("标准物质")) {
for (int j = 0; j < batchDetails.getQuantity(); j++) { for (int j = 0; j < batchDetails.getQuantity(); j++) {
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); ReferenceMaterial referenceMaterial = new ReferenceMaterial();
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
@ -412,7 +428,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.addForm(warehousingContent.getReagentConsumableId(), warehousingContent.getSupplierId(), acceptanceSignForServiceOne.getId()); AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.addForm(warehousingContent.getReagentConsumableId(), warehousingContent.getSupplierId(), acceptanceSignForServiceOne.getId());
warehousingContent.setAcceptanceRecordFormId(acceptanceRecordForm.getId()); warehousingContent.setAcceptanceRecordFormId(acceptanceRecordForm.getId());
} }
warehousingContentService.updateById(warehousingContent); warehousingContentService.updateById(warehousingContent);
} }
@ -449,6 +464,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
} }
this.updateById(warehousingRecordForm); this.updateById(warehousingRecordForm);
} }
@Override @Override
public IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm> qw) { public IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm> qw) {
IPage<WarehousingRecordFormVO> warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page, qw);//查询签收单列表 IPage<WarehousingRecordFormVO> warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page, qw);//查询签收单列表

@ -1,11 +1,14 @@
package digital.laboratory.platform.reagent.task; package digital.laboratory.platform.reagent.task;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import digital.laboratory.platform.reagent.entity.BatchDetails; import digital.laboratory.platform.reagent.entity.BatchDetails;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.entity.StandardReserveSolution; 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.service.*;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -15,6 +18,7 @@ import org.springframework.stereotype.Component;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Configuration @Configuration
@ -32,9 +36,11 @@ public class MaturityCalculation {
private final ReferenceMaterialService referenceMaterialService; private final ReferenceMaterialService referenceMaterialService;
private final ReagentConsumableInventoryMapper reagentConsumableInventoryMapper;
@Scheduled(cron = "1 0 0 * * ? ") @Scheduled(cron = "1 0 0 * * ? ")
public void calculate() { public void calculate() {
System.out.println("~~~~~~~~~~~~~~执行检测系统有效期情况~~~~~~~~~~~~~~");
//查找出有库存量的物品所有批次信息(状态为1) //查找出有库存量的物品所有批次信息(状态为1)
List<BatchDetails> list1 = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("service_status", 1)); List<BatchDetails> list1 = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("service_status", 1));
String warningInformation = null; String warningInformation = null;
@ -56,13 +62,9 @@ public class MaturityCalculation {
.eq("status", 1)); .eq("status", 1));
for (StandardReserveSolution standardReserveSolution : list) { for (StandardReserveSolution standardReserveSolution : list) {
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId()); ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId());
standardReserveSolutionService.updateById(standardReserveSolution); standardReserveSolutionService.updateById(standardReserveSolution);
} }
periodVerificationPlanService.getPlan(); periodVerificationPlanService.getPlan();
System.out.println("期间核查计划自动更新"); System.out.println("期间核查计划自动更新");
} }
@ -70,46 +72,39 @@ public class MaturityCalculation {
@Scheduled(cron = "0 0/1 * * * ? ") @Scheduled(cron = "0 0/1 * * * ? ")
public void inventoryReminder() { public void inventoryReminder() {
System.out.println("~~~~~~~~~~~~~~执行检测系统库存情况~~~~~~~~~~~~~~"+ LocalDateTimeUtil.format(LocalDateTime.now(),"yyyy-MM-dd HH:mm:ss"));
List<StandardReserveSolution> list2 = standardReserveSolutionService.list(Wrappers.<StandardReserveSolution>query() List<StandardReserveSolution> list2 = standardReserveSolutionService.list(Wrappers.<StandardReserveSolution>query()
.eq("status", 1)); .eq("status", 1));
for (StandardReserveSolution standardReserveSolution : list2) { for (StandardReserveSolution standardReserveSolution : list2) {
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId()); ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId());
if (referenceMaterialServiceById.getStatus() == -4) { if (referenceMaterialServiceById.getStatus() == -4) {
standardReserveSolution.setWarningInformation("已全部使用完毕或已报废"); standardReserveSolution.setWarningInformation("已全部使用完毕或已报废");
} }
} }
List<String> item = new ArrayList<>();
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list(Wrappers.<ReagentConsumableInventory>query().ne("category", "标准储备溶液")); item.add("试剂");
item.add("耗材");
item.add("标准物质");
List<ReagentConsumableInventoryVO> list = reagentConsumableInventoryMapper.getRciListByCategory(item);
for (ReagentConsumableInventory reagentConsumableInventory : list) { for (ReagentConsumableInventory reagentConsumableInventory : list) {
if (reagentConsumableInventory.getTotalQuantity() == 0) { if (reagentConsumableInventory.getTotalQuantity() == 0) {
reagentConsumableInventory.setWarningInformation("暂无库存"); reagentConsumableInventory.setWarningInformation("暂无库存");
} }
if (reagentConsumableInventory.getTotalQuantity() <= reagentConsumableInventory.getWarningValue()) { if (reagentConsumableInventory.getTotalQuantity() <= reagentConsumableInventory.getWarningValue()) {
reagentConsumableInventory.setWarningInformation("库存不足"); reagentConsumableInventory.setWarningInformation("库存不足");
} else { } else {
reagentConsumableInventory.setWarningInformation("库存充足"); reagentConsumableInventory.setWarningInformation("库存充足");
} }
reagentConsumableInventoryService.updateById(reagentConsumableInventory); reagentConsumableInventoryService.updateById(reagentConsumableInventory);
} }
// List<String> item1 = new ArrayList<>();
List<ReagentConsumableInventory> list1 = reagentConsumableInventoryService.list(Wrappers.<ReagentConsumableInventory>query().eq("category", "标准储备溶液")); // item1.add("标准储备溶液");
// List<ReagentConsumableInventoryVO> list1 = reagentConsumableInventoryMapper.getRciListByCategory(item1);
for (ReagentConsumableInventory reagentConsumableInventory : list1) { // for (ReagentConsumableInventory reagentConsumableInventory : list1) {
// reagentConsumableInventory.setWarningInformation("无");
reagentConsumableInventory.setWarningInformation("无"); // reagentConsumableInventoryService.updateById(reagentConsumableInventory);
// }
reagentConsumableInventoryService.updateById(reagentConsumableInventory);
}
} }
} }

@ -1,9 +0,0 @@
package digital.laboratory.platform.reagent.vo;
import lombok.Data;
@Data
public class RVO {
private String id;
private String number;
}

@ -1,5 +1,7 @@
package digital.laboratory.platform.reagent.vo; 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 digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -90,5 +92,102 @@ public class ReagentConsumableInventoryFullVO extends ReagentConsumableInventory
private String holderId; 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;
} }

@ -1,5 +1,7 @@
package digital.laboratory.platform.reagent.vo; 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 digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -24,6 +26,108 @@ public class ReagentConsumableInventoryVO extends ReagentConsumableInventory {
@ApiModelProperty(value="房间号") @ApiModelProperty(value="房间号")
private String roomNo; 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;

@ -1,6 +1,7 @@
package digital.laboratory.platform.reagent.vo; package digital.laboratory.platform.reagent.vo;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.entity.WarehousingBatchList; import digital.laboratory.platform.reagent.entity.WarehousingBatchList;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -10,9 +11,13 @@ import java.util.List;
@Data @Data
public class WarehousingBatchListVO extends WarehousingBatchList { public class WarehousingBatchListVO extends WarehousingBatchList {
@ApiModelProperty(value="入库人名称") @ApiModelProperty(value = "入库人名称")
private String depositorName; private String depositorName;
private List<ReferenceMaterial> idList;
private List<RVO> idList; private String reagentConsumableName;
private String reagentConsumableId;
private String standardValueOrPurity;
private String specificationAndModel;
private String category;
} }

@ -28,17 +28,17 @@ public class WarehousingContentVO extends WarehousingContent {
@ApiModelProperty(value = "(规格型号)") @ApiModelProperty(value = "(规格型号)")
private String specificationAndModel; private String specificationAndModel;
@ApiModelProperty(value="(标准值/纯度)") @ApiModelProperty(value = "(标准值/纯度)")
private String standardValueOrPurity; private String standardValueOrPurity;
@ApiModelProperty(value="单价") @ApiModelProperty(value = "单价")
private Double unitPrice; private Double unitPrice;
@ApiModelProperty(value="偏差/不确定度") @ApiModelProperty(value = "偏差/不确定度")
private String deviationOrUncertainty; private String deviationOrUncertainty;
@ApiModelProperty(value = "预警值")
private Integer warningValue;
} }

@ -7,47 +7,31 @@
<resultMap id="reagentConsumableInventoryMap" <resultMap id="reagentConsumableInventoryMap"
type="digital.laboratory.platform.reagent.entity.ReagentConsumableInventory"> type="digital.laboratory.platform.reagent.entity.ReagentConsumableInventory">
<id property="reagentConsumableInventoryId" column="reagent_consumable_inventory_id"/> <id property="reagentConsumableInventoryId" column="reagent_consumable_inventory_id"/>
<result property="brand" column="brand"/>
<result property="category" column="category"/>
<result property="deviationOrUncertainty" column="deviation_or_uncertainty"/>
<result property="instructionBookId" column="instruction_book_id"/> <result property="instructionBookId" column="instruction_book_id"/>
<result property="reagentConsumableId" column="reagent_consumable_id"/> <result property="reagentConsumableId" column="reagent_consumable_id"/>
<result property="specificationAndModel" column="specification_and_model"/> <result property="totalQuantity" column="total_quantity"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="standardValueOrPurity" column="standard_value_or_purity"/>
<result property="technicalParameter" column="technical_parameter"/>
<result property="totalQuantity" column="total_quantity"/>
<result property="species" column="species"/>
<result property="packagedCopies" column="packaged_copies"/>
<result property="configurationConcentration" column="configuration_concentration"/>
<result property="minimumUnit" column="minimum_unit"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<result property="storageCondition" column="storage_condition"/>
<result property="alias" column="alias"/>
<result property="englishName" column="english_name"/>
<result property="unitPrice" column="unit_price"/>
<result property="reagentConsumableName" column="reagent_consumable_name"/>
<result property="storageLife" column="storage_life"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="warningValue" column="warning_value"/> <result property="warningValue" column="warning_value"/>
<result property="warningInformation" column="warning_information"/> <result property="warningInformation" column="warning_information"/>
<result property="casNumber" column="cas_number"/>
<result property="code" column="code"/>
<result property="purityGrade" column="purity_grade"/>
</resultMap> </resultMap>
<resultMap id="reagentConsumableInventoryVO" <resultMap id="reagentConsumableInventoryVO"
type="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO" type="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO"
extends="reagentConsumableInventoryMap"> extends="reagentConsumableInventoryMap">
<collection property="batchDetailsVOS" ofType="batchDetailsVOS" select="getBatchDetailsListForReagent" column="reagent_consumable_inventory_id"></collection> <collection property="batchDetailsVOS" ofType="batchDetailsVOS" select="getBatchDetailsListForReagent"
column="reagent_consumable_inventory_id"></collection>
</resultMap> </resultMap>
<select id="getBatchDetailsListForReagent" resultMap="batchDetailsVOS" > <select id="getBatchDetailsListForReagent" resultMap="batchDetailsVOS">
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.reagent_consumable_inventory_id =#{reagent_consumable_inventory_id} 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
</select> </select>
<resultMap id="batchDetailsVOS" type="digital.laboratory.platform.reagent.entity.BatchDetails"> <resultMap id="batchDetailsVOS" type="digital.laboratory.platform.reagent.entity.BatchDetails">
@ -92,34 +76,42 @@
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO"> resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO">
SELECT bd.*, SELECT bd.*,
r1.*, r1.*,
(SELECT s1.supplier_name FROM supplier_information s1 WHERE s1.id = bd.supplier_id) as supplier_name s1.supplier_name,
FROM batch_details bd, rm.*
reagent_consumable_inventory r1 FROM batch_details bd
WHERE bd.reagent_consumable_inventory_id = r1.reagent_consumable_inventory_id 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;
<if test="name != null"> <if test="name != null">
AND r1.`reagent_consumable_name` = #{name} AND rm.`reagent_consumable_name` = #{name}
</if> </if>
<if test="category != null"> <if test="category != null">
AND r1.`category` = #{category} AND rm.`category` = #{category}
</if> </if>
</select> </select>
<select id="getReagentConsumableInventoryVOPage" resultMap="reagentConsumableInventoryVO" <select id="getReagentConsumableInventoryVOPage" resultMap="reagentConsumableInventoryVO"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO"> resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO">
select r.* from reagent_consumable_inventory r select r.*,rm.* from reagent_consumable_inventory r LEFT JOIN reagent_consumables rm ON rm.reagent_consumable_id
=
r.reagent_consumable_id
where where
<if test="reagentCategory != null and reagentCategory == 0"> <if test="reagentCategory != null and reagentCategory == 0">
r.category in ('试剂','耗材') rm.category in ('试剂','耗材')
</if> </if>
<if test="reagentCategory != null and reagentCategory == 1"> <if test="reagentCategory != null and reagentCategory == 1">
r.category in ('标准物质','标准储备溶液') rm.category in ('标准物质','标准储备溶液')
</if> </if>
<if test="warning != null and warning == 1"> <if test="warning != null and warning == 1">
and r.warning_information = '库存不足' and r.warning_information = '库存不足'
</if> </if>
<if test="warning != null and warning == 2">
and r.warning_information in ('即将过期', '已过期', '即将到达存储期限', '已超过存储期限')
</if>
<if test="keywords != null and keywords != ''"> <if test="keywords != null and keywords != ''">
and r.reagent_consumable_name like concat('%',#{keywords},'%') and rm.reagent_consumable_name like concat('%',#{keywords},'%')
or r.remark like like concat('%',#{keywords},'%') or rm.remark like like concat('%',#{keywords},'%')
</if> </if>
</select> </select>
@ -138,136 +130,141 @@
</select> </select>
<!-- <sql id="getReferenceMaterialPageSQL">-->
<!-- SELECT r1.*, r2.*, b1.*-->
<!-- FROM reference_material r1,-->
<!-- reagent_consumable_inventory r2,-->
<!-- batch_details b1-->
<!-- WHERE r1.reagent_consumable_inventory_id = r2.reagent_consumable_inventory_id-->
<!-- and r1.batch_details_id = b1.batch_details_id-->
<!-- </sql> -->
<select id="getReferenceMaterialPage" resultType="digital.laboratory.platform.reagent.vo.ReferenceMaterialFullVO"> <select id="getReferenceMaterialPage" resultType="digital.laboratory.platform.reagent.vo.ReferenceMaterialFullVO">
SELECT rmp.*, SELECT rmp.*,
(select rci.specification_and_model rci.reagent_consumable_id,
from reagent_consumable_inventory rci rm.specification_and_model,
where rci.reagent_consumable_inventory_id = rm.`code`,
rmp.reagent_consumable_inventory_id) as specification_and_model, rm.category,
(select rci.`code` rm.brand,
from reagent_consumable_inventory rci rm.deviation_or_uncertainty,
where rci.reagent_consumable_inventory_id = rci.instruction_book_id,
rmp.reagent_consumable_inventory_id) as `code`, rm.species,
(select rci.category rm.alias,
from reagent_consumable_inventory rci rm.remark,
where rci.reagent_consumable_inventory_id = rm.configuration_concentration,
rmp.reagent_consumable_inventory_id) as category, rm.storage_life,
(select rci.brand rci.warning_information,
from reagent_consumable_inventory rci r1.`status` as reference_material_status,
where rci.reagent_consumable_inventory_id = r1.`id` as reference_material_id,
rmp.reagent_consumable_inventory_id) as brand, bd.batch,
(select rci.deviation_or_uncertainty bd.fixed_result,
from reagent_consumable_inventory rci bd.purchase_time,
where rci.reagent_consumable_inventory_id = bd.batch_number,
rmp.reagent_consumable_inventory_id) as deviation_or_uncertainty, bd.supplier_id as manufacturer_id,
(select rci.instruction_book_id srs.configuration_concentration,
from reagent_consumable_inventory rci srs.configuration_date,
where rci.reagent_consumable_inventory_id = srs.solution_numbering,
rmp.reagent_consumable_inventory_id) as instruction_book_id, srs.validity_period
(select rci.species
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as species,
(select rci.alias
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as alias,
(select rci.remark
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as remark,
(select rci.configuration_concentration
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as configuration_concentration,
(select rci.storage_life
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as storage_life,
(select rci.warning_information
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as warning_information,
(select r1.`status` from reference_material r1 where r1.id = rmp.id) as reference_material_status,
(select r1.`id` from reference_material r1 where r1.id = rmp.id) as reference_material_id,
(select bd.batch
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as batch,
(select bd.fixed_result
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as fixed_result,
(select bd.purchase_time
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as purchase_time,
(select bd.batch_number
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as batch_number,
(select bd.supplier_id
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as manufacturer_id,
(select srs.configuration_concentration
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as configuration_concentration,
(select srs.configuration_date
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as configuration_date,
(select srs.solution_numbering
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as solution_numbering,
(select srs.validity_period
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as validity_period
FROM reference_material rmp FROM reference_material rmp
${ew.customSqlSegment} LEFT JOIN reagent_consumable_inventory rci
ON rci.reagent_consumable_inventory_id = rmp.reagent_consumable_inventory_id
LEFT JOIN reagent_consumables rm ON rm.reagent_consumable_id = rci.reagent_consumable_id
LEFT JOIN reference_material r1 ON r1.id = rmp.id
LEFT JOIN batch_details bd ON bd.batch_details_id = rmp.batch_details_id
LEFT JOIN standard_reserve_solution srs ON srs.reference_id = rmp.id
WHERE 1=1
<if test="status != null">
and rmp.`status` = #{status}
</if>
<if test="status == null">
and rmp.`status` != -4
</if>
<if test="reagentConsumableName != null and reagentConsumableName != ''">
and rmp.`reagent_consumable_name` like concat ('%', #{reagentConsumableName}, '%')
</if>
</select> </select>
<select id="getReagentConsumablePage" <select id="getReagentConsumablePage"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO"> resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO">
SELECT b1.batch, b1.batch_details_id, b1.quantity, r1.*, si.supplier_name,rm.*
SELECT b1.batch,b1.batch_details_id,b1.quantity,r1.*,(SELECT si.supplier_name FROM supplier_information si WHERE FROM batch_details b1
si.id = b1.supplier_id) as supplier_name FROM batch_details b1, reagent_consumable_inventory r1 WHERE LEFT JOIN reagent_consumable_inventory r1 ON b1.reagent_consumable_inventory_id =
(r1.category = '试剂' or r1.category = '耗材') and b1.reagent_consumable_inventory_id = r1.reagent_consumable_inventory_id
r1.reagent_consumable_inventory_id and b1.service_status = '1' LEFT JOIN reagent_consumables rm ON rm.reagent_consumable_id = r1.reagent_consumable_id
LEFT JOIN supplier_information si ON b1.supplier_id = si.id
WHERE (rm.category = '试剂' or rm.category = '耗材') and b1.service_status = '1'
<if test="name !=null and name !=''"> <if test="name !=null and name !=''">
and b1.reagent_consumable_inventory_id in (SELECT reagent_consumable_inventory_id FROM and rm.reagent_consumable_name like concat('%',#{name},'%')
reagent_consumable_inventory WHERE reagent_consumable_name like concat('%',#{name},'%'))
</if> </if>
</select> </select>
<select id="getReagentConsumableList" <select id="getReagentConsumableList"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO"> resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO">
SELECT b1.batch, SELECT b1.batch,
b1.purchase_time as batch_purchase_time, b1.purchase_time as batch_purchase_time,
b1.batch_details_id, b1.batch_details_id,
b1.quantity, b1.quantity,
b1.room_no, b1.room_no,
b1.location, b1.location,
r1.*, r1.*,
(SELECT si.supplier_name si.supplier_name as supplier_name,
FROM supplier_information si rm.*
WHERE si.id = b1.supplier_id) as supplier_name FROM batch_details b1
FROM batch_details b1, LEFT JOIN reagent_consumable_inventory r1
reagent_consumable_inventory r1 ON r1.reagent_consumable_inventory_id = b1.reagent_consumable_inventory_id
WHERE (r1.category = '试剂' or r1.category = '耗材') LEFT JOIN supplier_information si ON si.id = b1.supplier_id
and b1.reagent_consumable_inventory_id = LEFT JOIN reagent_consumables rm ON rm.reagent_consumable_id = r1.reagent_consumable_id
r1.reagent_consumable_inventory_id WHERE (rm.category = '试剂' or rm.category = '耗材')
and b1.service_status = '1' and b1.service_status = '1'
order by b1.room_no, b1.location asc order by b1.room_no, b1.location asc
</select> </select>
<select id="getRemListById" resultMap="reagentConsumableInventoryVO"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO">
SELECT r1.*, rm.*
FROM reagent_consumable_inventory r1
LEFT JOIN reagent_consumables rm ON rm.reagent_consumable_id = r1.reagent_consumable_id
WHERE rm.category != '试剂' AND rm.category != '耗材'
AND r1.reagent_consumable_inventory_id IN (
SELECT reagent_consumable_inventory_id
FROM batch_details
WHERE warning_information IN ('即将过期', '已过期', '即将到达存储期限', '已超过存储期限')
)
</select>
<select id="getRmListById" resultMap="reagentConsumableInventoryVO"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO">
SELECT r1.*, rm.*
FROM reagent_consumable_inventory r1
LEFT JOIN reagent_consumables rm ON rm.reagent_consumable_id = r1.reagent_consumable_id
WHERE rm.category != '标准物质' AND rm.category != '标准储备溶液'
AND r1.reagent_consumable_inventory_id IN (
SELECT reagent_consumable_inventory_id
FROM batch_details
WHERE warning_information IN ('即将过期', '已过期', '即将到达存储期限', '已超过存储期限')
)
</select>
<select id="getCellName" resultType="String"> <select id="getCellName" resultType="String">
select c.cabinet_name as name select c.cabinet_name as name
from dlp_cabinet.b_cabinet c from dlp_cabinet.b_cabinet c
where id = #{id} where id = #{id}
</select> </select>
<select id="getRciListByCategory" resultMap="reagentConsumableInventoryVO"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO">
SELECT ri.*, rm.*
FROM reagent_consumable_inventory ri
LEFT JOIN reagent_consumables rm ON rm.reagent_consumable_id = ri.reagent_consumable_id
WHERE rm.category in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="getRciById" resultMap="reagentConsumableInventoryVO"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO">
SELECT ri.*, rm.*
FROM reagent_consumable_inventory ri
LEFT JOIN reagent_consumables rm ON rm.reagent_consumable_id = ri.reagent_consumable_id
WHERE 1 = 1
<if test="reagentConsumableInventoryId != '' and reagentConsumableInventoryId != null">
and ri.reagent_consumable_inventory_id = #{reagentConsumableInventoryId}
</if>
<if test="reagentConsumableId != '' and reagentConsumableId != null">
and rm.reagent_consumable_id = #{reagentConsumableId}
</if>
</select>
</mapper> </mapper>

@ -32,13 +32,44 @@
<resultMap id="warehousingBatchListVO" type="digital.laboratory.platform.reagent.vo.WarehousingBatchListVO" <resultMap id="warehousingBatchListVO" type="digital.laboratory.platform.reagent.vo.WarehousingBatchListVO"
extends="warehousingBatchListMap"> extends="warehousingBatchListMap">
<result property="depositorName" column="depositor_name"></result> <result property="depositorName" column="depositor_name"></result>
<result property="reagentConsumableName" column="reagent_consumable_name"></result>
<result property="standardValueOrPurity" column="standard_value_or_purity"></result>
<result property="specificationAndModel" column="specification_and_model"></result>
<result property="reagentConsumableId" column="reagent_consumable_id"></result>
<result property="category" column="category"></result>
<collection property="idList" ofType="referenceMaterialMap" select="getReferenceMaterialMapByBatchId" column="batch_id"></collection>
</resultMap> </resultMap>
<resultMap id="referenceMaterialMap" type="digital.laboratory.platform.reagent.entity.ReferenceMaterial">
<id property="id" column="id"></id>
<result property="number" column="number"></result>
<result property="reagentConsumableName" column="reagent_consumable_name"></result>
</resultMap>
<select id="getReferenceMaterialMapByBatchId" resultMap="referenceMaterialMap">
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>
<select id="getWarehousingBatchListVOList" resultMap="warehousingBatchListVO" <select id="getWarehousingBatchListVOList" resultMap="warehousingBatchListVO"
resultType="digital.laboratory.platform.reagent.vo.WarehousingBatchListVO"> resultType="digital.laboratory.platform.reagent.vo.WarehousingBatchListVO">
SELECT wbl.*, SELECT wb.*, wc.reagent_consumable_id as reagent_consumable_id,
(select user.name from dlp_base.sys_user user where user.user_id=wbl.create_by ) as depositor_name rc.reagent_consumable_name,rc.standard_value_or_purity,rc.specification_and_model,rc.category,u.`name` as
FROM warehousing_batch_list wbl depositor_name
WHERE wbl.warehousing_content_id = #{warehousingContentId} FROM warehousing_batch_list wb
LEFT JOIN warehousing_content wc ON wb.warehousing_content_id = wc.id
LEFT JOIN reagent_consumables rc ON wc.reagent_consumable_id = rc.reagent_consumable_id
LEFT JOIN dlp_base.sys_user u ON u.user_id=wb.create_by
WHERE wb.warehousing_content_id IN (
SELECT id
FROM warehousing_content
WHERE warehousing_record_form_id = #{warehousingRecordFormId}
)
<if test="keywords != null and keywords != ''">
and rc.reagent_consumable_name = #{keywords}
</if>
ORDER BY create_time DESC;
</select> </select>
</mapper> </mapper>

@ -29,32 +29,144 @@
</resultMap> </resultMap>
<resultMap id="warehousingContentVO" type="digital.laboratory.platform.reagent.vo.WarehousingContentVO" extends="warehousingContentMap"> <resultMap id="warehousingContentVO" type="digital.laboratory.platform.reagent.vo.WarehousingContentVO"
extends="warehousingContentMap">
<result property="supplierName" column="supplier_name"/> <result property="supplierName" column="supplier_name"/>
<result property="applicantName" column="applicant_name"/> <result property="applicantName" column="applicant_name"/>
<result property="brand" column="brand"/> <result property="brand" column="brand"/>
<result property="category" column="category"/> <result property="category" column="category"/>
<result property="specificationAndModel" column="specification_and_model"/> <result property="specificationAndModel" column="specification_and_model"/>
<result property="standardValueOrPurity" column="standard_value_or_purity"/> <result property="standardValueOrPurity" column="standard_value_or_purity"/>
<collection property="warehousingBatchListVOList" ofType="warehousingBatchListVOMap"
select="getWarehousingBatchListVOList"
column="id"></collection>
</resultMap>
<resultMap id="warehousingBatchListVOMap" type="digital.laboratory.platform.reagent.vo.WarehousingBatchListVO">
<id property="id" column="id"/>
<result property="batch" column="batch"/>
<result property="batchNumber" column="batch_number"/>
<result property="dateOfProduction" column="date_of_production"/>
<result property="dateOfPurchase" column="date_of_purchase"/>
<result property="dateOfReceipt" column="date_of_receipt"/>
<result property="expirationDate" column="expiration_date"/>
<result property="quantity" column="quantity"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="reagentConsumableId" column="reagent_consumable_id"/>
<result property="warehousingContentId" column="warehousing_content_id"/>
<result property="warningValue" column="warning_value"/>
<result property="depositorId" column="depositor_id"/>
<result property="latticeId" column="lattice_id"/>
<result property="limitDate" column="limit_date"/>
<result property="remark" column="remark"/>
<result property="location" column="location"/>
<result property="batchId" column="batch_id"/>
<result property="depositorName" column="depositor_name"></result>
<result property="reagentConsumableName" column="reagent_consumable_name"></result>
<result property="standardValueOrPurity" column="standard_value_or_purity"></result>
<result property="specificationAndModel" column="specification_and_model"></result>
<result property="reagentConsumableId" column="reagent_consumable_id"></result>
<result property="category" column="category"></result>
<collection property="idList" ofType="referenceMaterialMap"
select="getReferenceMaterialMapByBatchId" column="batch_id"></collection>
</resultMap> </resultMap>
<select id="getWarehousingContentVOList" resultMap="warehousingContentVO" resultType="digital.laboratory.platform.reagent.vo.WarehousingContentVO"> <resultMap id="referenceMaterialMap" type="digital.laboratory.platform.reagent.entity.ReferenceMaterial">
SELECT wc.*, <id property="id" column="id"></id>
(select si.supplier_name from supplier_information si where si.id = wc.supplier_id) as supplier_name , <result property="number" column="number"></result>
(select user.name from dlp_base.sys_user user where user.user_id=wc.update_by ) as applicant_name <result property="reagentConsumableName" column="reagent_consumable_name"></result>
FROM warehousing_content wc </resultMap>
WHERE wc.warehousing_record_form_id = #{warehousingRecordFormId}
<select id="getReferenceMaterialMapByBatchId" resultMap="referenceMaterialMap">
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>
<select id="getWarehousingBatchListVOList" resultMap="warehousingBatchListVOMap"
resultType="digital.laboratory.platform.reagent.vo.WarehousingBatchListVO">
SELECT wb.*,
wc.reagent_consumable_id as reagent_consumable_id,
rc.reagent_consumable_name,
rc.standard_value_or_purity,
rc.specification_and_model,
rc.category,
u.`name` as
depositor_name
FROM warehousing_batch_list wb
LEFT JOIN warehousing_content wc ON wb.warehousing_content_id = wc.id
LEFT JOIN reagent_consumables rc ON wc.reagent_consumable_id = rc.reagent_consumable_id
LEFT JOIN dlp_base.sys_user u ON u.user_id = wb.create_by
WHERE wb.warehousing_content_id = #{id}
ORDER BY create_time DESC;
</select>
<select id="getWarehousingContentVOList" resultMap="warehousingContentVO"
resultType="digital.laboratory.platform.reagent.vo.WarehousingContentVO">
SELECT
wc.*,
ri.warning_value,
si.supplier_name,
user.name AS applicant_name,
rc.category,
rc.specification_and_model,
rc.brand,
rc.standard_value_or_purity,
rc.deviation_or_uncertainty,
rc.unit_price
FROM
warehousing_content wc
LEFT JOIN
supplier_information si ON wc.supplier_id = si.id
LEFT JOIN
dlp_base.sys_user user ON wc.update_by = user.user_id
LEFT JOIN
reagent_consumables rc ON wc.reagent_consumable_id = rc.reagent_consumable_id
LEFT JOIN
reagent_consumable_inventory ri ON wc.reagent_consumable_id = ri.reagent_consumable_id
WHERE
wc.warehousing_record_form_id = #{warehousingRecordFormId}
<if test="opCode != null and opCode == 1">
and wc.total_quantity > wc.warehousing_quantity
</if>
<if test="opCode != null and opCode == -1">
and wc.warehousing_quantity = wc.total_quantity
</if>
<if test="keywords != null and keywords != ''">
and wc.reagent_consumable_name = #{keywords}
</if>
<if test="category != null and category != ''">
and rc.category = #{category}
</if>
</select> </select>
<select id="getWarehousingContentVOPage" resultMap="warehousingContentVO" resultType="digital.laboratory.platform.reagent.vo.WarehousingContentVO"> <select id="getWarehousingContentVOPage" resultMap="warehousingContentVO"
resultType="digital.laboratory.platform.reagent.vo.WarehousingContentVO">
SELECT wc.*, SELECT wc.*,
(select si.supplier_name from supplier_information si where si.id = wc.supplier_id) as supplier_name, (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 user.name from dlp_base.sys_user user
(select rc.category from reagent_consumables rc where rc.reagent_consumable_id = wc.reagent_consumable_id) AS category, where user.user_id=wc.update_by ) as applicant_name
(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.category
(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 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 FROM warehousing_content wc
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>

Loading…
Cancel
Save