20250326 更新
This commit is contained in:
@@ -17,6 +17,7 @@ import digital.laboratory.platform.inspection.service.TestRecordSampleDataServic
|
||||
import digital.laboratory.platform.inspection.utils.TestDataFileUtil;
|
||||
import digital.laboratory.platform.inspection.utils.datafile.hair.HairSewageCompoundData;
|
||||
import digital.laboratory.platform.inspection.utils.datafile.nps.NPSDataFileStruct;
|
||||
import digital.laboratory.platform.inspection.vo.TestRecordSampleDataVO;
|
||||
import digital.laboratory.platform.inspection.vo.TestResultBusinessVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -186,8 +187,8 @@ public class TestRecordSampleDataController {
|
||||
|
||||
@PostMapping("/getAnalysisTestResultPage")
|
||||
@ApiOperation(value = "分页查询-获取实验结果", notes = "分页查询-获取实验结果")
|
||||
public R<Page<Object>> getAnalysisTestResultPage(@RequestBody @Valid AnalysisTestResultPageQuery query) {
|
||||
Page<Object> page = null;
|
||||
public R<IPage<TestRecordSampleDataVO>> getAnalysisTestResultPage(@RequestBody @Valid AnalysisTestResultPageQuery query) {
|
||||
IPage<TestRecordSampleDataVO> page = null;
|
||||
try {
|
||||
page = testRecordSampleDataService.getSampleTestDataByTestIdPage(query);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -34,6 +34,13 @@ public interface TestRecordSampleDataMapper extends BaseMapper<TestRecordSampleD
|
||||
*/
|
||||
List<TestRecordSampleDataVO> queryTestRecordSampleDataVOList(@Param(Constants.WRAPPER) Wrapper<TestRecordSampleData> wrapper);
|
||||
|
||||
/**
|
||||
* 查询检验数据vo类,会携带扩展数据的list属性
|
||||
* @param wrapper
|
||||
* @return
|
||||
*/
|
||||
IPage<TestRecordSampleDataVO> queryTestRecordSampleDataVOPage(Page page, @Param(Constants.WRAPPER) Wrapper<TestRecordSampleData> wrapper);
|
||||
|
||||
/**
|
||||
* 通过业务id查询委托表、筛查表、任务表
|
||||
* @param qw
|
||||
|
||||
@@ -11,6 +11,7 @@ import digital.laboratory.platform.inspection.query.AnalysisTestResultPageQuery;
|
||||
import digital.laboratory.platform.inspection.query.QueryTestResultPageQuery;
|
||||
import digital.laboratory.platform.inspection.utils.datafile.hair.HairSewageCompoundData;
|
||||
import digital.laboratory.platform.inspection.utils.datafile.nps.NPSDataFileStruct;
|
||||
import digital.laboratory.platform.inspection.vo.TestRecordSampleDataVO;
|
||||
import digital.laboratory.platform.inspection.vo.TestResultBusinessVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -63,7 +64,7 @@ public interface TestRecordSampleDataService extends IService<TestRecordSampleD
|
||||
* @param pageDTO
|
||||
* @return
|
||||
*/
|
||||
Page<Object> getSampleTestDataByTestIdPage(AnalysisTestResultPageQuery pageDTO);
|
||||
IPage<TestRecordSampleDataVO> getSampleTestDataByTestIdPage(AnalysisTestResultPageQuery pageDTO);
|
||||
|
||||
/**
|
||||
* 分页查询 获取审核的任务检验数据, header 是自定义头 data 是分页对象
|
||||
|
||||
@@ -270,25 +270,25 @@ public class TestRecordSampleDataServiceImpl extends ServiceImpl<TestRecordSampl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<Object> getSampleTestDataByTestIdPage(AnalysisTestResultPageQuery pageDTO) {
|
||||
Page<TestRecordSampleData> page = this.page(new Page<>(pageDTO.getCurrent(), pageDTO.getSize()), Wrappers.<TestRecordSampleData>lambdaQuery()
|
||||
public IPage<TestRecordSampleDataVO> getSampleTestDataByTestIdPage(AnalysisTestResultPageQuery pageDTO) {
|
||||
IPage<TestRecordSampleDataVO> page = baseMapper.queryTestRecordSampleDataVOPage(new Page<>(pageDTO.getCurrent(), pageDTO.getSize()), Wrappers.<TestRecordSampleData>lambdaQuery()
|
||||
.eq(TestRecordSampleData::getTestId, pageDTO.getTestId())
|
||||
.orderByDesc(TestRecordSampleData::getCompoundName)
|
||||
.orderByDesc(TestRecordSampleData::getSampleNo));
|
||||
List<Object> retList = new ArrayList<>();
|
||||
switch (BusinessType.getBusinessTypeByType(pageDTO.getType())) {
|
||||
case NPS_CASE:
|
||||
// NPS的数据分析
|
||||
extractedSampleTestData(page.getRecords(), retList, NPSCaseTestDataDto.class);
|
||||
case BOINT_CASE:
|
||||
extractedSampleTestData(page.getRecords(), retList, HairSewageDataDto.class);
|
||||
}
|
||||
Page<Object> resultPage = new Page<>();
|
||||
BeanUtils.copyProperties(page, resultPage, "records");
|
||||
// z最后转换类型
|
||||
// TypeCasting(retList);
|
||||
resultPage.setRecords(retList);
|
||||
return resultPage;
|
||||
// List<Object> retList = new ArrayList<>();
|
||||
// switch (BusinessType.getBusinessTypeByType(pageDTO.getType())) {
|
||||
// case NPS_CASE:
|
||||
// // NPS的数据分析
|
||||
// extractedSampleTestData(page.getRecords(), retList, NPSCaseTestDataDto.class);
|
||||
// case BOINT_CASE:
|
||||
// extractedSampleTestData(page.getRecords(), retList, HairSewageDataDto.class);
|
||||
// }
|
||||
// Page<Object> resultPage = new Page<>();
|
||||
// BeanUtils.copyProperties(page, resultPage, "records");
|
||||
// // z最后转换类型
|
||||
//// TypeCasting(retList);
|
||||
// resultPage.setRecords(retList);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -424,9 +424,13 @@ public class TestRecordSampleDataServiceImpl extends ServiceImpl<TestRecordSampl
|
||||
List<TestRecordSampleData> testRecordSampleDataList = TestRecordSampleDataConverter.dtoToEntityList(dtoList);
|
||||
if (super.updateBatchById(testRecordSampleDataList)) {
|
||||
// 开启异步执行
|
||||
// CompletableFuture.runAsync(() -> {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
testRecordSampleDataList.forEach(item -> calculateInspectData(item.getId()));
|
||||
// });
|
||||
}).exceptionally(e -> {
|
||||
log.error("计算保留时间以及相对误差出错!");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
});
|
||||
return testRecordSampledataExpandService.updateBatchByDTO(dtoList.stream().flatMap(dto -> dto.getExpandList().stream()).collect(Collectors.toList()));
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -160,7 +160,7 @@ public class TestRecordSampledataExpandServiceImpl extends ServiceImpl<TestRecor
|
||||
public Boolean updateBatchByDTO(List<TestSampleDataExpandDTO> dtoList) {
|
||||
List<TestRecordSampleDataExpand> expandList = TestSampleDataExpandConverter.dtoToEntityList(dtoList);
|
||||
if (super.updateBatchById(expandList)) {
|
||||
// CompletableFuture.runAsync(() -> {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
List<TestRecordSampleDataExpand> newExpandDatList = super.list(Wrappers.<TestRecordSampleDataExpand>lambdaQuery()
|
||||
.in(TestRecordSampleDataExpand::getId, expandList.stream().map(TestRecordSampleDataExpand::getId).collect(Collectors.toList()))
|
||||
.isNotNull(TestRecordSampleDataExpand::getPeakArea)
|
||||
@@ -202,7 +202,11 @@ public class TestRecordSampledataExpandServiceImpl extends ServiceImpl<TestRecor
|
||||
if (CollUtil.isNotEmpty(calculateAfterResult)) {
|
||||
super.updateBatchById(calculateAfterResult);
|
||||
}
|
||||
// });
|
||||
}).exceptionally(e -> {
|
||||
log.error("离子丰度比相关计算出错!");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
});
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package digital.laboratory.platform.inspection.vo;
|
||||
|
||||
import digital.laboratory.platform.inspection.constant.TestRecordSampleDataConstant;
|
||||
import digital.laboratory.platform.inspection.entity.TestRecordSampleDataExpand;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -71,4 +72,8 @@ public class TestRecordSampleDataVO {
|
||||
|
||||
@ApiModelProperty("样本检验扩展数据列表")
|
||||
private List<TestRecordSampleDataExpand> expandList;
|
||||
|
||||
public String getIsDetected() {
|
||||
return isDetected.equals(1) ? TestRecordSampleDataConstant.IS : TestRecordSampleDataConstant.NO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,13 @@
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="queryTestRecordSampleDataVOPage" resultMap="VOMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"></include>
|
||||
FROM b_test_record_sampledata
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 合并委托、任务、筛查表-->
|
||||
<sql id="queryCommoneBusinessSql">
|
||||
SELECT T.id,
|
||||
|
||||
Reference in New Issue
Block a user