Kaynağa Gözat

真实姓名、用户名赋值fix

haonan 1 yıl önce
ebeveyn
işleme
4aefd3cb36

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

@@ -82,6 +82,15 @@ public class StudentController extends BaseController {
         IPage<StudentVo> pages = studentService.selectPage(PageUtil.getPage(query), query);
         List<StudentVo> rows = pages.getRecords();
 
+        //如果真实姓名字段为空 把真实姓名赋值给昵称
+        rows.stream().forEach(r->{
+            if (StringUtils.isEmpty(r.getRealName())){
+                if (StringUtils.isNotEmpty(r.getUsername()))
+                r.setRealName(r.getUsername());
+            }
+        });
+
+
         Map<Long, List<TenantActivationCode>> groupByUserId = new HashMap<>();
         if (!rows.isEmpty() && query.getTenantAlbumPurchaseId() != null) {
             List<String> studentPhones = rows.stream().map(StudentVo::getPhone).collect(Collectors.toList());