|
@@ -13,7 +13,6 @@ import com.xy.collections.list.JList;
|
|
|
import com.xy.collections.map.JHashMap;
|
|
|
import com.xy.collections.map.JMap;
|
|
|
import com.xy.consumer.cmd.CmdProducer;
|
|
|
-import com.xy.device.EnumDeviceType;
|
|
|
import com.xy.dto.AckMqttDto;
|
|
|
import com.xy.dto.CommandMqtt;
|
|
|
import com.xy.dto.MqttDto;
|
|
@@ -22,8 +21,8 @@ import com.xy.entity.DeviceInfo;
|
|
|
import com.xy.entity.MqttCommand;
|
|
|
import com.xy.error.CommRuntimeException;
|
|
|
import com.xy.mapper.MqttCommandMapper;
|
|
|
-import com.xy.service.factory.cmd.service.CmdService;
|
|
|
-import com.xy.service.factory.device.service.DeviceFactory;
|
|
|
+import com.xy.service.factory.cmd.CmdService;
|
|
|
+import com.xy.service.factory.device.DeviceFactory;
|
|
|
import com.xy.utils.*;
|
|
|
import com.xy.utils.enums.MqttCommandStatusEnum;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -129,7 +128,7 @@ public class MqttServiceImpl extends ServiceImpl<MqttCommandMapper, MqttCommand>
|
|
|
});
|
|
|
List<Tuple.Tuple3<Long, Long, Boolean>> list = new ArrayList<>();
|
|
|
jMap.forEach((deviceType, commandMqttss) -> {
|
|
|
- List<Tuple.Tuple3<Long, Long, Boolean>> data = FactoryUtils.getService(() -> deviceType == EnumDeviceType.N_5.getIntCode() ? 2 : 1, DeviceFactory.class)
|
|
|
+ List<Tuple.Tuple3<Long, Long, Boolean>> data = FactoryUtils.getServiceRoute(DeviceFactory.class, deviceType)
|
|
|
.senCommand(commandMqttss).getData();
|
|
|
if (data != null) {
|
|
|
list.addAll(data);
|
|
@@ -172,7 +171,7 @@ public class MqttServiceImpl extends ServiceImpl<MqttCommandMapper, MqttCommand>
|
|
|
@ApiOperation("指令结果通知")
|
|
|
@PostMapping("commandResultBack")
|
|
|
public R commandResultBack(@RequestBody @Validated MqttDto.ResultBack resultBack) {
|
|
|
- return FactoryUtils.getService(resultBack.getCmdType(), CmdService.class).resultBack(resultBack);
|
|
|
+ return FactoryUtils.getService(CmdService.class, resultBack.getCmdType()).resultBack(resultBack);
|
|
|
}
|
|
|
|
|
|
@PostMapping("snByCmdAndResult")
|