From 26220601f74874186865626c051ea08373ea44bb Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期四, 26 三月 2026 15:29:52 +0800
Subject: [PATCH] 导入,创建id避免重复
---
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/FileService.java | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/FileService.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/FileService.java
index bf579a2..c2f37cc 100644
--- a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/FileService.java
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/FileService.java
@@ -75,10 +75,13 @@
}
data.setId(ContextUtil.generateId());
+ data.setCreateTime(new Date());
+ data.setCreateBy(ContextUtil.getLoginUserName());
data.setCompanyId(ContextUtil.getCompanyId());
//鏂囦欢鍏ㄨ矾寰�
String filePath = getFileSavePath(pathTag) + data.getFileName();
+
filePath = filePath.replace(FrameworkConfig.getProfile(), "/profile/");
data.setFilePath(filePath);
@@ -155,6 +158,7 @@
if("TEMPLATE".equals(pathTag)) return getTemplateFilePath();
if("QUANTITY".equals(pathTag)) return getQuantityPath();
if("WORD".equals(pathTag)) return getWordPath();
+ if("WEIGHTNAP".equals(pathTag)) return getWeightSnapPath();
return getCommonFilePath();
}
@@ -176,6 +180,19 @@
* 鑾峰彇浜嬩欢鏂囦欢璺緞
* @return
*/
+ public String getWeightSnapPath() {
+ String basePath = FrameworkConfig.getProfile() + "WEIGHTNAP/" + DateFormatUtils.format(new Date(), "yyyyMM") + "/";
+ File file = new File(basePath);
+ if (!file.exists()) {
+ file.mkdirs();
+ }
+ return basePath;
+ }
+
+ /**
+ * 鑾峰彇浜嬩欢鏂囦欢璺緞
+ * @return
+ */
public String getEventFilePath() {
String basePath = FrameworkConfig.getProfile() + "EVENT/" + DateFormatUtils.format(new Date(), "yyyyMM") + "/";
File file = new File(basePath);
--
Gitblit v1.9.3