提交 7f35c3f1 authored 作者: zhoushaopan's avatar zhoushaopan

fix(维修模块): 维修撤回bug

维修撤回bug
上级 d1301c76
...@@ -222,7 +222,7 @@ public class FileController { ...@@ -222,7 +222,7 @@ public class FileController {
documents.setReplyNum("123123123131"); documents.setReplyNum("123123123131");
documents.setSenderUnit("浙江省"); documents.setSenderUnit("浙江省");
documents.setTitle("密码装备清退单"); documents.setTitle("密码装备清退单");
documents.setId(1); documents.setId(null);
List<DocumentDevice> documentDevices=new ArrayList<>(); List<DocumentDevice> documentDevices=new ArrayList<>();
for (int i=0;i<20;i++){ for (int i=0;i<20;i++){
DocumentDevice documentDevice=new DocumentDevice(); DocumentDevice documentDevice=new DocumentDevice();
...@@ -238,8 +238,8 @@ public class FileController { ...@@ -238,8 +238,8 @@ public class FileController {
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
} }
documents.setDocumentDevices(documentDevices); documents.setDocumentDevices(documentDevices);
String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRender(documents,url+"htmlModel/"); // String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRender(documents,url+"htmlModel/");
String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRenderRepair(documents,url+"htmlModel/");
log.info("[file] 调用了生成出入单据对接口 documents"); log.info("[file] 调用了生成出入单据对接口 documents");
return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf(content,url,preview,"documents/")); return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf(content,url,preview,"documents/"));
......
...@@ -92,18 +92,17 @@ public class DocumentDevice { ...@@ -92,18 +92,17 @@ public class DocumentDevice {
} }
public String changeWord(String keyword) { public String changeWord(String keyword) {
String returnVal = keyword;
if (StringUtils.isNotBlank(keyword)) { if (StringUtils.isNotBlank(keyword)) {
if (keyword.contains("&")) { if (keyword.contains("&")) {
returnVal = keyword.replace("&", "&amp;"); keyword = keyword.replace("&", "&amp;");
} }
if (keyword.contains("<")) { if (keyword.contains("<")) {
returnVal = keyword.replace("<", "&lt;"); keyword = keyword.replace("<", "&lt;");
} }
if (keyword.contains(">")) { if (keyword.contains(">")) {
returnVal = keyword.replace(">", "&gt;"); keyword = keyword.replace(">", "&gt;");
} }
} }
return returnVal; return keyword;
} }
} }
...@@ -115,7 +115,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -115,7 +115,7 @@ public class JavaToPdfHtmlFreeMarker {
String url = new File(htmlFile).toURI().toURL().toString(); String url = new File(htmlFile).toURI().toURL().toString();
ByteArrayOutputStream os = new ByteArrayOutputStream(); ByteArrayOutputStream os = new ByteArrayOutputStream();
ITextRenderer renderer = new ITextRenderer(); ITextRenderer renderer = new ITextRenderer();
renderer.setDocument(htmlFile); renderer.setDocument(url);
// 解决中文不显示问题 // 解决中文不显示问题
ITextFontResolver fontResolver = renderer.getFontResolver(); ITextFontResolver fontResolver = renderer.getFontResolver();
fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"font/simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"font/simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
......
...@@ -73,7 +73,8 @@ public class RepairBackBillServiceImpl implements RepairBackBillService { ...@@ -73,7 +73,8 @@ public class RepairBackBillServiceImpl implements RepairBackBillService {
@Override @Override
public boolean delete(Integer id) { public boolean delete(Integer id) {
return false; deviceRepairBackBillDao.deleteById(id);
return true;
} }
@Override @Override
......
...@@ -13,7 +13,8 @@ spring.jpa.hibernate.ddl-auto=update ...@@ -13,7 +13,8 @@ spring.jpa.hibernate.ddl-auto=update
#spring.jpa.hibernate.ddl-auto=update #spring.jpa.hibernate.ddl-auto=update
#file.path=C:/Users/dengdiyi/Documents/file/ #file.path=C:/Users/dengdiyi/Documents/file/
# spring boot admin # spring boot admin
file.path=/Users/ozoz/data/ #file.path=/Users/ozoz/data/
file.path=/Users/zhoushaopan/Desktop/data/
preview.path=http://192.168.102.169:8087/file/ preview.path=http://192.168.102.169:8087/file/
spring.boot.admin.client.url=http://localhost:8769 spring.boot.admin.client.url=http://localhost:8769
spring.boot.admin.client.instance.serviceBaseUrl=http://localhost:8087 spring.boot.admin.client.instance.serviceBaseUrl=http://localhost:8087
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论