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

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


   */
  @RequestMapping(params = "del")
  @ResponseBody
  public AjaxJson del(CgFormHeadEntity cgFormHead,
      HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    cgFormHead = systemService.getEntity(CgFormHeadEntity.class,
        cgFormHead.getId());
    message = "删除成功";
    cgFormFieldService.deleteCgForm(cgFormHead);
    cgFormFieldService.removeSubTableStr4Main(cgFormHead);
    systemService.addLog(message, Globals.Log_Type_DEL,
        Globals.Log_Leavel_INFO);

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


   */
  @RequestMapping(params = "rem")
  @ResponseBody
  public AjaxJson rem(CgFormHeadEntity cgFormHead,
      HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    cgFormHead = systemService.getEntity(CgFormHeadEntity.class,
        cgFormHead.getId());
    message = "移除成功";
    cgFormFieldService.delete(cgFormHead);
    cgFormFieldService.removeSubTableStr4Main(cgFormHead);
    systemService.addLog(message, Globals.Log_Type_DEL,
        Globals.Log_Leavel_INFO);

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

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

   */
  @RequestMapping(params = "delField")
  @ResponseBody
  public AjaxJson delField(CgFormFieldEntity cgFormField,
      HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    cgFormField = systemService.getEntity(CgFormFieldEntity.class,
        cgFormField.getId());
    message = cgFormField.getFieldName()+"删除成功";
    cgFormFieldService.delete(cgFormField);
    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(JeecgNoteEntity jeecgNote, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(jeecgNote.getId())) {
      message = "更新成功";
      jeecgNoteService.saveOrUpdate(jeecgNote);
      systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
    } else {
View Full Code Here

   */
  @RequestMapping(params = "doDbSynch")
  @ResponseBody
  public AjaxJson doDbSynch(CgFormHeadEntity cgFormHead,String synMethod,
      HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    cgFormHead = systemService.getEntity(CgFormHeadEntity.class,
        cgFormHead.getId());
    //同步数据库
    try {
      boolean bl = cgFormFieldService.dbSynch(cgFormHead,synMethod);
      if(bl){
        //追加主表的附表串
        cgFormFieldService.appendSubTableStr4Main(cgFormHead);
        message = "同步成功";   
        j.setMsg(message);
      }else{
        message = "同步失败";   
        j.setMsg(message);
        return j;
      }
    } catch (BusinessException e) {
      j.setMsg(e.getMessage());
      return j;
    }
    return j;
  }
View Full Code Here

   */
  @RequestMapping(params = "save")
  @ResponseBody
  public AjaxJson save(CgFormHeadEntity cgFormHead,
      HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    CgFormHeadEntity oldTable =cgFormFieldService.getEntity(CgFormHeadEntity.class, cgFormHead.getId());
    cgFormFieldService.removeSubTableStr4Main(oldTable);
    //step.1 如果数据表已经创建,则不能更改主键策略(后续通过强制同步解决此问题)
    /*if(cgFormHead.getId()!=null){
      boolean tableexist = cgFormFieldService.checkTableExist(cgFormHead.getTableName());
      if(tableexist){
        if(!cgFormHead.getJformPkType().equalsIgnoreCase(oldTable.getJformPkType())){
          if((cgFormHead.getJformPkType().equalsIgnoreCase("NATIVE")||cgFormHead.getJformPkType().equalsIgnoreCase("SEQUENCE"))
              &&(oldTable.getJformPkType().equalsIgnoreCase("NATIVE")||oldTable.getJformPkType().equalsIgnoreCase("SEQUENCE"))){
            //native和sequence可以互转
          }else{
            throw new org.jeecgframework.core.common.exception.BusinessException("数据表已经创建,不能更换主键策略");
          }
        }
      }
    }
    */
    //step.2 判定表格是否存在
    CgFormHeadEntity table = judgeTableIsNotExit(cgFormHead,oldTable);
    //step.3 刷新orderNum并且去重复
    refreshFormFieldOrderNum(cgFormHead);
   
   
    if (StringUtil.isNotEmpty(cgFormHead.getId())&&table!=null) {
      List<CgFormFieldEntity>  formFieldEntities = table.getColumns();
      for (CgFormFieldEntity cgFormFieldEntity : formFieldEntities) {
        if (StringUtil.isEmpty(cgFormFieldEntity.getOldFieldName())
            && StringUtil.isNotEmpty(cgFormFieldEntity.getFieldName())) {
          cgFormFieldEntity.setFieldName(cgFormFieldEntity.getFieldName().toLowerCase());
          cgFormFieldEntity.setOldFieldName(cgFormFieldEntity.getFieldName());
        }
       
      }
      cgFormFieldService.updateTable(table,null);
      cgFormFieldService.appendSubTableStr4Main(table);
      cgFormFieldService.sortSubTableStr(table);
      systemService.addLog(message, Globals.Log_Type_UPDATE,
          Globals.Log_Leavel_INFO);
    } else if (StringUtil.isEmpty(cgFormHead.getId())&&table==null) {
      List<CgFormFieldEntity>  formFieldEntities = cgFormHead.getColumns();
      for (CgFormFieldEntity cgFormFieldEntity : formFieldEntities) {
        if (StringUtil.isEmpty(cgFormFieldEntity.getOldFieldName())) {
          cgFormFieldEntity.setFieldName(cgFormFieldEntity.getFieldName().toLowerCase());
          cgFormFieldEntity.setOldFieldName(cgFormFieldEntity.getFieldName());
        }
       
      }
      cgFormFieldService.saveTable(cgFormHead);
      systemService.addLog(message, Globals.Log_Type_INSERT,
          Globals.Log_Leavel_INFO);
    }
    j.setMsg(message);
    return j;
  }
View Full Code Here

   */
  @RequestMapping(params = "checkIsExit")
  @ResponseBody
  public AjaxJson checkIsExit(String name,
      HttpServletRequest req) {
    AjaxJson j = new AjaxJson();
    j.setSuccess(cgFormFieldService.judgeTableIsExit(name));
    return j;
  }
View Full Code Here

    //bean.setSqlPlugIn(sql_plug_in);
    cgFormFieldService.updateTable(bean,null);
    message = "保存成功";
    systemService.addLog(message, Globals.Log_Type_INSERT,
        Globals.Log_Leavel_INFO);
    AjaxJson j =  new AjaxJson();
    j.setMsg(message);
    return j;
  }
View Full Code Here

    //bean.setJsPlugIn(js_plug_in);停用jsPlugIn这个字段
    cgFormFieldService.updateTable(bean,null);
    message = "保存成功";
    systemService.addLog(message, Globals.Log_Type_INSERT,
        Globals.Log_Leavel_INFO);
    AjaxJson j =  new AjaxJson();
    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.