|
@@ -2,6 +2,7 @@ package com.fdkankan.ucenter.mq.consumer;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.ucenter.entity.IncrementOrder;
|
|
|
+import com.fdkankan.ucenter.entity.IncrementType;
|
|
|
import com.fdkankan.ucenter.entity.User;
|
|
|
import com.fdkankan.ucenter.entity.UserIncrement;
|
|
|
import com.fdkankan.ucenter.httpClient.vo.PayOrderVo;
|
|
@@ -9,10 +10,8 @@ import com.fdkankan.ucenter.pay.paypal.sdk.AutoPaypalVo;
|
|
|
import com.fdkankan.ucenter.pay.strategy.impl.DownloadOrderImpl;
|
|
|
import com.fdkankan.ucenter.pay.strategy.impl.EntityOrderImpl;
|
|
|
import com.fdkankan.ucenter.pay.strategy.impl.IncrementOrderImpl;
|
|
|
-import com.fdkankan.ucenter.service.IIncrementOrderService;
|
|
|
-import com.fdkankan.ucenter.service.IMailTemplateService;
|
|
|
-import com.fdkankan.ucenter.service.IUserIncrementService;
|
|
|
-import com.fdkankan.ucenter.service.IUserService;
|
|
|
+import com.fdkankan.ucenter.service.*;
|
|
|
+import com.fdkankan.ucenter.util.DateUserUtil;
|
|
|
import com.rabbitmq.client.Channel;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringEscapeUtils;
|
|
@@ -23,7 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
@Slf4j
|
|
|
@Component
|
|
@@ -36,6 +37,8 @@ public class AutoOrderConsumer {
|
|
|
IMailTemplateService mailTemplateService;
|
|
|
@Autowired
|
|
|
IUserService userService;
|
|
|
+ @Autowired
|
|
|
+ IncrementOrderImpl incrementOrder;
|
|
|
|
|
|
|
|
|
@RabbitListener(
|
|
@@ -55,19 +58,13 @@ public class AutoOrderConsumer {
|
|
|
}
|
|
|
|
|
|
List<UserIncrement> increments = userIncrementService.getByAutoOrderSn(order.getOrderSn());
|
|
|
- if(increments == null || increments.size()<=0){
|
|
|
- log.info("autoPaypal-result-mq-userIncrementIsEmpty");
|
|
|
- return;
|
|
|
- }
|
|
|
|
|
|
switch (order.getEventType()){
|
|
|
case "PAYMENT.SALE.COMPLETED" : //每日扣款
|
|
|
//Enum: "completed" "partially_refunded" "pending" "refunded" "denied"
|
|
|
switch (order.getState()){
|
|
|
case "completed" : //扣款完成
|
|
|
- for (UserIncrement increment : increments) {
|
|
|
- userIncrementService.delay(increment);
|
|
|
- }
|
|
|
+ incrementOrder.handleOrder(order.getOrderSn(),order.getOrderSn(),order.getOrderSn(),2,null);
|
|
|
break;
|
|
|
case "partially_refunded" :
|
|
|
break;
|