16 changed files with 154 additions and 188 deletions
-
22src/main/java/a8k/baseservice/AppExceptionBuilder.java
-
6src/main/java/a8k/baseservice/appeventbus/appevent/A8kEcodeContextListPromptEvent.java
-
10src/main/java/a8k/dbservice/A8kProjIdCardDBService.java
-
4src/main/java/a8k/service/appdata/AppProjConfigMgrService.java
-
35src/main/java/a8k/service/appdata/AppProjInfoMgrService.java
-
5src/main/java/a8k/service/appdevicectrl/AppConsumablesMgrService.java
-
22src/main/java/a8k/service/appdevicectrl/MainFlowCtrlService.java
-
1src/main/java/a8k/service/appdevicectrl/action/base/A8kActionStepType.java
-
44src/main/java/a8k/service/appdevicectrl/action/mainflow/SEQ2_SWITCH_TO_THE_NEXT_TUBE.java
-
89src/main/java/a8k/service/appdevicectrl/action/mainflow/SEQ3_CHECK_THE_QUANTITY_OF_CONSUMABLES.java
-
38src/main/java/a8k/service/appdevicectrl/scheduler/MainFlowCtrlScheduler.java
-
7src/main/java/a8k/service/appdevicectrl/type/A8kErrorContext.java
-
4src/main/java/a8k/service/appstate/MainFlowCtrlState.java
-
13src/main/java/a8k/type/ecode/ConsumeNotEnoughError.java
-
4src/main/java/a8k/type/projecttype/a8kidcard/A8kIdCardInfo.java
@ -0,0 +1,22 @@ |
|||||
|
package a8k.baseservice; |
||||
|
|
||||
|
import a8k.type.ecode.ConsumeNotEnoughError; |
||||
|
import a8k.type.exception.AppException; |
||||
|
import jakarta.annotation.Resource; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import a8k.service.appdata.AppProjInfoMgrService; |
||||
|
|
||||
|
@Component |
||||
|
public class AppExceptionBuilder { |
||||
|
|
||||
|
|
||||
|
@Resource |
||||
|
AppProjInfoMgrService projConfigMgrService; |
||||
|
|
||||
|
|
||||
|
public AppException buildConsumeNotEnoughError(Integer projIndex) { |
||||
|
String projName = projConfigMgrService.getProjNameByLotId(projIndex); |
||||
|
return new AppException(new ConsumeNotEnoughError(projName, projIndex)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -1,4 +0,0 @@ |
|||||
package a8k.service.appdata; |
|
||||
|
|
||||
public class AppProjConfigMgrService { |
|
||||
} |
|
@ -1,89 +0,0 @@ |
|||||
package a8k.service.appdevicectrl.action.mainflow; |
|
||||
|
|
||||
import a8k.service.appdata.AppProjInfoMgrService; |
|
||||
import a8k.service.appdevicectrl.action.base.A8kActionStepType; |
|
||||
import a8k.service.appdevicectrl.action.base.A8kStepAction; |
|
||||
import a8k.service.appstate.AppA8kGStateService; |
|
||||
import a8k.service.appstate.resource.A8kPublicResourceType; |
|
||||
import a8k.service.devicedriver.ctrl.SampleScanTransportCtrl; |
|
||||
import a8k.type.exception.AppException; |
|
||||
import jakarta.annotation.Resource; |
|
||||
import org.slf4j.Logger; |
|
||||
import org.slf4j.LoggerFactory; |
|
||||
import org.springframework.stereotype.Component; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 检查耗材是否充足 |
|
||||
*/ |
|
||||
@Component |
|
||||
public class SEQ3_CHECK_THE_QUANTITY_OF_CONSUMABLES extends A8kStepAction { |
|
||||
static Logger logger = LoggerFactory.getLogger(SEQ3_CHECK_THE_QUANTITY_OF_CONSUMABLES.class); |
|
||||
|
|
||||
SEQ3_CHECK_THE_QUANTITY_OF_CONSUMABLES() { |
|
||||
super(A8kActionStepType.DO_CHECK_THE_QUANTITY_OF_CONSUMABLES); |
|
||||
} |
|
||||
|
|
||||
@Resource |
|
||||
AppA8kGStateService gstate; |
|
||||
|
|
||||
@Resource |
|
||||
SampleScanTransportCtrl sstc; |
|
||||
|
|
||||
@Resource |
|
||||
AppProjInfoMgrService projInfoMgrService; |
|
||||
|
|
||||
void init() { |
|
||||
} |
|
||||
|
|
||||
|
|
||||
void checkProjResource(Integer projIndex) { |
|
||||
//检查项目ID卡是否存在 |
|
||||
// if(projInfoMgrService.) |
|
||||
//检查耗材 |
|
||||
|
|
||||
//申请耗材 |
|
||||
|
|
||||
//申请失败,抛出异常 |
|
||||
|
|
||||
//如果出错要归还耗材 |
|
||||
} |
|
||||
|
|
||||
@Override public void doaction() throws AppException { |
|
||||
//检查当前试管的待做项目所需要的资源是否充足 |
|
||||
// List<Integer> projIndex = gstate.getTubeHolder().getProcessingTube().projIndex; |
|
||||
// if (projIndex.isEmpty()) { |
|
||||
// logger.error("试管待处理项目为空");//属于代码异常 |
|
||||
// sstc.ejectTubeHolder(); |
|
||||
// throw new AppException(A8kEcode.CodeError.index, "试管待处理项目为空"); |
|
||||
// } |
|
||||
// |
|
||||
// for (Integer proj : projIndex) { |
|
||||
// checkProjResource(proj); |
|
||||
// } |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override public Boolean checkCondition() { |
|
||||
// // 仪器是否在工作 |
|
||||
// Boolean cond1 = gstate.isWorking(); |
|
||||
// // 试管架是否在处理中 |
|
||||
// Boolean cond2 = gstate.getTubeHolder().state.equals(TubeHolderState.PROCESSING); |
|
||||
// // 试管是否待处理 |
|
||||
// Boolean cond3 = gstate.getTubeHolder().getProcessingTube() != null && gstate.getTubeHolder().getProcessingTube().state.equals(TubeState.TO_BE_PROCESSED); |
|
||||
// // 孵育盘是否有空位 |
|
||||
// Boolean cond4 = gstate.getIncubationPlate().getEmptyPos() != null; |
|
||||
// return cond1 && cond2 && cond3 && cond4; |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
@Override public List<A8kPublicResourceType> getDeplyResourceList() { |
|
||||
return List.of(); |
|
||||
} |
|
||||
|
|
||||
@Override public Boolean isAllowsParallelRunning() { |
|
||||
return false;//串行任务,无需担心状态冲突 |
|
||||
} |
|
||||
} |
|
@ -1,19 +1,18 @@ |
|||||
package a8k.service.appdevicectrl.type; |
package a8k.service.appdevicectrl.type; |
||||
|
|
||||
import a8k.hardware.type.a8kcanprotocol.A8kEcode; |
|
||||
import a8k.service.appdevicectrl.action.base.A8kActionStepType; |
import a8k.service.appdevicectrl.action.base.A8kActionStepType; |
||||
import a8k.type.ecode.AppError; |
import a8k.type.ecode.AppError; |
||||
|
|
||||
public class A8kEcodeContext { |
|
||||
|
public class A8kErrorContext { |
||||
public A8kActionStepType dowhat; |
public A8kActionStepType dowhat; |
||||
public AppError ecode; |
public AppError ecode; |
||||
|
|
||||
public A8kEcodeContext(A8kActionStepType dowhat, AppError ecode) { |
|
||||
|
public A8kErrorContext(A8kActionStepType dowhat, AppError ecode) { |
||||
this.dowhat = dowhat; |
this.dowhat = dowhat; |
||||
this.ecode = ecode; |
this.ecode = ecode; |
||||
} |
} |
||||
|
|
||||
public Boolean equals(A8kEcodeContext other) { |
|
||||
|
public Boolean equals(A8kErrorContext other) { |
||||
return this.dowhat.equals(other.dowhat) && this.ecode.code.equals(other.ecode.code); |
return this.dowhat.equals(other.dowhat) && this.ecode.code.equals(other.ecode.code); |
||||
} |
} |
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
package a8k.type.ecode; |
||||
|
|
||||
|
import a8k.hardware.type.a8kcanprotocol.A8kEcode; |
||||
|
|
||||
|
public class ConsumeNotEnoughError extends AppError { |
||||
|
Integer projIndex; |
||||
|
String projName; |
||||
|
|
||||
|
public ConsumeNotEnoughError(String projName, Integer projIndex) { |
||||
|
super(A8kEcode.ConsumeNotEnough); |
||||
|
} |
||||
|
|
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue