1.更新毒品库中的领用出库模块
master
陈江保 2 days ago
parent ab35ba6ae9
commit bcaad2cb91
  1. 15
      src/main/java/digital/laboratory/platform/imr/controller/DrugUsageRecordController.java
  2. 3
      src/main/java/digital/laboratory/platform/imr/vo/DrugMaterialInfoVO.java
  3. 11
      src/main/resources/mapper/DrugMaterialInfoMapper.xml

@ -10,9 +10,12 @@ import digital.laboratory.platform.imr.convert.DrugUsageRecordConvert;
import digital.laboratory.platform.imr.dto.DrugUsageRecordDTO; import digital.laboratory.platform.imr.dto.DrugUsageRecordDTO;
import digital.laboratory.platform.imr.entity.DrugMaterialInfo; import digital.laboratory.platform.imr.entity.DrugMaterialInfo;
import digital.laboratory.platform.imr.entity.DrugUsageRecord; 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.mapper.DrugMaterialInfoMapper;
import digital.laboratory.platform.imr.query.DrugUsageRecordQuery; 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.service.DrugUsageRecordService;
import digital.laboratory.platform.imr.vo.DrugMaterialInfoVO;
import digital.laboratory.platform.imr.vo.DrugUsageRecordVO; import digital.laboratory.platform.imr.vo.DrugUsageRecordVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -22,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List;
@RestController @RestController
@RequestMapping("/drugUsageRecord") @RequestMapping("/drugUsageRecord")
@ -34,6 +38,9 @@ public class DrugUsageRecordController {
@Resource @Resource
private DrugMaterialInfoMapper drugMaterialInfoMapper; private DrugMaterialInfoMapper drugMaterialInfoMapper;
@Resource
private CommonFeignService commonFeignService;
@ApiOperation("毒品检材领用出库") @ApiOperation("毒品检材领用出库")
@PostMapping("/outbound") @PostMapping("/outbound")
public R outbound(@RequestBody @Valid DrugUsageRecordDTO dto) { public R outbound(@RequestBody @Valid DrugUsageRecordDTO dto) {
@ -69,7 +76,13 @@ public class DrugUsageRecordController {
public R details(@RequestParam("id") String id) { public R details(@RequestParam("id") String id) {
DrugUsageRecord drugUsageRecord = drugUsageRecordService.getById(id); DrugUsageRecord drugUsageRecord = drugUsageRecordService.getById(id);
DrugUsageRecordVO drugUsageRecordVO = DrugUsageRecordConvert.entityToVO(drugUsageRecord); DrugUsageRecordVO drugUsageRecordVO = DrugUsageRecordConvert.entityToVO(drugUsageRecord);
drugUsageRecordVO.setDrugMaterialInfoVOList(drugMaterialInfoMapper.getDrugMaterialVO(Wrappers.<DrugMaterialInfo>query().in("dm.id", drugUsageRecordVO.getDrugIds()))); List<DrugMaterialInfoVO> drugMaterialInfoVOS = drugMaterialInfoMapper.getDrugMaterialVO(Wrappers.<DrugMaterialInfo>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); return R.ok(drugUsageRecordVO);
} }

@ -37,6 +37,9 @@ public class DrugMaterialInfoVO {
@ApiModelProperty("柜子id") @ApiModelProperty("柜子id")
private String canineId; private String canineId;
@ApiModelProperty("格子id")
private String storageCellId;
@ApiModelProperty("存放位置") @ApiModelProperty("存放位置")
private String storageLocation; private String storageLocation;

@ -33,9 +33,10 @@
dc.case_no, dc.case_no,
dc.handing_over_org, dc.handing_over_org,
dc.handing_over_date, dc.handing_over_date,
ss.id as sampleStorageId, ss.id AS sampleStorageId,
ss.storage_location, ss.storage_location,
ss.box_id as canineId ss.box_id AS canineId,
ss.storage_cell_id
FROM b_drug_material_info dm FROM b_drug_material_info dm
LEFT JOIN b_drug_case_info dc ON dm.case_id = dc.id 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 LEFT JOIN b_sample_storage ss ON dm.id = ss.sample_id
@ -45,9 +46,11 @@
<include refid="queryVOSQL"/> <include refid="queryVOSQL"/>
<where> <where>
<if test="query.keywords != null and query.keywords != ''"> <if test="query.keywords != null and query.keywords != ''">
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_name LIKE CONCAT('%', #{query.keywords}, '%')
OR dm.drug_no LIKE CONCAT('%', #{query.keywords}, '%') OR dm.drug_no LIKE CONCAT('%', #{query.keywords}, '%')
)
</if> </if>
<if test="query.orgId != null and query.orgId != ''"> <if test="query.orgId != null and query.orgId != ''">
AND dc.handing_over_org = #{query.orgId} AND dc.handing_over_org = #{query.orgId}
@ -55,7 +58,7 @@
<if test="query.caseId != null and query.caseId != ''"> <if test="query.caseId != null and query.caseId != ''">
AND dm.case_id = #{query.caseId} AND dm.case_id = #{query.caseId}
</if> </if>
<if test="query.caseId != null"> <if test="query.status != null">
AND dm.status = #{query.status} AND dm.status = #{query.status}
</if> </if>
<if test="query.startDate != null"> <if test="query.startDate != null">

Loading…
Cancel
Save