فهرست منبع

自动订阅,权益续费,扣款日期

lyhzzz 1 سال پیش
والد
کامیت
99e1967ac0

+ 4 - 0
src/main/java/com/fdkankan/ucenter/httpClient/param/PayAutoPayVo.java

@@ -2,9 +2,11 @@ package com.fdkankan.ucenter.httpClient.param;
 
 import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 @Data
 @AllArgsConstructor
+@NoArgsConstructor
 public class PayAutoPayVo {
 
     private Integer autoPay;
@@ -12,4 +14,6 @@ public class PayAutoPayVo {
     DAY,MONTH,YEAR
  */
     private String autoPayTime;
+
+    private String autoStartTime;
 }

+ 2 - 0
src/main/java/com/fdkankan/ucenter/httpClient/param/PayOrderParam.java

@@ -15,6 +15,7 @@ public class PayOrderParam {
     private String nickName;
     private List<PayGoods> goodsInfo;
     private Integer autoPay;
+    private String autoStartTime;
     /*
         DAY,MONTH,YEAR
      */
@@ -29,6 +30,7 @@ public class PayOrderParam {
         if(autoPay != null){
             this.autoPay = autoPay.getAutoPay();
             this.autoPayTime = autoPay.getAutoPayTime();
+            this.autoStartTime = autoPay.getAutoStartTime();
         }
     }
 }

+ 14 - 3
src/main/java/com/fdkankan/ucenter/service/impl/IncrementOrderServiceImpl.java

@@ -173,15 +173,26 @@ public class IncrementOrderServiceImpl extends ServiceImpl<IIncrementOrderMapper
 
         IncrementOrder incrementOrderEntity = new IncrementOrder();
         PayAutoPayVo autoPayVo = null;
+        String autoStartTime = null;
+        String autoPayTime = null;
+        UserIncrement userIncrement = null;
+        if(param.getAutoPay() != null && param.getAutoPay() == 1){
+            if(param.getIncrementId() != null){
+                userIncrement = userIncrementService.getById(param.getIncrementId());
+                if(userIncrement != null){
+                    autoStartTime = userIncrement.getIncrementEndTime();
+                }
+            }
+        }
         if(incrementType.getValidTimeType() == 0){
             incrementOrderEntity.setMemberLevels("PR");
-            autoPayVo =new PayAutoPayVo(param.getAutoPay(),"YEAR");
+            autoPayTime = "MONTH";
         }
         if(incrementType.getValidTimeType() == 1){
             incrementOrderEntity.setMemberLevels("SE");
-            autoPayVo = new PayAutoPayVo(param.getAutoPay(), "MONTH");
+            autoPayTime = "YEAR";
         }
-
+        autoPayVo =new PayAutoPayVo(param.getAutoPay(),autoPayTime,autoStartTime);
         PayGoods payGoods = new PayGoods(incrementType.getName(),param.getCount(),incrementType.getValidTimeType(),param.getMonthQy());
         PayOrderVo payOrderVo = payService.downOrder(total, "incrementOrder",user.getUserName(),user.getNickName(), Arrays.asList(payGoods),autoPayVo);
         if(payOrderVo == null){