From cc057177b2fb17aee9a173a6adbabdc578fd74c7 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Mon, 06 Dec 2021 10:30:44 +0800
Subject: [PATCH] 1.许可

---
 src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java |   44 +++++++-------------------------------------
 1 files changed, 7 insertions(+), 37 deletions(-)

diff --git a/src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java b/src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
index 35280b5..424e4af 100644
--- a/src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
+++ b/src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -425,7 +425,7 @@
 
 		List<MultipartFile> fileList = new ArrayList<>();
 		//获取图片文件
-		fileList = fileUtil.getSubFiles(desPath+File.separator+namePath,fileList);
+		fileList = fileUtil.getSubFiles(desPath,fileList);
 		for (MultipartFile multipartFile : fileList){
 			if(multipartFile.getName().toLowerCase().endsWith(".png") || multipartFile.getName().toLowerCase().endsWith(".jpg")) {
 				String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") + multipartFile.getName().substring(multipartFile.getName().lastIndexOf("."));
@@ -607,6 +607,7 @@
 		String fileExtension = org.springblade.core.tool.utils.FileUtil.getFileExtension(fileName);
 		Attach attach = new Attach();
 		attach.setDomain(bladeFile.getDomain());
+		attach.setTenantId("000000");
 		attach.setLink(bladeFile.getLink());
 		attach.setName(bladeFile.getName());
 		attach.setOriginalName(bladeFile.getOriginalName());
@@ -619,42 +620,11 @@
 			attach.setNoticeId(noticeId);
 		}
 		attachService.save(attach);
-		String[] split = bladeFile.getName().split("/");
-		String ip = FtpConstant.ip+"/zhba/picture/";
-		String imgurl = ip + split[2];
-		FtpUtil.uploadFile(ftpHost_dev, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], in);
-		//数据同步
-		String s1 =
-			"insert into blade_attach(id,tenant_id,link,domain,name,original_name,extension,attach_size,create_user,create_dept," +
-				"create_time,update_user,update_time,status,is_deleted,type,cardid";
-		if (noticeId != null) {
-			s1 += ",notice_id";
-		} else {
-			s1 += ") " +
-				"values(" + "'" + attach.getId() + "'" + "," +
-				"'" + attach.getTenantId() + "'" + "," +
-				"'" + imgurl + "'" + "," +
-				"'" + ip + "'" + "," +
-				"'" + split[2] + "'" + "," +
-				"'" + attach.getOriginalName() + "'" + "," +
-				"'" + attach.getExtension() + "'" + "," +
-				"'" + attach.getAttachSize() + "'" + "," +
-				"'" + attach.getCreateUser() + "'" + "," +
-				"'" + attach.getCreateDept() + "'" + "," +
-				"'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," +
-				"'" + attach.getUpdateUser() + "'" + "," +
-				"'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," +
-				"'" + attach.getStatus() + "'" + "," +
-				"'" + attach.getIsDeleted() + "'" + "," +
-				"'" + attach.getType() + "'" + "," +
-				"'" + cardid + "'";
-		}
-		if (noticeId != null) {
-			s1 += "'" + noticeId + "'" + ")";
-		} else {
-			s1 += ")";
-		}
-		FtpUtil.sqlFileUpload(s1);
+		//String[] split = bladeFile.getName().split("/");
+		//String ip = FtpConstant.ip+"/zhba/upload/picture/";
+		//String imgurl = ip + split[2];
+		//FtpUtil.uploadFile(ftpHost_dev, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], in);
+		//FtpUtil.sqlFileUpload(s1);
 		return attach.getId();
 	}
 

--
Gitblit v1.9.3