满减活动问题
分类Pid问题
This commit is contained in:
@@ -62,8 +62,8 @@ public class MkDiscountActivityServiceImpl extends ServiceImpl<MkDiscountActivit
|
||||
}
|
||||
|
||||
@Override
|
||||
public MkDiscountActivityDTO checkDiscountAct(Long shopId, boolean couponShare, boolean vipShare, boolean limitRateShare, boolean pointsShare) {
|
||||
MkDiscountActivityDTO activityDTO = getActivityByShopId(shopId);
|
||||
public MkDiscountActivityDTO checkDiscountAct(Long discountActId, boolean couponShare, boolean vipShare, boolean limitRateShare, boolean pointsShare) {
|
||||
MkDiscountActivityDTO activityDTO = getActivityById(discountActId);
|
||||
AssertUtil.isNull(activityDTO, "店铺未配置满减活动");
|
||||
//检查是否开启了优惠券抵扣
|
||||
if (couponShare && activityDTO.getCouponShare() == 0) {
|
||||
@@ -105,6 +105,22 @@ public class MkDiscountActivityServiceImpl extends ServiceImpl<MkDiscountActivit
|
||||
return activityDTO;
|
||||
}
|
||||
|
||||
|
||||
private MkDiscountActivityDTO getActivityById(Long discountActId) {
|
||||
MkDiscountActivity activity = this.getById(discountActId);
|
||||
if (activity == null) {
|
||||
return null;
|
||||
}
|
||||
MkDiscountActivityDTO activityDTO = BeanUtil.toBean(activity, MkDiscountActivityDTO.class);
|
||||
activityDTO.setThresholds(thresholdMapper.selectListByQuery(
|
||||
new QueryWrapper()
|
||||
.eq(MkDiscountThreshold::getActivityId, activity.getId())
|
||||
.orderBy(MkDiscountThreshold::getFullAmount, false)
|
||||
));
|
||||
return activityDTO;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addActivity(MkDiscountActivityDTO param) {
|
||||
if (CollUtil.isEmpty(param.getThresholds())) {
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
AND is_del = 0
|
||||
AND status = 2
|
||||
AND NOW() BETWEEN valid_start_time AND valid_end_time
|
||||
<!-- AND (use_time_type = 'all' OR
|
||||
# (use_time_type = 'custom' AND TIME(NOW()) BETWEEN use_start_time AND use_end_time))
|
||||
# AND use_days LIKE CONCAT('%', #{useDay}, '%') -->
|
||||
AND (use_time_type = 'all' OR
|
||||
(use_time_type = 'custom' AND TIME(NOW()) BETWEEN use_start_time AND use_end_time))
|
||||
AND use_days LIKE CONCAT('%', #{useDay}, '%')
|
||||
ORDER BY sort DESC,
|
||||
update_time DESC,
|
||||
create_time DESC
|
||||
|
||||
Reference in New Issue
Block a user