| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.enums.ReplyStatusEnum; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | |
| | | // 封装会员条件查询对象 |
| | | MemberDTO memberDTO = null; |
| | | Set<Long> memberIdSet = null; |
| | | Page<PromotionWishList> page = new Page<>(query.getPageCurr(), query |
| | | .getPageSize()); |
| | | if (StringUtils.isNotBlank(query.getNickname()) || StringUtils.isNotBlank( |
| | | query.getPhone())) { |
| | | memberDTO = new MemberDTO(); |
| | |
| | | // 远程调用会员服务进行条件查询 |
| | | List<Member> memberList = memberClient.getMemberListByCondition(memberDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isEmpty(memberList)) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | memberIdSet = memberList.stream().map(Member::getId) |
| | | .collect(Collectors.toSet()); |
| | | } |
| | | |
| | | // 分页查询心愿求购列表 |
| | | Page<PromotionWishList> page = this.lambdaQuery() |
| | | page = this.lambdaQuery() |
| | | .eq(StringUtils.isNotNull(query.getReplyStatus()), |
| | | PromotionWishList::getReplyStatus, query.getReplyStatus()) |
| | | .in(StringUtils.isNotEmpty(memberIdSet), PromotionWishList::getMemberId, |
| | | memberIdSet).page(new Page<>(query.getPageCurr(), query |
| | | .getPageSize())); |
| | | memberIdSet).page(page); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | |
| | | public void reply(MgtPromotionWishListDTO dto) { |
| | | PromotionWishList promotionWishList = this.getById(dto.getId()); |
| | | promotionWishList.setReplies(dto.getReplies()); |
| | | promotionWishList.setReplyStatus(ReplyStatusEnum.REPLIED); |
| | | this.updateById(promotionWishList); |
| | | } |
| | | } |