|
|
@@ -1,19 +1,17 @@
|
|
|
package cn.tr.module.mobile.service.impl;
|
|
|
|
|
|
-import cn.tr.core.exception.TRExcCode;
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.tr.module.mobile.controller.vo.ImUserVO;
|
|
|
+import cn.tr.module.mobile.dto.ImGroupUserQueryDTO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import cn.hutool.core.collection.CollectionUtil;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import cn.tr.core.exception.ServiceException;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import cn.tr.module.mobile.repository.ImGroupUserRepository;
|
|
|
-import cn.tr.module.mobile.po.ImGroupUserPO;
|
|
|
-import cn.tr.module.mobile.dto.ImGroupUserDTO;
|
|
|
-import cn.tr.module.mobile.dto.ImGroupUserQueryDTO;
|
|
|
-import java.util.*;
|
|
|
import cn.tr.module.mobile.service.IImGroupUserService;
|
|
|
-import cn.tr.module.mobile.mapper.ImGroupUserMapper;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* 群成员表Service接口实现类
|
|
|
*
|
|
|
@@ -25,68 +23,13 @@ public class ImGroupUserServiceImpl implements IImGroupUserService {
|
|
|
@Autowired
|
|
|
private ImGroupUserRepository baseRepository;
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据条件查询群成员表
|
|
|
- * @param query 查询参数
|
|
|
- * @author lf
|
|
|
- * @date 2025/08/20 10:17
|
|
|
- */
|
|
|
- @Override
|
|
|
- public List<ImGroupUserDTO> selectImGroupUserList(ImGroupUserQueryDTO query){
|
|
|
- return ImGroupUserMapper.INSTANCE.convertDtoList(
|
|
|
- baseRepository.selectList(new LambdaQueryWrapper<ImGroupUserPO>()
|
|
|
- )
|
|
|
- );
|
|
|
- };
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据id查询群成员表
|
|
|
- * @param id 主键id
|
|
|
- * @author lf
|
|
|
- * @date 2025/08/20 10:17
|
|
|
- */
|
|
|
- @Override
|
|
|
- public ImGroupUserDTO selectImGroupUserById(String id){
|
|
|
- return ImGroupUserMapper.INSTANCE.convertDto(baseRepository.selectById(id));
|
|
|
- };
|
|
|
-
|
|
|
- /**
|
|
|
- * 编辑群成员表
|
|
|
- * @param source 编辑实体类
|
|
|
- * @author lf
|
|
|
- * @date 2025/08/20 10:17
|
|
|
- */
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- @Override
|
|
|
- public boolean updateImGroupUserById(ImGroupUserDTO source){
|
|
|
- return baseRepository.updateById(ImGroupUserMapper.INSTANCE.convertPO(source))!=0;
|
|
|
- };
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增群成员表
|
|
|
- * @param source 新增实体类
|
|
|
- * @author lf
|
|
|
- * @date 2025/08/20 10:17
|
|
|
- */
|
|
|
- @Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public boolean insertImGroupUser(ImGroupUserDTO source){
|
|
|
- return baseRepository.insert(ImGroupUserMapper.INSTANCE.convertPO(source))!=0;
|
|
|
- };
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除群成员表详情
|
|
|
- * @param ids 删除主键集合
|
|
|
- * @author lf
|
|
|
- * @date 2025/08/20 10:17
|
|
|
- */
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public int removeImGroupUserByIds(Collection<String> ids){
|
|
|
- if(CollectionUtil.isEmpty(ids)){
|
|
|
- throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001,"请选择要删除的数据");
|
|
|
- }
|
|
|
- return baseRepository.deleteBatchIds(ids);
|
|
|
- };
|
|
|
+ public List<ImUserVO> selectUserList(ImGroupUserQueryDTO query) {
|
|
|
+ List<ImUserVO> result = new ArrayList<>();
|
|
|
+ List<ImUserVO> doctorUserList=baseRepository.selectDoctorUserList(query);
|
|
|
+ List<ImUserVO> patientUserList=baseRepository.selectPatientUserList(query);
|
|
|
+ result.addAll(doctorUserList);
|
|
|
+ result.addAll(patientUserList);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|