diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectBasicController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectBasicController.cs index 52d393f39..d5ee136c0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectBasicController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectBasicController.cs @@ -63,6 +63,17 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers return Success(jsonData); } /// + /// 获取页面显示列表数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList() + { + var data = sRProjectBasicIBLL.GetList(); + return Success(data); + } + /// /// 获取表单数据 /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectPeopleController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectPeopleController.cs new file mode 100644 index 000000000..8cda38674 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectPeopleController.cs @@ -0,0 +1,117 @@ +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-09-15 17:10 + /// 描 述:项目人员管理 + /// + public class SRProjectPeopleController : MvcControllerBase + { + private SRProjectPeopleIBLL sRProjectPeopleIBLL = new SRProjectPeopleBLL(); + + #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 = sRProjectPeopleIBLL.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 SRProjectPeopleData = sRProjectPeopleIBLL.GetSRProjectPeopleEntity( keyValue ); + var jsonData = new { + SRProjectPeople = SRProjectPeopleData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + sRProjectPeopleIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + SRProjectPeopleEntity entity = strEntity.ToObject(); + sRProjectPeopleIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.cshtml new file mode 100644 index 000000000..7c2f0f189 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.cshtml @@ -0,0 +1,19 @@ +@{ + ViewBag.Title = "项目人员管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
项目编号*
+
+
+
+
项目负责人
+
+
+
+
项目成员*
+
+
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/SRProjectPeople/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.js new file mode 100644 index 000000000..b57bd8af4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.js @@ -0,0 +1,53 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-09-15 17:10 + * 描 述:项目人员管理 + */ +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 () { + $('#SRProjectBasicId').lrDataItemSelect({ code: 'NoticeCategory' }); + $('#ManageName').lrDataSourceSelect({ code: 'EmpInfo',value: 'empid',text: 'empname' }); + $('#Players').lrDataSourceSelect({ code: 'EmpInfo',value: 'empid',text: 'empname' }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/CustomFunction/SRProjectPeople/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/SRProjectPeople/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.cshtml new file mode 100644 index 000000000..ed4510173 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.cshtml @@ -0,0 +1,41 @@ +@{ + ViewBag.Title = "项目人员管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
项目编号
+
+
+
+
项目负责人
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/SRProjectPeople/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js new file mode 100644 index 000000000..f353e40b8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js @@ -0,0 +1,124 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-09-15 17:10 + * 描 述:项目人员管理 + */ +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); + $('#SRProjectBasicId').lrDataItemSelect({ code: 'NoticeCategory' }); + $('#ManageName').lrDataSourceSelect({ code: 'EmpInfo',value: 'empid',text: 'empname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/CustomFunction/SRProjectPeople/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/CustomFunction/SRProjectPeople/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/SRProjectPeople/DeleteForm', { keyValue: keyValue}, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/CustomFunction/SRProjectPeople/GetPageList', + headData: [ + { label: "项目编号", name: "SRProjectBasicId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'NoticeCategory', + callback: function (_data) { + callback(_data.text); + } + }); + }}, + { label: "项目负责人", name: "ManageName", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: value, + keyId: 'empid', + callback: function (_data) { + callback(_data['empname']); + } + }); + }}, + { label: "项目成员", name: "Players", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: value, + keyId: 'empid', + callback: function (_data) { + callback(_data['empname']); + } + }); + }}, + ], + mainId:'ID', + isPage: 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/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 8cb091fb2..b07e38c72 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 @@ -827,6 +827,7 @@ + @@ -6472,6 +6473,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata.js index 35792d688..b99f09329 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata.js @@ -14,7 +14,10 @@ var clientAsyncData = {}; var clientData = {}; - var data1 = {}; + var desktopData = {}; + var sourceData = {}; + var userData = {}; + var dataItemData = {}; function initLoad(callback) { var res = loadSate.yes; @@ -278,13 +281,19 @@ init: function () { if (clientAsyncData.user.states == loadSate.no) { clientAsyncData.user.states = loadSate.ing; - var ver = storage.get("userData").ver || ""; + //var ver = storage.get("userData").ver || ""; + var ver = ""; + if (userData) { + ver = userData.ver || ""; + } + learun.httpAsync('GET', top.$.rootUrl + '/LR_OrganizationModule/User/GetMap', { ver: ver }, function (data) { if (!data) { clientAsyncData.user.states = loadSate.fail; } else { if (data.ver) { - storage.set("userData", data); + userData = data; + //storage.set("userData", data); } clientAsyncData.user.states = loadSate.yes; clientAsyncData.dataItem.init(); @@ -300,7 +309,8 @@ }, 100);// 如果还在加载100ms后再检测 } else { - var data = storage.get("userData").data || {}; + //var data = storage.get("userData").data || {}; + var data = userData.data || {}; var keys = (op.key || '').split(','); var array = new Array(); if (keys.length > 1) { @@ -325,7 +335,8 @@ }, 100);// 如果还在加载100ms后再检测 } else { - var data = storage.get("userData").data || {}; + //var data = storage.get("userData").data || {}; + var data = userData.data || {}; op.callback(data, op); } } @@ -336,13 +347,17 @@ init: function () { if (clientAsyncData.dataItem.states == loadSate.no) { clientAsyncData.dataItem.states = loadSate.ing; - var ver = storage.get("dataItemData").ver || ""; + var ver = "";// storage.get("dataItemData").ver || ""; + if (dataItemData) { + ver = dataItemData.ver || ""; + } learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DataItem/GetMap', { ver: ver }, function (data) { if (!data) { clientAsyncData.dataItem.states = loadSate.fail; } else { if (data.ver) { - storage.set("dataItemData", data); + dataItemData = data; + //storage.set("dataItemData", data); } clientAsyncData.dataItem.states = loadSate.yes; clientAsyncData.db.init(); @@ -358,7 +373,7 @@ }, 100);// 如果还在加载100ms后再检测 } else { - var data = storage.get("dataItemData").data || {}; + var data = dataItemData.data || {};// storage.get("dataItemData").data || {}; // 数据字典翻译 var _item = clientAsyncData.dataItem.find(op.key, data[op.code] || {}); @@ -381,7 +396,7 @@ }, 100);// 如果还在加载100ms后再检测 } else { - var data = storage.get("dataItemData").data || {}; + var data = dataItemData.data || {};//storage.get("dataItemData").data || {}; var res = {}; $.each(data[op.code] || {}, function (_index, _item) { _item.text = top.learun.language.getSyn(_item.text); @@ -398,7 +413,7 @@ }, 100);// 如果还在加载100ms后再检测 } else { - var data = storage.get("dataItemData").data || {}; + var data = dataItemData || {};//storage.get("dataItemData").data || {}; var keyList = (op.key || "").split(','); var _text = [] @@ -487,8 +502,9 @@ }, 100);// 如果还在加载100ms后再检测 } else { - var data = storage.get("sourceData_" + op.code).data || []; + var data = sourceData["sourceData_" + code] || [];// storage.get("sourceData_" + op.code).data || []; if (!!data) { + //op.callback(sourceData["sourceData_" + code].find(op.key, op.keyId, data) || {}, op); op.callback(clientAsyncData.sourceData.find(op.key, op.keyId, data) || {}, op); } else { op.callback({}, op); @@ -507,7 +523,8 @@ }, 100);// 如果还在加载100ms后再检测 } else if (clientAsyncData.sourceData.states[op.code] == loadSate.yes) { - var data = storage.get("sourceData_" + op.code).data || []; + //var data = storage.get("sourceData_" + op.code).data || []; + var data = sourceData["sourceData_" + op.code].data || []; if (!!data) { op.callback(data, op); @@ -517,13 +534,19 @@ } }, load: function (code) { - var ver = storage.get("sourceData_" + code).ver || ""; + // var ver = storage.get("sourceData_" + code).ver || ""; + var ver = ""; + if (sourceData["sourceData_" + code]) { + ver = sourceData["sourceData_" + code].ver || ""; + } + //var ver = sourceData["sourceData_" + code].ver || "";//storage.get("sourceData_" + code).ver || ""; learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DataSource/GetMap', { code: code, ver: ver }, function (data) { if (!data) { clientAsyncData.sourceData.states[code] = loadSate.fail; } else { if (data.ver) { - storage.set("sourceData_" + code, data); + sourceData["sourceData_" + code] = data; + //storage.set("sourceData_" + code, data); } clientAsyncData.sourceData.states[code] = loadSate.yes; } @@ -661,7 +684,7 @@ clientAsyncData.desktop.states = loadSate.fail; } else { if (k.ver) { - data1 = k; + desktopData = k; //storage.set("desktopData", k); } clientAsyncData.desktop.states = loadSate.yes; @@ -676,7 +699,7 @@ clientAsyncData.desktop.get(k); }, 100) } else { - var j = data1 || {};//storage.get("desktopData").data || {}; + var j = desktopData;//storage.get("desktopData").data || {}; k.callback(j || {}, k); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata1.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata1.js new file mode 100644 index 000000000..35792d688 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata1.js @@ -0,0 +1,684 @@ + + +(function ($, learun) { + "use strict"; + + var loadSate = { + no: -1, // 还未加载 + yes: 1, // 已经加载成功 + ing: 0, // 正在加载中 + fail: 2 // 加载失败 + }; + + var clientDataFn = {}; + var clientAsyncData = {}; + + var clientData = {}; + var data1 = {}; + + function initLoad(callback) { + var res = loadSate.yes; + for (var id in clientDataFn) { + var _fn = clientDataFn[id]; + if (_fn.state == loadSate.fail) { + res = loadSate.fail; + break; + } + else if (_fn.state == loadSate.no) { + res = loadSate.ing; + _fn.init(); + } + else if (_fn.state == loadSate.ing) { + res = loadSate.ing; + } + } + if (res == loadSate.yes) { + callback(true); + } else if (res == loadSate.fail) { + callback(false); + } + else { + setTimeout(function () { + initLoad(callback); + }, 100); + } + } + function get(key, data) { + var res = ""; + var len = data.length; + if (len == undefined) { + res = data[key]; + } + else { + for (var i = 0; i < len; i++) { + if (key(data[i])) { + res = data[i]; + break; + } + } + } + return res; + } + + learun.clientdata = { + init: function (callback) { + initLoad(function (res) { + callback(res); + if (res) {// 开始异步加载数据 + clientAsyncData.company.init(); + } + }); + }, + get: function (nameArray) {//[key,function (v) { return v.key == value }] + var res = ""; + if (!nameArray) { + return res; + } + var len = nameArray.length; + var data = clientData; + for (var i = 0; i < len; i++) { + res = get(nameArray[i], data); + if (res != "" && res != undefined) { + data = res; + } + else { + break; + } + } + res = res || ""; + return res; + }, + getAsync: function (name, op) {// + return clientAsyncData[name].get(op); + }, + getAllAsync: function (name, op) {// + return clientAsyncData[name].getAll(op); + }, + getsAsync: function (name, op) {// + return clientAsyncData[name].gets(op); + }, + update: function (name) { + clientAsyncData[name].update && clientAsyncData[name].update(); + }, + getAsyncReal: function (name, op) { + clientAsyncData[name].states = 1; + return clientAsyncData[name].get(op); + } + }; + + + /*******************登录后数据***********************/ + // 注册数据的加载方法 + // 功能模块数据 + clientDataFn.modules = { + state: loadSate.no, + init: function () { + //初始化加载数据 + clientDataFn.modules.state = loadSate.ing; + learun.httpAsyncGet($.rootUrl + '/LR_SystemModule/Module/GetModuleList', function (res) { + if (res.code == learun.httpCode.success) { + clientData.modules = res.data; + clientDataFn.modules.toMap(); + clientDataFn.modules.state = loadSate.yes; + } + else { + clientData.modules = []; + clientDataFn.modules.toMap(); + clientDataFn.modules.state = loadSate.fail; + } + }); + }, + toMap: function () { + //转化成树结构 和 转化成字典结构 + var modulesTree = {}; + var modulesMap = {}; + var _len = clientData.modules.length; + for (var i = 0; i < _len; i++) { + var _item = clientData.modules[i]; + if (_item.F_EnabledMark == 1) { + modulesTree[_item.F_ParentId] = modulesTree[_item.F_ParentId] || []; + modulesTree[_item.F_ParentId].push(_item); + modulesMap[_item.F_ModuleId] = _item; + } + } + clientData.modulesTree = modulesTree; + clientData.modulesMap = modulesMap; + } + }; + // 登录用户信息 + clientDataFn.userinfo = { + state: loadSate.no, + init: function () { + //初始化加载数据 + clientDataFn.userinfo.state = loadSate.ing; + learun.httpAsyncGet($.rootUrl + '/Login/GetUserInfo', function (res) { + if (res.code == learun.httpCode.success) { + clientData.userinfo = res.data; + clientDataFn.userinfo.state = loadSate.yes; + } + else { + clientDataFn.userinfo.state = loadSate.fail; + } + }); + } + }; + + /*******************使用时异步获取*******************/ + var storage = { + get: function (name) { + if (localStorage) { + return JSON.parse(localStorage.getItem(name)) || {}; + } + else { + return clientData[name] || {}; + } + }, + set: function (name, data) { + if (localStorage) { + localStorage.setItem(name, JSON.stringify(data)); + } + else { + clientData[name] = data; + } + } + }; + // 公司信息 + clientAsyncData.company = { + states: loadSate.no, + init: function () { + if (clientAsyncData.company.states == loadSate.no) { + clientAsyncData.company.states = loadSate.ing; + var ver = storage.get("companyData").ver || ""; + learun.httpAsync('GET', top.$.rootUrl + '/LR_OrganizationModule/Company/GetMap', { ver: ver }, function (data) { + if (!data) { + clientAsyncData.company.states = loadSate.fail; + } else { + if (data.ver) { + storage.set("companyData", data); + } + clientAsyncData.company.states = loadSate.yes; + clientAsyncData.department.init(); + } + }); + } + }, + get: function (op) { + clientAsyncData.company.init(); + if (clientAsyncData.company.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.company.get(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("companyData").data || {}; + op.callback(data[op.key] || {}, op); + } + }, + getAll: function (op) { + clientAsyncData.company.init(); + if (clientAsyncData.company.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.company.getAll(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("companyData").data || {}; + op.callback(data, op); + } + } + }; + // 部门信息 + clientAsyncData.department = { + states: loadSate.no, + init: function () { + if (clientAsyncData.department.states == loadSate.no) { + clientAsyncData.department.states = loadSate.ing; + var ver = storage.get("departmentData").ver || ""; + learun.httpAsync('GET', top.$.rootUrl + '/LR_OrganizationModule/Department/GetMap', { ver: ver }, function (data) { + if (!data) { + clientAsyncData.department.states = loadSate.fail; + } else { + if (data.ver) { + storage.set("departmentData", data); + } + clientAsyncData.department.states = loadSate.yes; + clientAsyncData.user.init(); + } + }); + } + }, + get: function (op) { + clientAsyncData.department.init(); + if (clientAsyncData.department.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.department.get(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("departmentData").data || {}; + op.callback(data[op.key] || {}, op); + } + }, + getAll: function (op) { + clientAsyncData.department.init(); + if (clientAsyncData.department.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.department.getAll(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("departmentData").data || {}; + op.callback(data, op); + } + } + }; + // 人员信息 + clientAsyncData.user = { + states: loadSate.no, + init: function () { + if (clientAsyncData.user.states == loadSate.no) { + clientAsyncData.user.states = loadSate.ing; + var ver = storage.get("userData").ver || ""; + learun.httpAsync('GET', top.$.rootUrl + '/LR_OrganizationModule/User/GetMap', { ver: ver }, function (data) { + if (!data) { + clientAsyncData.user.states = loadSate.fail; + } else { + if (data.ver) { + storage.set("userData", data); + } + clientAsyncData.user.states = loadSate.yes; + clientAsyncData.dataItem.init(); + } + }); + } + }, + get: function (op) { + clientAsyncData.user.init(); + if (clientAsyncData.user.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.user.get(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("userData").data || {}; + var keys = (op.key || '').split(','); + var array = new Array(); + if (keys.length > 1) { + $.each(keys, + function (i, item) { + + array.push(data[item]); + }) + op.callback(array || {}, op); + + } else { + + op.callback(data[op.key] || {}, op); + } + } + }, + getAll: function (op) { + clientAsyncData.user.init(); + if (clientAsyncData.user.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.user.getAll(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("userData").data || {}; + op.callback(data, op); + } + } + }; + // 数据字典 + clientAsyncData.dataItem = { + states: loadSate.no, + init: function () { + if (clientAsyncData.dataItem.states == loadSate.no) { + clientAsyncData.dataItem.states = loadSate.ing; + var ver = storage.get("dataItemData").ver || ""; + learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DataItem/GetMap', { ver: ver }, function (data) { + if (!data) { + clientAsyncData.dataItem.states = loadSate.fail; + } else { + if (data.ver) { + storage.set("dataItemData", data); + } + clientAsyncData.dataItem.states = loadSate.yes; + clientAsyncData.db.init(); + } + }); + } + }, + get: function (op) { + clientAsyncData.dataItem.init(); + if (clientAsyncData.dataItem.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.dataItem.get(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("dataItemData").data || {}; + + // 数据字典翻译 + var _item = clientAsyncData.dataItem.find(op.key, data[op.code] || {}); + if (_item) { + top.learun.language.get(_item.text, function (text) { + _item.text = text; + op.callback(_item, op); + }); + } + else { + op.callback({}, op); + } + } + }, + getAll: function (op) { + clientAsyncData.dataItem.init(); + if (clientAsyncData.dataItem.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.dataItem.getAll(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("dataItemData").data || {}; + var res = {}; + $.each(data[op.code] || {}, function (_index, _item) { + _item.text = top.learun.language.getSyn(_item.text); + res[_index] = _item; + }); + op.callback(res, op); + } + }, + gets: function (op) { + clientAsyncData.dataItem.init(); + if (clientAsyncData.dataItem.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.dataItem.get(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("dataItemData").data || {}; + + var keyList = (op.key || "").split(','); + var _text = [] + $.each(keyList, function (_index, _item) { + var _item = clientAsyncData.dataItem.find(_item, data[op.code] || {}); + top.learun.language.get(_item.text, function (text) { + _text.push(text); + }); + }); + op.callback(String(_text), op); + } + }, + find: function (key, data) { + var res = {}; + for (var id in data) { + if (data[id].value == key) { + res = data[id]; + + + break; + } + } + return res; + }, + update: function () { + clientAsyncData.dataItem.states = loadSate.no; + clientAsyncData.dataItem.init(); + } + }; + // 数据库连接数据 + clientAsyncData.db = { + states: loadSate.no, + init: function () { + if (clientAsyncData.db.states == loadSate.no) { + clientAsyncData.db.states = loadSate.ing; + var ver = storage.get("dbData").ver || ""; + learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DatabaseLink/GetMap', { ver: ver }, function (data) { + if (!data) { + clientAsyncData.db.states = loadSate.fail; + } else { + if (data.ver) { + storage.set("dbData", data); + } + clientAsyncData.db.states = loadSate.yes; + } + }); + } + }, + get: function (op) { + clientAsyncData.db.init(); + if (clientAsyncData.db.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.db.get(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("dbData").data || {}; + op.callback(data[op.key] || {}, op); + } + }, + getAll: function (op) { + clientAsyncData.db.init(); + if (clientAsyncData.db.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.db.getAll(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("dbData").data || {}; + op.callback(data, op); + } + } + }; + // 数据源数据 + clientAsyncData.sourceData = { + states: {}, + get: function (op) { + if (clientAsyncData.sourceData.states[op.code] == undefined || clientAsyncData.sourceData.states[op.code] == loadSate.no) { + clientAsyncData.sourceData.states[op.code] = loadSate.ing; + clientAsyncData.sourceData.load(op.code); + } + + if (clientAsyncData.sourceData.states[op.code] == loadSate.ing) { + setTimeout(function () { + clientAsyncData.sourceData.get(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = storage.get("sourceData_" + op.code).data || []; + if (!!data) { + op.callback(clientAsyncData.sourceData.find(op.key, op.keyId, data) || {}, op); + } else { + op.callback({}, op); + } + } + }, + getAll: function (op) { + if (clientAsyncData.sourceData.states[op.code] == undefined || clientAsyncData.sourceData.states[op.code] == loadSate.no) { + clientAsyncData.sourceData.states[op.code] = loadSate.ing; + clientAsyncData.sourceData.load(op.code); + } + + if (clientAsyncData.sourceData.states[op.code] == loadSate.ing) { + setTimeout(function () { + clientAsyncData.sourceData.getAll(op); + }, 100);// 如果还在加载100ms后再检测 + } + else if (clientAsyncData.sourceData.states[op.code] == loadSate.yes) { + var data = storage.get("sourceData_" + op.code).data || []; + + if (!!data) { + op.callback(data, op); + } else { + op.callback({}, op); + } + } + }, + load: function (code) { + var ver = storage.get("sourceData_" + code).ver || ""; + learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DataSource/GetMap', { code: code, ver: ver }, function (data) { + if (!data) { + clientAsyncData.sourceData.states[code] = loadSate.fail; + } else { + if (data.ver) { + storage.set("sourceData_" + code, data); + } + clientAsyncData.sourceData.states[code] = loadSate.yes; + } + }); + }, + find: function (key, keyId, data) { + var res = {}; + for (var i = 0, l = data.length; i < l; i++) { + if (data[i][keyId] == key) { + res = data[i]; + break; + } + } + return res; + } + }; + // 获取自定义数据 url key valueId + clientAsyncData.custmerData = { + states: {}, + get: function (op) { + if (clientAsyncData.custmerData.states[op.url] == undefined || clientAsyncData.custmerData.states[op.url] == loadSate.no || op.sync == true) { + clientAsyncData.custmerData.states[op.url] = loadSate.ing; + if (!!op.sync) { + clientAsyncData.custmerData.loadsync(op.url, op); + } else { + clientAsyncData.custmerData.load(op.url); + } + + } + if (clientAsyncData.custmerData.states[op.url] == loadSate.ing) { + setTimeout(function () { + clientAsyncData.custmerData.get(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = clientData[op.url] || []; + if (!!data) { + op.callback(clientAsyncData.custmerData.find(op.key, op.keyId, data) || {}, op); + } else { + op.callback({}, op); + } + } + }, + gets: function (op) { + if (clientAsyncData.custmerData.states[op.url] == undefined || clientAsyncData.custmerData.states[op.url] == loadSate.no) { + clientAsyncData.custmerData.states[op.url] = loadSate.ing; + clientAsyncData.custmerData.load(op.url); + } + if (clientAsyncData.custmerData.states[op.url] == loadSate.ing) { + setTimeout(function () { + clientAsyncData.custmerData.get(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = clientData[op.url] || []; + if (!!data) { + var keyList = op.key.split(','); + var _text = [] + $.each(keyList, function (_index, _item) { + var _item = clientAsyncData.custmerData.find(op.key, op.keyId, data) || {}; + if (_item[op.textId]) { + _text.push(_item[op.textId]); + } + + }); + op.callback(String(_text), op); + } else { + op.callback('', op); + } + } + }, + getAll: function (op) { + if (clientAsyncData.custmerData.states[op.url] == undefined || clientAsyncData.custmerData.states[op.url] == loadSate.no) { + clientAsyncData.custmerData.states[op.url] = loadSate.ing; + clientAsyncData.custmerData.load(op.url); + } + if (clientAsyncData.custmerData.states[op.url] == loadSate.ing) { + setTimeout(function () { + clientAsyncData.custmerData.get(op); + }, 100);// 如果还在加载100ms后再检测 + } + else { + var data = clientData[op.url] || []; + if (!!data) { + op.callback(data, op); + } else { + op.callback([], op); + } + } + }, + load: function (url) { + learun.httpAsync('GET', top.$.rootUrl + url, {}, function (data) { + if (!!data) { + clientData[url] = data; + } + clientAsyncData.custmerData.states[url] = loadSate.yes; + }); + }, + loadsync: function (url, op) { + learun.httpSync('GET', top.$.rootUrl + url, {}, function (data) { + if (!!data) { + clientAsyncData.custmerData.states[url] = loadSate.yes; + clientData[url] = data; + op.callback(clientAsyncData.custmerData.find(op.key, op.keyId, data) || {}, op); + } else { + op.callback({}, op); + } + }); + }, + find: function (key, keyId, data) { + var res = {}; + for (var i = 0, l = data.length; i < l; i++) { + if (data[i][keyId] == key) { + res = data[i]; + break; + } + } + return res; + } + }; + //桌面 + clientAsyncData.desktop = { + states: loadSate.no, + init: function () { + if (clientAsyncData.desktop.states == loadSate.no) { + clientAsyncData.desktop.states = loadSate.ing; + var j = "";//storage.get("desktopData").ver || ""; + learun.httpAsync("GET", + top.$.rootUrl + "/LR_Desktop/DTTarget/GetMap", + { + ver: j + }, + function (k) { + if (!k) { + clientAsyncData.desktop.states = loadSate.fail; + } else { + if (k.ver) { + data1 = k; + //storage.set("desktopData", k); + } + clientAsyncData.desktop.states = loadSate.yes; + clientAsyncData.department.init(); + } + }); + } + }, get: function (k) { + clientAsyncData.desktop.init(); + if (clientAsyncData.desktop.states == loadSate.ing) { + setTimeout(function () { + clientAsyncData.desktop.get(k); + }, 100) + } else { + var j = data1 || {};//storage.get("desktopData").data || {}; + k.callback(j || {}, k); + } + } + } +})(window.jQuery, top.learun); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/SRProjectPeopleMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/SRProjectPeopleMap.cs new file mode 100644 index 000000000..fbb95c83d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/SRProjectPeopleMap.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-09-15 17:10 + /// 描 述:项目人员管理 + /// + public class SRProjectPeopleMap : EntityTypeConfiguration + { + public SRProjectPeopleMap() + { + #region 表、主键 + //表 + this.ToTable("SRPROJECTPEOPLE"); + //主键 + 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 8bbf4c97d..b17cddca7 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 @@ -583,6 +583,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicBLL.cs index 10c4fd499..dab7c9f06 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicBLL.cs @@ -42,7 +42,29 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } } - + + /// + /// 获取页面显示列表数据 + /// + /// + public IEnumerable GetList() + { + try + { + return sRProjectBasicService.GetList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取SRProjectBasic表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicIBLL.cs index d2f18e326..2f7c8d9d6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicIBLL.cs @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetList(); /// /// 获取SRProjectBasic表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicService.cs index 786a6f4d3..c8c4ac796 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicService.cs @@ -89,6 +89,29 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } + /// + /// + /// + /// + public IEnumerable GetList() + { + try + { + return this.BaseRepository("CollegeMIS").FindList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取SRProjectBasic表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleBLL.cs new file mode 100644 index 000000000..7a4e3b3e8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleBLL.cs @@ -0,0 +1,125 @@ +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-09-15 17:10 + /// 描 述:项目人员管理 + /// + public class SRProjectPeopleBLL : SRProjectPeopleIBLL + { + private SRProjectPeopleService sRProjectPeopleService = new SRProjectPeopleService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return sRProjectPeopleService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取SRProjectPeople表实体数据 + /// + /// 主键 + /// + public SRProjectPeopleEntity GetSRProjectPeopleEntity(string keyValue) + { + try + { + return sRProjectPeopleService.GetSRProjectPeopleEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + sRProjectPeopleService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, SRProjectPeopleEntity entity) + { + try + { + sRProjectPeopleService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleEntity.cs new file mode 100644 index 000000000..172d5ad59 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleEntity.cs @@ -0,0 +1,75 @@ +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-09-15 17:10 + /// 描 述:项目人员管理 + /// + public class SRProjectPeopleEntity + { + #region 实体成员 + /// + /// ID + /// + [Column("ID")] + public string ID { get; set; } + /// + /// 项目基本信息Id + /// + [Column("SRPROJECTBASICID")] + public string SRProjectBasicId { get; set; } + /// + /// 项目负责人 + /// + [Column("MANAGENAME")] + public string ManageName { get; set; } + /// + /// 项目成员 + /// + [Column("PLAYERS")] + public string Players { get; set; } + /// + /// 创建人 + /// + [Column("CREATEUSERID")] + public string CreateUserId { get; set; } + /// + /// 创建人 + /// + [Column("CREATEUSERNAME")] + public string CreateUserName { get; set; } + /// + /// CreateTime + /// + [Column("CREATETIME")] + public DateTime? CreateTime { 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/CustomFunction/SRProjectPeople/SRProjectPeopleIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleIBLL.cs new file mode 100644 index 000000000..ee007d91f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleIBLL.cs @@ -0,0 +1,48 @@ +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-09-15 17:10 + /// 描 述:项目人员管理 + /// + public interface SRProjectPeopleIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取SRProjectPeople表实体数据 + /// + /// 主键 + /// + SRProjectPeopleEntity GetSRProjectPeopleEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, SRProjectPeopleEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleService.cs new file mode 100644 index 000000000..60cd5514b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleService.cs @@ -0,0 +1,157 @@ +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-09-15 17:10 + /// 描 述:项目人员管理 + /// + public class SRProjectPeopleService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.ID, + t.SRProjectBasicId, + t.ManageName, + t.Players + "); + strSql.Append(" FROM SRProjectPeople t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["SRProjectBasicId"].IsEmpty()) + { + dp.Add("SRProjectBasicId",queryParam["SRProjectBasicId"].ToString(), DbType.String); + strSql.Append(" AND t.SRProjectBasicId = @SRProjectBasicId "); + } + if (!queryParam["ManageName"].IsEmpty()) + { + dp.Add("ManageName",queryParam["ManageName"].ToString(), DbType.String); + strSql.Append(" AND t.ManageName = @ManageName "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取SRProjectPeople表实体数据 + /// + /// 主键 + /// + public SRProjectPeopleEntity GetSRProjectPeopleEntity(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.ID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, SRProjectPeopleEntity 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); + } + } + } + + #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 5bd94a215..4ad3ac7aa 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 @@ -1746,6 +1746,10 @@ + + + +