记得上下班打卡 | git大法好,push需谨慎

Commit b657dcc0 authored by 胡佳晨's avatar 胡佳晨

添加 banner position 10

parent 465deff5
......@@ -16,6 +16,7 @@ import java.util.List;
* <p>
* 轮播图 添加、修改banner需要的参数
* </p>
*
* @author jiangxiulong
* @since 2021-05-03 11:19 上午
*/
......@@ -61,6 +62,9 @@ public class BannersParam implements Serializable {
@ApiModelProperty(value = "排序权重 越大越靠前", example = "100")
private Integer bannersSort;
@ApiModelProperty(value = "活动id", example = "100")
private String marketId;
@ApiModelProperty(value = "展示的位置 多选 数组", example = "[\"1\", \"3\", \"5\", \"6\", \"8\"]")
@NotEmpty(message = "请选择展示位置")
private List<String> positionList;
......
......@@ -32,6 +32,9 @@ public class BannerDetailsListDao implements Serializable {
private Integer bannersSort;
private String marketId;
private String marketName;
private String remarks;
private String createdAt;
......
......@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.List;
......@@ -19,7 +20,7 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class KylinBanners implements Serializable ,Cloneable {
public class KylinBanners implements Serializable, Cloneable {
private static final long serialVersionUID = 1L;
......@@ -77,6 +78,11 @@ public class KylinBanners implements Serializable ,Cloneable {
*/
private Integer BannersSort;
/**
* 活动id
*/
private String marketId;
/**
* 位置
*/
......@@ -105,6 +111,7 @@ public class KylinBanners implements Serializable ,Cloneable {
private String updatedAt;
private static final KylinBanners obj = new KylinBanners();
public static KylinBanners getNew() {
try {
return (KylinBanners) obj.clone();
......
......@@ -12,10 +12,10 @@
<!-- admin banner列表 -->
<select id="searchBannersList" parameterType="java.util.Map" resultType="com.liquidnet.service.kylin.dao.BannerDetailsListDao">
SELECT *
FROM kylin_banners
SELECT a.*,b.name
FROM kylin_banners as a left join goblin_self_marketing as b on a.market_id = b.self_market_id
<where>
is_deleted = 1
a.is_deleted = 1
<if test="bannersName != ''">
AND banners_name LIKE concat('%', #{bannersName}, '%')
</if>
......
......@@ -31,6 +31,10 @@ CREATE TABLE `kylin_banners`
COLLATE utf8mb4_unicode_ci
COMMENT '轮播图';
ALTER TABLE kylin_banners
add market_id varchar(255) NOT NULL DEFAULT '' COMMENT '活动id' after banners_sort;
drop TABLE if exists `kylin_banners_relations`;
CREATE TABLE `kylin_banners_relations`
(
......
......@@ -38,13 +38,15 @@ public class KylinBannersController {
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "position", value = "展示位置 1首页 3周边 5积分商城 6YB 8视频", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "provinceName", value = "城市名称"),
@ApiImplicitParam(type = "query", dataType = "String", name = "marketId", value = "活动id"),
})
public ResponseDto<List<KylinBanners>> blist(
@RequestParam() String position,
@RequestParam() String marketId,
@RequestParam(defaultValue = "") String provinceName
) {
try {
List<KylinBanners> result = bannersServiceImpl.blist(position, provinceName);
List<KylinBanners> result = bannersServiceImpl.blist(position, provinceName,marketId);
return ResponseDto.success(result);
} catch (Exception e) {
log.error("banner列表Error", e);
......
......@@ -36,7 +36,7 @@ public class BannersServiceImpl implements IKylinBannersService {
@Autowired
RedisUtil redisUtil;
public List<KylinBanners> blist(String position, String provinceName) {
public List<KylinBanners> blist(String position, String provinceName, String marketId) {
String nowTime = DateUtil.getNowTime();
Object ListObj = redisUtil.get(KylinRedisConst.ADMIN_BANNER_LIST);
List<KylinBanners> list = ObjectUtil.getKylinBannerListArrayList();
......@@ -66,8 +66,14 @@ public class BannersServiceImpl implements IKylinBannersService {
Boolean pis = false;
if (null != pList) {
for (String positionName : pList) {
if (positionName.equals(position)) {
pis = true;
if ("9".equals(position)) {
if (positionName.equals(position) && bannerInfo.getMarketId().equals(marketId)) {
pis = true;
}
} else {
if (positionName.equals(position)) {
pis = true;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment