diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Ask_MainOfTeacherController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Ask_MainOfTeacherController.cs new file mode 100644 index 000000000..f6918a368 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Ask_MainOfTeacherController.cs @@ -0,0 +1,247 @@ +using System; +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.Ask; +using System.Web.Mvc; +using System.Collections.Generic; +using Learun.Application.TwoDevelopment.EducationalAdministration; + +namespace Learun.Application.Web.Areas.Ask.Controllers +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-04-23 15:50 + /// 描 述:教师问卷管理 + /// + public class Ask_MainOfTeacherController : MvcControllerBase + { + private Ask_MainOfTeacherIBLL ask_MainOfTeacherIBLL = new Ask_MainOfTeacherBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + + [HttpGet] + public ActionResult AnswerIndex() + { + return View(); + } + + [HttpGet] + public ActionResult TeacherIndex() + { + var logininfo = LoginUserInfo.Get(); + ViewBag.EmpNo = logininfo.account; + ViewBag.EmpName = logininfo.realName; + return View(); + } + [HttpGet] + public ActionResult AnswerQuery() + { + return View(); + } + + [HttpGet] + public ActionResult Paper(string VID) + { + ViewBag.EmpNo = LoginUserInfo.Get().account; + ViewBag.EmpName = LoginUserInfo.Get().realName; + if (!string.IsNullOrEmpty(VID)) + { + var Ask_MainOfTeacher = ask_MainOfTeacherIBLL.GetAsk_MainOfTeacherEntityAndQuestions(VID); + return View(Ask_MainOfTeacher); + } + else + { + return View(); + } + } + [HttpGet] + public ActionResult PaperAdminView(string VID) + { + ViewBag.EmpNo = LoginUserInfo.Get().account; + ViewBag.EmpName = LoginUserInfo.Get().realName; + if (!string.IsNullOrEmpty(VID)) + { + var Ask_MainOfTeacher = ask_MainOfTeacherIBLL.GetAsk_MainOfTeacherEntityAndQuestions(VID); + return View(Ask_MainOfTeacher); + } + else + { + return View(); + } + } + [HttpGet] + public ActionResult PaperView(string VID,string EmpNo) + { + if (!string.IsNullOrEmpty(VID)) + { + var Ask_MainOfTeacher = ask_MainOfTeacherIBLL.GetAsk_MainOfTeacherEntityAndQuestionsResult(VID, EmpNo); + return View(Ask_MainOfTeacher); + } + else + { + return View(); + } + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + ViewBag.VSerial = "Table_" + CommonHelper.CreateNo(); + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = ask_MainOfTeacherIBLL.GetPageList(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) + { + Pagination paginationobj = pagination.ToObject(); + var data = ask_MainOfTeacherIBLL.GetTeacherPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + + [HttpGet] + [AjaxOnly] + public ActionResult GetAnswerPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = ask_MainOfTeacherIBLL.GetTeacherPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Ask_MainOfTeacherData = ask_MainOfTeacherIBLL.GetAsk_MainOfTeacherEntity(keyValue); + var jsonData = new + { + Ask_MainOfTeacher = Ask_MainOfTeacherData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + ask_MainOfTeacherIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + + [HttpPost] + [AjaxOnly] + public ActionResult SubmitForm(string keyValue) + { + ask_MainOfTeacherIBLL.ChangeFormStatus(keyValue, true); + return Success("操作成功!"); + } + + [HttpPost] + [AjaxOnly] + public ActionResult UnSubmitForm(string keyValue) + { + ask_MainOfTeacherIBLL.ChangeFormStatus(keyValue, false); + return Success("操作成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + var userinfo = LoginUserInfo.Get(); + Ask_MainOfTeacherEntity entity = strEntity.ToObject(); + entity.UID = userinfo.userId; + entity.UName = userinfo.realName; + entity.VCreateTime = DateTime.Now; + entity.Status = false; + entity.SPVNum = 0; + entity.SPNum = 0; + entity.SClick = 0; + ask_MainOfTeacherIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + [ValidateInput(false)] + public ActionResult TeacherSubmitForm(string answerlist,string VID) + { + var userinfo = LoginUserInfo.Get(); + List entity = answerlist.ToObject>(); + ask_MainOfTeacherIBLL.SaveAsk_QuestionResultEntity(entity, VID,userinfo.account,userinfo.realName, userinfo.iPAddress); + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerIndex.cshtml new file mode 100644 index 000000000..f6f195120 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerIndex.cshtml @@ -0,0 +1,38 @@ +@{ + ViewBag.Title = "教师问卷管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
姓名
+ +
+
+
编号
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/Ask/Views/Ask_MainOfTeacher/AnswerIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerIndex.js new file mode 100644 index 000000000..3755394dd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerIndex.js @@ -0,0 +1,88 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-23 15:50 + * 描 述:教师问卷管理 + */ +var refreshGirdData; +var VID = request("VID"); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 答题情况 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + var EmpNo = $('#gridtable').jfGridValue('EmpNo'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('IsAnswer'); + if (Status === false || Status === 'false') { + learun.alert.warning("当前项目未交卷!"); + return; + } + learun.frameTab.open({ F_ModuleId: 'paper' + keyValue, F_Icon: 'fa fa-window-maximize', F_FullName: '量表考核答卷', F_UrlAddress: '/Ask/Ask_MainOfTeacher/PaperView?VID=' + keyValue + '&EmpNo=' + EmpNo }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/GetAnswerPageList', + headData: [ + { label: "姓名", name: "EmpName", width: 80, align: "left" }, + { label: "编号", name: "EmpNo", width: 80, align: "left" }, + { + label: "性别", name: "GenderNo", width: 80, align: "left", + formatter: function (cellvalue) { + return cellvalue.toLowerCase() === true || cellvalue.toLowerCase() == "true" ? "男" : "女"; + } + }, + { + label: "考核部门", name: "DepartmentId", width: 150, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "是否交卷", name: "IsAnswer", width: 80, align: "left", formatter: function (cellvalue) { + return cellvalue === true ? "" : ""; + } + }, + { label: "得分", name: "TotalScore", width: 80, align: "left" } + ], + mainId: 'EmpNo', + isPage: true, + sidx: 'TotalScore', + sord: 'DESC' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.VID = VID; + param.Manager = true; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerQuery.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerQuery.cshtml new file mode 100644 index 000000000..bd4360dd0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerQuery.cshtml @@ -0,0 +1,46 @@ +@{ + ViewBag.Title = "教师问卷管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
标题
+ +
+
+
问卷编号
+ +
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/Ask/Views/Ask_MainOfTeacher/AnswerQuery.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerQuery.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerQuery.js new file mode 100644 index 000000000..7ec140512 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/AnswerQuery.js @@ -0,0 +1,217 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-23 15:50 + * 描 述:教师问卷管理 + */ +var refreshGirdData; +var ATId; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.inittree(); + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + if (!ATId) { + learun.alert.warning('请选择分类!'); + return false; + } + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/Form?ATId=' + ATId, + width: 780, + height: 560, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status === true || Status == 'true') { + learun.alert.warning("当前项目已审核不能修改!"); + return; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/Form?keyValue=' + keyValue, + width: 780, + height: 560, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status === true || Status == 'true') { + learun.alert.warning("当前项目已审核不能删除!"); + return; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 管理问题 + $('#lr_question').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status === true || Status == 'true') { + learun.alert.warning("当前项目已审核不能修改!"); + return; + } + learun.layerForm({ + id: 'formquestion', + title: '管理问题', + url: top.$.rootUrl + '/Ask/Ask_Question/Index?VID=' + keyValue, + width: 980, + height: 760, + btn:null + }); + } + }); + // 答题情况 + $('#lr_answer').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formanswer', + title: '答题情况', + url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/AnswerIndex?VID=' + keyValue, + width: 980, + height: 760, + btn:null + }); + } + }); + //  审核 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status === true || Status == 'true') { + learun.alert.warning("当前项目已审核!"); + return; + } + learun.layerConfirm('是否确认审核该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/SubmitForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  去审核 + $('#lr_unsubmit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status !== true && Status !== 'true') { + learun.alert.warning("当前项目已去审核!"); + return; + } + learun.layerConfirm('是否确认去审核该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/UnSubmitForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + inittree: function () { + $('#companyTree').lrtree({ + url: top.$.rootUrl + '/Ask/Ask_Type/GetAllTree', + nodeClick: page.treeNodeClick + }); + }, + treeNodeClick: function (item) { + ATId = item.id; + $('#titleinfo').text(item.text); + page.search(); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/GetPageList', + headData: [ + { label: "问卷编号", name: "VSerial", width: 180, align: "left" }, + { label: "标题", name: "VTitle", width: 200, align: "left" }, + { + label: "类别", name: "ATId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ask_Type', + key: value, + keyId: 'atid', + callback: function (_data) { + callback(_data['atname']); + } + }); + } + }, + { label: "开始时间", name: "VStartTime", width: 100, align: "left" }, + { label: "结束时间", name: "VStopTime", width: 100, align: "left" }, + { label: "考核部门", name: "DepartmentIdsName", width: 150, align: "left" }, + { label: "考核人数", name: "SPVNum", width: 80, align: "left" }, + { label: "填写人数", name: "SPNum", width: 80, align: "left" }, + { label: "点击热度", name: "SClick", width: 80, align: "left" }, + { label: "排序", name: "VOrder", width: 80, align: "left" }, + { + label: "是否匿名", name: "VHide", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "" : ""; + } + }, + { + label: "审核标志", name: "Status", width: 100, align: "left", formatter: function (cellvalue) { + return cellvalue == true ? "" : ""; + } + } + ], + mainId: 'VID', + isPage: true, + sidx:'VOrder' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.ATId = ATId; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Form.cshtml new file mode 100644 index 000000000..d855c288e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Form.cshtml @@ -0,0 +1,48 @@ +@{ + ViewBag.Title = "教师问卷管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
问卷编号
+ +
+
+
标题*
+ +
+
+
类别*
+
+ +
+
+
排序*
+ +
+
+
开始时间*
+ +
+
+
结束时间*
+ +
+
+
考核部门
+
+ +
+
+
是否匿名*
+
+
+
+
备注说明
+ +
+
+@Html.AppendJsFile("/Areas/Ask/Views/Ask_MainOfTeacher/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Form.js new file mode 100644 index 000000000..84c92bf26 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Form.js @@ -0,0 +1,73 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-23 15:50 + * 描 述:教师问卷管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +var pATId = request("ATId"); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#ATId').lrselect({ + type: 'tree', + // 展开最大高度 + maxHeight: 200, + // 是否允许搜索 + allowSearch: true, + // 访问数据接口地址 + url: top.$.rootUrl + '/Ask/Ask_Type/GetAllTree', + select: function(item) { + if (item != null && item != undefined) { + $("#ATName").val(item.text); + } + } + }); + if (!!pATId) { + $('#ATId').lrselectSet(pATId); + } + $('#DepartmentIds').lrDepartmentSelect({ type: 'treemultiple' }); + $('#VHide').lrDataItemSelect({ code: 'YesOrNoBit' }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/GetFormData?keyValue=' + keyValue, + function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } else { + $("#VSerial").val(NewVSerial); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + $("#DepartmentIdsName").val($("#DepartmentIds").find(".lr-select-placeholder").text()); + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Index.cshtml new file mode 100644 index 000000000..9e142139d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Index.cshtml @@ -0,0 +1,57 @@ +@{ + ViewBag.Title = "教师问卷管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
分类
+
+
+
+
+
+
+ 未选择分类 - 分类信息 +
+
+
+
+
+
+
+
标题
+ +
+
+
问卷编号
+ +
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/Ask/Views/Ask_MainOfTeacher/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Index.js new file mode 100644 index 000000000..70fde3e14 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Index.js @@ -0,0 +1,237 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-23 15:50 + * 描 述:教师问卷管理 + */ +var refreshGirdData; +var ATId; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.inittree(); + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + if (!ATId) { + learun.alert.warning('请选择分类!'); + return false; + } + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/Form?ATId=' + ATId, + width: 780, + height: 560, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status === true || Status == 'true') { + learun.alert.warning("当前项目已审核不能修改!"); + return; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/Form?keyValue=' + keyValue, + width: 780, + height: 560, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status === true || Status == 'true') { + learun.alert.warning("当前项目已审核不能删除!"); + return; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 管理问题 + $('#lr_question').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status === true || Status == 'true') { + learun.alert.warning("当前项目已审核不能修改!"); + return; + } + learun.layerForm({ + id: 'formquestion', + title: '管理问题', + url: top.$.rootUrl + '/Ask/Ask_Question/Index?VID=' + keyValue, + width: 980, + height: 760, + btn: null + }); + } + }); + // 结果分析 + $('#lr_analysis').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formanalysis', + title: '结果分析', + url: top.$.rootUrl + '/Ask/Ask_Question/AnalysisIndex?VID=' + keyValue, + width: 1000, + height: 760, + btn: null + }); + } + }); + // 答题情况 + $('#lr_answer').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formanswer', + title: '答题情况', + url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/AnswerIndex?VID=' + keyValue, + width: 980, + height: 760, + btn: null + }); + } + }); + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + top.learun.frameTab.open({ F_ModuleId: 'paper' + keyValue, F_Icon: 'fa fa-window-maximize', F_FullName: '量表考核答卷', F_UrlAddress: '/Ask/Ask_MainOfTeacher/PaperAdminView?VID=' + keyValue }); + } + }); + //  审核 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status === true || Status == 'true') { + learun.alert.warning("当前项目已审核!"); + return; + } + learun.layerConfirm('是否确认审核该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/SubmitForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  去审核 + $('#lr_unsubmit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status !== true && Status !== 'true') { + learun.alert.warning("当前项目已去审核!"); + return; + } + learun.layerConfirm('是否确认去审核该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/UnSubmitForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + inittree: function () { + $('#companyTree').lrtree({ + url: top.$.rootUrl + '/Ask/Ask_Type/GetAllTree', + nodeClick: page.treeNodeClick + }); + }, + treeNodeClick: function (item) { + ATId = item.id; + $('#titleinfo').text(item.text); + page.search(); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/GetPageList', + headData: [ + { label: "问卷编号", name: "VSerial", width: 180, align: "left" }, + { label: "标题", name: "VTitle", width: 200, align: "left" }, + { + label: "类别", name: "ATId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ask_Type', + key: value, + keyId: 'atid', + callback: function (_data) { + callback(_data['atname']); + } + }); + } + }, + { label: "开始时间", name: "VStartTime", width: 100, align: "left" }, + { label: "结束时间", name: "VStopTime", width: 100, align: "left" }, + { label: "考核部门", name: "DepartmentIdsName", width: 150, align: "left" }, + { label: "考核人数", name: "SPVNum", width: 80, align: "left" }, + { label: "填写人数", name: "SPNum", width: 80, align: "left" }, + { label: "点击热度", name: "SClick", width: 80, align: "left" }, + { label: "排序", name: "VOrder", width: 80, align: "left" }, + { + label: "是否匿名", name: "VHide", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "" : ""; + } + }, + { + label: "审核标志", name: "Status", width: 100, align: "left", formatter: function (cellvalue) { + return cellvalue == true ? "" : ""; + } + } + ], + mainId: 'VID', + isPage: true, + sidx: 'VOrder' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.ATId = ATId; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Paper.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Paper.cshtml new file mode 100644 index 000000000..dab5b36eb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Paper.cshtml @@ -0,0 +1,66 @@ +@{ + ViewBag.Title = "教师问卷管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@model Learun.Application.TwoDevelopment.Ask.Ask_MainOfTeacherEntity + + + + + +
+ +
+ + +
@Model.VTitle
+
@(Model.VStartTime.HasValue ? Model.VStartTime.Value.ToShortDateString() : "")~@(Model.VStopTime.HasValue ? Model.VStopTime.Value.ToShortDateString() : "")
+
+
+ @foreach (var question in Model.Ask_Questions) + { +
+
+
+
@question.QTitle @Html.Raw((question.QMust == true ? "*" : "")) @(question.QType == 2 && (question.QMin.HasValue) ? "最少选择" + question.QMin.Value + "项" : "") @(question.QType == 2 && (question.QMax.HasValue) ? "最多选择" + question.QMax.Value + "项" : "")
+
+ @foreach (var questionitem in question.Ask_QuestionItems) + { +
+ @questionitem.ITitle +
+ } +
+
+
+ @if (question.Ask_QuestionItems.Count(m => m.QShowText == true) > 0) + { +
+ @question.Ask_QuestionItems.FirstOrDefault(m => m.QShowText == true).ITitle +
+ +
+
+ } + +
+ } + +
+
本人声明在此报名表中填写的所有信息、 及提供与本表相关的一切资料均真实、准确
+
+
+
提  交
+
+
+
+
+
+
+ + + +
+@Html.AppendJsFile("/Areas/Ask/Views/Ask_MainOfTeacher/Paper.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Paper.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Paper.js new file mode 100644 index 000000000..2628e924b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/Paper.js @@ -0,0 +1,77 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-23 15:50 + * 描 述:教师问卷管理 + */ +var refreshGirdData; +var VID = request("VID"); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.warpper').lrscroll(); + page.bind(); + }, + bind: function () { + $('.shenBtn').click(function () { + $('#AskPaper').trigger("validate"); + }); + //单选框 + $('.shenInputBox').on('click', + '.inputRadio', + function () { + if (!$(this).hasClass('active')) { + $(this).addClass('active').parents('.shenInputBox').find('.inputRadio').not($(this)) + .removeClass('active'); + judgeRideo($(this)); + } + }); + + //多选框 + $('.inputCheck').click(function () { + if ($(this).hasClass('active')) { + $(this).removeClass('active'); + } else { + $(this).addClass('active'); + } + judgeRideo($(this)); + }); + //是否为其他选项判断 + function judgeRideo(obj) { + var parents = obj.parents('.signSec2Box'); + var inputs = parents.find('.shenInput3'); + if (parents.find("i[hasinput='yes']").hasClass('active')) { + inputs.css({ display: 'block' }); + } else { + inputs.css({ display: 'none' }); + } + } + $('#AskPaper').validator({ + timely: 2, + theme: 'yellow_right_effect', + valid: function (form) { + learun.layerConfirm('是否确认提交答案?', function (res) { + var answerlist = new Array(); + var strStuNo = $("#EmpNo").val(); + var strStuName = $("#EmpName").val(); + $(form).find("input.xuanze:checked").each(function (index, element) { + var itemvalue = { QID: $(this).attr("qid"), IID: $(this).attr("id"), UText: "", UID: strStuNo, UName:strStuName}; + if ($(this).attr("hasinput")=="yes") { + itemvalue.UText = $("#" + $(this).attr("id") + "Other").val(); + } + answerlist.push(itemvalue); + }); + if (res) { + learun.postForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/TeacherSubmitForm', { answerlist: JSON.stringify(answerlist), VID: VID, "__RequestVerificationToken": $.lrToken }, function () { + learun.frameTab.parentIframe().refreshGirdData(); + learun.frameTab.close("paper" + VID); + }); + } + }); + } + }); + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperAdminView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperAdminView.cshtml new file mode 100644 index 000000000..2ec2afcfe --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperAdminView.cshtml @@ -0,0 +1,57 @@ +@{ + ViewBag.Title = "教师问卷管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@model Learun.Application.TwoDevelopment.Ask.Ask_MainOfTeacherEntity + + + + + +
+ +
+ + +
@Model.VTitle
+
@(Model.VStartTime.HasValue ? Model.VStartTime.Value.ToShortDateString() : "")~@(Model.VStopTime.HasValue ? Model.VStopTime.Value.ToShortDateString() : "")
+
+
+ @foreach (var question in Model.Ask_Questions) + { +
+
+
+
@question.QTitle @Html.Raw((question.QMust == true ? "*" : "")) @(question.QType == 2 && (question.QMin.HasValue) ? "最少选择" + question.QMin.Value + "项" : "") @(question.QType == 2 && (question.QMax.HasValue) ? "最多选择" + question.QMax.Value + "项" : "")
+
+ @foreach (var questionitem in question.Ask_QuestionItems) + { +
+ @questionitem.ITitle +
+ } +
+
+
+ @if (question.Ask_QuestionItems.Count(m => m.QShowText == true) > 0) + { +
+ @question.Ask_QuestionItems.FirstOrDefault(m => m.QShowText == true).ITitle +
+ +
+
+ } + +
+ } +
+
+
+ + + +
+@Html.AppendJsFile("/Areas/Ask/Views/Ask_MainOfTeacher/PaperAdminView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperAdminView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperAdminView.js new file mode 100644 index 000000000..2628e924b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperAdminView.js @@ -0,0 +1,77 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-23 15:50 + * 描 述:教师问卷管理 + */ +var refreshGirdData; +var VID = request("VID"); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.warpper').lrscroll(); + page.bind(); + }, + bind: function () { + $('.shenBtn').click(function () { + $('#AskPaper').trigger("validate"); + }); + //单选框 + $('.shenInputBox').on('click', + '.inputRadio', + function () { + if (!$(this).hasClass('active')) { + $(this).addClass('active').parents('.shenInputBox').find('.inputRadio').not($(this)) + .removeClass('active'); + judgeRideo($(this)); + } + }); + + //多选框 + $('.inputCheck').click(function () { + if ($(this).hasClass('active')) { + $(this).removeClass('active'); + } else { + $(this).addClass('active'); + } + judgeRideo($(this)); + }); + //是否为其他选项判断 + function judgeRideo(obj) { + var parents = obj.parents('.signSec2Box'); + var inputs = parents.find('.shenInput3'); + if (parents.find("i[hasinput='yes']").hasClass('active')) { + inputs.css({ display: 'block' }); + } else { + inputs.css({ display: 'none' }); + } + } + $('#AskPaper').validator({ + timely: 2, + theme: 'yellow_right_effect', + valid: function (form) { + learun.layerConfirm('是否确认提交答案?', function (res) { + var answerlist = new Array(); + var strStuNo = $("#EmpNo").val(); + var strStuName = $("#EmpName").val(); + $(form).find("input.xuanze:checked").each(function (index, element) { + var itemvalue = { QID: $(this).attr("qid"), IID: $(this).attr("id"), UText: "", UID: strStuNo, UName:strStuName}; + if ($(this).attr("hasinput")=="yes") { + itemvalue.UText = $("#" + $(this).attr("id") + "Other").val(); + } + answerlist.push(itemvalue); + }); + if (res) { + learun.postForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/TeacherSubmitForm', { answerlist: JSON.stringify(answerlist), VID: VID, "__RequestVerificationToken": $.lrToken }, function () { + learun.frameTab.parentIframe().refreshGirdData(); + learun.frameTab.close("paper" + VID); + }); + } + }); + } + }); + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperView.cshtml new file mode 100644 index 000000000..d508f79ca --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperView.cshtml @@ -0,0 +1,56 @@ +@{ + ViewBag.Title = "教师问卷管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@model Learun.Application.TwoDevelopment.Ask.Ask_MainOfTeacherEntity + + + + + +
+ +
+
@Model.VTitle
+
@(Model.VStartTime.HasValue ? Model.VStartTime.Value.ToShortDateString() : "")~@(Model.VStopTime.HasValue ? Model.VStopTime.Value.ToShortDateString() : "")
+
+
+ @foreach (var question in Model.Ask_Questions) + { +
+
+
+
@question.QTitle @Html.Raw((question.QMust == true ? "*" : "")) @(question.QType == 2 && (question.QMin.HasValue) ? "最少选择" + question.QMin.Value + "项" : "") @(question.QType == 2 && (question.QMax.HasValue) ? "最多选择" + question.QMax.Value + "项" : "")
+
+ @foreach (var questionitem in question.Ask_QuestionItems) + { +
+ @questionitem.ITitle +
+ } +
+
+
+ @if (question.Ask_QuestionItems.Count(m => m.QShowText == true) > 0) + { +
+ @question.Ask_QuestionItems.FirstOrDefault(m => m.QShowText == true).ITitle +
+ +
+
+ } + +
+ } + +
+
+
+ + + +
+@Html.AppendJsFile("/Areas/Ask/Views/Ask_MainOfTeacher/PaperView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperView.js new file mode 100644 index 000000000..e0030c91a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/PaperView.js @@ -0,0 +1,55 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-23 15:50 + * 描 述:教师问卷管理 + */ +var refreshGirdData; +var VID = request("VID"); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.warpper').lrscroll(); + page.bind(); + }, + bind: function () { + //单选框 + $('.shenInputBox').on('click', + '.inputRadio', + function () { + if (!$(this).hasClass('active')) { + $(this).addClass('active').parents('.shenInputBox').find('.inputRadio').not($(this)) + .removeClass('active'); + judgeRideo($(this)); + } + }); + + //多选框 + $('.inputCheck').click(function () { + if ($(this).hasClass('active')) { + $(this).removeClass('active'); + } else { + $(this).addClass('active'); + } + judgeRideo($(this)); + }); + //是否为其他选项判断 + function judgeRideo(obj) { + var parents = obj.parents('.signSec2Box'); + var inputs = parents.find('.shenInput3'); + if (parents.find("i[hasinput='yes']").hasClass('active')) { + inputs.css({ display: 'block' }); + } else { + inputs.css({ display: 'none' }); + } + } + $('form').find("input.xuanze:checked").each(function (index, element) { + if ($(this).attr("hasinput") == "yes") { + $("#" + $(this).attr("id") + "Other").parents(".shenInput3").css({ display: 'block' }); + } + }); + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/TeacherIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/TeacherIndex.cshtml new file mode 100644 index 000000000..d9c60b86f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/TeacherIndex.cshtml @@ -0,0 +1,42 @@ +@{ + ViewBag.Title = "教师问卷管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + +
+
+
+
+
+
+
+
+
+
标题
+ +
+
+
问卷编号
+ +
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/Ask/Views/Ask_MainOfTeacher/TeacherIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/TeacherIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/TeacherIndex.js new file mode 100644 index 000000000..72a3ffb4f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Ask_MainOfTeacher/TeacherIndex.js @@ -0,0 +1,93 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-23 15:50 + * 描 述:教师问卷管理 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + $('#lr_start').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('IsAnswer'); + if (Status === true || Status === 'true') { + learun.alert.warning("当前项目已交卷!"); + return; + } + top.learun.frameTab.open({ F_ModuleId: 'paper' + keyValue, F_Icon: 'fa fa-window-maximize', F_FullName: '量表考核答卷', F_UrlAddress: '/Ask/Ask_MainOfTeacher/Paper?VID=' + keyValue }); + } + }); + //查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('VID'); + var EmpNo = $('#gridtable').jfGridValue('EmpNo'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('IsAnswer'); + if (Status === false || Status === 'false') { + learun.alert.warning("当前项目未交卷!"); + return; + } + top.learun.frameTab.open({ F_ModuleId: 'paper' + keyValue, F_Icon: 'fa fa-window-maximize', F_FullName: '量表考核答卷', F_UrlAddress: '/Ask/Ask_MainOfTeacher/PaperView?VID=' + keyValue + '&EmpNo=' + EmpNo }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/GetTeacherPageList', + headData: [ + { label: "问卷编号", name: "VSerial", width: 180, align: "left" }, + { label: "标题", name: "VTitle", width: 200, align: "left" }, + { + label: "类别", name: "ATId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ask_Type', + key: value, + keyId: 'atid', + callback: function (_data) { + callback(_data['atname']); + } + }); + } + }, + { label: "开始时间", name: "VStartTime", width: 100, align: "left" }, + { label: "结束时间", name: "VStopTime", width: 100, align: "left" }, + { + label: "是否交卷", name: "IsAnswer", width: 80, align: "left", formatter: function (cellvalue) { + return cellvalue === true ? "" : ""; + } + }, + { label: "考核评分", name: "TotalScore", width: 80, align: "left" }, + { label: "提交时间", name: "CreateDate", width: 80, align: "left" } + ], + mainId: 'VID', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.EmpNo = EmpNo; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} 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 ee7e2695b..c15903c21 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 @@ -284,6 +284,7 @@ + @@ -826,6 +827,14 @@ + + + + + + + + @@ -7366,6 +7375,14 @@ + + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/Ask_MainOfTeacherMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/Ask_MainOfTeacherMap.cs new file mode 100644 index 000000000..13a632549 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/Ask_MainOfTeacherMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.Ask; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-04-23 15:50 + /// 描 述:教师问卷管理 + /// + public class Ask_MainOfTeacherMap : EntityTypeConfiguration + { + public Ask_MainOfTeacherMap() + { + #region 表、主键 + //表 + this.ToTable("ASK_MAINOFTEACHER"); + //主键 + this.HasKey(t => t.VID); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index e49536cf2..a03f1492d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -61,6 +61,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherBLL.cs new file mode 100644 index 000000000..62d4a7881 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherBLL.cs @@ -0,0 +1,222 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; +using Learun.Application.TwoDevelopment.EducationalAdministration; + +namespace Learun.Application.TwoDevelopment.Ask +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-04-23 15:50 + /// 描 述:教师问卷管理 + /// + public class Ask_MainOfTeacherBLL : Ask_MainOfTeacherIBLL + { + private Ask_MainOfTeacherService ask_MainOfTeacherService = new Ask_MainOfTeacherService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return ask_MainOfTeacherService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Ask_MainOfTeacher表实体数据 + /// 主键 + /// + /// + public Ask_MainOfTeacherEntity GetAsk_MainOfTeacherEntity(string keyValue) + { + try + { + return ask_MainOfTeacherService.GetAsk_MainOfTeacherEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public Ask_MainOfTeacherEntity GetAsk_MainOfTeacherEntityAndQuestions(string keyValue) + { + try + { + return ask_MainOfTeacherService.GetAsk_MainOfTeacherEntityAndQuestions(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public Ask_MainOfTeacherEntity GetAsk_MainOfTeacherEntityAndQuestionsResult(string keyValue,string empno) + { + try + { + return ask_MainOfTeacherService.GetAsk_MainOfTeacherEntityAndQuestionsResult(keyValue, empno); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + ask_MainOfTeacherService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, Ask_MainOfTeacherEntity entity) + { + try + { + ask_MainOfTeacherService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void ChangeFormStatus(string keyValue, bool status) + { + try + { + ask_MainOfTeacherService.ChangeFormStatus(keyValue, status); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + public IEnumerable GetTeacherPageList(Pagination pagination, string queryJson) + { + try + { + return ask_MainOfTeacherService.GetTeacherPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void SaveAsk_QuestionResultEntity(List entity, string vid, + string userinfoUserId, string userinfoRealName, string userinfoIPAddress) + { + try + { + ask_MainOfTeacherService.SaveAsk_QuestionResultEntity(entity, vid, userinfoUserId, userinfoRealName, userinfoIPAddress); + } + 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/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherEntity.cs new file mode 100644 index 000000000..f99a9fc31 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherEntity.cs @@ -0,0 +1,159 @@ +using Learun.Util; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.Ask +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-04-23 15:50 + /// 描 述:教师问卷管理 + /// + public class Ask_MainOfTeacherEntity + { + #region 实体成员 + /// + /// VID + /// + [Column("VID")] + public string VID { get; set; } + /// + /// UID + /// + [Column("UID")] + public string UID { get; set; } + /// + /// UName + /// + [Column("UNAME")] + public string UName { get; set; } + /// + /// ATId + /// + [Column("ATID")] + public string ATId { get; set; } + /// + /// ATName + /// + [Column("ATNAME")] + public string ATName { get; set; } + /// + /// VTitle + /// + [Column("VTITLE")] + public string VTitle { get; set; } + /// + /// VContent + /// + [Column("VCONTENT")] + public string VContent { get; set; } + /// + /// VCreateTime + /// + [Column("VCREATETIME")] + public DateTime? VCreateTime { get; set; } + /// + /// VStartTime + /// + [Column("VSTARTTIME")] + public DateTime? VStartTime { get; set; } + /// + /// VStopTime + /// + [Column("VSTOPTIME")] + public DateTime? VStopTime { get; set; } + /// + /// DepartmentIdsName + /// + [Column("DEPARTMENTIDSNAME")] + public string DepartmentIdsName { get; set; } + + /// + /// DepartmentIds + /// + [Column("DEPARTMENTIDS")] + public string DepartmentIds { get; set; } + /// + /// Status + /// + [Column("STATUS")] + public bool? Status { get; set; } + /// + /// SPVNum + /// + [Column("SPVNUM")] + public int? SPVNum { get; set; } + /// + /// SPNum + /// + [Column("SPNUM")] + public int? SPNum { get; set; } + /// + /// SClick + /// + [Column("SCLICK")] + public int? SClick { get; set; } + /// + /// VOrder + /// + [Column("VORDER")] + public int? VOrder { get; set; } + /// + /// VHide + /// + [Column("VHIDE")] + public bool? VHide { get; set; } + /// + /// VSerial + /// + [Column("VSERIAL")] + public string VSerial { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.VID = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.VID = keyValue; + } + #endregion + #region 扩展字段 + [NotMapped] + public bool? IsAnswer { get; set; } + [NotMapped] + public decimal? TotalScore { get; set; } + [NotMapped] + public DateTime? CreateDate { get; set; } + [NotMapped] + public string EmpName { get; set; } + [NotMapped] + public string EmpNo { get; set; } + [NotMapped] + public string DepartmentId { get; set; } + [NotMapped] + public string GenderNo { get; set; } + + [NotMapped] + public List Ask_Questions + { + get; + set; + } + + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherIBLL.cs new file mode 100644 index 000000000..7814f6ed8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherIBLL.cs @@ -0,0 +1,57 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; +using Learun.Application.TwoDevelopment.EducationalAdministration; + +namespace Learun.Application.TwoDevelopment.Ask +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-04-23 15:50 + /// 描 述:教师问卷管理 + /// + public interface Ask_MainOfTeacherIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Ask_MainOfTeacher表实体数据 + /// 主键 + /// + /// + Ask_MainOfTeacherEntity GetAsk_MainOfTeacherEntity(string keyValue); + + Ask_MainOfTeacherEntity GetAsk_MainOfTeacherEntityAndQuestions(string keyValue); + Ask_MainOfTeacherEntity GetAsk_MainOfTeacherEntityAndQuestionsResult(string keyValue, string empno); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + void SaveEntity(string keyValue, Ask_MainOfTeacherEntity entity); + #endregion + + void ChangeFormStatus(string keyValue, bool status); + IEnumerable GetTeacherPageList(Pagination pagination, string queryJson); + void SaveAsk_QuestionResultEntity(List entity, string vid, string userinfoUserId, + string userinfoRealName, string userinfoIPAddress); + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherService.cs new file mode 100644 index 000000000..3444aed04 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Ask_MainOfTeacher/Ask_MainOfTeacherService.cs @@ -0,0 +1,406 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using Learun.Application.Base.SystemModule; +using Learun.Application.TwoDevelopment.EducationalAdministration; + +namespace Learun.Application.TwoDevelopment.Ask +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-04-23 15:50 + /// 描 述:教师问卷管理 + /// + public class Ask_MainOfTeacherService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.* "); + strSql.Append(" FROM Ask_MainOfTeacher t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["VTitle"].IsEmpty()) + { + dp.Add("VTitle", "%" + queryParam["VTitle"].ToString() + "%", DbType.String); + strSql.Append(" AND t.VTitle Like @VTitle "); + } + if (!queryParam["VSerial"].IsEmpty()) + { + dp.Add("VSerial", "%" + queryParam["VSerial"].ToString() + "%", DbType.String); + strSql.Append(" AND t.VSerial Like @VSerial "); + } + if (!queryParam["ATId"].IsEmpty()) + { + dp.Add("ATId", "" + queryParam["ATId"].ToString() + "", DbType.String); + strSql.Append(" AND t.ATId Like @ATId "); + } + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public IEnumerable GetTeacherPageList(Pagination pagination, string queryJson) + { + try + { + //取库名 + var misdbname = BaseRepository("CollegeMIS").getDbConnection().Database; + var basedbname = BaseRepository().getDbConnection().Database; + var strSql = new StringBuilder(); + strSql.Append("SELECT t.*,b.IsAnswer,b.TotalScore,b.CreateDate,c.EmpNo,c.EmpName,c.GenderNo,c.F_DepartmentId as DepartmentId "); + strSql.Append(" FROM " + basedbname + ".dbo.Ask_MainOfTeacher t right join " + basedbname + ".dbo.Ask_TeacherMain b on t.VID=b.VID left join " + misdbname + ".dbo.EmpInfo c on b.EmpNo=c.EmpNo "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (queryParam["Manager"].IsEmpty()) + { + strSql.Append(" and t.Status=1 "); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + dp.Add("EmpNo", "" + queryParam["EmpNo"].ToString() + "", DbType.String); + strSql.Append(" AND b.EmpNo=@EmpNo "); + } + if (!queryParam["EmpName"].IsEmpty()) + { + dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); + strSql.Append(" AND c.EmpName like @EmpName "); + } + if (!queryParam["VTitle"].IsEmpty()) + { + dp.Add("VTitle", "%" + queryParam["VTitle"].ToString() + "%", DbType.String); + strSql.Append(" AND t.VTitle Like @VTitle "); + } + if (!queryParam["VSerial"].IsEmpty()) + { + dp.Add("VSerial", "%" + queryParam["VSerial"].ToString() + "%", DbType.String); + strSql.Append(" AND t.VSerial Like @VSerial "); + } + if (!queryParam["ATId"].IsEmpty()) + { + dp.Add("ATId", "" + queryParam["ATId"].ToString() + "", DbType.String); + strSql.Append(" AND t.ATId Like @ATId "); + } + if (!queryParam["VID"].IsEmpty()) + { + dp.Add("VID", "" + queryParam["VID"].ToString() + "", DbType.String); + strSql.Append(" AND t.VID = @VID "); + } + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Ask_MainOfTeacher表实体数据 + /// 主键 + /// + /// + public Ask_MainOfTeacherEntity GetAsk_MainOfTeacherEntity(string keyValue) + { + try + { + return BaseRepository().FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public Ask_MainOfTeacherEntity GetAsk_MainOfTeacherEntityAndQuestions(string keyValue) + { + try + { + var Ask_MainOfTeacher = BaseRepository().FindEntity(keyValue); + var questionlist = BaseRepository().FindList(m => m.VID == keyValue).OrderBy(m => m.QOrder).ToList(); + foreach (var questionEntity in questionlist) + { + if (questionEntity.QType == 1) + { + questionEntity.QTypeString = "radio"; + } + else if (questionEntity.QType == 2) + { + questionEntity.QTypeString = "checkbox"; + } + else + { + questionEntity.QTypeString = "text"; + } + questionEntity.Ask_QuestionItems = BaseRepository().FindList(m => m.QID == questionEntity.QID).OrderBy(m => m.IOrder).ToList(); + } + Ask_MainOfTeacher.Ask_Questions = questionlist; + return Ask_MainOfTeacher; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository().Delete(t => t.VID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, Ask_MainOfTeacherEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository().Update(entity); + } + else + { + entity.Create(); + this.BaseRepository().Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + public void ChangeFormStatus(string keyValue, bool status) + { + try + { + var entity = BaseRepository().FindEntity(keyValue); + if (status) + { + entity.VCreateTime = DateTime.Now; + //统计调查人数 + StringBuilder sql = new StringBuilder("select distinct * from EmpInfo a where CheckMark=1 "); + if (!string.IsNullOrEmpty(entity.DepartmentIds)) + { + List departList = entity.DepartmentIds.Split(',').ToList(); + for (var i = 0; i < departList.Count; i++) + { + departList[i] = "'" + departList[i] + "'"; + } + sql.Append(" and a.F_DepartmentId in(" + string.Join(",", departList.ToArray()) + ")"); + } + var empinfo = BaseRepository("CollegeMIS").FindList(sql.ToString()).ToList(); + BaseRepository().Delete(m => m.VID == entity.VID); + foreach (var item in empinfo) + { + Ask_TeacherMainEntity askTeacherMain = new Ask_TeacherMainEntity(); + askTeacherMain.Create(); + askTeacherMain.EmpNo = item.EmpNo; + askTeacherMain.VID = entity.VID; + askTeacherMain.IsAnswer = false; + askTeacherMain.TotalScore = 0; + BaseRepository().Insert(askTeacherMain); + } + entity.SPVNum = empinfo.Count; + entity.Status = true; + } + else + { + entity.Status = false; + } + BaseRepository().Update(entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public void SaveAsk_QuestionResultEntity(List entity, string vid, + string userinfoUserId, string userinfoRealName, string userinfoIpAddress) + { + var db = BaseRepository().BeginTrans(); + try + { + decimal totalscore = 0; + foreach (var item in entity) + { + Ask_QuestionResultEntity questionResult = new Ask_QuestionResultEntity(); + questionResult.Create(); + questionResult.QID = item.QID; + questionResult.QID = item.QID; + questionResult.IID = item.IID; + questionResult.UID = userinfoUserId; + questionResult.UName = userinfoRealName; + if (!string.IsNullOrEmpty(item.UText)) + { + questionResult.UText = item.UText; + } + questionResult.UTime=DateTime.Now; + questionResult.UIP = userinfoIpAddress; + db.Insert(questionResult); + var score = db.FindEntity(m => m.IID == item.IID).IScore; + if (score != null) + totalscore += score.Value; + } + db.ExecuteBySql("update Ask_MainOfTeacher set SPNum=isnull(SPNum,0)+1 where VID='" + vid + "'"); + var teacherpaper = db.FindEntity(m => m.VID == vid && m.EmpNo == userinfoUserId); + if (teacherpaper != null) + { + teacherpaper.IsAnswer = true; + teacherpaper.TotalScore = totalscore; + teacherpaper.CreateDate=DateTime.Now; + db.Update(teacherpaper); + } + db.Commit(); + } + catch (Exception e) + { + db.Rollback(); + throw; + } + } + + public Ask_MainOfTeacherEntity GetAsk_MainOfTeacherEntityAndQuestionsResult(string keyValue, string empno) + { + try + { + var Ask_MainOfTeacher = BaseRepository().FindEntity(keyValue); + var questionlist = BaseRepository().FindList(m => m.VID == keyValue).OrderBy(m => m.QOrder).ToList(); + foreach (var questionEntity in questionlist) + { + if (questionEntity.QType == 1) + { + questionEntity.QTypeString = "radio"; + } + else if (questionEntity.QType == 2) + { + questionEntity.QTypeString = "checkbox"; + } + else + { + questionEntity.QTypeString = "text"; + } + var questionitemslist= BaseRepository().FindList(m => m.QID == questionEntity.QID).OrderBy(m => m.IOrder).ToList(); + foreach (var qii in questionitemslist) + { + var qresult = BaseRepository().FindEntity(m => + m.QID == questionEntity.QID && m.IID == qii.IID && m.UID == empno); + if (qresult != null) + { + qii.IsChecked = true; + qii.UText = qresult.UText; + } + } + questionEntity.Ask_QuestionItems = questionitemslist; + } + Ask_MainOfTeacher.Ask_Questions = questionlist; + return Ask_MainOfTeacher; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index cea1fed6c..a3a9d7487 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -70,6 +70,10 @@ + + + +