记得上下班打卡 | 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
9503ebd1
Commit
9503ebd1
authored
Aug 25, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口 增加参数校验
parent
7e7bcb4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
18 deletions
+36
-18
CandyCouponController.java
...idnet/service/candy/controller/CandyCouponController.java
+28
-10
CandyCouponServiceImpl.java
...et/service/candy/service/impl/CandyCouponServiceImpl.java
+8
-8
No files found.
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/controller/CandyCouponController.java
View file @
9503ebd1
...
@@ -12,8 +12,11 @@ import io.swagger.annotations.ApiImplicitParam;
...
@@ -12,8 +12,11 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -28,6 +31,7 @@ import java.util.List;
...
@@ -28,6 +31,7 @@ import java.util.List;
*/
*/
@Api
(
tags
=
"券相关接口"
)
@Api
(
tags
=
"券相关接口"
)
@RestController
@RestController
@Validated
@RequestMapping
(
"/candy-coupon"
)
@RequestMapping
(
"/candy-coupon"
)
public
class
CandyCouponController
{
public
class
CandyCouponController
{
...
@@ -40,7 +44,7 @@ public class CandyCouponController {
...
@@ -40,7 +44,7 @@ public class CandyCouponController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"Integer"
,
name
=
"type"
,
value
=
"类型 1可用 2过期/已使用 "
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"Integer"
,
name
=
"type"
,
value
=
"类型 1可用 2过期/已使用 "
,
required
=
true
),
})
})
public
ResponseDto
<
CandyMyCouponListVo
>
myCoupon
(
@RequestParam
(
"type"
)
Integer
type
)
{
public
ResponseDto
<
CandyMyCouponListVo
>
myCoupon
(
@RequestParam
(
"type"
)
@NotNull
Integer
type
)
{
return
ResponseDto
.
success
(
candyCouponService
.
myCoupon
(
type
));
return
ResponseDto
.
success
(
candyCouponService
.
myCoupon
(
type
));
}
}
...
@@ -54,7 +58,11 @@ public class CandyCouponController {
...
@@ -54,7 +58,11 @@ public class CandyCouponController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"ticketId"
,
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
),
@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
,
@RequestParam
(
"type"
)
Integer
type
)
{
public
ResponseDto
<
CandyMyCouponListVo
>
preUsePerformanceCoupon
(
@RequestParam
(
"priceTotal"
)
@NotNull
BigDecimal
priceTotal
,
@RequestParam
(
"performanceId"
)
@NotNull
@NotBlank
String
performanceId
,
@RequestParam
(
"timeId"
)
@NotNull
@NotBlank
String
timeId
,
@RequestParam
(
"ticketId"
)
@NotNull
@NotBlank
String
ticketId
,
@RequestParam
(
"type"
)
@NotNull
Integer
type
)
{
return
ResponseDto
.
success
(
candyCouponService
.
preUsePerformanceCoupon
(
priceTotal
,
performanceId
,
timeId
,
ticketId
,
type
));
return
ResponseDto
.
success
(
candyCouponService
.
preUsePerformanceCoupon
(
priceTotal
,
performanceId
,
timeId
,
ticketId
,
type
));
}
}
...
@@ -67,7 +75,10 @@ public class CandyCouponController {
...
@@ -67,7 +75,10 @@ public class CandyCouponController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"timeId"
,
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
=
"String"
,
name
=
"ticketId"
,
value
=
"票id"
,
required
=
true
),
})
})
public
ResponseDto
<
HashMap
<
String
,
Integer
>>
preCanUsePerformanceCoupon
(
@RequestParam
(
"priceTotal"
)
BigDecimal
priceTotal
,
@RequestParam
(
"performanceId"
)
String
performanceId
,
@RequestParam
(
"timeId"
)
String
timeId
,
@RequestParam
(
"ticketId"
)
String
ticketId
)
{
public
ResponseDto
<
HashMap
<
String
,
Integer
>>
preCanUsePerformanceCoupon
(
@RequestParam
(
"priceTotal"
)
@NotNull
BigDecimal
priceTotal
,
@RequestParam
(
"performanceId"
)
@NotNull
@NotBlank
String
performanceId
,
@RequestParam
(
"timeId"
)
@NotNull
@NotBlank
String
timeId
,
@RequestParam
(
"ticketId"
)
@NotNull
@NotBlank
String
ticketId
)
{
HashMap
<
String
,
Integer
>
hashMap
=
CollectionUtil
.
mapStringInteger
();
HashMap
<
String
,
Integer
>
hashMap
=
CollectionUtil
.
mapStringInteger
();
hashMap
.
put
(
"canUse"
,
candyCouponService
.
preCanUsePerformanceCoupon
(
priceTotal
,
performanceId
,
timeId
,
ticketId
));
hashMap
.
put
(
"canUse"
,
candyCouponService
.
preCanUsePerformanceCoupon
(
priceTotal
,
performanceId
,
timeId
,
ticketId
));
return
ResponseDto
.
success
(
hashMap
);
return
ResponseDto
.
success
(
hashMap
);
...
@@ -83,7 +94,10 @@ public class CandyCouponController {
...
@@ -83,7 +94,10 @@ public class CandyCouponController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"produceId"
,
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
),
@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
,
@RequestParam
(
"type"
)
Integer
type
)
{
public
ResponseDto
<
CandyMyCouponListVo
>
preUseGoodCoupon
(
@RequestParam
(
"priceTotal"
)
@NotNull
BigDecimal
priceTotal
,
@RequestParam
(
"goodId"
)
@NotNull
@NotBlank
String
goodId
,
@RequestParam
(
"produceId"
)
@NotNull
@NotBlank
String
produceId
,
@RequestParam
(
"type"
)
@NotNull
Integer
type
)
{
return
ResponseDto
.
success
(
candyCouponService
.
preUseGoodCoupon
(
priceTotal
,
goodId
,
produceId
,
type
));
return
ResponseDto
.
success
(
candyCouponService
.
preUseGoodCoupon
(
priceTotal
,
goodId
,
produceId
,
type
));
}
}
...
@@ -95,7 +109,9 @@ public class CandyCouponController {
...
@@ -95,7 +109,9 @@ public class CandyCouponController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"goodId"
,
value
=
"演出id"
,
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
=
"String"
,
name
=
"produceId"
,
value
=
"场次id"
,
required
=
true
),
})
})
public
ResponseDto
<
HashMap
<
String
,
Integer
>>
preCanUseGoodCoupon
(
@RequestParam
(
"priceTotal"
)
BigDecimal
priceTotal
,
@RequestParam
(
"goodId"
)
String
goodId
,
@RequestParam
(
"produceId"
)
String
produceId
)
{
public
ResponseDto
<
HashMap
<
String
,
Integer
>>
preCanUseGoodCoupon
(
@RequestParam
(
"priceTotal"
)
@NotNull
BigDecimal
priceTotal
,
@RequestParam
(
"goodId"
)
@NotNull
@NotBlank
String
goodId
,
@RequestParam
(
"produceId"
)
@NotNull
@NotBlank
String
produceId
)
{
HashMap
<
String
,
Integer
>
hashMap
=
CollectionUtil
.
mapStringInteger
();
HashMap
<
String
,
Integer
>
hashMap
=
CollectionUtil
.
mapStringInteger
();
hashMap
.
put
(
"canUse"
,
candyCouponService
.
preCanUseGoodCoupon
(
priceTotal
,
goodId
,
produceId
));
hashMap
.
put
(
"canUse"
,
candyCouponService
.
preCanUseGoodCoupon
(
priceTotal
,
goodId
,
produceId
));
return
ResponseDto
.
success
(
hashMap
);
return
ResponseDto
.
success
(
hashMap
);
...
@@ -115,7 +131,7 @@ public class CandyCouponController {
...
@@ -115,7 +131,7 @@ public class CandyCouponController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"uCouponId"
,
value
=
"券唯一表示id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"uCouponId"
,
value
=
"券唯一表示id"
,
required
=
true
),
})
})
public
ResponseDto
<
HashMap
<
String
,
Integer
>>
stateCoupon
(
@RequestParam
(
"uCouponId"
)
String
uCouponId
)
{
public
ResponseDto
<
HashMap
<
String
,
Integer
>>
stateCoupon
(
@RequestParam
(
"uCouponId"
)
@NotNull
@NotBlank
String
uCouponId
)
{
Integer
result
=
candyCouponService
.
stateCoupon
(
uCouponId
);
Integer
result
=
candyCouponService
.
stateCoupon
(
uCouponId
);
if
(
result
==
null
)
{
if
(
result
==
null
)
{
return
ResponseDto
.
failure
();
return
ResponseDto
.
failure
();
...
@@ -133,7 +149,9 @@ public class CandyCouponController {
...
@@ -133,7 +149,9 @@ public class CandyCouponController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"content"
,
value
=
"消费内容"
,
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
=
"totalPrice"
,
value
=
"消费价格"
,
required
=
true
),
})
})
public
ResponseDto
<
CandyUseResultVo
>
useCoupon
(
@RequestParam
(
"uCouponId"
)
String
uCouponId
,
@RequestParam
(
"content"
)
String
content
,
@RequestParam
(
"totalPrice"
)
String
totalPrice
)
{
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
);
CandyUseResultVo
result
=
candyCouponService
.
useCoupon
(
uCouponId
,
content
,
totalPrice
);
if
(
result
==
null
)
{
if
(
result
==
null
)
{
return
ResponseDto
.
failure
();
return
ResponseDto
.
failure
();
...
@@ -147,7 +165,7 @@ public class CandyCouponController {
...
@@ -147,7 +165,7 @@ public class CandyCouponController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"uCouponId"
,
value
=
"券唯一表示id(逗号隔开的字符串)"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"uCouponId"
,
value
=
"券唯一表示id(逗号隔开的字符串)"
,
required
=
true
),
})
})
public
ResponseDto
<
Boolean
>
useBackCoupon
(
@RequestParam
(
"uCouponId"
)
String
uCouponId
)
{
public
ResponseDto
<
Boolean
>
useBackCoupon
(
@RequestParam
(
"uCouponId"
)
@NotNull
@NotBlank
String
uCouponId
)
{
candyCouponService
.
useBackCoupon
(
uCouponId
);
candyCouponService
.
useBackCoupon
(
uCouponId
);
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
...
@@ -158,7 +176,7 @@ public class CandyCouponController {
...
@@ -158,7 +176,7 @@ public class CandyCouponController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"ccode"
,
value
=
"兑换码"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"ccode"
,
value
=
"兑换码"
,
required
=
true
),
})
})
public
ResponseDto
<
Boolean
>
receiveCoupon
(
@RequestParam
(
"ccode"
)
String
ccode
)
{
public
ResponseDto
<
Boolean
>
receiveCoupon
(
@RequestParam
(
"ccode"
)
@NotNull
@NotBlank
String
ccode
)
{
Boolean
result
=
candyCouponService
.
receiveCoupon
(
ccode
);
Boolean
result
=
candyCouponService
.
receiveCoupon
(
ccode
);
if
(
result
)
{
if
(
result
)
{
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
...
@@ -173,7 +191,7 @@ public class CandyCouponController {
...
@@ -173,7 +191,7 @@ public class CandyCouponController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"ccode"
,
value
=
"兑换码"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"ccode"
,
value
=
"兑换码"
,
required
=
true
),
})
})
public
ResponseDto
<
CandyCouponVo
>
receiveCouponDetails
(
@RequestParam
(
"ccode"
)
String
ccode
)
{
public
ResponseDto
<
CandyCouponVo
>
receiveCouponDetails
(
@RequestParam
(
"ccode"
)
@NotNull
@NotBlank
String
ccode
)
{
CandyCouponVo
result
=
candyCouponService
.
receiveCouponDetails
(
ccode
);
CandyCouponVo
result
=
candyCouponService
.
receiveCouponDetails
(
ccode
);
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
return
ResponseDto
.
success
(
result
);
return
ResponseDto
.
success
(
result
);
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/service/impl/CandyCouponServiceImpl.java
View file @
9503ebd1
...
@@ -73,7 +73,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
...
@@ -73,7 +73,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
}
@Override
@Override
public
CandyMyCouponListVo
preUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
,
Integer
type
)
{
public
CandyMyCouponListVo
preUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
,
Integer
type
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
List
<
CandyUserCouponBasicDto
>
dtoList
=
redisDataUtils
.
getCouponByUid
(
uid
);
List
<
CandyUserCouponBasicDto
>
dtoList
=
redisDataUtils
.
getCouponByUid
(
uid
);
CandyMyCouponListVo
vo
=
CandyMyCouponListVo
.
getNew
();
CandyMyCouponListVo
vo
=
CandyMyCouponListVo
.
getNew
();
...
@@ -124,7 +124,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
...
@@ -124,7 +124,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
}
@Override
@Override
public
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
String
produceId
,
Integer
type
)
{
public
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
String
produceId
,
Integer
type
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
List
<
CandyUserCouponBasicDto
>
dtoList
=
redisDataUtils
.
getCouponByUid
(
uid
);
List
<
CandyUserCouponBasicDto
>
dtoList
=
redisDataUtils
.
getCouponByUid
(
uid
);
CandyMyCouponListVo
vo
=
CandyMyCouponListVo
.
getNew
();
CandyMyCouponListVo
vo
=
CandyMyCouponListVo
.
getNew
();
...
@@ -201,7 +201,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
...
@@ -201,7 +201,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
if
(
dto
==
null
)
{
if
(
dto
==
null
)
{
return
null
;
//券不存在
return
null
;
//券不存在
}
}
return
CouponBaseUtil
.
getCouponState
(
LocalDateTime
.
now
(),
dto
.
getExpireAt
(),
dto
.
getEffectAt
(),
dto
.
getState
());
return
CouponBaseUtil
.
getCouponState
(
LocalDateTime
.
now
(),
dto
.
getExpireAt
(),
dto
.
getEffectAt
(),
dto
.
getState
());
}
}
@Override
@Override
...
@@ -288,9 +288,9 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
...
@@ -288,9 +288,9 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
public
Boolean
receiveCoupon
(
String
ccode
)
{
public
Boolean
receiveCoupon
(
String
ccode
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
CandyCouponCodeDto
dto
=
redisDataUtils
.
getCouponByCode
(
ccode
);
CandyCouponCodeDto
dto
=
redisDataUtils
.
getCouponByCode
(
ccode
);
if
(
dto
.
getState
().
equals
(
0
)
)
{
//判断可领
if
(
dto
!=
null
&&
dto
.
getState
().
equals
(
0
)
)
{
//判断可领
CandyCouponInfoDto
infoDto
=
redisDataUtils
.
getCouponInfo
(
dto
.
getCouponId
());
CandyCouponInfoDto
infoDto
=
redisDataUtils
.
getCouponInfo
(
dto
.
getCouponId
());
if
(!
CouponBaseUtil
.
CandyCanReceive
(
infoDto
))
{
if
(!
CouponBaseUtil
.
CandyCanReceive
(
infoDto
))
{
return
false
;
return
false
;
}
}
String
uCouponId
=
IDGenerator
.
get32UUID
();
String
uCouponId
=
IDGenerator
.
get32UUID
();
...
@@ -317,16 +317,16 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
...
@@ -317,16 +317,16 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
public
CandyCouponVo
receiveCouponDetails
(
String
ccode
)
{
public
CandyCouponVo
receiveCouponDetails
(
String
ccode
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
CandyCouponCodeDto
dto
=
redisDataUtils
.
getCouponByCode
(
ccode
);
CandyCouponCodeDto
dto
=
redisDataUtils
.
getCouponByCode
(
ccode
);
if
(
dto
.
getState
().
equals
(
0
))
{
//判断可领
if
(
dto
!=
null
&&
dto
.
getState
().
equals
(
0
))
{
//判断可领
CandyCouponInfoDto
infoDto
=
redisDataUtils
.
getCouponInfo
(
dto
.
getCouponId
());
CandyCouponInfoDto
infoDto
=
redisDataUtils
.
getCouponInfo
(
dto
.
getCouponId
());
if
(!
CouponBaseUtil
.
CandyCanReceive
(
infoDto
))
{
if
(!
CouponBaseUtil
.
CandyCanReceive
(
infoDto
))
{
return
null
;
return
null
;
}
}
String
uCouponId
=
IDGenerator
.
get32UUID
();
String
uCouponId
=
IDGenerator
.
get32UUID
();
//构建baseDto
//构建baseDto
CandyUserCouponBasicDto
baseDto
=
CandyUserCouponBasicDto
.
getNew
().
copyToRedisBaseCoupon
(
uCouponId
,
uid
,
ccode
,
infoDto
);
CandyUserCouponBasicDto
baseDto
=
CandyUserCouponBasicDto
.
getNew
().
copyToRedisBaseCoupon
(
uCouponId
,
uid
,
ccode
,
infoDto
);
return
CouponBaseUtil
.
getBaseCouponUserVo
(
baseDto
);
return
CouponBaseUtil
.
getBaseCouponUserVo
(
baseDto
);
}
else
{
}
else
{
return
null
;
return
null
;
}
}
}
}
...
...
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