bug fixed

develop
old易 2024-02-22 18:12:17 +08:00
parent 198b7c5841
commit 4df2fa0e59
12 changed files with 201 additions and 57 deletions

View File

@ -531,9 +531,9 @@ namespace New_College.Api.Controllers.Front
/// <param name="query"></param>
/// <returns></returns>
[HttpGet]
public async Task<MessageModel<RequestEnrollmentinproductionDetailResult>> GetRequestEnrollmentinproductionDetailResult([FromQuery] StringIdQuery query)
public MessageModel<collegeDetailResult> GetRequestEnrollmentinproductionDetailResult([FromQuery] StringIdQuery query)
{
return await iD_LongIdMapServices.GetRequestEnrollmentinproductionDetailResult(query);
return iD_LongIdMapServices.GetRequestEnrollmentinproductionDetailResult(query);
}

View File

@ -33,37 +33,40 @@ namespace New_College.Controllers
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[Route("login")]
public async Task<MessageModel<string>> Login([FromQuery] ThridLoginRequestDto dto)
{
string token = string.Empty;
if (dto == null)
{
return new MessageModel<string>()
{
success = false,
msg = "参数错误",
//[Route("login")]
//public async Task<MessageModel<string>> Login([FromQuery] ThridLoginRequestDto dto)
//{
// string token = string.Empty;
// if (dto == null)
// {
// return new MessageModel<string>()
// {
// success = false,
// msg = "参数错误",
};
}
if (ThridConfig.secretKey != dto.secretKey)
{
return new MessageModel<string>()
{
success = false,
msg = "密钥错误",
};
}
//首先判断是否存在账户|不存在则创建新的账户,存在则直接登录
// };
// }
// if (ThridConfig.secretKey != dto.secretKey)
// {
// return new MessageModel<string>()
// {
// success = false,
// msg = "密钥错误",
// };
// }
// //首先判断是否存在账户|
// //不存在则创建新的账户|
// //存在则直接登录|
return new MessageModel<string>()
{
msg = "ok",
success = true,
response = token
};
}
// return new MessageModel<string>()
// {
// msg = "ok",
// success = true,
// response = token
// };
//}
/// <summary>
/// Oauth2验证回调

View File

@ -3424,6 +3424,21 @@
退出重新登录时传此值
</summary>
</member>
<member name="P:New_College.Model.SyncUpdateStudentInfoDto.Status">
<summary>
状态0、未启用1、启用2、禁用
</summary>
</member>
<member name="P:New_College.Model.SyncUpdateStudentInfoDto.Datainit">
<summary>
学生数据是否初始化(省份,选科等)
</summary>
</member>
<member name="P:New_College.Model.SyncUpdateStudentInfoDto.IsVIP">
<summary>
是否为VIP
</summary>
</member>
<member name="F:New_College.Model.ResponseEnum.NoPermissions">
<summary>
无权限

View File

@ -1382,13 +1382,6 @@
</summary>
<returns></returns>
</member>
<member name="M:New_College.Controllers.OauthController.Login(New_College.Model.ThridLoginRequestDto)">
<summary>
三方登录
</summary>
<param name="dto"></param>
<returns></returns>
</member>
<member name="M:New_College.Controllers.OauthController.Callback(System.String,System.String,System.String)">
<summary>
Oauth2验证回调

View File

@ -87,7 +87,7 @@ namespace New_College
//三方验证
ThridConfig.secretKey = Appsettings.app(new string[] { "ThridConfig", "secretKey" });
ThridConfig.Url = Appsettings.app(new string[] { "ThridConfig", "Url" });
services.AddMemoryCacheSetup();

View File

@ -246,7 +246,8 @@
"SerialNumber": "1B304596B953D156B37863FF52FCAE40B458C9F2" //
},
"ThridConfig": {
"secretKey": "01eb9ee95ba00e440ece83f904ef9640"
"secretKey": "01eb9ee95ba00e440ece83f904ef9640",
"Url": "http://api.carrerwebapi.com/api/oauth/SyncUpdateStudentInfo"
}
}

View File

@ -5,6 +5,8 @@
{
public static string secretKey { get; set; }
public static string Url { get; set; }
}
public static class WeixinConfig
{

View File

@ -96,12 +96,13 @@ namespace New_College.IServices
/// <returns></returns>
MessageModel<List<GenBycollegeItem>> GetEnrollmentinproductionResult(UniversityGeneralRequest query);
/// <summary>
/// 获取招生简介详情
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
Task<MessageModel<RequestEnrollmentinproductionDetailResult>> GetRequestEnrollmentinproductionDetailResult(StringIdQuery query);
MessageModel<collegeDetailResult> GetRequestEnrollmentinproductionDetailResult(StringIdQuery query);
}
}

View File

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace New_College.Model
{
public class SyncUpdateCustomerDto
{
public string key { get; set; }
public SyncUpdateStudentInfoDto syncUpdateStudentInfoDto { get; set; }
}
public class SyncUpdateStudentInfoDto
{
public string UserCode { get; set; }
public string OpenId { get; set; }
public string NickName { get; set; }
public int Gender { get; set; }
public string Phone { get; set; }
public string UserPwd { get; set; }
public string Salt { get; set; }
public string SchoolName { get; set; }
public string ClassName { get; set; }
public int AreaId { get; set; } = 0;
public string AreaName { get; set; }
/// <summary>
/// 状态0、未启用1、启用2、禁用
/// </summary>
public int? Status { get; set; } = 1;
/// <summary>
///学生数据是否初始化(省份,选科等)
/// </summary>
public bool? Datainit { get; set; } = false;
/// <summary>
/// 是否为VIP
/// </summary>
public bool IsVIP { get; set; } = false;
public int Year { get; set; }
}
}

