Try this:
 @GetMapping("/downloadDOA")
    public ResponseEntity<Object>  downloadTemplate(HttpServletRequest request, HttpServletResponse response) throws IOException{
   
        
        String filename = "C://Users//Sai//git//r5//src//main//resources//DOA//DOAtemplate.xls";
        File file = new File(filename);
        
        InputStreamResource iresource = new InputStreamResource(new FileInputStream(file));
        
        HttpHeaders headers = new HttpHeaders();
        headers.add("Content-Disposition","attachment;filename=" +file.getName());
        headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
        headers.add("Pragma", "no-cache");
        headers.add("Expires", "0");
        ResponseEntity<Object> responseEntity = ResponseEntity.ok().headers(headers)
                .contentLength(file.length())
                .contentType(MediaType.parseMediaType("application/vnd.ms-excel")).body(iresource);
        return responseEntity;
        
    
        
    }