diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/YKTStateMentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/YKTStateMentController.cs index 490abd3a2..bca4feec6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/YKTStateMentController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/YKTStateMentController.cs @@ -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(); + 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) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.cshtml new file mode 100644 index 000000000..3b296cdce --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.cshtml @@ -0,0 +1,50 @@ +@{ + ViewBag.Title = "宿舍调换申请"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
系部
+
+
+
+
专业
+
+
+
+
班级
+
+
+
+
年份
+
+
+
+
月份
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.js new file mode 100644 index 000000000..28de74170 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/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(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs index 20cfc439a..5108fcb7e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs @@ -311,6 +311,18 @@ namespace Learun.Application.Web.Areas.EvaluationTeach.Controllers return Success("保存成功!"); } + /// + /// 整体复制 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoAllCopy(string keyValue) + { + ask_MainIBLL.DoAllCopy(keyValue); + return Success("操作成功!"); + } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/Index.cshtml index 843e01bb6..e024bbef1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/Index.cshtml @@ -30,7 +30,7 @@  录入  修改  删除 -  快速复制 + @* 快速复制*@  管理问题  学生评教情况  教师被评情况 @@ -41,6 +41,9 @@   审核   去审核 +
+  整体复制 +
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/Index.js index 0c62d475c..d61663663 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/Index.js @@ -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 ? "" : ""; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/wsbsdt.png b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/wsbsdt.png new file mode 100644 index 000000000..9bcf6dce2 Binary files /dev/null and b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/wsbsdt.png differ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index e6f489162..4ae362de4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -990,6 +990,7 @@ + @@ -2475,6 +2476,7 @@ + @@ -8062,6 +8064,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault.cshtml index 15744a4a8..bdd225e8e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault.cshtml @@ -3,6 +3,20 @@ Layout = "~/Views/Shared/_Admin.cshtml"; } @Html.AppendCssFile("/Views/Home/AdminDefault/index.css") + @@ -47,6 +61,9 @@
  • 备课任务 0 条
  • *@
  •           共 @ViewBag.UnreadNum 条
  • +
    + +
    @* 即时通讯窗体 *@ diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentBLL.cs index 2c8562094..3589281cc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentBLL.cs @@ -62,6 +62,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable 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 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentEntity.cs index 7975449fc..d1420bcf5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentEntity.cs @@ -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 } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentIBLL.cs index 234331c75..74e1df773 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentIBLL.cs @@ -26,7 +26,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration IEnumerable GetTeacherPageList(Pagination pagination, string queryJson); #endregion - - + + IEnumerable GetAnalysisByMonthForStudentPageList(Pagination paginationobj, string queryJson); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentService.cs index a7403e2cd..363a4ce84 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentService.cs @@ -78,6 +78,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// + /// 一卡通学生月统计 + /// + /// + /// + /// + public IEnumerable 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(strSql.ToString(), pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } public IEnumerable GetTeacherPageList(Pagination pagination, string queryJson) { @@ -127,6 +182,56 @@ B.TERMNAME,c.EmpNo,c.EmpName,d.Name as DepartmentName,c.identityno as IdentityCa } } + /// + /// 一卡通教师月统计 + /// + /// + /// + /// + public IEnumerable 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(strSql.ToString(), pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs index 1eeb3c705..0c9d8eefe 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs @@ -397,6 +397,29 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach } } + /// + /// 整体复制 + /// 主键 + /// + /// + public void DoAllCopy(string keyValue) + { + try + { + ask_MainService.DoAllCopy(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs index e92005214..cab91b210 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs @@ -81,5 +81,12 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach List GetMuiltyResults(string vid, string LessonNo, string EmpNo, string StuNo,string QID); void DeleteQestionResult(string RID); bool HasEnabled(string keyValue); + + /// + /// 整体复制 + /// 主键 + /// + /// + void DoAllCopy(string keyValue); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs index f5ab9e4e1..1e6a95b2e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs @@ -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(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(sql); } catch (Exception ex) @@ -661,11 +661,11 @@ where 1=1 and iscore>100 order by IScore desc"; } } - public List GetMuiltyResults(string vid,string LessonNo,string EmpNo,string StuNo,string QID) + public List 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(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"; } } } + + /// + /// 整体复制 + /// 主键 + /// + /// + public void DoAllCopy(string keyValue) + { + var db = BaseRepository().BeginTrans(); + try + { + var loginUserInfo = LoginUserInfo.Get(); + //Eval_Main表 + var entity = this.BaseRepository().FindEntity(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(x => x.VID == entity.VID); + if (questionList.Any()) + { + var insertEval_QuestionList = new List(); + var insertEval_QuestionItemsList = new List(); + 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(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); + } + } + } + } }