杨海航 2 years ago
parent 6326223288
commit e4c96cef54
  1. 1862
      db/dlp_reagent_managment.sql
  2. 6
      pom.xml
  3. 79
      src/main/java/digital/laboratory/platform/reagent/controller/AcceptanceRecordFormController.java
  4. 19
      src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java
  5. 59
      src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java
  6. 164
      src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java
  7. 9
      src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java
  8. 26
      src/main/java/digital/laboratory/platform/reagent/controller/FixedValueReportController.java
  9. 22
      src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java
  10. 71
      src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java
  11. 12
      src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java
  12. 18
      src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java
  13. 150
      src/main/java/digital/laboratory/platform/reagent/controller/PurchasingPlanController.java
  14. 16
      src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
  15. 31
      src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumablesController.java
  16. 34
      src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java
  17. 95
      src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApplicationController.java
  18. 87
      src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java
  19. 65
      src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java
  20. 86
      src/main/java/digital/laboratory/platform/reagent/controller/StandardSolutionCurveController.java
  21. 13
      src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java
  22. 31
      src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java
  23. 2
      src/main/java/digital/laboratory/platform/reagent/dto/AcceptanceRecordFormDTO.java
  24. 3
      src/main/java/digital/laboratory/platform/reagent/dto/CentralizedRequestDTO.java
  25. 1
      src/main/java/digital/laboratory/platform/reagent/dto/DecentralizedRequestDTO.java
  26. 3
      src/main/java/digital/laboratory/platform/reagent/dto/OutgoingContentsDTO.java
  27. 2
      src/main/java/digital/laboratory/platform/reagent/dto/PurchasingPlanDTO.java
  28. 3
      src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java
  29. 4
      src/main/java/digital/laboratory/platform/reagent/dto/StandardSolutionCurveDTO.java
  30. 3
      src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java
  31. 3
      src/main/java/digital/laboratory/platform/reagent/entity/AcceptanceRecordForm.java
  32. 3
      src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java
  33. 2
      src/main/java/digital/laboratory/platform/reagent/entity/ComplianceCheck.java
  34. 7
      src/main/java/digital/laboratory/platform/reagent/entity/DecentralizeDetails.java
  35. 3
      src/main/java/digital/laboratory/platform/reagent/entity/DetailsOfCentralized.java
  36. 1
      src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationPlan.java
  37. 2
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java
  38. 2
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java
  39. 9
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java
  40. 3
      src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java
  41. 1
      src/main/java/digital/laboratory/platform/reagent/entity/RequisitionRecord.java
  42. 3
      src/main/java/digital/laboratory/platform/reagent/entity/SolutionUseForm.java
  43. 3
      src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApplication.java
  44. 3
      src/main/java/digital/laboratory/platform/reagent/entity/StandardReserveSolution.java
  45. 7
      src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java
  46. 6
      src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java
  47. 3
      src/main/java/digital/laboratory/platform/reagent/mapper/AcceptanceRecordFormMapper.java
  48. 4
      src/main/java/digital/laboratory/platform/reagent/mapper/CatalogueDetailsMapper.java
  49. 1
      src/main/java/digital/laboratory/platform/reagent/mapper/CentralizedRequestMapper.java
  50. 6
      src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java
  51. 4
      src/main/java/digital/laboratory/platform/reagent/mapper/RequisitionRecordMapper.java
  52. 5
      src/main/java/digital/laboratory/platform/reagent/mapper/StandardMaterialApplicationMapper.java
  53. 3
      src/main/java/digital/laboratory/platform/reagent/mapper/StandardMaterialApprovalFormMapper.java
  54. 6
      src/main/java/digital/laboratory/platform/reagent/mapper/StandardSolutionCurveMapper.java
  55. 6
      src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingRecordFormMapper.java
  56. 7
      src/main/java/digital/laboratory/platform/reagent/service/AcceptanceRecordFormService.java
  57. 4
      src/main/java/digital/laboratory/platform/reagent/service/CheckScheduleService.java
  58. 3
      src/main/java/digital/laboratory/platform/reagent/service/ComplianceCheckService.java
  59. 5
      src/main/java/digital/laboratory/platform/reagent/service/PeriodVerificationImplementationService.java
  60. 2
      src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java
  61. 2
      src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java
  62. 2
      src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
  63. 5
      src/main/java/digital/laboratory/platform/reagent/service/ReferenceMaterialService.java
  64. 8
      src/main/java/digital/laboratory/platform/reagent/service/RequisitionRecordService.java
  65. 12
      src/main/java/digital/laboratory/platform/reagent/service/StandardMaterialApplicationService.java
  66. 5
      src/main/java/digital/laboratory/platform/reagent/service/StandardMaterialApprovalFormService.java
  67. 3
      src/main/java/digital/laboratory/platform/reagent/service/StandardReserveSolutionService.java
  68. 10
      src/main/java/digital/laboratory/platform/reagent/service/StandardSolutionCurveService.java
  69. 4
      src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java
  70. 163
      src/main/java/digital/laboratory/platform/reagent/service/impl/AcceptanceRecordFormServiceImpl.java
  71. 20
      src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java
  72. 105
      src/main/java/digital/laboratory/platform/reagent/service/impl/CheckScheduleServiceImpl.java
  73. 27
      src/main/java/digital/laboratory/platform/reagent/service/impl/ComplianceCheckServiceImpl.java
  74. 23
      src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java
  75. 37
      src/main/java/digital/laboratory/platform/reagent/service/impl/DeliveryRegistrationFormServiceImpl.java
  76. 11
      src/main/java/digital/laboratory/platform/reagent/service/impl/InstructionBookServiceImpl.java
  77. 133
      src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationImplementationServiceImpl.java
  78. 2
      src/main/java/digital/laboratory/platform/reagent/service/impl/ProcurementContentServiceImpl.java
  79. 24
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java
  80. 13
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java
  81. 3
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java
  82. 41
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java
  83. 97
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReferenceMaterialServiceImpl.java
  84. 121
      src/main/java/digital/laboratory/platform/reagent/service/impl/RequisitionRecordServiceImpl.java
  85. 1
      src/main/java/digital/laboratory/platform/reagent/service/impl/SolutionUseFormServiceImpl.java
  86. 149
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApplicationServiceImpl.java
  87. 142
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApprovalFormServiceImpl.java
  88. 134
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java
  89. 120
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardSolutionCurveServiceImpl.java
  90. 14
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingContentServiceImpl.java
  91. 255
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java
  92. 9
      src/main/java/digital/laboratory/platform/reagent/vo/AcceptanceRecordFormVO.java
  93. 4
      src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVO.java
  94. 2
      src/main/java/digital/laboratory/platform/reagent/vo/ComplianceCheckVO.java
  95. 2
      src/main/java/digital/laboratory/platform/reagent/vo/InstructionBookVO.java
  96. 7
      src/main/java/digital/laboratory/platform/reagent/vo/PeriodVerificationPlanVO.java
  97. 2
      src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCatalogueVO.java
  98. 39
      src/main/java/digital/laboratory/platform/reagent/vo/PurchaseRequestPrintVO.java
  99. 3
      src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryVO.java
  100. 8
      src/main/java/digital/laboratory/platform/reagent/vo/RequisitionRecordVO.java
  101. Some files were not shown because too many files have changed in this diff Show More

File diff suppressed because it is too large Load Diff

@ -118,6 +118,12 @@
<version>1.12.0</version> <version>1.12.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<!-- for MockMultipartFile--> <!-- for MockMultipartFile-->
<dependency> <dependency>

