Browse Source

fix some bug

master
zhaohe 3 months ago
parent
commit
fcff2b59d0
  1. 55
      src/main/java/a8k/app/engineer/service/qatest/ExperimentConsistencyTestingService.java
  2. 7
      src/main/java/a8k/app/service/utils/UISender.java
  3. 9
      src/main/java/a8k/extui/page/extapp/profession_test/ExperimentConsistencyTestingPage.java

55
src/main/java/a8k/app/engineer/service/qatest/ExperimentConsistencyTestingService.java

@ -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()) {

7
src/main/java/a8k/app/service/utils/UISender.java

@ -25,6 +25,13 @@ public class UISender {
service.pushMessageBox(new MessageBox(MessageLevel.Error, String.format(msg, args)));
}
public static void txErrorMsg(Logger logger, AppError e, String msg, Object... args) {
logger.error("{}", String.format(msg, args), e);
var service = SpringBootBeanUtil.getBean(FrontEndMessageBoxAndEventMgr.class);
service.pushMessageBox(new MessageBox(MessageLevel.Error, String.format(msg, args)));
}
public static void txErrorPrompt(AppError error) {
var ebus = SpringBootBeanUtil.getBean(AppEventBusService.class);
ebus.pushEvent(ZAppPromoptFactory.buildAppPromoptEvent(error));

9
src/main/java/a8k/extui/page/extapp/profession_test/ExperimentConsistencyTestingPage.java

@ -2,6 +2,8 @@ package a8k.extui.page.extapp.profession_test;
import a8k.app.engineer.service.qatest.ExperimentConsistencyTestingService;
import a8k.app.engineer.service.state.EngineerModeStateMgrService;
import a8k.app.engineer.service.type.EngineerModeState;
import a8k.app.engineer.service.type.TubeExConfig;
import a8k.app.engineer.service.type.TubeHolderExConfig;
import a8k.app.type.exception.AppException;
@ -20,6 +22,8 @@ public class ExperimentConsistencyTestingPage {
private final ExtApiPageMgr extApiPageMgr;
private final ExperimentConsistencyTestingService experimentConsistencyTestingService;
private final EngineerModeStateMgrService engineerModeStateMgrService;
@ExtApiStatu(name = "", group = "试管1", order = 1)
public TubeExConfig getTubeExConfig1() {
@ -71,6 +75,11 @@ public class ExperimentConsistencyTestingPage {
return experimentConsistencyTestingService.getTubeExConfig().tubeExConfigs.get(9);
}
@ExtApiStatu(name = "", group = "获取状态", order = 11)
public EngineerModeState getState() {
return engineerModeStateMgrService.getState();
}
@PostConstruct
void init() {

Loading…
Cancel
Save