|
@@ -23,6 +23,7 @@ import jcifs.smb.NtlmPasswordAuthentication;
|
|
|
import jcifs.smb.SmbFile;
|
|
|
import jcifs.smb.SmbFileInputStream;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -94,14 +95,12 @@ public class MeasuringController extends SuperController<OrderQualityService, Lo
|
|
|
@SysLog("下载远程质检报告")
|
|
|
public R<File> downloadFile(HttpServletResponse response, @RequestBody Map<String, Object> map) throws IOException, FileNotFoundException {
|
|
|
String id = map.get("id").toString();
|
|
|
-
|
|
|
- /*TTask task = tTaskMapper.selectById(id);
|
|
|
- String fileName = task.getCompleteBatchNo() + "_" + task.getProcedureNo() + ".csv";*/
|
|
|
-
|
|
|
OrderQuality orderQuality = baseService.getById(id);
|
|
|
String fileName = orderQuality.getMeasuringReport();
|
|
|
|
|
|
- response.setHeader("content-type", "application/pdf");
|
|
|
+ String contentType = fileName.contains(".pdf")? "application/pdf" : "text/csv";
|
|
|
+
|
|
|
+ response.setHeader("content-type", contentType);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
|
|
|
byte[] buff = new byte[1024];
|