// 投诉意见
  @RequestMapping("/userRecommendationDeal")
  public String userRecommendationDeal(HttpServletRequest request, HttpServletResponse response) {
    int id = Integer.parseInt(request.getParameter("id"));

    Feedback feedback = feedbackService.find(id).get(0);

    feedback.setReplied(true);

    feedbackService.updateFeedback(feedback);

    return userRecommendation(request, response);
  }
  // 转到投诉界面
  @RequestMapping("/userComplaint")
  public String userComplaint(HttpServletRequest request, HttpServletResponse response) {
    System.out.println("/userComplaint");
    Company company = (Company) request.getSession().getAttribute("company");

    List<Feedback> feedbacks = feedbackService.findAll();
    List<Feedback> doFeedbacks = new ArrayList<Feedback>();
    List<Feedback> noFeedbacks = new ArrayList<Feedback>();
    for (Feedback feedback : feedbacks) {
      if (feedback.getFeedbackType().equals("投诉")
          && feedback.getBus().getCompany().getId() == company.getId()) {

        if (feedback.getUserPhone() == null) {
          feedback.setUserPhone("匿名");
        } else {
          feedback.setUserPhone(
              userService.findByPhone(feedback.getUserPhone()).get(0).getUsername());
        }
        if (feedback.isReplied() == true) {
          doFeedbacks.add(feedback);
        } else {
          noFeedbacks.add(feedback);
        }
      }
    }
    request.setAttribute("doFeedbacks", doFeedbacks);
    request.setAttribute("noFeedbacks", noFeedbacks);
    return "userComplaint";
  }
  // 转到已处理的详细投诉界面
  @RequestMapping("/userComplaintInforDo")
  public String userComplaintInforDo(HttpServletRequest request, HttpServletResponse response) {
    int id = Integer.parseInt(request.getParameter("id"));

    Feedback feedback = feedbackService.find(id).get(0);

    if (feedback.getUserPhone() == null) {
      feedback.setUserPhone("匿名");
    } else {
      feedback.setUserPhone(userService.findByPhone(feedback.getUserPhone()).get(0).getUsername());
    }

    request.setAttribute("feedback", feedback);
    return "userComplaintInforDo";
  }
  // 转到意见界面
  @RequestMapping("/userRecommendation")
  public String userRecommendation(HttpServletRequest request, HttpServletResponse response) {

    List<Feedback> feedbacks = feedbackService.findAll();
    List<Feedback> doFeedbacks = new ArrayList<Feedback>();
    List<Feedback> noFeedbacks = new ArrayList<Feedback>();
    for (Feedback feedback : feedbacks) {
      if (feedback.getFeedbackType().equals("意见")) {

        if (feedback.getUserPhone() == null) {
          feedback.setUserPhone("匿名");
        } else {
          feedback.setUserPhone(
              userService.findByPhone(feedback.getUserPhone()).get(0).getUsername());
        }

        if (feedback.isReplied() == true) doFeedbacks.add(feedback);
        else noFeedbacks.add(feedback);
      }
    }
    request.setAttribute("doFeedbacks", doFeedbacks);
    request.setAttribute("noFeedbacks", noFeedbacks);
    return "userRecommendation";
  }