From 9f5127b6c58a297104bccc75a4c5125733f5ff4b Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期四, 27 十一月 2025 14:33:11 +0800
Subject: [PATCH] 修改了对应代码
---
archiveManager/src/main/java/com/ruoyi/service/impl/ArchiverecordstouserServiceImpl.java | 87 ++++++++++++++++++++++++++++++++-----------
1 files changed, 65 insertions(+), 22 deletions(-)
diff --git a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiverecordstouserServiceImpl.java b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiverecordstouserServiceImpl.java
index 49a9bac..29c2849 100644
--- a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiverecordstouserServiceImpl.java
+++ b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiverecordstouserServiceImpl.java
@@ -1,6 +1,7 @@
package com.ruoyi.service.impl;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
@@ -13,7 +14,9 @@
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ArchiveRecords;
import com.ruoyi.domain.Archiverecordstouser;
+import com.ruoyi.domain.vo.RecordToUserCount;
import com.ruoyi.mapper.ArchiverecordstouserMapper;
import com.ruoyi.service.IArchiverecordstouserService;
import com.ruoyi.system.mapper.SysUserMapper;
@@ -23,7 +26,7 @@
/**
- * 銆愯濉啓鍔熻兘鍚嶇О銆慡ervice涓氬姟灞傚鐞�
+ * 銆愭。妗堝垎閰嶃�慡ervice涓氬姟灞傚鐞�
*
* @author ruoyi
* @date 2025-07-20
@@ -37,7 +40,7 @@
private ISysUserService iSysUserService;
private LambdaQueryWrapper<Archiverecordstouser> buildCondition(Archiverecordstouser archiverecordstouser) {
LambdaQueryWrapper<Archiverecordstouser> lqw = new LambdaQueryWrapper<>();
- lqw.eq(!StringUtils.isEmpty(archiverecordstouser.getArchiveRecordsId()),Archiverecordstouser::getArchiveRecordsId, archiverecordstouser.getArchiveRecordsId());
+ lqw.eq(archiverecordstouser.getArchiveRecordsId()!=null,Archiverecordstouser::getArchiveRecordsId, archiverecordstouser.getArchiveRecordsId());
//淇濆瓨鐩稿叧鐢ㄦ埛鐨剈serId
List<Long> arr = new ArrayList<>();
@@ -59,7 +62,7 @@
@Override
- public int insertRecordToUsers(String recordId, Long[] userIds) {
+ public int insertRecordToUsers(Long recordId, Long[] userIds) {
// 鏂板鐢ㄦ埛涓庢鍗疯褰�
List<Archiverecordstouser> list = new ArrayList<Archiverecordstouser>();
for (Long userId : userIds)
@@ -68,6 +71,7 @@
ur.setArchiveRecordsId(recordId);
ur.setUserId(userId);
list.add(ur);
+ break;
}
boolean res = this.saveBatch(list);
if(res)
@@ -105,10 +109,10 @@
return AjaxResult.success(data); }
/**
- * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆�
+ * 鏌ヨ銆愭。妗堝垎閰嶃��
*
- * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
- * @return 銆愯濉啓鍔熻兘鍚嶇О銆�
+ * @param id 銆愭。妗堝垎閰嶃�戜富閿�
+ * @return 銆愭。妗堝垎閰嶃��
*/
@Override
public Archiverecordstouser selectArchiverecordstouserById(Long id)
@@ -117,22 +121,30 @@
}
@Override
+ public boolean selectArchiveRecordUsers(Long recordId) {
+ LambdaQueryWrapper<Archiverecordstouser> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(recordId!=null,Archiverecordstouser::getArchiveRecordsId, recordId);
+ List<Archiverecordstouser> lis = list(lqw);
+ return !lis.isEmpty();
+ }
+
+ @Override
public List<Archiverecordstouser> selectArchiverecordstouserList(Archiverecordstouser archiverecordstouser) {
- return null;
+ return this.list();
}
/**
- * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+ * 鏌ヨ銆愭。妗堝垎閰嶃�戝垪琛�
*
- * @param archiverecordstouser 銆愯濉啓鍔熻兘鍚嶇О銆�
- * @return 銆愯濉啓鍔熻兘鍚嶇О銆�
+ * @param archiverecordstouser 銆愭。妗堝垎閰嶃��
+ * @return 銆愭。妗堝垎閰嶃��
*/
/**
- * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+ * 鏂板銆愭。妗堝垎閰嶃��
*
- * @param archiverecordstouser 銆愯濉啓鍔熻兘鍚嶇О銆�
+ * @param archiverecordstouser 銆愭。妗堝垎閰嶃��
* @return 缁撴灉
*/
@Override
@@ -142,9 +154,9 @@
}
/**
- * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+ * 淇敼銆愭。妗堝垎閰嶃��
*
- * @param archiverecordstouser 銆愯濉啓鍔熻兘鍚嶇О銆�
+ * @param archiverecordstouser 銆愭。妗堝垎閰嶃��
* @return 缁撴灉
*/
@Override
@@ -154,9 +166,9 @@
}
/**
- * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+ * 鎵归噺鍒犻櫎銆愭。妗堝垎閰嶃��
*
- * @param ids 闇�瑕佸垹闄ょ殑銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+ * @param ids 闇�瑕佸垹闄ょ殑銆愭。妗堝垎閰嶃�戜富閿�
* @return 缁撴灉
*/
@Override
@@ -166,9 +178,9 @@
}
/**
- * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆戜俊鎭�
+ * 鍒犻櫎銆愭。妗堝垎閰嶃�戜俊鎭�
*
- * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+ * @param id 銆愭。妗堝垎閰嶃�戜富閿�
* @return 缁撴灉
*/
@Override
@@ -178,10 +190,10 @@
}
@Override
- public int deleteArchiverecordstouserByRecordId(String recordId, Long userId) {
+ public int deleteArchiverecordstouserByRecordId(Long recordId, Long userId) {
LambdaQueryWrapper<Archiverecordstouser> lqw = new LambdaQueryWrapper<>();
- lqw.eq(!StringUtils.isEmpty(recordId), Archiverecordstouser::getArchiveRecordsId, recordId)
+ lqw.eq(recordId!=null, Archiverecordstouser::getArchiveRecordsId, recordId)
.eq(userId!=null, Archiverecordstouser::getUserId, userId);
if(this.remove(lqw))
return 1;
@@ -190,9 +202,9 @@
}
@Override
- public int queryArchiverecordstouserByRecordId(String recordId, Long userId) {
+ public int queryArchiverecordstouserByRecordId(Long recordId, Long userId) {
LambdaQueryWrapper<Archiverecordstouser> lqw = new LambdaQueryWrapper<>();
- lqw.eq(!StringUtils.isEmpty(recordId), Archiverecordstouser::getArchiveRecordsId, recordId)
+ lqw.eq(recordId!=null, Archiverecordstouser::getArchiveRecordsId, recordId)
.eq(userId!=null, Archiverecordstouser::getUserId, userId);
List<Archiverecordstouser> lis = list(lqw);
@@ -201,4 +213,35 @@
else
return 0;
}
+
+ @Override
+ public AjaxResult countStatistic(String username, int pageNum, int pageSize) {
+ LambdaQueryWrapper<RecordToUserCount> lqw = new LambdaQueryWrapper<>();
+
+ if(username!=null)
+ lqw.like(!StringUtils.isEmpty(username), RecordToUserCount::getUserName, username);
+
+
+
+
+
+
+ Page<RecordToUserCount> page = new Page<>(pageNum, pageSize);
+
+ // 浣跨敤鑷畾涔夌殑鍒嗛〉鏌ヨ鏂规硶锛屽厛杩炴帴鍐嶅垎椤�
+ Page<RecordToUserCount> pageResult = this.baseMapper.selectRecordToUserPage(page, lqw);
+
+ List<RecordToUserCount> beanRecords = pageResult.getRecords();//寰楀埌鏌ヨ鍑烘潵鐨勬暟鎹�
+
+ HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords);
+
+
+ return AjaxResult.success(data);
+
+ }
+
+ @Override
+ public List<RecordToUserCount> findAllRecordToUserCont() {
+ return this.baseMapper.selectRecordToUserAll();
+ }
}
--
Gitblit v1.9.1