20220424 清日志、清考勤定时器,考试生成试卷接口方法修改

This commit is contained in:
杨红卫 2022-04-24 18:29:54 +08:00
parent 54fc77e7c1
commit 93df6c189c
21 changed files with 412 additions and 73 deletions

View File

@ -0,0 +1,29 @@
/****** Object: Index [NonClusteredIndex-20220422-165000] Script Date: 2022/4/22 16:50:59 ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20220422-165000] ON [dbo].[Training_TestPlan]
(
[TestPlanId] ASC,
[TestStartTime] ASC,
[States] ASC,
[TestEndTime] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object: Index [NonClusteredIndex-20220422-165128] Script Date: 2022/4/22 16:52:09 ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20220422-165128] ON [dbo].[Training_TestRecord]
(
[TestPlanId] ASC,
[TestManId] ASC,
[TestEndTime] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object: Index [NonClusteredIndex-20220424-164842] Script Date: 2022/4/24 16:49:20 ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20220424-164842] ON [dbo].[Training_TestRecordItem]
(
[TestRecordId] ASC,
[TestType] ASC,
[TrainingItemCode] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

View File

@ -99,14 +99,32 @@ namespace BLL
if (item == null)
{
List<Model.Training_TestTrainingItem> getTestTrainingItemList = new List<Model.Training_TestTrainingItem>();
//// 计划考试中单选、多选、判断题总数
int sumTestType1Count =0;
int sumTestType2Count = 0;
int sumTestType3Count = 0;
var testPlanTrainings = from x in db.Training_TestPlanTraining
where x.TestPlanId == getTestPlan.TestPlanId
select x;
//// 计划考试中单选、多选、判断题总数
int sumTestType1Count = testPlanTrainings.Sum(x => x.TestType1Count) ?? 0;
int sumTestType2Count = testPlanTrainings.Sum(x => x.TestType2Count) ?? 0;
int sumTestType3Count = testPlanTrainings.Sum(x => x.TestType3Count) ?? 0;
if (testPlanTrainings.Count() > 0)
{
//// 计划考试中单选、多选、判断题总数
sumTestType1Count = testPlanTrainings.Sum(x => x.TestType1Count) ?? 0;
sumTestType2Count = testPlanTrainings.Sum(x => x.TestType2Count) ?? 0;
sumTestType3Count = testPlanTrainings.Sum(x => x.TestType3Count) ?? 0;
}
else
{
var getTestRule = db.Sys_TestRule.FirstOrDefault();
if (getTestRule != null)
{
sumTestType1Count = getTestRule.SCount;
sumTestType2Count = getTestRule.MCount;
sumTestType3Count = getTestRule.JCount;
}
}
////获取类型下适合岗位试题集合
var getTestTrainingItemALLs = from x in db.Training_TestTrainingItem
where x.TrainingId != null && (x.WorkPostIds == null || (x.WorkPostIds.Contains(person.WorkPostId) && person.WorkPostId != null))
@ -331,38 +349,64 @@ namespace BLL
#region TestRecordId获取试卷题目列表
/// <summary>
/// 记录数
/// </summary>
public static int geTestRecordItemCount
{
get;
set;
}
/// <summary>
/// 根据TestRecordId获取试卷题目列表
/// </summary>
/// <param name="testPlanId"></param>
/// <returns>考试人员</returns>
public static List<Model.TestRecordItemItem> geTestRecordItemListByTestRecordId(string testRecordId)
public static List<Model.TestRecordItemItem> geTestRecordItemListByTestRecordId(string testRecordId, int pageIndex)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Training_TestRecordItem
where x.TestRecordId == testRecordId
orderby x.TestType, x.TrainingItemCode
select new Model.TestRecordItemItem
{
TestRecordItemId = x.TestRecordItemId,
TestRecordId = x.TestRecordId,
TrainingItemCode = x.TrainingItemCode,
TrainingItemName = x.TrainingItemName,
Abstracts = x.Abstracts,
AttachUrl = x.AttachUrl.Replace("\\", "/") ?? "",
TestType = x.TestType,
TestTypeName = x.TestType == "1" ? "单选题" : (x.TestType == "2" ? "多选题" : "判断题"),
AItem = x.AItem ?? "",
BItem = x.BItem ?? "",
CItem = x.CItem ?? "",
DItem = x.DItem ?? "",
EItem = x.EItem ?? "",
AnswerItems = x.AnswerItems ?? "",
Score = x.Score ?? 0,
SubjectScore = x.SubjectScore ?? 0,
SelectedItem = x.SelectedItem ?? "",
}).ToList();
return getDataLists;
var getDatas= from x in db.Training_TestRecordItem
where x.TestRecordId == testRecordId
select x;
geTestRecordItemCount = getDatas.Count();
if (geTestRecordItemCount == 0)
{
return null;
}
else
{
var getDataLists = from x in getDatas
orderby x.TestType, x.TrainingItemCode
select new Model.TestRecordItemItem
{
TestRecordItemId = x.TestRecordItemId,
TestRecordId = x.TestRecordId,
TrainingItemCode = x.TrainingItemCode,
TrainingItemName = x.TrainingItemName,
Abstracts = x.Abstracts,
AttachUrl = x.AttachUrl.Replace("\\", "/") ?? "",
TestType = x.TestType,
TestTypeName = x.TestType == "1" ? "单选题" : (x.TestType == "2" ? "多选题" : "判断题"),
AItem = x.AItem ?? "",
BItem = x.BItem ?? "",
CItem = x.CItem ?? "",
DItem = x.DItem ?? "",
EItem = x.EItem ?? "",
AnswerItems = x.AnswerItems ?? "",
Score = x.Score ?? 0,
SubjectScore = x.SubjectScore ?? 0,
SelectedItem = x.SelectedItem ?? "",
};
if (pageIndex > 0)
{
return getDataLists.Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
else
{
return getDataLists.ToList();
}
}
}
}
#endregion

View File

@ -176,5 +176,196 @@ namespace BLL
}
}
#endregion
#region
/// <summary>
/// 监视组件
/// </summary>
private static Timer messageTimer1;
/// <summary>
/// 定时清理推送日志
/// </summary>
public static void StartMonitorDeletePushLog()
{
int adTimeJ = 60 * 12;
if (messageTimer1 != null)
{
messageTimer1.Stop();
messageTimer1.Dispose();
messageTimer1 = null;
}
if (adTimeJ > 0)
{
messageTimer1 = new Timer
{
AutoReset = true
};
messageTimer1.Elapsed += new ElapsedEventHandler(DeletePushLog);
messageTimer1.Interval = 1000 * 60 * adTimeJ;// 60分钟 60000 * adTimeJ;
messageTimer1.Start();
}
}
/// <summary>
/// 流程确认 定时执行 系统启动5分钟
/// </summary>
/// <param name="sender">Timer组件</param>
/// <param name="e">事件参数</param>
private static void DeletePushLog(object sender, ElapsedEventArgs e)
{
try
{
/// 3天推送实名制日志
var getPushLogs = Funs.DB.RealName_PushLog.Where(x => x.PushTime.Value.AddDays(3) < DateTime.Now);
if (getPushLogs.Count() > 0)
{
Funs.DB.RealName_PushLog.DeleteAllOnSubmit(getPushLogs);
Funs.DB.SubmitChanges();
}
/// 3个月操作日志
var getSys_Logs = Funs.DB.Sys_Log.Where(x => x.OperationTime.Value.AddMonths(3) < DateTime.Now);
if (getSys_Logs.Count() > 0)
{
Funs.DB.Sys_Log.DeleteAllOnSubmit(getSys_Logs);
Funs.DB.SubmitChanges();
}
/// 1个月推送消息日志
var getSys_HttpLogs = Funs.DB.Sys_HttpLog.Where(x => x.LogTime.Value.AddMonths(1) < DateTime.Now);
if (getSys_HttpLogs.Count() > 0)
{
Funs.DB.Sys_HttpLog.DeleteAllOnSubmit(getSys_HttpLogs);
Funs.DB.SubmitChanges();
}
}
catch (Exception ex)
{
}
}
#endregion
#region
/// <summary>
/// 监视组件
/// </summary>
private static Timer messageTimer2;
/// <summary>
/// 定时清理推送日志
/// </summary>
public static void StartMonitorCleanAttendance()
{
int adTimeJ = 60 * 12;
if (messageTimer2 != null)
{
messageTimer2.Stop();
messageTimer2.Dispose();
messageTimer2 = null;
}
if (adTimeJ > 0)
{
messageTimer2 = new Timer
{
AutoReset = true
};
messageTimer2.Elapsed += new ElapsedEventHandler(CleanAttendance);
messageTimer2.Interval = 1000 * 60 * adTimeJ;// 60分钟 60000 * adTimeJ;
messageTimer2.Start();
}
}
/// <summary>
/// 流程确认 定时执行 系统启动5分钟
/// </summary>
/// <param name="sender">Timer组件</param>
/// <param name="e">事件参数</param>
private static void CleanAttendance(object sender, ElapsedEventArgs e)
{
try
{
/// 清理出入记录
var getRecords = from x in Funs.DB.T_d_facerecord where x.DateTimeRecord.Value.AddDays(1) < DateTime.Now select x;
if (getRecords.Count() > 0)
{
foreach (var item in getRecords)
{
if (item.InOrOut == "进门")
{
var getDelRecordsIn = from x in Funs.DB.T_d_facerecord
where x.ProjectId == item.ProjectId && x.EmployNO == item.EmployNO && x.InOrOut == item.InOrOut
&& x.DateTimeRecord.Value.Year == item.DateTimeRecord.Value.Year
&& x.DateTimeRecord.Value.Month == item.DateTimeRecord.Value.Month
&& x.DateTimeRecord.Value.Day == item.DateTimeRecord.Value.Day
&& x.DateTimeRecord > item.DateTimeRecord
select x;
if (getDelRecordsIn.Count() > 0)
{
Funs.DB.T_d_facerecord.DeleteAllOnSubmit(getDelRecordsIn);
Funs.DB.SubmitChanges();
}
}
else
{
var getDelRecordsOut = from x in Funs.DB.T_d_facerecord
where x.ProjectId == item.ProjectId && x.EmployNO == item.EmployNO && x.InOrOut == item.InOrOut
&& x.DateTimeRecord.Value.Year == item.DateTimeRecord.Value.Year
&& x.DateTimeRecord.Value.Month == item.DateTimeRecord.Value.Month
&& x.DateTimeRecord.Value.Day == item.DateTimeRecord.Value.Day
&& x.DateTimeRecord < item.DateTimeRecord
select x;
if (getDelRecordsOut.Count() > 0)
{
Funs.DB.T_d_facerecord.DeleteAllOnSubmit(getDelRecordsOut);
Funs.DB.SubmitChanges();
}
}
}
}
var getVRecords = from x in Funs.DB.T_d_validcardevent
where x.RecordDateTime.Value.AddDays(1) < DateTime.Now
select x;
if (getVRecords.Count() > 0)
{
foreach (var item in getVRecords)
{
if (item.InOrOut == 1)
{
var getDelVRecordsIn = from x in Funs.DB.T_d_validcardevent
where x.ProjectId == item.ProjectId && x.IDCardNo == item.IDCardNo && x.InOrOut == item.InOrOut
&& x.RecordDateTime.Value.Year == item.RecordDateTime.Value.Year
&& x.RecordDateTime.Value.Month == item.RecordDateTime.Value.Month
&& x.RecordDateTime.Value.Day == item.RecordDateTime.Value.Day
&& x.RecordDateTime > item.RecordDateTime
select x;
if (getDelVRecordsIn.Count() > 0)
{
Funs.DB.T_d_validcardevent.DeleteAllOnSubmit(getDelVRecordsIn);
Funs.DB.SubmitChanges();
}
}
else
{
var getDelVRecordsOut = from x in Funs.DB.T_d_validcardevent
where x.ProjectId == item.ProjectId && x.IDCardNo == item.IDCardNo && x.InOrOut == item.InOrOut
&& x.RecordDateTime.Value.Year == item.RecordDateTime.Value.Year
&& x.RecordDateTime.Value.Month == item.RecordDateTime.Value.Month
&& x.RecordDateTime.Value.Day == item.RecordDateTime.Value.Day
&& x.RecordDateTime < item.RecordDateTime
select x;
if (getDelVRecordsOut.Count() > 0)
{
Funs.DB.T_d_validcardevent.DeleteAllOnSubmit(getDelVRecordsOut);
Funs.DB.SubmitChanges();
}
}
}
}
}
catch (Exception ex)
{
}
}
#endregion
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@ -28,7 +28,6 @@
Funs.SGGLUrl = ConfigurationManager.AppSettings["SGGLUrl"];
Funs.RealNameApiUrl = ConfigurationManager.AppSettings["RealNameApiUrl"];
Funs.ControlApiUrl = ConfigurationManager.AppSettings["ControlApiUrl"];
sysUser = UserService.GetUserByUserId(Const.sysglyId);
}
catch (Exception ex)
@ -64,16 +63,27 @@
{
ErrLogInfo.WriteLog("通用定时器启动失败!", ex);
}
////员工考核定时器
//try
//{
// BLL.MonitorService.StartPersonQuarterCheck();
// BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "员工考核定时器启动成功!");
//}
//catch (Exception ex)
//{
// ErrLogInfo.WriteLog("员工考核定时器启动失败!", ex);
//}
///实名制日志清理定时器
try
{
BLL.RealNameMonitorService.StartMonitorDeletePushLog();
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "实名制日志清理定时器启动成功!");
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("实名制日志清理定时器启动失败!", ex);
}
///考勤记录清理定时器
try
{
BLL.RealNameMonitorService.StartMonitorCleanAttendance();
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "考勤去重定时器启动成功!");
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("实名制日志清理定时器启动失败!", ex);
}
////从集团获取数据定时器
try
{

View File

@ -30,20 +30,23 @@
<Tabs>
<f:Tab ID="Tab1" Title="基础信息" BodyPadding="5px" Layout="VBox" IconFont="Bookmark" runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server"
OnClick="btnSave_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnCustomQuery" Text="自定义查询" Icon="SystemSearch" runat="server"
OnClick="btnCustomQuery_Click" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Form ID="SimpleForm1" LabelAlign="Right" MessageTarget="Qtip" RedStarPosition="BeforeText"
LabelWidth="90px" BodyPadding="5px" ShowBorder="false" ShowHeader="false" runat="server"
AutoScroll="false">
<Items>
<f:Panel ID="Panel3" runat="server" ShowBorder="false" ShowHeader="false" Layout="HBox"
BoxConfigAlign="StretchMax">
@ -123,6 +126,10 @@
</f:TabStrip>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="查询" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="true" runat="server" IsModal="true" Width="1024px" Maximized="true"
Height="620px">
</f:Window>
</form>
</body>
</html>

View File

@ -38,6 +38,10 @@ namespace FineUIPro.Web.Personal
{
/// Tab1加载页面方法
this.Tab1LoadData();
if (this.CurrUser.UserId == Const.hfnbdId)
{
this.btnCustomQuery.Hidden = false;
}
}
}
@ -143,5 +147,10 @@ namespace FineUIPro.Web.Personal
Alert.ShowInParent("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
protected void btnCustomQuery_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../SysManage/CustomQuery.aspx"), "查询"));
}
}
}

View File

@ -75,6 +75,15 @@ namespace FineUIPro.Web.Personal {
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnCustomQuery 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnCustomQuery;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@ -290,5 +299,14 @@ namespace FineUIPro.Web.Personal {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm2;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
}
}

View File

@ -113,7 +113,7 @@ namespace FineUIPro.Web.ProjectData
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
BLL.LogService.AddSys_Log(this.CurrUser, "删除项目用户!", null, BLL.Const.ProjectUserMenuId, BLL.Const.BtnDelete);
var projectUser = BLL.ProjectUserService.GetProjectUserById(Grid1.DataKeys[rowIndex][0].ToString());
if (projectUser != null)
{
@ -123,6 +123,7 @@ namespace FineUIPro.Web.ProjectData
BLL.RoleItemService.DeleteRoleItem(roleItem.RoleItemId);
}
}
BLL.LogService.AddSys_Log(this.CurrUser, "删除项目用户!", projectUser.UserId, BLL.Const.ProjectUserMenuId, BLL.Const.BtnDelete);
BLL.ProjectUserService.DeleteProjectUserById(Grid1.DataKeys[rowIndex][0].ToString());
}

View File

@ -161831,6 +161831,8 @@ namespace Model
private System.Nullable<decimal> _DesignNum;
private System.Nullable<int> _SortIndex;
private EntitySet<JDGL_QuantityCompletion> _JDGL_QuantityCompletion;
private EntityRef<Base_CNProfessional> _Base_CNProfessional;
@ -161853,6 +161855,8 @@ namespace Model
partial void OnUnitChanged();
partial void OnDesignNumChanging(System.Nullable<decimal> value);
partial void OnDesignNumChanged();
partial void OnSortIndexChanging(System.Nullable<int> value);
partial void OnSortIndexChanged();
#endregion
public JDGL_QuantityList()
@ -161991,6 +161995,26 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortIndex", DbType="Int")]
public System.Nullable<int> SortIndex
{
get
{
return this._SortIndex;
}
set
{
if ((this._SortIndex != value))
{
this.OnSortIndexChanging(value);
this.SendPropertyChanging();
this._SortIndex = value;
this.SendPropertyChanged("SortIndex");
this.OnSortIndexChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JDGL_QuantityCompletion_JDGL_QuantityList", Storage="_JDGL_QuantityCompletion", ThisKey="QuantityListId", OtherKey="QuantityListId", DeleteRule="NO ACTION")]
public EntitySet<JDGL_QuantityCompletion> JDGL_QuantityCompletion
{
@ -253097,7 +253121,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(200)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(2000)")]
public string Address
{
get
@ -253161,7 +253185,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(200)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
public string WorkAreaName
{
get
@ -327273,6 +327297,8 @@ namespace Model
private string _Unit;
private System.Nullable<int> _SortIndex;
private System.Nullable<double> _TotalPlanNum;
private System.Nullable<double> _TotalRealNum;
@ -327499,6 +327525,22 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortIndex", DbType="Int")]
public System.Nullable<int> SortIndex
{
get
{
return this._SortIndex;
}
set
{
if ((this._SortIndex != value))
{
this._SortIndex = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalPlanNum", DbType="Float")]
public System.Nullable<double> TotalPlanNum
{
@ -335030,7 +335072,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(200)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(2000)")]
public string Address
{
get
@ -335046,7 +335088,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(200)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
public string WorkAreaName
{
get

View File

@ -192,7 +192,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
var getTestPlan = new Model.SGGLDB(Funs.ConnString).Training_TestPlan.FirstOrDefault(e => e.TestPlanId == testPlanId && e.States != "3" && e.TestStartTime <= DateTime.Now && e.TestEndTime >= DateTime.Now);
var getTestPlan = Funs.DB.Training_TestPlan.FirstOrDefault(e => e.TestPlanId == testPlanId && e.States != "3" && e.TestStartTime <= DateTime.Now && e.TestEndTime >= DateTime.Now);
if (getTestPlan != null)
{
var person = PersonService.GetPersonByUserId(personId, getTestPlan.ProjectId);
@ -201,7 +201,7 @@ namespace WebAPI.Controllers
//2-考试中;生成考试试卷
if (getTestPlan.States == "2" )
{
var testRecord = new Model.SGGLDB(Funs.ConnString).Training_TestRecord.FirstOrDefault(x => x.TestPlanId == getTestPlan.TestPlanId && x.TestManId == person.PersonId && !x.TestEndTime.HasValue);
var testRecord = Funs.DB.Training_TestRecord.FirstOrDefault(x => x.TestPlanId == getTestPlan.TestPlanId && x.TestManId == person.PersonId && !x.TestEndTime.HasValue);
if (testRecord != null)
{
string testRecordId = APITestRecordService.CreateTestRecordItem(getTestPlan, testRecord.TestRecordId, person);
@ -214,7 +214,7 @@ namespace WebAPI.Controllers
if (string.IsNullOrEmpty(getTestPlan.PlanId) && getTestPlan.UnitIds.Contains(person.UnitId) && (getTestPlan.WorkPostIds == null || getTestPlan.WorkPostIds.Contains(person.WorkPostId)))
{
//0-待提交1-已发布未考试 将人员添加进考试记录
var testTRecord = new Model.SGGLDB(Funs.ConnString).Training_TestRecord.FirstOrDefault(x => x.TestPlanId == testPlanId && x.TestManId == personId);
var testTRecord = Funs.DB.Training_TestRecord.FirstOrDefault(x => x.TestPlanId == testPlanId && x.TestManId == personId);
if ((getTestPlan.States == "0" || getTestPlan.States == "1") && testTRecord == null && !string.IsNullOrEmpty(personId))
{
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord

View File

@ -66,12 +66,8 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
var getDataLists = APITestRecordService.geTestRecordItemListByTestRecordId(testRecordId);
int pageCount = getDataLists.Count;
if (pageCount > 0 && pageIndex > 0)
{
getDataLists = getDataLists.OrderBy(x => x.TestType).ThenBy(x => x.TrainingItemCode).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
var getDataLists = APITestRecordService.geTestRecordItemListByTestRecordId(testRecordId, pageIndex);
int pageCount = APITestRecordService.geTestRecordItemCount;
responeData.data = new { pageCount, getDataLists };
}
catch (Exception ex)

View File

@ -1,8 +0,0 @@
publickey
<RSAKeyValue><Modulus>rnq6pYDFkcrpzVtMrLbf2dvDPs2FDo5yeDub6YCnl0hXov3MVEVMbVe3NCnC5Thl3dwm14yI9/vNIGdH5M4getAkMnkG8tNA60NPjtHUzyoZSpVYCUOmB30s5vx+4IBkPh8R4ynkJYyUxkl61/0h6y7A86qz4jNivxAKt2a0vQxk=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>
privatekey
<RSAKeyValue><Modulus>1oowM965L1r9NM10IruHI+4v4cF8cMrZ1PMaG/D1oNOww8YGEYjKiQ2iAjAtJi4OQX6sxI7BHJad/CGNKeE12ywplO18J8vL/YvEq38DMen22ungNAjSmC6zmIngvBrIiyW2Cyws/9JQKxT02I1tZlEQ9q4ZxCc3PLFazTD0sIk=</Modulus><Exponent>AQAB</Exponent><P>2K+KCTgEGJAvPzB6pYcDmE2n/gIIy6dOiaNQtTWRUrttC+DaU8ZlORlYH6+lWcekYhGnf+dVjfuGE3w45JVKxw==</P><Q>/Xb6T/4tizVbVpjLd47SN+c1yEcCubLhv7HHd/9E2K5olboWvOGxUbr53F4FOmTu9CWpybbCKLReJWPQxq5aLw==</Q><DP>eA1Ztx3X9xv7cVEUwpz5OurbhnnuEZdShiN71comB+Zb1lbv37Zt4qLOFlAklodr5gHOAalT12Rhtm3+v3aPhQ==</DP><DQ>5VjUNK+1PEKijGAjs+I627TN2JRQpgFz/gX6jN0hycM/BURmMLEzxtWeI0W8C1OrWKX/1XMWishya/i+wBihpw==</DQ><InverseQ>wE16uAx/ztTMObpArwC2eGhh+oCwXsnUPoFSQtLHeEbxx/Cf424wKr2ceV/Fe9YKQp5XLdOpJkCDDAF+2k4X1A==</InverseQ><D>0rF/yVEQeQtY5ERpq7qTa5v99i448eSlrVbZ61rnP3zmej29s/atQY/b7V422OoeIgAv2BGCYXshyH2CzwBYDAtGkz+qvaZtPvWIYPadTvgU5W/QgX8r/ozqFBHu17APSSBmJWulShxj6r9kOmgxW4HzwVQ/iQgyQ5Z+qgpf50k=</D></RSAKeyValue>

View File

@ -1,13 +0,0 @@
1、
2、另外在手动考勤的下拉菜单中已出场人员应该不自动显示
3、
4、
5、

View File

@ -1,38 +0,0 @@
单点登录的方式
五环系统点击链接https://zhgd.cwcec.com/Login.html?data=****&basedata=****
免登录进入智慧工地的系统
data参数说明
data字符串是用户名和时间戳用RSA公钥加密后的字符串。例如
userName=zhangsan&timespan=1256015312用公钥加密后生成****
basedata参数说明
basedata字符串是用户名和时间戳用RSA公钥加密后再用Base64加密一次
生成的加密字符串。例如:
userName=zhangsan&timespan=1256015312用公钥加密后再用Base64加密
为了解决有的解密过程中出现"+"或者"="这样的特殊字符。推荐截取basedata的
字符串解密。
解密方式
data或者basedata都是用公钥进行RSA加密需要用我们提供的私钥对加密文件进行解密判断用户名是否在系统中并且当前时间-时间戳<30秒钟才能登录到系统中否则需要输入账号密码
三、.net解密的函数参考
string userdata = context.Request["database"].ToString();
string privatekey = ****(我们会提供)
string result = RSADecrypt(privatekey, userdata); //经过RSA解密后获得的域登录名+时间戳
/// <summary>
/// <summary>
/// 用私钥对数据进行RSA解密
/// </summary>
/// <param name="privatekey"></param>
/// <param name="content"></param>
/// <returns></returns>
public static string RSADecrypt(string privatekey, string content)
{
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
byte[] cipherbytes;
rsa.FromXmlString(privatekey);
//对参数content进行两次base64解密
cipherbytes = rsa.Decrypt(Convert.FromBase64String(Encoding.UTF8.GetString(Convert.FromBase64String(content))), false);
return Encoding.UTF8.GetString(cipherbytes);
}