From 250bf6cc09ed6446b9754a11fccca70032800b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Wed, 16 Oct 2024 17:34:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B010.16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activeApplet/entity/ActiveApplet.java | 2 + .../service/ActiveAppletService.java | 3 +- .../service/impl/ActiveAppletServiceImpl.java | 38 +++++++++++++------ 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/entity/ActiveApplet.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/entity/ActiveApplet.java index 60b45fac7..a62567203 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/entity/ActiveApplet.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/entity/ActiveApplet.java @@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.extension.activerecord.Model; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * 小程序端活动表(ActiveApplet)表实体类 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/service/ActiveAppletService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/service/ActiveAppletService.java index f072d959c..41a304a2e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/service/ActiveAppletService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/service/ActiveAppletService.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet; import com.fuint.business.marketingActivity.activePrice.vo.ActivePriceReqVO; import com.fuint.business.marketingActivity.activePrice.vo.ActivePriceRespVO; +import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend; import java.util.List; @@ -68,6 +69,6 @@ public interface ActiveAppletService extends IService { * @param storeId * @return */ - ActiveApplet selectByStoreId(Integer storeId); + ActiveRecommend selectByStoreId(Integer storeId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/service/impl/ActiveAppletServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/service/impl/ActiveAppletServiceImpl.java index 26c611b84..3b66b3926 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/service/impl/ActiveAppletServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeApplet/service/impl/ActiveAppletServiceImpl.java @@ -16,6 +16,10 @@ import com.fuint.business.marketingActivity.activeConsumption.service.ActiveCons import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsService; import com.fuint.business.marketingActivity.activePopUp.service.ActivePopUpService; import com.fuint.business.marketingActivity.activePrice.service.ActiveSubPriceService; +import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend; +import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild; +import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendChildMapper; +import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendMapper; import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService; import com.fuint.business.marketingActivity.activeUserConsume.service.ActiveUserConsumeService; import com.fuint.business.marketingActivity.activeUserRecharge.service.ActiveUserRechargeService; @@ -24,6 +28,7 @@ import com.fuint.business.userManager.service.LJUserGradeService; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import com.fuint.utils.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; @@ -78,6 +83,11 @@ public class ActiveAppletServiceImpl extends ServiceImpl applet(ActiveApplet activeApplet) { return activeAppletMapper.selectApplet(activeApplet); @@ -210,23 +220,27 @@ public class ActiveAppletServiceImpl extends ServiceImpl() - .eq(ActiveApplet::getStoreId, storeId) - .eq(ActiveApplet::getType, "7") - .eq(ActiveApplet::getIsonline, "0") - .eq(ActiveApplet::getActiveStatus, "1")); - if (activeApplet != null) { - if (!"1".equals(activeApplet.getTime())) { - return activeApplet; + public ActiveRecommend selectByStoreId(Integer storeId) { + //推荐有礼表 + ActiveRecommend activeRecommend = activeRecommendMapper.selectOne(new LambdaQueryWrapper() + .eq(ActiveRecommend::getStoreId, storeId) + .eq(ActiveRecommend::getStatus, "0") + .eq(ActiveRecommend::getIsonline, "0")); + if (activeRecommend != null) { + //查询可以领取的优惠券 + List activeRecommendChildren = activeRecommendChildMapper.selectList(new LambdaQueryWrapper() + .eq(ActiveRecommendChild::getActiveRecommendId, activeRecommend.getId())); + activeRecommend.setCouponList(activeRecommendChildren); + if (!"1".equals(activeRecommend.getActiveTimeType())) { + return activeRecommend; }else { DateTime now = DateUtil.date(); - Date activeStartTime = activeApplet.getActiveStartTime(); - Date activeEndTime = activeApplet.getActiveEndTime(); + Date activeStartTime = activeRecommend.getActiveStartTime(); + Date activeEndTime = activeRecommend.getActiveEndTime(); //判断当前时间是否在活动时间范围内 boolean timeBetween = isTimeBetween(activeStartTime, activeEndTime, now); if (timeBetween) { - return activeApplet; + return activeRecommend; } } }