From 27f5356ba11e2400aac493502f1c5ba1fb47775b Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期二, 14 十月 2025 16:55:48 +0800
Subject: [PATCH] Merge branch 'master' of http://47.93.189.255:8099/r/archiveSystem

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java |  105 +++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 95 insertions(+), 10 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java
index 79a8a12..f50a90b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java
@@ -1,22 +1,24 @@
 package com.ruoyi.web.controller.archive;
 
+import java.util.Collections;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.core.text.Convert;
 import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.common.utils.file.FileUtils;
 import com.ruoyi.domain.ArchiveRecords;
+import com.ruoyi.domain.vo.AnalysisResult;
+import com.ruoyi.domain.vo.ArchiveRecordModelExp;
+import com.ruoyi.domain.vo.ArchiveRecordModelOther;
+import com.ruoyi.domain.vo.DocumentMaterialFileSmallVo;
+import com.ruoyi.framework.config.ServerConfig;
 import com.ruoyi.service.IArchiveRecordsService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -24,6 +26,7 @@
 
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
+import org.springframework.web.multipart.MultipartFile;
 
 import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
 import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
@@ -40,6 +43,29 @@
 {
     @Autowired
     private IArchiveRecordsService archiveRecordsService;
+
+
+
+    /**
+     * 鏌ヨ妗f瀹屾垚鎯呭喌
+     */
+    @PreAuthorize("@ss.hasPermi('system:records:list')")
+    @GetMapping("/analysisRes")
+    public AjaxResult analysis()
+    {
+        System.out.println("009099");
+        return new AjaxResult(200, "鏌ヨ鎴愬姛", archiveRecordsService.statisticAya());
+    }
+
+    @PreAuthorize("@ss.hasPermi('system:records:export')")
+    @Log(title = "妗f鍒嗘瀽缁撴灉瀵煎嚭", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportAllStatis")
+    public void exportAllStatis(HttpServletResponse response)
+    {
+        List<AnalysisResult> list = archiveRecordsService.statisticAya();
+        ExcelUtil<AnalysisResult> util = new ExcelUtil<AnalysisResult>(AnalysisResult.class);
+        util.exportExcel(response, list, "妗f鍒嗘瀽缁撴灉");
+    }
 
     /**
      * 鏌ヨ妗f璁板綍鍒楄〃
@@ -99,7 +125,17 @@
     @PostMapping
     public AjaxResult add(@RequestBody ArchiveRecords archiveRecords)
     {
-        return toAjax(archiveRecordsService.insertArchiveRecords(archiveRecords));
+        int res = archiveRecordsService.insertArchiveRecords(archiveRecords);
+        System.out.println(res);
+        if(res==0) {
+            System.out.println(res);
+
+            return new AjaxResult(0, "妗f鍙峰凡缁忓瓨鍦ㄤ簡锛�");
+        }
+        else
+            return new AjaxResult(200, "娣诲姞鎴愬姛浜嗭紒");
+
+
     }
 
     /**
@@ -112,7 +148,15 @@
     {
         return toAjax(archiveRecordsService.updateArchiveRecords(archiveRecords));
     }
-
+    @PreAuthorize("@ss.hasPermi('system:records:edit')")
+    @Log(title = "妗f璁板綍", businessType = BusinessType.UPDATE)
+    @PostMapping(value = "/updateSByIds")
+    public AjaxResult updateStatusByIds(@RequestBody Long[] ids)
+    {
+        System.out.println(ids);
+        System.out.println("090sdfsdf");
+        return new AjaxResult(0, archiveRecordsService.updateStatusByIds(ids)+"");
+    }
     /**
      * 鍒犻櫎妗f璁板綍
      */
@@ -123,4 +167,45 @@
     {
         return toAjax(archiveRecordsService.deleteArchiveRecordsByIds(ids));
     }
+    @PreAuthorize("@ss.hasPermi('system:records:edit')")
+    @Log(title = "妗f璁板綍瀵煎叆", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception
+    {
+        return archiveRecordsService.importExcel(file);
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('system:records:edit')")
+    @Log(title = "淇敼鐘舵��", businessType = BusinessType.IMPORT)
+    @GetMapping(value = "/updateStatusById/{status}/{id}")
+    public AjaxResult updateStatusById(@PathVariable("status") String status,@PathVariable("id") String id)
+    {
+        return new AjaxResult(200, archiveRecordsService.updateArchiveById(status, Long.parseLong(id))+"");
+    }
+
+
+
+    @PostMapping("/model")
+    public void getExportModel(HttpServletResponse response){
+        List<ArchiveRecordModelExp> list = Collections.singletonList(new ArchiveRecordModelExp());
+        ExcelUtil<ArchiveRecordModelExp> util = new ExcelUtil<>(ArchiveRecordModelExp.class);
+        util.exportExcel(response,list,"妗f淇℃伅瀵煎叆妯℃澘");
+    }
+
+
+    @PostMapping("/modelOther")
+    public void getExportModelOther(HttpServletResponse response){
+        List<ArchiveRecordModelOther> list = Collections.singletonList(new ArchiveRecordModelOther());
+        ExcelUtil<ArchiveRecordModelOther> util = new ExcelUtil<>(ArchiveRecordModelOther.class);
+        util.exportExcel(response,list,"妗f淇℃伅瀵煎叆妯℃澘");
+    }
+
+    @PreAuthorize("@ss.hasPermi('system:records:list')")
+    @Log(title = "鏄惁鍏佽鎻愪氦", businessType = BusinessType.IMPORT)
+    @GetMapping(value = "/whether/{recordId}")
+    public AjaxResult whether(@PathVariable("recordId") Long recordId)
+    {
+        return AjaxResult.success( archiveRecordsService.whether(recordId));
+    }
 }

--
Gitblit v1.9.1