admin
2020-05-19 744594ef1a2f530fc3e86ea9dc48b62247f79420
fanli/src/main/java/com/yeshi/fanli/controller/admin/HelpCenterAdminController.java
@@ -25,7 +25,6 @@
import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
import com.yeshi.fanli.exception.config.HelpCenterException;
import com.yeshi.fanli.exception.config.HelpClassException;
import com.yeshi.fanli.exception.homemodule.FloatADException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.AppVersionService;
import com.yeshi.fanli.service.inter.help.HelpCenterService;
@@ -83,6 +82,26 @@
      }
   }
   /**
    * 修改状态
    * @param callback
    * @param id
    * @param out
    */
   @RequestMapping(value = "switchState")
   public void switchState(String callback, Long id, PrintWriter out) {
      try {
         helpCenterService.switchState(id);
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
      } catch (HelpCenterException e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
      } catch (Exception e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
         e.printStackTrace();
      }
   }
   @RequestMapping(value = "getInfo")
   public void getInfo(String callback, Long id, PrintWriter out) {
@@ -101,6 +120,9 @@
      JSONObject data = new JSONObject();
      data.put("id", crrent.getId());
      data.put("title", crrent.getTitle());
      data.put("state", crrent.getState());
      data.put("weight", crrent.getWeight());
      if (crrent.getStartTime() != null) {
         data.put("startTime", TimeUtil.getWholeTime(crrent.getStartTime().getTime()));
@@ -141,7 +163,7 @@
    */
   @RequestMapping(value = "query")
   public void query(String callback, Integer pageIndex, Integer pageSize, String key, Long cid, Integer orderMode,
         String version, String platform, PrintWriter out) {
         String version, String platform, Integer state,PrintWriter out) {
      try {
         if (orderMode == null)
            orderMode = 1;
@@ -152,7 +174,7 @@
         if (pageSize == null)
            pageSize = Constant.PAGE_SIZE;
         List<HelpCenter> list = helpCenterService.query(0, Integer.MAX_VALUE, key, cid, orderMode);
         List<HelpCenter> list = helpCenterService.query(0, Integer.MAX_VALUE, key, cid, orderMode, state);
         if (list == null || list.size() == 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
            return;
@@ -346,7 +368,7 @@
            helpClassService.save(helpClass, null);
         }
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
      } catch (FloatADException e) {
      } catch (HelpClassException e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
      } catch (Exception e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
@@ -354,6 +376,25 @@
      }
   }
   /**
    * 修改状态
    * @param callback
    * @param id
    * @param out
    */
   @RequestMapping(value = "switchStateClass")
   public void switchStateClass(String callback, Long id, PrintWriter out) {
      try {
         helpClassService.switchState(id);
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
      } catch (HelpClassException e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
      } catch (Exception e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
         e.printStackTrace();
      }
   }
   /**
    * 修改排序