| | |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | |
| | | import com.yeshi.buwan.util.*; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | |
| | |
| | | import com.yeshi.buwan.service.imp.HomeTypeService; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.service.imp.recommend.CategoryRecommendVideoService; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.util.EhcacheUtil; |
| | | import com.yeshi.buwan.util.JsonUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.web.tag.PageEntity; |
| | | |
| | | @Controller |
| | |
| | | object.put("data", array); |
| | | out.print(object); |
| | | } |
| | | |
| | | @RequestMapping("getAllFirstClass") |
| | | public void getAllFirstClass(PrintWriter out){ |
| | | List<VideoType> list = classService.getAllVideoType(); |
| | |
| | | |
| | | /** |
| | | * 搜索 |
| | | * |
| | | * @param key |
| | | * @param detailsystem |
| | | * @param videotype |
| | |
| | | */ |
| | | @RequestMapping(value = "/getseachList",method=RequestMethod.POST) |
| | | public void categoryRecommendVideoList(String key, String detailsystem, |
| | | String videotype, String page, PrintWriter out) { |
| | | String videotype, String page, HttpSession session, PrintWriter out) { |
| | | |
| | | if(detailsystem==null || "".equals(detailsystem.trim())){ |
| | | detailsystem="0"; |
| | |
| | | |
| | | List<CategoryRecommendVideoAdmin> list = categoryRecommendVideoService |
| | | .getCategoryRecommendVideoAdmin(key, |
| | | Integer.parseInt(videotype), Integer.parseInt(detailsystem), pageIndex); |
| | | Integer.parseInt(videotype), SystemUtil.getAdminSelectedSystemId(session), Integer.parseInt(detailsystem), pageIndex); |
| | | long count = categoryRecommendVideoService |
| | | .getCategoryRecommendVideoAdminCount(key, |
| | | Integer.parseInt(videotype), Integer.parseInt(detailsystem)); |
| | | Integer.parseInt(videotype), SystemUtil.getAdminSelectedSystemId(session), Integer.parseInt(detailsystem)); |
| | | PageEntity pe = new PageEntity(); |
| | | pe.setPageIndex(pageIndex); |
| | | pe.setPageSize(Constant.pageCount); |
| | |
| | | root.put("pageEntity", pe); |
| | | String json = gson.toJson(list); |
| | | root.put("crv", json); |
| | | // for (CategoryRecommendVideoAdmin categoryRecommendVideoAdmin : list) |
| | | // { |
| | | // System.out.println(categoryRecommendVideoAdmin.getCategoryRecommendVideo().getCategoryRecommendVideo()); |
| | | // root.put("categoryRecommendVideoAdmin", |
| | | // gson.toJson(categoryRecommendVideoAdmin.getCategoryRecommendVideo().getCategoryRecommendVideo())); |
| | | // } |
| | | System.out.println(root.toString()); |
| | | out.print(root); |
| | | // dataMap.put("categoryRecommendVideoAdminList", list); |
| | | // List<DetailSystem> detailSystemList = systemService |
| | | // .getDetailSystemList(); |
| | | // dataMap.put("detailSystemList", detailSystemList); |
| | | // List<VideoType> typeList = classService.getFirstTypeList(""); |
| | | // dataMap.put("videoTypeList", typeList); |
| | | // json.put("data", data); |
| | | // System.out.println("jsonStr---------"+jsonStr); |
| | | // out.print(jsonStr); |
| | | } |
| | | |
| | | @RequestMapping(value="/deleteCategoryRecommendVideo",method=RequestMethod.POST) |
| | |
| | | } |
| | | |
| | | @RequestMapping(value="/setCategoryRecommendVideo",method=RequestMethod.POST) |
| | | public void updateCategoryRecommendVideo(String id,String beizhu,String desc,int orderby,String picture,String videoid,String videotype,PrintWriter out) { |
| | | public void updateCategoryRecommendVideo(String id, String beizhu, String desc, int orderby, String picture, String videoid, String videotype, HttpSession session, PrintWriter out) { |
| | | |
| | | //id为空则新加 |
| | | if(id == null || "".equals(id.trim())){ |
| | |
| | | newCategoryRecommendVideo.setBeizhu(beizhu); |
| | | newCategoryRecommendVideo.setCreatetime(System.currentTimeMillis() + ""); |
| | | newCategoryRecommendVideo.setDesc(desc); |
| | | // categoryRecommendVideo.setJpos(jpos); |
| | | newCategoryRecommendVideo.setOrderby(orderby); |
| | | newCategoryRecommendVideo.setPicture(picture); |
| | | newCategoryRecommendVideo.setVideoInfo(new VideoInfo(videoid)); |
| | | newCategoryRecommendVideo.setVideoType(new VideoType(Long.parseLong(videotype))); |
| | | newCategoryRecommendVideo.setSystem(SystemUtil.getAdminSelectedSystem(session)); |
| | | |
| | | categoryRecommendVideoService.addCategoryRecommendVideo(newCategoryRecommendVideo); |
| | | |
| | | SuperCategoryRecommendVideo sz=null; |
| | | List<DetailSystem> list = systemService.getDetailSystemList(); |
| | | List<DetailSystem> list = systemService.getDetailSystemList(SystemUtil.getAdminSelectedSystem(session).getId()); |
| | | for (DetailSystem ds : list) { |
| | | sz= new SuperCategoryRecommendVideo(); |
| | | sz.setDetailSystem(new DetailSystem(ds.getId())); |