更新10.16

This commit is contained in:
许允枞 2024-10-16 18:28:23 +08:00
parent 32aafbf042
commit 4687084528
4 changed files with 50 additions and 0 deletions

View File

@ -187,4 +187,14 @@ public class ActiveAppletController extends BaseController {
public ResponseObject getRecommendedByStoreId(Integer storeId){
return getSuccessResult(activeAppletService.selectByStoreId(storeId));
}
/**
*
* 根据storeId查询邀请有礼活动小程序
* @param storeId
* @return
*/
@GetMapping("getRecommendedRecordsByStoreId")
public ResponseObject getRecommendedRecordsByStoreId(Integer storeId){
return getSuccessResult(activeAppletService.selectRecommendedRecordsByStoreId(storeId));
}
}

View File

@ -7,6 +7,7 @@ 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 com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendRecords;
import java.util.List;
@ -70,5 +71,7 @@ public interface ActiveAppletService extends IService<ActiveApplet> {
* @return
*/
ActiveRecommend selectByStoreId(Integer storeId);
List<ActiveRecommendRecords> selectRecommendedRecordsByStoreId(Integer storeId);
}

View File

@ -18,11 +18,15 @@ import com.fuint.business.marketingActivity.activePopUp.service.ActivePopUpServi
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.entity.ActiveRecommendRecords;
import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendChildMapper;
import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendMapper;
import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendRecordsMapper;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService;
import com.fuint.business.marketingActivity.activeUserConsume.service.ActiveUserConsumeService;
import com.fuint.business.marketingActivity.activeUserRecharge.service.ActiveUserRechargeService;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponMapper;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.dto.AccountInfo;
@ -35,6 +39,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 小程序端活动表(ActiveApplet)表服务实现类
@ -87,6 +92,10 @@ public class ActiveAppletServiceImpl extends ServiceImpl<ActiveAppletMapper, Act
private ActiveRecommendChildMapper activeRecommendChildMapper;
@Autowired
private ActiveRecommendMapper activeRecommendMapper;
@Autowired
private ActiveRecommendRecordsMapper activeRecommendRecordsMapper;
@Autowired
private CardCouponMapper cardCouponMapper;
@Override
public List<ActiveApplet> applet(ActiveApplet activeApplet) {
@ -247,6 +256,27 @@ public class ActiveAppletServiceImpl extends ServiceImpl<ActiveAppletMapper, Act
return null;
}
@Override
public List<ActiveRecommendRecords> selectRecommendedRecordsByStoreId(Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
//查询推荐有礼领取记录
List<ActiveRecommendRecords> activeRecommendRecords = activeRecommendRecordsMapper.selectList(new LambdaQueryWrapper<ActiveRecommendRecords>()
.eq(ActiveRecommendRecords::getStoreId, storeId)
.eq(ActiveRecommendRecords::getUserId, nowAccountInfo.getId()));
//通过券ids查询券信息
for (ActiveRecommendRecords activeRecommendRecord : activeRecommendRecords) {
String[] split = activeRecommendRecord.getActiveRecommendIds().split(",");
List<ActiveRecommendChild> cardCoupons = activeRecommendChildMapper.selectList(new LambdaQueryWrapper<ActiveRecommendChild>()
.in(ActiveRecommendChild::getId, split));
if (cardCoupons != null) {
List<String> collect = cardCoupons.stream().map(ActiveRecommendChild::getGiftCardName).collect(Collectors.toList());
activeRecommendRecord.setCouponNames(collect);
}
}
return activeRecommendRecords;
}
/**
* 判断当前时间是否在活动时间范围内
* @param activeStartTime

View File

@ -3,12 +3,14 @@ package com.fuint.business.marketingActivity.activeRecommend.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
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 lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 邀请有礼记录表(ActiveRecommendRecords)表实体类
@ -46,5 +48,10 @@ public class ActiveRecommendRecords extends Model<ActiveRecommendRecords> {
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date updateTime;
private String activeRecommendIds;
private Integer points;
private Integer growthValue;
@TableField(exist = false)
private List<String> couponNames;
}