master:管理员推广营销功能调整;
parent
a0d24cb415
commit
e7c320c474
|
|
@ -33,6 +33,12 @@ public class AdminAdvertRoundController extends XktBaseController {
|
|||
|
||||
final IAdminAdvertRoundService adminAdvertRoundService;
|
||||
|
||||
@ApiOperation(value = "管理员推广营销列表待投放/已投放数量", httpMethod = "GET", response = R.class)
|
||||
@GetMapping("/status/count")
|
||||
public R<AdminAdRoundStatusCountResVO> statusCount() {
|
||||
return R.ok(BeanUtil.toBean(adminAdvertRoundService.statusCount(), AdminAdRoundStatusCountResVO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员获取推广营销列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
package com.ruoyi.web.controller.xkt;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.core.controller.XktBaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.web.controller.xkt.vo.advert.AdvertPageVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.advertStoreFile.AdvertStoreFilePageVO;
|
||||
import com.ruoyi.xkt.dto.advert.AdvertPageDTO;
|
||||
import com.ruoyi.xkt.dto.advert.AdvertResDTO;
|
||||
import com.ruoyi.xkt.dto.advertStoreFile.AdvertStoreFilePageDTO;
|
||||
import com.ruoyi.xkt.dto.advertStoreFile.AdvertStoreFileResDTO;
|
||||
import com.ruoyi.xkt.service.IAdvertService;
|
||||
import com.ruoyi.xkt.service.IAdvertStoreFileService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 管理员管理推广营销Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@Api(tags = "推广营销图片管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/rest/v1/ad-store-file")
|
||||
public class AdvertStoreFileController extends XktBaseController {
|
||||
|
||||
final IAdvertStoreFileService advertStoreFileService;
|
||||
|
||||
/**
|
||||
* 查询图片管理列表
|
||||
*/
|
||||
@ApiOperation(value = "查询图片管理列表 ", httpMethod = "POST", response = R.class)
|
||||
@PostMapping("/page")
|
||||
public R<Page<AdvertStoreFileResDTO>> page(@Validated @RequestBody AdvertStoreFilePageVO pageVO) {
|
||||
return R.ok(advertStoreFileService.page(BeanUtil.toBean(pageVO, AdvertStoreFilePageDTO.class)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ public class AdminAdRoundPageVO extends BasePageVO {
|
|||
@ApiModelProperty(value = "投放状态 1投放中 2待投放")
|
||||
private Integer launchStatus;
|
||||
@ApiModelProperty(value = "平台ID")
|
||||
private Long platformId;
|
||||
private Integer platformId;
|
||||
@ApiModelProperty(value = "推广类型")
|
||||
private Integer typeId;
|
||||
@ApiModelProperty(value = "图片审核状态 1 待审核 2 审核通过 3 审核驳回")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.adminAdvertRound;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("管理员推广营销列表统计列表")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminAdRoundStatusCountResVO {
|
||||
|
||||
@ApiModelProperty(value = "待投放数量")
|
||||
private Integer unLaunchCount;
|
||||
@ApiModelProperty(value = "已投放数量")
|
||||
private Integer launchCount;
|
||||
|
||||
}
|
||||
|
|
@ -70,6 +70,7 @@ public class AdvertCreateVO {
|
|||
@ApiModelProperty(value = "折扣失效时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private Date discountEndTime;
|
||||
@NotBlank(message = "截止时间不能为空!")
|
||||
@ApiModelProperty(value = "截止时间")
|
||||
private String deadline;
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ public class AdvertUpdateVO {
|
|||
@ApiModelProperty(value = "折扣失效时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private Date discountEndTime;
|
||||
@NotBlank(message = "截止时间不能为空!")
|
||||
@ApiModelProperty(value = "截止时间")
|
||||
private String deadline;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.advertStoreFile;
|
||||
|
||||
import com.ruoyi.web.controller.xkt.vo.BasePageVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("推广营销图片管理分页查询入参")
|
||||
@Data
|
||||
public class AdvertStoreFilePageVO extends BasePageVO {
|
||||
|
||||
@ApiModelProperty(value = "档口名称")
|
||||
private String storeName;
|
||||
@ApiModelProperty(value = "类型ID")
|
||||
private Integer typeId;
|
||||
|
||||
}
|
||||
|
|
@ -669,6 +669,28 @@ public class XktTask {
|
|||
log.info("-------------统计图搜热款结束-------------");
|
||||
}
|
||||
|
||||
/**
|
||||
* 凌晨2:35 更新过期档口
|
||||
*/
|
||||
public void autoCloseTimeoutStore() {
|
||||
|
||||
// TODO 更新未交年费档口
|
||||
// TODO 更新未交年费档口
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 凌晨2:40 更新档口过期会员
|
||||
*/
|
||||
public void autoCloseExpireStoreMember() {
|
||||
|
||||
// TODO 更新档口过期会员 删除ES中商品标识
|
||||
// TODO 更新档口过期会员 删除ES中商品标识
|
||||
// TODO 更新档口过期会员 删除ES中商品标识
|
||||
|
||||
// this.storeMapper.updateExpireStoreMember();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 每晚22:00:10 更新广告位竞价状态 将biddingTempStatus赋值给biddingStatus
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class AdminAdRoundPageDTO extends BasePageDTO {
|
|||
@ApiModelProperty(value = "投放状态 1投放中 2待投放")
|
||||
private Integer launchStatus;
|
||||
@ApiModelProperty(value = "平台ID")
|
||||
private Long platformId;
|
||||
private Integer platformId;
|
||||
@ApiModelProperty(value = "推广类型")
|
||||
private Integer typeId;
|
||||
@ApiModelProperty(value = "图片审核状态 1 待审核 2 审核通过 3 审核驳回")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.xkt.dto.adminAdvertRound;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("管理员推广营销列表统计列表")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminAdRoundStatusCountResDTO {
|
||||
|
||||
@ApiModelProperty(value = "待投放数量")
|
||||
private Integer unLaunchCount;
|
||||
@ApiModelProperty(value = "已投放数量")
|
||||
private Integer launchCount;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.xkt.dto.advertStoreFile;
|
||||
|
||||
import com.ruoyi.xkt.dto.BasePageDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("推广营销图片管理分页查询入参")
|
||||
@Data
|
||||
public class AdvertStoreFilePageDTO extends BasePageDTO {
|
||||
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private String storeName;
|
||||
@ApiModelProperty(value = "类型ID")
|
||||
private Integer typeId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.ruoyi.xkt.dto.advertStoreFile;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("推广营销图片管理返回数据")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdvertStoreFileResDTO {
|
||||
|
||||
@ApiModelProperty(value = "推广图片ID")
|
||||
private Long advertStoreFileId;
|
||||
@ApiModelProperty(value = "档口名称")
|
||||
private String storeName;
|
||||
@ApiModelProperty(value = "推广图片类型")
|
||||
private Integer typeId;
|
||||
@ApiModelProperty(value = "图片类型")
|
||||
private String typeName;
|
||||
@ApiModelProperty(value = "图片路径")
|
||||
private String fileUrl;
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.ruoyi.xkt.domain.AdvertRound;
|
||||
import com.ruoyi.xkt.dto.adminAdvertRound.AdminAdRoundPageDTO;
|
||||
import com.ruoyi.xkt.dto.adminAdvertRound.AdminAdRoundPageResDTO;
|
||||
import com.ruoyi.xkt.dto.adminAdvertRound.AdminAdRoundStatusCountResDTO;
|
||||
import com.ruoyi.xkt.dto.advertRound.AdvertRoundStorePageDTO;
|
||||
import com.ruoyi.xkt.dto.advertRound.AdvertRoundStorePageResDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -62,13 +63,11 @@ public interface AdvertRoundMapper extends BaseMapper<AdvertRound> {
|
|||
List<Long> selectMostPopulars();
|
||||
|
||||
/**
|
||||
* 获取时间范围类型推广位 最高出价
|
||||
* 推广状态数量
|
||||
*
|
||||
* @param advertId 推广位ID
|
||||
* @param roundId 播放轮次ID
|
||||
* @return BigDecimal
|
||||
* @return AdminAdRoundStatusCountResDTO
|
||||
*/
|
||||
BigDecimal selectMaxPayPrice(@Param("advertId") Long advertId, @Param("roundId") Integer roundId);
|
||||
AdminAdRoundStatusCountResDTO statusCount();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,12 @@ package com.ruoyi.xkt.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xkt.domain.AdvertStoreFile;
|
||||
import com.ruoyi.xkt.dto.advertStoreFile.AdvertStoreFilePageDTO;
|
||||
import com.ruoyi.xkt.dto.advertStoreFile.AdvertStoreFileResDTO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 推广营销档口上传的推广图 Mapper接口
|
||||
*
|
||||
|
|
@ -13,4 +17,12 @@ import org.springframework.stereotype.Repository;
|
|||
@Repository
|
||||
public interface AdvertStoreFileMapper extends BaseMapper<AdvertStoreFile> {
|
||||
|
||||
/**
|
||||
* 查询推广营销图片管理列表
|
||||
*
|
||||
* @param pageDTO 查询条件
|
||||
* @return 推广营销图片管理列表
|
||||
*/
|
||||
List<AdvertStoreFileResDTO> selectFilePage(AdvertStoreFilePageDTO pageDTO);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,4 +60,11 @@ public interface IAdminAdvertRoundService {
|
|||
*/
|
||||
Integer cancelIntercept(AdminAdRoundCancelInterceptDTO cancelInterceptDTO);
|
||||
|
||||
/**
|
||||
* 获取管理员推广营销列表 已投放/待投放数量
|
||||
*
|
||||
* @return AdminAdRoundPageStatusCountResDTO
|
||||
*/
|
||||
AdminAdRoundStatusCountResDTO statusCount();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.xkt.dto.advertStoreFile.AdvertStoreFilePageDTO;
|
||||
import com.ruoyi.xkt.dto.advertStoreFile.AdvertStoreFileResDTO;
|
||||
|
||||
/**
|
||||
* 推广营销Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
public interface IAdvertStoreFileService {
|
||||
|
||||
/**
|
||||
* 查询推广营销图片管理列表
|
||||
*
|
||||
* @param pageDTO 查询参数
|
||||
* @return 推广营销图片管理列表
|
||||
*/
|
||||
Page<AdvertStoreFileResDTO> page(AdvertStoreFilePageDTO pageDTO);
|
||||
|
||||
}
|
||||
|
|
@ -296,6 +296,17 @@ public class AdminAdvertRoundServiceImpl implements IAdminAdvertRoundService {
|
|||
return this.advertRoundMapper.updateAttrNull(advertRound.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取管理员推广营销列表 已投放/待投放数量
|
||||
*
|
||||
* @return AdminAdRoundPageStatusCountResDTO
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public AdminAdRoundStatusCountResDTO statusCount() {
|
||||
return this.advertRoundMapper.statusCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录竞价失败档口推广营销
|
||||
*
|
||||
|
|
|
|||
|
|
@ -28,10 +28,8 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -128,8 +126,19 @@ public class AdvertServiceImpl implements IAdvertService {
|
|||
}
|
||||
PageHelper.startPage(pageDTO.getPageNum(), pageDTO.getPageSize());
|
||||
List<Advert> advertList = this.advertMapper.selectList(queryWrapper);
|
||||
return CollectionUtils.isEmpty(advertList) ? Page.empty(pageDTO.getPageSize(), pageDTO.getPageNum())
|
||||
: Page.convert(new PageInfo<>(advertList), BeanUtil.copyToList(advertList, AdvertResDTO.class));
|
||||
if (CollectionUtils.isEmpty(advertList)) {
|
||||
return Page.empty(pageDTO.getPageSize(), pageDTO.getPageNum());
|
||||
}
|
||||
List<Long> fileIdList = advertList.stream().map(Advert::getExamplePicId).filter(ObjectUtils::isNotEmpty).collect(Collectors.toList());
|
||||
Map<Long, SysFile> fileMap = this.fileMapper.selectByIds(fileIdList).stream().collect(Collectors.toMap(SysFile::getId, Function.identity()));
|
||||
List<AdvertResDTO> advertResDTOList = advertList.stream().map(x -> {
|
||||
AdvertResDTO advertResDTO = BeanUtil.toBean(x, AdvertResDTO.class);
|
||||
if (ObjectUtils.isNotEmpty(x.getExamplePicId())) {
|
||||
advertResDTO.setExample(BeanUtil.toBean(fileMap.get(x.getExamplePicId()), AdvertResDTO.AdvertFileDTO.class));
|
||||
}
|
||||
return advertResDTO;
|
||||
}).collect(Collectors.toList());
|
||||
return Page.convert(new PageInfo<>(advertList), advertResDTOList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -251,6 +260,7 @@ public class AdvertServiceImpl implements IAdvertService {
|
|||
|
||||
/**
|
||||
* 随机生成10位,包含大小写字母、数字的字符串
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String random10Str() {
|
||||
|
|
@ -268,5 +278,4 @@ public class AdvertServiceImpl implements IAdvertService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.common.enums.AdType;
|
||||
import com.ruoyi.xkt.dto.advertStoreFile.AdvertStoreFilePageDTO;
|
||||
import com.ruoyi.xkt.dto.advertStoreFile.AdvertStoreFileResDTO;
|
||||
import com.ruoyi.xkt.mapper.AdvertStoreFileMapper;
|
||||
import com.ruoyi.xkt.service.IAdvertStoreFileService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 推广营销Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AdvertStoreFileServiceImpl implements IAdvertStoreFileService {
|
||||
|
||||
final AdvertStoreFileMapper advertStoreFileMapper;
|
||||
|
||||
/**
|
||||
* 查询推广营销图片管理列表
|
||||
*
|
||||
* @param pageDTO 查询参数
|
||||
* @return 推广营销图片管理列表
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Page<AdvertStoreFileResDTO> page(AdvertStoreFilePageDTO pageDTO) {
|
||||
PageHelper.startPage(pageDTO.getPageNum(), pageDTO.getPageSize());
|
||||
List<AdvertStoreFileResDTO> list = this.advertStoreFileMapper.selectFilePage(pageDTO);
|
||||
list.forEach(x -> x.setTypeName(AdType.of(x.getTypeId()).getLabel()));
|
||||
return Page.convert(new PageInfo<>(list));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -135,14 +135,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LIMIT 8
|
||||
</select>
|
||||
|
||||
<select id="selectMaxPayPrice">
|
||||
<select id="statusCount" resultType="com.ruoyi.xkt.dto.adminAdvertRound.AdminAdRoundStatusCountResDTO">
|
||||
SELECT
|
||||
MAX(IFNULL( pay_price, 0 )) AS pay_price
|
||||
SUM( CASE WHEN ar.launch_status = 2 THEN 1 ELSE 0 END ) AS unLaunchCount,
|
||||
SUM( CASE WHEN ar.launch_status = 1 THEN 1 ELSE 0 END ) AS launchCount
|
||||
FROM
|
||||
advert_round
|
||||
advert_round ar
|
||||
WHERE
|
||||
advert_id = #{advertId}
|
||||
AND round_id = #{roundId}
|
||||
ar.del_flag = 0
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,5 +4,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.xkt.mapper.AdvertStoreFileMapper">
|
||||
|
||||
<select id="selectFilePage" resultType="com.ruoyi.xkt.dto.advertStoreFile.AdvertStoreFileResDTO">
|
||||
SELECT
|
||||
ssf.id AS advertStoreFileId,
|
||||
s.store_name,
|
||||
ssf.type_id,
|
||||
sf.file_url
|
||||
FROM
|
||||
advert_store_file ssf
|
||||
LEFT JOIN sys_file sf ON ssf.pic_id = sf.id
|
||||
LEFT JOIN store s ON ssf.store_id = s.id
|
||||
WHERE
|
||||
ssf.del_flag = 0
|
||||
<if test="storeName != null and storeName != ''">
|
||||
AND s.store_name LIKE CONCAT('%', #{storeName}, '%')
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
AND ssf.type_id = #{typeId}
|
||||
</if>
|
||||
ORDER BY
|
||||
ssf.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue