From bcb1d905904fd43034f7c95077336e5cb849eff1 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期日, 18 一月 2026 23:17:22 +0800
Subject: [PATCH] 修改了对应代码

---
 archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java |   57 +++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 43 insertions(+), 14 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 56c7345..fe99738 100644
--- a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java
+++ b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java
@@ -96,11 +96,12 @@
         if (StringUtils.isEmpty(categoryNumberStart) || StringUtils.isEmpty(categoryNumberEnd)) {
             lqw.like(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId, archiveRecords.getRecordId());
         }
-        else {
+     //  else {
                 lqw.
             like(!StringUtils.isEmpty(archiveRecords.getInquiryNumber()), ArchiveRecords::getInquiryNumber, archiveRecords.getInquiryNumber())
                     .like(!StringUtils.isEmpty(archiveRecords.getCaseTitle()), ArchiveRecords::getCaseTitle, archiveRecords.getCaseTitle())
-                    .like(!StringUtils.isEmpty(archiveRecords.getPublicAttribute()), ArchiveRecords::getPublicAttribute, archiveRecords.getPublicAttribute())
+
+                        .like(!StringUtils.isEmpty(archiveRecords.getPublicAttribute()), ArchiveRecords::getPublicAttribute, archiveRecords.getPublicAttribute())
                     .like(!StringUtils.isEmpty(archiveRecords.getPreparationUnit()), ArchiveRecords::getPreparationUnit, archiveRecords.getPreparationUnit())
                     .like(!StringUtils.isEmpty(archiveRecords.getRetentionPeriod()), ArchiveRecords::getRetentionPeriod, archiveRecords.getRetentionPeriod())
                     .like(!StringUtils.isEmpty(archiveRecords.getSecurityClassification()), ArchiveRecords::getSecurityClassification, archiveRecords.getSecurityClassification())
@@ -117,7 +118,7 @@
                     .like(!StringUtils.isEmpty(archiveRecords.getEveryProjectName()), ArchiveRecords::getEveryProjectName, archiveRecords.getEveryProjectName())
                     .like(!StringUtils.isEmpty(archiveRecords.getRemarks()), ArchiveRecords::getRemarks, archiveRecords.getRemarks());
 
-        }
+      //  }
 
         if(archiveRecords.getIds()!=null)
                 lqw.in(ArchiveRecords::getId,new ArrayList<>(Arrays.asList(archiveRecords.getIds())));
@@ -383,12 +384,26 @@
         }
 
         assert dataList != null;
+      //  System.out.println("++++++++++++++++++++000000");
 
+//        System.out.println(dataList.size());
+//                for (ArchiveRecords archiveRecords : dataList) {
+//                    System.out.println(dataList.size());
+//
+//                }
         for (ArchiveRecords archiveRecords : dataList) {
            // physcialService.mySave(physcial);
             archiveRecords.setRecordStatus("鏈綍鍏�");
+            System.out.println(archiveRecords.getProjectName());
             LocalDateTime time = LocalDateTime.now();
-
+            String title = "";
+            if(archiveRecords.getConstructionUnit()!=null)
+                title = title +archiveRecords.getConstructionUnit();
+            if(archiveRecords.getConstructionAddress()!=null)
+                title = title + archiveRecords.getConstructionAddress();
+            if(archiveRecords.getProjectName()!=null)
+                title = title + archiveRecords.getProjectName();
+            archiveRecords.setCaseTitle(title);
             Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant());
             archiveRecords.setCreateTime(date);
             this.mySave(archiveRecords);
@@ -410,7 +425,7 @@
         // 鑾峰彇褰撳墠鐢ㄦ埛ID
         Long userId = SecurityUtils.getUserId();
         // 鍙互鍦ㄨ繖閲屼娇鐢╱serId杩涜鎺堟潈鎿嶄綔
-        if(operator.equals("閫�鍥炵鐞嗗憳"))
+        if(operator.equals("閫�鍥炵鐞嗗憳")||status.equals("褰曞叆瀹屾垚"))
             archiverecordstouserService.deleteArchiverecordstouserByRecordId(id, userId);
         this.baseMapper.updateStatusById(status, id, date);
         return 0;
@@ -421,8 +436,13 @@
         LocalDateTime time = LocalDateTime.now();
 
         Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant());
-        for(Long id : ids)
-            this.baseMapper.updateStatusById("褰曞叆瀹屾垚",id, date);
+        for(Long id : ids) {
+            // 鑾峰彇褰撳墠鐢ㄦ埛ID,鏀跺洖鎺堟潈
+            Long userId = SecurityUtils.getUserId();
+            archiverecordstouserService.deleteArchiverecordstouserByRecordId(id, userId);
+
+            this.baseMapper.updateStatusById("褰曞叆瀹屾垚", id, date);
+        }
         return 0;
     }
 
@@ -439,21 +459,30 @@
     @Override
     public AjaxResult mySave(ArchiveRecords archiveRecords) {
         // 妫�鏌ユ槸鍚︽湁閲嶅鏁版嵁鎻掑叆
+        System.out.println(archiveRecords.getRecordId()+"aaaaaaaaaaaaaaaaa");
+        if(archiveRecords.getRecordId()==null||StringUtils.isEmpty(archiveRecords.getRecordId()))
+            throw new RuntimeException("妗f鍙蜂笉鑳戒负绌�!");
+
         LambdaQueryWrapper<ArchiveRecords> lqw = new LambdaQueryWrapper<>();
         lqw.eq(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId,archiveRecords.getRecordId());
         List<ArchiveRecords> list = list(lqw);
-        if (!list.isEmpty()) {
-          //  throw new RuntimeException("璇峰嬁鏂板閲嶅鏁版嵁");
-            //濡傛灉鏈夐噸澶嶆暟鎹紝鍒欐牴鎹畆ecordId杩涜鏁版嵁淇敼
+        Long userid = SecurityUtils.getUserId();
+        if (!list.isEmpty()&&userid!=1) {
+           // throw new RuntimeException("璇峰嬁鏂板閲嶅鏁版嵁");
+            //濡傛灉鏈夐噸澶嶆暟鎹紝鍒欐牴鎹畆ecordId杩涜鏁版嵁淇敼sele
          //   if()
-
+//
                 this.baseMapper.update(archiveRecords, lqw);
                 return AjaxResult.success();
 
 
         }
+        else if(!list.isEmpty())
+        {
+             throw new RuntimeException("璇峰嬁鏂板閲嶅鏁版嵁");
+        }
         else {
-        Long userid = SecurityUtils.getUserId();
+
         if(userid==1) {
             if (save(archiveRecords)) {
                 return AjaxResult.success();
@@ -461,8 +490,8 @@
                 return AjaxResult.error();
             }
         }
-             else
-            return AjaxResult.error("妗f鍙蜂笉瀛樺湪锛�");
+       else
+            return AjaxResult.error("涓嶆槸绠$悊鍛橈紝涓嶈兘鏂板璁板綍锛�");
         }
 
     }

--
Gitblit v1.9.1