|
|
@ -44,6 +44,7 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
@ -289,44 +290,44 @@ public class ExperimentConsistencyTestingService { |
|
|
|
} |
|
|
|
Assert.isTrue(scanResult.tube[tubeoff].isTubeExist, String.format("位置[%d]未放入是试管", tubeoff + 1)); |
|
|
|
|
|
|
|
|
|
|
|
//移动试管架到预处理位置 |
|
|
|
int finalTubeoff = tubeoff; |
|
|
|
UISender.txInfoMsg(log, "开始处理第%d个试管", finalTubeoff + 1); |
|
|
|
docmd("移动试管到处理位", () -> tubeFeedingCtrlService.moveTubeToPreProcessPos(finalTubeoff)); |
|
|
|
|
|
|
|
//尝试处理孵育完成的反应板 |
|
|
|
incubationPlateProcess(false); |
|
|
|
for (int j = 0; j < getRepeatTimes(tubeoff); j++) { |
|
|
|
|
|
|
|
//申请耗材 |
|
|
|
var consumableInfo = consumablesMgrService.reserveConsumable(expectedProjId); |
|
|
|
if (consumableInfo == null) { |
|
|
|
throw AppException.of(A8kEcode.CODEERROR, "耗材不足?"); //理论上开始阶段已经核对过了耗材数量,此时应该不会不足 |
|
|
|
} |
|
|
|
consumablesMgrService.useReserveConsumable(consumableInfo); |
|
|
|
//尝试处理孵育完成的反应板 |
|
|
|
incubationPlateProcess(false); |
|
|
|
|
|
|
|
//构造项目信息 |
|
|
|
ProjBuildinInfo projBuildinInfo = projInfoMgrService.getProjBuildInInfo(expectedProjId); |
|
|
|
ProjExtInfoCard projExtInfoCard = projInfoMgrService.getProjExtInfoCard(consumableInfo.lotid); |
|
|
|
ProjBriefInfo projBriefInfo = ProjInfoUtils.buildProjBrefInfo(projBuildinInfo); |
|
|
|
//申请耗材 |
|
|
|
var consumableInfo = consumablesMgrService.reserveConsumable(expectedProjId); |
|
|
|
if (consumableInfo == null) { |
|
|
|
throw AppException.of(A8kEcode.CODEERROR, "耗材不足?"); //理论上开始阶段已经核对过了耗材数量,此时应该不会不足 |
|
|
|
} |
|
|
|
consumablesMgrService.useReserveConsumable(consumableInfo); |
|
|
|
|
|
|
|
Assert.notNull(projBuildinInfo, "projBuildInInfo is null"); |
|
|
|
Assert.notNull(projExtInfoCard, "projExtInfoCard is null"); |
|
|
|
//构造项目信息 |
|
|
|
ProjBuildinInfo projBuildinInfo = projInfoMgrService.getProjBuildInInfo(expectedProjId); |
|
|
|
ProjExtInfoCard projExtInfoCard = projInfoMgrService.getProjExtInfoCard(consumableInfo.lotid); |
|
|
|
ProjBriefInfo projBriefInfo = ProjInfoUtils.buildProjBrefInfo(projBuildinInfo); |
|
|
|
|
|
|
|
//处理样本 |
|
|
|
Tube tube = new Tube(tubeoff); |
|
|
|
tube.setIsHighTube(false); |
|
|
|
tube.setIsEmergency(false); |
|
|
|
tube.setBloodType(BloodType.WHOLE_BLOOD); |
|
|
|
tube.setSampleBarcode(tubeSetting.sampleBarcode); |
|
|
|
tube.setUserid(tubeSetting.userid); |
|
|
|
tube.setProjInfo(ZList.of(projBriefInfo)); |
|
|
|
tube.setProjIds(ZList.of(expectedProjId)); |
|
|
|
String sampleId = tubeStateMgrService.newSample(tube); |
|
|
|
tube.setSampleId(sampleId); |
|
|
|
Assert.notNull(projBuildinInfo, "projBuildInInfo is null"); |
|
|
|
Assert.notNull(projExtInfoCard, "projExtInfoCard is null"); |
|
|
|
|
|
|
|
//处理样本 |
|
|
|
Tube tube = new Tube(tubeoff); |
|
|
|
tube.setIsHighTube(false); |
|
|
|
tube.setIsEmergency(false); |
|
|
|
tube.setBloodType(BloodType.WHOLE_BLOOD); |
|
|
|
tube.setSampleBarcode(tubeSetting.sampleBarcode); |
|
|
|
tube.setUserid(tubeSetting.userid); |
|
|
|
tube.setProjInfo(ZList.of(projBriefInfo)); |
|
|
|
tube.setProjIds(ZList.of(expectedProjId)); |
|
|
|
String sampleId = tubeStateMgrService.newSample(tube); |
|
|
|
tube.setSampleId(sampleId); |
|
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < getRepeatTimes(tubeoff); j++) { |
|
|
|
//处理试管 |
|
|
|
processTube(tube, tubeoff, consumableInfo, tubeSetting); |
|
|
|
if (!tube.getErrors().isEmpty()) { |
|
|
|