diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_UshioPlanController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_UshioPlanController.cs index 5f671333..c81eb29b 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_UshioPlanController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_UshioPlanController.cs @@ -8,8 +8,11 @@ [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghre)] public class Ghre_UshioPlanController : BaseController { - public Ghre_UshioPlanController(IGhre_UshioPlanServices service) : base(service) + IGhre_PlanServices _planService; + public Ghre_UshioPlanController(IGhre_UshioPlanServices service, + IGhre_PlanServices planService) : base(service) { + _planService = planService; } #region 查询 @@ -33,9 +36,9 @@ public class Ghre_UshioPlanController : BaseController UpdateStatus(string status, [FromBody] InsertGhre_UshioPlanInput input) + public async Task UpdateStatus(string status, [FromBody] InsertGhre_PlanInput input) { - return await _service.UpdateStatus(input, status); + return await _planService.UpdateStatus(input, status); } #endregion diff --git a/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs b/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs index bc80436e..46d25e4b 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs @@ -693,7 +693,7 @@ FROM Ghre_Request A CreateProg, DeptNo, StaffNo, - LastUpdateDate,TrainStaffId,TrainClass,InOrOut,OutSideOrg) + LastUpdateDate,TrainStaffId,TrainClass,InOrOut) SELECT A.Id, A.RequestSource, c.DeptName, @@ -714,7 +714,7 @@ FROM Ghre_Request A SELECT ',' + S.StaffNo FROM OPENJSON(A.TrainStaffId) WITH (TrainStaffId INT '$') AS JsonData INNER JOIN Ghra_Staff S ON JsonData.TrainStaffId = S.StaffID - FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 1, '') AS StaffNames,A.TrainClass,A.InOrOut,SchoolId + FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 1, '') AS StaffNames,A.TrainClass,A.InOrOut FROM Ghre_Request A LEFT JOIN [120.26.205.42].[GhrUshio].[dbo].Ghre_GHR50Request B ON B.RequestID = A.Id diff --git a/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs b/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs index f0d5346b..83c3a351 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs @@ -1,6 +1,4 @@ -using Mysqlx.Crud; - -namespace Tiobon.Core.Services; +namespace Tiobon.Core.Services; /// /// 问卷题库 (服务) @@ -10,10 +8,12 @@ public class Ghre_SurveyQuestionPoolServices : BaseServices _dal; private IGhre_SurveyQuestionPoolOptionServices _ghre_SurveyQuestionPoolOptionServicesServices; public Ghre_SurveyQuestionPoolServices(IBaseRepository dal, + ICaching caching, IGhre_SurveyQuestionPoolOptionServices ghre_SurveyQuestionPoolOptionServices) { - this._dal = dal; base.BaseDal = dal; + base._caching = caching; + _ghre_SurveyQuestionPoolOptionServicesServices = ghre_SurveyQuestionPoolOptionServices; } @@ -37,6 +37,12 @@ public class Ghre_SurveyQuestionPoolServices : BaseServices + { + x.QuestionType = await GetParaLabel("QuestionType", x.QuestionType); + }); + + return result; } diff --git a/Tiobon.Core.Services/Ghre/Ghre_SurveyServices.cs b/Tiobon.Core.Services/Ghre/Ghre_SurveyServices.cs index 1f2df8ae..88c6ed1a 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_SurveyServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_SurveyServices.cs @@ -199,6 +199,8 @@ public class Ghre_SurveyServices : BaseServices> QueryESSData(long id, long? openClassId = null) { var entity = await base.QueryById(id); + + var data = Mapper.Map(entity).ToANew(); data.BeginEndTime.Add(data.BeginTime); @@ -218,13 +220,19 @@ public class Ghre_SurveyServices : BaseServices().Where(x => x.StaffId == App.User.StaffId && x.SurveyId == id).AnyAsync(); + data.IsSubmit = await Db.Queryable() + .Where(x => x.StaffId == App.User.StaffId && x.SurveyId == id) + .WhereIF(openClassId != null, x => x.OpenClassId == openClassId) + .AnyAsync(); #endregion #region 处理已提交信息 if (data.IsSubmit) { - var recordId = await Db.Queryable().Where(x => x.StaffId == App.User.StaffId && x.SurveyId == id).Select(x => x.Id).FirstAsync(); + var recordId = await Db.Queryable() + .Where(x => x.StaffId == App.User.StaffId && x.SurveyId == id) + .WhereIF(openClassId != null, x => x.OpenClassId == openClassId) + .Select(x => x.Id).FirstAsync(); var recordDetails = await Db.Queryable().Where(x => x.SurveyRecordId == recordId).ToListAsync(); var recordOptions = await Db.Queryable().Where(x => x.SurveyRecordId == recordId).OrderBy(x => x.OptionContent).ToListAsync();