优惠卷列表 添加 店铺名称

This commit is contained in:
2024-09-02 17:59:44 +08:00
parent fd184ba835
commit 9a9e43ba71
6 changed files with 30 additions and 19 deletions

View File

@@ -1,9 +1,7 @@
package com.chaozhanggui.system.cashierservice.service.impl;
import com.chaozhanggui.system.cashierservice.dao.TbActivateInRecordMapper;
import com.chaozhanggui.system.cashierservice.dao.TbActivateOutRecordMapper;
import com.chaozhanggui.system.cashierservice.dao.TbShopUserMapper;
import com.chaozhanggui.system.cashierservice.dao.TbUserCouponsMapper;
import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
import com.chaozhanggui.system.cashierservice.entity.dto.UserCouponDto;
import com.chaozhanggui.system.cashierservice.entity.vo.ShopUserListVo;
import com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo;
@@ -36,6 +34,8 @@ public class TbUserCouponsServiceImpl implements TbUserCouponsService {
private TbActivateOutRecordMapper outRecordMapper;
@Autowired
private TbShopUserMapper tbShopUserMapper;
@Autowired
private TbShopInfoMapper tbShopInfoMapper;
/**
@@ -52,12 +52,13 @@ public class TbUserCouponsServiceImpl implements TbUserCouponsService {
List<ShopUserListVo> tbShopUsers = tbShopUserMapper.selectByUserId(couponDto.getUserId().toString(), couponDto.getShopId()==null?null:couponDto.getShopId().toString());
if (!CollectionUtils.isEmpty(tbShopUsers)) {
tbShopUsers.forEach(s -> {
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(s.getShopId().intValue());
if (couponDto.getStatus()==null || (couponDto.getStatus() != null && couponDto.getStatus() == 0)) {
List<UserCouponVo> unuseCoupon = inRecordMapper.queryVipPro(s.getMemberId().intValue(), s.getShopId().intValue());
List<UserCouponVo> unuseCoupon = inRecordMapper.queryVipPro(s.getMemberId().intValue(), s.getShopId().intValue(),shopInfo.getShopName());
result.addAll(unuseCoupon);
}
if (couponDto.getStatus()==null || (couponDto.getStatus() != null && couponDto.getStatus() == 1)) {
List<UserCouponVo> useCoupon = outRecordMapper.queryVipPro(s.getMemberId().intValue(), s.getShopId().intValue());
List<UserCouponVo> useCoupon = outRecordMapper.queryVipPro(s.getMemberId().intValue(), s.getShopId().intValue(),shopInfo.getShopName());
result.addAll(useCoupon);
}
});