admin
2021-03-01 d73687bc6115007145b4aab050e4e29ff87fd8ae
src/main/java/com/yeshi/buwan/controller/admin/api/ClassController.java
@@ -7,8 +7,10 @@
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;
@@ -32,10 +34,6 @@
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
@@ -79,6 +77,7 @@
      object.put("data", array);
      out.print(object);
   }
   @RequestMapping("getAllFirstClass")
   public void getAllFirstClass(PrintWriter out){
      List<VideoType> list = classService.getAllVideoType();
@@ -140,6 +139,7 @@
   
   /**
    * 搜索
     *
    * @param key
    * @param detailsystem
    * @param videotype
@@ -148,7 +148,7 @@
    */
   @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";
@@ -166,10 +166,10 @@
      
      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);
@@ -186,23 +186,8 @@
      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)
@@ -244,7 +229,7 @@
   }
   
   @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())){
@@ -252,15 +237,16 @@
         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()));