public <T> Serializable save(T entity) { MenuEntity menuEntity = (MenuEntity) entity; menuEntity.setAccountId(ResourceUtil.getWeiXinAccountId()); Serializable t = super.save(entity); // 执行新增操作配置的sql增强 this.doAddSql((MenuEntity) entity); return t; }
/** * 添加扩展接口管理 * * @param ids * @return */ @RequestMapping(params = "doAdd") @ResponseBody public AjaxJson doAdd(WeixinExpandconfigEntity weixinExpandconfig, HttpServletRequest request) { AjaxJson j = new AjaxJson(); message = "扩展接口管理添加成功"; try { weixinExpandconfig.setAccountid(ResourceUtil.getWeiXinAccountId()); weixinExpandconfigService.save(weixinExpandconfig); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); } catch (Exception e) { e.printStackTrace(); message = "扩展接口管理添加失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); return j; }
/** * easyui AJAX请求数据 * * @param request * @param response * @param dataGrid * @param user */ @RequestMapping(params = "datagrid") public void datagrid( WeixinCmsSiteEntity weixinCmsSite, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { CriteriaQuery cq = new CriteriaQuery(WeixinCmsSiteEntity.class, dataGrid); // 查询条件组装器 org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql( cq, weixinCmsSite, request.getParameterMap()); cq.eq(ACCOUNTID, ResourceUtil.getWeiXinAccountId()); try { // 自定义追加查询条件 } catch (Exception e) { throw new BusinessException(e.getMessage()); } cq.add(); this.weixinCmsSiteService.getDataGridReturn(cq, true); TagUtil.datagrid(response, dataGrid); }
/** * 添加微站点信息 * * @param ids * @return */ @RequestMapping(params = "doAdd") @ResponseBody public AjaxJson doAdd(WeixinCmsSiteEntity weixinCmsSite, HttpServletRequest request) { AjaxJson j = new AjaxJson(); List lst = weixinCmsSiteService.findByProperty( WeixinCmsSiteEntity.class, "accountid", ResourceUtil.getWeiXinAccountId()); if (lst.size() != 0) { message = "每个用户只能添加一个微信站点"; j.setSuccess(false); } else { message = "微站点信息添加成功"; try { weixinCmsSiteService.save(weixinCmsSite); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); } catch (Exception e) { e.printStackTrace(); message = "微站点信息添加失败"; throw new BusinessException(e.getMessage()); } } j.setMsg(message); return j; }