20250326 更新

master
陈江保 6 days ago
parent 116d142489
commit cd25c94b07
  1. 5
      dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/controller/TestRecordSampleDataController.java
  2. 7
      dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/mapper/TestRecordSampleDataMapper.java
  3. 3
      dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/TestRecordSampleDataService.java
  4. 40
      dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/TestRecordSampleDataServiceImpl.java
  5. 8
      dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/TestRecordSampledataExpandServiceImpl.java
  6. 5
      dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/vo/TestRecordSampleDataVO.java
  7. 7
      dlp-drugtesting-biz/src/main/resources/mapper/TestRecordSampleDataMapper.xml

@ -17,6 +17,7 @@ import digital.laboratory.platform.inspection.service.TestRecordSampleDataServic
import digital.laboratory.platform.inspection.utils.TestDataFileUtil; import digital.laboratory.platform.inspection.utils.TestDataFileUtil;
import digital.laboratory.platform.inspection.utils.datafile.hair.HairSewageCompoundData; import digital.laboratory.platform.inspection.utils.datafile.hair.HairSewageCompoundData;
import digital.laboratory.platform.inspection.utils.datafile.nps.NPSDataFileStruct; import digital.laboratory.platform.inspection.utils.datafile.nps.NPSDataFileStruct;
import digital.laboratory.platform.inspection.vo.TestRecordSampleDataVO;
import digital.laboratory.platform.inspection.vo.TestResultBusinessVO; import digital.laboratory.platform.inspection.vo.TestResultBusinessVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@ -186,8 +187,8 @@ public class TestRecordSampleDataController {
@PostMapping("/getAnalysisTestResultPage") @PostMapping("/getAnalysisTestResultPage")
@ApiOperation(value = "分页查询-获取实验结果", notes = "分页查询-获取实验结果") @ApiOperation(value = "分页查询-获取实验结果", notes = "分页查询-获取实验结果")
public R<Page<Object>> getAnalysisTestResultPage(@RequestBody @Valid AnalysisTestResultPageQuery query) { public R<IPage<TestRecordSampleDataVO>> getAnalysisTestResultPage(@RequestBody @Valid AnalysisTestResultPageQuery query) {
Page<Object> page = null; IPage<TestRecordSampleDataVO> page = null;
try { try {
page = testRecordSampleDataService.getSampleTestDataByTestIdPage(query); page = testRecordSampleDataService.getSampleTestDataByTestIdPage(query);
} catch (Exception e) { } catch (Exception e) {

@ -34,6 +34,13 @@ public interface TestRecordSampleDataMapper extends BaseMapper<TestRecordSampleD
*/ */
List<TestRecordSampleDataVO> queryTestRecordSampleDataVOList(@Param(Constants.WRAPPER) Wrapper<TestRecordSampleData> wrapper); 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查询委托表筛查表任务表 * 通过业务id查询委托表筛查表任务表
* @param qw * @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.query.QueryTestResultPageQuery;
import digital.laboratory.platform.inspection.utils.datafile.hair.HairSewageCompoundData; import digital.laboratory.platform.inspection.utils.datafile.hair.HairSewageCompoundData;
import digital.laboratory.platform.inspection.utils.datafile.nps.NPSDataFileStruct; import digital.laboratory.platform.inspection.utils.datafile.nps.NPSDataFileStruct;
import digital.laboratory.platform.inspection.vo.TestRecordSampleDataVO;
import digital.laboratory.platform.inspection.vo.TestResultBusinessVO; import digital.laboratory.platform.inspection.vo.TestResultBusinessVO;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -63,7 +64,7 @@ public interface TestRecordSampleDataService extends IService<TestRecordSampleD
* @param pageDTO * @param pageDTO
* @return * @return
*/ */
Page<Object> getSampleTestDataByTestIdPage(AnalysisTestResultPageQuery pageDTO); IPage<TestRecordSampleDataVO> getSampleTestDataByTestIdPage(AnalysisTestResultPageQuery pageDTO);
/** /**
* 分页查询 获取审核的任务检验数据, header 是自定义头 data 是分页对象 * 分页查询 获取审核的任务检验数据, header 是自定义头 data 是分页对象

@ -270,25 +270,25 @@ public class TestRecordSampleDataServiceImpl extends ServiceImpl<TestRecordSampl
* @return * @return
*/ */
@Override @Override
public Page<Object> getSampleTestDataByTestIdPage(AnalysisTestResultPageQuery pageDTO) { public IPage<TestRecordSampleDataVO> getSampleTestDataByTestIdPage(AnalysisTestResultPageQuery pageDTO) {
Page<TestRecordSampleData> page = this.page(new Page<>(pageDTO.getCurrent(), pageDTO.getSize()), Wrappers.<TestRecordSampleData>lambdaQuery() IPage<TestRecordSampleDataVO> page = baseMapper.queryTestRecordSampleDataVOPage(new Page<>(pageDTO.getCurrent(), pageDTO.getSize()), Wrappers.<TestRecordSampleData>lambdaQuery()
.eq(TestRecordSampleData::getTestId, pageDTO.getTestId()) .eq(TestRecordSampleData::getTestId, pageDTO.getTestId())
.orderByDesc(TestRecordSampleData::getCompoundName) .orderByDesc(TestRecordSampleData::getCompoundName)
.orderByDesc(TestRecordSampleData::getSampleNo)); .orderByDesc(TestRecordSampleData::getSampleNo));
List<Object> retList = new ArrayList<>(); // List<Object> retList = new ArrayList<>();
switch (BusinessType.getBusinessTypeByType(pageDTO.getType())) { // switch (BusinessType.getBusinessTypeByType(pageDTO.getType())) {
case NPS_CASE: // case NPS_CASE:
// NPS的数据分析 // // NPS的数据分析
extractedSampleTestData(page.getRecords(), retList, NPSCaseTestDataDto.class); // extractedSampleTestData(page.getRecords(), retList, NPSCaseTestDataDto.class);
case BOINT_CASE: // case BOINT_CASE:
extractedSampleTestData(page.getRecords(), retList, HairSewageDataDto.class); // extractedSampleTestData(page.getRecords(), retList, HairSewageDataDto.class);
} // }
Page<Object> resultPage = new Page<>(); // Page<Object> resultPage = new Page<>();
BeanUtils.copyProperties(page, resultPage, "records"); // BeanUtils.copyProperties(page, resultPage, "records");
// z最后转换类型 // // z最后转换类型
// TypeCasting(retList); //// TypeCasting(retList);
resultPage.setRecords(retList); // resultPage.setRecords(retList);
return resultPage; return page;
} }
/** /**
@ -424,9 +424,13 @@ public class TestRecordSampleDataServiceImpl extends ServiceImpl<TestRecordSampl
List<TestRecordSampleData> testRecordSampleDataList = TestRecordSampleDataConverter.dtoToEntityList(dtoList); List<TestRecordSampleData> testRecordSampleDataList = TestRecordSampleDataConverter.dtoToEntityList(dtoList);
if (super.updateBatchById(testRecordSampleDataList)) { if (super.updateBatchById(testRecordSampleDataList)) {
// 开启异步执行 // 开启异步执行
// CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
testRecordSampleDataList.forEach(item -> calculateInspectData(item.getId())); 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 testRecordSampledataExpandService.updateBatchByDTO(dtoList.stream().flatMap(dto -> dto.getExpandList().stream()).collect(Collectors.toList()));
} }
return false; return false;

@ -160,7 +160,7 @@ public class TestRecordSampledataExpandServiceImpl extends ServiceImpl<TestRecor
public Boolean updateBatchByDTO(List<TestSampleDataExpandDTO> dtoList) { public Boolean updateBatchByDTO(List<TestSampleDataExpandDTO> dtoList) {
List<TestRecordSampleDataExpand> expandList = TestSampleDataExpandConverter.dtoToEntityList(dtoList); List<TestRecordSampleDataExpand> expandList = TestSampleDataExpandConverter.dtoToEntityList(dtoList);
if (super.updateBatchById(expandList)) { if (super.updateBatchById(expandList)) {
// CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
List<TestRecordSampleDataExpand> newExpandDatList = super.list(Wrappers.<TestRecordSampleDataExpand>lambdaQuery() List<TestRecordSampleDataExpand> newExpandDatList = super.list(Wrappers.<TestRecordSampleDataExpand>lambdaQuery()
.in(TestRecordSampleDataExpand::getId, expandList.stream().map(TestRecordSampleDataExpand::getId).collect(Collectors.toList())) .in(TestRecordSampleDataExpand::getId, expandList.stream().map(TestRecordSampleDataExpand::getId).collect(Collectors.toList()))
.isNotNull(TestRecordSampleDataExpand::getPeakArea) .isNotNull(TestRecordSampleDataExpand::getPeakArea)
@ -202,7 +202,11 @@ public class TestRecordSampledataExpandServiceImpl extends ServiceImpl<TestRecor
if (CollUtil.isNotEmpty(calculateAfterResult)) { if (CollUtil.isNotEmpty(calculateAfterResult)) {
super.updateBatchById(calculateAfterResult); super.updateBatchById(calculateAfterResult);
} }
// }); }).exceptionally(e -> {
log.error("离子丰度比相关计算出错!");
e.printStackTrace();
return null;
});
return Boolean.TRUE; return Boolean.TRUE;
} }
return Boolean.FALSE; return Boolean.FALSE;

@ -1,5 +1,6 @@
package digital.laboratory.platform.inspection.vo; package digital.laboratory.platform.inspection.vo;
import digital.laboratory.platform.inspection.constant.TestRecordSampleDataConstant;
import digital.laboratory.platform.inspection.entity.TestRecordSampleDataExpand; import digital.laboratory.platform.inspection.entity.TestRecordSampleDataExpand;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -71,4 +72,8 @@ public class TestRecordSampleDataVO {
@ApiModelProperty("样本检验扩展数据列表") @ApiModelProperty("样本检验扩展数据列表")
private List<TestRecordSampleDataExpand> expandList; private List<TestRecordSampleDataExpand> expandList;
public String getIsDetected() {
return isDetected.equals(1) ? TestRecordSampleDataConstant.IS : TestRecordSampleDataConstant.NO;
}
} }

@ -87,6 +87,13 @@
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>
<select id="queryTestRecordSampleDataVOPage" resultMap="VOMap">
SELECT
<include refid="Base_Column_List"></include>
FROM b_test_record_sampledata
${ew.customSqlSegment}
</select>
<!-- 合并委托、任务、筛查表--> <!-- 合并委托、任务、筛查表-->
<sql id="queryCommoneBusinessSql"> <sql id="queryCommoneBusinessSql">
SELECT T.id, SELECT T.id,

Loading…
Cancel
Save