diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Controllers/SW_Ask_StudentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Controllers/SW_Ask_StudentController.cs index 286a89d70..614096d59 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Controllers/SW_Ask_StudentController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Controllers/SW_Ask_StudentController.cs @@ -128,5 +128,27 @@ namespace Learun.Application.Web.Areas.StudentWork.Controllers } #endregion + #region 扩展数据 + #region 提名 + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult Nominate(string keyValue, string strEntity) + { + var userInfo = LoginUserInfo.Get(); + List entity = strEntity.ToObject>(); + foreach (var item in entity) + { + item.UserClassNo = item.ClassNo; + item.UserDeptNo = item.DeptNo; + item.CreateUserId = userInfo.userId; + item.CreateUserName = userInfo.realName; + item.CreateTime = DateTime.Now; + } + sW_Ask_StudentIBLL.SaveEntityList(keyValue, entity); + return Success("提名成功"); + } + #endregion + + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Main/ApplyForIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Main/ApplyForIndex.cshtml deleted file mode 100644 index 99d48fa8c..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Main/ApplyForIndex.cshtml +++ /dev/null @@ -1,46 +0,0 @@ -@{ - ViewBag.Title = "奖学金申请)"; - Layout = "~/Views/Shared/_Index.cshtml"; -} -
-
-
-
-
    -
  • 可申请奖学金
  • -
  • 已申请奖学金
  • -
  • 我的流程
  • -
