Search in sources :

Example 1 with YxStoreCouponUser

use of co.yixiang.modules.activity.domain.YxStoreCouponUser in project yshopmall by guchengwuyue.

the class YxStoreCouponUserServiceImpl method queryAll.

@Override
public // @Cacheable
Map<String, Object> queryAll(YxStoreCouponUserQueryCriteria criteria, Pageable pageable) {
    getPage(pageable);
    PageInfo<YxStoreCouponUser> page = new PageInfo<>(queryAll(criteria));
    List<YxStoreCouponUserDto> storeOrderDTOS = generator.convert(page.getList(), YxStoreCouponUserDto.class);
    for (YxStoreCouponUserDto couponUserDTO : storeOrderDTOS) {
        YxUser yxUser = userService.getOne(new LambdaQueryWrapper<YxUser>().eq(YxUser::getUid, couponUserDTO.getUid()));
        if (yxUser == null) {
            couponUserDTO.setNickname("--");
            continue;
        }
        couponUserDTO.setNickname(yxUser.getNickname());
    }
    Map<String, Object> map = new LinkedHashMap<>(2);
    map.put("content", storeOrderDTOS);
    map.put("totalElements", page.getTotal());
    return map;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) YxStoreCouponUserDto(co.yixiang.modules.activity.service.dto.YxStoreCouponUserDto) YxUser(co.yixiang.modules.shop.domain.YxUser) YxStoreCouponUser(co.yixiang.modules.activity.domain.YxStoreCouponUser) LambdaQueryWrapper(com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

YxStoreCouponUser (co.yixiang.modules.activity.domain.YxStoreCouponUser)1 YxStoreCouponUserDto (co.yixiang.modules.activity.service.dto.YxStoreCouponUserDto)1 YxUser (co.yixiang.modules.shop.domain.YxUser)1 LambdaQueryWrapper (com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)1 PageInfo (com.github.pagehelper.PageInfo)1 LinkedHashMap (java.util.LinkedHashMap)1