From 8eb944e8b7fe8baeaa54bd569bbcad0cea5e3cb8 Mon Sep 17 00:00:00 2001 From: edy Date: Mon, 21 Jun 2021 16:49:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=85=AC=E5=BC=8F=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FormulaFromController.cs | 117 ++++++++++++++ .../Views/FormulaFrom/Form.cshtml | 23 +++ .../Views/FormulaFrom/Form.js | 50 ++++++ .../Views/FormulaFrom/Index.cshtml | 36 +++++ .../Views/FormulaFrom/Index.js | 90 +++++++++++ .../Learun.Application.Web.csproj | 5 + .../FormulaFromMap.cs | 29 ++++ .../Learun.Application.Mapping.csproj | 1 + .../FormulaFrom/FormulaFromBLL.cs | 125 ++++++++++++++ .../FormulaFrom/FormulaFromEntity.cs | 65 ++++++++ .../FormulaFrom/FormulaFromIBLL.cs | 48 ++++++ .../FormulaFrom/FormulaFromService.cs | 153 ++++++++++++++++++ .../Learun.Application.TwoDevelopment.csproj | 4 + 13 files changed, 746 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FormulaFromController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FormulaFromMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FormulaFromController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FormulaFromController.cs new file mode 100644 index 000000000..fc2494484 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FormulaFromController.cs @@ -0,0 +1,117 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 16:15 + /// 描 述:FormulaFrom + /// + public class FormulaFromController : MvcControllerBase + { + private FormulaFromIBLL formulaFromIBLL = new FormulaFromBLL(); + + #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 = formulaFromIBLL.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 FormulaFromData = formulaFromIBLL.GetFormulaFromEntity( keyValue ); + var jsonData = new { + FormulaFrom = FormulaFromData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + formulaFromIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + FormulaFromEntity entity = strEntity.ToObject(); + formulaFromIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.cshtml new file mode 100644 index 000000000..84cc8401c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.cshtml @@ -0,0 +1,23 @@ +@{ + ViewBag.Title = "FormulaFrom"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
数1*
+ +
+
+
运算符*
+ +
+
+
数2*
+ +
+
+
备注*
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FormulaFrom/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.js new file mode 100644 index 000000000..57a4eab40 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.js @@ -0,0 +1,50 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 16:15 + * 描 述:FormulaFrom + */ +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 () { + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/FormulaFrom/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 + '/EducationalAdministration/FormulaFrom/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.cshtml new file mode 100644 index 000000000..2061739d8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.cshtml @@ -0,0 +1,36 @@ +@{ + ViewBag.Title = "FormulaFrom"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
备注
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FormulaFrom/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.js new file mode 100644 index 000000000..931d77fd7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.js @@ -0,0 +1,90 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 16:15 + * 描 述:FormulaFrom + */ +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); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/FormulaFrom/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 + '/EducationalAdministration/FormulaFrom/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 + '/EducationalAdministration/FormulaFrom/DeleteForm', { keyValue: keyValue}, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/FormulaFrom/GetPageList', + headData: [ + { label: "数1", name: "FormulaOne", width: 500, align: "center"}, + { label: "运算符", name: "Operato", width: 100, align: "center"}, + { label: "数2", name: "FormulaTwo", width: 500, align: "center"}, + { label: "备注", name: "Demo", width: 500, align: "center"}, + ], + 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 29def39e5..8b1fe8d4c 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 @@ -810,6 +810,7 @@ + @@ -6474,6 +6475,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FormulaFromMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FormulaFromMap.cs new file mode 100644 index 000000000..9ebfc09c5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FormulaFromMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 16:15 + /// 描 述:FormulaFrom + /// + public class FormulaFromMap : EntityTypeConfiguration + { + public FormulaFromMap() + { + #region 表、主键 + //表 + this.ToTable("FORMULAFROM"); + //主键 + 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 b3605be9f..33a4b6e01 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 @@ -565,6 +565,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromBLL.cs new file mode 100644 index 000000000..959249512 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromBLL.cs @@ -0,0 +1,125 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 16:15 + /// 描 述:FormulaFrom + /// + public class FormulaFromBLL : FormulaFromIBLL + { + private FormulaFromService formulaFromService = new FormulaFromService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return formulaFromService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取FormulaFrom表实体数据 + /// + /// 主键 + /// + public FormulaFromEntity GetFormulaFromEntity(string keyValue) + { + try + { + return formulaFromService.GetFormulaFromEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + formulaFromService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, FormulaFromEntity entity) + { + try + { + formulaFromService.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/EducationalAdministration/FormulaFrom/FormulaFromEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromEntity.cs new file mode 100644 index 000000000..c2d2752b8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromEntity.cs @@ -0,0 +1,65 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 16:15 + /// 描 述:FormulaFrom + /// + public class FormulaFromEntity + { + #region 实体成员 + /// + /// 主键 + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 数1 + /// + [Column("FORMULAONE")] + public decimal? FormulaOne { get; set; } + /// + /// 运算符 + /// + [Column("OPERATO")] + public string Operato { get; set; } + /// + /// 数2 + /// + [Column("FORMULATWO")] + public decimal? FormulaTwo { get; set; } + /// + /// Demo + /// + [Column("DEMO")] + public string Demo { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromIBLL.cs new file mode 100644 index 000000000..ccd6eeba0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromIBLL.cs @@ -0,0 +1,48 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 16:15 + /// 描 述:FormulaFrom + /// + public interface FormulaFromIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取FormulaFrom表实体数据 + /// + /// 主键 + /// + FormulaFromEntity GetFormulaFromEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, FormulaFromEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromService.cs new file mode 100644 index 000000000..15cbb7b87 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromService.cs @@ -0,0 +1,153 @@ +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.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 16:15 + /// 描 述:FormulaFrom + /// + public class FormulaFromService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.Id, + t.FormulaOne, + t.Operato, + t.FormulaTwo, + t.Demo + "); + strSql.Append(" FROM FormulaFrom t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["Demo"].IsEmpty()) + { + dp.Add("Demo", "%" + queryParam["Demo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.Demo Like @Demo "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取FormulaFrom表实体数据 + /// + /// 主键 + /// + public FormulaFromEntity GetFormulaFromEntity(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, FormulaFromEntity 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 268cbc9a2..a40b2c36a 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 @@ -1677,6 +1677,10 @@ + + + + From 90571f3df1d3e508d8b0b2d190af92d64f272c71 Mon Sep 17 00:00:00 2001 From: edy Date: Mon, 21 Jun 2021 17:15:37 +0800 Subject: [PATCH 2/3] 1 --- .../Controllers/FormulaFromController.cs | 117 -------------- .../Views/FormulaFrom/Form.cshtml | 23 --- .../Views/FormulaFrom/Form.js | 50 ------ .../Views/FormulaFrom/Index.cshtml | 36 ----- .../Views/FormulaFrom/Index.js | 90 ----------- .../Learun.Application.Web.csproj | 5 - .../FormulaFromMap.cs | 29 ---- .../Learun.Application.Mapping.csproj | 1 - .../FormulaFrom/FormulaFromBLL.cs | 125 -------------- .../FormulaFrom/FormulaFromEntity.cs | 65 -------- .../FormulaFrom/FormulaFromIBLL.cs | 48 ------ .../FormulaFrom/FormulaFromService.cs | 153 ------------------ .../Learun.Application.TwoDevelopment.csproj | 4 - 13 files changed, 746 deletions(-) delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FormulaFromController.cs delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.cshtml delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.js delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.cshtml delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.js delete mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FormulaFromMap.cs delete mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromBLL.cs delete mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromEntity.cs delete mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromIBLL.cs delete mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FormulaFromController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FormulaFromController.cs deleted file mode 100644 index fc2494484..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FormulaFromController.cs +++ /dev/null @@ -1,117 +0,0 @@ -using Learun.Util; -using System.Data; -using Learun.Application.TwoDevelopment.EducationalAdministration; -using System.Web.Mvc; -using System.Collections.Generic; - -namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers -{ - /// - /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 - /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 - /// 创 建:超级管理员 - /// 日 期:2021-06-21 16:15 - /// 描 述:FormulaFrom - /// - public class FormulaFromController : MvcControllerBase - { - private FormulaFromIBLL formulaFromIBLL = new FormulaFromBLL(); - - #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 = formulaFromIBLL.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 FormulaFromData = formulaFromIBLL.GetFormulaFromEntity( keyValue ); - var jsonData = new { - FormulaFrom = FormulaFromData, - }; - return Success(jsonData); - } - #endregion - - #region 提交数据 - - /// - /// 删除实体数据 - /// - /// 主键 - /// - [HttpPost] - [AjaxOnly] - public ActionResult DeleteForm(string keyValue) - { - formulaFromIBLL.DeleteEntity(keyValue); - return Success("删除成功!"); - } - /// - /// 保存实体数据(新增、修改) - /// - /// 主键 - /// 实体 - /// - [HttpPost] - [ValidateAntiForgeryToken] - [AjaxOnly] - public ActionResult SaveForm(string keyValue, string strEntity) - { - FormulaFromEntity entity = strEntity.ToObject(); - formulaFromIBLL.SaveEntity(keyValue,entity); - if (string.IsNullOrEmpty(keyValue)) - { - } - return Success("保存成功!"); - } - #endregion - - } -} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.cshtml deleted file mode 100644 index 84cc8401c..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.cshtml +++ /dev/null @@ -1,23 +0,0 @@ -@{ - ViewBag.Title = "FormulaFrom"; - Layout = "~/Views/Shared/_Form.cshtml"; -} -
-
-
数1*
- -
-
-
运算符*
- -
-
-
数2*
- -
-
-
备注*
- -
-
-@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FormulaFrom/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.js deleted file mode 100644 index 57a4eab40..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Form.js +++ /dev/null @@ -1,50 +0,0 @@ -/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) - * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 - * 创建人:超级管理员 - * 日 期:2021-06-21 16:15 - * 描 述:FormulaFrom - */ -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 () { - }, - initData: function () { - if (!!keyValue) { - $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/FormulaFrom/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 + '/EducationalAdministration/FormulaFrom/SaveForm?keyValue=' + keyValue, postData, function (res) { - // 保存成功后才回调 - if (!!callBack) { - callBack(); - } - }); - }; - page.init(); -} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.cshtml deleted file mode 100644 index 2061739d8..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.cshtml +++ /dev/null @@ -1,36 +0,0 @@ -@{ - ViewBag.Title = "FormulaFrom"; - Layout = "~/Views/Shared/_Index.cshtml"; -} -
-
-
-
-
-
-
-
-
-
备注
- -
-
-
-
-
-
-
- -
- -
-
-
-
-
-
-@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FormulaFrom/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.js deleted file mode 100644 index 931d77fd7..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FormulaFrom/Index.js +++ /dev/null @@ -1,90 +0,0 @@ -/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) - * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 - * 创建人:超级管理员 - * 日 期:2021-06-21 16:15 - * 描 述:FormulaFrom - */ -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); - // 刷新 - $('#lr_refresh').on('click', function () { - location.reload(); - }); - // 新增 - $('#lr_add').on('click', function () { - learun.layerForm({ - id: 'form', - title: '新增', - url: top.$.rootUrl + '/EducationalAdministration/FormulaFrom/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 + '/EducationalAdministration/FormulaFrom/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 + '/EducationalAdministration/FormulaFrom/DeleteForm', { keyValue: keyValue}, function () { - refreshGirdData(); - }); - } - }); - } - }); - }, - // 初始化列表 - initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ - url: top.$.rootUrl + '/EducationalAdministration/FormulaFrom/GetPageList', - headData: [ - { label: "数1", name: "FormulaOne", width: 500, align: "center"}, - { label: "运算符", name: "Operato", width: 100, align: "center"}, - { label: "数2", name: "FormulaTwo", width: 500, align: "center"}, - { label: "备注", name: "Demo", width: 500, align: "center"}, - ], - 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 8b1fe8d4c..29def39e5 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 @@ -810,7 +810,6 @@ - @@ -6475,10 +6474,6 @@ - - - - diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FormulaFromMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FormulaFromMap.cs deleted file mode 100644 index 9ebfc09c5..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FormulaFromMap.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Learun.Application.TwoDevelopment.EducationalAdministration; -using System.Data.Entity.ModelConfiguration; - -namespace Learun.Application.Mapping -{ - /// - /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 - /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 - /// 创 建:超级管理员 - /// 日 期:2021-06-21 16:15 - /// 描 述:FormulaFrom - /// - public class FormulaFromMap : EntityTypeConfiguration - { - public FormulaFromMap() - { - #region 表、主键 - //表 - this.ToTable("FORMULAFROM"); - //主键 - 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 33a4b6e01..b3605be9f 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 @@ -565,7 +565,6 @@ - diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromBLL.cs deleted file mode 100644 index 959249512..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromBLL.cs +++ /dev/null @@ -1,125 +0,0 @@ -using Learun.Util; -using System; -using System.Data; -using System.Collections.Generic; - -namespace Learun.Application.TwoDevelopment.EducationalAdministration -{ - /// - /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 - /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 - /// 创 建:超级管理员 - /// 日 期:2021-06-21 16:15 - /// 描 述:FormulaFrom - /// - public class FormulaFromBLL : FormulaFromIBLL - { - private FormulaFromService formulaFromService = new FormulaFromService(); - - #region 获取数据 - - /// - /// 获取页面显示列表数据 - /// - /// 分页参数 - /// 查询参数 - /// - public IEnumerable GetPageList(Pagination pagination, string queryJson) - { - try - { - return formulaFromService.GetPageList(pagination, queryJson); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - - /// - /// 获取FormulaFrom表实体数据 - /// - /// 主键 - /// - public FormulaFromEntity GetFormulaFromEntity(string keyValue) - { - try - { - return formulaFromService.GetFormulaFromEntity(keyValue); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - - #endregion - - #region 提交数据 - - /// - /// 删除实体数据 - /// - /// 主键 - public void DeleteEntity(string keyValue) - { - try - { - formulaFromService.DeleteEntity(keyValue); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - - /// - /// 保存实体数据(新增、修改) - /// - /// 主键 - /// 实体 - /// - public void SaveEntity(string keyValue, FormulaFromEntity entity) - { - try - { - formulaFromService.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/EducationalAdministration/FormulaFrom/FormulaFromEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromEntity.cs deleted file mode 100644 index c2d2752b8..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromEntity.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Learun.Util; -using System; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Learun.Application.TwoDevelopment.EducationalAdministration -{ - /// - /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 - /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 - /// 创 建:超级管理员 - /// 日 期:2021-06-21 16:15 - /// 描 述:FormulaFrom - /// - public class FormulaFromEntity - { - #region 实体成员 - /// - /// 主键 - /// - [Column("ID")] - public string Id { get; set; } - /// - /// 数1 - /// - [Column("FORMULAONE")] - public decimal? FormulaOne { get; set; } - /// - /// 运算符 - /// - [Column("OPERATO")] - public string Operato { get; set; } - /// - /// 数2 - /// - [Column("FORMULATWO")] - public decimal? FormulaTwo { get; set; } - /// - /// Demo - /// - [Column("DEMO")] - public string Demo { get; set; } - #endregion - - #region 扩展操作 - /// - /// 新增调用 - /// - public void Create() - { - this.Id = Guid.NewGuid().ToString(); - } - /// - /// 编辑调用 - /// - /// - public void Modify(string keyValue) - { - this.Id = keyValue; - } - #endregion - #region 扩展字段 - #endregion - } -} - diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromIBLL.cs deleted file mode 100644 index ccd6eeba0..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromIBLL.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Learun.Util; -using System.Data; -using System.Collections.Generic; - -namespace Learun.Application.TwoDevelopment.EducationalAdministration -{ - /// - /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 - /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 - /// 创 建:超级管理员 - /// 日 期:2021-06-21 16:15 - /// 描 述:FormulaFrom - /// - public interface FormulaFromIBLL - { - #region 获取数据 - - /// - /// 获取页面显示列表数据 - /// - /// 查询参数 - /// - IEnumerable GetPageList(Pagination pagination, string queryJson); - /// - /// 获取FormulaFrom表实体数据 - /// - /// 主键 - /// - FormulaFromEntity GetFormulaFromEntity(string keyValue); - #endregion - - #region 提交数据 - - /// - /// 删除实体数据 - /// - /// 主键 - void DeleteEntity(string keyValue); - /// - /// 保存实体数据(新增、修改) - /// - /// 主键 - /// 实体 - void SaveEntity(string keyValue, FormulaFromEntity entity); - #endregion - - } -} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromService.cs deleted file mode 100644 index 15cbb7b87..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FormulaFrom/FormulaFromService.cs +++ /dev/null @@ -1,153 +0,0 @@ -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.EducationalAdministration -{ - /// - /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 - /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 - /// 创 建:超级管理员 - /// 日 期:2021-06-21 16:15 - /// 描 述:FormulaFrom - /// - public class FormulaFromService : RepositoryFactory - { - #region 获取数据 - - /// - /// 获取页面显示列表数据 - /// - /// 查询参数 - /// 查询参数 - /// - public IEnumerable GetPageList(Pagination pagination, string queryJson) - { - try - { - var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(@" - t.Id, - t.FormulaOne, - t.Operato, - t.FormulaTwo, - t.Demo - "); - strSql.Append(" FROM FormulaFrom t "); - strSql.Append(" WHERE 1=1 "); - var queryParam = queryJson.ToJObject(); - // 虚拟参数 - var dp = new DynamicParameters(new { }); - if (!queryParam["Demo"].IsEmpty()) - { - dp.Add("Demo", "%" + queryParam["Demo"].ToString() + "%", DbType.String); - strSql.Append(" AND t.Demo Like @Demo "); - } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowServiceException(ex); - } - } - } - - /// - /// 获取FormulaFrom表实体数据 - /// - /// 主键 - /// - public FormulaFromEntity GetFormulaFromEntity(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, FormulaFromEntity 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 a40b2c36a..268cbc9a2 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 @@ -1677,10 +1677,6 @@ - - - - From 59f15e3db444c45e943f8017b430d5295242f739 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Mon, 21 Jun 2021 18:22:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=B1=BB=E5=9E=8B=E7=AE=A1=E7=90=86=EF=BC=9B?= =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E9=A1=B9=E7=9B=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ProjectManageController.cs | 120 +++++++++++++ .../ProjectTypeManageController.cs | 23 ++- .../Views/ProjectManage/Form.cshtml | 31 ++++ .../Views/ProjectManage/Form.js | 71 ++++++++ .../Views/ProjectManage/Index.cshtml | 58 +++++++ .../Views/ProjectManage/Index.js | 139 +++++++++++++++ .../Views/ProjectTypeManage/Index.js | 33 ++-- .../Learun.Application.Web.csproj | 5 + .../Learun.Application.Mapping.csproj | 1 + .../LogisticsManagement/ProjectManageMap.cs | 29 ++++ .../Learun.Application.TwoDevelopment.csproj | 4 + .../ProjectManage/ProjectManageBLL.cs | 125 ++++++++++++++ .../ProjectManage/ProjectManageEntity.cs | 90 ++++++++++ .../ProjectManage/ProjectManageIBLL.cs | 48 ++++++ .../ProjectManage/ProjectManageService.cs | 161 ++++++++++++++++++ .../ProjectTypeManage/ProjectTypeManageBLL.cs | 63 ++++++- .../ProjectTypeManageIBLL.cs | 12 ++ .../ProjectTypeManageService.cs | 46 ++++- 18 files changed, 1026 insertions(+), 33 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectManageController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/ProjectManageMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectManageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectManageController.cs new file mode 100644 index 000000000..7af2211c4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectManageController.cs @@ -0,0 +1,120 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Web.Mvc; +using System.Collections.Generic; +using System; + +namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 15:49 + /// 描 述:项目管理 + /// + public class ProjectManageController : MvcControllerBase + { + private ProjectManageIBLL projectManageIBLL = new ProjectManageBLL(); + + #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 = projectManageIBLL.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 ProjectManageData = projectManageIBLL.GetProjectManageEntity(keyValue); + var jsonData = new + { + ProjectManage = ProjectManageData, + }; + return Success(jsonData); + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + projectManageIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + ProjectManageEntity entity = strEntity.ToObject(); + entity.CreateTime = DateTime.Now; + entity.CreateUserId = LoginUserInfo.Get().userId; + projectManageIBLL.SaveEntity(keyValue, entity); + + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectTypeManageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectTypeManageController.cs index a29291f66..0f95a9aae 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectTypeManageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectTypeManageController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.LogisticsManagement; using System.Web.Mvc; using System.Collections.Generic; +using System.Linq; namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { @@ -26,7 +27,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +36,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } #endregion @@ -71,12 +72,24 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var ProjectTypeManageData = projectTypeManageIBLL.GetProjectTypeManageEntity( keyValue ); - var jsonData = new { + var ProjectTypeManageData = projectTypeManageIBLL.GetProjectTypeManageEntity(keyValue); + var jsonData = new + { ProjectTypeManage = ProjectTypeManageData, }; return Success(jsonData); } + /// + /// 获取左侧树形数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTree() + { + var data = projectTypeManageIBLL.GetList("{\"IsEnabled\":\"true\"}").OrderBy(x => x.Sort); + return Success(projectTypeManageIBLL.GetTree(data)); + } #endregion #region 提交数据 @@ -105,7 +118,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { ProjectTypeManageEntity entity = strEntity.ToObject(); - projectTypeManageIBLL.SaveEntity(keyValue,entity); + projectTypeManageIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Form.cshtml new file mode 100644 index 000000000..30bd65231 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Form.cshtml @@ -0,0 +1,31 @@ +@{ + ViewBag.Title = "项目管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
项目类型*
+
+
+
+
项目名称*
+ +
+
+
项目周期
+ +
+
+
负责部门
+
+
+
+
负责人
+
+
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/ProjectManage/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Form.js new file mode 100644 index 000000000..181f3e26f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Form.js @@ -0,0 +1,71 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 15:49 + * 描 述:项目管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +var PTId = request("PTId"); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#PTId').lrselect({ + type: 'tree', + // 展开最大高度 + maxHeight: 200, + // 是否允许搜索 + allowSearch: true, + // 访问数据接口地址 + url: top.$.rootUrl + '/LogisticsManagement/ProjectTypeManage/GetTree', + select: function (item) { + if (item != null && item != undefined) { + + } + } + }); + if (!!PTId) { + $('#PTId').lrselectSet(PTId); + } + + $('#DepartmentId').lrDepartmentSelect(); + $('#ManagerId').lrUserSelect(0); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/ProjectManage/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 + '/LogisticsManagement/ProjectManage/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml new file mode 100644 index 000000000..6880ecba7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml @@ -0,0 +1,58 @@ +@{ + /**/ + + ViewBag.Title = "项目管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
类型
+
+
+
+
+
+
+ 未选择类型 - 列表信息 +
+
+
+
+
+
+
+
项目名称
+ +
+
+
负责部门
+
+
+
+
负责人
+
+
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/ProjectManage/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js new file mode 100644 index 000000000..d2592c468 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js @@ -0,0 +1,139 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 15:49 + * 描 述:项目管理 + */ +var refreshGirdData; +var PTId; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.inittree(); + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#DepartmentId').lrDepartmentSelect(); + $('#ManagerId').lrUserSelect(0); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + if (!PTId) { + learun.alert.warning('请选择类型!'); + return false; + } + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/LogisticsManagement/ProjectManage/Form?PTId=' + PTId, + width: 800, + height: 600, + 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 + '/LogisticsManagement/ProjectManage/Form?keyValue=' + keyValue, + width: 800, + height: 600, + 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 + '/LogisticsManagement/ProjectManage/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  上传项目资料 + $('#lr_data').on('click', function () { + }); + }, + inittree: function () { + // 初始化左侧树形数据 + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/LogisticsManagement/ProjectTypeManage/GetTree', + nodeClick: page.treeNodeClick + }); + }, + treeNodeClick: function (item) { + PTId = item.id; + $('#titleinfo').text(item.text); + page.search(); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/ProjectManage/GetPageList', + headData: [ + { label: "项目名称", name: "Name", width: 200, align: "left" }, + { label: "项目周期", name: "Period", width: 100, align: "left" }, + { + label: "负责部门", name: "DepartmentId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "负责人", name: "ManagerId", 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: "Status", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'Id', + isPage: true, + sidx: 'CreateTime desc' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.PTId = PTId; + $('#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/LogisticsManagement/Views/ProjectTypeManage/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectTypeManage/Index.js index d462b8638..b58d42588 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectTypeManage/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectTypeManage/Index.js @@ -55,7 +55,7 @@ var bootstrap = function ($, learun) { if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/ProjectTypeManage/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/ProjectTypeManage/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -68,29 +68,26 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/LogisticsManagement/ProjectTypeManage/GetPageList', headData: [ - { label: "项目类型名称", name: "Name", width: 100, align: "left"}, - { label: "项目类型编号", name: "Code", width: 100, align: "left"}, - { label: "排序号", name: "Sort", width: 100, align: "left"}, - { label: "是否启用", name: "IsEnabled", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'YesOrNoBit', - callback: function (_data) { - callback(_data.text); - } - }); - }}, - { label: "备注", name: "Remark", width: 100, align: "left"}, + { label: "项目类型名称", name: "Name", width: 200, align: "left" }, + { label: "项目类型编号", name: "Code", width: 200, align: "left" }, + { label: "排序号", name: "Sort", width: 100, align: "left" }, + { + label: "是否启用", name: "IsEnabled", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "" : ""; + } + }, + { label: "备注", name: "Remark", width: 100, align: "left" }, ], - mainId:'Id', - isPage: true + mainId: 'Id', + isPage: true, + sidx:'Sort' }); 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 29def39e5..425a1fc62 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 @@ -810,6 +810,7 @@ + @@ -6474,6 +6475,10 @@ + + + + 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 b3605be9f..a6bed2be6 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 @@ -565,6 +565,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/ProjectManageMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/ProjectManageMap.cs new file mode 100644 index 000000000..08531f96d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/ProjectManageMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 15:49 + /// 描 述:项目管理 + /// + public class ProjectManageMap : EntityTypeConfiguration + { + public ProjectManageMap() + { + #region 表、主键 + //表 + this.ToTable("PROJECTMANAGE"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #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 268cbc9a2..3491b61e5 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 @@ -1677,6 +1677,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageBLL.cs new file mode 100644 index 000000000..4b98b4bcb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageBLL.cs @@ -0,0 +1,125 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 15:49 + /// 描 述:项目管理 + /// + public class ProjectManageBLL : ProjectManageIBLL + { + private ProjectManageService projectManageService = new ProjectManageService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return projectManageService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取ProjectManage表实体数据 + /// + /// 主键 + /// + public ProjectManageEntity GetProjectManageEntity(string keyValue) + { + try + { + return projectManageService.GetProjectManageEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + projectManageService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, ProjectManageEntity entity) + { + try + { + projectManageService.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/LogisticsManagement/ProjectManage/ProjectManageEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageEntity.cs new file mode 100644 index 000000000..5552d50d6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageEntity.cs @@ -0,0 +1,90 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 15:49 + /// 描 述:项目管理 + /// + public class ProjectManageEntity + { + #region 实体成员 + /// + /// 主键 + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 项目类型Id + /// + [Column("PTID")] + public string PTId { get; set; } + /// + /// 项目名称 + /// + [Column("NAME")] + public string Name { get; set; } + /// + /// 项目周期 + /// + [Column("PERIOD")] + public string Period { get; set; } + /// + /// 负责部门 + /// + [Column("DEPARTMENTID")] + public string DepartmentId { get; set; } + /// + /// 负责人 + /// + [Column("MANAGERID")] + public string ManagerId { get; set; } + /// + /// 项目状态 + /// + [Column("STATUS")] + public string Status { get; set; } + /// + /// 备注 + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// 创建时间 + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// 创建用户 + /// + [Column("CREATEUSERID")] + public string CreateUserId { 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/LogisticsManagement/ProjectManage/ProjectManageIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageIBLL.cs new file mode 100644 index 000000000..7fa54be1e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageIBLL.cs @@ -0,0 +1,48 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 15:49 + /// 描 述:项目管理 + /// + public interface ProjectManageIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取ProjectManage表实体数据 + /// + /// 主键 + /// + ProjectManageEntity GetProjectManageEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, ProjectManageEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageService.cs new file mode 100644 index 000000000..1250994c2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectManage/ProjectManageService.cs @@ -0,0 +1,161 @@ +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.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 15:49 + /// 描 述:项目管理 + /// + public class ProjectManageService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.* "); + strSql.Append(" FROM ProjectManage t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["Name"].IsEmpty()) + { + dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); + strSql.Append(" AND t.Name Like @Name "); + } + if (!queryParam["DepartmentId"].IsEmpty()) + { + dp.Add("DepartmentId",queryParam["DepartmentId"].ToString(), DbType.String); + strSql.Append(" AND t.DepartmentId = @DepartmentId "); + } + if (!queryParam["ManagerId"].IsEmpty()) + { + dp.Add("ManagerId",queryParam["ManagerId"].ToString(), DbType.String); + strSql.Append(" AND t.ManagerId = @ManagerId "); + } + if (!queryParam["PTId"].IsEmpty()) + { + dp.Add("PTId",queryParam["PTId"].ToString(), DbType.String); + strSql.Append(" AND t.PTId = @PTId "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取ProjectManage表实体数据 + /// + /// 主键 + /// + public ProjectManageEntity GetProjectManageEntity(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, ProjectManageEntity 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/LogisticsManagement/ProjectTypeManage/ProjectTypeManageBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageBLL.cs index 2815d5eff..cdce07e41 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageBLL.cs @@ -43,6 +43,30 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + return projectTypeManageService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取ProjectTypeManage表实体数据 /// @@ -66,7 +90,44 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } } - + /// + /// 获取树形数据 + /// + /// 公司数据列表 + /// + public IEnumerable GetTree(IEnumerable typelist) + { + try + { + List treeList = new List(); + foreach (var typeitem in typelist) + { + TreeModel node = new TreeModel + { + id = typeitem.Id, + text = typeitem.Name, + value = typeitem.Code, + showcheck = false, + checkstate = 0, + isexpand = true, + parentId = "" + }; + treeList.Add(node); + } + return treeList.ToTree(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageIBLL.cs index b6880a98e..364e16811 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageIBLL.cs @@ -22,11 +22,23 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// IEnumerable GetPageList(Pagination pagination, string queryJson); /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetList(string queryJson); + /// /// 获取ProjectTypeManage表实体数据 /// /// 主键 /// ProjectTypeManageEntity GetProjectTypeManageEntity(string keyValue); + /// + /// 获取树形数据 + /// + /// 公司数据列表 + /// + IEnumerable GetTree(IEnumerable typelist); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageService.cs index 3debe49e9..27f900fc9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectTypeManage/ProjectTypeManageService.cs @@ -30,15 +30,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement try { var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(@" - t.Id, - t.Name, - t.Code, - t.Sort, - t.IsEnabled, - t.Remark - "); + strSql.Append("SELECT t.* "); strSql.Append(" FROM ProjectTypeManage t "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); @@ -69,6 +61,42 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT * "); + strSql.Append(" FROM ProjectTypeManage t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["IsEnabled"].IsEmpty()) + { + dp.Add("IsEnabled", queryParam["IsEnabled"].ToBool(), DbType.Boolean); + strSql.Append(" AND t.IsEnabled = @IsEnabled "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取ProjectTypeManage表实体数据 ///