优化 删除多余代码

This commit is contained in:
2025-01-24 14:28:21 +08:00
parent a35d057146
commit c5b25e9a16

View File

@@ -34,7 +34,6 @@ import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
@@ -227,45 +226,6 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
return questionnaireVOS;
}
// 输出为pdf 需要自己组装pdf内容
// 解决iText不显示中文问题
/*public static void main(String[] args) {
try {
// 创建文档
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream("output.pdf"));
document.open();
// 加载字体文件
InputStream inputStream = ConvenientInquiryServiceImpl.class.getResourceAsStream("/font/msyhl.ttc");
byte[] fontBytes = toByteArray(inputStream);
inputStream.close();
// 创建BaseFont和Font对象
BaseFont baseFont = BaseFont.createFont("msyhl.ttc,1", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, true, fontBytes, null);
Font yaHeiFont = new Font(baseFont, 12, Font.NORMAL);
// 添加带有中文字体的段落
document.add(new Paragraph("你好,世界!", yaHeiFont));
document.close();
} catch (DocumentException | IOException e) {
e.printStackTrace();
}
}
// 将InputStream转换为字节数组
public static byte[] toByteArray(InputStream input) throws IOException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int n = 0;
while (-1 != (n = input.read(buffer))) {
output.write(buffer, 0, n);
}
return output.toByteArray();
}*/
/**
* 近期新增用户
*/