From c4f3c01d1da536b241b2b754e859ad054a9f34f6 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Fri, 9 May 2025 09:51:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E6=8F=90=E4=BA=A4=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Api/Controllers/Ghre/Ghre_SurveyController.cs | 2 +- Tiobon.Core.IServices/Ghre/IGhre_SurveyServices.cs | 2 +- Tiobon.Core.Services/Ghre/Ghre_SurveyServices.cs | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_SurveyController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_SurveyController.cs index 80d8ad25..7e1717f4 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_SurveyController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_SurveyController.cs @@ -106,7 +106,7 @@ public class Ghre_SurveyController : BaseController /// [HttpPost("SubmitESSData/{openClassId}/{id}")] - public async Task SubmitESSDataFromOpenCLass(long id, [FromBody] Ghre_SurveyExtend input, long openClassId) => await _service.SubmitESSData(id, input); + public async Task SubmitESSDataFromOpenCLass(long id, [FromBody] Ghre_SurveyExtend input, long openClassId) => await _service.SubmitESSData(id, input, openClassId); #endregion diff --git a/Tiobon.Core.IServices/Ghre/IGhre_SurveyServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_SurveyServices.cs index b6bda78a..2cefe8ed 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_SurveyServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_SurveyServices.cs @@ -18,7 +18,7 @@ public interface IGhre_SurveyServices : IBaseServices> QueryESSData(long id, long? openClassId = null); - Task SubmitESSData(long id, Ghre_SurveyExtend input); + Task SubmitESSData(long id, Ghre_SurveyExtend input, long? openClassId = null); Task Publish(long id); diff --git a/Tiobon.Core.Services/Ghre/Ghre_SurveyServices.cs b/Tiobon.Core.Services/Ghre/Ghre_SurveyServices.cs index 88c6ed1a..52fb1681 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_SurveyServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_SurveyServices.cs @@ -280,13 +280,14 @@ public class Ghre_SurveyServices : BaseServices SubmitESSData(long id, Ghre_SurveyExtend input) + public async Task SubmitESSData(long id, Ghre_SurveyExtend input, long? openClassId = null) { var entity = await base.QueryById(id); var lastRecord = await Db.Queryable() .Where(x => x.StaffId == App.User.StaffId && x.SurveyId == id) + .WhereIF(openClassId != null, x => x.OpenClassId == openClassId) .FirstAsync(); var surveyRecordId = lastRecord?.Id; await Db.Updateable() @@ -318,7 +319,8 @@ public class Ghre_SurveyServices : BaseServices