|
@@ -3,10 +3,7 @@ package com.zswl.cloud.springBtach.server.core.service.impl;
|
|
import cn.hutool.core.lang.Snowflake;
|
|
import cn.hutool.core.lang.Snowflake;
|
|
import cn.hutool.json.JSONObject;
|
|
import cn.hutool.json.JSONObject;
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
-import com.eeext.openapi.entity.NotifyOrderReq;
|
|
|
|
-import com.eeext.openapi.entity.ProductItemResp;
|
|
|
|
-import com.eeext.openapi.entity.RechargeOrderReq;
|
|
|
|
-import com.eeext.openapi.entity.RechargeProductResp;
|
|
|
|
|
|
+import com.eeext.openapi.entity.*;
|
|
import com.github.microservice.auth.client.content.ResultContent;
|
|
import com.github.microservice.auth.client.content.ResultContent;
|
|
import com.github.microservice.auth.client.content.ResultState;
|
|
import com.github.microservice.auth.client.content.ResultState;
|
|
import com.github.microservice.auth.security.helper.AuthHelper;
|
|
import com.github.microservice.auth.security.helper.AuthHelper;
|
|
@@ -17,9 +14,13 @@ import com.zhongshu.payment.client.type.*;
|
|
import com.zswl.cloud.shop.client.service.ShopService;
|
|
import com.zswl.cloud.shop.client.service.ShopService;
|
|
import com.zswl.cloud.shop.client.vo.life.AccountDetailVo;
|
|
import com.zswl.cloud.shop.client.vo.life.AccountDetailVo;
|
|
import com.zswl.cloud.shop.client.vo.life.SharePlatformVo;
|
|
import com.zswl.cloud.shop.client.vo.life.SharePlatformVo;
|
|
|
|
+import com.zswl.cloud.springBatch.client.model.video2.RechargeRequest;
|
|
|
|
+import com.zswl.cloud.springBatch.client.service.Video2Service;
|
|
import com.zswl.cloud.springBtach.server.core.api.video2.Video2Api;
|
|
import com.zswl.cloud.springBtach.server.core.api.video2.Video2Api;
|
|
import lombok.extern.log4j.Log4j2;
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -29,7 +30,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@Log4j2
|
|
@Log4j2
|
|
-public class Video2ServiceImpl {
|
|
|
|
|
|
+public class Video2ServiceImpl implements Video2Service {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private Video2Api video2Api;
|
|
private Video2Api video2Api;
|
|
@@ -47,7 +48,8 @@ public class Video2ServiceImpl {
|
|
OrderService2 orderService2;
|
|
OrderService2 orderService2;
|
|
@Autowired
|
|
@Autowired
|
|
private PaymentService2 paymentService2;
|
|
private PaymentService2 paymentService2;
|
|
-
|
|
|
|
|
|
+ @Value("${video2.notifyUrl}")
|
|
|
|
+ private String notifyUrl;
|
|
/**
|
|
/**
|
|
* 商品列表
|
|
* 商品列表
|
|
*
|
|
*
|
|
@@ -149,6 +151,25 @@ public class Video2ServiceImpl {
|
|
updateGoodsModel.setExtend(JSONUtil.parseObj(notifyOrderReq));
|
|
updateGoodsModel.setExtend(JSONUtil.parseObj(notifyOrderReq));
|
|
orderService2.updateGoods(updateGoodsModel);
|
|
orderService2.updateGoods(updateGoodsModel);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public ResultContent<Boolean> rechargeOrder(RechargeRequest rechargeRequest){
|
|
|
|
+ RechargeOrderReq rechargeOrderReq = new RechargeOrderReq();
|
|
|
|
+ rechargeOrderReq.setNotifyUrl(notifyUrl);
|
|
|
|
+ BeanUtils.copyProperties(rechargeRequest, rechargeOrderReq);
|
|
|
|
+ ResultContent<CreatOrderResultModel> creatOrderResultModelResultContent = creatOrder(rechargeOrderReq);
|
|
|
|
+ if (creatOrderResultModelResultContent.getState().equals(ResultState.Success)) {
|
|
|
|
+ return ResultContent.build(ResultState.Fail,creatOrderResultModelResultContent.getContent());
|
|
|
|
+ }
|
|
|
|
+ if (video2Api.rechargeOrder(rechargeOrderReq).isSuccess()) {
|
|
|
|
+ return ResultContent.buildContent(ResultState.Success);
|
|
|
|
+ }
|
|
|
|
+ return ResultContent.buildContent(ResultState.Fail);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public ResultContent<RechargeQueryResp> rechargeQuery(String outTradeNo) {
|
|
|
|
|
|
|
|
+ return ResultContent.buildContent(video2Api.rechargeQuery(outTradeNo));
|
|
}
|
|
}
|
|
}
|
|
}
|