Forráskód Böngészése

Merge branch 'feature/0406-degree' of http://git.dayaedu.com/yonge/mec into feature/0406-degree

liujc 2 éve
szülő
commit
e111458645

+ 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

+ 4 - 4
mec-student/src/main/java/com/ym/mec/student/controller/degree/DegreeInfoController.java

@@ -59,16 +59,16 @@ public class DegreeInfoController extends BaseController {
         DegreeWrapper.StudentDegreeInfo wrapper = degreeService.studentDegreeInfoById(id);
 
         // 考级机构-暂未开放此活动
-        if (!user.getTenantId().equals(wrapper.getTenantId())) {
+        /*if (!user.getTenantId().equals(wrapper.getTenantId())) {
             throw new BizException("暂未开放此活动");
-        }
+        }*/
 
         // 考级城市-暂未开放此活动
-        boolean noneMatch = Arrays.stream(wrapper.getOrganIds().split(","))
+        /*boolean noneMatch = Arrays.stream(wrapper.getOrganIds().split(","))
                 .mapToInt(Integer::parseInt).noneMatch(x -> x == user.getOrganId());
         if (Objects.nonNull(user.getOrganId()) && noneMatch) {
             throw new BizException("暂未开放此活动");
-        }
+        }*/
 
         // 查询机构信息
         return succeed(wrapper);