From fbddf74600d036ba46b311147847be978904e002 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期二, 10 三月 2026 10:32:58 +0800
Subject: [PATCH] 出入库详单,导入,时间格式兼容yy/mm/dd

---
 fzzy-igdss-core/src/main/java/com/fzzy/igds/service/FileService.java |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 51 insertions(+), 6 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 0367bbe..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);
 
@@ -89,14 +92,28 @@
                 data.setBizTag(bizTag);
             }
 
-            data.setCreateTime(new Date());
-            data.setCreateBy(ContextUtil.getLoginUserName());
-
-            data.setUpdateTime(new Date());
-            data.setUpdateBy(ContextUtil.getLoginUserName());
-            fileMapper.insert(data);
+            saveFile(data);
         }
     }
+
+    /**
+     *
+     * @param data
+     */
+    public void saveFile(FileInfo data) {
+
+        data.setUpdateTime(new Date());
+        data.setUpdateBy(ContextUtil.getLoginUserName());
+
+        if(StringUtils.isBlank(data.getId())){
+            data.setId(ContextUtil.UUID());
+            data.setCreateTime(new Date());
+            data.setCreateBy(ContextUtil.getLoginUserName());
+        }
+
+        fileMapper.insert(data);
+    }
+
 
     /**
      * 鏍规嵁鏉′欢鏌ヨ鏁版嵁
@@ -139,7 +156,9 @@
         if("TEMP".equals(pathTag)) return getTempFilePath();
         if("CONF".equals(pathTag)) return getConfPath();
         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();
     }
@@ -148,6 +167,32 @@
      * 鑾峰彇浜嬩欢鏂囦欢璺緞
      * @return
      */
+    public String getQuantityPath() {
+        String basePath = FrameworkConfig.getProfile() + "QUANTITY/" + DateFormatUtils.format(new Date(), "yyyyMM") + "/";
+        File file = new File(basePath);
+        if (!file.exists()) {
+            file.mkdirs();
+        }
+        return basePath;
+    }
+
+    /**
+     * 鑾峰彇浜嬩欢鏂囦欢璺緞
+     * @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