|
@ -2,12 +2,15 @@ package com.iflytop.handacid.app.service; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.iflytop.handacid.app.common.enums.ChannelCode; |
|
|
import com.iflytop.handacid.app.common.enums.ChannelCode; |
|
|
|
|
|
import com.iflytop.handacid.app.common.enums.SolutionAddMode; |
|
|
|
|
|
import com.iflytop.handacid.app.common.enums.SystemConfigKey; |
|
|
import com.iflytop.handacid.app.core.state.ChannelState; |
|
|
import com.iflytop.handacid.app.core.state.ChannelState; |
|
|
import com.iflytop.handacid.app.core.state.DeviceState; |
|
|
import com.iflytop.handacid.app.core.state.DeviceState; |
|
|
import com.iflytop.handacid.common.model.entity.Channel; |
|
|
import com.iflytop.handacid.common.model.entity.Channel; |
|
|
import com.iflytop.handacid.common.model.entity.Solution; |
|
|
import com.iflytop.handacid.common.model.entity.Solution; |
|
|
import com.iflytop.handacid.common.service.ChannelService; |
|
|
import com.iflytop.handacid.common.service.ChannelService; |
|
|
import com.iflytop.handacid.common.service.SolutionService; |
|
|
import com.iflytop.handacid.common.service.SolutionService; |
|
|
|
|
|
import com.iflytop.handacid.common.service.SystemConfigService; |
|
|
import com.iflytop.handacid.hardware.service.AppEventBusService; |
|
|
import com.iflytop.handacid.hardware.service.AppEventBusService; |
|
|
import com.iflytop.handacid.hardware.type.appevent.A8kCanBusOnConnectEvent; |
|
|
import com.iflytop.handacid.hardware.type.appevent.A8kCanBusOnConnectEvent; |
|
|
import com.iflytop.handacid.hardware.type.appevent.AppEvent; |
|
|
import com.iflytop.handacid.hardware.type.appevent.AppEvent; |
|
@ -27,6 +30,7 @@ public class DeviceInitService { |
|
|
private final ObjectProvider<ChannelState> channelStateObjectProvider; |
|
|
private final ObjectProvider<ChannelState> channelStateObjectProvider; |
|
|
private final ChannelService channelService; |
|
|
private final ChannelService channelService; |
|
|
private final SolutionService solutionService; |
|
|
private final SolutionService solutionService; |
|
|
|
|
|
private final SystemConfigService systemConfigService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostConstruct |
|
|
@PostConstruct |
|
@ -60,6 +64,8 @@ public class DeviceInitService { |
|
|
ChannelState channelState = channelStateObjectProvider.getObject(code, solution.getId(), solution.getName(), channel.getConcentration(), channel.getTargetVolume(), channel.getReceivedVolume(), channel.getCurrentVolume()); |
|
|
ChannelState channelState = channelStateObjectProvider.getObject(code, solution.getId(), solution.getName(), channel.getConcentration(), channel.getTargetVolume(), channel.getReceivedVolume(), channel.getCurrentVolume()); |
|
|
deviceState.getChannelStateMap().put(code, channelState); |
|
|
deviceState.getChannelStateMap().put(code, channelState); |
|
|
} |
|
|
} |
|
|
|
|
|
SolutionAddMode mode = SolutionAddMode.valueOf(systemConfigService.getValueByKey(SystemConfigKey.SOLUTION_ADD_MODE)); |
|
|
|
|
|
deviceState.setMode(mode); |
|
|
log.info("初始化 initDeviceState完毕"); |
|
|
log.info("初始化 initDeviceState完毕"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|