文件下载

version1
admin 2 years ago
parent 96c143b25a
commit da6764ff72

@ -1,5 +1,7 @@
package com.glxp.sale.admin.idc.controller;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
@ -84,6 +86,15 @@ public class IdcController {
return idcService.downlaodSuccess(request, params);
}
@RequestMapping(value = "/spssync/common/downloadFile")
public void downloadFile(HttpServletResponse response,@RequestParam String fileName) throws UnsupportedEncodingException {
if (fileName != null) {
response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
}
idcService.downloadFile(fileName, response);
}
@RequestMapping("/mapi/**")
public Object mapi(HttpServletRequest request, HttpServletResponse httpServletResponse) {
String uri = uriUtils.parseUri(request.getRequestURL().toString());

@ -3,6 +3,7 @@ package com.glxp.sale.admin.idc.service;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;
@ -32,4 +33,5 @@ public interface IdcService {
void asyncUdiTask();
void asyncSpsTask();
void downloadFile(String fileName,HttpServletResponse response) ;
}

@ -13,6 +13,7 @@ import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.WordUtils;
@ -407,7 +408,11 @@ public class IdcServiceImpl implements IdcService {
return ResultVOUtils.error(9999, "");
}
@Override
public void downloadFile(String fileName,HttpServletResponse response) {
}
private void saveUploadStatus(Map<String,Object> params) {
Map<String,Object> map = new HashMap<String,Object>();

Loading…
Cancel
Save