记得上下班打卡 | 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
f39d5cfd
Commit
f39d5cfd
authored
Aug 20, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 RedisDataUtils
parent
1b49e9a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
34 deletions
+26
-34
CandyCouponController.java
...idnet/service/candy/controller/CandyCouponController.java
+4
-15
CandyCouponServiceImpl.java
...et/service/candy/service/impl/CandyCouponServiceImpl.java
+22
-19
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 @
f39d5cfd
...
...
@@ -2,13 +2,8 @@ package com.liquidnet.service.candy.controller;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.candy.dto.CandyUserCouponBasicDto
;
import
com.liquidnet.service.candy.service.ICandyCouponService
;
import
com.liquidnet.service.candy.util.CouponBaseUtil
;
import
com.liquidnet.service.candy.util.ObjectUtil
;
import
com.liquidnet.service.candy.util.RedisDataUtils
;
import
com.liquidnet.service.candy.vo.CandyCouponVo
;
import
com.liquidnet.service.candy.vo.CandyMyCouponListVo
;
import
com.liquidnet.service.candy.vo.CandyUseResultVo
;
...
...
@@ -17,15 +12,9 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -132,7 +121,7 @@ public class CandyCouponController {
}
//判断券是否可用并使用
@
Ge
tMapping
(
"use"
)
@
Pos
tMapping
(
"use"
)
@ApiOperation
(
"券使用"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"uCouponId"
,
value
=
"券唯一表示id"
,
required
=
true
),
...
...
@@ -146,7 +135,7 @@ public class CandyCouponController {
}
//回退券
@
Ge
tMapping
(
"useBack"
)
@
Pos
tMapping
(
"useBack"
)
@ApiOperation
(
"回退券"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"uCouponId"
,
value
=
"券唯一表示id"
,
required
=
true
),
...
...
@@ -157,7 +146,7 @@ public class CandyCouponController {
}
//兑换券
@
Ge
tMapping
(
"receive"
)
@
Pos
tMapping
(
"receive"
)
@ApiOperation
(
"领取券"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"ccode"
,
value
=
"兑换码"
,
required
=
true
),
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/service/impl/CandyCouponServiceImpl.java
View file @
f39d5cfd
...
...
@@ -186,27 +186,28 @@ public class CandyCouponServiceImpl extends ServiceImpl<CandyCouponMapper, Candy
if
(
dtoList
==
null
)
{
return
null
;
}
else
{
CandyUserCouponBasicDto
dto
=
CouponBaseUtil
.
getSingleDtoByUCouponId
(
redisDataUtils
.
getCouponByUid
(
uid
),
uCouponId
);
switch
(
dto
.
getCouType
()){
//券类型[1-代金券|2-满减券|3-兑换券|4-折扣券]
case
1
:
vo
.
setValue
(
dto
.
getValFace
());
break
;
case
2
:
vo
.
setValue
(
dto
.
getValMinus
());
break
;
case
3
:
vo
.
setValue
(
BigDecimal
.
valueOf
(-
1
));
break
;
case
4
:
vo
.
setValue
(
dto
.
getDiscount
());
break
;
default
:
vo
.
setValue
(
BigDecimal
.
valueOf
(
0
));
break
;
}
vo
.
setCouType
(
dto
.
getCouType
());
redisDataUtils
.
setCouponByUid
(
uid
,
dtoList
);
//TODO 入库
}
CandyUserCouponBasicDto
dto
=
CouponBaseUtil
.
getSingleDtoByUCouponId
(
redisDataUtils
.
getCouponByUid
(
uid
),
uCouponId
);
switch
(
dto
.
getCouType
()){
//券类型[1-代金券|2-满减券|3-兑换券|4-折扣券]
case
1
:
vo
.
setValue
(
dto
.
getValFace
());
break
;
case
2
:
vo
.
setValue
(
dto
.
getValMinus
());
break
;
case
3
:
vo
.
setValue
(
BigDecimal
.
valueOf
(-
1
));
break
;
case
4
:
vo
.
setValue
(
dto
.
getDiscount
());
break
;
default
:
vo
.
setValue
(
BigDecimal
.
valueOf
(
0
));
break
;
}
vo
.
setCouType
(
dto
.
getCouType
());
return
vo
;
}
...
...
@@ -218,6 +219,7 @@ public class CandyCouponServiceImpl extends ServiceImpl<CandyCouponMapper, Candy
return
false
;
}
else
{
redisDataUtils
.
setCouponByUid
(
uid
,
dtoList
);
//TODO 入库
}
return
true
;
}
...
...
@@ -235,6 +237,7 @@ public class CandyCouponServiceImpl extends ServiceImpl<CandyCouponMapper, Candy
redisDataUtils
.
delCouponByCode
(
ccode
);
//添加baseDto -> baseDtoList
redisDataUtils
.
addCouponByUid
(
uid
,
baseDto
);
//TODO 入库
}
else
{
return
false
;
}
...
...
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