diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectLevelController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectLevelController.cs new file mode 100644 index 000000000..add3a6f9a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectLevelController.cs @@ -0,0 +1,131 @@ +using Learun.Application.TwoDevelopment.CustomFunction; +using Learun.Util; +using System.Data; +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.CustomFunction.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:15 + /// 描 述:科研项目级别管理 + /// + public class SRProjectLevelController : MvcControllerBase + { + private SRProjectLevelIBLL sRProjectLevelIBLL = new SRProjectLevelBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = sRProjectLevelIBLL.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 SRProjectLevelData = sRProjectLevelIBLL.GetSRProjectLevelEntity(keyValue); + var jsonData = new + { + SRProjectLevel = SRProjectLevelData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + sRProjectLevelIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + SRProjectLevelEntity entity = strEntity.ToObject(); + sRProjectLevelIBLL.SaveEntity(keyValue, entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + + /// + /// 启用 禁用 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult UpdateStatus(string keyValue, int status) + { + sRProjectLevelIBLL.UpdateStatus(keyValue, status); + return Success("保存成功!"); + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectTypeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectTypeController.cs new file mode 100644 index 000000000..e1e5f085c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectTypeController.cs @@ -0,0 +1,139 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.CustomFunction; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.CustomFunction.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:51 + /// 描 述:科研项目类型管理 + /// + public class SRProjectTypeController : MvcControllerBase + { + private SRProjectTypeIBLL sRProjectTypeIBLL = new SRProjectTypeBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = sRProjectTypeIBLL.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 SRProjectTypeData = sRProjectTypeIBLL.GetSRProjectTypeEntity(keyValue); + var jsonData = new + { + SRProjectType = SRProjectTypeData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + sRProjectTypeIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + SRProjectTypeEntity entity = strEntity.ToObject(); + var data = sRProjectTypeIBLL.GetEntityByCode(entity.TypeCode); + if (string.IsNullOrEmpty(keyValue) && data != null) + { + return Fail("编码已存在,请重新输入!"); + } + else if (!string.IsNullOrEmpty(keyValue) && (data != null && data.TypeID != keyValue)) + { + return Fail("编码已存在,请重新输入!"); + } + + sRProjectTypeIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult UpdateStatus(string keyValue,int status) + { + sRProjectTypeIBLL.UpdateStatus(keyValue, status); + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/CustomFunctionAreaRegistration.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/CustomFunctionAreaRegistration.cs new file mode 100644 index 000000000..0246f51ca --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/CustomFunctionAreaRegistration.cs @@ -0,0 +1,24 @@ +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.CustomFunction +{ + public class CustomFunctionAreaRegistration : AreaRegistration + { + public override string AreaName + { + get + { + return "CustomFunction"; + } + } + + public override void RegisterArea(AreaRegistrationContext context) + { + context.MapRoute( + "CustomFunction_default", + "CustomFunction/{controller}/{action}/{id}", + new { action = "Index", id = UrlParameter.Optional } + ); + } + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Form.cshtml new file mode 100644 index 000000000..12815367a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Form.cshtml @@ -0,0 +1,19 @@ +@{ + ViewBag.Title = "科研项目级别管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
级别名称*
+ +
+
+
排序
+ +
+
+
状态*
+
+
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/SRProjectLevel/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Form.js new file mode 100644 index 000000000..418077fa2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Form.js @@ -0,0 +1,59 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-08 11:15 + * 描 述:科研项目级别管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#LevStatus').lrRadioCheckbox({ + type: 'radio', + code: 'EnableStatus', + }); + + //$('#LevStatus').lrRadioCheckbox({ + // type: 'radio', + // code: 'EnableStatus', + //}); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/CustomFunction/SRProjectLevel/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]); + } + } + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/CustomFunction/SRProjectLevel/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Index.cshtml new file mode 100644 index 000000000..7b700a172 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Index.cshtml @@ -0,0 +1,45 @@ +@{ + ViewBag.Title = "科研项目级别管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
级别名称
+ +
+
+
状态
+
+
+
+
+
+
+
+
+ +
+ + +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/SRProjectLevel/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Index.js new file mode 100644 index 000000000..4b4d8840b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectLevel/Index.js @@ -0,0 +1,153 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-08 11:15 + * 描 述:科研项目级别管理 + */ +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); + $('#LevStatus').lrRadioCheckbox({ + type: 'radio', + code: 'EnableStatus', + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/CustomFunction/SRProjectLevel/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('LevID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/CustomFunction/SRProjectLevel/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('LevID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/SRProjectLevel/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + //  启用 + $('#lr-enable').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('LevID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认启用选中记录!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/SRProjectLevel/UpdateStatus', { keyValue: keyValue, status: 1 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  禁用 + $('#lr-disable').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('LevID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认禁用选中记录!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/SRProjectLevel/UpdateStatus', { keyValue: keyValue, status: 0 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/CustomFunction/SRProjectLevel/GetPageList', + headData: [ + { label: "级别名称", name: "LevName", width: 100, align: "left" }, + { label: "排序", name: "LevSort", width: 100, align: "left" }, + { label: "创建用户", name: "LevCreateUserName", width: 100, align: "left" }, + { + label: "创建时间", name: "LevCreateTime", width: 100, align: "left", + formatter: function (value) { + return learun.formatDate(value, 'yyyy-MM-dd'); + } + }, + { + label: "状态", name: "LevStatus", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '启用'; + } else if (cellvalue == 0) { + return '禁用'; + } + } + + + } + //formatterAsync: function (callback, value, row, op,$cell) { + // learun.clientdata.getAsync('dataItem', { + // key: value, + // code: 'EnableStatus', + // callback: function (_data) { + // callback(_data.text); + // } + // }); + //}}, + ], + mainId: 'LevID', + isPage: true, + sidx: 'LevSort', + sord: 'ASC', + isMultiselect: true, + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Form.cshtml new file mode 100644 index 000000000..038d54fb3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Form.cshtml @@ -0,0 +1,28 @@ +@{ + ViewBag.Title = "科研项目类型管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
分类编码*
+ +
+
+
分类名称*
+ +
+
+
上级
+
+
+
+
排序
+ +
+
+
状态*
+
+
+
+ +@Html.AppendJsFile("/Areas/CustomFunction/Views/SRProjectType/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Form.js new file mode 100644 index 000000000..9a9fa289c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Form.js @@ -0,0 +1,55 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-08 11:51 + * 描 述:科研项目类型管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#TypeParentId').lrDataSourceSelect({ code: 'SRProjectType', value: 'typeid', text: 'typename' }); + $('#TypeStatus').lrRadioCheckbox({ + type: 'radio', + code: 'EnableStatus', + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/CustomFunction/SRProjectType/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]); + } + } + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/CustomFunction/SRProjectType/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Index.cshtml new file mode 100644 index 000000000..68dab15e1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Index.cshtml @@ -0,0 +1,49 @@ +@{ + ViewBag.Title = "科研项目类型管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
分类编码
+ +
+
+
分类名称
+ +
+
+
状态
+
+
+
+
+
+
+
+
+ +
+ + +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/SRProjectType/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Index.js new file mode 100644 index 000000000..758021440 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectType/Index.js @@ -0,0 +1,150 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-08 11:51 + * 描 述:科研项目类型管理 + */ +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); + $('#TypeStatus').lrRadioCheckbox({ + type: 'radio', + code: 'EnableStatus', + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/CustomFunction/SRProjectType/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('TypeID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/CustomFunction/SRProjectType/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('TypeID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/SRProjectType/DeleteForm', { keyValue: keyValue}, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + //  启用 + $('#lr-enable').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('TypeID'); + + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认启用选中记录!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/SRProjectType/UpdateStatus', { keyValue: keyValue, status: 1 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  禁用 + $('#lr-disable').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('TypeID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认禁用选中记录!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/SRProjectType/UpdateStatus', { keyValue: keyValue, status: 0 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/CustomFunction/SRProjectType/GetPageList', + headData: [ + { label: "分类编码", name: "TypeCode", width: 100, align: "left"}, + { label: "分类名称", name: "TypeName", width: 100, align: "left"}, + { label: "上级", name: "TypeParentId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'ResearchType', + callback: function (_data) { + callback(_data.text); + } + }); + }}, + { label: "排序", name: "TypeSort", width: 100, align: "left"}, + { + label: "状态", + name: "TypeStatus", + width: 100, + align: "left", + formatter: function(cellvalue, row) { + if (cellvalue == 1) { + return '启用'; + } else if (cellvalue == 0) { + return '禁用'; + } + } + } + ], + mainId:'TypeID', + isPage: true, + isMultiselect: true, + isTree: true, + parentId: 'TypeParentId' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/web.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/web.config new file mode 100644 index 000000000..ae8f5bc1e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/web.config @@ -0,0 +1,35 @@ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ResourceImportController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ResourceImportController.cs index b44865424..d75f127d5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ResourceImportController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ResourceImportController.cs @@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +35,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } #endregion @@ -71,8 +71,9 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var ResourceImportData = resourceImportIBLL.GetResourceImportEntity( keyValue ); - var jsonData = new { + var ResourceImportData = resourceImportIBLL.GetResourceImportEntity(keyValue); + var jsonData = new + { ResourceImport = ResourceImportData, }; return Success(jsonData); @@ -93,6 +94,20 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers resourceImportIBLL.DeleteEntity(keyValue); return Success("删除成功!"); } + + + /// + /// 发布 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult Publish(string keyValue, int ImportState) + { + resourceImportIBLL.Publish(keyValue, ImportState); + return Success("删除成功!"); + } /// /// 保存实体数据(新增、修改) /// @@ -105,7 +120,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { ResourceImportEntity entity = strEntity.ToObject(); - resourceImportIBLL.SaveEntity(keyValue,entity); + resourceImportIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/StudyGuideController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/StudyGuideController.cs index 887e54afd..a69ffee39 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/StudyGuideController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/StudyGuideController.cs @@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +35,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } #endregion @@ -71,8 +71,9 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var StudyGuideData = studyGuideIBLL.GetStudyGuideEntity( keyValue ); - var jsonData = new { + var StudyGuideData = studyGuideIBLL.GetStudyGuideEntity(keyValue); + var jsonData = new + { StudyGuide = StudyGuideData, }; return Success(jsonData); @@ -94,6 +95,18 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers return Success("删除成功!"); } /// + /// 发布 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult Publish(string keyValue,int GuideState) + { + studyGuideIBLL.Publish(keyValue, GuideState); + return Success("发布成功!"); + } + /// /// 保存实体数据(新增、修改) /// /// 主键 @@ -105,7 +118,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { StudyGuideEntity entity = strEntity.ToObject(); - studyGuideIBLL.SaveEntity(keyValue,entity); + studyGuideIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Form.cshtml index d9511552d..6f94e6d85 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Form.cshtml @@ -11,14 +11,14 @@
内容
- *@
附件
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Form.js index 6915a357d..2731b4f56 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Form.js @@ -16,13 +16,15 @@ var bootstrap = function ($, learun) { }, bind: function () { var ImportContentUE = UE.getEditor('ImportContent'); - $('#ImportContent')[0].ue = ImportContentUE; $('#ImportTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); - $('#ImportUser')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; - $('#ImportUser').val(learun.clientdata.get(['userinfo']).realName); + $('#ImportContent')[0].ue = ImportContentUE; + //$('#ImportTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + //$('#ImportUser')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + //$('#ImportUser').val(learun.clientdata.get(['userinfo']).realName); $('#ImportLetter').lrUploader(); + $('#ImportState').lrRadioCheckbox({ type: 'radio', - code: 'YesOrNoInt', + code: 'publishStatus', }); }, initData: function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Index.cshtml index 049a4e5fd..3776c00e0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Index.cshtml @@ -23,10 +23,12 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Index.js index 4040d1123..fc10ab9f8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResourceImport/Index.js @@ -26,8 +26,8 @@ var bootstrap = function ($, learun) { id: 'form', title: '新增', url: top.$.rootUrl + '/PersonnelManagement/ResourceImport/Form', - width: 600, - height: 400, + width: 800, + height: 600, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -41,8 +41,8 @@ var bootstrap = function ($, learun) { id: 'form', title: '编辑', url: top.$.rootUrl + '/PersonnelManagement/ResourceImport/Form?keyValue=' + keyValue, - width: 600, - height: 400, + width: 800, + height: 600, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -55,7 +55,7 @@ var bootstrap = function ($, learun) { if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ResourceImport/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ResourceImport/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -66,42 +66,78 @@ var bootstrap = function ($, learun) { $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); + //发布 + $('#lr_publish').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ImportId'); + var ImportState = $('#gridtable').jfGridValue('ImportState'); + if (learun.checkrow(keyValue)) { + if (ImportState.indexOf('0') != -1) { + return learun.alert.warning('选中记录包含已发布的记录!'); + } + learun.layerConfirm('是否确认发布选中记录!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ResourceImport/Publish', { keyValue: keyValue, ImportState: 0 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //取消发布 + $('#lr_nopublish').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ImportId'); + var ImportState = $('#gridtable').jfGridValue('ImportState'); + if (learun.checkrow(keyValue)) { + if (ImportState.indexOf('1') != -1) { + return learun.alert.warning('选中记录包含未发布的记录!'); + } + learun.layerConfirm('是否确认发布选中记录!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ResourceImport/Publish', { keyValue: keyValue, ImportState: 1 }, function () { + refreshGirdData(); + }); + } + }); + } + }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/PersonnelManagement/ResourceImport/GetPageList', headData: [ - { label: "标题", name: "ImportName", width: 100, align: "left"}, - { label: "添加时间", name: "ImportTime", width: 100, align: "left"}, - { label: "创建用户", name: "ImportUser", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('user', { - key: value, - callback: function (_data) { - callback(_data.name); - } - }); - }}, - { label: "是否发布", name: "ImportState", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'YesOrNoInt', - callback: function (_data) { - callback(_data.text); - } - }); - }}, + { label: "标题", name: "ImportName", width: 100, align: "left" }, + { + label: "创建用户", name: "ImportUser", width: 100, align: "left" + }, + { + label: "添加时间", name: "ImportTime", width: 100, align: "left", formatter: function (value) { + return learun.formatDate(value, 'yyyy-MM-dd'); + } + }, + { + label: "发布状态", + name: "ImportState", + width: 100, + align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 0) { + return '发布'; + } else if (cellvalue == 1) { + return '暂未发布'; + } + } + } ], - mainId:'ImportId', - isPage: true + mainId: 'ImportId', + isPage: true, + isMultiselect: true, }); page.search(); }, search: function (param) { param = param || {}; - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Form.cshtml index 867bbfbd4..ca5f72bef 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Form.cshtml @@ -11,14 +11,14 @@
附件上传
-
+ @*
创建用户
添加时间
-
+
*@
是否发布
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Form.js index 51863f44c..3c6651340 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Form.js @@ -16,7 +16,10 @@ var bootstrap = function ($, learun) { }, bind: function () { $('#AttachmentUp').lrUploader(); - $('#GuideState').lrDataItemSelect({ code: 'YesOrNoInt' }); + $('#GuideState').lrRadioCheckbox({ + type: 'radio', + code: 'publishStatus', + }); }, initData: function () { if (!!keyValue) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.cshtml index d0962e4a2..c18bbb603 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.cshtml @@ -2,7 +2,7 @@ ViewBag.Title = "研究指导"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.js index a391d4f2a..0bf789c22 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/StudyGuide/Index.js @@ -55,7 +55,7 @@ var bootstrap = function ($, learun) { if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/StudyGuide/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/StudyGuide/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -66,34 +66,74 @@ var bootstrap = function ($, learun) { $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); + //发布 + $('#lr_publish').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StudyID'); + var GuideState = $('#gridtable').jfGridValue('GuideState'); + if (learun.checkrow(keyValue)) { + if (GuideState.indexOf('0') != -1) { + return learun.alert.warning('选中记录包含已发布的记录!'); + } + learun.layerConfirm('是否确认发布选中记录!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/StudyGuide/Publish', { keyValue: keyValue, GuideState: 0 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //取消发布 + $('#lr_nopublish').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StudyID'); + var GuideState = $('#gridtable').jfGridValue('GuideState'); + if (learun.checkrow(keyValue)) { + if (GuideState.indexOf('1') != -1) { + return learun.alert.warning('选中记录包含未发布的记录!'); + } + learun.layerConfirm('是否确认发布选中记录!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/StudyGuide/Publish', { keyValue: keyValue, GuideState: 1 }, function () { + refreshGirdData(); + }); + } + }); + } + }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/PersonnelManagement/StudyGuide/GetPageList', headData: [ - { label: "标题", name: "StudyName", width: 100, align: "left"}, - { label: "创建用户", name: "GuideName", width: 100, align: "left"}, - { label: "添加时间", name: "Guidetime", width: 100, align: "left"}, - { label: "是否发布", name: "GuideState", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'YesOrNoInt', - callback: function (_data) { - callback(_data.text); - } - }); - }}, + { label: "标题", name: "StudyName", width: 100, align: "left" }, + { label: "创建用户", name: "CreateUserName", width: 100, align: "left" }, + { + label: "添加时间", name: "CreateTime", width: 100, align: "left", + formatter: function (value) { + return learun.formatDate(value, 'yyyy-MM-dd'); + } + }, + { + label: "发布状态", name: "GuideState", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 0) { + return '发布'; + } else if (cellvalue == 1) { + return '暂未发布'; + } + } + }, ], - mainId:'StudyID', - isPage: true + mainId: 'StudyID', + isPage: true, + isMultiselect: true, }); page.search(); }, search: function (param) { param = param || {}; - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { 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 1b9f03207..695f9cf04 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 @@ -315,6 +315,7 @@ + @@ -805,6 +806,8 @@ + + @@ -6372,6 +6375,14 @@ + + + + + + + + @@ -7172,6 +7183,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/SRProjectLevelMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/SRProjectLevelMap.cs new file mode 100644 index 000000000..1e79b2981 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/SRProjectLevelMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.CustomFunction; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:15 + /// 描 述:科研项目级别管理 + /// + public class SRProjectLevelMap : EntityTypeConfiguration + { + public SRProjectLevelMap() + { + #region 表、主键 + //表 + this.ToTable("SRPROJECTLEVEL"); + //主键 + this.HasKey(t => t.LevID); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/SRProjectTypeMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/SRProjectTypeMap.cs new file mode 100644 index 000000000..da3093dff --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/SRProjectTypeMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.CustomFunction; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:51 + /// 描 述:科研项目类型管理 + /// + public class SRProjectTypeMap : EntityTypeConfiguration + { + public SRProjectTypeMap() + { + #region 表、主键 + //表 + this.ToTable("SRPROJECTTYPE"); + //主键 + this.HasKey(t => t.TypeID); + #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 7a5f01eb5..43ab8cde5 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 @@ -559,6 +559,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelBLL.cs new file mode 100644 index 000000000..f5fded7b9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelBLL.cs @@ -0,0 +1,149 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.CustomFunction +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:15 + /// 描 述:科研项目级别管理 + /// + public class SRProjectLevelBLL : SRProjectLevelIBLL + { + private SRProjectLevelService sRProjectLevelService = new SRProjectLevelService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return sRProjectLevelService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取SRProjectLevel表实体数据 + /// + /// 主键 + /// + public SRProjectLevelEntity GetSRProjectLevelEntity(string keyValue) + { + try + { + return sRProjectLevelService.GetSRProjectLevelEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + sRProjectLevelService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, SRProjectLevelEntity entity) + { + try + { + sRProjectLevelService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 启用 禁用 + /// + /// 主键 + /// 实体 + /// + public void UpdateStatus(string keyValue, int status) + { + try + { + sRProjectLevelService.UpdateStatus(keyValue, status); + } + 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/CustomFunction/SRProjectLevel/SRProjectLevelEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelEntity.cs new file mode 100644 index 000000000..4872777b6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelEntity.cs @@ -0,0 +1,98 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.CustomFunction +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:15 + /// 描 述:科研项目级别管理 + /// + public class SRProjectLevelEntity + { + #region 实体成员 + /// + /// 主键 + /// + [Column("LEVID")] + public string LevID { get; set; } + /// + /// 级别名称 + /// + [Column("LEVNAME")] + public string LevName { get; set; } + /// + /// 排序 + /// + [Column("LEVSORT")] + public int? LevSort { get; set; } + /// + /// 状态 + /// + [Column("LEVSTATUS")] + public int? LevStatus { get; set; } + /// + /// 创建人 + /// + [Column("LEVCREATEUSERID")] + public string LevCreateUserId { get; set; } + /// + /// 创建人 + /// + [Column("LEVCREATEUSERNAME")] + public string LevCreateUserName { get; set; } + /// + /// 创建时间 + /// + [Column("LEVCREATETIME")] + public DateTime? LevCreateTime { get; set; } + /// + /// 最后一次修改人 + /// + [Column("LEVMODIFYUSERID")] + public string LevModifyUserId { get; set; } + /// + /// 最后一次修改人 + /// + [Column("LEVMODIFYUSERNAME")] + public string LevModifyUserName { get; set; } + /// + /// 最后一次修改时间 + /// + [Column("LEVMODIFYTIME")] + public DateTime? LevModifyTime { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.LevID = Guid.NewGuid().ToString(); + var userinfo = LoginUserInfo.Get(); + this.LevCreateUserId = userinfo.userId; + this.LevCreateUserName = userinfo.realName; + this.LevCreateTime = DateTime.Now; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.LevID = keyValue; + var userinfo = LoginUserInfo.Get(); + this.LevModifyUserId = userinfo.userId; + this.LevModifyUserName = userinfo.realName; + this.LevModifyTime = DateTime.Now; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelIBLL.cs new file mode 100644 index 000000000..ec821176d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelIBLL.cs @@ -0,0 +1,56 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.CustomFunction +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:15 + /// 描 述:科研项目级别管理 + /// + public interface SRProjectLevelIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取SRProjectLevel表实体数据 + /// + /// 主键 + /// + SRProjectLevelEntity GetSRProjectLevelEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, SRProjectLevelEntity entity); + + /// + /// 启用 禁用 + /// + /// + /// + void UpdateStatus(string keyValue, int status); + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelService.cs new file mode 100644 index 000000000..315c9ca77 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectLevel/SRProjectLevelService.cs @@ -0,0 +1,182 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.CustomFunction +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:15 + /// 描 述:科研项目级别管理 + /// + public class SRProjectLevelService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.* + "); + strSql.Append(" FROM SRProjectLevel t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["LevName"].IsEmpty()) + { + dp.Add("LevName", "%" + queryParam["LevName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.LevName Like @LevName "); + } + if (!queryParam["LevStatus"].IsEmpty()) + { + dp.Add("LevStatus", queryParam["LevStatus"].ToString(), DbType.String); + strSql.Append(" AND t.LevStatus = @LevStatus "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取SRProjectLevel表实体数据 + /// + /// 主键 + /// + public SRProjectLevelEntity GetSRProjectLevelEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + 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.LevID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, SRProjectLevelEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 启用 禁用 + /// + /// 主键 + public void UpdateStatus(string keyValue, int status) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + string sql = $" update SRProjectLevel set LevStatus={status} where LevID in ('{keyValue}')"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + 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/CustomFunction/SRProjectType/SRProjectTypeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectType/SRProjectTypeBLL.cs new file mode 100644 index 000000000..bdb79c00b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectType/SRProjectTypeBLL.cs @@ -0,0 +1,173 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.CustomFunction +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:51 + /// 描 述:科研项目类型管理 + /// + public class SRProjectTypeBLL : SRProjectTypeIBLL + { + private SRProjectTypeService sRProjectTypeService = new SRProjectTypeService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return sRProjectTypeService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取SRProjectType表实体数据 + /// + /// 主键 + /// + public SRProjectTypeEntity GetSRProjectTypeEntity(string keyValue) + { + try + { + return sRProjectTypeService.GetSRProjectTypeEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取SRProjectType表实体数据 + /// + /// code + /// + public SRProjectTypeEntity GetEntityByCode(string code) + { + try + { + return sRProjectTypeService.GetEntityByCode(code); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + sRProjectTypeService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, SRProjectTypeEntity entity) + { + try + { + sRProjectTypeService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 状态 + /// + public void UpdateStatus(string keyValue, int status) + { + try + { + sRProjectTypeService.UpdateStatus(keyValue, status); + } + 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/CustomFunction/SRProjectType/SRProjectTypeEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectType/SRProjectTypeEntity.cs new file mode 100644 index 000000000..3420ce086 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectType/SRProjectTypeEntity.cs @@ -0,0 +1,108 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.CustomFunction +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:51 + /// 描 述:科研项目类型管理 + /// + public class SRProjectTypeEntity + { + #region 实体成员 + /// + /// 主键 + /// + [Column("TYPEID")] + public string TypeID { get; set; } + /// + /// 分类名称 + /// + [Column("TYPENAME")] + public string TypeName { get; set; } + /// + /// 分类编码 + /// + [Column("TYPECODE")] + public string TypeCode { get; set; } + /// + /// 上级Id + /// + [Column("TYPEPARENTID")] + public string TypeParentId { get; set; } + /// + /// 排序 + /// + [Column("TYPESORT")] + public int? TypeSort { get; set; } + /// + /// 状态 + /// + [Column("TYPESTATUS")] + public int? TypeStatus { get; set; } + /// + /// 创建人 + /// + [Column("TYPECREATEUSERID")] + public string TypeCreateUserId { get; set; } + /// + /// 创建人 + /// + [Column("TYPECREATEUSERNAME")] + public string TypeCreateUserName { get; set; } + /// + /// 创建时间 + /// + [Column("TYPECREATETIME")] + public DateTime? TypeCreateTime { get; set; } + /// + /// 最后一次修改人 + /// + [Column("TYPEMODIFYUSERID")] + public string TypeModifyUserId { get; set; } + /// + /// 最后一次修改人 + /// + [Column("TYPEMODIFYUSERNAME")] + public string TypeModifyUserName { get; set; } + /// + /// 最后一次修改时间 + /// + [Column("TYPEMODIFYTIME")] + public DateTime? TypeModifyTime { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.TypeID = Guid.NewGuid().ToString(); + var userinfo = LoginUserInfo.Get(); + this.TypeCreateUserId = userinfo.userId; + this.TypeCreateUserName = userinfo.realName; + this.TypeCreateTime = DateTime.Now; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.TypeID = keyValue; + var userinfo = LoginUserInfo.Get(); + this.TypeModifyUserId = userinfo.userId; + this.TypeModifyUserName = userinfo.realName; + this.TypeModifyTime = DateTime.Now; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectType/SRProjectTypeIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectType/SRProjectTypeIBLL.cs new file mode 100644 index 000000000..f7892b49e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectType/SRProjectTypeIBLL.cs @@ -0,0 +1,53 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.CustomFunction +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:51 + /// 描 述:科研项目类型管理 + /// + public interface SRProjectTypeIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取SRProjectType表实体数据 + /// + /// 主键 + /// + SRProjectTypeEntity GetSRProjectTypeEntity(string keyValue); + + SRProjectTypeEntity GetEntityByCode(string code); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, SRProjectTypeEntity entity); + + void UpdateStatus(string keyValue, int status); + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectType/SRProjectTypeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectType/SRProjectTypeService.cs new file mode 100644 index 000000000..d88cadfec --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectType/SRProjectTypeService.cs @@ -0,0 +1,209 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.CustomFunction +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-08 11:51 + /// 描 述:科研项目类型管理 + /// + public class SRProjectTypeService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.* + "); + strSql.Append(" FROM SRProjectType t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["TypeCode"].IsEmpty()) + { + dp.Add("TypeCode", "%" + queryParam["TypeCode"].ToString() + "%", DbType.String); + strSql.Append(" AND t.TypeCode Like @TypeCode "); + } + if (!queryParam["TypeName"].IsEmpty()) + { + dp.Add("TypeName", "%" + queryParam["TypeName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.TypeName Like @TypeName "); + } + if (!queryParam["TypeStatus"].IsEmpty()) + { + dp.Add("TypeStatus", queryParam["TypeStatus"].ToString(), DbType.String); + strSql.Append(" AND t.TypeStatus = @TypeStatus "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取SRProjectType表实体数据 + /// + /// 主键 + /// + public SRProjectTypeEntity GetSRProjectTypeEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取SRProjectType表实体数据 + /// + /// + /// + public SRProjectTypeEntity GetEntityByCode(string code) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(x => x.TypeCode == code); + } + 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.TypeID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, SRProjectTypeEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 启用 禁用 + /// + /// 主键 + public void UpdateStatus(string keyValue, int status) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + string sql = $" update SRProjectType set TypeStatus={status} where TypeID in ('{keyValue}')"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + 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 ceb8a46a4..28741feed 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 @@ -1654,6 +1654,14 @@ + + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportBLL.cs index 17f79c13f..d94276c34 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportBLL.cs @@ -93,6 +93,30 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } } + + /// + /// 发布 + /// + /// 主键 + public void Publish(string keyValue, int ImportState) + { + try + { + resourceImportService.Publish(keyValue, ImportState); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 保存实体数据(新增、修改) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportEntity.cs index 95e0eefdd..070b15a57 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportEntity.cs @@ -58,6 +58,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement public void Create() { this.ImportId = Guid.NewGuid().ToString(); + this.ImportTime=DateTime.Now; + this.ImportUser = LoginUserInfo.Get().realName; } /// /// 编辑调用 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportIBLL.cs index a6da07297..710ec3deb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportIBLL.cs @@ -37,6 +37,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 主键 void DeleteEntity(string keyValue); /// + /// 发布 + /// + /// + /// + void Publish(string keyValue, int ImportState); + /// /// 保存实体数据(新增、修改) /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportService.cs index 20d859e9a..f9eb2e05f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResourceImport/ResourceImportService.cs @@ -48,7 +48,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement dp.Add("ImportName", "%" + queryParam["ImportName"].ToString() + "%", DbType.String); strSql.Append(" AND t.ImportName Like @ImportName "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -99,7 +99,36 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.ImportId == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.ImportId == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 发布 + /// + /// 主键 + public void Publish(string keyValue, int ImportState) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + string sql = $" update ResourceImport set ImportState={ImportState} where ImportId in ('{keyValue}')"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideBLL.cs index 8195582c7..ee4f20444 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideBLL.cs @@ -94,6 +94,30 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 发布 + /// + /// 主键 + public void Publish(string keyValue,int GuideState) + { + try + { + studyGuideService.Publish(keyValue, GuideState); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// /// 保存实体数据(新增、修改) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideEntity.cs index 0035d112a..1049d1311 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideEntity.cs @@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 日 期:2021-05-12 11:43 /// 描 述:研究指导 /// - public class StudyGuideEntity + public class StudyGuideEntity { #region 实体成员 /// @@ -25,15 +25,15 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement [Column("STUDYNAME")] public string StudyName { get; set; } /// - /// GuideName + /// 创建用户 /// - [Column("GUIDENAME")] - public string GuideName { get; set; } + [Column("CREATEUSERNAME")] + public string CreateUserName { get; set; } /// - /// Guidetime + /// 添加时间 /// - [Column("GUIDETIME")] - public string Guidetime { get; set; } + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } /// /// GuideState /// @@ -53,6 +53,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement public void Create() { this.StudyID = Guid.NewGuid().ToString(); + this.CreateUserName = (LoginUserInfo.Get()).realName; + this.CreateTime = DateTime.Now; } /// /// 编辑调用 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideIBLL.cs index 009832707..d2bd59f70 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideIBLL.cs @@ -37,6 +37,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 主键 void DeleteEntity(string keyValue); /// + /// 发布 + /// + /// + void Publish(string keyValue,int GuideState); + /// /// 保存实体数据(新增、修改) /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideService.cs index b77c27b70..671d8a231 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/StudyGuide/StudyGuideService.cs @@ -32,11 +32,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var strSql = new StringBuilder(); strSql.Append("SELECT "); strSql.Append(@" - t.StudyID, - t.StudyName, - t.GuideName, - t.Guidetime, - t.GuideState + t.* "); strSql.Append(" FROM StudyGuide t "); strSql.Append(" WHERE 1=1 "); @@ -48,7 +44,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement dp.Add("StudyName", "%" + queryParam["StudyName"].ToString() + "%", DbType.String); strSql.Append(" AND t.StudyName Like @StudyName "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -99,7 +95,36 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.StudyID == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.StudyID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 发布 + /// + /// 主键 + public void Publish(string keyValue,int GuideState) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + string sql = $" update StudyGuide set guidestate={GuideState} where StudyID in ('{keyValue}')"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } catch (Exception ex) {