From bd2df0a3e0634bb5469472f10315797365748559 Mon Sep 17 00:00:00 2001
From: zqy <2522236926@qq.com>
Date: 星期日, 21 九月 2025 11:05:02 +0800
Subject: [PATCH] 添加注释

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java |   86 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 73 insertions(+), 13 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java
index 285a545..a300c4f 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java
@@ -3,9 +3,13 @@
 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.Archiverecordstouser;
+import com.ruoyi.domain.vo.RecordToUserCount;
 import com.ruoyi.service.IArchiverecordstouserService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,12 +28,13 @@
 
 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;
 
 /**
- * 銆愯濉啓鍔熻兘鍚嶇О銆慍ontroller
+ * 銆愭。妗堝垎閰嶃�慍ontroller
  * 
  * @author ruoyi
  * @date 2025-07-20
@@ -47,10 +52,21 @@
     @PutMapping("/authUserToArchive")
     public AjaxResult selectRecordToUser(String recordId, Long[] userIds)
     {
-        return toAjax(archiverecordstouserService.insertRecordToUsers(recordId, userIds));
+        for(Long userId:userIds)
+        {
+            if(archiverecordstouserService.queryArchiverecordstouserByRecordId(recordId, userId)==1)
+            {
+                return toAjax(0);
+            }
+        }
+        //鍒ゆ柇鏄惁鎺堟潈缁欏埆浜轰簡
+        if(archiverecordstouserService.selectArchiveRecordUsers(recordId))
+            return toAjax(0);
+        archiverecordstouserService.insertRecordToUsers(recordId, userIds);
+        return toAjax(200);
     }
     /**
-     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+     * 鏌ヨ銆愭。妗堝垎閰嶃�戝垪琛�
      */
     @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:list')")
     @GetMapping("/list")
@@ -62,21 +78,41 @@
 
     }
 
+
+    @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:list')")
+    @GetMapping("/listArToUser")
+    public AjaxResult listAllUserRecord(String userName )
+    {
+        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
+        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+        System.out.println(userName);
+        return  archiverecordstouserService.countStatistic(userName,pageNum, pageSize);
+
+    }
+    @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:list')")
+    @PostMapping("/exportArToUser")
+    public void exportArToUser(HttpServletResponse response)
+    {
+       // archiverecordstouserService.countStatistic()
+        List<RecordToUserCount> list = archiverecordstouserService.findAllRecordToUserCont();
+        ExcelUtil<RecordToUserCount> util = new ExcelUtil<RecordToUserCount>(RecordToUserCount.class);
+        util.exportExcel(response, list, "瀵煎嚭缁熻淇℃伅");
+    }
     /**
-     * 瀵煎嚭銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+     * 瀵煎嚭銆愭。妗堝垎閰嶃�戝垪琛�
      */
     @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:export')")
-    @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.EXPORT)
+    @Log(title = "銆愭。妗堝垎閰嶃��", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, Archiverecordstouser archiverecordstouser)
     {
         List<Archiverecordstouser> list = archiverecordstouserService.selectArchiverecordstouserList(archiverecordstouser);
         ExcelUtil<Archiverecordstouser> util = new ExcelUtil<Archiverecordstouser>(Archiverecordstouser.class);
-        util.exportExcel(response, list, "銆愯濉啓鍔熻兘鍚嶇О銆戞暟鎹�");
+        util.exportExcel(response, list, "銆愭。妗堝垎閰嶃�戞暟鎹�");
     }
 
     /**
-     * 鑾峰彇銆愯濉啓鍔熻兘鍚嶇О銆戣缁嗕俊鎭�
+     * 鑾峰彇銆愭。妗堝垎閰嶃�戣缁嗕俊鎭�
      */
     @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:query')")
     @GetMapping(value = "/{id}")
@@ -86,10 +122,10 @@
     }
 
     /**
-     * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 鏂板銆愭。妗堝垎閰嶃��
      */
     @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:add')")
-    @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.INSERT)
+    @Log(title = "銆愭。妗堝垎閰嶃��", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody Archiverecordstouser archiverecordstouser)
     {
@@ -97,10 +133,10 @@
     }
 
     /**
-     * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 淇敼銆愭。妗堝垎閰嶃��
      */
     @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:edit')")
-    @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.UPDATE)
+    @Log(title = "銆愭。妗堝垎閰嶃��", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody Archiverecordstouser archiverecordstouser)
     {
@@ -108,13 +144,37 @@
     }
 
     /**
-     * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 鍒犻櫎銆愭。妗堝垎閰嶃��
      */
     @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:remove')")
-    @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.DELETE)
+    @Log(title = "銆愭。妗堝垎閰嶃��", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
         return toAjax(archiverecordstouserService.deleteArchiverecordstouserByIds(ids));
     }
+    /**
+     * 鏍规嵁鐢ㄦ埛id鍜宺ecordId杩涜鍒犻櫎
+     */
+    @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:remove')")
+    @DeleteMapping("/deleteByRidUid")
+    public AjaxResult removeByRecordIdAndUserId(String recordId, Long userId)
+    {
+        return toAjax(archiverecordstouserService.deleteArchiverecordstouserByRecordId(recordId, userId));
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:query')")
+    @GetMapping("/getByRidUid")
+    public AjaxResult getByRecordIdAndUserId(String recordId, Long userId)
+    {
+        return toAjax(archiverecordstouserService.queryArchiverecordstouserByRecordId(recordId, userId));
+    }
+
+
+
+
+
+
+
 }

--
Gitblit v1.9.1