@ -1,18 +1,27 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO; import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm; import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm;
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
import digital.laboratory.platform.reagent.service.AcceptanceRecordFormService; import digital.laboratory.platform.reagent.service.AcceptanceRecordFormService;
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO; import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -24,6 +33,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.time.LocalDate;
import java.util.List; import java.util.List;
/** /**
@ -47,6 +57,10 @@ public class AcceptanceRecordFormController {
private final AcceptanceRecordFormService acceptanceRecordFormService; private final AcceptanceRecordFormService acceptanceRecordFormService;
private final ReagentConsumablesService reagentConsumablesService;
private final OssFile ossFile;
/** /**
* 通过id查询(验收记录表) * 通过id查询(验收记录表)
* *
@ -69,17 +83,20 @@ public class AcceptanceRecordFormController {
* 分页查询 * 分页查询
* *
* @param page 分页对象 * @param page 分页对象
* @param acceptanceRecordForm (验收记录表) * @param reagentConsumableName (验收记录表)
* @return * @return
*/ */
@ApiOperation(value = "分页查询验收任务", notes = "分页查询验收任务") @ApiOperation(value = "分页查询验收任务", notes = "分页查询验收任务")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_page')" ) // @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_page')" )
public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormPage(Page<AcceptanceRecordForm> page, AcceptanceRecordForm acceptanceRecordForm, HttpServletRequest theHttpServletRequest) { public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormPage(Page<AcceptanceRecordForm> page, String reagentConsumableName, @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(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVOPage(page IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVOPage(page, Wrappers.<AcceptanceRecordForm>query()
.eq(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
); );
return R.ok(acceptanceRecordFormVOPage); return R.ok(acceptanceRecordFormVOPage);
// return R.ok(acceptanceRecordFormService.page(page, Wrappers.query(acceptanceRecordForm))); // return R.ok(acceptanceRecordFormService.page(page, Wrappers.query(acceptanceRecordForm)));
@ -89,17 +106,22 @@ public class AcceptanceRecordFormController {
* 分页查询 * 分页查询
* *
* @param page 分页对象 * @param page 分页对象
* @param acceptanceRecordForm (验收记录表) * @param reagentConsumableName (验收记录表)
* @return * @return
*/ */
@ApiOperation(value = "分页查询验收记录", notes = "分页查询验收记录") @ApiOperation(value = "分页查询验收记录", notes = "分页查询验收记录")
@GetMapping("/recordPage") @GetMapping("/recordPage")
// @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_recordPage')" ) // @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_recordPage')" )
public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormRecordPage(Page<AcceptanceRecordForm> page, AcceptanceRecordForm acceptanceRecordForm, HttpServletRequest theHttpServletRequest) { public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormRecordPage(Page<AcceptanceRecordForm> page, String reagentConsumableName, @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(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVORecordPage(page); IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVOPage(page, Wrappers.<AcceptanceRecordForm>query()
.eq(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.eq("status",4)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
);
return R.ok(acceptanceRecordFormVOPage); return R.ok(acceptanceRecordFormVOPage);
@ -210,7 +232,7 @@ public class AcceptanceRecordFormController {
*/ */
@ApiOperation(value = "三级审核(验收记录表)", notes = "三级审核(验收记录表)") @ApiOperation(value = "三级审核(验收记录表)", notes = "三级审核(验收记录表)")
@SysLog("三级审核(验收记录表)") @SysLog("三级审核(验收记录表)")
@PutMapping("/threeLevel") @PutMapping("/three_level")
@PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_threeLevel')") @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_threeLevel')")
public R<AcceptanceRecordForm> threeLevelAudit(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { public R<AcceptanceRecordForm> threeLevelAudit(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
@ -223,4 +245,47 @@ public class AcceptanceRecordFormController {
} else return R.failed("审核失败"); } else return R.failed("审核失败");
} }
/**-------验收记录打印*/
/**
* 验收记录打印
*
* @param id
* @return
*/
@ApiOperation(value = "验收记录打印", notes = "验收记录打印")
@SysLog("验收记录打印")
@PostMapping("/print")
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(id);
ReagentConsumables byId = reagentConsumablesService.getById(acceptanceRecordFormVO.getReagentConsumableId());
String applyFileName = null;
if (byId.getCategory().equals("试剂") | byId.getCategory().equals("耗材")) {
applyFileName = "试剂耗材验收记录表" + id;
} else {
applyFileName = "标准物质验收记录表" + id;
}
String pdfFilePath = "document" + "/" + "acceptanceRecordForm" + "/" + id + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
acceptanceRecordFormService.acceptanceRecordFormTablePDF(acceptanceRecordFormVO, theHttpServletRequest, httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
}
}
} }

@ -1,5 +1,7 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -16,6 +18,7 @@ import digital.laboratory.platform.reagent.service.CentralizedRequestService;
import digital.laboratory.platform.reagent.service.DetailsOfCentralizedService; import digital.laboratory.platform.reagent.service.DetailsOfCentralizedService;
import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; import digital.laboratory.platform.reagent.vo.CentralizedRequestVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -81,31 +84,21 @@ public class CentralizedRequestController {
* 分页查询 * 分页查询
* *
* @param page 分页对象 * @param page 分页对象
* @param centralizedRequest 集中采购申请
* @return * @return
*/ */
@ApiOperation(value = "分页查询", notes = "分页查询") @ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('CentralizedPurchaseRequestList')") // @PreAuthorize("@pms.hasPermission('CentralizedPurchaseRequestList')")
public R<IPage<CentralizedRequestVO>> getCentralizedRequestPage(Page<CentralizedRequest> page, String orgName, CentralizedRequest centralizedRequest, HttpServletRequest theHttpServletRequest) { public R<IPage<CentralizedRequestVO>> getCentralizedRequestPage(Page<CentralizedRequest> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
if (orgName != null) {
IPage<CentralizedRequestVO> centralizedRequestVOPage = centralizedRequestService.getCentralizedRequestVOPage(page, Wrappers.<CentralizedRequest>query()
.eq("create_by", dlpUser.getId()).orderByDesc("create_time")
.eq("orgName", orgName));
return R.ok(centralizedRequestVOPage);
}
IPage<CentralizedRequestVO> centralizedRequestVOPage = centralizedRequestService.getCentralizedRequestVOPage(page, Wrappers.<CentralizedRequest>query() IPage<CentralizedRequestVO> centralizedRequestVOPage = centralizedRequestService.getCentralizedRequestVOPage(page, Wrappers.<CentralizedRequest>query()
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
.eq("create_by", dlpUser.getId()).orderByDesc("create_time")); .eq("create_by", dlpUser.getId()).orderByDesc("create_time"));
return R.ok(centralizedRequestVOPage); return R.ok(centralizedRequestVOPage);
} }

@ -1,20 +1,27 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.util.StrUtil;
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;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.PeriodVerificationPlanDTO; import digital.laboratory.platform.reagent.dto.PeriodVerificationPlanDTO;
import digital.laboratory.platform.reagent.entity.CheckSchedule; import digital.laboratory.platform.reagent.entity.CheckSchedule;
import digital.laboratory.platform.reagent.entity.PeriodVerificationPlan; import digital.laboratory.platform.reagent.entity.PeriodVerificationPlan;
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
import digital.laboratory.platform.reagent.service.CheckScheduleService; import digital.laboratory.platform.reagent.service.CheckScheduleService;
import digital.laboratory.platform.reagent.service.InstructionBookService; import digital.laboratory.platform.reagent.service.InstructionBookService;
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
import digital.laboratory.platform.reagent.vo.CheckScheduleVO; import digital.laboratory.platform.reagent.vo.CheckScheduleVO;
import org.joda.time.DateTime;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -26,6 +33,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -47,6 +55,7 @@ public class CheckScheduleController {
private final CheckScheduleService checkScheduleService; private final CheckScheduleService checkScheduleService;
private final OssFile ossFile;
/** /**
@ -71,29 +80,26 @@ public class CheckScheduleController {
* 分页查询 * 分页查询
* *
* @param page 分页对象 * @param page 分页对象
* @param checkSchedule * @param page
* @return * @return
*/ */
@ApiOperation(value = "分页查询新增标准物质期间核查计划和确认表", notes = "分页查询新增标准物质期间核查计划和确认表") @ApiOperation(value = "分页查询新增标准物质期间核查计划和确认表", notes = "分页查询新增标准物质期间核查计划和确认表")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_page)" ) // @PreAuthorize("@pms.hasPermission('reagent_check_schedule_page)" )
public R<IPage<CheckScheduleVO>> getCheckSchedulePage(Page<CheckSchedule> page, CheckSchedule checkSchedule,String status, String number,HttpServletRequest theHttpServletRequest) { public R<IPage<CheckScheduleVO>> getCheckSchedulePage(Page<CheckSchedule> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") Date startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") Date endTime, String status, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
QueryWrapper<CheckSchedule> checkScheduleQueryWrapper = new QueryWrapper<>();
if (!status.equals("")){ IPage<CheckScheduleVO> checkScheduleVOPage = checkScheduleService.getCheckScheduleVOPage(page, Wrappers.<CheckSchedule>query()
checkScheduleQueryWrapper.eq("status",status); .ge(startTime!=null,"create_time", startTime)
} .le(endTime!=null,"create_time", endTime)
if (!number.equals("")){ .eq(StrUtil.isNotBlank(status), "status", status)
checkScheduleQueryWrapper.eq("number",number);
}
IPage<CheckScheduleVO> checkScheduleVOPage = checkScheduleService.getCheckScheduleVOPage(page, checkScheduleQueryWrapper
.orderByDesc("create_time")); .orderByDesc("create_time"));
return R.ok(checkScheduleVOPage); return R.ok(checkScheduleVOPage);
} }
/** /**
* 新增 * 新增
* *
@ -181,6 +187,39 @@ public class CheckScheduleController {
} else return R.failed("审核失败"); } else return R.failed("审核失败");
} }
/**-------验收记录打印*/
/**
* 验收记录打印
*
* @param id
* @return
*/
@ApiOperation(value = "期间核查计划打印", notes = "期间核查计划打印")
@SysLog("期间核查计划打印")
@PostMapping("/print")
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
CheckScheduleVO checkScheduleVO = checkScheduleService.getCheckScheduleVO(id);
String applyFileName = "标准物质期间核查计划和确认表" + id;
;
String pdfFilePath = "document" + "/" + "checkSchedule" + "/" + id + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
checkScheduleService.checkScheduleTablePDF(checkScheduleVO, theHttpServletRequest, httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
}
}
} }

@ -1,17 +1,36 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.StrUtil;
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;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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 digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.ComplianceCheckDTO; import digital.laboratory.platform.reagent.dto.ComplianceCheckDTO;
import digital.laboratory.platform.reagent.entity.ComplianceCheck; import digital.laboratory.platform.reagent.entity.ComplianceCheck;
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
import digital.laboratory.platform.reagent.service.ComplianceCheckService; import digital.laboratory.platform.reagent.service.ComplianceCheckService;
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
import digital.laboratory.platform.reagent.vo.ComplianceCheckVO; import digital.laboratory.platform.reagent.vo.ComplianceCheckVO;
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -21,8 +40,12 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.sql.Date;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -47,6 +70,13 @@ public class ComplianceCheckController {
private final ComplianceCheckService complianceCheckService; private final ComplianceCheckService complianceCheckService;
private final OssFile ossFile;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Autowired
private ReagentConsumablesService reagentConsumablesService;
/** /**
* 通过id查询(符合性检查记录表) * 通过id查询(符合性检查记录表)
* *
@ -75,11 +105,14 @@ public class ComplianceCheckController {
@ApiOperation(value = "分页查询", notes = "分页查询") @ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_page)") // @PreAuthorize("@pms.hasPermission('reagent_compliance_check_page)")
public R<IPage<ComplianceCheckVO>> getComplianceCheckPage(Page<ComplianceCheck> page, ComplianceCheck complianceCheck, HttpServletRequest theHttpServletRequest) { public R<IPage<ComplianceCheckVO>> getComplianceCheckPage(Page<ComplianceCheck> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<ComplianceCheckVO> complianceCheckSList = complianceCheckService.getComplianceCheckVOPage(page, Wrappers.<ComplianceCheck>query() IPage<ComplianceCheckVO> complianceCheckSList = complianceCheckService.getComplianceCheckVOPage(page, Wrappers.<ComplianceCheck>query()
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
.orderByDesc("create_time") .orderByDesc("create_time")
); );
return R.ok(complianceCheckSList); return R.ok(complianceCheckSList);
@ -109,6 +142,7 @@ public class ComplianceCheckController {
// return R.failed(complianceCheck, "保存失败"); // return R.failed(complianceCheck, "保存失败");
// } // }
// } // }
/** /**
* 手动新增符合性检查记录表(试剂耗材) * 手动新增符合性检查记录表(试剂耗材)
* *
@ -274,4 +308,132 @@ public class ComplianceCheckController {
} }
/**-------采购计划打印*/
/**
* 采购计划打印
*
* @param purchasingPlanId
* @return
*/
@ApiOperation(value = "试剂耗材符合性检查打印", notes = "试剂耗材符合性检查打印")
@SysLog("试剂耗材符合性检查打印")
@PostMapping("/print")
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
public void bizGetPDFInventory(String complianceCheckId, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
ComplianceCheckVO complianceCheckVO = complianceCheckService.getComplianceCheckVO(complianceCheckId);
String id = complianceCheckVO.getId();
String applyFileName = null;
if (reagentConsumablesService.getById(complianceCheckVO.getReagentConsumableId()).getCategory().equals("标准物质") |
reagentConsumablesService.getById(complianceCheckVO.getReagentConsumableId()).getCategory().equals("标准储备溶液")) {
applyFileName = "标准物质符合性检查" + id;
} else {
applyFileName = "试剂耗材符合性检查-" + id;
}
String pdfFilePath = "document" + "/" + "complianceCheck" + "/" + id + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
complianceCheckTablePDF(complianceCheckVO, id, theHttpServletRequest, httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
}
}
public void complianceCheckTablePDF(ComplianceCheckVO complianceCheckVO, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("ComplianceCheckTablePDF.................");
String applyFileName = null;
//-----------------------------
// 生成 word 版本的 采购目录
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ReagentConsumables byId = reagentConsumablesService.getById(complianceCheckVO.getReagentConsumableId());
if (byId.getCategory().equals("标准物质") |
byId.getCategory().equals("标准储备溶液")) {
ossFile.fileGet("template" + "/" + "标准物质符合性检查记录表模板.docx", bos);
applyFileName = "标准物质符合性检查" + id;
} else {
ossFile.fileGet("template" + "/" + "试剂耗材符合性检查记录表模板.docx", bos);
applyFileName = "试剂耗材符合性检查-" + id;
}
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
Configure config = Configure.builder().
bind("voList", policy).build();
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
new HashMap<String, Object>() {{
put("dateOfInspection", LocalDateTimeUtil.format(complianceCheckVO.getDateOfInspection(), "yyyy年MM月dd日"));
put("id", id);
put("size", 1);
put("reagentConsumableName", complianceCheckVO.getReagentConsumableName());
put("brand", complianceCheckVO.getBrand());
put("specificationAndModel", complianceCheckVO.getSpecificationAndModel());
put("inspectionScheme", complianceCheckVO.getInspectionScheme());
put("examinationConclusion", complianceCheckVO.getExaminationConclusion());
put("nonconformingItem", complianceCheckVO.getNonconformingItem());
put("primaryAuditorName", complianceCheckVO.getPrimaryAuditorName());
put("secondaryAuditorName", complianceCheckVO.getSecondaryAuditorName());
put("auditTimeOfPrimary", LocalDateTimeUtil.format(complianceCheckVO.getAuditTimeOfPrimary(), "yyyy年MM月dd日"));
put("auditTimeOfSecondary", LocalDateTimeUtil.format(complianceCheckVO.getAuditTimeOfSecondary(), "yyyy年MM月dd日"));
if (byId.getCategory().equals("标准物质") |
byId.getCategory().equals("标准储备溶液")) {
put("executorName", complianceCheckVO.getExecutorName());
put("reagentConsumableNumber", complianceCheckVO.getReagentConsumableNumber());
put("commitTime", LocalDateTimeUtil.format(complianceCheckVO.getCommitTime(), "yyyy年MM月dd日"));
}
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "complianceCheck" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}
} }

@ -1,11 +1,13 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.date.DateTime;
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A; import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
@ -23,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -80,18 +83,20 @@ public class DecentralizedRequestController {
* 分页查询 * 分页查询
* *
* @param page 分页对象 * @param page 分页对象
* @param decentralizedRequest (分散采购申请) * @param page (分散采购申请)
* @return * @return
*/ */
@ApiOperation(value = "分页查询", notes = "分页查询") @ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')") // @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')")
public R<IPage<DecentralizedRequestVO>> getDecentralizedRequestPage(Page<DecentralizedRequest> page, DecentralizedRequest decentralizedRequest, HttpServletRequest theHttpServletRequest) { public R<IPage<DecentralizedRequestVO>> getDecentralizedRequestPage(Page<DecentralizedRequest> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime , @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<DecentralizedRequestVO> decentralizedRequestSList = decentralizedRequestService.getDecentralizedRequestVOPage(page, Wrappers.<DecentralizedRequest>query() IPage<DecentralizedRequestVO> decentralizedRequestSList = decentralizedRequestService.getDecentralizedRequestVOPage(page, Wrappers.<DecentralizedRequest>query()
.eq("create_by", dlpUser.getId()) .eq("create_by", dlpUser.getId())
.ge(startTime!=null,"create_time",startTime)
.le(endTime!=null,"create_time",endTime)
.orderByDesc("create_time") .orderByDesc("create_time")
); );
return R.ok(decentralizedRequestSList); return R.ok(decentralizedRequestSList);

@ -81,14 +81,18 @@ public class FixedValueReportController {
Map<String, String> ResultData = new HashMap<>(); Map<String, String> ResultData = new HashMap<>();
ResultData.put("fileName", fileName); ResultData.put("fileName", fileName);
ResultData.put("path", path); ResultData.put("path", path);
FixedValueReport fixedValueReport = new FixedValueReport();
FixedValueReport fixedValueReport1 = fixedValueReportService.getOne(Wrappers.<FixedValueReport>query().eq("reference_substance_id", id));
if (fixedValueReport1 == null) {
FixedValueReport fixedValueReport = new FixedValueReport();
if (b) { if (b) {
fixedValueReport.setFixedValueReportId(IdWorker.get32UUID().toUpperCase());
fixedValueReport.setFixedValueReport(fileName); fixedValueReport.setFixedValueReport(fileName);
fixedValueReport.setFixedValueReportId(IdWorker.get32UUID().toUpperCase());
fixedValueReport.setFixedResult(fixedResult); fixedValueReport.setFixedResult(fixedResult);
fixedValueReport.setReferenceSubstanceId(byId.getId()); fixedValueReport.setReferenceSubstanceId(id);
String fileNames = path + "/" + fileName; String fileNames = path + "/" + fileName;
ossFile.fileGet(fileNames, httpServletResponse.getOutputStream()); ossFile.fileGet(fileNames, httpServletResponse.getOutputStream());
@ -97,6 +101,20 @@ public class FixedValueReportController {
return R.ok(fixedValueReport, "上传成功"); return R.ok(fixedValueReport, "上传成功");
} else return R.failed("上传失败"); } else return R.failed("上传失败");
} else {
if (b) {
fixedValueReport1.setFixedValueReport(fileName);
fixedValueReport1.setFixedResult(fixedResult);
String fileNames = path + "/" + fileName;
ossFile.fileGet(fileNames, httpServletResponse.getOutputStream());
fixedValueReportService.updateById(fixedValueReport1);
return R.ok(fixedValueReport1, "上传成功");
} else return R.failed("上传失败");
}
} }
/** /**

@ -79,8 +79,12 @@ public class InstructionBookController {
Map<String, String> ResultData = new HashMap<>(); Map<String, String> ResultData = new HashMap<>();
ResultData.put("fileName", fileName); ResultData.put("fileName", fileName);
ResultData.put("path", path); ResultData.put("path", path);
InstructionBook instructionBook = new InstructionBook();
InstructionBook instructionBook1 = instructionBookService.getOne(Wrappers.<InstructionBook>query().eq("reference_material_type_id", id));
if (instructionBook1 == null) {
InstructionBook instructionBook = new InstructionBook();
if (b) { if (b) {
instructionBook.setId(IdWorker.get32UUID().toUpperCase()); instructionBook.setId(IdWorker.get32UUID().toUpperCase());
instructionBook.setCommitTime(LocalDateTime.now()); instructionBook.setCommitTime(LocalDateTime.now());
@ -97,7 +101,23 @@ public class InstructionBookController {
return R.ok(instructionBook, "上传成功"); return R.ok(instructionBook, "上传成功");
} else return R.failed("上传失败"); } else return R.failed("上传失败");
} else {
if (b) {
instructionBook1.setCommitTime(LocalDateTime.now());
instructionBook1.setMakerId(dlpUser.getId());
instructionBook1.setInstructionBook(fileName);
instructionBook1.setCommitStatus(1);
String fileNames = path + "/" + fileName;
ossFile.fileGet(fileNames, httpServletResponse.getOutputStream());
instructionBookService.save(instructionBook1);
return R.ok(instructionBook1, "上传成功");
} else return R.failed("上传失败");
}
} }

@ -1,17 +1,23 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.util.StrUtil;
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;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.PeriodVerificationImplementationDTO; import digital.laboratory.platform.reagent.dto.PeriodVerificationImplementationDTO;
import digital.laboratory.platform.reagent.entity.PeriodVerificationImplementation; import digital.laboratory.platform.reagent.entity.PeriodVerificationImplementation;
import digital.laboratory.platform.reagent.service.PeriodVerificationImplementationService; import digital.laboratory.platform.reagent.service.PeriodVerificationImplementationService;
import digital.laboratory.platform.reagent.vo.CheckScheduleVO;
import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO; import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO;
import org.joda.time.DateTime;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -30,7 +36,7 @@ import java.util.List;
* *
* @author Zhang Xiaolong created at 2023-03-10 * @author Zhang Xiaolong created at 2023-03-10
* @describe (标准物质期间核查实施情况及结果记录表) 前端控制器 * @describe (标准物质期间核查实施情况及结果记录表) 前端控制器
* * <p>
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service
* 这里写什么: * 这里写什么:
* 为前端提供数据, 接受前端的数据 * 为前端提供数据, 接受前端的数据
@ -46,8 +52,11 @@ public class PeriodVerificationImplementationController {
private final PeriodVerificationImplementationService periodVerificationImplementationService; private final PeriodVerificationImplementationService periodVerificationImplementationService;
private final OssFile ossFile;
/** /**
* 通过id查询(标准物质期间核查实施情况及结果记录表) * 通过id查询(标准物质期间核查实施情况及结果记录表)
*
* @param periodVerificationImplementationId id * @param periodVerificationImplementationId id
* @return R * @return R
*/ */
@ -65,6 +74,7 @@ public class PeriodVerificationImplementationController {
/** /**
* 分页查询 * 分页查询
*
* @param page 分页对象 * @param page 分页对象
* @param periodVerificationImplementation (标准物质期间核查实施情况及结果记录表) * @param periodVerificationImplementation (标准物质期间核查实施情况及结果记录表)
* @return * @return
@ -72,19 +82,14 @@ public class PeriodVerificationImplementationController {
@ApiOperation(value = "分页查询", notes = "分页查询") @ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_page')" ) // @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_page')" )
public R<IPage<PeriodVerificationImplementationVO>> getPeriodVerificationImplementationPage(Page<PeriodVerificationImplementation> page, String name,PeriodVerificationImplementation periodVerificationImplementation, HttpServletRequest theHttpServletRequest) { public R<IPage<PeriodVerificationImplementationVO>> getPeriodVerificationImplementationPage(Page<PeriodVerificationImplementation> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, String referenceMaterialName, PeriodVerificationImplementation periodVerificationImplementation, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
if (name!=null){
IPage<PeriodVerificationImplementationVO> periodVerificationImplementationSList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.<PeriodVerificationImplementation>query()
.orderByDesc("create_time")
);
return R.ok(periodVerificationImplementationSList);
}
IPage<PeriodVerificationImplementationVO> periodVerificationImplementationSList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.<PeriodVerificationImplementation>query() IPage<PeriodVerificationImplementationVO> periodVerificationImplementationSList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.<PeriodVerificationImplementation>query()
.like(StrUtil.isNotBlank(referenceMaterialName), "reference_material_name", referenceMaterialName)
.ge("create_time", startTime)
.le("create_time", endTime)
.orderByDesc("create_time") .orderByDesc("create_time")
); );
return R.ok(periodVerificationImplementationSList); return R.ok(periodVerificationImplementationSList);
@ -94,6 +99,7 @@ public class PeriodVerificationImplementationController {
/** /**
* 修改(标准物质期间核查实施情况及结果记录表) * 修改(标准物质期间核查实施情况及结果记录表)
*
* @param periodVerificationImplementationDTO (标准物质期间核查实施情况及结果记录表) * @param periodVerificationImplementationDTO (标准物质期间核查实施情况及结果记录表)
* @return R * @return R
*/ */
@ -109,8 +115,7 @@ public class PeriodVerificationImplementationController {
if (periodVerificationImplementation != null) { if (periodVerificationImplementation != null) {
return R.ok(periodVerificationImplementation, "保存成功"); return R.ok(periodVerificationImplementation, "保存成功");
} } else {
else {
return R.failed("保存对象失败"); return R.failed("保存对象失败");
} }
} }
@ -141,6 +146,7 @@ public class PeriodVerificationImplementationController {
/** /**
* 提交(标准物质期间核查实施情况及结果记录表) * 提交(标准物质期间核查实施情况及结果记录表)
*
* @param periodVerificationImplementationDTO (标准物质期间核查实施情况及结果记录表) * @param periodVerificationImplementationDTO (标准物质期间核查实施情况及结果记录表)
* @return R * @return R
*/ */
@ -158,14 +164,14 @@ public class PeriodVerificationImplementationController {
if (periodVerificationImplementation != null) { if (periodVerificationImplementation != null) {
return R.ok(periodVerificationImplementation, "提交成功"); return R.ok(periodVerificationImplementation, "提交成功");
} } else {
else {
return R.failed("提交失败"); return R.failed("提交失败");
} }
} }
/** /**
* 审核(标准物质期间核查实施情况及结果记录表) * 审核(标准物质期间核查实施情况及结果记录表)
*
* @param auditAndApproveDTO (标准物质期间核查实施情况及结果记录表) * @param auditAndApproveDTO (标准物质期间核查实施情况及结果记录表)
* @return R * @return R
*/ */
@ -181,11 +187,44 @@ public class PeriodVerificationImplementationController {
if (periodVerificationImplementation != null) { if (periodVerificationImplementation != null) {
return R.ok(periodVerificationImplementation, "审核成功"); return R.ok(periodVerificationImplementation, "审核成功");
} } else {
else {
return R.failed("审核失败"); return R.failed("审核失败");
} }
} }
/**-------标准物质期间核查计划和确认表打印*/
/**
* 标准物质期间核查计划和确认表打印
*
* @param id
* @return
*/
@ApiOperation(value = "标准物质期间核查计划和确认表打印", notes = "标准物质期间核查计划和确认表打印")
@SysLog("期间核查计划打印")
@PostMapping("/print")
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
PeriodVerificationImplementationVO periodVerificationImplementationVO = periodVerificationImplementationService.getPeriodVerificationImplementationVO(id);
if (periodVerificationImplementationVO == null) {
throw new RuntimeException("未查询到相关信息");
}
String applyFileName = "标准物质期间核查实施情况及结果记录表" + id;
;
String pdfFilePath = "document" + "/" + "periodVerificationImplementation" + "/" + id + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
periodVerificationImplementationService.periodVerificationImplementationTablePDF(periodVerificationImplementationVO, theHttpServletRequest, httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
}
}
} }

@ -92,15 +92,15 @@ public class PurchaseCatalogueController {
@ApiOperation(value = "分页查询已发布的采购目录明细", notes = "分页查询已发布的采购目录明细") @ApiOperation(value = "分页查询已发布的采购目录明细", notes = "分页查询已发布的采购目录明细")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_getPage')") // @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_getPage')")
public R<Page<CatalogueDetailsVO>> getPurchaseCataloguePage(String name,HttpServletRequest theHttpServletRequest) { public R<List<CatalogueDetails>> getPurchaseCataloguePage(String name,HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
Page vOpage = purchaseCatalogueService.getVOpage(name); List<CatalogueDetails> list = purchaseCatalogueService.getList(name);
return R.ok(vOpage); return R.ok(list);
} }
@ -253,7 +253,7 @@ public class PurchaseCatalogueController {
Boolean aBoolean = purchaseCatalogueService.delCatalogue(purchaseCatalogueId); Boolean aBoolean = purchaseCatalogueService.delCatalogue(purchaseCatalogueId);
if (aBoolean) { if (aBoolean) {
return R.ok("删除采购"); return R.ok("删除成功");
} else return R.failed("删除失败"); } else return R.failed("删除失败");
} }
@ -397,9 +397,9 @@ public class PurchaseCatalogueController {
return R.ok(anImport); return R.ok(anImport);
} }
/**-------出库清单*/ /**-------采购目录打印*/
/** /**
* 出库清单 * 采购目录打印
* *
* @param purchaseCatalogueId * @param purchaseCatalogueId
* *

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
@ -14,6 +15,8 @@ import digital.laboratory.platform.reagent.service.PurchaseListService;
import digital.laboratory.platform.reagent.vo.PurchaseListDetailsVO; import digital.laboratory.platform.reagent.vo.PurchaseListDetailsVO;
import digital.laboratory.platform.reagent.vo.PurchaseListPageVO; import digital.laboratory.platform.reagent.vo.PurchaseListPageVO;
import digital.laboratory.platform.reagent.vo.PurchaseListVO; import digital.laboratory.platform.reagent.vo.PurchaseListVO;
import org.joda.time.DateTime;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -25,6 +28,9 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.sql.Date;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
@ -70,17 +76,18 @@ public class PurchaseListController {
/** /**
* 分页查询 * 分页查询
* @param page 分页对象 * @param page 分页对象
* @param purchaseList (采购清单)
* @return * @return
*/ */
@ApiOperation(value = "分页查询", notes = "分页查询") @ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page" ) @GetMapping("/page" )
// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_page')" ) // @PreAuthorize("@pms.hasPermission('reagent_purchase_list_page')" )
public R<IPage<PurchaseListPageVO>> getPurchaseListPage(Page<PurchaseList> page, PurchaseList purchaseList, HttpServletRequest theHttpServletRequest) { public R<IPage<PurchaseListPageVO>> getPurchaseListPage(Page<PurchaseList> page, @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(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<PurchaseListPageVO> purchaseListSList = purchaseListService.getPurchaseListVOPage(page, Wrappers.<PurchaseList>query() IPage<PurchaseListPageVO> purchaseListSList = purchaseListService.getPurchaseListVOPage(page, Wrappers.<PurchaseList>query()
.ge(startTime!=null,"create_time",startTime)
.le(endTime!=null,"create_time",endTime)
.orderByDesc("create_time") .orderByDesc("create_time")
); );
return R.ok(purchaseListSList); return R.ok(purchaseListSList);
@ -105,24 +112,23 @@ public class PurchaseListController {
purchaseListService.editById(purchaseListDTO); purchaseListService.editById(purchaseListDTO);
return R.ok("添加成功"); return R.ok("添加成功");
} }
/** /**
* 新增(采购清单) * 新增(采购清单)
* @param purchaseListDTOList (采购清单) * @param id (采购清单)
* @return R * @return R
*/ */
@ApiOperation(value = "提交采购清单明细", notes = "提交采购清单明细") @ApiOperation(value = "提交采购清单明细", notes = "提交采购清单明细")
@SysLog("提交采购清单明细" ) @SysLog("提交采购清单明细" )
@PutMapping("/commit") @PutMapping("/commit")
// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_commit)" ) // @PreAuthorize("@pms.hasPermission('reagent_purchase_list_commit)" )
public R<PurchaseList> commitById(List<PurchaseListDTO> purchaseListDTOList, HttpServletRequest theHttpServletRequest) { public R<PurchaseList> commitById(String id, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
PurchaseList purchaseList = purchaseListService.commitById(purchaseListDTOList); PurchaseList purchaseList = purchaseListService.commitById(id);
if (purchaseList!=null) { if (purchaseList!=null) {
return R.ok(purchaseList, "提交成功"); return R.ok(purchaseList, "提交成功");

@ -1,35 +1,51 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
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.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.PurchasingPlanDTO; import digital.laboratory.platform.reagent.dto.PurchasingPlanDTO;
import digital.laboratory.platform.reagent.entity.ProcurementContent; import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.entity.PurchaseCatalogue;
import digital.laboratory.platform.reagent.entity.PurchasingPlan;
import digital.laboratory.platform.reagent.service.PurchasingPlanService; import digital.laboratory.platform.reagent.service.PurchasingPlanService;
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO; import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO;
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO; import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
import digital.laboratory.platform.reagent.vo.ReplacementVO; import digital.laboratory.platform.reagent.vo.ReplacementVO;
import feign.Response;
import lombok.Data; import lombok.Data;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.security.Principal; import java.security.Principal;
import java.sql.Date; import java.sql.Date;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -54,6 +70,12 @@ public class PurchasingPlanController {
@Autowired @Autowired
private final PurchasingPlanService purchasingPlanService; private final PurchasingPlanService purchasingPlanService;
private final OssFile ossFile;
private final RemoteWord2PDFService remoteWord2PDFService;
private final ReagentConsumablesService reagentConsumablesService;
/** /**
* 通过id查询(采购计划) * 通过id查询(采购计划)
* *
@ -321,7 +343,129 @@ public class PurchasingPlanController {
return R.failed("审批失败"); return R.failed("审批失败");
} }
} }
/**-------采购计划打印*/
/**
* 采购计划打印
*
* @param purchasingPlanId
*
* @return
*/
@ApiOperation(value = "采购计划打印", notes = "采购计划打印")
@SysLog("采购计划打印")
@PostMapping("/print")
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
public void bizGetPDFInventory(String purchasingPlanId, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
PurchasingPlanVO purchasingPlanVO = purchasingPlanService.getPurchasingPlanVO(purchasingPlanId);
List<ProcurementContentVO> voList = purchasingPlanVO.getProcurementContentVOList();
if (voList.isEmpty()) {
throw new RuntimeException("未查询到相关信息");
}
String id = purchasingPlanVO.getPurchasingPlanId();
String applyFileName = "采购计划-"+id;
String pdfFilePath = "document" + "/"+"purchasingPlan" + "/" + id + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
purchasingPlanTablePDF(purchasingPlanVO,id,theHttpServletRequest,httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
}
}
private void purchasingPlanTablePDF(PurchasingPlanVO purchasingPlanVO, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("PurchasingPlanTablePDF.................");
List<ProcurementContentVO> procurementContentVOList = purchasingPlanVO.getProcurementContentVOList();
ArrayList<ProcurementContentVO> voList = new ArrayList<>();
for (ProcurementContentVO procurementContentVO : procurementContentVOList) {
ReagentConsumables byId = reagentConsumablesService.getById(procurementContentVO.getReagentConsumableId());
if (byId.getCategory().equals("试剂")|byId.getCategory().equals("耗材")){
voList.add(procurementContentVO);
}
}
//-----------------------------
// 生成 word 版本的 采购目录
String applyFileName = "采购计划-"+id;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ossFile.fileGet("template" + "/" + "试剂耗材采购计划表模板.docx", bos);
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
Configure config = Configure.builder().
bind("voList", policy).build();
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
new HashMap<String, Object>() {{
put("voList", voList);
put("appropriationBudget",purchasingPlanVO.getAppropriationBudget());
put("id",id);
put("size",1);
put("createName", purchasingPlanVO.getCreateName());
put("primaryAuditorName", purchasingPlanVO.getPrimaryAuditorName());
put("approverName", purchasingPlanVO.getApproverName());
put("createTime",LocalDateTimeUtil.format(purchasingPlanVO.getCommitTime(),"yyyy年MM月dd日"));
put("auditTimeOfPrimary",LocalDateTimeUtil.format(purchasingPlanVO.getAuditTimeOfPrimary(),"yyyy年MM月dd日"));
put("approvalTime",LocalDateTimeUtil.format(purchasingPlanVO.getApprovalTime(),"yyyy年MM月dd日"));
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "purchasingPlan" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}

@ -101,10 +101,13 @@ public class ReagentConsumableInventoryController {
@ApiOperation(value = "标准物质管理列表", notes = "标准物质管理列表") @ApiOperation(value = "标准物质管理列表", notes = "标准物质管理列表")
@GetMapping("/standardList") @GetMapping("/standardList")
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) // @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
public R<Page<ReagentConsumableInventoryVO>> getReagentConsumableInventoryList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) { public R<IPage<ReagentConsumableInventoryVO>> getReagentConsumableInventoryList(Page<ReagentConsumableInventory> page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
Page<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, reagentConsumableName); IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, Wrappers.<ReagentConsumableInventory>query()
.like(StrUtil.isNotBlank(reagentConsumableName),"reagent_consumable_name",reagentConsumableName)
.eq("category", "标准物质").or()
.eq("category", "标准储备溶液"));
return R.ok(reagentConsumableInventoryRMVOList); return R.ok(reagentConsumableInventoryRMVOList);
// return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory))); // return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory)));
} }
@ -112,11 +115,14 @@ public class ReagentConsumableInventoryController {
@ApiOperation(value = "试剂耗材管理列表", notes = "试剂耗材管理列表") @ApiOperation(value = "试剂耗材管理列表", notes = "试剂耗材管理列表")
@GetMapping("/List") @GetMapping("/List")
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) // @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
public R<Page<ReagentConsumableInventoryVO>> getList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) { public R<IPage<ReagentConsumableInventoryVO>> getList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
Page<ReagentConsumableInventoryVO> reagentConsumableInventoryVOList = reagentConsumableInventoryService.getReagentConsumableInventoryVOList(page, reagentConsumableName); IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, Wrappers.<ReagentConsumableInventory>query()
return R.ok(reagentConsumableInventoryVOList); .like(StrUtil.isNotBlank(reagentConsumableName),"reagent_consumable_name",reagentConsumableName)
.eq("category", "试剂").or()
.eq("category", "耗材"));
return R.ok(reagentConsumableInventoryRMVOList);
// return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory))); // return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory)));
} }

@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.util.List;
/** /**
* (试剂耗材类) * (试剂耗材类)
@ -54,18 +55,40 @@ public class ReagentConsumablesController {
@ApiOperation(value = "分页查询试剂耗材类(包括标准物质)", notes = "分页查询试剂耗材类(包括标准物质)") @ApiOperation(value = "分页查询试剂耗材类(包括标准物质)", notes = "分页查询试剂耗材类(包括标准物质)")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumables_get')" ) // @PreAuthorize("@pms.hasPermission('reagent_reagent_consumables_get')" )
public R<IPage<ReagentConsumables>> getReagentConsumablesPage(Page<ReagentConsumables> page, String name, HttpServletRequest theHttpServletRequest) { public R<List<ReagentConsumables>> getReagentConsumablesPage(Page<ReagentConsumables> page, String name, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<ReagentConsumables> reagentConsumablesSList = reagentConsumablesService.page(page, Wrappers.<ReagentConsumables>query() List<ReagentConsumables> list = reagentConsumablesService.list(Wrappers.<ReagentConsumables>query()
.eq("category", "试剂").or() .eq("category", "试剂").or()
.eq("category", "耗材").or() .eq("category", "耗材").or()
.eq("category", "标准物质") .eq("category", "标准物质")
.eq(StrUtil.isNotBlank(name),"reagent_consumable_name",name) .like(StrUtil.isNotBlank(name), "reagent_consumable_name", name)
.orderByDesc("create_time") .orderByDesc("create_time")
); );
return R.ok(reagentConsumablesSList);
return R.ok(list);
// return R.ok(reagentConsumablesService.page(page, Wrappers.query(reagentConsumables)));
}
/**
* 分页查询
*
* @param id 分页对象
* @param id (试剂耗材类)
* @return
*/
@ApiOperation(value = "通过ID查询试剂耗材类(包括标准物质)", notes = "通过ID查询试剂耗材类")
@GetMapping()
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumables_get')" )
public R<ReagentConsumables> getReagentConsumables(String id, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
ReagentConsumables byId = reagentConsumablesService.getById(id);
return R.ok(byId);
// return R.ok(reagentConsumablesService.page(page, Wrappers.query(reagentConsumables))); // return R.ok(reagentConsumablesService.page(page, Wrappers.query(reagentConsumables)));
} }
} }

@ -7,8 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.entity.RequisitionRecord; import digital.laboratory.platform.reagent.entity.RequisitionRecord;
import digital.laboratory.platform.reagent.service.RequisitionRecordService; import digital.laboratory.platform.reagent.service.RequisitionRecordService;
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
import digital.laboratory.platform.reagent.vo.RequisitionRecordVO; import digital.laboratory.platform.reagent.vo.RequisitionRecordVO;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -21,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.util.List;
/** /**
* (试剂耗材领用记录表) * (试剂耗材领用记录表)
@ -43,7 +47,37 @@ public class RequisitionRecordController {
private final RequisitionRecordService requisitionRecordService; private final RequisitionRecordService requisitionRecordService;
private final OssFile ossFile;
@ApiOperation(value = "试剂耗材领用记录表打印", notes = "试剂耗材领用记录表打印")
@SysLog("试剂耗材领用申请表打印")
@PostMapping("/print")
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
List<RequisitionRecordVO> voList = requisitionRecordService.getRequisitionRecordVO(id);
if (voList.isEmpty()) {
throw new RuntimeException("未查询到相关信息");
}
String applyFileName = "试剂耗材领用记录表-"+id;
String pdfFilePath = "document" + "/"+"requisitionRecord" + "/" + id + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
requisitionRecordService.rquisitionRecordTablePDF(voList,id,theHttpServletRequest,httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
}
}
/** /**
* 分页查询 * 分页查询
* @param page 分页对象 * @param page 分页对象

@ -1,17 +1,23 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO; import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO;
import digital.laboratory.platform.reagent.entity.CatalogueDetails;
import digital.laboratory.platform.reagent.entity.StandardMaterialApplication; import digital.laboratory.platform.reagent.entity.StandardMaterialApplication;
import digital.laboratory.platform.reagent.service.StandardMaterialApplicationService; import digital.laboratory.platform.reagent.service.StandardMaterialApplicationService;
import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO;
import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO; import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -23,13 +29,16 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
/** /**
* (标准物质领用/归还登记表) * (标准物质领用/归还登记表)
* *
* @author Zhang Xiaolong created at 2023-03-10 * @author Zhang Xiaolong created at 2023-03-10
* @describe (标准物质领用 / 归还登记表) 前端控制器 * @describe (标准物质领用 / 归还登记表) 前端控制器
* * <p>
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service
* 这里写什么: * 这里写什么:
* 为前端提供数据, 接受前端的数据 * 为前端提供数据, 接受前端的数据
@ -45,25 +54,30 @@ public class StandardMaterialApplicationController {
private final StandardMaterialApplicationService standardMaterialApplicationService; private final StandardMaterialApplicationService standardMaterialApplicationService;
private final OssFile ossFile;
/** /**
* 通过id查询(标准物质领用/归还登记表) * 通过id查询(标准物质领用/归还登记表)
* @param standardMaterialApplicationId id *
* @param id, id
* @return R * @return R
*/ */
@ApiOperation(value = "通过id查询", notes = "通过id查询") @ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping() @GetMapping()
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_get')" ) // @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_get')" )
public R<StandardMaterialApplication> getById( String standardMaterialApplicationId, HttpServletRequest theHttpServletRequest) { public R<StandardMaterialApplicationVO> getById(String id, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
StandardMaterialApplication standardMaterialApplication = standardMaterialApplicationService.getById(standardMaterialApplicationId); StandardMaterialApplicationVO standardMaterialApplicationVO = standardMaterialApplicationService.getStandardMaterialApplicationVO(id);
return R.ok(standardMaterialApplication);
return R.ok(standardMaterialApplicationVO);
//return R.ok(standardMaterialApplicationService.getById(standardMaterialApplicationId)); //return R.ok(standardMaterialApplicationService.getById(standardMaterialApplicationId));
} }
/** /**
* 分页查询 * 分页查询
*
* @param page 分页对象 * @param page 分页对象
* @param standardMaterialApplication (标准物质领用/归还登记表) * @param standardMaterialApplication (标准物质领用/归还登记表)
* @return * @return
@ -84,6 +98,7 @@ public class StandardMaterialApplicationController {
/** /**
* 分页查询 * 分页查询
*
* @param page 分页对象 * @param page 分页对象
* @param standardMaterialApplication (标准物质领用/归还登记表) * @param standardMaterialApplication (标准物质领用/归还登记表)
* @return * @return
@ -91,13 +106,17 @@ public class StandardMaterialApplicationController {
@ApiOperation(value = "归还任务分页查询", notes = "归还任务分页查询") @ApiOperation(value = "归还任务分页查询", notes = "归还任务分页查询")
@GetMapping("/return/page") @GetMapping("/return/page")
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_get')" ) // @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_get')" )
public R<IPage<StandardMaterialApplicationVO>> getList(Page<StandardMaterialApplication> page, StandardMaterialApplication standardMaterialApplication, HttpServletRequest theHttpServletRequest) { public R<IPage<StandardMaterialApplicationVO>> getList(Page<StandardMaterialApplication> page, String name, @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(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getList(page, Wrappers.<StandardMaterialApplication>query() IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getList(page, Wrappers.<StandardMaterialApplication>query()
.orderByDesc("create_time")
.eq("status", 0) .eq("status", 0)
.like(StrUtil.isNotBlank(name),"reference_substance_name", name)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
.orderByDesc("create_time")
); );
return R.ok(standardMaterialApplicationSList); return R.ok(standardMaterialApplicationSList);
// return R.ok(standardMaterialApplicationService.page(page, Wrappers.query(standardMaterialApplication))); // return R.ok(standardMaterialApplicationService.page(page, Wrappers.query(standardMaterialApplication)));
@ -105,20 +124,23 @@ public class StandardMaterialApplicationController {
/** /**
* 分页查询 * 分页查询
*
* @param page 分页对象 * @param page 分页对象
* @param standardMaterialApplication (标准物质领用/归还登记表)
* @return * @return
*/ */
@ApiOperation(value = "归还记录分页查询", notes = "归还记录分页查询") @ApiOperation(value = "归还记录分页查询", notes = "归还记录分页查询")
@GetMapping("/return") @GetMapping("/return")
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_get')" ) // @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_get')" )
public R<IPage<StandardMaterialApplicationVO>> getPage(Page<StandardMaterialApplication> page, StandardMaterialApplication standardMaterialApplication, HttpServletRequest theHttpServletRequest) { public R<IPage<StandardMaterialApplicationVO>> getPage(Page<StandardMaterialApplication> page, String name,@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(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getList(page, Wrappers.<StandardMaterialApplication>query() IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getList(page, Wrappers.<StandardMaterialApplication>query()
.orderByDesc("create_time")
.eq("status", 1) .eq("status", 1)
.like(StrUtil.isNotBlank(name),"reference_substance_name", name)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
.orderByDesc("create_time")
); );
return R.ok(standardMaterialApplicationSList); return R.ok(standardMaterialApplicationSList);
// return R.ok(standardMaterialApplicationService.page(page, Wrappers.query(standardMaterialApplication))); // return R.ok(standardMaterialApplicationService.page(page, Wrappers.query(standardMaterialApplication)));
@ -127,6 +149,7 @@ public class StandardMaterialApplicationController {
/** /**
* 归还(标准物质领用/归还登记表) * 归还(标准物质领用/归还登记表)
*
* @param standardMaterialApplicationDTO (标准物质领用/归还登记表) * @param standardMaterialApplicationDTO (标准物质领用/归还登记表)
* @return R * @return R
*/ */
@ -147,6 +170,7 @@ public class StandardMaterialApplicationController {
/** /**
* 通过id删除(标准物质领用/归还登记表) * 通过id删除(标准物质领用/归还登记表)
*
* @param standardMaterialApplicationId id * @param standardMaterialApplicationId id
* @return R * @return R
*/ */
@ -162,12 +186,59 @@ public class StandardMaterialApplicationController {
if (standardMaterialApplicationService.removeById(standardMaterialApplicationId)) { if (standardMaterialApplicationService.removeById(standardMaterialApplicationId)) {
return R.ok(oldStandardMaterialApplication, "对象删除成功"); return R.ok(oldStandardMaterialApplication, "对象删除成功");
} } else {
else {
return R.failed(oldStandardMaterialApplication, "对象删除失败"); return R.failed(oldStandardMaterialApplication, "对象删除失败");
} }
} }
/**-------采购目录打印*/
/**
* 采购目录打印
*
* @param id
* @return
*/
@ApiOperation(value = "标准物质领用归还登记表打印", notes = "标准物质领用归还登记表打印")
@SysLog("标准物质领用归还登记表打印")
@PostMapping("/print")
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
String ids = IdWorker.get32UUID().toUpperCase();
String[] split = id.split(",");
List<StandardMaterialApplicationVO> voList = new ArrayList<>();
for (String s : split) {
StandardMaterialApplicationVO standardMaterialApplicationVO = standardMaterialApplicationService.getStandardMaterialApplicationVO(s);
voList.add(standardMaterialApplicationVO);
}
if (voList.isEmpty()) {
throw new RuntimeException("未查询到相关信息");
}
String applyFileName = "标准物质领用归还登记表-" + ids;
String pdfFilePath = "document" + "/" + "standardMaterialApplication" + "/" + ids + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
standardMaterialApplicationService.standardMaterialApplicationTablePDF(voList, ids, theHttpServletRequest, httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
}
}
} }

@ -1,6 +1,7 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
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;
@ -10,12 +11,14 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO; import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm; import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm;
import digital.laboratory.platform.reagent.service.ReferenceMaterialService; import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService; import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService;
import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO;
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO; import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -29,13 +32,14 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.time.LocalDate;
/** /**
* (标准物质停用/报废销毁/恢复/降级使用审批表) * (标准物质停用/报废销毁/恢复/降级使用审批表)
* *
* @author Zhang Xiaolong created at 2023-03-10 * @author Zhang Xiaolong created at 2023-03-10
* @describe (标准物质停用 / 报废销毁 / 恢复 / 降级使用审批表) 前端控制器 * @describe (标准物质停用 / 报废销毁 / 恢复 / 降级使用审批表) 前端控制器
* * <p>
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service
* 这里写什么: * 这里写什么:
* 为前端提供数据, 接受前端的数据 * 为前端提供数据, 接受前端的数据
@ -53,8 +57,11 @@ public class StandardMaterialApprovalFormController {
private final ReferenceMaterialService referenceMaterialService; private final ReferenceMaterialService referenceMaterialService;
private final OssFile ossFile;
/** /**
* 通过id查询(标准物质停用/报废销毁/恢复/降级使用审批表) * 通过id查询(标准物质停用/报废销毁/恢复/降级使用审批表)
*
* @param id * @param id
* @return R * @return R
*/ */
@ -72,6 +79,7 @@ public class StandardMaterialApprovalFormController {
/** /**
* 分页查询 * 分页查询
*
* @param page 分页对象 * @param page 分页对象
* @param referenceMaterialName (标准物质停用/报废销毁/恢复/降级使用审批表) * @param referenceMaterialName (标准物质停用/报废销毁/恢复/降级使用审批表)
* @return * @return
@ -79,25 +87,16 @@ public class StandardMaterialApprovalFormController {
@ApiOperation(value = "分页查询", notes = "分页查询") @ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_page)" ) // @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_page)" )
public R<IPage<StandardMaterialApprovalFormVO>> getStandardMaterialApprovalFormPage(Page<StandardMaterialApprovalForm> page, String referenceMaterialName, @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") DateTime startTime, public R<IPage<StandardMaterialApprovalFormVO>> getStandardMaterialApprovalFormPage(Page<StandardMaterialApprovalForm> page, String referenceMaterialName, @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startTime,
@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime,HttpServletRequest theHttpServletRequest) { @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
QueryWrapper<StandardMaterialApprovalForm> standardMaterialApprovalFormQueryWrapper = new QueryWrapper<>(); IPage<StandardMaterialApprovalFormVO> standardMaterialApprovalFormSList = standardMaterialApprovalFormService.getVOPage(page, Wrappers.<StandardMaterialApprovalForm>query()
.like(StrUtil.isNotBlank(referenceMaterialName), "reference_material_name", referenceMaterialName)
if (referenceMaterialName!=null){ .ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
standardMaterialApprovalFormQueryWrapper.eq("reference_material_name",referenceMaterialName);
}
if (startTime!=null&&endTime!=null){
standardMaterialApprovalFormQueryWrapper.ge("create_time",startTime).le("create_time",endTime);
}
IPage<StandardMaterialApprovalFormVO> standardMaterialApprovalFormSList = standardMaterialApprovalFormService.getVOPage(page, standardMaterialApprovalFormQueryWrapper
.orderByDesc("create_time")
); );
return R.ok(standardMaterialApprovalFormSList); return R.ok(standardMaterialApprovalFormSList);
// return R.ok(standardMaterialApprovalFormService.page(page, Wrappers.query(standardMaterialApprovalForm))); // return R.ok(standardMaterialApprovalFormService.page(page, Wrappers.query(standardMaterialApprovalForm)));
@ -106,6 +105,7 @@ public class StandardMaterialApprovalFormController {
/** /**
* 新增(标准物质停用/报废销毁/恢复/降级使用审批表) * 新增(标准物质停用/报废销毁/恢复/降级使用审批表)
*
* @param standardMaterialApprovalFormDTO (标准物质停用/报废销毁/恢复/降级使用审批表) * @param standardMaterialApprovalFormDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
* @return R * @return R
*/ */
@ -121,14 +121,14 @@ public class StandardMaterialApprovalFormController {
if (standardMaterialApprovalForm != null) { if (standardMaterialApprovalForm != null) {
return R.ok(standardMaterialApprovalForm, "保存成功"); return R.ok(standardMaterialApprovalForm, "保存成功");
} } else {
else {
return R.failed(standardMaterialApprovalForm, "保存失败"); return R.failed(standardMaterialApprovalForm, "保存失败");
} }
} }
/** /**
* 一级审核(标准物质停用/报废销毁/恢复/降级使用审批表) * 一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)
*
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表) * @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
* @return R * @return R
*/ */
@ -144,14 +144,14 @@ public class StandardMaterialApprovalFormController {
if (standardMaterialApprovalForm != null) { if (standardMaterialApprovalForm != null) {
return R.ok(standardMaterialApprovalForm, "审核成功"); return R.ok(standardMaterialApprovalForm, "审核成功");
} } else {
else {
return R.failed(standardMaterialApprovalForm, "审核失败"); return R.failed(standardMaterialApprovalForm, "审核失败");
} }
} }
/** /**
* 二级审核(标准物质停用/报废销毁/恢复/降级使用审批表) * 二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)
*
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表) * @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
* @return R * @return R
*/ */
@ -167,14 +167,14 @@ public class StandardMaterialApprovalFormController {
if (standardMaterialApprovalForm != null) { if (standardMaterialApprovalForm != null) {
return R.ok(standardMaterialApprovalForm, "审核成功"); return R.ok(standardMaterialApprovalForm, "审核成功");
} } else {
else {
return R.failed(standardMaterialApprovalForm, "审核失败"); return R.failed(standardMaterialApprovalForm, "审核失败");
} }
} }
/** /**
* 审批(标准物质停用/报废销毁/恢复/降级使用审批表) * 审批(标准物质停用/报废销毁/恢复/降级使用审批表)
*
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表) * @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
* @return R * @return R
*/ */
@ -190,8 +190,7 @@ public class StandardMaterialApprovalFormController {
if (standardMaterialApprovalForm != null) { if (standardMaterialApprovalForm != null) {
return R.ok(standardMaterialApprovalForm, "审批成功"); return R.ok(standardMaterialApprovalForm, "审批成功");
} } else {
else {
return R.failed(standardMaterialApprovalForm, "审批失败"); return R.failed(standardMaterialApprovalForm, "审批失败");
} }
} }
@ -210,9 +209,45 @@ public class StandardMaterialApprovalFormController {
if (referenceMaterialService.updateById(byId)) { if (referenceMaterialService.updateById(byId)) {
return R.ok("停用成功"); return R.ok("停用成功");
} } else {
else {
return R.failed("停用失败"); return R.failed("停用失败");
} }
} }
/**-------标准物质停用报废销毁恢复降级使用审批表打印*/
/**
* 标准物质停用报废销毁恢复降级使用审批表打印
*
* @param id
* @return
*/
@ApiOperation(value = "标准物质停用报废销毁恢复降级使用审批表打印", notes = "标准物质停用报废销毁恢复降级使用审批表打印")
@SysLog("标准物质停用报废销毁恢复降级使用审批表打印")
@PostMapping("/print")
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
StandardMaterialApprovalFormVO standardMaterialApprovalFormVO = standardMaterialApprovalFormService.getVO(id);
if (standardMaterialApprovalFormVO == null) {
throw new RuntimeException("未查询到相关信息");
}
String applyFileName = "标准物质停用报废销毁恢复降级使用审批表" + id;
;
String pdfFilePath = "document" + "/" + "standardMaterialApprovalForm" + "/" + id + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
standardMaterialApprovalFormService.standardMaterialApprovalFormTablePDF(standardMaterialApprovalFormVO, theHttpServletRequest, httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
}
}
} }

