记得上下班打卡 | 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
4d1b9375
Commit
4d1b9375
authored
Aug 25, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
券相关接口提交
parent
222f36ef
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
34 deletions
+111
-34
ICandyCouponService.java
.../liquidnet/service/candy/service/ICandyCouponService.java
+5
-3
CandyCouponVo.java
...in/java/com/liquidnet/service/candy/vo/CandyCouponVo.java
+1
-1
CandyUseResultVo.java
...java/com/liquidnet/service/candy/vo/CandyUseResultVo.java
+1
-1
CandyCouponController.java
...idnet/service/candy/controller/CandyCouponController.java
+27
-8
CandyCouponServiceImpl.java
...et/service/candy/service/impl/CandyCouponServiceImpl.java
+61
-8
CouponBaseUtil.java
...java/com/liquidnet/service/candy/util/CouponBaseUtil.java
+16
-13
No files found.
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/service/ICandyCouponService.java
View file @
4d1b9375
...
...
@@ -19,13 +19,13 @@ import java.util.List;
*/
public
interface
ICandyCouponService
{
CandyMyCouponListVo
myCoupon
();
CandyMyCouponListVo
myCoupon
(
Integer
type
);
CandyMyCouponListVo
preUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
);
CandyMyCouponListVo
preUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
,
Integer
type
);
Integer
preCanUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
);
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
String
produceId
);
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
String
produceId
,
Integer
type
);
Integer
preCanUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
String
produceId
);
...
...
@@ -38,4 +38,6 @@ public interface ICandyCouponService {
Boolean
useBackCoupon
(
String
uCouponId
);
Boolean
receiveCoupon
(
String
ccode
);
CandyCouponVo
receiveCouponDetails
(
String
ccode
);
}
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/vo/CandyCouponVo.java
View file @
4d1b9375
...
...
@@ -27,7 +27,7 @@ public class CandyCouponVo implements Serializable, Cloneable {
// private Integer exclusive;//专享标识[0-常规|1-会员礼包]
@ApiModelProperty
(
value
=
"业务类别[0-全场|1-演出|2-商品|3-优先购]"
,
example
=
"0"
)
private
Integer
busiType
;
@ApiModelProperty
(
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券]"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券
| 101-优先券
]"
,
example
=
"1"
)
private
Integer
couType
;
@ApiModelProperty
(
value
=
"[0-用户输入兑换|1-发放至用户]"
,
example
=
"1"
)
private
Integer
bindType
;
...
...
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/vo/CandyUseResultVo.java
View file @
4d1b9375
...
...
@@ -15,7 +15,7 @@ public class CandyUseResultVo implements Serializable, Cloneable {
private
static
final
long
serialVersionUID
=
4073256621782131607L
;
@ApiModelProperty
(
value
=
"优惠内容"
,
example
=
"1"
)
private
BigDecimal
value
;
@ApiModelProperty
(
value
=
"券类型[
1-代金券|2-满减券|3-兑换券|4-折扣
券]"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"券类型[
-1-不可用 | 1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先
券]"
,
example
=
"1"
)
private
Integer
couType
;
private
static
final
CandyUseResultVo
obj
=
new
CandyUseResultVo
();
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/controller/CandyCouponController.java
View file @
4d1b9375
...
...
@@ -37,8 +37,11 @@ public class CandyCouponController {
//我的券列表
@GetMapping
(
"my"
)
@ApiOperation
(
"我的券列表"
)
public
ResponseDto
<
CandyMyCouponListVo
>
myCoupon
()
{
return
ResponseDto
.
success
(
candyCouponService
.
myCoupon
());
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"Integer"
,
name
=
"type"
,
value
=
"类型 1可用 2过期/已使用 "
,
required
=
true
),
})
public
ResponseDto
<
CandyMyCouponListVo
>
myCoupon
(
@RequestParam
(
"type"
)
Integer
type
)
{
return
ResponseDto
.
success
(
candyCouponService
.
myCoupon
(
type
));
}
//要使用券列表 - 演出
...
...
@@ -49,9 +52,10 @@ public class CandyCouponController {
@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
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"Integer"
,
name
=
"type"
,
value
=
"类型 1可用 2过期/已使用 "
,
required
=
true
),
})
public
ResponseDto
<
CandyMyCouponListVo
>
preUsePerformanceCoupon
(
@RequestParam
(
"priceTotal"
)
BigDecimal
priceTotal
,
@RequestParam
(
"performanceId"
)
String
performanceId
,
@RequestParam
(
"timeId"
)
String
timeId
,
@RequestParam
(
"ticketId"
)
String
ticketId
)
{
return
ResponseDto
.
success
(
candyCouponService
.
preUsePerformanceCoupon
(
priceTotal
,
performanceId
,
timeId
,
ticketId
));
public
ResponseDto
<
CandyMyCouponListVo
>
preUsePerformanceCoupon
(
@RequestParam
(
"priceTotal"
)
BigDecimal
priceTotal
,
@RequestParam
(
"performanceId"
)
String
performanceId
,
@RequestParam
(
"timeId"
)
String
timeId
,
@RequestParam
(
"ticketId"
)
String
ticketId
,
@RequestParam
(
"type"
)
Integer
type
)
{
return
ResponseDto
.
success
(
candyCouponService
.
preUsePerformanceCoupon
(
priceTotal
,
performanceId
,
timeId
,
ticketId
,
type
));
}
// 是否可用券演出
...
...
@@ -77,9 +81,10 @@ public class CandyCouponController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"BigDecimal"
,
name
=
"priceTotal"
,
value
=
"待支付总金额"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"goodId"
,
value
=
"演出id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"produceId"
,
value
=
"场次id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"Integer"
,
name
=
"type"
,
value
=
"类型 1可用 2过期/已使用 "
,
required
=
true
),
})
public
ResponseDto
<
CandyMyCouponListVo
>
preUseGoodCoupon
(
@RequestParam
(
"priceTotal"
)
BigDecimal
priceTotal
,
@RequestParam
(
"goodId"
)
String
goodId
,
@RequestParam
(
"produceId"
)
String
produceId
)
{
return
ResponseDto
.
success
(
candyCouponService
.
preUseGoodCoupon
(
priceTotal
,
goodId
,
produceId
));
public
ResponseDto
<
CandyMyCouponListVo
>
preUseGoodCoupon
(
@RequestParam
(
"priceTotal"
)
BigDecimal
priceTotal
,
@RequestParam
(
"goodId"
)
String
goodId
,
@RequestParam
(
"produceId"
)
String
produceId
,
@RequestParam
(
"type"
)
Integer
type
)
{
return
ResponseDto
.
success
(
candyCouponService
.
preUseGoodCoupon
(
priceTotal
,
goodId
,
produceId
,
type
));
}
//是否可用券 - 商品
...
...
@@ -128,8 +133,8 @@ public class CandyCouponController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"content"
,
value
=
"消费内容"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"totalPrice"
,
value
=
"消费价格"
,
required
=
true
),
})
public
ResponseDto
<
CandyUseResultVo
>
useCoupon
(
@RequestParam
(
"uCouponId"
)
String
uCouponId
,
@RequestParam
(
"content"
)
String
content
,
@RequestParam
(
"totalPrice"
)
String
totalPrice
)
{
CandyUseResultVo
result
=
candyCouponService
.
useCoupon
(
uCouponId
,
content
,
totalPrice
);
public
ResponseDto
<
CandyUseResultVo
>
useCoupon
(
@RequestParam
(
"uCouponId"
)
String
uCouponId
,
@RequestParam
(
"content"
)
String
content
,
@RequestParam
(
"totalPrice"
)
String
totalPrice
)
{
CandyUseResultVo
result
=
candyCouponService
.
useCoupon
(
uCouponId
,
content
,
totalPrice
);
if
(
result
==
null
)
{
return
ResponseDto
.
failure
();
}
...
...
@@ -162,4 +167,18 @@ public class CandyCouponController {
}
}
//兑换券详情
@PostMapping
(
"receive/details"
)
@ApiOperation
(
"领取券详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"ccode"
,
value
=
"兑换码"
,
required
=
true
),
})
public
ResponseDto
<
CandyCouponVo
>
receiveCouponDetails
(
@RequestParam
(
"ccode"
)
String
ccode
)
{
CandyCouponVo
result
=
candyCouponService
.
receiveCouponDetails
(
ccode
);
if
(
result
!=
null
)
{
return
ResponseDto
.
success
(
result
);
}
else
{
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 @
4d1b9375
...
...
@@ -40,7 +40,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
private
QueueUtils
queueUtils
;
@Override
public
CandyMyCouponListVo
myCoupon
()
{
public
CandyMyCouponListVo
myCoupon
(
Integer
type
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
List
<
CandyUserCouponBasicDto
>
dtoList
=
redisDataUtils
.
getCouponByUid
(
uid
);
CandyMyCouponListVo
vo
=
CandyMyCouponListVo
.
getNew
();
...
...
@@ -48,6 +48,15 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
List
<
CandyCouponVo
>
myCoupon
=
ObjectUtil
.
getCandyCouponVoArrayList
();
for
(
CandyUserCouponBasicDto
dtoItem
:
dtoList
)
{
if
(
type
==
1
)
{
if
(
dtoItem
.
getState
().
equals
(
3
)
||
dtoItem
.
getState
().
equals
(
5
))
{
continue
;
}
}
else
if
(
type
==
2
)
{
if
(
dtoItem
.
getState
().
equals
(
1
))
{
continue
;
}
}
CandyCouponVo
baseVo
=
CouponBaseUtil
.
getBaseCouponUserVo
(
dtoItem
);
if
(
dtoItem
.
getExclusive
().
equals
(
1
))
{
//会员券
memberCoupon
.
add
(
baseVo
);
...
...
@@ -64,7 +73,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public
CandyMyCouponListVo
preUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
)
{
public
CandyMyCouponListVo
preUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
,
Integer
type
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
List
<
CandyUserCouponBasicDto
>
dtoList
=
redisDataUtils
.
getCouponByUid
(
uid
);
CandyMyCouponListVo
vo
=
CandyMyCouponListVo
.
getNew
();
...
...
@@ -72,6 +81,15 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
List
<
CandyCouponVo
>
myCoupon
=
ObjectUtil
.
getCandyCouponVoArrayList
();
for
(
CandyUserCouponBasicDto
dtoItem
:
dtoList
)
{
if
(
type
==
1
)
{
if
(
dtoItem
.
getState
().
equals
(
3
)
||
dtoItem
.
getState
().
equals
(
5
))
{
continue
;
}
}
else
if
(
type
==
2
)
{
if
(
dtoItem
.
getState
().
equals
(
1
))
{
continue
;
}
}
CandyCouponVo
baseVo
=
CouponBaseUtil
.
getPerformanceCouponUserVo
(
dtoItem
,
priceTotal
,
performanceId
,
timeId
,
ticketId
);
if
(
dtoItem
.
getExclusive
().
equals
(
1
))
{
//会员券
memberCoupon
.
add
(
baseVo
);
...
...
@@ -106,7 +124,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
String
produceId
)
{
public
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
String
produceId
,
Integer
type
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
List
<
CandyUserCouponBasicDto
>
dtoList
=
redisDataUtils
.
getCouponByUid
(
uid
);
CandyMyCouponListVo
vo
=
CandyMyCouponListVo
.
getNew
();
...
...
@@ -114,6 +132,15 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
List
<
CandyCouponVo
>
myCoupon
=
ObjectUtil
.
getCandyCouponVoArrayList
();
for
(
CandyUserCouponBasicDto
dtoItem
:
dtoList
)
{
if
(
type
==
1
)
{
if
(
dtoItem
.
getState
().
equals
(
3
)
||
dtoItem
.
getState
().
equals
(
5
))
{
continue
;
}
}
else
if
(
type
==
2
)
{
if
(
dtoItem
.
getState
().
equals
(
1
))
{
continue
;
}
}
CandyCouponVo
baseVo
=
CouponBaseUtil
.
getGoodCouponUserVo
(
dtoItem
,
priceTotal
,
goodId
,
produceId
);
if
(
dtoItem
.
getExclusive
().
equals
(
1
))
{
//会员券
memberCoupon
.
add
(
baseVo
);
...
...
@@ -174,7 +201,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
if
(
dto
==
null
)
{
return
null
;
//券不存在
}
return
CouponBaseUtil
.
getCouponState
(
LocalDateTime
.
now
(),
dto
.
getExpireAt
(),
dto
.
getState
());
return
CouponBaseUtil
.
getCouponState
(
LocalDateTime
.
now
(),
dto
.
getExpireAt
(),
dto
.
getEffectAt
(),
dto
.
getState
());
}
@Override
...
...
@@ -187,6 +214,11 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
vo
.
setValue
(
BigDecimal
.
ZERO
);
}
else
{
CandyUserCouponBasicDto
dto
=
CouponBaseUtil
.
getSingleDtoByUCouponId
(
redisDataUtils
.
getCouponByUid
(
uid
),
uCouponId
);
if
(
dto
.
getBusiType
().
equals
(
3
))
{
dto
.
setCouType
(
101
);
}
else
{
dto
.
setCouType
(
dto
.
getCouType
());
}
vo
.
setCouType
(
dto
.
getCouType
());
switch
(
dto
.
getCouType
())
{
//券类型[1-代金券|2-满减券|3-兑换券|4-折扣券]
case
1
:
...
...
@@ -238,12 +270,12 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
sqls
.
add
(
SqlMapping
.
get
(
"candy_coupon.back"
));
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
for
(
String
uCouponId
:
uCouponIdList
){
for
(
String
uCouponId
:
uCouponIdList
)
{
sqlsDataA
.
add
(
new
Object
[]{
uid
,
uCouponId
uid
,
uCouponId
});
}
String
sqlData
=
SqlMapping
.
gets
(
sqls
,
sqlsDataA
);
String
sqlData
=
SqlMapping
.
gets
(
sqls
,
sqlsDataA
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
CandyQueue
.
COUPON_BACK
.
getKey
(),
sqlData
...
...
@@ -256,8 +288,11 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
public
Boolean
receiveCoupon
(
String
ccode
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
CandyCouponCodeDto
dto
=
redisDataUtils
.
getCouponByCode
(
ccode
);
if
(
dto
.
getState
().
equals
(
0
))
{
//判断可领
if
(
dto
.
getState
().
equals
(
0
)
)
{
//判断可领
CandyCouponInfoDto
infoDto
=
redisDataUtils
.
getCouponInfo
(
dto
.
getCouponId
());
if
(!
CouponBaseUtil
.
CandyCanReceive
(
infoDto
)){
return
false
;
}
String
uCouponId
=
IDGenerator
.
get32UUID
();
//构建baseDto
CandyUserCouponBasicDto
baseDto
=
CandyUserCouponBasicDto
.
getNew
().
copyToRedisBaseCoupon
(
uCouponId
,
uid
,
ccode
,
infoDto
);
...
...
@@ -277,4 +312,22 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
return
true
;
}
@Override
public
CandyCouponVo
receiveCouponDetails
(
String
ccode
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
CandyCouponCodeDto
dto
=
redisDataUtils
.
getCouponByCode
(
ccode
);
if
(
dto
.
getState
().
equals
(
0
))
{
//判断可领
CandyCouponInfoDto
infoDto
=
redisDataUtils
.
getCouponInfo
(
dto
.
getCouponId
());
if
(!
CouponBaseUtil
.
CandyCanReceive
(
infoDto
)){
return
null
;
}
String
uCouponId
=
IDGenerator
.
get32UUID
();
//构建baseDto
CandyUserCouponBasicDto
baseDto
=
CandyUserCouponBasicDto
.
getNew
().
copyToRedisBaseCoupon
(
uCouponId
,
uid
,
ccode
,
infoDto
);
return
CouponBaseUtil
.
getBaseCouponUserVo
(
baseDto
);
}
else
{
return
null
;
}
}
}
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/util/CouponBaseUtil.java
View file @
4d1b9375
...
...
@@ -3,6 +3,7 @@ package com.liquidnet.service.candy.util;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.base.ResponseDto
;
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.vo.CandyCouponRulesVo
;
...
...
@@ -52,7 +53,7 @@ public class CouponBaseUtil {
}
else
{
vo
.
setCouType
(
dtoItem
.
getCouType
());
}
vo
.
setState
(
getCouponState
(
now
,
dtoItem
.
getExpireAt
(),
dtoItem
.
getState
()));
vo
.
setState
(
getCouponState
(
now
,
dtoItem
.
getExpireAt
(),
dtoItem
.
get
EffectAt
(),
dtoItem
.
get
State
()));
vo
.
setUseRules
(
rulesVoList
);
return
vo
;
}
...
...
@@ -115,7 +116,7 @@ public class CouponBaseUtil {
}
else
{
vo
.
setCouType
(
dtoItem
.
getCouType
());
}
int
state
=
getCouponState
(
now
,
dtoItem
.
getExpireAt
(),
dtoItem
.
getState
());
int
state
=
getCouponState
(
now
,
dtoItem
.
getExpireAt
(),
dtoItem
.
get
EffectAt
(),
dtoItem
.
get
State
());
if
(
isTarget
)
{
vo
.
setState
(
state
);
}
else
{
...
...
@@ -179,7 +180,7 @@ public class CouponBaseUtil {
}
else
{
vo
.
setCouType
(
dtoItem
.
getCouType
());
}
int
state
=
getCouponState
(
now
,
dtoItem
.
getExpireAt
(),
dtoItem
.
getState
());
int
state
=
getCouponState
(
now
,
dtoItem
.
getExpireAt
(),
dtoItem
.
get
EffectAt
(),
dtoItem
.
get
State
());
if
(
isTarget
)
{
vo
.
setState
(
state
);
}
else
{
...
...
@@ -222,11 +223,11 @@ public class CouponBaseUtil {
* @param state 券状态
* @return 判断过后的券状态
*/
public
static
Integer
getCouponState
(
LocalDateTime
currentTime
,
LocalDateTime
expireAt
,
Integer
state
)
{
public
static
Integer
getCouponState
(
LocalDateTime
currentTime
,
LocalDateTime
expireAt
,
LocalDateTime
effectAt
,
Integer
state
)
{
//券状态
Integer
data
;
if
(
state
.
equals
(
1
))
{
if
(
currentTime
.
isAfter
(
expireAt
))
{
if
(
currentTime
.
isAfter
(
expireAt
)
||
currentTime
.
isBefore
(
effectAt
)
)
{
data
=
3
;
}
else
{
data
=
state
;
...
...
@@ -305,17 +306,19 @@ public class CouponBaseUtil {
}
/**
*
领取券/兑换券
*
判断券是否在可兑换时间范围
*
* @param uid 用户id
* @param dto CandyCouponCodeDto
* @param dto
* @return
*/
public
static
CandyUserCouponBasicDto
receiveCoupon
(
String
uid
,
CandyCouponCodeDto
dto
)
{
CandyUserCouponBasicDto
baseDto
=
null
;
if
(
dto
.
getState
().
equals
(
0
))
{
//判断可领
baseDto
=
CandyUserCouponBasicDto
.
getNew
();
public
static
boolean
CandyCanReceive
(
CandyCouponInfoDto
dto
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
startTime
=
dto
.
getRedeemStart
();
LocalDateTime
endTime
=
dto
.
getRedeemStop
();
if
(
now
.
isAfter
(
startTime
)
&&
now
.
isBefore
(
endTime
))
{
return
true
;
}
else
{
return
false
;
}
return
baseDto
;
}
}
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