public String detail() {

    type = "0"; // 产品搜索标识
    supply = supplyService.getEntityById(supplyId);

    if (supply.getStatus() == 1) {
      return "list";
    }

    /*
     *	2012/9/11
     *  判断产品是否被禁止,不用查看
     *  能够查看的条件:
     *  1. 登录 & 是自己的产品
     *  2. 登录 & 后台管理员
     */
    PTags tag = supply.getPtags();
    boolean pass = tag == null ? true : tag.getPass();
    if (!pass) {
      if (Struts2Utils.getSession().getAttribute(SystemVariables.ADMIN_USER) == null
          || Struts2Utils.getSession().getAttribute(SystemVariables.CUSTOME_USER) == null
          || (Struts2Utils.getSession().getAttribute(SystemVariables.CUSTOME_USER) != null
              && ((Enterprise) Struts2Utils.getSession().getAttribute(SystemVariables.CUSTOME_USER))
                      .getId()
                  != supply.getCreator().getId())) {
        return "list";
      }
    }

    List<Map<String, String>> units = Unit.getInstance().getUnits();
    if (supply != null && units != null) {
      for (int i = 0; i < units.size(); i++) {
        Map map = units.get(i);
        if (map != null
            && map.get("id") != null
            && map.get("id").toString().equals(supply.getUnit())) {
          unitname = map.get("name").toString();
          break;
        }
      }
    }
    // 获取SEO关键字
    if (supply != null && supply.getCategory() != null) {
      int level = supply.getCategory().getCategoryLevel().intValue();
      String firstName = supply.getCategory().getName(); // 显示在最前面的类别名称
      switch (level) {
        case 1: // 第一级
          seoStr = firstName;
          break;
        case 2: // 第二级
          seoStr = firstName + "," + supply.getCategory().getCategory().getName();
          break;
        case 3: // 第三级
          seoStr =
              firstName
                  + ","
                  + supply.getCategory().getCategory().getName()
                  + ","
                  + supply.getCategory().getCategory().getCategory().getName();
          break;
        case 4: // 第四级
          seoStr =
              firstName
                  + ","
                  + supply.getCategory().getCategory().getName()
                  + ","
                  + supply.getCategory().getCategory().getCategory().getName()
                  + supply.getCategory().getCategory().getCategory().getCategory().getName();
          break;
        default:
          seoStr = "";
          break;
      }
      seoStr = supply.getName() + "," + seoStr;
    }

    entInfo = entInfoService.getEntInfoByEnterpriseId(supply.getCreator().getId());

    HttpServletRequest request = ServletActionContext.getRequest();
    HttpServletResponse response = ServletActionContext.getResponse();

    clickedKeywordExecute(request);

    // 将最近浏览过的产品添加到cookie当中
    String ids = CookieUtil.setSupplyIdCookies(request, response, supplyId + "");
    // 将最近浏览过的产品添加到session当中
    List<Long> supplyIds = CookieUtil.getSupplyIdByString(ids);
    request.getSession().setAttribute(SystemVariables.RECENTLY_BROWSE_SUPPLY, supplyIds);

    Enterprise ent = supply.getCreator();
    Long enterpriseId = ent.getId();
    recommends = supplyService.getRecommendSupplies(enterpriseId, 5);

    // 商品的点击率
    int hit = supply.getHit() == null ? 0 : supply.getHit();
    supply.setHit(hit + 1);
    supplyService.update(supply);

    return "detail";
  }