master:推广营销调优;

pull/1121/head
Mr刘 2025-06-24 19:58:29 +08:00
parent 5a91cd73e6
commit 3d5cc5d76d
5 changed files with 24 additions and 15 deletions

View File

@ -43,7 +43,7 @@ public class AdvertRoundController extends XktBaseController {
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
@ApiOperation(value = "档口购买推广营销", httpMethod = "POST", response = R.class)
@Log(title = "档口购买推广营销", businessType = BusinessType.INSERT)
@PostMapping
@PostMapping("/create")
public R<Integer> create(@Validated @RequestBody AdRoundStoreCreateVO createVO) {
return R.ok(advertRoundService.create(BeanUtil.toBean(createVO, AdRoundStoreCreateDTO.class)));
}
@ -77,7 +77,6 @@ public class AdvertRoundController extends XktBaseController {
return R.ok(BeanUtil.copyToList(advertRoundService.getStoreBoughtRecord(storeId), AdRoundStoreBoughtResVO.class));
}
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
@ApiOperation(value = "获取当前最新的出价及设置的商品", httpMethod = "POST", response = R.class)
@PostMapping(value = "/latest")
@ -93,7 +92,7 @@ public class AdvertRoundController extends XktBaseController {
}
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
@ApiOperation(value = "获取档口已购推广列表", httpMethod = "POST", response = R.class)
@ApiOperation(value = "已购推广菜单列表", httpMethod = "POST", response = R.class)
@PostMapping("/page")
public R<Page<AdvertRoundStorePageResDTO>> page(@Validated @RequestBody AdvertRoundStorePageVO pageVO) {
return R.ok(advertRoundService.page(BeanUtil.toBean(pageVO, AdvertRoundStorePageDTO.class)));

View File

@ -23,6 +23,10 @@ public class AdRoundTypeRoundResVO {
private Long advertId;
@ApiModelProperty(value = "广告轮次ID")
private Integer roundId;
@ApiModelProperty(value = "展示类型")
private Integer showType;
@ApiModelProperty(value = "广告位置 A B C D E")
private String position;
@ApiModelProperty(value = "投放开始时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date startTime;

View File

@ -16,25 +16,25 @@ import lombok.Getter;
public enum AdType {
// 顶部横向大图
PC_HOME_TOP_LEFT_BANNER(1, "顶部横向大图"),
PC_HOME_TOP_LEFT_BANNER(1, "首页顶部横向大图"),
// 顶部纵向小图
PC_HOME_TOP_RIGHT_BANNER(2, "顶部纵向小图"),
PC_HOME_TOP_RIGHT_BANNER(2, "首页顶部纵向小图"),
// 首页销售榜榜一
PC_HOME_SALE_RANK_ONE(3, "销售榜榜一"),
PC_HOME_SALE_RANK_ONE(3, "首页销售榜榜一"),
// 首页销售榜榜二
PC_HOME_SALE_RANK_TWO(4, "销售榜榜二"),
PC_HOME_SALE_RANK_TWO(4, "首页销售榜榜二"),
// 首页销售榜榜三
PC_HOME_SALE_RANK_THREE(5, "销售榜榜三"),
PC_HOME_SALE_RANK_THREE(5, "首页销售榜榜三"),
// 首页销售榜榜四
PC_HOME_SALE_RANK_FOUR(6, "销售榜榜四"),
PC_HOME_SALE_RANK_FOUR(6, "首页销售榜榜四"),
// 风格榜
PC_HOME_STYLE_RANK(7, "风格榜"),
PC_HOME_STYLE_RANK(7, "首页风格榜"),
// 人气榜左侧大图
PC_HOME_POP_LEFT_BANNER(8, "人气榜左大图"),
PC_HOME_POP_LEFT_BANNER(8, "首页人气榜左大图"),
// 人气榜中间图
PC_HOME_POP_MID(9, "人气榜中间图"),
PC_HOME_POP_MID(9, "首页人气榜中间图"),
// 人气榜右侧图
PC_HOME_POP_RIGHT(10, "人气榜右侧图"),
PC_HOME_POP_RIGHT(10, "首页人气榜右侧图"),
// 首页档口横幅

View File

@ -23,6 +23,10 @@ public class AdRoundTypeRoundResDTO {
private Long advertId;
@ApiModelProperty(value = "广告轮次ID")
private Integer roundId;
@ApiModelProperty(value = "展示类型")
private Integer showType;
@ApiModelProperty(value = "广告位置 A B C D E")
private String position;
@ApiModelProperty(value = "投放开始时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date startTime;

View File

@ -1,6 +1,7 @@
package com.ruoyi.xkt.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -225,7 +226,8 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService {
Integer durationDay = calculateDurationDay(advertRound.getStartTime(), advertRound.getEndTime(), Boolean.TRUE);
AdRoundTypeRoundResDTO typeRoundResDTO = new AdRoundTypeRoundResDTO().setAdvertId(advertRound.getAdvertId()).setRoundId(advertRound.getRoundId())
.setSymbol(advertRound.getSymbol()).setStartTime(advertRound.getStartTime()).setEndTime(advertRound.getEndTime())
.setStartWeekDay(getDayOfWeek(advertRound.getStartTime())).setEndWeekDay(getDayOfWeek(advertRound.getEndTime())).setDurationDay(durationDay);
.setStartWeekDay(getDayOfWeek(advertRound.getStartTime())).setEndWeekDay(getDayOfWeek(advertRound.getEndTime()))
.setDurationDay(durationDay).setShowType(advertRound.getShowType()).setPosition(advertRound.getPosition());
// 展示类型 为时间范围 则,修改价格并显示每一轮竞价状态
if (Objects.equals(advertRound.getShowType(), AdShowType.TIME_RANGE.getValue())) {
// 只有时间范围类型才显示起始价格
@ -824,7 +826,7 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService {
// 如果当前档口购买该推广位,且设置商品不为空,则返回设置的商品信息
if (Objects.equals(advertRound.getStoreId(), latestDTO.getStoreId()) && StringUtils.isNotBlank(advertRound.getProdIdStr())) {
List<StoreProduct> storeProdList = Optional.ofNullable(this.storeProdMapper.selectList(new LambdaQueryWrapper<StoreProduct>()
.eq(StoreProduct::getId, Arrays.stream(advertRound.getProdIdStr().split(",")))
.in(StoreProduct::getId, StrUtil.split(advertRound.getProdIdStr(), ","))
.eq(StoreProduct::getDelFlag, Constants.UNDELETED).eq(StoreProduct::getStoreId, advertRound.getStoreId())))
.orElseThrow(() -> new ServiceException("档口商品不存在!", HttpStatus.ERROR));
latestInfo.setProdList(storeProdList.stream().map(x -> new AdRoundLatestResDTO.ARLProdDTO()