|
|
@ -95,17 +95,17 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> { |
|
|
|
if (startCraftsDTO.getHeatId() == null) { |
|
|
|
//如果没有指定加热区id,则自动获取一个 |
|
|
|
HeatModuleState heatModuleState = heatModuleService.getIdleHeatModule(); |
|
|
|
if (heatModuleState == null) { |
|
|
|
if (heatModuleState == null || heatModuleState.getModuleCode().equals(HeatModuleCode.heat_module_04)) { |
|
|
|
log.error("自动分配工艺失败,无空闲加热模块。"); |
|
|
|
throw new AppException(ResultCode.HEAT_MODULE_NO_IDLE); |
|
|
|
} else { |
|
|
|
heatModuleCode = heatModuleState.getModuleCode(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// if (futureMap.containsKey(heatModuleCode)) {//校验指定加热模块是否正在执行工艺 |
|
|
|
// log.error("工艺正在执行中,不可重复开始执行。"); |
|
|
|
// throw new AppException(ResultCode.CRAFT_RUNNING); |
|
|
|
// } |
|
|
|
if (futureMap.containsKey(heatModuleCode)) {//校验指定加热模块是否正在执行工艺 |
|
|
|
log.error("工艺正在执行中,不可重复开始执行。"); |
|
|
|
throw new AppException(ResultCode.CRAFT_RUNNING); |
|
|
|
} |
|
|
|
} |
|
|
|
craftMonitor.setHeatId(heatModuleCode); |
|
|
|
craftMonitorService.save(craftMonitor); |
|
|
|