This commit is contained in:
gaofei 2022-05-22 10:35:38 +08:00
commit d33b007348
34 changed files with 952 additions and 171 deletions

1
.gitignore vendored
View File

@ -5,5 +5,4 @@
/SGGLPackFile/PackFile/bin
/SGGLPackFile
/SGGL/FineUIPro.Web/File/Excel/Temp
/SGGL/FineUIPro.Web/common
/SGGL/FineUIPro.Web/FileUpload/QRCodeFile

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

@ -30,6 +30,7 @@ namespace BLL
}
}
request.Headers.Add("token", "AF17168B-87BD-4GLY-1111-F0A0A1158F9B");
request.Timeout = 20000; /// 设置5秒超时
if (!string.IsNullOrEmpty(data))
{
Stream RequestStream = request.GetRequestStream();
@ -92,7 +93,7 @@ namespace BLL
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
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)
{
foreach (var i in header.Keys)
@ -161,6 +162,7 @@ namespace BLL
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = string.IsNullOrEmpty(method) ? "GET" : method;
request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype;
request.Timeout = 20000; /// 设置5秒超时
if (header != null)
{
foreach (var i in header.Keys)

View File

@ -56,35 +56,38 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = from x in db.Training_TestPlan
where x.TestPlanId == testPlanId
select new Model.TestPlanItem
{
TestPlanId = x.TestPlanId,
ProjectId = x.ProjectId,
TestPlanCode = x.PlanCode,
TestPlanName = x.PlanName,
TestPlanManId = x.PlanManId,
TestPlanManName = db.Sys_User.First(y => y.UserId == x.TestPlanId).UserName,
TestPlanDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.PlanDate),
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
Duration = x.Duration,
SValue = x.SValue,
MValue = x.MValue,
JValue = x.JValue,
TotalScore = x.TotalScore ?? 0,
QuestionCount = x.QuestionCount ?? 0,
TestPalce = x.TestPalce,
UnitIds = x.UnitIds,
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
WorkPostIds = x.WorkPostIds,
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostIds),
States = x.States,
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
TrainingPlanId = x.PlanId,
};
return getDataLists.FirstOrDefault();
Model.TestPlanItem returnItem = new Model.TestPlanItem();
var getTestP = db.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == testPlanId);
if (getTestP != null)
{
returnItem.TestPlanId = getTestP.TestPlanId;
returnItem.ProjectId = getTestP.ProjectId;
returnItem.TestPlanCode = getTestP.PlanCode;
returnItem.TestPlanName = getTestP.PlanName;
returnItem.TestPlanManId = getTestP.PlanManId;
returnItem.TestPlanManName = UserService.GetUserNameByUserId(getTestP.PlanManId);
returnItem.TestPlanDate = getTestP.PlanDate.HasValue ? string.Format("{0:yyyy-MM-dd HH:mm}", getTestP.PlanDate) : "";
returnItem.TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", getTestP.TestStartTime);
returnItem.TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", getTestP.TestEndTime);
returnItem.Duration = getTestP.Duration;
returnItem.SValue = getTestP.SValue;
returnItem.MValue = getTestP.MValue;
returnItem.JValue = getTestP.JValue;
returnItem.TotalScore = getTestP.TotalScore ?? 0;
returnItem.QuestionCount = getTestP.QuestionCount ?? 0;
returnItem.TestPalce = getTestP.TestPalce;
returnItem.UnitIds = getTestP.UnitIds;
returnItem.UnitNames = UnitService.getUnitNamesUnitIds(getTestP.UnitIds);
returnItem.WorkPostIds = getTestP.WorkPostIds;
returnItem.WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(getTestP.WorkPostIds);
returnItem.States = getTestP.States;
if (!string.IsNullOrEmpty(getTestP.QRCodeUrl))
{
returnItem.QRCodeUrl = getTestP.QRCodeUrl.Replace('\\', '/');
}
returnItem.TrainingPlanId = getTestP.PlanId;
}
return returnItem;
}
}
#endregion

View File

@ -21,6 +21,7 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Training_TestRecord
join y in db.SitePerson_Person on x.TestManId equals y.PersonId
where x.TestPlanId == testPlanId
orderby x.TestStartTime descending
select new Model.TestRecordItem
@ -29,7 +30,7 @@ namespace BLL
ProjectId = x.ProjectId,
TestPlanId = x.TestPlanId,
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),
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
TestScores = x.TestScores ?? 0,
@ -39,6 +40,25 @@ namespace BLL
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
#region ID获取试卷记录详细
@ -99,14 +119,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 +369,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

