From cfbba3e94514bd2b9336972ae0ee8b7af3abf5a9 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Thu, 23 Sep 2021 10:23:27 +0800
Subject: [PATCH] 1.附件
---
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 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..e4ed5a5 100644
--- a/src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
+++ b/src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -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());
@@ -620,15 +621,31 @@
}
attachService.save(attach);
String[] split = bladeFile.getName().split("/");
- String ip = FtpConstant.ip+"/zhba/picture/";
+ String ip = FtpConstant.ip+"/zhba/upload/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," +
+ "insert into blade_attach(id,tenant_id,link,domain,name,original_name,extension,attach_size,create_user,deptid," +
"create_time,update_user,update_time,status,is_deleted,type,cardid";
if (noticeId != null) {
- s1 += ",notice_id";
+ s1 += ",notice_id"+")" +"values(" + "'" + attach.getId() + "'" + "," +
+ "'" + attach.getTenantId() + "'" + "," +
+ "'" + imgurl + "'" + "," +
+ "'" + ip + "'" + "," +
+ "'" + split[2] + "'" + "," +
+ "'" + attach.getOriginalName() + "'" + "," +
+ "'" + attach.getExtension() + "'" + "," +
+ "'" + attach.getAttachSize() + "'" + "," +
+ "'" + attach.getCreateUser() + "'" + "," +
+ "'" + attach.getDeptid() + "'" + "," +
+ "'" + 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 + "'";
} else {
s1 += ") " +
"values(" + "'" + attach.getId() + "'" + "," +
@@ -640,7 +657,7 @@
"'" + attach.getExtension() + "'" + "," +
"'" + attach.getAttachSize() + "'" + "," +
"'" + attach.getCreateUser() + "'" + "," +
- "'" + attach.getCreateDept() + "'" + "," +
+ "'" + attach.getDeptid() + "'" + "," +
"'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," +
"'" + attach.getUpdateUser() + "'" + "," +
"'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," +
@@ -650,7 +667,7 @@
"'" + cardid + "'";
}
if (noticeId != null) {
- s1 += "'" + noticeId + "'" + ")";
+ s1 += ","+"'" + noticeId + "'" + ")";
} else {
s1 += ")";
}
--
Gitblit v1.9.3