@ -1,6 +1,7 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
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;
@ -10,11 +11,14 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.StandardReserveSolutionDTO; import digital.laboratory.platform.reagent.dto.StandardReserveSolutionDTO;
import digital.laboratory.platform.reagent.dto.StandardReserveSolutionFullDTO; import digital.laboratory.platform.reagent.dto.StandardReserveSolutionFullDTO;
import digital.laboratory.platform.reagent.entity.StandardReserveSolution; import digital.laboratory.platform.reagent.entity.StandardReserveSolution;
import digital.laboratory.platform.reagent.service.StandardReserveSolutionService; import digital.laboratory.platform.reagent.service.StandardReserveSolutionService;
import digital.laboratory.platform.reagent.utils.String2DateConverter; import digital.laboratory.platform.reagent.utils.String2DateConverter;
import digital.laboratory.platform.reagent.vo.SolutionUseFormVO;
import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO; import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO;
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO; import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -31,6 +35,7 @@ import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.sql.Date; import java.sql.Date;
import java.text.ParseException; import java.text.ParseException;
import java.util.List;
/** /**
* (标准储备溶液配制及使用记录表) * (标准储备溶液配制及使用记录表)
@ -53,6 +58,8 @@ public class StandardReserveSolutionController {
private final StandardReserveSolutionService standardReserveSolutionService; private final StandardReserveSolutionService standardReserveSolutionService;
private final OssFile ossFile;
/** /**
* 通过id查询(标准储备溶液配制及使用记录表) * 通过id查询(标准储备溶液配制及使用记录表)
* @param id id * @param id id
@ -83,20 +90,11 @@ public class StandardReserveSolutionController {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
QueryWrapper<StandardReserveSolution> standardReserveSolutionQueryWrapper = new QueryWrapper<>(); IPage<StandardReserveSolutionVO> standardReserveSolutionSList = standardReserveSolutionService.getStandardReserveSolutionVOList(page,Wrappers.<StandardReserveSolution>query()
//通过名称查询 .like(StrUtil.isNotBlank(solutionName),"solution_name",solutionName)
if (solutionName!=null){ .ge(startTime!=null,"create_time",startTime)
.le(endTime!=null,"create_time",endTime)
standardReserveSolutionQueryWrapper.like("solution_name",solutionName); .orderByDesc("create_time"));
}
if (startTime != null && endTime != null) {
standardReserveSolutionQueryWrapper.ge("create_time",startTime).le("create_time",endTime);
}
IPage<StandardReserveSolutionVO> standardReserveSolutionSList = standardReserveSolutionService.getStandardReserveSolutionVOList(page,standardReserveSolutionQueryWrapper
.orderByDesc("create_time")
);
return R.ok(standardReserveSolutionSList); return R.ok(standardReserveSolutionSList);
// return R.ok(standardReserveSolutionService.page(page, Wrappers.query(standardReserveSolution))); // return R.ok(standardReserveSolutionService.page(page, Wrappers.query(standardReserveSolution)));
} }
@ -159,4 +157,43 @@ public class StandardReserveSolutionController {
//return R.ok(standardReserveSolutionService.getById(standardReserveSolutionId)); //return R.ok(standardReserveSolutionService.getById(standardReserveSolutionId));
} }
/**-------标准储备溶液配制及使用记录表打印*/
/**
* 标准储备溶液配制及使用记录表打印
*
* @param id
*
* @return
*/
@ApiOperation(value = "标准储备溶液配制及使用记录表打印", notes = "标准储备溶液配制及使用记录表打印")
@SysLog("标准储备溶液配制及使用记录表打印")
@PostMapping("/print")
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
StandardReserveSolutionVO standardReserveSolutionVOById = standardReserveSolutionService.getStandardReserveSolutionVOById(id);
List<SolutionUseFormVO> voList = standardReserveSolutionVOById.getSolutionUseFormVOList();
if (voList.isEmpty()){
throw new RuntimeException(String.format("未查询到使用记录,无法打印"));
}
String applyFileName = "标准储备溶液配制及使用记录表-"+id;
String pdfFilePath = "document" + "/"+"standardReserveSolution" + "/" + id + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
standardReserveSolutionService.standardReserveSolutionTablePDF(standardReserveSolutionVOById,theHttpServletRequest,httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
}
}
} }

@ -1,6 +1,7 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
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;
@ -10,10 +11,14 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.StandardSolutionCurveDTO; import digital.laboratory.platform.reagent.dto.StandardSolutionCurveDTO;
import digital.laboratory.platform.reagent.entity.StandardSolutionCurve; import digital.laboratory.platform.reagent.entity.StandardSolutionCurve;
import digital.laboratory.platform.reagent.service.StandardSolutionCurveService; import digital.laboratory.platform.reagent.service.StandardSolutionCurveService;
import digital.laboratory.platform.reagent.vo.SolutionUseFormVO;
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO;
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO; import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
import nonapi.io.github.classgraph.json.Id;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -26,13 +31,16 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
/** /**
* (标准工作曲线溶液配置记录表) * (标准工作曲线溶液配置记录表)
* *
* @author Zhang Xiaolong created at 2023-03-10 * @author Zhang Xiaolong created at 2023-03-10
* @describe (标准工作曲线溶液配置记录表) 前端控制器 * @describe (标准工作曲线溶液配置记录表) 前端控制器
* * <p>
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service
* 这里写什么: * 这里写什么:
* 为前端提供数据, 接受前端的数据 * 为前端提供数据, 接受前端的数据
@ -48,8 +56,11 @@ public class StandardSolutionCurveController {
private final StandardSolutionCurveService standardSolutionCurveService; private final StandardSolutionCurveService standardSolutionCurveService;
private final OssFile ossFile;
/** /**
* 分页查询 * 分页查询
*
* @param page 分页对象 * @param page 分页对象
* @return * @return
*/ */
@ -57,26 +68,17 @@ public class StandardSolutionCurveController {
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_get')" ) // @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_get')" )
public R<IPage<StandardSolutionCurveVO>> getStandardSolutionCurvePage(Page<StandardSolutionCurve> page, String solutionName, @JsonFormat(pattern = "yyyy-MM-dd") public R<IPage<StandardSolutionCurveVO>> getStandardSolutionCurvePage(Page<StandardSolutionCurve> page, String solutionName, @JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")DateTime startTime,@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) { @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
QueryWrapper<StandardSolutionCurve> standardSolutionCurveQueryWrapper = new QueryWrapper<>();
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
if (solutionName!=null){
standardSolutionCurveQueryWrapper.like("solution_name",solutionName);
}
if (startTime!=null&&endTime!=null){
standardSolutionCurveQueryWrapper.ge("create_time",startTime).le("create_time",endTime);
}
IPage<StandardSolutionCurveVO> standardSolutionCurveVOPage = standardSolutionCurveService.getStandardSolutionCurveVOPage(page, standardSolutionCurveQueryWrapper IPage<StandardSolutionCurveVO> standardSolutionCurveVOPage = standardSolutionCurveService.getStandardSolutionCurveVOPage(page, Wrappers.<StandardSolutionCurve>query()
.like(StrUtil.isNotBlank(solutionName), "solution_name", solutionName)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
.orderByDesc("create_time") .orderByDesc("create_time")
); );
return R.ok(standardSolutionCurveVOPage); return R.ok(standardSolutionCurveVOPage);
@ -85,6 +87,7 @@ public class StandardSolutionCurveController {
/** /**
* 新增(标准工作曲线溶液配置记录表) * 新增(标准工作曲线溶液配置记录表)
*
* @param standardSolutionCurveDTO (标准工作曲线溶液配置记录表) * @param standardSolutionCurveDTO (标准工作曲线溶液配置记录表)
* @return R * @return R
*/ */
@ -105,5 +108,58 @@ public class StandardSolutionCurveController {
} else return R.failed("配置失败"); } else return R.failed("配置失败");
} }
/**-------标准工作曲线溶液配置记录表打印*/
/**
* 标准工作曲线溶液配置记录表打印
*
* @param idList
* @return
*/
@ApiOperation(value = "标准工作曲线溶液配置记录表打印", notes = "标准工作曲线溶液配置记录表打印")
@SysLog("标准工作曲线溶液配置记录表打印")
@PostMapping("/print")
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
public void bizGetPDFInventory(String idList, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
String[] ids = idList.split(",");
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
List<StandardSolutionCurveVO> voList = new ArrayList<>();
for (String id : ids) {
StandardSolutionCurveVO standardSolutionCurveVO = standardSolutionCurveService.getStandardSolutionCurveVO(id);
voList.add(standardSolutionCurveVO);
}
if (ids.length == 0 & ids == null) {
throw new RuntimeException(String.format("未查询到相关信息"));
}
if (voList.isEmpty()) {
throw new RuntimeException("未查询到相关信息");
}
String id = IdWorker.get32UUID().toUpperCase();
String applyFileName = "标准工作曲线溶液配制记录表-" + id;
String pdfFilePath = "document" + "/" + "standardSolutionCurve" + "/" + id + "/" + applyFileName + ".pdf";
try {
//直接调用pdf方法
standardSolutionCurveService.standardSolutionCurveTablePDF(voList, id, theHttpServletRequest, httpServletResponse);
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(applyFileName);
} catch (Exception e) {
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
e.printStackTrace();
}
}
} }

@ -86,24 +86,19 @@ public class SupplierInformationController {
* 分页查询 * 分页查询
* *
* @param page 分页对象 * @param page 分页对象
* @param type (服务商/供应商信息) * @param supplierName (服务商/供应商信息)
* @return * @return
*/ */
@ApiOperation(value = "分页查询", notes = "分页查询") @ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_page')" ) // @PreAuthorize("@pms.hasPermission('reagent_supplier_information_page')" )
public R<IPage<SupplierInformation>> getSupplierInformationPage(Page<SupplierInformation> page, String type, HttpServletRequest theHttpServletRequest) { public R<IPage<SupplierInformation>> getSupplierInformationPage(Page<SupplierInformation> page, String supplierName, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
QueryWrapper<SupplierInformation> supplierInformationQueryWrapper = new QueryWrapper<>();
if (type!=null) { IPage<SupplierInformation> supplierInformationSList = supplierInformationService.page(page, Wrappers.<SupplierInformation>query()
.like(StrUtil.isNotBlank(supplierName),"supplier_name",supplierName)
supplierInformationQueryWrapper.eq("acceptable_condition","合格");
}
IPage<SupplierInformation> supplierInformationSList = supplierInformationService.page(page, supplierInformationQueryWrapper
.orderByDesc("create_time") .orderByDesc("create_time")
); );
return R.ok(supplierInformationSList); return R.ok(supplierInformationSList);

@ -1,10 +1,12 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
@ -18,6 +20,8 @@ import digital.laboratory.platform.reagent.service.WarehousingContentService;
import digital.laboratory.platform.reagent.service.WarehousingRecordFormService; import digital.laboratory.platform.reagent.service.WarehousingRecordFormService;
import digital.laboratory.platform.reagent.vo.WarehousingContentVO; import digital.laboratory.platform.reagent.vo.WarehousingContentVO;
import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO; import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO;
import org.joda.time.DateTime;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -27,6 +31,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.security.Principal; import java.security.Principal;
import java.time.LocalDate;
import java.util.List; import java.util.List;
/** /**
@ -75,18 +80,21 @@ public class WarehousingRecordFormController {
/** /**
* 分页查询 * 分页查询
*
* @return * @return
*/ */
@ApiOperation(value = "分页查询", notes = "分页查询") @ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')") // @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')")
public R<Page<WarehousingRecordFormVO>> getWarehousingRecordFormVOPage( Page page,HttpServletRequest theHttpServletRequest) { public R<IPage<WarehousingRecordFormVO>> getWarehousingRecordFormVOPage(Page <WarehousingRecordForm>page, @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(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
Page<WarehousingRecordFormVO> warehousingRecordFormVOList = warehousingRecordFormService.getWarehousingRecordFormVOList(page); IPage<WarehousingRecordFormVO> warehousingRecordFormVOList = warehousingRecordFormService.getWarehousingRecordFormVOPage(page,Wrappers.<WarehousingRecordForm>query()
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime));
return R.ok(warehousingRecordFormVOList); return R.ok(warehousingRecordFormVOList);
@ -95,30 +103,29 @@ public class WarehousingRecordFormController {
/** /**
* 分页查询 * 分页查询
*
* @return * @return
*/ */
@ApiOperation(value = "分页查询", notes = "分页查询") @ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/pageWC") @GetMapping("/pageWC")
// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')") // @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')")
public R<IPage<WarehousingContentVO>> getWarehousingContentVOPage( Page page,String name,HttpServletRequest theHttpServletRequest) { public R<IPage<WarehousingContentVO>> getWarehousingContentVOPage(Page page, String name, @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(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
QueryWrapper<WarehousingContent> warehousingContentQueryWrapper = new QueryWrapper<>(); IPage<WarehousingContentVO> warehousingContentVOPage = warehousingContentService.getWarehousingContentVOPage(page, Wrappers.<WarehousingContent>query()
.like(StrUtil.isNotBlank(name), "reagent_consumable_name", name)
if (name!=null){ .ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
warehousingContentQueryWrapper.like("reagent_consumable_name",name); .eq("status", 1)
.orderByDesc("create_time"));
}
IPage<WarehousingContentVO> warehousingContentVOPage = warehousingContentService.getWarehousingContentVOPage(page, warehousingContentQueryWrapper);
return R.ok(warehousingContentVOPage); return R.ok(warehousingContentVOPage);
} }
/** /**
* 新增签收记录表 * 新增签收记录表
* *

@ -32,7 +32,7 @@ public class AcceptanceRecordFormDTO {
private String packingInGoodCondition; private String packingInGoodCondition;
@ApiModelProperty(value = "(包装完好备注)") @ApiModelProperty(value = "(包装完好备注)")
private String pcg_remarks; private String pgc_remarks;
@ApiModelProperty(value = "(有效期)") @ApiModelProperty(value = "(有效期)")
private String validityPeriod; private String validityPeriod;

@ -32,4 +32,7 @@ public class CentralizedRequestDTO {
@ApiModelProperty(value="集中采购申请明细Id") @ApiModelProperty(value="集中采购申请明细Id")
private String detailsOfCentralizedId; private String detailsOfCentralizedId;
@ApiModelProperty(value="用途/购买理由")
private String purpose;
} }

@ -43,7 +43,6 @@ public class DecentralizedRequestDTO {
private String standardValueOrPurity; private String standardValueOrPurity;
@ApiModelProperty(value="(用途)") @ApiModelProperty(value="(用途)")
private String purpose; private String purpose;
@ApiModelProperty(value="(分散采购申请ID)") @ApiModelProperty(value="(分散采购申请ID)")

@ -9,6 +9,9 @@ public class OutgoingContentsDTO {
@ApiModelProperty(value = "(出库用途)") @ApiModelProperty(value = "(出库用途)")
private Integer outboundUse; private Integer outboundUse;
@ApiModelProperty(value = "(出库明细ID)")
private String id;
@ApiModelProperty(value = "(出库数量)") @ApiModelProperty(value = "(出库数量)")
private Integer quantity; private Integer quantity;

@ -16,6 +16,8 @@ public class PurchasingPlanDTO {
@ApiModelProperty(value = "集中采购申请明细ID") @ApiModelProperty(value = "集中采购申请明细ID")
private String detailsOfCentralizedId; private String detailsOfCentralizedId;
private double unitPrice;
@ApiModelProperty(value = "采购计划id") @ApiModelProperty(value = "采购计划id")
private String purchasingPlanId; private String purchasingPlanId;

@ -14,6 +14,9 @@ public class StandardMaterialApplicationDTO {
@ApiModelProperty(value = "格子id") @ApiModelProperty(value = "格子id")
private String latticeId; private String latticeId;
@ApiModelProperty(value = "位置信息")
private String location;
@ApiModelProperty(value = "是否用完") @ApiModelProperty(value = "是否用完")
private Boolean outOfUse; private Boolean outOfUse;
} }

@ -7,8 +7,8 @@ import lombok.Data;
public class StandardSolutionCurveDTO { public class StandardSolutionCurveDTO {
@ApiModelProperty(value="(标准储备溶液编号)") @ApiModelProperty(value="(标准储备溶液Id)")
private String solutionNumbering; private String solutionId;
@ApiModelProperty(value="(逐级溶液浓度)") @ApiModelProperty(value="(逐级溶液浓度)")
private String stepSolutionConcentration; private String stepSolutionConcentration;

@ -57,5 +57,8 @@ public class WarehousingRecordFormDTO {
@ApiModelProperty(value = "(位置信息)") @ApiModelProperty(value = "(位置信息)")
private String location; private String location;
@ApiModelProperty(value = "(保管人名称)")
private String custodianName;
} }

@ -26,7 +26,8 @@ import lombok.EqualsAndHashCode;
@ApiModel(value = "(验收记录表)") @ApiModel(value = "(验收记录表)")
public class AcceptanceRecordForm extends BaseEntity { public class AcceptanceRecordForm extends BaseEntity {
@ApiModelProperty(value = "(试剂耗材名称)")
private String reagentConsumableName;
/** /**
* (供应商ID) * (供应商ID)
*/ */

@ -36,6 +36,8 @@ public class CentralizedRequest extends BaseEntity {
@ApiModelProperty(value="申请人ID") @ApiModelProperty(value="申请人ID")
private String applicantId; private String applicantId;
/** /**
* (申请日期) * (申请日期)
*/ */
@ -69,7 +71,6 @@ public class CentralizedRequest extends BaseEntity {
private LocalDateTime auditTime; private LocalDateTime auditTime;
/** /**
* centralizedRequestId * centralizedRequestId
*/ */

@ -38,6 +38,8 @@ public class ComplianceCheck extends BaseEntity {
@ApiModelProperty(value = "(编号)") @ApiModelProperty(value = "(编号)")
private String number; private String number;
@ApiModelProperty(value="(试剂耗材名称)")
private String reagentConsumableName;
/** /**
* (二级审核意见) * (二级审核意见)
*/ */

@ -146,4 +146,11 @@ public class DecentralizeDetails extends BaseEntity {
private String purpose; private String purpose;
/**
* (采购清单明细ID)
*/
@ApiModelProperty(value="(采购清单明细ID)")
private String purchaseListDetailsId;
} }

@ -59,6 +59,9 @@ public class DetailsOfCentralized extends BaseEntity {
@ApiModelProperty(value="备注") @ApiModelProperty(value="备注")
private String remarks; private String remarks;
@ApiModelProperty(value="用途/购买理由")
private String purpose;
/** /**
* (换货试剂耗材ID) * (换货试剂耗材ID)
*/ */

@ -119,4 +119,5 @@ public class PeriodVerificationPlan extends BaseEntity {
private String id; private String id;
} }

@ -101,7 +101,7 @@ public class ReagentConsumableInventory extends BaseEntity {
* (包装份数) * (包装份数)
*/ */
@ApiModelProperty(value = "(包装份数)") @ApiModelProperty(value = "(包装份数)")
private Integer packagedCopies; private String packagedCopies;
/** /**
* reagentConsumableInventoryId * reagentConsumableInventoryId

@ -69,7 +69,7 @@ public class ReagentConsumables extends BaseEntity {
* 包装份数 * 包装份数
*/ */
@ApiModelProperty(value="包装份数") @ApiModelProperty(value="包装份数")
private Integer packagedCopies; private String packagedCopies;
/** /**
* (标准值/纯度) * (标准值/纯度)
*/ */

@ -35,12 +35,21 @@ public class ReagentConsumablesSet extends BaseEntity {
@ApiModelProperty(value = "(标准物质编号)") @ApiModelProperty(value = "(标准物质编号)")
private String referenceMaterialNumber; private String referenceMaterialNumber;
@ApiModelProperty(value = "(出库明细ID)")
private String outgoingContentId;
/** /**
* (数量) * (数量)
*/ */
@ApiModelProperty(value = "(数量)") @ApiModelProperty(value = "(数量)")
private Integer quantity; private Integer quantity;
/**
* (出库数量)
*/
@ApiModelProperty(value = "(出库数量)")
private Integer quantityDelivered;
/** /**
* (用途) * (用途)
*/ */

@ -63,4 +63,7 @@ public class ReferenceMaterial extends BaseEntity {
@ApiModelProperty(value="试剂耗材(含标准物质)仓库表ID") @ApiModelProperty(value="试剂耗材(含标准物质)仓库表ID")
private String reagentConsumableInventoryId; private String reagentConsumableInventoryId;
@ApiModelProperty(value="试剂耗材(含标准物质)仓库表ID")
private String custodianName;
} }

@ -66,6 +66,7 @@ public class RequisitionRecord extends BaseEntity {
@ApiModelProperty(value="编号") @ApiModelProperty(value="编号")
private String number; private String number;
private String id;
/** /**

@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import digital.laboratory.platform.common.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -12,7 +13,7 @@ import lombok.EqualsAndHashCode;
@TableName(value = "solution_use_form", autoResultMap = true) @TableName(value = "solution_use_form", autoResultMap = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ApiModel(value = "(标准溶液使用记录表)") @ApiModel(value = "(标准溶液使用记录表)")
public class SolutionUseForm { public class SolutionUseForm extends BaseEntity {
@TableId(value = "id", type = IdType.ASSIGN_UUID) @TableId(value = "id", type = IdType.ASSIGN_UUID)
@ApiModelProperty(value="标准溶液使用记录表ID") @ApiModelProperty(value="标准溶液使用记录表ID")

@ -26,6 +26,8 @@ import lombok.EqualsAndHashCode;
@ApiModel(value = "(标准物质领用归还登记表)") @ApiModel(value = "(标准物质领用归还登记表)")
public class StandardMaterialApplication extends BaseEntity { public class StandardMaterialApplication extends BaseEntity {
@ApiModelProperty(value = "(标准物质名称)")
private String referenceSubstanceName;
/** /**
* (标准物质管理员ID) * (标准物质管理员ID)
*/ */
@ -149,5 +151,4 @@ public class StandardMaterialApplication extends BaseEntity {
@ApiModelProperty(value="领取码") @ApiModelProperty(value="领取码")
private String claimCode; private String claimCode;
} }

@ -55,6 +55,9 @@ public class StandardReserveSolution extends BaseEntity {
@ApiModelProperty(value="(标准物质ID)") @ApiModelProperty(value="(标准物质ID)")
private String referenceMaterialId; private String referenceMaterialId;
@ApiModelProperty(value="(标准溶液ID)")
private String referenceId;
/** /**
* (标准物质编号) * (标准物质编号)
*/ */

@ -84,6 +84,11 @@ public class WarehousingBatchList extends BaseEntity {
*/ */
@ApiModelProperty(value="入库人ID") @ApiModelProperty(value="入库人ID")
private String depositorId; private String depositorId;
/**
* 签收人ID
*/
@ApiModelProperty(value = "入库位置")
private String location;
/** /**
* 签收内容表ID * 签收内容表ID
@ -105,4 +110,6 @@ public class WarehousingBatchList extends BaseEntity {
private String id; private String id;
} }

@ -20,6 +20,12 @@ public class WarehousingContent extends BaseEntity {
*/ */
@ApiModelProperty(value = "(试剂耗材ID)") @ApiModelProperty(value = "(试剂耗材ID)")
private String reagentConsumableId; private String reagentConsumableId;
/**
* (签收状态 0 未完成 1 已完成)
*/
@ApiModelProperty(value = "(状态)")
private Integer status;
/** /**
* (试剂耗材ID) * (试剂耗材ID)
*/ */

@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm; import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm;
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO; import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -17,7 +18,7 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface AcceptanceRecordFormMapper extends BaseMapper<AcceptanceRecordForm> { public interface AcceptanceRecordFormMapper extends BaseMapper<AcceptanceRecordForm> {
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page); IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, @Param(Constants.WRAPPER)QueryWrapper<AcceptanceRecordForm> qw);
AcceptanceRecordFormVO getAcceptanceRecordFormVO(String acceptanceRecordFormId); AcceptanceRecordFormVO getAcceptanceRecordFormVO(String acceptanceRecordFormId);
} }

@ -1,7 +1,10 @@
package digital.laboratory.platform.reagent.mapper; package digital.laboratory.platform.reagent.mapper;
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.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import digital.laboratory.platform.reagent.entity.CatalogueDetails; import digital.laboratory.platform.reagent.entity.CatalogueDetails;
import digital.laboratory.platform.reagent.vo.CatalogueDetailsVO; import digital.laboratory.platform.reagent.vo.CatalogueDetailsVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -18,5 +21,4 @@ import java.util.List;
@Mapper @Mapper
public interface CatalogueDetailsMapper extends BaseMapper<CatalogueDetails> { public interface CatalogueDetailsMapper extends BaseMapper<CatalogueDetails> {
} }

@ -22,6 +22,7 @@ public interface CentralizedRequestMapper extends BaseMapper<CentralizedRequest>
IPage<CentralizedRequestVO> getCentralizedRequestVOPage(@Param("page") IPage<CentralizedRequest> page, @Param(Constants.WRAPPER) QueryWrapper<CentralizedRequest> qw); IPage<CentralizedRequestVO> getCentralizedRequestVOPage(@Param("page") IPage<CentralizedRequest> page, @Param(Constants.WRAPPER) QueryWrapper<CentralizedRequest> qw);
List<CentralizedRequestVO> getCentralizedRequestVOList(@Param(Constants.WRAPPER) QueryWrapper<CentralizedRequest> qw); List<CentralizedRequestVO> getCentralizedRequestVOList(@Param(Constants.WRAPPER) QueryWrapper<CentralizedRequest> qw);
List<CentralizedRequestVO> getVOList(@Param(Constants.WRAPPER) QueryWrapper<CentralizedRequest> qw);
CentralizedRequestVO getCentralizedRequestVO(String id); CentralizedRequestVO getCentralizedRequestVO(String id);

@ -1,7 +1,11 @@
package digital.laboratory.platform.reagent.mapper; package digital.laboratory.platform.reagent.mapper;
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.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -14,4 +18,6 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface ReagentConsumableInventoryMapper extends BaseMapper<ReagentConsumableInventory> { public interface ReagentConsumableInventoryMapper extends BaseMapper<ReagentConsumableInventory> {
IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryVOPage (IPage<ReagentConsumableInventory>page, @Param(Constants.WRAPPER) QueryWrapper<ReagentConsumableInventory> qw);
} }

@ -8,6 +8,8 @@ import digital.laboratory.platform.reagent.vo.RequisitionRecordVO;
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 java.util.List;
/** /**
* (试剂耗材领用记录表) Mapper 接口 * (试剂耗材领用记录表) Mapper 接口
* *
@ -19,4 +21,6 @@ public interface RequisitionRecordMapper extends BaseMapper<RequisitionRecord> {
IPage<RequisitionRecordVO> getRequisitionRecordVOPage (IPage<RequisitionRecord> page, QueryWrapper<RequisitionRecord> qw); IPage<RequisitionRecordVO> getRequisitionRecordVOPage (IPage<RequisitionRecord> page, QueryWrapper<RequisitionRecord> qw);
List<RequisitionRecordVO> getRequisitionRecordVO (String id);
} }

@ -11,6 +11,8 @@ 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.springframework.security.core.parameters.P;
import java.util.List;
/** /**
* (标准物质领用/归还登记表) Mapper 接口 * (标准物质领用/归还登记表) Mapper 接口
* *
@ -25,4 +27,7 @@ public interface StandardMaterialApplicationMapper extends BaseMapper<StandardMa
IPage<StandardMaterialApplicationVO> getStandardMaterialApplicationVOList(IPage<StandardMaterialApplication> page, @Param(Constants.WRAPPER) QueryWrapper<StandardMaterialApplication> qw); IPage<StandardMaterialApplicationVO> getStandardMaterialApplicationVOList(IPage<StandardMaterialApplication> page, @Param(Constants.WRAPPER) QueryWrapper<StandardMaterialApplication> qw);
StandardMaterialApplicationVO getStandardMaterialApplicationVO(String id
);
} }

@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm; import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm;
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO; import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -17,7 +18,7 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface StandardMaterialApprovalFormMapper extends BaseMapper<StandardMaterialApprovalForm> { public interface StandardMaterialApprovalFormMapper extends BaseMapper<StandardMaterialApprovalForm> {
IPage<StandardMaterialApprovalFormVO> getVOPage(IPage<StandardMaterialApprovalForm> page, QueryWrapper<StandardMaterialApprovalForm> qw); IPage<StandardMaterialApprovalFormVO> getVOPage(IPage<StandardMaterialApprovalForm> page, @Param(Constants.WRAPPER) QueryWrapper<StandardMaterialApprovalForm> qw);
StandardMaterialApprovalFormVO getVO (String id); StandardMaterialApprovalFormVO getVO (String id);

@ -3,11 +3,14 @@ package digital.laboratory.platform.reagent.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import digital.laboratory.platform.reagent.entity.StandardSolutionCurve; import digital.laboratory.platform.reagent.entity.StandardSolutionCurve;
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO; import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
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 java.util.List;
/** /**
* (标准工作曲线溶液配置记录表) Mapper 接口 * (标准工作曲线溶液配置记录表) Mapper 接口
* *
@ -17,6 +20,7 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface StandardSolutionCurveMapper extends BaseMapper<StandardSolutionCurve> { public interface StandardSolutionCurveMapper extends BaseMapper<StandardSolutionCurve> {
IPage<StandardSolutionCurveVO> getStandardSolutionCurveVOPage(IPage<StandardSolutionCurve> page, QueryWrapper<StandardSolutionCurve> qw); IPage<StandardSolutionCurveVO> getStandardSolutionCurveVOPage(IPage<StandardSolutionCurve> page, @Param(Constants.WRAPPER) QueryWrapper<StandardSolutionCurve> qw);
StandardSolutionCurveVO getStandardSolutionCurveVO (String id);
} }

@ -3,9 +3,11 @@ package digital.laboratory.platform.reagent.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import digital.laboratory.platform.reagent.entity.WarehousingRecordForm; import digital.laboratory.platform.reagent.entity.WarehousingRecordForm;
import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO; import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO;
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;
@ -17,5 +19,7 @@ import java.util.List;
*/ */
@Mapper @Mapper
public interface WarehousingRecordFormMapper extends BaseMapper<WarehousingRecordForm> { public interface WarehousingRecordFormMapper extends BaseMapper<WarehousingRecordForm> {
List <WarehousingRecordFormVO> getWarehousingRecordFormVOList (); IPage <WarehousingRecordFormVO> getWarehousingRecordFormVOPage (IPage<WarehousingRecordForm> page,@Param(Constants.WRAPPER)QueryWrapper <WarehousingRecordForm>qw);
} }

@ -9,6 +9,9 @@ import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm; import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm;
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO; import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/** /**
* (验收记录表)服务类 * (验收记录表)服务类
* *
@ -21,7 +24,7 @@ public interface AcceptanceRecordFormService extends IService<AcceptanceRecordFo
AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId); AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId);
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page); IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm>qw);
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVORecordPage(IPage<AcceptanceRecordForm> page); IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVORecordPage(IPage<AcceptanceRecordForm> page);
@ -32,4 +35,6 @@ public interface AcceptanceRecordFormService extends IService<AcceptanceRecordFo
AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser); AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser); AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
void acceptanceRecordFormTablePDF(AcceptanceRecordFormVO acceptanceRecordFormVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
} }

@ -9,6 +9,8 @@ import digital.laboratory.platform.reagent.dto.PeriodVerificationPlanDTO;
import digital.laboratory.platform.reagent.entity.CheckSchedule; import digital.laboratory.platform.reagent.entity.CheckSchedule;
import digital.laboratory.platform.reagent.vo.CheckScheduleVO; import digital.laboratory.platform.reagent.vo.CheckScheduleVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
@ -30,4 +32,6 @@ public interface CheckScheduleService extends IService<CheckSchedule> {
IPage<CheckScheduleVO> getCheckScheduleVOPage (IPage<CheckSchedule> page, QueryWrapper<CheckSchedule> qw); IPage<CheckScheduleVO> getCheckScheduleVOPage (IPage<CheckSchedule> page, QueryWrapper<CheckSchedule> qw);
CheckScheduleVO getCheckScheduleVO (String checkScheduleId); CheckScheduleVO getCheckScheduleVO (String checkScheduleId);
void checkScheduleTablePDF(CheckScheduleVO checkScheduleVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
} }

@ -10,6 +10,8 @@ import digital.laboratory.platform.reagent.entity.ComplianceCheck;
import digital.laboratory.platform.reagent.vo.ComplianceCheckVO; import digital.laboratory.platform.reagent.vo.ComplianceCheckVO;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
@ -44,4 +46,5 @@ public interface ComplianceCheckService extends IService<ComplianceCheck> {
//二级审核 //二级审核
ComplianceCheck secondaryAuditCheck(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser); ComplianceCheck secondaryAuditCheck(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
} }

@ -10,6 +10,9 @@ import digital.laboratory.platform.reagent.entity.PeriodVerificationImplementati
import digital.laboratory.platform.reagent.entity.PeriodVerificationPlan; import digital.laboratory.platform.reagent.entity.PeriodVerificationPlan;
import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO; import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/** /**
* (标准物质期间核查实施情况及结果记录表)服务类 * (标准物质期间核查实施情况及结果记录表)服务类
* *
@ -29,4 +32,6 @@ public interface PeriodVerificationImplementationService extends IService<Period
PeriodVerificationImplementation commitById(PeriodVerificationImplementationDTO periodVerificationImplementationDTO, DLPUser dlpUser); PeriodVerificationImplementation commitById(PeriodVerificationImplementationDTO periodVerificationImplementationDTO, DLPUser dlpUser);
PeriodVerificationImplementation auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser); PeriodVerificationImplementation auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
void periodVerificationImplementationTablePDF(PeriodVerificationImplementationVO periodVerificationImplementationVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
} }

@ -43,7 +43,7 @@ public interface PurchaseCatalogueService extends IService<PurchaseCatalogue> {
PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId); PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId);
Page getVOpage(String name); List<CatalogueDetails> getList(String name);
PurchaseCatalogueVO getImport(List<PurchaseCatalogueDTO> purchaseCatalogueDTOList); PurchaseCatalogueVO getImport(List<PurchaseCatalogueDTO> purchaseCatalogueDTOList);
} }

@ -28,7 +28,7 @@ public interface PurchaseListService extends IService<PurchaseList> {
void editById(List<PurchaseListDTO> purchaseListDTOList); void editById(List<PurchaseListDTO> purchaseListDTOList);
// //
PurchaseList commitById(List<PurchaseListDTO> purchaseListDTOList); PurchaseList commitById(String id);
PurchaseListDetailsVO addDetails(PurchaseListDTO purchaseListDTO); PurchaseListDetailsVO addDetails(PurchaseListDTO purchaseListDTO);

@ -32,7 +32,7 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
//分页查询试剂耗材 //分页查询试剂耗材
Page<ReagentConsumableInventoryFullVO> getAllRM(Integer current, Integer size,String reagentConsumableName); Page<ReagentConsumableInventoryFullVO> getAllRM(Integer current, Integer size,String reagentConsumableName);
Page<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(Page page,String reagentConsumableName); IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(IPage<ReagentConsumableInventory> page,QueryWrapper<ReagentConsumableInventory>qw);
List<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw); List<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw);
} }

@ -3,7 +3,10 @@ package digital.laboratory.platform.reagent.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO; import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO;
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
@ -15,4 +18,6 @@ import java.util.List;
public interface ReferenceMaterialService extends IService<ReferenceMaterial> { public interface ReferenceMaterialService extends IService<ReferenceMaterial> {
List<ReferenceMaterialVO> getReferenceMaterialVOList(String batchDetailsId); List<ReferenceMaterialVO> getReferenceMaterialVOList(String batchDetailsId);
void standardSolutionCurveTablePDF(List<StandardSolutionCurveVO> voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
} }

@ -7,6 +7,10 @@ import digital.laboratory.platform.reagent.entity.OutgoingContents;
import digital.laboratory.platform.reagent.entity.RequisitionRecord; import digital.laboratory.platform.reagent.entity.RequisitionRecord;
import digital.laboratory.platform.reagent.vo.RequisitionRecordVO; import digital.laboratory.platform.reagent.vo.RequisitionRecordVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* (试剂耗材领用记录表)服务类 * (试剂耗材领用记录表)服务类
* *
@ -18,4 +22,8 @@ public interface RequisitionRecordService extends IService<RequisitionRecord> {
RequisitionRecord addRecord(OutgoingContents outgoingContents); RequisitionRecord addRecord(OutgoingContents outgoingContents);
IPage<RequisitionRecordVO> getRequisitionRecordVOPage(IPage<RequisitionRecord> page, QueryWrapper<RequisitionRecord> qw); IPage<RequisitionRecordVO> getRequisitionRecordVOPage(IPage<RequisitionRecord> page, QueryWrapper<RequisitionRecord> qw);
List<RequisitionRecordVO> getRequisitionRecordVO(String id);
void rquisitionRecordTablePDF(List<RequisitionRecordVO> voList,String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
} }

@ -2,11 +2,17 @@ package digital.laboratory.platform.reagent.service;
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.Constants;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO; import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO;
import digital.laboratory.platform.reagent.entity.StandardMaterialApplication; import digital.laboratory.platform.reagent.entity.StandardMaterialApplication;
import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO; import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* (标准物质领用/归还登记表)服务类 * (标准物质领用/归还登记表)服务类
@ -22,4 +28,10 @@ public interface StandardMaterialApplicationService extends IService<StandardMat
//归还记录 //归还记录
IPage <StandardMaterialApplicationVO> getList(IPage<StandardMaterialApplication> page, QueryWrapper<StandardMaterialApplication> qw); IPage <StandardMaterialApplicationVO> getList(IPage<StandardMaterialApplication> page, QueryWrapper<StandardMaterialApplication> qw);
abstract void standardMaterialApplicationTablePDF(List<StandardMaterialApplicationVO> voList,String ids, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
StandardMaterialApplicationVO getStandardMaterialApplicationVO(String id
);
} }

@ -9,6 +9,9 @@ import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO;
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm; import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm;
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO; import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/** /**
* (标准物质停用/报废销毁/恢复/降级使用审批表)服务类 * (标准物质停用/报废销毁/恢复/降级使用审批表)服务类
* *
@ -29,4 +32,6 @@ public interface StandardMaterialApprovalFormService extends IService<StandardMa
//审批 //审批
StandardMaterialApprovalForm approveById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser); StandardMaterialApprovalForm approveById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
void standardMaterialApprovalFormTablePDF(StandardMaterialApprovalFormVO standardMaterialApprovalFormVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
} }

@ -10,6 +10,8 @@ import digital.laboratory.platform.reagent.entity.StandardReserveSolution;
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO; import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO;
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO; import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
@ -30,4 +32,5 @@ public interface StandardReserveSolutionService extends IService<StandardReserve
StandardReserveSolutionFullVO getByFullVOId(String id); StandardReserveSolutionFullVO getByFullVOId(String id);
void standardReserveSolutionTablePDF(StandardReserveSolutionVO standardReserveSolutionVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
} }

@ -6,8 +6,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.dto.StandardSolutionCurveDTO; import digital.laboratory.platform.reagent.dto.StandardSolutionCurveDTO;
import digital.laboratory.platform.reagent.entity.StandardSolutionCurve; import digital.laboratory.platform.reagent.entity.StandardSolutionCurve;
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO;
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO; import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* (标准工作曲线溶液配置记录表)服务类 * (标准工作曲线溶液配置记录表)服务类
* *
@ -19,4 +24,9 @@ public interface StandardSolutionCurveService extends IService<StandardSolutionC
IPage<StandardSolutionCurveVO> getStandardSolutionCurveVOPage(IPage<StandardSolutionCurve> page, QueryWrapper<StandardSolutionCurve> qw); IPage<StandardSolutionCurveVO> getStandardSolutionCurveVOPage(IPage<StandardSolutionCurve> page, QueryWrapper<StandardSolutionCurve> qw);
StandardSolutionCurve addById(StandardSolutionCurveDTO standardSolutionCurveDTO, DLPUser dlpUser); StandardSolutionCurve addById(StandardSolutionCurveDTO standardSolutionCurveDTO, DLPUser dlpUser);
void standardSolutionCurveTablePDF(List<StandardSolutionCurveVO> voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
StandardSolutionCurveVO getStandardSolutionCurveVO(String id);
} }

@ -1,5 +1,7 @@
package digital.laboratory.platform.reagent.service; package digital.laboratory.platform.reagent.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
@ -25,5 +27,5 @@ public interface WarehousingRecordFormService extends IService<WarehousingRecord
WarehousingRecordFormVO getWarehousingRecordFormVO (String warehousingFormId); WarehousingRecordFormVO getWarehousingRecordFormVO (String warehousingFormId);
@Transactional @Transactional
WarehousingRecordFormVO addFormById(List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, DLPUser dlpUser); WarehousingRecordFormVO addFormById(List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, DLPUser dlpUser);
Page<WarehousingRecordFormVO> getWarehousingRecordFormVOList(Page page); IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm>qw);
} }

@ -1,11 +1,20 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.config.ConfigureBuilder;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.config.PageUtils; import digital.laboratory.platform.reagent.config.PageUtils;
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO; import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
@ -16,12 +25,19 @@ import digital.laboratory.platform.reagent.service.AcceptanceRecordFormService;
import digital.laboratory.platform.reagent.service.BlacklistService; import digital.laboratory.platform.reagent.service.BlacklistService;
import digital.laboratory.platform.reagent.service.ReagentConsumablesService; import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO; import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
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.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -43,6 +59,12 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@Autowired
private OssFile ossFile;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Override @Override
public AcceptanceRecordForm commitForm(AcceptanceRecordFormDTO acceptanceRecordFormDTO, DLPUser dlpUser) { public AcceptanceRecordForm commitForm(AcceptanceRecordFormDTO acceptanceRecordFormDTO, DLPUser dlpUser) {
@ -58,6 +80,8 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
byId.setCommitTime(LocalDateTime.now()); byId.setCommitTime(LocalDateTime.now());
byId.setStatus(1); byId.setStatus(1);
byId.setDateOfAcceptance(LocalDateTime.now());
if (acceptanceRecordFormService.updateById(byId)) { if (acceptanceRecordFormService.updateById(byId)) {
return byId; return byId;
} else { } else {
@ -76,6 +100,10 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
acceptanceRecordForm.setReagentConsumableId(reagentConsumableId); acceptanceRecordForm.setReagentConsumableId(reagentConsumableId);
ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableId);
//将物品名称赋值给验收记录表
acceptanceRecordForm.setReagentConsumableName(byId.getReagentConsumableName());
acceptanceRecordForm.setStatus(0); acceptanceRecordForm.setStatus(0);
if ((acceptanceRecordFormService.save(acceptanceRecordForm))) { if ((acceptanceRecordFormService.save(acceptanceRecordForm))) {
@ -86,9 +114,9 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
} }
@Override @Override
public IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page) { public IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm>qw) {
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = baseMapper.getAcceptanceRecordFormVOPage(page); IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = baseMapper.getAcceptanceRecordFormVOPage(page,qw);
List<AcceptanceRecordFormVO> records = acceptanceRecordFormVOPage.getRecords(); List<AcceptanceRecordFormVO> records = acceptanceRecordFormVOPage.getRecords();
@ -120,7 +148,8 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId()); AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
acceptanceRecordFormVOS.add(acceptanceRecordFormVO); acceptanceRecordFormVOS.add(acceptanceRecordFormVO);
}} }
}
PageUtils pageUtils = new PageUtils(); PageUtils pageUtils = new PageUtils();
Page pages = pageUtils.getPages((int) page.getPages(), (int) page.getSize(), acceptanceRecordFormVOS); Page pages = pageUtils.getPages((int) page.getPages(), (int) page.getSize(), acceptanceRecordFormVOS);
@ -162,6 +191,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
return byId; return byId;
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }
@Override//二级审核 @Override//二级审核
public AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
@ -183,6 +213,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
return byId; return byId;
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }
@Override//三级审核 @Override//三级审核
public AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
@ -210,5 +241,131 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }
@Override
public void acceptanceRecordFormTablePDF(AcceptanceRecordFormVO acceptanceRecordFormVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("acceptanceRecordFormTablePDF.................");
ReagentConsumables byId = reagentConsumablesService.getById(acceptanceRecordFormVO.getReagentConsumableId());
if (acceptanceRecordFormVO.getTheSameBrandAndModel().equals("合格")) {
acceptanceRecordFormVO.setTheSameBrandAndModelPrint(true);
} else {
acceptanceRecordFormVO.setTheSameBrandAndModelPrint(false);
}
if (acceptanceRecordFormVO.getConsistentQuantity().equals("合格")) {
acceptanceRecordFormVO.setConsistentQuantityPrint(true);
} else {
acceptanceRecordFormVO.setConsistentQuantityPrint(false);
}
if (acceptanceRecordFormVO.getPackingInGoodCondition().equals("合格")) {
acceptanceRecordFormVO.setPackingInGoodConditionPrint(true);
} else {
acceptanceRecordFormVO.setPackingInGoodConditionPrint(false);
}
if (acceptanceRecordFormVO.getValidityPeriod().equals("合格")) {
acceptanceRecordFormVO.setValidityPeriodPrint(true);
} else {
acceptanceRecordFormVO.setValidityPeriodPrint(false);
}
if (acceptanceRecordFormVO.getDeliveryCycle().equals("合格")) {
acceptanceRecordFormVO.setDeliveryCyclePrint(true);
} else {
acceptanceRecordFormVO.setDeliveryCyclePrint(false);
}
String id = acceptanceRecordFormVO.getId();
String applyFileName = null;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
if (byId.getCategory().equals("试剂") | byId.getCategory().equals("耗材")) {
ossFile.fileGet("template" + "/" + "试剂耗材验收记录表模板.docx", bos);
applyFileName = "试剂耗材验收记录表" + id;
} else {
ossFile.fileGet("template" + "/" + "标准物质验收记录表模板.docx", bos);
applyFileName = "标准物质验收记录表" + id;
}
//-----------------------------
// 生成 word 版本的 验收记录表
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
new HashMap<String, Object>() {{
put("theSameBrandAndModelPrint", acceptanceRecordFormVO.getTheSameBrandAndModelPrint());
put("reagentConsumableName", acceptanceRecordFormVO.getReagentConsumableName());
put("dateOfAcceptance", LocalDateTimeUtil.format(acceptanceRecordFormVO.getDateOfAcceptance(),"yyyy年MM月dd日"));
put("supplierName",acceptanceRecordFormVO.getSupplierName());
put("consistentQuantityPrint",acceptanceRecordFormVO.getConsistentQuantityPrint());
put("packingInGoodConditionPrint",acceptanceRecordFormVO.getPackingInGoodConditionPrint());
put("validityPeriodPrint",acceptanceRecordFormVO.getValidityPeriodPrint());
put("deliveryCyclePrint",acceptanceRecordFormVO.getDeliveryCyclePrint());
put("nonconformingItem",acceptanceRecordFormVO.getNonconformingItem());
put("followUpTreatment",acceptanceRecordFormVO.getFollowUpTreatment());
put("acceptanceConclusion",acceptanceRecordFormVO.getAcceptanceConclusion());
put("secondaryAuditorName",acceptanceRecordFormVO.getSecondaryAuditorName());
put("auditOpinionOfSecondary",acceptanceRecordFormVO.getAuditOpinionOfSecondary());
put("auditTimeOfSecondary",LocalDateTimeUtil.format(acceptanceRecordFormVO.getAuditTimeOfSecondary(),"yyyy年MM月dd日"));
put("threeLevelAuditorName",acceptanceRecordFormVO.getThreeLevelAuditorName());
put("auditOpinionOfThreeLevel",acceptanceRecordFormVO.getAuditOpinionOfThreeLevel());
put("auditTimeOfThreeLevel",LocalDateTimeUtil.format(acceptanceRecordFormVO.getAuditTimeOfThreeLevel(),"yyyy年MM月dd日"));
put("id",acceptanceRecordFormVO.getId());
put("size",1);
put("bam_remarks",acceptanceRecordFormVO.getBam_remarks());
put("cq_remarks",acceptanceRecordFormVO.getCq_remarks());
put("pgc_remarks",acceptanceRecordFormVO.getPgc_remarks());
put("vp_remarks",acceptanceRecordFormVO.getVp_remarks());
put("dc_remarks",acceptanceRecordFormVO.getDc_remarks());
put("primaryAuditorName",acceptanceRecordFormVO.getPrimaryAuditorName());
put("auditOpinionOfPrimary",acceptanceRecordFormVO.getAuditOpinionOfPrimary());
put("auditTimeOfPrimary",LocalDateTimeUtil.format(acceptanceRecordFormVO.getAuditTimeOfPrimary(),"yyyy年MM月dd日"));
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "acceptanceRecordForm" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}
} }

@ -194,20 +194,15 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
@Override @Override
public List<CentralizedRequestVO> getVOList(QueryWrapper<CentralizedRequest> qw) { public List<CentralizedRequestVO> getVOList(QueryWrapper<CentralizedRequest> qw) {
LambdaQueryWrapper<CentralizedRequest> centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); List<CentralizedRequestVO> centralizedRequestVOArrayList = baseMapper.getVOList(qw);
//查询状态为1的采购申请:已提交
centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus,2);
List<CentralizedRequest> list = centralizedRequestService.list(centralizedRequestLambdaQueryWrapper); for (CentralizedRequestVO centralizedRequestVO : centralizedRequestVOArrayList) {
ArrayList<CentralizedRequestVO> centralizedRequestVOArrayList = new ArrayList<>(); List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId());
for (CentralizedRequest centralizedRequest : list) { centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList);
CentralizedRequestVO centralizedRequestVO = new CentralizedRequestVO();
BeanUtils.copyProperties(centralizedRequest,centralizedRequestVO);
centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId()));
centralizedRequestVOArrayList.add(centralizedRequestVO);
} }
return centralizedRequestVOArrayList; return centralizedRequestVOArrayList;
} }
@ -221,9 +216,10 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
byId.setAuditOpinion(auditAndApproveDTO.getAuditOpinion()); byId.setAuditOpinion(auditAndApproveDTO.getAuditOpinion());
byId.setAuditResult(auditAndApproveDTO.getAuditResult()); byId.setAuditResult(auditAndApproveDTO.getAuditResult());
if (auditAndApproveDTO.getApproveResult()==true){ if (auditAndApproveDTO.getAuditResult()==true){
byId.setStatus(2); byId.setStatus(2);
}byId.setStatus(-2); }
else {byId.setStatus(-2);}
if (centralizedRequestService.updateById(byId)){ if (centralizedRequestService.updateById(byId)){
return byId; return byId;
}else throw new RuntimeException(String.format("审核失败")); }else throw new RuntimeException(String.format("审核失败"));

@ -1,11 +1,19 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.config.ConfigureBuilder;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.PeriodVerificationPlanDTO; import digital.laboratory.platform.reagent.dto.PeriodVerificationPlanDTO;
import digital.laboratory.platform.reagent.entity.CheckSchedule; import digital.laboratory.platform.reagent.entity.CheckSchedule;
@ -16,14 +24,20 @@ import digital.laboratory.platform.reagent.service.PeriodVerificationImplementat
import digital.laboratory.platform.reagent.service.PeriodVerificationPlanService; import digital.laboratory.platform.reagent.service.PeriodVerificationPlanService;
import digital.laboratory.platform.reagent.vo.CheckScheduleVO; import digital.laboratory.platform.reagent.vo.CheckScheduleVO;
import digital.laboratory.platform.reagent.vo.PeriodVerificationPlanVO; import digital.laboratory.platform.reagent.vo.PeriodVerificationPlanVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
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.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -33,6 +47,7 @@ import java.util.List;
* @describe 服务实现类 * @describe 服务实现类
*/ */
@Service @Service
@SuppressWarnings("all")
public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, CheckSchedule> implements CheckScheduleService { public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, CheckSchedule> implements CheckScheduleService {
@Autowired @Autowired
@ -40,6 +55,12 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
@Autowired @Autowired
private CheckScheduleService checkScheduleService; private CheckScheduleService checkScheduleService;
@Autowired
private OssFile ossFile;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Autowired @Autowired
private PeriodVerificationPlanService periodVerificationPlanService; private PeriodVerificationPlanService periodVerificationPlanService;
@ -195,7 +216,89 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
return checkScheduleVO; return checkScheduleVO;
} }
@Override
public void checkScheduleTablePDF(CheckScheduleVO checkScheduleVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("checkScheduleTablePDF.................");
String id = checkScheduleVO.getId();
List<PeriodVerificationPlanVO> voList = checkScheduleVO.getPeriodVerificationPlanVOS();
int x= 1;
for (PeriodVerificationPlanVO periodVerificationPlanVO : voList) {
periodVerificationPlanVO.setI(x);
if (periodVerificationPlanVO.getVerificationResult().equals("P")){
periodVerificationPlanVO.setP("P");
}else if (periodVerificationPlanVO.getVerificationResult().equals("D")){
periodVerificationPlanVO.setD("D");
}else if (periodVerificationPlanVO.getVerificationResult().equals("F")){
periodVerificationPlanVO.setF("F");
}
x++;
}
String applyFileName = "标准物质期间核查计划和确认表" + id;
//-----------------------------
// 生成 word 版本的 验收记录表
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ossFile.fileGet("template" + "/" + "标准物质期间核查计划和确认表模板.docx", bos);
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
builder.bind("voList",policy).build();
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
new HashMap<String, Object>() {{
put("voList",voList);
put("id",id);
put("size",1);
put("managerName",checkScheduleVO.getManagerName());
put("technicalDirectorName",checkScheduleVO.getTechnicalDirectorName());
put("auditTimeOfTechnical", LocalDateTimeUtil.format(checkScheduleVO.getAuditTimeOfTechnical(),"yyyy年MM月dd日"));
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "checkSchedule" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}
} }

@ -1,24 +1,38 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.ComplianceCheckDTO; import digital.laboratory.platform.reagent.dto.ComplianceCheckDTO;
import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.ComplianceCheckMapper; import digital.laboratory.platform.reagent.mapper.ComplianceCheckMapper;
import digital.laboratory.platform.reagent.service.*; import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.vo.ComplianceCheckVO; import digital.laboratory.platform.reagent.vo.ComplianceCheckVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
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.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -40,6 +54,10 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
@Autowired @Autowired
private BlacklistService blacklistService; private BlacklistService blacklistService;
@Autowired
private OssFile ossFile;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@ -100,6 +118,8 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
BeanUtils.copyProperties(complianceCheckDTO, complianceCheck); BeanUtils.copyProperties(complianceCheckDTO, complianceCheck);
complianceCheck.setReagentConsumableName(reagentConsumablesService.getById(complianceCheckDTO.getReagentConsumableId()).getReagentConsumableName());
complianceCheck.setStatus(-1); complianceCheck.setStatus(-1);
if (complianceCheckService.save(complianceCheck)) { if (complianceCheckService.save(complianceCheck)) {
@ -118,6 +138,8 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
ComplianceCheck complianceCheck = complianceCheckService.addCheck(complianceCheckDTO, dlpUser); ComplianceCheck complianceCheck = complianceCheckService.addCheck(complianceCheckDTO, dlpUser);
complianceCheck.setReagentConsumableName(reagentConsumablesService.getById(complianceCheckDTO.getReagentConsumableId()).getReagentConsumableName());
complianceChecks.add(complianceCheck); complianceChecks.add(complianceCheck);
} }
if (complianceChecks != null) { if (complianceChecks != null) {
@ -181,9 +203,10 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
String nonconformingItem = complianceCheckDTO.getNonconformingItem(); String nonconformingItem = complianceCheckDTO.getNonconformingItem();
byId.setInspectionScheme(complianceCheckDTO.getInspectionScheme()); byId.setExaminationConclusion(complianceCheckDTO.getExaminationConclusion());
byId.setNonconformingItem(nonconformingItem); byId.setNonconformingItem(nonconformingItem);
byId.setDateOfInspection(LocalDateTime.now());
byId.setCommitTime(LocalDateTime.now()); byId.setCommitTime(LocalDateTime.now());
if (nonconformingItem != null) { if (nonconformingItem != null) {
@ -261,4 +284,6 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
return null; return null;
} }
} }
} }

@ -46,6 +46,9 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Autowired @Autowired
private PurchaseListService purchaseListService; private PurchaseListService purchaseListService;
@Autowired
private PurchaseListDetailsService purchaseListDetailsService;
@Override//分散采购申请分页 @Override//分散采购申请分页
public IPage<DecentralizedRequestVO> getDecentralizedRequestVOPage public IPage<DecentralizedRequestVO> getDecentralizedRequestVOPage
(@Param("page") IPage<DecentralizedRequest> page, @Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw) { (@Param("page") IPage<DecentralizedRequest> page, @Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw) {
@ -85,8 +88,6 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
decentralizedRequest.setApplicantId(dlpUser.getId()); decentralizedRequest.setApplicantId(dlpUser.getId());
decentralizedRequest.setDateOfApplication(LocalDateTime.now());
decentralizedRequest.setStatus(0); decentralizedRequest.setStatus(0);
List<DecentralizeDetails> list = new ArrayList<>(); List<DecentralizeDetails> list = new ArrayList<>();
@ -162,6 +163,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
decentralizedRequest.setStatus(1); decentralizedRequest.setStatus(1);
decentralizedRequest.setCommitTime(LocalDateTime.now()); decentralizedRequest.setCommitTime(LocalDateTime.now());
decentralizedRequest.setDateOfApplication(LocalDateTime.now());
if (decentralizedRequestService.updateById(decentralizedRequest)) { if (decentralizedRequestService.updateById(decentralizedRequest)) {
return decentralizedRequest; return decentralizedRequest;
@ -293,8 +295,6 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
List<DecentralizeDetails> list = decentralizeDetailsService.list(decentralizeDetailsLambdaQueryWrapper1); List<DecentralizeDetails> list = decentralizeDetailsService.list(decentralizeDetailsLambdaQueryWrapper1);
PurchaseListDTO purchaseListDTO = new PurchaseListDTO();
PurchaseList purchaseList = new PurchaseList(); PurchaseList purchaseList = new PurchaseList();
purchaseList.setId(IdWorker.get32UUID().toUpperCase()); purchaseList.setId(IdWorker.get32UUID().toUpperCase());
purchaseList.setName(DateTime.now() + "采购清单"); purchaseList.setName(DateTime.now() + "采购清单");
@ -305,14 +305,17 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
for (DecentralizeDetails decentralizeDetails : list) { for (DecentralizeDetails decentralizeDetails : list) {
purchaseListDTO.setReagentConsumableId(decentralizeDetails.getReagentConsumableId()); PurchaseListDetails purchaseListDetails = new PurchaseListDetails();
purchaseListDTO.setPurchaseQuantity(decentralizeDetails.getQuantity()); purchaseListDetails.setId(IdWorker.get32UUID().toUpperCase());
purchaseListDTO.setPurchaseListId(purchaseList.getId()); purchaseListDetails.setReagentConsumableId(decentralizeDetails.getReagentConsumableId());
purchaseListDetails.setPurchaseListId(purchaseList.getId());
purchaseListService.addDetails(purchaseListDTO); purchaseListDetails.setPurchaseQuantity(decentralizeDetails.getQuantity());
}
purchaseListDetailsService.save(purchaseListDetails);
decentralizeDetails.setPurchaseListDetailsId(purchaseListDetails.getId());
decentralizeDetailsService.updateById(decentralizeDetails);
}
if (byId.getResultOfApproval() == true) { if (byId.getResultOfApproval() == true) {
//如果未购入过该物品,则将该物品信息更新至试剂耗材类 //如果未购入过该物品,则将该物品信息更新至试剂耗材类
LambdaQueryWrapper<DecentralizeDetails> decentralizeDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DecentralizeDetails> decentralizeDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();

@ -15,6 +15,7 @@ import digital.laboratory.platform.reagent.mapper.DeliveryRegistrationFormMapper
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.ReagentConsumablesSetVO;
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;
@ -70,6 +71,9 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
@Autowired @Autowired
private BatchDetailsService batchDetailsService; private BatchDetailsService batchDetailsService;
@Autowired
private StandardReserveSolutionService standardReserveSolutionService;
@Override @Override
@Transactional//创建出库任务 @Transactional//创建出库任务
public DeliveryRegistrationForm addFrom(String applicationForUseId) { public DeliveryRegistrationForm addFrom(String applicationForUseId) {
@ -136,6 +140,10 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
outgoingContents.setLatticeId(byId1.getLatticeId()); outgoingContents.setLatticeId(byId1.getLatticeId());
outgoingContentsList.add(outgoingContents); outgoingContentsList.add(outgoingContents);
} }
reagentConsumablesSet.setOutgoingContentId(outgoingContents.getId());
reagentConsumablesSetService.updateById(reagentConsumablesSet);
} }
if (deliveryRegistrationFormService.save(deliveryRegistrationForm) && outgoingContentsService.saveBatch(outgoingContentsList) & if (deliveryRegistrationFormService.save(deliveryRegistrationForm) && outgoingContentsService.saveBatch(outgoingContentsList) &
@ -178,6 +186,13 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
applicationForUseService.updateById(one); applicationForUseService.updateById(one);
for (OutgoingContentsDTO outgoingContentsDTO : outgoingContentsDTOS) { for (OutgoingContentsDTO outgoingContentsDTO : outgoingContentsDTOS) {
//传入出库数量,区分出库数量与领用数量
ReagentConsumablesSet reagentConsumablesSet = reagentConsumablesSetService.getOne(Wrappers.<ReagentConsumablesSet>query().
eq("outgoing_content_id", outgoingContentsDTO.getId()));
reagentConsumablesSet.setQuantityDelivered(outgoingContentsDTO.getQuantity());
reagentConsumablesSetService.updateById(reagentConsumablesSet);
OutgoingContents outgoingContents = new OutgoingContents(); OutgoingContents outgoingContents = new OutgoingContents();
@ -211,6 +226,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber()); standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber());
standardMaterialApplications.add(standardMaterialApplication); standardMaterialApplications.add(standardMaterialApplication);
standardMaterialApplication.setIsReturn(outgoingContentsDTO.getOutboundUse()); standardMaterialApplication.setIsReturn(outgoingContentsDTO.getOutboundUse());
standardMaterialApplication.setDeliveryRegistrationFormId(byId.getId());
standardMaterialApplication.setReferenceSubstanceName(reagentConsumables.getReagentConsumableName());
if (outgoingContentsDTO.getOutboundUse() == 2) { if (outgoingContentsDTO.getOutboundUse() == 2) {
standardMaterialApplication.setStatus(-1); standardMaterialApplication.setStatus(-1);
standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString()); standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString());
@ -221,6 +238,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
byId1.setStatus(-3); byId1.setStatus(-3);
referenceMaterialService.updateById(byId1);
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()); BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId());
if (batchDetails!=null){ if (batchDetails!=null){
@ -244,6 +263,9 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
} }
} else if (reagentConsumables.getCategory().equals("标准储备溶液") ) { } else if (reagentConsumables.getCategory().equals("标准储备溶液") ) {
StandardReserveSolution reference_id = standardReserveSolutionService.getOne(Wrappers.<StandardReserveSolution>query().eq("reference_id", outgoingContentsDTO.getReferenceMaterialId()));
//创建标准物质领用/归还登记表 //创建标准物质领用/归还登记表
StandardMaterialApplication standardMaterialApplication = new StandardMaterialApplication(); StandardMaterialApplication standardMaterialApplication = new StandardMaterialApplication();
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber()); standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber());
@ -256,6 +278,10 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
standardMaterialApplication.setRequisitionedQuantity(outgoingContents.getQuantity()); standardMaterialApplication.setRequisitionedQuantity(outgoingContents.getQuantity());
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel()); standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel());
standardMaterialApplication.setApplicationForUseId(one.getId()); standardMaterialApplication.setApplicationForUseId(one.getId());
standardMaterialApplication.setDeliveryRegistrationFormId(byId.getId());
standardMaterialApplication.setReferenceSubstanceName(reference_id.getSolutionName());
if (outgoingContentsDTO.getOutboundUse() == 2) { if (outgoingContentsDTO.getOutboundUse() == 2) {
standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString()); standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString());
standardMaterialApplication.setStatus(1); standardMaterialApplication.setStatus(1);
@ -265,8 +291,12 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
standardMaterialApplication.setAdministratorId(dlpUser.getId()); standardMaterialApplication.setAdministratorId(dlpUser.getId());
standardMaterialApplication.setReferenceMaterialId(outgoingContentsDTO.getReferenceMaterialId()); standardMaterialApplication.setReferenceMaterialId(outgoingContentsDTO.getReferenceMaterialId());
standardMaterialApplications.add(standardMaterialApplication); standardMaterialApplications.add(standardMaterialApplication);
//录入标准储备溶液使用记录
SolutionUseForm solutionUseForm = solutionUseFormService.useById(outgoingContentsDTO.getNumber(), dlpUser);
solutionUseFormService.useById(outgoingContentsDTO.getNumber(), dlpUser); solutionUseForm.setStandardMaterialApplicationId(standardMaterialApplication.getStandardMaterialApplicationId());
solutionUseFormService.updateById(solutionUseForm);
//通过标准物质ID,查找出对应的仓库信息,将库存量减少 //通过标准物质ID,查找出对应的仓库信息,将库存量减少
String referenceMaterialId = outgoingContentsDTO.getReferenceMaterialId(); String referenceMaterialId = outgoingContentsDTO.getReferenceMaterialId();
@ -274,6 +304,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
referenceMaterial.setStatus(-3); referenceMaterial.setStatus(-3);
referenceMaterialService.updateById(referenceMaterial);
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId()); ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId());
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() - outgoingContentsDTO.getQuantity()); reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() - outgoingContentsDTO.getQuantity());
@ -312,6 +344,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
requisitionRecord.setDateOfClaim(LocalDateTime.now()); requisitionRecord.setDateOfClaim(LocalDateTime.now());
requisitionRecord.setRecipientId(one.getRecipientId()); requisitionRecord.setRecipientId(one.getRecipientId());
requisitionRecord.setId(byId.getId());
requisitionRecordService.updateById(requisitionRecord); requisitionRecordService.updateById(requisitionRecord);
//查找出对应的仓库信息,将库存量减少 //查找出对应的仓库信息,将库存量减少
@ -329,6 +363,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
complianceCheckDTO.setSpecificationAndModel(reagentConsumables.getSpecificationAndModel()); complianceCheckDTO.setSpecificationAndModel(reagentConsumables.getSpecificationAndModel());
complianceCheckDTO.setComplianceCheckId(IdWorker.get32UUID().toUpperCase()); complianceCheckDTO.setComplianceCheckId(IdWorker.get32UUID().toUpperCase());
complianceCheckDTO.setReagentConsumableNumber(outgoingContentsDTO.getNumber()); complianceCheckDTO.setReagentConsumableNumber(outgoingContentsDTO.getNumber());
complianceCheckDTO.setBatchDetailsId(batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()).getBatchDetailsId());
complianceCheckService.addCheck(complianceCheckDTO, dlpUser); complianceCheckService.addCheck(complianceCheckDTO, dlpUser);
} }
outgoingContentsList.add(outgoingContents); outgoingContentsList.add(outgoingContents);

