记得上下班打卡 | 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
fe95331f
Commit
fe95331f
authored
Jul 28, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员时间内,只能下一单,只能使用一次券
parent
3d8da619
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
12 deletions
+73
-12
KylinRedisConst.java
...com/liquidnet/service/kylin/constant/KylinRedisConst.java
+7
-3
KylinOrderTicketsServiceImpl.java
...vice/order/service/impl/KylinOrderTicketsServiceImpl.java
+20
-3
DataUtils.java
...ain/java/com/liquidnet/service/order/utils/DataUtils.java
+46
-6
No files found.
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/constant/KylinRedisConst.java
View file @
fe95331f
...
...
@@ -93,12 +93,16 @@ public class KylinRedisConst {
public
static
final
String
REDIS_WQ_ORDER_EXPRESS
=
"kylin:wq:pxress:order:"
;
//万青补偿快递vo 订单填写快递地址
public
static
final
String
ACTIVE_TICKET_AR_TICKET
=
"kylin:active:ar:ticket:"
;
//互动券
public
static
final
String
ACTIVE_TICKET_AR_USER
=
"kylin:active:ar:user:"
;
//互动券 绑定的用户
public
static
final
String
ACTIVE_TICKET_AR_TICKET
=
"kylin:active:ar:ticket:"
;
//互动券
public
static
final
String
ACTIVE_TICKET_AR_USER
=
"kylin:active:ar:user:"
;
//互动券 绑定的用户
/**
* 巡演券
* eg:{kylin:c_rs:${couponId}, List<巡演ID>}
*/
public
static
final
String
COUPON_ROADSHOWS
=
"kylin:c_rs:"
;
public
static
final
String
COUPON_ROADSHOWS
=
"kylin:c_rs:"
;
public
static
final
String
COUPON_COUNT
=
"kylin:coupon:count:"
;
//$key + $uid:$performance_id
public
static
final
String
MEMBER_COUNT
=
"kylin:member:count:"
;
//$key + $uid:$performance_id
}
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/KylinOrderTicketsServiceImpl.java
View file @
fe95331f
...
...
@@ -98,6 +98,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
public
ResponseDto
<
PayInnerResultVo
>
checkCanOrder
(
PayOrderParam
payOrderParam
)
{
boolean
isDownGeneral
=
false
;
boolean
isPay
=
true
;
boolean
useAdvance
=
false
;
String
performanceId
=
""
;
List
<
AdamEntersVo
>
entersVoList
=
ObjectUtil
.
cloneArrayListObject
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
HashMap
<
String
,
Object
>
advanceMap
=
null
;
...
...
@@ -128,7 +130,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
break
;
}
}
performanceId
=
performanceData
.
getPerformancesId
();
if
(
ticketTimesData
==
null
||
ticketData
==
null
)
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20004"
));
//参数错误
}
...
...
@@ -204,8 +206,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
int
memberType
;
//会员状态 不需要判断会员 1判断会员逻辑 2会员专属
if
(
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
memberTimeStart
)
==
1
&&
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
timeStart
)
==
-
1
){
//优先时间
if
(
payOrderParam
.
getNumber
()>
2
){
if
(
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
memberTimeStart
)
==
1
&&
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
timeStart
)
==
-
1
)
{
//优先时间
if
(
payOrderParam
.
getNumber
()
>
ticketData
.
getCounts
())
{
return
ResponseDto
.
failure
(
"非法下单"
);
}
int
advanceCount
=
dataUtils
.
incrUseMemberCount
(
uid
,
performanceData
.
getPerformancesId
());
if
(
advanceCount
>
1
)
{
//todo
dataUtils
.
decrUseMemberCount
(
uid
,
performanceData
.
getPerformancesId
());
return
ResponseDto
.
failure
(
"非法下单"
);
}
}
...
...
@@ -266,6 +273,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
orderUtils
.
backAdvanceCoupon
(
payOrderParam
.
getAdvanceCode
(),
uid
);
return
ResponseDto
.
failure
(
"优先券该演出不可用"
);
}
int
couponCount
=
dataUtils
.
incrUseCouponCount
(
uid
,
performanceData
.
getPerformancesId
());
useAdvance
=
true
;
if
(
couponCount
>
1
)
{
//todo
useAdvance
=
false
;
dataUtils
.
decrUseCouponCount
(
uid
,
performanceData
.
getPerformancesId
());
return
ResponseDto
.
failure
(
"非法下单"
);
}
}
}
}
...
...
@@ -376,6 +390,9 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
orderUtils
.
changeSurplus
(
isPay
,
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
log
.
error
(
"回滚库存"
);
orderUtils
.
backAdvanceCoupon
(
payOrderParam
.
getAdvanceCode
(),
uid
);
if
(
useAdvance
)
{
dataUtils
.
decrUseCouponCount
(
uid
,
performanceId
);
}
for
(
AdamEntersVo
enters
:
entersVoList
)
{
dataUtils
.
changeBuyInfo
(
uid
,
enters
.
getIdCard
(),
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
-
1
);
}
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/DataUtils.java
View file @
fe95331f
...
...
@@ -293,16 +293,16 @@ public class DataUtils {
String
redisKey
=
KylinRedisConst
.
ADAM_IS_MEMBER
.
concat
(
uid
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
return
null
;
}
else
{
}
else
{
return
(
Integer
)
obj
;
}
}
// 获取快递价格
public
BigDecimal
getExpressPrice
(
String
adCode
,
String
productCode
){
BigDecimal
price
;
public
BigDecimal
getExpressPrice
(
String
adCode
,
String
productCode
)
{
BigDecimal
price
;
Object
obj
=
redisUtil
.
get
(
KylinRedisConst
.
RETURN_ADDRESS_CODE
+
adCode
+
KylinRedisConst
.
EXPRESS_TYPE
+
productCode
);
if
(
obj
!=
null
)
{
KylinFreightChargeDao
k
=
(
KylinFreightChargeDao
)
obj
;
...
...
@@ -321,9 +321,9 @@ public class DataUtils {
public
String
getTicketPayTxt
(
String
ticketId
)
{
String
rdsKey
=
KylinRedisConst
.
TICKET_PAY_TXT
.
concat
(
ticketId
);
Object
obj
=
redisUtil
.
get
(
rdsKey
);
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
return
""
;
}
else
{
}
else
{
return
(
String
)
obj
;
}
}
...
...
@@ -338,4 +338,44 @@ public class DataUtils {
return
(
List
<
String
>)
obj
;
}
}
public
int
incrUseCouponCount
(
String
uid
,
String
performanceId
)
{
String
rdk
=
KylinRedisConst
.
COUPON_COUNT
.
concat
(
uid
).
concat
(
":"
).
concat
(
performanceId
);
return
(
int
)
redisUtil
.
incr
(
rdk
,
1
);
}
public
int
decrUseCouponCount
(
String
uid
,
String
performanceId
)
{
String
rdk
=
KylinRedisConst
.
COUPON_COUNT
.
concat
(
uid
).
concat
(
":"
).
concat
(
performanceId
);
return
(
int
)
redisUtil
.
decr
(
rdk
,
1
);
}
public
int
incrUseMemberCount
(
String
uid
,
String
performanceId
)
{
String
rdk
=
KylinRedisConst
.
MEMBER_COUNT
.
concat
(
uid
).
concat
(
":"
).
concat
(
performanceId
);
return
(
int
)
redisUtil
.
incr
(
rdk
,
1
);
}
public
int
decrUseMemberCount
(
String
uid
,
String
performanceId
)
{
String
rdk
=
KylinRedisConst
.
MEMBER_COUNT
.
concat
(
uid
).
concat
(
":"
).
concat
(
performanceId
);
return
(
int
)
redisUtil
.
decr
(
rdk
,
1
);
}
// public int getUseCouponCount(String uid,String performanceId){
// String rdk = KylinRedisConst.COUPON_COUNT.concat(uid).concat(":").concat(performanceId);
// Object obj = redisUtil.get(rdk);
// if(obj==null){
// return 0;
// }else{
// return (int) obj;
// }
// }
public
int
getUseCouponCount
(
String
uid
,
String
performanceId
)
{
String
rdk
=
KylinRedisConst
.
COUPON_COUNT
.
concat
(
uid
).
concat
(
":"
).
concat
(
performanceId
);
Object
obj
=
redisUtil
.
get
(
rdk
);
if
(
obj
==
null
)
{
return
0
;
}
else
{
return
(
int
)
obj
;
}
}
}
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