xiaochanghai 2 months ago
commit d69d0bc481
  1. 2
      Tiobon.Core.Model/Base/Ghra/Ghra_StaffGroupDetail.Dto.Base.cs
  2. 2
      Tiobon.Core.Model/Models/Ghra/Ghra_StaffGroupDetail.cs
  3. 39
      Tiobon.Core.Services/Ghra/Ghra_StaffGroupServices.cs

@ -47,7 +47,7 @@ namespace Tiobon.Core.Model.Models
/// 字段所选值
/// </summary>
[Display(Name = "FieldValue"), Description("字段所选值"), MaxLength(-1, ErrorMessage = "字段所选值 不能超过 -1 个字符")]
public string FieldValue { get; set; }
public object FieldValue { get; set; }
/// <summary>
/// 备注

@ -49,7 +49,7 @@ namespace Tiobon.Core.Model.Models
/// 字段所选值
/// </summary>
[Display(Name = "FieldValue"), Description("字段所选值"), MaxLength(-1, ErrorMessage = "字段所选值 不能超过 -1 个字符")]
public string FieldValue { get; set; }
public object FieldValue { get; set; }
/// <summary>
/// 备注

@ -60,7 +60,23 @@ namespace Tiobon.Core.Services
var StaffGroupDetail = await _StaffGroupDetailServices.Query(x => x.StaffGroupID == body.id);
result.result.DT_TableDataT1[0].StaffGroupDetail = StaffGroupDetail.OrderBy(x => x.SortNo).ToList();
result.result.DT_TableDataT1[0].StaffGroupDetail.ForEach((x) =>
{
if (x.FieldValue != null)
{
if (JsonHelper.IsJson(x.FieldValue.ToString()))
{
try
{
x.FieldValue = JsonHelper.JsonToObj<List<int>>(x.FieldValue.ToString());
}
catch (Exception)
{
x.FieldValue = JsonHelper.JsonToObj<List<string>>(x.FieldValue.ToString());
}
}
}
});
if (body.doType == "Copy")
{
result.result.DT_TableDataT1[0].StaffGroupNo = null;
@ -72,12 +88,14 @@ namespace Tiobon.Core.Services
{
var result = await base.QueryFilterPage(filter, condition, IsEnable);
//var a = await _StaffGroupDetailServices.Query();
//result.result.DT_TableDataT1.ForEach(async x =>
//{
// x.DetailInfo = (await _StaffGroupDetailServices.Query(a => a.StaffGroupID == x.Id))
// .Select(a => a.StaffField).ToString();
//});
result.result.DT_TableDataT1.ForEach(async x =>
{
x.DetailInfo = Db.Ado.SqlQuerySingle<string>($@"select stuff((select distinct ',' + (select top 1 dbo.FLangKeyToValue(MKey,1,StaffInfoColumnName) from Ghra_StaffInfoColumn where IsEnable=1 and StaffInfoGroupId = 1 and IsRelease = 1 and StaffInfoColumnNo=a.StaffField)
from Ghra_StaffGroupDetail a
where StaffGroupID = {x.Id}
for XML path(''),type).value('.','nvarchar(max)'),1,1,'')");
});
return result;
}
@ -92,7 +110,7 @@ namespace Tiobon.Core.Services
else '' end dataSourceType,
dbo.FS_GetdataSourceBySet('',DataSourceType, DataSource) dataSource ,
case when ColumnType in ('OrgTreeSelect','ApiSelect','StaffSelect') then 1
else 0 end multipleSelect,
else 0 end multipleSelectInt,
(select ParaDetailNo operatorNo,ParaDetailName operatorDesc,SqlFunction operatorIcon,SortNo
from Ghrs_ParaDetail where IsEnable= 1
and ParaDetailNo in (select value from dbo.Fs1_GHR30_SplitString(case when ColumnType in ('OrgTreeSelect','ApiSelect','StaffSelect')
@ -129,10 +147,11 @@ namespace Tiobon.Core.Services
public string StaffInfoColumnNo { get; set; }
public string StaffInfoColumnName { get; set; }
public string elementType { get; set; }
public string dataType { get; set; }
public string dataSourceType { get; set; }
public string dataSource { get; set; }
public int multipleSelect { get; set; }
public int multipleSelectInt { get; set; }
public bool multipleSelect => multipleSelectInt == 1 ? true : false;
public string OperatorDataStr { get; set; }
public List<OperatorData> operatorData { get; set; }
}

Loading…
Cancel
Save