Browse Source

Merge branch 'feature/0721-tenant' of http://git.dayaedu.com/yonge/cooleshow into feature/0721-tenant

liujc 1 năm trước cách đây
mục cha
commit
fe7553c52a

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/StudentServiceImpl.java

@@ -136,6 +136,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
             total = new StudentTotal();
         }
 
+        studentHomeVo.setTenantAlbumStatus(0);
         studentHomeVo.setExerciseDays(null == total.getExerciseDays() ? 0 : total.getExerciseDays());
         studentHomeVo.setExerciseHours(null == total.getExerciseHours() ? 0 : total.getExerciseHours());
         studentHomeVo.setTestingNum(null == total.getTestingNum() ? 0 : total.getTestingNum());
@@ -152,12 +153,15 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
         // 判断是否是机构学生 机构学生 检测机构专辑购买记录
         TenantInfo tenantInfo = tenantInfoService.detail(detail.getTenantId());
         if (tenantInfo != null) {
+            studentHomeVo.setTenantName(tenantInfo.getName());
             UserTenantAlbumRecord record =
                     userTenantAlbumRecordService.getNewestByTenantIdAndUserId(tenantInfo.getId(), detail.getUserId(),
                             ClientEnum.STUDENT);
             if (record == null || record.getEndTime().getTime() < System.currentTimeMillis()) {
+                studentHomeVo.setTenantAlbumStatus(1);
                 studentHomeVo.setTenantAlbumFlag(YesOrNoEnum.NO);
             } else {
+                studentHomeVo.setTenantAlbumStatus(2);
                 studentHomeVo.setTenantAlbumFlag(YesOrNoEnum.YES);
                 studentHomeVo.setTenantAlbumStartTime(record.getStartTime());
                 studentHomeVo.setTenantAlbumEndTime(record.getEndTime());

+ 8 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/StudentHomeVo.java

@@ -6,6 +6,7 @@ import com.yonge.cooleshow.biz.dal.enums.GenderEnum;
 import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.util.Date;
@@ -14,6 +15,7 @@ import java.util.Date;
  * @Author: liweifan
  * @Data: 2022/3/21 18:37
  */
+@Data
 @ApiModel(value = "StudentHomeVo对象", description = "学生主页基本信息返回")
 public class StudentHomeVo extends Student {
 
@@ -78,9 +80,15 @@ public class StudentHomeVo extends Student {
     @ApiModelProperty(value = "学练工具是否有效 0否 1是")
     private YesOrNoEnum tenantAlbumFlag;
 
+    @ApiModelProperty(value = "0:没有专辑 1:有,但是未解锁,2:有,且已解锁")
+    private Integer tenantAlbumStatus;
+
     @ApiModelProperty(value = "imToken")
     private String imToken;
 
+    @ApiModelProperty(value = "机构名称")
+    private String tenantName;
+
     public YesOrNoEnum getTenantAlbumFlag() {
         return tenantAlbumFlag;
     }