Prechádzať zdrojové kódy

fix:VIP休学时计算剩余有效期时长

Joburgess 4 rokov pred
rodič
commit
1137d28f8d

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentRecoverInfoDto.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 
+import java.time.LocalDate;
+
 /**
  * @Author Joburgess
  * @Date 2019/12/24
@@ -18,6 +20,16 @@ public class StudentRecoverInfoDto {
 
     private int giveCourseTimes;
 
+    private LocalDate expireDate;
+
+    public LocalDate getExpireDate() {
+        return expireDate;
+    }
+
+    public void setExpireDate(LocalDate expireDate) {
+        this.expireDate = expireDate;
+    }
+
     public Integer getVipGroupId() {
         return vipGroupId;
     }

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -2049,6 +2049,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		Map<BigDecimal, Long> collect = coursePrices.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
 		studentRecoverInfoDto.setGiveCourseTimes(Objects.isNull(collect.get(new BigDecimal("0.00")))?0:collect.get(new BigDecimal("0.00")).intValue());
 		studentRecoverInfoDto.setTotalCourseTimes(coursePrices.size()-studentRecoverInfoDto.getGiveCourseTimes());
+
+		if(courseInfo.containsKey("days")){
+			int surplusDays = Integer.valueOf(courseInfo.get("days").toString());
+			studentRecoverInfoDto.setExpireDate(LocalDate.now().plusDays(surplusDays));
+		}
 		return studentRecoverInfoDto;
     }