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> </summary>
</member> </member>
<member name="P:New_College.Model.Models.D_PlanMajorDesc.BatchItemName">
<summary>
</summary>
</member>
<member name="P:New_College.Model.Models.D_PlanMajorDesc.SelectSubject"> <member name="P:New_College.Model.Models.D_PlanMajorDesc.SelectSubject">
<summary> <summary>
选科要求 选科要求
@ -630,6 +635,16 @@
专业备注 专业备注
</summary> </summary>
</member> </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"> <member name="P:New_College.Model.Models.D_PlanMajorDesc.LowScore">
<summary> <summary>
最低分 最低分

View File

@ -97,7 +97,7 @@
"DBType": 0, "DBType": 0,
"Enabled": true, "Enabled": true,
"HitRate": 20, "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", "ConnId": "WMBLOG_ORACLE",

View File

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

View File

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

View File

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

View File

@ -15,7 +15,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <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" /> <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup> </ItemGroup>

View File

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

View File

@ -2,6 +2,9 @@
using New_College.IRepository.UnitOfWork; using New_College.IRepository.UnitOfWork;
using New_College.Model.Models; using New_College.Model.Models;
using New_College.Repository.Base; using New_College.Repository.Base;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
namespace New_College.Repository namespace New_College.Repository
{ {
@ -13,5 +16,22 @@ namespace New_College.Repository
public D_PlanMajorDescRepository(IUnitOfWork unitOfWork) : base(unitOfWork) 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.IRepository.Base;
using New_College.Model.Models; using New_College.Model.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace New_College.IRepository namespace New_College.IRepository
{ {
@ -8,5 +10,11 @@ namespace New_College.IRepository
/// </summary> /// </summary>
public interface ID_PlanMajorDescRepository : IBaseRepository<D_PlanMajorDesc> public interface ID_PlanMajorDescRepository : IBaseRepository<D_PlanMajorDesc>
{ {
/// <summary>
/// 批量更新数据
/// </summary>
/// <param name="majorDescs"></param>
/// <returns></returns>
Task<bool> Batchupdate(List<D_PlanMajorDesc> majorDescs);
} }
} }

View File

@ -1919,38 +1919,94 @@ namespace New_College.Services
/// <returns></returns> /// <returns></returns>
public async Task<bool> UpdateUniveristyInf() public async Task<bool> UpdateUniveristyInf()
{ {
var tbinfo = await t_TbSNeedDataInfoRepository.Query(); // var tbinfo = await t_TbSNeedDataInfoRepository.Query();
// var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023); // var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023);
var info = await d_UniversityRepository.Query(); 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 => 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); c.UId = a.Id;
if (!string.IsNullOrWhiteSpace(baseinfo.VRUrl)&& imginfo!=null) 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)
{ {
imginfo.VRUrl = baseinfo.VRUrl; this._PlanMajorDescRepository.Batchupdate(pplist);
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);
} }
}); });
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; return true;
} }
@ -1960,6 +2016,8 @@ namespace New_College.Services
// #region 院校排序 // #region 院校排序
/// <summary> /// <summary>
/// 院校排序 /// 院校排序

View File

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