From 7c2fc4093aa5d6b3468c412bdf168bc5b1aca7e5 Mon Sep 17 00:00:00 2001 From: edy Date: Thu, 19 Aug 2021 09:20:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8D=A3=E8=AA=89=E7=A7=B0=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DtHonorInfoController.cs | 23 ++++ .../Controllers/DtHonorTypeController.cs | 4 + .../Controllers/DtRaceTypeController.cs | 4 + .../Views/DtHonorInfo/AuditForm.cshtml | 47 +++++++ .../Views/DtHonorInfo/AuditForm.js | 118 ++++++++++++++++++ .../Views/DtHonorInfo/Form.js | 38 +++--- .../Views/DtHonorInfo/Index.cshtml | 29 +++-- .../Views/DtHonorInfo/Index.js | 53 ++++++-- .../Views/DtHonorType/Form.js | 6 +- .../Views/DtHonorType/Index.js | 15 +-- .../Views/DtRaceType/Index.js | 1 - .../Learun.Application.Web.csproj | 2 + .../XmlConfig/ioc.config | 4 +- .../DtHonorInfo/DtHonorInfoBLL.cs | 69 ++++++++++ .../DtHonorInfo/DtHonorInfoIBLL.cs | 21 ++++ .../DtHonorInfo/DtHonorInfoService.cs | 99 +++++++++++---- .../Learun.Application.WorkFlow.csproj | 1 + .../NodeMethod/DispatchMethod.cs | 8 +- .../NodeMethod/HonorMethod.cs | 29 +++++ 19 files changed, 484 insertions(+), 87 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/AuditForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/AuditForm.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/HonorMethod.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtHonorInfoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtHonorInfoController.cs index ba076bbeb..672e6bb17 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtHonorInfoController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtHonorInfoController.cs @@ -41,6 +41,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 审核界面 + /// + /// + [HttpGet] + public ActionResult AuditForm() + { + return View(); + } + #endregion #region 获取数据 @@ -145,6 +155,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success(data); } + + /// + /// 提交单子 + /// + /// 表主键 + /// 审核状态 + /// 流程Id + /// + public ActionResult ModifyStatus(string keyValue, int pastatus, string processId) + { + dtHonorInfoIBLL.ModifyStatus(keyValue, pastatus, processId); + return Success("提交成功!"); + } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtHonorTypeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtHonorTypeController.cs index bdc02fc69..4dda6508d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtHonorTypeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtHonorTypeController.cs @@ -94,6 +94,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, DtHonorTypeEntity entity) { var Model = dtHonorTypeIBLL.GetByItemId(keyValue, entity.ItemId); + if (string.IsNullOrEmpty(entity.ItemId) || string.IsNullOrEmpty(entity.ItemName) || string.IsNullOrEmpty(entity.HOrder.ToString())) + { + return Fail("请填写必填项"); + } if (string.IsNullOrEmpty(entity.ParentId)) { entity.ParentId = "0"; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtRaceTypeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtRaceTypeController.cs index 89528d9ce..cb4e6d6b1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtRaceTypeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/DtRaceTypeController.cs @@ -96,6 +96,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, DtRaceTypeEntity entity) { var model = dtRaceTypeIBLL.GetEntityByCode(entity.ItemId); + if (string.IsNullOrEmpty(entity.ItemId) || string.IsNullOrEmpty(entity.ItemName) || string.IsNullOrEmpty(entity.DOrder)) + { + return Fail("请填写必填项"); + } if (string.IsNullOrEmpty(entity.ParentId)) { entity.ParentId = "0"; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/AuditForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/AuditForm.cshtml new file mode 100644 index 000000000..bbfe8d78c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/AuditForm.cshtml @@ -0,0 +1,47 @@ +@{ + ViewBag.Title = "荣誉称号"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
申请开始时间*
+ +
+
+
申请结束时间*
+ +
+
+
类型*
+
+
+
+
评定周期*
+
+
+
+
评定学年*
+
+
+
+
评定学期*
+
+
+
+
备注
+ +
+ + + +
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/AuditForm/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/AuditForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/AuditForm.js new file mode 100644 index 000000000..d43b3ec7e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/AuditForm.js @@ -0,0 +1,118 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-08-13 15:17 + * 描 述:荣誉称号 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var bootstrap = function ($, learun) { + "use strict"; + // 设置权限 + setAuthorize = function (data) { + if(!!data) + { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#ItemId').lrHonorTypeSelect(); + $('#Cycle').lrDataItemSelect({ code: 'ThisCycle' }); + $('#SchoolYear').lrselect({ + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/DtHonorInfo/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + $('#Emester').lrDataItemSelect({ code: 'Semester' }); + $('#CareteUser')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#CareteUser').val(learun.clientdata.get(['userinfo']).realName); + $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#State').val('0'); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/DtHonorInfo/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]); + } + } + }); + } + } + }; + // 设置表单数据 + setFormData = function (processId,param,callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/DtHonorInfo/GetFormDataByProcessId?processId=' + processId, function (data) { + for (var id in data) { + if (!!data[id] && data[id].length > 0) { + $('#' + id ).jfGridSet('refreshdata', data[id]); + } + else { + if(id == 'DtHonorInfo' && data[id] ){ + keyValue = data[id].Id; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); } + // 验证数据是否填写完整 + validForm = function () { + if (!$('body').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = $('body').lrGetFormData(); + if(!!processId){ + formData.processId =processId; + } + var postData = { + strEntity: JSON.stringify(formData) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/DtHonorInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Form.js index 0b9d93ce9..5bbe258b5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Form.js @@ -18,24 +18,23 @@ var bootstrap = function ($, learun) { "use strict"; // 设置权限 setAuthorize = function (data) { - if(!!data) - { - for (var field in data) { - if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 - $('#' + data[field].fieldId).parent().remove(); - } - else { - if (data[field].isEdit != 1) { - $('#' + data[field].fieldId).attr('disabled', 'disabled'); - if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { - $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); - $('#' + data[field].fieldId).find('.btn-success').remove(); - } - } - } - } - } - }; + if(!!data) { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; var page = { init: function () { $('.lr-form-wrap').lrscroll(); @@ -43,7 +42,7 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - $('#ItemId').lrDataItemSelect({ code: 'HonorType' }); + $('#ItemId').lrHonorTypeSelect(); $('#Cycle').lrDataItemSelect({ code: 'ThisCycle' }); $('#SchoolYear').lrselect({ placeholder: "请选择学年", @@ -56,6 +55,7 @@ var bootstrap = function ($, learun) { $('#CareteUser')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; $('#CareteUser').val(learun.clientdata.get(['userinfo']).realName); $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#State').val('0'); }, initData: function () { if (!!keyValue) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Index.cshtml index bad68ee19..86a4c07d4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Index.cshtml @@ -10,19 +10,21 @@
-
-
-
-
类型
-
-
-
-
评定周期
-
-
-
-
评定学年
-
+
+
+
+
+
类型
+
+
+
+
评定周期
+
+
+
+
评定学年
+
+
@@ -35,6 +37,7 @@  新增  编辑  删除 +  提交
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Index.js index 9ddfb605b..260a4e67a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorInfo/Index.js @@ -46,7 +46,7 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); - $('#ItemId').lrDataItemSelect({ code: 'HonorType' }); + $('#ItemId').lrHonorTypeSelect(); $('#Cycle').lrDataItemSelect({ code: 'ThisCycle' }); //学年 $('#SchoolYear').lrselect({ @@ -119,6 +119,25 @@ var bootstrap = function ($, learun) { }); } }); + // 提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var State = $('#gridtable').jfGridValue('State'); + if (State !== 0) { + learun.alert.warning("当前项目已提交,请耐心等待审批!"); + return; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/EducationalAdministration/DtHonorInfo/ModifyStatus', { keyValue: keyValue, pastatus: 1, processId: processId }, function (res) { + refreshGirdData(res, {}); + }); + } + }); + } + }); }, // 初始化列表 initGird: function () { @@ -128,13 +147,14 @@ var bootstrap = function ($, learun) { { label: "申请开始时间", name: "BeginTime", width: 180, align: "left" }, { label: "申请结束时间", name: "EndTime", width: 180, align: "left" }, { - label: "类型", name: "ItemId", width: 200, align: "left", + label: "荣誉称号", name: "ItemId", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('dataItem', { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DtHonorType', key: value, - code: 'HonorType', + keyId: 'itemid', callback: function (_data) { - callback(_data.text); + callback(_data['itemname']); } }); } @@ -182,19 +202,19 @@ var bootstrap = function ($, learun) { formatter: function (cellvalue, row) { if (cellvalue == 0) { return '草稿'; - } - if (cellvalue == 1) { - return '审批中'; + } else if (cellvalue == 1) { + return '审批中'; } else if (cellvalue == 2) { return '审批通过'; } } }, ], + isPage: true, mainId: 'Id', - isPage: true + sord: 'asc' }); - page.search(); + //page.search(); }, search: function (param) { param = param || {}; @@ -212,6 +232,19 @@ var bootstrap = function ($, learun) { processId: processId, level: '1', }; + var ItemId = $('#gridtable').jfGridValue('ItemId'); + ItemId = ItemId.substring(0, 3); + switch (ItemId) { + case "001": + postData["schemeCode"] = 'Dispatch'; + break; + case "002": + postData["schemeCode"] = '222'; + break; + case "003": + postData["schemeCode"] = '333'; + break; + } learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { learun.loading(false); }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorType/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorType/Form.js index 557004118..5abeaf8de 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorType/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorType/Form.js @@ -19,6 +19,7 @@ var bootstrap = function ($, learun) { $('#ParentId').lrHonorTypeSelect(); $('#IsValid').lrDataItemSelect({ code: 'YesOrNoBit' }); $('#IsValid').lrselectSet("true"); + $('#State').lrselectSet('0'); }, initData: function () { if (!!selectedRow) { @@ -32,10 +33,7 @@ var bootstrap = function ($, learun) { if (!$('form').lrValidform()) { return false; } - //var postData = $('#form').lrGetFormData(keyValue); - var postData = { - strEntity: JSON.stringify($('form').lrGetFormData(keyValue)) - }; + var postData = $('#form').lrGetFormData(keyValue); if (postData["ParentId"] == '' || postData["ParentId"] == ' ') { postData["ParentId"] = $("#ParentId").lrselectGet(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorType/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorType/Index.js index 9839779d1..511c46001 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorType/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtHonorType/Index.js @@ -81,22 +81,11 @@ var bootstrap = function ($, learun) { headData: [ { label: "编码", name: "ItemId", width: 200, align: "left" }, { label: "名称", name: "ItemName", width: 200, align: "left" }, - { - label: "类型", name: "ItemId", width: 200, align: "left", - //formatterAsync: function (callback, value, row, op, $cell) { - // learun.clientdata.getAsync('dataItem', { - // key: value, - // code: 'HonorType', - // callback: function (_data) { - // callback(_data.text); - // } - // }); - //} - }, + { label: "类型", name: "ItemId", width: 200, align: "left" }, { label: "排序", name: "HOrder", width: 200, align: "left" }, { label: "有效", name: "IsValid", width: 200, align: "left", - formatter: function (cellvalue, options, rowObject) { + formatter: function (cellvalue, options, rowObject) { return cellvalue == 1 ? "" : ""; } }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtRaceType/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtRaceType/Index.js index ac4e1b4ed..9c46b63e3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtRaceType/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DtRaceType/Index.js @@ -83,7 +83,6 @@ var bootstrap = function ($, learun) { { label: "编码", name: "ItemId", width: 300, align: "left" }, { label: "有效", name: "IsValid", width: 300, align: "left", - //formatter: function (cellvalue, options, rowObject) { formatter: function (cellvalue) { return cellvalue == 1 ? "" : ""; } 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 5cc83f7f4..22fe9ae72 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 @@ -1005,6 +1005,7 @@ + @@ -7450,6 +7451,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config index de6018d43..200810352 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config @@ -30,6 +30,7 @@ + @@ -70,7 +71,8 @@ - + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoBLL.cs index 0f80afe9d..bbdaa79e7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoBLL.cs @@ -144,5 +144,74 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion + #region 扩展数据 + + /// + /// 提交审核 + /// + /// 主键 + /// 状态 + /// 流程Id + public void ModifyStatus(string keyValue, int pastatus, string processId) + { + try + { + dtHonorInfoService.ModifyStatus(keyValue, pastatus, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 修改审核状态 + /// + /// 审核状态 + /// 流程Id + public void ModifyStatusByProcessId(int pastatus, string processId) + { + try + { + dtHonorInfoService.ModifyStatusByProcessId(pastatus, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public void ModifTimeByProcessId(string processId) + { + try + { + dtHonorInfoService.ModifTimeByProcessId(processId); + } + 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/DtHonorInfo/DtHonorInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoIBLL.cs index f7b704b30..59ed82ec7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoIBLL.cs @@ -51,5 +51,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void SaveEntity(string keyValue, DtHonorInfoEntity entity); #endregion + #region 扩展数据 + /// + /// 提交数据 + /// + /// 主键 + /// 状态 + /// 流程Id + void ModifyStatus(string keyValue, int pastatus, string processId); + /// + /// + /// + /// + /// + void ModifyStatusByProcessId(int i, string processId); + /// + /// + /// + /// + void ModifTimeByProcessId(string processId); + + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoService.cs index 82fd4a057..4673602ad 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DtHonorInfo/DtHonorInfoService.cs @@ -31,19 +31,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { var strSql = new StringBuilder(); strSql.Append("SELECT "); - strSql.Append(@" - t.Id, - t.BeginTime, - t.EndTime, - t.ItemId, - t.Cycle, - t.SchoolYear, - t.Emester, - t.Demo, - t.CareteUser, - t.CreateTime, - t.State - "); + strSql.Append(@" * "); strSql.Append(" FROM DtHonorInfo t "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); @@ -51,26 +39,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var dp = new DynamicParameters(new { }); if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) { - dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); - dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.Date); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.Date); strSql.Append(" AND ( t.BeginTime >= @startTime AND t.EndTime <= @endTime ) "); } if (!queryParam["ItemId"].IsEmpty()) { - dp.Add("ItemId",queryParam["ItemId"].ToString(), DbType.String); - strSql.Append(" AND t.ItemId = @ItemId "); + dp.Add("ItemId", queryParam["ItemId"].ToString() + "%", DbType.String); + strSql.Append(" AND t.ItemId like @ItemId "); } if (!queryParam["Cycle"].IsEmpty()) { - dp.Add("Cycle",queryParam["Cycle"].ToString(), DbType.String); + dp.Add("Cycle", queryParam["Cycle"].ToString(), DbType.String); strSql.Append(" AND t.Cycle = @Cycle "); } if (!queryParam["SchoolYear"].IsEmpty()) { - dp.Add("SchoolYear",queryParam["SchoolYear"].ToString(), DbType.String); + dp.Add("SchoolYear", queryParam["SchoolYear"].ToString(), DbType.String); strSql.Append(" AND t.SchoolYear = @SchoolYear "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -118,7 +106,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return this.BaseRepository("CollegeMIS").FindEntity(t=>t.processId == processId); + return this.BaseRepository("CollegeMIS").FindEntity(t => t.processId == processId); } catch (Exception ex) { @@ -145,7 +133,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.Id == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); } catch (Exception ex) { @@ -196,5 +184,72 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion + #region 扩展数据 + + public void ModifyStatus(string keyValue, int pastatus, string processId) + { + try + { + var entity = this.BaseRepository("CollegeMIS").FindEntity(o => o.Id == keyValue); + entity.processId = processId; + entity.State = pastatus; + this.BaseRepository("CollegeMIS").Update(entity); + } + catch (Exception e) + { + if (e is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(e); + } + } + } + + public void ModifTimeByProcessId(string processId) + { + try + { + var entity = this.BaseRepository("CollegeMIS").FindEntity(a => a.processId == processId); + entity.State = 2; + this.BaseRepository("CollegeMIS").Update(entity); + } + catch (Exception e) + { + if (e is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(e); + } + } + } + + public void ModifyStatusByProcessId(int pastatus, string processId) + { + try + { + var entity = this.BaseRepository("CollegeMIS").FindEntity(a => a.processId == processId); + entity.State = Convert.ToInt32(pastatus); + this.BaseRepository("CollegeMIS").Update(entity); + } + catch (Exception e) + { + if (e is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(e); + } + } + } + + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj index be16abc09..0c4be73b8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj @@ -97,6 +97,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/DispatchMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/DispatchMethod.cs index 4f5c76878..7104aeaa9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/DispatchMethod.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/DispatchMethod.cs @@ -7,9 +7,9 @@ using Learun.Application.TwoDevelopment.EducationalAdministration; namespace Learun.Application.WorkFlow { - public class DispatchMethod : IWorkFlowMethod + public class HonorMethod : IWorkFlowMethod { - DispatchIBLL dispatchIBLL = new DispatchBLL(); + DtHonorInfoBLL dtHonorInfoIBll = new DtHonorInfoBLL(); /// /// 审核 /// @@ -18,11 +18,11 @@ namespace Learun.Application.WorkFlow { if (parameter.code == "agree") { - dispatchIBLL.ModifyStatusByProcessId(2, parameter.processId); + dtHonorInfoIBll.ModifyStatusByProcessId(2, parameter.processId); } else { - dispatchIBLL.ModifyStatusByProcessId(0, parameter.processId); + dtHonorInfoIBll.ModifyStatusByProcessId(0, parameter.processId); } } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/HonorMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/HonorMethod.cs new file mode 100644 index 000000000..4f5c76878 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/HonorMethod.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Learun.Application.TwoDevelopment.EducationalAdministration; + +namespace Learun.Application.WorkFlow +{ + public class DispatchMethod : IWorkFlowMethod + { + DispatchIBLL dispatchIBLL = new DispatchBLL(); + /// + /// 审核 + /// + /// + public void Execute(WfMethodParameter parameter) + { + if (parameter.code == "agree") + { + dispatchIBLL.ModifyStatusByProcessId(2, parameter.processId); + } + else + { + dispatchIBLL.ModifyStatusByProcessId(0, parameter.processId); + } + } + } +}