|
@@ -11,6 +11,7 @@ import com.huimv.farm.damsubsidy.common.utils.PdfUtil;
|
|
|
import com.huimv.farm.test.Print;
|
|
|
import com.spire.xls.FileFormat;
|
|
|
import com.spire.xls.Workbook;
|
|
|
+import org.apache.tomcat.util.http.fileupload.FileUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -19,6 +20,9 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.*;
|
|
|
+import java.nio.file.Files;
|
|
|
+import java.nio.file.Path;
|
|
|
+import java.nio.file.Paths;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
@@ -149,6 +153,12 @@ public class BillSubsidyController {
|
|
|
wb.saveToFile(pdfPath, FileFormat.PDF);
|
|
|
PdfUtil.returnPdfStream2(response,pdfPath,subsidy.getFarmerName());
|
|
|
//文件删除 TODO
|
|
|
-
|
|
|
+// File file = new File("G://"+subsidy.getFarmerName() + ".pdf");
|
|
|
+//
|
|
|
+// FileUtils.forceDelete(file);
|
|
|
+ Path path1 = Paths.get("G://"+subsidy.getFarmerName()+".pdf");
|
|
|
+ Files.delete(path1);
|
|
|
+ Path path2 = Paths.get("G://"+"order_contract"+".xls");
|
|
|
+ Files.delete(path2);
|
|
|
}
|
|
|
}
|