新增ESS端提交问卷信息接口

培训记录新增列冻结
master
xiaochanghai 3 months ago
parent 7311308540
commit 6ad4a82247
  1. 16
      Tiobon.Core.Model/ViewModels/Menu.cs
  2. 38
      Tiobon.Core.Services/CommonServices.cs
  3. 29
      Tiobon.Core.Services/Ghra/Ghra_TitleServices.cs
  4. 54
      Tiobon.Core.Services/Ghre/Ghre_SurveyServices.cs

@ -1,4 +1,6 @@
namespace Tiobon.Core.Model;
using Newtonsoft.Json.Linq;
namespace Tiobon.Core.Model;
public class MenuParam
{
@ -36,6 +38,16 @@ public class ModuleParam
public string timestamp { get; set; }
public string token { get; set; }
public ModulejsonParam jsonParam { get; set; }
private JObject _jsonParam;
public JObject jsonParam1
{
get { return _jsonParam; }
set
{
_jsonParam = value;
}
}
}
public class ModulejsonParam
{
@ -100,6 +112,7 @@ public class TableColumn
public int width { get; set; }
public string align { get; set; }
public string fixed1 { get; set; }
public bool? @fixed { get; set; }
public bool? editable { get; set; }
public bool? searchable { get; set; }
public bool? searchRequired { get; set; }
@ -147,6 +160,7 @@ public class TableColumn1
public string filterable { get; set; }
public int width { get; set; }
public string align { get; set; }
public bool? @fixed { get; set; }
public string fixed1 { get; set; }
public string editable { get; set; }
public string searchable { get; set; }

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using SqlSugar.Extensions;
using System.Text.RegularExpressions;
namespace Tiobon.Core.Services;
@ -784,7 +785,7 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
sql = @"select pageColumnID,elementType, field,label,meky, multipleSelect, dataType,
required, palceholder, dataSourceType,dataSource, sortable, sortOrder,
defaultHidden, ConfigIsShow, filterable, width,align, fixed,editable, searchable,
defaultHidden, ConfigIsShow, filterable, width,align,fixed fixed1,editable, searchable,
searchRequired,searchColumnSeq, multipleSearchValue, maxTagCount,
selfDefine, selectUI, isPrimaryKey,isSorted,isHidden,isSearched,sortNo,
( select ParaDetailNo operator,
@ -805,6 +806,7 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
result.JM_TableColumnT1.TableColumn = result.JM_TableColumnT1.TableColumn.Where(x => x.field != "DetailYN" && x.field != "Muti").ToList();
result.JM_TableColumnT1.TableColumn.ForEach(x =>
{
if (x.fixed1.IsNotEmptyOrNull()) x.@fixed = x.fixed1.ObjToBool();
if (!string.IsNullOrWhiteSpace(x.searchOperator1))
x.searchOperator = JsonConvert.DeserializeObject<List<searchOperator>>(x.searchOperator1);
x.searchOperator1 = null;
@ -2383,6 +2385,40 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
sort = column.SortNo;
result.JM_TableColumnT1.TableColumn = result.JM_TableColumnT1.TableColumn.Where(x => x.field != "Title_A01").ToList();
var titles = await Db.Queryable<Ghra_Title>().OrderBy(x => x.SortNo).ToListAsync();
if (param.jsonParam1 != null)
foreach (JProperty jProperty in param.jsonParam1.Properties())
{
var name = jProperty.Name;
var value = jProperty.Value.ToString();
if (name == "page" || name == "pageSize")
continue;
if (value.IsNotEmptyOrNull())
{
var jsonParam = JsonHelper.JsonToObj<JsonParam>(value);
switch (name)
{
case "TitleId":
switch (jsonParam.operationKey)
{
case "Include":
if (jsonParam.columnValue != null)
titles = titles.Where(x => x.TitleID == jsonParam.columnValue.ObjToInt()).ToList();
break;
case "NotInclude":
if (jsonParam.columnValue != null)
titles = titles.Where(x => x.TitleID != jsonParam.columnValue.ObjToInt()).ToList();
break;
default:
break;
}
break;
default:
break;
}
}
}
index = 0;
titles.ForEach(x =>
{

@ -1,4 +1,7 @@
namespace Tiobon.Core.Services;
using Tiobon.Core.Common;
using static StackExchange.Redis.Role;
namespace Tiobon.Core.Services;
/// <summary>
/// 岗位 (服务)
@ -28,7 +31,6 @@ public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, Insert
dynamic obj = new ExpandoObject();
dynamic result = new ExpandoObject();
var ruleSrc = Db.Queryable<Ghre_StudyRule>();
if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "Type ASC";
@ -52,6 +54,7 @@ public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, Insert
if (x.GradeId.IsNotEmptyOrNull())
x.GradeIds = JsonHelper.JsonToObj<List<int?>>(x.GradeId);
});
var titles = await Db.Queryable<Ghra_Title>().OrderBy(x => x.SortNo).ToListAsync();
#region 处理查询条件
//Expression<Func<Ghrh_Resume, bool>> whereExpression = new Expression<Func<Ghrh_Resume, bool>>();
@ -117,10 +120,12 @@ public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, Insert
case "Include":
if (jsonParam.columnValue != null)
rules = rules.Where(x => x.TitleIds.Contains(jsonParam.columnValue.ObjToInt())).ToList();
titles = titles.Where(x => x.TitleID == jsonParam.columnValue.ObjToInt()).ToList();
break;
case "NotInclude":
if (jsonParam.columnValue != null)
rules = rules.Where(x => !x.TitleIds.Contains(jsonParam.columnValue.ObjToInt())).ToList();
titles = titles.Where(x => x.TitleID != jsonParam.columnValue.ObjToInt()).ToList();
break;
case "IsNull":
rules = rules.Where(x => x.TitleIds.Count == 0).ToList();
@ -187,6 +192,22 @@ public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, Insert
rules = rules.Where(x => x.CourseId != jsonParam.columnValue.ObjToLong()).ToList();
sql += $" AND Id !={jsonParam.columnValue}";
break;
case "EqualAny"://
if (jsonParam.columnValue != null)
{
var ids1 = JsonHelper.JsonToObj<List<string>>(jsonParam.columnValue.ToString());
sql += $" AND Id IN ({string.Join(",", ids1.Select(id => "'" + id + "'"))})";
}
break;
case "NotEqualAny"://
if (jsonParam.columnValue != null)
{
var ids1 = JsonHelper.JsonToObj<List<string>>(jsonParam.columnValue.ToString());
sql += $" AND ( Id NOT IN ({string.Join(",", ids1.Select(id => "'" + id + "'"))}) OR {name} IS NULL)";
}
break;
default:
break;
@ -212,7 +233,8 @@ public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, Insert
ModuleParam param = new ModuleParam()
{
langId = filter.langId,
menuName = filter.menuName
menuName = filter.menuName,
jsonParam1 = filter.jsonParam
};
var module = await _commonServices.GetModuleInfoAsync(param);
var result1 = new ServicePageResult<TitleSkillMatrix>(filter.pageNum, totalCount, filter.pageSize, list);
@ -220,7 +242,6 @@ public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, Insert
var columns = new JArray();
var titles = await Db.Queryable<Ghra_Title>().OrderBy(x => x.SortNo).ToListAsync();
var dict = new Dictionary<string, List<int>>();

@ -1,4 +1,5 @@
using MathNet.Numerics.Distributions;
using Google.Protobuf.WellKnownTypes;
using MathNet.Numerics.Distributions;
using Tiobon.Core.Common;
namespace Tiobon.Core.Services;
@ -231,6 +232,14 @@ public class Ghre_SurveyServices : BaseServices<Ghre_Survey, Ghre_SurveyDto, Ins
case "Multiple":
case "MultipleScore":
question.Value1 = recordOptions.Where(x => x.SurveyQuestionId == question.Id).Select(x => x.OptionContent).ToList();
if (question.Options.Where(x => question.Value1.Contains(x.OptionNo) && x.IsOther == true).Any())
question.Options.ForEach(o =>
{
if (question.Value1.Contains(o.OptionNo) && o.IsOther == true)
o.OtherContent = recordOptions.Where(x => x.SurveyQuestionId == question.Id && x.SurveyQuestionOptionId == o.Id)
.Select(x => x.Reverse1).FirstOrDefault() ?? "";
});
break;
case "Single":
@ -238,8 +247,13 @@ public class Ghre_SurveyServices : BaseServices<Ghre_Survey, Ghre_SurveyDto, Ins
case "SingleScore":
case "Rate":
case "Scale":
question.Value = recordOptions.Where(x => x.SurveyQuestionId == question.Id).Select(x => x.OptionContent).Any() ? recordOptions.Where(x => x.SurveyQuestionId == question.Id).Select(x => x.OptionContent).FirstOrDefault() : "";
question.Value = recordOptions.Where(x => x.SurveyQuestionId == question.Id).Select(x => x.OptionContent).FirstOrDefault() ?? "";
if (question.Options.Where(x => x.OptionNo == question.Value && x.IsOther == true).Any())
question.Options.ForEach(o =>
{
if (o.OptionNo == question.Value && o.IsOther == true)
o.OtherContent = recordOptions.Where(x => x.SurveyQuestionId == question.Id).Select(x => x.Reverse1).FirstOrDefault() ?? "";
});
break;
default:
@ -314,19 +328,45 @@ public class Ghre_SurveyServices : BaseServices<Ghre_Survey, Ghre_SurveyDto, Ins
StaffId = App.User.StaffId,
Score = 0
};
option1.SurveyQuestionOptionId = question.Options.Where(x => x.OptionNo == question.Value1[j]).FirstOrDefault()?.Id;
var questionOption1 = question.Options.Where(x => x.OptionNo == question.Value1[j]).FirstOrDefault();
option1.SurveyQuestionOptionId = questionOption1?.Id;
option1.OptionContent = question.Value1[j];
if (questionOption1.IsOther == true)
option1.Reverse1 = questionOption1.OtherContent;
await Db.Insertable(option1).ExecuteReturnSnowflakeIdAsync();
}
break;
case "Single":
case "ShortAnswer":
case "SingleScore":
var option = new Ghre_SurveyRecordOption()
{
SurveyId = id,
SurveyRecordId = recordId,
SurveyRecordDetailId = recordDetailId,
SurveyQuestionId = question.Id,
//SurveyQuestionOptionId = x.Id,
StaffId = App.User.StaffId,
Score = 0
};
var questionOption = question.Options.Where(x => x.OptionNo == question.Value).FirstOrDefault();
option.SurveyQuestionOptionId = questionOption?.Id;
option.OptionContent = question.Value;
if (questionOption.IsOther == true)
option.Reverse1 = questionOption.OtherContent;
await Db.Insertable(option).ExecuteReturnSnowflakeIdAsync();
break;
case "Rate":
case "Scale":
var option = new Ghre_SurveyRecordOption()
case "ShortAnswer":
option = new Ghre_SurveyRecordOption()
{
SurveyId = id,
SurveyRecordId = recordId,
@ -336,7 +376,7 @@ public class Ghre_SurveyServices : BaseServices<Ghre_Survey, Ghre_SurveyDto, Ins
StaffId = App.User.StaffId,
Score = 0
};
option.SurveyQuestionOptionId = question.Options.Where(x => x.OptionNo == question.Value).FirstOrDefault()?.Id;
option.OptionContent = question.Value;
await Db.Insertable(option).ExecuteReturnSnowflakeIdAsync();

Loading…
Cancel
Save