/** * 查询单体信息 * * @param contentid * @param acttype * @return */ public Map<String, Object> getAudioInfo(String contentid, String acttype) { CacheEle<_CacheDictionary> cache = ((CacheEle<_CacheDictionary>) SystemCache.getCache(WtContentMngConstants.CACHE_DICT)); _CacheDictionary cd = cache.getContent(); Map<String, Object> audioData = new HashMap<String, Object>(); MediaAsset ma = mediaService.getMaInfoById(contentid); audioData.put("ContentId", ma.getId()); audioData.put("ContentName", ma.getMaTitle()); audioData.put("MediaType", acttype); audioData.put("ContentImg", ma.getMaImg()); audioData.put("ContentCTime", ma.getCTime()); audioData.put("ContentPubTime", ma.getMaPublishTime()); audioData.put("ContentDesc", ma.getDescn()); audioData.put("ContentTimes", ma.getCTime()); audioData.put("ContentSource", ma.getMaPublisher()); audioData.put("ContentURI", ma.getMaURL()); audioData.put("ContentPersons", null); List<DictRefResPo> listdicref = mediaService.getResDictRefByResId(audioData.get("ContentId") + ""); String catalogs = ""; for (DictRefResPo dictRefResPo : listdicref) { DictDetail dd = cd.getDictDetail(dictRefResPo.getDictMid(), dictRefResPo.getDictDid()); if (dd != null) catalogs += "," + dd.getNodeName(); } audioData.put( "ContentCatalogs", (StringUtils.isNullOrEmptyOrSpace(catalogs) || catalogs.toLowerCase().equals("null")) ? null : catalogs.substring(1)); return audioData; }
/** * 查询列表 * * @param flowFlag * @param page * @param pagesize * @param catalogsid * @param source * @param beginpubtime * @param endpubtime * @param beginctime * @param endctime * @return */ public Map<String, Object> getContent( int flowFlag, int page, int pagesize, String channelId, String publisherId, Timestamp beginpubtime, Timestamp endpubtime, Timestamp beginctime, Timestamp endctime) { Map<String, Object> mapall = new HashMap<String, Object>(); Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; List<Map<String, Object>> list2seq = new ArrayList<Map<String, Object>>(); int numall = 0; String sql = ""; Map<String, Object> m = new HashMap<String, Object>(); m.put("channelId", channelId); m.put("publisherId", publisherId); m.put("beginPubtime", beginpubtime); m.put("endPubtime", endpubtime); m.put("begincTime", beginctime); m.put("endcTime", endctime); m.put("flowFlag", flowFlag); numall = mediaService.getCountInCha(m); m.clear(); m.put("channelId", channelId); m.put("publisherId", publisherId); m.put("beginPubtime", beginpubtime); m.put("endPubtime", endpubtime); m.put("begincTime", beginctime); m.put("endcTime", endctime); m.put("flowFlag", flowFlag); m.put("beginNum", page * pagesize); m.put("size", pagesize); List<ChannelAssetPo> listchapo = mediaService.getContentsByFlowFlag(m); for (ChannelAssetPo channelAssetPo : listchapo) { Map<String, Object> oneData = new HashMap<String, Object>(); oneData.put("Id", channelAssetPo.getId()); // 栏目ID修改排序功能时使用 oneData.put("MediaType", channelAssetPo.getAssetType()); oneData.put("ContentId", channelAssetPo.getAssetId()); // 内容ID获得详细信息时使用 oneData.put("ContentImg", channelAssetPo.getPubImg()); oneData.put("ContentCTime", channelAssetPo.getCTime()); oneData.put("ContentPubTime", channelAssetPo.getPubTime()); oneData.put("ContentSort", channelAssetPo.getSort()); oneData.put("ContentFlowFlag", channelAssetPo.getFlowFlag()); list2seq.add(oneData); } // 查询显示的节目名称,发布组织和描述信息 for (Map<String, Object> map : list2seq) { if (map.get("MediaType").equals("wt_SeqMediaAsset")) { SeqMediaAsset sma = mediaService.getSmaInfoById(map.get("ContentId") + ""); map.put("ContentName", sma.getSmaTitle()); map.put("ContentSource", sma.getPublisher()); map.put("ContentDesc", sma.getDescn()); } else { if (map.get("MediaType").equals("wt_MediaAsset")) { MediaAsset ma = mediaService.getMaInfoById(map.get("ContentId") + ""); map.put("ContentName", ma.getMaTitle()); map.put("ContentSource", ma.getMaPublisher()); map.put("ContentDesc", ma.getDescn()); } else { if (map.get("MediaType").equals("wt_Broadcast")) { // 待更改 sql = "select bcTitle,bcPublisher,descn from wt_Broadcast where id = ? limit 1"; try { conn = DataSource.getConnection(); ps = conn.prepareStatement(sql); ps.setString(1, (String) map.get("ContentId")); rs = ps.executeQuery(); while (rs != null && rs.next()) { map.put("ContentName", rs.getString("bcTitle")); map.put("ContentSource", rs.getString("bcPublisher")); map.put("ContentDesc", rs.getString("descn")); } } catch (SQLException e) { e.printStackTrace(); } finally { closeConnection(conn, ps, rs); } } } } } mapall.put("List", list2seq); mapall.put("Count", numall); return mapall; }