|  |  |  | 
|---|
|  |  |  | import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto; | 
|---|
|  |  |  | import com.google.common.collect.BiMap; | 
|---|
|  |  |  | import com.google.common.collect.HashBiMap; | 
|---|
|  |  |  | import org.springframework.util.ObjectUtils; | 
|---|
|  |  |  | import org.springframework.util.StringUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void invoke(StreamPushExcelDto streamPushExcelDto, AnalysisContext analysisContext) { | 
|---|
|  |  |  | if (StringUtils.isEmpty(streamPushExcelDto.getApp()) | 
|---|
|  |  |  | || StringUtils.isEmpty(streamPushExcelDto.getStream()) | 
|---|
|  |  |  | || StringUtils.isEmpty(streamPushExcelDto.getGbId())) { | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(streamPushExcelDto.getApp()) | 
|---|
|  |  |  | || ObjectUtils.isEmpty(streamPushExcelDto.getStream()) | 
|---|
|  |  |  | || ObjectUtils.isEmpty(streamPushExcelDto.getGbId())) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | gBMap.put(streamPushExcelDto.getApp() + streamPushExcelDto.getStream(), streamPushExcelDto.getGbId()); | 
|---|
|  |  |  | }catch (IllegalArgumentException e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | errorGBList.add(streamPushExcelDto.getGbId() + "(不同的app+stream使用了相同的国标ID)"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | streamPushItem.setApp(streamPushExcelDto.getApp()); | 
|---|
|  |  |  | streamPushItem.setStream(streamPushExcelDto.getStream()); | 
|---|
|  |  |  | streamPushItem.setGbId(streamPushExcelDto.getGbId()); | 
|---|
|  |  |  | streamPushItem.setStatus(false); | 
|---|
|  |  |  | streamPushItem.setStatus(streamPushExcelDto.getStatus()); | 
|---|
|  |  |  | streamPushItem.setStreamType("push"); | 
|---|
|  |  |  | streamPushItem.setCreateTime(DateUtil.getNow()); | 
|---|
|  |  |  | streamPushItem.setMediaServerId(defaultMediaServerId); | 
|---|
|  |  |  | 
|---|
|  |  |  | streamPushItems.add(streamPushItem); | 
|---|
|  |  |  | streamPushItemForSave.put(streamPushItem.getApp() + streamPushItem.getStream(), streamPushItem); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!StringUtils.isEmpty(streamPushExcelDto.getPlatformId())) { | 
|---|
|  |  |  | if (!ObjectUtils.isEmpty(streamPushExcelDto.getPlatformId())) { | 
|---|
|  |  |  | List<String[]> platformList = streamPushItemsForPlatform.get(streamPushItem.getApp() + streamPushItem.getStream()); | 
|---|
|  |  |  | if (platformList == null) { | 
|---|
|  |  |  | platformList = new ArrayList<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String platformId = streamPushExcelDto.getPlatformId(); | 
|---|
|  |  |  | String catalogId = streamPushExcelDto.getCatalogId(); | 
|---|
|  |  |  | if (StringUtils.isEmpty(streamPushExcelDto.getCatalogId())) { | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(streamPushExcelDto.getCatalogId())) { | 
|---|
|  |  |  | catalogId = null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String[] platFormInfoArray = new String[]{platformId, catalogId}; | 
|---|