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

Commit 9701224c authored by jiangxiulong's avatar jiangxiulong

nft:order查询订单状态 services调用

parent eed02880
......@@ -27,6 +27,11 @@
<artifactId>easyexcel</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-dragon-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.liquidnet.service.goblin.param;
import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -46,4 +47,18 @@ public class GoblinNftOrderPayCallbackParam implements Cloneable {
return new GoblinNftOrderPayCallbackParam();
}
}
public GoblinNftOrderPayCallbackParam copy(DragonPayOrderQueryRespDto source) {
if (null == source) return this;
this.setStatus(source.getStatus());
// this.setOrderId(source.getOrderCodeId());
this.setOrderCode(source.getOrderCode());
this.setCode(source.getCode());
this.setPrice(source.getPrice());
this.setType(source.getType());
this.setPaymentId(source.getPaymentId());
this.setPaymentType(source.getPaymentType());
this.setPaymentAt(source.getPaymentAt());
return this;
}
}
......@@ -7,6 +7,8 @@ import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.UserPathDto;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto;
import com.liquidnet.service.dragon.service.IDragonOrdersService;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.constant.NftAccStatusEnum;
......@@ -51,11 +53,13 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
GoblinOrderUtils goblinOrderUtils;
@Autowired
GoblinNftOrderUtils nftOrderUtils;
@Autowired
private IDragonOrdersService dragonOrdersService;
@Value("${liquidnet.service.order.url-pay.pay}")
private String payUrl;
@Value("${liquidnet.service.order.url-pay.check}")
private String checkUrl;
/*@Value("${liquidnet.service.order.url-pay.check}")
private String checkUrl;*/
@Value("${liquidnet.service.order.url-pay.nftPayNotify}")
private String synUrl;
......@@ -502,7 +506,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
orderVo.setCreatedAt(nftOrder.getCreatedAt());
// 待支付发送队列
queueUtils.sendMsgByRedisGoblinStock(orderVo.getOrderId(), nftOrder.getCreatedAt(), "NFT",5);
queueUtils.sendMsgByRedisGoblinStock(orderVo.getOrderId(), nftOrder.getCreatedAt(), "NFT", 5);
// redis 订单详情
nftOrderUtils.setNftOrder(orderVo);
......@@ -624,12 +628,14 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
if (null == nftOrder || !nftOrder.getUserId().equals(uid)) {
return ResponseDto.failure("订单不存在");
} else {
String returnCheckData = HttpUtil.get(checkUrl + "?code=" + nftOrder.getPayCode(), null);
/*String returnCheckData = HttpUtil.get(checkUrl + "?code=" + nftOrder.getPayCode(), null);
ResponseDto<GoblinNftOrderPayCallbackParam> syncOrderDtoParam = JsonUtils.fromJson(returnCheckData, new TypeReference<ResponseDto<GoblinNftOrderPayCallbackParam>>() {
});
if (syncOrderDtoParam.getData().getStatus() == 1) {
});*/
DragonPayOrderQueryRespDto respDto = dragonOrdersService.checkOrderStatusByCode(nftOrder.getPayCode());
if (respDto.getStatus() == 1) {
//处理订单
syncOrder(syncOrderDtoParam.getData());
GoblinNftOrderPayCallbackParam goblinNftOrderPayCallbackParam = GoblinNftOrderPayCallbackParam.getNew().copy(respDto);
syncOrder(goblinNftOrderPayCallbackParam);
return ResponseDto.success(1);
} else {
return ResponseDto.success(0);
......
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