diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index 416c761..c6b1044 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -896,6 +896,11 @@ 学校 + + + 综合/理科/文科 + + 批次 diff --git a/New_College.Model/Models/D_PlanMajorScoreLine.cs b/New_College.Model/Models/D_PlanMajorScoreLine.cs index b7d0f15..a1c3a53 100644 --- a/New_College.Model/Models/D_PlanMajorScoreLine.cs +++ b/New_College.Model/Models/D_PlanMajorScoreLine.cs @@ -29,6 +29,12 @@ namespace New_College.Model.Models public string UniversityName { get; set; } + /// + /// 综合/理科/文科 + /// + public string SubjectType { get; set; } + + /// /// 批次 /// diff --git a/New_College.Services/V_CustomerInfoServices.cs b/New_College.Services/V_CustomerInfoServices.cs index f44f2b8..7d3d9c7 100644 --- a/New_College.Services/V_CustomerInfoServices.cs +++ b/New_College.Services/V_CustomerInfoServices.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using New_College.Common.HttpRestSharp; using StackExchange.Profiling.Internal; using New_College.Repository; +using System.Xml.Linq; namespace New_College.Services { @@ -368,50 +369,52 @@ namespace New_College.Services /// private async Task SyncXET(V_CustomerInfo info) { + if (!string.IsNullOrWhiteSpace(info.Phone)) { var xet = XiaoEtongApp.GetUsersList(new UserRequest() { phone = info.Phone, page = 1, page_size = 1, }); - if (xet.data.list != null && xet.data.list.Count() > 0) - { - var xiaoetong = (await _XiaoEtongUserRepository.Query(e => e.collect_phone == info.Phone)); - if (!xiaoetong.Any()) + if (xet != null && xet.data.list != null && xet.data.list.Count() > 0) { - await _XiaoEtongUserRepository.Add(new D_XiaoEtongUser() + var xiaoetong = (await _XiaoEtongUserRepository.Query(e => e.collect_phone == info.Phone)); + if (!xiaoetong.Any()) { - avatar = xet.data.list.First().avatar, - bind_phone = xet.data.list.First().bind_phone, - collect_phone = xet.data.list.First().collect_phone, - CreateBy = "system", - CreateTime = DateTime.Now, - from = xet.data.list.First().from, - IsDelete = false, - ModifyBy = "system", - ModifyTime = DateTime.Now, - OrderSort = 0, - pay_sum = xet.data.list.First().pay_sum, - punch_count = xet.data.list.First().punch_count, - user_created_at = xet.data.list.First().user_created_at, - user_nickname = xet.data.list.First().user_nickname, - wx_app_open_id = xet.data.list.First().wx_app_open_id, - wx_open_id = xet.data.list.First().wx_open_id, - wx_union_id = xet.data.list.First().wx_union_id, - user_id = xet.data.list.First().user_id - }); - var orders = XiaoEtongApp.GetOrdersList(new XETOrdersRequest() - { - page = 1, - page_size = 30, - user_id = xet.data.list.First().user_id - }); - if (orders.data.list.Any() && orders.data.list.Count() > 0 && !info.IsVIP) - { - var isvip = orders.data.list.Select(c => c.order_info).Where(e => e.activity_type_bitmap.Contains(11)); - info.IsVIP = isvip.Count() > 0 ? true : false; - info.ModifyTime = DateTime.Now; - await _dal.Update(info); + await _XiaoEtongUserRepository.Add(new D_XiaoEtongUser() + { + avatar = xet.data.list.First().avatar, + bind_phone = xet.data.list.First().bind_phone, + collect_phone = xet.data.list.First().collect_phone, + CreateBy = "system", + CreateTime = DateTime.Now, + from = xet.data.list.First().from, + IsDelete = false, + ModifyBy = "system", + ModifyTime = DateTime.Now, + OrderSort = 0, + pay_sum = xet.data.list.First().pay_sum, + punch_count = xet.data.list.First().punch_count, + user_created_at = xet.data.list.First().user_created_at, + user_nickname = xet.data.list.First().user_nickname, + wx_app_open_id = xet.data.list.First().wx_app_open_id, + wx_open_id = xet.data.list.First().wx_open_id, + wx_union_id = xet.data.list.First().wx_union_id, + user_id = xet.data.list.First().user_id + }); + var orders = XiaoEtongApp.GetOrdersList(new XETOrdersRequest() + { + page = 1, + page_size = 30, + user_id = xet.data.list.First().user_id + }); + if (orders.data.list.Any() && orders.data.list.Count() > 0 && !info.IsVIP) + { + var isvip = orders.data.list.Select(c => c.order_info).Where(e => e.activity_type_bitmap.Contains(11)); + info.IsVIP = isvip.Count() > 0 ? true : false; + info.ModifyTime = DateTime.Now; + await _dal.Update(info); + } } } }