增加了批量验收、按批次出库等功能

main
杨海航 2 years ago
parent 782b953af6
commit b3e1f96fcd
  1. 0
      README.md
  2. 3523
      db/dlp_reagent_managment.sql
  3. 2
      src/main/java/digital/laboratory/platform/reagent/Interceptor/WebSecurityConfigurer.java
  4. 32
      src/main/java/digital/laboratory/platform/reagent/config/MinioConfig.java
  5. 122
      src/main/java/digital/laboratory/platform/reagent/config/QRCodeUtils.java
  6. 33
      src/main/java/digital/laboratory/platform/reagent/controller/AcceptanceRecordFormController.java
  7. 32
      src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java
  8. 4
      src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java
  9. 7
      src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java
  10. 29
      src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java
  11. 4
      src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java
  12. 89
      src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
  13. 77
      src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java
  14. 24
      src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApplicationController.java
  15. 20
      src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java
  16. 11
      src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java
  17. 1
      src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java
  18. 1
      src/main/java/digital/laboratory/platform/reagent/dto/AuditAndApproveDTO.java
  19. 3
      src/main/java/digital/laboratory/platform/reagent/dto/OutgoingContentsDTO.java
  20. 4
      src/main/java/digital/laboratory/platform/reagent/dto/PurchaseCatalogueDTO.java
  21. 4
      src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionDTO.java
  22. 2
      src/main/java/digital/laboratory/platform/reagent/entity/AcceptanceRecordForm.java
  23. 2
      src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java
  24. 7
      src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java
  25. 7
      src/main/java/digital/laboratory/platform/reagent/entity/CategoryTable.java
  26. 6
      src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java
  27. 2
      src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationImplementation.java
  28. 2
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java
  29. 2
      src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java
  30. 3
      src/main/java/digital/laboratory/platform/reagent/entity/RequisitionRecord.java
  31. 1
      src/main/java/digital/laboratory/platform/reagent/entity/ReviewAndApprove.java
  32. 4
      src/main/java/digital/laboratory/platform/reagent/entity/StandardReserveSolution.java
  33. 2
      src/main/java/digital/laboratory/platform/reagent/entity/WarehousingRecordForm.java
  34. 3
      src/main/java/digital/laboratory/platform/reagent/mapper/RequisitionRecordMapper.java
  35. 5
      src/main/java/digital/laboratory/platform/reagent/service/AcceptanceRecordFormService.java
  36. 7
      src/main/java/digital/laboratory/platform/reagent/service/ApplicationForUseService.java
  37. 2
      src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java
  38. 2
      src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java
  39. 8
      src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
  40. 2
      src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java
  41. 54
      src/main/java/digital/laboratory/platform/reagent/service/impl/AcceptanceRecordFormServiceImpl.java
  42. 92
      src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java
  43. 5
      src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java
  44. 9
      src/main/java/digital/laboratory/platform/reagent/service/impl/BlacklistServiceImpl.java
  45. 5
      src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java
  46. 14
      src/main/java/digital/laboratory/platform/reagent/service/impl/CategoryTableServiceImpl.java
  47. 78
      src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java
  48. 30
      src/main/java/digital/laboratory/platform/reagent/service/impl/CheckScheduleServiceImpl.java
  49. 37
      src/main/java/digital/laboratory/platform/reagent/service/impl/ComplianceCheckServiceImpl.java
  50. 6
      src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizeDetailsServiceImpl.java
  51. 32
      src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java
  52. 92
      src/main/java/digital/laboratory/platform/reagent/service/impl/DeliveryRegistrationFormServiceImpl.java
  53. 6
      src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java
  54. 23
      src/main/java/digital/laboratory/platform/reagent/service/impl/EvaluationFormServiceImpl.java
  55. 7
      src/main/java/digital/laboratory/platform/reagent/service/impl/InstructionBookServiceImpl.java
  56. 21
      src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationImplementationServiceImpl.java
  57. 11
      src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationPlanServiceImpl.java
  58. 3
      src/main/java/digital/laboratory/platform/reagent/service/impl/ProcurementContentServiceImpl.java
  59. 7
      src/main/java/digital/laboratory/platform/reagent/service/impl/ProvideServicesOrSuppliesServiceImpl.java
  60. 59
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java
  61. 3
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListDetailsServiceImpl.java
  62. 10
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java
  63. 61
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java
  64. 201
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java
  65. 4
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumablesServiceImpl.java
  66. 5
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumablesSetServiceImpl.java
  67. 4
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReferenceMaterialServiceImpl.java
  68. 5
      src/main/java/digital/laboratory/platform/reagent/service/impl/RequisitionRecordServiceImpl.java
  69. 41
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReviewAndApproveServiceImpl.java
  70. 7
      src/main/java/digital/laboratory/platform/reagent/service/impl/SolutionUseFormServiceImpl.java
  71. 7
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApplicationServiceImpl.java
  72. 14
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApprovalFormServiceImpl.java
  73. 278
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java
  74. 5
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardSolutionCurveServiceImpl.java
  75. 26
      src/main/java/digital/laboratory/platform/reagent/service/impl/SupplierInformationServiceImpl.java
  76. 3
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingBatchListServiceImpl.java
  77. 73
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java
  78. 20
      src/main/java/digital/laboratory/platform/reagent/status/DataStatus.java
  79. 24
      src/main/java/digital/laboratory/platform/reagent/task/MaturityCalculation.java
  80. 2
      src/main/java/digital/laboratory/platform/reagent/utils/PageUtils.java
  81. 162
      src/main/java/digital/laboratory/platform/reagent/utils/QRCodeUtils.java
  82. 14
      src/main/java/digital/laboratory/platform/reagent/utils/String2DateConverter.java
  83. 6
      src/main/java/digital/laboratory/platform/reagent/vo/AcceptanceRecordFormVO.java
  84. 1
      src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVO.java
  85. 1
      src/main/java/digital/laboratory/platform/reagent/vo/CheckScheduleVO.java
  86. 1
      src/main/java/digital/laboratory/platform/reagent/vo/ComplianceCheckVO.java
  87. 7
      src/main/java/digital/laboratory/platform/reagent/vo/EvaluationFormVO.java
  88. 1
      src/main/java/digital/laboratory/platform/reagent/vo/InstructionBookVO.java
  89. 2
      src/main/java/digital/laboratory/platform/reagent/vo/OutgoingContentsVO.java
  90. 2
      src/main/java/digital/laboratory/platform/reagent/vo/PeriodVerificationImplementationVO.java
  91. 2
      src/main/java/digital/laboratory/platform/reagent/vo/PeriodVerificationPlanVO.java
  92. 2
      src/main/java/digital/laboratory/platform/reagent/vo/PurchasingPlanVO.java
  93. 2
      src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java
  94. 5
      src/main/java/digital/laboratory/platform/reagent/vo/ReferenceMaterialVO.java
  95. 2
      src/main/java/digital/laboratory/platform/reagent/vo/RequisitionRecordVO.java
  96. 1
      src/main/java/digital/laboratory/platform/reagent/vo/StandardMaterialApprovalFormVO.java
  97. 11
      src/main/resources/mapper/AcceptanceRecordFormMapper.xml
  98. 2
      src/main/resources/mapper/CatalogueDetailsMapper.xml
  99. 4
      src/main/resources/mapper/CategoryTableMapper.xml
  100. 2
      src/main/resources/mapper/CentralizedRequestMapper.xml
  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

@ -1,4 +1,4 @@
package digital.laboratory.platform.reagent.config; package digital.laboratory.platform.reagent.Interceptor;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;

@ -1,32 +0,0 @@
//package digital.laboratory.platform.reagent.config;
//
//import digital.laboratory.platform.reagent.utils.MinioProp;
//import io.minio.MinioClient;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.context.properties.EnableConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * minio 核心配置类
// */
//@Configuration
//@EnableConfigurationProperties(MinioProp.class)
//public class MinioConfig {
//
// @Autowired
// private MinioProp minioProp;
//
// /**
// * 获取 MinioClient
// *
// * @return
// * @throws InvalidPortException
// * @throws InvalidEndpointException
// */
// @Bean
// public MinioClient minioClient() throws InvalidPortException, InvalidEndpointException {
// return new MinioClient(minioProp.getEndpoint(), minioProp.getAccesskey(), minioProp.getSecretKey());
// }
//}
//

@ -1,122 +0,0 @@
package digital.laboratory.platform.reagent.config;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.oned.Code128Writer;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import org.springframework.util.StringUtils;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.util.HashMap;
import java.util.Map;
public class QRCodeUtils {
//二维码
public static BufferedImage genQRCode(String content, int width, int height) {
if (!StringUtils.isEmpty(content)) {
HashMap<EncodeHintType, Comparable> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.MARGIN, 0);
try {
QRCodeWriter writer = new QRCodeWriter();
BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, width, height, hints);
BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
return bufferedImage;
} catch (Exception e) {
} finally {
}
}
return null;
}
//打印条形码
public static String getBarCode128ImageBase64(String content, int width, int height) {
try {
Map<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.MARGIN, 0);
int realWidth = getBarCode128NoPaddingWidth(width, content, width);
BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.CODE_128, realWidth, height, hints);
BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(bufferedImage, "png", os);
BASE64Encoder encoder = new BASE64Encoder();
String resultImage = new String("data:image/png;base64," + encoder.encode(os.toByteArray()));
return resultImage;
} catch (Exception e) {
return null;
}
}
private static int getBarCode128NoPaddingWidth(int expectWidth, String contents, int maxWidth) {
boolean[] code = new Code128Writer().encode(contents);
int inputWidth = code.length;
double outputWidth = (double) Math.max(expectWidth, inputWidth);
double multiple = outputWidth / inputWidth;
//优先取大的
int returnVal = 0;
int ceil = (int) Math.ceil(multiple);
if (inputWidth * ceil <= maxWidth) {
returnVal = inputWidth * ceil;
} else {
int floor = (int) Math.floor(multiple);
returnVal = inputWidth * floor;
}
return returnVal;
}
public static String getBarCode93ImageBase64(String content, int width, int height) {
try {
Map<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.MARGIN, 0);
int realWidth = getBarCode128NoPaddingWidth(width, content, width);
BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.CODE_93, realWidth, height, hints);
BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(bufferedImage, "png", os);
BASE64Encoder encoder = new BASE64Encoder();
String resultImage = new String("data:image/png;base64," + encoder.encode(os.toByteArray()));
return resultImage;
} catch (Exception e) {
return null;
}
}
/**
* 打印条码
*
* @param
* @return
*/
}

