|
|
@ -199,6 +199,8 @@ public class Ghre_SurveyServices : BaseServices<Ghre_Survey, Ghre_SurveyDto, Ins |
|
|
|
public async Task<ServiceResult<Ghre_SurveyExtend>> QueryESSData(long id, long? openClassId = null) |
|
|
|
public async Task<ServiceResult<Ghre_SurveyExtend>> QueryESSData(long id, long? openClassId = null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var entity = await base.QueryById(id); |
|
|
|
var entity = await base.QueryById(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var data = Mapper.Map(entity).ToANew<Ghre_SurveyExtend>(); |
|
|
|
var data = Mapper.Map(entity).ToANew<Ghre_SurveyExtend>(); |
|
|
|
|
|
|
|
|
|
|
|
data.BeginEndTime.Add(data.BeginTime); |
|
|
|
data.BeginEndTime.Add(data.BeginTime); |
|
|
@ -218,13 +220,19 @@ public class Ghre_SurveyServices : BaseServices<Ghre_Survey, Ghre_SurveyDto, Ins |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
#region 是否存在已提交问卷数据 |
|
|
|
#region 是否存在已提交问卷数据 |
|
|
|
data.IsSubmit = await Db.Queryable<Ghre_SurveyRecord>().Where(x => x.StaffId == App.User.StaffId && x.SurveyId == id).AnyAsync(); |
|
|
|
data.IsSubmit = await Db.Queryable<Ghre_SurveyRecord>() |
|
|
|
|
|
|
|
.Where(x => x.StaffId == App.User.StaffId && x.SurveyId == id) |
|
|
|
|
|
|
|
.WhereIF(openClassId != null, x => x.OpenClassId == openClassId) |
|
|
|
|
|
|
|
.AnyAsync(); |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
#region 处理已提交信息 |
|
|
|
#region 处理已提交信息 |
|
|
|
if (data.IsSubmit) |
|
|
|
if (data.IsSubmit) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var recordId = await Db.Queryable<Ghre_SurveyRecord>().Where(x => x.StaffId == App.User.StaffId && x.SurveyId == id).Select(x => x.Id).FirstAsync(); |
|
|
|
var recordId = await Db.Queryable<Ghre_SurveyRecord>() |
|
|
|
|
|
|
|
.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<Ghre_SurveyRecordDetail>().Where(x => x.SurveyRecordId == recordId).ToListAsync(); |
|
|
|
var recordDetails = await Db.Queryable<Ghre_SurveyRecordDetail>().Where(x => x.SurveyRecordId == recordId).ToListAsync(); |
|
|
|
var recordOptions = await Db.Queryable<Ghre_SurveyRecordOption>().Where(x => x.SurveyRecordId == recordId).OrderBy(x => x.OptionContent).ToListAsync(); |
|
|
|
var recordOptions = await Db.Queryable<Ghre_SurveyRecordOption>().Where(x => x.SurveyRecordId == recordId).OrderBy(x => x.OptionContent).ToListAsync(); |
|
|
|