Package org.jeecgframework.core.common.model.json

Examples of org.jeecgframework.core.common.model.json.AjaxJson


   * @return
   */
  @RequestMapping(params = "save")
  @ResponseBody
  public AjaxJson save(CourseEntity course, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(course.getId())) {
      message = "课程更新成功";
      try {
        courseService.updateCourse(course);
        systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
      } catch (Exception e) {
        e.printStackTrace();
        message = "课程更新失败";
      }
    } else {
      message = "课程添加成功";
      courseService.saveCourse(course);
      systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
    }
    j.setMsg(message);
    return j;
  }
View Full Code Here


   * @return
   */
  @RequestMapping(params = "del")
  @ResponseBody
  public AjaxJson del(TSFunction function, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    function = systemService.getEntity(TSFunction.class, function.getId());
    message = "权限: " + function.getFunctionName() + "被删除成功";
    systemService
        .updateBySqlString("delete from t_s_role_function where functionid='"
            + function.getId() + "'");
View Full Code Here

   * @return
   */
  @RequestMapping(params = "delop")
  @ResponseBody
  public AjaxJson delop(TSOperation operation, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    operation = systemService.getEntity(TSOperation.class,
        operation.getId());
    message = "操作: " + operation.getOperationname() + "被删除成功";
    userService.delete(operation);
    systemService.addLog(message, Globals.Log_Type_DEL,
View Full Code Here

   * @return
   */
  @RequestMapping(params = "saveFunction")
  @ResponseBody
  public AjaxJson saveFunction(TSFunction function, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    // ----------------------------------------------------------------
    // ----------------------------------------------------------------
    String functionOrder = function.getFunctionOrder();
    if (StringUtils.isEmpty(functionOrder)) {
      function.setFunctionOrder("0");
View Full Code Here

  public AjaxJson saveop(TSOperation operation, HttpServletRequest request) {
    String pid = request.getParameter("TSFunction.id");
    if (pid.equals("")) {
      operation.setTSFunction(null);
    }
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(operation.getId())) {
      message = "操作: " + operation.getOperationname() + "被更新成功";
      userService.saveOrUpdate(operation);
      systemService.addLog(message, Globals.Log_Type_UPDATE,
          Globals.Log_Leavel_INFO);
View Full Code Here

   * @throws Exception
   */
  @RequestMapping(params = "saveOrUpdateIcon", method = RequestMethod.POST)
  @ResponseBody
  public AjaxJson saveOrUpdateIcon(HttpServletRequest request) throws Exception {
    AjaxJson j = new AjaxJson();   
    TSIcon icon = new TSIcon();
    Short iconType = oConvertUtils.getShort(request.getParameter("iconType"));
    String iconName = oConvertUtils.getString(request.getParameter("iconName"));
    String id = request.getParameter("id");
    icon.setId(id);
    icon.setIconName(iconName);
    icon.setIconType(iconType);
    // uploadFile.setBasePath("images/accordion");
    UploadFile uploadFile = new UploadFile(request, icon);
    uploadFile.setCusPath("plug-in/accordion/images");
    uploadFile.setExtend("extend");
    uploadFile.setTitleField("iconclas");
    uploadFile.setRealPath("iconPath");
    uploadFile.setObject(icon);
    uploadFile.setByteField("iconContent");
    uploadFile.setRename(false);
    systemService.uploadFile(uploadFile);
    // 图标的css样式
    String css = "." + icon.getIconClas() + "{background:url('../images/" + icon.getIconClas() + "." + icon.getExtend() + "') no-repeat}";
    write(request, css);
    message = "上传成功";
    j.setMsg(message);
    return j;
 
View Full Code Here

   */
  @SuppressWarnings("deprecation")
  @RequestMapping(params = "update", method = RequestMethod.POST)
  @ResponseBody
  public AjaxJson update(HttpServletRequest request) throws Exception {
    AjaxJson j = new AjaxJson();
    Short iconType = oConvertUtils.getShort(request.getParameter("iconType"));
    String iconName = java.net.URLDecoder.decode(oConvertUtils.getString(request.getParameter("iconName")));
    String id = request.getParameter("id");
    TSIcon icon = new TSIcon();
    if (StringUtil.isNotEmpty(id)) {
      icon = systemService.get(TSIcon.class, id);
      icon.setId(id);
    }
    icon.setIconName(iconName);
    icon.setIconType(iconType);
    systemService.saveOrUpdate(icon);
    // 图标的css样式
    String css = "." + icon.getIconClas() + "{background:url('../images/" + icon.getIconClas() + "." + icon.getExtend() + "') no-repeat}";
    write(request, css);
    message = "更新成功";
    j.setMsg(message);
    return j;
  }
View Full Code Here

   * @throws Exception
   */
  @RequestMapping(params = "repair")
  @ResponseBody
  public AjaxJson repair(HttpServletRequest request) throws Exception {
    AjaxJson json = new AjaxJson();
    List<TSIcon> icons = systemService.loadAll(TSIcon.class);
    String rootpath = request.getSession().getServletContext().getRealPath("/");
    String csspath = request.getSession().getServletContext().getRealPath("/plug-in/accordion/css/icons.css");
    // 清空CSS文件内容
    clearFile(csspath);
    for (TSIcon c : icons) {
      File file = new File(rootpath + c.getIconPath());
      if (!file.exists()) {
        byte[] content = c.getIconContent();
        if (content != null) {
          BufferedImage imag = ImageIO.read(new ByteArrayInputStream(content));
          ImageIO.write(imag, "PNG", file);// 输出到 png 文件
        }
      }
      String css = "." + c.getIconClas() + "{background:url('../images/" + c.getIconClas() + "." + c.getExtend() + "') no-repeat}";
      write(request, css);
      json.setMsg("样式表创建成功");
    }
    json.setSuccess(true);
    return json;
  }
View Full Code Here

   * @return
   */
  @RequestMapping(params = "del")
  @ResponseBody
  public AjaxJson del(TSIcon icon, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
   
    icon = systemService.getEntity(TSIcon.class, icon.getId());
   
    boolean isPermit=isPermitDel(icon);
   
    if(isPermit){
      systemService.delete(icon);
     
      message = "图标: " + icon.getIconName() + "被删除成功。";
     
      systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
     
      return j;
    }
   
    message = "图标: " + icon.getIconName() + "正在使用,不允许删除。";

    j.setMsg(message);
   
    return j;
  }
View Full Code Here

   * 地域保存
   */
  @RequestMapping(params = "saveTerritory")
  @ResponseBody
  public AjaxJson saveTerritory(TSTerritory territory, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    String functionOrder = territory.getTerritorySort();
    if(StringUtils.isEmpty(functionOrder)){
      territory.setTerritorySort("0");
    }
    if (territory.getTSTerritory().getId().equals("")) {
View Full Code Here

TOP

Related Classes of org.jeecgframework.core.common.model.json.AjaxJson

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.