|  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONArray; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.alibaba.fastjson.TypeReference; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.common.StreamInfo; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.conf.UserSetup; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.conf.UserSetting; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.bean.*; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.dto.*; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.IGbStreamService; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.IMediaServerService; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.IStreamPushService; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.dao.*; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto; | 
|---|
|  |  |  | import com.github.pagehelper.PageHelper; | 
|---|
|  |  |  | import com.github.pagehelper.PageInfo; | 
|---|
|  |  |  | import org.slf4j.Logger; | 
|---|
|  |  |  | 
|---|
|  |  |  | private IRedisCatchStorage redisCatchStorage; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private UserSetup userSetup; | 
|---|
|  |  |  | private UserSetting userSetting; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IMediaServerService mediaServerService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<StreamPushItem> handleJSON(String jsonData, MediaServerItem mediaServerItem) { | 
|---|
|  |  |  | if (jsonData == null) return null; | 
|---|
|  |  |  | if (jsonData == null) { | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Map<String, StreamPushItem> result = new HashMap<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | zlmresTfulUtils.getMediaList(mediaServerItem, (mediaList ->{ | 
|---|
|  |  |  | if (mediaList == null) return; | 
|---|
|  |  |  | if (mediaList == null) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String dataStr = mediaList.getString("data"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer code = mediaList.getInteger("code"); | 
|---|
|  |  |  | 
|---|
|  |  |  | String type = "PUSH"; | 
|---|
|  |  |  | for (MediaItem offlineMediaItem : offlineMediaItemList) { | 
|---|
|  |  |  | JSONObject jsonObject = new JSONObject(); | 
|---|
|  |  |  | jsonObject.put("serverId", userSetup.getServerId()); | 
|---|
|  |  |  | jsonObject.put("serverId", userSetting.getServerId()); | 
|---|
|  |  |  | jsonObject.put("app", offlineMediaItem.getApp()); | 
|---|
|  |  |  | jsonObject.put("stream", offlineMediaItem.getStream()); | 
|---|
|  |  |  | jsonObject.put("register", false); | 
|---|
|  |  |  | 
|---|
|  |  |  | // 移除redis内流的信息 | 
|---|
|  |  |  | redisCatchStorage.removeStream(mediaServerId, type, mediaItem.getApp(), mediaItem.getStream()); | 
|---|
|  |  |  | JSONObject jsonObject = new JSONObject(); | 
|---|
|  |  |  | jsonObject.put("serverId", userSetup.getServerId()); | 
|---|
|  |  |  | jsonObject.put("serverId", userSetting.getServerId()); | 
|---|
|  |  |  | jsonObject.put("app", mediaItem.getApp()); | 
|---|
|  |  |  | jsonObject.put("stream", mediaItem.getStream()); | 
|---|
|  |  |  | jsonObject.put("register", false); | 
|---|
|  |  |  | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | streamPushItemForPlatform.setPlatformId(platFormInfoArray[0]); | 
|---|
|  |  |  | if (platFormInfoArray[0].equals("34020000002110000001")) { | 
|---|
|  |  |  | System.out.println(111); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<GbStream> gbStreamList = platformForEvent.get(platFormInfoArray[0]); | 
|---|
|  |  |  | if (gbStreamList == null) { | 
|---|
|  |  |  | gbStreamList = new ArrayList<>(); | 
|---|