记得上下班打卡 | 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
deccfdae
Commit
deccfdae
authored
Mar 09, 2026
by
wangyifan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关联/取消关联时增加艺人操作日志
parent
0e22266b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
3 deletions
+71
-3
KylinArtistPerformanceServiceImpl.java
...kylin/service/impl/KylinArtistPerformanceServiceImpl.java
+69
-1
liquidnet-service-kylin.yml
...t-bus-config/liquidnet-config/liquidnet-service-kylin.yml
+2
-2
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinArtistPerformanceServiceImpl.java
View file @
deccfdae
...
@@ -16,7 +16,11 @@ import org.springframework.stereotype.Service;
...
@@ -16,7 +16,11 @@ import org.springframework.stereotype.Service;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.HashSet
;
import
java.util.HashMap
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.liquidnet.service.kylin.service.admin.IKylinArtistOperationLogService
;
@Slf4j
@Slf4j
...
@@ -32,6 +36,9 @@ public class KylinArtistPerformanceServiceImpl extends ServiceImpl<KylinArtistPe
...
@@ -32,6 +36,9 @@ public class KylinArtistPerformanceServiceImpl extends ServiceImpl<KylinArtistPe
@Autowired
@Autowired
private
DataUtils
dataUtils
;
private
DataUtils
dataUtils
;
@Autowired
private
IKylinArtistOperationLogService
operationLogService
;
@Override
@Override
public
List
<
KylinArtistPerformanceDao
>
getSessionArtists
(
String
performancesId
,
String
timesId
)
{
public
List
<
KylinArtistPerformanceDao
>
getSessionArtists
(
String
performancesId
,
String
timesId
)
{
// 查询该场次的艺人
// 查询该场次的艺人
...
@@ -60,9 +67,30 @@ public class KylinArtistPerformanceServiceImpl extends ServiceImpl<KylinArtistPe
...
@@ -60,9 +67,30 @@ public class KylinArtistPerformanceServiceImpl extends ServiceImpl<KylinArtistPe
@Override
@Override
public
int
deletePerformanceArtist
(
Long
mid
,
String
performanceId
)
{
public
int
deletePerformanceArtist
(
Long
mid
,
String
performanceId
)
{
KylinArtistPerformance
association
=
artistPerformanceMapper
.
selectById
(
mid
);
if
(
association
==
null
)
{
return
0
;
}
String
artistId
=
association
.
getArtistId
();
// 记录删除前的关联数量
Integer
beforeCount
=
artistPerformanceMapper
.
selectCount
(
new
QueryWrapper
<
KylinArtistPerformance
>().
eq
(
"artist_id"
,
artistId
));
beforeCount
=
beforeCount
==
null
?
0
:
beforeCount
;
// 删除缓存演出阵容
// 删除缓存演出阵容
dataUtils
.
delPerformanceArtists
(
performanceId
);
dataUtils
.
delPerformanceArtists
(
performanceId
);
return
artistPerformanceMapper
.
deleteById
(
mid
);
int
result
=
artistPerformanceMapper
.
deleteById
(
mid
);
// 记录删除后的关联数量
Integer
afterCount
=
artistPerformanceMapper
.
selectCount
(
new
QueryWrapper
<
KylinArtistPerformance
>().
eq
(
"artist_id"
,
artistId
));
afterCount
=
afterCount
==
null
?
0
:
afterCount
;
if
(!
beforeCount
.
equals
(
afterCount
))
{
String
logContent
=
String
.
format
(
"更新关联演出数量:从[%d]场改为[%d]场,"
,
beforeCount
,
afterCount
);
operationLogService
.
recordLog
(
artistId
,
2
,
logContent
);
}
return
result
;
}
}
@Override
@Override
...
@@ -100,6 +128,34 @@ public class KylinArtistPerformanceServiceImpl extends ServiceImpl<KylinArtistPe
...
@@ -100,6 +128,34 @@ public class KylinArtistPerformanceServiceImpl extends ServiceImpl<KylinArtistPe
@Override
@Override
public
boolean
updateArtistAssociations
(
String
performancesId
,
String
timesId
,
List
<
Map
<
String
,
Object
>>
artistOrders
)
{
public
boolean
updateArtistAssociations
(
String
performancesId
,
String
timesId
,
List
<
Map
<
String
,
Object
>>
artistOrders
)
{
// 先查询该演出、场次下关联的旧艺人
List
<
KylinArtistPerformance
>
oldAssociations
=
artistPerformanceMapper
.
selectList
(
new
QueryWrapper
<
KylinArtistPerformance
>()
.
eq
(
"performances_id"
,
performancesId
)
.
eq
(
"times_id"
,
timesId
));
Set
<
String
>
affectedArtistIds
=
new
HashSet
<>();
// 旧关联的艺人ID set
if
(
oldAssociations
!=
null
)
{
for
(
KylinArtistPerformance
a
:
oldAssociations
)
{
affectedArtistIds
.
add
(
a
.
getArtistId
());
}
}
if
(
artistOrders
!=
null
&&
!
artistOrders
.
isEmpty
())
{
for
(
Map
<
String
,
Object
>
item
:
artistOrders
)
{
String
artistId
=
(
String
)
item
.
get
(
"artistId"
);
if
(
artistId
!=
null
)
{
affectedArtistIds
.
add
(
artistId
);
}
}
}
// Record before counts
Map
<
String
,
Integer
>
beforeCounts
=
new
HashMap
<>();
for
(
String
artistId
:
affectedArtistIds
)
{
Integer
count
=
artistPerformanceMapper
.
selectCount
(
new
QueryWrapper
<
KylinArtistPerformance
>().
eq
(
"artist_id"
,
artistId
));
beforeCounts
.
put
(
artistId
,
count
==
null
?
0
:
count
);
}
// 1. 删除当前场次所有已关联的艺人
// 1. 删除当前场次所有已关联的艺人
artistPerformanceMapper
.
delete
(
new
QueryWrapper
<
KylinArtistPerformance
>()
artistPerformanceMapper
.
delete
(
new
QueryWrapper
<
KylinArtistPerformance
>()
.
eq
(
"performances_id"
,
performancesId
)
.
eq
(
"performances_id"
,
performancesId
)
...
@@ -120,6 +176,18 @@ public class KylinArtistPerformanceServiceImpl extends ServiceImpl<KylinArtistPe
...
@@ -120,6 +176,18 @@ public class KylinArtistPerformanceServiceImpl extends ServiceImpl<KylinArtistPe
artistPerformanceMapper
.
insert
(
newAssociation
);
artistPerformanceMapper
.
insert
(
newAssociation
);
}
}
}
}
// 3. Compare and log
for
(
String
artistId
:
affectedArtistIds
)
{
Integer
afterCount
=
artistPerformanceMapper
.
selectCount
(
new
QueryWrapper
<
KylinArtistPerformance
>().
eq
(
"artist_id"
,
artistId
));
afterCount
=
afterCount
==
null
?
0
:
afterCount
;
Integer
beforeCount
=
beforeCounts
.
get
(
artistId
);
if
(!
beforeCount
.
equals
(
afterCount
))
{
String
logContent
=
String
.
format
(
"更新关联演出数量:从[%d]场改为[%d]场,"
,
beforeCount
,
afterCount
);
operationLogService
.
recordLog
(
artistId
,
2
,
logContent
);
}
}
// 删除缓存演出阵容
// 删除缓存演出阵容
dataUtils
.
delPerformanceArtists
(
performancesId
);
dataUtils
.
delPerformanceArtists
(
performancesId
);
return
true
;
return
true
;
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-kylin.yml
View file @
deccfdae
...
@@ -58,8 +58,8 @@ info:
...
@@ -58,8 +58,8 @@ info:
artifactId
:
'
@project.artifactId@'
artifactId
:
'
@project.artifactId@'
version
:
'
@project.version@'
version
:
'
@project.version@'
# -----------------------------------------------------------
# -----------------------------------------------------------
#
mybatis-plus:
mybatis-plus
:
#
mapper-locations: classpath*:com.liquidnet.service.*.mapper/*Mapper.xml
mapper-locations
:
classpath*:com.liquidnet.service.*.mapper/*Mapper.xml
# -----------------------------------------------------------
# -----------------------------------------------------------
spring
:
spring
:
application
:
application
:
...
...
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