新增 用户备注 管理员再用户编辑时可填
This commit is contained in:
parent
3927fd21b5
commit
26d190afa1
@ -8,4 +8,3 @@ public class SimpleOptions
|
||||
{ "laitoolinfo", ["LaitoolHomePage", "LaitoolNotice", "LaitoolUpdateContent", "LaitoolVersion"] },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -56,6 +56,16 @@ namespace LMS.Repository.Models.DB
|
||||
/// </summary>
|
||||
public string AffiliateCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 用户微信号
|
||||
/// </summary>
|
||||
public string? WXNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实际使用的Options
|
||||
/// </summary>
|
||||
|
||||
@ -13,5 +13,7 @@
|
||||
public string LastLoginIp { get; set; } = string.Empty;
|
||||
|
||||
public string LastLoginDevice { get; set; } = string.Empty;
|
||||
|
||||
public string Remark { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,8 +30,16 @@ namespace LMS.Repository.DTO.UserDto
|
||||
/// </summary>
|
||||
public string AffiliateCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 所属用户ID
|
||||
/// </summary>
|
||||
public long ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remark { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 放一些操作信息 不能频繁的修改数据库,使用的json格式存放
|
||||
/// </summary>
|
||||
|
||||
@ -10,5 +10,7 @@
|
||||
public string? UserName { get; set; }
|
||||
public string? PhoneNumber { get; set; }
|
||||
public List<string>? RoleNames { get; set; }
|
||||
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@ -176,10 +176,10 @@ namespace LMS.service.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public async Task<ActionResult<APIResponseModel<CollectionResponse<UserCollectionDto>>>> QueryUserCollection([Required] int page, [Required] int pageSize, string userName, long? userId, string nickName, string phoneNumber, string email, string[] roleNames, long? parentId)
|
||||
public async Task<ActionResult<APIResponseModel<CollectionResponse<UserCollectionDto>>>> QueryUserCollection([Required] int page, [Required] int pageSize, string userName, long? userId, string nickName, string phoneNumber, string email, string[] roleNames, string remark, long? parentId)
|
||||
{
|
||||
long reuqertUserId = ConvertExtension.ObjectToLong(HttpContext.Items["UserId"] ?? 0);
|
||||
return await _userService.QueryUserCollection(page, pageSize, userName, userId, nickName, phoneNumber, email, roleNames, parentId, reuqertUserId);
|
||||
return await _userService.QueryUserCollection(page, pageSize, userName, userId, nickName, phoneNumber, email, roleNames, remark, parentId, reuqertUserId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -73,7 +73,8 @@ namespace LMS.service.Service.UserService
|
||||
Options = user.OptionsJson,
|
||||
AgentPercent = user.AgentPercent,
|
||||
AffiliateCode = user.AffiliateCode,
|
||||
ParentId = user.ParentId ?? 0
|
||||
ParentId = user.ParentId ?? 0,
|
||||
Remark = user.Remark ?? string.Empty
|
||||
};
|
||||
return APIResponseModel<UserDto>.CreateSuccessResponseModel(userDto);
|
||||
}
|
||||
@ -87,7 +88,7 @@ namespace LMS.service.Service.UserService
|
||||
|
||||
#region 查询用户列表
|
||||
|
||||
internal async Task<ActionResult<APIResponseModel<CollectionResponse<UserCollectionDto>>>> QueryUserCollection(int page, int pageSize, string userName, long? userId, string nickName, string phoneNumber, string email, string[] roleNames, long? parentId, long reuqertUserId)
|
||||
internal async Task<ActionResult<APIResponseModel<CollectionResponse<UserCollectionDto>>>> QueryUserCollection(int page, int pageSize, string userName, long? userId, string nickName, string phoneNumber, string email, string[] roleNames, string? remark, long? parentId, long reuqertUserId)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -173,6 +174,11 @@ namespace LMS.service.Service.UserService
|
||||
query = query.Where(x => !string.IsNullOrWhiteSpace(x.Email) && x.Email.Contains(email));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(remark))
|
||||
{
|
||||
query = query.Where(x => !string.IsNullOrWhiteSpace(x.Remark) && x.Remark.Contains(remark));
|
||||
}
|
||||
|
||||
if (roleIds.Count > 0)
|
||||
{
|
||||
query = query.Where(x => userIds.Contains(x.Id));
|
||||
@ -199,9 +205,10 @@ namespace LMS.service.Service.UserService
|
||||
PhoneNumber = x.PhoneNumber ?? string.Empty,
|
||||
CreatedDate = x.CreatedDate,
|
||||
LastLoginDate = x.LastLoginDate,
|
||||
LastLoginIp = x.LastLoginIp,
|
||||
LastLoginDevice = x.LastLoginDevice,
|
||||
ParentId = x.ParentId ?? 0
|
||||
LastLoginIp = x.LastLoginIp ?? string.Empty,
|
||||
LastLoginDevice = x.LastLoginDevice ?? string.Empty,
|
||||
ParentId = x.ParentId ?? 0,
|
||||
Remark = x.Remark ?? string.Empty
|
||||
}).ToList();
|
||||
for (int i = 0; i < userCollections.Count; i++)
|
||||
{
|
||||
@ -262,6 +269,12 @@ namespace LMS.service.Service.UserService
|
||||
return APIResponseModel<string>.CreateErrorResponseModel(ResponseCode.NotPermissionAction);
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(userModel.Remark))
|
||||
{
|
||||
return APIResponseModel<string>.CreateErrorResponseModel(ResponseCode.ParameterError, "备注必填");
|
||||
}
|
||||
user.Remark = userModel.Remark;
|
||||
|
||||
// 开始修改用户信息
|
||||
if (userModel.AgentPercent != null)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user