|
|
|
@ -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.<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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|