李昊 4 years ago
parent
commit
c19534b530

+ 1 - 1
gx_api/GxPress/Api/GxPress.Api/AdminControllers/AdminUserController.cs

@@ -107,7 +107,7 @@ namespace GxPress.Api.AdminControllers
         /// <param name="request"></param>
         /// <returns></returns>
         [HttpPut("{id}")]
-        public async Task<bool> Update(int id, [FromBody] User request)
+        public async Task<bool> Update(int id, [FromBody] UserInfoRequest request)
         {
             if (!string.IsNullOrEmpty(request.Description) && request.Description.Length > 500)
             {

+ 1 - 1
gx_api/GxPress/Api/GxPress.Api/AppControllers/UserController.cs

@@ -204,7 +204,7 @@ namespace GxPress.Api.AppControllers
         /// <param name="request"></param>
         /// <returns></returns>
         [HttpPut("update")]
-        public async Task<bool> Update([FromBody] User request)
+        public async Task<bool> Update([FromBody] UserInfoRequest request)
         {
             var id = _loginContext.AccountId;
             var result = await _userRepository.UpdateAsync(id, request);

+ 3 - 2
gx_api/GxPress/Model/GxPress.Entity/User.cs

@@ -193,9 +193,10 @@ namespace GxPress.Entity
 
 
         /// <summary>
-        /// 冻结状态 1冻结 2 未冻结 0 全部
+        /// 是否冻结 
         /// </summary>
         /// <value></value>
-        public int DisableTypeId { get; set; }
+        [DataColumn]
+        public bool IsFreeze { get; set; }
     }
 }

+ 5 - 0
gx_api/GxPress/Model/GxPress.Request/Order/OrderRequest.cs

@@ -64,5 +64,10 @@ namespace GxPress.Request.Order
         /// </summary>
         /// <value></value>
         public string EndTime { get; set; }
+        /// <summary>
+        /// 用户ID
+        /// </summary>
+        /// <value></value>
+        public int UserId { get; set; }
     }
 }

+ 204 - 2
gx_api/GxPress/Model/GxPress.Request/User/UserRequest.cs

@@ -1,3 +1,4 @@
+using System;
 using GxPress.Common.Page;
 
 namespace GxPress.Request.User
@@ -7,6 +8,202 @@ namespace GxPress.Request.User
 
     }
     /// <summary>
+    /// 
+    /// </summary>
+    public class UserInfoRequest
+    {
+        /// <summary>
+        /// 手机
+        /// </summary>
+
+        public string Phone { get; set; }
+        /// <summary>
+        /// 昵称
+        /// </summary>
+
+        public string Nick { get; set; }
+        /// <summary>
+        /// 姓名
+        /// </summary>
+
+        public string Name { get; set; }
+
+        /// <summary>
+        /// 头像地址
+        /// </summary>
+
+        public string AvatarUrl { get; set; }
+
+        /// <summary>
+        /// 性别
+        /// Gender
+        /// </summary>
+
+        public string Gender { get; set; }
+
+        /// <summary>
+        /// 角色id
+        /// </summary>
+
+        public int RoleId { get; set; }
+
+        /// <summary>
+        /// 部门id
+        /// </summary>
+
+        public int DepartmentId { get; set; }
+
+        /// <summary>
+        /// 职位
+        /// </summary>
+
+        public string Position { get; set; }
+
+        /// <summary>
+        /// 邮箱
+        /// </summary>
+
+        public string Email { get; set; }
+
+        /// <summary>
+        /// 签名
+        /// </summary>
+
+        public string Signature { get; set; }
+
+        /// <summary>
+        /// 自我介绍
+        /// </summary>
+
+        public string Description { get; set; }
+
+        /// <summary>
+        /// 是否是领导
+        /// </summary>
+
+        public bool IsLeader { get; set; }
+
+        /// <summary>
+        /// 入职时间
+        /// </summary>
+
+        public DateTime EntryDataTime { get; set; }
+        /// <summary>
+        /// 城市
+        /// </summary>
+
+        public string City { get; set; }
+        /// <summary>
+        /// 是否接收私信
+        /// </summary>
+
+        public int IsPrivateLetter { get; set; }
+        /// <summary>
+        /// 是否接收通知
+        /// </summary>
+
+        public int IsNotice { get; set; }
+        /// <summary>
+        /// 是否接收回复
+        /// </summary>
+
+        public int IsReply { get; set; }
+        /// <summary>
+        /// 是否静音
+        /// </summary>
+
+        public bool IsMute { get; set; }
+        /// <summary>
+        /// 是否震动
+        /// </summary>
+
+        public int IsShake { get; set; }
+        /// <summary>
+        /// 环信ID
+        /// </summary>
+
+        public string ImId { get; set; }
+        /// <summary>
+        /// 二维码
+        /// </summary>
+
+        public string QRCoder { get; set; }
+        /// <summary>
+        /// 是否上传
+        /// </summary>
+        /// <value></value>
+
+        public int IsUpload { get; set; }
+        /// <summary>
+        /// 是否禁用
+        /// </summary>
+        /// <value></value>
+
+        public int IsDisable { get; set; }
+        /// <summary>
+        /// 微信唯一标示码
+        /// </summary>
+        /// <value></value>
+
+        public string OpenId { get; set; }
+        /// <summary>
+        /// 是否VIP
+        /// </summary>
+        /// <value></value>
+
+        public int IsVip { get; set; }
+        /// <summary>
+        /// 会员类型 月卡 季卡 年卡
+        /// </summary>
+        /// <value></value>
+
+        public int TypeId { get; set; }
+        /// <summary>
+        /// 终端 pc android ios
+        /// </summary>
+        /// <value></value>
+
+        public int Port { get; set; }
+        /// <summary>
+        /// 会员开始时间
+        /// </summary>
+        /// <value></value>
+
+        public DateTime BeginTime { get; set; }
+        /// <summary>
+        /// 会员结束时间
+        /// </summary>
+        /// <value></value>
+
+        public DateTime EndTime { get; set; }
+        /// <summary>
+        /// 累计价格
+        /// </summary>
+        /// <value></value>
+
+        public decimal AccumulativePrice { get; set; }
+        /// <summary>
+        /// 是否自动续费
+        /// </summary>
+        /// <value></value>
+
+        public int IsRenewal { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        /// <value></value>
+        public string Remark { get; set; }
+
+
+        /// <summary>
+        /// 是否冻结 
+        /// </summary>
+        /// <value></value>
+
+        public int IsFreeze { get; set; }
+
+    }
+    /// <summary>
     /// 会员用户
     /// </summary>
     public class UserSearchVipRequest : PageParameter
@@ -27,9 +224,14 @@ namespace GxPress.Request.User
         /// <value></value>
         public int VipPort { get; set; }
         /// <summary>
-        /// 冻结状态 1冻结 2 未冻结 0 全部
+        /// 黑名单 设置 2 未设置 0 全部
+        /// </summary>
+        /// <value></value>
+        public int IsDisable { get; set; }
+        /// <summary>
+        /// 是否冻结 1 冻结 2未冻结
         /// </summary>
         /// <value></value>
-        public int DisableTypeId { get; set; }
+        public int IsFreeze { get; set; }
     }
 }

+ 161 - 7
gx_api/GxPress/Model/GxPress.Result/User/UserInfoResult.cs

@@ -10,45 +10,199 @@ namespace GxPress.Result.User
     public class UserInfoResult
     {
         /// <summary>
+        /// 
+        /// </summary>
+        /// <value></value>
+        public int Id { get; set; }
+
+        public string DepartmentName { get; set; }
+        /// <summary>
         /// 手机
         /// </summary>
+
         public string Phone { get; set; }
         /// <summary>
         /// 昵称
         /// </summary>
+
         public string Nick { get; set; }
         /// <summary>
         /// 姓名
         /// </summary>
+
         public string Name { get; set; }
 
         /// <summary>
         /// 头像地址
         /// </summary>
+
         public string AvatarUrl { get; set; }
 
         /// <summary>
-        /// 用户ID
+        /// 性别
+        /// Gender
         /// </summary>
-        public int Id { get; set; }
+
+        public string Gender { get; set; }
+
+        /// <summary>
+        /// 角色id
+        /// </summary>
+
+        public int RoleId { get; set; }
+
+        /// <summary>
+        /// 部门id
+        /// </summary>
+
+        public int DepartmentId { get; set; }
+
+        /// <summary>
+        /// 职位
+        /// </summary>
+
+        public string Position { get; set; }
+
+        /// <summary>
+        /// 邮箱
+        /// </summary>
+
+        public string Email { get; set; }
+
+        /// <summary>
+        /// 签名
+        /// </summary>
+
+        public string Signature { get; set; }
+
+        /// <summary>
+        /// 自我介绍
+        /// </summary>
+
+        public string Description { get; set; }
+
+        /// <summary>
+        /// 是否是领导
+        /// </summary>
+
+        public int IsLeader { get; set; }
+
+        /// <summary>
+        /// 入职时间
+        /// </summary>
+
+        public DateTime EntryDataTime { get; set; }
+        /// <summary>
+        /// 城市
+        /// </summary>
+
+        public string City { get; set; }
+        /// <summary>
+        /// 是否接收私信
+        /// </summary>
+
+        public bool IsPrivateLetter { get; set; }
+        /// <summary>
+        /// 是否接收通知
+        /// </summary>
+
+        public bool IsNotice { get; set; }
+        /// <summary>
+        /// 是否接收回复
+        /// </summary>
+
+        public bool IsReply { get; set; }
+        /// <summary>
+        /// 是否静音
+        /// </summary>
+
+        public bool IsMute { get; set; }
+        /// <summary>
+        /// 是否震动
+        /// </summary>
+
+        public bool IsShake { get; set; }
         /// <summary>
         /// 环信ID
         /// </summary>
+
         public string ImId { get; set; }
         /// <summary>
-        /// 部门名称
+        /// 二维码
         /// </summary>
-        /// <value></value>
-        public string DepartmentName { get; set; }
+
+        public string QRCoder { get; set; }
         /// <summary>
-        /// 部门Id
+        /// 是否上传
         /// </summary>
         /// <value></value>
-        public int DepartmentId { get; set; }
+
+        public bool IsUpload { get; set; }
         /// <summary>
         /// 是否禁用
         /// </summary>
         /// <value></value>
+
         public bool IsDisable { get; set; }
+        /// <summary>
+        /// 微信唯一标示码
+        /// </summary>
+        /// <value></value>
+
+        public string OpenId { get; set; }
+        /// <summary>
+        /// 是否VIP
+        /// </summary>
+        /// <value></value>
+
+        public bool IsVip { get; set; }
+        /// <summary>
+        /// 会员类型 月卡 季卡 年卡
+        /// </summary>
+        /// <value></value>
+
+        public int TypeId { get; set; }
+        /// <summary>
+        /// 终端 pc android ios
+        /// </summary>
+        /// <value></value>
+
+        public int Port { get; set; }
+        /// <summary>
+        /// 会员开始时间
+        /// </summary>
+        /// <value></value>
+
+        public DateTime BeginTime { get; set; }
+        /// <summary>
+        /// 会员结束时间
+        /// </summary>
+        /// <value></value>
+
+        public DateTime EndTime { get; set; }
+        /// <summary>
+        /// 累计价格
+        /// </summary>
+        /// <value></value>
+
+        public decimal AccumulativePrice { get; set; }
+        /// <summary>
+        /// 是否自动续费
+        /// </summary>
+        /// <value></value>
+
+        public bool IsRenewal { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        /// <value></value>
+        public string Remark { get; set; }
+
+        /// <summary>
+        /// 是否冻结 
+        /// </summary>
+        /// <value></value>
+
+        public bool IsFreeze { get; set; }
     }
 }

+ 1 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/AppStartPage/AppStartPageRepository.cs

@@ -54,6 +54,7 @@ namespace GxPress.Repository.Implement.AppStartPage
             {
                 item.ImageUrl=StringUtils.AddDomain(item.ImageUrl);
             }
+            return result;
         }
         /// <summary>
         /// 删除

+ 2 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/Order/OrderRepository.cs

@@ -53,6 +53,8 @@ namespace GxPress.Repository.Implement.Order
                     query.WhereDate(nameof(Entity.Order.Order.CreatedDate), "<", EndTime);
                 }
             }
+            if (request.UserId > 0)
+                query.Where(nameof(Entity.Order.Order.UserId), request.UserId);
             result.Total = await _repository.CountAsync(query);
             result.Items = await _repository.GetAllAsync(query.ForPage(request.Page, request.PerPage));
             return result;

+ 10 - 5
gx_api/GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

@@ -359,7 +359,7 @@ namespace GxPress.Repository.Implement
         /// <param name="id"></param>
         /// <param name="request"></param>
         /// <returns></returns>
-        public async Task<bool> UpdateAsync(int id, User request)
+        public async Task<bool> UpdateAsync(int id, UserInfoRequest request)
         {
             var user = await GetAsync(id);
             if (user == null) throw new BusinessException("该用户不存在");
@@ -388,8 +388,10 @@ namespace GxPress.Repository.Implement
             if (!string.IsNullOrWhiteSpace(request.Phone))
                 user.Phone = request.Phone;
             user.QRCoder = StringUtils.RemoveDomain(user.QRCoder);
-            if (request.DisableTypeId > 0)
-                user.IsDisable = request.DisableTypeId == 1;
+            if (request.IsDisable > 0)
+                user.IsDisable = request.IsDisable == 1;
+            if (request.IsFreeze > 0)
+                user.IsFreeze = request.IsFreeze == 1;
             return await UpdateAsync(user);
         }
 
@@ -897,12 +899,15 @@ namespace GxPress.Repository.Implement
                 query.Where(nameof(User.Port), request.VipPort);
             if (request.VipTypeId > 0)
                 query.Where(nameof(User.TypeId), request.VipTypeId);
-            if (request.DisableTypeId > 0)
-                query.Where(nameof(User.IsDisable), request.DisableTypeId == 1);
+            if (request.IsDisable > 0)
+                query.Where(nameof(User.IsDisable), request.IsDisable == 1);
+            if (request.IsFreeze > 0)
+                query.Where(nameof(User.IsFreeze), request.IsFreeze == 1);
             result.Total = await _repository.CountAsync(query);
             var items = await _repository.GetAllAsync(query.ForPage(request.Page, request.PerPage));
             result.Items = items.Select(n => _mapper.Map<UserDetail>(n));
             return result;
         }
+
     }
 }

+ 1 - 1
gx_api/GxPress/Repository/GxPress.Repository.Interface/IUserRepository.cs

@@ -66,7 +66,7 @@ namespace GxPress.Repository.Interface
         /// <param name="id"></param>
         /// <param name="request"></param>
         /// <returns></returns>
-        Task<bool> UpdateAsync(int id, User request);
+        Task<bool> UpdateAsync(int id, UserInfoRequest request);
 
         /// <summary>
         /// 用户分页列表