|
|
@ -101,11 +101,16 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> { |
|
|
|
heatModuleCode = heatModuleState.getModuleCode(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//判断加热区温度是否达标 |
|
|
|
if (futureMap.containsKey(heatModuleCode)) {//校验指定加热模块是否正在执行工艺 |
|
|
|
log.error("工艺正在执行中,不可重复开始执行。"); |
|
|
|
//判断选中的加热区是否存在托盘 存在托盘报错 |
|
|
|
TrayState trayState = deviceStateService.getDeviceState().getTrayByHeatModuleCode(heatModuleCode); |
|
|
|
if (trayState != null) { |
|
|
|
log.error("此加热区工艺正在执行中,不可重复开始执行。"); |
|
|
|
throw new AppException(ResultCode.CRAFT_RUNNING); |
|
|
|
} |
|
|
|
// if (futureMap.containsKey(heatModuleCode)) {//校验指定加热模块是否正在执行工艺 |
|
|
|
// log.error("工艺正在执行中,不可重复开始执行。"); |
|
|
|
// throw new AppException(ResultCode.CRAFT_RUNNING); |
|
|
|
// } |
|
|
|
} |
|
|
|
//判断温度 |
|
|
|
Double coldTemperature = systemConfigService.getSystemConfigDoubleByCode(SystemConfigCode.fan_stop_temperature);//加热区能能够执行加热的最低温度 |
|
|
@ -115,17 +120,17 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> { |
|
|
|
throw new AppException(ResultCode.HEAT_MODULE_TEMPERATURE_IS_HEIGHT); |
|
|
|
} |
|
|
|
craftMonitor.setHeatId(heatModuleCode); |
|
|
|
craftMonitorService.save(craftMonitor); |
|
|
|
craftMonitorService.saveMonitor(craftMonitor); |
|
|
|
log.info("准备开始工艺,加热模块{},工艺{}", heatModuleCode, craft.getName()); |
|
|
|
// 校验已有上下文状态,仅允许在 READY、STOPPED 或 FINISHED 状态下重置 |
|
|
|
// CraftsContext existing = contextMap.get(heatModuleCode); |
|
|
|
// if (existing != null) { |
|
|
|
// CraftStates state = existing.getSm().getState().getId(); |
|
|
|
// if (state == CraftStates.RUNNING || state == CraftStates.PAUSED) { |
|
|
|
// throw new AppException(ResultCode.CRAFT_RUNNING); |
|
|
|
// } |
|
|
|
// clearCraftContext(heatModuleCode); |
|
|
|
// } |
|
|
|
CraftsContext existing = contextMap.get(heatModuleCode); |
|
|
|
if (existing != null) { |
|
|
|
CraftStates state = existing.getSm().getState().getId(); |
|
|
|
if (state == CraftStates.RUNNING || state == CraftStates.PAUSED) { |
|
|
|
throw new AppException(ResultCode.CRAFT_RUNNING); |
|
|
|
} |
|
|
|
clearCraftContext(heatModuleCode); |
|
|
|
} |
|
|
|
|
|
|
|
TrayState trayState = deviceStateService.getDeviceState().getTrayInFeedModule(); |
|
|
|
//配置可操作试管 |
|
|
|