@ -6,9 +6,11 @@ import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.entity.InstructionBook; import digital.laboratory.platform.reagent.entity.InstructionBook;
import digital.laboratory.platform.reagent.entity.ReagentConsumables; import digital.laboratory.platform.reagent.entity.ReagentConsumables;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.mapper.InstructionBookMapper; import digital.laboratory.platform.reagent.mapper.InstructionBookMapper;
import digital.laboratory.platform.reagent.service.InstructionBookService; import digital.laboratory.platform.reagent.service.InstructionBookService;
import digital.laboratory.platform.reagent.service.ReagentConsumablesService; import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
import digital.laboratory.platform.reagent.vo.InstructionBookVO; import digital.laboratory.platform.reagent.vo.InstructionBookVO;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -30,6 +32,9 @@ public class InstructionBookServiceImpl extends ServiceImpl<InstructionBookMappe
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@Autowired
private ReferenceMaterialService referenceMaterialService;
@Override @Override
public InstructionBook auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser){ public InstructionBook auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser){
@ -64,9 +69,13 @@ public class InstructionBookServiceImpl extends ServiceImpl<InstructionBookMappe
InstructionBookVO instructionBookVO = new InstructionBookVO(); InstructionBookVO instructionBookVO = new InstructionBookVO();
if (one!=null){
BeanUtils.copyProperties(one,instructionBookVO); BeanUtils.copyProperties(one,instructionBookVO);
ReagentConsumables byId = reagentConsumablesService.getById(instructionBookVO.getReferenceMaterialTypeId()); }
ReagentConsumables byId = reagentConsumablesService.getById(id);
instructionBookVO.setReagentConsumables(byId); instructionBookVO.setReagentConsumables(byId);

@ -1,11 +1,19 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.config.ConfigureBuilder;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.PeriodVerificationImplementationDTO; import digital.laboratory.platform.reagent.dto.PeriodVerificationImplementationDTO;
import digital.laboratory.platform.reagent.entity.PeriodVerificationImplementation; import digital.laboratory.platform.reagent.entity.PeriodVerificationImplementation;
@ -18,12 +26,19 @@ import digital.laboratory.platform.reagent.service.PeriodVerificationPlanService
import digital.laboratory.platform.reagent.service.ReagentConsumablesService; 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.vo.PeriodVerificationImplementationVO; import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
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.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap;
/** /**
* (标准物质期间核查实施情况及结果记录表)服务实现类 * (标准物质期间核查实施情况及结果记录表)服务实现类
@ -45,6 +60,12 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
private ReferenceMaterialService referenceMaterialService; private ReferenceMaterialService referenceMaterialService;
@Autowired
private OssFile ossFile;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Override//分页查询 @Override//分页查询
public IPage<PeriodVerificationImplementationVO> getPeriodVerificationImplementationVOPage(IPage<PeriodVerificationImplementation> page, QueryWrapper<PeriodVerificationImplementation> qw) { public IPage<PeriodVerificationImplementationVO> getPeriodVerificationImplementationVOPage(IPage<PeriodVerificationImplementation> page, QueryWrapper<PeriodVerificationImplementation> qw) {
@ -73,6 +94,7 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
periodVerificationImplementation.setReferenceMaterialId(periodVerificationPlan.getReferenceMaterialId()); periodVerificationImplementation.setReferenceMaterialId(periodVerificationPlan.getReferenceMaterialId());
periodVerificationImplementation.setReferenceMaterialNumber(periodVerificationPlan.getReferenceMaterialNumber()); periodVerificationImplementation.setReferenceMaterialNumber(periodVerificationPlan.getReferenceMaterialNumber());
periodVerificationImplementation.setPeriodVerificationPlanId(periodVerificationPlan.getId()); periodVerificationImplementation.setPeriodVerificationPlanId(periodVerificationPlan.getId());
periodVerificationImplementation.setCauseOfDissatisfactionResult(false);
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>();
referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getId, periodVerificationPlan.getReferenceMaterialId()); referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getId, periodVerificationPlan.getReferenceMaterialId());
@ -114,20 +136,9 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
reagentConsumablesService.updateById(byId2); reagentConsumablesService.updateById(byId2);
String result = periodVerificationImplementationDTO.getResult();
byId.setCheckingTime(LocalDate.now());
PeriodVerificationPlan periodVerificationPlan = periodVerificationPlanService.getById(periodVerificationImplementationDTO.getPeriodVerificationPlanId());
periodVerificationPlan.setVerificationResult(result);
periodVerificationPlan.setImplementationDate(byId.getCheckingTime());
periodVerificationPlan.setInspectorId(dlpUser.getId());
if (periodVerificationImplementationService.updateById(byId) && periodVerificationPlanService if (periodVerificationImplementationService.updateById(byId) ) {
.updateById(periodVerificationPlan)) {
return byId; return byId;
} else throw new RuntimeException(String.format("保存失败")); } else throw new RuntimeException(String.format("保存失败"));
@ -143,7 +154,22 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
periodVerificationImplementation.setCommitTime(LocalDateTime.now()); periodVerificationImplementation.setCommitTime(LocalDateTime.now());
if (periodVerificationImplementationService.updateById(periodVerificationImplementation)) { String result = periodVerificationImplementationDTO.getResult();
periodVerificationImplementation.setCheckingTime(LocalDate.now());
PeriodVerificationPlan periodVerificationPlan = periodVerificationPlanService.getById(periodVerificationImplementationDTO.getPeriodVerificationPlanId());
periodVerificationPlan.setVerificationResult(result);
periodVerificationPlan.setImplementationDate(periodVerificationImplementation.getCheckingTime());
periodVerificationPlan.setInspectorId(dlpUser.getId());
periodVerificationPlan.setDateOfNextCheck(periodVerificationImplementation.getCheckingTime().plusMonths(periodVerificationPlan.getPlannedVerificationCycle()));
if (periodVerificationImplementationService.updateById(periodVerificationImplementation)&& periodVerificationPlanService
.updateById(periodVerificationPlan)) {
return periodVerificationImplementation; return periodVerificationImplementation;
@ -169,4 +195,85 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
return byId; return byId;
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }
@Override
public void periodVerificationImplementationTablePDF(PeriodVerificationImplementationVO periodVerificationImplementationVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("periodVerificationImplementationTablePDF.................");
String id = periodVerificationImplementationVO.getId();
String applyFileName = "标准物质期间核查实施情况及结果记录表" + id;
//-----------------------------
// 生成 word 版本的 验收记录表
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ossFile.fileGet("template" + "/" + "标准物质期间核查实施情况及结果记录表模板.docx", bos);
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
builder.bind("voList",policy).build();
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
new HashMap<String, Object>() {{
put("id",id);
put("size",1);
put("referenceMaterialName",periodVerificationImplementationVO.getReferenceMaterialName());
put("referenceMaterialNumber",periodVerificationImplementationVO.getReferenceMaterialNumber());
put("standardValueOrPurity",periodVerificationImplementationVO.getStandardValueOrPurity());
put("deviationAndUncertainty",periodVerificationImplementationVO.getDeviationAndUncertainty());
put("inspectorName",periodVerificationImplementationVO.getInspectorName());
put("verificationMethod",periodVerificationImplementationVO.getVerificationMethod());
put("implementationAndResults",periodVerificationImplementationVO.getImplementationAndResults());
put("causeOfDissatisfactionResult",periodVerificationImplementationVO.isCauseOfDissatisfactionResult());
put("causeOfDissatisfaction",periodVerificationImplementationVO.getCauseOfDissatisfaction());
put("auditOpinionOfTechnical",periodVerificationImplementationVO.getAuditTimeOfTechnical());
put("technicalDirectorName",periodVerificationImplementationVO.getTechnicalDirectorName());
put("remarks",periodVerificationImplementationVO.getRemarks());
put("checkingTime", LocalDateTimeUtil.format(periodVerificationImplementationVO.getCheckingTime(),"yyyy年MM月dd日"));
put("auditTimeOfTechnical", LocalDateTimeUtil.format(periodVerificationImplementationVO.getAuditTimeOfTechnical(),"yyyy年MM月dd日"));
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "periodVerificationImplementation" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}
} }

@ -45,8 +45,6 @@ public class ProcurementContentServiceImpl extends ServiceImpl<ProcurementConten
List<ProcurementContentVO> procurementContentVOList = baseMapper.getProcurementContentVOList(purchasingPlanId); List<ProcurementContentVO> procurementContentVOList = baseMapper.getProcurementContentVOList(purchasingPlanId);
for (ProcurementContentVO procurementContentVO : procurementContentVOList) { for (ProcurementContentVO procurementContentVO : procurementContentVOList) {
QueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryQueryWrapper = new QueryWrapper<>(); QueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryQueryWrapper = new QueryWrapper<>();

@ -1,5 +1,6 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -61,6 +62,8 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
List<CatalogueDetails> catalogueDetailsList = new ArrayList<>(); List<CatalogueDetails> catalogueDetailsList = new ArrayList<>();
Integer i = 1;
for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) { for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) {
CatalogueDetails catalogueDetails = new CatalogueDetails(); CatalogueDetails catalogueDetails = new CatalogueDetails();
@ -71,6 +74,12 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
catalogueDetails.setPurchaseCatalogueId(purchaseCatalogue.getPurchaseCatalogueId()); catalogueDetails.setPurchaseCatalogueId(purchaseCatalogue.getPurchaseCatalogueId());
String yyyy = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy");
catalogueDetails.setPurchaseCatalogueNumber( yyyy+"-"+ i.toString());
i++;
catalogueDetailsList.add(catalogueDetails); catalogueDetailsList.add(catalogueDetails);
typeTableService.addSpecies(catalogueDetails.getCategory(), catalogueDetails.getSpecies()); typeTableService.addSpecies(catalogueDetails.getCategory(), catalogueDetails.getSpecies());
@ -101,9 +110,10 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId); catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId);
return catalogueDetailsService.removeBatchByIds(catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper)) && List<CatalogueDetails> list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);
purchaseCatalogueService.removeById(purchaseCatalogueId);
return catalogueDetailsService.removeBatchByIds(list) &&
purchaseCatalogueService.removeById(purchaseCatalogueId);
} }
@Override @Override
@ -278,7 +288,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
} }
@Override//查询已发布的采购目录 @Override//查询已发布的采购目录
public Page getVOpage(String name) { public List<CatalogueDetails> getList(String name) {
QueryWrapper<PurchaseCatalogue> queryWrapper = new QueryWrapper<>(); QueryWrapper<PurchaseCatalogue> queryWrapper = new QueryWrapper<>();
@ -304,15 +314,11 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
List<CatalogueDetails> catalogueDetailsList = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); List<CatalogueDetails> catalogueDetailsList = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);
PageUtils pageUtils = new PageUtils(); if (list == null&list.size()==0) {
Page pages = pageUtils.getPages(1, 10, catalogueDetailsList);
if (pages == null) {
throw new RuntimeException(String.format("未存在已发布的采购目录")); throw new RuntimeException(String.format("未存在已发布的采购目录"));
} }
return pages; return catalogueDetailsList;
} }
@Override @Override

@ -101,18 +101,9 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
@Transactional @Transactional
@Override//提交采购清单 @Override//提交采购清单
public PurchaseList commitById(List<PurchaseListDTO> purchaseListDTOList) { public PurchaseList commitById(String id) {
for (PurchaseListDTO purchaseListDTO : purchaseListDTOList) { PurchaseList purchaseList = purchaseListService.getById(id);
PurchaseListDetails byId = purchaseListDetailsService.getById(purchaseListDTO.getId());
byId.setSupplierId(purchaseListDTO.getSupplierId());
purchaseListDetailsService.updateById(byId);
}
PurchaseList purchaseList = purchaseListService.getById(purchaseListDTOList.get(0).getPurchaseListId());
purchaseList.setStatus(1); purchaseList.setStatus(1);

@ -269,6 +269,9 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
ProcurementContent byId = procurementContentService.getById(purchasingPlanDTO.getProcurementContentId()); ProcurementContent byId = procurementContentService.getById(purchasingPlanDTO.getProcurementContentId());
byId.setUnitPrice(purchasingPlanDTO.getUnitPrice());
byId.setQuantityPurchased(purchasingPlanDTO.getQuantityPurchased());
PurchasingPlan purchasingPlan = purchasingPlanService.getById(byId.getPurchasingPlanId()); PurchasingPlan purchasingPlan = purchasingPlanService.getById(byId.getPurchasingPlanId());
DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId()); DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId());

@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.service.impl;
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.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.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -83,10 +84,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
//赋值试剂耗材批次明细 //赋值试剂耗材批次明细
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsVOList); reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsVOList);
ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableInventory.getReagentConsumableId());
//赋值试剂耗材名称
reagentConsumableInventoryVO.setReagentConsumablesName(byId.getReagentConsumableName());
reagentConsumableInventoryVOS.add(reagentConsumableInventoryVO); reagentConsumableInventoryVOS.add(reagentConsumableInventoryVO);
} }
if (reagentConsumableInventoryVOS != null) { if (reagentConsumableInventoryVOS != null) {
@ -100,39 +97,19 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
} }
@Override//标准物质管理列表 @Override//标准物质管理列表
public Page<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(Page page, String reagentConsumableName) { public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw) {
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list( Wrappers.<ReagentConsumableInventory>query()
.eq("category", "标准物质").or()
.eq("category", "标准储备溶液")
.like(StrUtil.isNotBlank(reagentConsumableName),"reagent_consumable_name",reagentConsumableName));
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, qw);
ArrayList<ReagentConsumableInventoryVO> reagentConsumableInventoryVOS = new ArrayList<>(); List<ReagentConsumableInventoryVO> records = reagentConsumableInventoryVOPage.getRecords();
for (ReagentConsumableInventory reagentConsumableInventory : list) { for (ReagentConsumableInventoryVO reagentConsumableInventoryVO : records) {
List<BatchDetailsVO> batchDetailsVOList = batchDetailsService.getBatchDetailsList(reagentConsumableInventory.getReagentConsumableInventoryId()); List<BatchDetailsVO> batchDetailsVOList = batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId());
ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO();
BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryVO);
//赋值试剂耗材批次明细 //赋值试剂耗材批次明细
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsVOList); reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsVOList);
ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableInventory.getReagentConsumableId());
//赋值试剂耗材名称
reagentConsumableInventoryVO.setReagentConsumablesName(byId.getReagentConsumableName());
reagentConsumableInventoryVOS.add(reagentConsumableInventoryVO);
} }
if (reagentConsumableInventoryVOS != null) { return reagentConsumableInventoryVOPage;
PageUtils pageUtils = new PageUtils();
Page pages = pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), reagentConsumableInventoryVOS);
return pages;
} else return null;
} }
@ -164,10 +141,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper);
one.setTotalQuantity(one.getTotalQuantity() - quantity); one.setTotalQuantity(one.getTotalQuantity() - quantity);
if (one.getTotalQuantity() == 0) {
one.setStatus(-1);
}
if (reagentConsumableInventoryService.updateById(one)) { if (reagentConsumableInventoryService.updateById(one)) {
return one; return one;
@ -246,6 +220,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime()); reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime());
reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId()); reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId());
reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus()); reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus());
reagentConsumableInventoryFullVO.setStorageLife(Integer.valueOf(batchDetails.getLimitDate()));
if (one1 != null) { if (one1 != null) {
reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration()); reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration());

@ -1,18 +1,33 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.config.ConfigureBuilder;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.entity.ReagentConsumables; import digital.laboratory.platform.reagent.entity.ReagentConsumables;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.mapper.ReferenceMaterialMapper; import digital.laboratory.platform.reagent.mapper.ReferenceMaterialMapper;
import digital.laboratory.platform.reagent.service.ReagentConsumablesService; 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.vo.ReferenceMaterialVO; import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO;
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
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.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -21,7 +36,9 @@ import java.util.List;
* @author Zhang Xiaolong created at 2023-03-23 * @author Zhang Xiaolong created at 2023-03-23
* @describe 服务实现类 * @describe 服务实现类
*/ */
@Service @Service
@SuppressWarnings("all")
public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialMapper, ReferenceMaterial> implements ReferenceMaterialService { public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialMapper, ReferenceMaterial> implements ReferenceMaterialService {
@Autowired @Autowired
@ -30,6 +47,12 @@ public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialM
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@Autowired
private OssFile ossFile;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Override @Override
public List<ReferenceMaterialVO> getReferenceMaterialVOList(String batchDetailsId){ public List<ReferenceMaterialVO> getReferenceMaterialVOList(String batchDetailsId){
@ -57,4 +80,78 @@ public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialM
return referenceMaterialVOS; return referenceMaterialVOS;
} }
@Override
public void standardSolutionCurveTablePDF(List<StandardSolutionCurveVO> voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("standardSolutionCurveTablePDF.................");
Integer x = 1;
for (StandardSolutionCurveVO standardSolutionCurveVO : voList) {
standardSolutionCurveVO.setSerialnNumber(x.toString());
x++;
}
String applyFileName = "标准工作曲线溶液配制记录表-" + id;
//-----------------------------
// 生成 word 版本的 验收记录表
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ossFile.fileGet("template" + "/" + "标准工作曲线溶液配制记录表模板.docx", bos);
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
builder.bind("voList", policy).build();
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
new HashMap<String, Object>() {{
put("voList",voList);
put("id",id);
put("size",1);
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "standardSolutionCurve" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}
} }

@ -1,19 +1,39 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
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;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.entity.ApplicationForUse;
import digital.laboratory.platform.reagent.entity.OutgoingContents; import digital.laboratory.platform.reagent.entity.OutgoingContents;
import digital.laboratory.platform.reagent.entity.ReagentConsumables; import digital.laboratory.platform.reagent.entity.ReagentConsumables;
import digital.laboratory.platform.reagent.entity.RequisitionRecord; import digital.laboratory.platform.reagent.entity.RequisitionRecord;
import digital.laboratory.platform.reagent.mapper.RequisitionRecordMapper; import digital.laboratory.platform.reagent.mapper.RequisitionRecordMapper;
import digital.laboratory.platform.reagent.service.ApplicationForUseService;
import digital.laboratory.platform.reagent.service.DeliveryRegistrationFormService;
import digital.laboratory.platform.reagent.service.ReagentConsumablesService; import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
import digital.laboratory.platform.reagent.service.RequisitionRecordService; import digital.laboratory.platform.reagent.service.RequisitionRecordService;
import digital.laboratory.platform.reagent.vo.RequisitionRecordVO; import digital.laboratory.platform.reagent.vo.RequisitionRecordVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
/** /**
* (试剂耗材领用记录表)服务实现类 * (试剂耗材领用记录表)服务实现类
* *
@ -21,6 +41,7 @@ import org.springframework.stereotype.Service;
* @describe (试剂耗材领用记录表) 服务实现类 * @describe (试剂耗材领用记录表) 服务实现类
*/ */
@Service @Service
@SuppressWarnings("all")
public class RequisitionRecordServiceImpl extends ServiceImpl<RequisitionRecordMapper, RequisitionRecord> implements RequisitionRecordService { public class RequisitionRecordServiceImpl extends ServiceImpl<RequisitionRecordMapper, RequisitionRecord> implements RequisitionRecordService {
@Autowired @Autowired
@ -28,9 +49,21 @@ public class RequisitionRecordServiceImpl extends ServiceImpl<RequisitionRecordM
@Autowired @Autowired
private RequisitionRecordService requisitionRecordService; private RequisitionRecordService requisitionRecordService;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Autowired
private ApplicationForUseService applicationForUseService;
@Autowired
private DeliveryRegistrationFormService deliveryRegistrationFormService;
@Autowired
private OssFile ossFile;
@Override @Override
public RequisitionRecord addRecord(OutgoingContents outgoingContents){ public RequisitionRecord addRecord(OutgoingContents outgoingContents){
RequisitionRecord requisitionRecord = new RequisitionRecord(); RequisitionRecord requisitionRecord = new RequisitionRecord();
ReagentConsumables byId = reagentConsumablesService.getById(outgoingContents.getReagentConsumableId()); ReagentConsumables byId = reagentConsumablesService.getById(outgoingContents.getReagentConsumableId());
@ -57,4 +90,92 @@ public class RequisitionRecordServiceImpl extends ServiceImpl<RequisitionRecordM
} }
@Override
public List<RequisitionRecordVO> getRequisitionRecordVO(String id){
ApplicationForUse byId = applicationForUseService.getById(id);
String deliveryRegistrationFormId = byId.getDeliveryRegistrationFormId();
List<RequisitionRecordVO> requisitionRecordVO = baseMapper.getRequisitionRecordVO(deliveryRegistrationFormId);
return requisitionRecordVO;
}
@Override
public void rquisitionRecordTablePDF(List<RequisitionRecordVO> voList,String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("RequisitionRecordTablePDF.................");
//-----------------------------
// 生成 word 版本的 采购目录
String applyFileName = "试剂耗材领用记录表-"+id;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ossFile.fileGet("template" + "/" + "试剂耗材领用记录表模板.docx", bos);
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
int x = 1;
for (RequisitionRecordVO requisitionRecordVO : voList) {
LocalDateTime dateOfClaim = requisitionRecordVO.getDateOfClaim();
requisitionRecordVO.setDateOfClaims(LocalDateTimeUtil.format(dateOfClaim,"yyyy年MM月dd日"));
requisitionRecordVO.setI(x);
x++;
}
Configure config = Configure.builder().
bind("voList", policy).build();
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
new HashMap<String, Object>() {{
put("voList", voList);
put("id",id);
put("size",1);
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "requisitionRecord" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}
} }

@ -61,4 +61,5 @@ public class SolutionUseFormServiceImpl extends ServiceImpl<SolutionUseFormMappe
return solutionUseForm; return solutionUseForm;
}else throw new RuntimeException(String.format("标准储备溶液使用记录保存失败")); }else throw new RuntimeException(String.format("标准储备溶液使用记录保存失败"));
} }
} }

