记得上下班打卡 | 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
bbc10c17
Commit
bbc10c17
authored
Apr 24, 2026
by
姜秀龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/dev-caomeihuizhang' into container-test
parents
732dfa7d
6230abef
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
144 additions
and
38 deletions
+144
-38
AdamCaomeiBadgeUserServiceImpl.java
...ice/adam/service/impl/AdamCaomeiBadgeUserServiceImpl.java
+73
-16
AdamCaomeiPassportUserServiceImpl.java
.../adam/service/impl/AdamCaomeiPassportUserServiceImpl.java
+71
-22
No files found.
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamCaomeiBadgeUserServiceImpl.java
View file @
bbc10c17
package
com
.
liquidnet
.
service
.
adam
.
service
.
impl
;
package
com
.
liquidnet
.
service
.
adam
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.adam.dto.AdamCaomeiPassportUserBadgeDto
;
import
com.liquidnet.service.adam.dto.AdamCaomeiPassportUserBadgeDto
;
...
@@ -30,6 +31,7 @@ import java.util.ArrayList;
...
@@ -30,6 +31,7 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Slf4j
@Slf4j
...
@@ -111,13 +113,19 @@ public class AdamCaomeiBadgeUserServiceImpl implements IAdamCaomeiBadgeUserServi
...
@@ -111,13 +113,19 @@ public class AdamCaomeiBadgeUserServiceImpl implements IAdamCaomeiBadgeUserServi
String
idCard
=
real
.
getIdCard
();
String
idCard
=
real
.
getIdCard
();
List
<
String
>
paidPerformanceIds
=
adamRdmService
.
getPaidPerformanceIdsByIdCard
(
idCard
);
List
<
String
>
paidPerformanceIds
=
adamRdmService
.
getPaidPerformanceIdsByIdCard
(
idCard
);
boolean
hasPaidRecord
=
paidPerformanceIds
!=
null
&&
paidPerformanceIds
.
contains
(
badge
.
getPerformanceId
());
boolean
hasPaidRecord
=
paidPerformanceIds
!=
null
&&
paidPerformanceIds
.
contains
(
badge
.
getPerformanceId
());
Integer
passedApplyCount
=
badgeApplyRecordMapper
.
selectCount
(
String
perfId
=
StringUtils
.
trimToEmpty
(
badge
.
getPerformanceId
());
Wrappers
.
lambdaQuery
(
AdamCaomeiBadgeApplyRecord
.
class
)
boolean
hasPassedApply
;
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getUserId
,
uid
)
if
(
StringUtils
.
isNotBlank
(
perfId
))
{
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getBadgeId
,
badgeId
)
hasPassedApply
=
countApplyForUserPerformanceAudit
(
uid
,
perfId
,
1
)
>
0
;
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getAuditStatus
,
1
)
}
else
{
);
Integer
passedApplyCount
=
badgeApplyRecordMapper
.
selectCount
(
boolean
hasPassedApply
=
passedApplyCount
!=
null
&&
passedApplyCount
>
0
;
Wrappers
.
lambdaQuery
(
AdamCaomeiBadgeApplyRecord
.
class
)
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getUserId
,
uid
)
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getBadgeId
,
badgeId
)
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getAuditStatus
,
1
)
);
hasPassedApply
=
passedApplyCount
!=
null
&&
passedApplyCount
>
0
;
}
if
(!
hasPaidRecord
&&
!
hasPassedApply
)
{
if
(!
hasPaidRecord
&&
!
hasPassedApply
)
{
log
.
error
(
"[claimBadge] 无购票记录且无通过的补签申请,无法认领, uid: {}, badgeId: {}"
,
uid
,
badgeId
);
log
.
error
(
"[claimBadge] 无购票记录且无通过的补签申请,无法认领, uid: {}, badgeId: {}"
,
uid
,
badgeId
);
...
@@ -215,19 +223,25 @@ public class AdamCaomeiBadgeUserServiceImpl implements IAdamCaomeiBadgeUserServi
...
@@ -215,19 +223,25 @@ public class AdamCaomeiBadgeUserServiceImpl implements IAdamCaomeiBadgeUserServi
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10608"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10608"
));
}
}
Integer
pendingCount
=
badgeApplyRecordMapper
.
selectCount
(
String
performanceId
=
StringUtils
.
trimToEmpty
(
badge
.
getPerformanceId
());
Wrappers
.
lambdaQuery
(
AdamCaomeiBadgeApplyRecord
.
class
)
int
pendingApply
;
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getUserId
,
uid
)
if
(
StringUtils
.
isNotBlank
(
performanceId
))
{
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getBadgeId
,
badgeId
)
pendingApply
=
countApplyForUserPerformanceAudit
(
uid
,
performanceId
,
0
);
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getAuditStatus
,
0
)
}
else
{
);
Integer
pendingCount
=
badgeApplyRecordMapper
.
selectCount
(
if
(
pendingCount
!=
null
&&
pendingCount
>
0
)
{
Wrappers
.
lambdaQuery
(
AdamCaomeiBadgeApplyRecord
.
class
)
return
ResponseDto
.
failure
(
"您已有待审核的补签申请,请勿重复提交"
);
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getUserId
,
uid
)
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getBadgeId
,
badgeId
)
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getAuditStatus
,
0
)
);
pendingApply
=
pendingCount
==
null
?
0
:
pendingCount
;
}
if
(
pendingApply
>
0
)
{
return
ResponseDto
.
failure
(
"该场次已有待审核的补签申请,请勿重复提交"
);
}
}
final
String
applyRecordId
=
IDGenerator
.
nextSnowId
();
final
String
applyRecordId
=
IDGenerator
.
nextSnowId
();
long
t
=
System
.
currentTimeMillis
();
long
t
=
System
.
currentTimeMillis
();
String
performanceId
=
StringUtils
.
trimToEmpty
(
badge
.
getPerformanceId
());
boolean
autoPass
=
isPerformanceOngoing
(
performanceId
);
boolean
autoPass
=
isPerformanceOngoing
(
performanceId
);
if
(
autoPass
)
{
if
(
autoPass
)
{
// 与 admin 审核通过保持一致:仅将申请记录标记为已通过,不自动发放徽章
// 与 admin 审核通过保持一致:仅将申请记录标记为已通过,不自动发放徽章
...
@@ -256,6 +270,49 @@ public class AdamCaomeiBadgeUserServiceImpl implements IAdamCaomeiBadgeUserServi
...
@@ -256,6 +270,49 @@ public class AdamCaomeiBadgeUserServiceImpl implements IAdamCaomeiBadgeUserServi
return
ResponseDto
.
success
(
applyRecordId
);
return
ResponseDto
.
success
(
applyRecordId
);
}
}
/**
* 同场次 type=2 徽章 ID(用于补签记录 performance_id 为空等历史数据的 OR 查询)。
*/
private
Set
<
String
>
type2BadgeIdsForPerformance
(
String
performanceId
)
{
if
(
StringUtils
.
isBlank
(
performanceId
))
{
return
Collections
.
emptySet
();
}
List
<
AdamCaomeiBadge
>
list
=
adamCaomeiBadgeMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
AdamCaomeiBadge
.
class
)
.
eq
(
AdamCaomeiBadge:
:
getType
,
2
)
.
eq
(
AdamCaomeiBadge:
:
getPerformanceId
,
performanceId
));
if
(
list
==
null
||
list
.
isEmpty
())
{
return
Collections
.
emptySet
();
}
return
list
.
stream
()
.
map
(
AdamCaomeiBadge:
:
getBadgeId
)
.
filter
(
StringUtils:
:
isNotBlank
)
.
collect
(
Collectors
.
toSet
());
}
/**
* 用户对某场次是否存在指定审核状态的补签记录(按 performance_id 或同场徽章 ID 命中)。
*/
private
int
countApplyForUserPerformanceAudit
(
String
uid
,
String
performanceId
,
int
auditStatus
)
{
if
(
StringUtils
.
isBlank
(
performanceId
))
{
return
0
;
}
Set
<
String
>
samePerfBadgeIds
=
type2BadgeIdsForPerformance
(
performanceId
);
LambdaQueryWrapper
<
AdamCaomeiBadgeApplyRecord
>
qw
=
Wrappers
.
lambdaQuery
(
AdamCaomeiBadgeApplyRecord
.
class
)
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getUserId
,
uid
)
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getAuditStatus
,
auditStatus
);
if
(
samePerfBadgeIds
.
isEmpty
())
{
qw
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getPerformanceId
,
performanceId
);
}
else
{
qw
.
and
(
w
->
w
.
eq
(
AdamCaomeiBadgeApplyRecord:
:
getPerformanceId
,
performanceId
)
.
or
()
.
in
(
AdamCaomeiBadgeApplyRecord:
:
getBadgeId
,
samePerfBadgeIds
));
}
Integer
n
=
badgeApplyRecordMapper
.
selectCount
(
qw
);
return
n
==
null
?
0
:
n
;
}
private
boolean
isPerformanceOngoing
(
String
performanceId
)
{
private
boolean
isPerformanceOngoing
(
String
performanceId
)
{
if
(
StringUtils
.
isBlank
(
performanceId
))
{
if
(
StringUtils
.
isBlank
(
performanceId
))
{
return
false
;
return
false
;
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamCaomeiPassportUserServiceImpl.java
View file @
bbc10c17
This diff is collapsed.
Click to expand it.
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