bug fixed

develop
old易 2024-01-04 10:43:55 +08:00
parent 50d130f34f
commit ab5dfc7cfc
12 changed files with 168 additions and 49 deletions

View File

@ -65,9 +65,9 @@ namespace New_College.Controllers
return d_LongIdMapServices.Import();
// return d_LongIdMapServices.Import();
// return d_LongIdMapServices.UpdateUniveristyInf();
return d_LongIdMapServices.UpdatePlanProInf();
}
}

View File

@ -605,6 +605,11 @@
批次
</summary>
</member>
<member name="P:New_College.Model.Models.D_PlanMajorDesc.BatchItemName">
<summary>
</summary>
</member>
<member name="P:New_College.Model.Models.D_PlanMajorDesc.SelectSubject">
<summary>
选科要求
@ -630,6 +635,16 @@
专业备注
</summary>
</member>
<member name="P:New_College.Model.Models.D_PlanMajorDesc.ReName">
<summary>
专业别名(页面展示需要)
</summary>
</member>
<member name="P:New_College.Model.Models.D_PlanMajorDesc.BookPageNo">
<summary>
内容所在书页码
</summary>
</member>
<member name="P:New_College.Model.Models.D_PlanMajorDesc.LowScore">
<summary>
最低分

View File

@ -97,7 +97,7 @@
"DBType": 0,
"Enabled": true,
"HitRate": 20,
"Connection": "Server=192.168.103.102; Port=3306;SslMode=None;Database=volunteerapp; Uid=ycymedu; Pwd=Vs..127134;CharSet=utf8mb4"
"Connection": "Server=192.168.103.102; Port=3306;SslMode=None;Database=volunteerapp; Uid=ycymedu; Pwd=Vs..127134;CharSet=utf8mb4;AllowLoadLocalInfile=true"
},
{
"ConnId": "WMBLOG_ORACLE",

View File

@ -46,7 +46,7 @@ namespace New_College.Extensions
ConnectionString = m.Connection,
DbType = (DbType)m.DbType,
IsAutoCloseConnection = true,
IsShardSameThread = false,
// IsShardSameThread = false,
AopEvents = new AopEvents
{
OnLogExecuting = (sql, p) =>

View File

@ -13,6 +13,7 @@ namespace New_College.IServices
/// </summary>
public interface ID_LongIdMapServices : IBaseServices<D_LongIdMap>
{
Task<bool> UpdatePlanProInf();
Task<bool> Import();
Task<bool> UpdateUniveristyInf();

View File

@ -70,6 +70,12 @@ namespace New_College.Model.Models
///批次
/// </summary>
public string BatchName { get; set; }
/// <summary>
///
/// </summary>
public string BatchItemName { get; set; }
/// <summary>
/// 选科要求
/// </summary>
@ -99,6 +105,17 @@ namespace New_College.Model.Models
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 专业别名(页面展示需要)
/// </summary>
public string ReName { get; set; }
/// <summary>
/// 内容所在书页码
/// </summary>
public string BookPageNo { get; set; }
public string MajorCode { get; set; }

View File

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="sqlSugarCore" Version="5.0.0.15" />
<PackageReference Include="sqlSugarCore" Version="5.1.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

View File

@ -213,7 +213,7 @@ namespace New_College.Model.Seed
{
//DataInfoCacheService = new HttpRuntimeCache()
},
IsShardSameThread = blnIsShardSameThread
// IsShardSameThread = blnIsShardSameThread
};
return config;
}

View File

@ -2,16 +2,36 @@
using New_College.IRepository.UnitOfWork;
using New_College.Model.Models;
using New_College.Repository.Base;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
namespace New_College.Repository
{
/// <summary>
/// D_PlanMajorDescRepository
/// </summary>
/// <summary>
/// D_PlanMajorDescRepository
/// </summary>
public class D_PlanMajorDescRepository : BaseRepository<D_PlanMajorDesc>, ID_PlanMajorDescRepository
{
public D_PlanMajorDescRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
}
/// <summary>
///
/// </summary>
/// <param name="majorDescs"></param>
/// <returns></returns>
public async Task<bool> Batchupdate(List<D_PlanMajorDesc> majorDescs)
{
// int k = this.Db.Updateable(majorDescs).ExecuteCommand();
// this.Db.Fastest<D_PlanMajorDesc>().BulkUpdate(GetList()) //适合大批量更新
var kk = await this.Db.Fastest<D_PlanMajorDesc>().BulkUpdateAsync(majorDescs);
return kk > 0;
}
}
}

