diff --git a/New_College.Api/Controllers/Front/LibraryController.cs b/New_College.Api/Controllers/Front/LibraryController.cs
index 8bb7dcd..a61ef92 100644
--- a/New_College.Api/Controllers/Front/LibraryController.cs
+++ b/New_College.Api/Controllers/Front/LibraryController.cs
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using MySqlX.XDevAPI.Common;
using New_College.Common.HttpRestSharp;
using New_College.IServices;
using New_College.Model;
@@ -152,6 +153,38 @@ namespace New_College.Api.Controllers.Front
}
+
+
+
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpGet]
+ public async Task>> GetMongoUniversity([FromQuery] string key)
+ {
+ if (key != "ycymedu")
+ {
+ return new MessageModel>()
+ {
+ success = false,
+ msg = ""
+ };
+ }
+
+ //var result = await iD_LongIdMapServices.GetSyncUniversityInfo();
+
+
+ return new MessageModel>()
+ {
+ // response = result,
+ };
+ }
+
+
+
///
/// 专业库 一级二级列表
///
@@ -487,8 +520,8 @@ namespace New_College.Api.Controllers.Front
if (string.IsNullOrWhiteSpace(query.Year))
{
- query.Year = query.Type==3?"2024":"2023";
- // query.SubjectType = query.Type;
+ query.Year = query.Type == 3 ? "2024" : "2023";
+ // query.SubjectType = query.Type;
}
var result = await iD_LongIdMapServices.GetPcUniversityRank(query);
@@ -644,7 +677,7 @@ namespace New_College.Api.Controllers.Front
}
-
+
}
diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml
index ee1542a..63492e9 100644
--- a/New_College.Api/New_College.Model.xml
+++ b/New_College.Api/New_College.Model.xml
@@ -1826,6 +1826,21 @@
获取或设置是否禁用,逻辑上的删除,非物理删除
+
+
+
+
+
+
+
+
+
+
+
+
+ 学校名称
+
+
角色表
@@ -6745,6 +6760,91 @@
原始code
+
+
+ 官网
+
+
+
+
+ 主键id
+
+
+
+
+ 名称
+
+
+
+
+ 院士数
+
+
+
+
+ 博士数
+
+
+
+
+ 硕士数
+
+
+
+
+ 学校logo
+
+
+
+
+ 学校简介
+
+
+
+
+ 省市区名称
+
+
+
+
+ 办学性质
+
+
+
+
+ 隶属于
+
+
+
+
+ 学科层次
+
+
+
+
+ 学校类型
+
+
+
+
+ 创办时间
+
+
+
+
+ 地址
+
+
+
+
+ 电话
+
+
+
+
+ 院校图片json
+
+
@@ -7700,6 +7800,21 @@
0分数修改次数|1查询次数
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0-pc,1-minpro
diff --git a/New_College.Api/New_College.xml b/New_College.Api/New_College.xml
index 67c3201..59aaa76 100644
--- a/New_College.Api/New_College.xml
+++ b/New_College.Api/New_College.xml
@@ -316,6 +316,13 @@
+
+
+ 问卷保存
+
+
+
+
招生计划
@@ -405,6 +412,13 @@
+
+
+
+
+
+
+
专业库 一级二级列表
diff --git a/New_College.Api/appsettings.Development.json b/New_College.Api/appsettings.Development.json
index 4ed1d9e..d2d6749 100644
--- a/New_College.Api/appsettings.Development.json
+++ b/New_College.Api/appsettings.Development.json
@@ -32,7 +32,7 @@
"RedisCachingAOP": {
"Enabled": true,
"ConnectionString": "127.0.0.1:6379",
- "Password": "Vs_.127134"
+ "Password": ""
},
"MemoryCachingAOP": {
"Enabled": true
diff --git a/New_College.IServices/ID_LongIdMapServices.cs b/New_College.IServices/ID_LongIdMapServices.cs
index 38670f0..6c904b8 100644
--- a/New_College.IServices/ID_LongIdMapServices.cs
+++ b/New_College.IServices/ID_LongIdMapServices.cs
@@ -24,6 +24,8 @@ namespace New_College.IServices
Task UpdateUniveristyInf();
Task> GetUniversitys(UniversityQuery query);
+ Task> GetSyncUniversityInfo();
+
Task> uniGetMajorInfo(MajorcategoryQuery query);
///
diff --git a/New_College.Model/ViewModels/Result/UniversityResult.cs b/New_College.Model/ViewModels/Result/UniversityResult.cs
index 1f18651..5182eaa 100644
--- a/New_College.Model/ViewModels/Result/UniversityResult.cs
+++ b/New_College.Model/ViewModels/Result/UniversityResult.cs
@@ -150,6 +150,101 @@ namespace New_College.Model.ViewModels
}
+ public class UniversityMongoResult
+ {
+
+ public string collegeCode { get; set; }
+
+ ///
+ /// 官网
+ ///
+ public string Web { get; set; }
+ ///
+ /// 主键id
+ ///
+ public int Id { get; set; }
+ ///
+ /// 名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 院士数
+ ///
+ public int? AcademicianCount { get; set; }
+ ///
+ /// 博士数
+ ///
+ public int DoctorateCount { get; set; }
+ ///
+ /// 硕士数
+ ///
+ public int MasterCount { get; set; }
+
+
+ ///
+ /// 学校logo
+ ///
+ public string Logo { get; set; }
+ ///
+ /// 学校简介
+ ///
+ public string Description { get; set; }
+ ///
+ /// 省市区名称
+ ///
+ public string AreaName { get; set; }
+ public string CityName { get; set; }
+ ///
+ /// 办学性质
+ ///
+ public string Nature { get; set; }
+ ///
+ /// 隶属于
+ ///
+ public string AscriptionName { get; set; }
+
+ public string Belong { get; set; }
+ ///
+ /// 学科层次
+ ///
+ public int? SubjectLevel { get; set; }
+ ///
+ /// 学校类型
+ ///
+ public List UniversityType { get; set; }
+ ///
+ /// 创办时间
+ ///
+ public string BuildDate { get; set; }
+
+ public string features { get; set; }
+
+ ///
+ /// 地址
+ ///
+ public string Address { get; set; }
+
+ ///
+ /// 电话
+ ///
+ public string Phone { get; set; }
+
+
+ ///
+ /// 院校图片json
+ ///
+ public string Imglist { get; set; }
+
+
+ public string VrUrl { get; set; }
+
+
+ }
+
+
+
+
///
///
///
diff --git a/New_College.Services/D_LongIdMapServices.cs b/New_College.Services/D_LongIdMapServices.cs
index 5b41b1b..55f61b5 100644
--- a/New_College.Services/D_LongIdMapServices.cs
+++ b/New_College.Services/D_LongIdMapServices.cs
@@ -25,6 +25,8 @@ using New_College.Repository;
using NPOI.Util.ArrayExtensions;
using System.Threading;
using Org.BouncyCastle.Asn1.Tsp;
+using Newtonsoft.Json;
+using MySqlX.XDevAPI.Common;
namespace New_College.Services
{
@@ -57,7 +59,7 @@ namespace New_College.Services
private readonly ID_PlanMajorDescRepository d_PlanMajorDescRepository;
private readonly ID_PlanMajorDescProRepository d_PlanMajorDescProRepository;
private readonly IT_TbSNeedDataInfoRepository t_TbSNeedDataInfoRepository;
-
+ private readonly IRedisCacheManager _redisCache;
public D_LongIdMapServices(IBaseRepository dal
, ID_MajorCategoryRepository ID_MajorCategoryRepository
, ID_MajorClassRepository ID_MajorClassRepository
@@ -84,7 +86,8 @@ namespace New_College.Services
ID_QualificationLineRepository d_QualificationLineRepository,
ID_PlanMajorDescRepository d_PlanMajorDescRepository,
ID_PlanMajorDescProRepository d_PlanMajorDescProRepository,
- IT_TbSNeedDataInfoRepository tbSNeedDataInfoRepository)
+ IT_TbSNeedDataInfoRepository tbSNeedDataInfoRepository,
+ IRedisCacheManager redisCache)
{
this._dal = dal;
d_MajorCategoryRepository = ID_MajorCategoryRepository;
@@ -114,6 +117,7 @@ namespace New_College.Services
this.d_PlanMajorDescRepository = d_PlanMajorDescRepository;
this.d_PlanMajorDescProRepository = d_PlanMajorDescProRepository;
t_TbSNeedDataInfoRepository = tbSNeedDataInfoRepository;
+ this._redisCache = redisCache;
}
///
@@ -2035,6 +2039,90 @@ namespace New_College.Services
return true;
}
+
+ public async Task> GetSyncUniversityInfo()
+ {
+ if (_redisCache.Get("sync_university"))
+ {
+ return JsonConvert.DeserializeObject>((Encoding.UTF8.GetString(_redisCache.Get("sync_university"))));
+ }
+
+ var list = new List();
+ var tbinfo = await t_TbSNeedDataInfoRepository.Query(e => e.Location == "山东省");
+ var universitylist = await d_UniversityRepository.Query();
+ var universityimglist = await d_UniversityimgRepository.Query(x => x.IsDelete == false);
+
+ universitylist.ForEach(university =>
+ {
+
+ var models = new UniversityMongoResult()
+ {
+ Id = university.Id,
+ Name = university.Name,
+ Address = university.Address,
+ Phone = university.Phone,
+ // Nature = university.Nature,
+ //AscriptionName = university.AscriptionName,
+ // Rank = university.Rank,
+ AreaName = university.Area_Name,
+ Logo = university.Logo,
+ // Syl = university.Syl == 1 ? true : false,
+ // Nhef = university.Nhef == 1 ? true : false,
+ // Sff = university.Sff == 1 ? true : false,
+ // QJJH = university.QJJH == 1 ? true : false,
+ //UniversityType = university.Type,
+ SubjectLevel = university.Subject_Level,
+ BuildDate = university.Build_Date,
+ // Imglist = imgs,
+ DoctorateCount = university.Doctorate_Count,
+ MasterCount = university.Master_Count,
+ AcademicianCount = university.Academician_Count,
+ collegeCode = university.UniversityCode,
+ Web = string.IsNullOrEmpty(university.Web) ? "暂无" : university.Web,
+ // Description = ClearHtmlHelper.SHTML(university.Description),
+ };
+ models.Imglist = universityimglist.Where(e => e.UniversityId == university.Id).Select(c => c.ImgList).FirstOrDefault();
+ models.VrUrl = universityimglist.Where(e => e.UniversityId == university.Id).Select(c => c.VRUrl).FirstOrDefault();
+
+ var baseinfo = tbinfo.Where(e => e.UniversityName == university.Name).FirstOrDefault();
+
+ if (baseinfo != null && !string.IsNullOrWhiteSpace(baseinfo.LnstitutionalLevel))
+ {
+ models.features = baseinfo.LnstitutionalLevel;
+ }
+
+ if (baseinfo != null && !string.IsNullOrWhiteSpace(baseinfo.City))
+ {
+ models.CityName = baseinfo.City;
+ }
+ if (baseinfo != null && !string.IsNullOrWhiteSpace(baseinfo.Nature))
+ {
+ models.Nature = baseinfo.Nature;
+ }
+
+ if (baseinfo != null && !string.IsNullOrWhiteSpace(baseinfo.Nature))
+ {
+ models.Nature = baseinfo.Nature;
+ }
+ if (baseinfo != null && !string.IsNullOrWhiteSpace(baseinfo.Ownership))
+ {
+ models.Belong = baseinfo.Ownership;
+ }
+ var undetail = HttpHelper.GetApi("http://192.168.104.104:3000/", "youzy.dms.basiclib.api.college.bycode.get?code=" + university.UniversityCode + "", "");
+ if (undetail != null && undetail.isSuccess)
+ {
+ models.UniversityType = undetail.result.categories.ToList();
+
+ }
+ list.Add(models);
+
+ });
+ byte[] byresult = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(list));
+ _redisCache.Set("sync_university", byresult, TimeSpan.FromDays(1));
+ return list;
+ }
+
+
///
/// 更新招生计划数据
///