退货增加订单Id

优惠券
This commit is contained in:
2025-03-04 09:41:48 +08:00
parent 23f4e36bda
commit fed28278d8
9 changed files with 32 additions and 18 deletions

View File

@@ -19,5 +19,5 @@ public interface ShopActivateCouponRecordMapper extends BaseMapper<ShopActivateC
List<CouponReceiveVo> queryReceive(QueryReceiveDto param);
List<ShopActivateCouponRecord> findByUser(List<Long> shopUserIds, Integer status);
List<UserCouponVo> queryByVipIdAndShopId(Long shopId, Long shopUserId);
List<UserCouponVo> queryByVipIdAndShopId(Long shopId, Long shopUserId,Integer type);
}

View File

@@ -31,7 +31,7 @@ public class ShopActivateCouponRecordServiceImpl extends ServiceImpl<ShopActivat
}
@Override
public List<UserCouponVo> queryByVipIdAndShopId(Long shopId, Long shopUserId) {
return getMapper().queryByVipIdAndShopId(shopId, shopUserId);
public List<UserCouponVo> queryByVipIdAndShopId(Long shopId, Long shopUserId, Integer type) {
return getMapper().queryByVipIdAndShopId(shopId, shopUserId, type);
}
}

View File

@@ -83,7 +83,7 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
@Override
public Page<CouponReceiveVo> queryReceive(QueryReceiveDto param) {
Page<Object> page = PageUtil.buildPage();
PageHelper.startPage(Math.toIntExact(page.getPageNumber()),Math.toIntExact(page.getPageSize()));
PageHelper.startPage(Math.toIntExact(page.getPageNumber()), Math.toIntExact(page.getPageSize()));
return PageUtil.convert(new PageInfo<>(couponRecordService.queryReceive(param)));
}
@@ -96,15 +96,15 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
.eq(ShopUser::getShopId, shopId)
.select(ShopUser::getId).listAs(Long.class);
if (CollectionUtil.isNotEmpty(shopUserIds)) {
PageHelper.startPage(Math.toIntExact(page.getPageNumber()),Math.toIntExact(page.getPageSize()));
PageHelper.startPage(Math.toIntExact(page.getPageNumber()), Math.toIntExact(page.getPageSize()));
return PageUtil.convert(new PageInfo<>(couponRecordService.findByUser(shopUserIds, status)));
}
return new Page<>();
}
@Override
public List<UserCouponVo> findCoupon(Long shopId, Long shopUserId) {
List<UserCouponVo> tbUserCouponVos = couponRecordService.queryByVipIdAndShopId(shopId, shopUserId);
public List<UserCouponVo> findCoupon(Long shopId, Long shopUserId, Integer type) {
List<UserCouponVo> tbUserCouponVos = couponRecordService.queryByVipIdAndShopId(shopId, shopUserId,type);
if (CollectionUtil.isNotEmpty(tbUserCouponVos)) {
String week = DateUtil.dayOfWeekEnum(new Date()).toChinese("");
LocalTime now = LocalTime.now();

View File

@@ -63,7 +63,7 @@
inRecord.over_num as num,
inRecord.use_end_time as endTime
FROM
tb_activate_in_record inRecord
tb_shop_activate_coupon_record inRecord
LEFT JOIN tb_shop_info shop ON inRecord.shop_id = shop.id
LEFT JOIN tb_product pro ON inRecord.pro_id = pro.id and pro.shop_id = #{shopId}
WHERE
@@ -74,7 +74,10 @@
<if test="shopId != null and shopId != ''">
and inRecord.shop_id = #{shopId}
</if>
and inRecord.over_num != 0
<if test="type != null ">
and inRecord.type = #{type}
</if>
and inRecord.status = 0
and inRecord.use_start_time &lt; now()
and inRecord.use_end_time &gt; now()
order by inRecord.use_end_time