@ -86,7 +86,7 @@ public class AcceptanceRecordFormController {
WarehousingBatchList byId1 = warehousingBatchListService.getById(byId.getWarehousingBatchListId()); WarehousingBatchList byId1 = warehousingBatchListService.getById(byId.getWarehousingBatchListId());
WarehousingContent byId2 = warehousingContentService.getById(byId1.getWarehousingContentId()); WarehousingContent byId2 = warehousingContentService.getById(byId1.getWarehousingContentId());
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(byId2.getAcceptanceRecordFormId()); AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(byId2.getAcceptanceRecordFormId());
if (acceptanceRecordFormVO.getStatus()==4){ if (acceptanceRecordFormVO.getStatus() == 6) {
return R.ok(acceptanceRecordFormVO); return R.ok(acceptanceRecordFormVO);
} else return R.failed(null); } else return R.failed(null);
@ -107,15 +107,17 @@ public class AcceptanceRecordFormController {
@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, 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) { public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormPage(Page<AcceptanceRecordForm> page, Integer status, 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, Wrappers.<AcceptanceRecordForm>query() IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVOPage(page, Wrappers.<AcceptanceRecordForm>query()
.eq(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName) .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.ge(startTime != null, "create_time", startTime) .ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime) .le(endTime != null, "create_time", endTime)
.ne("status", 4) .ne("status", 4)
.eq(status != null, "status", status)
.orderByDesc("create_time")
); );
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)));
@ -135,11 +137,8 @@ public class AcceptanceRecordFormController {
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, Wrappers.<AcceptanceRecordForm>query() IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVOPage(page, Wrappers.<AcceptanceRecordForm>query()
.eq(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName) .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.eq("status", 4) .eq("status", 4)
.ge(startTime != null, "create_time", startTime) .ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime) .le(endTime != null, "create_time", endTime)
@ -173,6 +172,26 @@ public class AcceptanceRecordFormController {
} }
/**
* 批量验收
*
* @param acceptanceRecordFormDTOList 批量验收
* @return R
*/
@ApiOperation(value = "批量验收(验收记录表)", notes = "批量验收(验收记录表)")
@SysLog("批量验收")
@PutMapping("/culkCommit")
@PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_add')")
public R<String> culkCommit(@RequestBody List<AcceptanceRecordFormDTO> acceptanceRecordFormDTOList, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
acceptanceRecordFormService.culkCommit(acceptanceRecordFormDTOList, dlpUser);
return R.ok("批量验收成功");
}
/** /**
* 一级审核(验收记录表) * 一级审核(验收记录表)
* *

@ -9,7 +9,9 @@ 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.reagent.dto.ApplicationForUseDTO; import digital.laboratory.platform.reagent.dto.ApplicationForUseDTO;
import digital.laboratory.platform.reagent.entity.ApplicationForUse; import digital.laboratory.platform.reagent.entity.ApplicationForUse;
import digital.laboratory.platform.reagent.entity.ReagentConsumablesSet;
import digital.laboratory.platform.reagent.service.ApplicationForUseService; import digital.laboratory.platform.reagent.service.ApplicationForUseService;
import digital.laboratory.platform.reagent.service.ReagentConsumablesSetService;
import digital.laboratory.platform.reagent.vo.ApplicationForUseVO; import digital.laboratory.platform.reagent.vo.ApplicationForUseVO;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -45,6 +47,8 @@ public class ApplicationForUseController {
private final ApplicationForUseService applicationForUseService; private final ApplicationForUseService applicationForUseService;
private final ReagentConsumablesSetService reagentConsumablesSetService;
/** /**
* 通过id查询(试剂耗材领用申请表) * 通过id查询(试剂耗材领用申请表)
* *
@ -89,20 +93,20 @@ public class ApplicationForUseController {
/** /**
* 新增(试剂耗材领用申请表) * 新增(试剂耗材领用申请表)
* *
* @param applicationForUseDTOList (试剂耗材领用申请表) * @param applicationForUseDTO (试剂耗材领用申请表)
* @return R * @return R
*/ */
@ApiOperation(value = "新增(试剂耗材领用申请表)", notes = "新增(试剂耗材领用申请表)") @ApiOperation(value = "新增(试剂耗材领用申请表)", notes = "新增(试剂耗材领用申请表)")
@SysLog("新增(试剂耗材领用申请表)") @SysLog("新增(试剂耗材领用申请表)")
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_add')") @PreAuthorize("@pms.hasPermission('reagent_application_for_use_add')")
public R<ApplicationForUseVO> postAddObject(@RequestBody List<ApplicationForUseDTO> applicationForUseDTOList, HttpServletRequest theHttpServletRequest) { public R<ApplicationForUseVO> postAddObject(@RequestBody ApplicationForUseDTO applicationForUseDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
ApplicationForUseVO applicationForUse = applicationForUseService.addApplication(applicationForUseDTOList, dlpUser); ApplicationForUseVO applicationForUse = applicationForUseService.addApplication(applicationForUseDTO, dlpUser);
if (applicationForUse != null) { if (applicationForUse != null) {
return R.ok(applicationForUse, "保存成功"); return R.ok(applicationForUse, "保存成功");
@ -112,25 +116,27 @@ public class ApplicationForUseController {
/** /**
* 修改(试剂耗材领用申请表) * 修改(试剂耗材领用申请表)
* *
* @param applicationForUseDTOList (试剂耗材领用申请表) * @param id (试剂耗材领用申请表)
* @return R * @return R
*/ */
@ApiOperation(value = "修改(试剂耗材领用申请表)", notes = "修改(试剂耗材领用申请表)") @ApiOperation(value = "修改(试剂耗材领用申请表)", notes = "修改(试剂耗材领用申请表)")
@SysLog("修改(试剂耗材领用申请表)") @SysLog("修改(试剂耗材领用申请表)")
@PutMapping @PutMapping
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_edit')") @PreAuthorize("@pms.hasPermission('reagent_application_for_use_edit')")
public R<ApplicationForUseVO> putUpdateById(@RequestBody List<ApplicationForUseDTO> applicationForUseDTOList, HttpServletRequest theHttpServletRequest) { public R<String> putUpdateById(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();
ApplicationForUseVO applicationForUse = applicationForUseService.editApplication(applicationForUseDTOList, dlpUser); ReagentConsumablesSet byId = reagentConsumablesSetService.getById(id);
if ( reagentConsumablesSetService.updateById(byId)){
return R.ok("修改成功");
}else {
return R.failed("修改失败");
}}
if (applicationForUse != null) {
return R.ok(applicationForUse, "修改成功");
} else return R.failed("修改失败");
}
/** /**
* 通过id删除(试剂耗材领用申请表) * 通过id删除(试剂耗材领用申请表)
@ -155,20 +161,20 @@ public class ApplicationForUseController {
/** /**
* 提交试剂耗材领用申请表 * 提交试剂耗材领用申请表
* *
* @param applicationForUseDTOList (试剂耗材领用申请表) * @param id (试剂耗材领用申请表)
* @return R * @return R
*/ */
@ApiOperation(value = "提交试剂耗材领用申请表", notes = "提交试剂耗材领用申请表") @ApiOperation(value = "提交试剂耗材领用申请表", notes = "提交试剂耗材领用申请表")
@SysLog("修改试剂耗材领用申请表") @SysLog("修改试剂耗材领用申请表")
@PostMapping("/commit") @PostMapping("/commit")
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_commit')") @PreAuthorize("@pms.hasPermission('reagent_application_for_use_commit')")
public R<ApplicationForUseVO> commitById(@RequestBody List<ApplicationForUseDTO> applicationForUseDTOList, HttpServletRequest theHttpServletRequest) { public R<ApplicationForUseVO> 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();
ApplicationForUseVO applicationForUse = applicationForUseService.commitApplication(applicationForUseDTOList, dlpUser); ApplicationForUseVO applicationForUse = applicationForUseService.commitApplication(id, dlpUser);
if (applicationForUse != null) { if (applicationForUse != null) {
return R.ok(applicationForUse, "提交成功"); return R.ok(applicationForUse, "提交成功");

@ -190,13 +190,13 @@ public class CentralizedRequestController {
@SysLog("提交集中采购申请") @SysLog("提交集中采购申请")
@PostMapping("/commit") @PostMapping("/commit")
@PreAuthorize("@pms.hasPermission('reagent_centralized_request_commit')") @PreAuthorize("@pms.hasPermission('reagent_centralized_request_commit')")
public R<CentralizedRequest> postCommitObject(@RequestBody List<CentralizedRequestDTO> centralizedRequestDTOList, HttpServletRequest theHttpServletRequest) { public R<CentralizedRequest> postCommitObject(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();
CentralizedRequest centralizedRequest = centralizedRequestService.commitRequest(centralizedRequestDTOList, dlpUser); CentralizedRequest centralizedRequest = centralizedRequestService.commitRequest(id, dlpUser);
if (centralizedRequest != null) { if (centralizedRequest != null) {
return R.ok(centralizedRequest, "提交成功"); return R.ok(centralizedRequest, "提交成功");

@ -105,7 +105,7 @@ 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, String rid, @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) { public R<IPage<ComplianceCheckVO>> getComplianceCheckPage(Page<ComplianceCheck> page, String rid, String status, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, 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();
@ -113,7 +113,7 @@ public class ComplianceCheckController {
IPage<ComplianceCheckVO> complianceCheckList = complianceCheckService.getComplianceCheckVOPage(page, Wrappers.<ComplianceCheck>query() IPage<ComplianceCheckVO> complianceCheckList = complianceCheckService.getComplianceCheckVOPage(page, Wrappers.<ComplianceCheck>query()
.eq("reference_material_id", rid) .eq("reference_material_id", rid)
.eq("status", 3) .eq("status", 6)
.orderByDesc("create_time")); .orderByDesc("create_time"));
return R.ok(complianceCheckList); return R.ok(complianceCheckList);
} }
@ -122,7 +122,8 @@ public class ComplianceCheckController {
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName) .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.ge(startTime != null, "create_time", startTime) .ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime) .le(endTime != null, "create_time", endTime)
.orderByDesc("create_time").or() .eq(StrUtil.isNotBlank(status), "status", status)
.orderByDesc("create_time")
); );

@ -83,14 +83,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 rid, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") java.time.LocalDate endTime, String referenceMaterialName, HttpServletRequest theHttpServletRequest) { public R<IPage<PeriodVerificationImplementationVO>> getPeriodVerificationImplementationPage(Page<PeriodVerificationImplementation> page, String commitStatus, String rid, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") java.time.LocalDate endTime, String referenceMaterialName, 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 (StrUtil.isNotBlank(rid)) { if (StrUtil.isNotBlank(rid)) {
IPage<PeriodVerificationImplementationVO> periodVerificationImplementationList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.<PeriodVerificationImplementation>query() IPage<PeriodVerificationImplementationVO> periodVerificationImplementationList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.<PeriodVerificationImplementation>query()
.eq("commit_status", 2) .eq("commit_status", 6)
.eq(StrUtil.isNotBlank(rid), "reference_material_id", rid) .eq(StrUtil.isNotBlank(rid), "reference_material_id", rid)
.orderByDesc("create_time") .orderByDesc("create_time")
); );
@ -103,6 +103,7 @@ public class PeriodVerificationImplementationController {
.ge(startTime != null, "create_time", startTime) .ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime) .le(endTime != null, "create_time", endTime)
.eq(StrUtil.isNotBlank(rid), "reference_material_id", rid) .eq(StrUtil.isNotBlank(rid), "reference_material_id", rid)
.eq(StrUtil.isNotBlank(commitStatus), "commit_status", commitStatus)
.orderByDesc("create_time") .orderByDesc("create_time")
); );
return R.ok(periodVerificationImplementationSList); return R.ok(periodVerificationImplementationSList);
@ -133,30 +134,6 @@ public class PeriodVerificationImplementationController {
} }
} }
// /**
// * 通过id删除(标准物质期间核查实施情况及结果记录表)
// * @param periodVerificationImplementationId id
// * @return R
// */
// @ApiOperation(value = "通过id删除(标准物质期间核查实施情况及结果记录表)", notes = "通过id删除(标准物质期间核查实施情况及结果记录表)")
// @SysLog("通过id删除(标准物质期间核查实施情况及结果记录表)" )
// @DeleteMapping("/{periodVerificationImplementationId}" )
// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_del')" )
// public R<PeriodVerificationImplementation> deleteById(@PathVariable String periodVerificationImplementationId, HttpServletRequest theHttpServletRequest) {
// Principal principal = theHttpServletRequest.getUserPrincipal();
// DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
//
// PeriodVerificationImplementation oldPeriodVerificationImplementation = periodVerificationImplementationService.getById(periodVerificationImplementationId);
//
// if (periodVerificationImplementationService.removeById(periodVerificationImplementationId)) {
// return R.ok(oldPeriodVerificationImplementation, "对象删除成功");
// }
// else {
// return R.failed(oldPeriodVerificationImplementation, "对象删除失败");
// }
//
// }
/** /**
* 提交(标准物质期间核查实施情况及结果记录表) * 提交(标准物质期间核查实施情况及结果记录表)
* *

@ -94,13 +94,13 @@ public class PurchaseCatalogueController {
@ApiOperation(value = "分页查询已发布的采购目录明细", notes = "分页查询已发布的采购目录明细") @ApiOperation(value = "分页查询已发布的采购目录明细", notes = "分页查询已发布的采购目录明细")
@GetMapping("/page") @GetMapping("/page")
@PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_pages')") @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_pages')")
public R<List<CatalogueDetails>> getPurchaseCataloguePage(String name, HttpServletRequest theHttpServletRequest) { public R<List<CatalogueDetails>> getPurchaseCataloguePage(String name,Integer category, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
List<CatalogueDetails> list = purchaseCatalogueService.getList(name); List<CatalogueDetails> list = purchaseCatalogueService.getList(name,category);
return R.ok(list); return R.ok(list);

@ -1,22 +1,20 @@
package digital.laboratory.platform.reagent.controller; package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
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.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.config.QRCodeUtils;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.service.ReagentConsumableInventoryService; import digital.laboratory.platform.reagent.service.ReagentConsumableInventoryService;
import digital.laboratory.platform.reagent.service.ReferenceMaterialService; import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
import digital.laboratory.platform.reagent.utils.QRCodeUtils;
import digital.laboratory.platform.reagent.vo.*; import digital.laboratory.platform.reagent.vo.*;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -31,8 +29,6 @@ import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -85,7 +81,7 @@ public class ReagentConsumableInventoryController {
*/ */
@ApiOperation(value = "标准物质列表", notes = "标准物质列表") @ApiOperation(value = "标准物质列表", notes = "标准物质列表")
@GetMapping("/RList") @GetMapping("/RList")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')") // @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
public R<Page<ReagentConsumableInventoryFullVO>> getReagentConsumableInventoryPage(Integer current, Integer size, String reagentConsumableName, Integer referenceMaterialStatus, HttpServletRequest theHttpServletRequest) { public R<Page<ReagentConsumableInventoryFullVO>> getReagentConsumableInventoryPage(Integer current, Integer size, String reagentConsumableName, Integer referenceMaterialStatus, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@ -93,14 +89,15 @@ public class ReagentConsumableInventoryController {
QueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryQueryWrapper = new QueryWrapper<>(); QueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryQueryWrapper = new QueryWrapper<>();
QueryWrapper<ReferenceMaterial> referenceMaterialQueryWrapper = new QueryWrapper<>(); QueryWrapper<ReferenceMaterial> referenceMaterialQueryWrapper = new QueryWrapper<>();
String number = reagentConsumableName;
if (reagentConsumableName != null) { if (reagentConsumableName != null) {
reagentConsumableInventoryQueryWrapper.like("reagent_consumable_name", reagentConsumableName); reagentConsumableInventoryQueryWrapper.like("reagent_consumable_name", reagentConsumableName);
} }
Page<ReagentConsumableInventoryFullVO> allList = reagentConsumableInventoryService.getAllList(current, size, reagentConsumableInventoryQueryWrapper, referenceMaterialStatus); Page<ReagentConsumableInventoryFullVO> allList = reagentConsumableInventoryService.getAllList(current, size, reagentConsumableInventoryQueryWrapper, referenceMaterialStatus, number);
return R.ok(allList); return R.ok(allList);
// return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory))); // return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory)));
} }
@ -108,7 +105,7 @@ 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<IPage<ReagentConsumableInventoryVO>> getReagentConsumableInventoryList(Page<ReagentConsumableInventory> page, Integer warning, String remark, String reagentConsumableName, HttpServletRequest theHttpServletRequest) { public R<IPage<ReagentConsumableInventoryVO>> getReagentConsumableInventoryList(Page<ReagentConsumableInventory> page, Integer warning, String remark, 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();
@ -135,7 +132,7 @@ 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<IPage<ReagentConsumableInventoryVO>> getList(Page page, String reagentConsumableName, Integer warning, String remark, HttpServletRequest theHttpServletRequest) { public R<IPage<ReagentConsumableInventoryVO>> getList(Page page, String reagentConsumableName, Integer warning, String remark, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@ -167,7 +164,7 @@ public class ReagentConsumableInventoryController {
*/ */
@ApiOperation(value = "试剂耗材列表", notes = "试剂耗材列表") @ApiOperation(value = "试剂耗材列表", notes = "试剂耗材列表")
@GetMapping("/MList") @GetMapping("/MList")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')") // @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
public R<IPage<ReagentConsumableInventoryFullVO>> getReferenceMaterialVOList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) { public R<IPage<ReagentConsumableInventoryFullVO>> getReferenceMaterialVOList(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();
@ -191,7 +188,7 @@ public class ReagentConsumableInventoryController {
*/ */
@ApiOperation(value = "试剂耗材/标准物质集合列表", notes = "试剂耗材/标准物质集合列表") @ApiOperation(value = "试剂耗材/标准物质集合列表", notes = "试剂耗材/标准物质集合列表")
@GetMapping("/full") @GetMapping("/full")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')") // @PreAuthorize("@pms.hasPermission(' ')")
public R<List<ReagentConsumableInventoryFullVO>> getReagentConsumableInventoryFull(String category, String name, HttpServletRequest theHttpServletRequest) { public R<List<ReagentConsumableInventoryFullVO>> getReagentConsumableInventoryFull(String category, 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();
@ -244,14 +241,14 @@ public class ReagentConsumableInventoryController {
} }
/** /**
* 生成 BARCODE 图像 * 标准物质打印二维码
* *
* @param code QRCODE字符串 * @param code QRCODE字符串
* @return R<CaseEventVO> * @return R<CaseEventVO>
*/ */
@ApiOperation(value = "生成条形码", notes = "生成条形码") @ApiOperation(value = "标准物质打印二维码", notes = "标准物质打印二维码")
@GetMapping("/code") @GetMapping("/code")
@PreAuthorize("@pms.hasAnyPermission('reagent_reagent_consumable_inventory_get')") // @PreAuthorize("@pms.hasAnyPermission('reagent_reagent_consumable_inventory_get')")
public String getBarCodeImageBase64(String code, HttpServletResponse httpServletResponse) throws IOException { public String getBarCodeImageBase64(String code, HttpServletResponse httpServletResponse) throws IOException {
@ -261,10 +258,25 @@ public class ReagentConsumableInventoryController {
} }
/** /**
* 生成 BARCODE 图像 * 标准储备溶液打印二维码
* *
* @param code QRCODE字符串 * @param code QRCODE字符串
* @return R<CaseEventVO> */
@ApiOperation(value = "标准储备溶液打印二维码", notes = "标准储备溶液打印二维码")
@GetMapping("/codeSolution")
// @PreAuthorize("@pms.hasAnyPermission('reagent_reagent_consumable_inventory_get')")
public String printSolutionTag(String code, HttpServletResponse httpServletResponse) throws IOException {
return reagentConsumableInventoryService.printSolutionTag(code);
}
/**
* 扫码录入物品编码
*
* @param code 物品二维码
*/ */
@ApiOperation(value = "扫码录入物品编码", notes = "扫码录入物品编码") @ApiOperation(value = "扫码录入物品编码", notes = "扫码录入物品编码")
@PutMapping("/code") @PutMapping("/code")
@ -276,5 +288,48 @@ public class ReagentConsumableInventoryController {
return R.ok("录入成功"); return R.ok("录入成功");
} }
/**
* 录入标准物质自带的二维码信息
*
* @param code 物品二维码
* @param id 标准物质ID
*/
@ApiOperation(value = "录入标准物质自带的二维码信息", notes = "录入标准物质自带的二维码信息")
@PutMapping("/RMCode")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
public R<String> setRMCode(String id, String code, HttpServletResponse httpServletResponse) {
reagentConsumableInventoryService.setRMCode(id, code);
return R.ok("录入成功");
}
/**
* 通过扫码获取标准物质所有信息
*
* @param id id
*/
@ApiOperation(value = "", notes = "通过id,获取标准物质所有信息")
@GetMapping("/getByCode")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
public R<ReagentConsumableInventoryFullVO> getByCode(String id, String number, HttpServletResponse httpServletResponse) {
if (StrUtil.isNotBlank(number)) {
ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(Wrappers.<ReferenceMaterial>query().eq("number", number));
if (referenceMaterial != null) {
return R.ok(reagentConsumableInventoryService.getByCode(referenceMaterial.getId()));
} else {
return R.failed("未能查询到该标准物质的详细信息");
}
}
ReagentConsumableInventoryFullVO byCode = reagentConsumableInventoryService.getByCode(id);
return R.ok(byCode);
}
} }

@ -1,5 +1,6 @@
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;
@ -31,7 +32,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
* 这里写什么: * 这里写什么:
* 为前端提供数据, 接受前端的数据 * 为前端提供数据, 接受前端的数据
@ -78,8 +79,10 @@ public class RequisitionRecordController {
e.printStackTrace(); e.printStackTrace();
} }
} }
/** /**
* 分页查询 * 分页查询
*
* @param page 分页对象 * @param page 分页对象
* @param requisitionRecord (试剂耗材领用记录表) * @param requisitionRecord (试剂耗材领用记录表)
* @return * @return
@ -87,83 +90,17 @@ public class RequisitionRecordController {
@ApiOperation(value = "分页查询", notes = "分页查询") @ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page") @GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_requisition_record_get')" ) // @PreAuthorize("@pms.hasPermission('reagent_requisition_record_get')" )
public R<IPage<RequisitionRecordVO>> getRequisitionRecordPage(Page<RequisitionRecord> page, RequisitionRecord requisitionRecord, HttpServletRequest theHttpServletRequest) { public R<IPage<RequisitionRecordVO>> getRequisitionRecordPage(Page<RequisitionRecord> page, String name, RequisitionRecord requisitionRecord, 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<RequisitionRecordVO> requisitionRecordSList = requisitionRecordService.getRequisitionRecordVOPage(page, Wrappers.<RequisitionRecord>query() IPage<RequisitionRecordVO> requisitionRecordSList = requisitionRecordService.getRequisitionRecordVOPage(page, Wrappers.<RequisitionRecord>query()
.orderByDesc("create_time") .like(StrUtil.isNotBlank(name), "reagent_consumable_name", name)
.orderByDesc("date_of_claim")
); );
return R.ok(requisitionRecordSList); return R.ok(requisitionRecordSList);
// return R.ok(requisitionRecordService.page(page, Wrappers.query(requisitionRecord))); // return R.ok(requisitionRecordService.page(page, Wrappers.query(requisitionRecord)));
} }
// /**
// * 新增(试剂耗材领用记录表)
// * @param requisitionRecord (试剂耗材领用记录表)
// * @return R
// */
// @ApiOperation(value = "新增(试剂耗材领用记录表)", notes = "新增(试剂耗材领用记录表)")
// @SysLog("新增(试剂耗材领用记录表)" )
// @PostMapping
// @PreAuthorize("@pms.hasPermission('reagent_requisition_record_add')" )
// public R<RequisitionRecord> postAddObject(@RequestBody RequisitionRecord requisitionRecord, HttpServletRequest theHttpServletRequest) {
// Principal principal = theHttpServletRequest.getUserPrincipal();
// DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
//
// requisitionRecord.setRequisitionRecordId(IdWorker.get32UUID().toUpperCase());
// if (requisitionRecordService.save(requisitionRecord)) {
// return R.ok(requisitionRecord, "对象创建成功");
// }
// else {
// return R.failed(requisitionRecord, "对象创建失败");
// }
// }
//
// /**
// * 修改(试剂耗材领用记录表)
// * @param requisitionRecord (试剂耗材领用记录表)
// * @return R
// */
// @ApiOperation(value = "修改(试剂耗材领用记录表)", notes = "修改(试剂耗材领用记录表)")
// @SysLog("修改(试剂耗材领用记录表)" )
// @PutMapping
// @PreAuthorize("@pms.hasPermission('reagent_requisition_record_edit')" )
// public R<RequisitionRecord> putUpdateById(@RequestBody RequisitionRecord requisitionRecord, HttpServletRequest theHttpServletRequest) {
// Principal principal = theHttpServletRequest.getUserPrincipal();
// DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
//
// if (requisitionRecordService.updateById(requisitionRecord)) {
// return R.ok(requisitionRecord, "保存对象成功");
// }
// else {
// return R.failed(requisitionRecord, "保存对象失败");
// }
// }
//
// /**
// * 通过id删除(试剂耗材领用记录表)
// * @param requisitionRecordId id
// * @return R
// */
// @ApiOperation(value = "通过id删除(试剂耗材领用记录表)", notes = "通过id删除(试剂耗材领用记录表)")
// @SysLog("通过id删除(试剂耗材领用记录表)" )
// @DeleteMapping("/{requisitionRecordId}" )
// @PreAuthorize("@pms.hasPermission('reagent_requisition_record_del')" )
// public R<RequisitionRecord> deleteById(@PathVariable String requisitionRecordId, HttpServletRequest theHttpServletRequest) {
// Principal principal = theHttpServletRequest.getUserPrincipal();
// DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
//
// RequisitionRecord oldRequisitionRecord = requisitionRecordService.getById(requisitionRecordId);
//
// if (requisitionRecordService.removeById(requisitionRecordId)) {
// return R.ok(oldRequisitionRecord, "对象删除成功");
// }
// else {
// return R.failed(oldRequisitionRecord, "对象删除失败");
// }
//
// }
} }

@ -62,13 +62,26 @@ public class StandardMaterialApplicationController {
* @param id, 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<StandardMaterialApplicationVO> getById(String id, HttpServletRequest theHttpServletRequest) { public R<StandardMaterialApplicationVO> getById(String id, String number, 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 (StrUtil.isNotBlank(number)) {
StandardMaterialApplication reference_material_number = standardMaterialApplicationService.getOne(Wrappers.<StandardMaterialApplication>query().eq(StrUtil.isNotBlank(number), "reference_material_number", number)
.eq("status", 0));
if (reference_material_number != null) {
StandardMaterialApplicationVO standardMaterialApplicationVO = standardMaterialApplicationService.getStandardMaterialApplicationVO(reference_material_number.getStandardMaterialApplicationId());
return R.ok(standardMaterialApplicationVO);
} else return R.failed("没有查询到该标准物质领用/归还的信息");
}
StandardMaterialApplicationVO standardMaterialApplicationVO = standardMaterialApplicationService.getStandardMaterialApplicationVO(id); StandardMaterialApplicationVO standardMaterialApplicationVO = standardMaterialApplicationService.getStandardMaterialApplicationVO(id);
return R.ok(standardMaterialApplicationVO); return R.ok(standardMaterialApplicationVO);
@ -79,18 +92,18 @@ public class StandardMaterialApplicationController {
* 分页查询 * 分页查询
* *
* @param page 分页对象 * @param page 分页对象
* @param standardMaterialApplication (标准物质领用/归还登记表)
* @return * @return
*/ */
@ApiOperation(value = "领用分页查询", notes = "领用分页查询") @ApiOperation(value = "领用分页查询", notes = "领用分页查询")
@GetMapping("/page") @GetMapping("/page")
@PreAuthorize("@pms.hasPermission('reagent_standard_material_application_page')") @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_page')")
public R<IPage<StandardMaterialApplicationVO>> getStandardMaterialApplicationPage(Page<StandardMaterialApplication> page, StandardMaterialApplication standardMaterialApplication, HttpServletRequest theHttpServletRequest) { public R<IPage<StandardMaterialApplicationVO>> getStandardMaterialApplicationPage(Page<StandardMaterialApplication> 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<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getPage(page, Wrappers.<StandardMaterialApplication>query() IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getPage(page, Wrappers.<StandardMaterialApplication>query()
.orderByDesc("create_time") .like(StrUtil.isNotBlank(name), "reference_substance_name", name)
.orderByDesc("date_of_claim")
); );
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)));
@ -100,7 +113,6 @@ public class StandardMaterialApplicationController {
* 分页查询 * 分页查询
* *
* @param page 分页对象 * @param page 分页对象
* @return * @return
*/ */
@ApiOperation(value = "归还任务分页查询", notes = "归还任务分页查询") @ApiOperation(value = "归还任务分页查询", notes = "归还任务分页查询")

@ -16,7 +16,6 @@ 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.vo.SolutionUseFormVO; import digital.laboratory.platform.reagent.vo.SolutionUseFormVO;
import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO; import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO; import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO;
@ -103,8 +102,6 @@ public class StandardReserveSolutionController {
} }
/** /**
* 新增(标准储备溶液配制及使用记录表) * 新增(标准储备溶液配制及使用记录表)
* *
@ -155,13 +152,28 @@ public class StandardReserveSolutionController {
@ApiOperation(value = "通过id查询标准储备溶液入库记录", notes = "通过id查询标准储备溶液入库记录") @ApiOperation(value = "通过id查询标准储备溶液入库记录", notes = "通过id查询标准储备溶液入库记录")
@GetMapping("/full") @GetMapping("/full")
@PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_full')") @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_full')")
public R<StandardReserveSolutionVO> getFullVOById(String id, HttpServletRequest theHttpServletRequest) { public R<StandardReserveSolutionVO> getFullVOById(String id, String number, 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 (StrUtil.isNotBlank(number)) {
StandardReserveSolution solution_numbering = standardReserveSolutionService.getOne(Wrappers.<StandardReserveSolution>query().eq("solution_numbering", number)
.eq("status", 0));
if (solution_numbering != null) {
StandardReserveSolutionFullVO byFullVOId = standardReserveSolutionService.getByFullVOId(solution_numbering.getId());
return R.ok(byFullVOId);
}else {
return R.failed("未能查询到该标准储备溶液的入库信息");
}
}
StandardReserveSolutionFullVO byFullVOId = standardReserveSolutionService.getByFullVOId(id); StandardReserveSolutionFullVO byFullVOId = standardReserveSolutionService.getByFullVOId(id);
return R.ok(byFullVOId); return R.ok(byFullVOId);
//return R.ok(standardReserveSolutionService.getById(standardReserveSolutionId)); //return R.ok(standardReserveSolutionService.getById(standardReserveSolutionId));
} }

@ -86,7 +86,7 @@ public class WarehousingRecordFormController {
@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<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) { public R<IPage<WarehousingRecordFormVO>> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, String status, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
@ -94,6 +94,7 @@ public class WarehousingRecordFormController {
IPage<WarehousingRecordFormVO> warehousingRecordFormVOList = warehousingRecordFormService.getWarehousingRecordFormVOPage(page, Wrappers.<WarehousingRecordForm>query() IPage<WarehousingRecordFormVO> warehousingRecordFormVOList = warehousingRecordFormService.getWarehousingRecordFormVOPage(page, Wrappers.<WarehousingRecordForm>query()
.ge(startTime != null, "create_time", startTime) .ge(startTime != null, "create_time", startTime)
.eq(StrUtil.isNotBlank(status), "status", status)
.le(endTime != null, "create_time", endTime)); .le(endTime != null, "create_time", endTime));
return R.ok(warehousingRecordFormVOList); return R.ok(warehousingRecordFormVOList);
@ -129,20 +130,20 @@ public class WarehousingRecordFormController {
/** /**
* 新增签收记录表 * 新增签收记录表
* *
* @param warehousingRecordFormDTOList 签收记录表 * @param warehousingRecordFormDTO 签收记录表
* @return R * @return R
*/ */
@ApiOperation(value = "新增签收记录表", notes = "新增签收记录表") @ApiOperation(value = "新增签收记录表", notes = "新增签收记录表")
@SysLog("新增签收记录表") @SysLog("新增签收记录表")
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_add')") // @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_add')")
public R<WarehousingRecordFormVO> postAddObject(@RequestBody List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, HttpServletRequest theHttpServletRequest) { public R<WarehousingRecordFormVO> postAddObject(@RequestBody WarehousingRecordFormDTO warehousingRecordFormDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
WarehousingRecordFormVO warehousingRecordFormVO = warehousingRecordFormService.addFormById(warehousingRecordFormDTOList, dlpUser); WarehousingRecordFormVO warehousingRecordFormVO = warehousingRecordFormService.addFormById(warehousingRecordFormDTO, dlpUser);
if (warehousingRecordFormVO != null) { if (warehousingRecordFormVO != null) {
return R.ok(warehousingRecordFormVO, "入库成功"); return R.ok(warehousingRecordFormVO, "入库成功");

@ -12,7 +12,6 @@ public class ApplicationForUseDTO {
@ApiModelProperty(value = "(标准物质编号)") @ApiModelProperty(value = "(标准物质编号)")
private String referenceMaterialId; private String referenceMaterialId;
@ApiModelProperty(value = "(备注)") @ApiModelProperty(value = "(备注)")
private String remarks; private String remarks;

@ -19,5 +19,4 @@ public class AuditAndApproveDTO {
private String approveOpinion; private String approveOpinion;
} }

@ -39,4 +39,7 @@ public class OutgoingContentsDTO {
@ApiModelProperty(value = "(位置信息)") @ApiModelProperty(value = "(位置信息)")
private String location; private String location;
@ApiModelProperty(value="(领用物品明细ID)")
private String reagentConsumablesSetId;
} }

@ -12,6 +12,10 @@ import lombok.NoArgsConstructor;
@ApiModel(value = "采购目录DTO") @ApiModel(value = "采购目录DTO")
public class PurchaseCatalogueDTO { public class PurchaseCatalogueDTO {
@ApiModelProperty(value="纯度等级")
private String purityGrade;
/** /**
* (品牌) * (品牌)
*/ */

@ -9,7 +9,7 @@ import java.time.LocalDateTime;
public class StandardReserveSolutionDTO { public class StandardReserveSolutionDTO {
@ApiModelProperty(value = "(定容体积(mL))") @ApiModelProperty(value = "(定容体积(mL))")
private String constantVolume; private Double constantVolume;
@ApiModelProperty(value = "(配置浓度(mg/mL))") @ApiModelProperty(value = "(配置浓度(mg/mL))")
private String configurationConcentration; private String configurationConcentration;
@ -21,7 +21,7 @@ public class StandardReserveSolutionDTO {
private String referenceMaterialNumber; private String referenceMaterialNumber;
@ApiModelProperty(value="(标准物质称取量)") @ApiModelProperty(value="(标准物质称取量)")
private String referenceMaterialScale; private Double referenceMaterialScale;
@ApiModelProperty(value="(备注)") @ApiModelProperty(value="(备注)")
private String remarks; private String remarks;

@ -49,7 +49,7 @@ public class AcceptanceRecordForm extends BaseEntity {
/** /**
* (部门负责人审核意见) * (部门负责人审核意见)
*/ */
@ApiModelProperty(value = "(三审核意见)") @ApiModelProperty(value = "(三审核意见)")
private String auditOpinionOfThreeLevel; private String auditOpinionOfThreeLevel;
@ApiModelProperty(value = "(提交时间)") @ApiModelProperty(value = "(提交时间)")

@ -29,7 +29,7 @@ public class BatchDetails extends BaseEntity {
* (批次) * (批次)
*/ */
@ApiModelProperty(value="(批次)") @ApiModelProperty(value="(批次)")
private Integer batch; private String batch;
/** /**
* (批号) * (批号)

@ -26,6 +26,13 @@ import lombok.EqualsAndHashCode;
@ApiModel(value = "(采购目录明细)") @ApiModel(value = "(采购目录明细)")
public class CatalogueDetails extends BaseEntity { public class CatalogueDetails extends BaseEntity {
/**
* 纯度等级
*/
@ApiModelProperty(value="纯度等级")
private String purityGrade;
/** /**
* (品牌) * (品牌)
*/ */

@ -9,6 +9,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.List;
/** /**
* *
@ -23,7 +25,7 @@ import lombok.EqualsAndHashCode;
public class CategoryTable extends BaseEntity { public class CategoryTable extends BaseEntity {
/** /**
* type * 类别
*/ */
@ApiModelProperty(value="类别") @ApiModelProperty(value="类别")
private String category; private String category;
@ -36,11 +38,10 @@ public class CategoryTable extends BaseEntity {
private String id; private String id;
/** /**
* species * 种类
*/ */
@ApiModelProperty(value="种类") @ApiModelProperty(value="种类")
private String species; private String species;
} }

@ -30,6 +30,12 @@ public class OutgoingContents extends BaseEntity {
@ApiModelProperty(value="(试剂耗材出库登记表ID)") @ApiModelProperty(value="(试剂耗材出库登记表ID)")
private String deliveryRegistrationFormId; private String deliveryRegistrationFormId;
/**
* (领用物品明细ID)
*/
@ApiModelProperty(value="(领用物品明细ID)")
private String reagentConsumablesSetId;
/** /**
* (出库用途) * (出库用途)
*/ */

@ -63,7 +63,7 @@ public class PeriodVerificationImplementation extends BaseEntity {
/** /**
* (提交状态) * (提交状态)
*/ */
@ApiModelProperty(value="(提交状态(0:未提交,1:已提交,2:审核通过,-1:审核未通过))") @ApiModelProperty(value="(提交状态(0:未核查,1:已核查,2:审核通过,-2:审核未通过))")
private Integer commitStatus; private Integer commitStatus;
/** /**

@ -26,6 +26,8 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "试剂耗材库存") @ApiModel(value = "试剂耗材库存")
public class ReagentConsumableInventory extends BaseEntity { public class ReagentConsumableInventory extends BaseEntity {
@ApiModelProperty(value="纯度等级")
private String purityGrade;
@ApiModelProperty(value = "CAS-号") @ApiModelProperty(value = "CAS-号")
private String casNumber; private String casNumber;

@ -24,6 +24,8 @@ import lombok.EqualsAndHashCode;
@ApiModel(value = "(试剂耗材类)") @ApiModel(value = "(试剂耗材类)")
public class ReagentConsumables extends BaseEntity { public class ReagentConsumables extends BaseEntity {
@ApiModelProperty(value="纯度等级")
private String purityGrade;
/** /**
* 品牌 * 品牌
*/ */

@ -68,6 +68,9 @@ public class RequisitionRecord extends BaseEntity {
private String id; private String id;
private String reagentConsumableName;
/** /**
* requisitionRecordId * requisitionRecordId

@ -38,5 +38,6 @@ public class ReviewAndApprove {
@ApiModelProperty(value="指导书数组") @ApiModelProperty(value="指导书数组")
List<InstructionBookVO> instructionBookList; List<InstructionBookVO> instructionBookList;
@ApiModelProperty(value="集中采购申请数组")
List<CentralizedRequestVO> centralizedRequestVOList; List<CentralizedRequestVO> centralizedRequestVOList;
} }

@ -49,7 +49,7 @@ public class StandardReserveSolution extends BaseEntity {
* (定容体积mL) * (定容体积mL)
*/ */
@ApiModelProperty(value="(定容体积(mL))") @ApiModelProperty(value="(定容体积(mL))")
private String constantVolume; private Double constantVolume;
/** /**
* (配制人ID) * (配制人ID)
*/ */
@ -74,7 +74,7 @@ public class StandardReserveSolution extends BaseEntity {
* (标准物质称取量) * (标准物质称取量)
*/ */
@ApiModelProperty(value="(标准物质称取量)") @ApiModelProperty(value="(标准物质称取量)")
private String referenceMaterialScale; private Double referenceMaterialScale;
/** /**
* (备注) * (备注)

@ -33,7 +33,7 @@ public class WarehousingRecordForm extends BaseEntity {
/** /**
* 状态 * 状态
*/ */
@ApiModelProperty(value="状态") @ApiModelProperty(value="状态 0:未入库 1:未完成入库 2:已完成入库")
private Integer status; private Integer status;
/** /**

@ -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.RequisitionRecord; import digital.laboratory.platform.reagent.entity.RequisitionRecord;
import digital.laboratory.platform.reagent.vo.RequisitionRecordVO; import digital.laboratory.platform.reagent.vo.RequisitionRecordVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -19,7 +20,7 @@ import java.util.List;
@Mapper @Mapper
public interface RequisitionRecordMapper extends BaseMapper<RequisitionRecord> { public interface RequisitionRecordMapper extends BaseMapper<RequisitionRecord> {
IPage<RequisitionRecordVO> getRequisitionRecordVOPage (IPage<RequisitionRecord> page, QueryWrapper<RequisitionRecord> qw); IPage<RequisitionRecordVO> getRequisitionRecordVOPage (IPage<RequisitionRecord> page, @Param(Constants.WRAPPER) QueryWrapper<RequisitionRecord> qw);
List<RequisitionRecordVO> getRequisitionRecordVO (String id); List<RequisitionRecordVO> getRequisitionRecordVO (String id);

@ -8,9 +8,11 @@ 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.vo.AcceptanceRecordFormVO; import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* (验收记录表)服务类 * (验收记录表)服务类
@ -20,6 +22,9 @@ import javax.servlet.http.HttpServletResponse;
*/ */
public interface AcceptanceRecordFormService extends IService<AcceptanceRecordForm> { public interface AcceptanceRecordFormService extends IService<AcceptanceRecordForm> {
@Transactional
void culkCommit(List<AcceptanceRecordFormDTO> acceptanceRecordFormDTOList, DLPUser dlpUser);
AcceptanceRecordForm commitForm(AcceptanceRecordFormDTO acceptanceRecordFormDTO, DLPUser dlpUser); AcceptanceRecordForm commitForm(AcceptanceRecordFormDTO acceptanceRecordFormDTO, DLPUser dlpUser);
AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId); AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId);

@ -24,13 +24,10 @@ public interface ApplicationForUseService extends IService<ApplicationForUse> {
List<ApplicationForUseVO> getApplicationForUseVOList (QueryWrapper<ApplicationForUse> qw); List<ApplicationForUseVO> getApplicationForUseVOList (QueryWrapper<ApplicationForUse> qw);
ApplicationForUseVO addApplication(List<ApplicationForUseDTO> applicationForUseDTOList, DLPUser dlpUser); ApplicationForUseVO addApplication(ApplicationForUseDTO applicationForUseDTO , DLPUser dlpUser);
//
ApplicationForUseVO editApplication (List<ApplicationForUseDTO> applicationForUseDTOList, DLPUser dlpUser);
//提交领用申请记录 //提交领用申请记录
ApplicationForUseVO commitApplication(List<ApplicationForUseDTO> applicationForUseDTOList, DLPUser dlpUser); ApplicationForUseVO commitApplication(String id, DLPUser dlpUser);
Boolean delApplication(String applicationForUseId); Boolean delApplication(String applicationForUseId);
} }

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

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

@ -30,7 +30,9 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
ReagentConsumableInventory reduceById(String reagentConsumableId, Integer quantity); ReagentConsumableInventory reduceById(String reagentConsumableId, Integer quantity);
Page<ReagentConsumableInventoryFullVO> getAllList(Integer current, Integer size, QueryWrapper<ReagentConsumableInventory> qw,Integer status); Page<ReagentConsumableInventoryFullVO> getAllList(Integer current, Integer size, QueryWrapper<ReagentConsumableInventory> qw,Integer status,String number);
ReagentConsumableInventoryFullVO getByCode(String id);
//分页查询试剂耗材 //分页查询试剂耗材
IPage<ReagentConsumableInventoryFullVO> getAllRM(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw); IPage<ReagentConsumableInventoryFullVO> getAllRM(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw);
@ -44,5 +46,9 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
//试剂/耗材扫描物品编码进行持久化 //试剂/耗材扫描物品编码进行持久化
void setCode(String id, String code); void setCode(String id, String code);
void setRMCode(String id, String code);
String buildCodeLabelContent(String code); String buildCodeLabelContent(String code);
String printSolutionTag(String id);
} }

@ -26,6 +26,6 @@ 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(WarehousingRecordFormDTO warehousingRecordFormDTO, DLPUser dlpUser);
IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm>qw); IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm>qw);
} }

@ -15,7 +15,7 @@ import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService; 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.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.config.PageUtils; import digital.laboratory.platform.reagent.utils.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;
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm; import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm;
@ -31,6 +31,7 @@ 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.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -50,9 +51,6 @@ import java.util.List;
@SuppressWarnings("all") @SuppressWarnings("all")
public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecordFormMapper, AcceptanceRecordForm> implements AcceptanceRecordFormService { public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecordFormMapper, AcceptanceRecordForm> implements AcceptanceRecordFormService {
@Autowired
private AcceptanceRecordFormService acceptanceRecordFormService;
@Autowired @Autowired
private BlacklistService blacklistService; private BlacklistService blacklistService;
@ -65,10 +63,20 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
@Autowired @Autowired
private RemoteWord2PDFService remoteWord2PDFService; private RemoteWord2PDFService remoteWord2PDFService;
@Transactional
@Override
public void culkCommit(List<AcceptanceRecordFormDTO> acceptanceRecordFormDTOList,DLPUser dlpUser){
for (AcceptanceRecordFormDTO acceptanceRecordFormDTO : acceptanceRecordFormDTOList) {
AcceptanceRecordForm acceptanceRecordForm = this.commitForm(acceptanceRecordFormDTO, dlpUser);
}
}
@Override @Override
public AcceptanceRecordForm commitForm(AcceptanceRecordFormDTO acceptanceRecordFormDTO, DLPUser dlpUser) { public AcceptanceRecordForm commitForm(AcceptanceRecordFormDTO acceptanceRecordFormDTO, DLPUser dlpUser) {
AcceptanceRecordForm byId = acceptanceRecordFormService.getById(acceptanceRecordFormDTO.getAcceptanceRecordFormId()); AcceptanceRecordForm byId = this.getById(acceptanceRecordFormDTO.getAcceptanceRecordFormId());
//将审核审批信息清空 //将审核审批信息清空
if (byId.getStatus() == -2) { if (byId.getStatus() == -2) {
@ -81,7 +89,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()); byId.setDateOfAcceptance(LocalDateTime.now());
if (acceptanceRecordFormService.updateById(byId)) { byId.setCreateBy(dlpUser.getId());
if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
throw new RuntimeException(String.format("重新提交失败")); throw new RuntimeException(String.format("重新提交失败"));
@ -101,7 +110,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()); byId.setDateOfAcceptance(LocalDateTime.now());
if (acceptanceRecordFormService.updateById(byId)) { byId.setCreateBy(dlpUser.getId());
if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
throw new RuntimeException(String.format("重新提交失败")); throw new RuntimeException(String.format("重新提交失败"));
@ -125,22 +135,20 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
byId.setCommitTime(LocalDateTime.now()); byId.setCommitTime(LocalDateTime.now());
byId.setStatus(1); byId.setStatus(1);
byId.setDateOfAcceptance(LocalDateTime.now()); byId.setDateOfAcceptance(LocalDateTime.now());
if (acceptanceRecordFormService.updateById(byId)) { byId.setCreateBy(dlpUser.getId());
if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
throw new RuntimeException(String.format("重新提交失败")); throw new RuntimeException(String.format("重新提交失败"));
} }
} }
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId); BeanUtils.copyProperties(acceptanceRecordFormDTO, byId);
byId.setUserName(dlpUser.getName()); byId.setUserName(dlpUser.getName());
byId.setCommitTime(LocalDateTime.now()); byId.setCommitTime(LocalDateTime.now());
byId.setStatus(1); byId.setStatus(1);
byId.setCreateBy(dlpUser.getId());
byId.setDateOfAcceptance(LocalDateTime.now()); byId.setDateOfAcceptance(LocalDateTime.now());
if (acceptanceRecordFormService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
throw new RuntimeException(String.format("保存失败")); throw new RuntimeException(String.format("保存失败"));
@ -164,7 +172,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
acceptanceRecordForm.setStatus(0); acceptanceRecordForm.setStatus(0);
if ((acceptanceRecordFormService.save(acceptanceRecordForm))) { if ((this.save(acceptanceRecordForm))) {
return acceptanceRecordForm; return acceptanceRecordForm;
@ -195,7 +203,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getStatus, 4); acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getStatus, 4);
List<AcceptanceRecordForm> list = acceptanceRecordFormService.list(acceptanceRecordFormLambdaQueryWrapper); List<AcceptanceRecordForm> list = this.list(acceptanceRecordFormLambdaQueryWrapper);
ArrayList<AcceptanceRecordFormVO> acceptanceRecordFormVOS = new ArrayList<>(); ArrayList<AcceptanceRecordFormVO> acceptanceRecordFormVOS = new ArrayList<>();
@ -203,7 +211,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
for (AcceptanceRecordForm acceptanceRecordForm : list) { for (AcceptanceRecordForm acceptanceRecordForm : list) {
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId()); AcceptanceRecordFormVO acceptanceRecordFormVO = this.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
acceptanceRecordFormVOS.add(acceptanceRecordFormVO); acceptanceRecordFormVOS.add(acceptanceRecordFormVO);
} }
@ -230,7 +238,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
@Override//一级审核 @Override//一级审核
public AcceptanceRecordForm primaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public AcceptanceRecordForm primaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
AcceptanceRecordForm byId = acceptanceRecordFormService.getById(auditAndApproveDTO.getUuId()); AcceptanceRecordForm byId = this.getById(auditAndApproveDTO.getUuId());
if (byId.getStatus() != 1) { if (byId.getStatus() != 1) {
throw new RuntimeException(String.format("当前状态不能审核")); throw new RuntimeException(String.format("当前状态不能审核"));
@ -245,7 +253,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
} else byId.setStatus(-2); } else byId.setStatus(-2);
if (acceptanceRecordFormService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }
@ -253,7 +261,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
@Override//二级审核 @Override//二级审核
public AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
AcceptanceRecordForm byId = acceptanceRecordFormService.getById(auditAndApproveDTO.getUuId()); AcceptanceRecordForm byId = this.getById(auditAndApproveDTO.getUuId());
if (byId.getStatus() != 2) { if (byId.getStatus() != 2) {
throw new RuntimeException(String.format("当前状态不能审核")); throw new RuntimeException(String.format("当前状态不能审核"));
@ -267,7 +275,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
byId.setStatus(3); byId.setStatus(3);
} else byId.setStatus(-3); } else byId.setStatus(-3);
if (acceptanceRecordFormService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }
@ -275,7 +283,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
@Override//三级审核 @Override//三级审核
public AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
AcceptanceRecordForm byId = acceptanceRecordFormService.getById(auditAndApproveDTO.getUuId()); AcceptanceRecordForm byId = this.getById(auditAndApproveDTO.getUuId());
if (byId.getStatus() != 3) { if (byId.getStatus() != 3) {
throw new RuntimeException(String.format("当前状态不能审核")); throw new RuntimeException(String.format("当前状态不能审核"));
@ -291,10 +299,10 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
blacklistService.addListById2(byId.getReagentConsumableId(), byId.getSupplierId()); blacklistService.addListById2(byId.getReagentConsumableId(), byId.getSupplierId());
} }
byId.setStatus(4); byId.setStatus(6);
} else byId.setStatus(-4); } else byId.setStatus(-4);
if (acceptanceRecordFormService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }

@ -35,8 +35,6 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
@Autowired @Autowired
private ReagentConsumablesSetService reagentConsumablesSetService; private ReagentConsumablesSetService reagentConsumablesSetService;
@Autowired
private ApplicationForUseService applicationForUseService;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@ -75,7 +73,7 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
for (ApplicationForUseVO record : records) { for (ApplicationForUseVO record : records) {
ApplicationForUseVO applicationForUseVO = applicationForUseService.getApplicationForUseVO(record.getId()); ApplicationForUseVO applicationForUseVO = this.getApplicationForUseVO(record.getId());
BeanUtils.copyProperties(applicationForUseVO, record); BeanUtils.copyProperties(applicationForUseVO, record);
} }
@ -90,19 +88,23 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
@Transactional @Transactional
@Override//创建领用申请表(试剂耗材领用、标准物质领用、标准溶液领用) @Override//创建领用申请表(试剂耗材领用、标准物质领用、标准溶液领用)
public ApplicationForUseVO addApplication(List<ApplicationForUseDTO> applicationForUseDTOList, DLPUser dlpUser) { public ApplicationForUseVO addApplication(ApplicationForUseDTO applicationForUseDTO, DLPUser dlpUser) {
//录入领用申请表
ApplicationForUse applicationForUse = new ApplicationForUse(); ApplicationForUse applicationForUse = new ApplicationForUse();
if (applicationForUseDTO.getApplicationForUseId() != null & (this.getById(applicationForUseDTO.getApplicationForUseId()) != null
)) {
applicationForUse = this.getById(applicationForUseDTO.getApplicationForUseId());
//录入领用申请表
} else {
applicationForUse.setId(IdWorker.get32UUID().toUpperCase()); applicationForUse.setId(IdWorker.get32UUID().toUpperCase());
applicationForUse.setStatus(0); applicationForUse.setStatus(0);
applicationForUse.setRecipientId(dlpUser.getId()); applicationForUse.setRecipientId(dlpUser.getId());
}
List<ReagentConsumablesSet> reagentConsumablesSets = new ArrayList<>();
//录入领用申请内容 //录入领用申请内容
for (ApplicationForUseDTO applicationForUseDTO : applicationForUseDTOList) {
//生成领用登记表集合 //生成领用登记表集合
ReagentConsumablesSet reagentConsumablesSet = new ReagentConsumablesSet(); ReagentConsumablesSet reagentConsumablesSet = new ReagentConsumablesSet();
@ -115,9 +117,7 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
if (applicationForUseDTO.getReferenceMaterialId() != null) { if (applicationForUseDTO.getReferenceMaterialId() != null) {
reagentConsumablesSet.setReferenceMaterialId(applicationForUseDTO.getReferenceMaterialId()); reagentConsumablesSet.setReferenceMaterialId(applicationForUseDTO.getReferenceMaterialId());
} }
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, applicationForUseDTO.getReagentConsumableId()); reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, applicationForUseDTO.getReagentConsumableId());
@ -126,46 +126,23 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
Integer totalQuantity = one.getTotalQuantity(); Integer totalQuantity = one.getTotalQuantity();
reagentConsumablesSets.add(reagentConsumablesSet);
if (reagentConsumablesSet.getQuantity() > totalQuantity) { if (reagentConsumablesSet.getQuantity() > totalQuantity) {
throw new RuntimeException(String.format("领用数量不能大于库存量")); throw new RuntimeException(String.format("领用数量不能大于库存量"));
} }
} if (this.save(applicationForUse) & reagentConsumablesSetService.save(reagentConsumablesSet)
if (applicationForUseService.save(applicationForUse) & reagentConsumablesSetService.saveBatch(reagentConsumablesSets)
) { ) {
ApplicationForUseVO applicationForUseVO = applicationForUseService.getApplicationForUseVO(applicationForUse.getId()); ApplicationForUseVO applicationForUseVO = this.getApplicationForUseVO(applicationForUse.getId());
return applicationForUseVO; return applicationForUseVO;
} else return null; } else return null;
} }
@Transactional
@Override//修改领用申请表
public ApplicationForUseVO editApplication(List<ApplicationForUseDTO> applicationForUseDTOList, DLPUser dlpUser) {
ApplicationForUse applicationForUse = applicationForUseService.getById(applicationForUseDTOList.get(0).getApplicationForUseId());
//删除领用申请明细
applicationForUseService.delApplication(applicationForUse.getId());
ApplicationForUse applicationForUse1 = applicationForUseService.addApplication(applicationForUseDTOList, dlpUser);
if (applicationForUse1 != null) {
ApplicationForUseVO applicationForUseVO = applicationForUseService.getApplicationForUseVO(applicationForUse1.getId());
return applicationForUseVO;
} else throw new RuntimeException(String.format("保存失败"));
}
@Override//提交领用申请记录 @Override//提交领用申请记录
@Transactional @Transactional
public ApplicationForUseVO commitApplication(String id, DLPUser dlpUser) {
public ApplicationForUseVO commitApplication(List<ApplicationForUseDTO> applicationForUseDTOList, DLPUser dlpUser) { ApplicationForUse applicationForUse = this.getById(id);
if (applicationForUseDTOList.get(0).getApplicationForUseId() == null) {
ApplicationForUse applicationForUse = applicationForUseService.addApplication(applicationForUseDTOList, dlpUser);
applicationForUse.setStatus(1); applicationForUse.setStatus(1);
@ -175,52 +152,21 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
applicationForUse.setDateOfCollection(LocalDateTime.now()); applicationForUse.setDateOfCollection(LocalDateTime.now());
LambdaQueryWrapper<ReagentConsumablesSet> reagentConsumablesSetLambdaQueryWrapper = new LambdaQueryWrapper<>(); this.updateById(applicationForUse);
reagentConsumablesSetLambdaQueryWrapper.eq(ReagentConsumablesSet::getApplicationForUseId, applicationForUse.getId());
List<ReagentConsumablesSet> list = reagentConsumablesSetService.list(reagentConsumablesSetLambdaQueryWrapper);
LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>();
applicationForUseService.updateById(applicationForUse);
deliveryRegistrationFormService.addFrom(applicationForUse.getId()); deliveryRegistrationFormService.addFrom(applicationForUse.getId());
ApplicationForUseVO applicationForUseVO = applicationForUseService.getApplicationForUseVO(applicationForUse.getId()); ApplicationForUseVO applicationForUseVO = this.getApplicationForUseVO(applicationForUse.getId());
return applicationForUseVO; return applicationForUseVO;
} else {
LambdaQueryWrapper<ApplicationForUse> applicationForUseLambdaQueryWrapper = new LambdaQueryWrapper<>();
applicationForUseLambdaQueryWrapper.eq(ApplicationForUse::getId, applicationForUseDTOList.get(0).getApplicationForUseId());
ApplicationForUse applicationForUse = applicationForUseService.getOne(applicationForUseLambdaQueryWrapper);
applicationForUse.setStatus(1);
applicationForUse.setDateOfCollection(LocalDateTime.now());
String code = getCode();
applicationForUse.setClaimCode(code);
applicationForUseService.updateById(applicationForUse);
deliveryRegistrationFormService.addFrom(applicationForUse.getId());
ApplicationForUseVO applicationForUseVO = applicationForUseService.getApplicationForUseVO(applicationForUse.getId());
return applicationForUseVO;
}
} }
@Override//通过ID删除领用申请表(标准物质领用/归还登记表) @Override//通过ID删除领用申请表(标准物质领用/归还登记表)
@Transactional @Transactional
public Boolean delApplication(String applicationForUseId) { public Boolean delApplication(String applicationForUseId) {
ApplicationForUse applicationForUse = applicationForUseService.getById(applicationForUseId); ApplicationForUse applicationForUse = this.getById(applicationForUseId);
if (applicationForUse.getStatus() == 0) { if (applicationForUse.getStatus() == 0) {
@ -230,7 +176,7 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
List<ReagentConsumablesSet> list = reagentConsumablesSetService.list(reagentConsumablesSetLambdaQueryWrapper); List<ReagentConsumablesSet> list = reagentConsumablesSetService.list(reagentConsumablesSetLambdaQueryWrapper);
return reagentConsumablesSetService.removeBatchByIds(list) & applicationForUseService.removeById(applicationForUse); return reagentConsumablesSetService.removeBatchByIds(list) & this.removeById(applicationForUse);
} else throw new RuntimeException(String.format("当前状态不能删除")); } else throw new RuntimeException(String.format("当前状态不能删除"));
} }
@ -245,7 +191,7 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
//判断随机数是否重复 //判断随机数是否重复
applicationForUseQueryWrapper.eq("claim_code", substring); applicationForUseQueryWrapper.eq("claim_code", substring);
if (applicationForUseService.getOne(applicationForUseQueryWrapper) != null) { if (this.getOne(applicationForUseQueryWrapper) != null) {
substring = random.substring(random.length() - 6); substring = random.substring(random.length() - 6);

@ -31,9 +31,6 @@ import java.util.List;
@Service @Service
public class BatchDetailsServiceImpl extends ServiceImpl<BatchDetailsMapper, BatchDetails> implements BatchDetailsService { public class BatchDetailsServiceImpl extends ServiceImpl<BatchDetailsMapper, BatchDetails> implements BatchDetailsService {
@Autowired
private BatchDetailsService batchDetailsService;
@Autowired @Autowired
private ReagentConsumableInventoryService reagentConsumableInventoryService; private ReagentConsumableInventoryService reagentConsumableInventoryService;
@ -50,7 +47,7 @@ public class BatchDetailsServiceImpl extends ServiceImpl<BatchDetailsMapper, Bat
batchDetailsLambdaQueryWrapper.eq(BatchDetails::getReagentConsumableInventoryId,reagentConsumableInventoryId) batchDetailsLambdaQueryWrapper.eq(BatchDetails::getReagentConsumableInventoryId,reagentConsumableInventoryId)
.eq(BatchDetails::getServiceStatus,1); .eq(BatchDetails::getServiceStatus,1);
List<BatchDetails> list = batchDetailsService.list(batchDetailsLambdaQueryWrapper); List<BatchDetails> list = this.list(batchDetailsLambdaQueryWrapper);
ReagentConsumableInventory byId = reagentConsumableInventoryService.getById(reagentConsumableInventoryId); ReagentConsumableInventory byId = reagentConsumableInventoryService.getById(reagentConsumableInventoryId);

@ -24,9 +24,6 @@ import java.util.List;
@Service @Service
public class BlacklistServiceImpl extends ServiceImpl<BlacklistMapper, Blacklist> implements BlacklistService { public class BlacklistServiceImpl extends ServiceImpl<BlacklistMapper, Blacklist> implements BlacklistService {
@Autowired
private BlacklistServiceImpl blacklistService;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@ -40,7 +37,7 @@ public class BlacklistServiceImpl extends ServiceImpl<BlacklistMapper, Blacklist
blacklist.setResultsOfComplianceCheck(false); blacklist.setResultsOfComplianceCheck(false);
blacklist.setReagentConsumableId(reagentConsumableId); blacklist.setReagentConsumableId(reagentConsumableId);
if (blacklistService.save(blacklist)) { if (this.save(blacklist)) {
return blacklist; return blacklist;
} else return null; } else return null;
@ -55,7 +52,7 @@ public class BlacklistServiceImpl extends ServiceImpl<BlacklistMapper, Blacklist
blacklist.setSupplierId(supplierId); blacklist.setSupplierId(supplierId);
blacklist.setReagentConsumableId(reagentConsumableId); blacklist.setReagentConsumableId(reagentConsumableId);
if (blacklistService.save(blacklist)) { if (this.save(blacklist)) {
return blacklist; return blacklist;
} else return null; } else return null;
@ -68,7 +65,7 @@ public class BlacklistServiceImpl extends ServiceImpl<BlacklistMapper, Blacklist
blacklistLambdaQueryWrapper.eq(Blacklist::getSupplierId, supplierInformationId); blacklistLambdaQueryWrapper.eq(Blacklist::getSupplierId, supplierInformationId);
List<Blacklist> list = blacklistService.list(blacklistLambdaQueryWrapper); List<Blacklist> list = this.list(blacklistLambdaQueryWrapper);
List<BlackListVO> blackListVOS = new ArrayList<>(); List<BlackListVO> blackListVOS = new ArrayList<>();

@ -1,6 +1,7 @@
package digital.laboratory.platform.reagent.service.impl; package digital.laboratory.platform.reagent.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import digital.laboratory.platform.reagent.entity.CatalogueDetails; import digital.laboratory.platform.reagent.entity.CatalogueDetails;
import digital.laboratory.platform.reagent.mapper.CatalogueDetailsMapper; import digital.laboratory.platform.reagent.mapper.CatalogueDetailsMapper;
@ -20,15 +21,13 @@ import java.util.List;
@Service @Service
public class CatalogueDetailsServiceImpl extends ServiceImpl<CatalogueDetailsMapper, CatalogueDetails> implements CatalogueDetailsService { public class CatalogueDetailsServiceImpl extends ServiceImpl<CatalogueDetailsMapper, CatalogueDetails> implements CatalogueDetailsService {
@Autowired
private CatalogueDetailsService catalogueDetailsService;
@Override @Override
public List<CatalogueDetails> getCatalogueDetailsList(String purchaseCatalogueId) { public List<CatalogueDetails> getCatalogueDetailsList(String purchaseCatalogueId) {
LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
List<CatalogueDetails> list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId)); List<CatalogueDetails> list = this.list(Wrappers.<CatalogueDetails>query().eq("purchase_catalogue_id",purchaseCatalogueId).orderByDesc("create_time"));
return list; return list;

@ -2,6 +2,7 @@ package digital.laboratory.platform.reagent.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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 digital.laboratory.platform.reagent.entity.CategoryTable; import digital.laboratory.platform.reagent.entity.CategoryTable;
import digital.laboratory.platform.reagent.mapper.CategoryTableMapper; import digital.laboratory.platform.reagent.mapper.CategoryTableMapper;
@ -21,8 +22,6 @@ import java.util.List;
@SuppressWarnings("all") @SuppressWarnings("all")
public class CategoryTableServiceImpl extends ServiceImpl<CategoryTableMapper, CategoryTable> implements CategoryTableService { public class CategoryTableServiceImpl extends ServiceImpl<CategoryTableMapper, CategoryTable> implements CategoryTableService {
@Autowired
private CategoryTableService categoryTableService;
@Override @Override
public CategoryTable addSpecies(String category, String species) { public CategoryTable addSpecies(String category, String species) {
@ -33,7 +32,7 @@ public class CategoryTableServiceImpl extends ServiceImpl<CategoryTableMapper, C
categoryTableLambdaQueryWrapper.eq(CategoryTable::getCategory, category); categoryTableLambdaQueryWrapper.eq(CategoryTable::getCategory, category);
CategoryTable one = categoryTableService.getOne(categoryTableLambdaQueryWrapper); CategoryTable one = this.getOne(categoryTableLambdaQueryWrapper);
if (one == null) { if (one == null) {
@ -45,7 +44,7 @@ public class CategoryTableServiceImpl extends ServiceImpl<CategoryTableMapper, C
categoryTable.setCategory(category); categoryTable.setCategory(category);
categoryTableService.save(categoryTable); this.save(categoryTable);
return categoryTable; return categoryTable;
} }
@ -53,13 +52,12 @@ public class CategoryTableServiceImpl extends ServiceImpl<CategoryTableMapper, C
} }
@Override @Override
public Boolean delSpeciesById(String categoryTableId) { public Boolean delSpeciesById(String categoryTableId) {
CategoryTable byId = categoryTableService.getById(categoryTableId); CategoryTable byId = this.getById(categoryTableId);
return categoryTableService.removeById(byId); return this.removeById(byId);
} }
@Override @Override
@ -69,7 +67,7 @@ public class CategoryTableServiceImpl extends ServiceImpl<CategoryTableMapper, C
typeTableLambdaQueryWrapper.eq(CategoryTable::getCategory, category); typeTableLambdaQueryWrapper.eq(CategoryTable::getCategory, category);
List<CategoryTable> list = categoryTableService.list(typeTableLambdaQueryWrapper); List<CategoryTable> list = this.list(typeTableLambdaQueryWrapper);
return list; return list;
} }

@ -46,10 +46,6 @@ import java.util.List;
@Service @Service
@SuppressWarnings("all") @SuppressWarnings("all")
public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedRequestMapper, CentralizedRequest> implements CentralizedRequestService { public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedRequestMapper, CentralizedRequest> implements CentralizedRequestService {
@Autowired
private CentralizedRequestService centralizedRequestService;
@Autowired @Autowired
private DetailsOfCentralizedService detailsOfCentralizedService; private DetailsOfCentralizedService detailsOfCentralizedService;
@ -84,6 +80,12 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
@Override//增加集中采购申请 @Override//增加集中采购申请
public CentralizedRequest addRequest(List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser) { public CentralizedRequest addRequest(List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser) {
String centralizedRequestId = centralizedRequestDTOList.get(0).getCentralizedRequestId();
List<DetailsOfCentralized> detailsOfCentralizedList = new ArrayList<>();
if (centralizedRequestId == null) {
CentralizedRequest centralizedRequest = new CentralizedRequest(); CentralizedRequest centralizedRequest = new CentralizedRequest();
centralizedRequest.setApplicantId(dlpUser.getId()); centralizedRequest.setApplicantId(dlpUser.getId());
@ -95,55 +97,67 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
centralizedRequest.setApplicantName(dlpUser.getName()); centralizedRequest.setApplicantName(dlpUser.getName());
List<DetailsOfCentralized> detailsOfCentralizedList = new ArrayList<>(); for (CentralizedRequestDTO centralizedRequestDTO : centralizedRequestDTOList) {
//将DTO赋值给明细表
for (CentralizedRequestDTO centralizedRequestDto : centralizedRequestDTOList) {
DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized(); DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized();
BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized); BeanUtils.copyProperties(centralizedRequestDTO, detailsOfCentralized);
detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase()); detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase());
detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getId()); detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getId());
detailsOfCentralizedList.add(detailsOfCentralized); detailsOfCentralizedList.add(detailsOfCentralized);
} }
if (centralizedRequestService.save(centralizedRequest) && detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) {
if (this.save(centralizedRequest) && detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) {
return centralizedRequest; return centralizedRequest;
} else return null; } else return null;
}
@Override//提交申请 //将DTO赋值给明细表
public CentralizedRequest commitRequest(List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser) {
if (centralizedRequestDTOList.get(0).getCentralizedRequestId() == null) {
CentralizedRequest centralizedRequest = centralizedRequestService.addRequest(centralizedRequestDTOList, dlpUser); } else {
centralizedRequest.setDateOfApplication(LocalDateTime.now()); CentralizedRequest centralizedRequest = this.getById(centralizedRequestId);
centralizedRequest.setStatus(1);
if (centralizedRequestService.updateById(centralizedRequest)) { for (CentralizedRequestDTO centralizedRequestDTO : centralizedRequestDTOList) {
return centralizedRequest;
} else return null;
} else {
CentralizedRequest byId = centralizedRequestService.getById(centralizedRequestDTOList.get(0).getCentralizedRequestId()); DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized();
byId.setDateOfApplication(LocalDateTime.now()); BeanUtils.copyProperties(centralizedRequestDTO, detailsOfCentralized);
byId.setStatus(1); detailsOfCentralized.setId(IdWorker.get32UUID().toUpperCase());
detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getId());
detailsOfCentralizedList.add(detailsOfCentralized);
}
if (detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) {
return centralizedRequest;
if (centralizedRequestService.updateById(byId)) {
return byId;
} else return null; } else return null;
} }
} }
@Override//提交申请
public CentralizedRequest commitRequest(String id, DLPUser dlpUser) {
CentralizedRequest byId = this.getById(id);
byId.setStatus(1);
byId.setDateOfApplication(LocalDateTime.now());
this.updateById(byId);
return byId;
}
@Override//修改申请 @Override//修改申请
public DetailsOfCentralized editDetailsById(CentralizedRequestDTO centralizedRequestDto) { public DetailsOfCentralized editDetailsById(CentralizedRequestDTO centralizedRequestDto) {
@ -186,7 +200,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
detailsOfCentralizedService.removeBatchByIds(list); detailsOfCentralizedService.removeBatchByIds(list);
} }
return centralizedRequestService.removeById(centralizedRequestId); return this.removeById(centralizedRequestId);
} }
@ -204,7 +218,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
//查询状态为1的采购申请:已提交 //查询状态为1的采购申请:已提交
centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus, 1); centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus, 1);
List<CentralizedRequest> list = centralizedRequestService.list(centralizedRequestLambdaQueryWrapper); List<CentralizedRequest> list = this.list(centralizedRequestLambdaQueryWrapper);
ArrayList<CentralizedRequestVO> centralizedRequestVOArrayList = new ArrayList<>(); ArrayList<CentralizedRequestVO> centralizedRequestVOArrayList = new ArrayList<>();
@ -248,7 +262,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
@Override @Override
public CentralizedRequest auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public CentralizedRequest auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
CentralizedRequest byId = centralizedRequestService.getById(auditAndApproveDTO.getUuId()); CentralizedRequest byId = this.getById(auditAndApproveDTO.getUuId());
byId.setAuditId(dlpUser.getId()); byId.setAuditId(dlpUser.getId());
byId.setAuditTime(LocalDateTime.now()); byId.setAuditTime(LocalDateTime.now());
@ -256,11 +270,11 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
byId.setAuditResult(auditAndApproveDTO.getAuditResult()); byId.setAuditResult(auditAndApproveDTO.getAuditResult());
if (auditAndApproveDTO.getAuditResult() == true) { if (auditAndApproveDTO.getAuditResult() == true) {
byId.setStatus(2); byId.setStatus(6);
} else { } else {
byId.setStatus(-2); byId.setStatus(-2);
} }
if (centralizedRequestService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }
@ -271,7 +285,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
if (type.equals("集中采购申请")) { if (type.equals("集中采购申请")) {
CentralizedRequestVO centralizedRequest = centralizedRequestService.getCentralizedRequestVO(id); CentralizedRequestVO centralizedRequest = this.getCentralizedRequestVO(id);
List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = centralizedRequest.getDetailsOfCentralizedVOList(); List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = centralizedRequest.getDetailsOfCentralizedVOList();
@ -349,7 +363,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
if (type.equals("集中采购申请")) { if (type.equals("集中采购申请")) {
CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(id); CentralizedRequestVO centralizedRequestVO = this.getCentralizedRequestVO(id);
PurchasingPlanVO byId = purchasingPlanService.getPurchasingPlanVO(centralizedRequestVO.getPurchasingPlanId()); PurchasingPlanVO byId = purchasingPlanService.getPurchasingPlanVO(centralizedRequestVO.getPurchasingPlanId());
firstAuditName = centralizedRequestVO.getAuditorName(); firstAuditName = centralizedRequestVO.getAuditorName();
secondAuditName = byId.getCreateName(); secondAuditName = byId.getCreateName();

@ -52,10 +52,6 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
@Autowired @Autowired
private PeriodVerificationImplementationService periodVerificationImplementationService; private PeriodVerificationImplementationService periodVerificationImplementationService;
@Autowired
private CheckScheduleService checkScheduleService;
@Autowired @Autowired
private OssFile ossFile; private OssFile ossFile;
@ -89,9 +85,9 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
periodVerificationPlans.add(periodVerificationPlan); periodVerificationPlans.add(periodVerificationPlan);
} }
if (checkScheduleService.save(checkSchedule) && periodVerificationPlanService.saveBatch(periodVerificationPlans)) { if (this.save(checkSchedule) && periodVerificationPlanService.saveBatch(periodVerificationPlans)) {
CheckScheduleVO checkScheduleVO = checkScheduleService.getCheckScheduleVO(checkSchedule.getId()); CheckScheduleVO checkScheduleVO = this.getCheckScheduleVO(checkSchedule.getId());
return checkScheduleVO; return checkScheduleVO;
} else throw new RuntimeException(String.format("保存失败")); } else throw new RuntimeException(String.format("保存失败"));
@ -102,7 +98,7 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
@Transactional @Transactional
public CheckSchedule editPlan(List<PeriodVerificationPlanDTO> periodVerificationPlanDTOS) { public CheckSchedule editPlan(List<PeriodVerificationPlanDTO> periodVerificationPlanDTOS) {
CheckSchedule byId = checkScheduleService.getById(periodVerificationPlanDTOS.get(0).getCheckScheduleId()); CheckSchedule byId = this.getById(periodVerificationPlanDTOS.get(0).getCheckScheduleId());
LambdaQueryWrapper<PeriodVerificationPlan> periodVerificationPlanLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PeriodVerificationPlan> periodVerificationPlanLambdaQueryWrapper = new LambdaQueryWrapper<>();
@ -127,7 +123,7 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
periodVerificationPlans.add(periodVerificationPlan); periodVerificationPlans.add(periodVerificationPlan);
} }
if (checkScheduleService.updateById(byId) && periodVerificationPlanService.saveBatch(periodVerificationPlans)) { if (this.updateById(byId) && periodVerificationPlanService.saveBatch(periodVerificationPlans)) {
return byId; return byId;
} else throw new RuntimeException(String.format("保存失败")); } else throw new RuntimeException(String.format("保存失败"));
@ -138,14 +134,14 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
@Transactional @Transactional
public CheckSchedule commitPlan(List<PeriodVerificationPlanDTO> periodVerificationPlanDTOS, DLPUser dlpUser) { public CheckSchedule commitPlan(List<PeriodVerificationPlanDTO> periodVerificationPlanDTOS, DLPUser dlpUser) {
CheckSchedule byId = checkScheduleService.getById(periodVerificationPlanDTOS.get(0).getCheckScheduleId()); CheckSchedule byId = this.getById(periodVerificationPlanDTOS.get(0).getCheckScheduleId());
if (byId == null) { if (byId == null) {
CheckSchedule checkSchedule = checkScheduleService.addPlan(periodVerificationPlanDTOS, dlpUser); CheckSchedule checkSchedule = this.addPlan(periodVerificationPlanDTOS, dlpUser);
checkSchedule.setStatus(1); checkSchedule.setStatus(1);
checkSchedule.setCommitTime(LocalDateTime.now()); checkSchedule.setCommitTime(LocalDateTime.now());
checkScheduleService.updateById(checkSchedule); this.updateById(checkSchedule);
return checkSchedule; return checkSchedule;
@ -153,19 +149,19 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
if (byId.getStatus()==-2){ if (byId.getStatus()==-2){
CheckScheduleVO checkScheduleVO = checkScheduleService.addPlan(periodVerificationPlanDTOS, dlpUser); CheckScheduleVO checkScheduleVO = this.addPlan(periodVerificationPlanDTOS, dlpUser);
return checkScheduleVO; return checkScheduleVO;
} }
CheckSchedule checkSchedule = checkScheduleService.editPlan(periodVerificationPlanDTOS); CheckSchedule checkSchedule = this.editPlan(periodVerificationPlanDTOS);
checkSchedule.setStatus(1); checkSchedule.setStatus(1);
checkSchedule.setCommitTime(LocalDateTime.now()); checkSchedule.setCommitTime(LocalDateTime.now());
checkScheduleService.updateById(checkSchedule); this.updateById(checkSchedule);
return checkSchedule; return checkSchedule;
} }
@ -175,7 +171,7 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
@Override @Override
public CheckSchedule auditPlan(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public CheckSchedule auditPlan(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
CheckSchedule byId = checkScheduleService.getById(auditAndApproveDTO.getUuId()); CheckSchedule byId = this.getById(auditAndApproveDTO.getUuId());
byId.setAuditOpinionOfTechnical(auditAndApproveDTO.getAuditOpinion()); byId.setAuditOpinionOfTechnical(auditAndApproveDTO.getAuditOpinion());
byId.setAuditResultOfTechnical(auditAndApproveDTO.getAuditResult()); byId.setAuditResultOfTechnical(auditAndApproveDTO.getAuditResult());
@ -195,12 +191,12 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
periodVerificationImplementationService.addById(periodVerificationPlan); periodVerificationImplementationService.addById(periodVerificationPlan);
} }
byId.setStatus(2); byId.setStatus(6);
} else { } else {
byId.setStatus(-2); byId.setStatus(-2);
} }
if (checkScheduleService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }

@ -44,8 +44,6 @@ import java.util.List;
@Service @Service
public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMapper, ComplianceCheck> implements ComplianceCheckService { public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMapper, ComplianceCheck> implements ComplianceCheckService {
@Autowired
private ComplianceCheckService complianceCheckService;
@Autowired @Autowired
private ReagentConsumableInventoryService reagentConsumableInventoryService; private ReagentConsumableInventoryService reagentConsumableInventoryService;
@ -122,7 +120,7 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
complianceCheck.setStatus(-1); complianceCheck.setStatus(-1);
if (complianceCheckService.save(complianceCheck)) { if (this.save(complianceCheck)) {
return complianceCheck; return complianceCheck;
} else { } else {
throw new RuntimeException(String.format("新增失败")); throw new RuntimeException(String.format("新增失败"));
@ -136,7 +134,7 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
for (ComplianceCheckDTO complianceCheckDTO : list) { for (ComplianceCheckDTO complianceCheckDTO : list) {
ComplianceCheck complianceCheck = complianceCheckService.addCheck(complianceCheckDTO, dlpUser); ComplianceCheck complianceCheck = this.addCheck(complianceCheckDTO, dlpUser);
complianceCheck.setReagentConsumableName(reagentConsumablesService.getById(complianceCheckDTO.getReagentConsumableId()).getReagentConsumableName()); complianceCheck.setReagentConsumableName(reagentConsumablesService.getById(complianceCheckDTO.getReagentConsumableId()).getReagentConsumableName());
@ -151,14 +149,21 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
@Override//删除符合性检查 @Override//删除符合性检查
public Boolean delCheckById(String complianceCheckId) { public Boolean delCheckById(String complianceCheckId) {
return complianceCheckService.removeById(complianceCheckId); ComplianceCheck byId = this.getById(complianceCheckId);
if (byId.getStatus()!=0){
throw new RuntimeException(String.format("当前状态无法删除"));
}
return this.removeById(complianceCheckId);
} }
@Transactional @Transactional
@Override//录入结论 @Override//录入结论
public ComplianceCheck editCheckById(ComplianceCheckDTO complianceCheckDTO) { public ComplianceCheck editCheckById(ComplianceCheckDTO complianceCheckDTO) {
ComplianceCheck byId = complianceCheckService.getById(complianceCheckDTO.getComplianceCheckId()); ComplianceCheck byId = this.getById(complianceCheckDTO.getComplianceCheckId());
if (complianceCheckDTO.getInspectionScheme() == null) { if (complianceCheckDTO.getInspectionScheme() == null) {
throw new RuntimeException(String.format("请先制定检查方案")); throw new RuntimeException(String.format("请先制定检查方案"));
@ -172,7 +177,7 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
byId.setNonconformingItem(nonconformingItem); byId.setNonconformingItem(nonconformingItem);
if (complianceCheckService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
throw new RuntimeException(String.format("录入失败")); throw new RuntimeException(String.format("录入失败"));
@ -183,13 +188,13 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
@Override//录入方案 @Override//录入方案
public ComplianceCheck addScheme(ComplianceCheckDTO complianceCheckDTO, DLPUser dlpUser) { public ComplianceCheck addScheme(ComplianceCheckDTO complianceCheckDTO, DLPUser dlpUser) {
ComplianceCheck byId = complianceCheckService.getById(complianceCheckDTO.getComplianceCheckId()); ComplianceCheck byId = this.getById(complianceCheckDTO.getComplianceCheckId());
byId.setInspectionScheme(complianceCheckDTO.getInspectionScheme()); byId.setInspectionScheme(complianceCheckDTO.getInspectionScheme());
byId.setStatus(0); byId.setStatus(0);
if (complianceCheckService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else return null; } else return null;
@ -201,7 +206,7 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
String complianceCheckId = complianceCheckDTO.getComplianceCheckId(); String complianceCheckId = complianceCheckDTO.getComplianceCheckId();
ComplianceCheck byId = complianceCheckService.getById(complianceCheckId); ComplianceCheck byId = this.getById(complianceCheckId);
String nonconformingItem = complianceCheckDTO.getNonconformingItem(); String nonconformingItem = complianceCheckDTO.getNonconformingItem();
byId.setExecutorId(dlpUser.getId()); byId.setExecutorId(dlpUser.getId());
@ -244,7 +249,7 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
byId.setStatus(1); byId.setStatus(1);
if (complianceCheckService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
return null; return null;
@ -255,7 +260,7 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
@Override//一级审核 @Override//一级审核
public ComplianceCheck primaryAuditCheck(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public ComplianceCheck primaryAuditCheck(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
ComplianceCheck byId = complianceCheckService.getById(auditAndApproveDTO.getUuId()); ComplianceCheck byId = this.getById(auditAndApproveDTO.getUuId());
if (byId.getStatus() != 1) { if (byId.getStatus() != 1) {
throw new RuntimeException(String.format("当前状态不可审核")); throw new RuntimeException(String.format("当前状态不可审核"));
@ -274,7 +279,7 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
byId.setStatus(-2); byId.setStatus(-2);
} }
if (complianceCheckService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
return null; return null;
@ -284,7 +289,7 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
@Override//二级审核 @Override//二级审核
public ComplianceCheck secondaryAuditCheck(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public ComplianceCheck secondaryAuditCheck(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
ComplianceCheck byId = complianceCheckService.getById(auditAndApproveDTO.getUuId()); ComplianceCheck byId = this.getById(auditAndApproveDTO.getUuId());
if (byId.getStatus() != 2) { if (byId.getStatus() != 2) {
throw new RuntimeException(String.format("当前状态不可审核")); throw new RuntimeException(String.format("当前状态不可审核"));
@ -297,12 +302,12 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
byId.setSecondaryAuditorId(dlpUser.getId()); byId.setSecondaryAuditorId(dlpUser.getId());
if (auditAndApproveDTO.getAuditResult() == true) { if (auditAndApproveDTO.getAuditResult() == true) {
byId.setStatus(3); byId.setStatus(6);
} else { } else {
byId.setStatus(-3); byId.setStatus(-3);
} }
if (complianceCheckService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
return null; return null;

@ -20,10 +20,6 @@ import java.util.List;
*/ */
@Service @Service
public class DecentralizeDetailsServiceImpl extends ServiceImpl<DecentralizeDetailsMapper, DecentralizeDetails> implements DecentralizeDetailsService { public class DecentralizeDetailsServiceImpl extends ServiceImpl<DecentralizeDetailsMapper, DecentralizeDetails> implements DecentralizeDetailsService {
@Autowired
private DecentralizeDetailsService decentralizeDetailsService;
@Autowired @Autowired
private DecentralizedRequestService decentralizedRequestService; private DecentralizedRequestService decentralizedRequestService;
@ -34,7 +30,7 @@ public class DecentralizeDetailsServiceImpl extends ServiceImpl<DecentralizeDeta
LambdaQueryWrapper<DecentralizeDetails> eq = decentralizeDetailsLambdaQueryWrapper.eq(DecentralizeDetails::getDecentralizedRequestId, decentralizedRequestId); LambdaQueryWrapper<DecentralizeDetails> eq = decentralizeDetailsLambdaQueryWrapper.eq(DecentralizeDetails::getDecentralizedRequestId, decentralizedRequestId);
List<DecentralizeDetails> decentralizeDetailsList = decentralizeDetailsService.list(decentralizeDetailsLambdaQueryWrapper); List<DecentralizeDetails> decentralizeDetailsList = this.list(decentralizeDetailsLambdaQueryWrapper);
return decentralizeDetailsList; return decentralizeDetailsList;
} }

@ -33,8 +33,6 @@ import java.util.List;
@SuppressWarnings("all") @SuppressWarnings("all")
public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRequestMapper, DecentralizedRequest> implements DecentralizedRequestService { public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRequestMapper, DecentralizedRequest> implements DecentralizedRequestService {
@Autowired
private DecentralizedRequestService decentralizedRequestService;
@Autowired @Autowired
private DecentralizeDetailsService decentralizeDetailsService; private DecentralizeDetailsService decentralizeDetailsService;
@ -105,7 +103,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
list.add(decentralizedDetails); list.add(decentralizedDetails);
} }
if (decentralizedRequestService.save(decentralizedRequest) & decentralizeDetailsService.saveBatch(list)) { if (this.save(decentralizedRequest) & decentralizeDetailsService.saveBatch(list)) {
return decentralizedRequest; return decentralizedRequest;
} else return null; } else return null;
} }
@ -148,7 +146,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
decentralizeDetailsService.removeBatchByIds(list); decentralizeDetailsService.removeBatchByIds(list);
} }
return decentralizedRequestService.removeById(decentralizedRequestService.getById(decentralizedRequestId)); return this.removeById(this.getById(decentralizedRequestId));
} }
@ -158,25 +156,25 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
if (decentralizedRequestId == null) { if (decentralizedRequestId == null) {
DecentralizedRequest decentralizedRequest = decentralizedRequestService.addRequest(decentralizedRequestDTOList, dlpUser); DecentralizedRequest decentralizedRequest = this.addRequest(decentralizedRequestDTOList, dlpUser);
decentralizedRequest.setStatus(1); decentralizedRequest.setStatus(1);
decentralizedRequest.setCommitTime(LocalDateTime.now()); decentralizedRequest.setCommitTime(LocalDateTime.now());
decentralizedRequest.setDateOfApplication(LocalDateTime.now()); decentralizedRequest.setDateOfApplication(LocalDateTime.now());
if (decentralizedRequestService.updateById(decentralizedRequest)) { if (this.updateById(decentralizedRequest)) {
return decentralizedRequest; return decentralizedRequest;
} else throw new RuntimeException(String.format("提交失败")); } else throw new RuntimeException(String.format("提交失败"));
} else { } else {
DecentralizedRequest byId = decentralizedRequestService.getById(decentralizedRequestId); DecentralizedRequest byId = this.getById(decentralizedRequestId);
byId.setStatus(1); byId.setStatus(1);
byId.setCommitTime(LocalDateTime.now()); byId.setCommitTime(LocalDateTime.now());
if (decentralizedRequestService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("提交失败")); } else throw new RuntimeException(String.format("提交失败"));
} }
@ -186,7 +184,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Override//一级审核 @Override//一级审核
public DecentralizedRequest primaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) { public DecentralizedRequest primaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) {
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDto.getUuId()); DecentralizedRequest byId = this.getById(auditAndApproveDto.getUuId());
if (byId.getStatus() != 1) { if (byId.getStatus() != 1) {
throw new RuntimeException(String.format("当前状态不能审核")); throw new RuntimeException(String.format("当前状态不能审核"));
@ -206,7 +204,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
byId.setStatus(-2); byId.setStatus(-2);
} }
if (decentralizedRequestService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else return null; } else return null;
@ -216,7 +214,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Override//二级审核 @Override//二级审核
public DecentralizedRequest secondaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) { public DecentralizedRequest secondaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) {
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDto.getUuId()); DecentralizedRequest byId = this.getById(auditAndApproveDto.getUuId());
if (byId.getStatus() != 2) { if (byId.getStatus() != 2) {
throw new RuntimeException(String.format("当前状态不能审核")); throw new RuntimeException(String.format("当前状态不能审核"));
@ -236,7 +234,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
byId.setStatus(-3); byId.setStatus(-3);
} }
if (decentralizedRequestService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else return null; } else return null;
} }
@ -245,7 +243,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Override//三级审核 @Override//三级审核
public DecentralizedRequest threeLevelAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDTO) { public DecentralizedRequest threeLevelAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDTO) {
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDTO.getUuId()); DecentralizedRequest byId = this.getById(auditAndApproveDTO.getUuId());
if (byId.getStatus() != 3) { if (byId.getStatus() != 3) {
throw new RuntimeException(String.format("当前状态不能审核")); throw new RuntimeException(String.format("当前状态不能审核"));
@ -265,7 +263,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
byId.setStatus(-4); byId.setStatus(-4);
} }
if (decentralizedRequestService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else return null; } else return null;
} }
@ -274,7 +272,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
@Transactional @Transactional
public DecentralizedRequest approveRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) { public DecentralizedRequest approveRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) {
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDto.getUuId()); DecentralizedRequest byId = this.getById(auditAndApproveDto.getUuId());
if (byId.getStatus() != 4) { if (byId.getStatus() != 4) {
throw new RuntimeException(String.format("当前状态不能审批")); throw new RuntimeException(String.format("当前状态不能审批"));
@ -328,7 +326,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
purchaseList.setType("分散采购申请"); purchaseList.setType("分散采购申请");
byId.setPurchaseListId(purchaseList.getId()); byId.setPurchaseListId(purchaseList.getId());
decentralizedRequestService.updateById(byId); this.updateById(byId);
purchaseListService.save(purchaseList); purchaseListService.save(purchaseList);
@ -351,7 +349,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
} else { } else {
byId.setStatus(-5); byId.setStatus(-5);
} }
if (decentralizedRequestService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else return null; } else return null;

@ -17,6 +17,7 @@ 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 digital.laboratory.platform.reagent.vo.ReagentConsumablesSetVO;
import digital.laboratory.platform.sys.feign.RemoteCabinetService; import digital.laboratory.platform.sys.feign.RemoteCabinetService;
import io.swagger.models.auth.In;
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;
@ -47,10 +48,6 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
@Autowired @Autowired
private OutgoingContentsService outgoingContentsService; private OutgoingContentsService outgoingContentsService;
@Autowired
private DeliveryRegistrationFormService deliveryRegistrationFormService;
@Autowired @Autowired
private ComplianceCheckService complianceCheckService; private ComplianceCheckService complianceCheckService;
@ -105,12 +102,12 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
//循环领用集合,创建出库集合 //循环领用集合,创建出库集合
for (ReagentConsumablesSet reagentConsumablesSet : list) { for (ReagentConsumablesSet reagentConsumablesSet : list) {
OutgoingContents outgoingContents = new OutgoingContents();
ReagentConsumables one = reagentConsumablesService.getById(reagentConsumablesSet.getReagentConsumableId()); ReagentConsumables one = reagentConsumablesService.getById(reagentConsumablesSet.getReagentConsumableId());
if (one.getCategory().equals("标准物质") | one.getCategory().equals("标准储备溶液")) { if (one.getCategory().equals("标准物质") | one.getCategory().equals("标准储备溶液")) {
OutgoingContents outgoingContents = new OutgoingContents();
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>();
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(reagentConsumablesSet.getReferenceMaterialId()); ReferenceMaterial referenceMaterial = referenceMaterialService.getById(reagentConsumablesSet.getReferenceMaterialId());
@ -130,34 +127,68 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
outgoingContents.setLatticeId(referenceMaterial.getLatticeId()); outgoingContents.setLatticeId(referenceMaterial.getLatticeId());
outgoingContents.setBoxId(referenceMaterial.getBoxId()); outgoingContents.setBoxId(referenceMaterial.getBoxId());
outgoingContents.setCode(referenceMaterial.getCode()); outgoingContents.setCode(referenceMaterial.getCode());
outgoingContents.setReagentConsumablesSetId(reagentConsumablesSet.getId());
outgoingContentsList.add(outgoingContents); outgoingContentsList.add(outgoingContents);
} else { } else {
BatchDetails byId1 = batchDetailsService.getById(reagentConsumablesSet.getBatchDetailsId()); String reagentConsumableId = reagentConsumablesSet.getReagentConsumableId();
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getOne(Wrappers.<ReagentConsumableInventory>query().eq("reagent_consumable_id", reagentConsumableId));
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", reagentConsumableInventory.getReagentConsumableInventoryId())
.orderByAsc("create_time")
.gt("quantity", 0));
List<BatchDetails> batchDetails = new ArrayList<>();
Integer quantity = reagentConsumablesSet.getQuantity();
Integer batchQuantity = 0;
for (int i = 0; i < batchDetailsList.size(); i++) {
batchQuantity += batchDetailsList.get(i).getQuantity();
batchDetails.add(batchDetailsList.get(i));
if (batchQuantity >= quantity) {
break;
}
}
for (int i = 0; i < batchDetails.size(); i++) {
OutgoingContents outgoingContents = new OutgoingContents();
outgoingContents.setId(IdWorker.get32UUID().toUpperCase()); outgoingContents.setId(IdWorker.get32UUID().toUpperCase());
outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId()); outgoingContents.setDeliveryRegistrationFormId(deliveryRegistrationForm.getId());
outgoingContents.setQuantity(reagentConsumablesSet.getQuantity()); outgoingContents.setQuantity(batchDetails.get(i).getQuantity());
outgoingContents.setRemarks(reagentConsumablesSet.getRemarks()); outgoingContents.setRemarks(reagentConsumablesSet.getRemarks());
outgoingContents.setOutboundUse(reagentConsumablesSet.getPurpose()); outgoingContents.setOutboundUse(reagentConsumablesSet.getPurpose());
outgoingContents.setReagentConsumableId(reagentConsumablesSet.getReagentConsumableId()); outgoingContents.setReagentConsumableId(reagentConsumablesSet.getReagentConsumableId());
outgoingContents.setReagentConsumableType(one.getCategory()); outgoingContents.setReagentConsumableType(one.getCategory());
outgoingContents.setBatchDetailsId(reagentConsumablesSet.getBatchDetailsId()); outgoingContents.setBatchDetailsId(batchDetails.get(i).getBatchDetailsId());
outgoingContents.setLocation(byId1.getLocation()); outgoingContents.setLocation(batchDetails.get(i).getLocation());
outgoingContents.setLatticeId(byId1.getLatticeId()); outgoingContents.setLatticeId(batchDetails.get(i).getLatticeId());
outgoingContents.setBoxId(byId1.getBoxId()); outgoingContents.setBoxId(batchDetails.get(i).getBoxId());
outgoingContents.setCode(one.getCode()); outgoingContents.setCode(one.getCode());
outgoingContentsList.add(outgoingContents); outgoingContents.setReagentConsumablesSetId(reagentConsumablesSet.getId());
} if (i == batchDetails.size() - 1) {
reagentConsumablesSet.setOutgoingContentId(outgoingContents.getId());
reagentConsumablesSetService.updateById(reagentConsumablesSet);
Integer x = quantity - (batchQuantity - batchDetailsList.get(i).getQuantity());
outgoingContents.setQuantity(x);
}
outgoingContentsList.add(outgoingContents);
}
} }
if (deliveryRegistrationFormService.save(deliveryRegistrationForm) && outgoingContentsService.saveBatch(outgoingContentsList) & }
if (this.save(deliveryRegistrationForm) && outgoingContentsService.saveBatch(outgoingContentsList) &
applicationForUseService.updateById(byId)) { applicationForUseService.updateById(byId)) {
return deliveryRegistrationForm; return deliveryRegistrationForm;
@ -168,7 +199,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
@Transactional @Transactional
public DeliveryRegistrationForm commitForm(List<OutgoingContentsDTO> outgoingContentsDTOS, DLPUser dlpUser) { public DeliveryRegistrationForm commitForm(List<OutgoingContentsDTO> outgoingContentsDTOS, DLPUser dlpUser) {
//得到出库登记表 //得到出库登记表
DeliveryRegistrationForm byId = deliveryRegistrationFormService.getById(outgoingContentsDTOS.get(0).getDeliveryRegistrationFormId()); DeliveryRegistrationForm byId = this.getById(outgoingContentsDTOS.get(0).getDeliveryRegistrationFormId());
byId.setStatus(1); byId.setStatus(1);
@ -198,10 +229,14 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
for (OutgoingContentsDTO outgoingContentsDTO : outgoingContentsDTOS) { for (OutgoingContentsDTO outgoingContentsDTO : outgoingContentsDTOS) {
//传入出库数量,区分出库数量与领用数量 //传入出库数量,区分出库数量与领用数量
ReagentConsumablesSet reagentConsumablesSet = reagentConsumablesSetService.getOne(Wrappers.<ReagentConsumablesSet>query(). ReagentConsumablesSet reagentConsumablesSet = reagentConsumablesSetService.getById(outgoingContentsDTO.getReagentConsumablesSetId());
eq("outgoing_content_id", outgoingContentsDTO.getId()));
if (reagentConsumablesSet.getQuantityDelivered() == null) {
reagentConsumablesSet.setQuantityDelivered(outgoingContentsDTO.getQuantity()); reagentConsumablesSet.setQuantityDelivered(outgoingContentsDTO.getQuantity());
} else {
reagentConsumablesSet.setQuantityDelivered(reagentConsumablesSet.getQuantityDelivered() + outgoingContentsDTO.getQuantity());
}
reagentConsumablesSetService.updateById(reagentConsumablesSet); reagentConsumablesSetService.updateById(reagentConsumablesSet);
@ -266,7 +301,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
batchDetails.setServiceStatus(-1); batchDetails.setServiceStatus(-1);
} }
batchDetailsService.updateById(batchDetails);} batchDetailsService.updateById(batchDetails);
}
//查找出对应的仓库信息,将库存量减少 //查找出对应的仓库信息,将库存量减少
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.reduceById(outgoingContents.getReagentConsumableId(), outgoingContents.getQuantity()); ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.reduceById(outgoingContents.getReagentConsumableId(), outgoingContents.getQuantity());
@ -341,7 +377,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
batchDetails.setServiceStatus(-1); batchDetails.setServiceStatus(-1);
} }
batchDetailsService.updateById(batchDetails);} batchDetailsService.updateById(batchDetails);
}
if (reagentConsumableInventory.getTotalQuantity() < 0) { if (reagentConsumableInventory.getTotalQuantity() < 0) {
throw new RuntimeException(String.format("出库数量不能超过库存量")); throw new RuntimeException(String.format("出库数量不能超过库存量"));
} }
@ -361,7 +398,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
batchDetails.setServiceStatus(-1); batchDetails.setServiceStatus(-1);
} }
batchDetailsService.updateById(batchDetails);} batchDetailsService.updateById(batchDetails);
}
requisitionRecord.setDateOfClaim(LocalDateTime.now()); requisitionRecord.setDateOfClaim(LocalDateTime.now());
requisitionRecord.setRecipientId(one.getRecipientId()); requisitionRecord.setRecipientId(one.getRecipientId());
@ -393,7 +431,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
if (standardMaterialApplications.size() != 0) { if (standardMaterialApplications.size() != 0) {
standardMaterialApplicationService.saveBatch(standardMaterialApplications); standardMaterialApplicationService.saveBatch(standardMaterialApplications);
} }
if (outgoingContentsService.saveBatch(outgoingContentsList)&& deliveryRegistrationFormService.updateById(byId)) { if (outgoingContentsService.saveBatch(outgoingContentsList) && this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("提交失败")); } else throw new RuntimeException(String.format("提交失败"));
} }
@ -437,9 +475,12 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
BatchDetails byId = batchDetailsService.getById(outgoingContents.getBatchDetailsId()); BatchDetails byId = batchDetailsService.getById(outgoingContents.getBatchDetailsId());
if (byId != null) {
outgoingContentsVO.setBatch(byId.getBatch()); outgoingContentsVO.setBatch(byId.getBatch());
outgoingContentsVO.setSupplierName(supplierInformationService.getById(byId.getSupplierId()).getSupplierName()); outgoingContentsVO.setSupplierName(supplierInformationService.getById(byId.getSupplierId()).getSupplierName());
}
outgoingContentsVOS.add(outgoingContentsVO); outgoingContentsVOS.add(outgoingContentsVO);
} }
@ -449,6 +490,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
return deliveryRegistrationFormVOById; return deliveryRegistrationFormVOById;
} }
@Override//通过ID查询出库内容 @Override//通过ID查询出库内容
public DeliveryRegistrationFormVO getDeliveryRegistrationFormVOByCode(String claimCode) { public DeliveryRegistrationFormVO getDeliveryRegistrationFormVOByCode(String claimCode) {

@ -28,10 +28,6 @@ import java.util.List;
*/ */
@Service @Service
public class DetailsOfCentralizedServiceImpl extends ServiceImpl<DetailsOfCentralizedMapper, DetailsOfCentralized> implements DetailsOfCentralizedService { public class DetailsOfCentralizedServiceImpl extends ServiceImpl<DetailsOfCentralizedMapper, DetailsOfCentralized> implements DetailsOfCentralizedService {
@Autowired
private DetailsOfCentralizedService detailsOfCentralizedService;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@ -63,7 +59,7 @@ public class DetailsOfCentralizedServiceImpl extends ServiceImpl<DetailsOfCentra
detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getProcurementContentId, purchasingPlanId); detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getProcurementContentId, purchasingPlanId);
List<DetailsOfCentralized> list = detailsOfCentralizedService.list(detailsOfCentralizedLambdaQueryWrapper); List<DetailsOfCentralized> list = this.list(detailsOfCentralizedLambdaQueryWrapper);
List<DetailsOfCentralizedVO> detailsOfCentralizedVOS = new ArrayList<>(); List<DetailsOfCentralizedVO> detailsOfCentralizedVOS = new ArrayList<>();

@ -32,8 +32,6 @@ import java.util.List;
@Service @Service
public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper, EvaluationForm> implements EvaluationFormService { public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper, EvaluationForm> implements EvaluationFormService {
@Autowired
private EvaluationFormService evaluationFormService;
@Autowired @Autowired
private ProvideServicesOrSuppliesService provideServicesOrSuppliesService; private ProvideServicesOrSuppliesService provideServicesOrSuppliesService;
@Autowired @Autowired
@ -76,7 +74,7 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
evaluationForm.setStatus(0); evaluationForm.setStatus(0);
evaluationForm.setSupplierInformationId(supplierInformationId); evaluationForm.setSupplierInformationId(supplierInformationId);
if (evaluationFormService.save(evaluationForm)) { if (this.save(evaluationForm)) {
return evaluationForm; return evaluationForm;
} else return null; } else return null;
@ -103,7 +101,7 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
throw new RuntimeException(String.format("请完善评价信息后再提交")); throw new RuntimeException(String.format("请完善评价信息后再提交"));
} }
EvaluationForm evaluationForm = evaluationFormService.getById(evaluationFormDTO.getEvaluationFormId()); EvaluationForm evaluationForm = this.getById(evaluationFormDTO.getEvaluationFormId());
if (evaluationForm.getStatus() == -3) { if (evaluationForm.getStatus() == -3) {
@ -118,7 +116,7 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
evaluationForm.setStatus(2); evaluationForm.setStatus(2);
evaluationForm.setCommitTime(LocalDateTime.now()); evaluationForm.setCommitTime(LocalDateTime.now());
if (evaluationFormService.updateById(evaluationForm)) { if (this.updateById(evaluationForm)) {
return evaluationForm; return evaluationForm;
} else throw new RuntimeException(String.format("提交失败")); } else throw new RuntimeException(String.format("提交失败"));
@ -143,7 +141,7 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
evaluationForm.setStatus(2); evaluationForm.setStatus(2);
evaluationForm.setCommitTime(LocalDateTime.now()); evaluationForm.setCommitTime(LocalDateTime.now());
if (evaluationFormService.updateById(evaluationForm)) { if (this.updateById(evaluationForm)) {
return evaluationForm; return evaluationForm;
} else throw new RuntimeException(String.format("提交失败")); } else throw new RuntimeException(String.format("提交失败"));
@ -153,13 +151,14 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
evaluationForm.setPrimaryUserId(dlpUser.getId()); evaluationForm.setPrimaryUserId(dlpUser.getId());
evaluationForm.setCreateBy(dlpUser.getId());
evaluationForm.setCommentsDateFromPrimary(LocalDate.now()); evaluationForm.setCommentsDateFromPrimary(LocalDate.now());
evaluationForm.setStatus(2); evaluationForm.setStatus(2);
evaluationForm.setCommitTime(LocalDateTime.now()); evaluationForm.setCommitTime(LocalDateTime.now());
if (evaluationFormService.updateById(evaluationForm)) { if (this.updateById(evaluationForm)) {
return evaluationForm; return evaluationForm;
} else throw new RuntimeException(String.format("提交失败")); } else throw new RuntimeException(String.format("提交失败"));
} }
@ -167,7 +166,7 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
@Override//二级审核 @Override//二级审核
public EvaluationForm auditFormOfSecondary(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public EvaluationForm auditFormOfSecondary(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
EvaluationForm byId = evaluationFormService.getById(auditAndApproveDTO.getUuId()); EvaluationForm byId = this.getById(auditAndApproveDTO.getUuId());
byId.setSecondaryUserId(dlpUser.getId()); byId.setSecondaryUserId(dlpUser.getId());
@ -181,7 +180,7 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
byId.setStatus(3); byId.setStatus(3);
} else byId.setStatus(-3); } else byId.setStatus(-3);
if (evaluationFormService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
return null; return null;
@ -192,7 +191,7 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
public EvaluationForm auditFormOfThreeLevel(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public EvaluationForm auditFormOfThreeLevel(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
EvaluationForm byId = evaluationFormService.getById(auditAndApproveDTO.getUuId()); EvaluationForm byId = this.getById(auditAndApproveDTO.getUuId());
byId.setThreeLevelUserId(dlpUser.getId()); byId.setThreeLevelUserId(dlpUser.getId());
@ -203,10 +202,10 @@ public class EvaluationFormServiceImpl extends ServiceImpl<EvaluationFormMapper,
byId.setCommentsResultFromThreeLevel(auditAndApproveDTO.getAuditResult()); byId.setCommentsResultFromThreeLevel(auditAndApproveDTO.getAuditResult());
if (auditAndApproveDTO.getAuditResult() == true) { if (auditAndApproveDTO.getAuditResult() == true) {
byId.setStatus(4); byId.setStatus(6);
} else byId.setStatus(-4); } else byId.setStatus(-4);
if (evaluationFormService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
return null; return null;

@ -27,9 +27,6 @@ import java.time.LocalDateTime;
@Service @Service
public class InstructionBookServiceImpl extends ServiceImpl<InstructionBookMapper, InstructionBook> implements InstructionBookService { public class InstructionBookServiceImpl extends ServiceImpl<InstructionBookMapper, InstructionBook> implements InstructionBookService {
@Autowired
private InstructionBookService instructionBookService;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@ -48,11 +45,11 @@ public class InstructionBookServiceImpl extends ServiceImpl<InstructionBookMappe
if (auditAndApproveDTO.getAuditResult()==true){ if (auditAndApproveDTO.getAuditResult()==true){
byId.setCommitStatus(2); byId.setCommitStatus(6);
} }
else byId.setCommitStatus(-2); else byId.setCommitStatus(-2);
if (instructionBookService.updateById(byId)){ if (this.updateById(byId)){
return byId; return byId;
}else return null; }else return null;

@ -51,9 +51,6 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
@Autowired @Autowired
private PeriodVerificationPlanService periodVerificationPlanService; private PeriodVerificationPlanService periodVerificationPlanService;
@Autowired
private PeriodVerificationImplementationService periodVerificationImplementationService;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@Autowired @Autowired
@ -124,7 +121,7 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
periodVerificationImplementation.setVerificationBasis(periodVerificationPlan.getVerificationBasis()); periodVerificationImplementation.setVerificationBasis(periodVerificationPlan.getVerificationBasis());
periodVerificationImplementation.setCommitStatus(0); periodVerificationImplementation.setCommitStatus(0);
if (periodVerificationImplementationService.save(periodVerificationImplementation)) { if (this.save(periodVerificationImplementation)) {
return periodVerificationImplementation; return periodVerificationImplementation;
} else throw new RuntimeException(String.format("保存失败")); } else throw new RuntimeException(String.format("保存失败"));
@ -133,7 +130,7 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
@Override//录入期间核查结果记录表 @Override//录入期间核查结果记录表
public PeriodVerificationImplementation editById(PeriodVerificationImplementationDTO periodVerificationImplementationDTO, DLPUser dlpUser) { public PeriodVerificationImplementation editById(PeriodVerificationImplementationDTO periodVerificationImplementationDTO, DLPUser dlpUser) {
PeriodVerificationImplementation byId = periodVerificationImplementationService.getById(periodVerificationImplementationDTO.getPeriodVerificationImplementationId()); PeriodVerificationImplementation byId = this.getById(periodVerificationImplementationDTO.getPeriodVerificationImplementationId());
BeanUtils.copyProperties(periodVerificationImplementationDTO, byId); BeanUtils.copyProperties(periodVerificationImplementationDTO, byId);
@ -153,7 +150,7 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
reagentConsumablesService.updateById(byId2); reagentConsumablesService.updateById(byId2);
if (periodVerificationImplementationService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("保存失败")); } else throw new RuntimeException(String.format("保存失败"));
@ -163,7 +160,7 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
@Override//提交期间核查结果记录表 @Override//提交期间核查结果记录表
public PeriodVerificationImplementation commitById(PeriodVerificationImplementationDTO periodVerificationImplementationDTO, DLPUser dlpUser) { public PeriodVerificationImplementation commitById(PeriodVerificationImplementationDTO periodVerificationImplementationDTO, DLPUser dlpUser) {
PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.editById(periodVerificationImplementationDTO, dlpUser); PeriodVerificationImplementation periodVerificationImplementation = this.editById(periodVerificationImplementationDTO, dlpUser);
periodVerificationImplementation.setCommitTime(LocalDateTime.now()); periodVerificationImplementation.setCommitTime(LocalDateTime.now());
@ -182,7 +179,7 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
periodVerificationImplementation.setCommitStatus(1); periodVerificationImplementation.setCommitStatus(1);
if (periodVerificationImplementationService.updateById(periodVerificationImplementation)) { if (this.updateById(periodVerificationImplementation)) {
return periodVerificationImplementation; return periodVerificationImplementation;
@ -192,7 +189,7 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
@Override//审核期间核查结果记录表 @Override//审核期间核查结果记录表
public PeriodVerificationImplementation auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public PeriodVerificationImplementation auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
PeriodVerificationImplementation byId = periodVerificationImplementationService.getById(auditAndApproveDTO.getUuId()); PeriodVerificationImplementation byId = this.getById(auditAndApproveDTO.getUuId());
byId.setAuditResultOfTechnical(auditAndApproveDTO.getAuditResult()); byId.setAuditResultOfTechnical(auditAndApproveDTO.getAuditResult());
byId.setAuditOpinionOfTechnical(auditAndApproveDTO.getAuditOpinion()); byId.setAuditOpinionOfTechnical(auditAndApproveDTO.getAuditOpinion());
@ -207,7 +204,7 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
periodVerificationPlan.setImplementationDate(byId.getCheckingTime()); periodVerificationPlan.setImplementationDate(byId.getCheckingTime());
periodVerificationPlan.setInspectorId(dlpUser.getId()); periodVerificationPlan.setInspectorId(byId.getInspectorId());
periodVerificationPlan.setDeviationAndUncertainty(byId.getDeviationAndUncertainty()); periodVerificationPlan.setDeviationAndUncertainty(byId.getDeviationAndUncertainty());
@ -215,10 +212,10 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
periodVerificationPlanService.updateById(periodVerificationPlan); periodVerificationPlanService.updateById(periodVerificationPlan);
byId.setCommitStatus(2); byId.setCommitStatus(6);
} else byId.setCommitStatus(-2); } else byId.setCommitStatus(-2);
if (periodVerificationImplementationService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }

@ -35,9 +35,6 @@ public class PeriodVerificationPlanServiceImpl extends ServiceImpl<PeriodVerific
@Autowired @Autowired
private ReferenceMaterialService referenceMaterialService; private ReferenceMaterialService referenceMaterialService;
@Autowired
private PeriodVerificationPlanService periodVerificationPlanService;
@Autowired @Autowired
private PeriodVerificationImplementationService periodVerificationImplementationService; private PeriodVerificationImplementationService periodVerificationImplementationService;
@ -75,7 +72,7 @@ public class PeriodVerificationPlanServiceImpl extends ServiceImpl<PeriodVerific
ArrayList<PeriodVerificationPlanVO> periodVerificationPlanVOArrayList = new ArrayList<>(); ArrayList<PeriodVerificationPlanVO> periodVerificationPlanVOArrayList = new ArrayList<>();
//查询审核已通过的期间核查计划 //查询审核已通过的期间核查计划
List<CheckSchedule> checkScheduleList = checkScheduleService.list(Wrappers.<CheckSchedule>query().eq("status", 2)); List<CheckSchedule> checkScheduleList = checkScheduleService.list(Wrappers.<CheckSchedule>query().eq("status", 6));
//获取所有的计划明细 //获取所有的计划明细
for (CheckSchedule checkSchedule : checkScheduleList) { for (CheckSchedule checkSchedule : checkScheduleList) {
@ -86,6 +83,10 @@ public class PeriodVerificationPlanServiceImpl extends ServiceImpl<PeriodVerific
periodVerificationPlanVOArrayList.addAll(periodVerificationPlanVOS); periodVerificationPlanVOArrayList.addAll(periodVerificationPlanVOS);
} }
//循环计划明细,判断是否需要创建该期间核查计划 //循环计划明细,判断是否需要创建该期间核查计划
/*
* 每一次创建计划之后不会存在下次核查日期在核查人未核查之前不会创建新的
* 若核查人核查完成之后就会生成下次核查日期也就会进入循环
* 若条件满足则创建期间核查同时再次清空下次核查日期也就是在新创建但未核查的情况下并不会重复创建*/
for (PeriodVerificationPlan periodVerificationPlan : periodVerificationPlanVOArrayList) { for (PeriodVerificationPlan periodVerificationPlan : periodVerificationPlanVOArrayList) {
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(periodVerificationPlan.getReferenceMaterialId()); ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(periodVerificationPlan.getReferenceMaterialId());
@ -98,7 +99,7 @@ public class PeriodVerificationPlanServiceImpl extends ServiceImpl<PeriodVerific
periodVerificationPlan.setDateOfNextCheck(null); periodVerificationPlan.setDateOfNextCheck(null);
periodVerificationPlanService.updateById(periodVerificationPlan); this.updateById(periodVerificationPlan);
} }
} }

@ -29,9 +29,6 @@ import java.util.List;
@Service @Service
public class ProcurementContentServiceImpl extends ServiceImpl<ProcurementContentMapper, ProcurementContent> implements ProcurementContentService { public class ProcurementContentServiceImpl extends ServiceImpl<ProcurementContentMapper, ProcurementContent> implements ProcurementContentService {
@Autowired
private ProcurementContentService procurementContentService;
@Autowired @Autowired
private DetailsOfCentralizedService detailsOfCentralizedService; private DetailsOfCentralizedService detailsOfCentralizedService;
@Autowired @Autowired

@ -25,9 +25,6 @@ import java.util.List;
@Service @Service
public class ProvideServicesOrSuppliesServiceImpl extends ServiceImpl<ProvideServicesOrSuppliesMapper, ProvideServicesOrSupplies> implements ProvideServicesOrSuppliesService { public class ProvideServicesOrSuppliesServiceImpl extends ServiceImpl<ProvideServicesOrSuppliesMapper, ProvideServicesOrSupplies> implements ProvideServicesOrSuppliesService {
@Autowired
private ProvideServicesOrSuppliesService provideServicesOrSuppliesService;
@Autowired @Autowired
private EvaluationFormService evaluationFormService; private EvaluationFormService evaluationFormService;
@ -50,7 +47,7 @@ public class ProvideServicesOrSuppliesServiceImpl extends ServiceImpl<ProvideSer
provideServicesOrSupplies.setReagentConsumableId(reagentConsumableId); provideServicesOrSupplies.setReagentConsumableId(reagentConsumableId);
provideServicesOrSuppliesService.save(provideServicesOrSupplies); this.save(provideServicesOrSupplies);
return provideServicesOrSupplies; return provideServicesOrSupplies;
@ -64,7 +61,7 @@ public class ProvideServicesOrSuppliesServiceImpl extends ServiceImpl<ProvideSer
provideServicesOrSuppliesLambdaQueryWrapper.eq(ProvideServicesOrSupplies::getEvaluationFormId,one.getId()); provideServicesOrSuppliesLambdaQueryWrapper.eq(ProvideServicesOrSupplies::getEvaluationFormId,one.getId());
//通过评价表ID,找出该供应商提供的所有供应品 //通过评价表ID,找出该供应商提供的所有供应品
List<ProvideServicesOrSupplies> list = provideServicesOrSuppliesService.list(provideServicesOrSuppliesLambdaQueryWrapper); List<ProvideServicesOrSupplies> list = this.list(provideServicesOrSuppliesLambdaQueryWrapper);
List<ProvideServicesOrSuppliesVO> provideServicesOrSuppliesVOS = new ArrayList<>(); List<ProvideServicesOrSuppliesVO> provideServicesOrSuppliesVOS = new ArrayList<>();

@ -7,10 +7,8 @@ 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.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.config.PageUtils;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.PurchaseCatalogueDTO; import digital.laboratory.platform.reagent.dto.PurchaseCatalogueDTO;
import digital.laboratory.platform.reagent.entity.CatalogueDetails; import digital.laboratory.platform.reagent.entity.CatalogueDetails;
@ -40,8 +38,6 @@ import java.util.*;
public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueMapper, PurchaseCatalogue> implements PurchaseCatalogueService { public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueMapper, PurchaseCatalogue> implements PurchaseCatalogueService {
@Autowired
private PurchaseCatalogueService purchaseCatalogueService;
@Autowired @Autowired
private CatalogueDetailsService catalogueDetailsService; private CatalogueDetailsService catalogueDetailsService;
@ -85,7 +81,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
typeTableService.addSpecies(catalogueDetails.getCategory(), catalogueDetails.getSpecies()); typeTableService.addSpecies(catalogueDetails.getCategory(), catalogueDetails.getSpecies());
} }
if (purchaseCatalogueService.save(purchaseCatalogue) & catalogueDetailsService.saveBatch(catalogueDetailsList)) { if (this.save(purchaseCatalogue) & catalogueDetailsService.saveBatch(catalogueDetailsList)) {
return purchaseCatalogue; return purchaseCatalogue;
} else return null; } else return null;
} }
@ -116,9 +112,8 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
if (list.size() > 0 & list != null) { if (list.size() > 0 & list != null) {
catalogueDetailsService.removeBatchByIds(list); catalogueDetailsService.removeBatchByIds(list);
} }
return return
purchaseCatalogueService.removeById(purchaseCatalogueId); this.removeById(purchaseCatalogueId);
} }
@Override @Override
@ -126,8 +121,16 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
CatalogueDetails catalogueDetails = new CatalogueDetails(); CatalogueDetails catalogueDetails = new CatalogueDetails();
PurchaseCatalogueVO purchaseCatalogueVO = this.getPurchaseCatalogueVO(purchaseCatalogueDTO.getPurchaseCatalogueId());
int size = purchaseCatalogueVO.getCatalogueDetailsListList().size();
BeanUtils.copyProperties(purchaseCatalogueDTO, catalogueDetails); BeanUtils.copyProperties(purchaseCatalogueDTO, catalogueDetails);
String yyyy = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy");
catalogueDetails.setPurchaseCatalogueNumber(yyyy + "-" + size + 1);
if (catalogueDetailsService.save(catalogueDetails)) { if (catalogueDetailsService.save(catalogueDetails)) {
return catalogueDetails; return catalogueDetails;
@ -143,7 +146,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
for (PurchaseCatalogueVO record : records) { for (PurchaseCatalogueVO record : records) {
PurchaseCatalogue byId = purchaseCatalogueService.getById(record.getPurchaseCatalogueId()); PurchaseCatalogue byId = this.getById(record.getPurchaseCatalogueId());
LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
@ -187,7 +190,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
if (purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId().equals("") | purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId() == null) { if (purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId().equals("") | purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId() == null) {
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.addCatalogue(dlpUser, purchaseCatalogueDTOList); PurchaseCatalogue purchaseCatalogue = this.addCatalogue(dlpUser, purchaseCatalogueDTOList);
if (permissions.contains("reagent_purchase_catalogue_primary")) { if (permissions.contains("reagent_purchase_catalogue_primary")) {
@ -195,17 +198,15 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
} else { } else {
purchaseCatalogue.setStatus(1); purchaseCatalogue.setStatus(1);
} }
purchaseCatalogue.setCommitTime(LocalDateTime.now()); purchaseCatalogue.setCommitTime(LocalDateTime.now());
if (purchaseCatalogueService.updateById(purchaseCatalogue)) { if (this.updateById(purchaseCatalogue)) {
return purchaseCatalogue; return purchaseCatalogue;
} else return null; } else return null;
} else { } else {
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.getById(purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId() PurchaseCatalogue purchaseCatalogue = this.getById(purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId()
); );
if (permissions.contains("reagent_purchase_catalogue_primary")) { if (permissions.contains("reagent_purchase_catalogue_primary")) {
purchaseCatalogue.setStatus(2); purchaseCatalogue.setStatus(2);
@ -214,7 +215,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
} }
purchaseCatalogue.setCommitTime(LocalDateTime.now()); purchaseCatalogue.setCommitTime(LocalDateTime.now());
if (purchaseCatalogueService.updateById(purchaseCatalogue)) { if (this.updateById(purchaseCatalogue)) {
return purchaseCatalogue; return purchaseCatalogue;
} else return null; } else return null;
} }
@ -224,7 +225,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
@Transactional @Transactional
public PurchaseCatalogue primaryAuditCatalogue(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) { public PurchaseCatalogue primaryAuditCatalogue(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) {
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.getById(auditAndApproveDto.getUuId()); PurchaseCatalogue purchaseCatalogue = this.getById(auditAndApproveDto.getUuId());
purchaseCatalogue.setAuditOpinion(auditAndApproveDto.getAuditOpinion()); purchaseCatalogue.setAuditOpinion(auditAndApproveDto.getAuditOpinion());
@ -247,12 +248,18 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
for (CatalogueDetails catalogueDetails : list) { for (CatalogueDetails catalogueDetails : list) {
ReagentConsumables one = reagentConsumablesService.getOne(Wrappers.<ReagentConsumables>query() ReagentConsumables one = reagentConsumablesService.getOne(Wrappers.<ReagentConsumables>query()
.eq("reagent_consumable_name", catalogueDetails.getReagentConsumableName()) .eq("reagent_consumable_name", catalogueDetails.getReagentConsumableName())
.eq("brand", catalogueDetails.getBrand()) .eq("brand", catalogueDetails.getBrand())
.eq("category", catalogueDetails.getCategory()) .eq("category", catalogueDetails.getCategory())
.eq("specification_and_model", catalogueDetails.getSpecificationAndModel()) .eq("specification_and_model", catalogueDetails.getSpecificationAndModel())
.eq("standard_value_or_purity", catalogueDetails.getStandardValueOrPurity() .eq(StrUtil.isNotBlank(catalogueDetails.getStandardValueOrPurity()), "standard_value_or_purity", catalogueDetails.getStandardValueOrPurity())
)); .eq(StrUtil.isNotBlank(catalogueDetails.getCasNumber()), "cas_number", catalogueDetails.getCasNumber())
.eq(StrUtil.isNotBlank(catalogueDetails.getSpecies()), "species", catalogueDetails.getSpecies())
.eq(StrUtil.isNotBlank(catalogueDetails.getEnglishName()), "english_name", catalogueDetails.getEnglishName())
.eq(StrUtil.isNotBlank(catalogueDetails.getPackagedCopies()), "packaged_copies", catalogueDetails.getPackagedCopies())
.eq(StrUtil.isNotBlank(catalogueDetails.getAlias()), "alias", catalogueDetails.getAlias())
);
if (one == null) { if (one == null) {
ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(catalogueDetails); ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(catalogueDetails);
@ -264,12 +271,12 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
} }
} }
purchaseCatalogue.setStatus(3); purchaseCatalogue.setStatus(6);
} else { } else {
purchaseCatalogue.setStatus(-3); purchaseCatalogue.setStatus(-3);
} }
if (purchaseCatalogueService.updateById(purchaseCatalogue)) { if (this.updateById(purchaseCatalogue)) {
return purchaseCatalogue; return purchaseCatalogue;
} else return null; } else return null;
} }
@ -278,17 +285,17 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
@Override @Override
public PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId) { public PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId) {
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.getById(purchaseCatalogueId); PurchaseCatalogue purchaseCatalogue = this.getById(purchaseCatalogueId);
purchaseCatalogue.setStatus(4); purchaseCatalogue.setStatus(4);
if (purchaseCatalogueService.updateById(purchaseCatalogue)) { if (this.updateById(purchaseCatalogue)) {
return purchaseCatalogue; return purchaseCatalogue;
} else return null; } else return null;
} }
@Override//查询已发布的采购目录 @Override//查询已发布的采购目录
public List<CatalogueDetails> getList(String name) { public List<CatalogueDetails> getList(String name, Integer category) {
QueryWrapper<PurchaseCatalogue> queryWrapper = new QueryWrapper<>(); QueryWrapper<PurchaseCatalogue> queryWrapper = new QueryWrapper<>();
@ -296,7 +303,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
QueryWrapper<PurchaseCatalogue> queryWrapper1 = queryWrapper.orderByDesc("update_time"); QueryWrapper<PurchaseCatalogue> queryWrapper1 = queryWrapper.orderByDesc("update_time");
List<PurchaseCatalogue> list = purchaseCatalogueService.list(queryWrapper1); List<PurchaseCatalogue> list = this.list(queryWrapper1);
if (list.size() == 0) { if (list.size() == 0) {
return null; return null;
@ -311,6 +318,12 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
catalogueDetailsLambdaQueryWrapper.like(CatalogueDetails::getReagentConsumableName, name); catalogueDetailsLambdaQueryWrapper.like(CatalogueDetails::getReagentConsumableName, name);
} }
if (category != null) {
catalogueDetailsLambdaQueryWrapper.like(category == 1, CatalogueDetails::getCategory, "试剂");
catalogueDetailsLambdaQueryWrapper.like(category == 2, CatalogueDetails::getCategory, "耗材");
catalogueDetailsLambdaQueryWrapper.like(category == 3, CatalogueDetails::getCategory, "标准物质");
}
List<CatalogueDetails> catalogueDetailsList = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); List<CatalogueDetails> catalogueDetailsList = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);

@ -20,8 +20,7 @@ import java.util.List;
*/ */
@Service @Service
public class PurchaseListDetailsServiceImpl extends ServiceImpl<PurchaseListDetailsMapper, PurchaseListDetails> implements PurchaseListDetailsService { public class PurchaseListDetailsServiceImpl extends ServiceImpl<PurchaseListDetailsMapper, PurchaseListDetails> implements PurchaseListDetailsService {
@Autowired
private PurchaseListDetailsService purchaseListDetailsService;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;

@ -46,8 +46,6 @@ import java.util.List;
@SuppressWarnings("all") @SuppressWarnings("all")
public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, PurchaseList> implements PurchaseListService { public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, PurchaseList> implements PurchaseListService {
@Autowired
private PurchaseListService purchaseListService;
@Autowired @Autowired
private PurchaseListDetailsService purchaseListDetailsService; private PurchaseListDetailsService purchaseListDetailsService;
@ -94,7 +92,7 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
PurchaseListVO purchaseListVO = new PurchaseListVO(); PurchaseListVO purchaseListVO = new PurchaseListVO();
PurchaseList byId = purchaseListService.getById(purchaseListId); PurchaseList byId = this.getById(purchaseListId);
List<PurchaseListDetailsVO> purchaseListDetailsVOList = purchaseListDetailsService.getPurchaseListDetailsVOList(purchaseListId); List<PurchaseListDetailsVO> purchaseListDetailsVOList = purchaseListDetailsService.getPurchaseListDetailsVOList(purchaseListId);
@ -137,7 +135,7 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
@Override//提交采购清单 @Override//提交采购清单
public PurchaseList commitById(String id) { public PurchaseList commitById(String id) {
PurchaseList purchaseList = purchaseListService.getById(id); PurchaseList purchaseList = this.getById(id);
//将集中采购与分散采购申请的状态改变 //将集中采购与分散采购申请的状态改变
if (purchaseList.getType().equals("采购计划")) { if (purchaseList.getType().equals("采购计划")) {
@ -214,7 +212,7 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
warehousingContentList.add(warehousingContent); warehousingContentList.add(warehousingContent);
} }
if (purchaseListService.updateById(purchaseList) & warehousingRecordFormService.save(warehousingRecordForm) if (this.updateById(purchaseList) & warehousingRecordFormService.save(warehousingRecordForm)
& warehousingContentService.saveBatch(warehousingContentList)) { & warehousingContentService.saveBatch(warehousingContentList)) {
return purchaseList; return purchaseList;
} else { } else {
@ -228,7 +226,7 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
String purchaseListId = purchaseListDTO.getPurchaseListId(); String purchaseListId = purchaseListDTO.getPurchaseListId();
PurchaseList byId = purchaseListService.getById(purchaseListId); PurchaseList byId = this.getById(purchaseListId);
PurchaseListDetails purchaseListDetails = purchaseListDetailsService.getById(purchaseListDTO.getId()); PurchaseListDetails purchaseListDetails = purchaseListDetailsService.getById(purchaseListDTO.getId());

@ -33,9 +33,6 @@ import java.util.List;
*/ */
@Service @Service
public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper, PurchasingPlan> implements PurchasingPlanService { public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper, PurchasingPlan> implements PurchasingPlanService {
@Autowired
private PurchasingPlanService purchasingPlanService;
@Autowired @Autowired
private ProcurementContentService procurementContentService; private ProcurementContentService procurementContentService;
@ -206,18 +203,10 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
list.add(procurementContent); list.add(procurementContent);
} }
} }
double x = 0;
for (
ProcurementContent procurementContent : list) {
x = x + procurementContent.getNumberOfApplications() * procurementContent.getUnitPrice();
} if (this.save(purchasingPlan) & procurementContentService.saveBatch(list)) {
calculatedAmount(purchasingPlan.getPurchasingPlanId());
purchasingPlan.setAppropriationBudget(x); PurchasingPlanVO purchasingPlanVO = this.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());
if (purchasingPlanService.save(purchasingPlan) & procurementContentService.saveBatch(list)) {
PurchasingPlanVO purchasingPlanVO = purchasingPlanService.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());
return purchasingPlanVO; return purchasingPlanVO;
} else throw new RuntimeException(String.format("保存失败")); } else throw new RuntimeException(String.format("保存失败"));
} }
@ -273,7 +262,7 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
byId.setUnitPrice(purchasingPlanDTO.getUnitPrice()); byId.setUnitPrice(purchasingPlanDTO.getUnitPrice());
PurchasingPlan purchasingPlan = purchasingPlanService.getById(byId.getPurchasingPlanId()); PurchasingPlan purchasingPlan = this.getById(byId.getPurchasingPlanId());
DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId()); DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId());
@ -320,9 +309,9 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
detailsOfCentralized.setQuantityPurchased(0); detailsOfCentralized.setQuantityPurchased(0);
} }
PurchasingPlan purchasingPlan = purchasingPlanService.getById(byId.getPurchasingPlanId()); PurchasingPlan purchasingPlan = this.getById(byId.getPurchasingPlanId());
if (purchasingPlanService.getById(byId.getPurchasingPlanId()).getStatus() == 0 if (this.getById(byId.getPurchasingPlanId()).getStatus() == 0
&& detailsOfCentralizedService.updateBatchById(list) && procurementContentService.removeById(procurementContentId)) { && detailsOfCentralizedService.updateBatchById(list) && procurementContentService.removeById(procurementContentId)) {
LambdaQueryWrapper<ProcurementContent> procurementContentLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ProcurementContent> procurementContentLambdaQueryWrapper = new LambdaQueryWrapper<>();
@ -333,7 +322,7 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
if (list1.size() == 0) { if (list1.size() == 0) {
purchasingPlanService.removeById(purchasingPlan); this.removeById(purchasingPlan);
return true; return true;
} }
@ -424,17 +413,29 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
public PurchasingPlan commitById(String purchasingPlanId) { public PurchasingPlan commitById(String purchasingPlanId) {
PurchasingPlan byId = purchasingPlanService.getById(purchasingPlanId); PurchasingPlan byId = this.getById(purchasingPlanId);
//若是审核审批不通过时的提交,则需清空原有的审核审批信息
if (byId.getStatus()!=0){ if (byId.getStatus()==-4){
throw new RuntimeException(String.format("当前状态无法提交")); byId.setAuditOpinionOfPrimary("");
byId.setAuditResultOfPrimary(false);
byId.setPrimaryAuditorId("");
byId.setAuditTimeOfPrimary(null);
}
if (byId.getStatus()==-5){
byId.setAuditOpinionOfPrimary("");
byId.setAuditResultOfPrimary(false);
byId.setPrimaryAuditorId("");
byId.setAuditTimeOfPrimary(null);
byId.setApproverId("");
byId.setApprovalOpinion("");
byId.setApprovalResult(false);
byId.setApprovalTime(null);
} }
byId.setStatus(1); byId.setStatus(1);
byId.setCommitTime(LocalDateTime.now()); byId.setCommitTime(LocalDateTime.now());
if (this.updateById(byId)) {
if (purchasingPlanService.updateById(byId)) {
calculatedAmount(byId.getPurchasingPlanId()); calculatedAmount(byId.getPurchasingPlanId());
return byId; return byId;
} else throw new RuntimeException(String.format("提交失败")); } else throw new RuntimeException(String.format("提交失败"));
@ -446,7 +447,7 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
@Override @Override
public PurchasingPlan auditById(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) { public PurchasingPlan auditById(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) {
PurchasingPlan purchasingPlan = purchasingPlanService.getById(auditAndApproveDto.getUuId()); PurchasingPlan purchasingPlan = this.getById(auditAndApproveDto.getUuId());
if (purchasingPlan.getStatus() != 1) { if (purchasingPlan.getStatus() != 1) {
throw new RuntimeException(String.format("当前状态不可审核")); throw new RuntimeException(String.format("当前状态不可审核"));
@ -465,7 +466,7 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
purchasingPlan.setStatus(-4); purchasingPlan.setStatus(-4);
} }
if (purchasingPlanService.updateById(purchasingPlan)) { if (this.updateById(purchasingPlan)) {
return purchasingPlan; return purchasingPlan;
} else { } else {
return null; return null;
@ -475,7 +476,7 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
@Override @Override
public PurchasingPlan approveById(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) { public PurchasingPlan approveById(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) {
PurchasingPlan purchasingPlan = purchasingPlanService.getById(auditAndApproveDto.getUuId()); PurchasingPlan purchasingPlan = this.getById(auditAndApproveDto.getUuId());
if (purchasingPlan.getStatus() != 4) { if (purchasingPlan.getStatus() != 4) {
throw new RuntimeException(String.format("当前状态不可审批")); throw new RuntimeException(String.format("当前状态不可审批"));
@ -530,7 +531,7 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
purchasingPlan.setStatus(-5); purchasingPlan.setStatus(-5);
} }
if (purchasingPlanService.updateById(purchasingPlan)) { if (this.updateById(purchasingPlan)) {
return purchasingPlan; return purchasingPlan;
} else { } else {
return null; return null;
@ -540,7 +541,7 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
//计算经费预算方法 //计算经费预算方法
public PurchasingPlan calculatedAmount(String purchasingPlanId) { public PurchasingPlan calculatedAmount(String purchasingPlanId) {
PurchasingPlan purchasingPlan = purchasingPlanService.getById(purchasingPlanId); PurchasingPlan purchasingPlan = this.getById(purchasingPlanId);
LambdaQueryWrapper<ProcurementContent> procurementContentLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ProcurementContent> procurementContentLambdaQueryWrapper = new LambdaQueryWrapper<>();
@ -556,7 +557,7 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
} }
purchasingPlan.setAppropriationBudget(x); purchasingPlan.setAppropriationBudget(x);
if (purchasingPlanService.updateById(purchasingPlan)) { if (this.updateById(purchasingPlan)) {
return purchasingPlan; return purchasingPlan;
} else throw new RuntimeException(String.format("计算失败")); } else throw new RuntimeException(String.format("计算失败"));
} }

@ -1,7 +1,7 @@
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 cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.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;
@ -15,10 +15,11 @@ import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteTemplate2htmlService; import digital.laboratory.platform.common.feign.RemoteTemplate2htmlService;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService; import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.oss.service.OssFile; import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.config.PageUtils; import digital.laboratory.platform.reagent.utils.PageUtils;
import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.ReagentConsumableInventoryMapper; import digital.laboratory.platform.reagent.mapper.ReagentConsumableInventoryMapper;
import digital.laboratory.platform.reagent.service.*; import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.utils.QRCodeUtils;
import digital.laboratory.platform.reagent.vo.*; import digital.laboratory.platform.reagent.vo.*;
import feign.Response; import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.commons.io.output.ByteArrayOutputStream;
@ -30,7 +31,6 @@ import org.springframework.stereotype.Service;
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.ByteArrayInputStream;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -45,9 +45,6 @@ import java.util.Map;
@Service @Service
@SuppressWarnings("all") @SuppressWarnings("all")
public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentConsumableInventoryMapper, ReagentConsumableInventory> implements ReagentConsumableInventoryService { public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentConsumableInventoryMapper, ReagentConsumableInventory> implements ReagentConsumableInventoryService {
@Autowired
private ReagentConsumableInventoryService reagentConsumableInventoryService;
@Autowired @Autowired
private BatchDetailsService batchDetailsService; private BatchDetailsService batchDetailsService;
@Autowired @Autowired
@ -78,7 +75,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Autowired @Autowired
private OssFile ossFile; private OssFile ossFile;
@Override//试剂耗材/标准物质标准物质管理列表 @Override//标准物质标准物质管理列表
public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw, Integer warning) { public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw, Integer warning) {
@ -97,7 +94,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
if (list.size() != 0) { if (list.size() != 0) {
for (BatchDetails batchDetails : list) { for (BatchDetails batchDetails : list) {
ReagentConsumableInventory byId = reagentConsumableInventoryService.getById(batchDetails.getReagentConsumableInventoryId()); ReagentConsumableInventory byId = this.getById(batchDetails.getReagentConsumableInventoryId());
ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO(); ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO();
BeanUtils.copyProperties(byId, reagentConsumableInventoryVO); BeanUtils.copyProperties(byId, reagentConsumableInventoryVO);
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId())); reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId()));
@ -148,7 +145,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
if (list.size() != 0) { if (list.size() != 0) {
for (BatchDetails batchDetails : list) { for (BatchDetails batchDetails : list) {
ReagentConsumableInventory byId = reagentConsumableInventoryService.getById(batchDetails.getReagentConsumableInventoryId()); ReagentConsumableInventory byId = this.getById(batchDetails.getReagentConsumableInventoryId());
ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO(); ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO();
BeanUtils.copyProperties(byId, reagentConsumableInventoryVO); BeanUtils.copyProperties(byId, reagentConsumableInventoryVO);
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId())); reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId()));
@ -189,12 +186,12 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumableId); reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumableId);
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); ReagentConsumableInventory one = this.getOne(reagentConsumableInventoryLambdaQueryWrapper);
one.setTotalQuantity(one.getTotalQuantity() + quantity); one.setTotalQuantity(one.getTotalQuantity() + quantity);
if (reagentConsumableInventoryService.updateById(one)) { if (this.updateById(one)) {
return one; return one;
} else throw new RuntimeException(String.format("库存添加失败")); } else throw new RuntimeException(String.format("库存添加失败"));
@ -207,7 +204,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumableId); reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumableId);
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); ReagentConsumableInventory one = this.getOne(reagentConsumableInventoryLambdaQueryWrapper);
one.setTotalQuantity(one.getTotalQuantity() - quantity); one.setTotalQuantity(one.getTotalQuantity() - quantity);
@ -216,7 +213,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
one.setWarningInformation("库存不足"); one.setWarningInformation("库存不足");
} }
if (reagentConsumableInventoryService.updateById(one)) { if (this.updateById(one)) {
return one; return one;
} else throw new RuntimeException(String.format("库存减少失败")); } else throw new RuntimeException(String.format("库存减少失败"));
@ -224,11 +221,85 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Override//分页查询标准物质 @Override//分页查询标准物质
public Page<ReagentConsumableInventoryFullVO> getAllList(Integer current, Integer size, QueryWrapper<ReagentConsumableInventory> qw, Integer status) { public Page<ReagentConsumableInventoryFullVO> getAllList(Integer current, Integer size, QueryWrapper<ReagentConsumableInventory> qw,Integer status,String number) {
//如果扫码
if (StrUtil.isNotBlank(number)){
ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(Wrappers.<ReferenceMaterial>query().eq("number", number));
if (referenceMaterial!=null) {
ReagentConsumableInventoryFullVO byCode = this.getByCode(referenceMaterial.getId());
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOS = new ArrayList<>();
reagentConsumableInventoryFullVOS.add(byCode);
PageUtils pageUtils = new PageUtils();
Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOS);
return pages;
}}
// List<ReferenceMaterial> list = referenceMaterialService.list(qw);
//
// List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>();
//
//
// for (ReferenceMaterial referenceMaterial : list) {
//
// ReagentConsumableInventory reagentConsumableInventory = this.getById(referenceMaterial.getReagentConsumableInventoryId());
//
// ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO();
//
// BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryFullVO);
//
// reagentConsumableInventoryFullVO.setNumber(referenceMaterial.getNumber());
//
// reagentConsumableInventoryFullVO.setBatchDetailsId(referenceMaterial.getBatchDetailsId());
//
// BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
//
// SupplierInformation supplierInformation = supplierInformationService.getById(batchDetails.getSupplierId());
//
// LambdaQueryWrapper<StandardReserveSolution> standardReserveSolutionLambdaQueryWrapper = new LambdaQueryWrapper<>();
//
// standardReserveSolutionLambdaQueryWrapper.eq(StandardReserveSolution::getReferenceId, referenceMaterial.getId());
//
// StandardReserveSolution one1 = standardReserveSolutionService.getOne(standardReserveSolutionLambdaQueryWrapper);
//
// reagentConsumableInventoryFullVO.setSupplierName(supplierInformation.getSupplierName());
// reagentConsumableInventoryFullVO.setBatch(batchDetails.getBatch());
// reagentConsumableInventoryFullVO.setBatchNumber(batchDetails.getBatchNumber());
// reagentConsumableInventoryFullVO.setManufacturerId(batchDetails.getSupplierId());
// reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime());
// reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId());
// reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus());
// reagentConsumableInventoryFullVO.setStorageLife(Integer.valueOf(batchDetails.getLimitDate()));
// reagentConsumableInventoryFullVO.setFixedResult(referenceMaterial.getFixedResult());
// if (one1 != null) {
//
// reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration());
// reagentConsumableInventoryFullVO.setConfigurationDate(one1.getConfigurationDate());
// reagentConsumableInventoryFullVO.setSolutionNumbering(referenceMaterial.getNumber());
// reagentConsumableInventoryFullVO.setValidityPeriod(one1.getValidityPeriod());
// }
// reagentConsumableInventoryFullVOList.add(reagentConsumableInventoryFullVO);
//
//
// }
// PageUtils pageUtils = new PageUtils();
////
// Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList);
//
// return pages;
// }
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>(); List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>();
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list(qw); List<ReagentConsumableInventory> list = this.list(qw);
ArrayList<ReferenceMaterial> referenceMaterialList = new ArrayList<>(); ArrayList<ReferenceMaterial> referenceMaterialList = new ArrayList<>();
//通过仓库类信息,查找对应的该类所有标准物质 //通过仓库类信息,查找对应的该类所有标准物质
@ -259,7 +330,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO(); ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO();
ReagentConsumableInventory byId = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId()); ReagentConsumableInventory byId = this.getById(referenceMaterial.getReagentConsumableInventoryId());
BeanUtils.copyProperties(byId, reagentConsumableInventoryFullVO); BeanUtils.copyProperties(byId, reagentConsumableInventoryFullVO);
@ -284,7 +355,6 @@ 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()));
reagentConsumableInventoryFullVO.setFixedResult(referenceMaterial.getFixedResult()); reagentConsumableInventoryFullVO.setFixedResult(referenceMaterial.getFixedResult());
if (one1 != null) { if (one1 != null) {
@ -301,7 +371,50 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList); Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList);
return pages; return pages;}
@Override//通过ID,获取标准物质所有信息
public ReagentConsumableInventoryFullVO getByCode(String id) {
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(id);
ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO();
ReagentConsumableInventory byId = this.getById(referenceMaterial.getReagentConsumableInventoryId());
BeanUtils.copyProperties(byId, reagentConsumableInventoryFullVO);
reagentConsumableInventoryFullVO.setNumber(referenceMaterial.getNumber());
reagentConsumableInventoryFullVO.setBatchDetailsId(referenceMaterial.getBatchDetailsId());
BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
SupplierInformation supplierInformation = supplierInformationService.getById(batchDetails.getSupplierId());
LambdaQueryWrapper<StandardReserveSolution> standardReserveSolutionLambdaQueryWrapper = new LambdaQueryWrapper<>();
standardReserveSolutionLambdaQueryWrapper.eq(StandardReserveSolution::getReferenceId, referenceMaterial.getId());
StandardReserveSolution one1 = standardReserveSolutionService.getOne(standardReserveSolutionLambdaQueryWrapper);
reagentConsumableInventoryFullVO.setSupplierName(supplierInformation.getSupplierName());
reagentConsumableInventoryFullVO.setBatch(batchDetails.getBatch());
reagentConsumableInventoryFullVO.setBatchNumber(batchDetails.getBatchNumber());
reagentConsumableInventoryFullVO.setManufacturerId(batchDetails.getSupplierId());
reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime());
reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId());
reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus());
reagentConsumableInventoryFullVO.setFixedResult(referenceMaterial.getFixedResult());
if (one1 != null) {
reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration());
reagentConsumableInventoryFullVO.setConfigurationDate(one1.getConfigurationDate());
reagentConsumableInventoryFullVO.setSolutionNumbering(referenceMaterial.getNumber());
reagentConsumableInventoryFullVO.setValidityPeriod(one1.getValidityPeriod());
}
return reagentConsumableInventoryFullVO;
} }
@ -309,7 +422,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Override @Override
public IPage<ReagentConsumableInventoryFullVO> getAllRM(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw) { public IPage<ReagentConsumableInventoryFullVO> getAllRM(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw) {
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list(qw); List<ReagentConsumableInventory> list = this.list(qw);
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOS = new ArrayList<>(); List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOS = new ArrayList<>();
@ -347,7 +460,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Override @Override
public List<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw) { public List<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw) {
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list(qw); List<ReagentConsumableInventory> list = this.list(qw);
// return list; // return list;
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>(); List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>();
@ -461,45 +574,73 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
ReagentConsumables byId = reagentConsumablesService.getById(id); ReagentConsumables byId = reagentConsumablesService.getById(id);
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(Wrappers.<ReagentConsumableInventory>query() ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query()
.eq("reagent_consumable_id", id)); .eq("reagent_consumable_id", id));
if (byId != null & one != null) { if (byId != null & one != null) {
byId.setCode(code); byId.setCode(code);
one.setCode(code); one.setCode(code);
reagentConsumableInventoryService.updateById(one); this.updateById(one);
reagentConsumablesService.updateById(byId); reagentConsumablesService.updateById(byId);
} }
} }
@Override @Override
//标准物质条形码打印 public void setRMCode(String id, String code) {
public String buildCodeLabelContent(String id) {
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(id);
if (referenceMaterial != null) {
referenceMaterial.setCode(code);
referenceMaterialService.updateById(referenceMaterial);
}
}
@Override
//标准物质二维码打印
public String buildCodeLabelContent(String id) {
//录入二维码信息
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(id); ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(id);
referenceMaterialServiceById.setCode(referenceMaterialServiceById.getNumber());
referenceMaterialService.updateById(referenceMaterialServiceById);
if (referenceMaterialServiceById == null) { if (referenceMaterialServiceById == null) {
throw new RuntimeException(String.format("请先入库后再进行打印条码")); throw new RuntimeException(String.format("请先入库后再进行打印条码"));
} }
//获取打印信息
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
referenceMaterialServiceById.setCode(LocalDateTimeUtil.format(LocalDateTime.now(), "yyyyMMddHHmmssSSS"));
referenceMaterialService.updateById(referenceMaterialServiceById); referenceMaterialService.updateById(referenceMaterialServiceById);
ReagentConsumables byId = reagentConsumablesService.getById(referenceMaterialServiceById.getReagentConsumableId()); ReagentConsumables byId = reagentConsumablesService.getById(referenceMaterialServiceById.getReagentConsumableId());
String reagentConsumableName = byId.getReagentConsumableName(); String reagentConsumableName = byId.getReagentConsumableName();
ReferenceMaterialVO referenceMaterial = new ReferenceMaterialVO(); ReferenceMaterialVO referenceMaterial = new ReferenceMaterialVO();
BatchDetails byId1 = batchDetailsService.getById(referenceMaterialServiceById.getBatchDetailsId());
BeanUtils.copyProperties(referenceMaterialServiceById, referenceMaterial); BeanUtils.copyProperties(referenceMaterialServiceById, referenceMaterial);
referenceMaterial.setCodeName(referenceMaterial.getNumber() + "-" + referenceMaterialServiceById.getCode()); //完善打印信息
referenceMaterial.setReferenceMaterialName(byId.getReagentConsumableName());
referenceMaterial.setTime(byId1.getExpirationDate());
data.put("referenceMaterial", referenceMaterial); data.put("referenceMaterial", referenceMaterial);
String templateFileName = "标准物质标签模板.vm"; String templateFileName = "标准物质标签模板.vm";
return remoteTemplate2htmlService.getHtml(templateFileName, data); return remoteTemplate2htmlService.getHtml(templateFileName, data);
}
@Override
public String printSolutionTag(String id) {
StandardReserveSolutionVO standardReserveSolutionVOById = standardReserveSolutionService.getStandardReserveSolutionVOById(id);
Map<String, Object> data = new HashMap<>();
String qrCodeImageBase64 = QRCodeUtils.getQRCodeImageBase64(standardReserveSolutionVOById.getSolutionName(), 12, 12);
data.put("standardReserveSolution", standardReserveSolutionVOById);
String templateFileName = "标准储备溶液标签模板.vm";
return remoteTemplate2htmlService.getHtml(templateFileName, data);
} }
} }

@ -18,8 +18,6 @@ import org.springframework.stereotype.Service;
@Service @Service
public class ReagentConsumablesServiceImpl extends ServiceImpl<ReagentConsumablesMapper, ReagentConsumables> implements ReagentConsumablesService { public class ReagentConsumablesServiceImpl extends ServiceImpl<ReagentConsumablesMapper, ReagentConsumables> implements ReagentConsumablesService {
@Autowired
private ReagentConsumablesService reagentConsumablesService;
@Override @Override
public ReagentConsumables addReagentConsumables(Object object){ public ReagentConsumables addReagentConsumables(Object object){
@ -29,7 +27,7 @@ public class ReagentConsumablesServiceImpl extends ServiceImpl<ReagentConsumable
reagentConsumables.setReagentConsumableId(IdWorker.get32UUID().toUpperCase()); reagentConsumables.setReagentConsumableId(IdWorker.get32UUID().toUpperCase());
if (!(reagentConsumablesService.save(reagentConsumables))){ if (!(this.save(reagentConsumables))){
throw new RuntimeException(String.format("系统错误,试剂耗材目录更新失败")); throw new RuntimeException(String.format("系统错误,试剂耗材目录更新失败"));
} }

@ -28,9 +28,6 @@ import java.util.List;
@Service @Service
public class ReagentConsumablesSetServiceImpl extends ServiceImpl<ReagentConsumablesSetMapper, ReagentConsumablesSet> implements ReagentConsumablesSetService { public class ReagentConsumablesSetServiceImpl extends ServiceImpl<ReagentConsumablesSetMapper, ReagentConsumablesSet> implements ReagentConsumablesSetService {
@Autowired
private ReagentConsumablesSetService reagentConsumablesSetService;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@ -47,7 +44,7 @@ public class ReagentConsumablesSetServiceImpl extends ServiceImpl<ReagentConsuma
reagentConsumablesSetLambdaQueryWrapper.eq(ReagentConsumablesSet::getApplicationForUseId, applicationForUseId); reagentConsumablesSetLambdaQueryWrapper.eq(ReagentConsumablesSet::getApplicationForUseId, applicationForUseId);
List<ReagentConsumablesSet> list = reagentConsumablesSetService.list(reagentConsumablesSetLambdaQueryWrapper); List<ReagentConsumablesSet> list = this.list(reagentConsumablesSetLambdaQueryWrapper);
List<ReagentConsumablesSetVO> reagentConsumablesSetVOS = new ArrayList<>(); List<ReagentConsumablesSetVO> reagentConsumablesSetVOS = new ArrayList<>();

@ -32,8 +32,6 @@ import java.util.List;
@SuppressWarnings("all") @SuppressWarnings("all")
public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialMapper, ReferenceMaterial> implements ReferenceMaterialService { public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialMapper, ReferenceMaterial> implements ReferenceMaterialService {
@Autowired
private ReferenceMaterialService referenceMaterialService;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@ -54,7 +52,7 @@ public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialM
referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getBatchDetailsId,batchDetailsId); referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getBatchDetailsId,batchDetailsId);
List<ReferenceMaterial> list = referenceMaterialService.list(referenceMaterialLambdaQueryWrapper); List<ReferenceMaterial> list = this.list(referenceMaterialLambdaQueryWrapper);
List<ReferenceMaterialVO> referenceMaterialVOS = new ArrayList<>(); List<ReferenceMaterialVO> referenceMaterialVOS = new ArrayList<>();

@ -47,8 +47,6 @@ public class RequisitionRecordServiceImpl extends ServiceImpl<RequisitionRecordM
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@Autowired
private RequisitionRecordService requisitionRecordService;
@Autowired @Autowired
private RemoteWord2PDFService remoteWord2PDFService; private RemoteWord2PDFService remoteWord2PDFService;
@ -73,8 +71,9 @@ public class RequisitionRecordServiceImpl extends ServiceImpl<RequisitionRecordM
requisitionRecord.setRemarks(outgoingContents.getRemarks()); requisitionRecord.setRemarks(outgoingContents.getRemarks());
requisitionRecord.setDrawingAmount(outgoingContents.getQuantity()); requisitionRecord.setDrawingAmount(outgoingContents.getQuantity());
requisitionRecord.setSpecificationAndModel(byId.getSpecificationAndModel()); requisitionRecord.setSpecificationAndModel(byId.getSpecificationAndModel());
requisitionRecord.setReagentConsumableName(byId.getReagentConsumableName());
if (requisitionRecordService.save(requisitionRecord)){ if (this.save(requisitionRecord)){
return requisitionRecord; return requisitionRecord;
}else throw new RuntimeException(String.format("试剂耗材领用记录表创建失败")); }else throw new RuntimeException(String.format("试剂耗材领用记录表创建失败"));

@ -559,7 +559,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
//分散采购申请一级已审核列表 //分散采购申请一级已审核列表
LambdaQueryWrapper<DecentralizedRequest> decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DecentralizedRequest> decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>();
decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getStatus, 2).or().eq(DecentralizedRequest::getStatus, -2); decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getPrimaryAuditorId,dlpUser.getId());
List<DecentralizedRequest> decentralizedRequestList = decentralizedRequestService.list(decentralizedRequestLambdaQueryWrapper); List<DecentralizedRequest> decentralizedRequestList = decentralizedRequestService.list(decentralizedRequestLambdaQueryWrapper);
@ -579,7 +579,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
//分散采购申请二级已审核列表 //分散采购申请二级已审核列表
LambdaQueryWrapper<DecentralizedRequest> decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DecentralizedRequest> decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>();
decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getStatus, 3).or().eq(DecentralizedRequest::getStatus, -3); decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getSecondaryAuditorId, dlpUser.getId());
List<DecentralizedRequest> decentralizedRequestList = decentralizedRequestService.list(decentralizedRequestLambdaQueryWrapper); List<DecentralizedRequest> decentralizedRequestList = decentralizedRequestService.list(decentralizedRequestLambdaQueryWrapper);
@ -599,7 +599,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
//分散采购申请三级已审核列表 //分散采购申请三级已审核列表
LambdaQueryWrapper<DecentralizedRequest> decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DecentralizedRequest> decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>();
decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getStatus, 4).or().eq(DecentralizedRequest::getStatus, -4); decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getThreeLevelAuditId,dlpUser.getId());
List<DecentralizedRequest> decentralizedRequestList = decentralizedRequestService.list(decentralizedRequestLambdaQueryWrapper); List<DecentralizedRequest> decentralizedRequestList = decentralizedRequestService.list(decentralizedRequestLambdaQueryWrapper);
@ -618,7 +618,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
//分散采购申请已审核列表 //分散采购申请已审核列表
LambdaQueryWrapper<DecentralizedRequest> decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DecentralizedRequest> decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>();
decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getStatus, 5).or().eq(DecentralizedRequest::getStatus, -5); decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getApproverId,dlpUser.getId());
List<DecentralizedRequest> decentralizedRequestList = decentralizedRequestService.list(decentralizedRequestLambdaQueryWrapper); List<DecentralizedRequest> decentralizedRequestList = decentralizedRequestService.list(decentralizedRequestLambdaQueryWrapper);
@ -637,7 +637,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
//采购目录一级已审核列表 //采购目录一级已审核列表
LambdaQueryWrapper<PurchaseCatalogue> purchaseCatalogueLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PurchaseCatalogue> purchaseCatalogueLambdaQueryWrapper = new LambdaQueryWrapper<>();
purchaseCatalogueLambdaQueryWrapper.eq(PurchaseCatalogue::getStatus, 2).or().eq(PurchaseCatalogue::getStatus, -2); purchaseCatalogueLambdaQueryWrapper.eq(PurchaseCatalogue::getAuditorId,dlpUser.getId());
List<PurchaseCatalogue> list = purchaseCatalogueService.list(purchaseCatalogueLambdaQueryWrapper); List<PurchaseCatalogue> list = purchaseCatalogueService.list(purchaseCatalogueLambdaQueryWrapper);
@ -657,7 +657,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<PurchaseCatalogue> purchaseCatalogueLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PurchaseCatalogue> purchaseCatalogueLambdaQueryWrapper = new LambdaQueryWrapper<>();
purchaseCatalogueLambdaQueryWrapper.eq(PurchaseCatalogue::getStatus, 3).or().eq(PurchaseCatalogue::getStatus, -3); purchaseCatalogueLambdaQueryWrapper.eq(PurchaseCatalogue::getAuditorId,dlpUser.getId());
List<PurchaseCatalogue> list = purchaseCatalogueService.list(purchaseCatalogueLambdaQueryWrapper); List<PurchaseCatalogue> list = purchaseCatalogueService.list(purchaseCatalogueLambdaQueryWrapper);
@ -678,7 +678,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<PurchasingPlan> purchasingPlanLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PurchasingPlan> purchasingPlanLambdaQueryWrapper = new LambdaQueryWrapper<>();
purchasingPlanLambdaQueryWrapper.eq(PurchasingPlan::getStatus, 2).or().eq(PurchasingPlan::getStatus, -2); purchasingPlanLambdaQueryWrapper.eq(PurchasingPlan::getPrimaryAuditorId,dlpUser.getId());
List<PurchasingPlan> list = purchasingPlanService.list(purchasingPlanLambdaQueryWrapper); List<PurchasingPlan> list = purchasingPlanService.list(purchasingPlanLambdaQueryWrapper);
@ -697,7 +697,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<PurchasingPlan> purchasingPlanLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PurchasingPlan> purchasingPlanLambdaQueryWrapper = new LambdaQueryWrapper<>();
purchasingPlanLambdaQueryWrapper.eq(PurchasingPlan::getStatus, 5).or().eq(PurchasingPlan::getStatus, -5); purchasingPlanLambdaQueryWrapper.eq(PurchasingPlan::getApproverId,dlpUser.getId());
List<PurchasingPlan> list = purchasingPlanService.list(purchasingPlanLambdaQueryWrapper); List<PurchasingPlan> list = purchasingPlanService.list(purchasingPlanLambdaQueryWrapper);
@ -717,7 +717,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<AcceptanceRecordForm> acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AcceptanceRecordForm> acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getStatus,2).or().eq(AcceptanceRecordForm::getStatus, -2); acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getPrimaryAuditorId,dlpUser.getId());
List<AcceptanceRecordForm> list = acceptanceRecordFormService.list(acceptanceRecordFormLambdaQueryWrapper); List<AcceptanceRecordForm> list = acceptanceRecordFormService.list(acceptanceRecordFormLambdaQueryWrapper);
@ -738,7 +738,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<AcceptanceRecordForm> acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AcceptanceRecordForm> acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getStatus,3).or().eq(AcceptanceRecordForm::getStatus, -3); acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getSecondaryAuditorId,dlpUser.getId());
List<AcceptanceRecordForm> list = acceptanceRecordFormService.list(acceptanceRecordFormLambdaQueryWrapper); List<AcceptanceRecordForm> list = acceptanceRecordFormService.list(acceptanceRecordFormLambdaQueryWrapper);
@ -759,7 +759,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<AcceptanceRecordForm> acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AcceptanceRecordForm> acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getStatus,4).or().eq(AcceptanceRecordForm::getStatus, -4); acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getThreeLevelAuditorId,dlpUser.getId());
List<AcceptanceRecordForm> list = acceptanceRecordFormService.list(acceptanceRecordFormLambdaQueryWrapper); List<AcceptanceRecordForm> list = acceptanceRecordFormService.list(acceptanceRecordFormLambdaQueryWrapper);
@ -779,7 +779,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<ComplianceCheck> complianceCheckLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ComplianceCheck> complianceCheckLambdaQueryWrapper = new LambdaQueryWrapper<>();
complianceCheckLambdaQueryWrapper.eq(ComplianceCheck::getStatus,2).or().eq(ComplianceCheck::getStatus, -2); complianceCheckLambdaQueryWrapper.eq(ComplianceCheck::getPrimaryAuditorId,dlpUser.getId());
List<ComplianceCheck> list = complianceCheckService.list(complianceCheckLambdaQueryWrapper); List<ComplianceCheck> list = complianceCheckService.list(complianceCheckLambdaQueryWrapper);
@ -799,7 +799,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<ComplianceCheck> complianceCheckLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ComplianceCheck> complianceCheckLambdaQueryWrapper = new LambdaQueryWrapper<>();
complianceCheckLambdaQueryWrapper.eq(ComplianceCheck::getStatus,3).or().eq(ComplianceCheck::getStatus, -3); complianceCheckLambdaQueryWrapper.eq(ComplianceCheck::getSecondaryAuditorId,dlpUser.getId());
List<ComplianceCheck> list = complianceCheckService.list(complianceCheckLambdaQueryWrapper); List<ComplianceCheck> list = complianceCheckService.list(complianceCheckLambdaQueryWrapper);
@ -818,7 +818,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<CheckSchedule> checkScheduleLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CheckSchedule> checkScheduleLambdaQueryWrapper = new LambdaQueryWrapper<>();
checkScheduleLambdaQueryWrapper.eq(CheckSchedule::getStatus,2).or().eq(CheckSchedule::getStatus, -2); checkScheduleLambdaQueryWrapper.eq(CheckSchedule::getTechnicalDirectorId,dlpUser.getId());
List<CheckSchedule> list = checkScheduleService.list(checkScheduleLambdaQueryWrapper); List<CheckSchedule> list = checkScheduleService.list(checkScheduleLambdaQueryWrapper);
@ -837,7 +837,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<PeriodVerificationImplementation> periodVerificationImplementationLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PeriodVerificationImplementation> periodVerificationImplementationLambdaQueryWrapper = new LambdaQueryWrapper<>();
periodVerificationImplementationLambdaQueryWrapper.eq(PeriodVerificationImplementation::getCommitStatus,2).or().eq(PeriodVerificationImplementation::getCommitStatus, -2); periodVerificationImplementationLambdaQueryWrapper.eq(PeriodVerificationImplementation::getTechnicalDirectorId,dlpUser.getId());
List<PeriodVerificationImplementation> list = periodVerificationImplementationService.list(periodVerificationImplementationLambdaQueryWrapper); List<PeriodVerificationImplementation> list = periodVerificationImplementationService.list(periodVerificationImplementationLambdaQueryWrapper);
@ -858,8 +858,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<StandardMaterialApprovalForm> standardMaterialApprovalFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StandardMaterialApprovalForm> standardMaterialApprovalFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
standardMaterialApprovalFormLambdaQueryWrapper.eq(StandardMaterialApprovalForm::getCommitStatus,4).or().eq(StandardMaterialApprovalForm::getCommitStatus, -4); standardMaterialApprovalFormLambdaQueryWrapper.eq(StandardMaterialApprovalForm::getSecondaryAuditorId,dlpUser.getId());
List<StandardMaterialApprovalForm> list = standardMaterialApprovalFormService.list(standardMaterialApprovalFormLambdaQueryWrapper); List<StandardMaterialApprovalForm> list = standardMaterialApprovalFormService.list(standardMaterialApprovalFormLambdaQueryWrapper);
ArrayList<StandardMaterialApprovalFormVO> standardMaterialApprovalFormVOS1 = new ArrayList<>(); ArrayList<StandardMaterialApprovalFormVO> standardMaterialApprovalFormVOS1 = new ArrayList<>();
@ -877,7 +876,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<StandardMaterialApprovalForm> standardMaterialApprovalFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StandardMaterialApprovalForm> standardMaterialApprovalFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
standardMaterialApprovalFormLambdaQueryWrapper.eq(StandardMaterialApprovalForm::getCommitStatus,5).or().eq(StandardMaterialApprovalForm::getCommitStatus, -5); standardMaterialApprovalFormLambdaQueryWrapper.eq(StandardMaterialApprovalForm::getApproverId,dlpUser.getId());
List<StandardMaterialApprovalForm> list = standardMaterialApprovalFormService.list(standardMaterialApprovalFormLambdaQueryWrapper); List<StandardMaterialApprovalForm> list = standardMaterialApprovalFormService.list(standardMaterialApprovalFormLambdaQueryWrapper);
@ -896,7 +895,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<EvaluationForm> evaluationFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EvaluationForm> evaluationFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
evaluationFormLambdaQueryWrapper.eq(EvaluationForm::getStatus,3).or().eq(EvaluationForm::getStatus, -3); evaluationFormLambdaQueryWrapper.eq(EvaluationForm::getSecondaryUserId,dlpUser.getId());
List<EvaluationForm> list = evaluationFormService.list(evaluationFormLambdaQueryWrapper); List<EvaluationForm> list = evaluationFormService.list(evaluationFormLambdaQueryWrapper);
@ -915,7 +914,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<EvaluationForm> evaluationFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EvaluationForm> evaluationFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
evaluationFormLambdaQueryWrapper.eq(EvaluationForm::getStatus,4).or().eq(EvaluationForm::getStatus, -4); evaluationFormLambdaQueryWrapper.eq(EvaluationForm::getThreeLevelUserId,dlpUser.getId());
List<EvaluationForm> list = evaluationFormService.list(evaluationFormLambdaQueryWrapper); List<EvaluationForm> list = evaluationFormService.list(evaluationFormLambdaQueryWrapper);
@ -934,7 +933,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<InstructionBook> instructionBookLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<InstructionBook> instructionBookLambdaQueryWrapper = new LambdaQueryWrapper<>();
instructionBookLambdaQueryWrapper.eq(InstructionBook::getCommitStatus,2).or().eq(InstructionBook::getCommitStatus, -2); instructionBookLambdaQueryWrapper.eq(InstructionBook::getTechnicalDirectorId,dlpUser.getId());
List<InstructionBook> list = instructionBookService.list(instructionBookLambdaQueryWrapper); List<InstructionBook> list = instructionBookService.list(instructionBookLambdaQueryWrapper);

