From 46ef5955707862f9b16b3c1168cad3df6347d818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Tue, 7 May 2024 22:34:42 +0800 Subject: [PATCH] ww --- .../ViewModels/Result/OccupationResult.cs | 41 +++++++++++++++++++ New_College.Services/D_LongIdMapServices.cs | 18 +++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/New_College.Model/ViewModels/Result/OccupationResult.cs b/New_College.Model/ViewModels/Result/OccupationResult.cs index 715261e..15789df 100644 --- a/New_College.Model/ViewModels/Result/OccupationResult.cs +++ b/New_College.Model/ViewModels/Result/OccupationResult.cs @@ -206,6 +206,47 @@ namespace New_College.Model public string id { get; set; } } + + + public class UnImglistobject + { + public UnImglistResult 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 UnImglistResult + { + public int numId { get; set; } + public string code { get; set; } + public string cnName { get; set; } + public string provinceName { get; set; } + public string logoUrl { get; set; } + public string[] features { get; set; } + public int hits { get; set; } + public Url[] urls { get; set; } + } + + public class Url + { + public string description { get; set; } + public string url { get; set; } + public bool isBanner { get; set; } + } + + + + + + + + + + + public class Address { public string name { get; set; } diff --git a/New_College.Services/D_LongIdMapServices.cs b/New_College.Services/D_LongIdMapServices.cs index 9faac44..b474752 100644 --- a/New_College.Services/D_LongIdMapServices.cs +++ b/New_College.Services/D_LongIdMapServices.cs @@ -2082,7 +2082,22 @@ namespace New_College.Services 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(); + + + + if (universityimglist.Where(e => e.UniversityId == university.Id).Any() && universityimglist.Where(e => e.UniversityId == university.Id).Select(c => c.ImgList).Count() > 0) + { + models.Imglist = universityimglist.Where(e => e.UniversityId == university.Id).Select(c => c.ImgList).FirstOrDefault(); + } + else + { + var unimglist = HttpHelper.GetApi("http://192.168.104.104:3000/", "youzy.dms.basiclib.api.college.image.get?collegeCode=" + university.UniversityCode + "", ""); + if (unimglist != null && unimglist.isSuccess) + { + + models.Imglist = unimglist.result.urls.Select(c => c.url).ToList().ToJson(); + } + } models.VrUrl = universityimglist.Where(e => e.UniversityId == university.Id).Select(c => c.VRUrl).FirstOrDefault(); var baseinfo = tbinfo.Where(e => e.UniversityName == university.Name).FirstOrDefault(); @@ -2117,6 +2132,7 @@ namespace New_College.Services models.Belong = university.AscriptionName; } + 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) {