|
@@ -12,6 +12,7 @@ import com.huimv.farm.damsubsidy.common.utils.PdfUtil;
|
|
import com.huimv.farm.test.Print;
|
|
import com.huimv.farm.test.Print;
|
|
import com.spire.xls.FileFormat;
|
|
import com.spire.xls.FileFormat;
|
|
import com.spire.xls.Workbook;
|
|
import com.spire.xls.Workbook;
|
|
|
|
+import com.spire.xls.Worksheet;
|
|
import org.apache.tomcat.util.http.fileupload.FileUtils;
|
|
import org.apache.tomcat.util.http.fileupload.FileUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
@@ -147,8 +148,13 @@ public class BillSubsidyController {
|
|
Workbook wb = new Workbook();
|
|
Workbook wb = new Workbook();
|
|
wb.loadFromFile(path);
|
|
wb.loadFromFile(path);
|
|
|
|
|
|
|
|
+ Worksheet worksheet = wb.getWorksheets().get(0);
|
|
|
|
+ worksheet.getRange().get("E3").getStyle().setWrapText(true);//地址自动换行
|
|
|
|
+ worksheet.getRange().get("C3").getStyle().setWrapText(true);//名字自动换行
|
|
|
|
+ worksheet.getRange().get("C18").getStyle().setWrapText(true);//耳标号
|
|
|
|
+
|
|
//调用方法保存为PDF格式
|
|
//调用方法保存为PDF格式
|
|
- String pdfPath = "/opt/subsidy/"+subsidy.getFarmerName()+".pdf";
|
|
|
|
|
|
+ String pdfPath = "G://"+subsidy.getFarmerName()+".pdf";
|
|
wb.saveToFile(pdfPath, FileFormat.PDF);
|
|
wb.saveToFile(pdfPath, FileFormat.PDF);
|
|
// wb.getConverterSetting().setSheetFitToPage(true);
|
|
// wb.getConverterSetting().setSheetFitToPage(true);
|
|
// OutputStream outputStream = null;
|
|
// OutputStream outputStream = null;
|
|
@@ -159,10 +165,10 @@ public class BillSubsidyController {
|
|
// File file = new File("G://"+subsidy.getFarmerName() + ".pdf");
|
|
// File file = new File("G://"+subsidy.getFarmerName() + ".pdf");
|
|
//
|
|
//
|
|
// FileUtils.forceDelete(file);
|
|
// FileUtils.forceDelete(file);
|
|
-// Path path1 = Paths.get("/opt/subsidy/"+subsidy.getFarmerName()+".pdf");
|
|
|
|
-// Files.delete(path1);
|
|
|
|
-// Path path2 = Paths.get("/opt/subsidy/"+"order_contract"+".xls");
|
|
|
|
-// Files.delete(path2);
|
|
|
|
|
|
+ Path path1 = Paths.get("/opt/subsidy/"+subsidy.getFarmerName()+".pdf");
|
|
|
|
+ Files.delete(path1);
|
|
|
|
+ Path path2 = Paths.get("/opt/subsidy/"+"order_contract"+".xls");
|
|
|
|
+ Files.delete(path2);
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/updatePayStatus")
|
|
@PostMapping("/updatePayStatus")
|