Commit ae27453c by zzrdark

1.修改适配配置配置结果

parent 367f0119
...@@ -102,4 +102,6 @@ public interface DeviceClient { ...@@ -102,4 +102,6 @@ public interface DeviceClient {
@PostMapping("/device/devicechannel/queryTotalStatisticsDeviceChannel") @PostMapping("/device/devicechannel/queryTotalStatisticsDeviceChannel")
List<DeviceChannelStatisticsDto> queryTotalStatisticsDeviceChannel(@RequestBody(required = false) List<Long> channelIds); List<DeviceChannelStatisticsDto> queryTotalStatisticsDeviceChannel(@RequestBody(required = false) List<Long> channelIds);
@PostMapping("/device/info/queryDeviceChannelSetting")
List<String> queryDeviceChannelSetting(List<String> imeis);
} }
...@@ -351,4 +351,16 @@ public class DeviceController { ...@@ -351,4 +351,16 @@ public class DeviceController {
} }
return response; return response;
} }
@RequestMapping("/device/queryDeviceChannelSetting")
public R queryDeviceChannelSetting(List<String> imeis){
if (imeis != null || imeis.size() != 0){
List<String> imeiList = deviceClient.queryDeviceChannelSetting(imeis);
return R.ok().put("data",imeiList);
}
return R.error(ResultCode.PARAMERROR,"参数错误");
}
} }
...@@ -20,5 +20,7 @@ public interface DeviceInfoChannelService extends IService<DeviceInfoChannelEnti ...@@ -20,5 +20,7 @@ public interface DeviceInfoChannelService extends IService<DeviceInfoChannelEnti
void removeDeivceInfoChannelByChannelId(List<Long> channelIds); void removeDeivceInfoChannelByChannelId(List<Long> channelIds);
List<DeviceInfoChannelEntity> queryDeviceInfoChannelByChannelIds(List<Long> channelIds); List<DeviceInfoChannelEntity> queryDeviceInfoChannelByChannelIds(List<Long> channelIds);
List<DeviceInfoChannelEntity> queryDeviceInfoChannelByDeviceIds(List<Long> deviceIds);
} }
...@@ -39,4 +39,11 @@ public class DeviceInfoChannelServiceImpl extends ServiceImpl<DeviceInfoChannelD ...@@ -39,4 +39,11 @@ public class DeviceInfoChannelServiceImpl extends ServiceImpl<DeviceInfoChannelD
return deviceInfoChannelEntities; return deviceInfoChannelEntities;
} }
@Override
public List<DeviceInfoChannelEntity> queryDeviceInfoChannelByDeviceIds(List<Long> deviceIds){
List<DeviceInfoChannelEntity> deviceInfoChannelEntities = getBaseMapper().selectList(new QueryWrapper<DeviceInfoChannelEntity>()
.in("device_id", deviceIds));
return deviceInfoChannelEntities;
}
} }
...@@ -229,6 +229,35 @@ public class DeviceInfoController { ...@@ -229,6 +229,35 @@ public class DeviceInfoController {
return R.ok(); return R.ok();
} }
@RequestMapping("/queryDeviceChannelSetting")
public List<String> queryDeviceChannelSetting(@RequestBody List<String> imeis){
Set<Long> deviceIds = new HashSet<>();
Set<String> ChannelSettingImeis = new HashSet<>();
List<DeviceInfoEntity> entities =
deviceInfoService.queryDeviceByImeis(imeis);
entities.forEach(deviceInfoEntity -> {
deviceIds.add(deviceInfoEntity.getDeptId());
if (deviceInfoEntity.getChannelRules() == null || deviceInfoEntity.getChannelRules() == 1){
ChannelSettingImeis.add(deviceInfoEntity.getImei());
}
});
List<DeviceInfoChannelEntity> deviceInfoChannelEntities =
deviceInfoChannelService.queryDeviceInfoChannelByDeviceIds(new LinkedList<>(deviceIds));
deviceInfoChannelEntities.forEach(deviceInfoChannelEntity -> {
entities.forEach(deviceInfoEntity -> {
if (deviceInfoEntity.getDeptId().equals(deviceInfoChannelEntity.getDeviceId())){
ChannelSettingImeis.add(deviceInfoEntity.getImei());
}
});
});
return new LinkedList<>(ChannelSettingImeis);
}
/** /**
* 保存 * 保存
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment