@@ -30,6 +30,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return View(); | |||
} | |||
[HttpGet] | |||
public ActionResult GenerateNearByYear() | |||
{ | |||
return Success(Learun.Util.WebHelper.GenerateNearByYear()); | |||
} | |||
[HttpGet] | |||
public ActionResult ManageIndexTeacher() | |||
@@ -51,6 +56,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return View(); | |||
} | |||
[HttpGet] | |||
public ActionResult AnalysisByMonthForStudent() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -77,6 +88,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return Success(jsonData); | |||
} | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetAnalysisByMonthForStudentPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = yktStateMentIbll.GetAnalysisByMonthForStudentPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetTeacherPageList(string pagination, string queryJson) | |||
@@ -0,0 +1,50 @@ | |||
@{ | |||
ViewBag.Title = "宿舍调换申请"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="datesearch"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">系部</div> | |||
<div id="DeptNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="MajorNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">班级</div> | |||
<div id="ClassNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">年份</div> | |||
<div id="Year"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">月份</div> | |||
<div id="Months"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.js") |
@@ -0,0 +1,120 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-07-11 14:34 | |||
* 描 述:宿舍调换申请 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var startTime; | |||
var endTime; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 300, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
$('#DeptNo').lrselect({ | |||
value: "deptno", | |||
text: "deptname", | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', | |||
select: function (item) { | |||
if (item) { | |||
$('#MajorNo').lrselectRefresh({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', | |||
param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" } | |||
}); | |||
} | |||
else { | |||
$('#MajorNo').lrselectRefresh({ | |||
url: "", | |||
data: [] | |||
}); | |||
} | |||
$('#ClassNo').lrselectRefresh({ | |||
url: "", | |||
data: [] | |||
}); | |||
} | |||
}); | |||
$('#MajorNo').lrselect({ | |||
value: "majorno", | |||
text: "majorname", | |||
select: function (item) { | |||
if (item) { | |||
$('#ClassNo').lrselectRefresh({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', | |||
param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" } | |||
}); | |||
} | |||
} | |||
}); | |||
$('#MajorNo').on("click", | |||
function () { | |||
var data = $('#DeptNo').lrselectGet(); | |||
if (!data) { | |||
learun.alert.error('请先选择系'); | |||
} | |||
}); | |||
$('#ClassNo').on("click", | |||
function () { | |||
var data1 = $('#DeptNo').lrselectGet(); | |||
var data2 = $('#MajorNo').lrselectGet(); | |||
if (!data1 || !data2) { | |||
learun.alert.error('请先选择系和专业'); | |||
} | |||
}); | |||
$('#ClassNo').lrselect({ | |||
value: "classno", | |||
text: "classname" | |||
}); | |||
$('#Months').lrDataItemSelect({ code: "MonthInt", type: "multiple" }); | |||
$('#Year').lrselect({ | |||
url: top.$.rootUrl + '/EducationalAdministration/YKTStateMent/GenerateNearByYear', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/YKTStateMent/GetAnalysisByMonthForStudentPageList', | |||
headData: [ | |||
{ label: "学号", name: "StuNo", width: 100, align: "left" }, | |||
{ label: "姓名", name: "StuName", width: 100, align: "left" }, | |||
{ label: "系部", name: "DeptName", width: 100, align: "left" }, | |||
{ label: "专业", name: "MajorName", width: 100, align: "left" }, | |||
{ label: "班级", name: "ClassName", width: 100, align: "left" }, | |||
{ label: "身份证号", name: "IdentityCardNo", width: 150, align: "left" }, | |||
{ label: "消费金额", name: "MONEY", width: 100, align: "left", statistics: true }, | |||
{ label: "消费次数", name: "PayTimes", width: 100, align: "left", statistics: true }, | |||
{ label: "平均消费金额", name: "PerMoney", width: 100, align: "left", statistics: true } | |||
], | |||
isPage: true | |||
}); | |||
//page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.StartDate = startTime; | |||
param.EndDate = endTime; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -311,6 +311,18 @@ namespace Learun.Application.Web.Areas.EvaluationTeach.Controllers | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 整体复制 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DoAllCopy(string keyValue) | |||
{ | |||
ask_MainIBLL.DoAllCopy(keyValue); | |||
return Success("操作成功!"); | |||
} | |||
#endregion | |||
@@ -30,7 +30,7 @@ | |||
<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_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_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> | |||
@@ -41,6 +41,9 @@ | |||
<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> | |||
</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 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 () { | |||
@@ -201,11 +212,12 @@ var bootstrap = function ($, learun) { | |||
headData: [ | |||
{ label: "评教编号", name: "VSerial", width: 250, 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: "Semester", 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) { | |||
return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||
@@ -990,6 +990,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\Acc_DormitoryChange\FormView.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\CdMajor\FormProvince.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\CdMajor\IndexProvince.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\YKTStateMent\AnalysisByMonthForStudent.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\YKTStateMent\ManageIndexTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\YKTStateMent\IndexForTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoBasic\ImportForm.css" /> | |||
@@ -2475,6 +2476,7 @@ | |||
<Content Include="Content\images\SsoSystem\search.png" /> | |||
<Content Include="Content\images\SsoSystem\user.jpg" /> | |||
<Content Include="Content\images\StuRecruitmentBrochure.jpg" /> | |||
<Content Include="Content\images\wsbsdt.png" /> | |||
<Content Include="Content\jquery\plugin\jqprint\jqprint.css" /> | |||
<Content Include="Content\jquery\plugin\jqprint\jQuery.print.js" /> | |||
<Content Include="Content\jquery\plugin\jSignature.min.js" /> | |||
@@ -8062,6 +8064,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\YKTStateMent\ManageIndexTeacher.cshtml" /> | |||
<Content Include="Content\excel\StuInfoBasicUpdateImport.xls" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoBasic\ImportForm.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\YKTStateMent\AnalysisByMonthForStudent.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -3,6 +3,20 @@ | |||
Layout = "~/Views/Shared/_Admin.cshtml"; | |||
} | |||
@Html.AppendCssFile("/Views/Home/AdminDefault/index.css") | |||
<style> | |||
.lr-im-bell2 { | |||
width: 80px; | |||
right: 123px; | |||
display: flex; | |||
justify-content: space-around; | |||
align-items: center; | |||
} | |||
.lr-im-bell2 .point { | |||
left: 23px; | |||
right: auto; | |||
} | |||
</style> | |||
<script> | |||
function request(d) { for (var c = location.search.slice(1).split("&"), a = 0; a < c.length; a++) { var b = c[a].split("="); if (b[0] == d) if ("undefined" == unescape(b[1])) break; else return unescape(b[1]) } return "" }; | |||
</script> | |||
@@ -47,6 +61,9 @@ | |||
<li><a href="javascript:void(0);" id="btn_gongwen3"><i class="fa fa-balance-scale"></i>备课任务 0 条</a></li>*@ | |||
<li> 共 @ViewBag.UnreadNum 条</li> | |||
</ul> | |||
<div style="display: inline-block; line-height: 18px; position: relative; top: -3px;" title="网上办事大厅"> | |||
<a href="/SSOSystem/DragModelOne" class="down downsso"><img src="~/Content/images/wsbsdt.png" /></a> | |||
</div> | |||
</div> | |||
@* 即时通讯窗体 *@ | |||
@@ -62,6 +62,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public IEnumerable<YKTStateMentEntity> GetAnalysisByMonthForStudentPageList(Pagination paginationobj, string queryJson) | |||
{ | |||
try | |||
{ | |||
return yKTStateMentService.GetAnalysisByMonthForStudentPageList(paginationobj, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
@@ -56,6 +56,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
public string EmpName { get; set; } | |||
public string DepartmentName { get; set; } | |||
public string PayTimes { get; set; } | |||
public string PerMoney { get; set; } | |||
#endregion | |||
} | |||
@@ -26,7 +26,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
IEnumerable<YKTStateMentEntity> GetTeacherPageList(Pagination pagination, string queryJson); | |||
#endregion | |||
IEnumerable<YKTStateMentEntity> GetAnalysisByMonthForStudentPageList(Pagination paginationobj, string queryJson); | |||
} | |||
} |
@@ -78,6 +78,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 一卡通学生月统计 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
public IEnumerable<YKTStateMentEntity> GetAnalysisByMonthForStudentPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var queryParam = queryJson.ToJObject(); | |||
var strSql = new StringBuilder(); | |||
strSql.Append( | |||
@"SELECT C.StuNo,C.StuName,d.DeptName,f.MajorName,e.ClassName,c.identityno as IdentityCardNo, sum(round(A.OPFARE/100,2)) AS MONEY,count(stuno) as PayTimes,round(sum(round(A.OPFARE/100,2))/count(stuno),2) as PerMoney | |||
FROM M_REC_CONSUME@ykt A LEFT JOIN M_BASE_TERM@ykt B ON A.TERMID = B.TERMID | |||
left join ds_stuinfo C on A.OUTID = C.mobile | |||
left join ds_dept d on c.deptno = d.deptno | |||
left join ds_classinfo e on c.classno = e.classno | |||
left join ds_major f on c.majorno=f.majorno | |||
where 1=1 and stuno is not null "); | |||
if (!queryParam["DeptNo"].IsEmpty()) | |||
{ | |||
strSql.Append($" AND C.DeptNo='{queryParam["DeptNo"].ToString()}' "); | |||
} | |||
if (!queryParam["MajorNo"].IsEmpty()) | |||
{ | |||
strSql.Append($" AND C.MajorNo='{queryParam["MajorNo"].ToString()}' "); | |||
} | |||
if (!queryParam["ClassNo"].IsEmpty()) | |||
{ | |||
strSql.Append($" AND C.ClassNo ='{queryParam["ClassNo"].ToString()}' "); | |||
} | |||
if (!queryParam["Months"].IsEmpty()) | |||
{ | |||
strSql.Append(" and extract(month from A.OPDT) in("+ queryParam["Months"].ToString() + ")"); | |||
} | |||
if (!queryParam["Year"].IsEmpty()) | |||
{ | |||
strSql.Append(" and extract(year from A.OPDT) in(" + queryParam["Year"].ToString() + ")"); | |||
} | |||
strSql.Append("group by C.StuNo, C.StuName,d.DeptNo, d.DeptName, f.MajorName,f.MajorNo, e.ClassNo,e.ClassName, c.identityno"); | |||
return BaseRepository("TLMZYMIDDLEString").FindList<YKTStateMentEntity>(strSql.ToString(), pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<YKTStateMentEntity> GetTeacherPageList(Pagination pagination, string queryJson) | |||
{ | |||
@@ -127,6 +182,56 @@ B.TERMNAME,c.EmpNo,c.EmpName,d.Name as DepartmentName,c.identityno as IdentityCa | |||
} | |||
} | |||
/// <summary> | |||
/// 一卡通教师月统计 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
public IEnumerable<YKTStateMentEntity> GetAnalysisByMonthForTeacherPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var queryParam = queryJson.ToJObject(); | |||
var strSql = new StringBuilder(); | |||
strSql.Append( | |||
@"SELECT c.EmpNo,c.EmpName,d.Name as DepartmentName,c.identityno as IdentityCardNo, sum(round(A.OPFARE/100,2)) AS MONEY,count(EmpNo) as PayTimes,round(sum(round(A.OPFARE/100,2))/count(EmpNo),2) as PerMoney | |||
FROM M_REC_CONSUME@ykt A LEFT JOIN M_BASE_TERM@ykt B ON A.TERMID = B.TERMID | |||
left join ds_empinfo C on A.OUTID = C.mobile | |||
left join ds_department d on c.departmentid=d.id | |||
where 1=1 and EmpNo is not null "); | |||
if (!queryParam["EmpNo"].IsEmpty()) | |||
{ | |||
strSql.Append($" AND C.EmpNo like '%{queryParam["EmpNo"].ToString()}%' "); | |||
} | |||
if (!queryParam["EmpName"].IsEmpty()) | |||
{ | |||
strSql.Append($" AND C.EmpName like '%{queryParam["EmpName"].ToString()}%' "); | |||
} | |||
if (!queryParam["DepartmentId"].IsEmpty()) | |||
{ | |||
strSql.Append($" AND C.DepartmentId='{queryParam["DepartmentId"].ToString()}' "); | |||
} | |||
if (!queryParam["Months"].IsEmpty()) | |||
{ | |||
strSql.Append(" and extract(month from A.OPDT) in(" + queryParam["Months"].ToString() + ")"); | |||
} | |||
strSql.Append("group by c.EmpNo,c.EmpName,d.DepartmentId,d.Name,c.identityno"); | |||
return BaseRepository("TLMZYMIDDLEString").FindList<YKTStateMentEntity>(strSql.ToString(), pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
@@ -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 | |||
} | |||
@@ -81,5 +81,12 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach | |||
List<Eval_QuestionResultEntity> GetMuiltyResults(string vid, string LessonNo, string EmpNo, string StuNo,string QID); | |||
void DeleteQestionResult(string RID); | |||
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(" order by ss.EmpNo,ss.LessonNo"); | |||
return this.BaseRepository().FindList<Eval_QuestionResultEntity>(strSql.ToString()); | |||
} | |||
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 | |||
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); | |||
} | |||
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 | |||
{ | |||
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(); | |||
} | |||
catch (Exception e) | |||
@@ -688,7 +688,7 @@ where 1=1 and iscore>100 order by IScore desc"; | |||
} | |||
} | |||
public bool HasEnabled(string keyValue) | |||
{ | |||
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); | |||
} | |||
} | |||
} | |||
} | |||
} |