|
|
@@ -7,6 +7,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|
|
import com.alibaba.excel.annotation.ExcelProperty;
|
|
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
|
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
|
|
+import com.ruoyi.common.enums.order.MarketingType;
|
|
|
import com.ruoyi.common.filepathsplicing.FilePathValue;
|
|
|
import com.ruoyi.shop.coupon.service.ICouponProductService;
|
|
|
import com.ruoyi.shop.enums.CouponStatus;
|
|
|
@@ -235,4 +236,33 @@ public class CouponVo {
|
|
|
adaptProductIds = couponProductService.loadAdaptProductIds(this.getBusinessId(),this.getId());
|
|
|
return CollectionUtil.isNotEmpty(adaptProductIds)?adaptProductIds:new ArrayList<>();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否适配秒杀
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Boolean isAdaptSecKill() {
|
|
|
+ return isAdaptActivity(MarketingType.SECKILL.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否适配拼团
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Boolean isAdaptGroupBuy() {
|
|
|
+ return isAdaptActivity(MarketingType.GROUP.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通用方法:判断是否适配指定活动类型
|
|
|
+ * @param activityCode 活动类型编码
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Boolean isAdaptActivity(Integer activityCode) {
|
|
|
+ if (adaptActivity == null || adaptActivity.isEmpty()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return adaptActivity.stream().anyMatch(activity -> activity.getCode().equals(activityCode));
|
|
|
+ }
|
|
|
+
|
|
|
}
|