@ -63,7 +63,8 @@ namespace BLL
}
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)
{
@ -197,6 +198,30 @@ namespace BLL
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>
/// 根据UserId主键获取人员信息
/// </summary>

View File

@ -7,23 +7,19 @@ namespace BLL
{
public class RealNameMonitorService
{
#region 5
#region 5
/// <summary>
/// 监视组件
/// </summary>
private static Timer messageTimer;
// private static Timer messageTimer;
/// <summary>
/// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 系统启动5分钟
/// </summary>
public static void StartMonitor()
{
int adTimeJ = Funs.GetNewInt(ConfigurationManager.AppSettings["Intervaltime"]) ?? 30;
//var getSynchroSet = Funs.DB.RealName_SynchroSet.FirstOrDefault();
//if (getSynchroSet != null && getSynchroSet.Intervaltime.HasValue)
//{
// adTimeJ = getSynchroSet.Intervaltime.Value;
//}
public static void StartMonitor(string jtProCode)
{
int adTimeJ = Funs.GetNewInt(ConfigurationManager.AppSettings["Intervaltime"]) ?? 30;
Timer messageTimer = new Timer();
if (messageTimer != null)
{
messageTimer.Stop();
@ -36,7 +32,8 @@ namespace BLL
{
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.Start();
}
@ -47,34 +44,25 @@ namespace BLL
/// </summary>
/// <param name="sender">Timer组件</param>
/// <param name="e">事件参数</param>
private static void AdUserInProcess(object sender, ElapsedEventArgs e)
public static void AdUserInProcess(object sender, string jtProCode)
{
try
{
SynchroSetService.PushCollCompany();
var getRProjects = from x in Funs.DB.RealName_Project
select x;
if (getRProjects.Count() > 0)
if (!string.IsNullOrEmpty(jtProCode))
{
foreach (var item in getRProjects)
{
var getSynchroSet = Funs.DB.RealName_SynchroSet.FirstOrDefault(x => x.ProCode == item.JTproCode);
if (getSynchroSet != null && !string.IsNullOrEmpty(item.JTproCode))
{
SynchroSetService.PushProCollCompany(item.JTproCode);
//SynchroSetService.PushCollTeam(item.ProCode);
//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);
}
}
SynchroSetService.PushProCollCompany(jtProCode);
SynchroSetService.PushCollTeam(jtProCode);
SynchroSetService.getCollTeam(jtProCode);
SynchroSetService.PushPersons(Const.BtnAdd, jtProCode, null);
SynchroSetService.PushPersons(Const.BtnModify, jtProCode, null);
SynchroSetService.PushAttendance(jtProCode);
SynchroSetService.updatePersonsExitTime(jtProCode);
}
}
catch (Exception ex)
{
StartMonitor();
StartMonitor(jtProCode);
ErrLogInfo.WriteLog(ex, "数据接口定时器", "RealNameMonitorService.AdUserInProcess");
}
}
@ -176,5 +164,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
}
}

View File

@ -56,6 +56,11 @@ namespace BLL
}
#endregion
public static List<Model.RealName_Project> GetRealNameProject()
{
return (from x in Funs.DB.RealName_Project select x).ToList();
}
#region
/// <summary>
/// 表下拉框
@ -1426,7 +1431,14 @@ namespace BLL
addTeam(getData.Select(x => x.TeamGroupId).Distinct().ToList(), 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);
var returndata = BLL.APIGetHttpService.OutsideHttp(url, "POST", null, newToken, pushContent);
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

View File

@ -58,7 +58,7 @@
<ItemGroup>
<Reference Include="Apache.NMS, Version=1.8.0.0, Culture=neutral, PublicKeyToken=82756feee3957618, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Apache.NMS.dll</HintPath>
<HintPath>..\..\..\..\DepCode\reference-bll\Reference BLL\Apache.NMS.dll</HintPath>
</Reference>
<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>

View File

@ -1,11 +1,12 @@
namespace FineUIPro.Web
{
using BLL;
using Model;
using System;
using System.Configuration;
using System.Globalization;
using System.Text;
using BLL;
using Model;
using System.Timers;
public class Global : System.Web.HttpApplication
{
@ -17,7 +18,6 @@
protected void Application_Start(object sender, EventArgs e)
{
Application["OnlineUserCount"] = 0;
Model.Sys_User sysUser = new Sys_User();
try
{
Funs.RootPath = Server.MapPath("~/");
@ -27,26 +27,34 @@
Funs.SystemName = ConfigurationManager.AppSettings["SystemName"];
Funs.SGGLUrl = ConfigurationManager.AppSettings["SGGLUrl"];
Funs.RealNameApiUrl = ConfigurationManager.AppSettings["RealNameApiUrl"];
Funs.ControlApiUrl = ConfigurationManager.AppSettings["ControlApiUrl"];
sysUser = UserService.GetUserByUserId(Const.sysglyId);
Funs.ControlApiUrl = ConfigurationManager.AppSettings["ControlApiUrl"];
Funs.SystemVersion = ConfigurationManager.AppSettings["SystemVersion"];
}
catch (Exception ex)
{
ErrLogInfo.WriteLog(string.Empty, ex);
//AppDomain.Unload(AppDomain.CurrentDomain);
}
////实名制同步定时器
///实名制出入记录去重
try
{
BLL.RealNameMonitorService.StartInOutMonitor();
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("实名制出入记录去重定时器启动失败!", ex);
}
////实名制同步定时器
try
{
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)
{
@ -58,27 +66,33 @@
BLL.MonitorService.StartMonitor();
BLL.MonitorService.StartMonitorEve();
BLL.MonitorService.StartPersonQuarterCheck();
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "通用定时器启动成功!");
}
catch (Exception ex)
{
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();
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("实名制日志清理定时器启动失败!", ex);
}
///考勤记录清理定时器
try
{
BLL.RealNameMonitorService.StartMonitorCleanAttendance();
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("实名制日志清理定时器启动失败!", ex);
}
////从集团获取数据定时器
try
{
BLL.MCSWebService.StartMonitor();
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "从材料软件获取数据定时器启动成功!");
}
catch (Exception ex)
{
@ -88,18 +102,15 @@
try
{
BLL.CNCECHSSEMonitorService.StartMonitor();
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "从集团获取数据定时器启动成功!");
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("从集团获取数据定时器启动失败!", ex);
}
////从博晟获取培训考试数据定时器
try
{
BLL.BOSHENGMonitorService.StartMonitor();
BLL.LogService.AddSys_Log(sysUser, string.Empty, string.Empty, string.Empty, "从博晟获取培训考试数据定时器启动成功!");
}
catch (Exception ex)
{

View File

@ -229,7 +229,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
DateTime inToOutTime = Convert.ToDateTime(col4);
}
catch (Exception)
catch (Exception ex)
{
result += "第" + (i + 2).ToString() + "行," + "时间" + "," + "[" + col4 + "]错误!" + "|";
}
@ -407,26 +407,43 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
if (string.IsNullOrEmpty(errorInfos))
{
int a = viewCheckings.Count();
for (int i = 0; i < a; i++)
foreach (var item in viewCheckings)
{
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,
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);
Model.SitePerson_Checking newChecking = new Model.SitePerson_Checking
{
CheckingId = item.CheckingId,
ProjectId = item.ProjectId,
IdentityCard = item.IdentityCard,
IntoOutTime = item.IntoOutTime,
IntoOut = item.IntoOut,
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 initFullPath = rootPath + initPath;
string filePath = initFullPath + this.hdFileName.Text;
if (filePath != string.Empty && System.IO.File.Exists(filePath))
{
System.IO.File.Delete(filePath);//删除上传的XLS文件
File.Delete(filePath);//删除上传的XLS文件
}
ShowNotify("导入成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());

View File

@ -10,9 +10,9 @@
</head>
<body>
<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"
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=""
src="res/index/images/iconlogo.png"
style="height: auto;width:300px; left: 100px; top: 60px; position: absolute;" />

View File

@ -30,20 +30,24 @@
<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:Label runat="server" ID="lbSystemVersion" Hidden="true" Label="系统版本"></f:Label>
<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 +127,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,12 @@ namespace FineUIPro.Web.Personal
{
/// Tab1加载页面方法
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);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
protected void btnCustomQuery_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../SysManage/CustomQuery.aspx"), "查询"));
}
}
}

View File

@ -66,6 +66,15 @@ namespace FineUIPro.Web.Personal {
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbSystemVersion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbSystemVersion;
/// <summary>
/// btnSave 控件。
/// </summary>
@ -75,6 +84,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 +308,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

@ -888,7 +888,7 @@
}
})
</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">
function randomData() {
return Math.round(Math.random() * 1000);

View File

@ -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
{
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
{
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
{
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
{
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

@ -30,6 +30,26 @@ namespace WebAPI.Controllers
}
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获取试卷记录详细
@ -66,12 +86,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)
@ -363,6 +379,6 @@ namespace WebAPI.Controllers
return responeData;
}
#endregion
#endregion
}
}

View File

@ -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 ProjectIdPersonId获取当前人试卷列表
/// <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 TestRecordItemIdselectedItem
/// <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
}
}

View File

@ -12,7 +12,7 @@
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>E:\Package\中化五环\SGGLAPI</publishUrl>
<publishUrl>F:\Package\中化五环\SGGLAPI</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<PrecompileBeforePublish>True</PrecompileBeforePublish>
<EnableUpdateable>True</EnableUpdateable>

View File

@ -179,6 +179,7 @@
<Compile Include="Controllers\FaceController.cs" />
<Compile Include="Controllers\DoorServerController.cs" />
<Compile Include="Controllers\HJGL\GetHJDataController.cs" />
<Compile Include="Controllers\HSSE\TestingController.cs" />
<Compile Include="Controllers\Person\PersonCheckController.cs" />
<Compile Include="Controllers\CQMS\CheckEquipmentController.cs" />
<Compile Include="Controllers\CQMS\CheckListController.cs" />

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);
}