From da3da21c152fb69a5669ed759b7f4577b0a9a734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Mon, 29 Jan 2024 17:50:18 +0800 Subject: [PATCH] feat:bug fixed --- .../Controllers/Back/D_ScoreLineController.cs | 118 ++--- .../Controllers/Back/VipCardController.cs | 8 +- .../Controllers/Front/CustomerController.cs | 53 +- .../Front/PcVolunteerController.cs | 6 +- .../Controllers/Front/WeixinPayController.cs | 11 +- .../Controllers/OAuthController.cs | 3 +- New_College.Api/New_College.Model.xml | 72 ++- New_College.Api/New_College.xml | 7 + New_College.Common/Helper/NatureHelper.cs | 43 ++ .../IT_TbSNeedDataInfoPevServices.cs | 19 + .../IT_TbSNeedDataInfoServices.cs | 20 +- New_College.Model/Models/D_UserSettingBase.cs | 5 + New_College.Model/Models/T_TbSNeedDataInfo.cs | 6 +- New_College.Model/Request/SyncCustomerDto.cs | 79 +++ .../ViewModels/Query/CustomerInfoQuery.cs | 8 + .../ViewModels/Query/OneSubmitGoRequest.cs | 2 +- .../ViewModels/Query/UniversityQuery.cs | 2 +- .../Result/TbSNeedDataInfoViewDto.cs | 155 ++++++ .../ViewModels/Result/VipPowerRolesViews.cs | 10 + .../ViewModels/UserSettingBaseRequest.cs | 2 + .../ViewModels/VolunteerTableDtoView.cs | 21 + .../BASE/T_EnrollmentPlanedescRepository.cs | 14 +- New_College.Services/D_LongIdMapServices.cs | 3 +- .../D_PlanMajorDescServices.cs | 466 +++++++++--------- .../D_UserSettingBaseServices.cs | 5 +- .../T_TbSNeedDataInfoPevServices.cs | 25 + .../T_TbSNeedDataInfoServices.cs | 7 + .../V_CustomerInfoServices.cs | 14 +- New_College.Services/V_OrderInfoServices.cs | 4 +- .../UserBaseSettingJobTimedService.cs | 7 + 30 files changed, 874 insertions(+), 321 deletions(-) create mode 100644 New_College.Common/Helper/NatureHelper.cs create mode 100644 New_College.IServices/IT_TbSNeedDataInfoPevServices.cs create mode 100644 New_College.Model/Request/SyncCustomerDto.cs create mode 100644 New_College.Model/ViewModels/Result/TbSNeedDataInfoViewDto.cs create mode 100644 New_College.Services/T_TbSNeedDataInfoPevServices.cs diff --git a/New_College.Api/Controllers/Back/D_ScoreLineController.cs b/New_College.Api/Controllers/Back/D_ScoreLineController.cs index 993c5f2..2c33295 100644 --- a/New_College.Api/Controllers/Back/D_ScoreLineController.cs +++ b/New_College.Api/Controllers/Back/D_ScoreLineController.cs @@ -9,69 +9,69 @@ using System.Threading.Tasks; namespace New_College.Api.Controllers { - [Route("api/[controller]/[action]")] - [ApiController] + [Route("api/[controller]/[action]")] + [ApiController] [Authorize(Permissions.Name)] - public class D_ScoreLineController : ControllerBase - { - /// - /// 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下 - /// - private readonly ID_ScoreLineServices _d_ScoreLineServices; - - public D_ScoreLineController(ID_ScoreLineServices D_ScoreLineServices) - { - _d_ScoreLineServices = D_ScoreLineServices; - } - - [HttpGet] - public async Task>> Get(int page = 1, string key = "",int intPageSize = 50) - { - if (string.IsNullOrEmpty(key) || string.IsNullOrWhiteSpace(key)) - { - key = ""; - } - - Expression> whereExpression = a => a.Id > 0; - - return new MessageModel>() - { - msg = "获取成功", - success = true, - response = await _d_ScoreLineServices.QueryPage(whereExpression, page, intPageSize) - }; - - } - - [HttpGet("{id}")] - public async Task> Get(int id = 0) + public class D_ScoreLineController : ControllerBase { - return new MessageModel() + /// + /// 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下 + /// + private readonly ID_ScoreLineServices _d_ScoreLineServices; + + public D_ScoreLineController(ID_ScoreLineServices D_ScoreLineServices) { - msg = "获取成功", - success = true, - response = await _d_ScoreLineServices.QueryById(id) - }; - } - - [HttpPost] - public async Task> Post([FromBody] D_ScoreLine request) - { - var data = new MessageModel(); - - var id = await _d_ScoreLineServices.Add(request); - data.success = id > 0; - - if (data.success) - { - data.response = id.ObjToString(); - data.msg = "添加成功"; + _d_ScoreLineServices = D_ScoreLineServices; } - return data; - } + [HttpGet] + public async Task>> Get(int page = 1, string key = "", int intPageSize = 50) + { + if (string.IsNullOrEmpty(key) || string.IsNullOrWhiteSpace(key)) + { + key = ""; + } - - -} + Expression> whereExpression = a => a.Id > 0; + + return new MessageModel>() + { + msg = "获取成功", + success = true, + response = await _d_ScoreLineServices.QueryPage(whereExpression, page, intPageSize) + }; + + } + + [HttpGet("{id}")] + public async Task> Get(int id = 0) + { + return new MessageModel() + { + msg = "获取成功", + success = true, + response = await _d_ScoreLineServices.QueryById(id) + }; + } + + [HttpPost] + public async Task> Post([FromBody] D_ScoreLine request) + { + var data = new MessageModel(); + + var id = await _d_ScoreLineServices.Add(request); + data.success = id > 0; + + if (data.success) + { + data.response = id.ObjToString(); + data.msg = "添加成功"; + } + + return data; + } + + + + } } \ No newline at end of file diff --git a/New_College.Api/Controllers/Back/VipCardController.cs b/New_College.Api/Controllers/Back/VipCardController.cs index ba4afbe..7708281 100644 --- a/New_College.Api/Controllers/Back/VipCardController.cs +++ b/New_College.Api/Controllers/Back/VipCardController.cs @@ -129,11 +129,13 @@ namespace New_College.Api.Controllers.Back { ScoreCount = c.ScoreCount, SearchCount = c.SearchCount, + ShowCount = c.ShowCount }).FirstOrDefault(); response.minProRole = list.Where(e => e.PType == 1).Select(c => new MinProRole() { ScoreCount = c.ScoreCount, SearchCount = c.SearchCount, + ShowCount=c.ShowCount }).FirstOrDefault(); } else @@ -142,12 +144,14 @@ namespace New_College.Api.Controllers.Back response.pcRole = new PCRole() { ScoreCount = 1, - SearchCount = 10 + SearchCount = 10, + ShowCount=10 }; response.minProRole = new MinProRole() { ScoreCount = 1, - SearchCount = 10 + SearchCount = 10, + ShowCount = 10 }; } diff --git a/New_College.Api/Controllers/Front/CustomerController.cs b/New_College.Api/Controllers/Front/CustomerController.cs index 15236ee..30d7474 100644 --- a/New_College.Api/Controllers/Front/CustomerController.cs +++ b/New_College.Api/Controllers/Front/CustomerController.cs @@ -33,6 +33,56 @@ namespace New_College.Api.Controllers.Front + /// + /// + /// + /// + /// + [HttpPost] + [AllowAnonymous] + public async Task> SyncCustomerInfo([FromBody] SyncCustomerDto sync) + { + + switch (sync.action) + { + case "signup": + break; + case "login": + case "logout": + case "update-user": + case "delete-user": + case "add-user": + if (!string.IsNullOrWhiteSpace(sync.extendedUser.id)) + { + var singlelist = await _services.Query(e => e.OpenId == sync.extendedUser.id); + if (singlelist.Any()) + { + var single = singlelist.FirstOrDefault(); + var custome = new CustomerUpdateQuery() + { + StudentId = single.Id, + NickName = sync.extendedUser.displayName, + Phone = sync.extendedUser.phone, + Expectedscore = sync.extendedUser.score, + AvatarUrl = sync.extendedUser.avatar + }; + await _services.UpdateCustomer(custome); + } + } + break; + } + + + + return new MessageModel() + { + msg = "ok", + response = true, + success = true + }; + } + + /// ///账号注销 @@ -226,7 +276,8 @@ namespace New_College.Api.Controllers.Front public async Task> UpdateScore(UpdateScoreQuery query) { var customersingle = await _services.QueryById(query.StudentId); - if (customersingle == null) { + if (customersingle == null) + { return new MessageModel() { diff --git a/New_College.Api/Controllers/Front/PcVolunteerController.cs b/New_College.Api/Controllers/Front/PcVolunteerController.cs index 6c8e063..9b282b8 100644 --- a/New_College.Api/Controllers/Front/PcVolunteerController.cs +++ b/New_College.Api/Controllers/Front/PcVolunteerController.cs @@ -143,7 +143,6 @@ namespace New_College.Api.Controllers.Front } var uitem = new VolunteerTableDetailItemsView() { - // UniversityId = s.UniversityId, UniversityName = s.UniversityName, UniversityCode = s.UniversityCode, @@ -152,6 +151,10 @@ namespace New_College.Api.Controllers.Front _211 = planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().LnstitutionalLevel != null ? planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().LnstitutionalLevel.Contains("211") ? "是" : "否" : "否", _985 = planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().LnstitutionalLevel != null ? planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().LnstitutionalLevel.Contains("985") ? "是" : "否" : "否", _SYL = planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().LnstitutionalLevel != null ? planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().LnstitutionalLevel.Contains("双一流") ? "是" : "否" : "否", + Ownership = planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().Ownership.Contains("省") ? "省属" : planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().Ownership.Contains("市") ? "市属" : planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().Ownership, + AreaName = planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().Province + "|" + planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().City, + Nature = planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().Nature, + Rank = planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault().UniversityRank, planMajorItems = planmajordesc.Where(ww => planids.Contains(ww.ID)).Select(c => new VolunteerTablePlanMajorItem() { @@ -162,6 +165,7 @@ namespace New_College.Api.Controllers.Front MajorRemark = c.Remark, planCount = int.Parse(c._23Count), PlanId = c.ID, + AcademicYear = c.AcademicYear, Sort = s.OrderSort, SubjectClam = c._23subject, Percentage = typeinfo.Any() && typeinfo.Count() > 0 ? typeinfo.FirstOrDefault(d => d.planId == c.ID).tage : 0, diff --git a/New_College.Api/Controllers/Front/WeixinPayController.cs b/New_College.Api/Controllers/Front/WeixinPayController.cs index d5b8302..7e624e7 100644 --- a/New_College.Api/Controllers/Front/WeixinPayController.cs +++ b/New_College.Api/Controllers/Front/WeixinPayController.cs @@ -17,6 +17,7 @@ using New_College.IServices; using New_College.Model; using New_College.Model.Models; using New_College.Model.ViewModels; +using New_College.Services; using Newtonsoft.Json; namespace New_College.Api.Controllers.Front @@ -30,19 +31,22 @@ namespace New_College.Api.Controllers.Front private readonly IV_CustomerInfoRepository v_CustomerInfoRepository; private readonly IV_VipCardInfoRepository v_VipCardInfoRepository; private readonly IV_VipCardTypeRepository v_VipCardTypeRepository; + private readonly ID_UserSettingBaseServices v_UserSettingBaseServices; private readonly ILogger logger; public WeixinPayController(IV_OrderInfoRepository IV_OrderInfoRepository , IV_CustomerInfoRepository IV_CustomerInfoRepository , IV_VipCardInfoRepository IV_VipCardInfoRepository , IV_VipCardTypeRepository IV_VipCardTypeRepository - , ILogger loggers) + , ILogger loggers, +ID_UserSettingBaseServices v_UserSettingBaseServices) { v_OrderInfoRepository = IV_OrderInfoRepository; v_CustomerInfoRepository = IV_CustomerInfoRepository; v_VipCardInfoRepository = IV_VipCardInfoRepository; v_VipCardTypeRepository = IV_VipCardTypeRepository; logger = loggers; + this.v_UserSettingBaseServices = v_UserSettingBaseServices; } /// @@ -64,9 +68,9 @@ namespace New_College.Api.Controllers.Front //外部商户订单号 var payNum = DateTime.Now.ToString("yyyyMMddHHmmss") + rd.Next(0, 1000).ToString().PadLeft(3, '0'); var data = new WxPayData(); - data.SetValue("body", "六纬志愿VIP"); + data.SetValue("body", "志愿小程序VIP"); data.SetValue("out_trade_no", payNum); - data.SetValue("detail", "六纬志愿VIP卡"); + data.SetValue("detail", "六纬志愿小程序VIP卡"); data.SetValue("total_fee", Convert.ToInt32(query.total_fee * 100)); data.SetValue("time_start", DateTime.Now.ToString("yyyyMMddHHmmss")); //data.SetValue("time_expire", DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss")); @@ -285,6 +289,7 @@ namespace New_College.Api.Controllers.Front a.Status = EnumOrderType.Cancel; await v_OrderInfoRepository.Update(a); }); + await v_UserSettingBaseServices.SyncBaseInfo(new UserSettingBaseRequest() { CustomerId = oneinfo.CustomerId }); //支付成功后根据用户code找到对应用户修改vip 状态 viewModel.message = "SUCCESS"; viewModel.code = "OK"; diff --git a/New_College.Api/Controllers/OAuthController.cs b/New_College.Api/Controllers/OAuthController.cs index 8dcad19..0fbc9a1 100644 --- a/New_College.Api/Controllers/OAuthController.cs +++ b/New_College.Api/Controllers/OAuthController.cs @@ -74,7 +74,8 @@ namespace New_College.Controllers { return new MessageModel() { - success = false + success = false, + msg="该账户不存在或已注销" }; } diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index 52227bd..33e1852 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -1311,6 +1311,11 @@ 功能查询次数 + + + 智能填报显示几所 + + @@ -2729,7 +2734,7 @@ - 办学性质 + 办学性质0、公办,1、民办,2中外合作,3 港澳台 @@ -4195,6 +4200,11 @@ 考生预计分数 + + + + + @@ -6330,6 +6340,36 @@ 自选结果 + + + 本/专 + + + + + 院校排名 + + + + + 所在地 + + + + + 本/专 + + + + + 院校排名 + + + + + 所在地 + + uni 专业列表 @@ -6895,6 +6935,11 @@ 模块查看次数 + + + 智能填报可以看多少所 + + 成绩更改次数 @@ -6905,6 +6950,11 @@ 模块查看次数 + + + 智能填报可以看多少所 + + 志愿填报推荐一级懒人专用 @@ -7630,6 +7680,26 @@ 双一流 + + + + + + + + 学校所在地区 + + + + + 排名 + + + + + 公办|民办 + + diff --git a/New_College.Api/New_College.xml b/New_College.Api/New_College.xml index fd57535..55b3f38 100644 --- a/New_College.Api/New_College.xml +++ b/New_College.Api/New_College.xml @@ -225,6 +225,13 @@ 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下 + + + + + + + 账号注销 diff --git a/New_College.Common/Helper/NatureHelper.cs b/New_College.Common/Helper/NatureHelper.cs new file mode 100644 index 0000000..1e4ec6f --- /dev/null +++ b/New_College.Common/Helper/NatureHelper.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace New_College.Common +{ + public static class NatureHelper + { + /// + /// 0、公办,1、民办,2中外合作,3 港澳台 + /// + /// + /// + public static List NatureNames(List Nature) + { + var str = new List(); + if (Nature == null) + return str; + Nature.ForEach(a => + { + switch (a) + { + case 0: + str.Add("公办"); + break; + case 1: + str.Add("民办"); + break; + case 2: + str.Add("中外合作"); + break; + case 3: + str.Add("港澳台"); + break; + } + }); + return str; + } + + } +} diff --git a/New_College.IServices/IT_TbSNeedDataInfoPevServices.cs b/New_College.IServices/IT_TbSNeedDataInfoPevServices.cs new file mode 100644 index 0000000..aaa11a5 --- /dev/null +++ b/New_College.IServices/IT_TbSNeedDataInfoPevServices.cs @@ -0,0 +1,19 @@ +using MathNet.Numerics.Statistics.Mcmc; +using New_College.IServices.BASE; +using New_College.Model.Models; +using New_College.Model.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; + +namespace New_College.IServices +{ + /// + /// IT_TbSNeedDataInfoServices + /// + public interface IT_TbSNeedDataInfoPevServices :IBaseServices + { + + } +} \ No newline at end of file diff --git a/New_College.IServices/IT_TbSNeedDataInfoServices.cs b/New_College.IServices/IT_TbSNeedDataInfoServices.cs index 4eaee01..b16f38d 100644 --- a/New_College.IServices/IT_TbSNeedDataInfoServices.cs +++ b/New_College.IServices/IT_TbSNeedDataInfoServices.cs @@ -1,12 +1,20 @@ -using New_College.IServices.BASE; +using MathNet.Numerics.Statistics.Mcmc; +using New_College.IServices.BASE; using New_College.Model.Models; +using New_College.Model.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; namespace New_College.IServices -{ - /// - /// IT_TbSNeedDataInfoServices - /// +{ + /// + /// IT_TbSNeedDataInfoServices + /// public interface IT_TbSNeedDataInfoServices :IBaseServices - { + { + + } } \ No newline at end of file diff --git a/New_College.Model/Models/D_UserSettingBase.cs b/New_College.Model/Models/D_UserSettingBase.cs index 95ffe19..975919e 100644 --- a/New_College.Model/Models/D_UserSettingBase.cs +++ b/New_College.Model/Models/D_UserSettingBase.cs @@ -30,5 +30,10 @@ namespace New_College.Model.Models /// public int SearchCount { get; set; } + /// + /// 智能填报显示几所 + /// + public int ShowCount { get; set; } + } } diff --git a/New_College.Model/Models/T_TbSNeedDataInfo.cs b/New_College.Model/Models/T_TbSNeedDataInfo.cs index 70f10d1..4058726 100644 --- a/New_College.Model/Models/T_TbSNeedDataInfo.cs +++ b/New_College.Model/Models/T_TbSNeedDataInfo.cs @@ -39,9 +39,9 @@ namespace New_College.Model.Models /// [SugarColumn(ColumnName="MajorName" )] public string MajorName { get; set; } - /// - /// 办学性质 - /// + /// + /// 办学性质0、公办,1、民办,2中外合作,3 港澳台 + /// [SugarColumn(ColumnName="Nature" )] public string Nature { get; set; } /// diff --git a/New_College.Model/Request/SyncCustomerDto.cs b/New_College.Model/Request/SyncCustomerDto.cs new file mode 100644 index 0000000..c4b4c28 --- /dev/null +++ b/New_College.Model/Request/SyncCustomerDto.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace New_College.Model +{ + + + public class SyncCustomerDto + { + public int id { get; set; } + public string owner { get; set; } + public string name { get; set; } + public DateTime createdTime { get; set; } + public string organization { get; set; } + public string clientIp { get; set; } + public string user { get; set; } + public string method { get; set; } + public string requestUri { get; set; } + public string action { get; set; } + public bool isTriggered { get; set; } + public string _object { get; set; } + public Extendeduser extendedUser { get; set; } + } + + public class Extendeduser + { + public string owner { get; set; } + public string name { get; set; } + public DateTime createdTime { get; set; } + public string updatedTime { get; set; } + public string id { get; set; } + public string type { get; set; } + public string password { get; set; } + public string passwordSalt { get; set; } + public string displayName { get; set; } + public string avatar { get; set; } + public string permanentAvatar { get; set; } + public string email { get; set; } + public string phone { get; set; } + public string location { get; set; } + public object address { get; set; } + public string affiliation { get; set; } + public string title { get; set; } + public int score { get; set; } + public int ranking { get; set; } + public bool isOnline { get; set; } + public bool isAdmin { get; set; } + public bool isForbidden { get; set; } + public bool isDeleted { get; set; } + public string signupApplication { get; set; } + public Properties properties { get; set; } + } + + public class Properties + { + public string bio { get; set; } + public string checkinDate { get; set; } + public string editorType { get; set; } + public DateTime emailVerifiedTime { get; set; } + public string fileQuota { get; set; } + public string location { get; set; } + public string no { get; set; } + public string oauth_QQ_displayName { get; set; } + public string oauth_QQ_verifiedTime { get; set; } + public string oauth_WeChat_displayName { get; set; } + public string oauth_WeChat_verifiedTime { get; set; } + public string onlineStatus { get; set; } + public string phoneVerifiedTime { get; set; } + public string renameQuota { get; set; } + public string tagline { get; set; } + public string website { get; set; } + } + + +} + diff --git a/New_College.Model/ViewModels/Query/CustomerInfoQuery.cs b/New_College.Model/ViewModels/Query/CustomerInfoQuery.cs index 7934c4b..d0c56df 100644 --- a/New_College.Model/ViewModels/Query/CustomerInfoQuery.cs +++ b/New_College.Model/ViewModels/Query/CustomerInfoQuery.cs @@ -128,6 +128,14 @@ namespace New_College.Model.ViewModels public string SchoolName { get; set; } public string ClassName { get; set; } + + public string Phone { get; set; } + + /// + /// + /// + public string AvatarUrl { get; set; } + } /// diff --git a/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs b/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs index 95bf075..e5d310b 100644 --- a/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs +++ b/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs @@ -72,7 +72,7 @@ namespace New_College.Model.ViewModels /// /// 办学性质 0、公办,1、民办,2中外合作,3 港澳台 /// - public string Nature { get; set; } + public List Nature { get; set; } /// ///大学类型 综合,理工类,医学类... diff --git a/New_College.Model/ViewModels/Query/UniversityQuery.cs b/New_College.Model/ViewModels/Query/UniversityQuery.cs index 7dac959..7b07d83 100644 --- a/New_College.Model/ViewModels/Query/UniversityQuery.cs +++ b/New_College.Model/ViewModels/Query/UniversityQuery.cs @@ -26,7 +26,7 @@ namespace New_College.Model.ViewModels /// /// 隶属于 1、教育部,2、省政府, 3 其他部委,4 军校 /// - public int? Ascription { get; set; } + public List? Ascription { get; set; } /// /// 用户id diff --git a/New_College.Model/ViewModels/Result/TbSNeedDataInfoViewDto.cs b/New_College.Model/ViewModels/Result/TbSNeedDataInfoViewDto.cs new file mode 100644 index 0000000..41d3fb9 --- /dev/null +++ b/New_College.Model/ViewModels/Result/TbSNeedDataInfoViewDto.cs @@ -0,0 +1,155 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace New_College.Model.ViewModels +{ + [SugarTable("T_TbSNeedDataInfo", "WMBLOG_MYSQL")] + public class TbSNeedDataInfoViewDto + { + public long ID { get; set; } + + public string EnrollmentType { get; set; } + + public string EnrollmentCode { get; set; } + + public string UniversityName { get; set; } + + public string MajorCode { get; set; } + + public string MajorName { get; set; } + + public string Nature { get; set; } + + + public string _23subject { get; set; } + + public string _24subject { get; set; } + + public string _23Count { get; set; } + + public string _Score { get; set; } + + public string _23Score { get; set; } + + public string _23ScoreLine { get; set; } + + public string _23SchoolScore { get; set; } + + public string _23SchoolScoreLine { get; set; } + + public string _23SchoolAvgScore { get; set; } + + public string _23SchoolAvgLine { get; set; } + + public string _22Count { get; set; } + + public string _22Score { get; set; } + + public string _22ScoreLine { get; set; } + + public string _21Count { get; set; } + + public string _21Score { get; set; } + + public string _21ScoreLine { get; set; } + + public string _20Count { get; set; } + + public string _20Score { get; set; } + + public string _20ScoreLine { get; set; } + + public string AcademicYear { get; set; } + + public string Fee { get; set; } + + public string Province { get; set; } + + public string City { get; set; } + + public string Ownership { get; set; } + + public string LnstitutionalLevel { get; set; } + + + + + /// + /// 本/专 + /// + public string EducationCategory { get; set; } + /// + /// 院校排名 + /// + public string UniversityRank { get; set; } + + + + /// + /// 所在地 + /// + public string Location { get; set; } + + } + + + + [SugarTable("T_TbSNeedDataInfo", "WMBLOG_MYSQL")] + public class TbSNeedDataInfoPerviewViewDto + { + + public string UniversityName { get; set; } + + public string Nature { get; set; } + + public string Province { get; set; } + + public string MajorName { get; set; } + public string _23subject { get; set; } + + public string _23Count { get; set; } + + public string _23Score { get; set; } + + + + public string _23SchoolScore { get; set; } + + + public string _22Score { get; set; } + + + public string _21Score { get; set; } + + public string _20Score { get; set; } + + + public string Ownership { get; set; } + + public string LnstitutionalLevel { get; set; } + + + + + /// + /// 本/专 + /// + public string EducationCategory { get; set; } + /// + /// 院校排名 + /// + public string UniversityRank { get; set; } + + /// + /// 所在地 + /// + public string Location { get; set; } + + } + + +} diff --git a/New_College.Model/ViewModels/Result/VipPowerRolesViews.cs b/New_College.Model/ViewModels/Result/VipPowerRolesViews.cs index 53146bf..0ce903a 100644 --- a/New_College.Model/ViewModels/Result/VipPowerRolesViews.cs +++ b/New_College.Model/ViewModels/Result/VipPowerRolesViews.cs @@ -33,6 +33,11 @@ namespace New_College.Model.ViewModels /// public int SearchCount { get; set; } + /// + /// 智能填报可以看多少所 + /// + public int ShowCount { get; set; } + } public class MinProRole @@ -47,6 +52,11 @@ namespace New_College.Model.ViewModels /// public int SearchCount { get; set; } + /// + /// 智能填报可以看多少所 + /// + public int ShowCount { get; set; } + } } diff --git a/New_College.Model/ViewModels/UserSettingBaseRequest.cs b/New_College.Model/ViewModels/UserSettingBaseRequest.cs index 12cee47..c468f55 100644 --- a/New_College.Model/ViewModels/UserSettingBaseRequest.cs +++ b/New_College.Model/ViewModels/UserSettingBaseRequest.cs @@ -39,6 +39,8 @@ namespace New_College.Model.ViewModels /// 功能查询次数 /// public int SearchCount { get; set; } + + public int ShowCount { get; set; } } } diff --git a/New_College.Model/ViewModels/VolunteerTableDtoView.cs b/New_College.Model/ViewModels/VolunteerTableDtoView.cs index ec4e48e..0d088ab 100644 --- a/New_College.Model/ViewModels/VolunteerTableDtoView.cs +++ b/New_College.Model/ViewModels/VolunteerTableDtoView.cs @@ -87,6 +87,25 @@ namespace New_College.Model.ViewModels public int Sort { get; set; } + /// + /// + /// + public string Ownership { get; set; } + + /// + /// 学校所在地区 + /// + public string AreaName { get; set; } + + /// + /// 排名 + /// + public string Rank { get; set; } + + /// + /// 公办|民办 + /// + public string Nature { get; set; } /// /// /// @@ -126,6 +145,8 @@ namespace New_College.Model.ViewModels /// public string MajorRemark { get; set; } + public string AcademicYear { get; set; } + /// /// 选科组合 /// diff --git a/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs b/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs index 9d62f85..2397d77 100644 --- a/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs +++ b/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs @@ -156,7 +156,7 @@ namespace New_College.Repository } var regionlist = this.Db.Queryable().Where(c => c.Level == 1).WhereIF(query.provinceIds != null && query.provinceIds.Any(), c => SqlFunc.ContainsArray(query.provinceIds, c.KeyId)).Select(c => c.RegionName).ToList(); - var subjects = new string[] { }; + var claim = new string[] { }; string sbuOne = string.Empty; string sbuTwo = string.Empty; string sbuTree = string.Empty; @@ -165,10 +165,10 @@ namespace New_College.Repository float wenend = query.Score - 15; if (!string.IsNullOrWhiteSpace(query.SubjectClaim)) { - subjects = query.SubjectClaim.Split(","); - sbuOne = subjects[0]; - sbuTwo = subjects[1]; - sbuTree = subjects[2]; + claim = query.SubjectClaim.Split(","); + //sbuOne = claim[0]; + //sbuTwo = subjects[1]; + //sbuTree = subjects[2]; } var majornames = new List(); var majoraslist = new List(); @@ -181,7 +181,7 @@ namespace New_College.Repository return new MessageModel>() { success = false, msg = "所选专业大类数据完善中..." }; majornames = majoraslist.Select(x => x.MajorName).ToList(); } - var recommendInfo = await this.Db.Queryable() + var recommendInfo = await this.Db.Queryable() .WhereIF(regionlist.Any(), p => SqlFunc.ContainsArray(regionlist, p.Province)) //.WhereIF(query.Year > 0, p => p.Years == query.Year) .WhereIF(!string.IsNullOrEmpty(query.Location), p => p.Location == query.Location) @@ -190,7 +190,7 @@ namespace New_College.Repository .WhereIF(query.Type == "冲", p => int.Parse(p._23Score) > 0 && (int.Parse(p._23Score) <= query.Score + 15 && int.Parse(p._23Score) > query.Score + 5)) .WhereIF(query.Type == "稳", p => int.Parse(p._23Score) > 0 && (int.Parse(p._23Score) <= query.Score + 5 && int.Parse(p._23Score) > query.Score - 15)) .WhereIF(query.Type == "保", p => int.Parse(p._23Score) > 0 && (int.Parse(p._23Score) < query.Score - 15)) - .WhereIF(!string.IsNullOrWhiteSpace(query.SubjectClaim), p => (SqlFunc.Contains(p._23subject, sbuOne) || SqlFunc.Contains(p._23subject, sbuTwo) || SqlFunc.Contains(p._23subject, sbuTree))) + .WhereIF(!string.IsNullOrWhiteSpace(query.SubjectClaim), c => SqlFunc.Contains(c._24subject, claim[0]) || SqlFunc.Contains(c._24subject, claim[1]) || SqlFunc.Contains(c._24subject, claim[2]) || c._24subject == "不限") .WhereIF(majornames.Any() && majornames.Count() > 0, p => SqlFunc.ContainsArray(majornames, p.MajorCode)) .ToListAsync(); diff --git a/New_College.Services/D_LongIdMapServices.cs b/New_College.Services/D_LongIdMapServices.cs index 4b5960f..7cd3472 100644 --- a/New_College.Services/D_LongIdMapServices.cs +++ b/New_College.Services/D_LongIdMapServices.cs @@ -128,13 +128,12 @@ namespace New_College.Services .AndIF(query.Nature != null && query.Nature.Any(), x => SqlFunc.ContainsArray(query.Nature, x.Nature)) .AndIF(query.Type != null && query.Type.Any(), x => SqlFunc.ContainsArray(query.Type, x.Type)) .AndIF(query.SubjectLevel.HasValue, x => x.Subject_Level == query.SubjectLevel) - .AndIF(query.Ascription.HasValue, x => x.Ascription == query.Ascription) + .AndIF(query.Ascription != null && query.Ascription.Any(), x => SqlFunc.ContainsArray(query.Ascription, x.Ascription)) .AndIF(query.Nhef.HasValue, x => x.Nhef == query.Nhef) .AndIF(query.Sff.HasValue, x => x.Sff == query.Sff) .AndIF(query.Syl.HasValue, x => x.Syl == query.Syl) .AndIF(!string.IsNullOrWhiteSpace(query.Name), u => SqlFunc.Contains(u.Name, query.Name)) .ToExpression(); - var info = await d_UniversityRepository.QueryPage(expression, query.PageIndex, query.PageSize, "Rank Asc"); if (info.data.Count <= 0) return new PageModel() { }; diff --git a/New_College.Services/D_PlanMajorDescServices.cs b/New_College.Services/D_PlanMajorDescServices.cs index 16892c7..961383f 100644 --- a/New_College.Services/D_PlanMajorDescServices.cs +++ b/New_College.Services/D_PlanMajorDescServices.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using New_College.Repository; using System.Data.Entity.Infrastructure; using NPOI.SS.Formula.Functions; +using StackExchange.Profiling.Internal; namespace New_College.Services { @@ -32,9 +33,10 @@ namespace New_College.Services private readonly IT_BatchlineRepository _batchlineRepository; private readonly IT_TbSNeedDataInfoServices sNeedDataInfoServices; private readonly ID_UniversityServices _UniversityServices; + private readonly IT_TbSNeedDataInfoPevServices t_TbSNeedDataInfoPev; public D_PlanMajorDescServices(IBaseRepository dal, ID_QualificationLineRepository d_QualificationLineRepository, ID_PlanMajorDescRepository planMajorDescRepository, IT_BatchlineRepository batchlineRepository, - IT_TbSNeedDataInfoServices sNeedDataInfoServices, ID_UniversityServices d_UniversityServices) + IT_TbSNeedDataInfoServices sNeedDataInfoServices, ID_UniversityServices d_UniversityServices, IT_TbSNeedDataInfoPevServices tbSNeedDataInfoPev) { this._dal = dal; base.BaseDal = dal; @@ -43,6 +45,7 @@ namespace New_College.Services _batchlineRepository = batchlineRepository; this.sNeedDataInfoServices = sNeedDataInfoServices; _UniversityServices = d_UniversityServices; + t_TbSNeedDataInfoPev = tbSNeedDataInfoPev; } @@ -62,63 +65,74 @@ namespace New_College.Services int startscore = request.Score - 25; int endscore = request.Score + 15; var claim = request.SubjectClaim.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); - - Expression> expression = Expressionable.Create() + var Nature = NatureHelper.NatureNames(request.Nature); + Expression> expression = Expressionable.Create() .And(c => c.Location == request.Location) .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.MajorName, request.Major)) - .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c._24subject, claim[0]) || SqlFunc.Contains(c._24subject, claim[1]) || SqlFunc.Contains(c._24subject, claim[2]) || c._24subject == "不限") + .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c._23subject, claim[0]) || SqlFunc.Contains(c._23subject, claim[1]) || SqlFunc.Contains(c._23subject, claim[2]) || c._23subject == "不限") .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.Province)) .AndIF(request.Syl.HasValue && request.Syl == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "双一流")) .AndIF(request._211.HasValue && request._211 == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "211")) .AndIF(request._985.HasValue && request._985 == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "985")) .AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership) - .AndIF(!string.IsNullOrWhiteSpace(request.Nature), c => c.Nature == request.Nature) + //.AndIF(!string.IsNullOrWhiteSpace(request.Nature), c => c.Nature == request.Nature) .AndIF(request.EndScore > endscore || request.StartScore < startscore, c => SqlFunc.Between(c._23SchoolScore, request.StartScore, request.EndScore)) .ToExpression(); - var querylist = (await sNeedDataInfoServices.Query(expression)).Select(c=>new T_TbSNeedDataInfo() { - ID = c.ID, - LnstitutionalLevel = c.LnstitutionalLevel, - UniversityName = c.UniversityName, - Nature=c.Nature, + var querylist = (await t_TbSNeedDataInfoPev.Query(expression)).Select(c => new TbSNeedDataInfoPerviewViewDto() + { + //ID = c.ID, + LnstitutionalLevel = c.LnstitutionalLevel, + UniversityName = c.UniversityName, + Nature = c.Nature, _23SchoolScore = c._23SchoolScore, - + }).ToList(); var unlist = querylist.GroupBy(b => b.UniversityName).Select(c => new AIPerviewItemDto() { UniversityName = c.Key }).ToList(); - var mapunlist = unlist.Select(c => new AIPerviewItemDto + //var mapunlist = unlist.Select(c => new AIPerviewItemDto + //{ + // LnstitutionalLevel = querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault().LnstitutionalLevel, + // Nature = querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault().Nature, + // UniversityName = querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault().UniversityName, + // Type = MajorPlanScoreTool.GetPlanScore(int.Parse(querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault()._23SchoolScore), request.Score), + //}).ToList(); + + unlist.AsParallel().ForAll(c => { - LnstitutionalLevel = querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault().LnstitutionalLevel, - Nature = querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault().Nature, - UniversityName = querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault().UniversityName, - Type = MajorPlanScoreTool.GetPlanScore(int.Parse(querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault()._23SchoolScore), request.Score), - }).ToList(); + c.LnstitutionalLevel = querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault().LnstitutionalLevel; + c.Nature = querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault().Nature; + c.UniversityName = querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault().UniversityName; + c.Type = MajorPlanScoreTool.GetPlanScore(int.Parse(querylist.Where(e => e.UniversityName == c.UniversityName).FirstOrDefault()._23SchoolScore), request.Score); + + }); + aidto.universities = new List() { new UniversityPerviewDto() { Name="985", - Count=mapunlist.Where(e=>e.LnstitutionalLevel!=null&&e.LnstitutionalLevel.Contains("985")).Count(), + Count=unlist.Where(e=>e.LnstitutionalLevel!=null&&e.LnstitutionalLevel.Contains("985")).Count(), }, new UniversityPerviewDto() { Name="211", - Count=mapunlist.Where(e=>e.LnstitutionalLevel!=null&&e.LnstitutionalLevel.Contains("211")).Count(), + Count=unlist.Where(e=>e.LnstitutionalLevel!=null&&e.LnstitutionalLevel.Contains("211")).Count(), }, new UniversityPerviewDto() { Name="双一流", - Count=mapunlist.Where(e=>e.LnstitutionalLevel!=null&&e.LnstitutionalLevel.Contains("双一流")).Count(), + Count=unlist.Where(e=>e.LnstitutionalLevel!=null&&e.LnstitutionalLevel.Contains("双一流")).Count(), }, new UniversityPerviewDto() { Name="保研资格", - Count=mapunlist.Where(e=>e.LnstitutionalLevel!=null&&e.LnstitutionalLevel.Contains("保研资格")).Count(), + Count=unlist.Where(e=>e.LnstitutionalLevel!=null&&e.LnstitutionalLevel.Contains("保研资格")).Count(), }, new UniversityPerviewDto() { Name="公办", - Count=mapunlist.Where(e=>e.Nature=="公办").Count(), + Count=unlist.Where(e=>e.Nature=="公办").Count(), }, new UniversityPerviewDto() { Name="民办", - Count=mapunlist.Where(e=>e.Nature=="民办").Count(), + Count=unlist.Where(e=>e.Nature=="民办").Count(), }, }; aidto.pieChats = new List() @@ -126,124 +140,125 @@ namespace New_College.Services new PieChatsDto() { name="需冲刺", - value=mapunlist.Where(e=>e.Type==2).Count() + value=unlist.Where(e=>e.Type==2).Count() }, new PieChatsDto() { name="较稳妥", - value=mapunlist.Where(e=>e.Type==1).Count() + value=unlist.Where(e=>e.Type==1).Count() }, new PieChatsDto() { name="可保底", - value=mapunlist.Where(e=>e.Type==0).Count() + value=unlist.Where(e=>e.Type==0).Count() }, }; return aidto; } - /// - /// - /// - /// - /// - public async Task> GetAIGoList(OneSubmitGoRequest request) - { - request.PageSize = request.PageSize > 50 ? 50 : request.PageSize; - var claim = request.SubjectClaim.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); - var pagemodel = new AIGOPageModel(); - int startscore = request.Score - 25; - int endscore = request.Score + 15; - int qyear = request.Year >= 2023 ? 2023 : request.Year; - var batlist = await _batchlineRepository.Query(c => c.Year == request.Year && c.Type_name == "综合"); - request.BatchName = batlist.Where(c => c.Average <= request.Score && c.Batch_name == "普通类一段").Any() ? "普通类一段" : "普通类二段"; - Expression> expression = Expressionable.Create() - .And(c => c.Years == qyear) - .And(c => c.IsDelete == false) - .And(c => c.Location == request.Location) - .AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName.Equals(request.BatchName)) - .AndIF(!string.IsNullOrWhiteSpace(request.Name), c => SqlFunc.Contains(c.UniversityName, request.Name)) - .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.AreaName)) - .AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SubjectType == request.SchoolType) - .AndIF(request.Score > 0 && (request.EndScore <= endscore && request.StartScore >= startscore), c => SqlFunc.Between(c.LowScore, startscore, endscore)) - .AndIF(request.EndScore > endscore || request.StartScore < startscore, c => SqlFunc.Between(c.LowScore, request.StartScore, request.EndScore)) - .AndIF(request.Syl.HasValue && request.Syl == 1, c => c._SYL == "是") - .AndIF(request._211.HasValue && request._211 == 1, c => c._211 == "是") - .AndIF(request._985.HasValue && request._985 == 1, c => c._985 == "是") - .AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership) - .AndIF(!string.IsNullOrWhiteSpace(request.Nature), c => c.Nature == request.Nature) - .ToExpression(); - //var query = await _qualificationLineRepository.QueryPage(expression, request.PageIndex, request.PageSize, " LowScoreRank desc "); - var query = await _qualificationLineRepository.QueryPage(expression, request.PageIndex, request.PageSize, " LowScoreRank desc "); - - //var majorarry = query.data.Select(c => c.Major).Distinct().ToArray(); - var universityarry = query.data.Select(c => c.UniversityName).Distinct().ToArray();// - - Expression> expression3 = Expressionable.Create() - .And(c => c.Location == request.Location) - .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.MajorName, request.Major)) - // .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c.SelectSubject, request.SubjectClaim)) //此条件不带 - .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c._24subject, claim[0]) || SqlFunc.Contains(c._24subject, claim[1]) || SqlFunc.Contains(c._24subject, claim[2]) || c._24subject == "不限") - //.AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName == request.BatchName) - .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.Province)) - // .AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType) - .AndIF(request.Syl.HasValue && request.Syl == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "双一流")) - .AndIF(request._211.HasValue && request._211 == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "211")) - .AndIF(request._985.HasValue && request._985 == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "985")) - .AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership) - .AndIF(!string.IsNullOrWhiteSpace(request.Nature), c => c.Nature == request.Nature) - .AndIF(universityarry.Any(), c => SqlFunc.ContainsArray(universityarry, c.UniversityName)) - .AndIF(request.EndScore > endscore || request.StartScore < startscore, c => SqlFunc.Between(c._23Score, request.StartScore, request.EndScore)) - .ToExpression(); - var querylist = await this.sNeedDataInfoServices.Query(expression3); - - var responselist = query.data.Select(c => new AIGOResponse() + /// + /// + /// + /// + /// + public async Task> GetAIGoList(OneSubmitGoRequest request) { - AreaName = c.AreaName, - Rank = c.Rank > 9999 ? "--" : c.Rank.ToString(), - _985 = c._985, - _211 = c._211, - _SYL = c._SYL, - UniversityId = c.UId, - UniversityName = c.UniversityName, - UniversityCode = UniversityCodeConvertRules.UniversityCodeConvertRulesMap(c.RecruitCode.ToString()), - collegeCode = c.RecruitCode.ToString(), - LowScoreRank = c.LowScoreRank, - Ownership = c.Ownership, - Type = MajorPlanScoreTool.GetPlanScore(c.LowScore, request.Score),//冲稳保院校 - Percentage = MajorPlanScoreTool.GetPlanPercentage(c.LowScore, request.Score), - planCount = querylist.Where(w => w.UniversityName == c.UniversityName).Sum(c => int.Parse(c._23Count)), - }).OrderByDescending(c => c.Type).OrderBy(c => c.LowScoreRank).ToList(); + var Nature = NatureHelper.NatureNames(request.Nature); + request.PageSize = request.PageSize > 50 ? 50 : request.PageSize; + var claim = request.SubjectClaim.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); + var pagemodel = new AIGOPageModel(); + int startscore = request.Score - 25; + int endscore = request.Score + 15; + int qyear = request.Year >= 2023 ? 2023 : request.Year; + var batlist = await _batchlineRepository.Query(c => c.Year == request.Year && c.Type_name == "综合"); + request.BatchName = batlist.Where(c => c.Average <= request.Score && c.Batch_name == "普通类一段").Any() ? "普通类一段" : "普通类二段"; + Expression> expression = Expressionable.Create() + .And(c => c.Years == qyear) + .And(c => c.IsDelete == false) + .And(c => c.Location == request.Location) + .AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName.Equals(request.BatchName)) + .AndIF(!string.IsNullOrWhiteSpace(request.Name), c => SqlFunc.Contains(c.UniversityName, request.Name)) + .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.AreaName)) + .AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SubjectType == request.SchoolType) + .AndIF(request.Score > 0 && (request.EndScore <= endscore && request.StartScore >= startscore), c => SqlFunc.Between(c.LowScore, startscore, endscore)) + .AndIF(request.EndScore > endscore || request.StartScore < startscore, c => SqlFunc.Between(c.LowScore, request.StartScore, request.EndScore)) + .AndIF(request.Syl.HasValue && request.Syl == 1, c => c._SYL == "是") + .AndIF(request._211.HasValue && request._211 == 1, c => c._211 == "是") + .AndIF(request._985.HasValue && request._985 == 1, c => c._985 == "是") + .AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership) + .AndIF(request.Nature!=null && request.Nature.Count() > 0, c => SqlFunc.ContainsArray(Nature, request.Nature)) + .ToExpression(); + //var query = await _qualificationLineRepository.QueryPage(expression, request.PageIndex, request.PageSize, " LowScoreRank desc "); + var query = await _qualificationLineRepository.QueryPage(expression, request.PageIndex, request.PageSize, " LowScoreRank desc "); - responselist.ToList().ForEach(c => - { - var items = querylist.Where(e => e.UniversityName == c.UniversityName); - c._fcount = items.Select(e => int.Parse(e._23Count)).Sum(); - c._scount = items.Select(e => int.Parse(e._22Count)).Sum(); - c._tcount = items.Select(e => int.Parse(e._21Count)).Sum(); - if (items.Any() && items.Count() > 0) - { - c._fscore = items.Min(e => int.Parse(e._23SchoolScore)); - c._frank = items.Min(e => int.Parse(e._23SchoolScoreLine)); - c._sscore = items.Min(e => int.Parse(e._22Score)); - c._srank = items.Min(e => int.Parse(e._22ScoreLine)); - c._tscore = items.Min(e => int.Parse(e._22Score)); - c._trank = items.Min(e => int.Parse(e._22ScoreLine)); - } - c.iGoPlanMajorItems = items.Select(t => new AIGoPlanMajorItem() - { + //var majorarry = query.data.Select(c => c.Major).Distinct().ToArray(); + var universityarry = query.data.Select(c => c.UniversityName).Distinct().ToArray();// - PlanId = t.ID, - MajorCode = t.MajorCode, - fee = t.Fee, - Major = t.MajorName, - // MajorGroup = t.MajorGroup,//山东无专业组 - MajorRemark = t.Remark, - planCount = int.Parse(t._23Count), - SubjectClam = t._23subject, - Type = MajorPlanScoreTool.GetPlanScore(int.Parse(t._23Score), request.Score),//冲稳保院校 - Percentage = MajorPlanScoreTool.GetPlanPercentage(int.Parse(t._23Score), request.Score), - PlanItems = new List() + Expression> expression3 = Expressionable.Create() + .And(c => c.Location == request.Location) + .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.MajorName, request.Major)) + // .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c.SelectSubject, request.SubjectClaim)) //此条件不带 + .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c._24subject, claim[0]) || SqlFunc.Contains(c._24subject, claim[1]) || SqlFunc.Contains(c._24subject, claim[2]) || c._24subject == "不限") + //.AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName == request.BatchName) + .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.Province)) + // .AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType) + .AndIF(request.Syl.HasValue && request.Syl == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "双一流")) + .AndIF(request._211.HasValue && request._211 == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "211")) + .AndIF(request._985.HasValue && request._985 == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "985")) + .AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership) + .AndIF(request.Nature != null && request.Nature.Count() > 0, c => SqlFunc.ContainsArray(Nature, request.Nature)) + .AndIF(universityarry.Any(), c => SqlFunc.ContainsArray(universityarry, c.UniversityName)) + .AndIF(request.EndScore > endscore || request.StartScore < startscore, c => SqlFunc.Between(c._23Score, request.StartScore, request.EndScore)) + .ToExpression(); + var querylist = await this.sNeedDataInfoServices.Query(expression3); + + var responselist = query.data.Select(c => new AIGOResponse() + { + AreaName = c.AreaName, + Rank = c.Rank > 9999 ? "--" : c.Rank.ToString(), + _985 = c._985, + _211 = c._211, + _SYL = c._SYL, + UniversityId = c.UId, + UniversityName = c.UniversityName, + UniversityCode = UniversityCodeConvertRules.UniversityCodeConvertRulesMap(c.RecruitCode.ToString()), + collegeCode = c.RecruitCode.ToString(), + LowScoreRank = c.LowScoreRank, + Ownership = c.Ownership, + Type = MajorPlanScoreTool.GetPlanScore(c.LowScore, request.Score),//冲稳保院校 + Percentage = MajorPlanScoreTool.GetPlanPercentage(c.LowScore, request.Score), + planCount = querylist.Where(w => w.UniversityName == c.UniversityName).Sum(c => int.Parse(c._23Count)), + }).OrderByDescending(c => c.Type).OrderBy(c => c.LowScoreRank).ToList(); + + responselist.ToList().ForEach(c => + { + var items = querylist.Where(e => e.UniversityName == c.UniversityName); + c._fcount = items.Select(e => int.Parse(e._23Count)).Sum(); + c._scount = items.Select(e => int.Parse(e._22Count)).Sum(); + c._tcount = items.Select(e => int.Parse(e._21Count)).Sum(); + if (items.Any() && items.Count() > 0) { + c._fscore = items.Min(e => int.Parse(e._23SchoolScore)); + c._frank = items.Min(e => int.Parse(e._23SchoolScoreLine)); + c._sscore = items.Min(e => int.Parse(e._22Score)); + c._srank = items.Min(e => int.Parse(e._22ScoreLine)); + c._tscore = items.Min(e => int.Parse(e._22Score)); + c._trank = items.Min(e => int.Parse(e._22ScoreLine)); + } + c.iGoPlanMajorItems = items.Select(t => new AIGoPlanMajorItem() + { + + PlanId = t.ID, + MajorCode = t.MajorCode, + fee = t.Fee, + Major = t.MajorName, + // MajorGroup = t.MajorGroup,//山东无专业组 + MajorRemark = t.Remark, + planCount = int.Parse(t._23Count), + SubjectClam = t._23subject, + Type = MajorPlanScoreTool.GetPlanScore(int.Parse(t._23Score), request.Score),//冲稳保院校 + Percentage = MajorPlanScoreTool.GetPlanPercentage(int.Parse(t._23Score), request.Score), + PlanItems = new List() + { new PlanItem() { PlanCount=int.Parse(t._23Count), RankLine=int.Parse(t._23ScoreLine), @@ -262,94 +277,93 @@ namespace New_College.Services Scoreline=int.Parse(t._21Score), Year="2021" }, - } + } + }).ToList(); + + }); + return new AIGOPageModel() + { + data = responselist, + c = responselist.Where(c => c.Type == 2).Count(), + w = responselist.Where(c => c.Type == 1).Count(), + b = responselist.Where(c => c.Type == 0).Count(), + dataCount = query.dataCount, + page = query.page, + pageCount = query.pageCount, + PageSize = query.PageSize + }; + } + + + + + /// + /// 一键填报招生计划展示 + /// + /// + /// + public async Task> GetPlanMajorList(OneSubmitGoRequest request) + { + + var pagemodel = new PageModel(); + var Nature = NatureHelper.NatureNames(request.Nature); + request.PageSize = request.PageSize < 100 ? 100 : request.PageSize; + //request.PageSize = 150;//山东省 + request.Year = request.Year > 2023 ? 2023 : request.Year; + var claim = request.SubjectClaim.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); + Expression> expression3 = Expressionable.Create() + + .And(c => c.Location == request.Location) + .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c._24subject, claim[0]) || SqlFunc.Contains(c._24subject, claim[1]) || SqlFunc.Contains(c._24subject, claim[2]) || c._24subject == "不限") + .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.MajorName, request.Major)) + //.AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName.Equals(request.BatchName)) + .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.Province)) + //.And(c => c.Years == request.Year) + //.AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType) + .AndIF(request.Score > 0, c => SqlFunc.Between(c._23Score, request.Score - 25, request.Score + 15)) + .AndIF(request.Syl.HasValue && request.Syl == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "双一流")) + .AndIF(request._211.HasValue && request._211 == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "211")) + .AndIF(request._985.HasValue && request._985 == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "985")) + .AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership) + .AndIF(request.Nature != null && request.Nature.Count() > 0, c => SqlFunc.ContainsArray(Nature, request.Nature)) + //.AndIF(request. > 0, c => SqlFunc.Between(c.LowScore, request.Score, request.Score)) 位次区间 + .ToExpression(); + + var querylist = await this.sNeedDataInfoServices.Query(expression3); + + var universitymaps = (await _UniversityServices.Query(c => c.IsDelete == false)).Select(c => new D_University() + { + Id = c.Id, + Name = c.Name, }).ToList(); - }); - return new AIGOPageModel() - { - data = responselist, - c = responselist.Where(c => c.Type == 2).Count(), - w = responselist.Where(c => c.Type == 1).Count(), - b = responselist.Where(c => c.Type == 0).Count(), - dataCount = query.dataCount, - page = query.page, - pageCount = query.pageCount, - PageSize = query.PageSize - }; - } + var responselist = querylist.Select(c => new OneSubmitGoResponse() + { - - - - /// - /// 一键填报招生计划展示 - /// - /// - /// - public async Task> GetPlanMajorList(OneSubmitGoRequest request) - { - - var pagemodel = new PageModel(); - - request.PageSize = request.PageSize < 100 ? 100 : request.PageSize; - //request.PageSize = 150;//山东省 - - request.Year = request.Year > 2023 ? 2023 : request.Year; - var claim = request.SubjectClaim.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); - Expression> expression3 = Expressionable.Create() - - .And(c => c.Location == request.Location) - .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c._24subject, claim[0]) || SqlFunc.Contains(c._24subject, claim[1]) || SqlFunc.Contains(c._24subject, claim[2]) || c._24subject == "不限") - .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.MajorName, request.Major)) - //.AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName.Equals(request.BatchName)) - .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.Province)) - //.And(c => c.Years == request.Year) - //.AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType) - .AndIF(request.Score > 0, c => SqlFunc.Between(c._23Score, request.Score - 25, request.Score + 15)) - .AndIF(request.Syl.HasValue && request.Syl == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "双一流")) - .AndIF(request._211.HasValue && request._211 == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "211")) - .AndIF(request._985.HasValue && request._985 == 1, c => SqlFunc.Contains(c.LnstitutionalLevel, "985")) - .AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership) - .AndIF(!string.IsNullOrWhiteSpace(request.Nature), c => c.Nature == request.Nature) - //.AndIF(request. > 0, c => SqlFunc.Between(c.LowScore, request.Score, request.Score)) 位次区间 - .ToExpression(); - - var querylist = await this.sNeedDataInfoServices.Query(expression3); - - var universitymaps = (await _UniversityServices.Query(c => c.IsDelete == false)).Select(c => new D_University() - { - Id = c.Id, - Name = c.Name, - }).ToList(); - - var responselist = querylist.Select(c => new OneSubmitGoResponse() - { - - AreaName = c.Province, - fee = c.Fee, - Major = c.MajorName, - // MajorGroup = c.MajorGroup, - AcademicYear = c.AcademicYear, - MajorRemark = c.Remark, - planCount = int.Parse(c._23Count), - Ownership = c.Ownership, - Rank = c.UniversityRank, - _985 = c.LnstitutionalLevel != null ? (c.LnstitutionalLevel.Contains("985") ? "是" : "否") : "否", - _211 = c.LnstitutionalLevel != null ? (c.LnstitutionalLevel.Contains("211") ? "是" : "否") : "否", - _SYL = c.LnstitutionalLevel != null ? (c.LnstitutionalLevel.Contains("双一流") ? "是" : "否") : "否", - UniversityId = universitymaps.Where(e => e.Name == c.UniversityName).Any() ? universitymaps.FirstOrDefault(e => e.Name == c.UniversityName).Id : 0, - UniversityName = c.UniversityName, - SubjectClam = c._23subject, - Type = MajorPlanScoreTool.GetPlanScore(int.Parse(c._23Score), request.Score),//还缺冲稳保 - Percentage = MajorPlanScoreTool.GetPlanPercentage(int.Parse(c._23Score), request.Score), - PlanId = (int)c.ID, - UniversityCode = c.EnrollmentCode, - collegeCode = c.EnrollmentCode, - MajorCode = c.MajorCode, - LowScoreRank = int.Parse(c._23SchoolScoreLine), - LowScore = int.Parse(c._23SchoolScore), - PlanItems = new List() + AreaName = c.Province, + fee = c.Fee, + Major = c.MajorName, + // MajorGroup = c.MajorGroup, + AcademicYear = c.AcademicYear, + MajorRemark = c.Remark, + planCount = int.Parse(c._23Count), + Ownership = c.Ownership, + Rank = c.UniversityRank, + _985 = c.LnstitutionalLevel != null ? (c.LnstitutionalLevel.Contains("985") ? "是" : "否") : "否", + _211 = c.LnstitutionalLevel != null ? (c.LnstitutionalLevel.Contains("211") ? "是" : "否") : "否", + _SYL = c.LnstitutionalLevel != null ? (c.LnstitutionalLevel.Contains("双一流") ? "是" : "否") : "否", + UniversityId = universitymaps.Where(e => e.Name == c.UniversityName).Any() ? universitymaps.FirstOrDefault(e => e.Name == c.UniversityName).Id : 0, + UniversityName = c.UniversityName, + SubjectClam = c._23subject, + Type = MajorPlanScoreTool.GetPlanScore(int.Parse(c._23Score), request.Score),//还缺冲稳保 + Percentage = MajorPlanScoreTool.GetPlanPercentage(int.Parse(c._23Score), request.Score), + PlanId = (int)c.ID, + UniversityCode = c.EnrollmentCode, + collegeCode = c.EnrollmentCode, + MajorCode = c.MajorCode, + LowScoreRank = int.Parse(c._23SchoolScoreLine), + LowScore = int.Parse(c._23SchoolScore), + PlanItems = new List() { new PlanItem() { PlanCount=int.Parse(c._23Count), @@ -370,21 +384,21 @@ namespace New_College.Services Year="2021" }, } - }).ToList(); - ////冲稳保比例--待定 - var newlist = responselist.Where(c => c.Type == 2).OrderByDescending(c => c.SubjectClam).OrderByDescending(c => c.LowScore).Take(25).ToList(); - newlist.AddRange(responselist.Where(c => c.Type == 1).OrderByDescending(c => c.SubjectClam).OrderByDescending(c => c.LowScore).Take(45).ToList()); - newlist.AddRange(responselist.Where(c => c.Type == 0).OrderByDescending(c => c.SubjectClam).OrderByDescending(c => c.LowScore).Take(30).ToList()); - pagemodel.page = request.PageIndex; - pagemodel.data = newlist; - pagemodel.dataCount = responselist.Count; - pagemodel.PageSize = request.PageSize; - pagemodel.pageCount = pagemodel.data.Count(); - return pagemodel; + }).ToList(); + ////冲稳保比例--待定 + var newlist = responselist.Where(c => c.Type == 2).OrderByDescending(c => c.SubjectClam).OrderByDescending(c => c.LowScore).Take(25).ToList(); + newlist.AddRange(responselist.Where(c => c.Type == 1).OrderByDescending(c => c.SubjectClam).OrderByDescending(c => c.LowScore).Take(45).ToList()); + newlist.AddRange(responselist.Where(c => c.Type == 0).OrderByDescending(c => c.SubjectClam).OrderByDescending(c => c.LowScore).Take(30).ToList()); + pagemodel.page = request.PageIndex; + pagemodel.data = newlist; + pagemodel.dataCount = responselist.Count; + pagemodel.PageSize = request.PageSize; + pagemodel.pageCount = pagemodel.data.Count(); + return pagemodel; + } + + + + } - - - - -} } \ No newline at end of file diff --git a/New_College.Services/D_UserSettingBaseServices.cs b/New_College.Services/D_UserSettingBaseServices.cs index 58b9d00..0868f9c 100644 --- a/New_College.Services/D_UserSettingBaseServices.cs +++ b/New_College.Services/D_UserSettingBaseServices.cs @@ -41,7 +41,6 @@ namespace New_College.Services var customerinfo = await _CustomerInfoRepository.Query(c => c.Id == request.CustomerId); if (customerinfo == null) { - return false; } var basesettinginfo = new D_UserSettingBase() @@ -53,7 +52,7 @@ namespace New_College.Services PType = 0, ScoreCount = customerinfo.FirstOrDefault().IsVIP ? 10 : 3, SearchCount = customerinfo.FirstOrDefault().IsVIP ? 9999 : 10, - + ShowCount = customerinfo.FirstOrDefault().IsVIP ? 9999 : 10, }; var basesettingtypeinfo = new D_UserSettingBase() @@ -65,6 +64,7 @@ namespace New_College.Services PType = 1, ScoreCount = customerinfo.FirstOrDefault().IsVIP ? 10 : 3, SearchCount = customerinfo.FirstOrDefault().IsVIP ? 9999 : 10, + ShowCount = customerinfo.FirstOrDefault().IsVIP ? 9999 : 10, }; await _dal.Add(basesettinginfo); await _dal.Add(basesettingtypeinfo); @@ -88,6 +88,7 @@ namespace New_College.Services var models = userbaselist.FirstOrDefault(); models.ScoreCount = c.IsVIP ? 10 : 3; models.SearchCount = c.IsVIP ? 9999 : 10; + models.ShowCount= c.IsVIP ? 9999 : 10; modelslist.Add(models); } }); diff --git a/New_College.Services/T_TbSNeedDataInfoPevServices.cs b/New_College.Services/T_TbSNeedDataInfoPevServices.cs new file mode 100644 index 0000000..98d0094 --- /dev/null +++ b/New_College.Services/T_TbSNeedDataInfoPevServices.cs @@ -0,0 +1,25 @@ + +using New_College.IServices; +using New_College.Model.Models; +using New_College.Services.BASE; +using New_College.IRepository.Base; +using System.Threading.Tasks; +using System.Collections.Generic; +using New_College.Model.ViewModels; + +namespace New_College.Services +{ + public class T_TbSNeedDataInfoPevServices : BaseServices, IT_TbSNeedDataInfoPevServices + { + private readonly IBaseRepository _dal; + + public T_TbSNeedDataInfoPevServices(IBaseRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + + } + + + } +} \ No newline at end of file diff --git a/New_College.Services/T_TbSNeedDataInfoServices.cs b/New_College.Services/T_TbSNeedDataInfoServices.cs index 093c53c..fd4b1e8 100644 --- a/New_College.Services/T_TbSNeedDataInfoServices.cs +++ b/New_College.Services/T_TbSNeedDataInfoServices.cs @@ -3,16 +3,23 @@ using New_College.IServices; using New_College.Model.Models; using New_College.Services.BASE; using New_College.IRepository.Base; +using System.Threading.Tasks; +using System.Collections.Generic; +using New_College.Model.ViewModels; namespace New_College.Services { public class T_TbSNeedDataInfoServices : BaseServices, IT_TbSNeedDataInfoServices { private readonly IBaseRepository _dal; + public T_TbSNeedDataInfoServices(IBaseRepository dal) { this._dal = dal; base.BaseDal = dal; + } + + } } \ No newline at end of file diff --git a/New_College.Services/V_CustomerInfoServices.cs b/New_College.Services/V_CustomerInfoServices.cs index 9a85230..9cfe140 100644 --- a/New_College.Services/V_CustomerInfoServices.cs +++ b/New_College.Services/V_CustomerInfoServices.cs @@ -53,8 +53,8 @@ namespace New_College.Services if (!string.IsNullOrWhiteSpace(query.UserCode)) { - - info.UserCode =query.UserCode; + + info.UserCode = query.UserCode; } @@ -188,6 +188,14 @@ namespace New_College.Services info.ClassName = query.ClassName; } + if (!string.IsNullOrEmpty(query.Phone)) + { + info.Phone = query.Phone; + } + if (!string.IsNullOrEmpty(query.AvatarUrl)) + { + info.AvatarUrl = query.AvatarUrl; + } var result = await _dal.Update(info); if (result) { @@ -242,7 +250,7 @@ namespace New_College.Services response = new CustomerInfoResult() { AvatarUrl = info.AvatarUrl, - UserCode = info.UserCode, + UserCode = info.UserCode, Gender = info.Gender, Id = info.Id, OpenId = info.OpenId, diff --git a/New_College.Services/V_OrderInfoServices.cs b/New_College.Services/V_OrderInfoServices.cs index b1c9e2e..b4c72a6 100644 --- a/New_College.Services/V_OrderInfoServices.cs +++ b/New_College.Services/V_OrderInfoServices.cs @@ -147,7 +147,7 @@ namespace New_College.Services CustomerId = customer.Id, Price = query.total_fee, PayPrice = query.total_fee, - Name = "志愿好帮手VIP购买", + Name = "六纬志愿VIP", //CardNo = code, //CardId = addcard CreateTime = createtime @@ -293,7 +293,7 @@ namespace New_College.Services .AndIF(!string.IsNullOrWhiteSpace(query.out_trade_no), x => x.out_trade_no.Contains(query.out_trade_no)) .AndIF(query.CardTypeId > 0, x => x.CardTypeId == query.CardTypeId) //根据卡片类别查询 .ToExpression(); - var info = await _dal.QueryPage(wheres, query.PageIndex, query.PageSize); + var info = await _dal.QueryPage(wheres, query.PageIndex, query.PageSize, "CreateTime desc"); if (info.data.Count <= 0) return new MessageModel>() { diff --git a/New_College.Tasks/HostedService/UserBaseSettingJobTimedService.cs b/New_College.Tasks/HostedService/UserBaseSettingJobTimedService.cs index ed4a3c1..c95894d 100644 --- a/New_College.Tasks/HostedService/UserBaseSettingJobTimedService.cs +++ b/New_College.Tasks/HostedService/UserBaseSettingJobTimedService.cs @@ -21,6 +21,13 @@ namespace New_College.Tasks { Console.WriteLine("Job userbaseupdate is starting."); // 获取当前时间 + + //_timer = new Timer(DoWork, null, TimeSpan.Zero, + // TimeSpan.FromSeconds(1));//一 + + + + DateTime currentTime = DateTime.Now; // 计算距离晚上12点的时间间隔 TimeSpan timeUntilMidnight = TimeSpan.FromDays(1) - currentTime.TimeOfDay;