记得上下班打卡 | 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
b1d570d1
Commit
b1d570d1
authored
Jun 21, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nft 支付回调 超时支付退款
parent
20d04b4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
37 deletions
+62
-37
application-dev.yml
liquidnet-bus-config/liquidnet-config/application-dev.yml
+1
-1
application-test.yml
liquidnet-bus-config/liquidnet-config/application-test.yml
+1
-1
GoblinNftOrderUtils.java
...om/liquidnet/service/order/utils/GoblinNftOrderUtils.java
+60
-35
No files found.
liquidnet-bus-config/liquidnet-config/application-dev.yml
View file @
b1d570d1
...
@@ -103,7 +103,7 @@ liquidnet:
...
@@ -103,7 +103,7 @@ liquidnet:
url
:
http://devorder.zhengzai.tv
url
:
http://devorder.zhengzai.tv
url-pay
:
url-pay
:
pay
:
http://devdragon.zhengzai.tv/dragon/pay/dragonPay
pay
:
http://devdragon.zhengzai.tv/dragon/pay/dragonPay
applePay
:
http://devorder.zhengzai.tv/order/notify/apple/purchase
#
applePay: http://devorder.zhengzai.tv/order/notify/apple/purchase
check
:
http://devdragon.zhengzai.tv/dragon/pay/checkOrder
check
:
http://devdragon.zhengzai.tv/dragon/pay/checkOrder
localUrl
:
http://devorder.zhengzai.tv/order/order/syncOrder
localUrl
:
http://devorder.zhengzai.tv/order/order/syncOrder
goblinUrl
:
http://devorder.zhengzai.tv/goblin/order/pay/syncOrder
goblinUrl
:
http://devorder.zhengzai.tv/goblin/order/pay/syncOrder
...
...
liquidnet-bus-config/liquidnet-config/application-test.yml
View file @
b1d570d1
...
@@ -103,7 +103,7 @@ liquidnet:
...
@@ -103,7 +103,7 @@ liquidnet:
url
:
http://testorder.zhengzai.tv
url
:
http://testorder.zhengzai.tv
url-pay
:
url-pay
:
pay
:
http://testdragon.zhengzai.tv/dragon/pay/dragonPay
pay
:
http://testdragon.zhengzai.tv/dragon/pay/dragonPay
applePay
:
http://testorder.zhengzai.tv/order/notify/apple/purchase
#
applePay: http://testorder.zhengzai.tv/order/notify/apple/purchase
check
:
http://testdragon.zhengzai.tv/dragon/pay/checkOrder
check
:
http://testdragon.zhengzai.tv/dragon/pay/checkOrder
localUrl
:
http://testorder.zhengzai.tv/order/order/syncOrder
localUrl
:
http://testorder.zhengzai.tv/order/order/syncOrder
goblinUrl
:
http://testorder.zhengzai.tv/order/goblin/syncOrder
goblinUrl
:
http://testorder.zhengzai.tv/order/goblin/syncOrder
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinNftOrderUtils.java
View file @
b1d570d1
package
com
.
liquidnet
.
service
.
order
.
utils
;
package
com
.
liquidnet
.
service
.
order
.
utils
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.commons.lang.util.*
;
...
@@ -7,6 +8,8 @@ import com.liquidnet.service.base.ResponseDto;
...
@@ -7,6 +8,8 @@ import com.liquidnet.service.base.ResponseDto;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.candy.vo.CandyUseResultVo
;
import
com.liquidnet.service.candy.vo.CandyUseResultVo
;
import
com.liquidnet.service.dragon.dto.DragonRefundAppDto
;
import
com.liquidnet.service.dragon.service.IDragonOrderRefundsService
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo
;
...
@@ -31,8 +34,8 @@ public class GoblinNftOrderUtils {
...
@@ -31,8 +34,8 @@ public class GoblinNftOrderUtils {
private
String
candyUrl
;
private
String
candyUrl
;
@Value
(
"${liquidnet.service.order.url-pay.nftRefundNotify}"
)
@Value
(
"${liquidnet.service.order.url-pay.nftRefundNotify}"
)
private
String
synUrl
;
private
String
synUrl
;
@Value
(
"${liquidnet.service.dragon.urls.refundApply}"
)
/*
@Value("${liquidnet.service.dragon.urls.refundApply}")
private
String
refundApply
;
private String refundApply;
*/
@Autowired
@Autowired
private
QueueUtils
queueUtils
;
private
QueueUtils
queueUtils
;
...
@@ -45,6 +48,9 @@ public class GoblinNftOrderUtils {
...
@@ -45,6 +48,9 @@ public class GoblinNftOrderUtils {
@Autowired
@Autowired
private
GoblinOrderUtils
goblinOrderUtils
;
private
GoblinOrderUtils
goblinOrderUtils
;
@Autowired
private
IDragonOrderRefundsService
dragonOrderRefundsService
;
// 库存
// 库存
public
int
decrSkuStock
(
String
skuId
,
Integer
stock
)
{
public
int
decrSkuStock
(
String
skuId
,
Integer
stock
)
{
String
redisKey
=
GoblinRedisConst
.
REAL_STOCK_SKU
.
concat
(
skuId
);
String
redisKey
=
GoblinRedisConst
.
REAL_STOCK_SKU
.
concat
(
skuId
);
...
@@ -86,6 +92,7 @@ public class GoblinNftOrderUtils {
...
@@ -86,6 +92,7 @@ public class GoblinNftOrderUtils {
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_NFT_ORDER_ID_OF_CODE
.
concat
(
orderCode
);
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_NFT_ORDER_ID_OF_CODE
.
concat
(
orderCode
);
redisUtil
.
set
(
redisKey
,
orderId
);
redisUtil
.
set
(
redisKey
,
orderId
);
}
}
// code换id
// code换id
public
String
getNftOrderIdOfCode
(
String
orderCode
)
{
public
String
getNftOrderIdOfCode
(
String
orderCode
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_NFT_ORDER_ID_OF_CODE
.
concat
(
orderCode
);
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_NFT_ORDER_ID_OF_CODE
.
concat
(
orderCode
);
...
@@ -163,17 +170,19 @@ public class GoblinNftOrderUtils {
...
@@ -163,17 +170,19 @@ public class GoblinNftOrderUtils {
return
(
GoblinNftExCodeVo
)
obj
;
return
(
GoblinNftExCodeVo
)
obj
;
}
}
}
}
public
void
setGoblinNftExCodeVo
(
GoblinNftExCodeVo
codeVo
)
{
public
void
setGoblinNftExCodeVo
(
GoblinNftExCodeVo
codeVo
)
{
String
redisKey
=
GoblinRedisConst
.
ACTIVITY_SKU_CODE
.
concat
(
codeVo
.
getCode
());
String
redisKey
=
GoblinRedisConst
.
ACTIVITY_SKU_CODE
.
concat
(
codeVo
.
getCode
());
redisUtil
.
set
(
redisKey
,
codeVo
);
redisUtil
.
set
(
redisKey
,
codeVo
);
}
}
public
int
incrExCountByUid
(
String
uid
,
String
skuId
,
String
activityId
,
int
number
)
{
public
int
incrExCountByUid
(
String
uid
,
String
skuId
,
String
activityId
,
int
number
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_EX_BUY_COUNT
.
concat
(
activityId
+
':'
).
concat
(
skuId
+
':'
).
concat
(
uid
);
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_EX_BUY_COUNT
.
concat
(
activityId
+
':'
).
concat
(
skuId
+
':'
).
concat
(
uid
);
return
(
int
)
redisUtil
.
incr
(
redisKey
,
number
);
return
(
int
)
redisUtil
.
incr
(
redisKey
,
number
);
}
}
public
int
decrExCountByUid
(
String
uid
,
String
skuId
,
String
activityId
,
int
number
)
{
public
int
decrExCountByUid
(
String
uid
,
String
skuId
,
String
activityId
,
int
number
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_EX_BUY_COUNT
.
concat
(
activityId
+
':'
).
concat
(
skuId
+
':'
).
concat
(
uid
);
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_EX_BUY_COUNT
.
concat
(
activityId
+
':'
).
concat
(
skuId
+
':'
).
concat
(
uid
);
return
(
int
)
redisUtil
.
decr
(
redisKey
,
number
);
return
(
int
)
redisUtil
.
decr
(
redisKey
,
number
);
}
}
...
@@ -185,10 +194,11 @@ public class GoblinNftOrderUtils {
...
@@ -185,10 +194,11 @@ public class GoblinNftOrderUtils {
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
return
false
;
return
false
;
}
else
{
}
else
{
GoblinGoodsAnticipateValueVo
anticipateValueVo
=
(
GoblinGoodsAnticipateValueVo
)
obj
;
GoblinGoodsAnticipateValueVo
anticipateValueVo
=
(
GoblinGoodsAnticipateValueVo
)
obj
;
return
anticipateValueVo
.
getType
()
!=
1
;
return
anticipateValueVo
.
getType
()
!=
1
;
}
}
}
}
// 是否预约过 没开启true
// 是否预约过 没开启true
public
boolean
getUserAboutAut
(
String
skuId
,
String
uid
)
{
public
boolean
getUserAboutAut
(
String
skuId
,
String
uid
)
{
boolean
valueBySkuId
=
getValueBySkuId
(
skuId
);
boolean
valueBySkuId
=
getValueBySkuId
(
skuId
);
...
@@ -374,7 +384,7 @@ public class GoblinNftOrderUtils {
...
@@ -374,7 +384,7 @@ public class GoblinNftOrderUtils {
private
String
initRefund
(
GoblinNftOrderVo
orderVo
,
BigDecimal
price
,
String
refundCode
)
{
private
String
initRefund
(
GoblinNftOrderVo
orderVo
,
BigDecimal
price
,
String
refundCode
)
{
log
.
info
(
"NFT退款请求 参数:[orderVo:{}, price:{}, refundCode:{}]"
,
orderVo
,
price
,
refundCode
);
log
.
info
(
"NFT退款请求 参数:[orderVo:{}, price:{}, refundCode:{}]"
,
orderVo
,
price
,
refundCode
);
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
/*
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
params.add("code", orderVo.getPayCode());
params.add("code", orderVo.getPayCode());
params.add("notifyUrl", synUrl);
params.add("notifyUrl", synUrl);
params.add("orderCode", orderVo.getOrderCode());
params.add("orderCode", orderVo.getOrderCode());
...
@@ -388,7 +398,21 @@ public class GoblinNftOrderUtils {
...
@@ -388,7 +398,21 @@ public class GoblinNftOrderUtils {
headers.add("Accept", "application/json;charset=UTF-8");
headers.add("Accept", "application/json;charset=UTF-8");
String returnString = HttpUtil.post(refundApply, params, headers);
String returnString = HttpUtil.post(refundApply, params, headers);
log.info("NFT退款请求 结果:[returnString:{}]", returnString);
log.info("NFT退款请求 结果:[returnString:{}]", returnString);
return
returnString
;
return returnString;*/
ResponseDto
<
DragonRefundAppDto
>
returnData
=
dragonOrderRefundsService
.
dragonRefund
(
orderVo
.
getPayCode
(),
orderVo
.
getPayCode
(),
refundCode
,
"NFT超时支付"
,
synUrl
,
price
,
orderVo
.
getPaymentType
(),
orderVo
.
getPaymentId
(),
price
);
String
returnString
=
JSON
.
toJSONString
(
returnData
);
log
.
info
(
"NFT退款请求 结果:[returnString:{}]"
,
returnString
);
return
JsonUtils
.
toJson
(
returnString
);
}
}
public
boolean
isVipMember
(
String
uid
)
{
public
boolean
isVipMember
(
String
uid
)
{
...
@@ -400,37 +424,37 @@ public class GoblinNftOrderUtils {
...
@@ -400,37 +424,37 @@ public class GoblinNftOrderUtils {
}
}
/**
/**
*
private int skuType 商品类型[0-常规|1-数字藏品]
* private int skuType 商品类型[0-常规|1-数字藏品]
*
private String status 审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过];
* private String status 审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过];
*
private String shelvesStatus 单品上架状态[0-待上架|1-下架|2-违规|3-上架];
* private String shelvesStatus 单品上架状态[0-待上架|1-下架|2-违规|3-上架];
*
private String skuAppear 是否隐藏[0-默认展示|1-隐藏]; 隐藏款 拼参数可购买 盲盒可抽
* private String skuAppear 是否隐藏[0-默认展示|1-隐藏]; 隐藏款 拼参数可购买 盲盒可抽
*
private String delFlg 删除标记[0-未删除|1-删除];
* private String delFlg 删除标记[0-未删除|1-删除];
*
*
<p>
*
private LocalDateTime saleStartTime 开售时间;
* private LocalDateTime saleStartTime 开售时间;
*
private LocalDateTime saleStopTime 停售时间 预留 暂时不做处理;
* private LocalDateTime saleStopTime 停售时间 预留 暂时不做处理;
*
private String soldoutStatus 是否售罄[0-否|1-是];
* private String soldoutStatus 是否售罄[0-否|1-是];
*
*
<p>
*
private String skuCanbuy 是否购买[0-否|1-是] 这个用来预览 前端自己判断;
* private String skuCanbuy 是否购买[0-否|1-是] 这个用来预览 前端自己判断;
*
*
<p>
*
Integer upchain NFT上传声明状态[0-待上传|1-已声明|2-声明失败|9-声明中]
* Integer upchain NFT上传声明状态[0-待上传|1-已声明|2-声明失败|9-声明中]
*
*
<p>
*
根据概率判断是否过滤当前sku 没设置概率或者设置了的返回true
* 根据概率判断是否过滤当前sku 没设置概率或者设置了的返回true
*
*
<p>
*
String unbox; 是否盲盒[0-否|1-是]
* String unbox; 是否盲盒[0-否|1-是]
*/
*/
// 获取盲盒下藏品的库存 各种状态下不能算库存的排除掉
// 获取盲盒下藏品的库存 各种状态下不能算库存的排除掉
public
int
getSkuAllStatusStock
(
String
listId
,
GoblinGoodsSkuInfoVo
info
)
{
public
int
getSkuAllStatusStock
(
String
listId
,
GoblinGoodsSkuInfoVo
info
)
{
if
(
if
(
info
!=
null
info
!=
null
// && LocalDateTime.now().isAfter(info.getSaleStartTime())
// && LocalDateTime.now().isAfter(info.getSaleStartTime())
&&
(
null
==
info
.
getSoldoutStatus
()
||
info
.
getSoldoutStatus
().
equals
(
"0"
))
&&
(
null
==
info
.
getSoldoutStatus
()
||
info
.
getSoldoutStatus
().
equals
(
"0"
))
&&
(
null
==
info
.
getSkuCanbuy
()
||
info
.
getSkuCanbuy
().
equals
(
"1"
))
&&
(
null
==
info
.
getSkuCanbuy
()
||
info
.
getSkuCanbuy
().
equals
(
"1"
))
&&
(
null
==
info
.
getHitRatio
()
||
info
.
getHitRatio
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
&&
(
null
==
info
.
getHitRatio
()
||
info
.
getHitRatio
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
)
{
// 可以返回库存
)
{
// 可以返回库存
// 外面只有盲盒才能请求进来 里面只有不是分批购才判断盲盒里藏品的开售时间
// 外面只有盲盒才能请求进来 里面只有不是分批购才判断盲盒里藏品的开售时间
if
(
null
==
listId
)
{
if
(
null
==
listId
)
{
// if (LocalDateTime.now().isAfter(info.getSaleStartTime())) {
// if (LocalDateTime.now().isAfter(info.getSaleStartTime())) {
return
goblinRedisUtils
.
getSkuStock
(
listId
,
info
.
getSkuId
());
return
goblinRedisUtils
.
getSkuStock
(
listId
,
info
.
getSkuId
());
// } else {
// } else {
// return 0;
// return 0;
// }
// }
...
@@ -441,16 +465,17 @@ public class GoblinNftOrderUtils {
...
@@ -441,16 +465,17 @@ public class GoblinNftOrderUtils {
return
0
;
return
0
;
}
}
}
}
// 各种状态下判断藏品是否可以展示
// 各种状态下判断藏品是否可以展示
public
boolean
getSkuAllStatusShow
(
GoblinGoodsSkuInfoVo
info
)
{
public
boolean
getSkuAllStatusShow
(
GoblinGoodsSkuInfoVo
info
)
{
if
(
if
(
info
!=
null
info
!=
null
&&
info
.
getSkuType
()
==
1
&&
info
.
getSkuType
()
==
1
&&
info
.
getStatus
().
equals
(
"3"
)
&&
info
.
getStatus
().
equals
(
"3"
)
&&
info
.
getShelvesStatus
().
equals
(
"3"
)
&&
info
.
getShelvesStatus
().
equals
(
"3"
)
// && (info.getSkuAppear() == null || info.getSkuAppear().equals("0"))
// && (info.getSkuAppear() == null || info.getSkuAppear().equals("0"))
&&
info
.
getDelFlg
().
equals
(
"0"
)
&&
info
.
getDelFlg
().
equals
(
"0"
)
&&
((
info
.
getUnbox
().
equals
(
"0"
)
&&
info
.
getUpchain
()
==
1
)
||
info
.
getUnbox
().
equals
(
"1"
))
&&
((
info
.
getUnbox
().
equals
(
"0"
)
&&
info
.
getUpchain
()
==
1
)
||
info
.
getUnbox
().
equals
(
"1"
))
)
{
)
{
return
true
;
return
true
;
}
else
{
}
else
{
...
...
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