记得上下班打卡 | 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
803b6227
Commit
803b6227
authored
Feb 16, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 商品券 可用uid
parent
5fd0ee66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
55 deletions
+63
-55
ICandyCouponService.java
.../liquidnet/service/candy/service/ICandyCouponService.java
+2
-2
CandyCouponController.java
...idnet/service/candy/controller/CandyCouponController.java
+59
-49
CandyCouponServiceImpl.java
...et/service/candy/service/impl/CandyCouponServiceImpl.java
+2
-4
No files found.
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/service/ICandyCouponService.java
View file @
803b6227
...
@@ -32,9 +32,9 @@ public interface ICandyCouponService {
...
@@ -32,9 +32,9 @@ public interface ICandyCouponService {
Integer
preCanUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
);
Integer
preCanUsePerformanceCoupon
(
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
);
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
Integer
type
);
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
Integer
type
,
String
uid
);
Integer
preCanUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodI
);
Integer
preCanUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodI
,
String
uid
);
List
<
CandyCouponVo
>
myAdvanceCoupon
(
String
performanceId
);
List
<
CandyCouponVo
>
myAdvanceCoupon
(
String
performanceId
);
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/controller/CandyCouponController.java
View file @
803b6227
...
@@ -151,12 +151,17 @@ public class CandyCouponController {
...
@@ -151,12 +151,17 @@ public class CandyCouponController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"BigDecimal"
,
name
=
"priceTotal"
,
value
=
"待支付总金额"
,
required
=
true
),
@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
=
"goodId"
,
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
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"uid"
,
value
=
"用户id"
,
required
=
false
),
})
})
public
ResponseDto
<
CandyMyCouponListVo
>
preUseGoodCoupon
(
@RequestParam
(
"priceTotal"
)
@NotNull
BigDecimal
priceTotal
,
public
ResponseDto
<
CandyMyCouponListVo
>
preUseGoodCoupon
(
@RequestParam
(
"priceTotal"
)
@NotNull
BigDecimal
priceTotal
,
@RequestParam
(
"goodId"
)
@NotNull
@NotBlank
String
goodId
,
@RequestParam
(
"goodId"
)
@NotNull
@NotBlank
String
goodId
,
@RequestParam
(
"type"
)
@NotNull
Integer
type
,
@RequestParam
(
"type"
)
@NotNull
Integer
type
,
@RequestParam
(
required
=
false
,
name
=
"page"
)
Integer
page
)
{
@RequestParam
(
required
=
false
,
name
=
"page"
)
Integer
page
,
CandyMyCouponListVo
vo
=
candyCouponService
.
preUseGoodCoupon
(
priceTotal
,
goodId
,
type
);
@RequestParam
(
required
=
false
,
name
=
"uid"
)
String
uid
)
{
if
(
uid
==
null
){
uid
=
CurrentUtil
.
getCurrentUid
();
}
CandyMyCouponListVo
vo
=
candyCouponService
.
preUseGoodCoupon
(
priceTotal
,
goodId
,
type
,
uid
);
List
<
CandyCouponVo
>
list
=
vo
.
getMyCoupon
();
List
<
CandyCouponVo
>
list
=
vo
.
getMyCoupon
();
List
<
CandyCouponVo
>
listVo
=
ObjectUtil
.
getCandyCouponVoArrayList
();
List
<
CandyCouponVo
>
listVo
=
ObjectUtil
.
getCandyCouponVoArrayList
();
if
(
page
==
null
||
page
==
0
)
{
if
(
page
==
null
||
page
==
0
)
{
...
@@ -180,12 +185,17 @@ public class CandyCouponController {
...
@@ -180,12 +185,17 @@ public class CandyCouponController {
@ApiOperation
(
"是否可用券 - 商品"
)
@ApiOperation
(
"是否可用券 - 商品"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"BigDecimal"
,
name
=
"priceTotal"
,
value
=
"待支付总金额"
,
required
=
true
),
@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
=
"goodId"
,
value
=
"商品id(逗号隔开的字符串)"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"uid"
,
value
=
"用户id"
,
required
=
false
),
})
})
public
ResponseDto
<
HashMap
<
String
,
Integer
>>
preCanUseGoodCoupon
(
@RequestParam
(
"priceTotal"
)
@NotNull
BigDecimal
priceTotal
,
public
ResponseDto
<
HashMap
<
String
,
Integer
>>
preCanUseGoodCoupon
(
@RequestParam
(
"priceTotal"
)
@NotNull
BigDecimal
priceTotal
,
@RequestParam
(
"goodId"
)
@NotNull
@NotBlank
String
goodId
)
{
@RequestParam
(
"goodId"
)
@NotNull
@NotBlank
String
goodId
,
@RequestParam
(
required
=
false
,
name
=
"uid"
)
String
uid
)
{
HashMap
<
String
,
Integer
>
hashMap
=
CollectionUtil
.
mapStringInteger
();
HashMap
<
String
,
Integer
>
hashMap
=
CollectionUtil
.
mapStringInteger
();
hashMap
.
put
(
"canUse"
,
candyCouponService
.
preCanUseGoodCoupon
(
priceTotal
,
goodId
));
if
(
uid
==
null
){
uid
=
CurrentUtil
.
getCurrentUid
();
}
hashMap
.
put
(
"canUse"
,
candyCouponService
.
preCanUseGoodCoupon
(
priceTotal
,
goodId
,
uid
));
return
ResponseDto
.
success
(
hashMap
);
return
ResponseDto
.
success
(
hashMap
);
}
}
...
@@ -341,48 +351,48 @@ public class CandyCouponController {
...
@@ -341,48 +351,48 @@ public class CandyCouponController {
// }
// }
}
}
//
//要使用券列表 - 商品
//
//要使用券列表 - 商品
@PostMapping
(
"preUse/goods/store"
)
//
@PostMapping("preUse/goods/store")
@ApiOperation
(
"要使用券列表 - 商品[商铺]"
)
//
@ApiOperation("要使用券列表 - 商品[商铺]")
@ApiImplicitParams
({
//
@ApiImplicitParams({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"BigDecimal"
,
name
=
"priceTotal"
,
value
=
"待支付总金额"
,
required
=
true
),
//
@ApiImplicitParam(type = "form", dataType = "BigDecimal", name = "priceTotal", value = "待支付总金额", required = true),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"skuIds"
,
value
=
"商品id(逗号隔开的字符串)"
,
required
=
true
),
//
@ApiImplicitParam(type = "form", dataType = "String", name = "skuIds", 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
<
List
<
CandyCouponVo
>>
preUseGoodStore
(
@RequestParam
(
"priceTotal"
)
@NotNull
BigDecimal
priceTotal
,
//
public ResponseDto<List<CandyCouponVo>> preUseGoodStore(@RequestParam("priceTotal") @NotNull BigDecimal priceTotal,
@RequestParam
(
"skuIds"
)
@NotNull
@NotBlank
String
skuIds
,
//
@RequestParam("skuIds") @NotNull @NotBlank String skuIds,
@RequestParam
(
"type"
)
@NotNull
Integer
type
,
//
@RequestParam("type") @NotNull Integer type,
@RequestParam
(
required
=
false
,
name
=
"page"
)
Integer
page
)
{
//
@RequestParam(required = false, name = "page") Integer page) {
CandyMyCouponListVo
vo
=
candyCouponService
.
preUseGoodCoupon
(
priceTotal
,
skuIds
,
type
);
//
CandyMyCouponListVo vo = candyCouponService.preUseGoodCoupon(priceTotal, skuIds, type);
List
<
CandyCouponVo
>
list
=
vo
.
getMyCoupon
();
//
List<CandyCouponVo> list = vo.getMyCoupon();
List
<
CandyCouponVo
>
listVo
=
ObjectUtil
.
getCandyCouponVoArrayList
();
//
List<CandyCouponVo> listVo = ObjectUtil.getCandyCouponVoArrayList();
if
(
page
==
null
||
page
==
0
)
{
//
if (page == null || page == 0) {
page
=
1
;
//
page = 1;
}
//
}
int
size
=
10
;
//
int size = 10;
int
initSize
=
(
page
-
1
)
*
size
;
//
int initSize = (page - 1) * size;
int
forSize
=
page
*
size
;
//
int forSize = page * size;
if
(
forSize
>=
list
.
size
())
{
//
if (forSize >= list.size()) {
forSize
=
list
.
size
();
//
forSize = list.size();
}
//
}
for
(
int
i
=
initSize
;
i
<
forSize
;
i
++)
{
//
for (int i = initSize; i < forSize; i++) {
listVo
.
add
(
list
.
get
(
i
));
//
listVo.add(list.get(i));
}
//
}
return
ResponseDto
.
success
(
listVo
);
//
return ResponseDto.success(listVo);
}
//
}
//
//是否可用券 - 商品
//
//是否可用券 - 商品
@PostMapping
(
"preCanUse/goods/store"
)
//
@PostMapping("preCanUse/goods/store")
@ApiOperation
(
"是否可用券 - 商品[商铺]"
)
//
@ApiOperation("是否可用券 - 商品[商铺]")
@ApiImplicitParams
({
//
@ApiImplicitParams({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"BigDecimal"
,
name
=
"priceTotal"
,
value
=
"待支付总金额"
,
required
=
true
),
//
@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 = "goodId", value = "商品id(逗号隔开的字符串)", required = true)
})
//
})
public
ResponseDto
<
HashMap
<
String
,
Integer
>>
preCanUseGoodStore
(
@RequestParam
(
"priceTotal"
)
@NotNull
BigDecimal
priceTotal
,
//
public ResponseDto<HashMap<String, Integer>> preCanUseGoodStore(@RequestParam("priceTotal") @NotNull BigDecimal priceTotal,
@RequestParam
(
"skuIds"
)
@NotNull
@NotBlank
String
skuIds
)
{
//
@RequestParam("skuIds") @NotNull @NotBlank String skuIds) {
HashMap
<
String
,
Integer
>
hashMap
=
CollectionUtil
.
mapStringInteger
();
//
HashMap<String, Integer> hashMap = CollectionUtil.mapStringInteger();
hashMap
.
put
(
"canUse"
,
candyCouponService
.
preCanUseGoodCoupon
(
priceTotal
,
skuIds
));
//
hashMap.put("canUse", candyCouponService.preCanUseGoodCoupon(priceTotal, skuIds));
return
ResponseDto
.
success
(
hashMap
);
//
return ResponseDto.success(hashMap);
}
//
}
}
}
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/service/impl/CandyCouponServiceImpl.java
View file @
803b6227
...
@@ -206,8 +206,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
...
@@ -206,8 +206,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
}
@Override
@Override
public
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
Integer
type
)
{
public
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
Integer
type
,
String
uid
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
LocalDateTime
userCreateTime
;
LocalDateTime
userCreateTime
;
try
{
try
{
userCreateTime
=
DateUtil
.
Formatter
.
yyyyMMddHHmmssTrim
.
parse
(
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_UCREATED
).
toString
());
userCreateTime
=
DateUtil
.
Formatter
.
yyyyMMddHHmmssTrim
.
parse
(
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_UCREATED
).
toString
());
...
@@ -249,8 +248,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
...
@@ -249,8 +248,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
}
@Override
@Override
public
Integer
preCanUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
)
{
public
Integer
preCanUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
String
uid
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
LocalDateTime
userCreateTime
;
LocalDateTime
userCreateTime
;
try
{
try
{
userCreateTime
=
DateUtil
.
Formatter
.
yyyyMMddHHmmssTrim
.
parse
(
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_UCREATED
).
toString
());
userCreateTime
=
DateUtil
.
Formatter
.
yyyyMMddHHmmssTrim
.
parse
(
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_UCREATED
).
toString
());
...
...
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