Eric 2 年之前
父节点
当前提交
8f4af986c5
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/DegreeWrapper.java

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/DegreeWrapper.java

@@ -237,6 +237,9 @@ public class DegreeWrapper {
         @ApiModelProperty("考级城市分部")
         private List<DegreeCity> degreeCities;
 
+        @ApiModelProperty("倒计时开始天数")
+        private Integer startDays;
+
 
         public String jsonString() {
             return JSON.toJSONString(this);
@@ -245,6 +248,16 @@ public class DegreeWrapper {
         public static StudentDegreeInfo from(String json) {
             return JSON.parseObject(json, StudentDegreeInfo.class);
         }
+
+        public Integer getStartDays() {
+            if (Objects.nonNull(getStartTime()) && EDegreeStatus.NOT_START == getStatus()) {
+
+                DateTime now = DateTime.now().withHourOfDay(0).withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0);
+                // 计算与当前时间相差天数
+                return Days.daysBetween(now, new DateTime(getStartTime())).getDays();
+            }
+            return Optional.ofNullable(startDays).orElse(0);
+        }
     }
 
     @Data