Exemplo n.º 1
0
 /**
  * 跳转到修改页面
  *
  * @return
  */
 public String load() throws Exception {
   guanzhures = guanzhuresService.loadById(id);
   // 为查询素材标题
   int fodderid = guanzhures.getFodderid();
   fodder = fodderService.loadById(fodderid);
   session.put("sucainame", fodder.getTitle());
   session.put("fodderid", fodderid);
   session.put("guanzhures", guanzhures);
   return "load";
 }
Exemplo n.º 2
0
  public String view() {
    String publicaccount = ((Pubclient) session.get("pubclient")).getPublicaccount();
    // 若客户第一次浏览该页,首先进入添加关注回复页面;否则,直接进入查看页面
    List<Guanzhures> guanzhureslist = guanzhuresService.queryListByPublicAccount(publicaccount);
    if (guanzhureslist.size() > 0) {
      guanzhures = guanzhureslist.get(0); // 有关注回复对象,则直接load
      // 查出该素材,并重新覆盖素材名、素材编号和关注回复对象
      int fodderid = guanzhures.getFodderid();
      fodder = fodderService.loadById(fodderid);
      session.put("sucainame", fodder.getTitle());
      session.put("fodderid", fodderid);
      session.put("guanzhures", guanzhures);
      return "load";

    } else {
      // 清空session,并跳转到add页
      session.put("sucainame", "");
      session.put("fodderid", "");
      return this.goToAdd();
    }
  }