|
|
@ -7,6 +7,8 @@ import com.iflytop.gd.app.mapper.CraftsMapper; |
|
|
|
import com.iflytop.gd.app.model.bo.status.device.CraftsState; |
|
|
|
import com.iflytop.gd.app.model.bo.status.device.HeatModuleState; |
|
|
|
import com.iflytop.gd.app.model.bo.status.device.TrayState; |
|
|
|
import com.iflytop.gd.app.model.bo.status.device.TubeState; |
|
|
|
import com.iflytop.gd.app.model.dto.StartCraftsDTO; |
|
|
|
import com.iflytop.gd.app.model.entity.Crafts; |
|
|
|
import com.iflytop.gd.app.model.entity.Ores; |
|
|
|
import com.iflytop.gd.app.model.vo.CraftStatusVO; |
|
|
@ -29,7 +31,6 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
import java.util.concurrent.Executors; |
|
|
@ -97,7 +98,9 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> { |
|
|
|
/** |
|
|
|
* 启动执行工艺 |
|
|
|
*/ |
|
|
|
public synchronized SetCraftsVO startCrafts(Long craftId, HeatModuleCode heatModuleCode) { |
|
|
|
public synchronized SetCraftsVO startCrafts(StartCraftsDTO startCraftsDTO) { |
|
|
|
long craftId = startCraftsDTO.getCraftId(); |
|
|
|
HeatModuleCode heatModuleCode = startCraftsDTO.getHeatId(); |
|
|
|
Crafts craft = this.getById(craftId); |
|
|
|
if (craft == null) { |
|
|
|
throw new AppException(ResultCode.INVALID_PARAMETER); |
|
|
@ -106,7 +109,7 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> { |
|
|
|
if (ores == null) { |
|
|
|
throw new AppException(ResultCode.INVALID_PARAMETER); |
|
|
|
} |
|
|
|
if(deviceStateService.getDeviceState().getSolutionModule().getTrayStatus() == 0){ |
|
|
|
if (deviceStateService.getDeviceState().getSolutionModule().getTrayStatus() == 0) { |
|
|
|
throw new AppException(ResultCode.SOLUTION_MODULE_NO_TRAY); |
|
|
|
} |
|
|
|
//判断是否指定加热区id |
|
|
@ -152,6 +155,16 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> { |
|
|
|
futureMap.put(heatModuleCode, future); |
|
|
|
|
|
|
|
TrayState trayState = deviceStateService.getDeviceState().getTrayInSolutionModule(); |
|
|
|
//配置可操作试管 |
|
|
|
TubeState[] tubeStateArr = trayState.getTubes(); |
|
|
|
List<Integer> needTubeNumArr = Arrays.stream(startCraftsDTO.getTubes()).boxed() .toList(); |
|
|
|
for (TubeState tubeState : tubeStateArr) { |
|
|
|
if(!needTubeNumArr.contains(tubeState.getTubeNum())){ |
|
|
|
tubeState.setNeedAddSolution(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//配置状态 |
|
|
|
CraftsState craftsState = craftsStateObjectProvider.getObject(); |
|
|
|
craftsState.setCraft(craft); |
|
|
|
craftsState.setOres(ores); |
|
|
@ -160,6 +173,7 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> { |
|
|
|
trayState.setHeatModuleId(heatModuleCode); |
|
|
|
trayState.setCrafts(craftsState); |
|
|
|
|
|
|
|
//组装返回值 |
|
|
|
SetCraftsVO setCraftsVO = new SetCraftsVO(); |
|
|
|
setCraftsVO.setHeatId(heatModuleCode); |
|
|
|
setCraftsVO.setCraftsName(craft.getName()); |
|
|
|