use of co.yixiang.modules.activity.service.dto.YxStoreCouponUserDto 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;
}
use of co.yixiang.modules.activity.service.dto.YxStoreCouponUserDto in project yshopmall by guchengwuyue.
the class YxStoreCouponUserServiceImpl method download.
@Override
public void download(List<YxStoreCouponUserDto> all, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
for (YxStoreCouponUserDto yxStoreCouponUser : all) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("兑换的项目id", yxStoreCouponUser.getCid());
map.put("优惠券所属用户", yxStoreCouponUser.getUid());
map.put("优惠券名称", yxStoreCouponUser.getCouponTitle());
map.put("优惠券的面值", yxStoreCouponUser.getCouponPrice());
map.put("最低消费多少金额可用优惠券", yxStoreCouponUser.getUseMinPrice());
map.put("优惠券结束时间", yxStoreCouponUser.getEndTime());
map.put("使用时间", yxStoreCouponUser.getUseTime());
map.put("获取方式", yxStoreCouponUser.getType());
map.put("状态(0:未使用,1:已使用, 2:已过期)", yxStoreCouponUser.getStatus());
map.put("是否有效", yxStoreCouponUser.getIsFail());
list.add(map);
}
FileUtil.downloadExcel(list, response);
}
Aggregations