/** * 加载专辑id为zjId的专辑的下属的节目列表,注意是某一页page的列表 * * @param zjId 专辑Id * @param page 第几页 * @return 返回该页的数据,以json串的方式,若该页无数据返回null */ public Map<String, Object> getZJSubPage(String zjId, String page) { Map<String, Object> map = new HashMap<String, Object>(); // 1-根据zjId,计算出文件存放目录 String path = SystemCache.getCache(FConstants.APPOSPATH).getContent() + "" + "mweb/zj/" + zjId + "/"; // 2-判断是否有page所对应的数据 File thisPage, nextPage; thisPage = new File(path + "P" + page + ".json"); // func() int nextpage = Integer.valueOf(page) + 1; nextPage = new File(path + "P" + nextpage + ".json"); if (!thisPage.exists()) { map.put("ReturnType", "1011"); map.put("Message", "没有相关内容 "); } else { // 组织本页数据 String jsonstr = CacheUtils.readFile(path + "P" + page + ".json"); List<Map<String, Object>> listaudios = (List<Map<String, Object>>) JsonUtils.jsonToObj(jsonstr, List.class); if (listaudios != null) { map.put("ResultList", listaudios); map.put("ReturnType", "1001"); map.put("NextPage", String.valueOf(nextPage.exists())); // 判断是否有下一页,并组织到返回数据中 } else { map.put("ReturnType", "1011"); map.put("Message", "没有相关内容 "); } } return map; }
/** * 查询单体信息 * * @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; }