From e200924ce19947fb5d69b7078e33b6d7c7032d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B5=B7=E8=88=AA?= <11918452+yang-haihang@user.noreply.gitee.com> Date: Fri, 28 Feb 2025 14:29:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=9A=84=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BE=8B?= =?UTF-8?q?=E5=A6=82=E6=A3=80=E5=87=BA=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...trustMaterialCheckoutResultController.java | 10 ++++++- .../EntrustMaterialCheckoutResultService.java | 3 ++ ...rustMaterialCheckoutResultServiceImpl.java | 29 ++++++++++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustMaterialCheckoutResultController.java b/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustMaterialCheckoutResultController.java index e928638..1c25ce6 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustMaterialCheckoutResultController.java +++ b/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustMaterialCheckoutResultController.java @@ -2,6 +2,7 @@ package digital.laboratory.platform.entrustment.controller; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import digital.laboratory.platform.common.core.exception.CheckedException; import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.entrustment.convert.EntrustMaterialCheckoutResultConvert; @@ -10,11 +11,11 @@ import digital.laboratory.platform.entrustment.query.BaseQuery; import digital.laboratory.platform.entrustment.query.EntrustMaterialCheckoutResultQuery; import digital.laboratory.platform.entrustment.service.EntrustMaterialCheckoutResultService; import digital.laboratory.platform.entrustment.vo.EntrustMaterialCheckoutResultVO; +import digital.laboratory.platform.entrustment.vo.EntrustmentIdentificationMaterialVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; - import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; @@ -93,4 +94,11 @@ public class EntrustMaterialCheckoutResultController { public R getDetectionRateByMaterial(Integer year, String orgId){ return R.ok(entrustMaterialCheckoutResultService.getDetectionRateByMaterial(year, orgId),"查询成功!"); } + + @ApiOperation("根据毒品名称来查询所有检出该毒品的检材列表") + @GetMapping("/getMaterialByDetection") + public R getMaterialByDetection(String drugName, Integer year, Page page){ + return R.ok(entrustMaterialCheckoutResultService.getMaterialByDetection(drugName,year,page)); + } + } diff --git a/src/main/java/digital/laboratory/platform/entrustment/service/EntrustMaterialCheckoutResultService.java b/src/main/java/digital/laboratory/platform/entrustment/service/EntrustMaterialCheckoutResultService.java index c68f3e2..4d550e4 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/service/EntrustMaterialCheckoutResultService.java +++ b/src/main/java/digital/laboratory/platform/entrustment/service/EntrustMaterialCheckoutResultService.java @@ -1,12 +1,14 @@ package digital.laboratory.platform.entrustment.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import digital.laboratory.platform.entrustment.dto.EntrustMaterialCheckoutResultDTO; import digital.laboratory.platform.entrustment.entity.EntrustMaterialCheckoutResult; import digital.laboratory.platform.entrustment.query.EntrustMaterialCheckoutResultQuery; import digital.laboratory.platform.entrustment.vo.DetectionRateVO; import digital.laboratory.platform.entrustment.vo.EntrustMaterialCheckoutResultVO; +import digital.laboratory.platform.entrustment.vo.EntrustmentIdentificationMaterialVO; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -58,6 +60,7 @@ public interface EntrustMaterialCheckoutResultService extends IService getResultType(Integer year, String orgId); + IPage getMaterialByDetection(String drugName, Integer year, Page page); /** * 查询所有毒品的检出率 * diff --git a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustMaterialCheckoutResultServiceImpl.java b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustMaterialCheckoutResultServiceImpl.java index d8102fb..ae9abcb 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustMaterialCheckoutResultServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustMaterialCheckoutResultServiceImpl.java @@ -16,6 +16,7 @@ import digital.laboratory.platform.entrustment.entity.Entrustment; import digital.laboratory.platform.entrustment.entity.EntrustmentIdentificationMaterial; import digital.laboratory.platform.entrustment.enums.EntrustmentStatusConstants; import digital.laboratory.platform.entrustment.mapper.EntrustMaterialCheckoutResultMapper; +import digital.laboratory.platform.entrustment.mapper.EntrustmentIdentificationMaterialMapper; import digital.laboratory.platform.entrustment.query.EntrustMaterialCheckoutResultQuery; import digital.laboratory.platform.entrustment.service.CommonFeignService; import digital.laboratory.platform.entrustment.service.EntrustMaterialCheckoutResultService; @@ -23,6 +24,7 @@ import digital.laboratory.platform.entrustment.service.EntrustmentIdentification import digital.laboratory.platform.entrustment.service.EntrustmentService; import digital.laboratory.platform.entrustment.vo.DetectionRateVO; import digital.laboratory.platform.entrustment.vo.EntrustMaterialCheckoutResultVO; +import digital.laboratory.platform.entrustment.vo.EntrustmentIdentificationMaterialVO; import digital.laboratory.platform.sys.entity.Area; import digital.laboratory.platform.sys.entity.DrugLite; import org.apache.poi.ss.usermodel.*; @@ -58,6 +60,8 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl entrustIdList = getEntrustIdListByOrgId(orgId); + // 查询所有非空且不为空的定性结果,且创建时间大于等于起始时间 List list = this.list(Wrappers.lambdaQuery() .in(CollUtil.isNotEmpty(entrustIdList), EntrustMaterialCheckoutResult::getEntrustId, entrustIdList) @@ -444,6 +449,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl entrustIdList = getEntrustIdListByOrgId(orgId); + // 查询所有非空且不为空的定性结果,且创建时间大于等于起始时间 List materialList = entrustmentIdentificationMaterialService.list(Wrappers.lambdaQuery() .in(CollUtil.isNotEmpty(entrustIdList), EntrustmentIdentificationMaterial::getEntrustmentId, entrustIdList) @@ -484,7 +490,28 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl getMaterialBy + @Override + public IPage getMaterialByDetection(String drugName, Integer year, Page page){ + + List list = this.list(Wrappers.lambdaQuery() + .like(EntrustMaterialCheckoutResult::getQualitativeResult, drugName)); + + ArrayList materialIdList = new ArrayList<>(); + + for (EntrustMaterialCheckoutResult result : list) { + materialIdList.add(result.getId()); + } + + LocalDateTime startTime = this.getStartTime(year); + + Page materialPage = entrustmentIdentificationMaterialService.page(page, Wrappers.lambdaQuery() + .in(EntrustmentIdentificationMaterial::getId, materialIdList) + .ge(EntrustmentIdentificationMaterial::getAcceptTime, startTime) + .orderByDesc(EntrustmentIdentificationMaterial::getAcceptTime)); + return materialPage; + } + + }