记得上下班打卡 | 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
192cbf84
Commit
192cbf84
authored
Mar 01, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~API:商城优惠券:展示+当前用户已领取数量;
parent
34447015
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
GoblinStoreCouponVo.java
.../liquidnet/service/goblin/dto/vo/GoblinStoreCouponVo.java
+6
-1
GoblinCouponController.java
...net/service/goblin/controller/GoblinCouponController.java
+16
-1
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinStoreCouponVo.java
View file @
192cbf84
...
...
@@ -13,7 +13,7 @@ import java.time.LocalDateTime;
@ApiModel
(
value
=
"GoblinStoreCouponVo"
,
description
=
"商铺活动:优惠券详情"
)
@Data
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@JsonIgnoreProperties
(
value
=
{
"receiveCount"
},
ignoreUnknown
=
true
)
public
class
GoblinStoreCouponVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
6233852543461320809L
;
@ApiModelProperty
(
position
=
10
,
value
=
"卡券ID[64]"
)
...
...
@@ -63,6 +63,11 @@ public class GoblinStoreCouponVo implements Serializable, Cloneable {
private
LocalDateTime
endTime
;
/* ========================================================================== */
@ApiModelProperty
(
position
=
27
,
value
=
"当前用户已领取数量"
)
private
int
receiveCount
;
private
static
final
GoblinStoreCouponVo
obj
=
new
GoblinStoreCouponVo
();
public
static
GoblinStoreCouponVo
getNew
()
{
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinCouponController.java
View file @
192cbf84
...
...
@@ -11,6 +11,7 @@ import com.liquidnet.service.goblin.service.GoblinCouponService;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
io.swagger.annotations.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -53,7 +54,21 @@ public class GoblinCouponController {
public
ResponseDto
<
ArrayList
<
GoblinStoreCouponVo
>>
getSpuByType
(
@RequestParam
(
"spuId"
)
@Valid
String
spuId
,
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"type"
)
@Valid
String
type
)
{
return
ResponseDto
.
success
(
goblinCouponService
.
getSpuByType
(
spuId
,
storeId
,
type
));
ArrayList
<
GoblinStoreCouponVo
>
storeCouponVos
=
goblinCouponService
.
getSpuByType
(
spuId
,
storeId
,
type
);
if
(!
CollectionUtils
.
isEmpty
(
storeCouponVos
))
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
if
(
StringUtils
.
isNotEmpty
(
currentUid
))
{
List
<
GoblinUserCouponVo
>
userCouponVos
=
goblinRedisUtils
.
getUserCouponVos
(
currentUid
);
if
(!
CollectionUtils
.
isEmpty
(
userCouponVos
))
for
(
GoblinStoreCouponVo
storeCouponVo
:
storeCouponVos
)
for
(
GoblinUserCouponVo
userCouponVo
:
userCouponVos
)
if
(
storeCouponVo
.
getStoreCouponId
().
equals
(
userCouponVo
.
getStoreCouponId
()))
{
storeCouponVo
.
setReceiveCount
(
storeCouponVo
.
getReceiveCount
()
+
1
);
break
;
}
}
}
return
ResponseDto
.
success
(
storeCouponVos
);
}
@PostMapping
(
"receive"
)
...
...
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