-
-
-
-
-
-
-
-
-
-
-
- -
-
-  查询 -
-
-
-
- -
-
-  申请 -
-
-
- -
-
-
-
-
-@Html.AppendJsFile("/Areas/StudentWork/Views/SW_Ask_Main/ApplyForIndex.js") \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Main/ApplyForIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Main/ApplyForIndex.js deleted file mode 100644 index adedb6687..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Main/ApplyForIndex.js +++ /dev/null @@ -1,188 +0,0 @@ -/* - * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) - * Copyright (c) 2013-2018 上海力软信息技术有限公司 - * 创建人:力软-前端开发组 - * 日 期:2017.08.04 - * 描 述:流程(我的任务) - */ -var refreshGirdData; -var bootstrap = function ($, learun) { - "use strict"; - var categoryId = '2'; - var logbegin = ''; - var logend = ''; - - refreshGirdData = function () { - $('#gridtable').jfGridSet('reload'); - } - - var page = { - init: function () { - page.initleft(); - page.initGrid(); - page.bind(); - }, - bind: function () { - $('#datesearch').lrdate({ - dfdata: [ - { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, - { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, - { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, - { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, - ], - // 月 - mShow: false, - premShow: false, - // 季度 - jShow: false, - prejShow: false, - // 年 - ysShow: false, - yxShow: false, - preyShow: false, - yShow: false, - // 默认 - selectfn: function (begin, end) { - logbegin = begin; - logend = end; - - page.search(); - } - }); - // 查询 - $('#btn_Search').on('click', function () { - var keyword = $('#txt_Keyword').val(); - page.search({ keyword: keyword }); - }); - // 刷新 - $('#lr_refresh').on('click', function () { - location.reload(); - }); - // 查看流程进度 - $('#lr_eye').on('click', function () { - page.eye(); - }); - - //// 发起流程 - //$('#lr_release').on('click', function () { - // learun.layerForm({ - // id: 'form', - // title: '选择流程模板', - // url: top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/ReleaseForm', - // height: 600, - // width: 825, - // maxmin: true, - // callBack: function (id) { - // return top[id].acceptClick(); - // } - // }); - //}); - - //// 审核流程 - //$('#lr_verify').on('click', function () { - // page.verify(); - //}); - }, - initleft: function () { - $('#lr_left_list li').on('click', function () { - var $this = $(this); - var $parent = $this.parent(); - $parent.find('.active').removeClass('active'); - $this.addClass('active'); - - categoryId = $this.attr('data-value'); - - if (categoryId == '2') { - $('#lr_verify').show(); - $('#lr_verify span').text("审核"); - } - else { - $('#lr_verify').hide(); - } - - page.search(); - }); - }, - initGrid: function () { - $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/StudentWork/SW_Ask_Main/GetPageList', - headData: [ - { label: "问卷编号", name: "VSerial", width: 180, align: "left" }, - { label: "标题", name: "VTitle", width: 200, align: "left" }, - { - label: "类别", name: "TId", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'SW_Ask_Type', - key: value, - keyId: 'id', - callback: function (_data) { - callback(_data['tname']); - } - }); - } - }, - { label: "学年", name: "AcademicYearNo", width: 80, align: "left" }, - { label: "学期", name: "Semester", width: 80, align: "left" }, - { label: "排序", name: "VOrder", width: 80, align: "left" }, - //{ - // label: "是否提交", name: "IsSubmit", 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.StartTime = logbegin; - param.EndTime = logend; - - $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param), categoryId: categoryId }); - }, - - eye: function () { - var processId = $('#gridtable').jfGridValue('F_Id') || ''; - var taskId = $('#gridtable').jfGridValue('F_TaskId') || ''; - var title = $('#gridtable').jfGridValue('F_Title'); - var schemeName = $('#gridtable').jfGridValue('F_SchemeName'); - var taskType = $('#gridtable').jfGridValue('F_TaskType'); - - if (schemeName != title && title) { - title = schemeName + "(" + title + ")"; - } - else { - title = schemeName; - } - - var enabledMark = $('#gridtable').jfGridValue('F_EnabledMark'); - if (enabledMark == 2) {// 草稿不允许查看进度 - learun.alert.warning("草稿不能查看进度"); - return; - } - - if (learun.checkrow(processId)) { - if (taskType == '4' || taskType == '6') { - learun.frameTab.open({ F_ModuleId: processId + taskId, F_Icon: 'fa magic', F_FullName: '查看流程进度【' + title + '】', F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?tabIframeId=' + processId + taskId + '&type=childlook' + "&processId=" + processId + "&taskId=" + taskId }); - } - else { - learun.frameTab.open({ F_ModuleId: processId + taskId, F_Icon: 'fa magic', F_FullName: '查看流程进度【' + title + '】', F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?tabIframeId=' + processId + taskId + '&type=look' + "&processId=" + processId + "&taskId=" + taskId }); - } - } - } - - }; - - page.init(); -} - - diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Student/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Student/Index.js index c4895908d..4d787ccfc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Student/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Student/Index.js @@ -101,7 +101,7 @@ var bootstrap = function ($, learun) { //提名 $('#lr_Nominate').on('click', function () { learun.layerFormForPercent({ - id: 'formitem', + id: 'formItem', title: '奖学金提名', url: top.$.rootUrl + '/StudentWork/SW_Ask_Student/IndexTwo', width: "60%", diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Student/IndexTwo.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Student/IndexTwo.js index 73e740063..c68d626f0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Student/IndexTwo.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StudentWork/Views/SW_Ask_Student/IndexTwo.js @@ -6,10 +6,6 @@ */ var refreshGirdData; var acceptClick; -//var AId = request("AId"); -//console.log(AId); -//var currentUser = request("currentUser");//我的资产需要用到 -//var IsDelete = request("IsDelete");//报废资产需要使用 var bootstrap = function ($, learun) { "use strict"; var page = { @@ -126,9 +122,17 @@ var bootstrap = function ($, learun) { }; // 保存数据 acceptClick = function (callBack) { - console.log(111,22) var selectedRow = $('#gridtable').jfGridGet('rowdata'); - callBack(selectedRow); + var postData = { + strEntity: JSON.stringify(selectedRow) + }; + var keyValue = ""; + $.lrSaveForm(top.$.rootUrl + '/StudentWork/SW_Ask_Student/Nominate?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); }; page.init(); } @@ -161,38 +165,4 @@ function datedifference(sDate1, sDate2) { //sDate1和sDate2是2006-12-18格 dateSpan = Math.abs(dateSpan); iDays = Math.floor(dateSpan / (24 * 3600 * 1000)); return iDays; -}; - - - -function AddPrintContent(html) { - var myHtml = myHtml = html; - // var strBodyStyle=""; - // var strFormHtml=strBodyStyle+""+myHtml+""; - var strFormHtml = "" + myHtml + ""; - - LODOP = getLodop(); - LODOP.PRINT_INIT("资产编号"); - LODOP.SET_PRINT_PAGESIZE(2, '40mm', '32.3mm', ""); - - LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2); - LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7); - - LODOP.ADD_PRINT_HTM(10, 8, '40mm', '30mm', strFormHtml); - //打印预览 - // LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1); - // var TaskID1=LODOP.PREVIEW(); - // 直接打印 - var TaskID1 = LODOP.PRINT(); - -}; -//function hiddenButton() { - -// $("#lr_add").hide(); -// $("#lr_printBar").hide(); -// $("#lr_edit").hide(); -// $("#lr_delete").hide(); -// $("#lr_detail").hide(); -// $("#lr_import").hide(); -//} - +}; \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentBLL.cs index 8c18eeb97..855a22275 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentBLL.cs @@ -142,7 +142,30 @@ namespace Learun.Application.TwoDevelopment.StudentWork } } } - + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntityList(string keyValue, List entity) + { + try + { + sW_Ask_StudentService.SaveEntityList(keyValue, entity); + } + 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/StudentWork/SW_Ask_Student/SW_Ask_StudentEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentEntity.cs index 3f2d13bb5..d2acd9669 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentEntity.cs @@ -54,6 +54,16 @@ namespace Learun.Application.TwoDevelopment.StudentWork /// [Column("DEMO")] public string Demo { get; set; } + /// + /// 系 + /// + [NotMapped] + public string DeptNo { get; set; } + /// + /// 班级 + /// + [NotMapped] + public string ClassNo { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentIBLL.cs index 569834d8c..de01c0cfd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentIBLL.cs @@ -49,6 +49,13 @@ namespace Learun.Application.TwoDevelopment.StudentWork /// 主键 /// 实体 void SaveEntity(string keyValue, SW_Ask_StudentEntity entity); + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntityList(string keyValue, List entity); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentService.cs index 062a5f511..c406a5c0a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StudentWork/SW_Ask_Student/SW_Ask_StudentService.cs @@ -151,16 +151,54 @@ namespace Learun.Application.TwoDevelopment.StudentWork { try { - if (!string.IsNullOrEmpty(keyValue)) + var entityList = this.BaseRepository().FindEntity(p => p.Id != entity.Id && p.StuNo == entity.StuNo); + if (entityList == null) { - entity.Modify(keyValue); - this.BaseRepository().Update(entity); + 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 { - entity.Create(); - this.BaseRepository().Insert(entity); + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntityList(string keyValue, List entity) + { + var db = BaseRepository().BeginTrans(); + try + { + foreach (var item in entity) + { + var entityLists = this.BaseRepository().FindEntity(p => p.StuNo == item.StuNo); + if (entityLists == null) + { + item.Create(); + db.Insert(item); + } } + db.Commit(); } catch (Exception ex) { @@ -174,7 +212,6 @@ namespace Learun.Application.TwoDevelopment.StudentWork } } } - #endregion }