소스 검색

Merge remote-tracking branch 'origin/feature-2022.06.27' into feature-2022.06.27

sakuya 3 년 전
부모
커밋
8b5ffa6493

+ 5 - 5
eladmin-system/src/main/java/me/zhengjie/appapi/config/AppConfigInfo.java

@@ -6,7 +6,7 @@ import org.springframework.stereotype.Component;
 @Component
 public class AppConfigInfo {
 
-	public static String APP_IMAGE_URL;
+//	public static String APP_IMAGE_URL;
 
 	public static String APP_UPLOAD_PATH;
 
@@ -22,10 +22,10 @@ public class AppConfigInfo {
 	 * 
 	 * @param appImageUrl
 	 */
-	@Value("${app.image.url}")
-	public void setAppImageUrl(String appImageUrl) {
-		APP_IMAGE_URL = appImageUrl;
-	}
+//	@Value("${app.image.url}")
+//	public void setAppImageUrl(String appImageUrl) {
+//		APP_IMAGE_URL = appImageUrl;
+//	}
 
 	/**
 	 * 设置上传路径

+ 2 - 2
eladmin-system/src/main/java/me/zhengjie/appapi/service/impl/NotaryNoteServiceImpl.java

@@ -197,8 +197,8 @@ public class NotaryNoteServiceImpl extends ServiceImpl<INotaryNoteDao, NotaryNot
 		String pdfPath = FileUploadUtil.savePdf(htmlContent, notary.getBusinessNo(),notary.getOrderId());
 		//
 		me.zhengjie.appapi.entity.OrderDocEntity orderDoc = new me.zhengjie.appapi.entity.OrderDocEntity();
-		orderDoc.setNote(AppConfigInfo.APP_IMAGE_URL + htmlpath);
-		orderDoc.setNotePdf(AppConfigInfo.APP_IMAGE_URL + pdfPath);
+		orderDoc.setNote(htmlpath);
+		orderDoc.setNotePdf(pdfPath);
 		orderDocService.update(orderDoc, "contract_id", notary.getOrderId());
 		// 如果相同取出数据
 		if ("9".equals(code)) {

+ 22 - 16
eladmin-system/src/main/java/me/zhengjie/appapi/service/impl/UserAXQInfoServiceImpl.java

@@ -8,6 +8,7 @@ import me.zhengjie.appapi.entity.UserAXQInfoEntity;
 import me.zhengjie.appapi.mapper.IUserAXQInfoDao;
 import me.zhengjie.appapi.service.UserAXQInfoService;
 import me.zhengjie.appapi.util.FileUploadUtil;
+import me.zhengjie.appapi.util.StatusEnum.StepStatusEnum;
 import me.zhengjie.base.ResponseDTO;
 import me.zhengjie.base.ResultCode;
 import me.zhengjie.modules.system.entity.OrderDocEntity;
@@ -26,10 +27,10 @@ import java.util.Date;
 @Service
 public class UserAXQInfoServiceImpl extends ServiceImpl<IUserAXQInfoDao, UserAXQInfoEntity>
 		implements UserAXQInfoService {
-	@Value("${app.upload.path}")
-	private String uplaodPath;
-	@Value("${app.image.url}")
-	private String imageURL;
+//	@Value("${app.upload.path}")
+//	private String uplaodPath;
+//	@Value("${app.image.url}")
+//	private String imageURL;
 	@Value("${spring.profiles.active}")
 	private String systemEnv;
 	@Autowired
@@ -149,6 +150,11 @@ public class UserAXQInfoServiceImpl extends ServiceImpl<IUserAXQInfoDao, UserAXQ
         OrderDocEntity saveDocEntity = new OrderDocEntity();
         saveDocEntity.setId(orderDocEntity.getId());
         CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
+        //得到路径
+    	String orderType = StepStatusEnum.getType(Integer.valueOf(orderDocEntity.getContractId()));
+     	String uplaodPath = orderDocEntity.getBusinessNo() + "/" + orderType + "/" ;
+     
+     	
         String path = uplaodPath + "signed-doc-" + entity.getIdCard() + "/";
         try{
         	//通过文件得到文件的流
@@ -158,8 +164,8 @@ public class UserAXQInfoServiceImpl extends ServiceImpl<IUserAXQInfoDao, UserAXQ
             saveDocEntity.setApplyContractNo(applyContractNo);
             //
             String filePath = CFCACertUtil.download(path, applyContractNo);
-            String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
-            saveDocEntity.setAuthApply(fileUrl);
+            //           String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
+           saveDocEntity.setAuthApply(filePath);
         }catch (Exception e){
             e.printStackTrace();
         }
@@ -171,8 +177,8 @@ public class UserAXQInfoServiceImpl extends ServiceImpl<IUserAXQInfoDao, UserAXQ
             String confirmationContractNo = CFCACertUtil.uploadSignContract(notartyUser, inputStream,fileName);
             saveDocEntity.setConfirmationContractNo(confirmationContractNo);
             String filePath = CFCACertUtil.download(path, confirmationContractNo);
-            String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
-            saveDocEntity.setAuthConfirmation(fileUrl);
+//            String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
+            saveDocEntity.setAuthConfirmation(filePath);
         }catch (Exception e){
             e.printStackTrace();
         }
@@ -186,8 +192,8 @@ public class UserAXQInfoServiceImpl extends ServiceImpl<IUserAXQInfoDao, UserAXQ
             saveDocEntity.setNoteContractNo(noteContractNo);
             //
             String filePath = CFCACertUtil.download(path, noteContractNo);
-            String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
-            saveDocEntity.setAuthNote(fileUrl);
+//            String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
+            saveDocEntity.setAuthNote(filePath);
         }catch (Exception e){
             e.printStackTrace();
         }
@@ -199,8 +205,8 @@ public class UserAXQInfoServiceImpl extends ServiceImpl<IUserAXQInfoDao, UserAXQ
             saveDocEntity.setNoticeContractNo(noticeContractNo);
             //
             String filePath = CFCACertUtil.download(path, noticeContractNo);
-            String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
-                saveDocEntity.setAuthNotice(fileUrl);
+ //           String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
+                saveDocEntity.setAuthNotice(filePath);
         }catch (Exception e){
             e.printStackTrace();
         }
@@ -212,8 +218,8 @@ public class UserAXQInfoServiceImpl extends ServiceImpl<IUserAXQInfoDao, UserAXQ
             saveDocEntity.setPromiseContractNo(promiseContractNo);
             //
             String filePath = CFCACertUtil.download(path, promiseContractNo);
-            String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
-            saveDocEntity.setAuthPromise(fileUrl);
+ //           String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
+            saveDocEntity.setAuthPromise(filePath);
         }catch (Exception e){
             e.printStackTrace();
         }
@@ -225,8 +231,8 @@ public class UserAXQInfoServiceImpl extends ServiceImpl<IUserAXQInfoDao, UserAXQ
             saveDocEntity.setNotificationContractNo(notificaitonContractNo);
             //
             String filePath = CFCACertUtil.download(path, notificaitonContractNo);
-            String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
-            saveDocEntity.setAuthNotification(fileUrl);
+//            String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
+            saveDocEntity.setAuthNotification(filePath);
         }catch (Exception e){
             e.printStackTrace();
         }

+ 58 - 5
eladmin-system/src/main/java/me/zhengjie/appapi/util/FileUploadUtil.java

@@ -233,7 +233,7 @@ public class FileUploadUtil {
 			return null;
 		}
 
-		String logo = file.getFilePath();
+		String filePath = file.getFilePath();
 		MultipartFile multipartFile = file.getFile();
 		String uploadFileName = multipartFile.getOriginalFilename();
 
@@ -244,7 +244,7 @@ public class FileUploadUtil {
 		String suffix = uploadFileName.substring(index);
 		String fileName = uuid + "_" + file.getFileType() + suffix;
 		file.setFileName(fileName);
-		String imagePath = logo + "/" + fileName;
+		String imagePath = filePath + "/" + fileName;
 		try {
 			FileHandleVo fileHandlevo = new FileHandleVo();
 			fileHandlevo.setFilePath(imagePath);
@@ -299,7 +299,27 @@ public class FileUploadUtil {
 			return null;
 		}
 	}
-
+	public static String saveHtml(String filePath, String html) {
+		if (html == null) {
+			return null;
+		}
+		// 拼接文件路径
+	 
+		try {
+			ByteArrayInputStream bis = new ByteArrayInputStream(html.getBytes("UTF-8"));
+			// File file, String data, Charset charset
+			FileHandleVo fileHandlevo = new FileHandleVo();
+			fileHandlevo.setFilePath(filePath);
+			fileHandlevo.setContentType("text/html");
+			fileHandlevo.setInputStream(bis);
+			fileHandle.uploadFileStream(fileHandlevo);
+			bis.close();
+			return filePath;
+		} catch (Exception e) {
+			log.error("上传图片失败:" + e.getLocalizedMessage());
+			return null;
+		}
+	}
 	/**
 	 * 上传文件通过文件的流
 	 * 
@@ -318,7 +338,7 @@ public class FileUploadUtil {
 			bis = IoUtil.toStream(b);
 			FileHandleVo fileHandlevo = new FileHandleVo();
 			fileHandlevo.setFilePath(filePath);
-			fileHandlevo.setContentType("text/html");
+			fileHandlevo.setContentType(contentType);
 			fileHandlevo.setInputStream(bis);
 			fileHandle.uploadFileStream(fileHandlevo);
 		} finally {
@@ -347,7 +367,7 @@ public class FileUploadUtil {
 			bis = IoUtil.toStream(b);
 			FileHandleVo fileHandlevo = new FileHandleVo();
 			fileHandlevo.setFilePath(filePath);
-			fileHandlevo.setContentType("text/html");
+			fileHandlevo.setContentType(contentType);
 			fileHandlevo.setInputStream(bis);
 			fileHandle.uploadFileStream(fileHandlevo);
 		} finally {
@@ -414,7 +434,40 @@ public class FileUploadUtil {
 			IoUtil.close(inputStream);
 		}
 	}
+	public static String createPdf(String html,String pdfPath) { 
 
+		if (html == null) {
+			return null;
+		}
+		String uploadPath = AppConfigInfo.APP_UPLOAD_PATH;
+ 
+		String sourceFilePath = uploadPath + pdfPath;
+		InputStream inputStream = null;
+		try {
+			// File file, String data, Charset charset
+			HtmlConvertPdf.createPdfFile(html, sourceFilePath);
+			inputStream = new FileInputStream(sourceFilePath);
+			// 这里需要把转换完成的删除掉
+			String contentType = "application/pdf";
+			// 通过流上传
+			// fileHandle.uploadFilePath(path, filePath, contentType);
+			FileHandleVo fileHandlevo = new FileHandleVo();
+			fileHandlevo.setFilePath(pdfPath);
+			fileHandlevo.setSourceFilePath(sourceFilePath);
+			fileHandlevo.setContentType(contentType);
+			fileHandlevo.setInputStream(inputStream);
+			fileHandle.uploadFileStream(fileHandlevo);
+			// 这个删除文件留给具体的上传处理
+			FileUtils.deleteQuietly(new File(sourceFilePath));
+			return pdfPath;
+		} catch (Exception e) {
+			log.error("转换pdf失败:" + e.getLocalizedMessage());
+			return null;
+		} finally {
+			IoUtil.close(inputStream);
+		}
+	
+	}
 	/**
 	 * 产生图片预览
 	 * 

+ 6 - 6
eladmin-system/src/main/java/me/zhengjie/modules/mq/RedisReceiver.java

@@ -78,23 +78,23 @@ public class RedisReceiver implements MessageListener {
 					String path = FileUploadUtil.saveHtml(html, order.getBusinessNo(),order.getOrderId());
 					JSONObject jsonObj = new JSONObject();
 					jsonObj.put("sort", m.getSort());
-					jsonObj.put("path", AppConfigInfo.APP_IMAGE_URL + path);
+					jsonObj.put("path",  path);
 					String pdfPath = FileUploadUtil.savePdf(html, order.getBusinessNo(),order.getOrderId());
 					if ("1".equals(m.getCode())) {
 						docEntity.setApply(jsonObj.toJSONString());
-						docEntity.setApplyPdf(AppConfigInfo.APP_IMAGE_URL + pdfPath);
+						docEntity.setApplyPdf(pdfPath);
 					} else if ("2".equals(m.getCode())) {
 						docEntity.setConfirmation(jsonObj.toJSONString());
-						docEntity.setConfirmationPdf(AppConfigInfo.APP_IMAGE_URL + pdfPath);
+						docEntity.setConfirmationPdf(pdfPath);
 					} else if ("3".equals(m.getCode())) {
 						docEntity.setNotice(jsonObj.toJSONString());
-						docEntity.setNoticePdf(AppConfigInfo.APP_IMAGE_URL + pdfPath);
+						docEntity.setNoticePdf(pdfPath);
 					} else if ("4".equals(m.getCode())) {
 						docEntity.setNotification(jsonObj.toJSONString());
-						docEntity.setNotificationPdf(AppConfigInfo.APP_IMAGE_URL + pdfPath);
+						docEntity.setNotificationPdf(pdfPath);
 					} else if ("5".equals(m.getCode())) {
 						docEntity.setPromise(jsonObj.toJSONString());
-						docEntity.setPromisePdf(AppConfigInfo.APP_IMAGE_URL + pdfPath);
+						docEntity.setPromisePdf(pdfPath);
 					}
 				}
 				// 在保存之前先删除数据

+ 24 - 14
eladmin-system/src/main/java/me/zhengjie/modules/system/executor/jobhandler/GenerateNotarizationJob.java

@@ -12,7 +12,9 @@ import me.zhengjie.appapi.mapper.IProvinceDao;
 import me.zhengjie.appapi.mapper.ISysUserDao;
 import me.zhengjie.appapi.service.impl.NotaryNoteServiceImpl;
 import me.zhengjie.appapi.util.DateUtils;
+import me.zhengjie.appapi.util.FileUploadUtil;
 import me.zhengjie.appapi.util.HtmlConvertPdf;
+import me.zhengjie.appapi.util.StatusEnum.StepStatusEnum;
 import me.zhengjie.modules.system.entity.*;
 import me.zhengjie.modules.system.repository.*;
 import me.zhengjie.util.CFCACertUtil;
@@ -64,10 +66,10 @@ public class GenerateNotarizationJob {
     @Autowired
     ICityDao cityDao;
 
-    @Value("${app.upload.path}")
-    private String uplaodPath;
-    @Value("${app.image.url}")
-    private String imageURL;
+//    @Value("${app.upload.path}")
+//    private String uplaodPath;
+//    @Value("${app.image.url}")
+//    private String imageURL;
     @Value("${spring.profiles.active}")
     private String systemEnv;
 
@@ -165,24 +167,27 @@ public class GenerateNotarizationJob {
         notaryOfficeInfo.setAuthorizationTime("20220214171200");
 
         CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
-        String path = orderDoc.getNotarizationPdf().replaceAll(imageURL, uplaodPath);
-        File file = new File(path);
-        String contractNO = CFCACertUtil.uploadSignContract(notaryUserInfo, notaryOfficeInfo, file);
+        String path = orderDoc.getNotarizationPdf();
+        InputStream inputStream=  FileUploadUtil.getInputStream(path);
+        String fileName=FileUploadUtil.getFileName(path);
+        String contractNO = CFCACertUtil.uploadSignContract(notaryUserInfo, notaryOfficeInfo, inputStream,fileName);
         orderDoc.setContractNo(contractNO);
         // 保存合同编号
         saveNotarizationInfo(contractNO, orderDoc.getId());
     }
-
+ 
     /**
      * 下载公证书
      * @param orderDoc
      */
     private void downloadNotarization(OrderDocEntity orderDoc) throws Exception{
+    	String orderType = StepStatusEnum.getType(Integer.valueOf(orderDoc.getContractId()));
         CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
+    	String uplaodPath = orderDoc.getBusinessNo() + "/" + orderType + "/" ;
         String path = uplaodPath + "notary-signed-" + orderDoc.getBusinessNo() + "/";
         String filePath = CFCACertUtil.download(path, orderDoc.getContractNo());
-        String fileUrl = filePath.replaceAll(uplaodPath, imageURL);
-        saveAuthNorizationUrlById(fileUrl, orderDoc.getId());
+     
+        saveAuthNorizationUrlById(filePath, orderDoc.getId());
     }
 
     /**
@@ -299,6 +304,8 @@ public class GenerateNotarizationJob {
         } catch (Exception e) {
             e.printStackTrace();
         }
+    	String orderType = StepStatusEnum.getType(Integer.valueOf(orderDoc.getContractId()));
+    	String uplaodPath = orderDoc.getBusinessNo() + "/" + orderType + "/" ;
         String content = result.replace("${ModelContent}", TextTempletUtil.replaceContent(modelEntity.getContent(), map));
         String htmlFilePath = uplaodPath + "notary-html-" + orderDoc.getBusinessNo() + "/";
         Path path = Paths.get(htmlFilePath);
@@ -306,14 +313,17 @@ public class GenerateNotarizationJob {
             Files.createDirectory(path);
         }
         String fullFilePath = htmlFilePath + orderDoc.getId() + ".html";
-        Files.write(Paths.get(fullFilePath), content.getBytes(StandardCharsets.UTF_8));
+       // saveHtml
+        FileUploadUtil.saveHtml(fullFilePath, content);
+//         Files.write(Paths.get(fullFilePath), content.getBytes(StandardCharsets.UTF_8));
         String pdfFilePath = uplaodPath + "notary-pdf-" + orderDoc.getBusinessNo() + "/" + orderDoc.getId() + ".pdf";
-        HtmlConvertPdf.createPdfFile(content, pdfFilePath);
+        FileUploadUtil.createPdf(content, pdfFilePath);
+      //  HtmlConvertPdf.createPdfFile(content, pdfFilePath);
         // 保存HTML公证书信息
         OrderDocEntity orderDocEntity = new OrderDocEntity();
         orderDocEntity.setId(orderDoc.getId());
-        orderDocEntity.setNotarization(fullFilePath.replace(uplaodPath, imageURL));
-        orderDocEntity.setNotarizationPdf(pdfFilePath.replace(uplaodPath, imageURL));
+        orderDocEntity.setNotarization(fullFilePath);
+        orderDocEntity.setNotarizationPdf(pdfFilePath);
         orderDocMapper.updateById(orderDocEntity);
         // 保存参数
         orderDoc.setNotarizationPdf(orderDocEntity.getNotarizationPdf());

+ 4 - 13
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/FileInfoController.java

@@ -16,6 +16,7 @@ import me.zhengjie.appapi.entity.FileInfoEntity;
 import me.zhengjie.appapi.service.ApiBankService;
 import me.zhengjie.appapi.service.FileInfoService;
 import me.zhengjie.appapi.util.FileUploadUtil;
+import me.zhengjie.appapi.util.StatusEnum.StepStatusEnum;
 import me.zhengjie.appapi.vo.FileUploadVo;
 import me.zhengjie.appapi.vo.FileVo;
 import me.zhengjie.base.ResponseDTO;
@@ -84,10 +85,11 @@ public class FileInfoController {
 		if (fileType == null) {
 			return ResponseDTO.error(ResultCode.PARAM_NOT_COMPLETE);
 		}
+		String path = businessNo + "/" + StepStatusEnum.getType(orderId) + "/" ;
 		log.info("文件上传参数:" + file);
 		FileVo filevo = new FileVo();
 		filevo.setFile(file);
-		filevo.setFilePath(type);
+		filevo.setFilePath(path);
 		filevo.setFileType(String.valueOf(fileType.getCode()));
 		String filePath = FileUploadUtil.upload(filevo);
 
@@ -107,16 +109,5 @@ public class FileInfoController {
 		return ResponseDTO.success(json);
 	}
 
-	/**
-	 * 文件和图片
-	 * 
-	 * @return
-	 */
-	@RequestMapping("/preview/{imageId}")
-	public ResponseDTO<String> preview(@PathVariable Integer imageId) {
-
-		FileInfoEntity fileInfo = fileInfoService.getById(imageId);
-		String path = AppConfigInfo.APP_IMAGE_URL + fileInfo.getPath();
-		return ResponseDTO.success(path);
-	}
+	
 }

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/TencentPushController.java

@@ -114,7 +114,7 @@ public class TencentPushController {
 							String filePath = orderRoomId.getBusinessNo() + "/" + orderRoomId.getOrderId();
 							String fileName = filePath + "/APP" + fileId + ".mp4";
 							DownloadUtils.downloadFile(videoUrl.get("Url").toString(), fileName);
-							orderRoomId.setAppVideoUrl(AppConfigInfo.APP_IMAGE_URL + "/" + fileName);
+							orderRoomId.setAppVideoUrl(fileName);
 							//
 							orderRoomIdService.update(orderRoomId, "roomId", roomId);
 							PushDataEntity pushDataEntity = new PushDataEntity();

+ 2 - 2
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/NotaryOfficeServiceImpl.java

@@ -69,8 +69,8 @@ public class NotaryOfficeServiceImpl extends ServiceImpl<NotaryOfficeMapper, Not
 	private BankMapper bankMapper;
 	@Value("${app.upload.path}")
 	private String uplaodPath;
-	@Value("${app.image.url}")
-	private String imageURL;
+//	@Value("${app.image.url}")
+//	private String imageURL;
 	@Value("${spring.profiles.active}")
 	private String systemEnv;
 	@Autowired

+ 24 - 18
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/NotaryOrderServiceImpl.java

@@ -14,6 +14,7 @@ import me.zhengjie.appapi.util.BeanCopyUtils;
 import me.zhengjie.appapi.util.DateUtils;
 import me.zhengjie.appapi.util.FileUploadUtil;
 import me.zhengjie.appapi.util.StatusEnum;
+import me.zhengjie.appapi.util.StatusEnum.StepStatusEnum;
 import me.zhengjie.appapi.vo.FileVo;
 import me.zhengjie.base.ResultCode;
 import me.zhengjie.modules.security.service.dto.JwtUserDto;
@@ -553,29 +554,35 @@ public class NotaryOrderServiceImpl extends ServiceImpl<NotaryOrderMapper, Notar
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public BaseResponse uploadNotarization(FileVo file) {
+
 		BaseResponse response = new BaseResponse<>();
-		String uploadFileName = file.getFile().getOriginalFilename();
-		int index = uploadFileName.lastIndexOf(".");
-		String suffix = uploadFileName.substring(index);
-		String fileName = file.getFileName() + suffix;
-		String filePath = AppConfigInfo.APP_UPLOAD_PATH + "notarization/" + fileName;
-		String fileUrl = AppConfigInfo.APP_IMAGE_URL + "notarization/" + fileName;
-		File fullPath = new File(filePath);
-		if (fullPath.exists()) {
-			response.fail(ResultCode.FILE_EXISTING);
-		}
-		try {
-			FileUtils.copyInputStreamToFile(file.getFile().getInputStream(), fullPath);
-		} catch (Exception e) {
-			e.printStackTrace();
-			response.fail(ResultCode.INTERFACE_INNER_INVOKE_ERROR);
-		}
+//		String uploadFileName = file.getFile().getOriginalFilename();
+//		int index = uploadFileName.lastIndexOf(".");
+//		String suffix = uploadFileName.substring(index);
+//		String fileName = file.getFileName() + suffix;
+//		String filePath = AppConfigInfo.APP_UPLOAD_PATH + "notarization/" + fileName;
+//		String fileUrl =  "notarization/" + fileName;
+//		File fullPath = new File(filePath);
+//		if (fullPath.exists()) {
+//			response.fail(ResultCode.FILE_EXISTING);
+//		}
+//		try {
+//			FileUtils.copyInputStreamToFile(file.getFile().getInputStream(), fullPath);
+//		} catch (Exception e) {
+//			e.printStackTrace();
+//			response.fail(ResultCode.INTERFACE_INNER_INVOKE_ERROR);
+//		}
+
 		QueryWrapper<OrderDocEntity> orderDocQw = new QueryWrapper<>();
 		orderDocQw.eq("contract_id", file.getContractId());
 		OrderDocEntity orderDoc = orderDocMapper.selectOne(orderDocQw);
+		String path = orderDoc.getBusinessNo()+ "/" + StepStatusEnum.getType(orderDoc.getContractId()) + "/" ;
+		file.setFilePath(path);
+		String filePath = FileUploadUtil.upload(file);
+		
 		OrderDocEntity saveOrderDoc = new OrderDocEntity();
 		saveOrderDoc.setId(orderDoc.getId());
-		saveOrderDoc.setAuthNotarization(fileUrl);
+		saveOrderDoc.setAuthNotarization(filePath);
 		orderDocMapper.updateById(saveOrderDoc);
 		updateStatusPass(file.getContractId(), orderDoc.getBusinessNo());
 		return response;
@@ -705,7 +712,6 @@ public class NotaryOrderServiceImpl extends ServiceImpl<NotaryOrderMapper, Notar
 
 	public String getPreviewUrl(String path) {
 
-		 
 		return FileUploadUtil.getPreviewUrl(path);
 	}
 

+ 2 - 2
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java

@@ -107,8 +107,8 @@ public class UserServiceImpl implements UserService {
     private ISysDeptDao deptDao;
     @Value("${app.upload.path}")
     private String uplaodPath;
-    @Value("${app.image.url}")
-    private String imageURL;
+//    @Value("${app.image.url}")
+//    private String imageURL;
     @Value("${spring.profiles.active}")
     private String systemEnv;
     @Autowired

+ 16 - 9
eladmin-system/src/main/java/me/zhengjie/util/CFCACertUtil.java

@@ -12,6 +12,8 @@ import cfca.trustsign.converter.JsonObjectMapper;
 import cfca.trustsign.util.PdfUtil;
 import cfca.trustsign.util.SecurityUtil;
 import cfca.trustsign.util.TimeUtil;
+import me.zhengjie.appapi.util.FileUploadUtil;
+
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.File;
@@ -254,7 +256,7 @@ public class CFCACertUtil {
      * @return 返回合同编号
      * @throws Exception
      */
-    public static String uploadSignContract(UploadSignInfoVO notaryUser, UploadSignInfoVO notaryOffice, File file) throws Exception {
+    public static String uploadSignContract(UploadSignInfoVO notaryUser, UploadSignInfoVO notaryOffice, InputStream file,String fileName) throws Exception {
         SignKeywordVO keywordNotaryUser = getSignKeywork("公证员", "70", "0", "160", "60");
         setSignInfoDefault(notaryUser, keywordNotaryUser);
         SignKeywordVO keywordNotaryOffice = getSignKeywork("签章", "0", "0", "150", "150");
@@ -273,7 +275,7 @@ public class CFCACertUtil {
         tx3203ReqVO.setHead(head);
         tx3203ReqVO.setUploadContract(uploadContract);
 
-        String response = requestAPI(tx3203ReqVO, "3203", file);
+        String response = requestAPI(tx3203ReqVO, "3203", file,fileName);
         if (!isSucess(response)) {
             ErrorResVO errorResVO = new ObjectMapper().readValue(response, ErrorResVO.class);
             System.out.println(errorResVO.getErrorCode() + ": " + errorResVO.getErrorMessage());
@@ -331,13 +333,18 @@ public class CFCACertUtil {
         httpConnector.init();
 
         byte[] fileBtye = httpConnector.getFile("platId/" + Request.AXQ_PLAT_ID + "/contractNo/" + contractNo + "/downloading");
-        Path path = Paths.get(filePath);
-        if (!Files.exists(path)) {
-            Files.createDirectory(path);
-        }
-        String suffix = PdfUtil.isPdf(fileBtye) ? ".pdf" : ".ofd";
-        String fullFilePath = filePath + contractNo + suffix;
-        Files.write(Paths.get(fullFilePath), fileBtye);
+       
+       String contentType;
+       String suffix;
+       if(PdfUtil.isPdf(fileBtye)) { 
+    		contentType = "application/pdf";
+    		suffix=".pdf";
+       }else {
+    	   contentType = "application/ofd";
+    	   suffix=".ofd";
+       }
+       FileUploadUtil.uploadFile(filePath, contentType, fileBtye);
+       String fullFilePath = filePath + contractNo + suffix;
         return fullFilePath;
     }
 

+ 1 - 1
eladmin-system/src/main/resources/config/application-test.yml

@@ -67,7 +67,7 @@ login:
   # 登录缓存
   cache-enable: true
   #  是否限制单用户登录
-  single-login: false
+  single-login: true
   #  验证码
   login-code:
     #  验证码类型配置 查看 LoginProperties 类