|
|
@@ -37,7 +37,6 @@ public class SourcePlayRecordHandler extends ChannelInboundHandlerAdapter {
|
|
|
log.info("SourcePlayRecordHandler : receive play record message :{}", message);
|
|
|
String[] messageArray = message.split("/");
|
|
|
String identifier = messageArray[0];
|
|
|
-
|
|
|
// 设备信息
|
|
|
SmsbDeviceVo smsbDeviceVo = smsbDeviceService.getDeviceByIdentifier(identifier);
|
|
|
if (null == smsbDeviceVo) {
|
|
|
@@ -47,14 +46,19 @@ public class SourcePlayRecordHandler extends ChannelInboundHandlerAdapter {
|
|
|
SourcePlayRecord sourcePlayRecord = new SourcePlayRecord();
|
|
|
// 设备ID
|
|
|
sourcePlayRecord.setDeviceId(smsbDeviceVo.getId());
|
|
|
- // 节目ID
|
|
|
- sourcePlayRecord.setItemId(Long.parseLong(messageArray[4]));
|
|
|
- // 资源ID
|
|
|
- sourcePlayRecord.setSourceId(Long.parseLong(messageArray[5]));
|
|
|
- // 资源类型
|
|
|
- sourcePlayRecord.setSourceType(Integer.parseInt(messageArray[6]));
|
|
|
- // 播放时长
|
|
|
- sourcePlayRecord.setDuration(Long.parseLong(messageArray[7]));
|
|
|
+ try {
|
|
|
+ // 节目ID
|
|
|
+ sourcePlayRecord.setItemId(Long.parseLong(messageArray[4]));
|
|
|
+ // 资源ID
|
|
|
+ sourcePlayRecord.setSourceId(Long.parseLong(messageArray[5]));
|
|
|
+ // 资源类型
|
|
|
+ sourcePlayRecord.setSourceType(Integer.parseInt(messageArray[6]));
|
|
|
+ // 播放时长
|
|
|
+ sourcePlayRecord.setDuration(Long.parseLong(messageArray[7]));
|
|
|
+ }catch (Exception e) {
|
|
|
+ log.error("SourcePlayRecordHandler : parse message error :{}", message);
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 租户编号
|
|
|
sourcePlayRecord.setTenantId(smsbDeviceVo.getTenantId());
|
|
|
sourcePlayRecordMapper.insert(sourcePlayRecord);
|