@@ -311,6 +311,18 @@ namespace Learun.Application.Web.Areas.EvaluationTeach.Controllers | |||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
/// <summary> | |||||
/// 整体复制 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DoAllCopy(string keyValue) | |||||
{ | |||||
ask_MainIBLL.DoAllCopy(keyValue); | |||||
return Success("操作成功!"); | |||||
} | |||||
#endregion | #endregion | ||||
@@ -30,7 +30,7 @@ | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a> | <a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a> | ||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 修改</a> | <a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 修改</a> | ||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | <a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | ||||
<a id="lr_copy" class="btn btn-default"><i class="fa fa-plus"></i> 快速复制</a> | |||||
@*<a id="lr_copy" class="btn btn-default"><i class="fa fa-plus"></i> 快速复制</a>*@ | |||||
<a id="lr_question" class="btn btn-default"><i class="fa fa-navicon"></i> 管理问题</a> | <a id="lr_question" class="btn btn-default"><i class="fa fa-navicon"></i> 管理问题</a> | ||||
<a id="lr_answer" class="btn btn-default"><i class="fa fa-building-o"></i> 学生评教情况</a> | <a id="lr_answer" class="btn btn-default"><i class="fa fa-building-o"></i> 学生评教情况</a> | ||||
<a id="lr_teacher" class="btn btn-default"><i class="fa fa-envelope-open"></i> 教师被评情况</a> | <a id="lr_teacher" class="btn btn-default"><i class="fa fa-envelope-open"></i> 教师被评情况</a> | ||||
@@ -41,6 +41,9 @@ | |||||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-lock"></i> 审核</a> | <a id="lr_submit" class="btn btn-default"><i class="fa fa-lock"></i> 审核</a> | ||||
<a id="lr_unsubmit" class="btn btn-default"><i class="fa fa-unlock"></i> 去审核</a> | <a id="lr_unsubmit" class="btn btn-default"><i class="fa fa-unlock"></i> 去审核</a> | ||||
</div> | </div> | ||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_allcopy" class="btn btn-default"><i class="fa fa-lock"></i> 整体复制</a> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="lr-layout-body" id="gridtable"></div> | <div class="lr-layout-body" id="gridtable"></div> | ||||
@@ -193,6 +193,17 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
//整体复制 | |||||
$('#lr_allcopy').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('VID'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.postForm(top.$.rootUrl + '/EvaluationTeach/Eval_Main/DoAllCopy', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
}, | }, | ||||
// 初始化列表 | // 初始化列表 | ||||
initGird: function () { | initGird: function () { | ||||
@@ -201,11 +212,12 @@ var bootstrap = function ($, learun) { | |||||
headData: [ | headData: [ | ||||
{ label: "评教编号", name: "VSerial", width: 250, align: "left" }, | { label: "评教编号", name: "VSerial", width: 250, align: "left" }, | ||||
{ label: "标题", name: "VTitle", width: 200, align: "left" }, | { label: "标题", name: "VTitle", width: 200, align: "left" }, | ||||
{ label: "开始时间", name: "VStartTime", width: 100, align: "left" }, | |||||
{ label: "结束时间", name: "VStopTime", width: 100, align: "left" }, | |||||
{ label: "开始时间", name: "VStartTime", width: 130, align: "left" }, | |||||
{ label: "结束时间", name: "VStopTime", width: 130, align: "left" }, | |||||
{ label: "评教学年", name: "AcademicYearNo", width: 80, align: "left" }, | { label: "评教学年", name: "AcademicYearNo", width: 80, align: "left" }, | ||||
{ label: "评教学期", name: "Semester", width: 80, align: "left" }, | { label: "评教学期", name: "Semester", width: 80, align: "left" }, | ||||
{ label: "排序", name: "VOrder", width: 80, align: "left" }, | { label: "排序", name: "VOrder", width: 80, align: "left" }, | ||||
{ label: "创建时间", name: "VCreateTime", width: 130, align: "left" }, | |||||
{ | { | ||||
label: "审核标志", name: "Status", width: 100, align: "left", formatter: function (cellvalue) { | label: "审核标志", name: "Status", width: 100, align: "left", formatter: function (cellvalue) { | ||||
return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | ||||
@@ -397,6 +397,29 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 整体复制 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void DoAllCopy(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
ask_MainService.DoAllCopy(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -81,5 +81,12 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach | |||||
List<Eval_QuestionResultEntity> GetMuiltyResults(string vid, string LessonNo, string EmpNo, string StuNo,string QID); | List<Eval_QuestionResultEntity> GetMuiltyResults(string vid, string LessonNo, string EmpNo, string StuNo,string QID); | ||||
void DeleteQestionResult(string RID); | void DeleteQestionResult(string RID); | ||||
bool HasEnabled(string keyValue); | bool HasEnabled(string keyValue); | ||||
/// <summary> | |||||
/// 整体复制 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
void DoAllCopy(string keyValue); | |||||
} | } | ||||
} | } |
@@ -562,7 +562,7 @@ where 1=1 "); | |||||
strSql.Append(" and cc.EmpName like '%" + queryParam["keyword"] + "%' "); | strSql.Append(" and cc.EmpName like '%" + queryParam["keyword"] + "%' "); | ||||
} | } | ||||
strSql.Append(" order by ss.EmpNo,ss.LessonNo"); | strSql.Append(" order by ss.EmpNo,ss.LessonNo"); | ||||
return this.BaseRepository().FindList<Eval_QuestionResultEntity>(strSql.ToString()); | return this.BaseRepository().FindList<Eval_QuestionResultEntity>(strSql.ToString()); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -592,7 +592,7 @@ where 1=1 "); | |||||
{ | { | ||||
string sql = @"select c.* from [dbo].[Eval_Main] a left join [dbo].[Eval_Question] b on a.vid=b.vid | string sql = @"select c.* from [dbo].[Eval_Main] a left join [dbo].[Eval_Question] b on a.vid=b.vid | ||||
left join[dbo].[Eval_QuestionResult] c on b.qid=c.qid | left join[dbo].[Eval_QuestionResult] c on b.qid=c.qid | ||||
where a.vid='"+keyValue+"' and c.empno='"+EmpNo+"' and c.lessonno= '"+LessonNo+"' and c.uid= '"+stuno+"'"; | |||||
where a.vid='" + keyValue + "' and c.empno='" + EmpNo + "' and c.lessonno= '" + LessonNo + "' and c.uid= '" + stuno + "'"; | |||||
return BaseRepository().FindList<Eval_QuestionResultEntity>(sql); | return BaseRepository().FindList<Eval_QuestionResultEntity>(sql); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -661,11 +661,11 @@ where 1=1 and iscore>100 order by IScore desc"; | |||||
} | } | ||||
} | } | ||||
public List<Eval_QuestionResultEntity> GetMuiltyResults(string vid,string LessonNo,string EmpNo,string StuNo,string QID) | |||||
public List<Eval_QuestionResultEntity> GetMuiltyResults(string vid, string LessonNo, string EmpNo, string StuNo, string QID) | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
string sql = "select b.* from Eval_Question a left join Eval_QuestionResult b on a.QID=b.QID where a.vid = '" + vid + "' and b.LessonNo='"+ LessonNo + "' and b.EmpNo='"+EmpNo+"' and b.uid='"+ StuNo + "' and b.QID='"+QID+"'"; | |||||
string sql = "select b.* from Eval_Question a left join Eval_QuestionResult b on a.QID=b.QID where a.vid = '" + vid + "' and b.LessonNo='" + LessonNo + "' and b.EmpNo='" + EmpNo + "' and b.uid='" + StuNo + "' and b.QID='" + QID + "'"; | |||||
return BaseRepository().FindList<Eval_QuestionResultEntity>(sql).ToList(); | return BaseRepository().FindList<Eval_QuestionResultEntity>(sql).ToList(); | ||||
} | } | ||||
catch (Exception e) | catch (Exception e) | ||||
@@ -688,7 +688,7 @@ where 1=1 and iscore>100 order by IScore desc"; | |||||
} | } | ||||
} | } | ||||
public bool HasEnabled(string keyValue) | public bool HasEnabled(string keyValue) | ||||
{ | { | ||||
try | try | ||||
@@ -713,5 +713,105 @@ where 1=1 and iscore>100 order by IScore desc"; | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 整体复制 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void DoAllCopy(string keyValue) | |||||
{ | |||||
var db = BaseRepository().BeginTrans(); | |||||
try | |||||
{ | |||||
var loginUserInfo = LoginUserInfo.Get(); | |||||
//Eval_Main表 | |||||
var entity = this.BaseRepository().FindEntity<Eval_MainEntity>(x => x.VID == keyValue); | |||||
if (entity != null) | |||||
{ | |||||
//Eval_Main表副本 | |||||
var insertEval_MainEntity = new Eval_MainEntity() | |||||
{ | |||||
VID = Guid.NewGuid().ToString(), | |||||
UID = loginUserInfo.userId, | |||||
UName = loginUserInfo.realName, | |||||
VTitle = entity.VTitle, | |||||
VContent = entity.VContent, | |||||
VCreateTime = DateTime.Now, | |||||
VStartTime = entity.VStartTime, | |||||
VStopTime = entity.VStopTime, | |||||
AcademicYearNo = entity.AcademicYearNo, | |||||
Semester = entity.Semester, | |||||
Status = false, | |||||
VOrder = entity.VOrder, | |||||
VSerial = "EvaluationTeach_" + CommonHelper.CreateNo() | |||||
}; | |||||
db.Insert(insertEval_MainEntity); | |||||
//Eval_Question表 | |||||
var questionList = this.BaseRepository().FindList<Eval_QuestionEntity>(x => x.VID == entity.VID); | |||||
if (questionList.Any()) | |||||
{ | |||||
var insertEval_QuestionList = new List<Eval_QuestionEntity>(); | |||||
var insertEval_QuestionItemsList = new List<Eval_QuestionItemsEntity>(); | |||||
foreach (var questionItem in questionList) | |||||
{ | |||||
//Eval_Question表副本 | |||||
var insertEval_QuestionEntity = new Eval_QuestionEntity() | |||||
{ | |||||
QID = Guid.NewGuid().ToString(), | |||||
VID = insertEval_MainEntity.VID, | |||||
QTitle = questionItem.QTitle, | |||||
QContent = questionItem.QContent, | |||||
QType = questionItem.QType, | |||||
QMust = questionItem.QMust, | |||||
QMin = questionItem.QMin, | |||||
QMax = questionItem.QMax, | |||||
QOrder = questionItem.QOrder, | |||||
QSerial = "Question_" + CommonHelper.CreateNo() | |||||
}; | |||||
insertEval_QuestionList.Add(insertEval_QuestionEntity); | |||||
//Eval_QuestionItems表 | |||||
var questionItemsList = this.BaseRepository().FindList<Eval_QuestionItemsEntity>(x => x.QID == questionItem.QID); | |||||
if (questionItemsList.Any()) | |||||
{ | |||||
foreach (var qiItem in questionItemsList) | |||||
{ | |||||
//Eval_QuestionItems表副本 | |||||
var insertEval_QuestionItemsEntity = new Eval_QuestionItemsEntity() | |||||
{ | |||||
IID = Guid.NewGuid().ToString(), | |||||
QID = insertEval_QuestionEntity.QID, | |||||
ITitle = qiItem.ITitle, | |||||
IContent = qiItem.IContent, | |||||
QShowText = qiItem.QShowText, | |||||
IScore = qiItem.IScore, | |||||
IOrder = qiItem.IOrder | |||||
}; | |||||
insertEval_QuestionItemsList.Add(insertEval_QuestionItemsEntity); | |||||
} | |||||
} | |||||
} | |||||
db.Insert(insertEval_QuestionList); | |||||
db.Insert(insertEval_QuestionItemsList); | |||||
} | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } |