feat:bug fixed

develop
old易 2024-02-28 14:40:24 +08:00
parent 81e2ddc4ba
commit 245af4e1aa
2 changed files with 24 additions and 15 deletions

View File

@ -196,7 +196,11 @@ namespace New_College.Api.Controllers.Front
var result = repUserPhoneNumber.errcode == 0 ? await _services.Update(customerinfo) : false; var result = repUserPhoneNumber.errcode == 0 ? await _services.Update(customerinfo) : false;
if (result) if (result)
{ {
newId = await updatesync(customerinfo.Phone); try
{
newId = await updatesync(customerinfo.Phone);
}catch (Exception ex) {
}
} }
return new MessageModel<string>() return new MessageModel<string>()
{ {
@ -217,10 +221,10 @@ namespace New_College.Api.Controllers.Front
var customer = await _services.Query(c => c.Phone == phone); var customer = await _services.Query(c => c.Phone == phone);
if (customer.Count() > 1) if (customer.Count() > 1)
{ {
var exists = customer.Exists(e => e.UUID.Contains("-")); var exists = customer.Exists(e => !string.IsNullOrWhiteSpace(e.UUID));
if (exists) if (exists)
{ {
var firstinfo = customer.FirstOrDefault(e => e.UUID.Contains("-")); var firstinfo = customer.FirstOrDefault(e => !string.IsNullOrWhiteSpace(e.UUID));
newId = firstinfo.Id; newId = firstinfo.Id;
var endinfo = customer.FirstOrDefault(e => e.Id != firstinfo.Id); var endinfo = customer.FirstOrDefault(e => e.Id != firstinfo.Id);
firstinfo.IsVIP = endinfo.IsVIP ? true : firstinfo.IsVIP; firstinfo.IsVIP = endinfo.IsVIP ? true : firstinfo.IsVIP;
@ -336,8 +340,10 @@ namespace New_College.Api.Controllers.Front
var result = await _services.UpdateScore(query); var result = await _services.UpdateScore(query);
if (result.Id > 0) if (result.Id > 0)
{ {
await _userSetting.UpdateSingleCustomerSetting(new UserBaseSettingUpdateDTO() { UType = 0, CustomerId = query.StudentId });//修改参数次数 if (query.Score != customersingle.Expectedscore)
{
await _userSetting.UpdateSingleCustomerSetting(new UserBaseSettingUpdateDTO() { UType = 0, CustomerId = query.StudentId });//修改参数次数
}
var token = JwtHelper.IssueJwt(new TokenModelJwt() { Uid = result.Id, Role = "学生" }); var token = JwtHelper.IssueJwt(new TokenModelJwt() { Uid = result.Id, Role = "学生" });
result.Token = token; result.Token = token;
} }
@ -360,10 +366,10 @@ namespace New_College.Api.Controllers.Front
var result = await _services.UpdateCustomer(query); var result = await _services.UpdateCustomer(query);
if (result.Id > 0) if (result.Id > 0)
{ {
if (query.Expectedscore >= 0) //if (query.Expectedscore >= 0)
{ //{
await _userSetting.UpdateSingleCustomerSetting(new UserBaseSettingUpdateDTO() { UType = 0, CustomerId = query.StudentId });//修改参数次数 // await _userSetting.UpdateSingleCustomerSetting(new UserBaseSettingUpdateDTO() { UType = 0, CustomerId = query.StudentId });//修改参数次数
} //}
var token = JwtHelper.IssueJwt(new TokenModelJwt() { Uid = result.Id, Role = "学生" }); var token = JwtHelper.IssueJwt(new TokenModelJwt() { Uid = result.Id, Role = "学生" });
result.Token = token; result.Token = token;
} }

View File

@ -29,12 +29,14 @@ namespace New_College.Services
private readonly IBaseRepository<V_CustomerInfo> _dal; private readonly IBaseRepository<V_CustomerInfo> _dal;
private readonly IT_BatchlineRepository t_BatchlineRepository; private readonly IT_BatchlineRepository t_BatchlineRepository;
private readonly ICasdoorUserRepository _casdoorUserRepository; private readonly ICasdoorUserRepository _casdoorUserRepository;
public V_CustomerInfoServices(IBaseRepository<V_CustomerInfo> dal, IT_BatchlineRepository t_Batchline, ICasdoorUserRepository casdoorUserRepository) private readonly ID_UserSettingBaseServices _userSetting;
public V_CustomerInfoServices(IBaseRepository<V_CustomerInfo> dal, IT_BatchlineRepository t_Batchline, ICasdoorUserRepository casdoorUserRepository, ID_UserSettingBaseServices userSetting)
{ {
this._dal = dal; this._dal = dal;
base.BaseDal = dal; base.BaseDal = dal;
t_BatchlineRepository = t_Batchline; t_BatchlineRepository = t_Batchline;
_casdoorUserRepository = casdoorUserRepository; _casdoorUserRepository = casdoorUserRepository;
_userSetting = userSetting;
} }
@ -76,8 +78,7 @@ namespace New_College.Services
//info.Phone = query.Phone; //info.Phone = query.Phone;
info.Gender = query.Gender; info.Gender = query.Gender;
info.AvatarUrl = query.AvatarUrl; info.AvatarUrl = query.AvatarUrl;
DingHookHelper.DingTalkHookMessage("CasDoorUpdate", query.service_token); var result = await _dal.Update(info);
if (!string.IsNullOrWhiteSpace(query.UserPwd)) if (!string.IsNullOrWhiteSpace(query.UserPwd))
{ {
UpdateCasdoorPwd(new CasDoorUpdatePwdDto() UpdateCasdoorPwd(new CasDoorUpdatePwdDto()
@ -89,7 +90,6 @@ namespace New_College.Services
var salt = RadomHelper.RandCode(6); var salt = RadomHelper.RandCode(6);
info.UserPwd = MD5Helper.MD5Encrypt16(query.UserPwd + salt); info.UserPwd = MD5Helper.MD5Encrypt16(query.UserPwd + salt);
} }
var result = await _dal.Update(info);
return new CustomerInfoResult() return new CustomerInfoResult()
{ {
Status = 1, Status = 1,
@ -213,8 +213,11 @@ namespace New_College.Services
} }
if (query.Expectedscore > 0) if (query.Expectedscore > 0)
{ {
if (query.Expectedscore != info.Expectedscore)
info.Expectedscore = query.Expectedscore; {
await _userSetting.UpdateSingleCustomerSetting(new UserBaseSettingUpdateDTO() { UType = 0, CustomerId = query.StudentId });//修改参数次数
info.Expectedscore = query.Expectedscore;
}
} }
if (query.Year > 0) if (query.Year > 0)
{ {