@ -1,19 +1,37 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.Constants;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO; import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO;
import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.StandardMaterialApplicationMapper; import digital.laboratory.platform.reagent.mapper.StandardMaterialApplicationMapper;
import digital.laboratory.platform.reagent.service.*; import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO; import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -47,6 +65,12 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
@Autowired @Autowired
private StandardReserveSolutionService standardReserveSolutionService; private StandardReserveSolutionService standardReserveSolutionService;
@Autowired
private OssFile ossFile;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Override//归还标准物质 @Override//归还标准物质
@Transactional @Transactional
public StandardMaterialApplication returnById(StandardMaterialApplicationDTO standardMaterialApplicationDTO) { public StandardMaterialApplication returnById(StandardMaterialApplicationDTO standardMaterialApplicationDTO) {
@ -59,19 +83,37 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(byId.getReferenceMaterialId()); ReferenceMaterial referenceMaterial = referenceMaterialService.getById(byId.getReferenceMaterialId());
BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId()); ReagentConsumables reagentConsumables = reagentConsumablesService.getById(referenceMaterial.getReagentConsumableId());
batchDetails.setLatticeId(standardMaterialApplicationDTO.getLatticeId());
batchDetailsService.updateById(batchDetails); referenceMaterial.setLocation(standardMaterialApplicationDTO.getLocation());
referenceMaterial.setLocation(standardMaterialApplicationDTO.getLocation());
//若无需归还,则证明标准物质/标准储备溶液已经使用完毕,删除记录即可 //若无需归还,则证明标准物质/标准储备溶液已经使用完毕,删除记录即可
if (!standardMaterialApplicationDTO.getOutOfUse()){ if (standardMaterialApplicationDTO.getOutOfUse()) {
referenceMaterial.setStatus(-4); referenceMaterial.setStatus(-4);
referenceMaterialService.updateById(referenceMaterial);
if (reagentConsumables.getCategory().equals("标准储备溶液")) {
StandardReserveSolution solution_numbering = standardReserveSolutionService.getOne(Wrappers.<StandardReserveSolution>query().eq("solution_numbering", referenceMaterial.getNumber()));
solution_numbering.setStatus(-1);
standardReserveSolutionService.updateById(solution_numbering);
} }
} else {
referenceMaterial.setStatus(0);
BatchDetails byId2 = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
byId2.setQuantity(byId2.getQuantity() + 1);
ReagentConsumableInventory byId1 = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId());
byId1.setTotalQuantity(byId1.getTotalQuantity() + 1);
batchDetailsService.updateById(byId2);
reagentConsumableInventoryService.updateById(byId1);
}
referenceMaterialService.updateById(referenceMaterial);
LambdaQueryWrapper<SolutionUseForm> solutionUseFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SolutionUseForm> solutionUseFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
solutionUseFormLambdaQueryWrapper.eq(SolutionUseForm::getStandardMaterialApplicationId, byId.getStandardMaterialApplicationId()); solutionUseFormLambdaQueryWrapper.eq(SolutionUseForm::getStandardMaterialApplicationId, byId.getStandardMaterialApplicationId());
@ -101,9 +143,9 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
@Override//归还记录 @Override//归还记录
public IPage<StandardMaterialApplicationVO> getList(IPage<StandardMaterialApplication> page, QueryWrapper<StandardMaterialApplication> qw) { public IPage<StandardMaterialApplicationVO> getList(IPage<StandardMaterialApplication> page, QueryWrapper<StandardMaterialApplication> qw) {
IPage<StandardMaterialApplicationVO> standardMaterialApplicationVOList = baseMapper.getStandardMaterialApplicationVOList(page, qw); IPage<StandardMaterialApplicationVO> standardMaterialApplicationVOIPage = baseMapper.getStandardMaterialApplicationVOList(page, qw);
List<StandardMaterialApplicationVO> records = standardMaterialApplicationVOList.getRecords(); List<StandardMaterialApplicationVO> records = standardMaterialApplicationVOIPage.getRecords();
for (StandardMaterialApplicationVO record : records) { for (StandardMaterialApplicationVO record : records) {
@ -125,10 +167,97 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
} }
}
return standardMaterialApplicationVOIPage;
}
@Override
public void standardMaterialApplicationTablePDF(List<StandardMaterialApplicationVO> voList, String ids,HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("standardMaterialApplicationTablePDF.................");
int x = 1;
for (StandardMaterialApplicationVO standardMaterialApplicationVO : voList) {
standardMaterialApplicationVO.setDateOfClaims(LocalDateTimeUtil.format(standardMaterialApplicationVO.getDateOfClaim(), "yyyy年MM月dd日"));
standardMaterialApplicationVO.setDateOfReturns(LocalDateTimeUtil.format(standardMaterialApplicationVO.getDateOfReturn(), "yyyy年MM月dd日"));
standardMaterialApplicationVO.setX(x);
if (standardMaterialApplicationVO.getPurpose() == 0) {
standardMaterialApplicationVO.setPurposeAndQuantity("案件," + standardMaterialApplicationVO.getPurposeAndQuantity());
} else {
standardMaterialApplicationVO.setPurposeAndQuantity("科研," + standardMaterialApplicationVO.getPurposeAndQuantity());
}
x++;
}
//-----------------------------
// 生成 word 版本的 采购目录
String applyFileName = "标准物质领用归还登记表-" + ids;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ossFile.fileGet("template" + "/" + "标准物质领用归还登记表模板.docx", bos);
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
Configure config = Configure.builder().
bind("voList", policy).build();
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
new HashMap<String, Object>() {{
put("voList", voList);
put("ids", ids);
put("size", 1);
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "standardMaterialApplication" + "/" + ids + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
} }
return standardMaterialApplicationVOList;
@Override
public StandardMaterialApplicationVO getStandardMaterialApplicationVO(String id) {
StandardMaterialApplicationVO standardMaterialApplicationVO = baseMapper.getStandardMaterialApplicationVO(id);
return standardMaterialApplicationVO;
} }
} }