@ -16,9 +16,6 @@ import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@Service//标准溶液使用记录 @Service//标准溶液使用记录
public class SolutionUseFormServiceImpl extends ServiceImpl<SolutionUseFormMapper, SolutionUseForm> implements SolutionUseFormService { public class SolutionUseFormServiceImpl extends ServiceImpl<SolutionUseFormMapper, SolutionUseForm> implements SolutionUseFormService {
@Autowired
private SolutionUseFormService solutionUseFormService;
@Autowired @Autowired
private StandardReserveSolutionService standardReserveSolutionService; private StandardReserveSolutionService standardReserveSolutionService;
@Override @Override
@ -50,14 +47,14 @@ public class SolutionUseFormServiceImpl extends ServiceImpl<SolutionUseFormMappe
solutionUseFormLambdaQueryWrapper.eq(SolutionUseForm::getSolutionId,standardReserveSolution.getId()); solutionUseFormLambdaQueryWrapper.eq(SolutionUseForm::getSolutionId,standardReserveSolution.getId());
List<SolutionUseForm> list = solutionUseFormService.list(solutionUseFormLambdaQueryWrapper); List<SolutionUseForm> list = this.list(solutionUseFormLambdaQueryWrapper);
//判断使用次序 //判断使用次序
if (list==null){ if (list==null){
solutionUseForm.setOrderOfUse(1); solutionUseForm.setOrderOfUse(1);
}else { }else {
solutionUseForm.setOrderOfUse(list.size()+1); solutionUseForm.setOrderOfUse(list.size()+1);
} }
if (solutionUseFormService.save(solutionUseForm)){ if (this.save(solutionUseForm)){
return solutionUseForm; return solutionUseForm;
}else throw new RuntimeException(String.format("标准储备溶液使用记录保存失败")); }else throw new RuntimeException(String.format("标准储备溶液使用记录保存失败"));
} }

