@ -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,18 +88,20 @@ 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 ;
}
public async Task < ServiceResult < object > > GetStaffInfoColumnData ( )
{
public async Task < ServiceResult < object > > GetStaffInfoColumnData ( )
{
string sql = @ $ "select StaffInfoColumnNo,
dbo . FLangKeyToValue ( MKey , 1 , StaffInfoColumnName ) StaffInfoColumnName ,
ColumnType elementType ,
@ -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 ' )
@ -115,33 +133,34 @@ namespace Tiobon.Core.Services
and StaffInfoGroupId = 1
and IsRelease = 1
and StaffInfoColumnNo ! = ' AttachmentIDs ' ";
var result = Db . Ado . SqlQuery < StaffInfoColumn > ( sql ) ;
result . ForEach ( x = >
result . ForEach ( x = >
{
x . operatorData = JsonConvert . DeserializeObject < List < OperatorData > > ( x . OperatorDataStr ) ;
x . operatorData = JsonConvert . DeserializeObject < List < OperatorData > > ( x . OperatorDataStr ) ;
} ) ;
return ServiceResult < object > . OprateSuccess ( "查询成功!" , result ) ;
}
public class StaffInfoColumn ( )
public class StaffInfoColumn ( )
{
public string StaffInfoColumnNo { get ; set ; }
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 ; }
public List < OperatorData > operatorData { get ; set ; }
}
public class OperatorData ( )
{
public string operatorNo { get ; set ; }
public string ParaDetailName { get ; set ; }
public string operatorIcon { get ; set ; }
public string SortNo { get ; set ; }
public string SortNo { get ; set ; }
}
}