main
杨海航 4 months ago
parent 6f66ef0abf
commit 6c9a487682
  1. 6
      pom.xml
  2. 68
      src/main/java/digital/laboratory/platform/reagent/constans/ReagentStatusConstants.java
  3. 10
      src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java
  4. 5
      src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java
  5. 8
      src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
  6. 16
      src/main/java/digital/laboratory/platform/reagent/entity/AcceptanceRecordForm.java
  7. 3
      src/main/java/digital/laboratory/platform/reagent/entity/AcceptanceSignFor.java
  8. 8
      src/main/java/digital/laboratory/platform/reagent/entity/ApplicationForUse.java
  9. 3
      src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java
  10. 8
      src/main/java/digital/laboratory/platform/reagent/entity/Blacklist.java
  11. 2
      src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java
  12. 2
      src/main/java/digital/laboratory/platform/reagent/entity/CategoryTable.java
  13. 2
      src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java
  14. 2
      src/main/java/digital/laboratory/platform/reagent/entity/CheckSchedule.java
  15. 3
      src/main/java/digital/laboratory/platform/reagent/entity/ComplianceCheck.java
  16. 2
      src/main/java/digital/laboratory/platform/reagent/entity/DecentralizeDetails.java
  17. 3
      src/main/java/digital/laboratory/platform/reagent/entity/DecentralizedRequest.java
  18. 3
      src/main/java/digital/laboratory/platform/reagent/entity/DeliveryRegistrationForm.java
  19. 3
      src/main/java/digital/laboratory/platform/reagent/entity/DetailsOfCentralized.java
  20. 3
      src/main/java/digital/laboratory/platform/reagent/entity/EvaluationForm.java
  21. 3
      src/main/java/digital/laboratory/platform/reagent/entity/FixedValueReport.java
  22. 3
      src/main/java/digital/laboratory/platform/reagent/entity/InstructionBook.java
  23. 3
      src/main/java/digital/laboratory/platform/reagent/entity/LocationInfo.java
  24. 3
      src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java
  25. 3
      src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationImplementation.java
  26. 3
      src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationPlan.java
  27. 3
      src/main/java/digital/laboratory/platform/reagent/entity/ProcurementContent.java
  28. 3
      src/main/java/digital/laboratory/platform/reagent/entity/ProvideServicesOrSupplies.java
  29. 2
      src/main/java/digital/laboratory/platform/reagent/entity/PurchaseCatalogue.java
  30. 7
      src/main/java/digital/laboratory/platform/reagent/entity/PurchaseList.java
  31. 6
      src/main/java/digital/laboratory/platform/reagent/entity/PurchaseListDetails.java
  32. 2
      src/main/java/digital/laboratory/platform/reagent/entity/PurchasingPlan.java
  33. 12
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java
  34. 3
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableStash.java
  35. 3
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java
  36. 2
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java
  37. 2
      src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java
  38. 36
      src/main/java/digital/laboratory/platform/reagent/entity/RequisitionRecord.java
  39. 3
      src/main/java/digital/laboratory/platform/reagent/entity/SolutionUseForm.java
  40. 5
      src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApplication.java
  41. 6
      src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApprovalForm.java
  42. 6
      src/main/java/digital/laboratory/platform/reagent/entity/StandardReserveSolution.java
  43. 6
      src/main/java/digital/laboratory/platform/reagent/entity/StandardSolutionCurve.java
  44. 6
      src/main/java/digital/laboratory/platform/reagent/entity/SupplierInformation.java
  45. 6
      src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java
  46. 18
      src/main/java/digital/laboratory/platform/reagent/entity/WarehousingRecordForm.java
  47. 139
      src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java
  48. 6
      src/main/java/digital/laboratory/platform/reagent/service/impl/EvaluationFormServiceImpl.java
  49. 55
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java
  50. 4
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java
  51. 251
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java
  52. 79
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java
  53. 2
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReferenceMaterialServiceImpl.java
  54. 16
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApplicationServiceImpl.java
  55. 13
      src/main/java/digital/laboratory/platform/reagent/task/MaturityCalculation.java
  56. 4
      src/main/resources/bootstrap.yml
  57. 23
      src/main/resources/mapper/PurchasingPlanMapper.xml
  58. 4
      src/main/resources/mapper/ReagentConsumableInventoryMapper.xml

@ -48,6 +48,12 @@
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>com.zhuozhengsoft</groupId>
<artifactId>pageoffice</artifactId>
<version>6.3.1.1-javax</version>
</dependency>
<!-- AOP依赖 -->
<dependency>

@ -0,0 +1,68 @@
package digital.laboratory.platform.reagent.constans;
import lombok.*;
@RequiredArgsConstructor
@Getter
public enum ReagentStatusConstants {
/**
* 采购目录的状态
*/
CATALOGUE_STATUS_NOT_COMMIT(0, "未提交"),
CATALOGUE_STATUS_COMMIT(1, "已提交"),
CATALOGUE_STATUS_FIRST_AUDIT(2, "一级审核通过"),
CATALOGUE_STATUS_SECOND_AUDIT(3, "二级审核通过"),
CATALOGUE_STATUS_NOT_AUDIT(-1, "审核不通过"),
CATALOGUE_STATUS_RELEASED(4, "已发布"),
/**
* 集中采购申请的状态
*/
CENTRALIZED_PURCHASING_NOT_COMMIT(0, "未提交"),
CENTRALIZED_PURCHASING_COMMIT(1, "已提交"),
CENTRALIZED_PURCHASING_AUDIT(6, "审核通过"),
CENTRALIZED_PURCHASING_NOT_AUDIT(-2, "审核不通过"),
CENTRALIZED_PURCHASING_TO_PLAN(3, "已被制定为采购计划"),
CENTRALIZED_PURCHASING_TO_LIST(4, "已被制定为采购清单"),
/**
* 采购计划的状态
*/
PURCHASING_PLAN_NOT_COMMIT(0, "未提交"),
PURCHASING_PLAN_COMMIT(1, "已提交"),
PURCHASING_PLAN_AUDIT(2, "审核通过"),
PURCHASING_PLAN_APPROVE(3, "审批通过"),
PURCHASING_PLAN_NOT_AUDIT(-1, "审核/审批不通过"),
PURCHASING_PLAN_TO_LIST(4, "已被制定为采购清单"),
/**
* 采购清单的状态
*/
PURCHASING_LIST_NOT_COMMIT(0, "未提交"),
PURCHASING_LIST_COMMIT(1, "已提交"),
/**
* 入库签收单的状态
*/
WAREHOUSING_NOT_STARTED(0, "未开始"),
WAREHOUSING_STARTED(1, "已开始"),
WAREHOUSING_COMPLETE(2, "已完成"),
/**
* 入库明细的状态
*/
WAREHOUSING_COUNT_NOT_COMPLETE(0, "未完成"),
WAREHOUSING_COUNT_COMPLETE(1, "已开始"),
/**
* 验收单的状态
*/
ACCEPTANCE_NOT_COMMIT(0, "未提交"),
ACCEPTANCE_COMMIT(1, "已提交"),
ACCEPTANCE_FIRST_AUDIT(2, "一级审核通过"),
ACCEPTANCE_SECOND_AUDIT(3, "二级审核通过"),
ACCEPTANCE_THIRD_AUDIT(6, "三级审核通过"),
ACCEPTANCE_NOT_FIRST_AUDIT(-2, "一级审核不通过"),
ACCEPTANCE_NOT_SECOND_AUDIT(-3, "二级审核不通过"),
ACCEPTANCE_NOT_THIRD_AUDIT(-4, "三级审核不通过");
private final Integer status;
private final String statusName;
}

