用户优惠券问题
This commit is contained in:
@@ -24,7 +24,7 @@ public interface MkShopCouponRecordService extends IService<MkShopCouponRecord>
|
|||||||
|
|
||||||
List<CouponReceiveVo> queryReceive(QueryReceiveDto param);
|
List<CouponReceiveVo> queryReceive(QueryReceiveDto param);
|
||||||
|
|
||||||
List<UserCouponVO> findByUser(String name, List<Long> shopUserIds, Integer status);
|
List<UserCouponVO> findByUser(String name, List<Long> shopUserIds, Integer status,Long shopId);
|
||||||
|
|
||||||
List<UserCouponVo> queryByVipIdAndShopId(Long shopId, Long shopUserId, Integer type, Integer isFood);
|
List<UserCouponVo> queryByVipIdAndShopId(Long shopId, Long shopUserId, Integer type, Integer isFood);
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public interface MkShopCouponRecordMapper extends BaseMapper<MkShopCouponRecord>
|
|||||||
|
|
||||||
List<CouponReceiveVo> queryReceive(@Param("param") QueryReceiveDto param);
|
List<CouponReceiveVo> queryReceive(@Param("param") QueryReceiveDto param);
|
||||||
|
|
||||||
List<UserCouponVO> findCouponVOByUser(String name, List<Long> shopUserIds, Integer status);
|
List<UserCouponVO> findCouponVOByUser(String name, List<Long> shopUserIds, Integer status, Long shopId);
|
||||||
|
|
||||||
List<UserCouponVo> queryByVipIdAndShopId(Long shopId, Long shopUserId, Integer type, Integer isFood);
|
List<UserCouponVo> queryByVipIdAndShopId(Long shopId, Long shopUserId, Integer type, Integer isFood);
|
||||||
|
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ public class MkShopCouponRecordServiceImpl extends ServiceImpl<MkShopCouponRecor
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UserCouponVO> findByUser(String name, List<Long> shopUserIds, Integer status) {
|
public List<UserCouponVO> findByUser(String name, List<Long> shopUserIds, Integer status, Long shopId) {
|
||||||
return getMapper().findCouponVOByUser(name, shopUserIds, status);
|
return getMapper().findCouponVOByUser(name, shopUserIds, status, shopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -244,13 +244,14 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
|||||||
@Override
|
@Override
|
||||||
public Page<UserCouponVO> find(Long userId, String name, Long shopId, Integer status) {
|
public Page<UserCouponVO> find(Long userId, String name, Long shopId, Integer status) {
|
||||||
Page<Object> page = PageUtil.buildPage();
|
Page<Object> page = PageUtil.buildPage();
|
||||||
|
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
|
||||||
List<Long> shopUserIds = shopUserService.listAs(new QueryWrapper().eq(ShopUser::getUserId, userId)
|
List<Long> shopUserIds = shopUserService.listAs(new QueryWrapper().eq(ShopUser::getUserId, userId)
|
||||||
.eq(ShopUser::getSourceShopId, shopId)
|
.eq(ShopUser::getMainShopId, mainShopId)
|
||||||
.select(ShopUser::getId), Long.class);
|
.select(ShopUser::getId), Long.class);
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(shopUserIds)) {
|
if (CollectionUtil.isNotEmpty(shopUserIds)) {
|
||||||
PageHelper.startPage(Math.toIntExact(page.getPageNumber()), Math.toIntExact(page.getPageSize()));
|
PageHelper.startPage(Math.toIntExact(page.getPageNumber()), Math.toIntExact(page.getPageSize()));
|
||||||
List<UserCouponVO> coupons = recordService.findByUser(name, shopUserIds, status);
|
List<UserCouponVO> coupons = recordService.findByUser(name, shopUserIds, status, shopId);
|
||||||
for (UserCouponVO coupon : coupons) {
|
for (UserCouponVO coupon : coupons) {
|
||||||
int maxShow = 5;
|
int maxShow = 5;
|
||||||
if (StrUtil.isNotBlank(coupon.getFoods())) {
|
if (StrUtil.isNotBlank(coupon.getFoods())) {
|
||||||
|
|||||||
@@ -72,6 +72,9 @@
|
|||||||
<foreach collection="shopUserIds" item="userId" open="(" separator="," close=")">
|
<foreach collection="shopUserIds" item="userId" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
<if test="shopId != null">
|
||||||
|
and mk_shop_coupon_record.shop_id = #{shopId}
|
||||||
|
</if>
|
||||||
<if test="name != null and name != ''">
|
<if test="name != null and name != ''">
|
||||||
and mk_shop_coupon_record.name like concat('%', #{name}, '%')
|
and mk_shop_coupon_record.name like concat('%', #{name}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user