Przeglądaj źródła

修改pdf生成

humuyu 2 lat temu
rodzic
commit
0f0d19045b

+ 1 - 0
.gitignore

@@ -47,3 +47,4 @@ node_modules
 /eladmin-security/*.factorypath
 /eladmin-system/*.classpath
 /eladmin-system/*.factorypath
+/eladmin-system/*.pid

+ 0 - 1
eladmin-system/application.pid

@@ -1 +0,0 @@
-7400

+ 18 - 2
eladmin-system/src/main/java/me/zhengjie/archives/controller/ArchivesController.java

@@ -77,14 +77,30 @@ public class ArchivesController {
 	 * @return
 	 */
 	@AnonymousPostMapping("/edit")
-	public ResponseDTO<ArchivesEntity> edit(@RequestBody ArchivesVo archives) {
+	public ResponseDTO<ArchivesEntity> edit(@RequestBody ArchivesEntity archives) {
+		ArchivesEntity entity = new ArchivesEntity();
+		//entity = archivesService.getById(archives.getId());
+		archivesService.updateById(archives);
+		// String	previewPath = dictDetailService.getValueByName("file_path").get("preview_path");
+		// entity.setPdfPath(previewPath + entity.getPdfPath());
+		return ResponseDTO.success(entity);
+	}
+	/**
+	 * 文件和图片
+	 *
+	 * @return
+	 */
+	@AnonymousPostMapping("/detail")
+	public ResponseDTO<ArchivesEntity> detail(@RequestBody ArchivesVo archives) {
 		ArchivesEntity entity = new ArchivesEntity();
 		entity = archivesService.getById(archives.getId());
+		if(entity.getStatus().equalsIgnoreCase("1")) {
+			
+		}
 		 String	previewPath = dictDetailService.getValueByName("file_path").get("preview_path");
 		 entity.setPdfPath(previewPath + entity.getPdfPath());
 		return ResponseDTO.success(entity);
 	}
-
 	/**
 	 * 文件和图片
 	 *

+ 15 - 17
eladmin-system/src/main/java/me/zhengjie/archives/util/HtmlConvertToPdf.java

@@ -32,27 +32,25 @@ import java.nio.file.*;
 @Component
 @Slf4j
 public class HtmlConvertToPdf implements InitializingBean {
-	@Value("${html2Pdf.simsumPath}")
+	// @Value("${html2Pdf.simsumPath}")
 	private String simsumPath;
-	@Value("${html2Pdf.simfangPath}")
+//	@Value("${html2Pdf.simfangPath}")
 	private String simfangPath;
 
-
-
-	@Override
+//	@Override
 	public void afterPropertiesSet() throws Exception {
-		String[] fontPath = { simsumPath, simfangPath };
-		for (String path : fontPath) {
-			String aimPath = path.substring(path.indexOf("/"));
-			Path temp = Paths
-					.get(new File(HtmlConvertToPdf.class.getClassLoader().getResource("").getPath().concat(aimPath))
-							.getAbsolutePath());
-			if (Files.exists(temp)) {
-				Files.delete(temp);
-			}
-			Files.copy(HtmlConvertToPdf.class.getClassLoader().getResourceAsStream(path), temp,
-					StandardCopyOption.REPLACE_EXISTING);
-		}
+//		String[] fontPath = { simsumPath, simfangPath };
+//		for (String path : fontPath) {
+//			String aimPath = path.substring(path.indexOf("/"));
+//			Path temp = Paths
+//					.get(new File(HtmlConvertToPdf.class.getClassLoader().getResource("").getPath().concat(aimPath))
+//							.getAbsolutePath());
+//			if (Files.exists(temp)) {
+//				Files.delete(temp);
+//			}
+//			Files.copy(HtmlConvertToPdf.class.getClassLoader().getResourceAsStream(path), temp,
+//					StandardCopyOption.REPLACE_EXISTING);
+//		}
 	}
 
 	/**

+ 2 - 0
eladmin-system/src/main/java/me/zhengjie/archives/vo/ArchivesVo.java

@@ -16,6 +16,8 @@ public class ArchivesVo extends PageVo {
 	private String caseNum;
 	// 当事人姓名
 	private String partyName;
+	// 当事人姓名
+	private String status;
 	//主键
 	private Long id;
 }

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java

@@ -82,7 +82,7 @@ public class JobServiceImpl implements JobService {
     }
 
     @Override
-    @CacheEvict(key = "'id:' + #p0.id")
+//    @CacheEvict(key = "'id:' + #p0.id")
     @Transactional(rollbackFor = Exception.class)
     public void update(Job resources) {
         Job job = jobRepository.findById(resources.getId()).orElseGet(Job::new);