@ -48,9 +48,6 @@ import java.util.List;
@SuppressWarnings("all") @SuppressWarnings("all")
public class StandardMaterialApplicationServiceImpl extends ServiceImpl<StandardMaterialApplicationMapper, StandardMaterialApplication> implements StandardMaterialApplicationService { public class StandardMaterialApplicationServiceImpl extends ServiceImpl<StandardMaterialApplicationMapper, StandardMaterialApplication> implements StandardMaterialApplicationService {
@Autowired
private StandardMaterialApplicationService standardMaterialApplicationService;
@Autowired @Autowired
private ReagentConsumablesService reagentConsumablesService; private ReagentConsumablesService reagentConsumablesService;
@ -85,7 +82,7 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
@Transactional @Transactional
public StandardMaterialApplication returnById(StandardMaterialApplicationDTO standardMaterialApplicationDTO) { public StandardMaterialApplication returnById(StandardMaterialApplicationDTO standardMaterialApplicationDTO) {
StandardMaterialApplication byId = standardMaterialApplicationService.getById(standardMaterialApplicationDTO.getStandardMaterialApplicationId()); StandardMaterialApplication byId = this.getById(standardMaterialApplicationDTO.getStandardMaterialApplicationId());
byId.setPurposeAndQuantity(standardMaterialApplicationDTO.getPurposeAndQuantity()); byId.setPurposeAndQuantity(standardMaterialApplicationDTO.getPurposeAndQuantity());
byId.setDateOfReturn(LocalDateTime.now()); byId.setDateOfReturn(LocalDateTime.now());
@ -146,7 +143,7 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
solutionUseFormService.updateById(one); solutionUseFormService.updateById(one);
} }
// //
if (standardMaterialApplicationService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("归还失败")); } else throw new RuntimeException(String.format("归还失败"));
} }

