From 61f3ca9c5ce1c3dbbcca91af9c3fffcc2d514636 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期六, 22 十一月 2025 16:01:49 +0800
Subject: [PATCH] 修改了对应代码

---
 archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java |   51 ++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 46 insertions(+), 5 deletions(-)

diff --git a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java
index c7c3d40..9ac9f0e 100644
--- a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java
+++ b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java
@@ -20,9 +20,11 @@
 import com.ruoyi.mapper.ArchiveRecordsMapper;
 import com.ruoyi.mapper.ArchiverecordstouserMapper;
 import com.ruoyi.service.IArchiveRecordsService;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
+import java.util.Arrays;
 
 /**
  * 妗f璁板綍Service涓氬姟灞傚鐞�
@@ -182,6 +184,27 @@
 
         return beanRecords;
     }
+    
+    @Override
+    public List<ArchiveRecords> selectArchiveRecordsByIds(Long[] ids)
+    {
+        // 鑾峰彇褰撳墠鐢ㄦ埛ID
+        Long userid = SecurityUtils.getUserId();
+        
+        // 鍒涘缓鏌ヨ鏉′欢
+        LambdaQueryWrapper<ArchiveRecords> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+        
+        // 鏍规嵁ids鏌ヨ
+        lambdaQueryWrapper.in(ArchiveRecords::getId, Arrays.asList(ids));
+        
+        // 濡傛灉涓嶆槸绠$悊鍛橈紝闇�瑕佽�冭檻鏉冮檺杩囨护锛堝彲鏍规嵁瀹為檯鏉冮檺闇�姹傝皟鏁达級
+        if (userid != 1) {
+            // 杩欓噷鍙互娣诲姞鏉冮檺鐩稿叧鐨勮繃婊ゆ潯浠�
+        }
+        
+        List<ArchiveRecords> beanRecords = list(lambdaQueryWrapper);
+        return beanRecords;
+    }
 
     /**
      * 鏂板妗f璁板綍
@@ -282,6 +305,11 @@
 
         for (ArchiveRecords archiveRecords : dataList) {
            // physcialService.mySave(physcial);
+            archiveRecords.setRecordStatus("鏈綍鍏�");
+            LocalDateTime time = LocalDateTime.now();
+
+            Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant());
+            archiveRecords.setCreateTime(date);
             this.mySave(archiveRecords);
         }
 
@@ -294,15 +322,15 @@
     }
 
     @Override
-    public int updateArchiveById(Long id) {
-        this.baseMapper.updateStatusById(id);
+    public int updateArchiveById(String status, Long id) {
+        this.baseMapper.updateStatusById(status, id);
         return 0;
     }
 
     @Override
     public int updateStatusByIds(Long[] ids) {
         for(Long id : ids)
-            this.baseMapper.updateStatusById(id);
+            this.baseMapper.updateStatusById("褰曞叆瀹屾垚",id);
         return 0;
     }
 
@@ -326,16 +354,29 @@
         if (list.size() > 0) {
           //  throw new RuntimeException("璇峰嬁鏂板閲嶅鏁版嵁");
             //濡傛灉鏈夐噸澶嶆暟鎹紝鍒欐牴鎹畆ecordId杩涜鏁版嵁淇敼
-            this.baseMapper.update(archiveRecords, lqw);
-            return AjaxResult.success();
+         //   if()
+
+                this.baseMapper.update(archiveRecords, lqw);
+                return AjaxResult.success();
+
+
         }
         else {
+        Long userid = SecurityUtils.getUserId();
+        if(userid==1) {
             if (save(archiveRecords)) {
                 return AjaxResult.success();
             } else {
                 return AjaxResult.error();
             }
         }
+             else
+            return AjaxResult.error("妗f鍙蜂笉瀛樺湪锛�");
+        }
 
     }
+    @Override
+    public boolean whether(@Param("recordId") Long recordId){
+        return this.baseMapper.whether(recordId);
+    }
 }

--
Gitblit v1.9.1