From ff751a0cb789ae9c0c28e927a86b5353a2f34388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Thu, 4 Jan 2024 14:43:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=BF=97=E6=84=BF=20bug=20fi?= =?UTF-8?q?xed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Back/D_PlanMajorDescController.cs | 8 +++++++- .../Controllers/Front/PcVolunteerController.cs | 2 +- New_College.Api/Controllers/HealthCheckController.cs | 6 +++--- New_College.Services/D_LongIdMapServices.cs | 6 +++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs b/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs index d182316..e6b294e 100644 --- a/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs +++ b/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs @@ -278,11 +278,17 @@ namespace New_College.Api.Controllers } if (id > 0 && itemIds == vollunterrrequest.volunteerTableDetailViews.Count() && itemIds > 0) { - _unitOfWork.BeginTran(); + _unitOfWork.CommitTran(); } else { _unitOfWork.RollbackTran(); + return new MessageModel() + { + success = false, + response = -1, + msg = "无数据" + }; } return new MessageModel() { diff --git a/New_College.Api/Controllers/Front/PcVolunteerController.cs b/New_College.Api/Controllers/Front/PcVolunteerController.cs index 4c86c54..9a9f936 100644 --- a/New_College.Api/Controllers/Front/PcVolunteerController.cs +++ b/New_College.Api/Controllers/Front/PcVolunteerController.cs @@ -256,7 +256,7 @@ namespace New_College.Api.Controllers.Front } if (id > 0 && itemIds == request.volunteerTableDetailViews.Count() && itemIds > 0) { - _unitOfWork.BeginTran(); + _unitOfWork.CommitTran(); } else { diff --git a/New_College.Api/Controllers/HealthCheckController.cs b/New_College.Api/Controllers/HealthCheckController.cs index d30cd33..cc43a90 100644 --- a/New_College.Api/Controllers/HealthCheckController.cs +++ b/New_College.Api/Controllers/HealthCheckController.cs @@ -64,10 +64,10 @@ namespace New_College.Controllers // return t_EnrollmentPlane.categoryupdate(); + // return d_LongIdMapServices.UpdateUniveristyInf(); + // return d_LongIdMapServices.Import(); - // return d_LongIdMapServices.Import(); - - return d_LongIdMapServices.UpdatePlanProInf(); + return d_LongIdMapServices.UpdatePlanProInf(); } } diff --git a/New_College.Services/D_LongIdMapServices.cs b/New_College.Services/D_LongIdMapServices.cs index 6a8c8df..47cea7f 100644 --- a/New_College.Services/D_LongIdMapServices.cs +++ b/New_College.Services/D_LongIdMapServices.cs @@ -1949,7 +1949,7 @@ namespace New_College.Services // await d_UniversityRepository.Update(a); // } //}); - var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023); + var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023 && c.IsDelete == false && c.UId <= 0); info.ForEach(async a => { var pplist = plist.Where(ee => ee.UniversityName == a.Name).ToList(); @@ -1971,7 +1971,7 @@ namespace New_College.Services }); if (pplist.Any() && pplist.Count() > 0) { - this._PlanMajorDescRepository.Batchupdate(pplist); + await this._PlanMajorDescRepository.Batchupdate(pplist); } }); @@ -1985,7 +1985,7 @@ namespace New_College.Services public async Task UpdatePlanProInf() { var tbinfo = await t_TbSNeedDataInfoRepository.Query(); - var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023 && c.IsDelete == false); + var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023 && c.IsDelete == false && c.UId <= 0); plist.ForEach(p => { var newmodel = tbinfo.Where(e => e.EnrollmentCode == p.EnrollmentCode && e.MajorCode == p.MajorCode).FirstOrDefault();