From bcaad2cb9163e7b1e7c2d4467325f296b5677168 Mon Sep 17 00:00:00 2001 From: chen <2710907404@qq.com> Date: Wed, 13 Nov 2024 09:58:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=201.=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=AF=92=E5=93=81=E5=BA=93=E4=B8=AD=E7=9A=84=E9=A2=86=E7=94=A8?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../imr/controller/DrugUsageRecordController.java | 15 ++++++++++++++- .../platform/imr/vo/DrugMaterialInfoVO.java | 3 +++ .../resources/mapper/DrugMaterialInfoMapper.xml | 11 +++++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/main/java/digital/laboratory/platform/imr/controller/DrugUsageRecordController.java b/src/main/java/digital/laboratory/platform/imr/controller/DrugUsageRecordController.java index bc1deb0..4fb4e20 100644 --- a/src/main/java/digital/laboratory/platform/imr/controller/DrugUsageRecordController.java +++ b/src/main/java/digital/laboratory/platform/imr/controller/DrugUsageRecordController.java @@ -10,9 +10,12 @@ import digital.laboratory.platform.imr.convert.DrugUsageRecordConvert; import digital.laboratory.platform.imr.dto.DrugUsageRecordDTO; import digital.laboratory.platform.imr.entity.DrugMaterialInfo; import digital.laboratory.platform.imr.entity.DrugUsageRecord; +import digital.laboratory.platform.imr.enums.DrugMaterialStatus; import digital.laboratory.platform.imr.mapper.DrugMaterialInfoMapper; import digital.laboratory.platform.imr.query.DrugUsageRecordQuery; +import digital.laboratory.platform.imr.service.CommonFeignService; import digital.laboratory.platform.imr.service.DrugUsageRecordService; +import digital.laboratory.platform.imr.vo.DrugMaterialInfoVO; import digital.laboratory.platform.imr.vo.DrugUsageRecordVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiModelProperty; @@ -22,6 +25,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.List; @RestController @RequestMapping("/drugUsageRecord") @@ -34,6 +38,9 @@ public class DrugUsageRecordController { @Resource private DrugMaterialInfoMapper drugMaterialInfoMapper; + @Resource + private CommonFeignService commonFeignService; + @ApiOperation("毒品检材领用出库") @PostMapping("/outbound") public R outbound(@RequestBody @Valid DrugUsageRecordDTO dto) { @@ -69,7 +76,13 @@ public class DrugUsageRecordController { public R details(@RequestParam("id") String id) { DrugUsageRecord drugUsageRecord = drugUsageRecordService.getById(id); DrugUsageRecordVO drugUsageRecordVO = DrugUsageRecordConvert.entityToVO(drugUsageRecord); - drugUsageRecordVO.setDrugMaterialInfoVOList(drugMaterialInfoMapper.getDrugMaterialVO(Wrappers.query().in("dm.id", drugUsageRecordVO.getDrugIds()))); + List drugMaterialInfoVOS = drugMaterialInfoMapper.getDrugMaterialVO(Wrappers.query() + .in("dm.id", drugUsageRecordVO.getDrugIds())); + drugMaterialInfoVOS.parallelStream().forEach(item -> { + item.setHandingOverOrgName(commonFeignService.remoteGetSysOrg(item.getHandingOverOrg()).getName()); + item.setStatusName(DrugMaterialStatus.fromStatus(item.getStatus()).getDesc()); + }); + drugUsageRecordVO.setDrugMaterialInfoVOList(drugMaterialInfoVOS); return R.ok(drugUsageRecordVO); } diff --git a/src/main/java/digital/laboratory/platform/imr/vo/DrugMaterialInfoVO.java b/src/main/java/digital/laboratory/platform/imr/vo/DrugMaterialInfoVO.java index 93ce01b..3f7f291 100644 --- a/src/main/java/digital/laboratory/platform/imr/vo/DrugMaterialInfoVO.java +++ b/src/main/java/digital/laboratory/platform/imr/vo/DrugMaterialInfoVO.java @@ -37,6 +37,9 @@ public class DrugMaterialInfoVO { @ApiModelProperty("柜子id") private String canineId; + @ApiModelProperty("格子id") + private String storageCellId; + @ApiModelProperty("存放位置") private String storageLocation; diff --git a/src/main/resources/mapper/DrugMaterialInfoMapper.xml b/src/main/resources/mapper/DrugMaterialInfoMapper.xml index a9aaa91..2e1022d 100644 --- a/src/main/resources/mapper/DrugMaterialInfoMapper.xml +++ b/src/main/resources/mapper/DrugMaterialInfoMapper.xml @@ -33,9 +33,10 @@ dc.case_no, dc.handing_over_org, dc.handing_over_date, - ss.id as sampleStorageId, + ss.id AS sampleStorageId, ss.storage_location, - ss.box_id as canineId + ss.box_id AS canineId, + ss.storage_cell_id FROM b_drug_material_info dm LEFT JOIN b_drug_case_info dc ON dm.case_id = dc.id LEFT JOIN b_sample_storage ss ON dm.id = ss.sample_id @@ -45,9 +46,11 @@ - OR dc.case_name LIKE CONCAT('%', #{query.keywords}, '%') + AND ( + dc.case_name LIKE CONCAT('%', #{query.keywords}, '%') OR dm.drug_name LIKE CONCAT('%', #{query.keywords}, '%') OR dm.drug_no LIKE CONCAT('%', #{query.keywords}, '%') + ) AND dc.handing_over_org = #{query.orgId} @@ -55,7 +58,7 @@ AND dm.case_id = #{query.caseId} - + AND dm.status = #{query.status}