优化代码

pull/65/head
awenes 2023-10-05 10:54:33 +08:00
parent 265c357fe5
commit 705d4dbbe5
6 changed files with 52 additions and 48 deletions

View File

@ -187,7 +187,7 @@ public class UserEntity extends LogicDeleteEntity<Long> {
*/ */
@Transient @Transient
@JsonIgnore @JsonIgnore
private String plaintext; private String passwordPlainText;
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {

View File

@ -69,7 +69,7 @@ public class UserRepositoryCustomizedImpl implements UserRepositoryCustomized {
@Override @Override
public Page<UserPO> getUserList(UserListQuery query, Pageable pageable) { public Page<UserPO> getUserList(UserListQuery query, Pageable pageable) {
//@formatter:off //@formatter:off
StringBuilder builder = new StringBuilder("SELECT `user`.id_, `user`.username_,`user`.password_, `user`.email_, `user`.phone_,`user`.phone_area_code, `user`.full_name ,`user`.nick_name, `user`.avatar_ , `user`.status_, `user`.data_origin, `user`.email_verified, `user`.phone_verified, `user`.auth_total, `user`.last_auth_ip, `user`.last_auth_time, `user`.expand_, `user`.external_id , `user`.expire_date,`user`.create_by, `user`.create_time, `user`.update_by , `user`.update_time, `user`.remark_, group_concat( IF(organization_member.primary_ = 1, null, organization_.display_path ) ) AS primary_org_display_path, group_concat( IF(organization_member.primary_ IS NULL, null, organization_.display_path ) ) AS org_display_path FROM `user` INNER JOIN `organization_member` ON (`user`.id_ = organization_member.user_id) INNER JOIN `organization` organization_ ON (organization_.id_ = organization_member.org_id) WHERE `user`.is_deleted = 0"); StringBuilder builder = new StringBuilder("SELECT `user`.id_, `user`.username_, `user`.password_, `user`.email_, `user`.phone_, `user`.phone_area_code, `user`.full_name, `user`.nick_name, `user`.avatar_, `user`.status_, `user`.data_origin, `user`.email_verified, `user`.phone_verified, `user`.auth_total, `user`.last_auth_ip, `user`.last_auth_time, `user`.expand_, `user`.external_id, `user`.expire_date, `user`.create_by, `user`.create_time, `user`.update_by, `user`.update_time, `user`.remark_, group_concat( IF( organization_member.primary_ = TRUE, organization_.display_path, NULL) ) AS primary_org_display_path, group_concat( IF ( organization_member.primary_ IS NULL, organization_.display_path, NULL ) ) AS org_display_path FROM `user` INNER JOIN `organization_member` ON ( `user`.id_ = organization_member.user_id ) INNER JOIN `organization` organization_ ON ( organization_.id_ = organization_member.org_id ) WHERE `user`.is_deleted = 0 AND organization_member.is_deleted = 0 ");
//组织条件 //组织条件
if (StringUtils.isNotBlank(query.getOrganizationId())) { if (StringUtils.isNotBlank(query.getOrganizationId())) {
if (Boolean.TRUE.equals(query.getInclSubOrganization())) { if (Boolean.TRUE.equals(query.getInclSubOrganization())) {

View File

@ -184,44 +184,53 @@ export default (props: UserListProps) => {
dataIndex: 'orgDisplayPath', dataIndex: 'orgDisplayPath',
search: false, search: false,
ellipsis: true, ellipsis: true,
render: (_, record) => [ render: (_, record) => {
<Popover console.log(record.primaryOrgDisplayPath);
key="pop" return (
title={ <Popover
<Tag color={'geekblue'} key={record.orgDisplayPath}> key="pop"
{record.primaryOrgDisplayPath} title={
</Tag> record.primaryOrgDisplayPath && (
} <Tag color={'geekblue'} key={record.orgDisplayPath}>
content={ {record.primaryOrgDisplayPath}
<Space direction="vertical" size="small" style={{ display: 'flex' }}>
{record.orgDisplayPath.split(',')?.map((p: string) => {
return (
<Tag color={'green'} key={p}>
{p}
</Tag>
);
})}
</Space>
}
>
<Space key="primary_path">
{
<Tag color={'geekblue'} key={record.primaryOrgDisplayPath}>
{record.primaryOrgDisplayPath}
</Tag>
}
</Space>
<Space key="path" direction="vertical" size="small" style={{ display: 'flex' }}>
{record.orgDisplayPath.split(',')?.map((p: string) => {
return (
<Tag color={'green'} key={p}>
{p}
</Tag> </Tag>
); )
})} }
</Space> content={
</Popover>, <Space direction="vertical" size="small" style={{ display: 'flex' }}>
], {record.orgDisplayPath?.split(',')?.map((p: string) => {
return (
<Tag color={'green'} key={p}>
{p}
</Tag>
);
})}
</Space>
}
>
{record.primaryOrgDisplayPath && (
<Space key="primary_path">
{
<Tag color={'geekblue'} key={record.primaryOrgDisplayPath}>
{record.primaryOrgDisplayPath}
</Tag>
}
</Space>
)}
{record.orgDisplayPath && (
<Space key="path" direction="vertical" size="small" style={{ display: 'flex' }}>
{record.orgDisplayPath?.split(',')?.map((p: string) => {
return (
<Tag color={'green'} key={p}>
{p}
</Tag>
);
})}
</Space>
)}
</Popover>
);
},
}, },
{ {
title: intl.formatMessage({ id: 'pages.account.user_list.user.columns.status' }), title: intl.formatMessage({ id: 'pages.account.user_list.user.columns.status' }),

View File

@ -181,6 +181,7 @@ declare namespace AccountAPI {
dataOrigin: string; dataOrigin: string;
authTotal: string; authTotal: string;
lastAuthTime: string; lastAuthTime: string;
primaryOrgDisplayPath: string;
orgDisplayPath: string; orgDisplayPath: string;
remark: string; remark: string;
custom?: Record<string, any>; custom?: Record<string, any>;

View File

@ -178,7 +178,7 @@ public class AbstractIdentitySourcePostProcessor {
entity.setDataOrigin(dataOrigin); entity.setDataOrigin(dataOrigin);
entity.setIdentitySourceId(identitySource.getId()); entity.setIdentitySourceId(identitySource.getId());
entity.setPassword(passwordEncoder.encode(defaultPassword)); entity.setPassword(passwordEncoder.encode(defaultPassword));
entity.setPlaintext(defaultPassword); entity.setPasswordPlainText(defaultPassword);
//必须字段 //必须字段
entity.setCreateBy(SYSTEM_DEFAULT_USER_NAME); entity.setCreateBy(SYSTEM_DEFAULT_USER_NAME);
@ -302,14 +302,14 @@ public class AbstractIdentitySourcePostProcessor {
thirdPartyUser.getEmail(), thirdPartyUser.getPhone()); thirdPartyUser.getEmail(), thirdPartyUser.getPhone());
if (StringUtils.isNotEmpty(thirdPartyUser.getEmail())) { if (StringUtils.isNotEmpty(thirdPartyUser.getEmail())) {
Map<String, Object> parameter = new HashMap<>(16); Map<String, Object> parameter = new HashMap<>(16);
parameter.put(MsgVariable.PASSWORD, thirdPartyUser.getPlaintext()); parameter.put(MsgVariable.PASSWORD, thirdPartyUser.getPasswordPlainText());
mailMsgEventPublish.publish(MailType.RESET_PASSWORD_CONFIRM, mailMsgEventPublish.publish(MailType.RESET_PASSWORD_CONFIRM,
thirdPartyUser.getEmail(), parameter); thirdPartyUser.getEmail(), parameter);
} }
if (StringUtils.isNotEmpty(thirdPartyUser.getPhone())) { if (StringUtils.isNotEmpty(thirdPartyUser.getPhone())) {
LinkedHashMap<String, String> parameter = new LinkedHashMap<>(); LinkedHashMap<String, String> parameter = new LinkedHashMap<>();
parameter.put(USERNAME, thirdPartyUser.getUsername()); parameter.put(USERNAME, thirdPartyUser.getUsername());
parameter.put(MsgVariable.PASSWORD, thirdPartyUser.getPlaintext()); parameter.put(MsgVariable.PASSWORD, thirdPartyUser.getPasswordPlainText());
smsMsgEventPublish.publish(SmsType.RESET_PASSWORD_SUCCESS, smsMsgEventPublish.publish(SmsType.RESET_PASSWORD_SUCCESS,
thirdPartyUser.getPhone(), parameter); thirdPartyUser.getPhone(), parameter);
} }

View File

@ -48,12 +48,6 @@ public class UpdateUserInfoRequest implements Serializable {
@Schema(description = "昵称") @Schema(description = "昵称")
private String nickName; private String nickName;
/**
*
*/
@Schema(description = "个人简介")
private String personalProfile;
/** /**
* *
*/ */