添加了一些统计的功能,例如检出率
This commit is contained in:
@@ -2,6 +2,7 @@ package digital.laboratory.platform.entrustment.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
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.exception.CheckedException;
|
||||||
import digital.laboratory.platform.common.core.util.R;
|
import digital.laboratory.platform.common.core.util.R;
|
||||||
import digital.laboratory.platform.entrustment.convert.EntrustMaterialCheckoutResultConvert;
|
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.query.EntrustMaterialCheckoutResultQuery;
|
||||||
import digital.laboratory.platform.entrustment.service.EntrustMaterialCheckoutResultService;
|
import digital.laboratory.platform.entrustment.service.EntrustMaterialCheckoutResultService;
|
||||||
import digital.laboratory.platform.entrustment.vo.EntrustMaterialCheckoutResultVO;
|
import digital.laboratory.platform.entrustment.vo.EntrustMaterialCheckoutResultVO;
|
||||||
|
import digital.laboratory.platform.entrustment.vo.EntrustmentIdentificationMaterialVO;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
@@ -93,4 +94,11 @@ public class EntrustMaterialCheckoutResultController {
|
|||||||
public R getDetectionRateByMaterial(Integer year, String orgId){
|
public R getDetectionRateByMaterial(Integer year, String orgId){
|
||||||
return R.ok(entrustMaterialCheckoutResultService.getDetectionRateByMaterial(year, orgId),"查询成功!");
|
return R.ok(entrustMaterialCheckoutResultService.getDetectionRateByMaterial(year, orgId),"查询成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据毒品名称来查询所有检出该毒品的检材列表")
|
||||||
|
@GetMapping("/getMaterialByDetection")
|
||||||
|
public R<IPage> getMaterialByDetection(String drugName, Integer year, Page page){
|
||||||
|
return R.ok(entrustMaterialCheckoutResultService.getMaterialByDetection(drugName,year,page));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
package digital.laboratory.platform.entrustment.service;
|
package digital.laboratory.platform.entrustment.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import digital.laboratory.platform.entrustment.dto.EntrustMaterialCheckoutResultDTO;
|
import digital.laboratory.platform.entrustment.dto.EntrustMaterialCheckoutResultDTO;
|
||||||
import digital.laboratory.platform.entrustment.entity.EntrustMaterialCheckoutResult;
|
import digital.laboratory.platform.entrustment.entity.EntrustMaterialCheckoutResult;
|
||||||
import digital.laboratory.platform.entrustment.query.EntrustMaterialCheckoutResultQuery;
|
import digital.laboratory.platform.entrustment.query.EntrustMaterialCheckoutResultQuery;
|
||||||
import digital.laboratory.platform.entrustment.vo.DetectionRateVO;
|
import digital.laboratory.platform.entrustment.vo.DetectionRateVO;
|
||||||
import digital.laboratory.platform.entrustment.vo.EntrustMaterialCheckoutResultVO;
|
import digital.laboratory.platform.entrustment.vo.EntrustMaterialCheckoutResultVO;
|
||||||
|
import digital.laboratory.platform.entrustment.vo.EntrustmentIdentificationMaterialVO;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -58,6 +60,7 @@ public interface EntrustMaterialCheckoutResultService extends IService<EntrustMa
|
|||||||
*/
|
*/
|
||||||
List<String> getResultType(Integer year, String orgId);
|
List<String> getResultType(Integer year, String orgId);
|
||||||
|
|
||||||
|
IPage<EntrustmentIdentificationMaterialVO> getMaterialByDetection(String drugName, Integer year, Page page);
|
||||||
/**
|
/**
|
||||||
* 查询所有毒品的检出率
|
* 查询所有毒品的检出率
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import digital.laboratory.platform.entrustment.entity.Entrustment;
|
|||||||
import digital.laboratory.platform.entrustment.entity.EntrustmentIdentificationMaterial;
|
import digital.laboratory.platform.entrustment.entity.EntrustmentIdentificationMaterial;
|
||||||
import digital.laboratory.platform.entrustment.enums.EntrustmentStatusConstants;
|
import digital.laboratory.platform.entrustment.enums.EntrustmentStatusConstants;
|
||||||
import digital.laboratory.platform.entrustment.mapper.EntrustMaterialCheckoutResultMapper;
|
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.query.EntrustMaterialCheckoutResultQuery;
|
||||||
import digital.laboratory.platform.entrustment.service.CommonFeignService;
|
import digital.laboratory.platform.entrustment.service.CommonFeignService;
|
||||||
import digital.laboratory.platform.entrustment.service.EntrustMaterialCheckoutResultService;
|
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.service.EntrustmentService;
|
||||||
import digital.laboratory.platform.entrustment.vo.DetectionRateVO;
|
import digital.laboratory.platform.entrustment.vo.DetectionRateVO;
|
||||||
import digital.laboratory.platform.entrustment.vo.EntrustMaterialCheckoutResultVO;
|
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.Area;
|
||||||
import digital.laboratory.platform.sys.entity.DrugLite;
|
import digital.laboratory.platform.sys.entity.DrugLite;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
@@ -58,6 +60,8 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus
|
|||||||
@Resource
|
@Resource
|
||||||
private CommonFeignService commonFeignService;
|
private CommonFeignService commonFeignService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private EntrustmentIdentificationMaterialMapper entrustmentIdentificationMaterialMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建委托材料检验结果字符串
|
* 构建委托材料检验结果字符串
|
||||||
@@ -378,6 +382,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus
|
|||||||
// 根据年份构建查询起始时间
|
// 根据年份构建查询起始时间
|
||||||
LocalDateTime startTime = getStartTime(year);
|
LocalDateTime startTime = getStartTime(year);
|
||||||
List<String> entrustIdList = getEntrustIdListByOrgId(orgId);
|
List<String> entrustIdList = getEntrustIdListByOrgId(orgId);
|
||||||
|
|
||||||
// 查询所有非空且不为空的定性结果,且创建时间大于等于起始时间
|
// 查询所有非空且不为空的定性结果,且创建时间大于等于起始时间
|
||||||
List<EntrustMaterialCheckoutResult> list = this.list(Wrappers.<EntrustMaterialCheckoutResult>lambdaQuery()
|
List<EntrustMaterialCheckoutResult> list = this.list(Wrappers.<EntrustMaterialCheckoutResult>lambdaQuery()
|
||||||
.in(CollUtil.isNotEmpty(entrustIdList), EntrustMaterialCheckoutResult::getEntrustId, entrustIdList)
|
.in(CollUtil.isNotEmpty(entrustIdList), EntrustMaterialCheckoutResult::getEntrustId, entrustIdList)
|
||||||
@@ -444,6 +449,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus
|
|||||||
LocalDateTime startTime = getStartTime(year);
|
LocalDateTime startTime = getStartTime(year);
|
||||||
List<String> entrustIdList = getEntrustIdListByOrgId(orgId);
|
List<String> entrustIdList = getEntrustIdListByOrgId(orgId);
|
||||||
|
|
||||||
|
|
||||||
// 查询所有非空且不为空的定性结果,且创建时间大于等于起始时间
|
// 查询所有非空且不为空的定性结果,且创建时间大于等于起始时间
|
||||||
List<EntrustmentIdentificationMaterial> materialList = entrustmentIdentificationMaterialService.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
|
List<EntrustmentIdentificationMaterial> materialList = entrustmentIdentificationMaterialService.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
|
||||||
.in(CollUtil.isNotEmpty(entrustIdList), EntrustmentIdentificationMaterial::getEntrustmentId, entrustIdList)
|
.in(CollUtil.isNotEmpty(entrustIdList), EntrustmentIdentificationMaterial::getEntrustmentId, entrustIdList)
|
||||||
@@ -484,7 +490,28 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus
|
|||||||
return vo ;
|
return vo ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public IPage<EntrustmentIdentificationMaterialVO> getMaterialBy
|
@Override
|
||||||
|
public IPage<EntrustmentIdentificationMaterialVO> getMaterialByDetection(String drugName, Integer year, Page page){
|
||||||
|
|
||||||
|
List<EntrustMaterialCheckoutResult> list = this.list(Wrappers.<EntrustMaterialCheckoutResult>lambdaQuery()
|
||||||
|
.like(EntrustMaterialCheckoutResult::getQualitativeResult, drugName));
|
||||||
|
|
||||||
|
ArrayList<String> materialIdList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (EntrustMaterialCheckoutResult result : list) {
|
||||||
|
materialIdList.add(result.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDateTime startTime = this.getStartTime(year);
|
||||||
|
|
||||||
|
Page materialPage = entrustmentIdentificationMaterialService.page(page, Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
|
||||||
|
.in(EntrustmentIdentificationMaterial::getId, materialIdList)
|
||||||
|
.ge(EntrustmentIdentificationMaterial::getAcceptTime, startTime)
|
||||||
|
.orderByDesc(EntrustmentIdentificationMaterial::getAcceptTime));
|
||||||
|
return materialPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user