easyui下弹出窗口下载文件

jsp

 function kpdc1(){
             var rows = $("#xxx").datagrid('getRows');
             var datarows = JSON.stringify(rows);
            
             var url = 'url?datarows='+datarows
                window.location.href=url;
            
       }  

controller

@RequestMapping(value="xxx", produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView xxx(Integer id)
            throws DocumentException, IOException {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateString = formatter.format(new Date());
        try {
            YhcwProcessBgbxAndFpWebClient webClient = WebClient.getCW(YhcwProcessBgbxAndFpWebClient.class);
            List cxInvoicerecordParams = Json2Bean.getListBean(webClient.getInvoicerecord(id),
                    CxInvoicerecordParam.class);
            TemplateWebClient templatewebClient = WebClient.get(TemplateWebClient.class);
            Map map = new HashMap<>();
            map.put("sysCompanyId", getCurrentUser().getSysCompany().getId().toString());
            map.put("templatetype", "3");
            List