From 9ba1061f62fa81f4b78e1d15984db7174d148406 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期一, 02 三月 2026 17:07:41 +0800
Subject: [PATCH] APP电子巡逻列表

---
 fzzy-igdss-core/src/main/java/com/fzzy/igds/service/FileService.java |   81 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 75 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 5c3c073..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
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.fzzy.igds.domain.FileInfo;
+import com.fzzy.igds.domain.Quantity;
 import com.fzzy.igds.mapper.FileMapper;
 import com.fzzy.igds.utils.Base64Util;
 import com.fzzy.igds.utils.ContextUtil;
@@ -31,6 +32,29 @@
     private FileMapper fileMapper;
 
     /**
+     * 鏍规嵁鏉′欢鑾峰彇闄勪欢淇℃伅
+     * @param companyId
+     * @param bizId
+     * @return
+     */
+    public List<FileInfo> listFile(String companyId, String bizId) {
+        if (StringUtils.isEmpty(companyId)) {
+            companyId = ContextUtil.getCompanyId();
+        }
+
+        if (StringUtils.isEmpty(bizId)){
+            return null;
+        }
+
+        QueryWrapper<FileInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("company_id", companyId);
+        queryWrapper.eq("biz_id", bizId);
+        queryWrapper.orderByAsc("create_time");
+
+        return fileMapper.selectList(queryWrapper);
+    }
+
+    /**
      * 寮傛鎵ц闄勪欢淇濆瓨
      * @param files     闄勪欢淇℃伅
      * @param bizId     涓氬姟id
@@ -51,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);
 
@@ -65,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);
+    }
+
 
     /**
      * 鏍规嵁鏉′欢鏌ヨ鏁版嵁
@@ -115,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();
     }
@@ -124,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