View File

@ -59,6 +59,41 @@ namespace New_College.Model.ViewModels
public List<RequestEnrollmentinproductionResult> Data { get; set; }
}
public class Rootobject
{
public collegeDetailResult result { get; set; }
public string code { get; set; }
public string message { get; set; }
public string fullMessage { get; set; }
public DateTime timestamp { get; set; }
public bool isSuccess { get; set; }
}
public class collegeDetailResult
{
public string collegeCode { get; set; }
public string collegeName { get; set; }
public string title { get; set; }
public string content { get; set; }
public string summary { get; set; }
public string metaKeywords { get; set; }
public string metaDescription { get; set; }
public int year { get; set; }
public string[] tags { get; set; }
public int rank { get; set; }
public int hits { get; set; }
public int type { get; set; }
public bool isArt { get; set; }
public bool isShow { get; set; }
public string editor { get; set; }
public DateTime updatedAt { get; set; }
public DateTime createdAt { get; set; }
}
public class RequestQuery : BasePageRequest
{
public string Id { get; set; }

View File

@ -1046,32 +1046,35 @@ namespace New_College.Services
};
}
/// <summary>
/// 获取招生简介详情
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public async Task<MessageModel<RequestEnrollmentinproductionDetailResult>> GetRequestEnrollmentinproductionDetailResult(StringIdQuery query)
public MessageModel<collegeDetailResult> GetRequestEnrollmentinproductionDetailResult(StringIdQuery query)
{
if (string.IsNullOrWhiteSpace(query.Id))
//http://192.168.104.104:3000/youzy.dms.basiclib.api.college.news.get?id=65d152e0b306093ad50dc039&isAddHits=true
var info = HttpHelper.PostApi<Rootobject>(string.Format("http://192.168.104.104:3000/youzy.dms.basiclib.api.college.news.get?id={0}&isAddHits=true", query.Id));
if (info.isSuccess == true)
{
return new MessageModel<RequestEnrollmentinproductionDetailResult>() { success = false, msg = "传入为空" };
return new MessageModel<collegeDetailResult>()
{
success = true,
msg = "获取成功",
response = info.result
};
}
var stringBuilder = new StringBuilder();
stringBuilder.AppendFormat("Id={0}", query.Id);
var info = HttpHelper.GetApi<RequestDetailBaseResponse>("https://hbs.yrtsedu.cn/", "api/University/GetEnrollmentinproductionDetali", stringBuilder.ToString());
if (info.Success == false)
return new MessageModel<collegeDetailResult>()
{
return new MessageModel<RequestEnrollmentinproductionDetailResult>() { success = false, msg = "请求失败" };
}
return new MessageModel<RequestEnrollmentinproductionDetailResult>()
{
success = info.Success,
msg = "获取成功",
response = info.Data
success = info.isSuccess,
msg = "获取失败",
};
}
#region 数据导入
@ -2076,6 +2079,8 @@ namespace New_College.Services
return true;
}

View File

@ -19,6 +19,8 @@ using NPOI.SS.Formula.Functions;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;
using New_College.Common.HttpRestSharp;
using System.Data.Entity;
namespace New_College.Services
{
@ -44,7 +46,7 @@ namespace New_College.Services
{
try
{
// DingHookHelper.DingTalkHookMessage("UpdateCasdoorPwd", JsonConvert.SerializeObject(query));
// DingHookHelper.DingTalkHookMessage("UpdateCasdoorPwd", JsonConvert.SerializeObject(query));
var list = await _casdoorUserRepository.Query(e => e.id == query.openId);
if (list != null && list.Count() > 0)
{
@ -159,6 +161,16 @@ namespace New_College.Services
}
/// <summary>
/// 更新生涯平台数据
/// </summary>
/// <param name="sync"></param>
/// <returns></returns>
private void UpdateSYCustomer(SyncUpdateCustomerDto sync)
{
var postres = HttpHelper.PostApi<dynamic>(ThridConfig.Url, JsonConvert.SerializeObject(sync));
}
/// <summary>
/// 完善用户信息
@ -170,7 +182,6 @@ namespace New_College.Services
var info = await _dal.QueryById(query.StudentId);
if (info == null)
return new CustomerInfoResult() { Status = 3 };
if (query.AreaId > 0)
{
info.AreaId = query.AreaId;
@ -202,7 +213,7 @@ namespace New_College.Services
}
if (query.Expectedscore > 0)
{
info.Expectedscore = query.Expectedscore;
}
if (query.Year > 0)
@ -230,6 +241,32 @@ namespace New_College.Services
var result = await _dal.Update(info);
if (result)
{
//
Task.Factory.StartNew(() =>
{
UpdateSYCustomer(new SyncUpdateCustomerDto()
{
syncUpdateStudentInfoDto = new SyncUpdateStudentInfoDto()
{
AreaId = info.AreaId,
AreaName = info.AreaName,
ClassName = info.ClassName,
Datainit = true,
Gender = info.Gender,
IsVIP = info.IsVIP,
NickName = info.NickName,
OpenId = info.OpenId,
Phone = info.Phone,
Salt = info.Salt,
SchoolName = info.SchoolName,
Status = info.Status,
UserCode = info.UserCode,
UserPwd = info.UserPwd,
Year = info.Year
},
key = ThridConfig.secretKey
});
});
return new CustomerInfoResult()
{
Status = 1,