@ -45,10 +45,6 @@ import java.util.HashMap;
@Service @Service
@SuppressWarnings("all") @SuppressWarnings("all")
public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<StandardMaterialApprovalFormMapper, StandardMaterialApprovalForm> implements StandardMaterialApprovalFormService { public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<StandardMaterialApprovalFormMapper, StandardMaterialApprovalForm> implements StandardMaterialApprovalFormService {
@Autowired
private StandardMaterialApprovalFormService standardMaterialApprovalFormService;
@Autowired @Autowired
private SupplierInformationService supplierInformationService; private SupplierInformationService supplierInformationService;
@ -82,7 +78,7 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
standardMaterialApprovalForm.setCommitTime(LocalDateTime.now()); standardMaterialApprovalForm.setCommitTime(LocalDateTime.now());
if (standardMaterialApprovalFormService.save(standardMaterialApprovalForm)) { if (this.save(standardMaterialApprovalForm)) {
return standardMaterialApprovalForm; return standardMaterialApprovalForm;
} else throw new RuntimeException(String.format("保存失败")); } else throw new RuntimeException(String.format("保存失败"));
} }
@ -112,7 +108,7 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
@Override//审核 @Override//审核
public StandardMaterialApprovalForm auditSecondary(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public StandardMaterialApprovalForm auditSecondary(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
StandardMaterialApprovalForm byId = standardMaterialApprovalFormService.getById(auditAndApproveDTO.getUuId()); StandardMaterialApprovalForm byId = this.getById(auditAndApproveDTO.getUuId());
byId.setAuditOpinionOfSecondary(auditAndApproveDTO.getAuditOpinion()); byId.setAuditOpinionOfSecondary(auditAndApproveDTO.getAuditOpinion());
byId.setAuditResultOfSecondary(auditAndApproveDTO.getAuditResult()); byId.setAuditResultOfSecondary(auditAndApproveDTO.getAuditResult());
@ -123,7 +119,7 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
} else { } else {
byId.setCommitStatus(-4); byId.setCommitStatus(-4);
} }
if (standardMaterialApprovalFormService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else throw new RuntimeException(String.format("审核失败")); } else throw new RuntimeException(String.format("审核失败"));
} }
@ -131,7 +127,7 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
@Override//审批 @Override//审批
public StandardMaterialApprovalForm approveById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { public StandardMaterialApprovalForm approveById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
StandardMaterialApprovalForm byId1 = standardMaterialApprovalFormService.getById(auditAndApproveDTO.getUuId()); StandardMaterialApprovalForm byId1 = this.getById(auditAndApproveDTO.getUuId());
byId1.setOpinionOfApproval(auditAndApproveDTO.getApproveOpinion()); byId1.setOpinionOfApproval(auditAndApproveDTO.getApproveOpinion());
byId1.setResultOfApproval(auditAndApproveDTO.getApproveResult()); byId1.setResultOfApproval(auditAndApproveDTO.getApproveResult());
@ -180,7 +176,7 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
} else { } else {
byId1.setCommitStatus(-5); byId1.setCommitStatus(-5);
} }
if (standardMaterialApprovalFormService.updateById(byId1)) { if (this.updateById(byId1)) {
return byId1; return byId1;
} else throw new RuntimeException(String.format("审批失败")); } else throw new RuntimeException(String.format("审批失败"));
} }

