feat:搜索bug fixed
parent
9ba902a573
commit
2a97e797c0
|
|
@ -211,10 +211,10 @@ namespace New_College.Api.Controllers.Front
|
|||
/// <returns></returns>
|
||||
|
||||
[HttpGet]
|
||||
public async Task<MessageModel<dynamic>> PcGetOccupationInfo()
|
||||
public async Task<MessageModel<dynamic>> PcGetOccupationInfo([FromQuery] MinOccupationRequest request)
|
||||
{
|
||||
////http://192.168.104.104:3000/youzy.dms.basiclib.api.v1.career2.level.tree.get
|
||||
var result = await iD_LongIdMapServices.pcGetOccupationInfo();
|
||||
var result = await iD_LongIdMapServices.pcGetOccupationInfo(request.Name);
|
||||
return new MessageModel<dynamic>()
|
||||
{
|
||||
success = result.Count <= 0 ? false : true,
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ namespace New_College.Common.Helper
|
|||
type = 1;
|
||||
break;
|
||||
case "医学":
|
||||
case "医药":
|
||||
type = 2;
|
||||
break;
|
||||
case "军事":
|
||||
|
|
|
|||
|
|
@ -300,7 +300,13 @@ namespace New_College.Services
|
|||
public async Task<List<pcMajorInfoResult>> pcGetOccupationInfo(string name = null)
|
||||
{
|
||||
var list = new List<pcMajorInfoResult>() { };
|
||||
var occupationCategoryList = (await d_OccupationCategoryRepository.Query(x => x.IsDelete == false)).Select(x => new uniOccSelect() { Id = x.Id, Level = x.Level, Name = x.Name, ParentId = x.ParentId, OccupationName = x.OccupationName });
|
||||
|
||||
|
||||
Expression<Func<D_OccupationCategory, bool>> categoryexpression = Expressionable.Create<D_OccupationCategory>()
|
||||
.And(x => x.IsDelete == false)
|
||||
// .AndIF(!string.IsNullOrWhiteSpace(name), x => SqlFunc.Contains(x.Name, name))
|
||||
.ToExpression();
|
||||
var occupationCategoryList = (await d_OccupationCategoryRepository.Query(categoryexpression)).Select(x => new uniOccSelect() { Id = x.Id, Level = x.Level, Name = x.Name, ParentId = x.ParentId, OccupationName = x.OccupationName });
|
||||
|
||||
Expression<Func<D_Occupation, bool>> expression = Expressionable.Create<D_Occupation>()
|
||||
.And(x => x.IsDelete == false)
|
||||
|
|
@ -313,23 +319,27 @@ namespace New_College.Services
|
|||
{
|
||||
var scond = new List<pcMajorItem>();
|
||||
var nowmajoclass = occupationCategoryList.Where(x => x.ParentId == item.Id).ToList();
|
||||
scond = nowmajoclass.Select(s => new pcMajorItem()
|
||||
var tids = queryoccupations.Select(c => c.CategoryId).ToList();
|
||||
if (nowmajoclass.Where(ww => SqlFunc.ContainsArray(tids, ww.Id)).Any())
|
||||
{
|
||||
Name = s.OccupationName,
|
||||
MajorNum = occupations.Count(e => e == s.Id),
|
||||
children = queryoccupations.Where(e => e.CategoryId == s.Id).Select(c => new pcMajorItem()
|
||||
scond = nowmajoclass.Select(s => new pcMajorItem()
|
||||
{
|
||||
Name = c.Name,
|
||||
Id = c.Id,
|
||||
// MajorNum = queryoccupations.Where(e => e.CategoryId == s.Id).Count()
|
||||
}).ToList(),
|
||||
Id = s.Id
|
||||
}).ToList();
|
||||
list.Add(new pcMajorInfoResult()
|
||||
{
|
||||
Name = item.Name,
|
||||
children = scond
|
||||
});
|
||||
Name = s.OccupationName,
|
||||
MajorNum = occupations.Count(e => e == s.Id),
|
||||
children = queryoccupations.Where(e => e.CategoryId == s.Id).Select(c => new pcMajorItem()
|
||||
{
|
||||
Name = c.Name,
|
||||
Id = c.Id,
|
||||
// MajorNum = queryoccupations.Where(e => e.CategoryId == s.Id).Count()
|
||||
}).ToList(),
|
||||
Id = s.Id
|
||||
}).ToList();
|
||||
list.Add(new pcMajorInfoResult()
|
||||
{
|
||||
Name = item.Name,
|
||||
children = scond.Where(e=>e.children.Any()).ToList()
|
||||
});
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
@ -1827,38 +1837,47 @@ namespace New_College.Services
|
|||
//});
|
||||
#region *******************院校信息更新******************
|
||||
|
||||
//for (var i = 1; i <= 147; i++)
|
||||
//{
|
||||
// var body = new HttpHelperPostRequest() { pageIndex = i };
|
||||
// var info = HttpHelper.PostApi<HttpHelperPostobject>("http://192.168.104.104:3000/youzy.dms.basiclib.api.college.query", body);
|
||||
for (var i = 1; i <= 147; i++)
|
||||
{
|
||||
var body = new HttpHelperPostRequest() { pageIndex = i };
|
||||
var info = HttpHelper.PostApi<HttpHelperPostobject>("http://192.168.104.104:3000/youzy.dms.basiclib.api.college.query", body);
|
||||
|
||||
info.result.items.ToList().ForEach(async a =>
|
||||
{
|
||||
|
||||
//http://192.168.104.104:3000/youzy.dms.basiclib.api.college.bycode.get?code=10017 //详情
|
||||
// var bodydetail = new httphelperdetailrequest() { code = a.code };
|
||||
var undetail = HttpHelper.GetApi<UniversityDetailobject>("http://192.168.104.104:3000/", "youzy.dms.basiclib.api.college.bycode.get?code=" + a.code + "", "");
|
||||
Thread.Sleep(1000);
|
||||
var universitymodel = await d_UniversityRepository.Query(c => c.Name == a.cnName);
|
||||
if (universitymodel.Any() && undetail != null && undetail.result != null)
|
||||
{
|
||||
var updatemodel = universitymodel.FirstOrDefault();
|
||||
var category = undetail.result.categories.ToList();
|
||||
if (category.Contains("医药"))
|
||||
{
|
||||
updatemodel.Type = UniversityTypeRelsove.GetTypeName("医药");
|
||||
|
||||
//updatemodel.Web = undetail.result.webSite;
|
||||
//updatemodel.Address = undetail.result.address[0].address;
|
||||
//updatemodel.Phone = string.Join(",",undetail.result.zhaoBanDH);
|
||||
// updatemodel.AscriptionName = undetail.result.belong;
|
||||
//updatemodel.UniversityCode = a.code;
|
||||
//updatemodel.Rank = a.ranking;
|
||||
//updatemodel.Build_Date = undetail.result.createdYear;
|
||||
//updatemodel.Description = undetail.result.introduction;
|
||||
//updatemodel.Master_Count = undetail.result.pointsOfShuo.Any() ? undetail.result.pointsOfShuo[0].number : 0;
|
||||
//updatemodel.Doctorate_Count = undetail.result.pointsOfBo.Any() ? undetail.result.pointsOfBo[0].number : 0;
|
||||
//updatemodel.Type = UniversityTypeRelsove.GetTypeName((undetail.result.categories.Any() ? undetail.result.categories[0] : ""));
|
||||
await d_UniversityRepository.Update(updatemodel);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// info.result.items.ToList().ForEach(async a =>
|
||||
// {
|
||||
|
||||
// //http://192.168.104.104:3000/youzy.dms.basiclib.api.college.bycode.get?code=10017 //详情
|
||||
// // var bodydetail = new httphelperdetailrequest() { code = a.code };
|
||||
// var undetail = HttpHelper.GetApi<UniversityDetailobject>("http://192.168.104.104:3000/", "youzy.dms.basiclib.api.college.bycode.get?code=" + a.code + "", "");
|
||||
// Thread.Sleep(1000);
|
||||
// var universitymodel = await d_UniversityRepository.Query(c => c.Name == a.cnName);
|
||||
// if (universitymodel.Any() && undetail != null && undetail.result != null)
|
||||
// {
|
||||
// var updatemodel = universitymodel.FirstOrDefault();
|
||||
// //updatemodel.Web = undetail.result.webSite;
|
||||
// //updatemodel.Address = undetail.result.address[0].address;
|
||||
// //updatemodel.Phone = string.Join(",",undetail.result.zhaoBanDH);
|
||||
// updatemodel.AscriptionName = undetail.result.belong;
|
||||
// //updatemodel.UniversityCode = a.code;
|
||||
// //updatemodel.Rank = a.ranking;
|
||||
// //updatemodel.Build_Date = undetail.result.createdYear;
|
||||
// //updatemodel.Description = undetail.result.introduction;
|
||||
// //updatemodel.Master_Count = undetail.result.pointsOfShuo.Any() ? undetail.result.pointsOfShuo[0].number : 0;
|
||||
// //updatemodel.Doctorate_Count = undetail.result.pointsOfBo.Any() ? undetail.result.pointsOfBo[0].number : 0;
|
||||
// //updatemodel.Type = UniversityTypeRelsove.GetTypeName((undetail.result.categories.Any() ? undetail.result.categories[0] : ""));
|
||||
// await d_UniversityRepository.Update(updatemodel);
|
||||
// }
|
||||
|
||||
// });
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
|
|
@ -1933,4 +1952,54 @@ namespace New_College.Services
|
|||
|
||||
|
||||
}
|
||||
|
||||
public class HttpHelperPostRequest
|
||||
{
|
||||
|
||||
public int pageIndex { get; set; }
|
||||
}
|
||||
|
||||
public class HttpHelperPostobject
|
||||
{
|
||||
public basiclibResult 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 basiclibResult
|
||||
{
|
||||
public int totalCount { get; set; }
|
||||
public basiclibItem[] items { get; set; }
|
||||
}
|
||||
|
||||
public class basiclibItem
|
||||
{
|
||||
public int numId { get; set; }
|
||||
public string code { get; set; }
|
||||
public string gbCode { get; set; }
|
||||
public string cnName { get; set; }
|
||||
public string logoUrl { get; set; }
|
||||
public string natureType { get; set; }
|
||||
public string eduLevel { get; set; }
|
||||
public string belong { get; set; }
|
||||
public string[] categories { get; set; }
|
||||
public string[] features { get; set; }
|
||||
public string provinceCode { get; set; }
|
||||
public string provinceName { get; set; }
|
||||
public string cityName { get; set; }
|
||||
public int hits { get; set; }
|
||||
public int ranking { get; set; }
|
||||
public int rankingOfWSL { get; set; }
|
||||
public int rankingOfRK { get; set; }
|
||||
public int rankingOfXYH { get; set; }
|
||||
public int rankingOfQS { get; set; }
|
||||
public int rankingOfUSNews { get; set; }
|
||||
public int rankingOfEdu { get; set; }
|
||||
public float comScore { get; set; }
|
||||
public string id { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ namespace New_College.Services
|
|||
/// <returns></returns>
|
||||
public async Task<AIGOPageModel<AIGOResponse>> GetAIGoList(OneSubmitGoRequest request)
|
||||
{
|
||||
request.PageSize = request.PageSize > 20 ? 20 : request.PageSize;
|
||||
request.PageSize = request.PageSize > 200 ? 200 : request.PageSize;
|
||||
var claim = request.SubjectClaim.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||
|
||||
var pagemodel = new AIGOPageModel<AIGOResponse>();
|
||||
|
|
@ -140,7 +140,9 @@ namespace New_College.Services
|
|||
}).OrderByDescending(c => c.Type).OrderBy(c => c.LowScoreRank).ToList();
|
||||
|
||||
var _qualifcationlist = await _qualificationLineRepository.Query(c => SqlFunc.ContainsArray(universityarry, c.UId));
|
||||
responselist.ForEach(c =>
|
||||
|
||||
responselist = responselist.Where(e => e.planCount > 0).ToList();
|
||||
responselist.ToList().ForEach(c =>
|
||||
{
|
||||
c._fcount = c.iGoPlanMajorItems.Select(s => s.planCount).Sum();
|
||||
c._scount = c.iGoPlanMajorItems.Select(s => s.PlanItems.Where(w => w.Year == "2022").Sum(s => s.PlanCount)).Sum();
|
||||
|
|
|
|||
Loading…
Reference in New Issue