对比新文件 |
| | |
| | | package com.mzl.flower.service.impl.coupon; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mzl.flower.entity.coupon.CouponTemplateCustomerDO; |
| | | import com.mzl.flower.entity.customer.Customer; |
| | | import com.mzl.flower.mapper.coupon.CouponTemplateCustomerMapper; |
| | | import com.mzl.flower.mapper.customer.CustomerMapper; |
| | | import com.mzl.flower.service.coupon.CouponTemplateCustomerService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author @TaoJie |
| | | * @since 2024-08-24 |
| | | */ |
| | | @Service |
| | | public class CouponTemplateCustomerServiceImpl extends ServiceImpl<CouponTemplateCustomerMapper, CouponTemplateCustomerDO> implements CouponTemplateCustomerService { |
| | | |
| | | @Autowired |
| | | private CustomerMapper customerMapper; |
| | | |
| | | @Override |
| | | public List<CouponTemplateCustomerDO> getPointCustomReList(String id) { |
| | | QueryWrapper<CouponTemplateCustomerDO> queryWrapper=new QueryWrapper<>(); |
| | | queryWrapper.lambda().eq(CouponTemplateCustomerDO::getCouponId,id); |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteByCouponTemplateId(String couponTemplateId) { |
| | | QueryWrapper<CouponTemplateCustomerDO> queryWrapper=new QueryWrapper<>(); |
| | | queryWrapper.lambda().eq(CouponTemplateCustomerDO::getCouponId,couponTemplateId); |
| | | return baseMapper.delete(queryWrapper)>0; |
| | | } |
| | | |
| | | @Override |
| | | public List<Customer> getPointCustomerList(String id) { |
| | | final List<CouponTemplateCustomerDO> pointCustomReList = getPointCustomReList(id); |
| | | final List<Long> customerList = pointCustomReList.stream().map(CouponTemplateCustomerDO::getCustomId).collect(Collectors.toList()); |
| | | final List<Customer> customers = customerMapper.selectBatchIds(customerList); |
| | | return customers; |
| | | } |
| | | } |