@ -2,6 +2,7 @@ package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.StrUtil;
import 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;
@ -36,8 +37,12 @@ import org.springframework.transaction.annotation.Transactional;
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.ByteArrayInputStream;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -52,9 +57,6 @@ import java.util.List;
@SuppressWarnings("all") @SuppressWarnings("all")
public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardReserveSolutionMapper, StandardReserveSolution> implements StandardReserveSolutionService { public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardReserveSolutionMapper, StandardReserveSolution> implements StandardReserveSolutionService {
@Autowired
private StandardReserveSolutionService standardReserveSolutionService;
@Autowired @Autowired
private SolutionUseFormService solutionUseFormService; private SolutionUseFormService solutionUseFormService;
@ -87,7 +89,8 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
List<SolutionUseFormVO> solutionUseFormVOList = solutionUseFormService.getSolutionUseFormVOList(standardReserveSolutionVOById.getId()); List<SolutionUseFormVO> solutionUseFormVOList = solutionUseFormService.getSolutionUseFormVOList(standardReserveSolutionVOById.getId());
if (solutionUseFormVOList != null) { if (solutionUseFormVOList != null) {
standardReserveSolutionVOById.setSolutionUseFormVOList(solutionUseFormVOList);} standardReserveSolutionVOById.setSolutionUseFormVOList(solutionUseFormVOList);
}
return standardReserveSolutionVOById; return standardReserveSolutionVOById;
} }
@ -105,6 +108,9 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
BeanUtils.copyProperties(standardReserveSolutionDTO, standardReserveSolution); BeanUtils.copyProperties(standardReserveSolutionDTO, standardReserveSolution);
standardReserveSolution.setReferenceMaterialScale(standardReserveSolutionDTO.getReferenceMaterialScale());
standardReserveSolution.setConstantVolume(standardReserveSolutionDTO.getConstantVolume());
standardReserveSolution.setId(IdWorker.get32UUID().toUpperCase()); standardReserveSolution.setId(IdWorker.get32UUID().toUpperCase());
standardReserveSolution.setDispenserId(dlpUser.getId()); standardReserveSolution.setDispenserId(dlpUser.getId());
@ -112,24 +118,28 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
standardReserveSolution.setConfigurationDate(LocalDateTime.now()); standardReserveSolution.setConfigurationDate(LocalDateTime.now());
standardReserveSolution.setStatus(0); standardReserveSolution.setStatus(0);
//计算浓度
Double v = standardReserveSolution.getReferenceMaterialScale() / standardReserveSolution.getConstantVolume();
BigDecimal bigDecimal = new BigDecimal(v);
LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); BigDecimal bigDecimal1 = bigDecimal.setScale(2);
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName, standardReserveSolution.getSolutionName()); standardReserveSolution.setConfigurationConcentration(bigDecimal1.toString());
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration, standardReserveSolution.getConfigurationConcentration());
ReagentConsumables one = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper); LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableName, standardReserveSolution.getSolutionName());
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getConfigurationConcentration, standardReserveSolution.getConfigurationConcentration());
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper);
//判断是否存在过该标准储备溶液,若未存在,则将其存入试剂耗材类 //判断是否存在过该标准储备溶液,若未存在,则将其存入试剂耗材类
if (one == null) { if (one == null) {
ReagentConsumables reagentConsumables = new ReagentConsumables();
ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId()); ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId());
//创建一个标准储备溶液的种类对象
ReagentConsumables reagentConsumables1 = reagentConsumablesService.getById(byId.getReagentConsumableId()); ReagentConsumables reagentConsumables1 = reagentConsumablesService.getById(byId.getReagentConsumableId());
BeanUtils.copyProperties(reagentConsumables1, reagentConsumables);
reagentConsumables1.setReagentConsumableId(IdWorker.get32UUID().toUpperCase()); reagentConsumables1.setReagentConsumableId(IdWorker.get32UUID().toUpperCase());
reagentConsumables1.setReagentConsumableName(standardReserveSolution.getSolutionName()); reagentConsumables1.setReagentConsumableName(standardReserveSolution.getSolutionName());
reagentConsumables1.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration()); reagentConsumables1.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration());
@ -138,166 +148,203 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
reagentConsumables1.setUpdateTime(LocalDateTime.now()); reagentConsumables1.setUpdateTime(LocalDateTime.now());
reagentConsumablesService.save(reagentConsumables1); reagentConsumablesService.save(reagentConsumables1);
} //创建标准储备溶液的库存对象
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory();
if (standardReserveSolutionService.save(standardReserveSolution)) { BeanUtils.copyProperties(reagentConsumables1, reagentConsumableInventory);
StandardReserveSolutionVO standardReserveSolutionVOById = standardReserveSolutionService.getStandardReserveSolutionVOById(standardReserveSolution.getId()); reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase());
return standardReserveSolutionVOById; reagentConsumableInventory.setStatus(1);
} else throw new RuntimeException(String.format("配置失败"));
}
@Override//标准储备溶液入库任务 reagentConsumableInventory.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration());
@Transactional reagentConsumableInventory.setCreateTime(LocalDateTime.now());
public IPage<StandardReserveSolutionVO> getStandardReserveSolutionVOList(IPage<StandardReserveSolution> page, QueryWrapper<StandardReserveSolution> qw) { reagentConsumableInventory.setUpdateTime(LocalDateTime.now());
reagentConsumableInventory.setTotalQuantity(0);
IPage<StandardReserveSolutionVO> standardReserveSolutionVOPage = baseMapper.getStandardReserveSolutionVOPage(page, qw); //创建标准储备溶液对象
ReferenceMaterial referenceMaterial = new ReferenceMaterial();
//获取当前年月日
LocalDate date = LocalDate.now(); // get the current date
//获取当前年月日
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
List<StandardReserveSolutionVO> records = standardReserveSolutionVOPage.getRecords(); String format = date.format(formatter);
for (StandardReserveSolutionVO record : records) { String prefix = reagentConsumableInventory.getEnglishName() + "-" + format+"-";
ReferenceMaterial byId = referenceMaterialService.getById(record.getReferenceId()); List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
.likeRight("number", prefix)
.orderByDesc("number"));
if (byId!=null) { int newNo = 1;
record.setLocation(byId.getLocation());
record.setLatticeId(byId.getLatticeId()); if ((list != null) && (list.size() > 0)) {
ReferenceMaterial referenceMaterial1 = list.get(0);
String strMaxNo = StrUtil.removePrefixIgnoreCase(referenceMaterial1.getNumber(), prefix);
try {
int maxno = Integer.parseUnsignedInt(strMaxNo);
newNo = maxno + 1;
} catch (NumberFormatException e) {
// 如果后缀有非数字, 则无视之, 重头编码
newNo = 1;
} }
} }
//创建标准溶液对象,并生成编号
referenceMaterial.setStatus(-4);
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setReagentConsumableId(reagentConsumableInventory.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
referenceMaterial.setNumber(reagentConsumableInventory.getEnglishName() + "-" + format + "-" + newNo);
ReferenceMaterial byId1 = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId());
return standardReserveSolutionVOPage; BatchDetails batchDetails = batchDetailsService.getById(byId.getBatchDetailsId());
}
@Override//标准储备溶液配置入库 referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
@Transactional
public StandardReserveSolutionFullVO warehousingById(StandardReserveSolutionFullDTO standardReserveSolutionFullDTO) {
String id = standardReserveSolutionFullDTO.getId(); referenceMaterialService.save(referenceMaterial);
String location = standardReserveSolutionFullDTO.getLocation(); standardReserveSolution.setReferenceId(referenceMaterial.getId());
String latticeId = standardReserveSolutionFullDTO.getLatticeId();
String boxId = standardReserveSolutionFullDTO.getBoxId();
String warehousingRemarks = standardReserveSolutionFullDTO.getWarehousingRemarks();
//提供格子位置与标准储备溶液配置表ID
StandardReserveSolution byId = standardReserveSolutionService.getById(id);
ReferenceMaterial byId1 = referenceMaterialService.getById(byId.getReferenceMaterialId()); standardReserveSolution.setSolutionNumbering(referenceMaterial.getNumber());
remoteCabinetService.updateCabinet(standardReserveSolutionFullDTO.getLatticeId(),byId1.getId(),"1"); if (reagentConsumableInventoryService.save(reagentConsumableInventory) && this
.save(standardReserveSolution)) {
StandardReserveSolutionFullVO byFullVOId = this.getByFullVOId(standardReserveSolution.getId());
return byFullVOId;
} else {
throw new RuntimeException(String.format("配置失败"));
}
BatchDetails batchDetails = batchDetailsService.getById(byId1.getBatchDetailsId()); } else {
LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); ReferenceMaterial byId1 = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId());
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName, byId.getSolutionName()); BatchDetails batchDetails = batchDetailsService.getById(byId1.getBatchDetailsId());
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration, byId.getConfigurationConcentration()); ReferenceMaterial referenceMaterial = new ReferenceMaterial();
//查询出该标准储备溶液的对象
ReagentConsumables reagentConsumables = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper);
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); LocalDate date = LocalDate.now(); // get the current date
//获取当前年月日
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, reagentConsumables.getReagentConsumableId()); String format = date.format(formatter);
//判断仓库是否存在过该标准储备溶液 (标准储备溶液ID与标准物质共用一个RMID,但标准储备溶液具有)
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper);
//若不存在,则创建一条该标准储备溶液的仓库信息记录表
if (one == null) {
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory(); //创建标准溶液对象,并生成编号
referenceMaterial.setStatus(-4);
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setReagentConsumableId(one.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId());
BeanUtils.copyProperties(reagentConsumables, reagentConsumableInventory); Calendar calendar = Calendar.getInstance();
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); int year = calendar.get(Calendar.YEAR);
reagentConsumableInventory.setStatus(1); String prefix = one.getEnglishName() + "-" + format+"-";
reagentConsumableInventory.setConfigurationConcentration(byId.getConfigurationConcentration()); List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
reagentConsumableInventory.setCreateTime(LocalDateTime.now()); .likeRight("number", prefix)
reagentConsumableInventory.setUpdateTime(LocalDateTime.now()); .orderByDesc("number"));
int newNo = 1;
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); if ((list != null) && (list.size() > 0)) {
//获取当前年月日 ReferenceMaterial referenceMaterial1 = list.get(0);
Date date = new Date(); String strMaxNo = StrUtil.removePrefixIgnoreCase(referenceMaterial1.getNumber(), prefix);
try {
int maxno = Integer.parseUnsignedInt(strMaxNo);
newNo = maxno + 1;
} catch (NumberFormatException e) {
// 如果后缀有非数字, 则无视之, 重头编码
newNo = 1;
}
}
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); referenceMaterial.setNumber(one.getEnglishName() + "-" + format + "-" + newNo);
formatter.format(date);
//创建标准溶液对象,并生成编号
referenceMaterial.setStatus(0);
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setReagentConsumableId(reagentConsumableInventory.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
referenceMaterial.setNumber(reagentConsumableInventory.getEnglishName() + "-" + formatter.format(date));
referenceMaterial.setLatticeId(latticeId);
referenceMaterial.setLocation(standardReserveSolutionFullDTO.getLocation());
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
referenceMaterial.setBoxId(boxId);
byId.setReferenceId(referenceMaterial.getId()); standardReserveSolution.setReferenceId(referenceMaterial.getId());
referenceMaterialService.save(referenceMaterial); referenceMaterialService.save(referenceMaterial);
//将存储信息录入仓库表
reagentConsumableInventory.setTotalQuantity(1); standardReserveSolution.setSolutionNumbering(referenceMaterial.getNumber());
reagentConsumableInventory.setStorageLife(byId.getValidityPeriod());
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
batchDetails.setLatticeId(latticeId);
byId.setSolutionNumbering(referenceMaterial.getNumber()); if (this.save(standardReserveSolution)) {
byId.setStatus(1); StandardReserveSolutionVO standardReserveSolutionVOById = this.getStandardReserveSolutionVOById(standardReserveSolution.getId());
byId.setWarehousingRemarks(warehousingRemarks); return standardReserveSolutionVOById;
} else throw new RuntimeException(String.format("配置失败"));
if (reagentConsumableInventoryService.save(reagentConsumableInventory) && standardReserveSolutionService
.updateById(byId)) {
StandardReserveSolutionFullVO byFullVOId = standardReserveSolutionService.getByFullVOId(byId.getId());
return byFullVOId;
} else {
throw new RuntimeException(String.format("入库失败"));
} }
} else { }
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); @Override//标准储备溶液入库任务
//获取当前年月日 @Transactional
Date date = new Date(); public IPage<StandardReserveSolutionVO> getStandardReserveSolutionVOList(IPage<StandardReserveSolution> page, QueryWrapper<StandardReserveSolution> qw) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-mm-dd"); IPage<StandardReserveSolutionVO> standardReserveSolutionVOPage = baseMapper.getStandardReserveSolutionVOPage(page, qw);
formatter.format(date); List<StandardReserveSolutionVO> records = standardReserveSolutionVOPage.getRecords();
//创建标准溶液对象,并生成编号
referenceMaterial.setStatus(0);
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setReagentConsumableId(one.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId());
referenceMaterial.setNumber(one.getEnglishName() + "-" + formatter.format(date));
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());
referenceMaterial.setLatticeId(latticeId);
referenceMaterial.setLocation(standardReserveSolutionFullDTO.getLocation());
referenceMaterial.setBoxId(boxId);
byId.setReferenceId(referenceMaterial.getId()); for (StandardReserveSolutionVO record : records) {
referenceMaterialService.save(referenceMaterial); ReferenceMaterial byId = referenceMaterialService.getById(record.getReferenceId());
//将存储信息录入仓库表
one.setTotalQuantity(one.getTotalQuantity() + 1); if (byId != null) {
one.setStorageLife(byId.getValidityPeriod()); record.setLocation(byId.getLocation());
record.setLatticeId(byId.getLatticeId());
}
} }
return standardReserveSolutionVOPage;
}
@Override//标准储备溶液配置入库
@Transactional
public StandardReserveSolutionFullVO warehousingById(StandardReserveSolutionFullDTO standardReserveSolutionFullDTO) {
String id = standardReserveSolutionFullDTO.getId();
String location = standardReserveSolutionFullDTO.getLocation();
String latticeId = standardReserveSolutionFullDTO.getLatticeId();
String boxId = standardReserveSolutionFullDTO.getBoxId();
String warehousingRemarks = standardReserveSolutionFullDTO.getWarehousingRemarks();
//提供格子位置与标准储备溶液配置表ID
StandardReserveSolution byId = this.getById(id);
byId.setStatus(1); byId.setStatus(1);
byId.setWarehousingRemarks(warehousingRemarks); byId.setWarehousingRemarks(warehousingRemarks);
//为标准储备溶液对象赋值位置信息
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(byId.getReferenceId());
referenceMaterialServiceById.setBoxId(boxId);
referenceMaterialServiceById.setLocation(location);
referenceMaterialServiceById.setLatticeId(latticeId);
referenceMaterialServiceById.setStatus(0);
referenceMaterialService.updateById(referenceMaterialServiceById);
if (standardReserveSolutionService.updateById(byId) && reagentConsumableInventoryService.updateById(one)) { ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterialServiceById.getReagentConsumableInventoryId());
StandardReserveSolutionFullVO byFullVOId = standardReserveSolutionService.getByFullVOId(byId.getId()); if (reagentConsumableInventory.getTotalQuantity() != null) {
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + 1);
} else {
reagentConsumableInventory.setTotalQuantity(1);
}
if (this.updateById(byId) && reagentConsumableInventoryService.updateById(reagentConsumableInventory)) {
StandardReserveSolutionFullVO byFullVOId = this.getByFullVOId(byId.getId());
return byFullVOId; return byFullVOId;
} else { } else {
throw new RuntimeException(String.format("入库失败")); throw new RuntimeException(String.format("入库失败"));
@ -307,7 +354,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
@Override//通过ID查找已入库的标准储备溶液信息 @Override//通过ID查找已入库的标准储备溶液信息
public StandardReserveSolutionFullVO getByFullVOId(String id) { public StandardReserveSolutionFullVO getByFullVOId(String id) {
StandardReserveSolutionVO standardReserveSolutionVOById = standardReserveSolutionService.getStandardReserveSolutionVOById(id); StandardReserveSolutionVO standardReserveSolutionVOById = this.getStandardReserveSolutionVOById(id);
StandardReserveSolutionFullVO standardReserveSolutionFullVO = new StandardReserveSolutionFullVO(); StandardReserveSolutionFullVO standardReserveSolutionFullVO = new StandardReserveSolutionFullVO();
@ -315,6 +362,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
return standardReserveSolutionFullVO; return standardReserveSolutionFullVO;
} }
@Override @Override
public void standardReserveSolutionTablePDF(StandardReserveSolutionVO standardReserveSolutionVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { public void standardReserveSolutionTablePDF(StandardReserveSolutionVO standardReserveSolutionVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
System.out.println("standardReserveSolutionTablePDF................."); System.out.println("standardReserveSolutionTablePDF.................");

@ -48,9 +48,6 @@ import java.util.List;
@SuppressWarnings("all") @SuppressWarnings("all")
public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSolutionCurveMapper, StandardSolutionCurve> implements StandardSolutionCurveService { public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSolutionCurveMapper, StandardSolutionCurve> implements StandardSolutionCurveService {
@Autowired
private StandardSolutionCurveService standardSolutionCurveService;
@Autowired @Autowired
private StandardReserveSolutionService standardReserveSolutionService; private StandardReserveSolutionService standardReserveSolutionService;
@ -108,7 +105,7 @@ public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSoluti
standardSolutionCurve.setReferenceMaterialId(referenceMaterial.getId()); standardSolutionCurve.setReferenceMaterialId(referenceMaterial.getId());
standardSolutionCurve.setDispenserId(dlpUser.getId()); standardSolutionCurve.setDispenserId(dlpUser.getId());
if (standardSolutionCurveService.save(standardSolutionCurve)) { if (this.save(standardSolutionCurve)) {
return standardSolutionCurve; return standardSolutionCurve;
} else throw new RuntimeException(String.format("配置失败")); } else throw new RuntimeException(String.format("配置失败"));

@ -2,6 +2,7 @@ package digital.laboratory.platform.reagent.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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 digital.laboratory.platform.reagent.dto.SupplierInformationDTO; import digital.laboratory.platform.reagent.dto.SupplierInformationDTO;
import digital.laboratory.platform.reagent.entity.EvaluationForm; import digital.laboratory.platform.reagent.entity.EvaluationForm;
@ -28,9 +29,6 @@ import java.util.List;
@Service @Service
public class SupplierInformationServiceImpl extends ServiceImpl<SupplierInformationMapper, SupplierInformation> implements SupplierInformationService { public class SupplierInformationServiceImpl extends ServiceImpl<SupplierInformationMapper, SupplierInformation> implements SupplierInformationService {
@Autowired
private SupplierInformationService supplierInformationService;
@Autowired @Autowired
private EvaluationFormService evaluationFormService; private EvaluationFormService evaluationFormService;
@ -45,7 +43,7 @@ public class SupplierInformationServiceImpl extends ServiceImpl<SupplierInformat
LambdaQueryWrapper<SupplierInformation> supplierInformationQueryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<SupplierInformation> supplierInformationQueryWrapper = new LambdaQueryWrapper();
List<SupplierInformation> list = supplierInformationService.list(supplierInformationQueryWrapper); List<SupplierInformation> list = this.list(supplierInformationQueryWrapper);
if (list.size() != 0) { if (list.size() != 0) {
@ -53,13 +51,14 @@ public class SupplierInformationServiceImpl extends ServiceImpl<SupplierInformat
if (information.getSupplierName().equals(supplierInformationDTO.getSupplierName())) { if (information.getSupplierName().equals(supplierInformationDTO.getSupplierName())) {
throw new RuntimeException(String.format("该供应商信息已存在")); throw new RuntimeException(String.format("该供应商信息已存在"));
} }
}} }
}
BeanUtils.copyProperties(supplierInformationDTO, supplierInformation); BeanUtils.copyProperties(supplierInformationDTO, supplierInformation);
supplierInformation.setId(IdWorker.get32UUID().toUpperCase()); supplierInformation.setId(IdWorker.get32UUID().toUpperCase());
supplierInformationService.save(supplierInformation); this.save(supplierInformation);
return supplierInformation; return supplierInformation;
@ -68,20 +67,27 @@ public class SupplierInformationServiceImpl extends ServiceImpl<SupplierInformat
@Override @Override
public SupplierInformation editInfoById(SupplierInformationDTO supplierInformationDTO) { public SupplierInformation editInfoById(SupplierInformationDTO supplierInformationDTO) {
SupplierInformation byId = supplierInformationService.getById(supplierInformationDTO.getId()); SupplierInformation supplier_name = this.getOne(Wrappers.<SupplierInformation>query().eq("supplier_name", supplierInformationDTO.getSupplierName()));
if (supplier_name != null) {
throw new RuntimeException(String.format("该供应商信息已存在"));
}
SupplierInformation byId = this.getById(supplierInformationDTO.getId());
BeanUtils.copyProperties(supplierInformationDTO, byId); BeanUtils.copyProperties(supplierInformationDTO, byId);
if (supplierInformationService.updateById(byId)) { if (this.updateById(byId)) {
return byId; return byId;
} else { } else {
return null; return null;
} }
} }
@Override @Override
public SupplierInformationVO getVOById(String supplierInformationId) { public SupplierInformationVO getVOById(String supplierInformationId) {
SupplierInformation supplierInformation = supplierInformationService.getById(supplierInformationId); SupplierInformation supplierInformation = this.getById(supplierInformationId);
SupplierInformationVO supplierInformationVO = new SupplierInformationVO(); SupplierInformationVO supplierInformationVO = new SupplierInformationVO();
@ -95,6 +101,4 @@ public class SupplierInformationServiceImpl extends ServiceImpl<SupplierInformat
} }
} }

@ -64,10 +64,7 @@ public class WarehousingBatchListServiceImpl extends ServiceImpl<WarehousingBatc
} }
} }
warehousingBatchListVO.setIdList(rvos); warehousingBatchListVO.setIdList(rvos);
} }
return warehousingBatchListVOList; return warehousingBatchListVOList;
} }
} }

