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

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


   * @return
   */
  @RequestMapping(params = "del")
  @ResponseBody
  public AjaxJson del(JeecgOrderMainEntity jeecgOrderMain, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    jeecgOrderMain = systemService.getEntity(JeecgOrderMainEntity.class, jeecgOrderMain.getId());
    message = "删除成功";
    jeecgOrderMainService.delMain(jeecgOrderMain);
    systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
    j.setMsg(message);
    return j;
  }
View Full Code Here


  public AjaxJson save(JeecgOrderMainEntity jeecgOrderMain ,JeecgOrderMainPage jeecgOrderMainPage, 
      HttpServletRequest request) {
    List<JeecgOrderProductEntity> jeecgOrderProducList =  jeecgOrderMainPage.getJeecgOrderProductList();
    List<JeecgOrderCustomEntity>  jeecgOrderCustomList = jeecgOrderMainPage.getJeecgOrderCustomList();
    Boolean jeecgOrderCustomShow = "true".equals(request.getParameter("jeecgOrderCustomShow"));
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(jeecgOrderMain.getId())) {
      message = "更新成功";
      jeecgOrderMainService.updateMain(jeecgOrderMain, jeecgOrderProducList, jeecgOrderCustomList,jeecgOrderCustomShow);
      systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
    } else {
      message = "添加成功";
      jeecgOrderMainService.addMain(jeecgOrderMain, jeecgOrderProducList, jeecgOrderCustomList);
      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(JeecgMinidaoEntity jeecgMinidao, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    jeecgMinidao = jeecgMinidaoService.getEntity(JeecgMinidaoEntity.class, jeecgMinidao.getId());
    message = "Minidao例子删除成功";
    jeecgMinidaoService.delete(jeecgMinidao);
    systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
   
    j.setMsg(message);
    return j;
  }
View Full Code Here

   * @return
   */
  @RequestMapping(params = "save")
  @ResponseBody
  public AjaxJson save(JeecgMinidaoEntity jeecgMinidao, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(jeecgMinidao.getId())) {
      message = "Minidao例子更新成功";
      JeecgMinidaoEntity t = jeecgMinidaoService.getEntity(JeecgMinidaoEntity.class, jeecgMinidao.getId());
      try {
        MyBeanUtils.copyBeanNotNull2Bean(jeecgMinidao, t);
        jeecgMinidaoService.update(t);
        systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
      } catch (Exception e) {
        e.printStackTrace();
        message = "Minidao例子更新失败";
      }
    } else {
      message = "Minidao例子添加成功";
      jeecgMinidao.setStatus("0");
      jeecgMinidaoService.insert(jeecgMinidao);
      systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
    }
    j.setMsg(message);
    return j;
  }
View Full Code Here

   */
  @RequestMapping(params = "del")
  @ResponseBody
  public AjaxJson del(JeecgDemoCkfinderEntity jeecgDemoCkfinder,
      HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    jeecgDemoCkfinder = systemService.getEntity(
        JeecgDemoCkfinderEntity.class, jeecgDemoCkfinder.getId());
    message = "ckeditor+ckfinder例子删除成功";
    jeecgDemoCkfinderService.delete(jeecgDemoCkfinder);
    systemService.addLog(message, Globals.Log_Type_DEL,
        Globals.Log_Leavel_INFO);

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

   */
  @RequestMapping(params = "save")
  @ResponseBody
  public AjaxJson save(JeecgDemoCkfinderEntity jeecgDemoCkfinder,
      HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(jeecgDemoCkfinder.getId())) {
      message = "ckeditor+ckfinder例子更新成功";
      JeecgDemoCkfinderEntity t = jeecgDemoCkfinderService.get(
          JeecgDemoCkfinderEntity.class, jeecgDemoCkfinder.getId());
      try {
        MyBeanUtils.copyBeanNotNull2Bean(jeecgDemoCkfinder, t);
        jeecgDemoCkfinderService.saveOrUpdate(t);
        systemService.addLog(message, Globals.Log_Type_UPDATE,
            Globals.Log_Leavel_INFO);
      } catch (Exception e) {
        e.printStackTrace();
        message = "ckeditor+ckfinder例子更新失败";
      }
    } else {
      message = "ckeditor+ckfinder例子添加成功";
      jeecgDemoCkfinderService.save(jeecgDemoCkfinder);
      systemService.addLog(message, Globals.Log_Type_INSERT,
          Globals.Log_Leavel_INFO);
    }
    j.setMsg(message);
    return j;
  }
View Full Code Here

   * @throws Exception
   */
  @RequestMapping(params = "saveFiles", method = RequestMethod.POST)
  @ResponseBody
  public AjaxJson saveFiles(HttpServletRequest request, HttpServletResponse response, TFinanceFilesEntity financeFile) {
    AjaxJson j = new AjaxJson();
    Map<String, Object> attributes = new HashMap<String, Object>();
    String fileKey = oConvertUtils.getString(request.getParameter("fileKey"));// 文件ID
   
    String financeId = oConvertUtils.getString(request.getParameter("financeId"));//资金ID
   
    if (StringUtil.isNotEmpty(fileKey)) {
      financeFile.setId(fileKey);
      financeFile = systemService.getEntity(TFinanceFilesEntity.class, fileKey);

    }
    TFinanceEntity finance = systemService.getEntity(TFinanceEntity.class, financeId);
    financeFile.setFinance(finance);
    UploadFile uploadFile = new UploadFile(request, financeFile);
    uploadFile.setCusPath("files");
    uploadFile.setSwfpath("swfpath");
    uploadFile.setByteField(null);//不存二进制内容
    financeFile = systemService.uploadFile(uploadFile);
    attributes.put("fileKey", financeFile.getId());
    attributes.put("viewhref", "commonController.do?objfileList&fileKey=" + financeFile.getId());
    attributes.put("delurl", "commonController.do?delObjFile&fileKey=" + financeFile.getId());
    j.setMsg("文件添加成功");
    j.setAttributes(attributes);

    return j;
  }
View Full Code Here

   * @return
   */
  @RequestMapping(params = "del")
  @ResponseBody
  public AjaxJson del(TFinanceEntity tFinance, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    tFinance = systemService.getEntity(TFinanceEntity.class, tFinance.getId());
    message = "删除成功";
    tFinanceService.deleteFinance(tFinance);
    systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
    j.setMsg(message);
    return j;
  }
View Full Code Here

   * @return
   */
  @RequestMapping(params = "save")
  @ResponseBody
  public AjaxJson save(TFinanceEntity tFinance, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(tFinance.getId())) {
      message = "更新成功";
      TFinanceEntity t = tFinanceService.get(TFinanceEntity.class, tFinance.getId());
      try {
        MyBeanUtils.copyBeanNotNull2Bean(tFinance, t);
        tFinanceService.saveOrUpdate(t);
        systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
      } catch (Exception e) {
        e.printStackTrace();
      }
    } else {
      message = "添加成功";
      tFinanceService.save(tFinance);
   
      systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
    }
    j.setObj(tFinance);
    return j;
  }
View Full Code Here

   * @return
   */
  @RequestMapping(params = "delFile")
  @ResponseBody
  public AjaxJson delFile( HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    String id  = request.getParameter("id");
    TFinanceFilesEntity file = systemService.getEntity(TFinanceFilesEntity.class, id);
    message = "" + file.getAttachmenttitle() + "被删除成功";
    tFinanceService.deleteFile(file);
    systemService.addLog(message, Globals.Log_Type_DEL,
        Globals.Log_Leavel_INFO);
    j.setSuccess(true);
    j.setMsg(message);
    return j;
  }
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.