记得上下班打卡 | 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
0259556f
Commit
0259556f
authored
Dec 05, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交 离线券相关接口
parent
a374718d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
103 additions
and
7 deletions
+103
-7
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+5
-0
CouponOutLineVo.java
.../com/liquidnet/service/goblin/dto/vo/CouponOutLineVo.java
+35
-0
GoblinPosController.java
...uidnet/service/goblin/controller/GoblinPosController.java
+8
-2
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+22
-4
ObjectUtil.java
...in/java/com/liquidnet/service/goblin/util/ObjectUtil.java
+4
-0
GoblinOrderUtils.java
...a/com/liquidnet/service/order/utils/GoblinOrderUtils.java
+15
-1
GoblinRedisUtils.java
...a/com/liquidnet/service/order/utils/GoblinRedisUtils.java
+9
-0
ObjectUtil.java
...in/java/com/liquidnet/service/order/utils/ObjectUtil.java
+5
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
0259556f
...
@@ -391,6 +391,11 @@ public class GoblinRedisConst {
...
@@ -391,6 +391,11 @@ public class GoblinRedisConst {
*/
*/
public
static
final
String
NFT_TRANSFER_CONF_AGAIN
=
PREFIX
.
concat
(
"nft_trans_conf_again"
);
public
static
final
String
NFT_TRANSFER_CONF_AGAIN
=
PREFIX
.
concat
(
"nft_trans_conf_again"
);
/**
* 商铺离线券
*/
public
static
final
String
STORE_OUT_LINE_COUPON
=
PREFIX
.
concat
(
"out_coupon"
);
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/CouponOutLineVo.java
0 → 100644
View file @
0259556f
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
@Api
@Data
public
class
CouponOutLineVo
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"storeCouponIds"
,
value
=
"券ID"
,
example
=
"1"
,
required
=
true
)
private
String
storeCouponId
;
@ApiModelProperty
(
dataType
=
"Integer"
,
name
=
"count"
,
value
=
"折扣[例如95折]"
,
example
=
"95"
,
required
=
true
)
private
Integer
discount
;
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"name"
,
value
=
"券名称"
,
example
=
"券名称1"
,
required
=
true
)
private
String
name
;
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"desc"
,
value
=
"描述"
,
example
=
"这是95折券"
,
required
=
true
)
private
String
desc
;
@ApiModelProperty
(
value
=
"券类型[1-代金券|2-折扣券|3-满减券]"
,
example
=
"1"
)
private
String
couType
;
private
static
final
CouponOutLineVo
obj
=
new
CouponOutLineVo
();
public
static
CouponOutLineVo
getNew
()
{
try
{
return
(
CouponOutLineVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
CouponOutLineVo
();
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinPosController.java
View file @
0259556f
...
@@ -87,7 +87,7 @@ public class GoblinPosController {
...
@@ -87,7 +87,7 @@ public class GoblinPosController {
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"店铺不存在"
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"店铺不存在"
);
}
}
String
storeId
=
storeInfoVo
.
getStoreId
();
String
storeId
=
storeInfoVo
.
getStoreId
();
skuids
=
skuids
.
replaceFirst
(
"skuids"
,
""
).
replaceAll
(
"[\":{}]"
,
""
);
skuids
=
skuids
.
replaceFirst
(
"skuids"
,
""
).
replaceAll
(
"[\":{}]"
,
""
);
String
[]
skuIdArr
=
skuids
.
split
(
","
);
String
[]
skuIdArr
=
skuids
.
split
(
","
);
List
<
GoblinPosGoodsVo
>
posGoodsVoList
=
ObjectUtil
.
getGoblinPosGoodsVoArrayList
();
List
<
GoblinPosGoodsVo
>
posGoodsVoList
=
ObjectUtil
.
getGoblinPosGoodsVoArrayList
();
...
@@ -144,7 +144,7 @@ public class GoblinPosController {
...
@@ -144,7 +144,7 @@ public class GoblinPosController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"uid"
,
value
=
"UID"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"uid"
,
value
=
"UID"
),
})
})
public
ResponseDto
<
List
<
CouponCountVo
>>
couponCount
(
@NotBlank
(
message
=
"参数无效:storeCouponId"
)
@RequestParam
(
"storeCouponId"
)
List
<
String
>
storeCouponIds
,
public
ResponseDto
<
List
<
CouponCountVo
>>
couponCount
(
@NotBlank
(
message
=
"参数无效:storeCouponId"
)
@RequestParam
(
"storeCouponId"
)
List
<
String
>
storeCouponIds
,
@NotBlank
(
message
=
"参数无效:uid"
)
@RequestParam
(
"uid"
)
String
uid
)
{
@NotBlank
(
message
=
"参数无效:uid"
)
@RequestParam
(
"uid"
)
String
uid
)
{
List
<
GoblinUserCouponVo
>
userCouponVos
=
goblinRedisUtils
.
getUserCouponVos
(
uid
);
List
<
GoblinUserCouponVo
>
userCouponVos
=
goblinRedisUtils
.
getUserCouponVos
(
uid
);
List
<
CouponCountVo
>
voList
=
ObjectUtil
.
couponCountVos
();
List
<
CouponCountVo
>
voList
=
ObjectUtil
.
couponCountVos
();
for
(
String
storeCouponId
:
storeCouponIds
)
{
for
(
String
storeCouponId
:
storeCouponIds
)
{
...
@@ -160,4 +160,10 @@ public class GoblinPosController {
...
@@ -160,4 +160,10 @@ public class GoblinPosController {
}
}
return
ResponseDto
.
success
(
voList
);
return
ResponseDto
.
success
(
voList
);
}
}
@PostMapping
(
"coupon/outline"
)
@ApiOperation
(
"获取离线券"
)
public
ResponseDto
<
List
<
CouponOutLineVo
>>
getOutLineCoupon
()
{
return
ResponseDto
.
success
(
goblinRedisUtils
.
getOutLineCoupon
());
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
0259556f
...
@@ -2805,8 +2805,8 @@ public class GoblinRedisUtils {
...
@@ -2805,8 +2805,8 @@ public class GoblinRedisUtils {
/**
/**
* NFT转赠约束配置(首次转赠)
* NFT转赠约束配置(首次转赠)
* <p>
* <p>
*
Redis未配置或配置格式有误时,默认返回180天对应15552000秒
* Redis未配置或配置格式有误时,默认返回180天对应15552000秒
*
{"xuper":15552000,"zxinchain":15552000}
* {"xuper":15552000,"zxinchain":15552000}
* </p>
* </p>
*
*
* @return Map<String, Long>
* @return Map<String, Long>
...
@@ -2818,8 +2818,8 @@ public class GoblinRedisUtils {
...
@@ -2818,8 +2818,8 @@ public class GoblinRedisUtils {
/**
/**
* NFT转赠约束配置(区分首次转赠、二次转赠)
* NFT转赠约束配置(区分首次转赠、二次转赠)
* <p>
* <p>
*
Redis未配置或配置格式有误时,默认返回180天对应15552000秒
* Redis未配置或配置格式有误时,默认返回180天对应15552000秒
*
{"xuper":15552000,"zxinchain":15552000}
* {"xuper":15552000,"zxinchain":15552000}
* </p>
* </p>
*
*
* @param artworkSource 藏品来源,为空或不等于`6`时为首次转赠配置
* @param artworkSource 藏品来源,为空或不等于`6`时为首次转赠配置
...
@@ -2849,6 +2849,24 @@ public class GoblinRedisUtils {
...
@@ -2849,6 +2849,24 @@ public class GoblinRedisUtils {
return
map
;
return
map
;
}
}
public
List
<
CouponOutLineVo
>
getOutLineCoupon
()
{
Object
obj
=
redisUtil
.
get
(
GoblinRedisConst
.
STORE_OUT_LINE_COUPON
);
if
(
obj
==
null
)
{
List
<
CouponOutLineVo
>
list
=
ObjectUtil
.
couponOutLineVo
();
CouponOutLineVo
vo
=
CouponOutLineVo
.
getNew
();
vo
.
setName
(
"95折券"
);
vo
.
setStoreCouponId
(
"ccoupon95"
);
vo
.
setDiscount
(
95
);
vo
.
setDesc
(
"95折券"
);
vo
.
setCouType
(
"2"
);
list
.
add
(
vo
);
redisUtil
.
set
(
GoblinRedisConst
.
STORE_OUT_LINE_COUPON
,
list
);
return
list
;
}
else
{
return
(
List
<
CouponOutLineVo
>)
obj
;
}
}
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/ObjectUtil.java
View file @
0259556f
...
@@ -101,6 +101,7 @@ public class ObjectUtil {
...
@@ -101,6 +101,7 @@ public class ObjectUtil {
private
static
final
ArrayList
<
GoblinMixAppListVo
>
goblinMixAppListVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixAppListVo
>
goblinMixAppListVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CouponCountVo
>
couponCountVos
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CouponCountVo
>
couponCountVos
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixDetailsVo
>
goblinMixDetailsVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixDetailsVo
>
goblinMixDetailsVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CouponOutLineVo
>
couponOutLineVo
=
new
ArrayList
<>();
private
static
final
HashMap
<
String
,
String
[]>
mixIdMap
=
new
HashMap
();
private
static
final
HashMap
<
String
,
String
[]>
mixIdMap
=
new
HashMap
();
...
@@ -108,6 +109,9 @@ public class ObjectUtil {
...
@@ -108,6 +109,9 @@ public class ObjectUtil {
return
(
HashMap
<
String
,
String
[]>)
mixIdMap
.
clone
();
return
(
HashMap
<
String
,
String
[]>)
mixIdMap
.
clone
();
}
}
public
static
ArrayList
<
CouponOutLineVo
>
couponOutLineVo
()
{
return
(
ArrayList
<
CouponOutLineVo
>)
couponOutLineVo
.
clone
();
}
public
static
ArrayList
<
CouponCountVo
>
couponCountVos
()
{
public
static
ArrayList
<
CouponCountVo
>
couponCountVos
()
{
return
(
ArrayList
<
CouponCountVo
>)
couponCountVos
.
clone
();
return
(
ArrayList
<
CouponCountVo
>)
couponCountVos
.
clone
();
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinOrderUtils.java
View file @
0259556f
...
@@ -249,9 +249,23 @@ public class GoblinOrderUtils {
...
@@ -249,9 +249,23 @@ public class GoblinOrderUtils {
}
}
public
GoblinUseResultVo
useStoreCoupon
(
String
ucouponId
,
String
content
,
BigDecimal
totalPrice
,
List
<
GoblinOrderSku
>
goblinOrderSkuList
,
String
uid
)
{
public
GoblinUseResultVo
useStoreCoupon
(
String
ucouponId
,
String
content
,
BigDecimal
totalPrice
,
List
<
GoblinOrderSku
>
goblinOrderSkuList
,
String
uid
)
{
GoblinUseResultVo
returnVo
=
GoblinUseResultVo
.
getNew
();
List
<
CouponOutLineVo
>
couponList
=
redisUtils
.
getOutLineCoupon
();
boolean
isOutLine
=
false
;
for
(
CouponOutLineVo
data:
couponList
)
{
if
(
data
.
getStoreCouponId
().
equals
(
ucouponId
)){
isOutLine
=
true
;
BigDecimal
tempPrice
=
totalPrice
.
subtract
(
totalPrice
.
multiply
(
BigDecimal
.
valueOf
(
data
.
getDiscount
())).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_DOWN
));
returnVo
.
setSpuIds
(
CollectionUtil
.
linkedListString
());
returnVo
.
setValue
(
tempPrice
);
returnVo
.
setCouType
(
data
.
getCouType
());
}
}
if
(
isOutLine
){
return
returnVo
;
}
try
{
try
{
List
<
GoblinUserCouponVo
>
voList
=
redisUtils
.
getUserCouponVos
(
uid
);
List
<
GoblinUserCouponVo
>
voList
=
redisUtils
.
getUserCouponVos
(
uid
);
GoblinUseResultVo
returnVo
=
GoblinUseResultVo
.
getNew
();
returnVo
.
setValue
(
BigDecimal
.
ZERO
);
returnVo
.
setValue
(
BigDecimal
.
ZERO
);
returnVo
.
setCouType
(
"-1"
);
returnVo
.
setCouType
(
"-1"
);
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinRedisUtils.java
View file @
0259556f
...
@@ -734,4 +734,13 @@ public class GoblinRedisUtils {
...
@@ -734,4 +734,13 @@ public class GoblinRedisUtils {
return
BigDecimal
.
valueOf
((
int
)
obj
);
return
BigDecimal
.
valueOf
((
int
)
obj
);
}
}
}
}
public
List
<
CouponOutLineVo
>
getOutLineCoupon
()
{
Object
obj
=
redisUtil
.
get
(
GoblinRedisConst
.
STORE_OUT_LINE_COUPON
);
if
(
obj
==
null
)
{
return
ObjectUtil
.
couponOutLineVo
();
}
else
{
return
(
List
<
CouponOutLineVo
>)
obj
;
}
}
}
}
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/ObjectUtil.java
View file @
0259556f
...
@@ -58,6 +58,7 @@ public class ObjectUtil {
...
@@ -58,6 +58,7 @@ public class ObjectUtil {
private
static
final
HashMap
<
String
,
List
<
GoblinStoreOrder
>>
hashMapSp
=
new
HashMap
();
private
static
final
HashMap
<
String
,
List
<
GoblinStoreOrder
>>
hashMapSp
=
new
HashMap
();
private
static
final
HashMap
<
String
,
List
<
GoblinGoodsSkuInfoVo
>>
goblinGoodsSkuInfoVoMap
=
new
HashMap
();
private
static
final
HashMap
<
String
,
List
<
GoblinGoodsSkuInfoVo
>>
goblinGoodsSkuInfoVoMap
=
new
HashMap
();
private
static
final
HashMap
<
String
,
String
[]>
mixIdMap
=
new
HashMap
();
private
static
final
HashMap
<
String
,
String
[]>
mixIdMap
=
new
HashMap
();
private
static
final
ArrayList
<
CouponOutLineVo
>
couponOutLineVo
=
new
ArrayList
<>();
public
static
Object
[]
objectsArray
;
public
static
Object
[]
objectsArray
;
public
static
final
Integer
[]
integerArray2
=
new
Integer
[
2
];
public
static
final
Integer
[]
integerArray2
=
new
Integer
[
2
];
...
@@ -67,6 +68,10 @@ public class ObjectUtil {
...
@@ -67,6 +68,10 @@ public class ObjectUtil {
return
(
HashMap
<
String
,
String
[]>)
mixIdMap
.
clone
();
return
(
HashMap
<
String
,
String
[]>)
mixIdMap
.
clone
();
}
}
public
static
ArrayList
<
CouponOutLineVo
>
couponOutLineVo
()
{
return
(
ArrayList
<
CouponOutLineVo
>)
couponOutLineVo
.
clone
();
}
public
static
ArrayList
<
GoblinGoodsSkuInfoVo
>
goblinGoodsSkuInfoVos
()
{
public
static
ArrayList
<
GoblinGoodsSkuInfoVo
>
goblinGoodsSkuInfoVos
()
{
return
(
ArrayList
<
GoblinGoodsSkuInfoVo
>)
goblinGoodsSkuInfoVos
.
clone
();
return
(
ArrayList
<
GoblinGoodsSkuInfoVo
>)
goblinGoodsSkuInfoVos
.
clone
();
}
}
...
...
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