|
|
@ -41,53 +41,53 @@ public class ExperimentConsistencyTestingService { |
|
|
|
* @throws AppException |
|
|
|
*/ |
|
|
|
public void startTest() throws AppException { |
|
|
|
/* |
|
|
|
* 检查当前是否有其他项目正在进行测试 |
|
|
|
*/ |
|
|
|
BeforeDoEngineerActionChecker.check(); |
|
|
|
/* |
|
|
|
* 核对试管配置是否符合要求 |
|
|
|
*/ |
|
|
|
TubeHolderSetting tubeHolderSetting = tubeHolderSettingMgrService.getThelastActiveTubeHolderSetting(); |
|
|
|
if (tubeHolderSetting == null) { |
|
|
|
throw AppException.of(A8kEcode.APPE_TUBEHOLDER_SETTING_ERROR, "缺少试管配置"); |
|
|
|
} |
|
|
|
|
|
|
|
for (TubeSetting tubeSetting : tubeHolderSetting.tubeSettings) { |
|
|
|
for (Integer projId : tubeSetting.projId) { |
|
|
|
if (projId != 1) { |
|
|
|
throw AppException.of(A8kEcode.APPE_TUBEHOLDER_SETTING_ERROR, "目前只支持HsCrp项目"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
* 核对耗材数量是否足够 |
|
|
|
*/ |
|
|
|
int testTotalTimes = 0; |
|
|
|
for (TubeSetting tubeSetting : tubeHolderSetting.tubeSettings) { |
|
|
|
for (Integer ignored : tubeSetting.projId) { |
|
|
|
testTotalTimes += tubeholderExSettingMgr.getTubeExConfig().tubeExConfigs.get(tubeSetting.tubeIndex).repeatTimes; |
|
|
|
} |
|
|
|
} |
|
|
|
Integer consumableNum = consumablesMgrService.getConsumableNum(projInfoMgrService.getProjBuildInInfo(1)); |
|
|
|
if (consumableNum < testTotalTimes) { |
|
|
|
throw AppException.of(A8kEcode.APPE_CONSUME_NOT_ENOUGH, |
|
|
|
String.format("反应板,当前剩余:%d,需要:%d",consumableNum, testTotalTimes)); |
|
|
|
} |
|
|
|
if (!consumablesMgrService.isHasEnoughTips((int) (testTotalTimes * 1.2))) { |
|
|
|
throw AppException.of(A8kEcode.APPE_TIP_NOT_ENOUGH, |
|
|
|
String.format("Tip不足,需要:%d", (int) (testTotalTimes * 1.2))); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
log.info("开始试剂实验一致性检测"); |
|
|
|
tubeholderExSettingMgr.setEnabled(true); |
|
|
|
mainFlowCtrlScheduler.startWork(() -> { |
|
|
|
log.info("试剂实验一致性检测工作线程结束"); |
|
|
|
tubeholderExSettingMgr.setEnabled(false); |
|
|
|
}); |
|
|
|
// /* |
|
|
|
// * 检查当前是否有其他项目正在进行测试 |
|
|
|
// */ |
|
|
|
// BeforeDoEngineerActionChecker.check(); |
|
|
|
// /* |
|
|
|
// * 核对试管配置是否符合要求 |
|
|
|
// */ |
|
|
|
// TubeHolderSetting tubeHolderSetting = tubeHolderSettingMgrService.getThelastActiveTubeHolderSetting(); |
|
|
|
// if (tubeHolderSetting == null) { |
|
|
|
// throw AppException.of(A8kEcode.APPE_TUBEHOLDER_SETTING_ERROR, "缺少试管配置"); |
|
|
|
// } |
|
|
|
// |
|
|
|
// for (TubeSetting tubeSetting : tubeHolderSetting.tubeSettings) { |
|
|
|
// for (Integer projId : tubeSetting.projId) { |
|
|
|
// if (projId != 1) { |
|
|
|
// throw AppException.of(A8kEcode.APPE_TUBEHOLDER_SETTING_ERROR, "目前只支持HsCrp项目"); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// |
|
|
|
// |
|
|
|
// /* |
|
|
|
// * 核对耗材数量是否足够 |
|
|
|
// */ |
|
|
|
// int testTotalTimes = 0; |
|
|
|
// for (TubeSetting tubeSetting : tubeHolderSetting.tubeSettings) { |
|
|
|
// for (Integer ignored : tubeSetting.projId) { |
|
|
|
// testTotalTimes += tubeholderExSettingMgr.getTubeExConfig().tubeExConfigs.get(tubeSetting.tubeIndex).repeatTimes; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// Integer consumableNum = consumablesMgrService.getConsumableNum(projInfoMgrService.getProjBuildInInfo(1)); |
|
|
|
// if (consumableNum < testTotalTimes) { |
|
|
|
// throw AppException.of(A8kEcode.APPE_CONSUME_NOT_ENOUGH, |
|
|
|
// String.format("反应板,当前剩余:%d,需要:%d",consumableNum, testTotalTimes)); |
|
|
|
// } |
|
|
|
// if (!consumablesMgrService.isHasEnoughTips((int) (testTotalTimes * 1.2))) { |
|
|
|
// throw AppException.of(A8kEcode.APPE_TIP_NOT_ENOUGH, |
|
|
|
// String.format("Tip不足,需要:%d", (int) (testTotalTimes * 1.2))); |
|
|
|
// } |
|
|
|
// |
|
|
|
// |
|
|
|
// log.info("开始试剂实验一致性检测"); |
|
|
|
// tubeholderExSettingMgr.setEnabled(true); |
|
|
|
// mainFlowCtrlScheduler.startWork(() -> { |
|
|
|
// log.info("试剂实验一致性检测工作线程结束"); |
|
|
|
// tubeholderExSettingMgr.setEnabled(false); |
|
|
|
// }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|