兑换码功能实现
parent
68f2d3e466
commit
68170cf792
|
|
@ -324,6 +324,49 @@ namespace New_College.Services
|
|||
if (!string.IsNullOrWhiteSpace(info.Phone))
|
||||
{
|
||||
Task.Run(async () =>
|
||||
{
|
||||
SyncXET(info);
|
||||
});
|
||||
}
|
||||
|
||||
return new MessageModel<CustomerInfoResult>()
|
||||
{
|
||||
success = true,
|
||||
msg = "获取成功",
|
||||
response = new CustomerInfoResult()
|
||||
{
|
||||
AvatarUrl = info.AvatarUrl,
|
||||
UserCode = info.UserCode,
|
||||
Gender = info.Gender,
|
||||
Id = info.Id,
|
||||
OpenId = info.OpenId,
|
||||
NickName = info.NickName,
|
||||
AreaId = info.AreaId,
|
||||
AreaName = info.AreaName,
|
||||
Datainit = info.Datainit,
|
||||
Expectedscore = info.Expectedscore,
|
||||
Phone = info.Phone,
|
||||
Rank = info.Rank,
|
||||
IsVIP = info.IsVIP,
|
||||
Subject = info.Subject,
|
||||
Subjectgroup = info.Subjectgroup,
|
||||
subjectgroupName = info.subjectgroupName,
|
||||
VipCode = info.VipCode,
|
||||
IsUpdateScore = info.IsUpdateScore,
|
||||
Year = info.Year,
|
||||
SchoolName = info.SchoolName,
|
||||
ClassName = info.ClassName,
|
||||
BatchName = batchlist.Where(c => c.Batch_name == "普通类一段" && c.Average <= info.Expectedscore).Any() ? "普通类一段" : "普通类二段"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 同步小鹅通
|
||||
/// </summary>
|
||||
/// <param name="info"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<V_CustomerInfo> SyncXET(V_CustomerInfo info)
|
||||
{
|
||||
var xet = XiaoEtongApp.GetUsersList(new UserRequest()
|
||||
{
|
||||
|
|
@ -368,45 +411,12 @@ namespace New_College.Services
|
|||
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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return new MessageModel<CustomerInfoResult>()
|
||||
{
|
||||
success = true,
|
||||
msg = "获取成功",
|
||||
response = new CustomerInfoResult()
|
||||
{
|
||||
AvatarUrl = info.AvatarUrl,
|
||||
UserCode = info.UserCode,
|
||||
Gender = info.Gender,
|
||||
Id = info.Id,
|
||||
OpenId = info.OpenId,
|
||||
NickName = info.NickName,
|
||||
AreaId = info.AreaId,
|
||||
AreaName = info.AreaName,
|
||||
Datainit = info.Datainit,
|
||||
Expectedscore = info.Expectedscore,
|
||||
Phone = info.Phone,
|
||||
Rank = info.Rank,
|
||||
IsVIP = info.IsVIP,
|
||||
Subject = info.Subject,
|
||||
Subjectgroup = info.Subjectgroup,
|
||||
subjectgroupName = info.subjectgroupName,
|
||||
VipCode = info.VipCode,
|
||||
IsUpdateScore = info.IsUpdateScore,
|
||||
Year = info.Year,
|
||||
SchoolName = info.SchoolName,
|
||||
ClassName = info.ClassName,
|
||||
BatchName = batchlist.Where(c => c.Batch_name == "普通类一段" && c.Average <= info.Expectedscore).Any() ? "普通类一段" : "普通类二段"
|
||||
}
|
||||
};
|
||||
return info;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -505,6 +515,7 @@ namespace New_College.Services
|
|||
var userinfo = (await _dal.Query(w => w.OpenId == query.openId && w.IsDelete == false)).ToList().FirstOrDefault();
|
||||
if (userinfo != null)
|
||||
{
|
||||
await SyncXET(userinfo);
|
||||
return new Tuple<bool, CustomerInfoResult>(true, new CustomerInfoResult()
|
||||
{
|
||||
AreaId = userinfo.AreaId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue