@RequestMapping(value = "/complaint-department", method = RequestMethod.GET)
 public String listDepartment(Model model) {
   List<ComplaintDepartment> list = complaintDepartmentService.getComplaintDepartmentList();
   model.addAttribute("list", list);
   model.addAttribute("department", new ComplaintDepartment());
   return "complaint-department";
 }
 @RequestMapping(value = "/update-dept", method = RequestMethod.POST)
 public String updateDepartment(@ModelAttribute ComplaintDepartment department, Model model) {
   complaintDepartmentService.updateComplaintDepartment(department);
   // logger.info(deptIds + " - " + deptnames);
   /*for(Integer i : deptIds)
   logger.info(""+i);*/
   /*complaintDepartmentService.updateComplaintDepartment(entity);
   List<ComplaintDepartment> list = complaintDepartmentService.getComplaintDepartmentList();
   model.addAttribute("list", list);*/
   return "redirect:/complaint-department";
 }
 @RequestMapping(value = "/add-dept", method = RequestMethod.POST)
 public String addDepartment(
     @ModelAttribute ComplaintDepartment department,
     @RequestParam(required = false) int deptId,
     Model model) {
   logger.info("Dept : " + department);
   complaintDepartmentService.addComplaintDepartment(department);
   // List<ComplaintDepartment> list = complaintDepartmentService.getComplaintDepartmentList();
   // model.addAttribute("list", list);
   // model.addAttribute("department", new ComplaintDepartment());
   return "redirect:/complaint-department";
 }
 @RequestMapping(value = "/check-complaint-department", method = RequestMethod.GET)
 public @ResponseBody boolean isComplaintDepartmentExist(@RequestParam String deptName) {
   logger.info("Check Dept : " + deptName);
   return complaintDepartmentService.isComplaintDepartmentExist(deptName.trim().toUpperCase());
 }
  @RequestMapping(value = "/all-complaint-department", method = RequestMethod.POST)
  public @ResponseBody List<ComplaintDepartment> getAllDepartment() {

    List<ComplaintDepartment> list = complaintDepartmentService.getComplaintDepartmentList();
    return list;
  }
 @RequestMapping(value = "/delete-dept", method = RequestMethod.POST)
 public String deleteDepartment(@RequestParam Integer deptId, Model model) {
   logger.info("Deptid: " + deptId);
   complaintDepartmentService.deleteComplaintDepartment(deptId);
   return "redirect:/complaint-department";
 }