/** 首页关注管理-管理员用(暂无) */ public String list() throws Exception { String publicaccount = ((Pubclient) session.get("pubclient")).getPublicaccount(); if (convalue != null && !convalue.equals("")) { convalue = URLDecoder.decode(convalue, "utf-8"); } if (page < 1) { page = 1; } // 总页数 pageCount = guanzhuresService.getPageCount(con, convalue, status, publicaccount, size); if (page > pageCount && pageCount != 0) { page = pageCount; } // 所有当前页记录对象 guanzhuress = guanzhuresService.queryList(con, convalue, status, publicaccount, page, size); // 总记录数 totalCount = guanzhuresService.getTotalCount(con, convalue, status, publicaccount); return "list"; }
/** * 跳转到修改页面 * * @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"; }
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(); } }
/** * 添加 * * @return * @throws Exception */ public String add() throws Exception { guanzhuresService.add(guanzhures); return this.view(); }
/** * 修改 * * @return */ public String update() throws Exception { guanzhuresService.update(guanzhures); return this.view(); }