20260817 积分、扣分
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
namespace FineUIPro.Web
|
||||
{
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using BLL;
|
||||
using FineUIPro.Web.Score;
|
||||
using Model;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data.SqlClient;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
public class Global : System.Web.HttpApplication
|
||||
{
|
||||
@@ -33,11 +39,10 @@
|
||||
ErrLogInfo.WriteLog(string.Empty, ex);
|
||||
//AppDomain.Unload(AppDomain.CurrentDomain);
|
||||
}
|
||||
|
||||
////通用定时器
|
||||
//通用定时器
|
||||
try
|
||||
{
|
||||
ErrLogInfo.WriteLog("通用定时器开启!" );
|
||||
ErrLogInfo.WriteLog("通用定时器开启!");
|
||||
QuartzServices.Init();
|
||||
ErrLogInfo.WriteLog("通用定时器结束!");
|
||||
}
|
||||
@@ -45,6 +50,485 @@
|
||||
{
|
||||
ErrLogInfo.WriteLog("通用定时器!", ex);
|
||||
}
|
||||
// 开启线程
|
||||
System.Threading.Thread LoadServiceData = new System.Threading.Thread(new System.Threading.ThreadStart(EduTrainAddScore));
|
||||
LoadServiceData.Start();
|
||||
}
|
||||
|
||||
private void EduTrainAddScore()
|
||||
{
|
||||
//定义一个定时器,并开启和配置相关属性
|
||||
System.Timers.Timer Wtimer = new System.Timers.Timer();
|
||||
//执行任务的周期 ,60分钟
|
||||
Wtimer.Interval =1000 * 60 * 60; //120000;
|
||||
Wtimer.Enabled = true;
|
||||
Wtimer.Start();
|
||||
Wtimer.Elapsed += new System.Timers.ElapsedEventHandler(Wtimer_Elapsed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 培训考试加分
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void Wtimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
//考试大于等于80分通过,且没有加过分的记录,加分
|
||||
var testRecordList = (from x in Funs.DB.View_Training_TestRecord where x.TestScores >= 80
|
||||
&& !Funs.DB.ScoreFlowLog.Any(log => log.DataSourceId == x.TestRecordId)
|
||||
orderby x.TestStartTime select x).ToList();
|
||||
foreach (var item in testRecordList)
|
||||
{
|
||||
//查找最新一条积分记录
|
||||
var flowLog = BLL.ScoreFlowLogService.GetScoreFlowLogByIdentityCard(item.IdentityCard, item.TestStartTime.Value.Year, DateTime.Now);
|
||||
|
||||
//作业人员考试加分
|
||||
if (item.WorkPostType == "一般作业岗位" || item.WorkPostType == "特种作业人员")
|
||||
{
|
||||
//必修-岗位基本操作技能:一门专业课20分,最高20分;超过1门课程,多出的学习课程每门2分
|
||||
if (item.CompanyTrainingId == BLL.Const.CompanyTrainingId3)
|
||||
{
|
||||
var scoreFlowLog = (from x in Funs.DB.ScoreFlowLog where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year && x.Item.Contains("考试【岗位基本操作技能】") orderby x.CompileDate descending select x).ToList();
|
||||
//一个课程加分一次
|
||||
var isExist = scoreFlowLog.Where(x => x.LogContent.Contains("岗位基本操作技能【" + item.CompanyTrainingItemName + "】")).FirstOrDefault();
|
||||
if (isExist == null)//第一次加分
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【岗位基本操作技能】";
|
||||
newlog.LogContent = "岗位基本操作技能【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
|
||||
if (scoreFlowLog.Count == 0)
|
||||
{
|
||||
newlog.Score = 20;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 120;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
//必修-通用安全知识:60分,每门10分,最高60分;超过6门课程,多出的学习课程每门2分
|
||||
else if (item.CompanyTrainingId == BLL.Const.CompanyTrainingId1)
|
||||
{
|
||||
var scoreFlowLog = (from x in Funs.DB.ScoreFlowLog where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year && x.Item.Contains("考试【通用安全知识】") orderby x.CompileDate descending select x).ToList();
|
||||
//一个课程加分一次
|
||||
var isExist = scoreFlowLog.Where(x => x.LogContent.Contains("通用安全知识【" + item.CompanyTrainingItemName + "】")).FirstOrDefault();
|
||||
if (isExist == null)//第一次加分
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【通用安全知识】";
|
||||
newlog.LogContent = "通用安全知识【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
if (scoreFlowLog.Count < 6)
|
||||
{
|
||||
newlog.Score = 10;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 110;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
//选修加分 每节课2分,加分上线不限制,以年度为节点
|
||||
else
|
||||
{
|
||||
var isExist = (from x in Funs.DB.ScoreFlowLog
|
||||
where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year
|
||||
&& x.Item.Contains(item.CompanyTrainingName)
|
||||
&& x.LogContent.Contains(item.CompanyTrainingName + "【" + item.CompanyTrainingItemName + "】")
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (isExist == null)
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【" + item.CompanyTrainingName + "】";
|
||||
newlog.LogContent = item.CompanyTrainingName + "【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
//管理人员考试加分
|
||||
else if (item.WorkPostType == "一般管理岗位" || item.WorkPostType == "特种管理人员")
|
||||
{
|
||||
//必修-知识方法工具,最少学习5门课程,一门5分;超过5门课程,多出的学习课程每门2分
|
||||
if (item.CompanyTrainingId == BLL.Const.CompanyTrainingId2)
|
||||
{
|
||||
var scoreFlowLog = (from x in Funs.DB.ScoreFlowLog where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year && x.Item.Contains("考试【知识方法工具】") orderby x.CompileDate descending select x).ToList();
|
||||
//一次考试加分一次
|
||||
var isExist = scoreFlowLog.Where(x => x.LogContent.Contains("知识方法工具【" + item.CompanyTrainingItemName + "】")).FirstOrDefault();
|
||||
if (isExist == null)//第一次加分
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【知识方法工具】";
|
||||
newlog.LogContent = "知识方法工具【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
if (scoreFlowLog.Count < 5)
|
||||
{
|
||||
newlog.Score = 5;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 105;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
//必修-生产受控管理,最少学习5门课程,一门5分;超过5门课程,多出的学习课程每门2分
|
||||
else if (item.CompanyTrainingId == BLL.Const.CompanyTrainingId4)
|
||||
{
|
||||
var scoreFlowLog = (from x in Funs.DB.ScoreFlowLog where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year && x.Item.Contains("考试【生产受控管理】") orderby x.CompileDate descending select x).ToList();
|
||||
//一次考试加分一次
|
||||
var isExist = scoreFlowLog.Where(x => x.LogContent.Contains("生产受控管理【" + item.CompanyTrainingItemName + "】")).FirstOrDefault();
|
||||
if (isExist == null)//第一次加分
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【生产受控管理】";
|
||||
newlog.LogContent = "生产受控管理【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
if (scoreFlowLog.Count < 5)
|
||||
{
|
||||
newlog.Score = 5;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 105;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
//必修-通用课程:通用安全知识:30分,每门10分,最高30分;超过3门课程,多出的学习课程每门2分
|
||||
else if (item.CompanyTrainingId == BLL.Const.CompanyTrainingId1)
|
||||
{
|
||||
var scoreFlowLog = (from x in Funs.DB.ScoreFlowLog where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year && x.Item.Contains("考试【通用安全知识】") orderby x.CompileDate descending select x).ToList();
|
||||
//一次考试加分一次
|
||||
var isExist = scoreFlowLog.Where(x => x.LogContent.Contains("通用安全知识【" + item.CompanyTrainingItemName + "】")).FirstOrDefault();
|
||||
if (isExist == null)//第一次加分
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【通用安全知识】";
|
||||
newlog.LogContent = "通用安全知识【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
if (scoreFlowLog.Count < 3)
|
||||
{
|
||||
newlog.Score = 10;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 110;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
else //选修加分 每节课2分,加分上线不限制,以年度为节点
|
||||
{
|
||||
var isExist = (from x in Funs.DB.ScoreFlowLog
|
||||
where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year
|
||||
&& x.Item.Contains(item.CompanyTrainingName)
|
||||
&& x.LogContent.Contains(item.CompanyTrainingName + "【" + item.CompanyTrainingItemName + "】")
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (isExist == null)
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【" + item.CompanyTrainingName + "】";
|
||||
newlog.LogContent = item.CompanyTrainingName + "【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void Session_Start(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user