|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
package com.supervision.police.dto.user;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
|
|
|
import com.supervision.constant.RoleEnum;
|
|
|
|
|
import com.supervision.police.domain.SystemUser;
|
|
|
|
|
import com.supervision.police.domain.SystemUserRoleRelation;
|
|
|
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
|
@ -50,6 +52,9 @@ public class UserInfoDTO {
|
|
|
|
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
|
|
|
|
private LocalDateTime registerTime;
|
|
|
|
|
|
|
|
|
|
@Schema(description = "管理员标识 0:否 1:是")
|
|
|
|
|
private String adminFlag="0";
|
|
|
|
|
|
|
|
|
|
public UserInfoDTO() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -62,6 +67,11 @@ public class UserInfoDTO {
|
|
|
|
|
if (StrUtil.isNotEmpty(this.id)){
|
|
|
|
|
this.setUserRoleList(userRoleMap.getOrDefault(this.id, new ArrayList<>(1)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(this.userRoleList)){
|
|
|
|
|
this.adminFlag = this.userRoleList.stream()
|
|
|
|
|
.anyMatch(userRoleDTO -> RoleEnum.ADMIN.getCode().equals(userRoleDTO.getRoleId())) ? "1" : "0";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void systemUserSetter(SystemUser systemUser){
|
|
|
|
|