|
@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
@ -31,22 +32,24 @@ import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.ScanContentUtils; |
|
|
import com.epmet.commons.tools.utils.ScanContentUtils; |
|
|
|
|
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.modules.member.service.ResiGroupMemberService; |
|
|
import com.epmet.modules.member.service.ResiGroupMemberService; |
|
|
import com.epmet.modules.notice.dao.NoticeCommentDao; |
|
|
import com.epmet.modules.notice.dao.NoticeCommentDao; |
|
|
import com.epmet.modules.notice.entity.NoticeCommentEntity; |
|
|
import com.epmet.modules.notice.entity.NoticeCommentEntity; |
|
|
import com.epmet.modules.notice.entity.NoticeEntity; |
|
|
|
|
|
import com.epmet.modules.notice.redis.NoticeCommentRedis; |
|
|
import com.epmet.modules.notice.redis.NoticeCommentRedis; |
|
|
import com.epmet.modules.notice.service.NoticeCommentService; |
|
|
import com.epmet.modules.notice.service.NoticeCommentService; |
|
|
import com.epmet.modules.notice.service.NoticeService; |
|
|
import com.epmet.modules.notice.service.NoticeService; |
|
|
import com.epmet.modules.topic.service.ResiTopicService; |
|
|
|
|
|
import com.epmet.modules.utils.ModuleConstant; |
|
|
import com.epmet.modules.utils.ModuleConstant; |
|
|
import com.epmet.resi.group.constant.MemberStateConstant; |
|
|
import com.epmet.resi.group.constant.MemberStateConstant; |
|
|
import com.epmet.resi.group.constant.TopicConstant; |
|
|
import com.epmet.resi.group.constant.TopicConstant; |
|
|
|
|
|
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; |
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; |
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; |
|
|
import com.epmet.resi.group.dto.notice.NoticeCommentDTO; |
|
|
import com.epmet.resi.group.dto.notice.NoticeCommentDTO; |
|
|
import com.epmet.resi.group.dto.notice.NoticeDTO; |
|
|
import com.epmet.resi.group.dto.notice.NoticeDTO; |
|
|
import com.epmet.resi.group.dto.notice.form.NoticeCommentFormDTO; |
|
|
import com.epmet.resi.group.dto.notice.form.NoticeCommentFormDTO; |
|
|
import com.epmet.resi.group.dto.topic.ResiTopicDTO; |
|
|
import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO; |
|
|
|
|
|
import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.logging.Log; |
|
|
import org.apache.commons.logging.Log; |
|
|
import org.apache.commons.logging.LogFactory; |
|
|
import org.apache.commons.logging.LogFactory; |
|
@ -55,10 +58,8 @@ import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
import java.util.*; |
|
|
import java.util.List; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 小组通知评论表 |
|
|
* 小组通知评论表 |
|
@ -71,14 +72,16 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl<NoticeCommentDao, |
|
|
private final Log logger = LogFactory.getLog(getClass()); |
|
|
private final Log logger = LogFactory.getLog(getClass()); |
|
|
@Autowired |
|
|
@Autowired |
|
|
private NoticeCommentRedis noticeCommentRedis; |
|
|
private NoticeCommentRedis noticeCommentRedis; |
|
|
@Autowired |
|
|
|
|
|
private NoticeService noticeService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ResiGroupMemberService resiGroupMemberService; |
|
|
|
|
|
@Value("${openapi.scan.server.url}") |
|
|
@Value("${openapi.scan.server.url}") |
|
|
private String scanApiUrl; |
|
|
private String scanApiUrl; |
|
|
@Value("${openapi.scan.method.textSyncScan}") |
|
|
@Value("${openapi.scan.method.textSyncScan}") |
|
|
private String textSyncScanMethod; |
|
|
private String textSyncScanMethod; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private NoticeService noticeService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ResiGroupMemberService resiGroupMemberService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -196,4 +199,42 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl<NoticeCommentDao, |
|
|
insert(entity); |
|
|
insert(entity); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return |
|
|
|
|
|
* @Author sun |
|
|
|
|
|
* @Description 通知评论列表查询 |
|
|
|
|
|
**/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<NoticeCommentListResultDTO> noticeCommentList(TokenDto tokenDto, NoticeCommentListFormDTO formDTO) { |
|
|
|
|
|
//1.分页查询通知评论列表
|
|
|
|
|
|
formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize()); |
|
|
|
|
|
List<NoticeCommentListResultDTO> resultList = baseDao.getNoticeCommentList(formDTO); |
|
|
|
|
|
if (resultList.size() < NumConstant.ONE) { |
|
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//2.调用user服务,查询评论人员基础信息
|
|
|
|
|
|
List<String> userIdList = resultList.stream().map(NoticeCommentListResultDTO::getUserId).collect(Collectors.toList()); |
|
|
|
|
|
Result<List<UserBaseInfoResultDTO>> result = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); |
|
|
|
|
|
if (!result.success()) { |
|
|
|
|
|
throw new RenException("调用user服务,获取用户基础数据失败"); |
|
|
|
|
|
} |
|
|
|
|
|
List<UserBaseInfoResultDTO> resultDTOList = result.getData(); |
|
|
|
|
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
|
|
|
resultList.forEach(l -> { |
|
|
|
|
|
StringBuffer name = new StringBuffer(); |
|
|
|
|
|
resultDTOList.forEach(user -> { |
|
|
|
|
|
if (l.getUserId().equals(user.getUserId())) { |
|
|
|
|
|
name.append(null == user.getSurname() ? "" : user.getSurname()).append(null == user.getName() ? "" : user.getName()); |
|
|
|
|
|
l.setCommentUserHeadPhoto(user.getHeadImgUrl()); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
l.setCommentUserName(name.toString()); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return resultList; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |