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

Commit 8e76121e authored by wangyifan's avatar wangyifan

Merge branch 'dev-wyf-v1.8.0-goblin' into test

parents 2df263b5 2822d4ba
......@@ -31,6 +31,7 @@ CREATE TABLE `goblin_artist_topic` (
`store_id` varchar(64) NOT NULL COMMENT '所属店铺ID',
`topic_name` varchar(100) NOT NULL COMMENT '专题名称',
`artist_id` varchar(64) DEFAULT NULL COMMENT '关联艺人ID,可空',
`custom_avatar_url` varchar(500) DEFAULT NULL COMMENT '未关联艺人时的自定义头像',
`template_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1双列网格 2单列列表',
`banner_url` varchar(500) DEFAULT NULL COMMENT '专题banner',
`banner_height` int(11) NOT NULL DEFAULT 240 COMMENT 'banner高度px',
......@@ -92,3 +93,9 @@ INSERT INTO `sys_menu` VALUES (2231, '设置排序', 2221, 6, '#', 'menuItem', '
INSERT INTO `sys_menu` VALUES (2232, '删除专题', 2221, 7, '#', 'menuItem', 'F', '0', '1', 'goblin:artist:topic:delete', '#', 'admin', '2026-08-14 14:30:00', '', NULL, '');
-- TODO 再将“演出管理”下的”艺人管理“菜单移动到新增的“艺人管理”目录下
-- ----------------------------
-- 已建库增量:未关联艺人时的自定义头像
-- ----------------------------
-- ALTER TABLE `goblin_artist_topic`
-- ADD COLUMN `custom_avatar_url` varchar(500) DEFAULT NULL COMMENT '未关联艺人时的自定义头像' AFTER `artist_id`;
......@@ -87,8 +87,9 @@ public class GoblinRedisConst {
public static final String STORE_NOTICE = PREFIX.concat("store_ntc:");
/* ----------------------------------------------------------------- */
public static final String FRONT_TOP_BANNER = PREFIX.concat("front_top_banner"); //前端顶部banner
public static final String FRONT_MIDDLE_BANNER = PREFIX.concat("front_middle_banner"); //前端中部banner
public static final String FRONT_TOP_BANNER = PREFIX.concat("front_top_banner"); //前端顶部banner(旧版 bannerType=1)
public static final String FRONT_MIDDLE_BANNER = PREFIX.concat("front_middle_banner"); //前端中部banner(bannerType=2)
public static final String FRONT_NEW_TOP_BANNER = PREFIX.concat("front_new_top_banner"); //前端新版顶部banner(bannerType=3)
public static final String FRONT_NAVIGATION = PREFIX.concat("front_navigation"); //前端banner
public static final String FRONT_HOTWORD = PREFIX.concat("front_hot_word"); //前端banner
public static final String FRONT_HOTWORD_INDEX = PREFIX.concat("front_hot_word_index"); //前端banner index
......
......@@ -28,6 +28,10 @@ public class GoblinStoreMgtArtistTopicCreateParams implements Serializable {
@ApiModelProperty(value = "关联艺人ID,非必填")
private String artistId;
@ApiModelProperty(value = "未关联艺人时的自定义头像")
@Size(max = 500, message = "自定义头像地址长度超限")
private String customAvatarUrl;
@ApiModelProperty(value = "模版类型 1双列 2单列")
@NotNull(message = "模版类型不能为空")
private Integer templateType;
......
......@@ -32,6 +32,10 @@ public class GoblinStoreMgtArtistTopicUpdateParams implements Serializable {
@ApiModelProperty(value = "关联艺人ID,非必填;传空字符串表示清空")
private String artistId;
@ApiModelProperty(value = "未关联艺人时的自定义头像;有艺人时忽略")
@Size(max = 500, message = "自定义头像地址长度超限")
private String customAvatarUrl;
@ApiModelProperty(value = "模版类型 1双列 2单列")
@NotNull(message = "模版类型不能为空")
private Integer templateType;
......
......@@ -28,9 +28,12 @@ public class GoblinStoreMgtArtistTopicDetailVo implements Serializable {
@ApiModelProperty("关联艺人名称")
private String artistName;
@ApiModelProperty("艺人头像")
@ApiModelProperty("展示头像:有艺人取艺人头像,否则取自定义头像")
private String avatarUrl;
@ApiModelProperty("未关联艺人时的自定义头像")
private String customAvatarUrl;
@ApiModelProperty("模版类型")
private Integer templateType;
......
......@@ -47,9 +47,12 @@ public class GoblinStoreMgtArtistTopicPageVo implements Serializable {
@ApiModelProperty("关联艺人名称")
private String artistName;
@ApiModelProperty("艺人头像")
@ApiModelProperty("展示头像:有艺人取艺人头像,否则取自定义头像")
private String avatarUrl;
@ApiModelProperty("未关联艺人时的自定义头像")
private String customAvatarUrl;
@ApiModelProperty("关联商品数量")
private Integer goodsCount;
......
......@@ -17,6 +17,8 @@ public class GoblinArtistTopicVo implements Serializable {
private String storeId;
private String topicName;
private String artistId;
/** 未关联艺人时的自定义头像 */
private String customAvatarUrl;
private Integer templateType;
private String bannerUrl;
private Integer bannerHeight;
......
......@@ -26,7 +26,7 @@ public class GoblinFrontArtistTopicDetailVo implements Serializable {
private String artistId;
@ApiModelProperty("艺人名称")
private String artistName;
@ApiModelProperty("艺人头像")
@ApiModelProperty("头像:有艺人取艺人头像,否则取自定义头像")
private String avatarUrl;
@ApiModelProperty("模版类型 1双列 2单列")
private Integer templateType;
......
......@@ -41,7 +41,7 @@ public class GoblinFrontArtistTopicHomeVo implements Serializable {
private String artistId;
@ApiModelProperty("艺人名称")
private String artistName;
@ApiModelProperty("艺人头像")
@ApiModelProperty("头像:有艺人取艺人头像,否则取自定义头像")
private String avatarUrl;
}
}
......@@ -44,7 +44,7 @@ public class GoblinFrontArtistTopicListPageVo implements Serializable {
private String artistId;
@ApiModelProperty("艺人名称")
private String artistName;
@ApiModelProperty("艺人头像")
@ApiModelProperty("头像:有艺人取艺人头像,否则取自定义头像")
private String avatarUrl;
}
}
......@@ -134,6 +134,8 @@ public class GoblinFrontBannerController extends BaseController {
logger.info("bannerResult,{}",bannerResult);
boolean bannerMiddle=goblinFrontBannerService.middle();
logger.info("banner中部{}",bannerMiddle);
boolean bannerNewTop=goblinFrontBannerService.onlineNewTopBanner();
logger.info("banner新版顶部{}",bannerNewTop);
boolean hotWordResult=goblinFrontHotWordService.online();
logger.info("热词,{}",hotWordResult);
boolean navigationResult=goblinFrontNavigationService.online();
......@@ -151,7 +153,7 @@ public class GoblinFrontBannerController extends BaseController {
logger.debug("新品推荐{}",recommendResult);
/* boolean hejiReult=goblinFrontCompilationsService.online();
logger.info("合集{}",hejiReult);*/
if (bannerResult&&hotWordResult&&navigationResult&bannerMiddle&&selectGoods&&moudleIndexResult&&cubeResult ) {
if (bannerResult&&hotWordResult&&navigationResult&bannerMiddle&&selectGoods&&moudleIndexResult&&cubeResult&&bannerNewTop) {
return success("操作成功");
} else {
return error("操作失败");
......
......@@ -233,6 +233,23 @@
}
modalPx()
})
function openTopBannerPicker() {
layer.open({
type: 1,
title: '选择顶部Banner类型',
area: ['320px', '180px'],
content: '<div style="padding:24px 20px;">' +
'<p style="margin-bottom:16px;color:#555;">请选择要编辑的顶部Banner版本:</p>' +
'<div style="display:flex;gap:12px;">' +
'<button class="btn btn-default" style="flex:1;height:48px;" onclick="layer.closeAll();$.modal.open(\'旧版顶部Banner\', prefix2+\'/topBanner?id=6\',900,560,cancel)">' +
'旧版 Banner</button>' +
'<button class="btn btn-primary" style="flex:1;height:48px;" onclick="layer.closeAll();$.modal.open(\'新版顶部Banner\', prefix2+\'/topBanner?id=3\',900,560,cancel)">' +
'新版 Banner</button>' +
'</div></div>',
btn: false
});
}
function goArea (num) {
switch(num) {
case 1:
......@@ -244,8 +261,7 @@
// $.modal.openTab('商品搜索', prefix2 + "/searchStore?id=" + 1212)
break;
case 6:
$.modal.open('顶部banner', prefix2 + "/topBanner?id=" + num,900,560, cancel)
// $.modal.openTab('顶部banner', prefix2 + "/topBanner?id=" + num)
openTopBannerPicker();
break;
case 2:
$.modal.open('活动banner', prefix2 + "/topBanner?id=" + num,900,560, cancel)
......
......@@ -194,8 +194,13 @@
$("#tags").hide();
$("#activeTags").show();
$("#showMiddleBanner").show();
} else if (type == 3) {
type = 3;
$("#tags").show();
$("#activeTags").hide();
$("#tall").html('新版顶部BANNER(bannerType=3)');
} else {
type = 1
type = 1;
$("#tags").show();
$("#activeTags").hide();
}
......
......@@ -209,7 +209,32 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_MIDDLE_BANNER,list);
}
return true;
}
public boolean onlineNewTopBanner(){
LambdaQueryWrapper<GoblinFrontBanner> queryWrapper = Wrappers.lambdaQuery(GoblinFrontBanner.class);
queryWrapper.ne(GoblinFrontBanner::getDelTag,1);
queryWrapper.eq(GoblinFrontBanner::getBannerType,3);
queryWrapper.orderByAsc(GoblinFrontBanner::getIndexs);
List<GoblinFrontBanner> list=goblinFrontBannerMapper.selectList(queryWrapper);
if(list.size()>0){
//mongodb
for(GoblinFrontBanner goblinFrontBanner: list){
GoblinFrontBanner goblinFrontBanner1=mongoTemplate.findOne(Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())), GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
if(null==goblinFrontBanner1){
mongoTemplate.save(goblinFrontBanner,GoblinFrontBanner.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontBanner)));
mongoTemplate.getCollection(GoblinFrontBanner.class.getSimpleName()).updateOne(
Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())).getQueryObject(),
orderObject
);
}
}
}
//redis 无论有无数据都刷新(支持清空情况)
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_NEW_TOP_BANNER,list);
return true;
}
......
......@@ -28,6 +28,9 @@ public class GoblinArtistTopic implements Serializable {
private String artistId;
/** 未关联艺人时的自定义头像 */
private String customAvatarUrl;
/** 1双列 2单列 */
private Integer templateType;
......
......@@ -51,6 +51,12 @@ public class GoblinFrontController {
return ResponseDto.success(goblinFrontService.getMiddleBanner());
}
@GetMapping("getNewTopBanner")
@ApiOperation("获取新版顶部banner(bannerType=3,新版App专用)")
public ResponseDto<ArrayList<GoblinFrontBannerVo>> getNewTopBanner() {
return ResponseDto.success(goblinFrontService.getNewTopBanner());
}
@GetMapping("getHotWord")
@ApiOperation("获得热词")
public ResponseDto<GoblinFrontHotWord> getHotWord() {
......
......@@ -112,6 +112,8 @@ public class GoblinFrontArtistTopicServiceImpl {
vo.setArtistName(artist.getArtistName());
vo.setAvatarUrl(artist.getAvatarUrl());
}
} else {
vo.setAvatarUrl(topic.getCustomAvatarUrl());
}
vo.setGoods(buildGoods(topic.getGoods(), sortType, sortOrder));
return ResponseDto.success(vo);
......@@ -279,6 +281,8 @@ public class GoblinFrontArtistTopicServiceImpl {
if (artist != null) {
item.setArtistName(artist.getArtistName());
item.setAvatarUrl(artist.getAvatarUrl());
} else {
item.setAvatarUrl(t.getCustomAvatarUrl());
}
return item;
}).collect(Collectors.toList());
......@@ -299,6 +303,8 @@ public class GoblinFrontArtistTopicServiceImpl {
if (artist != null) {
item.setArtistName(artist.getArtistName());
item.setAvatarUrl(artist.getAvatarUrl());
} else {
item.setAvatarUrl(t.getCustomAvatarUrl());
}
return item;
}).collect(Collectors.toList());
......
......@@ -209,6 +209,35 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return list1;
}
public ArrayList<GoblinFrontBannerVo> getNewTopBanner() {
List<GoblinFrontBanner> list = goblinRedisUtils.getNewTopBanner();
if (null == list) {
return null;
}
LocalDateTime nowTime = LocalDateTime.now();
ArrayList<GoblinFrontBanner> goblinFrontBannerArrayList = ObjectUtil.getGoblinFrontBannerArrayList();
for (GoblinFrontBanner goblinFrontBanner : list) {
if (null != goblinFrontBanner.getEndTime()) {
if (nowTime.isAfter(goblinFrontBanner.getEndTime())) {
} else {
if (nowTime.isBefore(goblinFrontBanner.getStartTime())) {
} else {
goblinFrontBannerArrayList.add(goblinFrontBanner);
}
}
} else {
goblinFrontBannerArrayList.add(goblinFrontBanner);
}
}
ArrayList<GoblinFrontBannerVo> list1 = ObjectUtil.goblinFrontBannerVoArrayList();
for (GoblinFrontBanner goblinFrontBanner : goblinFrontBannerArrayList) {
GoblinFrontBannerVo goblinFrontBannerVo = GoblinFrontBannerVo.getNew();
BeanUtils.copyProperties(goblinFrontBanner, goblinFrontBannerVo);
list1.add(goblinFrontBannerVo);
}
return list1;
}
@Override
public GoblinFrontHotWord getHotWord() {
List<GoblinFrontHotWord> list = goblinRedisUtils.getHotWord();
......
......@@ -339,10 +339,13 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
item.setTopicId(topic.getTopicId());
item.setTopicName(topic.getTopicName());
item.setArtistId(topic.getArtistId());
item.setCustomAvatarUrl(topic.getCustomAvatarUrl());
KylinArtist artist = artistMap.get(topic.getArtistId());
if (artist != null) {
item.setArtistName(artist.getArtistName());
item.setAvatarUrl(artist.getAvatarUrl());
} else {
item.setAvatarUrl(topic.getCustomAvatarUrl());
}
item.setGoodsCount(topic.getGoods() != null ? topic.getGoods().size() : 0);
item.setOnSaleStart(topic.getOnSaleStart());
......@@ -370,6 +373,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
vo.setTopicId(topic.getTopicId());
vo.setTopicName(topic.getTopicName());
vo.setArtistId(topic.getArtistId());
vo.setCustomAvatarUrl(topic.getCustomAvatarUrl());
vo.setTemplateType(topic.getTemplateType());
vo.setBannerUrl(topic.getBannerUrl());
vo.setBannerHeight(topic.getBannerHeight());
......@@ -383,6 +387,8 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
vo.setArtistName(artist.getArtistName());
vo.setAvatarUrl(artist.getAvatarUrl());
}
} else {
vo.setAvatarUrl(topic.getCustomAvatarUrl());
}
if (!CollectionUtils.isEmpty(topic.getGoods())) {
......@@ -450,6 +456,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
topicVo.setStoreId(storeId);
topicVo.setTopicName(params.getTopicName());
topicVo.setArtistId(StringUtils.trimToNull(params.getArtistId()));
topicVo.setCustomAvatarUrl(resolveCustomAvatarUrl(params.getArtistId(), params.getCustomAvatarUrl()));
topicVo.setTemplateType(params.getTemplateType());
topicVo.setBannerUrl(params.getBannerUrl());
topicVo.setBannerHeight(params.getBannerHeight() == null ? GoblinArtistConst.DEFAULT_BANNER_HEIGHT : params.getBannerHeight());
......@@ -526,6 +533,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
Update update = new Update();
update.set("topicName", params.getTopicName());
update.set("artistId", StringUtils.trimToNull(params.getArtistId()));
update.set("customAvatarUrl", resolveCustomAvatarUrl(params.getArtistId(), params.getCustomAvatarUrl()));
update.set("templateType", params.getTemplateType());
update.set("bannerUrl", params.getBannerUrl());
update.set("bannerHeight", params.getBannerHeight() == null ? GoblinArtistConst.DEFAULT_BANNER_HEIGHT : params.getBannerHeight());
......@@ -665,6 +673,14 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
return ResponseDto.success(null);
}
/** 有艺人时不存自定义头像 */
private String resolveCustomAvatarUrl(String artistId, String customAvatarUrl) {
if (StringUtils.isNotBlank(artistId)) {
return null;
}
return StringUtils.trimToNull(customAvatarUrl);
}
private ResponseDto<Void> checkGoodsBelong(String storeId, Map<String, GoblinGoods> goodsMap,
List<GoblinStoreMgtArtistTopicGoodsItemParams> paramsGoods) {
if (CollectionUtils.isEmpty(paramsGoods)) {
......@@ -788,7 +804,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
LinkedList<Object[]> topicObjs = CollectionUtil.linkedListObjectArr();
topicObjs.add(new Object[]{
topicVo.getTopicId(), topicVo.getStoreId(), topicVo.getTopicName(),
topicVo.getArtistId(), topicVo.getTemplateType(),
topicVo.getArtistId(), topicVo.getCustomAvatarUrl(), topicVo.getTemplateType(),
topicVo.getBannerUrl(), topicVo.getBannerHeight(),
topicVo.getOnSaleStart(), topicVo.getOnSaleEnd(),
topicVo.getStatus(), topicVo.getSort(), topicVo.getRecommendPosition(),
......@@ -824,6 +840,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
LinkedList<Object[]> topicObjs = CollectionUtil.linkedListObjectArr();
topicObjs.add(new Object[]{
params.getTopicName(), StringUtils.trimToNull(params.getArtistId()),
resolveCustomAvatarUrl(params.getArtistId(), params.getCustomAvatarUrl()),
params.getTemplateType(), params.getBannerUrl(),
params.getBannerHeight() == null ? GoblinArtistConst.DEFAULT_BANNER_HEIGHT : params.getBannerHeight(),
params.getOnSaleStart(), params.getOnSaleEnd(), now, topicId
......
......@@ -1604,6 +1604,12 @@ public class GoblinMongoUtils {
GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
}
public List<GoblinFrontBanner> getNewTopBanner() {
Query query = Query.query(Criteria.where("delTag").is(0).and("bannerType").is(3));
return mongoTemplate.find(query,
GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
}
public List<GoblinFrontHotWord> getHotWord() {
Query query = Query.query(Criteria.where("delTag").is(0));
return mongoTemplate.find(query,
......
......@@ -1868,6 +1868,15 @@ public class GoblinRedisUtils {
return vo;
}
public List<GoblinFrontBanner> getNewTopBanner() {
List<GoblinFrontBanner> vo = (List<GoblinFrontBanner>) redisUtil.get(GoblinRedisConst.FRONT_NEW_TOP_BANNER);
if (null == vo) {
//降级
return goblinMongoUtils.getNewTopBanner();
}
return vo;
}
// 热词降级
public List<GoblinFrontHotWord> getHotWord() {
List<GoblinFrontHotWord> vo = (List<GoblinFrontHotWord>) redisUtil.get(GoblinRedisConst.FRONT_HOTWORD);
......
......@@ -212,8 +212,8 @@ goblin_artist_auth_apply.revoke=UPDATE goblin_artist_auth_apply SET status=3,upd
goblin_artist_auth_apply.approve=UPDATE goblin_artist_auth_apply SET status=1,reviewer_id=?,reviewer_name=?,review_time=?,review_remark=?,auth_expire_at=?,updated_at=? WHERE apply_id=?
goblin_artist_auth_apply.reject=UPDATE goblin_artist_auth_apply SET status=2,reviewer_id=?,reviewer_name=?,review_time=?,reject_reason=?,updated_at=? WHERE apply_id=?
#---- \u827A\u4EBA\u4E13\u9898
goblin_artist_topic.insert=INSERT INTO goblin_artist_topic (topic_id,store_id,topic_name,artist_id,template_type,banner_url,banner_height,on_sale_start,on_sale_end,status,sort,recommend_position,del_flg,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_artist_topic.update=UPDATE goblin_artist_topic SET topic_name=?,artist_id=?,template_type=?,banner_url=?,banner_height=?,on_sale_start=?,on_sale_end=?,updated_at=? WHERE topic_id=?
goblin_artist_topic.insert=INSERT INTO goblin_artist_topic (topic_id,store_id,topic_name,artist_id,custom_avatar_url,template_type,banner_url,banner_height,on_sale_start,on_sale_end,status,sort,recommend_position,del_flg,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_artist_topic.update=UPDATE goblin_artist_topic SET topic_name=?,artist_id=?,custom_avatar_url=?,template_type=?,banner_url=?,banner_height=?,on_sale_start=?,on_sale_end=?,updated_at=? WHERE topic_id=?
goblin_artist_topic.delete=UPDATE goblin_artist_topic SET del_flg=1,updated_at=? WHERE topic_id=?
goblin_artist_topic.status=UPDATE goblin_artist_topic SET status=?,updated_at=? WHERE topic_id=?
#---- \u4E13\u9898\u5546\u54C1
......
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