From ea50a2d2667519eeb3b87ed878b6ee6a435fc482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Wed, 13 Nov 2024 17:28:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81=E6=A1=86?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Front/CustomerController.cs | 54 +++++++++---------- .../Controllers/OAuthController.cs | 9 ++-- New_College.Api/New_College.Model.xml | 31 +++++++++++ New_College.Api/New_College.xml | 7 --- .../IV_CustomerInfoServices.cs | 2 +- New_College.Model/Models/RootEntity.cs | 48 +++++++++++++++++ New_College.Model/Models/V_CustomerInfo.cs | 5 +- .../ViewModels/Result/CasDoorTokenResult.cs | 2 +- .../ViewModels/Result/CustomerInfoResult.cs | 4 +- .../V_CustomerInfoServices.cs | 2 +- 10 files changed, 121 insertions(+), 43 deletions(-) diff --git a/New_College.Api/Controllers/Front/CustomerController.cs b/New_College.Api/Controllers/Front/CustomerController.cs index e10079c..31e48cf 100644 --- a/New_College.Api/Controllers/Front/CustomerController.cs +++ b/New_College.Api/Controllers/Front/CustomerController.cs @@ -46,28 +46,28 @@ namespace New_College.Api.Controllers.Front /// /// /// - [HttpGet] - public async Task> ShareTaskFinshing([FromQuery] CustomerShareQuery query) - { - var userinfo = new List(); - var customer = await _fansDistributionServices.Query(c => c.IsDelete == false && c.SaleId == query.CustomerId); - var fansids = customer.Select(c => c.FansId).ToList(); - userinfo = (await _services.Query(c => fansids.Contains(c.Id))).Select(c => new CustomerShareItem() - { - Avatar = c.AvatarUrl, - nickName = c.NickName - }).ToList(); - return new MessageModel() - { - response = new CustomerShareModel() - { - ShareItems = userinfo, - UnDone = 3 - userinfo.Count() - }, - success = true, - msg = "ok" - }; - } + //[HttpGet] + //public async Task> ShareTaskFinshing([FromQuery] CustomerShareQuery query) + //{ + //var userinfo = new List(); + //var customer = await _fansDistributionServices.Query(c => c.IsDelete == false && c.SaleId == query.CustomerId); + //var fansids = customer.Select(c => c.FansId).ToList(); + //userinfo = (await _services.Query(c => fansids.Contains(c.Id))).Select(c => new CustomerShareItem() + //{ + // Avatar = c.AvatarUrl, + // nickName = c.NickName + //}).ToList(); + //return new MessageModel() + //{ + // response = new CustomerShareModel() + // { + // ShareItems = userinfo, + // UnDone = 3 - userinfo.Count() + // }, + // success = true, + // msg = "ok" + //}; + // } /// /// /// @@ -250,10 +250,10 @@ namespace New_College.Api.Controllers.Front { try { - Task.Run(async () => - { - await DistrFanc(request.SaleId, customerinfo.Id); - }); + //Task.Run(async () => + // { + //await DistrFanc(request.SaleId, customerinfo.Id); + // }); // newId = await updatesync(customerinfo.Phone); } @@ -320,7 +320,7 @@ namespace New_College.Api.Controllers.Front var firstinfo = customer.FirstOrDefault(e => !string.IsNullOrWhiteSpace(e.UUID) && e.IsDelete == false && string.IsNullOrWhiteSpace(e.GZOpenId)); if (firstinfo != null) { - newId = firstinfo.Id; + // newId = firstinfo.Id; var endinfo = customer.FirstOrDefault(e => e.Id != firstinfo.Id); firstinfo.IsVIP = endinfo.IsVIP ? true : firstinfo.IsVIP; firstinfo.Subject = endinfo.Subject; diff --git a/New_College.Api/Controllers/OAuthController.cs b/New_College.Api/Controllers/OAuthController.cs index d63dec1..51d0f54 100644 --- a/New_College.Api/Controllers/OAuthController.cs +++ b/New_College.Api/Controllers/OAuthController.cs @@ -69,10 +69,12 @@ namespace New_College.Controllers //没有用户则注册一个新用户 user = new Model.Models.V_CustomerInfo() { + Id = userinfo.result.Id, IsDelete = false, UUID = userinfo.result.UnionId, Phone = userinfo.result.Mobile, GZOpenId = userinfo.result.OpenId, + OpenId = userinfo.result.OpenId, CreateTime = DateTime.Now, IsVIP = true,//默认不收费 Gender = 0, @@ -83,7 +85,7 @@ namespace New_College.Controllers AvatarUrl = userinfo.result.Avatar, CustomerType = CustomerTypeEnum.General, Datainit = false, - + }; user.Id = await _CustomerInfoServices.Add(user); } @@ -98,8 +100,9 @@ namespace New_College.Controllers } await _CustomerInfoServices.Update(user); } - if (string.IsNullOrEmpty(user.NickName)) { - user.NickName = "学霸"+ RadomHelper.RandNum(4); + if (string.IsNullOrEmpty(user.NickName)) + { + user.NickName = "学霸" + RadomHelper.RandNum(4); } var tokenModel = new SSOTokenModelJwt { UserId = user.Id.ToString(), NickName = user.NickName, LoginMode = LoginModeEnum.APP.ToString() }; jwtStr = JwtHelper.ssoIssueJwt(tokenModel); diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index 1e5ace9..4f6f1bf 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -2041,6 +2041,37 @@ 租户id + + + 租户id + + + + + 不带创建人BaseModel + + + + + ID + + + + + 排序 + + + + + 创建时间 + + + + + + 是否删除 + + 不带创建人BaseModel diff --git a/New_College.Api/New_College.xml b/New_College.Api/New_College.xml index 3bf29f5..f2fa607 100644 --- a/New_College.Api/New_College.xml +++ b/New_College.Api/New_College.xml @@ -239,13 +239,6 @@ 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下 - - - 获取分享好友任务完成情况 - - - - diff --git a/New_College.IServices/IV_CustomerInfoServices.cs b/New_College.IServices/IV_CustomerInfoServices.cs index 043ab48..7ffa190 100644 --- a/New_College.IServices/IV_CustomerInfoServices.cs +++ b/New_College.IServices/IV_CustomerInfoServices.cs @@ -55,7 +55,7 @@ namespace New_College.IServices /// /// /// - Task GetCustomerId(string OpenId); + Task GetCustomerId(string OpenId); /// /// 通过用户id获取openid /// diff --git a/New_College.Model/Models/RootEntity.cs b/New_College.Model/Models/RootEntity.cs index da849c4..43c07a4 100644 --- a/New_College.Model/Models/RootEntity.cs +++ b/New_College.Model/Models/RootEntity.cs @@ -78,6 +78,54 @@ namespace New_College.Model.Models } + public abstract class DEntityUserTenant : EntityUserModel + { + /// + /// 租户id + /// + public virtual long? TenantId { get; set; } + } + + + /// + /// 不带创建人BaseModel + /// + public partial class EntityUserModel + { + + /// + /// ID + /// + [SugarColumn(IsNullable = false, IsPrimaryKey = true)] + public long Id { get; set; } + + + /// + ///排序 + /// + public int OrderSort { get; set; } + + + /// + /// 创建时间 + /// + [SugarColumn(IsNullable = true)] + public DateTime? CreateTime { get; set; } = TimeUtil.GetCstDateTime(); + /// + /// + /// 修改时间 + /// + [SugarColumn(IsNullable = true)] + public DateTime? ModifyTime { get; set; } = TimeUtil.GetCstDateTime(); + + /// + /// 是否删除 + /// + public bool IsDelete { get; set; } + + } + + /// /// 不带创建人BaseModel /// diff --git a/New_College.Model/Models/V_CustomerInfo.cs b/New_College.Model/Models/V_CustomerInfo.cs index ecfea4f..abc74d8 100644 --- a/New_College.Model/Models/V_CustomerInfo.cs +++ b/New_College.Model/Models/V_CustomerInfo.cs @@ -7,7 +7,10 @@ using System.Text; namespace New_College.Model.Models { - public class V_CustomerInfo : DEntityTenant + + + + public class V_CustomerInfo : DEntityUserTenant { /// /// 用户头像 diff --git a/New_College.Model/ViewModels/Result/CasDoorTokenResult.cs b/New_College.Model/ViewModels/Result/CasDoorTokenResult.cs index 55a865a..507c408 100644 --- a/New_College.Model/ViewModels/Result/CasDoorTokenResult.cs +++ b/New_College.Model/ViewModels/Result/CasDoorTokenResult.cs @@ -215,7 +215,7 @@ namespace New_College.Model.ViewModels public class CasDoorToken { - public int Id { get; set; } + public long Id { get; set; } public string token { get; set; } public string servicetoken { get; set; } diff --git a/New_College.Model/ViewModels/Result/CustomerInfoResult.cs b/New_College.Model/ViewModels/Result/CustomerInfoResult.cs index 78d1119..866e068 100644 --- a/New_College.Model/ViewModels/Result/CustomerInfoResult.cs +++ b/New_College.Model/ViewModels/Result/CustomerInfoResult.cs @@ -76,7 +76,7 @@ namespace New_College.Model.ViewModels /// public int Status { get; set; } - public int Id { get; set; } + public long Id { get; set; } /// /// 小程序openid @@ -170,7 +170,7 @@ namespace New_College.Model.ViewModels /// /// 编号id /// - public int Id { get; set; } + public long Id { get; set; } /// /// 用户名 diff --git a/New_College.Services/V_CustomerInfoServices.cs b/New_College.Services/V_CustomerInfoServices.cs index ef6a80d..6629b6e 100644 --- a/New_College.Services/V_CustomerInfoServices.cs +++ b/New_College.Services/V_CustomerInfoServices.cs @@ -666,7 +666,7 @@ namespace New_College.Services } } - public async Task GetCustomerId(string OpenId) + public async Task GetCustomerId(string OpenId) { var customerinfo = await _dal.Query(x => x.IsDelete == false && x.OpenId == OpenId); if (customerinfo.Count == 0)