lyhzzz 2 سال پیش
والد
کامیت
950f262ee9

+ 8 - 1
src/main/java/com/fdkankan/ucenter/service/impl/IncrementOrderServiceImpl.java

@@ -90,8 +90,15 @@ public class IncrementOrderServiceImpl extends ServiceImpl<IIncrementOrderMapper
         if(param.getDateType() != 5 && param.getDateType() != 6 && param.getDateType() !=7){
             throw new BusinessException(SceneConstant.FAILURE_CODE_5012, SceneConstant.FAILURE_MSG_5012);
         }
+        GoodsSkuVo goodsSkuVo = getGoodsSkuVo(param.getDateType(), param.getUserIncrementId());
+        if(param.getMonthQy() != null){
+            goodsSkuVo.setPrice(goodsSkuVo.getPrice().multiply(new BigDecimal(param.getMonthQy())));
+            if(param.getDateType() ==7){
+                goodsSkuVo.setDeadLine(DateUserUtil.getMonthDate( new Date(),param.getMonthQy() ).getTime());
+            }
+        }
 
-        return getGoodsSkuVo(param.getDateType(),param.getUserIncrementId());
+        return goodsSkuVo;
     }
 
     private GoodsSkuVo getGoodsSkuVo (Integer dateType,Integer userIncrementId){

+ 9 - 0
src/main/java/com/fdkankan/ucenter/util/DateUserUtil.java

@@ -6,6 +6,8 @@ import com.fdkankan.ucenter.entity.IncrementType;
 import org.joda.time.DateTime;
 
 import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
 import java.util.Date;
 
 public class DateUserUtil {
@@ -85,4 +87,11 @@ public class DateUserUtil {
         }
         return between;
     }
+    public static Date getMonthDate(Date endDate, Integer month) {
+
+        LocalDateTime localDateTime = endDate.toInstant()
+                .atZone(ZoneId.systemDefault())
+                .toLocalDateTime().plusMonths(month);
+        return  Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
+    }
 }

+ 3 - 1
src/main/java/com/fdkankan/ucenter/vo/request/OrderParam.java

@@ -18,6 +18,8 @@ public class OrderParam extends RequestBase {
     // 订单类型,0表示购物,1表示点数充值,2表示扩充容量
     private Integer orderType;
 
-    private int payType;
+    private Integer payType;
+
+    private Integer monthQy;
 
 }