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

Commit faaadd54 authored by 胡佳晨's avatar 胡佳晨

再次支付 接口添加

parent 9e3024c8
......@@ -14,4 +14,5 @@ public interface IGoblinAppOrderService {
ResponseDto<GoblinPayInnerResultVo> syncOrder(SyncOrderParam syncOrderParam);
ResponseDto<Integer> checkOrderResult(String orderId);
}
......@@ -7,9 +7,7 @@ import com.liquidnet.service.goblin.dto.manage.vo.GoblinPayInnerResultVo;
import com.liquidnet.service.goblin.param.PayAgainParam;
import com.liquidnet.service.goblin.param.SyncOrderParam;
import com.liquidnet.service.goblin.service.IGoblinAppOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -49,6 +47,16 @@ public class GoblinAppOrderController {
@ApiOperation("再次支付")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<GoblinPayInnerResultVo> payAgain(@RequestBody @Valid PayAgainParam param) {
return null;
return goblinAppOrderService.payAgain(param);
}
@PostMapping("payAgain")
@ApiOperation("再次支付")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "订单id", example = "1"),
})
public ResponseDto<Integer> checkOrderResult(@RequestParam("orderId") @Valid String orderId) {
return goblinAppOrderService.checkOrderResult(orderId);
}
}
......@@ -387,10 +387,10 @@ public class GoblinAppOrderServiceImpl implements IGoblinAppOrderService {
//检查订单时间 是否关闭
GoblinStoreOrderVo storeOrderVo = redisUtils.getGoblinOrder(param.getOrderId());
if (!storeOrderVo.getUserId().equals(uid)) {
return ResponseDto.failure(ErrorMapping.get("20003"));
return ResponseDto.failure("无权查看");
}
if (storeOrderVo == null) {
return ResponseDto.failure(ErrorMapping.get("20024"));
return ResponseDto.failure("订单不存在");
}
if (storeOrderVo.getStatus() != GoblinStatusConst.OrderStatus.ORDER_STATUS_0.getValue()) {
......@@ -467,4 +467,27 @@ public class GoblinAppOrderServiceImpl implements IGoblinAppOrderService {
public ResponseDto<GoblinPayInnerResultVo> syncOrder(SyncOrderParam syncOrderParam) {
return null;
}
@Override
public ResponseDto<Integer> checkOrderResult(String orderId) {
String uid = CurrentUtil.getCurrentUid();
GoblinStoreOrderVo storeOrderVo = redisUtils.getGoblinOrder(orderId);
if (storeOrderVo == null) {
return ResponseDto.failure("订单不存在");
} else {
if (!storeOrderVo.getUserId().equals(uid)) {
return null;
}
String returnCheckData = HttpUtil.get(checkUrl + "?code=" + storeOrderVo.getPayCode(), null);
ResponseDto<SyncOrderParam> syncOrderDtoParam = JsonUtils.fromJson(returnCheckData, new TypeReference<ResponseDto<SyncOrderParam>>() {
});
if (syncOrderDtoParam.getData().getStatus() == 1) {
//处理订单
syncOrder(syncOrderDtoParam.getData());
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