|
|
|
@ -2,6 +2,7 @@ |
|
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
|
using SqlSugar; |
|
|
|
|
using Tiobon.Core.Common; |
|
|
|
|
using Tiobon.Core.Common.DB.Dapper; |
|
|
|
|
using Tiobon.Core.IServices; |
|
|
|
@ -20,7 +21,6 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon |
|
|
|
|
_httpContextAccessor = httpContextAccessor; |
|
|
|
|
} |
|
|
|
|
#region 获取菜单 |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 获取菜单 |
|
|
|
|
/// </summary> |
|
|
|
@ -83,7 +83,590 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return new ServiceResult<MenuReturn>() { Success = true, Message = "查询成功", Data = result, }; |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 获取模块信息 |
|
|
|
|
/// <summary> |
|
|
|
|
/// 获取模块信息 |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="param"></param> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
public async Task<ServiceResult<ModuleReturn>> GetModuleInfoAsync([FromBody] ModuleParam param) |
|
|
|
|
{ |
|
|
|
|
var result = new ModuleReturn(); |
|
|
|
|
|
|
|
|
|
#region 定义页面的操作按钮 |
|
|
|
|
string sql = @"SELECT fnKey,
|
|
|
|
|
fnKeyValue, |
|
|
|
|
[dbo].[FLangKeyToValue] (fnKeyValue, {2}, fnKeyValue) fnTitle, |
|
|
|
|
fnType, |
|
|
|
|
position, |
|
|
|
|
icon, |
|
|
|
|
'true' display |
|
|
|
|
FROM (SELECT CASE |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'NewYN' THEN 1 |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'ToExcelYN' THEN 2 |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'FromExcelYN' THEN 3 |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'BatchUpdateYN' THEN 4 |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'BatchDelYN' THEN 5 |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'LogYN' THEN 6 |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'ManualYN' THEN 7 |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'UpdateYN' THEN 2 |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'DelYN' THEN 4 |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'CopyYN' THEN 3 |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'DetailYN' THEN 1 |
|
|
|
|
ELSE 8 |
|
|
|
|
END fnKeySeq, |
|
|
|
|
substring (fnKey, 3, 99) + 'YN' fnKey, |
|
|
|
|
'Ghr_FnKey_' + fnKey fnKeyValue, |
|
|
|
|
CASE |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' IN ('NewYN', |
|
|
|
|
'ToExcelYN', |
|
|
|
|
'FromExcelYN', |
|
|
|
|
'BatchUpdateYN', |
|
|
|
|
'BatchDelYN', |
|
|
|
|
'RecycleYN', |
|
|
|
|
'CancelRecycleYN', |
|
|
|
|
'ManualYN', |
|
|
|
|
'LogYN', |
|
|
|
|
'BatchDelYN', |
|
|
|
|
'BatchUpdateYN') |
|
|
|
|
THEN |
|
|
|
|
'table' |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' IN ('UpdateYN', |
|
|
|
|
'DelYN', |
|
|
|
|
'CopyYN', |
|
|
|
|
'DetailYN') |
|
|
|
|
THEN |
|
|
|
|
'row' |
|
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' IN ('QueryYN', |
|
|
|
|
'AdvanceQueryYN', |
|
|
|
|
'QuerySettingYN', |
|
|
|
|
'') |
|
|
|
|
THEN |
|
|
|
|
'search' |
|
|
|
|
ELSE |
|
|
|
|
'' |
|
|
|
|
END fnType, |
|
|
|
|
'left' position, |
|
|
|
|
CASE substring (fnKey, 3, 99) + 'YN' |
|
|
|
|
WHEN 'NewYN' THEN 'ghr-icon-add' |
|
|
|
|
WHEN 'ToExcelYN' THEN 'ghr-file-export' |
|
|
|
|
WHEN 'FromExcelYN' THEN 'ghr-file-import' |
|
|
|
|
WHEN 'UpdateYN' THEN 'ghr-icon-edit' |
|
|
|
|
WHEN 'BatchUpdateYN' THEN 'ghr-batch-update' |
|
|
|
|
WHEN 'DelYN' THEN 'ghr-icon-trash' |
|
|
|
|
WHEN 'BatchDelYN' THEN 'ghr-batch-del' |
|
|
|
|
WHEN 'LogYN' THEN 'ghr-log' |
|
|
|
|
WHEN 'ManualYN' THEN 'ghr-operation-manual' |
|
|
|
|
WHEN 'CopyYN' THEN 'ghr-icon-copy' |
|
|
|
|
WHEN 'DetailYN' THEN 'ghr-icon-eye-open' |
|
|
|
|
ELSE '' |
|
|
|
|
END icon |
|
|
|
|
FROM (SELECT max (c.IsWaterMark) IsWaterMark, |
|
|
|
|
max (c.IsPWDAgain) IsPWDAgain, |
|
|
|
|
max (c.IsFromExcel) IsFromExcel, |
|
|
|
|
max (c.IsToExcel) IsToExcel, |
|
|
|
|
max (c.IsNew) IsNew, |
|
|
|
|
max (c.IsDetail) IsDetail, |
|
|
|
|
max (c.IsDel) IsDel, |
|
|
|
|
max (c.IsDel) IsBatchDel, |
|
|
|
|
max (c.IsUpdate) IsUpdate, |
|
|
|
|
max (c.IsUpdate) IsBatchUpdate, |
|
|
|
|
max (c.IsQuery) IsQuery, |
|
|
|
|
max (c.IsPrint) IsPrint, |
|
|
|
|
0 IsLog, |
|
|
|
|
max (c.IsManual) IsManual, |
|
|
|
|
max (c.IsCopy) IsCopy |
|
|
|
|
FROM Ghrs_UserRole a, Ghrs_RoleMenu c, Ghrs_Menu d |
|
|
|
|
WHERE a.IsEnable = 1 |
|
|
|
|
AND c.IsEnable = 1 |
|
|
|
|
AND d.IsEnable = 1 |
|
|
|
|
AND EXISTS |
|
|
|
|
(SELECT 1 |
|
|
|
|
FROM Ghrs_Role kk |
|
|
|
|
WHERE kk.roleid = a.roleid AND kk.IsEnable = 1) |
|
|
|
|
AND a.UserID = '{1}' |
|
|
|
|
AND a.RoleId = c.RoleID |
|
|
|
|
AND c.MenuId = d.MenuId |
|
|
|
|
AND d.MenuNo = '{0}') kk |
|
|
|
|
UNPIVOT (fnKeyValue |
|
|
|
|
FOR fnKey |
|
|
|
|
IN (IsWaterMark, |
|
|
|
|
IsPWDAgain, |
|
|
|
|
IsFromExcel, |
|
|
|
|
IsToExcel, |
|
|
|
|
IsNew, |
|
|
|
|
IsDetail, |
|
|
|
|
IsUpdate, |
|
|
|
|
IsDel, |
|
|
|
|
IsQuery, |
|
|
|
|
IsPrint, |
|
|
|
|
IsLog, |
|
|
|
|
IsManual, |
|
|
|
|
IsCopy, |
|
|
|
|
IsBatchUpdate, |
|
|
|
|
IsBatchDel)) AS tt |
|
|
|
|
WHERE fnKeyValue > 0 |
|
|
|
|
UNION ALL |
|
|
|
|
SELECT NULL fnKeySeq, |
|
|
|
|
'QuerySettingYN' fnKey, |
|
|
|
|
'GHR_Common_000064' fnTitle, |
|
|
|
|
'search' fnType, |
|
|
|
|
'left' position, |
|
|
|
|
NULL icon |
|
|
|
|
UNION ALL |
|
|
|
|
SELECT NULL fnKeySeq, |
|
|
|
|
'LabelYN' fnKey, |
|
|
|
|
'GHR_Common_000065' fnTitle, |
|
|
|
|
NULL fnType, |
|
|
|
|
NULL position, |
|
|
|
|
NULL icon |
|
|
|
|
UNION ALL |
|
|
|
|
SELECT NULL fnKeySeq, |
|
|
|
|
'MoreStyleYN' fnKey, |
|
|
|
|
'GHR_Common_000066' fnTitle, |
|
|
|
|
NULL fnType, |
|
|
|
|
NULL position, |
|
|
|
|
NULL icon |
|
|
|
|
UNION ALL |
|
|
|
|
SELECT NULL fnKeySeq, |
|
|
|
|
'SetDefault' fnKey, |
|
|
|
|
[dbo].[FLangKeyToValue]('GHR_Common_000000',{2},'恢复默认') fnTitle, |
|
|
|
|
'table' fnType, |
|
|
|
|
'left' position, |
|
|
|
|
'ghr-icon-setDefault' icon |
|
|
|
|
UNION ALL |
|
|
|
|
SELECT NULL fnKeySeq, |
|
|
|
|
'GridView' fnKey, |
|
|
|
|
'GHR_Common_000067' fnTitle, |
|
|
|
|
'table' fnType, |
|
|
|
|
'right' position, |
|
|
|
|
'ant-design:setting-outlined' icon |
|
|
|
|
UNION ALL |
|
|
|
|
SELECT NULL fnKeySeq, |
|
|
|
|
'DataSort' fnKey, |
|
|
|
|
'GHR_Common_000045' fnTitle, |
|
|
|
|
'table', |
|
|
|
|
'left', |
|
|
|
|
'ghr-data-sort' |
|
|
|
|
UNION ALL |
|
|
|
|
SELECT NULL fnKeySeq, |
|
|
|
|
'Muti' fnKey, |
|
|
|
|
'GHR_Common_000062' fnTitle, |
|
|
|
|
'row', |
|
|
|
|
'left', |
|
|
|
|
'ghr-icon-global') A |
|
|
|
|
WHERE fnKey NOT IN |
|
|
|
|
(SELECT b.field |
|
|
|
|
FROM Ghrs_UserPageSettingQueryColumn a, Ghrs_PageSettingQuery b |
|
|
|
|
WHERE a.PageSettingQueryId = b.PageSettingQueryId |
|
|
|
|
AND a.UserID = '{1}' |
|
|
|
|
AND b.PageNo = '{0}' |
|
|
|
|
AND a.IsEnable = 1 |
|
|
|
|
AND b.IsEnable = 1 |
|
|
|
|
AND a.isHidden = 'true' |
|
|
|
|
AND b.elementType = 'FnKey') order by fnKeySeq";
|
|
|
|
|
|
|
|
|
|
sql = string.Format(sql, param.menuName, App.User.ID, param.langId); |
|
|
|
|
result.JM_PageControlT1.Toolbar = DbAccess.QueryList<Toolbar>(sql); |
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 定义表格页面的栏位, 含 表格栏位, 常用查询栏位, 高级查询栏位,可编辑栏位 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Db.Ado.BeginTran(); |
|
|
|
|
sql = @"IF OBJECT_ID('tempdb.[dbo].[#TmpInitPageSettingQuery]') IS NOT NULL DROP TABLE [dbo].[#TmpInitPageSettingQuery]
|
|
|
|
|
CREATE TABLE [dbo].[#TmpInitPageSettingQuery](pageColumnID int) alter TABLE [dbo].[#TmpInitPageSettingQuery] |
|
|
|
|
add [elementType] [nvarchar](1000) , [field] [nvarchar](1000) ,[label] [nvarchar](1000) , |
|
|
|
|
[meky] [nvarchar](100) , [multipleSelect] [nvarchar](1000) , [dataType] [nvarchar](1000) , |
|
|
|
|
[required] [nvarchar](1000) , [palceholder] [nvarchar](1000) , [dataSourceType] [nvarchar](1000) , |
|
|
|
|
[dataSource] [nvarchar](1000) , [sortable] [nvarchar](1000) , [sortOrder] [nvarchar](1000) , |
|
|
|
|
[defaultHidden] [nvarchar](1000) ,[ConfigIsShow] [nvarchar](1000) , [filterable] [nvarchar](1000) , [width] int, |
|
|
|
|
[align] [nvarchar](1000) , [fixed] [nvarchar](1000) , |
|
|
|
|
[editable] [nvarchar](1000) , [searchable] [nvarchar](1000) , [searchRequired] [nvarchar](1000) , |
|
|
|
|
[searchColumnSeq] int , [multipleSearchValue] [nvarchar](1000) , [maxTagCount] [nvarchar](1000) , |
|
|
|
|
[selfDefine] [nvarchar](2000) , [selectUI] [nvarchar](1000) , [isPrimaryKey] [nvarchar](1000) , |
|
|
|
|
isSorted nvarchar(10),isHidden nvarchar(10),isSearched nvarchar(10),sortNo int, |
|
|
|
|
[searchOperator] nvarchar(max),searchColumnDefaultValue nvarchar(1000),AppColumnType nvarchar(100)";
|
|
|
|
|
int count = Db.Ado.ExecuteCommand(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sql = @"SELECT count (1) UserHasSetting
|
|
|
|
|
FROM Ghrs_UserPageSettingQueryColumn a, Ghrs_PageSettingQuery b |
|
|
|
|
WHERE b.PageNo = '{0}' |
|
|
|
|
AND b.IsEnable = 1 |
|
|
|
|
AND b.field ! = 'Muti' |
|
|
|
|
AND a.UserID = '{1}' |
|
|
|
|
AND a.IsEnable = 1 |
|
|
|
|
AND a.PageSettingQueryId = b.PageSettingQueryId";
|
|
|
|
|
sql = string.Format(sql, param.menuName, App.User.ID); |
|
|
|
|
int UserHasSetting = Db.Ado.GetInt(sql); |
|
|
|
|
if (UserHasSetting == 0) |
|
|
|
|
{ |
|
|
|
|
sql = @"insert into [dbo].[#TmpInitPageSettingQuery]
|
|
|
|
|
select PageSettingQueryId,elementType,field,label,Meky,multipleSelect,dataType,required,palceholder,dataSourceType, |
|
|
|
|
dbo.FS_GetdataSourceBySet(dataSource,APIDataSourceType,Ghrs_PageSettingQuery.APIDataSourceID) dataSource, |
|
|
|
|
sortable,sortOrder,defaultHidden, ConfigIsShow,filterable, |
|
|
|
|
case when width='' then '100' else width end ,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,'' searchColumnDefaultValue,'' AppColumnType |
|
|
|
|
from Ghrs_PageSettingQuery where PageNo='F_Title' and elementType not in ( 'PageGroup') and IsEnable=1 |
|
|
|
|
order by SortNo";
|
|
|
|
|
count = Db.Ado.ExecuteCommand(sql); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
sql = @"insert into [dbo].[#TmpInitPageSettingQuery]
|
|
|
|
|
select a.PageSettingQueryId,elementType,field,label,Meky,multipleSelect,dataType,required,palceholder,dataSourceType, |
|
|
|
|
dbo.FS_GetdataSourceBySet(dataSource,APIDataSourceType,b.APIDataSourceID) dataSource, |
|
|
|
|
sortable,isnull(a.sortOrder,b.sortOrder),defaultHidden, ConfigIsShow,filterable, |
|
|
|
|
case when isnull(a.width,b.width) ='' then '100' else isnull(a.width,b.width) end ,align,a.fixed,editable, searchable,searchRequired,isnull(a.searchColumnSeq,b.searchColumnSeq),multipleSearchValue,maxTagCount,selfDefine,selectUI,isPrimaryKey, |
|
|
|
|
a.isSorted isSorted, isnull(a.isHidden,'false') isHidden, |
|
|
|
|
case when a.searchColumnSeq is null or a.searchColumnSeq='' then 'false' else 'true' end isSearched,a.SortNo, |
|
|
|
|
b.searchCanOperator ,'' searchColumnDefaultValue,'' AppColumnType |
|
|
|
|
from Ghrs_UserPageSettingQueryColumn a,Ghrs_PageSettingQuery b |
|
|
|
|
where b.PageNo='F_Title' and b.IsEnable=1 and b.elementType not in ( 'PageGroup') |
|
|
|
|
and a.UserID=1 and a.IsEnable=1 and a.PageSettingQueryId=b.PageSettingQueryId |
|
|
|
|
order by a.SortNo,b.SortNo |
|
|
|
|
|
|
|
|
|
insert into [dbo].[#TmpInitPageSettingQuery] |
|
|
|
|
select PageSettingQueryId,elementType,field,label,Meky,multipleSelect,dataType,required,palceholder,dataSourceType, |
|
|
|
|
dbo.FS_GetdataSourceBySet(dataSource,APIDataSourceType,Ghrs_PageSettingQuery.APIDataSourceID) dataSource, |
|
|
|
|
sortable,sortOrder,defaultHidden, ConfigIsShow,filterable, |
|
|
|
|
case when width='' then '100' else width end ,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,'' searchColumnDefaultValue ,'' AppColumnType |
|
|
|
|
from Ghrs_PageSettingQuery where PageNo='F_Title' and elementType not in ( 'PageGroup') and IsEnable=1 |
|
|
|
|
and elementtype='FnKey' |
|
|
|
|
and not exists (select 1 from [dbo].[#TmpInitPageSettingQuery] kk |
|
|
|
|
where kk.pageColumnID=Ghrs_PageSettingQuery.PageSettingQueryId |
|
|
|
|
and kk.field=Ghrs_PageSettingQuery.field |
|
|
|
|
and kk.elementtype=Ghrs_PageSettingQuery.elementtype) |
|
|
|
|
order by SortNo ";
|
|
|
|
|
count = Db.Ado.ExecuteCommand(sql); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sql = @"
|
|
|
|
|
-- 多语言的栏位的特别更新 |
|
|
|
|
if OBJECT_ID('tempdb.[dbo].[#TempInitUserPageFnKey]') IS NOT NULL |
|
|
|
|
begin |
|
|
|
|
insert into [dbo].[#TmpInitPageSettingQuery] |
|
|
|
|
select 0,elementType,field,label,Meky,multipleSelect,dataType,required,palceholder,dataSourceType, |
|
|
|
|
dbo.FS_GetdataSourceBySet(dataSource,APIDataSourceType,Ghrs_PageSettingQuery.APIDataSourceID) dataSource, |
|
|
|
|
sortable,sortOrder,defaultHidden, ConfigIsShow,filterable, |
|
|
|
|
case when width='' then '100' else width end ,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,'' searchColumnDefaultValue ,'' AppColumnType |
|
|
|
|
from Ghrs_PageSettingQuery where field='Muti' and IsEnable=1 |
|
|
|
|
and elementtype='FnKey' and pageno='F_Dept' |
|
|
|
|
and exists (select 1 from [dbo].[#TempInitUserPageFnKey] where fnKey='Muti') |
|
|
|
|
and not exists (select 1 from [dbo].[#TmpInitPageSettingQuery] kk |
|
|
|
|
where kk.pageColumnID=Ghrs_PageSettingQuery.PageSettingQueryId |
|
|
|
|
and kk.field=Ghrs_PageSettingQuery.field |
|
|
|
|
and kk.elementtype=Ghrs_PageSettingQuery.elementtype) |
|
|
|
|
order by SortNo |
|
|
|
|
-- 明细按钮的宽度 |
|
|
|
|
insert into [dbo].[#TmpInitPageSettingQuery] |
|
|
|
|
select 0,elementType,'DetailYN',label,Meky,multipleSelect,dataType,required,palceholder,dataSourceType, |
|
|
|
|
dbo.FS_GetdataSourceBySet(dataSource,APIDataSourceType,Ghrs_PageSettingQuery.APIDataSourceID) dataSource, |
|
|
|
|
sortable,sortOrder,defaultHidden, ConfigIsShow,filterable, |
|
|
|
|
case when width='' then '100' else width end ,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,'' searchColumnDefaultValue,'' AppColumnType |
|
|
|
|
from Ghrs_PageSettingQuery where field='Muti' and IsEnable=1 |
|
|
|
|
and elementtype='FnKey' and pageno='F_Dept' |
|
|
|
|
and exists (select 1 from [dbo].[#TempInitUserPageFnKey] where fnKey='DetailYN') |
|
|
|
|
and not exists (select 1 from [dbo].[#TmpInitPageSettingQuery] kk |
|
|
|
|
where field='DetailYN' and elementtype='FnKey') |
|
|
|
|
order by SortNo |
|
|
|
|
end |
|
|
|
|
else |
|
|
|
|
begin |
|
|
|
|
insert into [dbo].[#TmpInitPageSettingQuery] |
|
|
|
|
select 0,elementType,field,label,Meky,multipleSelect,dataType,required,palceholder,dataSourceType, |
|
|
|
|
dbo.FS_GetdataSourceBySet(dataSource,APIDataSourceType,Ghrs_PageSettingQuery.APIDataSourceID) dataSource, |
|
|
|
|
sortable,sortOrder,defaultHidden, ConfigIsShow,filterable, |
|
|
|
|
case when width='' then '100' else width end ,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,'' searchColumnDefaultValue ,'' AppColumnType |
|
|
|
|
from Ghrs_PageSettingQuery where field='Muti' and IsEnable=1 |
|
|
|
|
and elementtype='FnKey' and pageno='F_Dept' |
|
|
|
|
and not exists (select 1 from [dbo].[#TmpInitPageSettingQuery] kk |
|
|
|
|
where kk.pageColumnID=Ghrs_PageSettingQuery.PageSettingQueryId |
|
|
|
|
and kk.field=Ghrs_PageSettingQuery.field |
|
|
|
|
and kk.elementtype=Ghrs_PageSettingQuery.elementtype) |
|
|
|
|
order by SortNo |
|
|
|
|
-- 明细按钮的宽度 |
|
|
|
|
insert into [dbo].[#TmpInitPageSettingQuery] |
|
|
|
|
select 0,elementType,'DetailYN',label,Meky,multipleSelect,dataType,required,palceholder,dataSourceType, |
|
|
|
|
dbo.FS_GetdataSourceBySet(dataSource,APIDataSourceType,Ghrs_PageSettingQuery.APIDataSourceID) dataSource, |
|
|
|
|
sortable,sortOrder,defaultHidden, ConfigIsShow,filterable, |
|
|
|
|
case when width='' then '100' else width end ,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,'' searchColumnDefaultValue ,'' AppColumnType |
|
|
|
|
from Ghrs_PageSettingQuery where field='Muti' and IsEnable=1 |
|
|
|
|
and elementtype='FnKey' and pageno='F_Dept' |
|
|
|
|
and not exists (select 1 from [dbo].[#TmpInitPageSettingQuery] kk |
|
|
|
|
where field='DetailYN' and elementtype='FnKey') |
|
|
|
|
order by SortNo |
|
|
|
|
end |
|
|
|
|
-- 更新可编辑 |
|
|
|
|
if OBJECT_ID('tempdb.[dbo].[#TempInitUserPageFnKey]') IS NOT NULL |
|
|
|
|
begin |
|
|
|
|
update [dbo].[#TmpInitPageSettingQuery] set editable='false' |
|
|
|
|
where ( not exists (select 1 from [dbo].[#TempInitUserPageFnKey] where fnKey='UpdateYN' |
|
|
|
|
and 'F_Title' not in ('F_Staff~1','F_StaffToDo','F_StaffQuery', |
|
|
|
|
'F_StaffChangeToDo','F_StaffChangeToEnable','F_StaffChangeQuery', |
|
|
|
|
'F_SalaryChangeToDo','F_SalaryChange','F_SalaryChangeQuery' |
|
|
|
|
) |
|
|
|
|
) and |
|
|
|
|
not exists (select 1 from [dbo].[#TempInitUserPageFnKey] where fnKey='TBD2YN' |
|
|
|
|
and 'F_Title' in ('F_Staff~1','F_StaffToDo','F_StaffQuery') ) and |
|
|
|
|
not exists (select 1 from [dbo].[#TempInitUserPageFnKey] where fnKey='TBD5YN' |
|
|
|
|
and 'F_Title' in ('F_StaffChangeToDo','F_StaffChangeToEnable','F_StaffChangeQuery' , |
|
|
|
|
'F_SalaryChangeToDo','F_SalaryChange','F_SalaryChangeQuery') |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
and 'F_Title' not in ( 'F_SchedulePeriodSetup') |
|
|
|
|
end |
|
|
|
|
-- 更新栏位说明(从多语言里面) |
|
|
|
|
update [dbo].[#TmpInitPageSettingQuery] set label=[dbo].[FLangKeyToValue](Meky,1,label); |
|
|
|
|
update [dbo].[#TmpInitPageSettingQuery] set width=50 where elementType='FnKey' or field='Muti' ;";
|
|
|
|
|
count = Db.Ado.ExecuteCommand(sql); |
|
|
|
|
|
|
|
|
|
sql = @"select pageColumnID,elementType, field,label,meky, multipleSelect, dataType,
|
|
|
|
|
required, palceholder, dataSourceType,dataSource, sortable, sortOrder, |
|
|
|
|
defaultHidden, ConfigIsShow, filterable, width,align, fixed,editable, searchable, |
|
|
|
|
searchRequired,searchColumnSeq, multipleSearchValue, maxTagCount, |
|
|
|
|
selfDefine, selectUI, isPrimaryKey,isSorted,isHidden,isSearched,sortNo, |
|
|
|
|
( 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(searchOperator,',')) |
|
|
|
|
order by (select positon from dbo.Fs1_GHR30_SplitString2(searchOperator,',') |
|
|
|
|
where value= ParaDetailNo) |
|
|
|
|
FOR JSON Path ) searchOperator , |
|
|
|
|
iif(ISJSON(searchColumnDefaultValue)=1,JSON_QUERY(searchColumnDefaultValue),null) searchColumnDefaultValue , |
|
|
|
|
AppColumnType |
|
|
|
|
from [dbo].[#TmpInitPageSettingQuery] |
|
|
|
|
order by sortno";
|
|
|
|
|
result.JM_TableColumnT1.TableColumn = Db.Ado.SqlQuery<TableColumn>(sql); |
|
|
|
|
Db.Ado.CommitTran(); |
|
|
|
|
|
|
|
|
|
sql = @"SELECT Langkey field,
|
|
|
|
|
CASE 1 |
|
|
|
|
WHEN 1 THEN isnull (Value01, LangValue) |
|
|
|
|
WHEN 2 THEN isnull (Value02, LangValue) |
|
|
|
|
WHEN 3 THEN isnull (Value03, LangValue) |
|
|
|
|
WHEN 4 THEN isnull (Value04, LangValue) |
|
|
|
|
WHEN 5 THEN isnull (Value05, LangValue) |
|
|
|
|
WHEN 6 THEN isnull (Value06, LangValue) |
|
|
|
|
WHEN 7 THEN isnull (Value07, LangValue) |
|
|
|
|
WHEN 8 THEN isnull (Value08, LangValue) |
|
|
|
|
WHEN 9 THEN isnull (Value09, LangValue) |
|
|
|
|
WHEN 10 THEN isnull (Value10, LangValue) |
|
|
|
|
END label |
|
|
|
|
FROM Ghrs_LangKey |
|
|
|
|
WHERE IsEnable = 1 |
|
|
|
|
AND (LangKey LIKE 'GHR_Page%' OR LangKey LIKE 'GHR_Common%')";
|
|
|
|
|
result.DT_PageMutiMsg = Db.Ado.SqlQuery<DT_PageMutiMsg>(sql); |
|
|
|
|
|
|
|
|
|
sql = "select QueryProcedure, EditProcedure, IUDProcedure from Ghrs_Menu where MenuNo='F_Title'"; |
|
|
|
|
DataTable dt = Db.Ado.GetDataTable(sql); |
|
|
|
|
if(dt.Rows.Count > 0) |
|
|
|
|
{ |
|
|
|
|
result.DT_Procedure.QueryProcedure = dt.Rows[0]["QueryProcedure"].ToString(); |
|
|
|
|
result.DT_Procedure.EditProcedure = dt.Rows[0]["EditProcedure"].ToString(); |
|
|
|
|
result.DT_Procedure.IUDProcedure = dt.Rows[0]["IUDProcedure"].ToString(); |
|
|
|
|
} |
|
|
|
|
//if (UserHasSetting == 0) |
|
|
|
|
//{ |
|
|
|
|
// sql = @"SELECT PageSettingQueryId, |
|
|
|
|
// elementType, |
|
|
|
|
// field, |
|
|
|
|
// label, |
|
|
|
|
// Meky, |
|
|
|
|
// multipleSelect, |
|
|
|
|
// dataType, |
|
|
|
|
// required, |
|
|
|
|
// palceholder, |
|
|
|
|
// dataSourceType, |
|
|
|
|
// dbo.FS_GetdataSourceBySet |
|
|
|
|
// (dataSource, APIDataSourceType, Ghrs_PageSettingQuery.APIDataSourceID) |
|
|
|
|
// dataSource, |
|
|
|
|
// sortable, |
|
|
|
|
// sortOrder, |
|
|
|
|
// defaultHidden, |
|
|
|
|
// ConfigIsShow, |
|
|
|
|
// filterable, |
|
|
|
|
// CASE WHEN width = '' THEN '100' ELSE width END width, |
|
|
|
|
// align, |
|
|
|
|
// fixed fixed1, |
|
|
|
|
// 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, |
|
|
|
|
// '' |
|
|
|
|
// searchColumnDefaultValue, |
|
|
|
|
// '' |
|
|
|
|
// AppColumnType |
|
|
|
|
// FROM Ghrs_PageSettingQuery |
|
|
|
|
// WHERE PageNo = '{0}' |
|
|
|
|
// AND elementType NOT IN ('PageGroup') |
|
|
|
|
// AND IsEnable = 1 |
|
|
|
|
// ORDER BY SortNo"; |
|
|
|
|
// sql = string.Format(sql, param.menuName); |
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
//else |
|
|
|
|
//{ |
|
|
|
|
// sql = @"SELECT a.PageSettingQueryId, |
|
|
|
|
// elementType, |
|
|
|
|
// field, |
|
|
|
|
// label, |
|
|
|
|
// Meky, |
|
|
|
|
// multipleSelect, |
|
|
|
|
// dataType, |
|
|
|
|
// required, |
|
|
|
|
// palceholder, |
|
|
|
|
// dataSourceType, |
|
|
|
|
// dbo.FS_GetdataSourceBySet |
|
|
|
|
// (dataSource, APIDataSourceType, b.APIDataSourceID) |
|
|
|
|
// dataSource, |
|
|
|
|
// sortable, |
|
|
|
|
// isnull (a.sortOrder, b.sortOrder), |
|
|
|
|
// defaultHidden, |
|
|
|
|
// ConfigIsShow, |
|
|
|
|
// filterable, |
|
|
|
|
// CASE |
|
|
|
|
// WHEN isnull (a.width, b.width) = '' THEN '100' |
|
|
|
|
// ELSE isnull (a.width, b.width) |
|
|
|
|
// END width, |
|
|
|
|
// align, |
|
|
|
|
// a.fixed fixed1, |
|
|
|
|
// editable, |
|
|
|
|
// searchable, |
|
|
|
|
// searchRequired, |
|
|
|
|
// isnull (a.searchColumnSeq, b.searchColumnSeq) searchColumnSeq, |
|
|
|
|
// multipleSearchValue, |
|
|
|
|
// maxTagCount, |
|
|
|
|
// selfDefine, |
|
|
|
|
// selectUI, |
|
|
|
|
// isPrimaryKey, |
|
|
|
|
// a.isSorted |
|
|
|
|
// isSorted, |
|
|
|
|
// isnull (a.isHidden, 'false') |
|
|
|
|
// isHidden, |
|
|
|
|
// CASE |
|
|
|
|
// WHEN a.searchColumnSeq IS NULL OR a.searchColumnSeq = '' |
|
|
|
|
// THEN |
|
|
|
|
// 'false' |
|
|
|
|
// ELSE |
|
|
|
|
// 'true' |
|
|
|
|
// END |
|
|
|
|
// isSearched, |
|
|
|
|
// a.SortNo, |
|
|
|
|
// b.searchCanOperator, |
|
|
|
|
// '' |
|
|
|
|
// searchColumnDefaultValue, |
|
|
|
|
// '' |
|
|
|
|
// AppColumnType |
|
|
|
|
// FROM Ghrs_UserPageSettingQueryColumn a, Ghrs_PageSettingQuery b |
|
|
|
|
// WHERE b.PageNo = '{0}' |
|
|
|
|
// AND b.IsEnable = 1 |
|
|
|
|
// AND b.elementType NOT IN ('PageGroup') |
|
|
|
|
// AND a.UserID = '{1}' |
|
|
|
|
// AND a.IsEnable = 1 |
|
|
|
|
// AND a.PageSettingQueryId = b.PageSettingQueryId |
|
|
|
|
// ORDER BY a.SortNo, b.SortNo"; |
|
|
|
|
// sql = string.Format(sql, param.menuName, App.User.ID); |
|
|
|
|
|
|
|
|
|
// sql = @"SELECT PageSettingQueryId, |
|
|
|
|
// elementType, |
|
|
|
|
// field, |
|
|
|
|
// label, |
|
|
|
|
// Meky, |
|
|
|
|
// multipleSelect, |
|
|
|
|
// dataType, |
|
|
|
|
// required, |
|
|
|
|
// palceholder, |
|
|
|
|
// dataSourceType, |
|
|
|
|
// dbo.FS_GetdataSourceBySet |
|
|
|
|
// (dataSource, APIDataSourceType, Ghrs_PageSettingQuery.APIDataSourceID) |
|
|
|
|
// dataSource, |
|
|
|
|
// sortable, |
|
|
|
|
// sortOrder, |
|
|
|
|
// defaultHidden, |
|
|
|
|
// ConfigIsShow, |
|
|
|
|
// filterable, |
|
|
|
|
// CASE WHEN width = '' THEN '100' ELSE width END width, |
|
|
|
|
// align, |
|
|
|
|
// fixed fixed1, |
|
|
|
|
// 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, |
|
|
|
|
// '' |
|
|
|
|
// searchColumnDefaultValue, |
|
|
|
|
// '' |
|
|
|
|
// AppColumnType |
|
|
|
|
// FROM Ghrs_PageSettingQuery |
|
|
|
|
// WHERE PageNo = '{0}' |
|
|
|
|
// AND elementType NOT IN ('PageGroup') |
|
|
|
|
// AND IsEnable = 1 |
|
|
|
|
// AND elementtype = 'FnKey' ORDER BY SortNo"; |
|
|
|
|
// sql = string.Format(sql, param.menuName ); |
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
//result.JM_TableColumnT1 = DbAccess.QueryList<JM_TableColumnT1>(sql); |
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ServiceResult<ModuleReturn>() { Success = true, Message = "查询成功", Data = result, }; |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|