@ -1,10 +1,18 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
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;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.config.ConfigureBuilder;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO; import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
@ -15,11 +23,18 @@ import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService; import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService;
import digital.laboratory.platform.reagent.service.SupplierInformationService; import digital.laboratory.platform.reagent.service.SupplierInformationService;
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO; import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
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.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap;
/** /**
* (标准物质停用/报废销毁/恢复/降级使用审批表)服务实现类 * (标准物质停用/报废销毁/恢复/降级使用审批表)服务实现类
@ -28,6 +43,7 @@ import java.time.LocalDateTime;
* @describe (标准物质停用 / 报废销毁 / 恢复 / 降级使用审批表) 服务实现类 * @describe (标准物质停用 / 报废销毁 / 恢复 / 降级使用审批表) 服务实现类
*/ */
@Service @Service
@SuppressWarnings("all")
public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<StandardMaterialApprovalFormMapper, StandardMaterialApprovalForm> implements StandardMaterialApprovalFormService { public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<StandardMaterialApprovalFormMapper, StandardMaterialApprovalForm> implements StandardMaterialApprovalFormService {
@Autowired @Autowired
@ -39,6 +55,12 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
@Autowired @Autowired
private ReferenceMaterialService referenceMaterialService; private ReferenceMaterialService referenceMaterialService;
@Autowired
private OssFile ossFile;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Override @Override
public StandardMaterialApprovalForm commitById(StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser) { public StandardMaterialApprovalForm commitById(StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser) {
@ -54,8 +76,6 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
standardMaterialApprovalForm.setId(IdWorker.get32UUID().toUpperCase()); standardMaterialApprovalForm.setId(IdWorker.get32UUID().toUpperCase());
standardMaterialApprovalForm.setApprovalOfTime(LocalDateTime.now());
standardMaterialApprovalForm.setCommitTime(LocalDateTime.now()); standardMaterialApprovalForm.setCommitTime(LocalDateTime.now());
if (standardMaterialApprovalFormDTO.getApplicationContent() == 1 | standardMaterialApprovalFormDTO.getApplicationContent() == 2) { if (standardMaterialApprovalFormDTO.getApplicationContent() == 1 | standardMaterialApprovalFormDTO.getApplicationContent() == 2) {
@ -170,4 +190,122 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
return byId; return byId;
} else throw new RuntimeException(String.format("审批失败")); } else throw new RuntimeException(String.format("审批失败"));
} }
@Override
public void standardMaterialApprovalFormTablePDF(StandardMaterialApprovalFormVO standardMaterialApprovalFormVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("standardMaterialApprovalFormTablePDF.................");
String id = standardMaterialApprovalFormVO.getId();
String reasonForApplication = standardMaterialApprovalFormVO.getReasonForApplication();
Integer reasonForApplicationPrint = standardMaterialApprovalFormVO.getReasonForApplicationPrint();
if (reasonForApplication.equals("发现质变或有异常,暂停使用")) {
standardMaterialApprovalFormVO.setReasonForApplicationPrint(0);
}
if (reasonForApplication.equals("超过有效期或保质期,暂停使用")) {
standardMaterialApprovalFormVO.setReasonForApplicationPrint(1);
}
if (reasonForApplication.equals("定值合格恢复使用")) {
standardMaterialApprovalFormVO.setReasonForApplicationPrint(2);
}
if (reasonForApplication.equals("定值未达原等级要求,降级使用")) {
standardMaterialApprovalFormVO.setReasonForApplicationPrint(3);
}
if (reasonForApplication.equals("定值未达使用要求,报废销毁")) {
standardMaterialApprovalFormVO.setReasonForApplicationPrint(4);
}
if (reasonForApplication.equals("其他")) {
standardMaterialApprovalFormVO.setReasonForApplicationPrint(5);
}
String applyFileName = "标准物质停用报废销毁恢复降级使用审批表" + id;
//-----------------------------
// 生成 word 版本的 验收记录表
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ossFile.fileGet("template" + "/" + "标准物质停用报废销毁恢复降级使用审批表模板.docx", bos);
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
builder.bind("voList", policy).build();
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
new HashMap<String, Object>() {{
put("id", id);
put("size", 1);
put("referenceMaterialName",standardMaterialApprovalFormVO.getReferenceMaterialName());
put("referenceMaterialNumber",standardMaterialApprovalFormVO.getReferenceMaterialNumber());
put("batchNumber",standardMaterialApprovalFormVO.getBatchNumber());
put("specification",standardMaterialApprovalFormVO.getSpecification());
put("manufacturerName",standardMaterialApprovalFormVO.getManufacturerName());
put("purchaseTime", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getProcessingTime(),"yyyy年MM月dd日"));
put("commitTime", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getCommitTime(),"yyyy年MM月dd日"));
put("processingTime", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getProcessingTime(),"yyyy年MM月dd日"));
put("auditTimeOfPrimary", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getAuditTimeOfPrimary(),"yyyy年MM月dd日"));
put("auditTimeOfSecondary", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getAuditTimeOfSecondary(),"yyyy年MM月dd日"));
put("approvalOfTime", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getApprovalOfTime(),"yyyy年MM月dd日"));
put("quantity", standardMaterialApprovalFormVO.getQuantity());
put("fixedResult", standardMaterialApprovalFormVO.getFixedResult());
put("createName", standardMaterialApprovalFormVO.getCreateName());
put("applicationContent", standardMaterialApprovalFormVO.getApplicationContent());
put("agentName", standardMaterialApprovalFormVO.getAgentName());
put("reasonForApplicationPrint",standardMaterialApprovalFormVO.getReasonForApplicationPrint());
put("auditOpinionOfPrimary",standardMaterialApprovalFormVO.getAuditOpinionOfPrimary());
put("primaryAuditorName",standardMaterialApprovalFormVO.getPrimaryAuditorName());
put("auditOpinionOfSecondary",standardMaterialApprovalFormVO.getAuditOpinionOfSecondary());
put("secondaryAuditorName",standardMaterialApprovalFormVO.getSecondaryAuditorName());
put("opinionOfApproval",standardMaterialApprovalFormVO.getOpinionOfApproval());
put("approverName",standardMaterialApprovalFormVO.getApproverName());
put("remarks",standardMaterialApprovalFormVO.getRemarks());
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "standardMaterialApprovalForm" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}
} }

@ -1,29 +1,41 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.config.ConfigureBuilder;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.StandardReserveSolutionDTO; import digital.laboratory.platform.reagent.dto.StandardReserveSolutionDTO;
import digital.laboratory.platform.reagent.dto.StandardReserveSolutionFullDTO; import digital.laboratory.platform.reagent.dto.StandardReserveSolutionFullDTO;
import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.StandardReserveSolutionMapper; import digital.laboratory.platform.reagent.mapper.StandardReserveSolutionMapper;
import digital.laboratory.platform.reagent.service.*; import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.vo.LocationVO; import digital.laboratory.platform.reagent.vo.*;
import digital.laboratory.platform.reagent.vo.SolutionUseFormVO; import feign.Response;
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO; import org.apache.commons.io.output.ByteArrayOutputStream;
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO;
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.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -51,6 +63,12 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
@Autowired @Autowired
private CabinetFormService cabinetFormService; private CabinetFormService cabinetFormService;
@Autowired
private OssFile ossFile;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@Autowired @Autowired
@ -139,6 +157,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
String id = standardReserveSolutionFullDTO.getId(); String id = standardReserveSolutionFullDTO.getId();
String location = standardReserveSolutionFullDTO.getLocation();
String latticeId = standardReserveSolutionFullDTO.getLatticeId(); String latticeId = standardReserveSolutionFullDTO.getLatticeId();
String warehousingRemarks = standardReserveSolutionFullDTO.getWarehousingRemarks(); String warehousingRemarks = standardReserveSolutionFullDTO.getWarehousingRemarks();
@ -194,6 +213,8 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
referenceMaterial.setLatticeId(latticeId); referenceMaterial.setLatticeId(latticeId);
referenceMaterial.setLocation(standardReserveSolutionFullDTO.getLocation()); referenceMaterial.setLocation(standardReserveSolutionFullDTO.getLocation());
byId.setReferenceId(referenceMaterial.getId());
referenceMaterialService.save(referenceMaterial); referenceMaterialService.save(referenceMaterial);
reagentConsumableInventory.setTotalQuantity(1); reagentConsumableInventory.setTotalQuantity(1);
@ -235,6 +256,8 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
referenceMaterial.setLatticeId(latticeId); referenceMaterial.setLatticeId(latticeId);
referenceMaterial.setLocation(standardReserveSolutionFullDTO.getLocation()); referenceMaterial.setLocation(standardReserveSolutionFullDTO.getLocation());
byId.setReferenceId(referenceMaterial.getId());
referenceMaterialService.save(referenceMaterial); referenceMaterialService.save(referenceMaterial);
//将存储信息录入仓库表 //将存储信息录入仓库表
@ -263,16 +286,107 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
StandardReserveSolutionFullVO standardReserveSolutionFullVO = new StandardReserveSolutionFullVO(); StandardReserveSolutionFullVO standardReserveSolutionFullVO = new StandardReserveSolutionFullVO();
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); BeanUtils.copyProperties(standardReserveSolutionVOById,standardReserveSolutionFullVO);
ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolutionVOById.getReferenceMaterialId()); ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolutionVOById.getReferenceId());
if (byId!=null) {
standardReserveSolutionFullVO.setLocation(byId.getLocation());
standardReserveSolutionFullVO.setLatticeId(byId.getLatticeId());
}
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableName, standardReserveSolutionVOById.getSolutionName());
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getConfigurationConcentration, standardReserveSolutionVOById.getConfigurationConcentration());
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper);
return standardReserveSolutionFullVO; return standardReserveSolutionFullVO;
} }
@Override
public void standardReserveSolutionTablePDF(StandardReserveSolutionVO standardReserveSolutionVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("standardReserveSolutionTablePDF.................");
String id = standardReserveSolutionVO.getId();
List<SolutionUseFormVO> voList = standardReserveSolutionVO.getSolutionUseFormVOList();
for (SolutionUseFormVO solutionUseFormVO : voList) {
LocalDateTime createTime = solutionUseFormVO.getCreateTime();
String format = LocalDateTimeUtil.format(createTime, "yyyy年MM月dd日");
solutionUseFormVO.setFormat(format);
}
String applyFileName = "标准储备溶液配制及使用记录表-" + id;
//-----------------------------
// 生成 word 版本的 验收记录表
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ossFile.fileGet("template" + "/" + "标准储备溶液配制及使用记录表模板.docx", bos);
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
builder.bind("voList", policy).build();
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
new HashMap<String, Object>() {{
put("voList",voList);
put("id", id);
put("size", 1);
put("solutionName",standardReserveSolutionVO.getSolutionName());
put("solutionNumbering",standardReserveSolutionVO.getSolutionNumbering());
put("referenceMaterialNumber",standardReserveSolutionVO.getReferenceMaterialNumber());
put("referenceMaterialScale",standardReserveSolutionVO.getReferenceMaterialScale());
put("useOfSolvent",standardReserveSolutionVO.getUseOfSolvent());
put("constantVolume",standardReserveSolutionVO.getConstantVolume());
put("configurationConcentration",standardReserveSolutionVO.getConfigurationConcentration());
put("dispenserName",standardReserveSolutionVO.getDispenserName());
put("validityPeriod",standardReserveSolutionVO.getValidityPeriod());
put("remarks",standardReserveSolutionVO.getRemarks());
put("configurationDate", LocalDateTimeUtil.format(standardReserveSolutionVO.getConfigurationDate(),"yyyy年MM月dd日"));
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "standardReserveSolution" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}
} }

