You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Tiobon.Web.Core/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs

147 lines
5.3 KiB

using Tiobon.Core.IServices;
using Tiobon.Core.Model.Models;
using Tiobon.Core.Services.BASE;
using Tiobon.Core.IRepository.Base;
using Tiobon.Core.Common.Caches;
using System.Dynamic;
using Tiobon.Core.Model;
using Tiobon.Core.Common;
using AgileObjects.AgileMapper;
using Newtonsoft.Json;
namespace Tiobon.Core.Services;
/// <summary>
/// 考试 (服务)
/// </summary>
public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhre_ExamInput, EditGhre_ExamInput>, IGhre_ExamServices
{
private readonly IBaseRepository<Ghre_Exam> _dal;
public Ghre_ExamServices(ICaching caching, IBaseRepository<Ghre_Exam> dal)
{
this._dal = dal;
base.BaseDal = dal;
base._caching = caching;
}
public dynamic GetModuleInfo(ModuleParam param)
{
dynamic result = new ExpandoObject();
dynamic data = new ExpandoObject();
var Toolbar = new List<Toolbar>();
Toolbar.Add(new Toolbar()
{
fnKey = "NewYN",
fnKeyValue = null,
fnTitle = "新增",
fnType = "table",
position = "left",
icon = "ghr-icon-add",
display = true
});
Toolbar.Add(new Toolbar()
{
fnKey = "Release",
fnKeyValue = null,
fnTitle = "发布",
fnType = "table",
position = "left",
icon = "ghr-publish",
display = true
});
var DT_Procedure = new DT_Procedure();
var sql = "select QueryProcedure, EditProcedure, IUDProcedure from Ghrs_Menu where MenuNo='{0}'";
sql = string.Format(sql, param.menuName, App.User.ID, param.langId);
var dt = Db.Ado.GetDataTable(sql);
if (dt.Rows.Count > 0)
{
DT_Procedure.QueryProcedure = dt.Rows[0]["QueryProcedure"].ToString();
DT_Procedure.EditProcedure = dt.Rows[0]["EditProcedure"].ToString();
DT_Procedure.IUDProcedure = dt.Rows[0]["IUDProcedure"].ToString();
}
sql = $@"SELECT PageSettingQueryId,
elementType,
field,
[dbo].[FLangKeyToValue] (Meky, {param.langId}, label)
label,
Meky,
multipleSelect,
dataType,
required,
palceholder,
dataSourceType,
dbo.FS_GetdataSourceBySet
(dataSource, APIDataSourceType, Ghrs_PageSettingQuery.APIDataSourceID)
dataSource,
sortable,
sortOrder,
defaultHidden,
ConfigIsShow,
filterable,
CAST(CASE WHEN width = '' THEN '100' ELSE width END AS INT) width,
align,
fixed,
editable,
searchable,
searchRequired,
searchColumnSeq,
multipleSearchValue,
maxTagCount,
selfDefine,
selectUI,
isPrimaryKey,
'false'
isSorted,
'false'
isHidden,
CASE
WHEN searchColumnSeq IS NULL OR searchColumnSeq = '' THEN 'false'
ELSE 'true'
END
isSearched,
SortNo,
-- searchCanOperator,
( select ParaDetailNo operator,
[dbo].[FLangKeyToValue](MKey,1,ParaDetailName) operatorDesc,
SqlFunction operatorIcon
from Ghrs_ParaDetail where ParaMasterId=13 and IsEnable=1
and ParaDetailNo in (select Value from dbo.Fs1_GHR30_SplitString2(searchCanOperator,','))
order by (select positon from dbo.Fs1_GHR30_SplitString2(searchCanOperator,',')
where value= ParaDetailNo)
FOR JSON Path ) searchOperator1,
''
searchColumnDefaultValue,
''
AppColumnType
FROM Ghrs_PageSettingQuery
WHERE PageNo = '{param.menuName}'
AND elementType NOT IN ('PageGroup')
AND IsEnable = 1
ORDER BY SortNo ASC";
sql = string.Format(sql, param.menuName, App.User.ID, param.langId);
var TableColumn = Db.Ado.SqlQuery<TableColumn1>(sql);
var SearchFormFields = Mapper.Map(TableColumn).ToANew<List<TableColumn>>();
SearchFormFields.ForEach(x =>
{
if (!string.IsNullOrWhiteSpace(x.searchOperator1))
x.searchOperator = JsonConvert.DeserializeObject<List<searchOperator>>(x.searchOperator1);
x.searchOperator1 = null;
});
data.Toolbar = Toolbar;
data.DT_Procedure = DT_Procedure;
data.SearchFormFields = SearchFormFields;
result.Success = true;
result.Status = 200;
result.Data = data;
result.Message = "查询成功";
return result;
}
}