0522-004
This commit is contained in:
commit
d33b007348
|
@ -5,5 +5,4 @@
|
||||||
/SGGLPackFile/PackFile/bin
|
/SGGLPackFile/PackFile/bin
|
||||||
/SGGLPackFile
|
/SGGLPackFile
|
||||||
/SGGL/FineUIPro.Web/File/Excel/Temp
|
/SGGL/FineUIPro.Web/File/Excel/Temp
|
||||||
/SGGL/FineUIPro.Web/common
|
|
||||||
/SGGL/FineUIPro.Web/FileUpload/QRCodeFile
|
/SGGL/FineUIPro.Web/FileUpload/QRCodeFile
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ namespace BLL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
request.Headers.Add("token", "AF17168B-87BD-4GLY-1111-F0A0A1158F9B");
|
request.Headers.Add("token", "AF17168B-87BD-4GLY-1111-F0A0A1158F9B");
|
||||||
|
request.Timeout = 20000; /// 设置5秒超时
|
||||||
if (!string.IsNullOrEmpty(data))
|
if (!string.IsNullOrEmpty(data))
|
||||||
{
|
{
|
||||||
Stream RequestStream = request.GetRequestStream();
|
Stream RequestStream = request.GetRequestStream();
|
||||||
|
@ -92,7 +93,7 @@ namespace BLL
|
||||||
|
|
||||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||||
request.Method = string.IsNullOrEmpty(method) ? "GET" : method;
|
request.Method = string.IsNullOrEmpty(method) ? "GET" : method;
|
||||||
request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype;
|
request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype;
|
||||||
if (header != null)
|
if (header != null)
|
||||||
{
|
{
|
||||||
foreach (var i in header.Keys)
|
foreach (var i in header.Keys)
|
||||||
|
@ -161,6 +162,7 @@ namespace BLL
|
||||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||||
request.Method = string.IsNullOrEmpty(method) ? "GET" : method;
|
request.Method = string.IsNullOrEmpty(method) ? "GET" : method;
|
||||||
request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype;
|
request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype;
|
||||||
|
request.Timeout = 20000; /// 设置5秒超时
|
||||||
if (header != null)
|
if (header != null)
|
||||||
{
|
{
|
||||||
foreach (var i in header.Keys)
|
foreach (var i in header.Keys)
|
||||||
|
|
|
@ -56,35 +56,38 @@ namespace BLL
|
||||||
{
|
{
|
||||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||||
{
|
{
|
||||||
var getDataLists = from x in db.Training_TestPlan
|
Model.TestPlanItem returnItem = new Model.TestPlanItem();
|
||||||
where x.TestPlanId == testPlanId
|
var getTestP = db.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == testPlanId);
|
||||||
select new Model.TestPlanItem
|
if (getTestP != null)
|
||||||
{
|
{
|
||||||
TestPlanId = x.TestPlanId,
|
returnItem.TestPlanId = getTestP.TestPlanId;
|
||||||
ProjectId = x.ProjectId,
|
returnItem.ProjectId = getTestP.ProjectId;
|
||||||
TestPlanCode = x.PlanCode,
|
returnItem.TestPlanCode = getTestP.PlanCode;
|
||||||
TestPlanName = x.PlanName,
|
returnItem.TestPlanName = getTestP.PlanName;
|
||||||
TestPlanManId = x.PlanManId,
|
returnItem.TestPlanManId = getTestP.PlanManId;
|
||||||
TestPlanManName = db.Sys_User.First(y => y.UserId == x.TestPlanId).UserName,
|
returnItem.TestPlanManName = UserService.GetUserNameByUserId(getTestP.PlanManId);
|
||||||
TestPlanDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.PlanDate),
|
returnItem.TestPlanDate = getTestP.PlanDate.HasValue ? string.Format("{0:yyyy-MM-dd HH:mm}", getTestP.PlanDate) : "";
|
||||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
returnItem.TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", getTestP.TestStartTime);
|
||||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
returnItem.TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", getTestP.TestEndTime);
|
||||||
Duration = x.Duration,
|
returnItem.Duration = getTestP.Duration;
|
||||||
SValue = x.SValue,
|
returnItem.SValue = getTestP.SValue;
|
||||||
MValue = x.MValue,
|
returnItem.MValue = getTestP.MValue;
|
||||||
JValue = x.JValue,
|
returnItem.JValue = getTestP.JValue;
|
||||||
TotalScore = x.TotalScore ?? 0,
|
returnItem.TotalScore = getTestP.TotalScore ?? 0;
|
||||||
QuestionCount = x.QuestionCount ?? 0,
|
returnItem.QuestionCount = getTestP.QuestionCount ?? 0;
|
||||||
TestPalce = x.TestPalce,
|
returnItem.TestPalce = getTestP.TestPalce;
|
||||||
UnitIds = x.UnitIds,
|
returnItem.UnitIds = getTestP.UnitIds;
|
||||||
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
returnItem.UnitNames = UnitService.getUnitNamesUnitIds(getTestP.UnitIds);
|
||||||
WorkPostIds = x.WorkPostIds,
|
returnItem.WorkPostIds = getTestP.WorkPostIds;
|
||||||
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostIds),
|
returnItem.WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(getTestP.WorkPostIds);
|
||||||
States = x.States,
|
returnItem.States = getTestP.States;
|
||||||
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
|
if (!string.IsNullOrEmpty(getTestP.QRCodeUrl))
|
||||||
TrainingPlanId = x.PlanId,
|
{
|
||||||
};
|
returnItem.QRCodeUrl = getTestP.QRCodeUrl.Replace('\\', '/');
|
||||||
return getDataLists.FirstOrDefault();
|
}
|
||||||
|
returnItem.TrainingPlanId = getTestP.PlanId;
|
||||||
|
}
|
||||||
|
return returnItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -21,6 +21,7 @@ namespace BLL
|
||||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||||
{
|
{
|
||||||
var getDataLists = (from x in db.Training_TestRecord
|
var getDataLists = (from x in db.Training_TestRecord
|
||||||
|
join y in db.SitePerson_Person on x.TestManId equals y.PersonId
|
||||||
where x.TestPlanId == testPlanId
|
where x.TestPlanId == testPlanId
|
||||||
orderby x.TestStartTime descending
|
orderby x.TestStartTime descending
|
||||||
select new Model.TestRecordItem
|
select new Model.TestRecordItem
|
||||||
|
@ -29,7 +30,7 @@ namespace BLL
|
||||||
ProjectId = x.ProjectId,
|
ProjectId = x.ProjectId,
|
||||||
TestPlanId = x.TestPlanId,
|
TestPlanId = x.TestPlanId,
|
||||||
TestManId = x.TestManId,
|
TestManId = x.TestManId,
|
||||||
TestManName = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == x.TestManId).PersonName,
|
TestManName = y.PersonName,
|
||||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||||
TestScores = x.TestScores ?? 0,
|
TestScores = x.TestScores ?? 0,
|
||||||
|
@ -39,6 +40,25 @@ namespace BLL
|
||||||
return getDataLists;
|
return getDataLists;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据TestPlanId获取考试人员列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="testPlanId"></param>
|
||||||
|
/// <returns>考试人员</returns>
|
||||||
|
public static string getTestRecordTestManByTestPlanId(string testPlanId)
|
||||||
|
{
|
||||||
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||||
|
{
|
||||||
|
string name = string.Empty;
|
||||||
|
var getManList = db.Training_TestRecord.Where(x => x.TestPlanId == testPlanId).Select(x => x.TestManId).Distinct();
|
||||||
|
if (getManList.Count() > 0)
|
||||||
|
{
|
||||||
|
name = PersonService.getPersonsPersonIds(getManList.ToList());
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 根据试卷ID获取试卷记录详细
|
#region 根据试卷ID获取试卷记录详细
|
||||||
|
@ -99,14 +119,32 @@ namespace BLL
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
List<Model.Training_TestTrainingItem> getTestTrainingItemList = new List<Model.Training_TestTrainingItem>();
|
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
|
var testPlanTrainings = from x in db.Training_TestPlanTraining
|
||||||
where x.TestPlanId == getTestPlan.TestPlanId
|
where x.TestPlanId == getTestPlan.TestPlanId
|
||||||
select x;
|
select x;
|
||||||
//// 计划考试中单选、多选、判断题总数
|
if (testPlanTrainings.Count() > 0)
|
||||||
int sumTestType1Count = testPlanTrainings.Sum(x => x.TestType1Count) ?? 0;
|
{
|
||||||
int sumTestType2Count = testPlanTrainings.Sum(x => x.TestType2Count) ?? 0;
|
//// 计划考试中单选、多选、判断题总数
|
||||||
int sumTestType3Count = testPlanTrainings.Sum(x => x.TestType3Count) ?? 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
|
var getTestTrainingItemALLs = from x in db.Training_TestTrainingItem
|
||||||
where x.TrainingId != null && (x.WorkPostIds == null || (x.WorkPostIds.Contains(person.WorkPostId) && person.WorkPostId != null))
|
where x.TrainingId != null && (x.WorkPostIds == null || (x.WorkPostIds.Contains(person.WorkPostId) && person.WorkPostId != null))
|
||||||
|
@ -331,38 +369,64 @@ namespace BLL
|
||||||
|
|
||||||
#region 根据TestRecordId获取试卷题目列表
|
#region 根据TestRecordId获取试卷题目列表
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 记录数
|
||||||
|
/// </summary>
|
||||||
|
public static int geTestRecordItemCount
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 根据TestRecordId获取试卷题目列表
|
/// 根据TestRecordId获取试卷题目列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="testPlanId"></param>
|
/// <param name="testPlanId"></param>
|
||||||
/// <returns>考试人员</returns>
|
/// <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))
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||||
{
|
{
|
||||||
var getDataLists = (from x in db.Training_TestRecordItem
|
var getDatas= from x in db.Training_TestRecordItem
|
||||||
where x.TestRecordId == testRecordId
|
where x.TestRecordId == testRecordId
|
||||||
orderby x.TestType, x.TrainingItemCode
|
select x;
|
||||||
select new Model.TestRecordItemItem
|
geTestRecordItemCount = getDatas.Count();
|
||||||
{
|
if (geTestRecordItemCount == 0)
|
||||||
TestRecordItemId = x.TestRecordItemId,
|
{
|
||||||
TestRecordId = x.TestRecordId,
|
return null;
|
||||||
TrainingItemCode = x.TrainingItemCode,
|
}
|
||||||
TrainingItemName = x.TrainingItemName,
|
else
|
||||||
Abstracts = x.Abstracts,
|
{
|
||||||
AttachUrl = x.AttachUrl.Replace("\\", "/") ?? "",
|
var getDataLists = from x in getDatas
|
||||||
TestType = x.TestType,
|
orderby x.TestType, x.TrainingItemCode
|
||||||
TestTypeName = x.TestType == "1" ? "单选题" : (x.TestType == "2" ? "多选题" : "判断题"),
|
select new Model.TestRecordItemItem
|
||||||
AItem = x.AItem ?? "",
|
{
|
||||||
BItem = x.BItem ?? "",
|
TestRecordItemId = x.TestRecordItemId,
|
||||||
CItem = x.CItem ?? "",
|
TestRecordId = x.TestRecordId,
|
||||||
DItem = x.DItem ?? "",
|
TrainingItemCode = x.TrainingItemCode,
|
||||||
EItem = x.EItem ?? "",
|
TrainingItemName = x.TrainingItemName,
|
||||||
AnswerItems = x.AnswerItems ?? "",
|
Abstracts = x.Abstracts,
|
||||||
Score = x.Score ?? 0,
|
AttachUrl = x.AttachUrl.Replace("\\", "/") ?? "",
|
||||||
SubjectScore = x.SubjectScore ?? 0,
|
TestType = x.TestType,
|
||||||
SelectedItem = x.SelectedItem ?? "",
|
TestTypeName = x.TestType == "1" ? "单选题" : (x.TestType == "2" ? "多选题" : "判断题"),
|
||||||
}).ToList();
|
AItem = x.AItem ?? "",
|
||||||
return getDataLists;
|
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
|
#endregion
|
||||||
|
|
|
@ -63,7 +63,8 @@ namespace BLL
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(workPostIds))
|
if (!string.IsNullOrEmpty(workPostIds))
|
||||||
{
|
{
|
||||||
getPersonList = getPersonList.Where(x => workPostIds.Contains(x.WorkPostId));
|
List<string> wIds = Funs.GetStrListByStr(workPostIds, ',');
|
||||||
|
getPersonList = getPersonList.Where(x => wIds.Contains(x.WorkPostId));
|
||||||
}
|
}
|
||||||
if (ckTrain)
|
if (ckTrain)
|
||||||
{
|
{
|
||||||
|
@ -197,6 +198,30 @@ namespace BLL
|
||||||
return personId;
|
return personId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 根据多用户ID得到用户名称字符串
|
||||||
|
/// <summary>
|
||||||
|
/// 根据多用户ID得到用户名称字符串
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bigType"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string getPersonsPersonIds(List<string> personIds)
|
||||||
|
{
|
||||||
|
string personName = string.Empty;
|
||||||
|
foreach (string id in personIds)
|
||||||
|
{
|
||||||
|
var q = GetPersonNameById(id);
|
||||||
|
if (q != null)
|
||||||
|
{
|
||||||
|
personName += q + ",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(personName))
|
||||||
|
{
|
||||||
|
personName = personName.Substring(0, personName.Length - 1); ;
|
||||||
|
}
|
||||||
|
return personName;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据UserId主键获取人员信息
|
/// 根据UserId主键获取人员信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -7,23 +7,19 @@ namespace BLL
|
||||||
{
|
{
|
||||||
public class RealNameMonitorService
|
public class RealNameMonitorService
|
||||||
{
|
{
|
||||||
#region 启动监视器 系统启动5分钟
|
#region 启动监视器 系统启动5分钟
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 监视组件
|
/// 监视组件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static Timer messageTimer;
|
// private static Timer messageTimer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 系统启动5分钟
|
/// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 系统启动5分钟
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void StartMonitor()
|
public static void StartMonitor(string jtProCode)
|
||||||
{
|
{
|
||||||
int adTimeJ = Funs.GetNewInt(ConfigurationManager.AppSettings["Intervaltime"]) ?? 30;
|
int adTimeJ = Funs.GetNewInt(ConfigurationManager.AppSettings["Intervaltime"]) ?? 30;
|
||||||
//var getSynchroSet = Funs.DB.RealName_SynchroSet.FirstOrDefault();
|
Timer messageTimer = new Timer();
|
||||||
//if (getSynchroSet != null && getSynchroSet.Intervaltime.HasValue)
|
|
||||||
//{
|
|
||||||
// adTimeJ = getSynchroSet.Intervaltime.Value;
|
|
||||||
//}
|
|
||||||
if (messageTimer != null)
|
if (messageTimer != null)
|
||||||
{
|
{
|
||||||
messageTimer.Stop();
|
messageTimer.Stop();
|
||||||
|
@ -36,7 +32,8 @@ namespace BLL
|
||||||
{
|
{
|
||||||
AutoReset = true
|
AutoReset = true
|
||||||
};
|
};
|
||||||
messageTimer.Elapsed += new ElapsedEventHandler(AdUserInProcess);
|
messageTimer.Elapsed += (sender, args) => AdUserInProcess(sender, jtProCode);
|
||||||
|
//messageTimer.Elapsed += new ElapsedEventHandler(AdUserInProcess);
|
||||||
messageTimer.Interval = 1000 * 60 * adTimeJ;// 60分钟 60000 * adTimeJ;
|
messageTimer.Interval = 1000 * 60 * adTimeJ;// 60分钟 60000 * adTimeJ;
|
||||||
messageTimer.Start();
|
messageTimer.Start();
|
||||||
}
|
}
|
||||||
|
@ -47,34 +44,25 @@ namespace BLL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender">Timer组件</param>
|
/// <param name="sender">Timer组件</param>
|
||||||
/// <param name="e">事件参数</param>
|
/// <param name="e">事件参数</param>
|
||||||
private static void AdUserInProcess(object sender, ElapsedEventArgs e)
|
public static void AdUserInProcess(object sender, string jtProCode)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SynchroSetService.PushCollCompany();
|
SynchroSetService.PushCollCompany();
|
||||||
var getRProjects = from x in Funs.DB.RealName_Project
|
if (!string.IsNullOrEmpty(jtProCode))
|
||||||
select x;
|
|
||||||
if (getRProjects.Count() > 0)
|
|
||||||
{
|
{
|
||||||
foreach (var item in getRProjects)
|
SynchroSetService.PushProCollCompany(jtProCode);
|
||||||
{
|
SynchroSetService.PushCollTeam(jtProCode);
|
||||||
var getSynchroSet = Funs.DB.RealName_SynchroSet.FirstOrDefault(x => x.ProCode == item.JTproCode);
|
SynchroSetService.getCollTeam(jtProCode);
|
||||||
if (getSynchroSet != null && !string.IsNullOrEmpty(item.JTproCode))
|
SynchroSetService.PushPersons(Const.BtnAdd, jtProCode, null);
|
||||||
{
|
SynchroSetService.PushPersons(Const.BtnModify, jtProCode, null);
|
||||||
SynchroSetService.PushProCollCompany(item.JTproCode);
|
SynchroSetService.PushAttendance(jtProCode);
|
||||||
//SynchroSetService.PushCollTeam(item.ProCode);
|
SynchroSetService.updatePersonsExitTime(jtProCode);
|
||||||
//SynchroSetService.getCollTeam(item.ProCode);
|
|
||||||
SynchroSetService.PushPersons(Const.BtnAdd, item.JTproCode, null);
|
|
||||||
SynchroSetService.PushPersons(Const.BtnModify, item.JTproCode, null);
|
|
||||||
SynchroSetService.PushAttendance(item.JTproCode);
|
|
||||||
SynchroSetService.updatePersonsExitTime(item.JTproCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
StartMonitor();
|
StartMonitor(jtProCode);
|
||||||
ErrLogInfo.WriteLog(ex, "数据接口定时器", "RealNameMonitorService.AdUserInProcess");
|
ErrLogInfo.WriteLog(ex, "数据接口定时器", "RealNameMonitorService.AdUserInProcess");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,5 +164,196 @@ namespace BLL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,11 @@ namespace BLL
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public static List<Model.RealName_Project> GetRealNameProject()
|
||||||
|
{
|
||||||
|
return (from x in Funs.DB.RealName_Project select x).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
#region 项目基础数据下拉框
|
#region 项目基础数据下拉框
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表下拉框
|
/// 表下拉框
|
||||||
|
@ -1426,7 +1431,14 @@ namespace BLL
|
||||||
|
|
||||||
addTeam(getData.Select(x => x.TeamGroupId).Distinct().ToList(), newToken);
|
addTeam(getData.Select(x => x.TeamGroupId).Distinct().ToList(), newToken);
|
||||||
getTeam(proCode, newToken);
|
getTeam(proCode, newToken);
|
||||||
addPerson(getData.Select(x => x.PersonId).Distinct().ToList(), newToken);
|
|
||||||
|
var getPersonS = getData.Select(x => x.idcardNumber).Distinct().ToList();
|
||||||
|
foreach (var pitem in getPersonS)
|
||||||
|
{
|
||||||
|
PushPersonsByIdentityCard(Const.BtnAdd, proCode, pitem);
|
||||||
|
PushPersonsByIdentityCard(Const.BtnModify, proCode, pitem);
|
||||||
|
}
|
||||||
|
|
||||||
pushContent = JsonConvert.SerializeObject(listObject);
|
pushContent = JsonConvert.SerializeObject(listObject);
|
||||||
var returndata = BLL.APIGetHttpService.OutsideHttp(url, "POST", null, newToken, pushContent);
|
var returndata = BLL.APIGetHttpService.OutsideHttp(url, "POST", null, newToken, pushContent);
|
||||||
if (!string.IsNullOrEmpty(returndata))
|
if (!string.IsNullOrEmpty(returndata))
|
||||||
|
|
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 |
|
@ -58,7 +58,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Apache.NMS, Version=1.8.0.0, Culture=neutral, PublicKeyToken=82756feee3957618, processorArchitecture=MSIL">
|
<Reference Include="Apache.NMS, Version=1.8.0.0, Culture=neutral, PublicKeyToken=82756feee3957618, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>bin\Apache.NMS.dll</HintPath>
|
<HintPath>..\..\..\..\DepCode\reference-bll\Reference BLL\Apache.NMS.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Apache.NMS.ActiveMQ, Version=1.7.2.4108, Culture=neutral, PublicKeyToken=82756feee3957618, processorArchitecture=MSIL">
|
<Reference Include="Apache.NMS.ActiveMQ, Version=1.7.2.4108, Culture=neutral, PublicKeyToken=82756feee3957618, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Apache.NMS.ActiveMQ.1.7.2\lib\net40\Apache.NMS.ActiveMQ.dll</HintPath>
|
<HintPath>..\packages\Apache.NMS.ActiveMQ.1.7.2\lib\net40\Apache.NMS.ActiveMQ.dll</HintPath>
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
namespace FineUIPro.Web
|
namespace FineUIPro.Web
|
||||||
{
|
{
|
||||||
|
using BLL;
|
||||||
|
using Model;
|
||||||
using System;
|
using System;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using BLL;
|
using System.Timers;
|
||||||
using Model;
|
|
||||||
|
|
||||||
public class Global : System.Web.HttpApplication
|
public class Global : System.Web.HttpApplication
|
||||||
{
|
{
|
||||||
|
@ -17,7 +18,6 @@
|
||||||
protected void Application_Start(object sender, EventArgs e)
|
protected void Application_Start(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Application["OnlineUserCount"] = 0;
|
Application["OnlineUserCount"] = 0;
|
||||||
Model.Sys_User sysUser = new Sys_User();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Funs.RootPath = Server.MapPath("~/");
|
Funs.RootPath = Server.MapPath("~/");
|
||||||
|
@ -27,26 +27,34 @@
|
||||||
Funs.SystemName = ConfigurationManager.AppSettings["SystemName"];
|
Funs.SystemName = ConfigurationManager.AppSettings["SystemName"];
|
||||||
Funs.SGGLUrl = ConfigurationManager.AppSettings["SGGLUrl"];
|
Funs.SGGLUrl = ConfigurationManager.AppSettings["SGGLUrl"];
|
||||||
Funs.RealNameApiUrl = ConfigurationManager.AppSettings["RealNameApiUrl"];
|
Funs.RealNameApiUrl = ConfigurationManager.AppSettings["RealNameApiUrl"];
|
||||||
Funs.ControlApiUrl = ConfigurationManager.AppSettings["ControlApiUrl"];
|
Funs.ControlApiUrl = ConfigurationManager.AppSettings["ControlApiUrl"];
|
||||||
|
Funs.SystemVersion = ConfigurationManager.AppSettings["SystemVersion"];
|
||||||
sysUser = UserService.GetUserByUserId(Const.sysglyId);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
ErrLogInfo.WriteLog(string.Empty, ex);
|
ErrLogInfo.WriteLog(string.Empty, ex);
|
||||||
//AppDomain.Unload(AppDomain.CurrentDomain);
|
//AppDomain.Unload(AppDomain.CurrentDomain);
|
||||||
}
|
}
|
||||||
|
///实名制出入记录去重
|
||||||
////实名制同步定时器
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BLL.RealNameMonitorService.StartInOutMonitor();
|
BLL.RealNameMonitorService.StartInOutMonitor();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ErrLogInfo.WriteLog("实名制出入记录去重定时器启动失败!", ex);
|
||||||
|
}
|
||||||
|
////实名制同步定时器
|
||||||
|
try
|
||||||
|
{
|
||||||
if (ConfigurationManager.AppSettings["EnableRealName"] == "True")
|
if (ConfigurationManager.AppSettings["EnableRealName"] == "True")
|
||||||
{
|
{
|
||||||
BLL.RealNameMonitorService.StartMonitor();
|
var getProjects = SynchroSetService.GetRealNameProject();
|
||||||
|
foreach (var item in getProjects)
|
||||||
|
{
|
||||||
|
BLL.RealNameMonitorService.StartMonitor(item.JTproCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
BLL.RealNameMonitorService.StartInOutMonitor();
|
|
||||||
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "实名制同步定时器启动成功!");
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -58,27 +66,33 @@
|
||||||
BLL.MonitorService.StartMonitor();
|
BLL.MonitorService.StartMonitor();
|
||||||
BLL.MonitorService.StartMonitorEve();
|
BLL.MonitorService.StartMonitorEve();
|
||||||
BLL.MonitorService.StartPersonQuarterCheck();
|
BLL.MonitorService.StartPersonQuarterCheck();
|
||||||
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "通用定时器启动成功!");
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
ErrLogInfo.WriteLog("通用定时器启动失败!", ex);
|
ErrLogInfo.WriteLog("通用定时器启动失败!", ex);
|
||||||
}
|
}
|
||||||
////员工考核定时器
|
///实名制日志清理定时器
|
||||||
//try
|
try
|
||||||
//{
|
{
|
||||||
// BLL.MonitorService.StartPersonQuarterCheck();
|
BLL.RealNameMonitorService.StartMonitorDeletePushLog();
|
||||||
// BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "员工考核定时器启动成功!");
|
}
|
||||||
//}
|
catch (Exception ex)
|
||||||
//catch (Exception ex)
|
{
|
||||||
//{
|
ErrLogInfo.WriteLog("实名制日志清理定时器启动失败!", ex);
|
||||||
// ErrLogInfo.WriteLog("员工考核定时器启动失败!", ex);
|
}
|
||||||
//}
|
///考勤记录清理定时器
|
||||||
|
try
|
||||||
|
{
|
||||||
|
BLL.RealNameMonitorService.StartMonitorCleanAttendance();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ErrLogInfo.WriteLog("实名制日志清理定时器启动失败!", ex);
|
||||||
|
}
|
||||||
////从集团获取数据定时器
|
////从集团获取数据定时器
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BLL.MCSWebService.StartMonitor();
|
BLL.MCSWebService.StartMonitor();
|
||||||
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "从材料软件获取数据定时器启动成功!");
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -88,18 +102,15 @@
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BLL.CNCECHSSEMonitorService.StartMonitor();
|
BLL.CNCECHSSEMonitorService.StartMonitor();
|
||||||
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "从集团获取数据定时器启动成功!");
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
ErrLogInfo.WriteLog("从集团获取数据定时器启动失败!", ex);
|
ErrLogInfo.WriteLog("从集团获取数据定时器启动失败!", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
////从博晟获取培训考试数据定时器
|
////从博晟获取培训考试数据定时器
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BLL.BOSHENGMonitorService.StartMonitor();
|
BLL.BOSHENGMonitorService.StartMonitor();
|
||||||
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "从博晟获取培训考试数据定时器启动成功!");
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -229,7 +229,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||||
{
|
{
|
||||||
DateTime inToOutTime = Convert.ToDateTime(col4);
|
DateTime inToOutTime = Convert.ToDateTime(col4);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
result += "第" + (i + 2).ToString() + "行," + "时间" + "," + "[" + col4 + "]错误!" + "|";
|
result += "第" + (i + 2).ToString() + "行," + "时间" + "," + "[" + col4 + "]错误!" + "|";
|
||||||
}
|
}
|
||||||
|
@ -407,26 +407,43 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(errorInfos))
|
if (string.IsNullOrEmpty(errorInfos))
|
||||||
{
|
{
|
||||||
int a = viewCheckings.Count();
|
foreach (var item in viewCheckings)
|
||||||
for (int i = 0; i < a; i++)
|
|
||||||
{
|
{
|
||||||
Model.SitePerson_Checking newChecking = new Model.SitePerson_Checking
|
var getCheck = Funs.DB.SitePerson_Checking.FirstOrDefault(x => x.CheckingId == item.CheckingId);
|
||||||
|
if (getCheck == null)
|
||||||
{
|
{
|
||||||
CheckingId = viewCheckings[i].CheckingId,
|
Model.SitePerson_Checking newChecking = new Model.SitePerson_Checking
|
||||||
ProjectId = viewCheckings[i].ProjectId,
|
{
|
||||||
IdentityCard = viewCheckings[i].IdentityCard,
|
CheckingId = item.CheckingId,
|
||||||
IntoOutTime = viewCheckings[i].IntoOutTime,
|
ProjectId = item.ProjectId,
|
||||||
IntoOut = viewCheckings[i].IntoOut,
|
IdentityCard = item.IdentityCard,
|
||||||
PersonId = viewCheckings[i].PersonId
|
IntoOutTime = item.IntoOutTime,
|
||||||
};
|
IntoOut = item.IntoOut,
|
||||||
BLL.SitePerson_CheckingService.AddPersonInfo(newChecking);
|
PersonId = item.PersonId
|
||||||
|
};
|
||||||
|
BLL.SitePerson_CheckingService.AddPersonInfo(newChecking);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
//int a = viewCheckings.Count();
|
||||||
|
//for (int i = 0; i < a; i++)
|
||||||
|
//{
|
||||||
|
// Model.SitePerson_Checking newChecking = new Model.SitePerson_Checking
|
||||||
|
// {
|
||||||
|
// CheckingId = viewCheckings[i].CheckingId,
|
||||||
|
// ProjectId = viewCheckings[i].ProjectId,
|
||||||
|
// IdentityCard = viewCheckings[i].IdentityCard,
|
||||||
|
// IntoOutTime = viewCheckings[i].IntoOutTime,
|
||||||
|
// IntoOut = viewCheckings[i].IntoOut,
|
||||||
|
// PersonId = viewCheckings[i].PersonId
|
||||||
|
// };
|
||||||
|
// BLL.SitePerson_CheckingService.AddPersonInfo(newChecking);
|
||||||
|
//}
|
||||||
string rootPath = Server.MapPath("~/");
|
string rootPath = Server.MapPath("~/");
|
||||||
string initFullPath = rootPath + initPath;
|
string initFullPath = rootPath + initPath;
|
||||||
string filePath = initFullPath + this.hdFileName.Text;
|
string filePath = initFullPath + this.hdFileName.Text;
|
||||||
if (filePath != string.Empty && System.IO.File.Exists(filePath))
|
if (filePath != string.Empty && System.IO.File.Exists(filePath))
|
||||||
{
|
{
|
||||||
System.IO.File.Delete(filePath);//删除上传的XLS文件
|
File.Delete(filePath);//删除上传的XLS文件
|
||||||
}
|
}
|
||||||
ShowNotify("导入成功!", MessageBoxIcon.Success);
|
ShowNotify("导入成功!", MessageBoxIcon.Success);
|
||||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="wrapper" class="dec-login bi-absolute-layout dec-login-fresh">
|
<div id="wrapper" class="dec-login bi-absolute-layout dec-login-fresh">
|
||||||
<img alt="" class="bi-single bi-img display-block"
|
<%-- <img alt="" class="bi-single bi-img display-block"
|
||||||
src="./images/login.png"
|
src="./images/login.png"
|
||||||
style="height: 100%; left: 0px; top: 0px; bottom: 0px; position: absolute; display: none;" />
|
style="height: 100%; left: 0px; top: 0px; bottom: 0px; position: absolute; display: none;" />--%>
|
||||||
<img alt=""
|
<img alt=""
|
||||||
src="res/index/images/iconlogo.png"
|
src="res/index/images/iconlogo.png"
|
||||||
style="height: auto;width:300px; left: 100px; top: 60px; position: absolute;" />
|
style="height: auto;width:300px; left: 100px; top: 60px; position: absolute;" />
|
||||||
|
|
|
@ -30,20 +30,24 @@
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<f:Tab ID="Tab1" Title="基础信息" BodyPadding="5px" Layout="VBox" IconFont="Bookmark" runat="server">
|
<f:Tab ID="Tab1" Title="基础信息" BodyPadding="5px" Layout="VBox" IconFont="Bookmark" runat="server">
|
||||||
<Toolbars>
|
<Toolbars>
|
||||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||||
<Items>
|
<Items>
|
||||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
<f:Label runat="server" ID="lbSystemVersion" Hidden="true" Label="系统版本"></f:Label>
|
||||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server"
|
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||||
OnClick="btnSave_Click">
|
<f:Button ID="btnSave" Icon="SystemSave" runat="server"
|
||||||
</f:Button>
|
OnClick="btnSave_Click">
|
||||||
</Items>
|
</f:Button>
|
||||||
</f:Toolbar>
|
<f:Button ID="btnCustomQuery" Text="自定义查询" Icon="SystemSearch" runat="server"
|
||||||
</Toolbars>
|
OnClick="btnCustomQuery_Click" Hidden="true">
|
||||||
|
</f:Button>
|
||||||
|
</Items>
|
||||||
|
</f:Toolbar>
|
||||||
|
</Toolbars>
|
||||||
<Items>
|
<Items>
|
||||||
<f:Form ID="SimpleForm1" LabelAlign="Right" MessageTarget="Qtip" RedStarPosition="BeforeText"
|
<f:Form ID="SimpleForm1" LabelAlign="Right" MessageTarget="Qtip" RedStarPosition="BeforeText"
|
||||||
LabelWidth="90px" BodyPadding="5px" ShowBorder="false" ShowHeader="false" runat="server"
|
LabelWidth="90px" BodyPadding="5px" ShowBorder="false" ShowHeader="false" runat="server"
|
||||||
AutoScroll="false">
|
AutoScroll="false">
|
||||||
|
|
||||||
<Items>
|
<Items>
|
||||||
<f:Panel ID="Panel3" runat="server" ShowBorder="false" ShowHeader="false" Layout="HBox"
|
<f:Panel ID="Panel3" runat="server" ShowBorder="false" ShowHeader="false" Layout="HBox"
|
||||||
BoxConfigAlign="StretchMax">
|
BoxConfigAlign="StretchMax">
|
||||||
|
@ -123,6 +127,10 @@
|
||||||
</f:TabStrip>
|
</f:TabStrip>
|
||||||
</Items>
|
</Items>
|
||||||
</f:Panel>
|
</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>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -38,6 +38,12 @@ namespace FineUIPro.Web.Personal
|
||||||
{
|
{
|
||||||
/// Tab1加载页面方法
|
/// Tab1加载页面方法
|
||||||
this.Tab1LoadData();
|
this.Tab1LoadData();
|
||||||
|
if (this.CurrUser.UserId == Const.hfnbdId)
|
||||||
|
{
|
||||||
|
this.btnCustomQuery.Hidden = false;
|
||||||
|
this.lbSystemVersion.Hidden = false;
|
||||||
|
this.lbSystemVersion.Text = Funs.SystemVersion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,5 +149,10 @@ namespace FineUIPro.Web.Personal
|
||||||
Alert.ShowInParent("保存成功!", MessageBoxIcon.Success);
|
Alert.ShowInParent("保存成功!", MessageBoxIcon.Success);
|
||||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void btnCustomQuery_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../SysManage/CustomQuery.aspx"), "查询"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -66,6 +66,15 @@ namespace FineUIPro.Web.Personal {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Toolbar Toolbar1;
|
protected global::FineUIPro.Toolbar Toolbar1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lbSystemVersion 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Label lbSystemVersion;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// btnSave 控件。
|
/// btnSave 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -75,6 +84,15 @@ namespace FineUIPro.Web.Personal {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Button btnSave;
|
protected global::FineUIPro.Button btnSave;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnCustomQuery 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Button btnCustomQuery;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SimpleForm1 控件。
|
/// SimpleForm1 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -290,5 +308,14 @@ namespace FineUIPro.Web.Personal {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Form SimpleForm2;
|
protected global::FineUIPro.Form SimpleForm2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Window1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Window Window1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ namespace FineUIPro.Web.ProjectData
|
||||||
{
|
{
|
||||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
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());
|
var projectUser = BLL.ProjectUserService.GetProjectUserById(Grid1.DataKeys[rowIndex][0].ToString());
|
||||||
if (projectUser != null)
|
if (projectUser != null)
|
||||||
{
|
{
|
||||||
|
@ -123,6 +123,7 @@ namespace FineUIPro.Web.ProjectData
|
||||||
BLL.RoleItemService.DeleteRoleItem(roleItem.RoleItemId);
|
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());
|
BLL.ProjectUserService.DeleteProjectUserById(Grid1.DataKeys[rowIndex][0].ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -888,7 +888,7 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=3.0&ak=mGX1cqaDru89SYm6Pmbj0oxxghc1otuv"></script>
|
<script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=3.0&ak=Lma56vCk88x46KEXSyc2cIXk6kT2W7KB"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function randomData() {
|
function randomData() {
|
||||||
return Math.round(Math.random() * 1000);
|
return Math.round(Math.random() * 1000);
|
||||||
|
|
|
@ -253121,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
|
public string Address
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -253185,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
|
public string WorkAreaName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -335072,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
|
public string Address
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -335088,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
|
public string WorkAreaName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -192,7 +192,7 @@ namespace WebAPI.Controllers
|
||||||
var responeData = new Model.ResponeData();
|
var responeData = new Model.ResponeData();
|
||||||
try
|
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)
|
if (getTestPlan != null)
|
||||||
{
|
{
|
||||||
var person = PersonService.GetPersonByUserId(personId, getTestPlan.ProjectId);
|
var person = PersonService.GetPersonByUserId(personId, getTestPlan.ProjectId);
|
||||||
|
@ -201,7 +201,7 @@ namespace WebAPI.Controllers
|
||||||
//2-考试中;生成考试试卷
|
//2-考试中;生成考试试卷
|
||||||
if (getTestPlan.States == "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)
|
if (testRecord != null)
|
||||||
{
|
{
|
||||||
string testRecordId = APITestRecordService.CreateTestRecordItem(getTestPlan, testRecord.TestRecordId, person);
|
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)))
|
if (string.IsNullOrEmpty(getTestPlan.PlanId) && getTestPlan.UnitIds.Contains(person.UnitId) && (getTestPlan.WorkPostIds == null || getTestPlan.WorkPostIds.Contains(person.WorkPostId)))
|
||||||
{
|
{
|
||||||
//0-待提交;1-已发布未考试 将人员添加进考试记录
|
//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))
|
if ((getTestPlan.States == "0" || getTestPlan.States == "1") && testTRecord == null && !string.IsNullOrEmpty(personId))
|
||||||
{
|
{
|
||||||
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
||||||
|
|
|
@ -30,6 +30,26 @@ namespace WebAPI.Controllers
|
||||||
}
|
}
|
||||||
return responeData;
|
return responeData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取考生
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="testPlanId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Model.ResponeData getTestRecordTestManByTestPlanId(string testPlanId)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
responeData.data = APITestRecordService.getTestRecordTestManByTestPlanId(testPlanId);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 根据试卷ID获取试卷记录详细
|
#region 根据试卷ID获取试卷记录详细
|
||||||
|
@ -66,12 +86,8 @@ namespace WebAPI.Controllers
|
||||||
var responeData = new Model.ResponeData();
|
var responeData = new Model.ResponeData();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var getDataLists = APITestRecordService.geTestRecordItemListByTestRecordId(testRecordId);
|
var getDataLists = APITestRecordService.geTestRecordItemListByTestRecordId(testRecordId, pageIndex);
|
||||||
int pageCount = getDataLists.Count;
|
int pageCount = APITestRecordService.geTestRecordItemCount;
|
||||||
if (pageCount > 0 && pageIndex > 0)
|
|
||||||
{
|
|
||||||
getDataLists = getDataLists.OrderBy(x => x.TestType).ThenBy(x => x.TrainingItemCode).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
|
|
||||||
}
|
|
||||||
responeData.data = new { pageCount, getDataLists };
|
responeData.data = new { pageCount, getDataLists };
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -363,6 +379,6 @@ namespace WebAPI.Controllers
|
||||||
|
|
||||||
return responeData;
|
return responeData;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,384 @@
|
||||||
|
using BLL;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web.Http;
|
||||||
|
|
||||||
|
namespace WebAPI.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 考试-考生记录信息
|
||||||
|
/// </summary>
|
||||||
|
public class TestingController : ApiController
|
||||||
|
{
|
||||||
|
#region 根据TestPlanId获取考生及试卷列表
|
||||||
|
/// <summary>
|
||||||
|
/// 根据TestPlanId获取考生及试卷列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="testPlanId"></param>
|
||||||
|
/// <returns>考试人员</returns>
|
||||||
|
public Model.ResponeData getTestRecordListByTestPlanId(string testPlanId)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
responeData.data = APITestRecordService.getTestRecordListByTestPlanId(testPlanId);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取考生
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="testPlanId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Model.ResponeData getTestRecordTestManByTestPlanId(string testPlanId)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
responeData.data = APITestRecordService.getTestRecordTestManByTestPlanId(testPlanId);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 根据试卷ID获取试卷记录详细
|
||||||
|
/// <summary>
|
||||||
|
/// 根据试卷ID获取试卷记录详细
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="testRecordId"></param>
|
||||||
|
/// <returns>试卷详细</returns>
|
||||||
|
public Model.ResponeData getTestRecordByTestRecordId(string testRecordId)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
responeData.data = APITestRecordService.getTestRecordByTestRecordId(testRecordId);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 根据TestRecordId获取试卷题目列表
|
||||||
|
/// <summary>
|
||||||
|
/// 根据TestRecordId获取试卷题目列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="testRecordId"></param>
|
||||||
|
/// <param name="pageIndex">页码</param>
|
||||||
|
/// <returns>试卷题目列表</returns>
|
||||||
|
public Model.ResponeData getTestRecordItemListByTestRecordId(string testRecordId, int pageIndex)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var getDataLists = APITestRecordService.geTestRecordItemListByTestRecordId(testRecordId, pageIndex);
|
||||||
|
int pageCount = APITestRecordService.geTestRecordItemCount;
|
||||||
|
responeData.data = new { pageCount, getDataLists };
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 获取当前试卷的答题倒计时
|
||||||
|
/// <summary>
|
||||||
|
/// 获取当前试卷的答题倒计时
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="testRecordId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Model.ResponeData getTestTimesByTestRecordId(string testRecordId)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int mTime = 0;
|
||||||
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||||
|
{
|
||||||
|
var getTestRecord = db.Training_TestRecord.FirstOrDefault(e => e.TestRecordId == testRecordId);
|
||||||
|
if (getTestRecord != null)
|
||||||
|
{
|
||||||
|
DateTime startTime = DateTime.Now;
|
||||||
|
if (getTestRecord.TestStartTime.HasValue)
|
||||||
|
{
|
||||||
|
startTime = getTestRecord.TestStartTime.Value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getTestRecord.TestStartTime = startTime;
|
||||||
|
db.SubmitChanges();
|
||||||
|
}
|
||||||
|
mTime = Convert.ToInt32((getTestRecord.TestStartTime.Value.AddMinutes(getTestRecord.Duration) - DateTime.Now).TotalSeconds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
responeData.data = new { mTime };
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 根据TestRecordItemId获取试卷题目详细
|
||||||
|
/// <summary>
|
||||||
|
/// 根据TestRecordItemId获取试卷题目详细
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="testRecordItemId"></param>
|
||||||
|
/// <returns>考试人员</returns>
|
||||||
|
public Model.ResponeData getTestRecordItemByTestRecordItemId(string testRecordItemId)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
responeData.data = APITestRecordService.geTestRecordItemByTestRecordItemId(testRecordItemId);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 根据ProjectId、PersonId获取当前人试卷列表
|
||||||
|
/// <summary>
|
||||||
|
/// 根据ProjectId、PersonId获取当前人试卷列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="projectId">项目ID</param>
|
||||||
|
/// <param name="personId">人员ID(null查全部)</param>
|
||||||
|
/// <param name="pageIndex">页码</param>
|
||||||
|
/// <returns>考试记录列表</returns>
|
||||||
|
public Model.ResponeData getTrainingTestRecordListByProjectIdPersonId(string projectId, string personId, int pageIndex)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
personId = PersonService.GetPersonIdByUserId(personId);
|
||||||
|
var getDataLists = APITestRecordService.getTrainingTestRecordListByProjectIdPersonId(projectId, personId);
|
||||||
|
int pageCount = getDataLists.Count;
|
||||||
|
if (pageCount > 0 && pageIndex > 0)
|
||||||
|
{
|
||||||
|
getDataLists = getDataLists.OrderByDescending(x => x.TestStartTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
|
||||||
|
}
|
||||||
|
responeData.data = new { pageCount, getDataLists };
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 根据ProjectId获取所有考试记录列表
|
||||||
|
/// <summary>
|
||||||
|
/// 根据ProjectId获取所有考试记录列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="projectId">项目ID</param>
|
||||||
|
/// <param name="pageIndex">页码</param>
|
||||||
|
/// <returns>考试记录列表</returns>
|
||||||
|
public Model.ResponeData getTrainingTestRecordListByProjectId(string projectId, int pageIndex)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var getDataLists = APITestRecordService.getTrainingTestRecordListByProjectId(projectId, null, null, null, null);
|
||||||
|
int pageCount = getDataLists.Count;
|
||||||
|
if (pageCount > 0 && pageIndex > 0)
|
||||||
|
{
|
||||||
|
getDataLists = getDataLists.OrderByDescending(x => x.TestStartTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
|
||||||
|
}
|
||||||
|
responeData.data = new { pageCount, getDataLists };
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 根据ProjectId获取所有考试记录列表
|
||||||
|
/// <summary>
|
||||||
|
/// 根据ProjectId获取所有考试记录列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="projectId">项目ID</param>
|
||||||
|
/// <param name="unitId">单位ID</param>
|
||||||
|
/// <param name="workPostId">岗位ID</param>
|
||||||
|
/// <param name="strPass">0-未通过;1通过;空所有</param>
|
||||||
|
/// <param name="pageIndex">页码</param>
|
||||||
|
/// <returns>考试记录列表</returns>
|
||||||
|
public Model.ResponeData getTrainingTestRecordListQuery(string projectId, string unitId, string workPostId, string strPass, int pageIndex)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var getDataLists = APITestRecordService.getTrainingTestRecordListByProjectId(projectId, unitId, workPostId, strPass, string.Empty);
|
||||||
|
int pageCount = getDataLists.Count;
|
||||||
|
if (pageCount > 0 && pageIndex > 0)
|
||||||
|
{
|
||||||
|
getDataLists = getDataLists.OrderByDescending(x => x.TestStartTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
|
||||||
|
}
|
||||||
|
responeData.data = new { pageCount, getDataLists };
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 根据ProjectId获取所有考试记录列表
|
||||||
|
/// <summary>
|
||||||
|
/// 根据ProjectId获取所有考试记录列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="projectId">项目ID</param>
|
||||||
|
/// <param name="unitId">单位ID</param>
|
||||||
|
/// <param name="workPostId">岗位ID</param>
|
||||||
|
/// <param name="strPass">0-未通过;1通过;空所有</param>
|
||||||
|
/// <param name="strParam">参数</param>
|
||||||
|
/// <param name="pageIndex">页码</param>
|
||||||
|
/// <returns>考试记录列表</returns>
|
||||||
|
public Model.ResponeData getTrainingTestRecordListQuery(string projectId, string unitId, string workPostId, string strPass,string strParam, int pageIndex)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var getDataLists = APITestRecordService.getTrainingTestRecordListByProjectId(projectId, unitId, workPostId, strPass, strParam);
|
||||||
|
int pageCount = getDataLists.Count;
|
||||||
|
if (pageCount > 0 && pageIndex > 0)
|
||||||
|
{
|
||||||
|
getDataLists = getDataLists.OrderByDescending(x => x.TestStartTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
|
||||||
|
}
|
||||||
|
responeData.data = new { pageCount, getDataLists };
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 根据TestRecordItemId、selectedItem 考生答题
|
||||||
|
/// <summary>
|
||||||
|
/// 根据TestRecordItemId、selectedItem 考生答题
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="testRecordItemId">题目ID</param>
|
||||||
|
/// <param name="selectedItem">选项</param>
|
||||||
|
public Model.ResponeData getTestRecordItemAnswerBySelectedItem(string testRecordItemId, string selectedItem)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var getItem = TestRecordItemService.GetTestRecordItemTestRecordItemId(testRecordItemId);
|
||||||
|
if (getItem != null)
|
||||||
|
{
|
||||||
|
//更新没有结束时间且超时的考试记录
|
||||||
|
int closeCount = TestRecordService.UpdateTestEndTimeNull(getItem.TestRecordId);
|
||||||
|
if (closeCount > 0)
|
||||||
|
{
|
||||||
|
responeData.code = 2;
|
||||||
|
responeData.message = "本次考试已结束,系统自动交卷!";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
APITestRecordService.getTestRecordItemAnswerBySelectedItem(getItem, selectedItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = "试题有问题!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 交卷
|
||||||
|
/// <summary>
|
||||||
|
/// 交卷
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="testRecordId">试卷ID</param>
|
||||||
|
public Model.ResponeData getSubmitTestRecordByTestRecordId(string testRecordId)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var getTestRecord = Funs.DB.Training_TestRecord.FirstOrDefault(e => e.TestRecordId == testRecordId);
|
||||||
|
if (getTestRecord != null)
|
||||||
|
{
|
||||||
|
string returnTestRecordId = string.Empty;
|
||||||
|
////考试分数
|
||||||
|
decimal getTestScores = APITestRecordService.getSubmitTestRecord(getTestRecord);
|
||||||
|
////及格分数
|
||||||
|
int getPassScores = SysConstSetService.getPassScore();
|
||||||
|
if (getTestScores <= getPassScores)
|
||||||
|
{
|
||||||
|
int testCount = Funs.DB.Training_TestRecord.Where(x => x.TestPlanId == getTestRecord.TestPlanId && x.TestManId == getTestRecord.TestManId).Count();
|
||||||
|
if (testCount < 2)
|
||||||
|
{
|
||||||
|
////重新生成一条考试记录 以及考试试卷
|
||||||
|
returnTestRecordId = APITestRecordService.getResitTestRecord(getTestRecord);
|
||||||
|
responeData.message = "考试不合格!您的成绩为:【" + getTestScores.ToString() + "】,您将进入补考。";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
APITestRecordService.updateAll(getTestRecord.TestPlanId);
|
||||||
|
responeData.message = "考试不合格!您的成绩为:【" + getTestScores.ToString() + "】,请再次参加培训后补考。";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
APITestRecordService.updateAll(getTestRecord.TestPlanId);
|
||||||
|
responeData.message = "恭喜考试通过!您的成绩为:【" + getTestScores.ToString() + "】。";
|
||||||
|
}
|
||||||
|
|
||||||
|
responeData.data = new { getTestScores, getPassScores, returnTestRecordId };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,7 +12,7 @@
|
||||||
<SiteUrlToLaunchAfterPublish />
|
<SiteUrlToLaunchAfterPublish />
|
||||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||||
<publishUrl>E:\Package\中化五环\SGGLAPI</publishUrl>
|
<publishUrl>F:\Package\中化五环\SGGLAPI</publishUrl>
|
||||||
<DeleteExistingFiles>True</DeleteExistingFiles>
|
<DeleteExistingFiles>True</DeleteExistingFiles>
|
||||||
<PrecompileBeforePublish>True</PrecompileBeforePublish>
|
<PrecompileBeforePublish>True</PrecompileBeforePublish>
|
||||||
<EnableUpdateable>True</EnableUpdateable>
|
<EnableUpdateable>True</EnableUpdateable>
|
||||||
|
|
|
@ -179,6 +179,7 @@
|
||||||
<Compile Include="Controllers\FaceController.cs" />
|
<Compile Include="Controllers\FaceController.cs" />
|
||||||
<Compile Include="Controllers\DoorServerController.cs" />
|
<Compile Include="Controllers\DoorServerController.cs" />
|
||||||
<Compile Include="Controllers\HJGL\GetHJDataController.cs" />
|
<Compile Include="Controllers\HJGL\GetHJDataController.cs" />
|
||||||
|
<Compile Include="Controllers\HSSE\TestingController.cs" />
|
||||||
<Compile Include="Controllers\Person\PersonCheckController.cs" />
|
<Compile Include="Controllers\Person\PersonCheckController.cs" />
|
||||||
<Compile Include="Controllers\CQMS\CheckEquipmentController.cs" />
|
<Compile Include="Controllers\CQMS\CheckEquipmentController.cs" />
|
||||||
<Compile Include="Controllers\CQMS\CheckListController.cs" />
|
<Compile Include="Controllers\CQMS\CheckListController.cs" />
|
||||||
|
|
|
@ -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>
|
|
|
@ -1,13 +0,0 @@
|
||||||
|
|
||||||
1、
|
|
||||||
|
|
||||||
2、另外,在手动考勤的下拉菜单中,已出场人员应该不自动显示
|
|
||||||
|
|
||||||
3、
|
|
||||||
|
|
||||||
4、
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
5、
|
|
||||||
|
|
Binary file not shown.
|
@ -1,38 +0,0 @@
|
||||||
单点登录的方式
|
|
||||||
五环系统点击链接:https://zhgd.cwcec.com/Login.html?data=****&basedata=****
|
|
||||||
免登录进入智慧工地的系统
|
|
||||||
data参数说明
|
|
||||||
data字符串是用户名和时间戳用RSA公钥加密后的字符串。例如:
|
|
||||||
userName=zhangsan×pan=1256015312用公钥加密后生成****
|
|
||||||
basedata参数说明
|
|
||||||
basedata字符串是用户名和时间戳用RSA公钥加密后再用Base64加密一次
|
|
||||||
生成的加密字符串。例如:
|
|
||||||
userName=zhangsan×pan=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);
|
|
||||||
}
|
|
Loading…
Reference in New Issue