|
|
@ -14,6 +14,7 @@ using SqlSugar; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Tiobon.Core.Common.UserManager; |
|
|
|
using Tiobon.Core.Common.UserManager; |
|
|
|
using MongoDB.Driver.Linq; |
|
|
|
using MongoDB.Driver.Linq; |
|
|
|
|
|
|
|
using Tiobon.Core.Common.DB.Dapper; |
|
|
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
|
|
@ -58,30 +59,207 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
|
|
|
|
|
|
|
var Toolbar = new List<Toolbar>(); |
|
|
|
var Toolbar = new List<Toolbar>(); |
|
|
|
|
|
|
|
|
|
|
|
Toolbar.Add(new Toolbar() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
fnKey = "NewYN", |
|
|
|
|
|
|
|
fnKeyValue = null, |
|
|
|
#region 定义页面的操作按钮 |
|
|
|
fnTitle = "新增", |
|
|
|
string sql = @"SELECT fnKey,
|
|
|
|
fnType = "table", |
|
|
|
fnKeyValue, |
|
|
|
position = "left", |
|
|
|
[dbo].[FLangKeyToValue] (fnKeyValue, {2}, fnKeyValue) fnTitle, |
|
|
|
icon = "ghr-icon-add", |
|
|
|
fnType, |
|
|
|
display = true |
|
|
|
position, |
|
|
|
}); |
|
|
|
icon, |
|
|
|
Toolbar.Add(new Toolbar() |
|
|
|
'true' display |
|
|
|
{ |
|
|
|
FROM (SELECT CASE |
|
|
|
fnKey = "Release", |
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'NewYN' THEN 1 |
|
|
|
fnKeyValue = null, |
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'ToExcelYN' THEN 2 |
|
|
|
fnTitle = "发布", |
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'FromExcelYN' THEN 3 |
|
|
|
fnType = "table", |
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'BatchUpdateYN' THEN 4 |
|
|
|
position = "left", |
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'BatchDelYN' THEN 5 |
|
|
|
icon = "ghr-publish", |
|
|
|
WHEN substring (fnKey, 3, 99) + 'YN' = 'LogYN' THEN 6 |
|
|
|
display = true |
|
|
|
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, |
|
|
|
|
|
|
|
'GridView' fnKey, |
|
|
|
|
|
|
|
'GHR_Common_000067' fnTitle, |
|
|
|
|
|
|
|
'table' fnType, |
|
|
|
|
|
|
|
'right' position, |
|
|
|
|
|
|
|
'ant-design:setting-outlined' icon |
|
|
|
|
|
|
|
) 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); |
|
|
|
|
|
|
|
var toolbars = DbAccess.QueryList<Toolbar>(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (toolbars.Any(x => x.fnKey == "NewYN")) |
|
|
|
|
|
|
|
Toolbar.Add(new Toolbar() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
fnKey = "NewYN", |
|
|
|
|
|
|
|
fnKeyValue = null, |
|
|
|
|
|
|
|
fnTitle = "新增", |
|
|
|
|
|
|
|
fnType = "table", |
|
|
|
|
|
|
|
position = "left", |
|
|
|
|
|
|
|
icon = "ghr-icon-add", |
|
|
|
|
|
|
|
display = true |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (param.menuName == "F_ExamManageDraft") |
|
|
|
|
|
|
|
Toolbar.Add(new Toolbar() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
fnKey = "Release", |
|
|
|
|
|
|
|
fnKeyValue = null, |
|
|
|
|
|
|
|
fnTitle = "发布", |
|
|
|
|
|
|
|
fnType = "table", |
|
|
|
|
|
|
|
position = "left", |
|
|
|
|
|
|
|
icon = "ghr-publish", |
|
|
|
|
|
|
|
display = true |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (param.menuName == "F_ExamManageReleased") |
|
|
|
|
|
|
|
Toolbar.Add(new Toolbar() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
fnKey = "Release", |
|
|
|
|
|
|
|
fnKeyValue = null, |
|
|
|
|
|
|
|
fnTitle = "取消发布", |
|
|
|
|
|
|
|
fnType = "table", |
|
|
|
|
|
|
|
position = "left", |
|
|
|
|
|
|
|
icon = "ghr-publish", |
|
|
|
|
|
|
|
display = true |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (toolbars.Any(x => x.fnKey == "ToExcelYN")) |
|
|
|
|
|
|
|
Toolbar.Add(toolbars.First(x => x.fnKey == "ToExcelYN")); |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DT_Procedure = new DT_Procedure(); |
|
|
|
var DT_Procedure = new DT_Procedure(); |
|
|
|
|
|
|
|
|
|
|
|
var sql = "select QueryProcedure, EditProcedure, IUDProcedure from Ghrs_Menu where MenuNo='{0}'"; |
|
|
|
sql = "select QueryProcedure, EditProcedure, IUDProcedure from Ghrs_Menu where MenuNo='{0}'"; |
|
|
|
sql = string.Format(sql, param.menuName, App.User.ID, param.langId); |
|
|
|
sql = string.Format(sql, param.menuName, App.User.ID, param.langId); |
|
|
|
var dt = Db.Ado.GetDataTable(sql); |
|
|
|
var dt = Db.Ado.GetDataTable(sql); |
|
|
|
if (dt.Rows.Count > 0) |
|
|
|
if (dt.Rows.Count > 0) |
|
|
@ -159,9 +337,6 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
x.searchOperator = JsonConvert.DeserializeObject<List<searchOperator>>(x.searchOperator1); |
|
|
|
x.searchOperator = JsonConvert.DeserializeObject<List<searchOperator>>(x.searchOperator1); |
|
|
|
x.searchOperator1 = null; |
|
|
|
x.searchOperator1 = null; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region DT_PageMutiMsg |
|
|
|
#region DT_PageMutiMsg |
|
|
|
var DT_PageMutiMsg = await _caching.GetAsync<List<DT_PageMutiMsg>>("DT_PageMutiMsg"); |
|
|
|
var DT_PageMutiMsg = await _caching.GetAsync<List<DT_PageMutiMsg>>("DT_PageMutiMsg"); |
|
|
|
if (DT_PageMutiMsg == null || (DT_PageMutiMsg != null && !DT_PageMutiMsg.Any())) |
|
|
|
if (DT_PageMutiMsg == null || (DT_PageMutiMsg != null && !DT_PageMutiMsg.Any())) |
|
|
@ -319,6 +494,163 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
.OrderBy(filter.orderBy) |
|
|
|
.OrderBy(filter.orderBy) |
|
|
|
.ToPageListAsync(filter.pageNum, filter.pageSize, totalCount); |
|
|
|
.ToPageListAsync(filter.pageNum, filter.pageSize, totalCount); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 定义页面的操作按钮 |
|
|
|
|
|
|
|
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, |
|
|
|
|
|
|
|
'GridView' fnKey, |
|
|
|
|
|
|
|
'GHR_Common_000067' fnTitle, |
|
|
|
|
|
|
|
'table' fnType, |
|
|
|
|
|
|
|
'right' position, |
|
|
|
|
|
|
|
'ant-design:setting-outlined' icon |
|
|
|
|
|
|
|
) 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, filter.menuName, App.User.ID, filter.langId); |
|
|
|
|
|
|
|
var toolbars = DbAccess.QueryList<Toolbar>(sql); |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
data.ForEach(x => |
|
|
|
data.ForEach(x => |
|
|
|
{ |
|
|
|
{ |
|
|
|
x.ExamName = x.ExamName + "(" + x.ExamNo + ")"; |
|
|
|
x.ExamName = x.ExamName + "(" + x.ExamNo + ")"; |
|
|
@ -347,6 +679,13 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
x.AfterHowLongLabel = $"学完{x.AfterHowLong}天"; |
|
|
|
x.AfterHowLongLabel = $"学完{x.AfterHowLong}天"; |
|
|
|
|
|
|
|
|
|
|
|
x.ExamModeLabel = x.ExamMode == "Online" ? "线上考试" : "线下实操"; |
|
|
|
x.ExamModeLabel = x.ExamMode == "Online" ? "线上考试" : "线下实操"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!toolbars.Any(x => x.fnKey == "UpdateYN")) |
|
|
|
|
|
|
|
x.canEdit = 0; |
|
|
|
|
|
|
|
if (!toolbars.Any(x => x.fnKey == "DelYN")) |
|
|
|
|
|
|
|
x.canDelete = 0; |
|
|
|
|
|
|
|
if (!toolbars.Any(x => x.fnKey == "DetailYN")) |
|
|
|
|
|
|
|
x.canDetail = 0; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return new ServicePageResult<Ghre_ExamDto>(filter.pageNum, totalCount, filter.pageSize, data); |
|
|
|
return new ServicePageResult<Ghre_ExamDto>(filter.pageNum, totalCount, filter.pageSize, data); |
|
|
@ -823,7 +1162,12 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult<Ghre_ExamMessageLogDto>> QueryMessageLog(long id) |
|
|
|
public async Task<ServiceResult<Ghre_ExamMessageLogDto>> QueryMessageLog(long id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var view = await _ghre_ExamMessageLogServices.QueryById(id); |
|
|
|
|
|
|
|
|
|
|
|
var exam = await base.QueryById(id); |
|
|
|
|
|
|
|
if (exam is null) |
|
|
|
|
|
|
|
return ServiceResult<Ghre_ExamMessageLogDto>.OprateFailed("无效的考试ID!"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var view = await _ghre_ExamMessageLogServices.QuerySingleDto(x => x.ExamId == id); |
|
|
|
if (view == null) view = new Ghre_ExamMessageLogDto() |
|
|
|
if (view == null) view = new Ghre_ExamMessageLogDto() |
|
|
|
{ |
|
|
|
{ |
|
|
|
NotificationScope = "All", |
|
|
|
NotificationScope = "All", |
|
|
@ -832,11 +1176,8 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
|
|
|
|
|
|
|
if (view.IsFirstEntry == false) |
|
|
|
if (view.IsFirstEntry == false) |
|
|
|
view.NotificationScope = "Need"; |
|
|
|
view.NotificationScope = "Need"; |
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(view.SendType)) |
|
|
|
var exam = await base.QueryById(id); |
|
|
|
view.SendExamMessage = JsonConvert.DeserializeObject<List<string>>(view.SendType); |
|
|
|
|
|
|
|
|
|
|
|
if (exam is null) |
|
|
|
|
|
|
|
return ServiceResult<Ghre_ExamMessageLogDto>.OprateFailed("无效的考试ID!"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var examPaper = await _ghre_ExamPaperServices.QueryById(exam.ExamPaperId); |
|
|
|
var examPaper = await _ghre_ExamPaperServices.QueryById(exam.ExamPaperId); |
|
|
|
view.ExamName = exam.ExamName; |
|
|
|
view.ExamName = exam.ExamName; |
|
|
@ -856,9 +1197,12 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult> InsertMessageLog(Ghre_ExamMessageLogDto insert) |
|
|
|
public async Task<ServiceResult> InsertMessageLog(Ghre_ExamMessageLogDto insert) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
insert.IsFirstEntry = false; |
|
|
|
|
|
|
|
insert.SendType = JsonConvert.SerializeObject(insert.SendExamMessage); |
|
|
|
Db.Updateable<Ghre_ExamMessageLog>().SetColumns(it => it.IsEnable == 0).Where(it => it.ExamId == insert.Id && it.IsEnable == 1).ExecuteCommand(); |
|
|
|
Db.Updateable<Ghre_ExamMessageLog>().SetColumns(it => it.IsEnable == 0).Where(it => it.ExamId == insert.Id && it.IsEnable == 1).ExecuteCommand(); |
|
|
|
|
|
|
|
|
|
|
|
var insert1 = Mapper.Map(insert).ToANew<InsertGhre_ExamMessageLogInput>(); |
|
|
|
var insert1 = Mapper.Map(insert).ToANew<InsertGhre_ExamMessageLogInput>(); |
|
|
|
|
|
|
|
insert1.ExamId = insert.Id; |
|
|
|
await _ghre_ExamMessageLogServices.Add(insert1); |
|
|
|
await _ghre_ExamMessageLogServices.Add(insert1); |
|
|
|
return ServiceResult.OprateSuccess("提交成功!"); |
|
|
|
return ServiceResult.OprateSuccess("提交成功!"); |
|
|
|
|
|
|
|
|
|
|
|