记得上下班打卡 | git大法好,push需谨慎

Commit b1d570d1 authored by jiangxiulong's avatar jiangxiulong

nft 支付回调 超时支付退款

parent 20d04b4f
...@@ -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
......
...@@ -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
......
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) {
...@@ -405,17 +429,17 @@ public class GoblinNftOrderUtils { ...@@ -405,17 +429,17 @@ public class GoblinNftOrderUtils {
* 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-是]
*/ */
// 获取盲盒下藏品的库存 各种状态下不能算库存的排除掉 // 获取盲盒下藏品的库存 各种状态下不能算库存的排除掉
...@@ -441,6 +465,7 @@ public class GoblinNftOrderUtils { ...@@ -441,6 +465,7 @@ public class GoblinNftOrderUtils {
return 0; return 0;
} }
} }
// 各种状态下判断藏品是否可以展示 // 各种状态下判断藏品是否可以展示
public boolean getSkuAllStatusShow(GoblinGoodsSkuInfoVo info) { public boolean getSkuAllStatusShow(GoblinGoodsSkuInfoVo info) {
if ( if (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment