记得上下班打卡 | 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
583fb8ad
Commit
583fb8ad
authored
Aug 31, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改下单接口
券 使用接口 券 提前下单接口
parent
4c118c46
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
17 deletions
+79
-17
ICandyCouponService.java
.../liquidnet/service/candy/service/ICandyCouponService.java
+3
-3
CandyCouponController.java
...idnet/service/candy/controller/CandyCouponController.java
+22
-4
CandyCouponServiceImpl.java
...et/service/candy/service/impl/CandyCouponServiceImpl.java
+36
-5
CouponBaseUtil.java
...java/com/liquidnet/service/candy/util/CouponBaseUtil.java
+10
-2
KylinOrderTicketsServiceImpl.java
...vice/order/service/impl/KylinOrderTicketsServiceImpl.java
+2
-2
OrderUtils.java
...in/java/com/liquidnet/service/order/utils/OrderUtils.java
+6
-1
No files found.
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/service/ICandyCouponService.java
View file @
583fb8ad
...
...
@@ -25,7 +25,7 @@ public interface ICandyCouponService {
List
<
CandyCouponVo
>
memberCoupon
(
String
mCouponId
);
CandyMyCouponListVo
preUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
,
Integer
type
);
CandyMyCouponListVo
preUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
,
Integer
type
);
Integer
preCanUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
);
...
...
@@ -33,11 +33,11 @@ public interface ICandyCouponService {
Integer
preCanUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodI
);
List
<
CandyCouponVo
>
myAdvanceCoupon
();
List
<
CandyCouponVo
>
myAdvanceCoupon
(
String
performanceId
,
String
timesId
,
String
ticketId
);
Integer
stateCoupon
(
String
uCouponId
);
CandyUseResultVo
useCoupon
(
String
uCouponId
,
String
content
,
String
totalPrice
);
CandyUseResultVo
useCoupon
(
String
uCouponId
,
String
content
,
String
totalPrice
,
String
performanceId
,
String
timesId
,
String
ticketId
,
String
goodIds
);
Boolean
useBackCoupon
(
List
<
BackCouponParam
>
backCouponParam
);
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/controller/CandyCouponController.java
View file @
583fb8ad
...
...
@@ -129,8 +129,15 @@ public class CandyCouponController {
//要使用券列表 - 演出提前
@GetMapping
(
"my/advance"
)
@ApiOperation
(
"提前券列表"
)
public
ResponseDto
<
List
<
CandyCouponVo
>>
myAdvanceCoupon
()
{
return
ResponseDto
.
success
(
candyCouponService
.
myAdvanceCoupon
());
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"performanceId"
,
value
=
"演出id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"timeId"
,
value
=
"场次id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"ticketId"
,
value
=
"票id"
,
required
=
true
),
})
public
ResponseDto
<
List
<
CandyCouponVo
>>
myAdvanceCoupon
(
@RequestParam
(
"performanceId"
)
@NotNull
@NotBlank
String
performanceId
,
@RequestParam
(
"timeId"
)
@NotNull
@NotBlank
String
timeId
,
@RequestParam
(
"ticketId"
)
@NotNull
@NotBlank
String
ticketId
)
{
return
ResponseDto
.
success
(
candyCouponService
.
myAdvanceCoupon
(
performanceId
,
timeId
,
ticketId
));
}
//判断券是否可用
...
...
@@ -156,11 +163,22 @@ public class CandyCouponController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"uCouponId"
,
value
=
"券唯一表示id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"content"
,
value
=
"消费内容"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"totalPrice"
,
value
=
"消费价格"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"goodId"
,
value
=
"商品id(逗号隔开的字符串)"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"performanceId"
,
value
=
"演出id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"timeId"
,
value
=
"场次id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"ticketId"
,
value
=
"票id"
,
required
=
true
),
})
public
ResponseDto
<
CandyUseResultVo
>
useCoupon
(
@RequestParam
(
"uCouponId"
)
@NotNull
@NotBlank
String
uCouponId
,
@RequestParam
(
"content"
)
@NotNull
@NotBlank
String
content
,
@RequestParam
(
"totalPrice"
)
@NotNull
String
totalPrice
)
{
CandyUseResultVo
result
=
candyCouponService
.
useCoupon
(
uCouponId
,
content
,
totalPrice
);
@RequestParam
(
"totalPrice"
)
@NotNull
String
totalPrice
,
@RequestParam
(
"goodId"
)
@NotNull
@NotBlank
String
goodId
,
@RequestParam
(
"performanceId"
)
@NotNull
@NotBlank
String
performanceId
,
@RequestParam
(
"timeId"
)
@NotNull
@NotBlank
String
timeId
,
@RequestParam
(
"ticketId"
)
@NotNull
@NotBlank
String
ticketId
)
{
CandyUseResultVo
result
=
candyCouponService
.
useCoupon
(
uCouponId
,
content
,
totalPrice
,
performanceId
,
ticketId
,
timeId
,
goodId
);
if
(
result
==
null
)
{
return
ResponseDto
.
failure
();
}
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/service/impl/CandyCouponServiceImpl.java
View file @
583fb8ad
...
...
@@ -8,6 +8,7 @@ import com.liquidnet.service.base.SqlMapping;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.candy.dto.CandyCouponCodeDto
;
import
com.liquidnet.service.candy.dto.CandyCouponInfoDto
;
import
com.liquidnet.service.candy.dto.CandyCouponRuleDto
;
import
com.liquidnet.service.candy.dto.CandyUserCouponBasicDto
;
import
com.liquidnet.service.candy.param.BackCouponParam
;
import
com.liquidnet.service.candy.service.ICandyCouponService
;
...
...
@@ -163,7 +164,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
continue
;
}
}
CandyCouponVo
baseVo
=
CouponBaseUtil
.
getGoodCouponUserVo
(
dtoItem
,
priceTotal
,
goodId
);
CandyCouponVo
baseVo
=
CouponBaseUtil
.
getGoodCouponUserVo
(
dtoItem
,
priceTotal
,
goodId
,
dtoList
.
size
()
);
if
(
dtoItem
.
getExclusive
().
equals
(
1
))
{
//会员券
memberCoupon
.
add
(
baseVo
);
}
else
{
//非会员券
...
...
@@ -185,7 +186,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
List
<
CandyUserCouponBasicDto
>
dtoList
=
redisDataUtils
.
getCouponByUid
(
uid
);
int
canUse
=
0
;
for
(
CandyUserCouponBasicDto
dtoItem
:
dtoList
)
{
CandyCouponVo
baseVo
=
CouponBaseUtil
.
getGoodCouponUserVo
(
dtoItem
,
priceTotal
,
goodId
);
CandyCouponVo
baseVo
=
CouponBaseUtil
.
getGoodCouponUserVo
(
dtoItem
,
priceTotal
,
goodId
,
dtoList
.
size
()
);
if
(
baseVo
.
getState
().
equals
(
1
))
{
//可用
canUse
=
1
;
break
;
...
...
@@ -197,13 +198,13 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public
List
<
CandyCouponVo
>
myAdvanceCoupon
()
{
public
List
<
CandyCouponVo
>
myAdvanceCoupon
(
String
performanceId
,
String
timesId
,
String
ticketId
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
List
<
CandyUserCouponBasicDto
>
dtoList
=
redisDataUtils
.
getCouponByUid
(
uid
);
List
<
CandyCouponVo
>
advanceCoupon
=
ObjectUtil
.
getCandyCouponVoArrayList
();
for
(
CandyUserCouponBasicDto
dtoItem
:
dtoList
)
{
if
(
dtoItem
.
getBusiType
().
equals
(
3
))
{
CandyCouponVo
baseVo
=
CouponBaseUtil
.
get
BaseCouponUserVo
(
dtoItem
);
CandyCouponVo
baseVo
=
CouponBaseUtil
.
get
PerformanceCouponUserVo
(
dtoItem
,
BigDecimal
.
ZERO
,
performanceId
,
timesId
,
ticketId
);
if
(
baseVo
.
getState
().
equals
(
1
))
{
advanceCoupon
.
add
(
baseVo
);
}
else
{
...
...
@@ -227,7 +228,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public
CandyUseResultVo
useCoupon
(
String
uCouponId
,
String
content
,
String
totalPrice
)
{
public
CandyUseResultVo
useCoupon
(
String
uCouponId
,
String
content
,
String
totalPrice
,
String
performanceId
,
String
timesId
,
String
ticketId
,
String
goodId
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
CandyUseResultVo
vo
=
CandyUseResultVo
.
getNew
();
List
<
CandyUserCouponBasicDto
>
dtoList
=
CouponBaseUtil
.
useCoupon
(
redisDataUtils
.
getCouponByUid
(
uid
),
uCouponId
,
content
);
...
...
@@ -264,6 +265,36 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
vo
.
setValue
(
BigDecimal
.
valueOf
(
0
));
break
;
}
Boolean
isTarget
=
false
;
for
(
CandyCouponRuleDto
ruleItem:
dto
.
getUseRules
())
{
switch
(
ruleItem
.
getUseScope
())
{
case
80
:
//商品
isTarget
=
CouponBaseUtil
.
isTargetCoupon
(
ruleItem
.
getBusiId
(),
dto
.
getCouType
(),
goodId
,
new
BigDecimal
(
totalPrice
),
dto
.
getValOver
());
break
;
case
90
:
//演出
isTarget
=
CouponBaseUtil
.
isTargetCoupon
(
ruleItem
.
getBusiId
(),
dto
.
getCouType
(),
performanceId
,
new
BigDecimal
(
totalPrice
),
dto
.
getValOver
());
break
;
case
91
:
//场次
isTarget
=
CouponBaseUtil
.
isTargetCoupon
(
ruleItem
.
getBusiId
(),
dto
.
getCouType
(),
timesId
,
new
BigDecimal
(
totalPrice
),
dto
.
getValOver
());
break
;
case
92
:
//票
isTarget
=
CouponBaseUtil
.
isTargetCoupon
(
ruleItem
.
getBusiId
(),
dto
.
getCouType
(),
ticketId
,
new
BigDecimal
(
totalPrice
),
dto
.
getValOver
());
break
;
default
:
isTarget
=
false
;
break
;
}
if
(
dto
.
getUseRules
().
size
()
>
1
&&
dto
.
getCouType
().
equals
(
4
))
{
isTarget
=
false
;
}
}
if
(!
isTarget
){
vo
.
setCouType
(-
1
);
vo
.
setValue
(
BigDecimal
.
ZERO
);
}
if
(
vo
.
getCouType
()
!=
-
1
)
{
redisDataUtils
.
setCouponByUid
(
uid
,
dtoList
);
//入库
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/util/CouponBaseUtil.java
View file @
583fb8ad
...
...
@@ -109,6 +109,9 @@ public class CouponBaseUtil {
isTarget
=
false
;
break
;
}
if
(
dtoItem
.
getUseRules
().
size
()
>
1
&&
dtoItem
.
getCouType
().
equals
(
4
))
{
isTarget
=
false
;
}
}
}
//券类别
...
...
@@ -135,7 +138,8 @@ public class CouponBaseUtil {
*/
public
static
CandyCouponVo
getGoodCouponUserVo
(
CandyUserCouponBasicDto
dtoItem
,
BigDecimal
priceTotal
,
String
goodId
)
{
String
goodId
,
Integer
size
)
{
boolean
isTarget
=
false
;
LocalDateTime
now
=
LocalDateTime
.
now
();
CandyCouponVo
vo
=
CandyCouponVo
.
getNew
();
...
...
@@ -172,6 +176,9 @@ public class CouponBaseUtil {
isTarget
=
false
;
break
;
}
if
(
size
>
1
&&
dtoItem
.
getCouType
().
equals
(
4
))
{
isTarget
=
false
;
}
}
}
//券类别
...
...
@@ -181,6 +188,7 @@ public class CouponBaseUtil {
vo
.
setCouType
(
dtoItem
.
getCouType
());
}
int
state
=
getCouponState
(
now
,
dtoItem
.
getExpireAt
(),
dtoItem
.
getEffectAt
(),
dtoItem
.
getState
());
if
(
isTarget
)
{
vo
.
setState
(
state
);
}
else
{
...
...
@@ -230,7 +238,7 @@ public class CouponBaseUtil {
if
(
state
.
equals
(
1
))
{
if
(
currentTime
.
isAfter
(
expireAt
))
{
data
=
3
;
}
else
if
(
currentTime
.
isBefore
(
effectAt
))
{
}
else
if
(
currentTime
.
isBefore
(
effectAt
))
{
data
=
31
;
}
else
{
data
=
state
;
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/KylinOrderTicketsServiceImpl.java
View file @
583fb8ad
...
...
@@ -178,7 +178,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
//通用判断时间
if
(
payOrderParam
.
getAdvanceCode
()
!=
null
)
{
advanceMap
=
orderUtils
.
useCoupon
(
payOrderParam
.
getAdvanceCode
(),
""
,
BigDecimal
.
ZERO
);
advanceMap
=
orderUtils
.
useCoupon
(
payOrderParam
.
getAdvanceCode
(),
""
,
BigDecimal
.
ZERO
,
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTimeId
(),
payOrderParam
.
getTicketId
()
);
Integer
typeVoucher
=
(
Integer
)
advanceMap
.
get
(
"type"
);
if
(
typeVoucher
.
equals
(-
1
))
{
throw
new
Exception
(
"券不可用"
);
...
...
@@ -351,7 +351,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
if
(
payOrderParam
.
getVoucherCode
()
!=
null
)
{
HashMap
<
String
,
Object
>
hashMap
=
orderUtils
.
useCoupon
(
payOrderParam
.
getVoucherCode
(),
content
,
orderTickets
.
getPriceTotal
());
HashMap
<
String
,
Object
>
hashMap
=
orderUtils
.
useCoupon
(
payOrderParam
.
getVoucherCode
(),
content
,
orderTickets
.
getPriceTotal
()
,
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTimeId
(),
payOrderParam
.
getTicketId
()
);
BigDecimal
priceVoucher
=
(
BigDecimal
)
hashMap
.
get
(
"voucher"
);
Integer
typeVoucher
=
(
Integer
)
hashMap
.
get
(
"type"
);
if
(
typeVoucher
.
equals
(-
1
))
{
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/OrderUtils.java
View file @
583fb8ad
...
...
@@ -180,12 +180,17 @@ public class OrderUtils {
* @param totalPrice 订单总价
* @return
*/
public
HashMap
<
String
,
Object
>
useCoupon
(
String
uCouponId
,
String
content
,
BigDecimal
totalPrice
)
{
public
HashMap
<
String
,
Object
>
useCoupon
(
String
uCouponId
,
String
content
,
BigDecimal
totalPrice
,
String
performanceId
,
String
timesId
,
String
ticketId
)
{
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
params
.
add
(
"uCouponId"
,
uCouponId
);
params
.
add
(
"content"
,
content
);
params
.
add
(
"totalPrice"
,
totalPrice
.
toString
());
params
.
add
(
"goodId"
,
"-1"
);
params
.
add
(
"performanceId"
,
performanceId
);
params
.
add
(
"timeId"
,
timesId
);
params
.
add
(
"ticketId"
,
ticketId
);
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Authorization"
,
"Bearer "
+
CurrentUtil
.
getToken
());
...
...
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