|
|
@ -8,6 +8,7 @@ import com.itextpdf.text.pdf.*; |
|
|
import com.itextpdf.text.pdf.draw.LineSeparator; |
|
|
import com.itextpdf.text.pdf.draw.LineSeparator; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
import java.io.File; |
|
|
@ -27,7 +28,8 @@ public class PdfBaseUtil { |
|
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(PdfBaseUtil.class); |
|
|
private static final Logger logger = LoggerFactory.getLogger(PdfBaseUtil.class); |
|
|
|
|
|
|
|
|
private static final String fileDir="D:/hxhq/uploadPath"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String localFilePath="D:/hxhq/uploadPath"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -48,7 +50,7 @@ public class PdfBaseUtil { |
|
|
String timestamp = timestampFormat.format(now)+UUID.randomUUID(); |
|
|
String timestamp = timestampFormat.format(now)+UUID.randomUUID(); |
|
|
|
|
|
|
|
|
// 2. 构建文件夹路径 |
|
|
// 2. 构建文件夹路径 |
|
|
String folderPath = fileDir + File.separator + year + File.separator + month + File.separator + day; |
|
|
|
|
|
|
|
|
String folderPath = localFilePath + File.separator + year + File.separator + month + File.separator + day; |
|
|
|
|
|
|
|
|
// 3. 确保目录存在 |
|
|
// 3. 确保目录存在 |
|
|
File dir = new File(folderPath); |
|
|
File dir = new File(folderPath); |
|
|
|