记得上下班打卡 | 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
51f1f38b
Commit
51f1f38b
authored
Mar 03, 2026
by
wangyifan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 修复修改艺人图片不展示问题 2. 艺人关联演出列表
parent
4575268b
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
268 additions
and
84 deletions
+268
-84
ArtistVo.java
...ain/java/com/liquidnet/service/kylin/dto/vo/ArtistVo.java
+6
-0
IKylinArtistService.java
...dnet/service/kylin/service/admin/IKylinArtistService.java
+19
-0
KylinArtistController.java
.../web/controller/zhengzai/kylin/KylinArtistController.java
+6
-6
create.html
...ain/resources/templates/zhengzai/kylin/artist/create.html
+20
-5
update.html
...ain/resources/templates/zhengzai/kylin/artist/update.html
+159
-47
KylinArtistServiceImpl.java
...n/zhengzai/kylin/service/impl/KylinArtistServiceImpl.java
+19
-2
KylinArtistDao.java
.../java/com/liquidnet/service/kylin/dao/KylinArtistDao.java
+1
-1
KylinArtistPerformanceDao.java
...iquidnet/service/kylin/dao/KylinArtistPerformanceDao.java
+10
-20
KylinArtistPerformance.java
...iquidnet/service/kylin/entity/KylinArtistPerformance.java
+5
-0
KylinArtistPerformanceMapper.java
...et/service/kylin/mapper/KylinArtistPerformanceMapper.java
+1
-1
KylinArtistMapper.xml
.../com.liquidnet.service.kylin.mapper/KylinArtistMapper.xml
+3
-1
KylinArtistPerformanceMapper.xml
...net.service.kylin.mapper/KylinArtistPerformanceMapper.xml
+19
-1
No files found.
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/ArtistVo.java
View file @
51f1f38b
...
...
@@ -69,6 +69,12 @@ public class ArtistVo {
@ApiModelProperty
(
"演出开始时间"
)
private
String
timeStart
;
@ApiModelProperty
(
"场次ID"
)
private
String
timesId
;
@ApiModelProperty
(
"场次名称"
)
private
String
timeTitle
;
}
@Data
...
...
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/service/admin/IKylinArtistService.java
View file @
51f1f38b
package
com
.
liquidnet
.
service
.
kylin
.
service
.
admin
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.service.kylin.dao.KylinArtistDao
;
import
com.liquidnet.service.kylin.dto.param.ArtistParam
;
import
com.liquidnet.service.kylin.dto.param.ArtistSearchParam
;
import
com.liquidnet.service.kylin.dto.vo.ArtistVo
;
import
com.liquidnet.service.kylin.entity.KylinArtist
;
import
java.util.List
;
/**
* <p>
* 艺人管理 服务类
...
...
@@ -13,4 +20,16 @@ import com.liquidnet.service.kylin.entity.KylinArtist;
*/
public
interface
IKylinArtistService
extends
IService
<
KylinArtist
>
{
Boolean
create
(
ArtistParam
param
);
Boolean
update
(
ArtistParam
param
);
ArtistVo
detail
(
String
artistId
);
PageInfo
<
KylinArtistDao
>
artistList
(
ArtistSearchParam
param
);
Boolean
delete
(
List
<
String
>
artistIds
);
Boolean
checkArtistNameExists
(
String
artistName
,
String
artistId
);
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/KylinArtistController.java
View file @
51f1f38b
...
...
@@ -6,11 +6,11 @@ import com.liquidnet.client.admin.common.core.controller.BaseController;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.common.enums.BusinessType
;
import
com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinArtistServiceImpl
;
import
com.liquidnet.service.kylin.dao.KylinArtistDao
;
import
com.liquidnet.service.kylin.dto.param.ArtistParam
;
import
com.liquidnet.service.kylin.dto.param.ArtistSearchParam
;
import
com.liquidnet.service.kylin.dto.vo.ArtistVo
;
import
com.liquidnet.service.kylin.service.admin.IKylinArtistService
;
import
io.swagger.annotations.Api
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -40,7 +40,7 @@ public class KylinArtistController extends BaseController {
private
String
platformUrl
;
@Autowired
private
KylinArtistServiceImpl
kylinArtistService
;
private
IKylinArtistService
kylinArtistService
;
@GetMapping
(
"/create"
)
@RequiresPermissions
(
"kylin:artist:create"
)
...
...
@@ -95,8 +95,8 @@ public class KylinArtistController extends BaseController {
if
(
albumImagesJson
!=
null
&&
!
albumImagesJson
.
isEmpty
()
&&
!
albumImagesJson
.
equals
(
"[]"
))
{
try
{
com
.
fasterxml
.
jackson
.
databind
.
ObjectMapper
mapper
=
new
com
.
fasterxml
.
jackson
.
databind
.
ObjectMapper
();
List
<
String
>
albumImages
=
mapper
.
readValue
(
albumImagesJson
,
mapper
.
getTypeFactory
().
constructCollectionType
(
List
.
class
,
String
.
class
));
List
<
String
>
albumImages
=
mapper
.
readValue
(
albumImagesJson
,
mapper
.
getTypeFactory
().
constructCollectionType
(
List
.
class
,
String
.
class
));
param
.
setAlbumImages
(
albumImages
);
}
catch
(
Exception
e
)
{
return
error
(
"相册图片数据格式错误"
);
...
...
@@ -127,8 +127,8 @@ public class KylinArtistController extends BaseController {
if
(
albumImagesJson
!=
null
&&
!
albumImagesJson
.
isEmpty
()
&&
!
albumImagesJson
.
equals
(
"[]"
))
{
try
{
com
.
fasterxml
.
jackson
.
databind
.
ObjectMapper
mapper
=
new
com
.
fasterxml
.
jackson
.
databind
.
ObjectMapper
();
List
<
String
>
albumImages
=
mapper
.
readValue
(
albumImagesJson
,
mapper
.
getTypeFactory
().
constructCollectionType
(
List
.
class
,
String
.
class
));
List
<
String
>
albumImages
=
mapper
.
readValue
(
albumImagesJson
,
mapper
.
getTypeFactory
().
constructCollectionType
(
List
.
class
,
String
.
class
));
param
.
setAlbumImages
(
albumImages
);
}
catch
(
Exception
e
)
{
return
error
(
"相册图片数据格式错误"
);
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/artist/create.html
View file @
51f1f38b
...
...
@@ -204,11 +204,12 @@
"buckType"
:
1
},
autoReplace
:
true
,
dropZoneTitle
:
"请上传艺人头像(1:1比例)"
,
dropZoneTitle
:
"请上传艺人头像(1:1比例
,仅限1张
)"
,
maxFileCount
:
1
,
maxFileSize
:
5120
,
allowedFileExtensions
:
[
'jpg'
,
'png'
,
'jpeg'
],
msgSizeTooLarge
:
'文件 "{name}" ({size} KB) 超过了允许大小 {maxSize} KB,最大支持上传5M文件'
msgSizeTooLarge
:
'文件 "{name}" ({size} KB) 超过了允许大小 {maxSize} KB,最大支持上传5M文件'
,
msgFilesTooMany
:
'只能上传1张头像图片!'
});
$
(
"#fileinput-avatar"
).
on
(
"fileuploaded"
,
function
(
event
,
data
,
previewId
,
index
)
{
...
...
@@ -225,11 +226,25 @@
"pathName"
:
"artist/album"
,
"buckType"
:
1
},
dropZoneTitle
:
"请上传艺人相册图片"
,
maxFileCount
:
20
,
uploadAsync
:
true
,
// 异步上传,每次上传一个文件
dropZoneTitle
:
"请上传艺人相册图片(最多20张)"
,
maxFileCount
:
20
,
// 最多20张
maxFileSize
:
5120
,
allowedFileExtensions
:
[
'jpg'
,
'png'
,
'jpeg'
],
msgSizeTooLarge
:
'文件 "{name}" ({size} KB) 超过了允许大小 {maxSize} KB,最大支持上传5M文件'
msgSizeTooLarge
:
'文件 "{name}" ({size} KB) 超过了允许大小 {maxSize} KB,最大支持上传5M文件'
,
msgFilesTooMany
:
'选择的文件数量({n})超过了允许的最大数量{m},相册最多只能上传20张图片!'
,
showRemove
:
true
,
showUpload
:
false
,
validateInitialCount
:
true
,
maxTotalFileCount
:
20
}).
on
(
'filebatchselected'
,
function
(
event
,
files
)
{
// 检查选择的文件数量
var
currentCount
=
$
(
"#fileinput-album"
).
fileinput
(
'getFilesCount'
);
console
.
log
(
"当前文件总数:"
,
currentCount
);
if
(
currentCount
>
20
)
{
$
.
modal
.
alertWarning
(
"相册最多只能上传20张图片!"
);
return
false
;
}
});
$
(
"#fileinput-album"
).
on
(
"fileuploaded"
,
function
(
event
,
data
,
previewId
,
index
)
{
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/artist/update.html
View file @
51f1f38b
...
...
@@ -57,7 +57,7 @@
<label
class=
"col-sm-2 control-label"
>
艺人相册:
</label>
<div
class=
"col-sm-10"
>
<div
class=
"file-loading"
>
<input
id=
"fileinput-album"
type=
"file"
name=
"file
s
"
multiple
data-browse-on-zone-click=
"true"
>
<input
id=
"fileinput-album"
type=
"file"
name=
"file"
multiple
data-browse-on-zone-click=
"true"
>
</div>
<span
class=
"help-block m-b-none"
><i
class=
"fa fa-info-circle"
></i>
支持上传jpg、png格式图片,单次最多上传20张,每张最大支持5M
</span>
</div>
...
...
@@ -69,10 +69,37 @@
<th:block
th:include=
"include :: summernote-js"
/>
<script
th:inline=
"javascript"
>
var
prefix
=
ctx
+
"kylin/artist"
;
var
platformUrl
=
"[[${platformUrl}]]"
;
var
artistData
=
[[
$
{
ArtistVo
}]];
var
platformUrl
=
/*[[${platformUrl}]]*/
""
;
// 使用安全的方式获取数据,避免JavaScript语法错误
var
artistData
=
{
artistId
:
/*[[${ArtistVo?.artistId}]]*/
""
,
artistName
:
/*[[${ArtistVo?.artistName}]]*/
""
,
artistType
:
/*[[${ArtistVo?.artistType}]]*/
0
,
avatarUrl
:
/*[[${ArtistVo?.avatarUrl}]]*/
""
,
introduction
:
/*[[${ArtistVo?.introduction}]]*/
""
,
albumImages
:
/*[[${ArtistVo?.albumImages}]]*/
[]
};
var
albumImagesList
=
[];
var
originalArtistName
=
artistData
.
artistName
;
var
originalArtistName
=
""
;
console
.
log
(
"原始艺人数据:"
,
artistData
);
// 安全地获取艺人数据
if
(
artistData
)
{
originalArtistName
=
artistData
.
artistName
||
""
;
// 初始化相册图片列表
if
(
artistData
.
albumImages
&&
Array
.
isArray
(
artistData
.
albumImages
)
&&
artistData
.
albumImages
.
length
>
0
)
{
albumImagesList
=
artistData
.
albumImages
.
slice
();
// 复制数组
console
.
log
(
"初始化相册图片列表:"
,
albumImagesList
);
}
else
{
console
.
log
(
"没有相册图片数据"
);
}
}
else
{
console
.
error
(
"艺人数据为空"
);
}
function
submitHandler
()
{
var
artistName
=
$
(
'#artistName'
).
val
().
trim
();
...
...
@@ -138,7 +165,36 @@
return
false
;
}
var
albumImagesJson
=
JSON
.
stringify
(
albumImagesList
);
// 重新构建最终的相册列表
// 方案:遍历当前显示的所有预览图,提取图片URL
var
finalAlbumList
=
[];
// 获取所有预览框
var
previews
=
$
(
"#fileinput-album"
).
parent
().
find
(
'.file-preview-frame'
);
previews
.
each
(
function
()
{
var
$preview
=
$
(
this
);
// 检查是否是初始预览(有data-fileindex属性)
if
(
$preview
.
attr
(
'data-fileindex'
)
!==
undefined
)
{
var
fileIndex
=
parseInt
(
$preview
.
attr
(
'data-fileindex'
));
if
(
fileIndex
>=
0
&&
fileIndex
<
albumImagesList
.
length
)
{
finalAlbumList
.
push
(
albumImagesList
[
fileIndex
]);
}
}
else
{
// 新上传的图片,从img标签获取src
var
imgSrc
=
$preview
.
find
(
'img'
).
attr
(
'src'
);
if
(
imgSrc
&&
imgSrc
.
indexOf
(
'https://img.zhengzai.tv/'
)
===
0
)
{
finalAlbumList
.
push
(
imgSrc
);
}
}
});
// 如果上面的方法没有获取到,使用albumImagesList作为备份
if
(
finalAlbumList
.
length
===
0
&&
albumImagesList
.
length
>
0
)
{
finalAlbumList
=
albumImagesList
.
slice
();
}
console
.
log
(
"最终相册列表:"
,
finalAlbumList
);
var
albumImagesJson
=
JSON
.
stringify
(
finalAlbumList
);
if
(
$
.
validate
.
form
())
{
var
data
=
$
(
'#form-artist-edit'
).
serializeArray
();
...
...
@@ -149,6 +205,10 @@
}
$
(
function
()
{
console
.
log
(
"页面加载完成"
);
console
.
log
(
"艺人数据:"
,
artistData
);
console
.
log
(
"相册图片列表:"
,
albumImagesList
);
// 初始化字数统计
var
nameLength
=
$
(
'#artistName'
).
val
().
length
;
$
(
'#nameCount'
).
text
(
nameLength
);
...
...
@@ -189,27 +249,13 @@
});
// 设置富文本内容
if
(
artistData
.
introduction
)
{
if
(
artistData
&&
artistData
.
introduction
)
{
$
(
'#introduction'
).
summernote
(
'code'
,
artistData
.
introduction
);
}
// 初始化相册图片列表
if
(
artistData
.
albumImages
&&
artistData
.
albumImages
.
length
>
0
)
{
albumImagesList
=
artistData
.
albumImages
;
}
// 初始化头像上传
var
avatarInitialPreview
=
[];
var
avatarInitialPreviewConfig
=
[];
if
(
artistData
.
avatarUrl
)
{
avatarInitialPreview
.
push
(
artistData
.
avatarUrl
);
avatarInitialPreviewConfig
.
push
({
caption
:
"当前头像"
,
url
:
"#"
,
key
:
1
});
}
console
.
log
(
"头像URL:"
,
artistData
?
artistData
.
avatarUrl
:
"无数据"
);
$
(
"#fileinput-avatar"
).
fileinput
({
'theme'
:
'explorer-fas'
,
'uploadUrl'
:
platformUrl
+
"/platform/basicServices/alOss/upload/unsm"
,
...
...
@@ -218,36 +264,58 @@
"buckType"
:
1
},
autoReplace
:
true
,
initialPreview
:
avatarInitialPreview
,
overwriteInitial
:
false
,
initialPreviewAsData
:
true
,
initialPreviewConfig
:
avatarInitialPreviewConfig
,
dropZoneTitle
:
"请上传艺人头像(1:1比例)"
,
initialPreview
:
(
artistData
&&
artistData
.
avatarUrl
)
?
[
artistData
.
avatarUrl
]
:
[],
initialPreviewConfig
:
(
artistData
&&
artistData
.
avatarUrl
)
?
[{
caption
:
"当前头像"
,
size
:
0
,
width
:
"120px"
,
key
:
1
,
extra
:
{
url
:
artistData
.
avatarUrl
}
}]
:
[],
dropZoneTitle
:
"请上传艺人头像(1:1比例,仅限1张)"
,
maxFileCount
:
1
,
maxFileSize
:
5120
,
allowedFileExtensions
:
[
'jpg'
,
'png'
,
'jpeg'
],
msgSizeTooLarge
:
'文件 "{name}" ({size} KB) 超过了允许大小 {maxSize} KB,最大支持上传5M文件'
msgSizeTooLarge
:
'文件 "{name}" ({size} KB) 超过了允许大小 {maxSize} KB,最大支持上传5M文件'
,
msgFilesTooMany
:
'只能上传1张头像图片!'
,
deleteUrl
:
"#"
,
// 设置一个假的删除URL,启用删除按钮
previewSettings
:
{
image
:
{
width
:
"auto"
,
height
:
"160px"
}
}
}).
on
(
'fileloaded'
,
function
(
event
,
file
,
previewId
,
index
,
reader
)
{
console
.
log
(
"头像加载成功:"
,
previewId
);
}).
on
(
'fileerror'
,
function
(
event
,
data
,
msg
)
{
console
.
error
(
"头像加载错误:"
,
msg
);
});
$
(
"#fileinput-avatar"
).
on
(
"fileuploaded"
,
function
(
event
,
data
,
previewId
,
index
)
{
var
imgPath
=
data
.
response
.
data
.
ossPath
;
var
fullUrl
=
"https://img.zhengzai.tv/"
+
imgPath
;
$
(
"#avatarUrl"
).
val
(
fullUrl
);
console
.
log
(
"头像上传成功:"
,
fullUrl
);
});
// 初始化相册上传
var
albumInitialPreview
=
[];
var
albumInitialPreviewConfig
=
[];
if
(
albumImagesList
.
length
>
0
)
{
albumImagesList
.
forEach
(
function
(
img
,
index
)
{
albumInitialPreview
.
push
(
img
);
albumInitialPreviewConfig
.
push
({
caption
:
"相册图片"
+
(
index
+
1
),
url
:
"#"
,
key
:
index
+
1
});
});
}
// 监听头像删除事件
$
(
"#fileinput-avatar"
).
on
(
"filedeleted"
,
function
(
event
,
key
)
{
console
.
log
(
"删除头像"
);
$
(
"#avatarUrl"
).
val
(
""
);
});
// 监听头像清空事件
$
(
"#fileinput-avatar"
).
on
(
"filecleared"
,
function
(
event
)
{
console
.
log
(
"清空头像"
);
$
(
"#avatarUrl"
).
val
(
""
);
});
// 初始化相册上传
console
.
log
(
"相册图片列表:"
,
albumImagesList
);
// 计算还可以上传多少张图片
var
remainingCount
=
20
-
(
albumImagesList
?
albumImagesList
.
length
:
0
);
console
.
log
(
"还可以上传:"
,
remainingCount
,
"张图片"
);
$
(
"#fileinput-album"
).
fileinput
({
'theme'
:
'explorer-fas'
,
'uploadUrl'
:
platformUrl
+
"/platform/basicServices/alOss/upload/unsm"
,
...
...
@@ -255,27 +323,71 @@
"pathName"
:
"artist/album"
,
"buckType"
:
1
},
initialPreview
:
albumInitialPreview
,
uploadAsync
:
true
,
// 异步上传,每次上传一个文件
overwriteInitial
:
false
,
initialPreviewAsData
:
true
,
initialPreviewConfig
:
albumInitialPreviewConfig
,
dropZoneTitle
:
"请上传艺人相册图片"
,
maxFileCount
:
20
,
initialPreview
:
(
albumImagesList
&&
albumImagesList
.
length
>
0
)
?
albumImagesList
:
[],
initialPreviewConfig
:
(
albumImagesList
&&
albumImagesList
.
length
>
0
)
?
albumImagesList
.
map
(
function
(
url
,
index
)
{
return
{
caption
:
"相册图片"
+
(
index
+
1
),
size
:
0
,
width
:
"120px"
,
key
:
index
,
extra
:
{
url
:
url
}
// 保存URL用于后续处理
};
})
:
[],
dropZoneTitle
:
"请上传艺人相册图片(最多20张)"
,
maxFileCount
:
20
,
// 总共最多20张
maxFileSize
:
5120
,
allowedFileExtensions
:
[
'jpg'
,
'png'
,
'jpeg'
],
msgSizeTooLarge
:
'文件 "{name}" ({size} KB) 超过了允许大小 {maxSize} KB,最大支持上传5M文件'
msgSizeTooLarge
:
'文件 "{name}" ({size} KB) 超过了允许大小 {maxSize} KB,最大支持上传5M文件'
,
msgFilesTooMany
:
'选择的文件数量({n})超过了允许的最大数量{m},相册最多只能上传20张图片!'
,
showRemove
:
true
,
showUpload
:
false
,
deleteUrl
:
"#"
,
// 设置一个假的删除URL,启用删除按钮
previewSettings
:
{
image
:
{
width
:
"auto"
,
height
:
"160px"
}
},
validateInitialCount
:
true
,
// 验证初始文件数量
maxTotalFileCount
:
20
// 包括初始文件在内的最大文件总数
}).
on
(
'fileloaded'
,
function
(
event
,
file
,
previewId
,
index
,
reader
)
{
console
.
log
(
"文件加载成功:"
,
previewId
);
}).
on
(
'fileerror'
,
function
(
event
,
data
,
msg
)
{
console
.
error
(
"文件加载错误:"
,
msg
);
}).
on
(
'filebatchselected'
,
function
(
event
,
files
)
{
// 检查选择的文件数量
var
currentCount
=
$
(
"#fileinput-album"
).
fileinput
(
'getFilesCount'
);
console
.
log
(
"当前文件总数:"
,
currentCount
);
if
(
currentCount
>
20
)
{
$
.
modal
.
alertWarning
(
"相册最多只能上传20张图片!"
);
return
false
;
}
});
$
(
"#fileinput-album"
).
on
(
"fileuploaded"
,
function
(
event
,
data
,
previewId
,
index
)
{
var
imgPath
=
data
.
response
.
data
.
ossPath
;
var
fullUrl
=
"https://img.zhengzai.tv/"
+
imgPath
;
albumImagesList
.
push
(
fullUrl
);
console
.
log
(
"上传后相册列表:"
,
albumImagesList
);
});
$
(
"#fileinput-album"
).
on
(
"fileremoved"
,
function
(
event
,
id
,
index
)
{
if
(
index
<
albumImagesList
.
length
)
{
albumImagesList
.
splice
(
index
,
1
);
// 监听初始预览图片的删除事件
$
(
"#fileinput-album"
).
on
(
"filedeleted"
,
function
(
event
,
key
)
{
console
.
log
(
"删除图片,key:"
,
key
);
// key 对应 initialPreviewConfig 中的 key
if
(
key
>=
0
&&
key
<
albumImagesList
.
length
)
{
albumImagesList
.
splice
(
key
,
1
);
console
.
log
(
"删除后相册列表:"
,
albumImagesList
);
}
});
// 监听文件清除事件
$
(
"#fileinput-album"
).
on
(
"filecleared"
,
function
(
event
)
{
console
.
log
(
"清空所有文件"
);
albumImagesList
=
[];
console
.
log
(
"清空后相册列表:"
,
albumImagesList
);
});
});
</script>
</body>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinArtistServiceImpl.java
View file @
51f1f38b
...
...
@@ -8,6 +8,7 @@ import com.liquidnet.commons.lang.util.BeanUtil;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.kylin.dao.KylinArtistDao
;
import
com.liquidnet.service.kylin.dao.KylinArtistPerformanceDao
;
import
com.liquidnet.service.kylin.dto.param.ArtistParam
;
import
com.liquidnet.service.kylin.dto.param.ArtistSearchParam
;
import
com.liquidnet.service.kylin.dto.vo.ArtistVo
;
...
...
@@ -162,8 +163,24 @@ public class KylinArtistServiceImpl extends ServiceImpl<KylinArtistMapper, Kylin
artistVo
.
setUpdatedAt
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
data
.
getUpdatedAt
()));
}
// TODO 设置关联演出
artistVo
.
setPerformanceVoList
(
Collections
.
EMPTY_LIST
);
// 设置关联演出
List
<
KylinArtistPerformanceDao
>
performanceList
=
artistPerformanceMapper
.
selectPerformanceDaoByArtistId
(
artistId
);
if
(
performanceList
!=
null
&&
!
performanceList
.
isEmpty
())
{
List
<
ArtistVo
.
PerformanceVo
>
performanceVoList
=
performanceList
.
stream
()
.
map
(
performance
->
{
ArtistVo
.
PerformanceVo
vo
=
new
ArtistVo
.
PerformanceVo
();
vo
.
setPerformanceId
(
performance
.
getPerformanceId
());
vo
.
setTitle
(
performance
.
getTitle
());
vo
.
setTimeStart
(
performance
.
getTimeStart
());
vo
.
setTimesId
(
performance
.
getTimesId
());
vo
.
setTimeTitle
(
performance
.
getTimeTitle
());
return
vo
;
})
.
collect
(
Collectors
.
toList
());
artistVo
.
setPerformanceVoList
(
performanceVoList
);
}
else
{
artistVo
.
setPerformanceVoList
(
Collections
.
emptyList
());
}
}
else
{
log
.
error
(
"[detail] query artist is null, artistId: {}"
,
artistId
);
...
...
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/dao/KylinArtistDao.java
View file @
51f1f38b
...
...
@@ -61,7 +61,7 @@ public class KylinArtistDao implements Serializable {
private
Integer
productCount
;
/**
* 创建时间
* 创建时间
(艺人入驻时间)
*/
private
LocalDateTime
createdAt
;
}
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/dao/KylinArtistPerformanceDao.java
View file @
51f1f38b
...
...
@@ -11,31 +11,11 @@ public class KylinArtistPerformanceDao implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
/**
* 艺人ID
*/
private
String
artistId
;
/**
* 艺人名称
*/
private
String
artistName
;
/**
* 艺人头像
*/
private
String
artistUrl
;
/**
* 演出ID
*/
private
String
performanceId
;
/**
* 艺人在演出排序 越大越靠前
*/
private
Integer
sort
;
/**
* 演出标题
*/
...
...
@@ -46,4 +26,14 @@ public class KylinArtistPerformanceDao implements Serializable {
*/
private
String
timeStart
;
/**
* 演出场次ID
*/
private
String
timesId
;
/**
* 演出场次标题
*/
private
String
timeTitle
;
}
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/entity/KylinArtistPerformance.java
View file @
51f1f38b
...
...
@@ -27,6 +27,11 @@ public class KylinArtistPerformance implements Serializable{
*/
private
String
performancesId
;
/**
* 场次ID
*/
private
String
timesId
;
/**
* 该艺人在本演出中的排序权重,越大越靠前
*/
...
...
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/mapper/KylinArtistPerformanceMapper.java
View file @
51f1f38b
...
...
@@ -15,6 +15,6 @@ public interface KylinArtistPerformanceMapper extends BaseMapper<KylinArtistPerf
* @param artistId 艺人ID
* @return 演出信息列表
*/
List
<
KylinArtistPerformanceDao
>
selectPerformance
s
ByArtistId
(
@Param
(
"artistId"
)
String
artistId
);
List
<
KylinArtistPerformanceDao
>
selectPerformance
Dao
ByArtistId
(
@Param
(
"artistId"
)
String
artistId
);
}
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/resources/com.liquidnet.service.kylin.mapper/KylinArtistMapper.xml
View file @
51f1f38b
...
...
@@ -17,7 +17,9 @@
END as artist_type_name,
a.avatar_url,
a.introduction,
a.created_at
a.created_at,
(SELECT COUNT(1) FROM kylin_artist_performance ap WHERE ap.artist_id = a.artist_id) as performance_count,
0 as product_count
FROM kylin_artist a
<where>
a.status = 1
...
...
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/resources/com.liquidnet.service.kylin.mapper/KylinArtistPerformanceMapper.xml
View file @
51f1f38b
...
...
@@ -2,8 +2,26 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.liquidnet.service.kylin.mapper.KylinArtistPerformanceMapper"
>
<select
id=
"selectPerformancesByArtistId"
parameterType=
"java.lang.String"
resultType=
"com.liquidnet.service.kylin.dao.KylinArtistPerformanceDao"
>
<select
id=
"selectPerformanceDaoByArtistId"
parameterType=
"java.lang.String"
resultType=
"com.liquidnet.service.kylin.dao.KylinArtistPerformanceDao"
>
SELECT
p.performances_id as performanceId,
p.title,
DATE_FORMAT(p.time_start, '%Y-%m-%d %H:%i:%s') as timeStart,
t.ticket_times_id as timesId,
t.title as timeTitle
FROM kylin_artist_performance ap
INNER JOIN kylin_performances p ON ap.performances_id = p.performances_id
INNER JOIN kylin_ticket_times t ON ap.times_id = t.ticket_times_id
WHERE ap.artist_id = #{artistId}
ORDER BY ap.sort DESC, p.time_start DESC
</select>
<!-- 根据艺人ID获取关联演出数量 -->
<select
id=
"countPerformancesByArtistId"
parameterType=
"java.lang.String"
resultType=
"java.lang.Integer"
>
SELECT COUNT(1)
FROM kylin_artist_performance
WHERE artist_id = #{artistId}
AND status = 1
</select>
</mapper>
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