From 76208975bffec39eb62f8599a68d583a5cb6da18 Mon Sep 17 00:00:00 2001 From: leesam <leesam@leesam.cn> Date: 星期二, 19 三月 2024 16:53:01 +0800 Subject: [PATCH] [add]支持其他平台通过ApiKey调用系统相关接口 --- src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java index 467014c..55fa5e9 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java @@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; import java.util.ArrayList; import java.util.HashMap; @@ -245,6 +246,10 @@ @Override public void batchUpdateChannel(List<DeviceChannel> channels) { + String now = DateUtil.getNow(); + for (DeviceChannel channel : channels) { + channel.setUpdateTime(now); + } channelMapper.batchUpdate(channels); for (DeviceChannel channel : channels) { if (channel.getParentId() != null) { @@ -263,5 +268,16 @@ } } - + @Override + public void updateChannelStreamIdentification(DeviceChannel channel) { + assert !ObjectUtils.isEmpty(channel.getDeviceId()); + assert !ObjectUtils.isEmpty(channel.getStreamIdentification()); + if (ObjectUtils.isEmpty(channel.getStreamIdentification())) { + logger.info("[閲嶇疆閫氶亾鐮佹祦绫诲瀷] 璁惧: {}, 鐮佹祦锛� {}", channel.getDeviceId(), channel.getStreamIdentification()); + }else { + logger.info("[鏇存柊閫氶亾鐮佹祦绫诲瀷] 璁惧: {}, 閫氶亾锛歿}锛� 鐮佹祦锛� {}", channel.getDeviceId(), channel.getChannelId(), + channel.getStreamIdentification()); + } + channelMapper.updateChannelStreamIdentification(channel); + } } -- Gitblit v1.8.0