Преглед на файлове

Merge branch 'feature/0721-tenant' into develop

yuanliang преди 1 година
родител
ревизия
962cb22b52

+ 10 - 0
cooleshow-common/src/main/java/com/yonge/cooleshow/common/constant/SysConfigConstant.java

@@ -407,5 +407,15 @@ public interface SysConfigConstant {
     /**
      * 机构学生默认头像
      */
+    String TENANT_STUDENT_AVATAR = "tenant_student_avatar";
+
+    /**
+     * 机构老师默认头像
+     */
+    String TENANT_TEACHER_AVATAR = "tenant_teacher_avatar";
+
+    /**
+     * 机构学生默认头像
+     */
     String TENANT_STUDENT_GIRL_AVATAR = "tenant_student_girl_avatar";
 }

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

@@ -604,6 +604,11 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
         if (student == null) {
             throw new BizException("学生信息不存在");
         }
+        String avatar = student.getAvatar();
+        if (StringUtils.isEmpty(avatar)) {
+            avatar = sysConfigService.findConfigValue(SysConfigConstant.TENANT_STUDENT_AVATAR);
+            student.setAvatar(avatar);
+        }
         // 解绑
 //        if (Boolean.FALSE.equals(studentInfo.getBindTenant())) {
 //            studentInfo.setTenantId(-1L);
@@ -638,6 +643,12 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
         student.setSubjectId(studentInfo.getSubjectId());
         student.setCreateTime(new Date());
         student.setLockFlag(UserLockFlag.NORMAL);
+        String avatar = studentInfo.getAvatar();
+        if (StringUtils.isEmpty(avatar)) {
+            avatar = sysConfigService.findConfigValue(SysConfigConstant.TENANT_STUDENT_AVATAR);
+            student.setAvatar(avatar);
+        }
+
         save(student);
         return true;
     }

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

@@ -280,7 +280,7 @@ public class TenantUnbindRecordServiceImpl extends ServiceImpl<TenantUnbindRecor
     @Override
     public void sendPlatformAuditMessage() {
         String configValue = sysConfigService.findConfigValue(SysConfigConstant.TENANT_USER_UNBIND_EXPIRE_TIME);
-        String unBindPhone = sysConfigService.findConfigValue(SysConfigConstant.TENANT_USER_UNBIND_PHONE);
+//        String unBindPhone = sysConfigService.findConfigValue(SysConfigConstant.TENANT_USER_UNBIND_PHONE);
         // 默认5天
         long expireTime = 5L;
         try {
@@ -310,7 +310,7 @@ public class TenantUnbindRecordServiceImpl extends ServiceImpl<TenantUnbindRecor
                     continue;
                 }
                 Map<Long, String> receivers = new HashMap<>();
-                receivers.put(unbindAuthUser.getUserId(), unBindPhone);
+                receivers.put(unbindAuthUser.getUserId(), sysUser.getPhone());
                 sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS,
                         MessageTypeEnum.PLATFORM_AUDIT_UNBIND,
                         receivers, null, 0, null, ClientEnum.SYSTEM.getCode(), count, finalExpireTime);

+ 2 - 2
cooleshow-user/user-tenant/src/main/java/com/yonge/cooleshow/tenant/controller/StudentController.java

@@ -83,10 +83,10 @@ public class StudentController extends BaseController {
 
         Map<Long, List<TenantActivationCode>> groupByUserId = new HashMap<>();
         if (!rows.isEmpty() && query.getTenantAlbumPurchaseId() != null) {
-            List<Long> studentIdList = rows.stream().map(Student::getUserId).collect(Collectors.toList());
+            List<String> studentPhones = rows.stream().map(StudentVo::getPhone).collect(Collectors.toList());
              groupByUserId = tenantActivationCodeService.lambdaQuery()
                     .eq(TenantActivationCode::getId, query.getTenantAlbumPurchaseId())
-                    .in(TenantActivationCode::getActivationUserId, studentIdList)
+                    .in(TenantActivationCode::getActivationPhone, studentPhones)
                     .list().stream().collect(Collectors.groupingBy(TenantActivationCode::getActivationUserId));
         }
 

+ 1 - 1
cooleshow-user/user-tenant/src/main/java/com/yonge/cooleshow/tenant/controller/TenantActivationCodeController.java

@@ -148,7 +148,7 @@ public class TenantActivationCodeController extends BaseController {
         }
         boolean update = tenantActivationCodeService.lambdaUpdate()
                 .set(TenantActivationCode::getSendStatus, EActivationCode.WAIT)
-                .eq(TenantActivationCode::getTenantId, id)
+                .eq(TenantActivationCode::getId, id)
                 .eq(TenantActivationCode::getActivationStatus, false)
                 .eq(TenantActivationCode::getSendStatus, EActivationCode.SEND)
                 .update();

+ 5 - 6
cooleshow-user/user-tenant/src/main/java/com/yonge/cooleshow/tenant/controller/open/OpenStudentController.java

@@ -142,12 +142,11 @@ public class OpenStudentController extends BaseController {
         }
 
         // 配置头像
-        if (StringUtils.isEmpty(student.getAvatar())) {
-            String avatar;
-            if (student.getGender().equals(1)) {
-                avatar = sysConfigService.findConfigValue(SysConfigConstant.TENANT_STUDENT_BOY_AVATAR);
-            } else {
-                avatar = sysConfigService.findConfigValue(SysConfigConstant.TENANT_STUDENT_GIRL_AVATAR);
+        String avatar = student.getAvatar();
+        if (StringUtils.isEmpty(avatar)) {
+            if (StringUtils.isEmpty(avatar)) {
+                avatar = sysConfigService.findConfigValue(SysConfigConstant.TENANT_STUDENT_AVATAR);
+                student.setAvatar(avatar);
             }
             student.setAvatar(avatar);
         }