记得上下班打卡 | 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
15946514
Commit
15946514
authored
Sep 08, 2025
by
姜秀龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
场次限购-order 实名限购逻辑
parent
37e2bb64
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
15 deletions
+45
-15
KylinRedisConst.java
...com/liquidnet/service/kylin/constant/KylinRedisConst.java
+1
-0
KylinOrderTicketsServiceImpl.java
...vice/order/service/impl/KylinOrderTicketsServiceImpl.java
+9
-8
DataUtils.java
...ain/java/com/liquidnet/service/order/utils/DataUtils.java
+14
-1
OrderUtils.java
...in/java/com/liquidnet/service/order/utils/OrderUtils.java
+21
-6
No files found.
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/constant/KylinRedisConst.java
View file @
15946514
...
...
@@ -62,6 +62,7 @@ public class KylinRedisConst {
public
static
final
String
IDCARD_BUY_INFO
=
"kylin:buy:idCard:"
;
public
static
final
String
PERFORMANCE_ID
=
"performanceId"
;
public
static
final
String
TICKET_ID
=
"ticketId"
;
public
static
final
String
TIME_ID
=
"timeId"
;
public
static
final
String
USE_TIME
=
"useTime"
;
public
static
final
String
BUY_COUNT
=
"buyCount"
;
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/KylinOrderTicketsServiceImpl.java
View file @
15946514
...
...
@@ -255,6 +255,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
// 获取限购 实名
Integer
timeRealNameLimit
=
ticketTimesData
.
getRealNameLimit
();
int
ticketLimit
=
1
;
int
ticketMemberLimit
=
ticketData
.
getLimitCountMember
();
//会员票种限购
int
ticketIdCount
=
ticketData
.
getIdCount
();
//实名票种限购
...
...
@@ -399,11 +400,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
//限购判断 如果实名 则身份证维度限购 如果不实名则数量限购
if
(
entersVoList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
entersVoList
.
size
();
i
++)
{
dataUtils
.
changeBuyInfo
(
uid
,
entersVoList
.
get
(
i
).
getIdCard
(),
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
1
);
String
res1
=
orderUtils
.
judgeOrderLimit
(
uid
,
entersVoList
.
get
(
i
).
getIdCard
(),
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
p
erformanceLimit
,
performanceMemberLimit
,
performanceIdCount
,
ticketLimit
,
ticketMemberLimit
,
ticketIdCoun
t
,
memberType
,
isTrueName
);
dataUtils
.
changeBuyInfo
(
uid
,
entersVoList
.
get
(
i
).
getIdCard
(),
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
payOrderParam
.
getTimeId
(),
1
);
String
res1
=
orderUtils
.
judgeOrderLimit
(
uid
,
entersVoList
.
get
(
i
).
getIdCard
(),
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
p
ayOrderParam
.
getTimeId
(),
performanceLimit
,
performanceMemberLimit
,
performanceIdCount
,
ticketLimit
,
ticketMemberLimit
,
ticketIdCount
,
timeRealNameLimi
t
,
memberType
,
isTrueName
);
if
(!
res1
.
equals
(
""
))
{
for
(
int
x
=
0
;
x
<=
i
;
x
++)
{
dataUtils
.
changeBuyInfo
(
uid
,
entersVoList
.
get
(
x
).
getIdCard
(),
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
-
1
);
dataUtils
.
changeBuyInfo
(
uid
,
entersVoList
.
get
(
x
).
getIdCard
(),
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
payOrderParam
.
getTimeId
(),
-
1
);
}
orderUtils
.
changeSurplus
(
isPay
,
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
orderUtils
.
backAdvanceCoupon
(
payOrderParam
.
getAdvanceCode
(),
uid
);
...
...
@@ -411,10 +412,10 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
}
}
else
{
dataUtils
.
changeBuyInfo
(
uid
,
""
,
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
payOrderParam
.
getNumber
());
String
res1
=
orderUtils
.
judgeOrderLimit
(
uid
,
""
,
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
p
erformanceLimit
,
performanceMemberLimit
,
performanceIdCount
,
ticketLimit
,
ticketMemberLimit
,
ticketIdCoun
t
,
memberType
,
isTrueName
);
dataUtils
.
changeBuyInfo
(
uid
,
""
,
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
payOrderParam
.
get
TimeId
(),
payOrderParam
.
get
Number
());
String
res1
=
orderUtils
.
judgeOrderLimit
(
uid
,
""
,
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
p
ayOrderParam
.
getTimeId
(),
performanceLimit
,
performanceMemberLimit
,
performanceIdCount
,
ticketLimit
,
ticketMemberLimit
,
ticketIdCount
,
timeRealNameLimi
t
,
memberType
,
isTrueName
);
if
(!
res1
.
equals
(
""
))
{
dataUtils
.
changeBuyInfo
(
uid
,
""
,
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
-
payOrderParam
.
getNumber
());
dataUtils
.
changeBuyInfo
(
uid
,
""
,
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
payOrderParam
.
getTimeId
(),
-
payOrderParam
.
getNumber
());
orderUtils
.
changeSurplus
(
isPay
,
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
orderUtils
.
backAdvanceCoupon
(
payOrderParam
.
getAdvanceCode
(),
uid
);
return
ResponseDto
.
failure
(
res1
);
//乱七八糟异常
...
...
@@ -435,11 +436,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
dataUtils
.
decrUseCouponCount
(
uid
,
performanceId
);
}
for
(
AdamEntersVo
enters
:
entersVoList
)
{
dataUtils
.
changeBuyInfo
(
uid
,
enters
.
getIdCard
(),
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
-
1
);
dataUtils
.
changeBuyInfo
(
uid
,
enters
.
getIdCard
(),
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
payOrderParam
.
getTimeId
(),
-
1
);
}
if
(
entersVoList
.
size
()
==
0
)
{
for
(
int
i
=
0
;
i
<
payOrderParam
.
getNumber
();
i
++)
{
dataUtils
.
changeBuyInfo
(
uid
,
""
,
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
-
1
);
dataUtils
.
changeBuyInfo
(
uid
,
""
,
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
payOrderParam
.
getTimeId
(),
-
1
);
}
}
}
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/DataUtils.java
View file @
15946514
...
...
@@ -130,11 +130,12 @@ public class DataUtils {
* @param ticketId 票种id
* @param buyCount 购买数量 大于 0 增加 小于 0 减少 对应 支付 退款表
*/
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
buyCount
)
{
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
String
timeId
,
int
buyCount
)
{
String
redisKeyUid
;
String
redisKeyIdCard
;
String
performanceIdKeyIdCard
=
""
;
String
ticketIdKeyIdCard
=
""
;
String
timeIdKeyIdCard
=
""
;
int
isTrueName
=
getPerformanceIsTrueName
(
performanceId
);
...
...
@@ -146,6 +147,7 @@ public class DataUtils {
performanceIdKeyIdCard
=
redisKeyIdCard
+
":"
+
KylinRedisConst
.
PERFORMANCE_ID
+
":"
+
performanceId
;
ticketIdKeyIdCard
=
redisKeyIdCard
+
":"
+
KylinRedisConst
.
TICKET_ID
+
":"
+
ticketId
;
}
timeIdKeyIdCard
=
redisKeyIdCard
+
":"
+
KylinRedisConst
.
TIME_ID
+
":"
+
timeId
;
if
(
buyCount
>
0
)
{
redisUtil
.
incr
(
ticketIdKeyUid
,
buyCount
);
...
...
@@ -154,7 +156,9 @@ public class DataUtils {
redisUtil
.
incr
(
ticketIdKeyIdCard
,
buyCount
);
redisUtil
.
incr
(
performanceIdKeyIdCard
,
buyCount
);
}
redisUtil
.
incr
(
timeIdKeyIdCard
,
buyCount
);
}
else
{
redisUtil
.
decr
(
timeIdKeyIdCard
,
Math
.
abs
(
buyCount
));
if
(
isTrueName
!=
0
)
{
redisUtil
.
decr
(
ticketIdKeyIdCard
,
Math
.
abs
(
buyCount
));
redisUtil
.
decr
(
performanceIdKeyIdCard
,
Math
.
abs
(
buyCount
));
...
...
@@ -202,6 +206,15 @@ public class DataUtils {
}
}
// 获取 证件维度 场次购买数量
public
int
getIdCardMBuyCount
(
String
idCard
,
String
timeId
)
{
try
{
return
(
int
)
redisUtil
.
get
(
KylinRedisConst
.
IDCARD_BUY_INFO
+
idCard
+
":"
+
KylinRedisConst
.
TIME_ID
+
":"
+
timeId
);
}
catch
(
Exception
e
)
{
return
0
;
}
}
/**
* 删除订单redis
*
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/OrderUtils.java
View file @
15946514
...
...
@@ -51,19 +51,22 @@ public class OrderUtils {
String
idCard
,
String
performanceId
,
String
ticketId
,
String
timeId
,
int
performanceLimitCount
,
int
performanceMemberLimitCount
,
int
performanceLimitIdCard
,
int
ticketLimitCount
,
int
ticketMemberLimitCount
,
int
ticketLimitIdCard
,
int
timeRealNameLimit
,
int
memberType
,
int
isTrueName
)
{
Integer
[]
integers
=
orderLimit
(
userId
,
idCard
,
performanceId
,
ticketId
,
isTrueName
);
Integer
[]
integers
=
orderLimit
(
userId
,
idCard
,
performanceId
,
ticketId
,
timeId
,
isTrueName
);
return
judgeMemberType
(
performanceLimitCount
,
performanceMemberLimitCount
,
performanceLimitIdCard
,
ticketLimitCount
,
ticketMemberLimitCount
,
ticketLimitIdCard
,
memberType
,
integers
[
0
],
integers
[
1
],
integers
[
2
],
integers
[
3
],
isTrueName
);
ticketLimitCount
,
ticketMemberLimitCount
,
ticketLimitIdCard
,
timeRealNameLimit
,
memberType
,
integers
[
0
],
integers
[
1
],
integers
[
2
],
integers
[
3
],
i
ntegers
[
4
],
i
sTrueName
);
}
public
Integer
[]
orderLimit
(
...
...
@@ -71,34 +74,46 @@ public class OrderUtils {
String
idCard
,
String
performanceId
,
String
ticketId
,
String
timeId
,
int
isTrueName
)
{
int
performanceBuyCountUid
=
0
;
int
ticketBuyCountUid
=
0
;
int
performanceBuyCountIdCard
=
0
;
int
ticketBuyCountIdCard
=
0
;
int
timeBuyCountIdCard
=
0
;
if
(
1
==
isTrueName
)
{
//实名
performanceBuyCountIdCard
=
dataUtils
.
getIdCardPBuyCount
(
idCard
,
performanceId
);
ticketBuyCountIdCard
=
dataUtils
.
getIdCardTBuyCount
(
idCard
,
ticketId
);
performanceBuyCountUid
=
dataUtils
.
getUserPBuyCount
(
userId
,
performanceId
);
ticketBuyCountUid
=
dataUtils
.
getUserTBuyCount
(
userId
,
ticketId
);
timeBuyCountIdCard
=
dataUtils
.
getIdCardMBuyCount
(
idCard
,
timeId
);
}
else
{
//非实名
performanceBuyCountUid
=
dataUtils
.
getUserPBuyCount
(
userId
,
performanceId
);
ticketBuyCountUid
=
dataUtils
.
getUserTBuyCount
(
userId
,
ticketId
);
}
Integer
[]
array
=
new
Integer
[
4
];
Integer
[]
array
=
new
Integer
[
5
];
array
[
0
]
=
performanceBuyCountUid
;
array
[
1
]
=
ticketBuyCountUid
;
array
[
2
]
=
performanceBuyCountIdCard
;
array
[
3
]
=
ticketBuyCountIdCard
;
array
[
4
]
=
timeBuyCountIdCard
;
return
array
;
}
public
String
judgeMemberType
(
int
performanceLimitCount
,
int
performanceMemberLimitCount
,
int
performanceLimitIdCard
,
int
ticketLimitCount
,
int
ticketMemberLimitCount
,
int
ticketLimitIdCard
,
int
memberType
,
int
performanceBuyCountUid
,
int
ticketBuyCountUid
,
int
performanceBuyCountIdCard
,
int
ticketBuyCountIdCard
,
int
isTrueName
)
{
int
ticketLimitCount
,
int
ticketMemberLimitCount
,
int
ticketLimitIdCard
,
int
timeRealNameLimit
,
int
memberType
,
int
performanceBuyCountUid
,
int
ticketBuyCountUid
,
int
performanceBuyCountIdCard
,
int
ticketBuyCountIdCard
,
int
timeBuyCountIdCard
,
int
isTrueName
)
{
if
(
isTrueName
==
1
&&
timeRealNameLimit
==
1
)
{
if
(
timeBuyCountIdCard
>
timeRealNameLimit
)
{
return
"实名制场次限购"
+
timeRealNameLimit
+
"张,已超出"
;
//超过场次维度购买量
}
}
if
(
memberType
==
1
||
memberType
==
2
)
{
if
(
isTrueName
==
1
)
{
...
...
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