@ -1,8 +1,5 @@
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 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.conditions.query.QueryWrapper;
@ -11,33 +8,22 @@ 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.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.*; import digital.laboratory.platform.reagent.vo.*;
import digital.laboratory.platform.sys.feign.RemoteCabinetService; import digital.laboratory.platform.sys.feign.RemoteCabinetService;
import feign.Response;
//import io.seata.spring.annotation.GlobalTransactional; //import io.seata.spring.annotation.GlobalTransactional;
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;
/** /**
@ -49,9 +35,6 @@ import java.util.List;
@Service @Service
@SuppressWarnings("all") @SuppressWarnings("all")
public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRecordFormMapper, WarehousingRecordForm> implements WarehousingRecordFormService { public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRecordFormMapper, WarehousingRecordForm> implements WarehousingRecordFormService {
@Autowired
private WarehousingRecordFormService warehousingRecordFormService;
@Autowired @Autowired
private WarehousingContentService warehousingContentService; private WarehousingContentService warehousingContentService;
@ -111,7 +94,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
@Override//查看采购入库 @Override//查看采购入库
public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) { public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) {
WarehousingRecordForm byId = warehousingRecordFormService.getById(warehousingFormId); WarehousingRecordForm byId = this.getById(warehousingFormId);
WarehousingRecordFormVO warehousingRecordFormVO = new WarehousingRecordFormVO(); WarehousingRecordFormVO warehousingRecordFormVO = new WarehousingRecordFormVO();
@ -127,22 +110,19 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
@Transactional @Transactional
@Override//录入入库明细 @Override//录入入库明细
public WarehousingRecordFormVO addFormById(List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, DLPUser dlpUser) { public WarehousingRecordFormVO addFormById(WarehousingRecordFormDTO warehousingRecordFormDTO, DLPUser dlpUser) {
for (WarehousingRecordFormDTO warehousingRecordFormDTO : warehousingRecordFormDTOList) {
if (warehousingRecordFormDTO.getLatticeId().isEmpty() & warehousingRecordFormDTO.getLocation().isEmpty() & if (warehousingRecordFormDTO.getLatticeId().isEmpty() & warehousingRecordFormDTO.getLocation().isEmpty() &
warehousingRecordFormDTO.getBoxId().isEmpty()) { warehousingRecordFormDTO.getBoxId().isEmpty()) {
throw new RuntimeException(String.format("请选择存放位置后再进行提交")); throw new RuntimeException(String.format("请选择存放位置后再进行提交"));
} }
}
boolean flag = true; boolean flag = true;
int i = 0; int i = 0;
//签收内容循环
for (WarehousingRecordFormDTO warehousingRecordFormDTO : warehousingRecordFormDTOList) {
String latticeId = warehousingRecordFormDTO.getLatticeId(); String latticeId = warehousingRecordFormDTO.getLatticeId();
//录入签收批次信息 //录入签收批次信息
@ -203,13 +183,17 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
BatchDetails batchDetails = new BatchDetails(); BatchDetails batchDetails = new BatchDetails();
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
BeanUtils.copyProperties(warehousingRecordFormDTO, batchDetails); BeanUtils.copyProperties(warehousingRecordFormDTO, batchDetails);
batchDetails.setBatchDetailsId(IdWorker.get32UUID().toUpperCase()); batchDetails.setBatchDetailsId(IdWorker.get32UUID().toUpperCase());
batchDetails.setServiceStatus(1); batchDetails.setServiceStatus(1);
batchDetails.setPurchaseTime(LocalDateTime.now()); batchDetails.setPurchaseTime(LocalDateTime.now());
batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId()); batchDetails.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
batchDetails.setSupplierId(byId.getSupplierId()); batchDetails.setSupplierId(byId.getSupplierId());
batchDetails.setBatch(1); batchDetails.setBatch(year + "-" + 1);
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate()); batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate());
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity() * Integer.valueOf(reagentConsumables.getPackagedCopies())); batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity() * Integer.valueOf(reagentConsumables.getPackagedCopies()));
batchDetails.setWarehousingBatchListId(warehousingBatchList.getId()); batchDetails.setWarehousingBatchListId(warehousingBatchList.getId());
@ -257,10 +241,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
//更新格子信息(标准物质传入对象ID) //更新格子信息(标准物质传入对象ID)
remoteCabinetService.updateCabinet(latticeId, referenceMaterial.getId(), "1"); remoteCabinetService.updateCabinet(latticeId, referenceMaterial.getId(), "1");
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
String location = warehousingRecordFormDTO.getLocation(); String location = warehousingRecordFormDTO.getLocation();
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(1) + "-"; String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(1) + "-";
@ -321,13 +301,23 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
batchDetails.setWarehousingBatchListId(warehousingBatchList.getId()); batchDetails.setWarehousingBatchListId(warehousingBatchList.getId());
warehousingBatchList.setBatchId(batchDetails.getBatchDetailsId()); warehousingBatchList.setBatchId(batchDetails.getBatchDetailsId());
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
Integer years = Integer.valueOf(year);
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())
.like( "batch",years));
if (batchDetailsList.size() == 0) { if (batchDetailsList.size() == 0) {
batchDetails.setBatch(1); batchDetails.setBatch(year + "-" + 1);
} else { } else {
batchDetails.setBatch(batchDetailsList.size() + 1); Integer x = batchDetailsList.size() + 1;
batchDetails.setBatch(year + "-" +x );
} }
if (one.getCategory().equals("试剂") | one.getCategory().equals("耗材")) { if (one.getCategory().equals("试剂") | one.getCategory().equals("耗材")) {
batchDetails.setLocation(warehousingRecordFormDTO.getLocation()); batchDetails.setLocation(warehousingRecordFormDTO.getLocation());
@ -357,9 +347,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
//更新格子信息(试剂耗材传入类ID) //更新格子信息(试剂耗材传入类ID)
remoteCabinetService.updateCabinet(latticeId, referenceMaterial.getId(), "1"); remoteCabinetService.updateCabinet(latticeId, referenceMaterial.getId(), "1");
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
String location = warehousingRecordFormDTO.getLocation(); String location = warehousingRecordFormDTO.getLocation();
@ -393,20 +380,19 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
batchDetailsService.save(batchDetails); batchDetailsService.save(batchDetails);
} }
warehousingBatchListService.save(warehousingBatchList); warehousingBatchListService.save(warehousingBatchList);
}
LambdaQueryWrapper<WarehousingContent> warehousingContentLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<WarehousingContent> warehousingContentLambdaQueryWrapper = new LambdaQueryWrapper<>();
WarehousingContent byId = warehousingContentService.getById(warehousingRecordFormDTOList.get(0).getWarehousingContentId()); WarehousingContent byId1 = warehousingContentService.getById(warehousingRecordFormDTO.getWarehousingContentId());
String warehousingRecordFormId = byId.getWarehousingRecordFormId(); String warehousingRecordFormId = byId1.getWarehousingRecordFormId();
warehousingContentLambdaQueryWrapper.eq(WarehousingContent::getWarehousingRecordFormId, warehousingRecordFormId); warehousingContentLambdaQueryWrapper.eq(WarehousingContent::getWarehousingRecordFormId, warehousingRecordFormId);
List<WarehousingContent> list = warehousingContentService.list(warehousingContentLambdaQueryWrapper); List<WarehousingContent> list = warehousingContentService.list(warehousingContentLambdaQueryWrapper);
WarehousingRecordForm warehousingRecordForm = warehousingRecordFormService.getById(warehousingRecordFormId); WarehousingRecordForm warehousingRecordForm = this.getById(warehousingRecordFormId);
//遍历采购内容,判断试剂耗材是否入库完毕 //遍历采购内容,判断试剂耗材是否入库完毕
@ -434,7 +420,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
List<SupplierInformation> supplierInformations = new ArrayList<>(); List<SupplierInformation> supplierInformations = new ArrayList<>();
//创建供应商评价表 //创建供应商评价表
/* /*
通过循环签收内容获得所有的供应商列表 通过循环签收内容获得所有的供应商列表
@ -467,9 +452,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
warehousingRecordForm.setStatus(1); warehousingRecordForm.setStatus(1);
} }
warehousingRecordFormService.updateById(warehousingRecordForm); this.updateById(warehousingRecordForm);
WarehousingRecordFormVO warehousingRecordFormVO = warehousingRecordFormService.getWarehousingRecordFormVO(warehousingRecordFormId); WarehousingRecordFormVO warehousingRecordFormVO = this.getWarehousingRecordFormVO(warehousingRecordFormId);
return warehousingRecordFormVO; return warehousingRecordFormVO;
} }
@ -503,7 +488,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
public List<PurchaseRequestPrintVO> getPurchaseRequestPrint(String id) { public List<PurchaseRequestPrintVO> getPurchaseRequestPrint(String id) {
WarehousingRecordForm byId = warehousingRecordFormService.getById(id); WarehousingRecordForm byId = this.getById(id);
List<WarehousingContent> warehousingContentList = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", id)); List<WarehousingContent> warehousingContentList = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", id));

@ -1,20 +0,0 @@
package digital.laboratory.platform.reagent.status;
public enum DataStatus {
Not_Submitted(0,"未提交"),
Have_Submitted(1,"已提交"),
Have_Audit(2,"已审核"),
Have_Approved(3,"已审批"),
HaveBeenReleased(4,"已发布"),
Failed_To_Pass_The_Audit(-1,"审核未通过"),
Failed_To_Pass_The_Approve(-2,"审批未通过");
private Integer code;
private String message;
private DataStatus (Integer code,String message) {
this.code=code;
this.message=message;
}}

@ -35,8 +35,6 @@ public class MaturityCalculation {
@Scheduled(cron = "0 0 0 * * ? ") @Scheduled(cron = "0 0 0 * * ? ")
public void calculate() { public void calculate() {
//查找出有库存量的物品所有批次信息(状态为1) //查找出有库存量的物品所有批次信息(状态为1)
List<BatchDetails> list1 = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("service_status", 1)); List<BatchDetails> list1 = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("service_status", 1));
String warningInformation = null; String warningInformation = null;
@ -46,19 +44,13 @@ public class MaturityCalculation {
warningInformation = "即将过期"; warningInformation = "即将过期";
batchDetails.setWarningInformation(warningInformation); batchDetails.setWarningInformation(warningInformation);
batchDetailsService.updateById(batchDetails); batchDetailsService.updateById(batchDetails);
} else if (batchDetails.getExpirationDate().isBefore(LocalDate.now())) { }
if (batchDetails.getExpirationDate().isBefore(LocalDate.now())) {
warningInformation = "已过期"; warningInformation = "已过期";
batchDetails.setWarningInformation(warningInformation); batchDetails.setWarningInformation(warningInformation);
batchDetailsService.updateById(batchDetails); batchDetailsService.updateById(batchDetails);
} }
if (batchDetails.getCreateTime().plusMonths(Integer.valueOf(batchDetails.getLimitDate())).isBefore(LocalDateTime.now().plusDays(7))) {
batchDetails.setWarningInformation(batchDetails.getWarningInformation() + ",即将到达存储期限");
} else if (batchDetails.getCreateTime().plusMonths(Integer.valueOf(batchDetails.getLimitDate())).isBefore(LocalDateTime.now())) {
batchDetails.setWarningInformation("已超过存储期限");
}
} }
List<StandardReserveSolution> list = standardReserveSolutionService.list(Wrappers.<StandardReserveSolution>query() List<StandardReserveSolution> list = standardReserveSolutionService.list(Wrappers.<StandardReserveSolution>query()
.eq("status", 1)); .eq("status", 1));
@ -66,14 +58,7 @@ public class MaturityCalculation {
for (StandardReserveSolution standardReserveSolution : list) { for (StandardReserveSolution standardReserveSolution : list) {
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId()); ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId());
if (referenceMaterialServiceById.getStatus() != -4) {
if (standardReserveSolution.getConfigurationDate().plusMonths(standardReserveSolution.getValidityPeriod()).isBefore(LocalDateTime.now().plusDays(7))) {
standardReserveSolution.setWarningInformation("即将到达存储期限");
} else if (standardReserveSolution.getConfigurationDate().plusMonths(standardReserveSolution.getValidityPeriod()).isBefore(LocalDateTime.now())) {
standardReserveSolution.setWarningInformation("已超过存储期限");
}
}
standardReserveSolutionService.updateById(standardReserveSolution); standardReserveSolutionService.updateById(standardReserveSolution);
} }
@ -96,7 +81,7 @@ public class MaturityCalculation {
ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId()); ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(standardReserveSolution.getReferenceId());
if (referenceMaterialServiceById.getStatus() == -4) { if (referenceMaterialServiceById.getStatus() == -4) {
standardReserveSolution.setWarningInformation("已全部使用完毕"); standardReserveSolution.setWarningInformation("已全部使用完毕或已报废");
} }
} }
@ -114,7 +99,6 @@ public class MaturityCalculation {
reagentConsumableInventory.setWarningInformation("库存不足"); reagentConsumableInventory.setWarningInformation("库存不足");
System.out.println("计算库存信息");
} else { } else {
reagentConsumableInventory.setWarningInformation("库存充足"); reagentConsumableInventory.setWarningInformation("库存充足");
} }

@ -1,4 +1,4 @@
package digital.laboratory.platform.reagent.config; package digital.laboratory.platform.reagent.utils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

@ -0,0 +1,162 @@
package digital.laboratory.platform.reagent.utils;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.oned.Code128Writer;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import org.springframework.util.StringUtils;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class QRCodeUtils {
//二维码
public static String getQRCodeImageBase64(String content, int width, int height) {
if (!StringUtils.isEmpty(content)) {
ServletOutputStream stream = null;
HashMap<EncodeHintType, Comparable> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.MARGIN, 0);
try {
QRCodeWriter writer = new QRCodeWriter();
BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, width, height, hints);
BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(bufferedImage, "png", os);
BASE64Encoder encoder = new BASE64Encoder();
String resultImage = new String("data:image/png;base64," + encoder.encode(os.toByteArray()));
return resultImage;
} catch (Exception e) {
} finally {
if (stream != null) {
try {
stream.flush();
stream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
return null;
}
//二维码
public static BufferedImage genQRCode(String content, int width, int height) {
if (!StringUtils.isEmpty(content)) {
HashMap<EncodeHintType, Comparable> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.MARGIN, 0);
try {
QRCodeWriter writer = new QRCodeWriter();
BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, width, height, hints);
BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
return bufferedImage;
} catch (Exception e) {
} finally {
}
}
return null;
}
//打印条形码
public static String getBarCode128ImageBase64(String content, int width, int height) {
try {
Map<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.MARGIN, 0);
int realWidth = getBarCode128NoPaddingWidth(width, content, width);
BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.CODE_128, realWidth, height, hints);
BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(bufferedImage, "png", os);
BASE64Encoder encoder = new BASE64Encoder();
String resultImage = new String("data:image/png;base64," + encoder.encode(os.toByteArray()));
return resultImage;
} catch (Exception e) {
return null;
}
}
private static int getBarCode128NoPaddingWidth(int expectWidth, String contents, int maxWidth) {
boolean[] code = new Code128Writer().encode(contents);
int inputWidth = code.length;
double outputWidth = (double) Math.max(expectWidth, inputWidth);
double multiple = outputWidth / inputWidth;
//优先取大的
int returnVal = 0;
int ceil = (int) Math.ceil(multiple);
if (inputWidth * ceil <= maxWidth) {
returnVal = inputWidth * ceil;
} else {
int floor = (int) Math.floor(multiple);
returnVal = inputWidth * floor;
}
return returnVal;
}
public static String getBarCode93ImageBase64(String content, int width, int height) {
try {
Map<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.MARGIN, 0);
int realWidth = getBarCode128NoPaddingWidth(width, content, width);
BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.CODE_93, realWidth, height, hints);
BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(bufferedImage, "png", os);
BASE64Encoder encoder = new BASE64Encoder();
String resultImage = new String("data:image/png;base64," + encoder.encode(os.toByteArray()));
return resultImage;
} catch (Exception e) {
return null;
}
}
/**
* 打印条码
*
* @param
* @return
*/
}

