コード例 #1
0
  // 投诉意见
  @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);
  }
コード例 #2
0
  // 转到投诉界面
  @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";
  }
コード例 #3
0
  // 转到已处理的详细投诉界面
  @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";
  }
コード例 #4
0
  // 转到意见界面
  @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";
  }