View File

@ -1,5 +1,7 @@
using New_College.IRepository.Base;
using New_College.Model.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace New_College.IRepository
{
@ -8,5 +10,11 @@ namespace New_College.IRepository
/// </summary>
public interface ID_PlanMajorDescRepository : IBaseRepository<D_PlanMajorDesc>
{
/// <summary>
/// 批量更新数据
/// </summary>
/// <param name="majorDescs"></param>
/// <returns></returns>
Task<bool> Batchupdate(List<D_PlanMajorDesc> majorDescs);
}
}

View File

@ -1860,21 +1860,21 @@ namespace New_College.Services
var category = undetail.result.categories.ToList();
//if (category.Contains("医药"))
//{
// updatemodel.Type = UniversityTypeRelsove.GetTypeName("医药");
// 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);
// }
//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);
// }
}
});
@ -1919,38 +1919,94 @@ namespace New_College.Services
/// <returns></returns>
public async Task<bool> UpdateUniveristyInf()
{
var tbinfo = await t_TbSNeedDataInfoRepository.Query();
// var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023);
// var tbinfo = await t_TbSNeedDataInfoRepository.Query();
// var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023);
var info = await d_UniversityRepository.Query();
var infoimg = await d_UniversityimgRepository.Query();
//var infoimg = await d_UniversityimgRepository.Query();
//info.ForEach(async a =>
//{
// if (tbinfo.Where(e => e.UniversityName == a.Name).Any())
// {
// var baseinfo = tbinfo.Where(e => e.UniversityName == a.Name).FirstOrDefault();
// var imginfo = infoimg.FirstOrDefault(o => o.UniversityId == a.Id);
// if (!string.IsNullOrWhiteSpace(baseinfo.VRUrl)&& imginfo!=null)
// {
// imginfo.VRUrl = baseinfo.VRUrl;
// await d_UniversityimgRepository.Update(imginfo);
// }
// if (baseinfo.LnstitutionalLevel != null)
// {
// a.Sff = baseinfo.LnstitutionalLevel.Contains("211") ? 0 : 1;
// a.Syl = baseinfo.LnstitutionalLevel.Contains("双一流") ? 0 : 1;
// a.QJJH = baseinfo.LnstitutionalLevel.Contains("强基") ? 0 : 1;
// a.Nhef = baseinfo.LnstitutionalLevel.Contains("985") ? 0 : 1;
// }
// //a.Doctorate_Count = int.Parse(baseinfo.PhDPoint);
// //a.Master_Count = int.Parse(baseinfo.MastersDegree);
// a.Nature = baseinfo.Nature.Contains("公办") ? 0 : baseinfo.Nature.Contains("民办") ? 1 : baseinfo.Nature.Contains("中外合作") ? 2 : baseinfo.Nature.Contains("港澳台") ? 3 : -1;
// a.Subject_Level = baseinfo.EducationCategory == "本科" ? 0 : 1;
// await d_UniversityRepository.Update(a);
// }
//});
var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023);
info.ForEach(async a =>
{
if (tbinfo.Where(e => e.UniversityName == a.Name).Any())
var pplist = plist.Where(ee => ee.UniversityName == a.Name).ToList();
pplist.ForEach(c =>
{
var baseinfo = tbinfo.Where(e => e.UniversityName == a.Name).FirstOrDefault();
var imginfo = infoimg.FirstOrDefault(o => o.UniversityId == a.Id);
if (!string.IsNullOrWhiteSpace(baseinfo.VRUrl)&& imginfo!=null)
{
imginfo.VRUrl = baseinfo.VRUrl;
await d_UniversityimgRepository.Update(imginfo);
}
if (baseinfo.LnstitutionalLevel != null)
{
a.Sff = baseinfo.LnstitutionalLevel.Contains("211") ? 0 : 1;
a.Syl = baseinfo.LnstitutionalLevel.Contains("双一流") ? 0 : 1;
a.QJJH = baseinfo.LnstitutionalLevel.Contains("强基") ? 0 : 1;
a.Nhef = baseinfo.LnstitutionalLevel.Contains("985") ? 0 : 1;
}
//a.Doctorate_Count = int.Parse(baseinfo.PhDPoint);
//a.Master_Count = int.Parse(baseinfo.MastersDegree);
a.Nature = baseinfo.Nature.Contains("公办") ? 0 : baseinfo.Nature.Contains("民办") ? 1 : baseinfo.Nature.Contains("中外合作") ? 2 : baseinfo.Nature.Contains("港澳台") ? 3 : -1;
a.Subject_Level = baseinfo.EducationCategory == "本科" ? 0 : 1;
await d_UniversityRepository.Update(a);
c.UId = a.Id;
c.AreaName = a.Area_Name;
c.Rank = a.Rank.ToString();
c._985 = a.Nhef == 1 ? "是" : "否";
c._SYL = a.Syl == 1 ? "是" : "否";
c._211 = a.Sff == 1 ? "是" : "否";
c.Nature = a.Nature == 0 ? "公办" : a.Nature == 1 ? "民办" : a.Nature == 2 ? "中外合作办学" : "港澳台";
c.ReName = c.Major;
c.Remark = "(" + c.Major.Remove(c.Major.Length - 1, 1).Replace(c.Major.Split("(")[0], "");
c.Major = c.Major.Split("(")[0];
});
if (pplist.Any() && pplist.Count() > 0)
{
this._PlanMajorDescRepository.Batchupdate(pplist);
}
});
return true;
}
/// <summary>
/// 更新招生计划数据
/// </summary>
/// <returns></returns>
public async Task<bool> UpdatePlanProInf()
{
var tbinfo = await t_TbSNeedDataInfoRepository.Query();
var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023 && c.IsDelete == false);
plist.ForEach(p =>
{
var newmodel = tbinfo.Where(e => e.EnrollmentCode == p.EnrollmentCode && e.MajorCode == p.MajorCode).FirstOrDefault();
if (newmodel != null)
{
p.CityName = newmodel.City;
p.EducationCategory = newmodel.EducationCategory;
// p.EnrollmentCode = newmodel.EnrollmentCode;
p.EnrollmentType = newmodel.EnrollmentType;
//p.SchoolType=newmodel.sch
p.FirstType = newmodel.FirstType;
p.Nature = newmodel.Nature;
p.Ownership = newmodel.Ownership;
p.LowScore = int.Parse(newmodel._23Score);
p.LowScoreRank = int.Parse(newmodel._23ScoreLine);
}
});
await this._PlanMajorDescRepository.Batchupdate(plist);
return true;
}
@ -1960,6 +2016,8 @@ namespace New_College.Services
// #region 院校排序
/// <summary>
/// 院校排序

