|
|
@ -6,6 +6,7 @@ import com.iflytop.gd.app.service.device.DeviceStateService; |
|
|
|
import com.iflytop.gd.app.service.device.module.HeatModuleService; |
|
|
|
import com.iflytop.gd.common.annotation.CommandMapping; |
|
|
|
import com.iflytop.gd.common.enums.HeatModuleCode; |
|
|
|
import com.iflytop.gd.common.enums.HeatingType; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
@ -26,13 +27,17 @@ public class HeatStartCommand extends BaseCommandHandler { |
|
|
|
@Override |
|
|
|
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { |
|
|
|
String heatId = cmdDTO.getStringParam("heatId"); |
|
|
|
Integer time = cmdDTO.getIntegerParam("time"); |
|
|
|
Integer minutes = cmdDTO.getIntegerParam("minutes"); |
|
|
|
Integer seconds = cmdDTO.getIntegerParam("seconds"); |
|
|
|
Double temperature = cmdDTO.getDoubleParam("temperature"); |
|
|
|
HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatId); |
|
|
|
return runAsync(() -> { |
|
|
|
//从系统状态中获取指定加热区设定的温度数值 |
|
|
|
double temperature = deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).getTemperature(); |
|
|
|
//开启加热 |
|
|
|
heatModuleService.heatRodOpen(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, temperature); |
|
|
|
// deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeating(true); |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTargetTime(time); |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatTemperature(temperature); |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTargetTemperature(temperature); |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.thermostatic); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|