// 转到投诉界面 @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("/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"; }