diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Acc_DormitoryChangeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Acc_DormitoryChangeController.cs new file mode 100644 index 000000000..d3e7b596e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Acc_DormitoryChangeController.cs @@ -0,0 +1,158 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using Learun.Application.TwoDevelopment.LR_CodeDemo; +using System.Collections.Generic; +using Learun.Application.Base.SystemModule; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-07-11 14:34 + /// 描 述:宿舍调换申请 + /// + public class Acc_DormitoryChangeController : MvcControllerBase + { + private Acc_DormitoryChangeIBLL acc_DormitoryChangeIBLL = new Acc_DormitoryChangeBLL(); + private CodeRuleIBLL codeRuleIBLL = new CodeRuleBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = acc_DormitoryChangeIBLL.GetPageList(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 Acc_DormitoryChangeData = acc_DormitoryChangeIBLL.GetAcc_DormitoryChangeEntity(keyValue); + var jsonData = new + { + Acc_DormitoryChange = Acc_DormitoryChangeData, + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 流程实例主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormDataByProcessId(string processId) + { + var Acc_DormitoryChangeData = acc_DormitoryChangeIBLL.GetEntityByProcessId(processId); + var jsonData = new + { + Acc_DormitoryChange = Acc_DormitoryChangeData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + acc_DormitoryChangeIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Acc_DormitoryChangeEntity entity = strEntity.ToObject(); + if (entity.HisDormitory == entity.Dormitory && entity.HisUnit == entity.Unit && entity.HisFloor == entity.Floor + && entity.HisRId == entity.RId) + { + return Fail("新宿舍请勿选择与旧宿舍一致"); + } + acc_DormitoryChangeIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + [HttpPost] + [AjaxOnly] + public ActionResult SubmitForm(string status, string processId, string keyValue) + { + acc_DormitoryChangeIBLL.SubmitEntity(status, processId, keyValue); + return Success("提交成功!"); + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Form.cshtml new file mode 100644 index 000000000..75d386c7d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Form.cshtml @@ -0,0 +1,47 @@ +@{ + ViewBag.Title = "宿舍调换申请"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
宿舍楼*
+
+
+
+
新宿舍楼*
+
+
+
+
单元*
+
+
+
+
新单元*
+
+
+
+
楼层*
+
+
+
+
新楼层*
+
+
+
+
宿舍*
+
+
+
+
新宿舍*
+
+
+
+
原因*
+ +
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Form.js new file mode 100644 index 000000000..ead64884b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Form.js @@ -0,0 +1,191 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-07-11 14:34 + * 描 述:宿舍调换申请 + */ +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 () { + $('#HisDormitory').lrDataSourceSelect({ + code: 'Acc_DormitoryData', value: 'id', text: 'name', select: function (item) { + if (item) { + $('#HisUnit').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: 'Acc_UnitData', strWhere: "ParentID='" + item.id + "' order by name" } + }); + } + } + }); + $('#HisUnit').lrselect({ + text: 'name', + value: 'id', + select: function (item) { + if (item) { + $('#HisFloor').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: 'Acc_FloorData', strWhere: "ParentID='" + item.id + "' order by name" } + }); + } + } + }); + $('#HisFloor').lrselect({ + text: 'name', + value: 'id', + select: function (item) { + if (item) { + $('#HisRId').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: 'Acc_RoomData', strWhere: "ParentID='" + item.id + "' order by name" } + }); + } + } + }); + + $('#HisRId').lrselect({ + text: 'name', + value: 'id', + allowSearch: true + }) + $('#Dormitory').lrDataSourceSelect({ + code: 'Acc_DormitoryData', value: 'id', text: 'name', select: function (item) { + if (item) { + $('#Unit').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: 'Acc_UnitData', strWhere: "ParentID='" + item.id + "' order by name" } + }); + } + } + }); + $('#Unit').lrselect({ + text: 'name', + value: 'id', + select: function (item) { + if (item) { + $('#Floor').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: 'Acc_FloorData', strWhere: "ParentID='" + item.id + "' order by name" } + }); + } + } + }); + $('#Floor').lrselect({ + text: 'name', + value: 'id', + select: function (item) { + if (item) { + $('#RId').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: 'Acc_RoomData', strWhere: "ParentID='" + item.id + "' order by name" } + }); + } + } + }); + + $('#RId').lrselect({ + text: 'name', + value: 'id', + allowSearch: true + }) + + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Acc_DormitoryChange/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/Acc_DormitoryChange/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 == 'Acc_DormitoryChange' && 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 IdentityName = learun.clientdata.get(['userinfo']).Description; + if (IdentityName != "学生") { + learun.alert.warning("当前提交者非学生!!!"); + return false; + } + var formData = $('#form').lrGetFormData(); + if (!!processId) { + formData.ProcessId = processId; + } + var postData = { + strEntity: JSON.stringify(formData) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Acc_DormitoryChange/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/Acc_DormitoryChange/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Index.cshtml new file mode 100644 index 000000000..3fd418a45 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Index.cshtml @@ -0,0 +1,54 @@ +@{ + ViewBag.Title = "宿舍调换申请"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
学号
+ +
+
+
姓名
+ +
+
+
系部
+
+
+
+
专业
+
+
+
+
班级
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Index.js new file mode 100644 index 000000000..67c96f85e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Acc_DormitoryChange/Index.js @@ -0,0 +1,389 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-07-11 14:34 + * 描 述:宿舍调换申请 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var processId = ''; + 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(); + }); + $('#DeptNo').lrselect({ + value: "deptno", + text: "deptname", + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', + select: function (item) { + if (item) { + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" } + }); + } + else { + $('#MajorNo').lrselectRefresh({ + url: "", + data: [] + }); + } + $('#ClassNo').lrselectRefresh({ + url: "", + data: [] + }); + } + }); + $('#MajorNo').lrselect({ + value: "majorno", + text: "majorname", + select: function (item) { + if (item) { + $('#ClassNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" } + }); + } + + } + }); + + + $('#MajorNo').on("click", + function () { + var data = $('#DeptNo').lrselectGet(); + if (!data) { + learun.alert.error('请先选择系'); + } + }); + $('#ClassNo').on("click", + function () { + var data1 = $('#DeptNo').lrselectGet(); + var data2 = $('#MajorNo').lrselectGet(); + if (!data1 || !data2) { + learun.alert.error('请先选择系和专业'); + } + }); + + $('#ClassNo').lrselect({ + value: "classno", + text: "classname" + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/Acc_DormitoryChange/Form', + width: 600, + height: 450, + callBack: function (id) { + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + res = top[id].save('', function () { + page.search(); + }); + } + return res; + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + var CheckStatus = $('#gridtable').jfGridValue('Status'); + if (CheckStatus != "0") { + learun.alert.warning("当前项已提交!"); + return false; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/Acc_DormitoryChange/Form?keyValue=' + keyValue, + width: 600, + height: 450, + callBack: function (id) { + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + res = top[id].save('', function () { + page.search(); + }); + } + return res; + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + var CheckStatus = $('#gridtable').jfGridValue('Status'); + if (CheckStatus != "0") { + learun.alert.warning("当前项已提交!"); + return false; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Acc_DormitoryChange/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/EducationalAdministration/Acc_DormitoryChange/FormView?keyValue=' + keyValue, + width: 1000, + height: 800, + btn: null + }); + } + }); + //  提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + var CheckStatus = $('#gridtable').jfGridValue('Status'); + if (CheckStatus != "0") { + learun.alert.warning("当前项已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/EducationalAdministration/Acc_DormitoryChange/SubmitForm', { keyValue: keyValue, status: "1", processId: processId }, function (res) { + refreshGirdData(res, {}); + }); + + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Acc_DormitoryChange/GetPageList', + headData: [ + { label: "学号", name: "StuNo", width: 100, align: "left" }, + { label: "姓名", name: "StuName", width: 100, align: "left" }, + { + label: "系所", name: "DeptNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "班级", name: "ClassNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { label: "原因", name: "Reason", width: 100, align: "left" }, + { + label: "性别", name: "Sex", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "男" : "女"; + } + }, + { + label: "原宿舍楼", name: "HisDormitory", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_DormitoryData', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "原单元", name: "Unit", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_UnitData', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "原楼层", name: "Floor", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_FloorData', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "原宿舍", name: "RId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_RoomData', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "新宿舍楼", name: "Dormitory", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_DormitoryData', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "新单元", name: "Unit", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_UnitData', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "新楼层", name: "Floor", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_FloorData', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "新宿舍", name: "RId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_RoomData', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "审批状态", name: "Status", width: 100, align: "center", + formatter: function (cellvalue, row) { + if (cellvalue == 0) { + return '草稿'; + } if (cellvalue == 1) { + return '审批中'; + } else if (cellvalue == 2) { + return '同意'; + } else if (cellvalue == 3) { + return '不同意'; + } + } + }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + sidx: 'CreateTime', + sord: 'desc', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function (res, postData) { + if (!!res) { + if (res.code == 200) { + // 发起流程 + var postData = { + schemeCode: 'DorChange',// 填写流程对应模板编号 + processId: processId, + level: '1', + }; + learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + learun.loading(false); + }); + } + 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 58e7f2d18..1e451c5a7 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 @@ -839,6 +839,7 @@ + @@ -6586,6 +6587,10 @@ + + + + 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 2f1f612c2..f51265c4d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config @@ -6,7 +6,7 @@ - + @@ -37,6 +37,7 @@ + @@ -85,7 +86,8 @@ - + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Acc_DormitoryChangeMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Acc_DormitoryChangeMap.cs new file mode 100644 index 000000000..fdb84f501 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Acc_DormitoryChangeMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-07-11 14:34 + /// 描 述:宿舍调换申请 + /// + public class Acc_DormitoryChangeMap : EntityTypeConfiguration + { + public Acc_DormitoryChangeMap() + { + #region 表、主键 + //表 + this.ToTable("ACC_DORMITORYCHANGE"); + //主键 + this.HasKey(t => t.ID); + #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 364b1bba1..dc086b634 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 @@ -593,6 +593,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeBLL.cs new file mode 100644 index 000000000..e20fe62f5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeBLL.cs @@ -0,0 +1,193 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-07-11 14:34 + /// 描 述:宿舍调换申请 + /// + public class Acc_DormitoryChangeBLL : Acc_DormitoryChangeIBLL + { + private Acc_DormitoryChangeService acc_DormitoryChangeService = new Acc_DormitoryChangeService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return acc_DormitoryChangeService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Acc_DormitoryChange表实体数据 + /// + /// 主键 + /// + public Acc_DormitoryChangeEntity GetAcc_DormitoryChangeEntity(string keyValue) + { + try + { + return acc_DormitoryChangeService.GetAcc_DormitoryChangeEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public Acc_DormitoryChangeEntity GetEntityByProcessId(string processId) + { + try + { + return acc_DormitoryChangeService.GetEntityByProcessId(processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + acc_DormitoryChangeService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Acc_DormitoryChangeEntity entity) + { + try + { + acc_DormitoryChangeService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SubmitEntity(string status, string processId, string keyValue) + { + try + { + acc_DormitoryChangeService.SubmitEntity(status, processId, keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 审核实体数据 + /// + /// 主键 + public void ChangeStatusByProcessId(string status, string processId) + { + try + { + acc_DormitoryChangeService.ChangeStatusByProcessId(status, 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/Acc_DormitoryChange/Acc_DormitoryChangeEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeEntity.cs new file mode 100644 index 000000000..e41eb063d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeEntity.cs @@ -0,0 +1,156 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-07-11 14:34 + /// 描 述:宿舍调换申请 + /// + public class Acc_DormitoryChangeEntity + { + #region 实体成员 + /// + /// ID + /// + [Column("ID")] + public string ID { get; set; } + /// + /// StuNo + /// + [Column("STUNO")] + public string StuNo { get; set; } + /// + /// StuName + /// + [Column("STUNAME")] + public string StuName { get; set; } + /// + /// Sex + /// + [Column("SEX")] + public bool? Sex { get; set; } + /// + /// Grade + /// + [Column("GRADE")] + public string Grade { get; set; } + /// + /// ClassNo + /// + [Column("CLASSNO")] + public string ClassNo { get; set; } + /// + /// MajorNo + /// + [Column("MAJORNO")] + public string MajorNo { get; set; } + /// + /// DeptNo + /// + [Column("DEPTNO")] + public string DeptNo { get; set; } + /// + /// F_School + /// + [Column("F_SCHOOL")] + public string F_School { get; set; } + /// + /// Remark + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// CreateTime + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// ProcessId + /// + [Column("PROCESSID")] + public string ProcessId { get; set; } + /// + /// 宿舍楼 + /// + [Column("DORMITORY")] + public string Dormitory { get; set; } + /// + /// 单元 + /// + [Column("UNIT")] + public string Unit { get; set; } + /// + /// Floor + /// + [Column("FLOOR")] + public string Floor { get; set; } + /// + /// RId + /// + [Column("RID")] + public string RId { get; set; } + /// + /// Reason + /// + [Column("REASON")] + public string Reason { get; set; } + /// + /// HisDormitory + /// + [Column("HISDORMITORY")] + public string HisDormitory { get; set; } + /// + /// HisUnit + /// + [Column("HISUNIT")] + public string HisUnit { get; set; } + /// + /// HisFloor + /// + [Column("HISFLOOR")] + public string HisFloor { get; set; } + /// + /// HisRId + /// + [Column("HISRID")] + public string HisRId { get; set; } + /// + /// 状态 + /// + [Column("STATUS")] + public int? Status { get; set; } + + /// + /// CheckTime + /// + [Column("CHECKTIME")] + public DateTime? CheckTime { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.ID = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.ID = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeIBLL.cs new file mode 100644 index 000000000..4cc68c580 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeIBLL.cs @@ -0,0 +1,64 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-07-11 14:34 + /// 描 述:宿舍调换申请 + /// + public interface Acc_DormitoryChangeIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Acc_DormitoryChange表实体数据 + /// + /// 主键 + /// + Acc_DormitoryChangeEntity GetAcc_DormitoryChangeEntity(string keyValue); + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + Acc_DormitoryChangeEntity GetEntityByProcessId(string processId); + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Acc_DormitoryChangeEntity entity); + + void SubmitEntity(string status, string processId, string keyValue); + + /// + /// 审核实体数据 + /// + /// 主键 + void ChangeStatusByProcessId(string status, string processId); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeService.cs new file mode 100644 index 000000000..595457a53 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Acc_DormitoryChange/Acc_DormitoryChangeService.cs @@ -0,0 +1,272 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-07-11 14:34 + /// 描 述:宿舍调换申请 + /// + public class Acc_DormitoryChangeService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" * "); + strSql.Append(" FROM Acc_DormitoryChange t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); + strSql.Append(" AND t.StuNo like @StuNo "); + } + if (!queryParam["StuName"].IsEmpty()) + { + dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuName Like @StuName "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", "" + queryParam["DeptNo"].ToString() + "", DbType.String); + strSql.Append(" AND t.DeptNo=@DeptNo "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", "" + queryParam["MajorNo"].ToString() + "", DbType.String); + strSql.Append(" AND t.MajorNo=@MajorNo "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", "" + queryParam["ClassNo"].ToString() + "", DbType.String); + strSql.Append(" AND t.ClassNo=@ClassNo "); + } + if (!queryParam["Grade"].IsEmpty()) + { + dp.Add("Grade", "" + queryParam["Grade"].ToString() + "", DbType.String); + strSql.Append(" AND t.Grade=@Grade "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Acc_DormitoryChange表实体数据 + /// + /// 主键 + /// + public Acc_DormitoryChangeEntity GetAcc_DormitoryChangeEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public Acc_DormitoryChangeEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t => t.ProcessId == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Acc_DormitoryChangeEntity entity) + { + entity.Status = 0; + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + var UserList = LoginUserInfo.Get(); + if (UserList.Description == "学生") + { + var StuList = this.BaseRepository("CollegeMIS").FindList().FirstOrDefault(x => x.StuNo == UserList.account); + entity.F_School = StuList.F_SchoolId; + entity.DeptNo = StuList.DeptNo; + entity.MajorNo = StuList.MajorNo; + entity.ClassNo = StuList.ClassNo; + entity.Grade = StuList.Grade; + entity.Sex = StuList.GenderNo; + entity.StuName = StuList.StuName; entity.CreateTime = DateTime.Now; + entity.StuNo = StuList.StuNo; + } + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SubmitEntity(string status, string processId, string keyValue) + { + try + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update Acc_DormitoryChange set Status='" + status + "',ProcessId='" + processId + "' where Id='" + keyValue + "' "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 审核实体数据 + /// + /// 主键 + public void ChangeStatusByProcessId(string status, string processId) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update Acc_DormitoryChange set Status='" + status + "',CheckTime='" + DateTime.Now + "' where ProcessId='" + processId + "' "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index b0dc69e9d..d588fcac9 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 @@ -1802,6 +1802,10 @@ + + + + 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 4f82fc4c6..37cc98ba7 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 @@ -101,6 +101,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/Acc_DormitoryChangeMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/Acc_DormitoryChangeMethod.cs new file mode 100644 index 000000000..5dee61203 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/Acc_DormitoryChangeMethod.cs @@ -0,0 +1,28 @@ +using Learun.Application.TwoDevelopment.PersonnelManagement; +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 Acc_DormitoryChangeMethod : IWorkFlowMethod + { + Acc_DormitoryChangeIBLL acc_DormitoryChangeIBLL = new Acc_DormitoryChangeBLL(); + + + public void Execute(WfMethodParameter parameter) + { + if (parameter.code == "agree") + { + acc_DormitoryChangeIBLL.ChangeStatusByProcessId("2", parameter.processId); + } + else + { + acc_DormitoryChangeIBLL.ChangeStatusByProcessId("3", parameter.processId); + } + } + } +}