@ -1,14 +0,0 @@
package digital.laboratory.platform.reagent.utils;
import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
public class String2DateConverter {
public Date convert(String s) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return (Date) sdf.parse(s);
}
}

@ -33,10 +33,13 @@ public class AcceptanceRecordFormVO extends AcceptanceRecordForm {
@ApiModelProperty(value = "(试剂耗材对象)") @ApiModelProperty(value = "(试剂耗材对象)")
private ReagentConsumables reagentConsumables; private ReagentConsumables reagentConsumables;
private String type = "验收记录"; private String type = "验收记录";
private String createName; private String createName;
/*
* 打印参数*/
private Boolean theSameBrandAndModelPrint; private Boolean theSameBrandAndModelPrint;
private Boolean consistentQuantityPrint; private Boolean consistentQuantityPrint;
private Boolean packingInGoodConditionPrint; private Boolean packingInGoodConditionPrint;
@ -44,4 +47,7 @@ public class AcceptanceRecordFormVO extends AcceptanceRecordForm {
private Boolean deliveryCyclePrint; private Boolean deliveryCyclePrint;
private String department;
} }

@ -2,7 +2,6 @@ package digital.laboratory.platform.reagent.vo;
import digital.laboratory.platform.reagent.entity.CentralizedRequest; import digital.laboratory.platform.reagent.entity.CentralizedRequest;
import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; import digital.laboratory.platform.reagent.entity.DetailsOfCentralized;
import digital.laboratory.platform.reagent.status.DataStatus;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;

@ -21,5 +21,6 @@ public class CheckScheduleVO extends CheckSchedule {
private String createName; private String createName;
private String type = "期间核查计划"; private String type = "期间核查计划";
private String department ;
} }

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

@ -26,12 +26,19 @@ public class EvaluationFormVO extends EvaluationForm {
@ApiModelProperty(value = "(三级评价人名称)") @ApiModelProperty(value = "(三级评价人名称)")
private String threeLevelUserName; private String threeLevelUserName;
@ApiModelProperty(value = "(类型)")
private String type = "供应商评价"; private String type = "供应商评价";
@ApiModelProperty(value = "(提供服务牌或供应品集合)")
private List<ProvideServicesOrSuppliesVO> provideServicesOrSuppliesVOList; private List<ProvideServicesOrSuppliesVO> provideServicesOrSuppliesVOList;
@ApiModelProperty(value = "(提交人姓名)")
private String createName; private String createName;
@ApiModelProperty(value = "(部门)")
private String department;
@ApiModelProperty(value = "(供应商名称)")
private String supplierName; private String supplierName;
} }

@ -17,4 +17,5 @@ public class InstructionBookVO extends InstructionBook {
private String technicalDirectorName; private String technicalDirectorName;
private String department;
} }

@ -14,7 +14,7 @@ public class OutgoingContentsVO extends OutgoingContents {
private ReagentConsumableInventory reagentConsumableInventory; private ReagentConsumableInventory reagentConsumableInventory;
private Integer batch; private String batch;
private String supplierName; private String supplierName;

@ -32,4 +32,6 @@ public class PeriodVerificationImplementationVO extends PeriodVerificationImplem
private String instructionBook; private String instructionBook;
private String department;
} }

@ -15,6 +15,8 @@ public class PeriodVerificationPlanVO extends PeriodVerificationPlan {
private String type = "期间核查计划"; private String type = "期间核查计划";
private String department;
@ApiModelProperty(value = "(打印标签)") @ApiModelProperty(value = "(打印标签)")
private String P; private String P;
private String D; private String D;

@ -24,7 +24,7 @@ public class PurchasingPlanVO extends PurchasingPlan {
private String createName; private String createName;
@ApiModelProperty(value="部门名称") @ApiModelProperty(value="部门名称")
private String orgName; private String department;
@ApiModelProperty(value="采购计划明细") @ApiModelProperty(value="采购计划明细")
private List <ProcurementContentVO> procurementContentVOList; private List <ProcurementContentVO> procurementContentVOList;

@ -36,7 +36,7 @@ public class ReagentConsumableInventoryFullVO extends ReagentConsumableInventory
private String supplierName; private String supplierName;
@ApiModelProperty(value = "批次") @ApiModelProperty(value = "批次")
private Integer batch; private String batch;
@ApiModelProperty(value = "标准物质ID") @ApiModelProperty(value = "标准物质ID")
private String referenceMaterialId; private String referenceMaterialId;

@ -4,6 +4,9 @@ import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data @Data
public class ReferenceMaterialVO extends ReferenceMaterial { public class ReferenceMaterialVO extends ReferenceMaterial {
@ -21,4 +24,6 @@ public class ReferenceMaterialVO extends ReferenceMaterial {
private Integer i ; private Integer i ;
private String codeName; private String codeName;
private LocalDate time;
} }

@ -9,8 +9,6 @@ public class RequisitionRecordVO extends RequisitionRecord {
private String recipientName; private String recipientName;
private String reagentConsumableName;
@ApiModelProperty(value = "领用时间") @ApiModelProperty(value = "领用时间")
private String dateOfClaims; private String dateOfClaims;

@ -14,6 +14,7 @@ public class StandardMaterialApprovalFormVO extends StandardMaterialApprovalForm
private String approverName; private String approverName;
private String secondaryAuditorName; private String secondaryAuditorName;
private String createName; private String createName;
private String department;
private Integer reasonForApplicationPrint; private Integer reasonForApplicationPrint;
private String type = "标准物质停用_报废销毁_恢复_降级使用审批"; private String type = "标准物质停用_报废销毁_恢复_降级使用审批";

@ -52,12 +52,18 @@
<result property="secondaryAuditorName" column="secondary_auditor_name"></result> <result property="secondaryAuditorName" column="secondary_auditor_name"></result>
<result property="threeLevelAuditorName" column="three_level_auditor_name"></result> <result property="threeLevelAuditorName" column="three_level_auditor_name"></result>
<result property="createName" column="create_name"></result> <result property="createName" column="create_name"></result>
<result property="department" column="department"></result>
</resultMap> </resultMap>
<sql id="getAcceptanceRecordFormVOSQL"> <sql id="getAcceptanceRecordFormVOSQL">
SELECT arf.*, SELECT arf.*,
(
select department
from dlp_base.sys_user
where user_id = arf.create_by) as department
,
(select si.supplier_name (select si.supplier_name
from supplier_information si from supplier_information si
where si.id = arf.supplier_id) as supplier_name, where si.id = arf.supplier_id) as supplier_name,
@ -85,6 +91,11 @@
<select id="getAcceptanceRecordFormVO" resultMap="acceptanceRecordFormVO" <select id="getAcceptanceRecordFormVO" resultMap="acceptanceRecordFormVO"
resultType="digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO"> resultType="digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO">
SELECT arf.*, SELECT arf.*,
(
select department
from dlp_base.sys_user
where user_id = arf.create_by) as department
,
(select si.supplier_name (select si.supplier_name
from supplier_information si from supplier_information si
where si.id = arf.supplier_id)as supplier_name, where si.id = arf.supplier_id)as supplier_name,

@ -25,6 +25,8 @@
<result property="minimumUnit" column="minimum_unit"/> <result property="minimumUnit" column="minimum_unit"/>
<result property="casNumber" column="cas_number"/> <result property="casNumber" column="cas_number"/>
<result property="code" column="code"/> <result property="code" column="code"/>
<result property="purityGrade" column="purity_grade"/>
</resultMap> </resultMap>

@ -2,9 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="digital.laboratory.platform.reagent.mapper.TypeTableMapper"> <mapper namespace="digital.laboratory.platform.reagent.mapper.CategoryTableMapper">
<resultMap id="typeTableMap" type="digital.laboratory.platform.reagent.entity.CategoryTable"> <resultMap id="CategoryTableMap" type="digital.laboratory.platform.reagent.entity.CategoryTable">
<id property="id" column="id"/> <id property="id" column="id"/>
<result property="category" column="category"/> <result property="category" column="category"/>
<result property="species" column="species"/> <result property="species" column="species"/>

@ -86,7 +86,7 @@
WHERE user.user_id=cr.audit_id WHERE user.user_id=cr.audit_id
) AS auditor_name ) AS auditor_name
FROM centralized_request cr FROM centralized_request cr
WHERE cr.status = 2 WHERE cr.status = 6
</select> </select>

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

Loading…
Cancel
Save