新疆油建优化
This commit is contained in:
@@ -129,11 +129,11 @@ namespace BLL
|
||||
|
||||
////及格分数
|
||||
int passScore = 80;
|
||||
var testRule = db.Sys_TestRule.FirstOrDefault();
|
||||
if (testRule != null)
|
||||
{
|
||||
passScore = testRule.PassingScore;
|
||||
}
|
||||
//var testRule = db.Sys_TestRule.FirstOrDefault();
|
||||
//if (testRule != null)
|
||||
//{
|
||||
// passScore = testRule.PassingScore;
|
||||
//}
|
||||
|
||||
foreach (var item in getTrainingTasks)
|
||||
{
|
||||
|
||||
@@ -159,11 +159,11 @@
|
||||
public static int getPassScore()
|
||||
{
|
||||
int passScore = 80;
|
||||
var testRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||
if (testRule != null)
|
||||
{
|
||||
passScore = testRule.PassingScore;
|
||||
}
|
||||
//var testRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||
//if (testRule != null)
|
||||
//{
|
||||
// passScore = testRule.PassingScore;
|
||||
//}
|
||||
return passScore;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,10 +94,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
this.BindGrid();
|
||||
|
||||
this.GetButtonPower();
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
btnNew.Hidden = true;
|
||||
}
|
||||
//if (string.IsNullOrEmpty(this.ProjectId))
|
||||
//{
|
||||
this.btnNew.Hidden = true;
|
||||
//}
|
||||
}
|
||||
#region 编制
|
||||
/// <summary>
|
||||
|
||||
@@ -55,7 +55,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
this.InitDropDownList();
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
this.PlanId = Request.Params["PlanId"];
|
||||
|
||||
if (!string.IsNullOrEmpty(PlanId))
|
||||
@@ -63,6 +66,8 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
var trainingPlan = TrainingPlanService.GetPlanById(PlanId);
|
||||
if (trainingPlan != null)
|
||||
{
|
||||
this.ProjectId = trainingPlan.ProjectId;
|
||||
this.InitDropDownList();
|
||||
|
||||
this.txtPlanCode.Text = trainingPlan.PlanCode;
|
||||
this.txtPlanName.Text = trainingPlan.PlanName;
|
||||
@@ -91,7 +96,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
dpCompanyTraining.SelectedValueArray = planItem;
|
||||
}
|
||||
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, trainingPlan.UnitIds, trainingPlan.WorkPostId, "", trainingPlan.TrainTypeId, "", "").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
|
||||
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.ProjectId, trainingPlan.UnitIds, trainingPlan.WorkPostId, "", trainingPlan.TrainTypeId, "", "").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
|
||||
dpSysUser.DataTextField = "PersonName";
|
||||
dpSysUser.DataValueField = "PersonId";
|
||||
dpSysUser.DataSource = getDataList;
|
||||
@@ -107,8 +112,9 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
}
|
||||
else
|
||||
{
|
||||
string code = ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectCode + "-";
|
||||
txtPlanCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", this.CurrUser.LoginProjectId, code);
|
||||
this.InitDropDownList();
|
||||
string code = ProjectService.GetProjectByProjectId(this.ProjectId).ProjectCode + "-";
|
||||
txtPlanCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", this.ProjectId, code);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,8 +126,8 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
TrainTypeService.InitTrainTypeDropDownList(drpTrainType, true);
|
||||
TrainLevelService.InitTrainLevelDropDownList(drpTrainLevel, true);
|
||||
UnitService.InitUnitByProjectIdUnitTypeDropDownList1(dpUnit, this.CurrUser.LoginProjectId, false);
|
||||
WorkPostService.InitWorkPostByProjectIdDropDownList(dpWorkPost, this.CurrUser.LoginProjectId, false);
|
||||
UnitService.InitUnitByProjectIdUnitTypeDropDownList1(dpUnit, this.ProjectId, false);
|
||||
WorkPostService.InitWorkPostByProjectIdDropDownList(dpWorkPost, this.ProjectId, false);
|
||||
//var postIds = (from u in Funs.DB.SitePerson_Person
|
||||
// where u.ProjectId == CurrUser.LoginProjectId
|
||||
// select u.WorkPostId).Distinct();
|
||||
@@ -273,7 +279,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
var db = Funs.DB;
|
||||
|
||||
Model.Training_Plan trainingPlan = new Model.Training_Plan();
|
||||
trainingPlan.ProjectId = this.CurrUser.LoginProjectId;
|
||||
trainingPlan.ProjectId = this.ProjectId;
|
||||
trainingPlan.PlanName = this.txtPlanName.Text;
|
||||
trainingPlan.PlanCode = this.txtPlanCode.Text;
|
||||
trainingPlan.TrainContent = this.txtTrainContent.Text;
|
||||
@@ -296,8 +302,8 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
}
|
||||
if (string.IsNullOrEmpty(PlanId))
|
||||
{
|
||||
//string code = ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectCode + "-";
|
||||
//trainingPlan.PlanCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", this.CurrUser.LoginProjectId, code);
|
||||
//string code = ProjectService.GetProjectByProjectId(this.ProjectId).ProjectCode + "-";
|
||||
//trainingPlan.PlanCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", this.ProjectId, code);
|
||||
|
||||
//trainingPlan.PlanCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectTrainingPlanMenuId, CurrUser.LoginProjectId, CurrUser.UnitId);
|
||||
trainingPlan.PlanId = SQLHelper.GetNewID();
|
||||
@@ -474,7 +480,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
dpSysUser.Items.Clear();
|
||||
string unitIds = string.Join(",", dpUnit.SelectedValueArray);
|
||||
string workPostIds = string.Join(",", dpWorkPost.SelectedValueArray);
|
||||
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, unitIds, workPostIds, "", drpTrainType.SelectedValue, "", "").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
|
||||
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.ProjectId, unitIds, workPostIds, "", drpTrainType.SelectedValue, "", "").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
|
||||
dpSysUser.DataTextField = "PersonName";
|
||||
dpSysUser.DataValueField = "PersonId";
|
||||
dpSysUser.DataSource = getDataList;
|
||||
|
||||
@@ -631,11 +631,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
select x;
|
||||
////及格分数
|
||||
int passScore = 80;
|
||||
var testRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||
if (testRule != null)
|
||||
{
|
||||
passScore = testRule.PassingScore;
|
||||
}
|
||||
//var testRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||
//if (testRule != null)
|
||||
//{
|
||||
// passScore = testRule.PassingScore;
|
||||
//}
|
||||
foreach (var item in getTrainingTasks)
|
||||
{
|
||||
bool isInsert = true;
|
||||
|
||||
@@ -232,7 +232,8 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
&& x.TestPlanId == this.TestPlanId);
|
||||
if (getTestRecord.Count() > 0)
|
||||
{ ////及格分数
|
||||
int getPassScores = SysConstSetService.getPassScore();
|
||||
int getPassScores = 80;
|
||||
//int getPassScores = SysConstSetService.getPassScore();
|
||||
var getOK = getTestRecord.FirstOrDefault(x => x.TestScores >= getPassScores);
|
||||
if (getOK != null)
|
||||
{
|
||||
|
||||
@@ -520,11 +520,11 @@ namespace FineUIPro.Web.Person.EduTrain
|
||||
select x;
|
||||
////及格分数
|
||||
int passScore = 80;
|
||||
var testRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||
if (testRule != null)
|
||||
{
|
||||
passScore = testRule.PassingScore;
|
||||
}
|
||||
//var testRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||
//if (testRule != null)
|
||||
//{
|
||||
// passScore = testRule.PassingScore;
|
||||
//}
|
||||
foreach (var item in getTrainingTasks)
|
||||
{
|
||||
bool isInsert = true;
|
||||
|
||||
@@ -232,7 +232,8 @@ namespace FineUIPro.Web.Person.EduTrain
|
||||
&& x.TestPlanId == this.TestPlanId);
|
||||
if (getTestRecord.Count() > 0)
|
||||
{ ////及格分数
|
||||
int getPassScores = SysConstSetService.getPassScore();
|
||||
int getPassScores = 80;
|
||||
//int getPassScores = SysConstSetService.getPassScore();
|
||||
var getOK = getTestRecord.FirstOrDefault(x => x.TestScores >= getPassScores);
|
||||
if (getOK != null)
|
||||
{
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace WebAPI.Controllers
|
||||
/// <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)
|
||||
public Model.ResponeData getTrainingTestRecordListQuery(string projectId, string unitId, string workPostId, string strPass, string strParam, int pageIndex)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
@@ -336,7 +336,8 @@ namespace WebAPI.Controllers
|
||||
////考试分数
|
||||
decimal getTestScores = APITestRecordService.getSubmitTestRecord(getTestRecord);
|
||||
////及格分数
|
||||
int getPassScores = SysConstSetService.getPassScore();
|
||||
int getPassScores = 80;
|
||||
//int getPassScores = SysConstSetService.getPassScore();
|
||||
if (getTestScores <= getPassScores)
|
||||
{
|
||||
int testCount = Funs.DB.Training_TestRecord.Where(x => x.TestPlanId == getTestRecord.TestPlanId && x.TestManId == getTestRecord.TestManId).Count();
|
||||
@@ -388,7 +389,6 @@ namespace WebAPI.Controllers
|
||||
#region 将答题记录保存到数据库
|
||||
RedisHelper redis = new RedisHelper();
|
||||
var trainingTestRecordItems = redis.GetObjString<List<Training_TestRecordItem>>(testRecordId);
|
||||
|
||||
if (trainingTestRecordItems != null)
|
||||
{
|
||||
var modeltestRecordItem = from x in db.Training_TestRecordItem
|
||||
@@ -403,7 +403,6 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
var getTestRecord = db.Training_TestRecord.FirstOrDefault(e => e.TestRecordId == testRecordId);
|
||||
if (getTestRecord != null)
|
||||
{
|
||||
@@ -431,17 +430,13 @@ namespace WebAPI.Controllers
|
||||
if (!string.IsNullOrEmpty(Fingerprint))
|
||||
{
|
||||
Fingerprint = Fingerprint.Replace("data:image/svg+xml;base64,", "").Replace("data:image/png;base64,", "").Replace("data:image/jgp;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", "");//将base64头部信息替换
|
||||
|
||||
byte[] bytes = Convert.FromBase64String(Fingerprint);
|
||||
|
||||
MemoryStream memStream = new MemoryStream(bytes);
|
||||
Image mImage = Image.FromStream(memStream);
|
||||
Bitmap bp = new Bitmap(mImage);
|
||||
MemoryStream ms = new MemoryStream();
|
||||
bp.Save(Fingerprintfilename, System.Drawing.Imaging.ImageFormat.Png);
|
||||
|
||||
getTestRecord.Fingerprint = Fingerprintfilename.Replace(rootUrl, "");
|
||||
|
||||
}
|
||||
db.SubmitChanges();
|
||||
// APITestRecordService.updateTestRecord(getTestRecord);
|
||||
@@ -449,14 +444,14 @@ namespace WebAPI.Controllers
|
||||
////考试分数
|
||||
decimal getTestScores = APITestRecordService.getSubmitTestRecord(getTestRecord);
|
||||
|
||||
if (!string.IsNullOrEmpty(getTestRecord.TestPlanId))
|
||||
{ ////及格分数
|
||||
int getPassScores = 80;
|
||||
var testRule = db.Sys_TestRule.FirstOrDefault();
|
||||
if (testRule != null)
|
||||
{
|
||||
getPassScores = testRule.PassingScore;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(getTestRecord.TestPlanId))
|
||||
{////及格分数
|
||||
//var testRule = db.Sys_TestRule.FirstOrDefault();
|
||||
//if (testRule != null)
|
||||
//{
|
||||
// getPassScores = testRule.PassingScore;
|
||||
//}
|
||||
if (getTestScores <= getPassScores)
|
||||
{
|
||||
int testCount = db.Training_TestRecord.Where(x => x.TestPlanId == getTestRecord.TestPlanId && x.TestManId == getTestRecord.TestManId).Count();
|
||||
@@ -478,14 +473,11 @@ namespace WebAPI.Controllers
|
||||
responeData.message = "恭喜考试通过!您的成绩为:【" + getTestScores.ToString() + "】。";
|
||||
}
|
||||
responeData.data = new { getTestScores, getPassScores, returnTestRecordId };
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
responeData.data = new { getTestScores };
|
||||
|
||||
responeData.data = new { getTestScores, getPassScores };
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user