更新10.16
This commit is contained in:
parent
9cf48beb49
commit
250bf6cc09
@ -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)表实体类
|
||||
|
@ -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<ActiveApplet> {
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
ActiveApplet selectByStoreId(Integer storeId);
|
||||
ActiveRecommend selectByStoreId(Integer storeId);
|
||||
}
|
||||
|
||||
|
@ -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<ActiveAppletMapper, Act
|
||||
@Lazy
|
||||
private ActivePopUpService activePopUpService;
|
||||
|
||||
@Autowired
|
||||
private ActiveRecommendChildMapper activeRecommendChildMapper;
|
||||
@Autowired
|
||||
private ActiveRecommendMapper activeRecommendMapper;
|
||||
|
||||
@Override
|
||||
public List<ActiveApplet> applet(ActiveApplet activeApplet) {
|
||||
return activeAppletMapper.selectApplet(activeApplet);
|
||||
@ -210,23 +220,27 @@ public class ActiveAppletServiceImpl extends ServiceImpl<ActiveAppletMapper, Act
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ActiveApplet selectByStoreId(Integer storeId) {
|
||||
ActiveApplet activeApplet = baseMapper.selectOne(new LambdaQueryWrapper<ActiveApplet>()
|
||||
.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<ActiveRecommend>()
|
||||
.eq(ActiveRecommend::getStoreId, storeId)
|
||||
.eq(ActiveRecommend::getStatus, "0")
|
||||
.eq(ActiveRecommend::getIsonline, "0"));
|
||||
if (activeRecommend != null) {
|
||||
//查询可以领取的优惠券
|
||||
List<ActiveRecommendChild> activeRecommendChildren = activeRecommendChildMapper.selectList(new LambdaQueryWrapper<ActiveRecommendChild>()
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user