View File

@ -115,8 +115,8 @@ namespace New_College.Services
// SubjectClam = c.SelectSubject,
Type = MajorPlanScoreTool.GetPlanScore(c.LowScore, request.Score),//冲稳保院校
Percentage = MajorPlanScoreTool.GetPlanPercentage(c.LowScore, request.Score),
//planCount = list.Where(w => w.Years == DateTime.Now.Year && w.UId == c.UId).Sum(c => c.PlanCount),
iGoPlanMajorItems = list.Where(w => w.Years == (DateTime.Now.Year-1) && w.UId == c.UId).Select(t => new AIGoPlanMajorItem()
planCount = list.Where(w => w.Years == DateTime.Now.Year && w.UId == c.UId).Sum(c => c.PlanCount),
iGoPlanMajorItems = list.Where(w => w.Years == DateTime.Now.Year && w.UId == c.UId).Select(t => new AIGoPlanMajorItem()
{
PlanId = t.Id,
MajorCode = t.MajorCode,
@ -268,7 +268,7 @@ namespace New_College.Services
Type = MajorPlanScoreTool.GetPlanScore(c.LowScore, request.Score),//还缺冲稳保
Percentage = MajorPlanScoreTool.GetPlanPercentage(c.LowScore, request.Score),
PlanId = c.Id,
UniversityCode = UniversityCodeConvertRules.UniversityCodeConvertRulesMap(c.EnrollmentCode),
UniversityCode = c.EnrollmentCode,
collegeCode = c.EnrollmentCode,
MajorCode = c.MajorCode,
LowScoreRank = c.LowScoreRank,