Package org.jeecgframework.web.cgform.entity.button

Examples of org.jeecgframework.web.cgform.entity.button.CgformButtonSqlEntity


   * sql业务增强
   *
   */
  public void executeSqlExtend(String formId,String buttonCode,Map<String, Object> data){
    //根据formId和buttonCode获取
    CgformButtonSqlEntity cgformButtonSqlVo = getCgformButtonSqlByCodeFormId(buttonCode,formId);
    if(cgformButtonSqlVo!=null){
      //获取sql参数注入参数
      String sqlPlugin = cgformButtonSqlVo.getCgbSqlStr();
      if(StringUtils.isNotEmpty(sqlPlugin)){
        String [] sqls = sqlPlugin.split(";");
        for(String sql:sqls){
          if(sql.toLowerCase().indexOf(CgAutoListConstant.SQL_INSERT)!=-1
              ||sql.toLowerCase().indexOf(CgAutoListConstant.SQL_UPDATE)!=-1){
View Full Code Here


        CgFormHeadEntity.class, cgFormHead.getId());
    //按钮配置
    buttons = cgformButtonService.getCgformButtonListByFormId(cgFormHead.getId());
    //按钮SQL增强
    for(CgformButtonEntity cb:buttons){
      CgformButtonSqlEntity cbs = cgformButtonSqlService.getCgformButtonSqlByCodeFormId(cb.getButtonCode(), cgFormHead.getId());
      buttonSqlMap.put(cb.getButtonCode(), cbs==null?new String[]{}:cbs.getCgbSqlStr().replaceAll("(\r\n|\r|\n|\n\r)", "").split(";"));
    }
    CgformButtonSqlEntity cbsAdd = cgformButtonSqlService.getCgformButtonSqlByCodeFormId("add", cgFormHead.getId());
    buttonSqlMap.put("add", cbsAdd==null?new String[]{}:cbsAdd.getCgbSqlStr().replaceAll("(\r\n|\r|\n|\n\r)", "").split(";"));
    CgformButtonSqlEntity cbsUpdate = cgformButtonSqlService.getCgformButtonSqlByCodeFormId("update", cgFormHead.getId());
    buttonSqlMap.put("update", cbsUpdate==null?new String[]{}:cbsUpdate.getCgbSqlStr().replaceAll("(\r\n|\r|\n|\n\r)", "").split(";"));
    CgformButtonSqlEntity cbsDelete = cgformButtonSqlService.getCgformButtonSqlByCodeFormId("delete", cgFormHead.getId());
    buttonSqlMap.put("delete", cbsDelete==null?new String[]{}:cbsDelete.getCgbSqlStr().replaceAll("(\r\n|\r|\n|\n\r)", "").split(";"));
    //JS增强-列表
    CgformEnhanceJsEntity listJs =   cgformEnhanceJsService.getCgformEnhanceJsByTypeFormId("list", cgFormHead.getId());
    CgformEnhanceJsEntity listJsCopy = null;
    try{
      listJsCopy = listJs.deepCopy();
View Full Code Here

   */
  @RequestMapping(params = "doCgformButtonSql")
  @ResponseBody 
  public AjaxJson doCgformButtonSql(CgformButtonSqlEntity cgformButtonSql, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    CgformButtonSqlEntity cgformSql = cgformButtonSqlService.getCgformButtonSqlByCodeFormId(cgformButtonSql.getButtonCode(), cgformButtonSql.getFormId());
    if(cgformSql!=null){
      j.setObj(cgformSql);
      j.setSuccess(true);
    }else{
      j.setSuccess(false);
View Full Code Here

      j.setMsg(message);
      return j;
    }
    if (StringUtil.isNotEmpty(cgformButtonSql.getId())) {
      message = "更新成功";
      CgformButtonSqlEntity t = cgformButtonSqlService.get(CgformButtonSqlEntity.class, cgformButtonSql.getId());
      try {
        MyBeanUtils.copyBeanNotNull2Bean(cgformButtonSql, t);
        cgformButtonSqlService.saveOrUpdate(t);
        systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
      } catch (Exception e) {
View Full Code Here

  @RequestMapping(params = "addorupdate")
  public ModelAndView addorupdate(CgformButtonSqlEntity cgformButtonSql, HttpServletRequest req) {
    //根据buttonCode和formId初始化数据
    cgformButtonSql.setButtonCode("add");
    if (StringUtil.isNotEmpty(cgformButtonSql.getButtonCode())&&StringUtil.isNotEmpty(cgformButtonSql.getFormId())) {
      CgformButtonSqlEntity cgformButtonSqlVo = cgformButtonSqlService.getCgformButtonSqlByCodeFormId(cgformButtonSql.getButtonCode(), cgformButtonSql.getFormId());
        if(cgformButtonSqlVo!=null){
          cgformButtonSql = cgformButtonSqlVo;
        }
    }
    List<CgformButtonEntity> list = cgformButtonService.getCgformButtonListByFormId(cgformButtonSql.getFormId());
View Full Code Here

TOP

Related Classes of org.jeecgframework.web.cgform.entity.button.CgformButtonSqlEntity

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.