Browse Source

Merge branch 'feature/0721-tenant'

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

+ 4 - 14
cooleshow-common/src/main/java/com/yonge/cooleshow/common/constant/SysConfigConstant.java

@@ -400,22 +400,12 @@ public interface SysConfigConstant {
     String TENANT_DEFAULT_HEAD = "tenant_default_head";
 
     /**
-     * 机构学生默认头像
+     * 老师默认头像
      */
-    String TENANT_STUDENT_BOY_AVATAR = "tenant_student_boy_avatar";
+    String TEACHER_AVATAR = "teacher_avatar";
 
     /**
-     * 机构学生默认头像
+     * 学生默认头像
      */
-    String TENANT_STUDENT_AVATAR = "tenant_student_avatar";
-
-    /**
-     * 机构老师默认头像
-     */
-    String TENANT_TEACHER_AVATAR = "tenant_teacher_avatar";
-
-    /**
-     * 机构学生默认头像
-     */
-    String TENANT_STUDENT_GIRL_AVATAR = "tenant_student_girl_avatar";
+    String STUDENT_AVATAR = "student_avatar";
 }

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

@@ -605,11 +605,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
         }
         String avatar = studentInfo.getAvatar();
         if (StringUtils.isEmpty(avatar)) {
-            if (studentInfo.getGender().equals(1)) {
-                avatar = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_BOY);
-            } else {
-                avatar = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_GIRL);
-            }
+            avatar = sysConfigService.findConfigValue(SysConfigConstant.STUDENT_AVATAR);
             studentInfo.setAvatar(avatar);
         }
         // 解绑
@@ -655,11 +651,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
     private Boolean createStudent(StudentWrapper.Student studentInfo) {
         String avatar = studentInfo.getAvatar();
         if (StringUtils.isEmpty(avatar)) {
-            if (studentInfo.getGender().equals(1)) {
-                avatar = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_BOY);
-            } else {
-                avatar = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_GIRL);
-            }
+            avatar = sysConfigService.findConfigValue(SysConfigConstant.STUDENT_AVATAR);
             studentInfo.setAvatar(avatar);
         }
         com.yonge.cooleshow.biz.dal.entity.SysUser sysUser = getOrCreateAccount(studentInfo);
@@ -707,17 +699,11 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
             sysUser = JSON.parseObject(JSON.toJSONString(studentInfo),
                     com.yonge.cooleshow.biz.dal.entity.SysUser.class);
             sysUser.setPhone(studentInfo.getPhone());
+            sysUser.setAvatar(studentInfo.getAvatar());
             if (StringUtils.isEmpty(studentInfo.getAvatar())) {
                 //设置默认头像
-                String avatar;
-                if (studentInfo.getGender().equals(1)) {
-                    avatar = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_BOY);
-                } else {
-                    avatar = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_GIRL);
-                }
+                String avatar = sysConfigService.findConfigValue(SysConfigConstant.STUDENT_AVATAR);
                 sysUser.setAvatar(avatar);
-            } else {
-                sysUser.setAvatar(studentInfo.getAvatar());
             }
             sysUser.setGender(studentInfo.getGender());
             sysUser.setUserType("STUDENT");

+ 6 - 6
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherServiceImpl.java

@@ -462,6 +462,11 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
         if (StringUtils.isEmpty(sysUser.getUsername())) {
             sysUser.setUsername("游客" + sysUser.getId());
         }
+        //设置默认头像
+        if (StringUtil.isEmpty(sysUser.getAvatar())) {
+            String defaultHeard = sysConfigService.findConfigValue(SysConfigConstant.TEACHER_AVATAR);
+            sysUser.setAvatar(defaultHeard);
+        }
         employeeDao.updateSysUser(sysUser);
         return sysUser;
     }
@@ -581,12 +586,7 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
         } else if (!sysUser.getUserType().contains("TEACHER")) {
             sysUser.setUserType(sysUser.getUserType() + ",TEACHER");
         }
-        //设置默认头像
-        if (StringUtil.isEmpty(sysUser.getAvatar())) {
-            String defaultHeard = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD);
-            sysUser.setAvatar(defaultHeard);
-        }
-
+        sysUser.setAvatar(teacherSubmitReq.getAvatar());
         sysUser.setUsername(teacherSubmitReq.getUsername());
         sysUser.setPhone(teacherSubmitReq.getPhone());
         return sysUser;

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

@@ -273,7 +273,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI
         } else {
             sysUser = new SysUser();
             sysUser.setPhone(tenantInfo.getPhone());
-            sysUser.setAvatar(sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD));
+            sysUser.setAvatar(sysConfigService.findConfigValue(SysConfigConstant.TEACHER_AVATAR));
             sysUser.setUserType(SysUserType.ORGANIZATION.getCode());
             sysUser.setUsername(tenantInfo.getUsername());
             String newPassword = MessageFormat.format("klxjg{0}", tenantInfo.getPhone().substring(7));

+ 3 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserAccountRecordServiceImpl.java

@@ -179,9 +179,10 @@ public class UserAccountRecordServiceImpl extends ServiceImpl<UserAccountRecordD
             records.addAll(baseMapper.selectRecordByOrderDetail(userOrderDetailVo.getOrderNo(),AccountBizTypeEnum.PRACTICE, bizIds));
         }else if(GoodTypeEnum.LIVE.equals(userOrderDetailVo.getGoodType())){
 
+            List<Long> groupId = Arrays.asList(userOrderDetailVo.getBizId());
+            records.addAll(baseMapper.selectRecordByOrderDetail(userOrderDetailVo.getOrderNo(), AccountBizTypeEnum.LIVE_SHARE, groupId));
+
             if (userOrderDetailVo.getPaymentVersion().equals(EPaymentVersion.V1)) {
-                List<Long> groupId = Arrays.asList(userOrderDetailVo.getBizId());
-                records.addAll(baseMapper.selectRecordByOrderDetail(userOrderDetailVo.getOrderNo(), AccountBizTypeEnum.LIVE_SHARE, groupId));
                 //查询课程组下所有课程id
                 List<CourseSchedule> cancel = courseScheduleService.list(Wrappers.<CourseSchedule>lambdaQuery()
                         .eq(CourseSchedule::getCourseGroupId, userOrderDetailVo.getBizId())

+ 0 - 11
cooleshow-user/user-tenant/src/main/java/com/yonge/cooleshow/tenant/controller/open/OpenStudentController.java

@@ -145,17 +145,6 @@ public class OpenStudentController extends BaseController {
             student.setId(studentId);
         }
 
-        // 配置头像
-        String avatar = student.getAvatar();
-        if (StringUtils.isEmpty(avatar)) {
-            if (student.getGender().equals(1)) {
-                avatar = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_BOY);
-            } else {
-                avatar = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_GIRL);
-            }
-            student.setAvatar(avatar);
-        }
-
         StudentWrapper.Student studentInfo = JSON.parseObject(JSON.toJSONString(student), StudentWrapper.Student.class);
         studentInfo.setTenantId(tenantInfo.getId());