记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
705bca25
Commit
705bca25
authored
Aug 20, 2026
by
wangyifan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-wyf-v1.8.0-goblin' into test
parents
2e46fe44
e0ea79d5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
244 additions
and
45 deletions
+244
-45
GoblinFrontBannerBuildParam.java
...net/service/goblin/param/GoblinFrontBannerBuildParam.java
+3
-3
GoblinFrontBannerController.java
...ntroller/zhengzai/goblin/GoblinFrontBannerController.java
+22
-0
topBanner.html
...resources/templates/zhengzai/store/homeSet/topBanner.html
+42
-23
FeignGoblinTaskClient.java
...dnet/service/feign/goblin/task/FeignGoblinTaskClient.java
+3
-0
GoblinTaskHandler.java
...dnet/service/executor/main/handler/GoblinTaskHandler.java
+14
-0
GoblinArtistTopicJobController.java
...blin/controller/Inner/GoblinArtistTopicJobController.java
+39
-0
GoblinArtistTopicJobServiceImpl.java
...n/service/impl/inner/GoblinArtistTopicJobServiceImpl.java
+101
-0
GoblinStoreMgtArtistServiceImpl.java
.../service/impl/manage/GoblinStoreMgtArtistServiceImpl.java
+20
-19
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinFrontBannerBuildParam.java
View file @
705bca25
...
@@ -38,7 +38,7 @@ public class GoblinFrontBannerBuildParam implements Serializable {
...
@@ -38,7 +38,7 @@ public class GoblinFrontBannerBuildParam implements Serializable {
/**
/**
* 排序
* 排序
*/
*/
@ApiModelProperty
(
value
=
"排序"
)
@ApiModelProperty
(
value
=
"排序"
,
required
=
true
)
private
Integer
indexs
;
private
Integer
indexs
;
/**
/**
...
@@ -50,14 +50,14 @@ public class GoblinFrontBannerBuildParam implements Serializable {
...
@@ -50,14 +50,14 @@ public class GoblinFrontBannerBuildParam implements Serializable {
/**
/**
* 开启时间
* 开启时间
*/
*/
@ApiModelProperty
(
value
=
"开启时间"
)
@ApiModelProperty
(
value
=
"开启时间"
,
required
=
true
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
startTime
;
private
LocalDateTime
startTime
;
/**
/**
* 结束时间
* 结束时间
*/
*/
@ApiModelProperty
(
value
=
"结束时间"
)
@ApiModelProperty
(
value
=
"结束时间"
,
required
=
true
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
endTime
;
private
LocalDateTime
endTime
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinFrontBannerController.java
View file @
705bca25
...
@@ -70,6 +70,28 @@ public class GoblinFrontBannerController extends BaseController {
...
@@ -70,6 +70,28 @@ public class GoblinFrontBannerController extends BaseController {
@ApiOperation
(
value
=
"修改或者增加banner"
)
@ApiOperation
(
value
=
"修改或者增加banner"
)
@ResponseBody
@ResponseBody
public
AjaxResult
updateOrCreate
(
@RequestBody
List
<
GoblinFrontBannerBuildParam
>
list
)
{
public
AjaxResult
updateOrCreate
(
@RequestBody
List
<
GoblinFrontBannerBuildParam
>
list
)
{
if
(
list
==
null
||
list
.
isEmpty
())
{
return
error
(
"请添加banner"
);
}
int
i
=
0
;
for
(
GoblinFrontBannerBuildParam
param
:
list
)
{
i
++;
if
(
param
.
getStartTime
()
==
null
)
{
return
error
(
"第"
+
i
+
"张banner请填写开启时间"
);
}
if
(
param
.
getEndTime
()
==
null
)
{
return
error
(
"第"
+
i
+
"张banner请填写结束时间"
);
}
if
(
param
.
getEndTime
().
isBefore
(
param
.
getStartTime
()))
{
return
error
(
"第"
+
i
+
"张banner结束时间不能早于开启时间"
);
}
// type=2 活动banner 页面隐藏了单项排序,不校验 indexs
if
(
param
.
getBannerType
()
==
null
||
param
.
getBannerType
()
!=
2
)
{
if
(
param
.
getIndexs
()
==
null
)
{
return
error
(
"第"
+
i
+
"张banner请填写排序"
);
}
}
}
List
<
GoblinFrontBanner
>
goblinFrontBannerList
=
new
ArrayList
<>();
List
<
GoblinFrontBanner
>
goblinFrontBannerList
=
new
ArrayList
<>();
for
(
GoblinFrontBannerBuildParam
goblinFrontBannerBuildParam1:
list
){
for
(
GoblinFrontBannerBuildParam
goblinFrontBannerBuildParam1:
list
){
GoblinFrontBanner
goblinFrontBanner
=
new
GoblinFrontBanner
();
GoblinFrontBanner
goblinFrontBanner
=
new
GoblinFrontBanner
();
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/store/homeSet/topBanner.html
View file @
705bca25
...
@@ -126,7 +126,7 @@
...
@@ -126,7 +126,7 @@
</div>
</div>
<div
class=
"function_btn"
id=
"showMiddleBanner"
style=
"display: none;"
>
<div
class=
"function_btn"
id=
"showMiddleBanner"
style=
"display: none;"
>
<div
class=
"hot_title"
>
<div
class=
"hot_title"
>
位置顺序:
位置顺序:
<span
style=
"color:#f5222d;"
>
*
</span>
</div>
</div>
<div
class=
"tags"
style=
"font-weight: 600;font-size: 16px;"
>
<div
class=
"tags"
style=
"font-weight: 600;font-size: 16px;"
>
<input
type=
"text"
class=
"layui-input form-control titleIpt"
id=
"sorting"
value=
""
autocomplete=
"off"
placeholder=
"请输入模块顺序"
>
<input
type=
"text"
class=
"layui-input form-control titleIpt"
id=
"sorting"
value=
""
autocomplete=
"off"
placeholder=
"请输入模块顺序"
>
...
@@ -270,19 +270,19 @@
...
@@ -270,19 +270,19 @@
<div class="set_function">
<div class="set_function">
<div class="set_function_time">
<div class="set_function_time">
<div class="title">
<div class="title">
时间设置:
时间设置:
<span style="color:#f5222d;">*</span>
</div>
</div>
<div class="select_tiem" style="display:flex;">
<div class="select_tiem" style="display:flex;">
<input type="text" class="layui-input form-control timeStart" id="startTime
${
i
+
1
}
" value="
${
data
[
i
].
startTime
||
''
}
" autocomplete="off" placeholder="
配置活动时间
">
<input type="text" class="layui-input form-control timeStart" id="startTime
${
i
+
1
}
" value="
${
data
[
i
].
startTime
||
''
}
" autocomplete="off" placeholder="
开始时间(必填)
">
<input type="text" class="layui-input form-control timeEnd" id="endTime
${
i
+
1
}
" value="
${
data
[
i
].
endTime
||
''
}
" autocomplete="off" placeholder="
配置活动时间
">
<input type="text" class="layui-input form-control timeEnd" id="endTime
${
i
+
1
}
" value="
${
data
[
i
].
endTime
||
''
}
" autocomplete="off" placeholder="
结束时间(必填)
">
</div>
</div>
</div>
</div>
<div class="set_function_time pxBox" style="width: 40%;">
<div class="set_function_time pxBox" style="width: 40%;">
<div class="title">
<div class="title">
排序:
排序:
<span style="color:#f5222d;">*</span>
</div>
</div>
<div class="select_tiem">
<div class="select_tiem">
<input id="px
${
i
+
1
}
" type="text" class="layui-input form-control px" value="
${
data
[
i
].
indexs
}
" placeholder="请输入顺序数字">
<input id="px
${
i
+
1
}
" type="text" class="layui-input form-control px" value="
${
data
[
i
].
indexs
}
" placeholder="请输入顺序数字
(必填)
">
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -359,19 +359,19 @@
...
@@ -359,19 +359,19 @@
<div class="set_function">
<div class="set_function">
<div class="set_function_time">
<div class="set_function_time">
<div class="title">
<div class="title">
时间设置:
时间设置:
<span style="color:#f5222d;">*</span>
</div>
</div>
<div class="select_tiem" style="display:flex;">
<div class="select_tiem" style="display:flex;">
<input type="text" class="layui-input form-control timeStart" id="startTime
${
num
}
" autocomplete="off" placeholder="
配置活动时间
">
<input type="text" class="layui-input form-control timeStart" id="startTime
${
num
}
" autocomplete="off" placeholder="
开始时间(必填)
">
<input type="text" class="layui-input form-control timeEnd" id="endTime
${
num
}
" autocomplete="off" placeholder="
配置活动时间
">
<input type="text" class="layui-input form-control timeEnd" id="endTime
${
num
}
" autocomplete="off" placeholder="
结束时间(必填)
">
</div>
</div>
</div>
</div>
<div class="set_function_time pxBox" style="width: 40%;">
<div class="set_function_time pxBox" style="width: 40%;">
<div class="title">
<div class="title">
排序:
排序:
<span style="color:#f5222d;">*</span>
</div>
</div>
<div class="select_tiem">
<div class="select_tiem">
<input id="px
${
num
}
" type="text" class="layui-input form-control px" placeholder="请输入顺序数字">
<input id="px
${
num
}
" type="text" class="layui-input form-control px" placeholder="请输入顺序数字
(必填)
">
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -385,24 +385,40 @@
...
@@ -385,24 +385,40 @@
}
}
}
}
function
save
()
{
function
save
()
{
let
obj
=
{};
let
itmeLength
=
$
(
".banner_item"
);
let
itmeLength
=
$
(
".banner_item"
);
if
(
!
itmeLength
.
length
)
{
let
data
=
[]
return
layer
.
msg
(
'请先添加banner'
);
Array
.
prototype
.
forEach
.
call
(
itmeLength
,
function
(
item
,
index
,
arr
)
{
}
let
data
=
[];
for
(
let
index
=
0
;
index
<
itmeLength
.
length
;
index
++
)
{
let
item
=
itmeLength
[
index
];
let
startTime
=
(
item
.
querySelector
(
'.timeStart'
).
value
||
''
).
trim
();
let
endTime
=
(
item
.
querySelector
(
'.timeEnd'
).
value
||
''
).
trim
();
let
indexs
=
(
item
.
querySelector
(
'.px'
).
value
||
''
).
trim
();
if
(
!
startTime
)
{
return
layer
.
msg
(
'请填写第'
+
(
index
+
1
)
+
'张banner的开始时间'
);
}
if
(
!
endTime
)
{
return
layer
.
msg
(
'请填写第'
+
(
index
+
1
)
+
'张banner的结束时间'
);
}
if
(
startTime
>
endTime
)
{
return
layer
.
msg
(
'第'
+
(
index
+
1
)
+
'张banner结束时间不能早于开始时间'
);
}
if
(
type
!=
2
&&
indexs
===
''
)
{
return
layer
.
msg
(
'请填写第'
+
(
index
+
1
)
+
'张banner的排序'
);
}
let
obj
=
{};
obj
.
activityUrl
=
item
.
querySelector
(
'.h5Url'
).
value
;
obj
.
activityUrl
=
item
.
querySelector
(
'.h5Url'
).
value
;
obj
.
bannerId
=
item
.
getAttribute
(
'data-id'
);
obj
.
bannerId
=
item
.
getAttribute
(
'data-id'
);
obj
.
bannerType
=
type
;
obj
.
bannerType
=
type
;
obj
.
createTime
=
item
.
getAttribute
(
'data-createTime'
);
obj
.
createTime
=
item
.
getAttribute
(
'data-createTime'
);
obj
.
delTag
=
'0'
;
obj
.
delTag
=
'0'
;
obj
.
endTime
=
item
.
getAttribute
(
'data-endTime'
);
obj
.
indexs
=
indexs
;
obj
.
indexs
=
item
.
querySelector
(
'.px'
).
value
;
obj
.
jumpType
=
item
.
querySelector
(
'#jumpSelect'
+
(
index
+
1
)
+
''
).
value
;
obj
.
jumpType
=
item
.
querySelector
(
'#jumpSelect'
+
(
index
+
1
)
+
''
).
value
;
obj
.
mid
=
item
.
getAttribute
(
'data-mid'
)
||
0
;
//
obj
.
mid
=
item
.
getAttribute
(
'data-mid'
)
||
0
;
obj
.
picUrl
=
item
.
querySelector
(
'.imgBox'
).
getAttribute
(
'src'
);
obj
.
picUrl
=
item
.
querySelector
(
'.imgBox'
).
getAttribute
(
'src'
);
obj
.
startTime
=
item
.
querySelector
(
'.timeStart'
).
value
;
obj
.
startTime
=
startTime
;
obj
.
endTime
=
item
.
querySelector
(
'.timeEnd'
).
value
;
obj
.
endTime
=
endTime
;
// obj.updateTime = item.getAttribute('data-upData');
if
(
item
.
querySelector
(
'#jumpSelect'
+
(
index
+
1
)
+
''
).
value
==
2
)
{
if
(
item
.
querySelector
(
'#jumpSelect'
+
(
index
+
1
)
+
''
).
value
==
2
)
{
obj
.
ticketId
=
item
.
querySelector
(
'.h5Url'
).
getAttribute
(
'data-id'
);
obj
.
ticketId
=
item
.
querySelector
(
'.h5Url'
).
getAttribute
(
'data-id'
);
obj
.
ticketName
=
item
.
querySelector
(
'.h5Url'
).
value
;
obj
.
ticketName
=
item
.
querySelector
(
'.h5Url'
).
value
;
...
@@ -413,8 +429,11 @@
...
@@ -413,8 +429,11 @@
obj
.
ticketId
=
item
.
querySelector
(
'.storeList'
).
getAttribute
(
'data-id'
);
obj
.
ticketId
=
item
.
querySelector
(
'.storeList'
).
getAttribute
(
'data-id'
);
obj
.
ticketName
=
item
.
querySelector
(
'.storeList'
).
value
;
obj
.
ticketName
=
item
.
querySelector
(
'.storeList'
).
value
;
}
}
data
.
push
({...
obj
})
data
.
push
(
obj
);
});
//foreach js6章封装的方法
}
if
(
type
==
2
&&
!
(
$
(
"#sorting"
).
val
()
||
''
).
trim
())
{
return
layer
.
msg
(
'请填写位置顺序'
);
}
promiseMethods
(
'/frontBanner/updateOrCreate'
,
'post'
,
JSON
.
stringify
(
data
),
'application/json'
).
then
(
res
=>
{
promiseMethods
(
'/frontBanner/updateOrCreate'
,
'post'
,
JSON
.
stringify
(
data
),
'application/json'
).
then
(
res
=>
{
if
(
type
==
2
)
{
if
(
type
==
2
)
{
let
data
=
{
let
data
=
{
...
...
liquidnet-bus-feign/liquidnet-api-feign-goblin/src/main/java/com/liquidnet/service/feign/goblin/task/FeignGoblinTaskClient.java
View file @
705bca25
...
@@ -33,4 +33,7 @@ public interface FeignGoblinTaskClient {
...
@@ -33,4 +33,7 @@ public interface FeignGoblinTaskClient {
@PostMapping
(
"rsc/job/sqb/autoRefund"
)
@PostMapping
(
"rsc/job/sqb/autoRefund"
)
ResponseDto
<
String
>
sqbAutoRefund
(
@RequestParam
(
value
=
"performancesId"
,
required
=
false
)
String
performancesId
);
ResponseDto
<
String
>
sqbAutoRefund
(
@RequestParam
(
value
=
"performancesId"
,
required
=
false
)
String
performancesId
);
@PostMapping
(
"rsc/job/artistTopic/offlineExpired"
)
ResponseDto
<
String
>
artistTopicOfflineExpired
();
}
}
liquidnet-bus-service/liquidnet-service-executor-all/liquidnet-service-executor-main/src/main/java/com/liquidnet/service/executor/main/handler/GoblinTaskHandler.java
View file @
705bca25
...
@@ -69,6 +69,20 @@ public class GoblinTaskHandler {
...
@@ -69,6 +69,20 @@ public class GoblinTaskHandler {
}
}
}
}
/**
* 艺人授权过期后自动下架 B 端已上架专题
* xxl-job 配置:JobHandler = sev-goblin:artistTopicOfflineExpired;建议 CRON 0 0/10 * * * ?;无任务参数
*/
@XxlJob
(
value
=
"sev-goblin:artistTopicOfflineExpired"
)
public
void
artistTopicOfflineExpired
()
{
try
{
XxlJobHelper
.
handleSuccess
(
"结果:"
+
feignGoblinTaskClient
.
artistTopicOfflineExpired
().
getData
());
}
catch
(
Exception
e
)
{
XxlJobHelper
.
log
(
e
);
XxlJobHelper
.
handleFail
();
}
}
/**
/**
* 演出结束自动退款 / 退款中超8小时卡单重试
* 演出结束自动退款 / 退款中超8小时卡单重试
* xxl-job 配置:JobHandler = sev-goblin:sqbAutoRefund;参数为演出ID、或 performancesId=xxx;空则走 goblin 全库候选(慎用)
* xxl-job 配置:JobHandler = sev-goblin:sqbAutoRefund;参数为演出ID、或 performancesId=xxx;空则走 goblin 全库候选(慎用)
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/Inner/GoblinArtistTopicJobController.java
0 → 100644
View file @
705bca25
package
com
.
liquidnet
.
service
.
goblin
.
controller
.
Inner
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.service.impl.inner.GoblinArtistTopicJobServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 艺人专题定时任务入口(供 executor 服务通过 Feign 调用)
*
* xxl-job 配置说明:
* - 在 xxl-job 平台新增定时任务
* - JobHandler:sev-goblin:artistTopicOfflineExpired(接口走 rsc/** 免登录,与 NFT/收钱吧 job 一致)
* - CRON:建议每 10 分钟 0 0/10 * * * ?
* - 执行器:liquidnet-service-executor
* - 任务参数:无
* - 路由策略:第一个
*/
@Slf4j
@Api
(
tags
=
"艺人专题定时任务"
)
@RestController
@RequestMapping
(
"/rsc/job/artistTopic"
)
public
class
GoblinArtistTopicJobController
{
@Autowired
private
GoblinArtistTopicJobServiceImpl
goblinArtistTopicJobService
;
@PostMapping
(
"/offlineExpired"
)
@ApiOperation
(
"授权过期自动下架已上架专题(同一店铺+艺人无未过期新授权时)"
)
public
ResponseDto
<
String
>
offlineExpired
()
{
log
.
info
(
"[艺人专题过期下架] 收到任务"
);
return
goblinArtistTopicJobService
.
offlineExpired
();
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/inner/GoblinArtistTopicJobServiceImpl.java
0 → 100644
View file @
705bca25
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
inner
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.goblin.constant.GoblinArtistConst
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.dto.vo.GoblinArtistAuthApplyVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinArtistTopicVo
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.Collections
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* 艺人授权过期后,自动将对应已上架专题改为下架
*/
@Slf4j
@Service
public
class
GoblinArtistTopicJobServiceImpl
{
@Autowired
private
MongoTemplate
mongoTemplate
;
@Autowired
private
GoblinRedisUtils
goblinRedisUtils
;
@Autowired
private
QueueUtils
queueUtils
;
public
ResponseDto
<
String
>
offlineExpired
()
{
LocalDateTime
now
=
LocalDateTime
.
now
();
Set
<
String
>
validKeys
=
loadValidAuthKeys
(
now
);
List
<
GoblinArtistTopicVo
>
onlineTopics
=
mongoTemplate
.
find
(
new
Query
(
Criteria
.
where
(
"status"
).
is
(
GoblinArtistConst
.
TOPIC_ONLINE
)
.
and
(
"delFlg"
).
is
(
GoblinArtistConst
.
DEL_NO
)
.
and
(
"artistId"
).
exists
(
true
).
ne
(
""
)),
GoblinArtistTopicVo
.
class
,
GoblinArtistTopicVo
.
class
.
getSimpleName
());
if
(
onlineTopics
==
null
||
onlineTopics
.
isEmpty
())
{
return
ResponseDto
.
success
(
"无已上架专题"
);
}
List
<
GoblinArtistTopicVo
>
toOffline
=
onlineTopics
.
stream
()
.
filter
(
t
->
StringUtils
.
isNotBlank
(
t
.
getTopicId
()))
.
filter
(
t
->
StringUtils
.
isNotBlank
(
t
.
getArtistId
()))
.
filter
(
t
->
!
validKeys
.
contains
(
t
.
getStoreId
()
+
"_"
+
t
.
getArtistId
()))
.
collect
(
Collectors
.
toList
());
if
(
toOffline
.
isEmpty
())
{
return
ResponseDto
.
success
(
"无需要下架的专题"
);
}
List
<
String
>
topicIds
=
toOffline
.
stream
()
.
map
(
GoblinArtistTopicVo:
:
getTopicId
)
.
collect
(
Collectors
.
toList
());
mongoTemplate
.
updateMulti
(
new
Query
(
Criteria
.
where
(
"topicId"
).
in
(
topicIds
)),
new
Update
().
set
(
"status"
,
GoblinArtistConst
.
TOPIC_OFFLINE
).
set
(
"updatedAt"
,
now
),
GoblinArtistTopicVo
.
class
.
getSimpleName
());
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlObjs
=
CollectionUtil
.
linkedListObjectArr
();
for
(
String
topicId
:
topicIds
)
{
goblinRedisUtils
.
del
(
GoblinRedisConst
.
ARTIST_TOPIC
+
topicId
);
sqls
.
add
(
SqlMapping
.
get
(
"goblin_artist_topic.status"
));
sqlObjs
.
add
(
new
Object
[]{
GoblinArtistConst
.
TOPIC_OFFLINE
,
now
,
topicId
});
}
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_STORE
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlObjs
));
log
.
info
(
"[艺人专题过期下架] 下架 {} 个专题, topicIds={}"
,
topicIds
.
size
(),
topicIds
);
return
ResponseDto
.
success
(
"下架"
+
topicIds
.
size
()
+
"个专题"
);
}
/** 仍有效授权:申请已通过且未过期 */
private
Set
<
String
>
loadValidAuthKeys
(
LocalDateTime
now
)
{
List
<
GoblinArtistAuthApplyVo
>
auths
=
mongoTemplate
.
find
(
new
Query
(
Criteria
.
where
(
"status"
).
is
(
GoblinArtistConst
.
APPLY_APPROVED
)
.
and
(
"authExpireAt"
).
gt
(
now
)),
GoblinArtistAuthApplyVo
.
class
,
GoblinArtistAuthApplyVo
.
class
.
getSimpleName
());
if
(
auths
==
null
||
auths
.
isEmpty
())
{
return
Collections
.
emptySet
();
}
return
auths
.
stream
()
.
filter
(
a
->
StringUtils
.
isNotBlank
(
a
.
getStoreId
())
&&
StringUtils
.
isNotBlank
(
a
.
getArtistId
()))
.
map
(
a
->
a
.
getStoreId
()
+
"_"
+
a
.
getArtistId
())
.
collect
(
Collectors
.
toSet
());
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtArtistServiceImpl.java
View file @
705bca25
...
@@ -27,8 +27,6 @@ import com.liquidnet.service.goblin.dto.vo.GoblinArtistAuthApplyVo;
...
@@ -27,8 +27,6 @@ import com.liquidnet.service.goblin.dto.vo.GoblinArtistAuthApplyVo;
import
com.liquidnet.service.goblin.dto.vo.GoblinArtistTopicVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinArtistTopicVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo
;
import
com.liquidnet.service.goblin.entity.GoblinGoods
;
import
com.liquidnet.service.goblin.mapper.GoblinGoodsMapper
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtArtistService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtArtistService
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
...
@@ -72,8 +70,6 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -72,8 +70,6 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
@Autowired
@Autowired
private
QueueUtils
queueUtils
;
private
QueueUtils
queueUtils
;
@Autowired
@Autowired
private
GoblinGoodsMapper
goodsMapper
;
@Autowired
private
KylinArtistMapper
kylinArtistMapper
;
private
KylinArtistMapper
kylinArtistMapper
;
private
ResponseDto
<
GoblinStoreInfoVo
>
requireStore
()
{
private
ResponseDto
<
GoblinStoreInfoVo
>
requireStore
()
{
...
@@ -396,14 +392,14 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -396,14 +392,14 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
.
map
(
GoblinArtistTopicVo
.
GoodsItem
::
getSpuId
)
.
map
(
GoblinArtistTopicVo
.
GoodsItem
::
getSpuId
)
.
filter
(
StringUtils:
:
isNotBlank
)
.
filter
(
StringUtils:
:
isNotBlank
)
.
collect
(
Collectors
.
toSet
());
.
collect
(
Collectors
.
toSet
());
Map
<
String
,
GoblinGoods
>
goodsMap
=
loadGoodsMapBySpuIds
(
spuIds
);
Map
<
String
,
GoblinGoods
InfoVo
>
goodsMap
=
loadGoodsMapBySpuIds
(
spuIds
);
for
(
GoblinArtistTopicVo
.
GoodsItem
goods
:
topic
.
getGoods
())
{
for
(
GoblinArtistTopicVo
.
GoodsItem
goods
:
topic
.
getGoods
())
{
GoblinStoreMgtArtistTopicDetailVo
.
GoodsItem
item
=
new
GoblinStoreMgtArtistTopicDetailVo
.
GoodsItem
();
GoblinStoreMgtArtistTopicDetailVo
.
GoodsItem
item
=
new
GoblinStoreMgtArtistTopicDetailVo
.
GoodsItem
();
item
.
setSpuId
(
goods
.
getSpuId
());
item
.
setSpuId
(
goods
.
getSpuId
());
item
.
setSort
(
goods
.
getSort
());
item
.
setSort
(
goods
.
getSort
());
item
.
setName
(
goods
.
getName
());
item
.
setName
(
goods
.
getName
());
item
.
setCoverPic
(
goods
.
getCoverPic
());
item
.
setCoverPic
(
goods
.
getCoverPic
());
GoblinGoods
dbGoods
=
goodsMap
.
get
(
goods
.
getSpuId
());
GoblinGoods
InfoVo
dbGoods
=
goodsMap
.
get
(
goods
.
getSpuId
());
if
(
dbGoods
!=
null
)
{
if
(
dbGoods
!=
null
)
{
item
.
setName
(
dbGoods
.
getName
());
item
.
setName
(
dbGoods
.
getName
());
item
.
setCoverPic
(
dbGoods
.
getCoverPic
());
item
.
setCoverPic
(
dbGoods
.
getCoverPic
());
...
@@ -470,7 +466,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -470,7 +466,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
topicVo
.
setCreatedAt
(
now
);
topicVo
.
setCreatedAt
(
now
);
topicVo
.
setUpdatedAt
(
now
);
topicVo
.
setUpdatedAt
(
now
);
Map
<
String
,
GoblinGoods
>
goodsMap
=
loadGoodsMap
(
params
.
getGoods
());
Map
<
String
,
GoblinGoods
InfoVo
>
goodsMap
=
loadGoodsMap
(
params
.
getGoods
());
List
<
GoblinArtistTopicVo
.
GoodsItem
>
goodsItems
=
buildGoodsItems
(
params
.
getGoods
(),
goodsMap
);
List
<
GoblinArtistTopicVo
.
GoodsItem
>
goodsItems
=
buildGoodsItems
(
params
.
getGoods
(),
goodsMap
);
ResponseDto
<
Void
>
goodsCheck
=
checkGoodsBelong
(
storeId
,
goodsMap
,
params
.
getGoods
());
ResponseDto
<
Void
>
goodsCheck
=
checkGoodsBelong
(
storeId
,
goodsMap
,
params
.
getGoods
());
if
(!
goodsCheck
.
isSuccess
())
{
if
(!
goodsCheck
.
isSuccess
())
{
...
@@ -523,7 +519,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -523,7 +519,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
}
}
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
Map
<
String
,
GoblinGoods
>
goodsMap
=
loadGoodsMap
(
params
.
getGoods
());
Map
<
String
,
GoblinGoods
InfoVo
>
goodsMap
=
loadGoodsMap
(
params
.
getGoods
());
ResponseDto
<
Void
>
goodsCheck
=
checkGoodsBelong
(
storeId
,
goodsMap
,
params
.
getGoods
());
ResponseDto
<
Void
>
goodsCheck
=
checkGoodsBelong
(
storeId
,
goodsMap
,
params
.
getGoods
());
if
(!
goodsCheck
.
isSuccess
())
{
if
(!
goodsCheck
.
isSuccess
())
{
return
ResponseDto
.
failure
(
goodsCheck
.
getMessage
());
return
ResponseDto
.
failure
(
goodsCheck
.
getMessage
());
...
@@ -681,14 +677,14 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -681,14 +677,14 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
return
StringUtils
.
trimToNull
(
customAvatarUrl
);
return
StringUtils
.
trimToNull
(
customAvatarUrl
);
}
}
private
ResponseDto
<
Void
>
checkGoodsBelong
(
String
storeId
,
Map
<
String
,
GoblinGoods
>
goodsMap
,
private
ResponseDto
<
Void
>
checkGoodsBelong
(
String
storeId
,
Map
<
String
,
GoblinGoods
InfoVo
>
goodsMap
,
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
paramsGoods
)
{
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
paramsGoods
)
{
if
(
CollectionUtils
.
isEmpty
(
paramsGoods
))
{
if
(
CollectionUtils
.
isEmpty
(
paramsGoods
))
{
return
ResponseDto
.
success
(
null
);
return
ResponseDto
.
success
(
null
);
}
}
for
(
GoblinStoreMgtArtistTopicGoodsItemParams
item
:
paramsGoods
)
{
for
(
GoblinStoreMgtArtistTopicGoodsItemParams
item
:
paramsGoods
)
{
if
(
StringUtils
.
isBlank
(
item
.
getSpuId
()))
continue
;
if
(
StringUtils
.
isBlank
(
item
.
getSpuId
()))
continue
;
GoblinGoods
goods
=
goodsMap
.
get
(
item
.
getSpuId
());
GoblinGoods
InfoVo
goods
=
goodsMap
.
get
(
item
.
getSpuId
());
if
(
goods
==
null
||
!
Objects
.
equals
(
goods
.
getStoreId
(),
storeId
)
if
(
goods
==
null
||
!
Objects
.
equals
(
goods
.
getStoreId
(),
storeId
)
||
!
Objects
.
equals
(
goods
.
getDelFlg
(),
"0"
))
{
||
!
Objects
.
equals
(
goods
.
getDelFlg
(),
"0"
))
{
return
ResponseDto
.
failure
(
"存在非本店或已删除商品"
);
return
ResponseDto
.
failure
(
"存在非本店或已删除商品"
);
...
@@ -735,7 +731,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -735,7 +731,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
// ======================== 私有:商品 / 艺人 Map ========================
// ======================== 私有:商品 / 艺人 Map ========================
private
Map
<
String
,
GoblinGoods
>
loadGoodsMap
(
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
goods
)
{
private
Map
<
String
,
GoblinGoods
InfoVo
>
loadGoodsMap
(
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
goods
)
{
if
(
CollectionUtils
.
isEmpty
(
goods
))
{
if
(
CollectionUtils
.
isEmpty
(
goods
))
{
return
Collections
.
emptyMap
();
return
Collections
.
emptyMap
();
}
}
...
@@ -744,22 +740,27 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -744,22 +740,27 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
return
loadGoodsMapBySpuIds
(
spuIds
);
return
loadGoodsMapBySpuIds
(
spuIds
);
}
}
private
Map
<
String
,
GoblinGoods
>
loadGoodsMapBySpuIds
(
Set
<
String
>
spuIds
)
{
private
Map
<
String
,
GoblinGoods
InfoVo
>
loadGoodsMapBySpuIds
(
Set
<
String
>
spuIds
)
{
if
(
CollectionUtils
.
isEmpty
(
spuIds
))
{
if
(
CollectionUtils
.
isEmpty
(
spuIds
))
{
return
Collections
.
emptyMap
();
return
Collections
.
emptyMap
();
}
}
List
<
GoblinGoods
>
list
=
goodsMapper
.
selectList
(
new
LambdaQueryWrapper
<
GoblinGoods
>()
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
.
in
(
GoblinGoods:
:
getSpuId
,
spuIds
));
new
Query
(
Criteria
.
where
(
"spuId"
).
in
(
spuIds
)),
Map
<
String
,
GoblinGoods
>
map
=
new
HashMap
<>();
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
for
(
GoblinGoods
g
:
list
)
{
Map
<
String
,
GoblinGoodsInfoVo
>
map
=
new
HashMap
<>();
map
.
put
(
g
.
getSpuId
(),
g
);
if
(
list
!=
null
)
{
for
(
GoblinGoodsInfoVo
g
:
list
)
{
if
(
g
!=
null
&&
StringUtils
.
isNotBlank
(
g
.
getSpuId
()))
{
map
.
put
(
g
.
getSpuId
(),
g
);
}
}
}
}
return
map
;
return
map
;
}
}
private
List
<
GoblinArtistTopicVo
.
GoodsItem
>
buildGoodsItems
(
private
List
<
GoblinArtistTopicVo
.
GoodsItem
>
buildGoodsItems
(
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
paramsGoods
,
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
paramsGoods
,
Map
<
String
,
GoblinGoods
>
goodsMap
)
{
Map
<
String
,
GoblinGoods
InfoVo
>
goodsMap
)
{
List
<
GoblinArtistTopicVo
.
GoodsItem
>
items
=
new
ArrayList
<>();
List
<
GoblinArtistTopicVo
.
GoodsItem
>
items
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
paramsGoods
))
{
if
(
CollectionUtils
.
isEmpty
(
paramsGoods
))
{
return
items
;
return
items
;
...
@@ -770,7 +771,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -770,7 +771,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
GoblinArtistTopicVo
.
GoodsItem
item
=
new
GoblinArtistTopicVo
.
GoodsItem
();
GoblinArtistTopicVo
.
GoodsItem
item
=
new
GoblinArtistTopicVo
.
GoodsItem
();
item
.
setSpuId
(
p
.
getSpuId
());
item
.
setSpuId
(
p
.
getSpuId
());
item
.
setSort
(
p
.
getSort
()
==
null
?
index
:
p
.
getSort
());
item
.
setSort
(
p
.
getSort
()
==
null
?
index
:
p
.
getSort
());
GoblinGoods
goods
=
goodsMap
.
get
(
p
.
getSpuId
());
GoblinGoods
InfoVo
goods
=
goodsMap
.
get
(
p
.
getSpuId
());
if
(
goods
!=
null
)
{
if
(
goods
!=
null
)
{
item
.
setName
(
goods
.
getName
());
item
.
setName
(
goods
.
getName
());
item
.
setCoverPic
(
goods
.
getCoverPic
());
item
.
setCoverPic
(
goods
.
getCoverPic
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment