| | |
| | | package com.jilongda.manage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.mapper.TCouponMapper; |
| | | import com.jilongda.manage.mapper.TStoreMapper; |
| | | import com.jilongda.manage.model.TCouponReceive; |
| | | import com.jilongda.manage.mapper.TCouponReceiveMapper; |
| | | import com.jilongda.manage.model.TStore; |
| | | import com.jilongda.manage.query.TAppUserCouponQuery; |
| | | import com.jilongda.manage.service.TCouponReceiveService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.manage.service.TCouponService; |
| | | import com.jilongda.manage.service.TStoreService; |
| | | import com.jilongda.manage.vo.TAppUserCouponVO; |
| | | import com.jilongda.manage.vo.TStoreVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TCouponReceiveServiceImpl extends ServiceImpl<TCouponReceiveMapper, TCouponReceive> implements TCouponReceiveService { |
| | | |
| | | @Resource |
| | | private TCouponMapper couponMapper; |
| | | @Resource |
| | | private TStoreMapper storeMapper; |
| | | @Resource |
| | | private TCouponReceiveMapper couponReceiveMapper; |
| | | @Override |
| | | public PageInfo<TAppUserCouponVO> pageList(TAppUserCouponQuery query) { |
| | | PageInfo<TAppUserCouponVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TAppUserCouponVO> list = couponReceiveMapper.pageList(query,pageInfo); |
| | | for (TAppUserCouponVO tAppUserCouponVO : list) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | if (StringUtils.hasLength(tAppUserCouponVO.getStoreId())) { |
| | | List<TStore> tStores = storeMapper.selectList(new LambdaQueryWrapper<TStore>() |
| | | .in(TStore::getId, Arrays.asList(tAppUserCouponVO.getStoreId().split(",")))); |
| | | for (TStore tStoreVO : tStores) { |
| | | stringBuilder.append(tStoreVO.getName()).append(","); |
| | | } |
| | | tAppUserCouponVO.setStoreName(stringBuilder.substring(0, stringBuilder.length() - 1)); |
| | | } else { |
| | | tAppUserCouponVO.setStoreName("不限"); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |