فهرست منبع

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

liujc 1 سال پیش
والد
کامیت
26c578787a

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

@@ -197,6 +197,7 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
                 .set(TenantActivationCode::getActivationUserId, student.getUserId())
                 .set(TenantActivationCode::getActivationTime, new Date())
                 .set(TenantActivationCode::getActivationPhone, sysUser.getPhone())
+                .set(TenantActivationCode::getSendStatus, EActivationCode.SEND)
                 .eq(TenantActivationCode::getId, code.getId())
                 .eq(TenantActivationCode::getActivationStatus, false)
                 .update();

+ 1 - 5
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantPersonStatServiceImpl.java

@@ -28,17 +28,13 @@ public class TenantPersonStatServiceImpl extends ServiceImpl<TenantPersonStatMap
     @Transactional(rollbackFor = Exception.class)
     public void tenantPersonStatTask() {
         Date date = DateUtil.addDays(new Date(), -1);
-        String day = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
-        this.lambdaUpdate().eq(TenantPersonStat::getDay,day).remove();
         String month = DateUtil.format(date,DateUtil.ISO_YEAR_MONTH_FORMAT);
-        String year = DateUtil.getYear(date);
+        this.lambdaUpdate().eq(TenantPersonStat::getMonth,month).remove();
         //获取初始化数据
         List<TenantPersonStat> stats = baseMapper.init();
         if(CollectionUtils.isNotEmpty(stats)){
             stats.stream().forEach(e->{
-                e.setDay(day);
                 e.setMonth(month);
-                e.setYear(year);
             });
             this.saveBatch(stats);
         }

+ 7 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/StudentVo.java

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
 import java.util.Date;
 
 import lombok.Data;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -21,6 +22,9 @@ import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 @Data
 @ApiModel(value = "StudentVo对象", description = "学生表")
 public class StudentVo extends Student {
+
+    @ApiModelProperty("用户头像")
+    private String userAvatar;
     @ApiModelProperty("头像地址")
     private String avatar;
     @ApiModelProperty("昵称")
@@ -77,6 +81,9 @@ public class StudentVo extends Student {
     }
 
     public String getAvatar() {
+        if (StringUtils.isBlank(avatar)){
+            return userAvatar;
+        }
         return avatar;
     }
 

+ 13 - 11
cooleshow-user/user-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -18,20 +18,20 @@
 
     <!-- 表字段 -->
     <sql id="baseColumns">
-         t.user_id_ as "userId"
-        , t.subject_id_ as "subjectId"
-        , t.current_grade_num_ as "currentGradeNum"
-        , t.member_rank_setting_id_ as "memberRankSettingId"
-        , t.membership_start_time_ as "membershipStartTime"
-        , t.membership_end_time_ as "membershipEndTime"
-        , t.cloud_study_sequence_days_ as "cloudStudySequenceDays"
-        , t.cloud_study_use_last_day_ as "cloudStudyUseLastDay"
+         t.user_id_ as `userId`
+        , t.subject_id_ as `subjectId`
+        , t.current_grade_num_ as `currentGradeNum`
+        , t.member_rank_setting_id_ as `memberRankSettingId`
+        , t.membership_start_time_ as `membershipStartTime`
+        , t.membership_end_time_ as `membershipEndTime`
+        , t.cloud_study_sequence_days_ as `cloudStudySequenceDays`
+        , t.cloud_study_use_last_day_ as `cloudStudyUseLastDay`
         , t.train_time_ as trainTime
         , t.evaluate_time_ as evaluateTime
         , t.tenant_id_ as tenantId
-        , t.create_time_ as "createTime"
-        , t.update_time_ as "updateTime"
-        , t.avatar_ as "avatar"
+        , t.create_time_ as `createTime`
+        , t.update_time_ as `updateTime`
+        , t.avatar_ as `avatar`
         </sql>
     <update id="setSubject">
         update student set subject_id_ = #{subjectIds},update_time_ = now() where user_id_ = #{id}
@@ -41,6 +41,7 @@
         SELECT
             <include refid="baseColumns"/>,
             if(u.lock_flag_ = 0 and t.lock_flag_ = 0,0,1) as lockFlag,
+            u.avatar_ as userAvatar,
             u.real_name_ as realName,
             u.id_card_no_ as idCardNo,
             u.username_ as username,
@@ -87,6 +88,7 @@
         SELECT
             <include refid="baseColumns"/>,
             if(u.lock_flag_ = 0 and t.lock_flag_ = 0,0,1) as lockFlag,
+            u.avatar_ as userAvatar,
             u.username_ as username,
             u.gender_ as gender,
             u.birthdate_ as birthdate,

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -99,7 +99,7 @@
         u.username_ as username,
         u.phone_ as phone,
         u.real_name_ as realName,
-        u.avatar_ as avatar,
+        if (t.avatar_ = '' OR t.avatar_ IS NULL, u.avatar_, t.avatar_) as avatar,
         u.birthdate_ as birthdate,
         u.gender_ as gender,
         (case when t.membership_end_time_ &gt;= now() then 1 else 0 end) isVip,

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantPersonStatMapper.xml

@@ -14,7 +14,7 @@
         </sql> 
     
     <select id="init" resultType="com.yonge.cooleshow.biz.dal.entity.TenantPersonStat">
-        select ti.id_ tenantId,COUNT(s.user_id_) studentNum,COUNT(t.user_id_) teacherNum from tenant_info ti
+        select ti.id_ tenantId,COUNT(distinct s.user_id_) studentNum,COUNT(distinct t.user_id_) teacherNum from tenant_info ti
         left join student s ON s.tenant_id_ = ti.id_ AND s.lock_flag_ = 0
         left join teacher t ON t.tenant_id_ = ti.id_ AND t.lock_flag_ = 0
         group by ti.id_