@ -14,6 +14,8 @@ import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhuozhengsoft.pageoffice.FileSaver;
import com.zhuozhengsoft.pageoffice.PageOfficeCtrl;
import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.log.annotation.SysLog;
@ -46,6 +48,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.security.Principal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -460,6 +463,7 @@ public class PurchaseCatalogueController {
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
PageOfficeCtrl pageOfficeCtrl = new PageOfficeCtrl(theHttpServletRequest);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
@ -470,10 +474,10 @@ public class PurchaseCatalogueController {
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "purchaseCatalogue" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
FileSaver fs = new FileSaver(theHttpServletRequest, httpServletResponse);
FileInputStream fileStream = fs.getFileStream();
ossFile.fileSave("document" + "/" + "purchaseCatalogue" + "/" + id + "/" + applyFileName + ".pdf", fileStream);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}

@ -65,13 +65,9 @@ public class PurchaseListController {
@GetMapping()
@PreAuthorize("@pms.hasPermission('reagent_purchase_list_get')")
public R<PurchaseList> getById(String purchaseListId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
PurchaseListVO purchaseList = purchaseListService.getPurchaseList(purchaseListId);
return R.ok(purchaseList);
}
@ -87,7 +83,6 @@ public class PurchaseListController {
public R<IPage<PurchaseListPageVO>> getPurchaseListPage(Page<PurchaseList> page, Integer status, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<PurchaseListPageVO> purchaseListSList = purchaseListService.getPurchaseListVOPage(page, Wrappers.<PurchaseList>query()
.eq(status != null, "status", status)
.ge(startTime != null, "create_time", startTime)

@ -92,15 +92,15 @@ public class ReagentConsumableInventoryController {
@ApiOperation(value = "标准物质管理列表", notes = "标准物质管理列表")
@GetMapping("/standardList")
public R<IPage<ReagentConsumableInventoryVO>> getStandardList(Page page, Integer warning, String keywords) {
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, warning, keywords);
public R<IPage<ReagentConsumableInventoryVO>> getStandardList(Page page, Integer warning, String reagentConsumableName) {
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, warning, reagentConsumableName);
return R.ok(reagentConsumableInventoryRMVOList);
}
@ApiOperation(value = "试剂耗材管理列表", notes = "试剂耗材管理列表")
@GetMapping("/List")
public R<IPage<ReagentConsumableInventoryVO>> getList(Page page, Integer warning, String keywords) {
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryREVOList(page, warning, keywords);
public R<IPage<ReagentConsumableInventoryVO>> getList(Page page, Integer warning, String reagentConsumableName) {
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryREVOList(page, warning, reagentConsumableName);
return R.ok(reagentConsumableInventoryRMVOList);
}

@ -111,24 +111,26 @@ public class AcceptanceRecordForm extends BaseEntity {
private String deliveryCycle;
@ApiModelProperty(value = "(供货周期备注)")
private String dc_remarks;
private String dc_remarks;
@ApiModelProperty(value = "(验收结论)")
private String acceptanceConclusion;
private String acceptanceConclusion;
@ApiModelProperty(value = "(不合格项目)")
private String nonconformingItem;
private String nonconformingItem;
@ApiModelProperty(value = "状态(0:未提交,1:一级待审核,2:二级待审核,3:三级待审核,6:审核通过,-2 一级审核不不通过,-3:二级审核不通过,-4 三级审核不通过)")
private Integer status;
private Integer status;
@ApiModelProperty(value = "(签收物品明细Id)")
private String warehousingContentId;
private String warehousingContentId;
@ApiModelProperty(value = "(验收人名称)")
private String userName;
private String userName;
@ApiModelProperty(value = "(验收中间表ID)")
private String acceptanceSignForId;
private String acceptanceSignForId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -27,4 +27,7 @@ public class AcceptanceSignFor extends BaseEntity {
@ApiModelProperty(value = "状态 0 未开始签收 1 进行中 2 已完成 ")
private Integer status;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -31,7 +31,10 @@ public class ApplicationForUse extends BaseEntity {
private String recipientId;
@ApiModelProperty(value="(状态)")
private Integer status;
private Integer status;//0-待提交 1-待领用 2-已领用
@ApiModelProperty(value="(备注)")
private String remark;
@TableId(value = "id", type = IdType.ASSIGN_UUID)
@ApiModelProperty(value="id")
@ -49,5 +52,6 @@ public class ApplicationForUse extends BaseEntity {
@ApiModelProperty(value="检验鉴定实验ID")
private String experimentId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -103,4 +103,7 @@ public class BatchDetails extends BaseEntity {
@TableField(exist = false)
private String supplierName;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -24,11 +24,6 @@ import lombok.EqualsAndHashCode;
@ApiModel(value = "(试剂耗材黑名单)")
public class Blacklist extends BaseEntity {
public static void main(String[] args) {
int a = 5;
int b =2 ;
System.out.println(a/b);
}
/**
* (试剂耗材ID)
@ -61,7 +56,8 @@ public class Blacklist extends BaseEntity {
@ApiModelProperty(value="complianceCheckId")
private String complianceCheckId;
@ApiModelProperty(value = "系统ID")
private String sId;

@ -149,5 +149,7 @@ public class CatalogueDetails extends BaseEntity {
@ApiModelProperty(value = "catalogueDetailsId")
private String catalogueDetailsId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -43,5 +43,7 @@ public class CategoryTable extends BaseEntity {
@ApiModelProperty(value="种类")
private String species;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -81,5 +81,7 @@ public class CentralizedRequest extends BaseEntity {
@ApiModelProperty(value = "集中采购申请ID")
private String id;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -76,6 +76,8 @@ public class CheckSchedule extends BaseEntity {
@ApiModelProperty(value="(提交时间)")
private LocalDateTime commitTime;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -157,4 +157,7 @@ public class ComplianceCheck extends BaseEntity {
@ApiModelProperty(value="(标准物质Id,若选择的物质为标准物质,则需传输Id)")
private String referenceMaterialId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -170,6 +170,8 @@ public class DecentralizeDetails extends BaseEntity {
@ApiModelProperty(value = "物品编码")
private String code;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -154,7 +154,8 @@ public class DecentralizedRequest extends BaseEntity {
@ApiModelProperty(value="(状态(0:未提交,1:已提交,2:一级审核通过,3:二级审核通过,4:三级审核通过,5:审批通过,6:已被制定为采购清单))")
private Integer status;
@ApiModelProperty(value = "系统ID")
private String sId;

@ -57,5 +57,8 @@ public class DeliveryRegistrationForm extends BaseEntity {
@ApiModelProperty(value="id")
private String id;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -99,6 +99,7 @@ public class DetailsOfCentralized extends BaseEntity {
@ApiModelProperty(value="采购计划换货备注")
private String replacementRemark;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -188,5 +188,6 @@ public class EvaluationForm extends BaseEntity {
@ApiModelProperty(value="状态:(0:未评价,1:已评价,2:二级审核通过,3:三级审核通过, -1 :审核未通过)")
private Integer status;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -49,7 +49,8 @@ public class FixedValueReport extends BaseEntity {
@ApiModelProperty(value="定值结果")
private String fixedResult;
@ApiModelProperty(value = "系统ID")
private String sId;

@ -88,5 +88,6 @@ public class InstructionBook extends BaseEntity {
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -25,4 +25,7 @@ public class LocationInfo extends BaseEntity {
@ApiModelProperty(value = "新的存放位置")
private String newLocation;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -93,5 +93,6 @@ public class OutgoingContents extends BaseEntity {
@ApiModelProperty(value = "(领用物品仓库ID)")
private String reagentConsumableStashId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -160,4 +160,7 @@ public class PeriodVerificationImplementation extends BaseEntity {
@ApiModelProperty(value="提交时间")
private LocalDateTime commitTime;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -117,6 +117,7 @@ public class PeriodVerificationPlan extends BaseEntity {
@ApiModelProperty(value="id")
private String id;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -104,5 +104,6 @@ public class ProcurementContent extends BaseEntity {
@ApiModelProperty(value="procurementContentId")
private String procurementContentId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -43,5 +43,6 @@ public class ProvideServicesOrSupplies extends BaseEntity {
@ApiModelProperty(value="提供服务或供应品表ID")
private String id;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -80,5 +80,7 @@ public class PurchaseCatalogue extends BaseEntity {
@ApiModelProperty(value="purchaseCatalogueId")
private String purchaseCatalogueId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -50,7 +50,12 @@ public class PurchaseList extends BaseEntity {
@ApiModelProperty(value="采购清单ID")
private String id;
/**
* (编号)
*/
@ApiModelProperty(value="区分是分散采购申请还是采购计划")
private String type;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -54,7 +54,13 @@ public class PurchaseListDetails extends BaseEntity {
@ApiModelProperty(value="采购清单明细ID")
private String id;
/**
* 采购计划明细ID
*/
@ApiModelProperty(value="采购计划明细ID")
private String procurementContentId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -127,5 +127,7 @@ public class PurchasingPlan extends BaseEntity {
@ApiModelProperty(value = "采购计划ID")
private String purchasingPlanId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -51,11 +51,11 @@ public class ReagentConsumableInventory extends BaseEntity {
@TableId(value = "reagent_consumable_inventory_id", type = IdType.ASSIGN_UUID)
@ApiModelProperty(value = "reagentConsumableInventoryId")
private String reagentConsumableInventoryId;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
// /**
// * 备注
// */
// @ApiModelProperty(value = "备注")
// private String remark;
/**
@ -76,4 +76,6 @@ public class ReagentConsumableInventory extends BaseEntity {
@ApiModelProperty(value = "(预警信息)")
private String warningInformation;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -81,5 +81,6 @@ public class ReagentConsumableStash extends BaseEntity {
@ApiModelProperty(value = "房间号")
private String roomNo;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -132,5 +132,6 @@ public class ReagentConsumables extends BaseEntity {
// @ApiModelProperty(value = "存储期限")
// private Integer storageLife;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -87,4 +87,6 @@ public class ReagentConsumablesSet extends BaseEntity {
@ApiModelProperty(value = "(领用物品仓库ID)")
private String reagentConsumableStashId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -70,4 +70,6 @@ public class ReferenceMaterial extends BaseEntity {
@ApiModelProperty(value = "单位")
private String referenceMaterialUnit;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableName;
import digital.laboratory.platform.common.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -27,57 +29,63 @@ public class RequisitionRecord extends BaseEntity {
/**
* (领用日期)
*/
@ApiModelProperty(value="(领用日期)")
@ApiModelProperty(value = "(领用日期)")
private LocalDateTime dateOfClaim;
/**
* (领用人)
*/
@ApiModelProperty(value="(领用人)")
@ApiModelProperty(value = "(领用人)")
private String recipientId;
/**
* (备注)
*/
@ApiModelProperty(value="(备注)")
@ApiModelProperty(value = "(备注)")
private String remarks;
/**
/**
* (耗材ID)
*/
@ApiModelProperty(value="(耗材ID)")
@ApiModelProperty(value = "(耗材ID)")
private String reagentConsumableId;
/**
* 规格型号
*/
@ApiModelProperty(value="规格型号")
@ApiModelProperty(value = "规格型号")
private String specificationAndModel;
/**
* 领用数量
*/
@ApiModelProperty(value="领用数量")
@ApiModelProperty(value = "领用数量")
private Integer drawingAmount;
/**
/**
* 编号
*/
@ApiModelProperty(value="编号")
@ApiModelProperty(value = "编号")
private String number;
/**
* 出库记录表ID
*/
@ApiModelProperty(value = "出库记录表ID")
private String deliveryRegistrationFormId;
/**
* 试剂耗材名称
*/
@ApiModelProperty(value = "试剂耗材名称")
private String reagentConsumableName;
/**
* requisitionRecordId
*/
@TableId(value = "requisition_record_id", type = IdType.ASSIGN_UUID)
@ApiModelProperty(value="requisitionRecordId")
@ApiModelProperty(value = "requisitionRecordId")
private String requisitionRecordId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -33,4 +33,7 @@ public class SolutionUseForm extends BaseEntity {
@ApiModelProperty(value="(标准物质领用/归还登记表ID)")
private String standardMaterialApplicationId;
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -151,4 +151,9 @@ public class StandardMaterialApplication extends BaseEntity {
@ApiModelProperty(value="领取码")
private String claimCode;
/**
* sId
*/
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -197,6 +197,10 @@ public class StandardMaterialApprovalForm extends BaseEntity {
@TableId(value = "id", type = IdType.ASSIGN_UUID)
@ApiModelProperty(value="id")
private String id;
/**
* sId
*/
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -123,5 +123,9 @@ public class StandardReserveSolution extends BaseEntity {
@ApiModelProperty(value="标准储备溶液及使用记录表ID")
private String id;
/**
* sId
*/
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -75,6 +75,10 @@ public class StandardSolutionCurve extends BaseEntity {
@ApiModelProperty(value="(标准储备溶液ID)")
private String referenceMaterialId;
/**
* sId
*/
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -110,7 +110,11 @@ public class SupplierInformation extends BaseEntity {
@ApiModelProperty(value="(编号)")
private String number;
/**
* sId
*/
@ApiModelProperty(value = "系统ID")
private String sId;
/**
* supplierInformationId
*/

@ -89,6 +89,10 @@ public class WarehousingContent extends BaseEntity {
@ApiModelProperty(value="柜子ID")
private String boxId;
/**
* sId
*/
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableName;
import digital.laboratory.platform.common.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -27,27 +29,31 @@ public class WarehousingRecordForm extends BaseEntity {
/**
* 采购清单ID
*/
@ApiModelProperty(value="采购清单ID")
@ApiModelProperty(value = "采购清单ID")
private String purchaseListId;
/**
* 状态
*/
@ApiModelProperty(value="状态 0:未入库 1:未完成入库 2:已完成入库")
@ApiModelProperty(value = "状态 0:未入库 1:未完成入库 2:已完成入库")
private Integer status;
/**
* 采购编号
*/
@ApiModelProperty(value="采购编号")
private String purchaseNumber;
@ApiModelProperty(value = "采购编号")
private String purchaseNumber;
/**
* signingRecordFormId
*/
@TableId(value = "id", type = IdType.ASSIGN_UUID)
@ApiModelProperty(value="id")
@ApiModelProperty(value = "id")
private String id;
/**
* sId
*/
@ApiModelProperty(value = "系统ID")
private String sId;
}

@ -104,26 +104,17 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
public DecentralizedRequest addRequest(List<DecentralizedRequestDTO> decentralizedRequestDTOList, DLPUser dlpUser) {
DecentralizedRequest decentralizedRequest = new DecentralizedRequest();
decentralizedRequest.setId(IdWorker.get32UUID().toUpperCase());
decentralizedRequest.setApplicantId(dlpUser.getId());
decentralizedRequest.setStatus(0);
List<DecentralizeDetails> list = new ArrayList<>();
//接收分散采购DTO,将其赋值给分散采购明细
for (DecentralizedRequestDTO decentralizedRequestDTO : decentralizedRequestDTOList) {
//新添加试剂耗材
DecentralizeDetails decentralizedDetails = new DecentralizeDetails();
BeanUtils.copyProperties(decentralizedRequestDTO, decentralizedDetails);
decentralizedDetails.setId(IdWorker.get32UUID().toUpperCase());
decentralizedDetails.setDecentralizedRequestId(decentralizedRequest.getId());
list.add(decentralizedDetails);
}
if (this.save(decentralizedRequest) & decentralizeDetailsService.saveBatch(list)) {
@ -133,11 +124,8 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Override
public DecentralizeDetails addDetails(DecentralizedRequestDTO decentralizedRequestDTO) {
DecentralizeDetails decentralizeDetails = new DecentralizeDetails();
BeanUtils.copyProperties(decentralizedRequestDTO, decentralizeDetails);
if (decentralizeDetailsService.save(decentralizeDetails)) {
return decentralizeDetails;
} else throw new RuntimeException(String.format("保存失败"));
@ -145,11 +133,8 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Override//修改分散采购申请明细
public DecentralizeDetails editRequest(DecentralizedRequestDTO decentralizedRequestDTO) {
DecentralizeDetails decentralizeDetails = decentralizeDetailsService.getById(decentralizedRequestDTO.getDecentralizeDetailsId());
BeanUtils.copyProperties(decentralizedRequestDTO, decentralizeDetails);
if (decentralizeDetailsService.updateById(decentralizeDetails)) {
return decentralizeDetails;
} else return null;
@ -158,17 +143,12 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Override//删除分散采购申请
public Boolean delRequestById(String decentralizedRequestId) {
LambdaQueryWrapper<DecentralizeDetails> decentralizeDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
decentralizeDetailsLambdaQueryWrapper.eq(DecentralizeDetails::getDecentralizedRequestId, decentralizedRequestId);
List<DecentralizeDetails> list = decentralizeDetailsService.list(decentralizeDetailsLambdaQueryWrapper);
if (list != null) {
if (list != null && list.size() > 0) {
decentralizeDetailsService.removeBatchByIds(list);
}
return this.removeById(this.getById(decentralizedRequestId));
}
@ -176,27 +156,20 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Override//提交分散采购申请
public DecentralizedRequest commitRequest(List<DecentralizedRequestDTO> decentralizedRequestDTOList, DLPUser dlpUser) {
String decentralizedRequestId = decentralizedRequestDTOList.get(0).getDecentralizedRequestId();
//直接提交,此时还未保存
if (decentralizedRequestId == null) {
DecentralizedRequest decentralizedRequest = this.addRequest(decentralizedRequestDTOList, dlpUser);
decentralizedRequest.setStatus(1);
decentralizedRequest.setCommitTime(LocalDateTime.now());
decentralizedRequest.setDateOfApplication(LocalDateTime.now());
if (this.updateById(decentralizedRequest)) {
return decentralizedRequest;
} else throw new RuntimeException(String.format("提交失败"));
//保存以后再提交,已经存在ID了
} else {
DecentralizedRequest byId = this.getById(decentralizedRequestId);
byId.setStatus(1);
byId.setCommitTime(LocalDateTime.now());
if (this.updateById(byId)) {
return byId;
} else throw new RuntimeException(String.format("提交失败"));
@ -207,58 +180,43 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Override//一级审核
public DecentralizedRequest primaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) {
DecentralizedRequest byId = this.getById(auditAndApproveDto.getUuId());
DecentralizedRequest request = this.getById(auditAndApproveDto.getUuId());
if (byId.getStatus() != 1) {
if (request.getStatus() != 1) {
throw new RuntimeException(String.format("当前状态不能审核"));
}
byId.setPrimaryAuditorId(dlpUser.getId());
byId.setAuditResultOfPrimary(auditAndApproveDto.getAuditResult());
byId.setAuditOpinionOfPrimary(auditAndApproveDto.getAuditOpinion());
byId.setAuditTimeOfPrimary(LocalDateTime.now());
request.setPrimaryAuditorId(dlpUser.getId());
request.setAuditResultOfPrimary(auditAndApproveDto.getAuditResult());
request.setAuditOpinionOfPrimary(auditAndApproveDto.getAuditOpinion());
request.setAuditTimeOfPrimary(LocalDateTime.now());
if (auditAndApproveDto.getAuditResult() == true) {
byId.setStatus(2);
request.setStatus(2);
} else {
byId.setStatus(-2);
request.setStatus(-2);
}
if (this.updateById(byId)) {
return byId;
if (this.updateById(request)) {
return request;
} else return null;
}
@Override//二级审核
public DecentralizedRequest secondaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) {
DecentralizedRequest byId = this.getById(auditAndApproveDto.getUuId());
if (byId.getStatus() != 2) {
DecentralizedRequest request = this.getById(auditAndApproveDto.getUuId());
if (request.getStatus() != 2) {
throw new RuntimeException(String.format("当前状态不能审核"));
}
byId.setSecondaryAuditorId(dlpUser.getId());
byId.setAuditResultOfSecondary(auditAndApproveDto.getAuditResult());
byId.setAuditOpinionOfSecondary(auditAndApproveDto.getAuditOpinion());
byId.setAuditTimeOfSecondary(LocalDateTime.now());
request.setSecondaryAuditorId(dlpUser.getId());
request.setAuditResultOfSecondary(auditAndApproveDto.getAuditResult());
request.setAuditOpinionOfSecondary(auditAndApproveDto.getAuditOpinion());
request.setAuditTimeOfSecondary(LocalDateTime.now());
if (auditAndApproveDto.getAuditResult() == true) {
byId.setStatus(3);
request.setStatus(3);
} else {
byId.setStatus(-3);
request.setStatus(-3);
}
if (this.updateById(byId)) {
return byId;
if (this.updateById(request)) {
return request;
} else return null;
}
@ -266,57 +224,48 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Override//三级审核
public DecentralizedRequest threeLevelAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDTO) {
DecentralizedRequest byId = this.getById(auditAndApproveDTO.getUuId());
if (byId.getStatus() != 3) {
DecentralizedRequest request = this.getById(auditAndApproveDTO.getUuId());
if (request.getStatus() != 3) {
throw new RuntimeException(String.format("当前状态不能审核"));
}
byId.setThreeLevelAuditId(dlpUser.getId());
byId.setAuditResultOfThreeLevel(auditAndApproveDTO.getAuditResult());
byId.setAuditOpinionOfThreeLevel(auditAndApproveDTO.getAuditOpinion());
byId.setAuditTimeOfThreeLevel(LocalDateTime.now());
request.setThreeLevelAuditId(dlpUser.getId());
request.setAuditResultOfThreeLevel(auditAndApproveDTO.getAuditResult());
request.setAuditOpinionOfThreeLevel(auditAndApproveDTO.getAuditOpinion());
request.setAuditTimeOfThreeLevel(LocalDateTime.now());
if (auditAndApproveDTO.getAuditResult() == true) {
byId.setStatus(4);
request.setStatus(4);
} else {
byId.setStatus(-4);
request.setStatus(-4);
}
if (this.updateById(byId)) {
return byId;
if (this.updateById(request)) {
return request;
} else return null;
}
@Override//审批
@Transactional
public DecentralizedRequest approveRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) {
DecentralizedRequest byId = this.getById(auditAndApproveDto.getUuId());
if (byId.getStatus() != 4) {
DecentralizedRequest request = this.getById(auditAndApproveDto.getUuId());
if (request.getStatus() != 4) {
throw new RuntimeException(String.format("当前状态不能审批"));
}
byId.setApproverId(dlpUser.getId());
byId.setResultOfApproval(auditAndApproveDto.getApproveResult());
byId.setOpinionOfApproval(auditAndApproveDto.getApproveOpinion());
byId.setApprovalOfTime(LocalDateTime.now());
request.setApproverId(dlpUser.getId());
request.setResultOfApproval(auditAndApproveDto.getApproveResult());
request.setOpinionOfApproval(auditAndApproveDto.getApproveOpinion());
request.setApprovalOfTime(LocalDateTime.now());
if (auditAndApproveDto.getApproveResult() == true) {
List<DecentralizeDetails> decentralizeDetailsList = decentralizeDetailsService.list(new LambdaQueryWrapper<DecentralizeDetails>().eq(DecentralizeDetails::getDecentralizedRequestId, byId.getId()));
//创建采购清单
List<PurchaseListDetails> purchaseListDetailsList = purchaseListService.addList(byId.getId(), 0);
List<PurchaseListDetails> purchaseListDetailsList = purchaseListService.addList(request.getId(), 0);
if (purchaseListDetailsList == null) {
throw new RuntimeException(String.format("出错了,请及时联系工作人员"));
}
byId.setStatus(5);
request.setStatus(5);
} else {
byId.setStatus(-5);
request.setStatus(-5);
}
if (this.updateById(byId)) {
return byId;
if (this.updateById(request)) {
return request;
} else return null;
}

@ -84,9 +84,7 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
@Override//填写评价表并提交
public EvaluationForm editFormById(EvaluationFormDTO evaluationFormDTO, DLPUser dlpUser) {
if (!(StrUtil.isNotBlank(evaluationFormDTO.getContactNumber()) &
StrUtil.isNotBlank(evaluationFormDTO.getContactPerson()) &
StrUtil.isNotBlank(evaluationFormDTO.getSupplierBusinessLicense()) &
if (!(StrUtil.isNotBlank(evaluationFormDTO.getSupplierBusinessLicense()) &
StrUtil.isNotBlank(evaluationFormDTO.getSupplierPassesQualityAssuranceSystem()) &
StrUtil.isNotBlank(evaluationFormDTO.getSupplierProductCertification()) &
StrUtil.isNotBlank(evaluationFormDTO.getCheckAndCalibrateEfficiencyOfSupplies()) &
@ -217,12 +215,10 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
EvaluationFormVO evaluationForm = baseMapper.getEvaluationForm(id);
List<ProvideServicesOrSuppliesVO> voList = provideServicesOrSuppliesService.getVOList(evaluationForm.getId());
evaluationForm.setProvideServicesOrSuppliesVOList(voList);
return evaluationForm;
}

@ -167,6 +167,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
purchaseCatalogue.setAuditResult(auditAndApproveDto.getAuditResult());
purchaseCatalogue.setAuditorId(dlpUser.getId());
purchaseCatalogue.setAuditTime(LocalDateTime.now());
ArrayList<CatalogueDetails> details = new ArrayList<>();
if (purchaseCatalogue.getAuditResult() == true) {
//审核通过后,将采购目录添加的试剂耗材,录入至试剂耗材类
List<CatalogueDetails> list = catalogueDetailsService.list(Wrappers.<CatalogueDetails>lambdaQuery()
@ -174,44 +175,48 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
//目录中的试剂耗材是否存在试剂耗材类中,有则不管,无则添加
for (CatalogueDetails catalogueDetails : list) {
ReagentConsumables reagentConsumable = reagentConsumablesService.getOne(Wrappers.<ReagentConsumables>query()
.eq("reagent_consumable_name", catalogueDetails.getReagentConsumableName())
.eq("brand", catalogueDetails.getBrand())
.eq("category", catalogueDetails.getCategory())
.eq("specification_and_model", catalogueDetails.getSpecificationAndModel())
.eq("unit_price", catalogueDetails.getUnitPrice())
.eq(StrUtil.isNotBlank(catalogueDetails.getStandardValueOrPurity()), "standard_value_or_purity", catalogueDetails.getStandardValueOrPurity())
.eq(StrUtil.isNotBlank(catalogueDetails.getCasNumber()), "cas_number", catalogueDetails.getCasNumber())
.eq(StrUtil.isNotBlank(catalogueDetails.getSpecies()), "species", catalogueDetails.getSpecies())
.eq(StrUtil.isNotBlank(catalogueDetails.getEnglishName()), "english_name", catalogueDetails.getEnglishName())
.eq(catalogueDetails.getPackagedCopies() != null, "packaged_copies", catalogueDetails.getPackagedCopies())
.eq(StrUtil.isNotBlank(catalogueDetails.getAlias()), "alias", catalogueDetails.getAlias())
.eq(StrUtil.isNotBlank(catalogueDetails.getPurityGrade()), "purity_grade", catalogueDetails.getPurityGrade())
.eq(StrUtil.isNotBlank(catalogueDetails.getDeviationOrUncertainty()), "deviation_or_uncertainty", catalogueDetails.getDeviationOrUncertainty())
.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())
);
ReagentConsumables reagentConsumable = this.checkIsExist(catalogueDetails);
if (reagentConsumable == null) {
ReagentConsumables addReagentConsumables = reagentConsumablesService.addReagentConsumables(catalogueDetails);
catalogueDetails.setReagentConsumableId(addReagentConsumables.getReagentConsumableId());
catalogueDetailsService.updateById(catalogueDetails);
} else {
catalogueDetails.setReagentConsumableId(reagentConsumable.getReagentConsumableId());
catalogueDetailsService.updateById(catalogueDetails);
}
details.add(catalogueDetails);
}
purchaseCatalogue.setStatus(6);
catalogueDetailsService.updateBatchById(details);
purchaseCatalogue.setStatus(6);//审核通过
} else {
purchaseCatalogue.setStatus(-3);
purchaseCatalogue.setStatus(-3);//审核不通过
}
if (this.updateById(purchaseCatalogue)) {
return purchaseCatalogue;
} else return null;
}
//检查采购目录中的内容是否已经在存在
public ReagentConsumables checkIsExist(CatalogueDetails catalogueDetails) {
ReagentConsumables reagentConsumable = reagentConsumablesService.getOne(Wrappers.<ReagentConsumables>query()
.eq("reagent_consumable_name", catalogueDetails.getReagentConsumableName())
.eq("brand", catalogueDetails.getBrand())
.eq("category", catalogueDetails.getCategory())
.eq("specification_and_model", catalogueDetails.getSpecificationAndModel())
.eq("unit_price", catalogueDetails.getUnitPrice())
.eq(StrUtil.isNotBlank(catalogueDetails.getStandardValueOrPurity()), "standard_value_or_purity", catalogueDetails.getStandardValueOrPurity())
.eq(StrUtil.isNotBlank(catalogueDetails.getCasNumber()), "cas_number", catalogueDetails.getCasNumber())
.eq(StrUtil.isNotBlank(catalogueDetails.getSpecies()), "species", catalogueDetails.getSpecies())
.eq(StrUtil.isNotBlank(catalogueDetails.getEnglishName()), "english_name", catalogueDetails.getEnglishName())
.eq(catalogueDetails.getPackagedCopies() != null, "packaged_copies", catalogueDetails.getPackagedCopies())
.eq(StrUtil.isNotBlank(catalogueDetails.getAlias()), "alias", catalogueDetails.getAlias())
.eq(StrUtil.isNotBlank(catalogueDetails.getPurityGrade()), "purity_grade", catalogueDetails.getPurityGrade())
.eq(StrUtil.isNotBlank(catalogueDetails.getDeviationOrUncertainty()), "deviation_or_uncertainty", catalogueDetails.getDeviationOrUncertainty())
.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()));
return reagentConsumable;
}
@Override
public PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId) {
PurchaseCatalogue purchaseCatalogue = this.getById(purchaseCatalogueId);
@ -225,7 +230,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
public List<CatalogueDetails> getList(String name, Integer category) {
List<PurchaseCatalogue> list = this.list(Wrappers.<PurchaseCatalogue>lambdaQuery().eq(PurchaseCatalogue::getStatus, 4)
.orderByDesc(PurchaseCatalogue::getUpdateTime));
if (list == null & list.size() == 0) {
if (list == null ||list.size() == 0) {
throw new RuntimeException(String.format("未存在已发布的采购目录"));
}
PurchaseCatalogue purchaseCatalogue = list.get(0);

@ -82,9 +82,7 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
@Override//通过ID查找清单
public PurchaseListVO getPurchaseList(String purchaseListId) {
PurchaseListVO purchaseListVO = new PurchaseListVO();//采购清单VO
PurchaseList purchaseList = this.getById(purchaseListId);
List<PurchaseListDetailsVO> purchaseListDetailsVOList = purchaseListDetailsService.getPurchaseListDetailsVOList(purchaseListId);//采购清单明细
BeanUtils.copyProperties(purchaseList, purchaseListVO);//拷贝
@ -224,7 +222,6 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
purchaseList.setType("分散采购申请");
purchaseList.setId(IdWorker.get32UUID().toUpperCase());
decentralizedRequest.setPurchaseListId(purchaseList.getId());
ArrayList<PurchaseListDetails> purchaseListDetailsArrayList = new ArrayList<>();
for (DecentralizeDetails decentralizeDetails : decentralizeDetailsList) {
if (StrUtil.isNotBlank(decentralizeDetails.getReagentConsumableId())) {
@ -255,7 +252,6 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
purchaseList.setStatus(0);//状态
purchaseList.setType("采购计划");//清单类型,区分分散采购申请和采购计划
purchaseList.setCreateBy(purchasingPlan.getCreateBy());//清单创建人
purchasingPlan.setPurchaseListId(purchaseList.getId());//关联采购清单
ArrayList<PurchaseListDetails> purchaseListDetailsArrayList = new ArrayList<>();

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.constans.ReagentStatusConstants;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.PurchasingPlanDTO;
import digital.laboratory.platform.reagent.entity.*;
@ -26,6 +27,8 @@ import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* (采购计划)服务实现类
@ -89,93 +92,131 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
List<CentralizedRequest> centralizedRequestList = requestService.list(Wrappers.<CentralizedRequest>query().in("id", idList));
List<DetailsOfCentralized> detailsOfCentralizedAllList = new ArrayList<>();
for (CentralizedRequest centralizedRequest : centralizedRequestList) {
List<DetailsOfCentralized> detailsOfCentralizedList = detailsOfCentralizedService.list(Wrappers.<DetailsOfCentralized>query().eq("centralized_request_id", centralizedRequest.getId()));
detailsOfCentralizedAllList.addAll(detailsOfCentralizedList);
}
PurchasingPlan purchasingPlan = new PurchasingPlan();//创建采购计划
purchasingPlan.setPurchasingPlanId(IdWorker.get32UUID().toUpperCase());
purchasingPlan.setCreateId(user.getId());//创建人ID
purchasingPlan.setStatus(0);//状态
purchasingPlan.setCreateName(user.getName());//创建人名称
List<ProcurementContent> list = new ArrayList<>();//需要整合的集合
boolean flag = true;
for (DetailsOfCentralized detailsOfCentralized1 : detailsOfCentralizedAllList) {
PurchasingPlanDTO purchasingPlanDTO = new PurchasingPlanDTO();
BeanUtils.copyProperties(detailsOfCentralized1, purchasingPlanDTO);
purchasingPlanDTO.setDetailsOfCentralizedId(detailsOfCentralized1.getId());
//将列入计划的集中采购申请状态变为3
CentralizedRequest centralizedRequest = requestService.getById(detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId()).getCentralizedRequestId());
centralizedRequest.setStatus(3);
List<String> requestIdList = new ArrayList<>();
List<DetailsOfCentralized> updateList = new ArrayList<>();
//更新采购申请信息
centralizedRequestList.forEach(centralizedRequest -> {
requestIdList.add(centralizedRequest.getId());
centralizedRequest.setStatus(ReagentStatusConstants.CENTRALIZED_PURCHASING_TO_PLAN.getStatus());
centralizedRequest.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());
requestService.updateById(centralizedRequest);
DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId());//集中采购申请明细
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId());//试剂耗材信息
flag = true;
//合并相同的采购内容,若存在相同的采购物品,则无需创建计划明细,将采购申请明细与该计划明细关联即可
if (list.size() != 0) {
for (int i = 0; i < list.size(); i++) {
if (list.get(i).getReagentConsumableId().equals(purchasingPlanDTO.getReagentConsumableId())) {
list.get(i).setUnitPrice(reagentConsumables.getUnitPrice());//获取单价
//Set采购数量
list.get(i).setQuantityPurchased(list.get(i).getQuantityPurchased() + purchasingPlanDTO.getNumberOfApplications());//合并之前的数量加上被合并对象的数量
list.get(i).setSubtotal(list.get(i).getQuantityPurchased() * list.get(i).getUnitPrice());//计算小计
//添加采购申请明细的采购数量
detailsOfCentralized.setQuantityPurchased(detailsOfCentralized.getNumberOfApplications());
detailsOfCentralized.setProcurementContentId(list.get(i).getProcurementContentId());
detailsOfCentralizedService.updateById(detailsOfCentralized);
//被合并后,改变flag,进入下一个循环
flag = false;
}
}
//无需合并的采购计划明细
if (flag) {
ProcurementContent procurementContent = new ProcurementContent();//新建计划明细
BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);//拷贝
procurementContent.setProcurementContentId(IdWorker.get32UUID().toUpperCase());
procurementContent.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());//关联计划ID
procurementContent.setQuantityPurchased(purchasingPlanDTO.getNumberOfApplications());//赋值采购数量
detailsOfCentralized.setQuantityPurchased(detailsOfCentralized.getNumberOfApplications());//赋值采购数量
procurementContent.setUnitPrice(reagentConsumables.getUnitPrice());//单价
procurementContent.setSubtotal(procurementContent.getUnitPrice() * procurementContent.getQuantityPurchased());//小计
detailsOfCentralized.setProcurementContentId(procurementContent.getProcurementContentId());//采购申请明细关联采购计划明细
detailsOfCentralizedService.updateById(detailsOfCentralized);
list.add(procurementContent);//将计划明细添加至集合
}
} else {//对于首次循环,List一定为空,故执行下列语句,且只会执行一次
ProcurementContent procurementContent = new ProcurementContent();
BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);
DetailsOfCentralized byId = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId());
byId.setQuantityPurchased(byId.getNumberOfApplications());
});
requestService.updateBatchById(centralizedRequestList);
List<DetailsOfCentralized> detailsOfCentralizeds = detailsOfCentralizedService.list(Wrappers.<DetailsOfCentralized>lambdaQuery().in(DetailsOfCentralized::getCentralizedRequestId, requestIdList));
// boolean flag = true;
Map<String, List<DetailsOfCentralized>> map = detailsOfCentralizeds.stream().collect(Collectors.groupingBy(item -> item.getReagentConsumableId()));
map.forEach((key, value) -> {
//证明有重复购买的物品,需要合并
if (value.size() > 1) {
ProcurementContent procurementContent = new ProcurementContent();//新建计划明细
fillData(procurementContent, value.get(0));
procurementContent.setProcurementContentId(IdWorker.get32UUID().toUpperCase());
procurementContent.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());
procurementContent.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());//关联计划ID
procurementContent.setQuantityPurchased(0);
procurementContent.setNumberOfApplications(0);
value.forEach(detailsOfCentralized -> {
detailsOfCentralized.setProcurementContentId(procurementContent.getProcurementContentId());
detailsOfCentralized.setQuantityPurchased(detailsOfCentralized.getNumberOfApplications());
updateList.add(detailsOfCentralized);
procurementContent.setQuantityPurchased(procurementContent.getQuantityPurchased() + detailsOfCentralized.getQuantityPurchased());
});
procurementContent.setNumberOfApplications(procurementContent.getQuantityPurchased());
procurementContent.setSubtotal(procurementContent.getUnitPrice() * procurementContent.getQuantityPurchased());
list.add(procurementContent);//将计划明细添加至集合
} else {
DetailsOfCentralized detailsOfCentralized = value.get(0);
ProcurementContent procurementContent = new ProcurementContent();//新建计划明细
procurementContent.setProcurementContentId(IdWorker.get32UUID().toUpperCase());
procurementContent.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());//关联计划ID
fillData(procurementContent, detailsOfCentralized);
procurementContent.setQuantityPurchased(procurementContent.getNumberOfApplications());
procurementContent.setUnitPrice(reagentConsumables.getUnitPrice());
procurementContent.setSubtotal(procurementContent.getQuantityPurchased() * procurementContent.getUnitPrice());
byId.setProcurementContentId(procurementContent.getProcurementContentId());
detailsOfCentralizedService.updateById(byId);
list.add(procurementContent);
detailsOfCentralized.setProcurementContentId(procurementContent.getProcurementContentId());
detailsOfCentralized.setQuantityPurchased(detailsOfCentralized.getNumberOfApplications());
procurementContent.setSubtotal(procurementContent.getUnitPrice() * procurementContent.getQuantityPurchased());
list.add(procurementContent);//将计划明细添加至集合
updateList.add(detailsOfCentralized);
}
}
if (this.save(purchasingPlan) & procurementContentService.saveBatch(list)) {
calculatedAmount(purchasingPlan.getPurchasingPlanId());//计算经费预算
});
// for (DetailsOfCentralized detailsOfCentralized1 : detailsOfCentralizedAllList) {
// PurchasingPlanDTO purchasingPlanDTO = new PurchasingPlanDTO();
// BeanUtils.copyProperties(detailsOfCentralized1, purchasingPlanDTO);
// purchasingPlanDTO.setDetailsOfCentralizedId(detailsOfCentralized1.getId());
// //将列入计划的集中采购申请状态变为3
// CentralizedRequest centralizedRequest = requestService.getById(detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId()).getCentralizedRequestId());
// centralizedRequest.setStatus(3);
// centralizedRequest.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());
// requestService.updateById(centralizedRequest);
//
// DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId());//集中采购申请明细
// ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId());//试剂耗材信息
//
// flag = true;
// //合并相同的采购内容,若存在相同的采购物品,则无需创建计划明细,将采购申请明细与该计划明细关联即可
// if (list.size() != 0) {
// for (int i = 0; i < list.size(); i++) {
// if (list.get(i).getReagentConsumableId().equals(purchasingPlanDTO.getReagentConsumableId())) {
// list.get(i).setUnitPrice(reagentConsumables.getUnitPrice());//获取单价
// //Set采购数量
// list.get(i).setQuantityPurchased(list.get(i).getQuantityPurchased() + purchasingPlanDTO.getNumberOfApplications());//合并之前的数量加上被合并对象的数量
// list.get(i).setSubtotal(list.get(i).getQuantityPurchased() * list.get(i).getUnitPrice());//计算小计
// //添加采购申请明细的采购数量
// detailsOfCentralized.setQuantityPurchased(detailsOfCentralized.getNumberOfApplications());
// detailsOfCentralized.setProcurementContentId(list.get(i).getProcurementContentId());
// detailsOfCentralizedService.updateById(detailsOfCentralized);
// //被合并后,改变flag,进入下一个循环
// flag = false;
// }
// }
// //无需合并的采购计划明细
// if (flag) {
// ProcurementContent procurementContent = new ProcurementContent();//新建计划明细
// BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);//拷贝
// procurementContent.setProcurementContentId(IdWorker.get32UUID().toUpperCase());
// procurementContent.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());//关联计划ID
// procurementContent.setQuantityPurchased(purchasingPlanDTO.getNumberOfApplications());//赋值采购数量
// detailsOfCentralized.setQuantityPurchased(detailsOfCentralized.getNumberOfApplications());//赋值采购数量
// procurementContent.setUnitPrice(reagentConsumables.getUnitPrice());//单价
// procurementContent.setSubtotal(procurementContent.getUnitPrice() * procurementContent.getQuantityPurchased());//小计
// detailsOfCentralized.setProcurementContentId(procurementContent.getProcurementContentId());//采购申请明细关联采购计划明细
// detailsOfCentralizedService.updateById(detailsOfCentralized);
// list.add(procurementContent);//将计划明细添加至集合
//
// }
//
// } else {//对于首次循环,List一定为空,故执行下列语句,且只会执行一次
// ProcurementContent procurementContent = new ProcurementContent();
// BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);
// DetailsOfCentralized byId = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId());
// byId.setQuantityPurchased(byId.getNumberOfApplications());
// procurementContent.setProcurementContentId(IdWorker.get32UUID().toUpperCase());
// procurementContent.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());
// procurementContent.setQuantityPurchased(procurementContent.getNumberOfApplications());
// procurementContent.setUnitPrice(reagentConsumables.getUnitPrice());
// procurementContent.setSubtotal(procurementContent.getQuantityPurchased() * procurementContent.getUnitPrice());
// byId.setProcurementContentId(procurementContent.getProcurementContentId());
// detailsOfCentralizedService.updateById(byId);
// list.add(procurementContent);
// }
// }
if (this.save(purchasingPlan) & procurementContentService.saveBatch(list) && detailsOfCentralizedService.updateBatchById(updateList)) {
calculatedAmount(purchasingPlan, list);//计算经费预算
PurchasingPlanVO purchasingPlanVO = this.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());//获取VO
return purchasingPlanVO;
} else throw new RuntimeException(String.format("保存失败"));
}
public void fillData(ProcurementContent procurementContent, DetailsOfCentralized detailsOfCentralized) {
BeanUtils.copyProperties(detailsOfCentralized, procurementContent);
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId());
procurementContent.setUnitPrice(reagentConsumables.getUnitPrice());
}
@Transactional
@Override//创建计划
public PurchasingPlanVO addById(List<PurchasingPlanDTO> purchasingPlanDTOList, DLPUser user) {
@ -254,7 +295,7 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
}
if (this.save(purchasingPlan) & procurementContentService.saveBatch(list)) {
calculatedAmount(purchasingPlan.getPurchasingPlanId());//计算经费预算
calculatedAmount(purchasingPlan, list);//计算经费预算
PurchasingPlanVO purchasingPlanVO = this.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());//获取VO
return purchasingPlanVO;
} else throw new RuntimeException(String.format("保存失败"));
@ -277,28 +318,19 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
@Override
@Transactional//修改采购计划明细(已废弃)
public ProcurementContent editById(PurchasingPlanDTO purchasingPlanDTO) {
ProcurementContent byId = procurementContentService.getById(purchasingPlanDTO.getProcurementContentId());
BeanUtils.copyProperties(purchasingPlanDTO, byId);
byId.setSubtotal(byId.getUnitPrice() * byId.getQuantityPurchased());
LambdaQueryWrapper<DetailsOfCentralized> detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>();
detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getId, byId.getDetailsOfCentralizedId());
DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getOne(detailsOfCentralizedLambdaQueryWrapper);
detailsOfCentralized.setQuantityPurchased(byId.getQuantityPurchased());
procurementContentService.updateById(byId);
//进行修改
ProcurementContent procurementContent = procurementContentService.getById(purchasingPlanDTO.getProcurementContentId());
PurchasingPlan purchasingPlan = this.getById(procurementContent.getPurchasingPlanId());
BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);
procurementContent.setSubtotal(procurementContent.getUnitPrice() * procurementContent.getQuantityPurchased());
//需要修改采购申请的实际采购数量
DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getOne(Wrappers.<DetailsOfCentralized>lambdaQuery().eq(DetailsOfCentralized::getProcurementContentId, procurementContent.getProcurementContentId()));
detailsOfCentralized.setQuantityPurchased(procurementContent.getQuantityPurchased());
procurementContentService.updateById(procurementContent);
detailsOfCentralizedService.updateById(detailsOfCentralized);
calculatedAmount(byId.getPurchasingPlanId());
return byId;
//计算修改后的经费
calculatedAmount(purchasingPlan,procurementContentService.list(Wrappers.<ProcurementContent>lambdaQuery().eq(ProcurementContent::getPurchasingPlanId, purchasingPlan.getPurchasingPlanId())));
return procurementContent;
}
@ -308,17 +340,12 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
public ProcurementContent editDetails(PurchasingPlanDTO purchasingPlanDTO) {
ProcurementContent procurementContent = procurementContentService.getById(purchasingPlanDTO.getProcurementContentId());//得到计划明细
procurementContent.setUnitPrice(purchasingPlanDTO.getUnitPrice());//得到修改的明细单价
PurchasingPlan purchasingPlan = this.getById(procurementContent.getPurchasingPlanId());//查询出采购计划
DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId());//获取修改的对应的采购申请明细
if (detailsOfCentralized.getQuantityPurchased() == null) {
//原本合并总数量-采购申请明细数量+采购申请明细修改后的数量
procurementContent.setQuantityPurchased(procurementContent.getQuantityPurchased() - detailsOfCentralized.getNumberOfApplications() + purchasingPlanDTO.getQuantityPurchased());
} else {//原本合并总数量-采购申请修改后的采购数量+修改数量
procurementContent.setQuantityPurchased(procurementContent.getQuantityPurchased() - detailsOfCentralized.getQuantityPurchased() + purchasingPlanDTO.getQuantityPurchased());
}
@ -327,7 +354,8 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
detailsOfCentralized.setDetailsRemark(purchasingPlanDTO.getPlanRemark());//修改备注
if (procurementContentService.updateById(procurementContent) && detailsOfCentralizedService.updateById(detailsOfCentralized)) {
calculatedAmount(procurementContent.getPurchasingPlanId());//计算经费预算
//计算经费
calculatedAmount(purchasingPlan,procurementContentService.list(Wrappers.<ProcurementContent>lambdaQuery().eq(ProcurementContent::getPurchasingPlanId, purchasingPlan.getPurchasingPlanId())));
return procurementContent;
} else throw new RuntimeException(String.format("修改失败"));
}
@ -347,14 +375,13 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
if (this.getById(procurementContent.getPurchasingPlanId()).getStatus() == 0
&& detailsOfCentralizedService.updateBatchById(list) && procurementContentService.removeById(procurementContentId)) {
List<ProcurementContent> procurementContentList = procurementContentService.list(Wrappers.<ProcurementContent>query().eq("purchasing_plan_id", purchasingPlan.getPurchasingPlanId()));
//如果采购计划的明细全部被删除,则自动删除这个采购计划
if (procurementContentList.size() == 0) {
this.removeById(purchasingPlan);
return true;
}
calculatedAmount(procurementContent.getPurchasingPlanId());//计算经费预算
calculatedAmount(purchasingPlan,procurementContentService.list(Wrappers.<ProcurementContent>lambdaQuery().eq(ProcurementContent::getPurchasingPlanId, purchasingPlan.getPurchasingPlanId())));
return true;
} else {
return null;
@ -446,7 +473,7 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
purchasingPlan.setStatus(1);
purchasingPlan.setCommitTime(LocalDateTime.now());//
if (this.updateById(purchasingPlan)) {
calculatedAmount(purchasingPlan.getPurchasingPlanId());
calculatedAmount(purchasingPlan,procurementContentService.list(Wrappers.<ProcurementContent>lambdaQuery().eq(ProcurementContent::getPurchasingPlanId, purchasingPlan.getPurchasingPlanId())));
return purchasingPlan;
} else throw new RuntimeException(String.format("提交失败"));
@ -508,21 +535,13 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
}
//计算经费预算方法
public PurchasingPlan calculatedAmount(String purchasingPlanId) {
PurchasingPlan purchasingPlan = this.getById(purchasingPlanId);//采购计划
LambdaQueryWrapper<ProcurementContent> procurementContentLambdaQueryWrapper = new LambdaQueryWrapper<>();
procurementContentLambdaQueryWrapper.eq(ProcurementContent::getPurchasingPlanId, purchasingPlan.getPurchasingPlanId());
List<ProcurementContent> list = procurementContentService.list(procurementContentLambdaQueryWrapper);//这个采购计划内的所有采购计划明细
double x = 0;
public PurchasingPlan calculatedAmount(PurchasingPlan purchasingPlan, List<ProcurementContent> procurementContentList) {
double appropriationBudget = 0d;
//计算每个采购计划明细的小计(单价*采购数量)
for (
ProcurementContent procurementContent : list) {
x = x + procurementContent.getQuantityPurchased() * procurementContent.getUnitPrice();
for (ProcurementContent procurementContent : procurementContentList) {
appropriationBudget = appropriationBudget + procurementContent.getQuantityPurchased() * procurementContent.getUnitPrice();
}
purchasingPlan.setAppropriationBudget(x);//经费预算
purchasingPlan.setAppropriationBudget(appropriationBudget);//经费预算
if (this.updateById(purchasingPlan)) {
return purchasingPlan;
} else throw new RuntimeException(String.format("计算失败"));

@ -558,23 +558,29 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
}
}
if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) {
ReferenceMaterial referenceMaterial = new ReferenceMaterial();
referenceMaterial.setReagentConsumableId(oldReagentConsumables.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(inventory.getReagentConsumableInventoryId());
referenceMaterial.setLocation(location);
referenceMaterial.setStatus(0);
referenceMaterial.setLatticeId(cabinetCell.getId());
referenceMaterial.setBoxId(cabinetCell.getCabinetId());
String roomNo = reagentConsumableInventoryDTO.getRoomNo();
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + roomNo.charAt(0) + "-1");//自动生成编号
referenceMaterial.setCode(referenceMaterial.getNumber());
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setReagentConsumableName(reagentConsumableInventoryDTO.getReagentConsumableName());
referenceMaterial.setMass(reagentConsumableInventoryDTO.getMass());
referenceMaterial.setReferenceMaterialUnit(reagentConsumableInventoryDTO.getReferenceMaterialUnit());
referenceMaterialService.save(referenceMaterial);
this.updateCabinet(cabinetCell.getId(), referenceMaterial.getId(), 1);
Integer totalQuantity = reagentConsumableInventoryDTO.getTotalQuantity();
if (totalQuantity > 1) {
for (Integer i = 0; i < totalQuantity; i++) {
ReferenceMaterial referenceMaterial = new ReferenceMaterial();
referenceMaterial.setReagentConsumableId(oldReagentConsumables.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(inventory.getReagentConsumableInventoryId());
referenceMaterial.setLocation(location);
referenceMaterial.setStatus(0);
referenceMaterial.setLatticeId(cabinetCell.getId());
referenceMaterial.setBoxId(cabinetCell.getCabinetId());
String roomNo = reagentConsumableInventoryDTO.getRoomNo();
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + roomNo.charAt(0) + i + 1);//自动生成编号
referenceMaterial.setCode(referenceMaterial.getNumber());
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setReagentConsumableName(reagentConsumableInventoryDTO.getReagentConsumableName());
referenceMaterial.setMass(reagentConsumableInventoryDTO.getMass());
referenceMaterial.setReferenceMaterialUnit(reagentConsumableInventoryDTO.getReferenceMaterialUnit());
referenceMaterialService.save(referenceMaterial);
this.updateCabinet(cabinetCell.getId(), referenceMaterial.getId(), 1);
}
}
}
this.updateCabinet(cabinetCell.getId(), oldReagentConsumables.getReagentConsumableId(), 1);
@ -616,23 +622,28 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
}
}
if (reagentConsumableInventoryDTO.getCategory().equals("标准物质")) {
ReferenceMaterial referenceMaterial = new ReferenceMaterial();
referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
referenceMaterial.setLocation(location);
referenceMaterial.setStatus(0);
referenceMaterial.setLatticeId(cabinetCell.getId());
referenceMaterial.setBoxId(cabinetCell.getCabinetId());
referenceMaterial.setReagentConsumableName(reagentConsumableInventoryDTO.getReagentConsumableName());
String roomNo = reagentConsumableInventoryDTO.getRoomNo();
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + roomNo.charAt(0) + "-1");//自动生成编号
referenceMaterial.setCode(referenceMaterial.getNumber());
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setMass(reagentConsumableInventoryDTO.getMass());
referenceMaterial.setReferenceMaterialUnit(reagentConsumableInventoryDTO.getReferenceMaterialUnit());
referenceMaterialService.save(referenceMaterial);
this.updateCabinet(cabinetCell.getId(), referenceMaterial.getId(), 1);
Integer totalQuantity = reagentConsumableInventoryDTO.getTotalQuantity();
if (totalQuantity >= 1) {
for (Integer i = 0; i < totalQuantity; i++) {
ReferenceMaterial referenceMaterial = new ReferenceMaterial();
referenceMaterial.setReagentConsumableId(reagentConsumables.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
referenceMaterial.setLocation(location);
referenceMaterial.setStatus(0);
referenceMaterial.setLatticeId(cabinetCell.getId());
referenceMaterial.setBoxId(cabinetCell.getCabinetId());
String roomNo = reagentConsumableInventoryDTO.getRoomNo();
referenceMaterial.setNumber(reagentConsumableInventoryDTO.getAlias() + "-" + year + "-" + roomNo.charAt(0) + "-" + (i + 1));//自动生成编号
referenceMaterial.setCode(referenceMaterial.getNumber());
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setReagentConsumableName(reagentConsumableInventoryDTO.getReagentConsumableName());
referenceMaterial.setMass(reagentConsumableInventoryDTO.getMass());
referenceMaterial.setReferenceMaterialUnit(reagentConsumableInventoryDTO.getReferenceMaterialUnit());
referenceMaterialService.save(referenceMaterial);
this.updateCabinet(cabinetCell.getId(), referenceMaterial.getId(), 1);
}
}
}
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1);
}

@ -95,6 +95,4 @@ public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialM
}
return prefix + newNo;
}
}

@ -106,18 +106,22 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
}
//若无需归还,则证明标准物质/标准储备溶液已经使用完毕,删除记录即可
if (standardMaterialApplicationDTO.getOutOfUse()) {
referenceMaterial.setStatus(-4);
if (reagentConsumables.getCategory().equals("标准储备溶液")) {
StandardReserveSolution solution_numbering = standardReserveSolutionService.getOne(Wrappers.<StandardReserveSolution>query().eq("reference_id", referenceMaterial.getId()));
solution_numbering.setStatus(-1);
standardReserveSolutionService.updateById(solution_numbering);
BatchDetails byId2 = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
byId2.setQuantity(byId2.getQuantity() - 1);
ReagentConsumableInventory byId1 = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId());
byId1.setTotalQuantity(byId1.getTotalQuantity() - 1);
if (byId2.getQuantity() > 0) {
byId2.setServiceStatus(1);
}
batchDetailsService.updateById(byId2);
reagentConsumableInventoryService.updateById(byId1);
reagentConsumableInventoryService.updateCabinet(referenceMaterial.getLatticeId(), referenceMaterial.getId(), 1);
}
} else {
if (referenceMaterial.getServiceStatus() != null) {
if (referenceMaterial.getServiceStatus() == -2) {

@ -60,9 +60,7 @@ public class MaturityCalculation {
}
List<StandardReserveSolution> list = standardReserveSolutionService.list(Wrappers.<StandardReserveSolution>query()
.eq("status", 1));
for (StandardReserveSolution standardReserveSolution : list) {
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId());
standardReserveSolutionService.updateById(standardReserveSolution);
}
periodVerificationPlanService.getPlan();
@ -73,10 +71,10 @@ public class MaturityCalculation {
@Scheduled(cron = "0 0/1 * * * ? ")
public void inventoryReminder() {
System.out.println("~~~~~~~~~~~~~~执行检测系统库存情况~~~~~~~~~~~~~~"+ LocalDateTimeUtil.format(LocalDateTime.now(),"yyyy-MM-dd HH:mm:ss"));
List<StandardReserveSolution> list2 = standardReserveSolutionService.list(Wrappers.<StandardReserveSolution>query()
List<StandardReserveSolution> standardReserveSolutions = standardReserveSolutionService.list(Wrappers.<StandardReserveSolution>query()
.eq("status", 1));
for (StandardReserveSolution standardReserveSolution : list2) {
for (StandardReserveSolution standardReserveSolution : standardReserveSolutions) {
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId());
if (referenceMaterialServiceById.getStatus() == -4) {
standardReserveSolution.setWarningInformation("已全部使用完毕或已报废");
@ -99,12 +97,5 @@ public class MaturityCalculation {
}
reagentConsumableInventoryService.updateById(reagentConsumableInventory);
}
// List<String> item1 = new ArrayList<>();
// item1.add("标准储备溶液");
// List<ReagentConsumableInventoryVO> list1 = reagentConsumableInventoryMapper.getRciListByCategory(item1);
// for (ReagentConsumableInventory reagentConsumableInventory : list1) {
// reagentConsumableInventory.setWarningInformation("无");
// reagentConsumableInventoryService.updateById(reagentConsumableInventory);
// }
}
}

@ -34,7 +34,7 @@ spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
username: dlp
password: 7990016
url: jdbc:mysql://dlp-mysql:3306/dlp_reagent_managment?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
@ -58,7 +58,7 @@ spring:
# 文件上传相关 支持阿里云、华为云、腾讯、minio
oss:
endpoint: http://127.0.0.1:9000
endpoint: http://192.168.9.74:9000
accessKey: dlp
secretKey: 87990016
bucket-name: dlpfiles

@ -36,6 +36,29 @@
<result property="createName" column="create_name"></result>
<result property="department" column="department"></result>
</resultMap>
<!-- <resultMap id="procurmentContenVO" type="digital.laboratory.platform.reagent.vo.ProcurementContentVO">-->
<!-- <id property="procurementContentId" column="procurement_content_id"/>-->
<!-- <result property="purchasingPlanId" column="purchasing_plan_id"/>-->
<!-- <result property="quantityPurchased" column="quantity_purchased"/>-->
<!-- <result property="reagentConsumableId" column="reagent_consumable_id"/>-->
<!-- <result property="subtotal" column="subtotal"/>-->
<!-- <result property="unitPrice" column="unit_price"/>-->
<!-- <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="detailsOfCentralizedId" column="details_of_centralized_id"/>-->
<!-- <result property="replacementReagentConsumableId" column="replacement_reagent_consumable_id"/>-->
<!-- <result property="replacementQuantity" column="replacement_quantity"/>-->
<!-- <result property="replacementPrice" column="replacement_price"/>-->
<!-- <result property="numberOfApplications" column="number_of_applications"/>-->
<!-- <result property="planRemark" column="plan_remark"/>-->
<!-- <result property="replacementRemark" column="replacement_remark"/>-->
<!-- <result property="supplierId" column="supplier_id"/>-->
<!-- <result property="reagentConsumableName" column="reagent_consumable_name"></result>-->
<!-- <result property="replacementReagentConsumableName" column="replacement_reagent_consumable_name"></result>-->
<!-- </resultMap>-->
<sql id="getPurchasingPlanVOSQL">
SELECT pp.*,

@ -111,12 +111,12 @@
</if>
<if test="keywords != null and keywords != ''">
and rm.reagent_consumable_name like concat('%',#{keywords},'%')
or rm.remark like like concat('%',#{keywords},'%')
or rm.remark like concat('%',#{keywords},'%')
</if>
</select>
<select id="getUserList" resultType="digital.laboratory.platform.reagent.vo.UserVO">
SELECT user.name, user.user_id
SELECT user.name, user.user_id11
FROM dlp_base.sys_user user ,dlp_base. b_staff s1
WHERE s1.user_id = user.user_id
<if test="name !=null and name !=''">

Loading…
Cancel
Save