@ -1,24 +1,42 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.config.ConfigureBuilder;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.StandardSolutionCurveDTO; import digital.laboratory.platform.reagent.dto.StandardSolutionCurveDTO;
import digital.laboratory.platform.reagent.entity.ReagentConsumables; import digital.laboratory.platform.reagent.entity.ReagentConsumables;
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.StandardSolutionCurve; import digital.laboratory.platform.reagent.entity.StandardSolutionCurve;
import digital.laboratory.platform.reagent.mapper.StandardSolutionCurveMapper; import digital.laboratory.platform.reagent.mapper.StandardSolutionCurveMapper;
import digital.laboratory.platform.reagent.service.ReagentConsumablesService; 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.StandardReserveSolutionService;
import digital.laboratory.platform.reagent.service.StandardSolutionCurveService; import digital.laboratory.platform.reagent.service.StandardSolutionCurveService;
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO; import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
/** /**
* (标准工作曲线溶液配置记录表)服务实现类 * (标准工作曲线溶液配置记录表)服务实现类
@ -27,11 +45,21 @@ import java.time.LocalDateTime;
* @describe (标准工作曲线溶液配置记录表) 服务实现类 * @describe (标准工作曲线溶液配置记录表) 服务实现类
*/ */
@Service @Service
@SuppressWarnings("all")
public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSolutionCurveMapper, StandardSolutionCurve> implements StandardSolutionCurveService { public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSolutionCurveMapper, StandardSolutionCurve> implements StandardSolutionCurveService {
@Autowired @Autowired
private StandardSolutionCurveService standardSolutionCurveService; private StandardSolutionCurveService standardSolutionCurveService;
@Autowired
private StandardReserveSolutionService standardReserveSolutionService;
@Autowired
private OssFile ossFile;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Autowired @Autowired
private ReferenceMaterialService referenceMaterialService; private ReferenceMaterialService referenceMaterialService;
@ -51,13 +79,9 @@ public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSoluti
StandardSolutionCurve standardSolutionCurve = new StandardSolutionCurve(); StandardSolutionCurve standardSolutionCurve = new StandardSolutionCurve();
String solutionNumbering = standardSolutionCurveDTO.getSolutionNumbering(); StandardReserveSolution byId = standardReserveSolutionService.getById(standardSolutionCurveDTO.getSolutionId());
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>(); ReferenceMaterial referenceMaterial = referenceMaterialService.getById(byId.getReferenceId());
referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getNumber,solutionNumbering);
ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(referenceMaterialLambdaQueryWrapper);
standardSolutionCurve.setId(IdWorker.get32UUID().toUpperCase()); standardSolutionCurve.setId(IdWorker.get32UUID().toUpperCase());
@ -76,4 +100,88 @@ public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSoluti
}else throw new RuntimeException(String.format("配置失败")); }else throw new RuntimeException(String.format("配置失败"));
} }
@Override
public void standardSolutionCurveTablePDF(List<StandardSolutionCurveVO> voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("standardSolutionCurveTablePDF.................");
Integer x = 1;
for (StandardSolutionCurveVO standardSolutionCurveVO : voList) {
standardSolutionCurveVO.setSerialnNumber(x.toString());
standardSolutionCurveVO.setConfigurationDatePrint(LocalDateTimeUtil.format(standardSolutionCurveVO.getConfigurationDate(),"yyyy年MM月dd日"));
x++;
}
String applyFileName = "标准工作曲线溶液配制记录表-" + id;
//-----------------------------
// 生成 word 版本的 验收记录表
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ossFile.fileGet("template" + "/" + "标准工作曲线溶液配制记录表模板.docx", bos);
byte[] templateArray = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
bos.close();
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
builder.bind("voList", policy).build();
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
new HashMap<String, Object>() {{
put("voList",voList);
put("id",id);
put("size",1);
}}
);
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
template.write(fosWord);
template.close();
//------------
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
fosWord.close();
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
fisWord.close();
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close();
ossFile.fileSave("document" + "/" + "standardSolutionCurve" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
isPDF.close();
System.out.println(String.format("转换为 PDF 结束"));
}
@Override
public StandardSolutionCurveVO getStandardSolutionCurveVO(String id){
StandardSolutionCurveVO standardSolutionCurveVO = baseMapper.getStandardSolutionCurveVO(id);
return standardSolutionCurveVO;
}
} }

@ -55,19 +55,11 @@ public class WarehousingContentServiceImpl extends ServiceImpl<WarehousingConten
List<WarehousingContentVO> records = warehousingContentVOPage.getRecords(); List<WarehousingContentVO> records = warehousingContentVOPage.getRecords();
for (WarehousingContentVO warehousingContentVO : records) { for (WarehousingContentVO record : records) {
List<WarehousingBatchListVO> warehousingBatchListVOList = warehousingBatchListService.getWarehousingBatchListVOList(warehousingContentVO.getId()); List<WarehousingBatchListVO> warehousingBatchListVOList = warehousingBatchListService.getWarehousingBatchListVOList(record.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());
record.setWarehousingBatchListVOList(warehousingBatchListVOList);
} }
return warehousingContentVOPage; return warehousingContentVOPage;
} }

@ -1,28 +1,40 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.PageUtil; import cn.hutool.core.util.PageUtil;
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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.config.PageUtils; import digital.laboratory.platform.reagent.config.PageUtils;
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.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.WarehousingContentVO; import digital.laboratory.platform.reagent.vo.*;
import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO; import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
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.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -76,6 +88,30 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
@Autowired @Autowired
private SupplierInformationService supplierInformationService; private SupplierInformationService supplierInformationService;
@Autowired
private PurchaseListDetailsService purchaseListDetailsService;
@Autowired
private ProcurementContentService procurementContentService;
@Autowired
private DetailsOfCentralizedService detailsOfCentralizedService;
@Autowired
private DecentralizeDetailsService decentralizeDetailsService;
@Autowired
private PurchasingPlanService purchasingPlanService;
@Autowired
private CentralizedRequestService centralizedRequestService;
@Autowired
private DecentralizedRequestService decentralizedRequestService;
@Autowired
private PurchaseListService purchaseListService;
@Override//查看采购入库 @Override//查看采购入库
public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) { public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) {
@ -97,6 +133,14 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
@Override//录入入库明细 @Override//录入入库明细
public WarehousingRecordFormVO addFormById(List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, DLPUser dlpUser) { public WarehousingRecordFormVO addFormById(List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, DLPUser dlpUser) {
for (WarehousingRecordFormDTO warehousingRecordFormDTO : warehousingRecordFormDTOList) {
if (warehousingRecordFormDTO.getLatticeId().isEmpty()&warehousingRecordFormDTO.getLocation().isEmpty()){
throw new RuntimeException(String.format("请选择存放位置后再进行提交"));
}
}
boolean flag = true; boolean flag = true;
int i = 0; int i = 0;
@ -181,7 +225,11 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
batchDetails.setSupplierId(byId.getSupplierId()); batchDetails.setSupplierId(byId.getSupplierId());
batchDetails.setBatch(1); batchDetails.setBatch(1);
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate()); batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate());
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*reagentConsumables.getPackagedCopies()); batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*Integer.valueOf(reagentConsumables.getPackagedCopies()));
if (batchDetails.getQuantity()==null){
batchDetails.setQuantity(0);
}
if (reagentConsumables.getCategory().equals("试剂")|reagentConsumables.getCategory().equals("耗材")){ if (reagentConsumables.getCategory().equals("试剂")|reagentConsumables.getCategory().equals("耗材")){
@ -193,9 +241,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
reagentConsumableInventory.setTotalQuantity(0); reagentConsumableInventory.setTotalQuantity(0);
} }
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + batchDetails.getQuantity() * Integer.valueOf(reagentConsumableInventory.getPackagedCopies()));
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + batchDetails.getQuantity()); reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + batchDetails.getQuantity());
//如果是标准物质,则赋值编号 //如果是标准物质,则赋值编号
if (reagentConsumables.getCategory().equals("标准物质")) { if (reagentConsumables.getCategory().equals("标准物质")) {
@ -209,18 +257,15 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
referenceMaterial.setStatus(0); referenceMaterial.setStatus(0);
referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation()); referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation());
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId()); referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId());
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName());
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR); int year = calendar.get(Calendar.YEAR);
LatticeForm latticeForm = latticeFormService.getById(warehousingRecordFormDTO.getLatticeId()); String location = warehousingRecordFormDTO.getLocation();
CabinetForm cabinetForm = cabinetFormService.getById(latticeForm.getCabinetFormId());
StorageRoomForm storageRoomForm = storageRoomFormService.getById(cabinetForm.getStorageRoomFormId()); String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(2) + "-";
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + storageRoomForm.getFloor() + "-";
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
.likeRight("number", prefix) .likeRight("number", prefix)
@ -268,7 +313,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
batchDetails.setSupplierId(byId.getSupplierId()); batchDetails.setSupplierId(byId.getSupplierId());
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate()); batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate());
batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId());
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*one.getPackagedCopies()); batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*Integer.valueOf(one.getPackagedCopies()));
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId()) List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId())
.eq("supplier_id",byId.getSupplierId())); .eq("supplier_id",byId.getSupplierId()));
@ -298,18 +343,15 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
referenceMaterial.setStatus(0); referenceMaterial.setStatus(0);
referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation()); referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation());
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId()); referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId());
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName());
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR); int year = calendar.get(Calendar.YEAR);
LatticeForm latticeForm = latticeFormService.getById(warehousingRecordFormDTO.getLatticeId()); String location = warehousingRecordFormDTO.getLocation();
CabinetForm cabinetForm = cabinetFormService.getById(latticeForm.getCabinetFormId());
StorageRoomForm storageRoomForm = storageRoomFormService.getById(cabinetForm.getStorageRoomFormId()); String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(2) + "-";
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + storageRoomForm.getFloor() + "-";
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
.likeRight("number", prefix) .likeRight("number", prefix)
@ -355,12 +397,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
if (warehousingContent.getWarehousingQuantity() == warehousingContent.getTotalQuantity()) { if (warehousingContent.getWarehousingQuantity() == warehousingContent.getTotalQuantity()) {
LambdaQueryWrapper<WarehousingBatchList> warehousingBatchListLambdaQueryWrapper = new LambdaQueryWrapper<>(); warehousingContent.setStatus(1);
warehousingBatchListLambdaQueryWrapper.eq(WarehousingBatchList::getWarehousingContentId, warehousingContent.getId());
List<WarehousingBatchList> list1 = warehousingBatchListService.list(warehousingBatchListLambdaQueryWrapper);
warehousingContentService.updateById(warehousingContent);
if (warehousingContent.getAcceptanceRecordFormId() == null) { if (warehousingContent.getAcceptanceRecordFormId() == null) {
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.addForm(warehousingContent.getReagentConsumableId(), warehousingContent.getSupplierId()); AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.addForm(warehousingContent.getReagentConsumableId(), warehousingContent.getSupplierId());
@ -419,45 +458,173 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
} }
@Override @Override
public Page<WarehousingRecordFormVO> getWarehousingRecordFormVOList(Page page) { public IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm> qw) {
List<WarehousingRecordFormVO> warehousingRecordFormVOList = baseMapper.getWarehousingRecordFormVOList(); IPage<WarehousingRecordFormVO> warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page,qw);
for (WarehousingRecordFormVO warehousingRecordFormVO : warehousingRecordFormVOList) { List<WarehousingRecordFormVO> records = warehousingRecordFormVOPage.getRecords();
LambdaQueryWrapper<WarehousingContent> warehousingContentLambdaQueryWrapper = new LambdaQueryWrapper<>(); for (WarehousingRecordFormVO record : records) {
warehousingContentLambdaQueryWrapper.eq(WarehousingContent::getWarehousingRecordFormId, warehousingRecordFormVO.getId()); List<WarehousingContent> warehousingContents = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", record.getId()));
List<WarehousingContent> list = warehousingContentService.list(warehousingContentLambdaQueryWrapper); for (WarehousingContent warehousingContent : warehousingContents) {
Integer x = 0; Integer warehousingQuantity = warehousingContent.getWarehousingQuantity();
Integer y = 0;
for (WarehousingContent warehousingContent : list) {
Integer totalQuantity = warehousingContent.getTotalQuantity(); Integer totalQuantity = warehousingContent.getTotalQuantity();
if (record.getWarehousingQuantity()==null&record.getQuantityPurchased()==null){
if (totalQuantity != null) { record.setWarehousingQuantity(0);
x = x + totalQuantity; record.setQuantityPurchased(0);
}
record.setWarehousingQuantity(record.getWarehousingQuantity()+warehousingQuantity);
record.setQuantityPurchased(record.getQuantityPurchased()+totalQuantity);
} }
Integer warehousingQuantity = warehousingContent.getWarehousingQuantity();
if (warehousingQuantity != null) {
y = y + warehousingContent.getWarehousingQuantity();
} }
return warehousingRecordFormVOPage;
}
public List<PurchaseRequestPrintVO> getPurchaseRequestPrint(String id){
WarehousingRecordForm byId = warehousingRecordFormService.getById(id);
List<WarehousingContent> warehousingContentList = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", id));
PurchaseListDetails purchaseListDetails1 = purchaseListDetailsService.getById(warehousingContentList.get(0).getPurchaseListDetailsId());
DecentralizedRequest request = decentralizedRequestService.getOne(Wrappers.<DecentralizedRequest>query().eq("purchase_list_id", purchaseListDetails1.getPurchaseListId()));
if (request!=null){
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId());
List<DecentralizeDetails> decentralizeDetailsVOList = requestById.getDecentralizeDetailsVOList();
} }
warehousingRecordFormVO.setWarehousingQuantity(y);
warehousingRecordFormVO.setQuantityPurchased(x);
for (WarehousingContent warehousingContent : warehousingContentList) {
PurchaseListDetails purchaseListDetails = purchaseListDetailsService.getById(warehousingContent.getPurchaseListDetailsId());
String purchaseListId = purchaseListDetails.getPurchaseListId();
List<WarehousingBatchList> batchListList = warehousingBatchListService.list(Wrappers.<WarehousingBatchList>query().eq("warehousing_content_id", warehousingContent.getId()));
// DecentralizedRequest request = decentralizedRequestService.getOne(Wrappers.<DecentralizedRequest>query().eq("purchase_list_id", purchaseListId));
if (request!=null){
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId());
List<DecentralizeDetails> decentralizeDetailsVOList = requestById.getDecentralizeDetailsVOList();
for (DecentralizeDetails decentralizeDetail : decentralizeDetailsVOList) {
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO();
if (decentralizeDetail.getCategory().equals("标准物质")){
purchaseRequestPrintVO.setRemarks(decentralizeDetail.getRemarks());
purchaseRequestPrintVO.setQuantity(decentralizeDetail.getQuantity());
purchaseRequestPrintVO.setPurpose(decentralizeDetail.getPurpose());
purchaseRequestPrintVO.setSubtotal(decentralizeDetail.getUnitPrice()*decentralizeDetail.getQuantity());
purchaseRequestPrintVO.setApplicantName(requestById.getApplicantName());
purchaseRequestPrintVO.setReagentConsumableName(decentralizeDetail.getReagentConsumableName());
// purchaseRequestPrintVO.setSupplierName();
}}
} }
if (warehousingRecordFormVOList.size() != 0) {
PageUtils pageUtils = new PageUtils(); ProcurementContent procurementContent = procurementContentService.getById(purchaseListDetails.getProcurementContentId());
Page pages = pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), warehousingRecordFormVOList);
return pages;
} else return null;
} }
return
null;
}
// @Override
// public void PurchaseRequestPrintTablePDF(PurchaseRequestPrintVO purchaseRequestPrintVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
//
// System.out.println("PurchaseRequestPrintTablePDF.................");
//
// ReagentConsumables byId = reagentConsumablesService.getById(acceptanceRecordFormVO.getReagentConsumableId());
//
// String id = acceptanceRecordFormVO.getId();
//
// String applyFileName = null;
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
// if (byId.getCategory().equals("试剂") | byId.getCategory().equals("耗材")) {
//
// ossFile.fileGet("template" + "/" + "试剂耗材验收记录表模板.docx", bos);
//
// applyFileName = "试剂耗材验收记录表" + id;
// } else {
//
// ossFile.fileGet("template" + "/" + "标准物质验收记录表模板.docx", bos);
//
// applyFileName = "标准物质验收记录表" + id;
// }
//
//
// //-----------------------------
// // 生成 word 版本的 验收记录表
//
// byte[] templateArray = bos.toByteArray();
//
// ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
// bos.close();
//
// LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
//
// Configure config = Configure.builder().
// bind("voList", policy).build();
// /**
// * 循环表格
// */
// XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
// new HashMap<String, Object>() {{
// put("theSameBrandAndModel", acceptanceRecordFormVO.getTheSameBrandAndModel());
// }}
// );
// bis.close();
//
// ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
// template.write(fosWord);
// template.close();
//
// //------------
// ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
// fosWord.close();
//
// //MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
// MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
// Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
// fisWord.close();
//
//
// ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
// IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
// ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
// outPDF.close();
//
//
// ossFile.fileSave("document" + "/" + "acceptanceRecordForm" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
// isPDF.close();
//
//
// System.out.println(String.format("转换为 PDF 结束"));
//
// }
} }

@ -16,8 +16,7 @@ import java.time.LocalDateTime;
@ApiModel(value = "验收记录表VO") @ApiModel(value = "验收记录表VO")
public class AcceptanceRecordFormVO extends AcceptanceRecordForm { public class AcceptanceRecordFormVO extends AcceptanceRecordForm {
@ApiModelProperty(value = "(试剂耗材名称)")
private String reagentConsumableName;
@ApiModelProperty(value = "(供应商名称)") @ApiModelProperty(value = "(供应商名称)")
private String supplierName; private String supplierName;
@ -38,5 +37,11 @@ public class AcceptanceRecordFormVO extends AcceptanceRecordForm {
private String createName; private String createName;
private Boolean theSameBrandAndModelPrint;
private Boolean consistentQuantityPrint;
private Boolean packingInGoodConditionPrint;
private Boolean validityPeriodPrint;
private Boolean deliveryCyclePrint;
} }

@ -28,6 +28,10 @@ public class CentralizedRequestVO extends CentralizedRequest {
private String applicantName; private String applicantName;
private String auditorName;
private String type = "集中采购申请";

@ -20,8 +20,6 @@ public class ComplianceCheckVO extends ComplianceCheck {
@ApiModelProperty(value="(二级审核人名称)") @ApiModelProperty(value="(二级审核人名称)")
private String secondaryAuditorName; private String secondaryAuditorName;
@ApiModelProperty(value="(试剂耗材名称)")
private String reagentConsumableName;
@ApiModelProperty(value="(试剂耗材对象)") @ApiModelProperty(value="(试剂耗材对象)")
private ReagentConsumables reagentConsumables; private ReagentConsumables reagentConsumables;

@ -13,4 +13,6 @@ public class InstructionBookVO extends InstructionBook {
private String createName; private String createName;
private String number;
} }

@ -15,4 +15,11 @@ public class PeriodVerificationPlanVO extends PeriodVerificationPlan {
private String type = "期间核查计划"; private String type = "期间核查计划";
@ApiModelProperty(value = "(打印标签)")
private String P;
private String D;
private String F;
private Integer i;
} }

@ -26,7 +26,7 @@ public class PurchaseCatalogueVO extends PurchaseCatalogue {
private List<CatalogueDetails> catalogueDetailsListList; private List<CatalogueDetails> catalogueDetailsListList;
@ApiModelProperty(value="部门名称") @ApiModelProperty(value="部门名称")
private String orgName; private String department;
@ApiModelProperty(value="创建人名称") @ApiModelProperty(value="创建人名称")
private String createName; private String createName;

@ -0,0 +1,39 @@
package digital.laboratory.platform.reagent.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class PurchaseRequestPrintVO {
@ApiModelProperty(value="规格型号")
private String specificationAndModel;
@ApiModelProperty(value="试剂耗材名称")
private String reagentConsumableName;
@ApiModelProperty(value="供应商名称")
private String supplierName;
@ApiModelProperty(value="(批号)")
private String batchNumber;
@ApiModelProperty(value="(数量)")
private Integer quantity;
@ApiModelProperty(value="单价")
private Double unitPrice;
@ApiModelProperty(value="备注")
private String remarks;
@ApiModelProperty(value="申请人名称")
private String applicantName;
@ApiModelProperty(value="用途/购买理由")
private String purpose;
@ApiModelProperty(value="(小计)")
private Double subtotal;
}

@ -14,9 +14,6 @@ import java.util.List;
@ApiModel(value = "库存信息VO") @ApiModel(value = "库存信息VO")
public class ReagentConsumableInventoryVO extends ReagentConsumableInventory { public class ReagentConsumableInventoryVO extends ReagentConsumableInventory {
@ApiModelProperty(value="试剂耗材名称")
private String reagentConsumablesName;
@ApiModelProperty(value="批次信息数组") @ApiModelProperty(value="批次信息数组")
List<BatchDetailsVO> batchDetailsVOS; List<BatchDetailsVO> batchDetailsVOS;

@ -1,11 +1,19 @@
package digital.laboratory.platform.reagent.vo; package digital.laboratory.platform.reagent.vo;
import digital.laboratory.platform.reagent.entity.RequisitionRecord; import digital.laboratory.platform.reagent.entity.RequisitionRecord;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
public class RequisitionRecordVO extends RequisitionRecord { public class RequisitionRecordVO extends RequisitionRecord {
private String recipientName; private String recipientName;
private String reagentConsumableName; private String reagentConsumableName;
@ApiModelProperty(value = "领用时间")
private String dateOfClaims;
@ApiModelProperty(value = "序号")
private int i ;
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save