コード例 #1
0
  /**
   * easyuiAJAX请求数据: 用户选择角色列表
   *
   * @param request
   * @param response
   * @param dataGrid
   * @param user
   */
  @RequestMapping(params = "addorupdate")
  public ModelAndView addorupdate(ZkZhBanner ent, HttpServletRequest req) {
    if (StringUtil.isNotEmpty(ent.getId())) {
      ent = systemService.getEntity(ZkZhBanner.class, ent.getId());
      req.setAttribute("ent", ent);

      TSFunction function = systemService.getEntity(TSFunction.class, ent.getTSFunction().getId());
      req.setAttribute("function", function);
    }
    return new ModelAndView("zky/module/content");
  }
コード例 #2
0
 /**
  * 信息删除
  *
  * @param user
  * @param req
  * @return
  */
 @RequestMapping(params = "del")
 @ResponseBody
 public AjaxJson del(ZkZhBanner ent, HttpServletRequest req) {
   AjaxJson j = new AjaxJson();
   ent = systemService.getEntity(ZkZhBanner.class, ent.getId());
   // 删除内容关联的图片
   //		systemService.executeSql("delete from t_s_document where conId=?", ent.getId());
   // 删除内容
   systemService.executeSql("delete from zk_banner where id=?", ent.getId());
   message = "Banner:" + ent.getTitleEN() + "删除成功";
   j.setMsg(message);
   return j;
 }
コード例 #3
0
  /**
   * 录入
   *
   * @param user
   * @param req
   * @return
   */
  @RequestMapping(params = "saveContent")
  @ResponseBody
  public AjaxJson save(HttpServletRequest req, ZkZhBanner ent) {
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(ent.getId())) {
      ZkZhBanner ent_old = systemService.getEntity(ZkZhBanner.class, ent.getId());
      ent_old.setTSFunction(ent.getTSFunction());
      ent_old.setTitleEN(ent.getTitleEN());
      ent_old.setIsshow(ent.getIsshow());
      ent_old.setFunctionOrder(ent.getFunctionOrder());
      ent_old.setPicSrc(ent.getPicSrc());
      systemService.updateEntitie(ent_old);
      message = "Banner: " + ent.getTitleEN() + "更新成功";
      systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
    } else {
      ent.setCreatTime(new Date());
      systemService.save(ent);
      message = "Banner: " + ent.getTitleEN() + "添加成功";
      systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
    }
    j.setMsg(message);

    return j;
  }