diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/GantProjectController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/GantProjectController.cs new file mode 100644 index 000000000..cf5af2401 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/GantProjectController.cs @@ -0,0 +1,294 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LR_CodeDemo; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.LR_CodeDemo.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-05-08 18:30 + /// 描 述:甘特图应用 + /// + public class GantProjectController : MvcControllerBase + { + private GantProjectIBLL gantProjectIBLL = new GantProjectBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 甘特图 + /// + /// + [HttpGet] + public ActionResult Gant() + { + return View(); + } + /// + /// 项目主表 + /// + /// + [HttpGet] + public ActionResult Project() + { + return View(); + } + /// + /// 项目明细 + /// + /// + [HttpGet] + public ActionResult ProjectDetail() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = gantProjectIBLL.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 LR_OA_ProjectData = gantProjectIBLL.GetLR_OA_ProjectEntity(keyValue); + var LR_OA_ProjectDetailData = gantProjectIBLL.GetLR_OA_ProjectDetailList(LR_OA_ProjectData.F_Id); + var jsonData = new + { + LR_OA_Project = LR_OA_ProjectData, + LR_OA_ProjectDetail = LR_OA_ProjectDetailData, + }; + return Success(jsonData); + } + /// + /// 获取甘特图明细数据 + /// + /// 关键字 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetProjectList(string keyword) + { + List list = new List(); + var projectList = gantProjectIBLL.GetList(keyword); + foreach (var item in projectList) + { + List timeList = new List(); + timeList.Add(new + { + beginTime = item.F_StartTime.ToString(), + endTime = item.F_EndTime.ToString(), + color = string.IsNullOrEmpty(item.F_Status) ? "#3286ed" : item.F_Status, + overtime = false, + text = item.F_ProjectName + }); + var data = new + { + id = item.F_Id, + text = item.F_ProjectName, + isexpand = false, + complete = false, + timeList = timeList, + hasChildren = true + }; + if (!string.IsNullOrEmpty(keyword)) + { + if (data.text.IndexOf(keyword) != -1) + { + list.Add(data); + } + } + else + { + list.Add(data); + }; + } + return Success(list); + } + /// + /// 获取甘特图数据 + /// + /// 父键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetProjectDetail(string parentId) + { + List list = new List(); + var projectDetail = gantProjectIBLL.GetDetailList(parentId); + foreach (var item in projectDetail) + { + List timeList = new List(); + timeList.Add(new + { + beginTime = item.F_StartTime.ToString(), + endTime = item.F_EndTime.ToString(), + color = string.IsNullOrEmpty(item.F_Status) ? "#1bb99a" : item.F_Status, + overtime = false, + text = item.F_ItemName + }); + + + var data = new + { + id = item.F_Id, + text = item.F_ItemName, + isexpand = false, + complete = true, + timeList = timeList, + hasChildren = false + }; + list.Add(data); + } + return Success(list); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetGantData(string keyValue) + { + var LR_OA_ProjectData = gantProjectIBLL.GetLR_OA_ProjectEntity(keyValue); + var jsonData = new + { + LR_OA_Project = LR_OA_ProjectData, + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetGantDetail(string keyValue) + { + var LR_OA_ProjectDetailData = gantProjectIBLL.GetLR_OA_ProjectDetailEntity(keyValue); + var jsonData = new + { + LR_OA_ProjectDetail = LR_OA_ProjectDetailData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + gantProjectIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 删除明细数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteDetail(string keyValue) + { + gantProjectIBLL.DeleteDetail(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity, string strlR_OA_ProjectDetailList) + { + LR_OA_ProjectEntity entity = strEntity.ToObject(); + List lR_OA_ProjectDetailList = strlR_OA_ProjectDetailList.ToObject>(); + gantProjectIBLL.SaveEntity(keyValue, entity, lR_OA_ProjectDetailList); + return Success("保存成功!"); + } + /// + /// 保存表头实体数据(新增、修改) + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveGant(string keyValue, string strEntity) + { + LR_OA_ProjectEntity entity = strEntity.ToObject(); + gantProjectIBLL.SaveGant(keyValue, entity); + return Success("保存成功!"); + } + /// + /// 保存明细实体数据(新增、修改) + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveDetail(string keyValue, string strEntity) + { + LR_OA_ProjectDetailEntity entity = strEntity.ToObject(); + gantProjectIBLL.SaveDetail(keyValue, entity); + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/GanttDemoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/GanttDemoController.cs new file mode 100644 index 000000000..d00646677 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/GanttDemoController.cs @@ -0,0 +1,207 @@ +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.LR_CodeDemo.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创建人:力软-框架开发组 + /// 日 期:2018.011.23 + /// 描 述:甘特图演示 + /// + public class GanttDemoController : MvcControllerBase + { + #region 视图功能 + /// + /// 显示静态本地数据 + /// + /// + [HttpGet] + public ActionResult Index1() + { + return View(); + } + /// + /// 显示树形数据 + /// + /// + [HttpGet] + public ActionResult Index2() + { + return View(); + } + /// + /// 动态加载后台数据 + /// + /// + [HttpGet] + public ActionResult Index3() + { + return View(); + } + /// + /// 分页显示 + /// + /// + [HttpGet] + public ActionResult Index4() + { + return View(); + } + #endregion + + #region 获取数据 + /// + /// 获取数据 + /// + /// 分页参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTimeList(string keyword, string parentId) + { + List list = new List(); + if (string.IsNullOrEmpty(parentId) || parentId == "0") + { + // 根节点 + for (int i = 0; i < 10; i++) { + List timeList = new List(); + timeList.Add(new { + beginTime = DateTime.Now.ToString("yyyy-MM-dd"), + endTime = DateTime.Now.AddDays(8).ToString("yyyy-MM-dd"), + color = "#3286ed", + overtime = false, + text = "执行时间9天" + }); + var data = new { + id = Guid.NewGuid().ToString(), + text = "计划任务" + (i + 1), + isexpand = false, + complete = false, + timeList = timeList, + hasChildren = true + }; + if (!string.IsNullOrEmpty(keyword)) + { + if (data.text.IndexOf(keyword) != -1) + { + list.Add(data); + } + } + else + { + list.Add(data); + } + } + } + else { + // 子节点 + for (int i = 0; i < 2; i++) + { + List timeList = new List(); + + if (i == 0) + { + timeList.Add(new + { + beginTime = DateTime.Now.ToString("yyyy-MM-dd"), + endTime = DateTime.Now.AddDays(3).ToString("yyyy-MM-dd"), + color = "#1bb99a", + overtime = false, + text = "执行时间4天" + }); + } + else { + timeList.Add(new + { + beginTime = DateTime.Now.AddDays(4).ToString("yyyy-MM-dd"), + endTime = DateTime.Now.AddDays(8).ToString("yyyy-MM-dd"), + color = "#E4474D", + overtime = true, + text = "执行时间5天" + }); + } + + var data = new + { + id = Guid.NewGuid().ToString(), + text = "子任务" + (i + 1), + isexpand = false, + complete = true, + timeList = timeList, + hasChildren = false + }; + list.Add(data); + } + } + + return Success(list); + } + /// + /// + /// + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination,string keyword) + { + List list = new List(); + // 根节点 + for (int i = 0; i < 100; i++) + { + List timeList = new List(); + timeList.Add(new + { + beginTime = DateTime.Now.ToString("yyyy-MM-dd"), + endTime = DateTime.Now.AddDays(8).ToString("yyyy-MM-dd"), + color = "#3286ed", + overtime = false, + text = "执行时间9天" + }); + var data = new + { + id = Guid.NewGuid().ToString(), + text = "计划任务" + (i + 1), + isexpand = false, + complete = false, + timeList = timeList, + hasChildren = true + }; + if (!string.IsNullOrEmpty(keyword)) + { + if (data.text.IndexOf(keyword) != -1) + { + list.Add(data); + } + } + else + { + list.Add(data); + } + } + Pagination paginationobj = pagination.ToObject(); + int _index = (paginationobj.page - 1) * paginationobj.rows; + int _cont = paginationobj.rows; + if (_cont > list.Count - _index) { + _cont = list.Count - _index; + } + + var res = list.GetRange(_index, _cont); + paginationobj.records = list.Count; + var jsonData = new + { + rows = res, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records, + }; + return Success(jsonData); + } + #endregion + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/ImgShowController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/ImgShowController.cs new file mode 100644 index 000000000..c795f5568 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/ImgShowController.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.LR_CodeDemo.Controllers +{ + public class ImgShowController : MvcControllerBase + { + // GET: LR_CodeDemo/ImgShow + public ActionResult Demo1() + { + return View(); + } + public ActionResult Demo2() + { + return View(); + } + public ActionResult Demo3() + { + return View(); + } + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/StockDemoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/StockDemoController.cs new file mode 100644 index 000000000..725751f92 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/StockDemoController.cs @@ -0,0 +1,135 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LR_CodeDemo; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.LR_CodeDemo.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-12 18:49 + /// 描 述:库存 + /// + public class StockDemoController : MvcControllerBase + { + private StockDemoIBLL stockDemoIBLL = new StockDemoBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 库存页 + /// + /// + [HttpGet] + public ActionResult Stock() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = stockDemoIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetStock(string stockArea) + { + var data = stockDemoIBLL.GetStock(stockArea); + return Success(data); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var LR_Demo_StockData = stockDemoIBLL.GetLR_Demo_StockEntity( keyValue ); + var jsonData = new { + LR_Demo_Stock = LR_Demo_StockData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + stockDemoIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + LR_Demo_StockEntity entity = strEntity.ToObject(); + stockDemoIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/WorkOrderController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/WorkOrderController.cs new file mode 100644 index 000000000..5d3b47c39 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Controllers/WorkOrderController.cs @@ -0,0 +1,163 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LR_CodeDemo; +using System.Web.Mvc; +using System.Collections.Generic; +using Learun.Application.Base.SystemModule; + +namespace Learun.Application.Web.Areas.LR_CodeDemo.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-10 17:21 + /// 描 述:工单管理 + /// + public class WorkOrderController : MvcControllerBase + { + private WorkOrderIBLL workOrderIBLL = new WorkOrderBLL(); + private CodeRuleIBLL codeRuleIBLL = new CodeRuleBLL(); + + #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 = workOrderIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取大屏显示数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList() + { + var data = workOrderIBLL.GetList(); + return Success(data); + } + /// + /// 获取打印数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPrintItem(string keyValue) + { + var data = workOrderIBLL.GetPrintItem(keyValue); + return Success(data); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var LR_Demo_WorkOrderData = workOrderIBLL.GetLR_Demo_WorkOrderEntity( keyValue ); + var jsonData = new { + LR_Demo_WorkOrder = LR_Demo_WorkOrderData, + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormDataByProcessId(string processId) + { + var LR_Demo_WorkOrderData = workOrderIBLL.GetEntityByProcessId( processId ); + var jsonData = new { + LR_Demo_WorkOrder = LR_Demo_WorkOrderData, + }; + return Success(jsonData); + } + /// + /// 获取左侧树形数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTree() + { + var data = workOrderIBLL.GetTree(); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + workOrderIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + LR_Demo_WorkOrderEntity entity = strEntity.ToObject(); + workOrderIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Form.cshtml new file mode 100644 index 000000000..87e7e4561 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Form.cshtml @@ -0,0 +1,26 @@ +@{ + ViewBag.Title = "甘特图应用"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
项目名称
+ +
+
+
项目起始
+ +
+
+
项目结束
+ +
+
+
+
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/GantProject/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Form.js new file mode 100644 index 000000000..0951af5bd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Form.js @@ -0,0 +1,80 @@ +/* * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:超级管理员 + * 日 期:2019-05-08 18:30 + * 描 述:甘特图应用 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + $('#LR_OA_ProjectDetail').jfGrid({ + headData: [ + { + label: '项目名称', name: 'F_ItemName', width: 100, align: 'left', edit: { + type: 'input' + } + }, + { + label: '开始时间', name: 'F_StartTime', width: 100, align: 'left' + , edit: { + type: 'datatime', + dateformat: '1' + } + }, + { + label: '结束时间', name: 'F_EndTime', width: 100, align: 'left' + , edit: { + type: 'datatime', + dateformat: '1' + } + }, + { + label: '备注', name: 'F_Remark', width: 100, align: 'left' + , edit: { + type: 'input' + } + }, + ], + isEdit: true, + height: 400 + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LR_CodeDemo/GantProject/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 = {}; + postData.strEntity = JSON.stringify($('[data-table="LR_OA_Project"]').lrGetFormData()); + postData.strlR_OA_ProjectDetailList = JSON.stringify($('#LR_OA_ProjectDetail').jfGridGet('rowdatas')); + $.lrSaveForm(top.$.rootUrl + '/LR_CodeDemo/GantProject/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Gant.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Gant.cshtml new file mode 100644 index 000000000..cfa8a31aa --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Gant.cshtml @@ -0,0 +1,31 @@ +@{ + ViewBag.Title = "甘特图3"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@Html.AppendCssFile("/Views/LR_Content/plugin/gantt/lrGantt.css") +
+
+
+
+
+
+ +
+
+  查询 +
+
+
+
+ +  新增 +  删除 +
+
+
+
+
+
+
+@Html.AppendJsFile("/Views/LR_Content/plugin/gantt/lrGantt.js", "/Areas/LR_CodeDemo/Views/GantProject/Gant.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Gant.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Gant.js new file mode 100644 index 000000000..c78fd8235 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Gant.js @@ -0,0 +1,131 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:力软-前端开发组 + * 日 期:208.11.22 + * 描 述:甘特图 + */ +var isMain = false; +var keyValue = ''; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGantt(); + page.bind(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/LR_CodeDemo/GantProject/Form', + width: 800, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 删除 + $('#lr_delete').on('click', function () { + if (learun.checkrow(keyValue)) { + var url = top.$.rootUrl + '/LR_CodeDemo/GantProject/DeleteForm'; + if (!isMain) { + url = top.$.rootUrl + '/LR_CodeDemo/GantProject/DeleteDetail' + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(url, { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + initGantt: function () { + $('#gridtable').lrGantt({ + url: top.$.rootUrl + '/LR_CodeDemo/GantProject/GetProjectList', + childUrl: top.$.rootUrl + '/LR_CodeDemo/GantProject/GetProjectDetail', + timebtns: ['month', 'week', 'day'],//'month', 'week', 'day', 'hour' + timeClick: function (data, $self) { + if (data.item.hasChildren) { + isMain = true; + } + else { + isMain = false; + } + keyValue = data.item.id; + }, + timeDoubleClick: function (data, $self) { + if (data.item.hasChildren) { + isMain = true; + } + keyValue = data.item.id; + if (isMain) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LR_CodeDemo/GantProject/Project?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(location.reload()); + } + }); + } + else { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LR_CodeDemo/GantProject/ProjectDetail?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(location.reload()); + } + }); + } + }, + click: function (item, $item) { + if (item.hasChildren) { + isMain = true; + } + else { + isMain = false; + } + keyValue = item.id; + if (isMain) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LR_CodeDemo/GantProject/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(location.reload()); + } + }); + } + } + }).lrGanttSet('reload'); + }, + search: function (param) { + $('#gridtable').lrGanttSet('reload', param || {}); + } + }; + page.init(); +} + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Index.cshtml new file mode 100644 index 000000000..2b3935970 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Index.cshtml @@ -0,0 +1,38 @@ +@{ + ViewBag.Title = "甘特图应用"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
项目名称
+ +
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/GantProject/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Index.js new file mode 100644 index 000000000..f08881315 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Index.js @@ -0,0 +1,98 @@ +/* * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:超级管理员 + * 日 期:2019-05-08 18:30 + * 描 述:甘特图应用 + */ +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 + '/LR_CodeDemo/GantProject/Form', + width: 800, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LR_CodeDemo/GantProject/Form?keyValue=' + keyValue, + width: 800, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LR_CodeDemo/GantProject/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + // 编辑 + $('#lr_gant').on('click', function () { + learun.frameTab.open({ F_ModuleId: 'gantpreview', F_Icon: 'fa fa-file-text-o', F_FullName: '项目进度', F_UrlAddress: '/LR_CodeDemo/GantProject/Gant' }); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/LR_CodeDemo/GantProject/GetPageList', + headData: [ + { label: "项目名称", name: "F_ProjectName", width: 100, align: "left" }, + { label: "项目起始", name: "F_StartTime", width: 100, align: "left" }, + { label: "项目结束", name: "F_EndTime", width: 100, align: "left" }, + { label: "备注", name: "F_Remark", width: 100, align: "left" }, + ], + mainId: 'F_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/Areas/LR_CodeDemo/Views/GantProject/Project.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Project.cshtml new file mode 100644 index 000000000..0f426146c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Project.cshtml @@ -0,0 +1,27 @@ +@{ + ViewBag.Title = "F"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
项目名称*
+ +
+
+
起始日期*
+ +
+
+
结束日期*
+ +
+
+
备注*
+ +
+
+
项目状态
+
+
+
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/GantProject/Project.js") \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Project.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Project.js new file mode 100644 index 000000000..d7df7b892 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/Project.js @@ -0,0 +1,54 @@ +/* * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:超级管理员 + * 日 期:2019-05-09 11:38 + * 描 述:F + */ +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 () { + $('#F_Status').lrRadioCheckbox({ + type: 'radio', + code: 'ProStatus', + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LR_CodeDemo/GantProject/GetGantData?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 + '/LR_CodeDemo/GantProject/SaveGant?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/ProjectDetail.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/ProjectDetail.cshtml new file mode 100644 index 000000000..d9323e418 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/ProjectDetail.cshtml @@ -0,0 +1,31 @@ +@{ + ViewBag.Title = "甘特图"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
项目名
+ +
+
+
开始日期
+ +
+
+
结束日期
+ +
+
+
备注
+ +
+
+
执行情况
+
+
+ +
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/GantProject/ProjectDetail.js") \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/ProjectDetail.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/ProjectDetail.js new file mode 100644 index 000000000..8f25fdd18 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GantProject/ProjectDetail.js @@ -0,0 +1,55 @@ + +/* * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:超级管理员 + * 日 期:2019-05-09 17:27 + * 描 述:甘特图 + */ +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 () { + $('#F_Status').lrRadioCheckbox({ + type: 'radio', + code: 'ProStatus', + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LR_CodeDemo/GantProject/GetGantDetail?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 + '/LR_CodeDemo/GantProject/SaveDetail?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index1.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index1.cshtml new file mode 100644 index 000000000..d39043864 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index1.cshtml @@ -0,0 +1,29 @@ +@{ + ViewBag.Title = "甘特图1"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@Html.AppendCssFile("/Views/LR_Content/plugin/gantt/lrGantt.css") +
+
+
+
+
+
+ +
+
+  查询 +
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Views/LR_Content/plugin/gantt/lrGantt.js", "/Areas/LR_CodeDemo/Views/GanttDemo/Index1.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index1.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index1.js new file mode 100644 index 000000000..6e3a58a90 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index1.js @@ -0,0 +1,100 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:力软-前端开发组 + * 日 期:208.11.22 + * 描 述:甘特图 + */ +var bootstrap = function ($, learun) { + "use strict"; + + var data = []; + + var page = { + init: function () { + // 初始化数据 + for (var i = 0; i < 10; i++) { + var day = new Date(); + day = day.DateAdd('d', i * 2); + var ponit = { + id: learun.newGuid(), + text: '计划任务' + (i + 1), + isexpand:false, + complete:true, + timeList: [{ + beginTime: learun.formatDate(day, 'yyyy-MM-dd'), + endTime: learun.formatDate(day.DateAdd('d', 3), 'yyyy-MM-dd'), + color: '#3286ed', + overtime: true, + text: '执行时间9天' + }, { + beginTime: learun.formatDate(day.DateAdd('d', 4), 'yyyy-MM-dd'), + endTime: learun.formatDate(day.DateAdd('d', 7), 'yyyy-MM-dd'), + color: '#1bb99a', + overtime: false, + text: '执行时间4天' + }] + } + data.push(ponit); + } + + page.initGantt(); + page.bind(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + if (keyword) { + var _data = [] + $.each(data, function (_index, _item) { + if (_item.text.indexOf(keyword) != -1) { + _data.push(_item); + } + }); + $('#gridtable').lrGanttSet('refreshdata', _data); + } + else { + $('#gridtable').lrGanttSet('refreshdata', data); + } + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + initGantt: function () { + $('#gridtable').lrGantt({ + data: data, + timeHover: function (data, flag, $self) { + // data:当前行数据 和 所在时间段数据 flag:true 移入 false 移出 $self:整个gantt对象 + if (flag) { + var _html = '
任务名称
'; + _html += '
开始时间
'; + _html += '
结束时间
'; + + $self.lrGanttSet('showinfo', _html); + } + else { + //$self.lrGanttSet('hideinfo'); + } + + }, + timebtns: ['month', 'week', 'day'],//'month', 'week', 'day', 'hour' + timeClick: function (data, $self) { + }, + timeDoubleClick: function (data, $self) { + }, + click: function (item,$item) { + } + + + }); + }, + search: function (param) { + } + }; + page.init(); +} + +// /LR_CodeDemo/GanttDemo/Index1 fa fa-reorder \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index2.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index2.cshtml new file mode 100644 index 000000000..263ad545f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index2.cshtml @@ -0,0 +1,21 @@ +@{ + ViewBag.Title = "甘特图2"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@Html.AppendCssFile("/Views/LR_Content/plugin/gantt/lrGantt.css") +
+
+
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Views/LR_Content/plugin/gantt/lrGantt.js", "/Areas/LR_CodeDemo/Views/GanttDemo/Index2.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index2.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index2.js new file mode 100644 index 000000000..d8cd97a32 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index2.js @@ -0,0 +1,83 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:力软-前端开发组 + * 日 期:208.11.22 + * 描 述:甘特图 + */ +var bootstrap = function ($, learun) { + "use strict"; + + var data = []; + + var page = { + init: function () { + // 初始化数据 + for (var i = 0; i < 10; i++) { + var day = new Date(); + day = day.DateAdd('d', i * 2); + var ponit = { + id: learun.newGuid(), + text: '计划任务' + (i + 1), + isexpand: false, + complete: true, + timeList: [{ + beginTime: learun.formatDate(day, 'yyyy-MM-dd'), + endTime: learun.formatDate(day.DateAdd('d', 8), 'yyyy-MM-dd'), + color: '#3286ed', + overtime: true, + text: '执行时间9天' + }], + hasChildren: true, + children: [{ + id: learun.newGuid(), + text: '计划任务' + (i + 1) + '.1', + isexpand: false, + complete: true, + timeList: [{ + beginTime: learun.formatDate(day, 'yyyy-MM-dd'), + endTime: learun.formatDate(day.DateAdd('d', 3), 'yyyy-MM-dd'), + color: '#1bb99a', + overtime: true, + text: '执行时间4天' + }] + }, + { + id: learun.newGuid(), + text: '计划任务' + (i + 1) + '.2', + isexpand: false, + complete: true, + timeList: [{ + beginTime: learun.formatDate(day.DateAdd('d', 4), 'yyyy-MM-dd'), + endTime: learun.formatDate(day.DateAdd('d', 8), 'yyyy-MM-dd'), + color: '#E4474D', + overtime: true, + text: '执行时间5天' + }] + }] + } + data.push(ponit); + } + + page.initGantt(); + page.bind(); + }, + bind: function () { + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + initGantt: function () { + $('#gridtable').lrGantt({ + data: data, + timebtns: ['month', 'week', 'day'],//'month', 'week', 'day', 'hour' + }); + }, + search: function (param) { + } + }; + page.init(); +} + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index3.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index3.cshtml new file mode 100644 index 000000000..e27ccefb2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index3.cshtml @@ -0,0 +1,29 @@ +@{ + ViewBag.Title = "甘特图3"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@Html.AppendCssFile("/Views/LR_Content/plugin/gantt/lrGantt.css") +
+
+
+
+
+
+ +
+
+  查询 +
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Views/LR_Content/plugin/gantt/lrGantt.js", "/Areas/LR_CodeDemo/Views/GanttDemo/Index3.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index3.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index3.js new file mode 100644 index 000000000..a6d9db196 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index3.js @@ -0,0 +1,40 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:力软-前端开发组 + * 日 期:208.11.22 + * 描 述:甘特图 + */ +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGantt(); + page.bind(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + initGantt: function () { + $('#gridtable').lrGantt({ + url: top.$.rootUrl + '/LR_CodeDemo/GanttDemo/GetTimeList', + childUrl: top.$.rootUrl + '/LR_CodeDemo/GanttDemo/GetTimeList', + timebtns: ['month', 'week', 'day'],//'month', 'week', 'day', 'hour' + }).lrGanttSet('reload'); + }, + search: function (param) { + $('#gridtable').lrGanttSet('reload', param || {}); + } + }; + page.init(); +} + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index4.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index4.cshtml new file mode 100644 index 000000000..ae2736568 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index4.cshtml @@ -0,0 +1,29 @@ +@{ + ViewBag.Title = "甘特图4"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@Html.AppendCssFile("/Views/LR_Content/plugin/gantt/lrGantt.css") +
+
+
+
+
+
+ +
+
+  查询 +
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Views/LR_Content/plugin/gantt/lrGantt.js", "/Areas/LR_CodeDemo/Views/GanttDemo/Index4.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index4.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index4.js new file mode 100644 index 000000000..f45a898d2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/GanttDemo/Index4.js @@ -0,0 +1,42 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:力软-前端开发组 + * 日 期:208.11.22 + * 描 述:甘特图 + */ +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGantt(); + page.bind(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + initGantt: function () { + $('#gridtable').lrGantt({ + url: top.$.rootUrl + '/LR_CodeDemo/GanttDemo/GetPageList', + childUrl: top.$.rootUrl + '/LR_CodeDemo/GanttDemo/GetTimeList', + isPage: true, + rows: 30, + timebtns: ['month', 'week', 'day'],//'month', 'week', 'day', 'hour' + }).lrGanttSet('reload'); + }, + search: function (param) { + $('#gridtable').lrGanttSet('reload', param || {}); + } + }; + page.init(); +} + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo1.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo1.cshtml new file mode 100644 index 000000000..a4946b37f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo1.cshtml @@ -0,0 +1,35 @@ +@{ + ViewBag.Title = "图片展示"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+ +
+
+
+
+
+
+
+ +@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/ImgShow/Demo1.js") + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo1.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo1.js new file mode 100644 index 000000000..a07373f0d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo1.js @@ -0,0 +1,22 @@ +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + }, + bind: function () { + // 打印 + $('.node').on('click', function () { + var stockArea = $(this).attr("data-value"); + learun.layerForm({ + id: 'form', + title:'A'+ stockArea+'仓位库存信息', + url: top.$.rootUrl + '/LR_CodeDemo/StockDemo/Stock?stockArea=' + stockArea, + width: 600, + height: 400 + }); + }); + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo2.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo2.cshtml new file mode 100644 index 000000000..25c40cb3e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo2.cshtml @@ -0,0 +1,20 @@ +@{ + ViewBag.Title = "图片展示"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+ +
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/ImgShow/Demo2.js") + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo2.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo2.js new file mode 100644 index 000000000..436a06c11 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo2.js @@ -0,0 +1,11 @@ +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + }, + bind: function () { + } + }; + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo3.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo3.cshtml new file mode 100644 index 000000000..f49e829e7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo3.cshtml @@ -0,0 +1,42 @@ +@{ + ViewBag.Title = "图片展示"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+ + +
冲压产线
+
已完成:750
+
未完成:300
+
涂装产线
+
已完成:450
+
未完成:550
+
焊接产线
+
已完成:587
+
未完成:582
+
总装产线
+
已完成:150
+
未完成:910
+ +
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/ImgShow/Demo3.js") + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo3.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo3.js new file mode 100644 index 000000000..cf4bee0b5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/ImgShow/Demo3.js @@ -0,0 +1,27 @@ +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + page.loaddata(); + }, + bind: function () { + }, + loaddata: function () { + learun.httpAsyncGet(top.$.rootUrl + '/LR_CodeDemo/WorkOrder/GetList',function (data) { + if (!!data) { + console.log('data', data.data[0]['01']); + $("#line1-1").html('未完成:' + data.data[0]['1-1']); + $("#line1-2").html('已完成:' + data.data[0]['1-2']); + $("#line2-1").html('未完成:' + data.data[0]['2-1']); + $("#line2-2").html('已完成:' + data.data[0]['2-2']); + $("#line3-1").html('未完成:' + data.data[0]['3-1']); + $("#line3-2").html('已完成:' + data.data[0]['3-2']); + $("#line4-1").html('未完成:' + data.data[0]['4-1']); + $("#line4-2").html('已完成:' + data.data[0]['4-2']); + } + }); + } + }; + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Form.cshtml new file mode 100644 index 000000000..4dc0fab15 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Form.cshtml @@ -0,0 +1,23 @@ +@{ + ViewBag.Title = "库存"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
物料名称*
+ +
+
+
库存数量*
+ +
+
+
库存单位
+ +
+
+
存放库位*
+
+
+
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/StockDemo/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Form.js new file mode 100644 index 000000000..a75675886 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Form.js @@ -0,0 +1,51 @@ +/* * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:超级管理员 + * 日 期:2019-06-12 18:49 + * 描 述:库存 + */ +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 () { + $('#F_Area').lrDataItemSelect({ code: 'StockArea' }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LR_CodeDemo/StockDemo/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 + '/LR_CodeDemo/StockDemo/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Index.cshtml new file mode 100644 index 000000000..0b8d29af8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Index.cshtml @@ -0,0 +1,45 @@ +@{ + ViewBag.Title = "库存"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
物料名称
+ +
+
+
库存单位
+ +
+
+
存放库位
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/StockDemo/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Index.js new file mode 100644 index 000000000..010df78a8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Index.js @@ -0,0 +1,104 @@ +/* * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:超级管理员 + * 日 期:2019-06-12 18:49 + * 描 述:库存 + */ +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); + }, 190, 400); + $('#F_Area').lrDataItemSelect({ code: 'StockArea' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/LR_CodeDemo/StockDemo/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LR_CodeDemo/StockDemo/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LR_CodeDemo/StockDemo/DeleteForm', { keyValue: keyValue}, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/LR_CodeDemo/StockDemo/GetPageList', + headData: [ + { label: "物料名称", name: "F_ItemName", width: 100, align: "left"}, + { label: "库存数量", name: "F_Qty", width: 100, align: "left"}, + { label: "库存单位", name: "F_Unit", width: 100, align: "left"}, + { label: "存放库位", name: "F_Area", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StockArea', + callback: function (_data) { + callback(_data.text); + } + }); + }}, + ], + mainId:'F_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/Areas/LR_CodeDemo/Views/StockDemo/Stock.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Stock.cshtml new file mode 100644 index 000000000..fb4a8046a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Stock.cshtml @@ -0,0 +1,10 @@ +@{ + ViewBag.Title = "库存"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/StockDemo/Stock.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Stock.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Stock.js new file mode 100644 index 000000000..18348ada9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/StockDemo/Stock.js @@ -0,0 +1,50 @@ +/* * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:超级管理员 + * 日 期:2019-06-12 18:49 + * 描 述:库存 + */ +var stockArea = request('stockArea'); +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LR_CodeDemo/StockDemo/GetStock?stockArea=' + stockArea, + headData: [ + { label: "物料名称", name: "F_ItemName", width: 100, align: "left"}, + { label: "库存数量", name: "F_Qty", width: 100, align: "left"}, + { label: "库存单位", name: "F_Unit", width: 100, align: "left"}, + { label: "存放库位", name: "F_Area", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StockArea', + callback: function (_data) { + callback(_data.text); + } + }); + }}, + ], + mainId:'F_Id', + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload'); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Form.cshtml new file mode 100644 index 000000000..9df5bc7f9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Form.cshtml @@ -0,0 +1,35 @@ +@{ + ViewBag.Title = "工单管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
工单编码*
+ +
+
+
生产部门
+
+
+
+
负责人*
+ +
+
+
生产数量*
+ +
+
+
工单制程
+
+
+
+
规格型号
+ +
+
+
完工状态
+
+
+
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/WorkOrder/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Form.js new file mode 100644 index 000000000..280ab92de --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Form.js @@ -0,0 +1,124 @@ +/* * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:超级管理员 + * 日 期:2019-06-10 17:21 + * 描 述:工单管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var bootstrap = function ($, learun) { + "use strict"; + // 设置权限 + setAuthorize = function (data) { + if(!!data) + { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#F_DepartmentId').lrselect({ + type: 'tree', + allowSearch: true, + url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', + param: {} + }); + $('#F_Process').lrDataItemSelect({ code: 'Process' }); + $('#F_Status').lrDataItemSelect({ code: 'HaveOrNot' }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LR_CodeDemo/WorkOrder/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id ).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + }; + // 设置表单数据 + setFormData = function (processId,param,callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/LR_CodeDemo/WorkOrder/GetFormDataByProcessId?processId=' + processId, function (data) { + for (var id in data) { + if (!!data[id] && data[id].length > 0) { + $('#' + id ).jfGridSet('refreshdata', data[id]); + } + else { + if(id == 'LR_Demo_WorkOrder' && data[id] ){ + keyValue = data[id].F_Id; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); } + // 验证数据是否填写完整 + validForm = function () { + if (!$('body').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + + learun.layerConfirm("注:您确定要保存吗?", function (r) { + if (r) { + var formData = $('body').lrGetFormData(); + if (!!processId) { + formData.F_Id = processId; + } + var postData = { + strEntity: JSON.stringify(formData) + }; + $.lrSaveForm(top.$.rootUrl + '/LR_CodeDemo/WorkOrder/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, i); + } + }); + alert('同意退出'); + } + else { + + alert('不同意'); + } + + }); + + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Index.cshtml new file mode 100644 index 000000000..09361172a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Index.cshtml @@ -0,0 +1,59 @@ +@{ + ViewBag.Title = "工单管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
树形列表
+
+
+
+
+
+
+ 列表信息 +
+
+
+
+
+
+
+
工单编码
+ +
+
+
生产部门
+
+
+
+
负责人
+ +
+
+
工单制程
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LR_CodeDemo/Views/WorkOrder/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Index.js new file mode 100644 index 000000000..6ac49e4b5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_CodeDemo/Views/WorkOrder/Index.js @@ -0,0 +1,183 @@ +/* * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:超级管理员 + * 日 期:2019-06-10 17:21 + * 描 述:工单管理 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var processId = ''; + var page = { + init: function () { + page.initGird(); + page.bind(); + //setTimeout(" $('#dataTree [tpath=0]').trigger('click')", 1000) + }, + bind: function () { + // 初始化左侧树形数据 + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/LR_CodeDemo/WorkOrder/GetTree', + nodeClick: function (item) { + page.search({ F_DepartmentId: item.value }); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#F_DepartmentId').lrDepartmentSelect(); + $('#F_Process').lrDataItemSelect({ code: 'Process' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/LR_CodeDemo/WorkOrder/Form', + width: 600, + height: 400, + callBack: function (id) { + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + processId = learun.newGuid(); + res = top[id].save(processId, refreshGirdData); + } + return res; + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LR_CodeDemo/WorkOrder/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + res = top[id].save('', function () { + page.search(); + }); + } + return res; + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LR_CodeDemo/WorkOrder/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + // 套打 + $('#lr_printItem').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_Id'); + if (learun.checkrow(keyValue)) { + learun.frameTab.open({ + F_ModuleId: 'report', + F_Icon: 'fa magic', + F_FullName: '工单套打', + F_UrlAddress: '/LR_ReportModule/RptManage/Report?reportId=' + encodeURI(encodeURI("制程工单.rdlx|" + keyValue)) + '&isPrint=1' + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/LR_CodeDemo/WorkOrder/GetPageList', + headData: [ + { label: "工单编码", name: "F_Code", width: 200, align: "left" }, + { + label: "生产部门", name: "F_DepartmentId", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('department', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + } + }, + { label: "负责人", name: "F_ManagerId", width: 100, align: "left" }, + { label: "生产数量", name: "F_Qty", width: 100, align: "left" }, + { + label: "工单制程", name: "F_Process", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'Process', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "规格型号", name: "F_Spec", width: 150, align: "left" }, + { + label: "完工状态", name: "F_Status", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'HaveOrNot', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + ], + mainId: 'F_Id', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function (res, postData) { + if (!!res) { + if (res.code == 200) + { + // 发起流程 + var postData = { + schemeCode:'wf001',// 填写流程对应模板编号 + processId:processId, + level:'1', + }; + learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function(data) { + learun.loading(false); + }); + } + page.search(); + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/StampDetailIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/StampDetailIndex.js index c51f8729c..9c09a4ce1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/StampDetailIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/StampDetailIndex.js @@ -60,7 +60,6 @@ var bootstrap = function ($, learun) { var postData = $('.lr-item').lrGetFormData(); var F_Password = $.md5(postData.F_Password); learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/EqualForm', { keyValue: keyValue, Password: F_Password }, function (res) { - console.log(keyValue); callBack(keyValue); }); }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ScheduleController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ScheduleController.cs index d6f39b3f8..b06878f92 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ScheduleController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ScheduleController.cs @@ -104,7 +104,6 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers [AjaxOnly] public ActionResult SaveForm(string keyValue, ScheduleEntity entity) { - scheduleIBLL.SaveForm(keyValue, entity); var startTime = entity.F_StartDate.ToDate(); var endTime = entity.F_EndDate.ToDate(); if (startTime < DateTime.Now.Date) @@ -116,6 +115,7 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers { return Fail("结束时间不能早与开始时间"); } + scheduleIBLL.SaveForm(keyValue, entity); return Success("操作成功。"); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Signet/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Signet/Index.cshtml index a1a6d0ce7..41fcbc02a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Signet/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Signet/Index.cshtml @@ -2,13 +2,20 @@ ViewBag.Title = "电子签章"; Layout = "~/Views/Shared/_ReportTemplate.cshtml"; } -
+ + +
+ + + +
+
- +
-

xxxxxxxxxxxxxxxxxxxxxxx

-

电话:010-8888888  传真:010-8888888

+

上海市浦东新区世纪大道108号

+

电话:021-8888888  传真:021-8888888

报  价  单 @@ -184,11 +191,14 @@
- - +@Html.AppendJsFile("/Areas/LR_OAModule/Views/Signet/Index.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Signet/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Signet/Index.js new file mode 100644 index 000000000..e4c57737b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Signet/Index.js @@ -0,0 +1,56 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人: + * 日 期:2018.11.10 + * 描 述:电子签章 + */ +var selectedRow; +var refreshGirdData; +var keyValue; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + }, + bind: function () { + $('.add').on('click', function () { + learun.layerForm({ + id: 'StampDetailIndex', + title: '印章列表', + url: top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/StampDetailIndex', + width: 1050, + height: 600, + callBack: function (id) { + return top[id].acceptClick(function (imgutl) { + keyValue = imgutl; + $(".price-box").lrSign({//电子签章调用插件 + img: top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetImg?keyValue=' + imgutl + }); + }); + } + }); + }); + $(".price-box").on("click", ".sure", function () { + learun.layerForm({ + id: 'EqualForm', + title: '密码验证', + url: top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/EqualForm?keyValue=' + keyValue, + width: 360, + height: 140, + callBack: function (id) { + return top[id].acceptClick(function () { + $("div.sign").addClass('ok').off('mousedown').find('.btn').remove(); + + }); + } + }); + }); + $('.print').on('click', function () {//电子签章打印 + $('.price-box').jqprint(); + }); + } + } + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/imgshow/有货架图1.jpg b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/imgshow/有货架图1.jpg new file mode 100644 index 000000000..09ecc4e05 Binary files /dev/null and b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/imgshow/有货架图1.jpg differ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/imgshow/有货架图2.jpg b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/imgshow/有货架图2.jpg new file mode 100644 index 000000000..ebd63e481 Binary files /dev/null and b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/imgshow/有货架图2.jpg differ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/imgshow/流程_有车_显示屏.jpg b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/imgshow/流程_有车_显示屏.jpg new file mode 100644 index 000000000..97154ef8e Binary files /dev/null and b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/imgshow/流程_有车_显示屏.jpg differ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/signet/jquery.zsign.css b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/signet/jquery.zsign.css index d5562f3a0..1d38e7c62 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/signet/jquery.zsign.css +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/signet/jquery.zsign.css @@ -1,72 +1,73 @@ -.zsign .panels -{ +.panels { position: absolute; top: 22px; right: 8px; } -.zsign .btn -{ - margin-right:5px; -} -.zsign .btn[disabled] -{ - cursor: default; - background-image: none; - background-color: #E6E6E6; - opacity: 0.65; - filter: alpha(opacity=65); - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} -.zsign .cursor -{ - cursor: none; -} -.zsign .show -{ - display: block; -} -.zsign .hide -{ - display: none; +.zsign { + position: relative; } -.zsign .sign -{ - position: absolute; - cursor: move; - border: 1px dashed #ccc; - padding: 8px; - display: -webkit-box; - -webkit-box-pack: center; - -webkit-box-align: center; -} -.zsign .sign.ok -{ - cursor: default; - border-color:transparent; -} -.zsign .sign img -{ - max-height: 100%; - max-width: 100%; -} -.zsign .sign .btn -{ - padding: 2px 6px; - font-size: 11px; - line-height: 14px; - position: absolute; -} + .zsign .btn { + margin-right: 5px; + } -.zsign .sign .btn.del -{ - bottom: 4px; - right: 4px; -} -.zsign .sign .btn.ok -{ - bottom: 4px; - right: 50px; + .zsign .btn[disabled] { + cursor: default; + background-image: none; + background-color: #E6E6E6; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + + .zsign .cursor { + cursor: none; + } + + .zsign .show { + display: block; + } + + .zsign .hide { + display: none; + } + + .zsign .sign { + position: absolute; + cursor: move; + border: 1px dashed #ccc; + padding: 8px; + display: -webkit-box; + -webkit-box-pack: center; + -webkit-box-align: center; + } + + .zsign .sign.ok { + cursor: default; + border-color: transparent; + } + + .zsign .sign img { + max-height: 100%; + max-width: 100%; + } + + .zsign .sign .btn { + padding: 2px 6px; + font-size: 11px; + line-height: 14px; + position: absolute; + } + + .zsign .sign .btn.del { + bottom: 4px; + right: 4px; + } + + .zsign .sign .btn.ok { + bottom: 4px; + right: 50px; + } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/signet/jquery.zsign.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/signet/jquery.zsign.js index dfd76e082..043a52a6e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/signet/jquery.zsign.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/signet/jquery.zsign.js @@ -4,7 +4,7 @@ date:2012-11-08 */ -;$.fn.zSign = function (options) { +; $.fn.zSign = function (options) { var _s = $.extend({ img: '', width: 150, @@ -27,6 +27,7 @@ var _add = $('.add', _btnPanel).click(function (e) { _add.attr('disabled', 'disabled'); + var sign = $(_html).appendTo(_parent); $('.ok', sign).click(function () { //确定盖章 @@ -62,7 +63,7 @@ }); }); - $('.cancel', _btnPanel).click(function () { + $('.cancel', _btnPanel).click(function () { var r = true; if (_add.attr('disabled') == 'disabled') { if (!confirm("未确定的盖章将被取消,确定要关闭吗?")) { @@ -75,4 +76,63 @@ _btnPanel.remove(); } }); +}; + + +$.fn.lrSign = function (options) { + var _s = $.extend({ + img: '', + width: 150, + height: 150, + offset: 30, //边界值 + callBack: null + }, options || {}); + + var _parent = $(this); + var range = { + minX: _s.offset, + minY: _s.offset, + maxX: $(window).width(), //扣去2个padding=8px以及2个边框1px + maxY: $(window).height() + }; + + + + var _html = "
"; + var sign = $(_html).appendTo(_parent); + //$('.ok', sign).click(function () { + // //确定盖章 + // sign.addClass('ok').off('mousedown').find('.btn').remove(); + // // _add.removeAttr('disabled'); + // if (_s.callBack) { + // _s.callBack.call(this, { img: _s.img, top: parseInt(sign.css('top')), left: parseInt(sign.css('left')) }); + // } + //}); + $('.del', sign).click(function () { + //取消盖章 + sign.remove(); + //_add.removeAttr('disabled'); + }); + //绑定移动事件 + sign.on('mousedown', function (e) { + sign.data('x', e.clientX); + sign.data('y', e.clientY); + var position = sign.position(); + $(document).on('mousemove', function (e1) { + var x = e1.clientX - sign.data('x') + position.left; + var y = e1.clientY - sign.data('y') + position.top; + x = x < range.minX ? range.minX : x; + x = x > range.maxX ? range.maxX : x; + y = y < range.minY ? range.minY : y; + y = y > range.maxY ? range.maxY : y; + + sign.css({ left: x, top: y }); + }).on('mouseup', function () { + $(this).off('mousemove').off('mouseup'); + }); + }); + //取消 + $('.cancel').click(function () { + $('div.sign').remove();//移除当前确定的图片 + }); }; \ No newline at end of file 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 312fb0f27..f68b8bdd0 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 @@ -379,7 +379,12 @@ + + + + + @@ -1144,9 +1149,26 @@ + + + + + + + + + + + + + + + + + @@ -1234,6 +1256,7 @@ + @@ -1646,6 +1669,9 @@ + + + @@ -3722,6 +3748,8 @@ + + @@ -6730,6 +6758,23 @@ + + + + + + + + + + + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/gantt/lrGantt.css b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/gantt/lrGantt.css new file mode 100644 index 000000000..b05cdac4f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/gantt/lrGantt.css @@ -0,0 +1,519 @@ +.lr-gantt { + position: relative; + width: 100%; + height: 100%; + padding: 36px 0; +} + + .lr-gantt.lr-gantt-nopage { + padding-bottom: 0px; + } + + .lr-gantt.lr-gantt-nopage .lr-gantt-footer { + display: none; + } + +.lr-gantt-title { + position: absolute; + width: 100%; + height: 36px; + border-bottom: 1px solid #ccc; + left: 0; + top: 0; + padding-left: 15px; +} + +.lr-gantt-title-text { + position: relative; + height: 35px; + line-height: 35px; + float: left; +} + +.lr-gantt-title .btn-group { + margin-top: 3.5px; + margin-left: 5px; +} + +.lr-gantt-title .btn-group-sm > .btn { + padding: 3px 10px; +} + +.lr-gantt-title .btn-default:hover, .lr-gantt-title .btn-default.active { + color: #fff; + background-color: #3286ed; + border-color: transparent; +} + +.lr-gantt-footer { + position: absolute; + width: 100%; + height: 36px; + border-top: 1px solid #ccc; + left: 0; + bottom: 0; +} + +.lr-gantt-body { + position: relative; + width: 100%; + height: 100%; + padding-left: 200px; +} +.lr-gantt-showtext-active .lr-gantt-body { + padding-right: 200px; +} + + .lr-gantt-left { + position: absolute; + width: 200px; + height: 100%; + border-right: 1px solid #ccc; + top: 0; + left: 0; + padding-top: 49px; + } + +.lr-gantt-left-content { + position: relative; + width: 100%; + height: 100%; + border-top: 1px solid #ccc; +} + +.lr-gantt-right { + position: relative; + width: 100%; + height: 100%; + padding-top: 50px; + overflow: hidden; +} + +.lr-gantt-rightheader { + position: absolute; + top: 0; + left: 0; + min-width: 100%; + height: 50px; +} + +.lr-gantt-rightheader-months, .lr-gantt-rightheader-days { + position: relative; + height: 25px; + width: 100%; + border-bottom: 1px solid #ccc; +} + +.lr-gantt-rightheader-month { + position: relative; + height: 24px; + line-height: 24px; + border-right: 1px solid #ccc; + text-align: center; + float: left; + overflow: hidden; +} + +.lr-gantt-rightheader-day { + position: relative; + height: 24px; + line-height: 24px; + width: 28px; + border-right: 1px solid #ccc; + text-align: center; + float: left; +} + .lr-gantt-rightheader-day.lr-gantt-weekend { + color: #ff5d48; + } + + +.lr-gantt-grid-row { + width: 100%; +} + .lr-gantt-grid-row:nth-of-type(even) .lr-gantt-grid-row-cell { + background-color: #f5f5f5; + } + + + .lr-gantt-grid-row-cell { + height: 25px; + width: 28px; + border-right: 1px solid #f0f0f0; + border-bottom: 1px solid #f0f0f0; + float: left; + } + + + +.lr-gantt-blocks { + position: absolute; + z-index: 2; + top: 0; + left: 0; + width: 100%; +} + +.lr-gantt-block-container { + position: relative; + width: 100%; + height: 25px; +} + +.lr-gantt-block { + position: absolute; + top: 2px; + left: 0; + height: 20px; + border: 1px solid #ccc; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + cursor: pointer; +} + +.lr-gantt-block-text { + position: relative; + width: 100%; + height: 18px; + line-height: 18px; + padding-left: 5px; + font-size: 12px; + color: #fff; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + + +.lr-gantt-block-icon { + position: absolute; + top: 0; + right: -18px; + height: 18px; + line-height:18px; + width: 18px; + text-align: center; + color: #ff5d48; + font-size:14px; + cursor:pointer; +} +.lr-gantt-showtext { + position: absolute; + top: 0; + right: 0; + width: 200px; + height: 100%; + border-left:1px solid #ccc; + display:none; +} + .lr-gantt-showtext.active { + display: block; + } +.lr-gantt-showtext-title-remove { + position: absolute; + top: 0; + right: 4px; + z-index: 1; + cursor: pointer; + color: #333; + font-size:16px; +} +.lr-gantt-showtext-content { + position: relative; + width: 100%; + height: 100%; + padding: 6px 6px 0 6px; +} +.lr-gantt-showtext .title { + height: 28px; + line-height: 28px; +} +.lr-gantt-showtext .text, .lr-gantt-showtext .textarea { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075); + -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; + color: #000; + border-radius: 0; + box-shadow: none; + font-size: 9pt; + height: 28px; + padding-top: 0; + padding-bottom: 1px; + padding-right: 0; + padding-left: 5px; + resize: none; + border-radius: 2px; +} +.lr-gantt-showtext .textarea { + height:200px; +} + /*翻页条*/ + .lr-gantt-page-bar { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + -khtml-user-select: none; + user-select: none; + position: relative; + bottom: 0; + left: 0; + width: 100%; + height: 35px; + background-color: #fff; + border-radius: 0px 0px 3px 3px; + z-index: 5; + } + +.lr-gantt-page-bar-info { + position: absolute; + top: 0; + left: 10px; + font-size: 12px; + height: 100%; + line-height: 34px; + color: #475059; +} + + .lr-gantt-page-bar-info > span { + position: relative; + top: -1px; + color: #475059; + } + +.lr-gantt-page-bar .paginations { + margin: 0px; + position: absolute; + right: 4px; + top: 4px; + height: 26px; + line-height: 26px; +} + +.lr-gantt-page-bar .pagination input { + display: block; + top: 0; + left: 0; + height: 26px; + margin: 0; + top: 0; + border-radius: 4px; + width: 45px; + line-height: 1.5; + position: relative; + float: left; + text-align: center; +} + +.lr-gantt-page-bar .pagination { + margin: 0px; +} + + .lr-gantt-page-bar .pagination > li > a, .pagination > li > span { + color: #475059; + } + +.lr-gantt-page-bar .pagination-sm > li > a { + padding: 3px 8px; + font-size: 12px; + line-height: 1.5; +} + +.lr-gantt-page-bar .pagination > li > span { + padding: 3px 0px; + font-size: 12px; + line-height: 1.5; + border: 0px; +} + +.pagination > li > a.active, +.pagination > li > a:focus { + color: #ffffff; + background-color: #3498DB; + border-color: #3498DB; +} + +.pagination > li > span.active, +.pagination > li > span:focus { + color: #475059; +} + +.pagination > li > span:hover { + background-color: #fff; + color: #475059; +} + +/*没数据的情况下显示图片*/ +.lr-gantt-nodata-img { + position: absolute; + top: 50%; + left: 50%; + height: 180px; + width: 380px; + margin: -90px 0px 0px -190px; + z-index: 1; + display: none; +} + + +/*调动左侧框大小的滑块*/ +.lr-gantt-move { + position: absolute; + top: 0; + z-index: 1; + right: -4px; + width: 8px; + height: 100%; + cursor: col-resize; +} + +/*左侧树形数据*/ +.lr-gantt-left ul, +.lr-gantt-left li { + list-style-type: none; + margin: 0px; + padding: 0px; +} + +.lr-gantt-tree-icon, +.lr-gantt-tree-ec-icon, +.lr-gantt-tree-node-cb, +.lr-gantt-tree-node-icon { + border: 0 none; + height: 18px; + margin: 0; + padding: 0; + margin-top: 3px; + vertical-align: top; + width: 16px; + background-repeat: no-repeat; +} + +.lr-gantt-tree-node-cb { + height: 16px; + padding: 2px; + margin-top: 4.5px; + margin-right: 5px; +} + +ul.lr-gantt-tree-node-ct { + line-height: 0; + zoom: 1; +} + +.lr-gantt-tree-node-expanded > .lr-gantt-tree-ec-icon { + background-image: url(/Content/images/learuntree/arrows.gif) !important; + background: transparent no-repeat -16px 0; +} + + .lr-gantt-tree-node-expanded > .lr-gantt-tree-ec-icon:hover { + background: transparent no-repeat -48px 0; + } + +.lr-gantt-tree-node-collapsed > .lr-gantt-tree-ec-icon { + background-image: url(/Content/images/learuntree/arrows.gif) !important; + background: transparent no-repeat 0px 0; +} + + .lr-gantt-tree-node-collapsed > .lr-gantt-tree-ec-icon:hover { + background: transparent no-repeat -32px 0; + } + +.lr-gantt-tree-node { + white-space: nowrap; + color: #000; +} + +.lr-gantt-tree-node { + color: #000; +} + + .lr-gantt-tree-node i { + font-size: 13px; + width: 13px; + color: #666666; + } + + .lr-gantt-tree-node a { + text-decoration: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + -khtml-user-select: none; + user-select: none; + -kthml-user-focus: normal; + -moz-user-focus: normal; + -moz-outline: 0 none; + outline: 0 none; + } + + .lr-gantt-tree-node a span { + text-decoration: none; + padding: 1px 3px 1px 2px; + } + + .lr-gantt-tree-node a:hover { + text-decoration: none; + } + + .lr-gantt-tree-node .lr-gantt-tree-selected { + background-color: #2F94EE !important; + color: #fff; + } + + .lr-gantt-tree-node .lr-gantt-tree-selected a span { + color: #fff; + } + + .lr-gantt-tree-node .lr-gantt-tree-selected i { + color: #fff; + } + +.lr-gantt-tree-node-el { + position: relative; + line-height: 24px; + cursor: default; + cursor: pointer; + border-bottom: 1px solid #f0f0f0; + background-color: #fff; +} + +.lr-gantt-tree-node:nth-of-type(even) > .lr-gantt-tree-node-el { + background-color: #f5f5f5; +} +.lr-gantt-tree-node:nth-of-type(odd) > .lr-gantt-tree-node-ct > .lr-gantt-tree-node:nth-of-type(odd) > .lr-gantt-tree-node-el { + background-color: #f5f5f5; +} +.lr-gantt-tree-node:nth-of-type(odd) > .lr-gantt-tree-node-ct > .lr-gantt-tree-node:nth-of-type(even) > .lr-gantt-tree-node-el { + background-color: #fff; +} + + .lr-gantt-tree-node-el:hover { + background-color: #eee; + } + +.lr-gantt-tree-loading { + position: absolute; + top: 3px; + right: 5px; + display: none; +} + + .lr-gantt-tree-loading > img { + height: 14px; + width: 14px; + } + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/gantt/lrGantt.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/gantt/lrGantt.js new file mode 100644 index 000000000..8953a4da8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/gantt/lrGantt.js @@ -0,0 +1,1154 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:力软-前端开发组 + * 日 期:2018.11.22 + * 描 述:甘特图 + */ +(function ($, learun) { + "use strict"; + + //+--------------------------------------------------- + //| 日期计算 + //+--------------------------------------------------- + Date.prototype.DateAdd = function (strInterval, Number) { + var dtTmp = this; + switch (strInterval) { + case 's': return new Date(Date.parse(dtTmp) + (1000 * Number));// 秒 + case 'n': return new Date(Date.parse(dtTmp) + (60000 * Number));// 分 + case 'h': return new Date(Date.parse(dtTmp) + (3600000 * Number));// 小时 + case 'd': return new Date(Date.parse(dtTmp) + (86400000 * Number));// 天 + case 'w': return new Date(Date.parse(dtTmp) + ((86400000 * 7) * Number));// 星期 + case 'q': return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number * 3, dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());// 季度 + case 'm': return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number, dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());// 月 + case 'y': return new Date((dtTmp.getFullYear() + Number), dtTmp.getMonth(), dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());// 年 + } + } + //+--------------------------------------------------- + //| 比较日期差 dtEnd 格式为日期型或者 有效日期格式字符串 + //+--------------------------------------------------- + Date.prototype.DateDiff = function (strInterval, dtEnd) { + var dtStart = this; + if (typeof dtEnd == 'string')//如果是字符串转换为日期型 + { + dtEnd = learun.parseDate(dtEnd); + } + switch (strInterval) { + case 's': return parseInt((dtEnd - dtStart) / 1000); + case 'n': return parseInt((dtEnd - dtStart) / 60000); + case 'h': return parseInt((dtEnd - dtStart) / 3600000); + case 'd': return parseInt((dtEnd - dtStart) / 86400000); + case 'w': return parseInt((dtEnd - dtStart) / (86400000 * 7)); + case 'm': return (dtEnd.getMonth() + 1) + ((dtEnd.getFullYear() - dtStart.getFullYear()) * 12) - (dtStart.getMonth() + 1); + case 'y': return dtEnd.getFullYear() - dtStart.getFullYear(); + } + } + //+--------------------------------------------------- + //| 取得当前日期所在月的最大天数 + //+--------------------------------------------------- + Date.prototype.MaxDayOfDate = function () { + var myDate = this; + var date1 = learun.parseDate(learun.formatDate(myDate, 'yyyy-MM-01 00:00:00')); + var date2 = date1.DateAdd('m', 1); + var result = date1.DateDiff('d', date2); + return result; + } + //--------------------------------------------------- + // 判断闰年 + //--------------------------------------------------- + Date.prototype.isLeapYear = function () { + return (0 == this.getYear() % 4 && ((this.getYear() % 100 != 0) || (this.getYear() % 400 == 0))); + } + + var _gantt = { + init: function ($self, op) { + + $self.addClass('lr-gantt'); + var $title = $('
\ +
时间维度:
\ +
\ +
\ +
'); + $.each(op.timebtns, function (_index, _item) { + switch (_item) { + case 'month': + $title.find('.btn-group-sm').append(''); + break; + case 'week': + $title.find('.btn-group-sm').append(''); + break; + case 'day': + $title.find('.btn-group-sm').append(''); + break; + case 'hour': + $title.find('.btn-group-sm').append(''); + break; + } + }); + + + var $footer = $(''); + var $body = $('
').css({ 'padding-left': op.leftWidh }); + + var $left = $('
').css({ width: op.leftWidh }); // 左侧显示区域 + var $right = $('
\ +
\ +
\ +
\ +
'); // 右侧显示区域 + + $left.append('
'); // 左右移动滑块 + $right.append('
'); + + $body.append('
\ +
\ +
\ +
'); + + op._row = 0; + + _gantt.initTitle($title, op); + _gantt.initFooter($footer, $self, op); + + _gantt.initLeft($left, $self, op); + _gantt.initRight($right, $self, op); + + _gantt.initMove($self); + _gantt.initShow($body); + + $body.append($left); + $body.append($right); + + $self.append($title); + $self.append($body); + $self.append($footer); + + // 绘制数据 + _gantt.renderData($self, op); + + // 加载后台数据 + // _gantt.loadData($self, op); + + $title = null; + $body = null; + $footer = null; + $left = null; + $right = null; + $self = null; + }, + initShow: function ($body) { + $body.find('.lr-gantt-showtext-content').lrscroll(); + $body.find('.lr-gantt-showtext-title-remove').on('click', function () { + var $this = $(this); + $this.parent().removeClass('active'); + $this.parents('.lr-gantt').removeClass('lr-gantt-showtext-active'); + $this.parent().find('.lr-scroll-box').html(''); + $this = null; + }); + }, + initMove: function ($self) { + $self.on('mousedown', function (e) { + e = e || window.event; + var et = e.target || e.srcElement; + var $et = $(et); + var $this = $(this); + var dfop = $this[0].dfop; + if ($et.hasClass('lr-gantt-move')) { + dfop._ismove = true; + dfop._pageX = e.pageX; + } + }); + + $self.mousemove(function (e) { + var $this = $(this); + var dfop = $this[0].dfop; + if (dfop._ismove) { + var $block = $this.find('.lr-gantt-left'); + $block.css('width', dfop.leftWidh + (e.pageX - dfop._pageX)); + $this.find('.lr-gantt-body').css('padding-left', dfop.leftWidh + (e.pageX - dfop._pageX)); + } + }); + + $self.on('click', function (e) { + var $this = $(this); + var dfop = $this[0].dfop; + if (dfop._ismove) { + dfop.leftWidh += (e.pageX - dfop._pageX); + dfop._ismove = false; + } + }); + }, + + initTitle: function ($title, op) { + $title.find('.' + op.type).addClass('active'); + $title.find('a').on('click', function () { + var $this = $(this); + if (!$this.hasClass('active')) { + $this.parent().find('.active').removeClass('active'); + + + var $self = $this.parents('.lr-gantt'); + var _op = $self[0].dfop; + _op.type = $this.attr('data-value'); + + setTimeout(function () { + _gantt.renderRightHeader($self.find('.lr-gantt-rightheader'), op); + _gantt.renderRightData($self, op); + $self = null; + }); + $this.addClass('active'); + } + $this = null; + }); + + }, + initFooter: function ($footer, $self, op) { + if (op.isPage) { + var $pagebar = $('
无显示数据
\ +
'); + $footer.append($pagebar); + $pagebar.find('#lr_gantt_page_bar_num_' + op.id).on('click', _gantt.turnPage); + $pagebar.find('#lr_gantt_page_bar_nums_' + op.id + ' .pagebtn').on('click', { op: op }, _gantt.turnPage2); + $pagebar = null; + } + else { + $self.addClass('lr-gantt-nopage'); + } + $footer = null; + }, + + initLeft: function ($left, $self, op) { + $left.find('.lr-gantt-left-content').lrscroll(function (x, y) { + if (!$self.is(":hidden")) { + $self.find('.lr-gantt-rightbody').lrscrollSet('moveY', y); + + } + }); + }, + initRight: function ($right, $self, op) { + $right.find('.lr-gantt-rightbody').lrscroll(function (x, y) { + if (!$self.is(":hidden")) { + $self.find('.lr-gantt-rightheader').css('left', -x); + + $self.find('.lr-gantt-left-content').lrscrollSet('moveY', y); + } + }); + }, + renderRightHeader: function ($header, op) { + $header.hide(); + $header.html(''); + op._time = DateUtils.getBoundaryDatesFromData(op.data, op.cellNum, op.type); + // 绘制头部 + var $month = $('
'); + var $day = $('
'); + + var len = 0; + var last = op._time.min; + var y = ''; + var w = 0; + var $y = null; + op._num = 0; + switch (op.type) { + case 'month': + len = op._time.min.DateDiff('m', op._time.max) + 1; + w = 0; + for (var i = 0; i < len; i++) { + var _y = last.getFullYear(); + if (y != _y) { + y = _y; + if ($y != null) { + $y.css({ 'width': w * 28 }); + } + $y = $('
' + y + '
'); + $month.append($y); + w = 0; + } + $day.append('
' + (last.getMonth()+1) + '
'); + last = last.DateAdd('m', 1); + w++; + op._num++; + } + $y.css({ 'width': w * 28 }); + break; + case 'week': + len = op._time.min.DateDiff('w', op._time.max) +1; + w = 0; + var start = null; + for (var i = 0; i < len; i++) { + var _y = op.monthNames[last.getMonth()] + '/' + last.getFullYear(); + if (y != _y) { + y = _y; + if ($y != null) { + if (op._time.min.DateDiff('m', start) > 0) { + $y.css({ 'width': start.MaxDayOfDate() * 4 }); + } + else { + $y.css({ 'width': (start.MaxDayOfDate() - start.getDate() + 1) * 4 }); + } + } + start = last; + $y = $('
' + y + '
'); + $month.append($y); + w = 0; + } + $day.append('
' + DateUtils.getWeekNumber(last) + '
'); + last = last.DateAdd('w', 1); + w++; + op._num++; + } + $y.css({ 'width': (last.DateAdd('w', -1).getDate() + 6) * 4 }); + + break; + case 'day': + len = op._time.min.DateDiff('d', op._time.max) + 1; + w = 0; + for (var i = 0; i < len; i++) { + var _y = op.monthNames[last.getMonth()] + '/' + last.getFullYear(); + + if (y != _y) { + y = _y; + if ($y != null) { + $y.css({ 'width': w * 28 }); + } + $y = $('
' + y + '
'); + $month.append($y); + w = 0; + } + $day.append('
' + last.getDate() + '
'); + last = last.DateAdd('d', 1); + w++; + op._num++; + } + $y.css({ 'width': w * 28 }); + break; + case 'hour': + len = op._time.min.DateDiff('h', op._time.max) + 1; + w = 0; + for (var i = 0; i < len; i++) { + var _y = last.getDate() + '/' + op.monthNames[last.getMonth()] + '/' + last.getFullYear(); + if (y != _y) { + y = _y; + if ($y != null) { + $y.css({ 'width': w * 28 }); + } + $y = $('
' + y + '
'); + $month.append($y); + w = 0; + } + $day.append('
' + last.getHours() + '
'); + last = last.DateAdd('h', 1); + w++; + op._num++; + } + $y.css({ 'width': w * 28 }); + break; + } + op._width = op._num * 28; + + $header.css("width", op._width + "px"); + $header.append($month); + $header.append($day); + $header.show(); + $header = null; + $month = null; + $day = null; + }, + renderRightGird: function ($content, op) { + $content.hide(); + $content.css({ 'width': op._width }); + $content.html(''); + var $row = $('
'); + for (var j = 0; j < op._num; j++) { + var $cell = $('
', { "class": "ganttview-grid-row-cell" }); + $row.append($cell); + $cell = null; + } + for (var j = 0; j < op._row; j++) { + $content.append($row.clone()); + } + $content.show(); + + if (op._row == 0) { + $content.parents('.lr-gantt-right').find('.lr-gantt-nodata-img').show(); + } + else { + $content.parents('.lr-gantt-right').find('.lr-gantt-nodata-img').hide(); + } + $row = null; + $content = null; + }, + + // 加载数据 + loadData: function ($self, op) { + var _param = op.param || {}; + if (op.isPage) { + learun.loading(true, '正在获取数据'); + op.pageparam = op.pageparam || { + rows: op.rows, // 每页行数 + page: 1, // 当前页 + sidx: '', // 排序列 + sord: '', // 排序类型 + records: 0, // 总记录数 + total: 0 // 总页数 + }; + + op.pageparam.rows = op.rows; + op.pageparam.sidx = op.sidx; + op.pageparam.sord = op.sord; + op.pageparam.page = op.pageparam.page || 1; + op.pageparam.records = 0; + op.pageparam.total = 0; + + + op.param = op.param || {}; + delete op.param['pagination']; + var _paramString = JSON.stringify(op.param); + if (op.paramString != _paramString) { + op.paramString = _paramString; + op.pageparam.page = 1; + } + + + op.param['pagination'] = JSON.stringify(op.pageparam); + + learun.httpAsync('GET', op.url, op.param, function (data) { + learun.loading(false); + if (data) { + op.data = data.rows; + op.pageparam.page = data.page; + op.pageparam.records = data.records; + op.pageparam.total = data.total; + + } + else { + op.data = []; + op.pageparam.page = 1; + op.pageparam.records = 0; + op.pageparam.total = 0; + } + _gantt.renderData($self, op); + + + var $pagebar = $self.find('#lr_gantt_page_bar_' + op.id); + var $pagebarBtn = $pagebar.find('#lr_gantt_page_bar_num_' + op.id); + var $pagebarBtns = $pagebar.find('#lr_gantt_page_bar_nums_' + op.id); + + var pagebarLabel = ''; + var btnlist = ""; + if (op.data.length == 0) { + pagebarLabel = '无显示数据'; + } + else { + var pageparam = op.pageparam; + var beginnum = (pageparam.page - 1) * pageparam.rows + 1; + var endnum = beginnum + op.data.length - 1; + pagebarLabel = '显示第 ' + beginnum + ' - ' + endnum + ' 条记录 | 检索到 ' + pageparam.records + ' 条记录'; + + if (pageparam.total > 1) { + var bpage = pageparam.page - 6; + bpage = bpage < 0 ? 0 : bpage; + var epage = bpage + 10; + if (epage > pageparam.total) { + epage = pageparam.total; + } + if ((epage - bpage) < 10) { + bpage = epage - 10; + } + bpage = bpage < 0 ? 0 : bpage; + + for (var i = bpage; i < epage; i++) { + btnlist += '
  • ' + (i + 1) + '
  • '; + } + + $pagebarBtns.find('span').text('共' + pageparam.total + '页,到'); + + $pagebarBtns.show(); + } + else { + $pagebarBtns.hide(); + } + } + $pagebarBtn.html(btnlist); + $pagebar.find('.lr-gantt-page-bar-info').html(pagebarLabel); + + op.onRenderComplete && op.onRenderComplete(op.data); + }); + } + else { + if (op.url) { + learun.loading(true, '正在获取数据'); + + learun.httpAsync('GET', op.url, _param, function (data) { + learun.loading(false); + op.data = data || []; + _gantt.renderData($self, op); + op.onRenderComplete && op.onRenderComplete(op.data); + }); + } + } + }, + turnPage: function (e) { + e = e || window.event; + + var $this = $(this); + var $self = $('#' + $this.attr('id').replace('lr_gantt_page_bar_num_', '')); + var op = $self[0].dfop; + + var et = e.target || e.srcElement; + var $et = $(et); + if ($et.hasClass('pagebtn')) { + var page = parseInt($et.text()); + if (page != op.pageparam.page) { + $this.find('.active').removeClass('active'); + $et.addClass('active'); + op.pageparam.page = page; + _gantt.loadData($self, op); + } + } + }, + turnPage2: function (e) { + var $this = $(this); + var op = e.data.op; + var name = $this.text(); + var $pagenum = $('#lr_gantt_page_bar_num_' + op.id); + var page = parseInt($pagenum.find('.active').text()); + var falg = false; + switch (name) { + case '首页': + if (page != 1) { + op.pageparam.page = 1; + falg = true; + } + break; + case '上一页': + if (page > 1) { + op.pageparam.page = page - 1; + falg = true; + } + break; + case '下一页': + if (page < op.pageparam.total) { + op.pageparam.page = page + 1; + falg = true; + } + break; + case '尾页': + if (page != op.pageparam.total) { + op.pageparam.page = op.pageparam.total; + falg = true; + } + break; + case '跳转': + var text = $this.parents('#lr_gantt_page_bar_nums_' + op.id).find('input').val(); + if (!!text) { + var p = parseInt(text); + if (String(p) != 'NaN') { + if (p < 1) { + p = 1; + } + if (p > op.pageparam.total) { + p = op.pageparam.total; + } + op.pageparam.page = p; + falg = true; + } + } + break; + } + if (falg) { + _gantt.loadData($('#' + op.id), op); + } + + }, + // 渲染数据 + renderData: function ($self, op) { + _gantt.hideinfo($self); + + _gantt.renderRightHeader($self.find('.lr-gantt-rightheader'), op); + // 绘制左侧列表数据 + _gantt.renderLeftData($self, op); + // 绘制右侧数据 + _gantt.renderRightData($self, op); + + }, + // 左侧 + renderLeftData: function ($self, op) { + var $treeRoot = $('
      '); + var _len = op.data.length; + op._timeDatas = {}; + op._row = 0; + for (var i = 0; i < _len; i++) { + var $node = _gantt.renderNode(op.data[i], 0, i, op, true); + $treeRoot.append($node); + } + $self.find('.lr-gantt-left .lr-scroll-box').html($treeRoot); + }, + renderNode: function (node, deep, path, dfop, isShow) { + if (isShow) { + dfop._timeDatas[path + ''] = node; + dfop._row++; + } + node._deep = deep; + node._path = path; + // 渲染成单个节点 + var nid = node.id.replace(/[^\w]/gi, "_"); + var title = node.title || node.text; + + var $node = $('
    • '); + var $nodeDiv = $('
      '); + if (node.hasChildren) { + var c = (node.isexpand || dfop.isAllExpand) ? 'lr-gantt-tree-node-expanded' : 'lr-gantt-tree-node-collapsed'; + $nodeDiv.addClass(c); + } + else { + $nodeDiv.addClass('lr-gantt-tree-node-leaf'); + } + // span indent + var $span = $(''); + if (deep == 1) { + $span.append(''); + } + else if (deep > 1) { + $span.append(''); + for (var j = 1; j < deep; j++) { + $span.append(''); + } + } + $nodeDiv.append($span); + // img + var $img = $(''); + $nodeDiv.append($img); + // a + var ahtml = ''; + ahtml += '' + node.text + ''; + ahtml += ''; + $nodeDiv.append(ahtml); + // 节点事件绑定 + $nodeDiv.on('click', _gantt.nodeClick); + + if (!node.complete) { + $nodeDiv.append('
      '); + } + + $node.append($nodeDiv); + if (node.hasChildren) { + var $treeChildren = $('
        '); + if (!node.isexpand && !dfop.isAllExpand) { + $treeChildren.css('display', 'none'); + } + if (node.children) { + var l = node.children.length; + for (var k = 0; k < l; k++) { + node.children[k].parent = node; + var $childNode = _gantt.renderNode(node.children[k], deep + 1, path + "." + k, dfop); + $treeChildren.append($childNode); + } + $node.append($treeChildren); + } + } + node.render = true; + return $node; + }, + renderNodeAsync: function ($this, node, dfop) { + var $treeChildren = $('
          '); + if (!node.isexpand && !dfop.isAllExpand) { + $treeChildren.css('display', 'none'); + } + if (node.children) { + var l = node.children.length; + for (var k = 0; k < l; k++) { + node.children[k].parent = node; + var $childNode = _gantt.renderNode(node.children[k], node._deep + 1, node._path + "." + k, dfop); + $treeChildren.append($childNode); + } + $this.parent().append($treeChildren); + } + return $treeChildren; + }, + getItem: function (path, dfop) { + var ap = path.split("."); + var t = dfop.data; + for (var i = 0; i < ap.length; i++) { + if (i == 0) { + t = t[ap[i]]; + } + else { + t = t.children[ap[i]]; + } + } + return t; + }, + nodeClick: function (e) { + e = e || window.event; + var et = e.target || e.srcElement; + var $this = $(this); + var $parent = $('#' + $this.attr('dataId')); + var dfop = $parent[0].dfop; + + var path = $this.attr('tpath'); + var node = _gantt.getItem(path, dfop); + + if (et.tagName == 'IMG') { + var $et = $(et); + var $ul = $this.next('.lr-gantt-tree-node-ct'); + if ($et.hasClass("lr-gantt-tree-ec-icon")) { + if ($this.hasClass('lr-gantt-tree-node-expanded')) { + $ul.slideUp(200, function () { + $this.removeClass('lr-gantt-tree-node-expanded'); + $this.addClass('lr-gantt-tree-node-collapsed'); + + _gantt.removeTimeDatas(node.children, dfop); + + // 重新刷新下右侧的数据 + _gantt.renderRightData($parent, dfop); + }); + } + else if ($this.hasClass('lr-gantt-tree-node-collapsed')) { + // 展开 + + if (!node.complete) { + if (!node._loading) { + node._loading = true;// 表示正在加载数据 + $this.find('.lr-gantt-tree-loading').show(); + var param = dfop.childParam || {}; + param.parentId = node.id; + var url = dfop.childUrl || dfop.url; + learun.httpAsync('GET', url, param, function (data) { + if (data) { + node.children = data; + $ul = _gantt.renderNodeAsync($this, node, dfop); + $ul.slideDown(200, function () { + $this.removeClass('lr-gantt-tree-node-collapsed'); + $this.addClass('lr-gantt-tree-node-expanded'); + + // 检测下当前节点下哪些节点显示了 + _gantt.addTimeDatas(node.children, dfop); + // 重新刷新下右侧的数据 + _gantt.renderRightData($parent, dfop); + }); + node.complete = true; + $this.find('.lr-gantt-tree-loading').hide(); + } + node._loading = false; + }); + } + } + else { + $ul.slideDown(200, function () { + $this.removeClass('lr-gantt-tree-node-collapsed'); + $this.addClass('lr-gantt-tree-node-expanded'); + + // 检测下当前节点下哪些节点显示了 + _gantt.addTimeDatas(node.children, dfop); + + // 重新刷新下右侧的数据 + _gantt.renderRightData($parent, dfop); + }); + } + } + + } + } + else { + dfop.currentItem = node; + $parent.find('.lr-gantt-tree-selected').removeClass('lr-gantt-tree-selected'); + $this.addClass('lr-gantt-tree-selected'); + dfop.click && dfop.click(node, $this); + } + + + return false; + }, + addTimeDatas: function (data, op) { + $.each(data, function (_index, _item) { + var nid = _item.id.replace(/[^\w]/gi, "_"); + var id = op.id + '_' + nid; + var $node = $('#' + id); + if (!$node.is(":hidden")) { + var path = $node.attr('tpath'); + op._timeDatas[path] = _item; + op._row++; + if (_item.hasChildren && _item.children && _item.children.length) { + _gantt.addTimeDatas(_item.children, op); + } + } + }); + }, + removeTimeDatas: function (data, op) { + $.each(data, function (_index, _item) { + var nid = _item.id.replace(/[^\w]/gi, "_"); + var id = op.id + '_' + nid; + var $node = $('#' + id); + if ($node.is(":hidden")) { + var path = $node.attr('tpath'); + if (op._timeDatas) { + delete op._timeDatas[path]; + op._row--; + } + + if (_item.hasChildren && _item.children && _item.children.length) { + _gantt.addTimeDatas(_item.children, op); + } + } + }); + }, + + // 右侧 + renderRightData: function ($self, op) { + _gantt.renderRightGird($self.find('.lr-gantt-rightbody .lr-scroll-box'), op); + var $blocks = $('
          '); + + // 对 op._timeDatas 进行排序 + var _dataTemp = []; + $.each(op._timeDatas, function (_index, _item) { + if (_index.indexOf('.') == -1) { + _dataTemp.push(_item); + // 获取他的子节点 + _gantt.addRightChildTimeDatas(op._timeDatas, _dataTemp, _index); + } + }); + + $.each(_dataTemp, function (_index, _item) { + var $blockContainer = $('
          '); + $.each(_item.timeList || [], function (_i, _t) { + var res = DateUtils.getDateBlock(_t.beginTime, _t.endTime, op); + if (res.width > 0) { + var $block = $('
          ').css({ width: res.width, left: res.left, 'background-color': _t.color || '#3286ed' }); + if (_t.text) { + $block.find('.lr-gantt-block-text').text(_t.text); + } + if (_t.overtime) { + $block.append('
          '); + } + $block[0].ganttData = { + item: _item, + mytime:_t + }; + + // 点击 + $block.on('click', { op: op }, function (e) { + e = e || window.event; + var _op = e.data.op; + var ganttData = $(this)[0].ganttData; + _op.timeClick && _op.timeClick(ganttData, $('#' + _op.id)); + }); + // 双击 + $block.on('dblclick', { op: op }, function (e) { + e = e || window.event; + var _op = e.data.op; + var ganttData = $(this)[0].ganttData; + _op.timeDoubleClick && _op.timeDoubleClick(ganttData, $('#' + _op.id)); + }); + + // 移入、移出 + $block.hover(function () { + var ganttData = $(this)[0].ganttData; + op.timeHover && op.timeHover(ganttData, true, $('#' + op.id)); + }, function () { + var ganttData = $(this)[0].ganttData; + op.timeHover && op.timeHover(ganttData, false, $('#' + op.id)); + }); + $blockContainer.append($block); + } + }); + $blocks.append($blockContainer); + }); + $self.find('.lr-gantt-rightbody .lr-scroll-box').append($blocks); + }, + addRightChildTimeDatas: function (data, _dataTemp, path) { + var num =0; + while(true){ + var _path = path + '.' + num; + if (data[_path]) { + _dataTemp.push(data[_path]); + _gantt.addRightChildTimeDatas(data, _dataTemp, _path); + num++; + } + else { + break; + } + } + }, + + // 方法 + showInfo: function ($self, info) {// 显示右侧信息板信息 + var $content = $self.find('.lr-gantt-showtext-content .lr-scroll-box'); + $content.html(info); + var $showText = $self.find('.lr-gantt-showtext'); + if (!$showText.hasClass('active')) { + $showText.addClass('active'); + $self.addClass('lr-gantt-showtext-active'); + } + }, + hideinfo: function ($self) {// 隐藏右侧信息板信息 + var $content = $self.find('.lr-gantt-showtext-content .lr-scroll-box'); + var $showText = $self.find('.lr-gantt-showtext'); + if ($showText.hasClass('active')) { + $showText.removeClass('active'); + $self.removeClass('lr-gantt-showtext-active'); + $content.html(''); + } + } + }; + + var DateUtils = { + getDateBlock: function (start, end, op) {// 根据开始结束时间获取宽度和起始位置 + start = DateUtils.parseDate(start, 'h'); + end = DateUtils.parseDate(end, 'h'); + + var wnum = 0; + var dnum = 0; + var res = { + left: 0, + width: 0 + }; + switch (op.type) { + case 'day': + wnum = start.DateDiff('d', end) + 1; + dnum = op._time.min.DateDiff('d', start); + break; + case 'week': + + dnum = op._time.min.DateDiff('w', start); + var eweek = op._time.min.DateDiff('w', end); + wnum = eweek - dnum + 1; + + break; + case 'month': + dnum = op._time.min.DateDiff('m', start); + var emonth = op._time.min.DateDiff('m', end); + wnum = emonth - dnum + 1; + break; + case 'hour': + dnum = op._time.min.DateDiff('h', start); + var ehour = op._time.min.DateDiff('h', end); + wnum = ehour - dnum + 1; + break; + } + + res.left = dnum * 28 + 2; + res.width = wnum * 28 - 4; + return res; + }, + isLeapYear:function(year) { + return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0); + }, + getMonthDays:function(year, month) { + return [31, (DateUtils.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; + }, + getWeekNumber: function (targetDay) { + var year = targetDay.getFullYear(); + var month = targetDay.getMonth(); + var days = targetDay.getDate(); + //那一天是那一年中的第多少天 + for (var i = 0; i < month; i++) { + days += DateUtils.getMonthDays(year, i); + } + //那一年第一天是星期几 + var yearFirstDay = (new Date(year, 0, 1)).getDay(); + //计算是第几周 + days += yearFirstDay; + var week = Math.ceil(days / 7); + + var _num = 7 - targetDay.getDay(); + if (targetDay.DateAdd('d', _num).getFullYear() != year) { + return 1; + } + + return week; + }, + isWeekend: function (date) { + return date.getDay() % 6 == 0; + }, + + getBoundaryDatesFromData: function (data, num, type) { + var time = { + min: DateUtils.parseDate(new Date(), 'h'), + max: DateUtils.parseDate(new Date(), 'h') + }; + DateUtils.getMinMax(data, time, true); + + switch (type) { + case 'month': + time.min = DateUtils.parseDate(time.min, 'm'); + time.max = DateUtils.parseDate(time.max, 'm').DateAdd('m',1); + if (time.min.DateDiff('m', time.max) < num) { + time.max = time.min.DateAdd('m', num); + } + if (time.min.getMonth() == 11) { + time.min = time.min.DateAdd('m', -1); + } + if (time.max.getMonth() == 0) { + time.max = time.max.DateAdd('m', 1); + } + break; + case 'week': + time.min = DateUtils.parseDate(time.min, 'w'); + time.max = DateUtils.parseDate(time.max, 'w').DateAdd('w', 1); + if (time.min.DateDiff('w', time.max) < num) { + time.max = time.min.DateAdd('w', num); + } + + if (time.min.MaxDayOfDate() - time.min.getDate() + 1 < 21) { + var _wnum = time.min.getDate() - time.min.getDate() % 7; + time.min = time.min.DateAdd('d',-_wnum); + } + + if (time.max.getDate() < 21) { + var _wnum = parseInt((time.max.MaxDayOfDate() - time.max.getDate()) / 7); + time.max = time.max.DateAdd('w', _wnum); + } + + break; + case 'day': + if (time.min.DateDiff('d', time.max) < num) { + time.max = time.min.DateAdd('d', num); + } + // 获取当前月最大天数 + var minMonths = time.min.MaxDayOfDate(); + var minCurrentDay = time.min.getDate(); + var maxCurrentDay = time.max.getDate(); + + if (minMonths - minCurrentDay < 2) { + time.min = time.min.DateAdd('d', -(2 + minCurrentDay - minMonths)); + } + if (maxCurrentDay < 3) { + time.max = time.max.DateAdd('d', (3 - maxCurrentDay)); + } + break; + case 'hour': + if (time.min.DateDiff('h', time.max) < num) { + time.max = time.min.DateAdd('h', num); + } + break; + } + return time; + }, + getMinMax:function(data, time, isFirst) { + $.each(data || [], function (_index, _item) { + $.each(_item.timeList, function (_jindex, _jitem) { + var start = DateUtils.parseDate(_jitem.beginTime, 'h'); + var end = DateUtils.parseDate(_jitem.endTime, 'h'); + if (isFirst) { + time.min = start; + time.max = end; + isFirst = false; + } + if (time.min.DateDiff('h', start) < 0) { time.min = start; } + if (time.max.DateDiff('h', end) > 0) { time.max = end; } + }); + if (data.children && data.children.length > 0) { + DateUtils.getMinMax(data.children, time, false); + } + }); + }, + parseDate: function (day, strInterval) { + switch (strInterval) { + case 'd': + return learun.parseDate(learun.formatDate(day, 'yyyy-MM-dd 00:00:00')); + break; + case 'w':// 获取当前周的第一天 + var d = learun.parseDate(learun.formatDate(day, 'yyyy-MM-dd 00:00:00')); + var w = d.getDay(); + return d.DateAdd('d', (1 -w)); + break; + case 'm': + return learun.parseDate(learun.formatDate(day, 'yyyy-MM-01 00:00:00')); + break; + case 'h': + return learun.parseDate(learun.formatDate(day, 'yyyy-MM-dd hh:00:00')); + break; + default: + return learun.parseDate(learun.formatDate(day, 'yyyy-MM-dd 00:00:00')); + break; + } + + } + }; + + $.fn.lrGantt = function (op) { + //id, // id 对应字段 + //text, // 显示文本对应字段 + //isexpand:false, // 是否展开 + //complete:true, // 是否加载完数据 + //timeList // 显示时间字段数组 + // ---- + //-beginTime, // 开始时间对应字段 + //-endTime, // 结束时间对应字段 + //-color, // 颜色对应字段 + //-overtime, // 超时对饮字段 + //children + + var dfop = { + url: false, // 接口地址 + childUrl: false, // 加载子节点参数 + data: [], // 加载数据 + param: false, // 访问接口参数 + childParam: false, // 访问子节点接口参数 + + leftWidh: 200, + type: 'day', // month,week,day,hour + timebtns: ['month', 'week', 'day', 'hour'], + monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一", "十二"], + + isAllExpand:false, + isPage: false, + rows: 50, + imgUrl:top.$.rootUrl + '/Content/images/jfgrid/nodata.jpg', + cbiconpath: top.$.rootUrl + '/Content/images/learuntree/', + + cellNum: 100, + + click: false, // 单击事件 item + + timeClick: false, // 时间段点击事件 item 和 时间段信息 + timeDoubleClick: false, // 时间段双击事件 item 和 时间段信息 + + timeHover: false, // 时间段hover事件 移入事件/移出事件 item 和 时间段信息 flag 标志 true 移入 false 移出 + + onRenderComplete:false // 动态加载后台数据完成后执行 + }; + $.extend(dfop, op || {}); + var $self = $(this); + $self[0].dfop = dfop; + dfop.id = $self.attr('id'); + _gantt.init($self, dfop); + + return $self; + } + + $.fn.lrGanttSet = function (name, data) { + var $this = $(this); + var op = $this[0].dfop; + + switch (name) { + case 'showinfo': // 显示信息框 + _gantt.showInfo($this, data); + break; + case 'hideinfo': // 关闭信息框 + _gantt.hideinfo($this); + break; + case 'refreshdata': // 刷新数据 + op.data = data || []; + _gantt.renderData($this, op); + break; + case 'reload': + if (data) { + op.param = data; + } + _gantt.loadData($this, op); + break; + + } + }; + +})(window.jQuery, top.learun); \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-date.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-date.js index 041dad21e..1367f0448 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-date.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-date.js @@ -7,7 +7,6 @@ */ (function ($, learun) { "use strict"; - $.extend(learun, { // 字串转化成日期 parseDate: function (strDate) { @@ -255,10 +254,13 @@ //+--------------------------------------------------- Date.prototype.MaxDayOfDate = function () { var myDate = this; - var ary = myDate.toArray(); - var date1 = (new Date(ary[0], ary[1] + 1, 1)); + //var ary = myDate.toArray(); + //var date1 = (new Date(ary[0], ary[1] + 1, 1)); + //var date2 = date1.DateAdd('m', 1); + //var result = dateDiff(date1.Format('yyyy-MM-dd'), date2.Format('yyyy-MM-dd')); + var date1 = learun.parseDate(learun.formatDate(myDate, 'yyyy-MM-01 00:00:00')); var date2 = date1.DateAdd('m', 1); - var result = dateDiff(date1.Format('yyyy-MM-dd'), date2.Format('yyyy-MM-dd')); + var result = date1.DateDiff('d', date2); return result; } //--------------------------------------------------- diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_Demo_StockMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_Demo_StockMap.cs new file mode 100644 index 000000000..01a304e0e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_Demo_StockMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LR_CodeDemo; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-12 18:49 + /// 描 述:库存 + /// + public class LR_Demo_StockMap : EntityTypeConfiguration + { + public LR_Demo_StockMap() + { + #region 表、主键 + //表 + this.ToTable("LR_DEMO_STOCK"); + //主键 + this.HasKey(t => t.F_Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_Demo_WorkOrderMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_Demo_WorkOrderMap.cs new file mode 100644 index 000000000..b14c55290 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_Demo_WorkOrderMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LR_CodeDemo; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-10 17:21 + /// 描 述:工单管理 + /// + public class LR_Demo_WorkOrderMap : EntityTypeConfiguration + { + public LR_Demo_WorkOrderMap() + { + #region 表、主键 + //表 + this.ToTable("LR_DEMO_WORKORDER"); + //主键 + this.HasKey(t => t.F_Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_OA_ProjectDetailMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_OA_ProjectDetailMap.cs new file mode 100644 index 000000000..6d0f569b9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_OA_ProjectDetailMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LR_CodeDemo; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-05-08 18:30 + /// 描 述:甘特图应用 + /// + public class LR_OA_ProjectDetailMap : EntityTypeConfiguration + { + public LR_OA_ProjectDetailMap() + { + #region 表、主键 + //表 + this.ToTable("LR_OA_PROJECTDETAIL"); + //主键 + this.HasKey(t => t.F_Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_OA_ProjectMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_OA_ProjectMap.cs new file mode 100644 index 000000000..f06ecdd83 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_CodeDemo/LR_OA_ProjectMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LR_CodeDemo; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-05-08 18:30 + /// 描 述:甘特图应用 + /// + public class LR_OA_ProjectMap : EntityTypeConfiguration + { + public LR_OA_ProjectMap() + { + #region 表、主键 + //表 + this.ToTable("LR_OA_PROJECT"); + //主键 + this.HasKey(t => t.F_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 22137abcf..5b7ded915 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 @@ -104,6 +104,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/GantProjectBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/GantProjectBLL.cs new file mode 100644 index 000000000..3284d5a4b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/GantProjectBLL.cs @@ -0,0 +1,256 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-05-08 18:30 + /// 描 述:甘特图应用 + /// + public class GantProjectBLL : GantProjectIBLL + { + private GantProjectService gantProjectService = new GantProjectService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return gantProjectService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取LR_OA_ProjectDetail表数据 + /// + /// + public IEnumerable GetLR_OA_ProjectDetailList(string keyValue) + { + try + { + return gantProjectService.GetLR_OA_ProjectDetailList(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取LR_OA_Project表实体数据 + /// 主键 + /// + /// + public LR_OA_ProjectEntity GetLR_OA_ProjectEntity(string keyValue) + { + try + { + return gantProjectService.GetLR_OA_ProjectEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取LR_OA_ProjectDetail表实体数据 + /// 主键 + /// + /// + public LR_OA_ProjectDetailEntity GetLR_OA_ProjectDetailEntity(string keyValue) + { + try + { + return gantProjectService.GetLR_OA_ProjectDetailEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取项目列表 + /// + /// + /// + public IEnumerable GetList(string keyValue) + { + return gantProjectService.GetList(keyValue); + } + /// + /// 获取项目列表 + /// + /// + /// + public IEnumerable GetDetailList(string parentId) + { + return gantProjectService.GetLR_OA_ProjectDetailList(parentId); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + gantProjectService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 删除明细数据 + /// 主键 + /// + /// + public void DeleteDetail(string keyValue) + { + try + { + gantProjectService.DeleteDetail(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, LR_OA_ProjectEntity entity,List lR_OA_ProjectDetailList) + { + try + { + gantProjectService.SaveEntity(keyValue, entity,lR_OA_ProjectDetailList); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 保存表头实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveGant(string keyValue, LR_OA_ProjectEntity entity) + { + try + { + gantProjectService.SaveGant(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 保存明细实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveDetail(string keyValue, LR_OA_ProjectDetailEntity entity) + { + try + { + gantProjectService.SaveDetail(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/LR_CodeDemo/GantProject/GantProjectIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/GantProjectIBLL.cs new file mode 100644 index 000000000..6c82e09d3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/GantProjectIBLL.cs @@ -0,0 +1,90 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-05-08 18:30 + /// 描 述:甘特图应用 + /// + public interface GantProjectIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取LR_OA_ProjectDetail表数据 + /// + /// + IEnumerable GetLR_OA_ProjectDetailList(string keyValue); + /// + /// 获取LR_OA_Project表实体数据 + /// 主键 + /// + /// + LR_OA_ProjectEntity GetLR_OA_ProjectEntity(string keyValue); + /// + /// 获取LR_OA_ProjectDetail表实体数据 + /// 主键 + /// + /// + LR_OA_ProjectDetailEntity GetLR_OA_ProjectDetailEntity(string keyValue); + /// + /// 获取项目列表 + /// + /// + /// + IEnumerable GetList(string keyValue); + /// + /// 获取项目明细列表 + /// + /// + /// + IEnumerable GetDetailList(string parentId); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + void DeleteEntity(string keyValue); + /// + /// 删除明细数据 + /// 主键 + /// + /// + void DeleteDetail(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + void SaveEntity(string keyValue, LR_OA_ProjectEntity entity, List lR_OA_ProjectDetailList); + /// + /// 保存表头实体数据(新增、修改) + /// 主键 + /// + /// + void SaveGant(string keyValue, LR_OA_ProjectEntity entity); + /// + /// 保存明细实体数据(新增、修改) + /// 主键 + /// + /// + void SaveDetail(string keyValue, LR_OA_ProjectDetailEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/GantProjectService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/GantProjectService.cs new file mode 100644 index 000000000..d1ef12d4e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/GantProjectService.cs @@ -0,0 +1,337 @@ +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.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-05-08 18:30 + /// 描 述:甘特图应用 + /// + public class GantProjectService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.F_Id, + t.F_ProjectName, + t.F_StartTime, + t.F_EndTime, + t.F_Remark, + t.F_Status + "); + strSql.Append(" FROM LR_OA_Project t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["F_ProjectName"].IsEmpty()) + { + dp.Add("F_ProjectName", "%" + queryParam["F_ProjectName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.F_ProjectName Like @F_ProjectName "); + } + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取LR_OA_ProjectDetail表数据 + /// + /// + public IEnumerable GetLR_OA_ProjectDetailList(string parentId) + { + try + { + return this.BaseRepository().FindList("select * from LR_OA_ProjectDetail where F_ParentId='" + parentId + "' order by F_StartTime"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取LR_OA_Project表实体数据 + /// 主键 + /// + /// + public LR_OA_ProjectEntity GetLR_OA_ProjectEntity(string keyValue) + { + try + { + return this.BaseRepository().FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取LR_OA_ProjectDetail表实体数据 + /// 主键 + /// + /// + public LR_OA_ProjectDetailEntity GetLR_OA_ProjectDetailEntity(string keyValue) + { + try + { + return this.BaseRepository().FindEntity(t => t.F_Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取项目列表 + /// + /// + /// + public IEnumerable GetList(string keyValue) + { + if (string.IsNullOrEmpty(keyValue)) + { + return this.BaseRepository().FindList(); + } + else + { + return this.BaseRepository().FindList(t => t.F_ProjectName.Contains(keyValue)); + } + } + /// + /// 获取项目明细列表 + /// + /// + /// + public IEnumerable GetDetailList(string parentId) + { + return this.BaseRepository().FindList(t => t.F_ParentId == parentId); + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + var db = this.BaseRepository().BeginTrans(); + try + { + var lR_OA_ProjectEntity = GetLR_OA_ProjectEntity(keyValue); + db.Delete(t => t.F_Id == keyValue); + db.Delete(t => t.F_ParentId == lR_OA_ProjectEntity.F_Id); + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 删除明细数据 + /// 主键 + /// + /// + public void DeleteDetail(string keyValue) + { + try + { + this.BaseRepository().Delete(t => t.F_Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, LR_OA_ProjectEntity entity, List lR_OA_ProjectDetailList) + { + var db = this.BaseRepository().BeginTrans(); + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + var lR_OA_ProjectEntityTmp = GetLR_OA_ProjectEntity(keyValue); + entity.Modify(keyValue); + db.Update(entity); + db.Delete(t => t.F_ParentId == lR_OA_ProjectEntityTmp.F_Id); + foreach (LR_OA_ProjectDetailEntity item in lR_OA_ProjectDetailList) + { + item.Create(); + item.F_ParentId = lR_OA_ProjectEntityTmp.F_Id; + db.Insert(item); + } + } + else + { + entity.Create(); + db.Insert(entity); + foreach (LR_OA_ProjectDetailEntity item in lR_OA_ProjectDetailList) + { + item.Create(); + item.F_ParentId = entity.F_Id; + db.Insert(item); + } + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 保存表头实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveGant(string keyValue, LR_OA_ProjectEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository().Update(entity); + } + else + { + entity.Create(); + this.BaseRepository().Insert(entity); + + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 保存明细实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveDetail(string keyValue, LR_OA_ProjectDetailEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository().Update(entity); + } + else + { + entity.Create(); + this.BaseRepository().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/LR_CodeDemo/GantProject/LR_OA_ProjectDetailEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/LR_OA_ProjectDetailEntity.cs new file mode 100644 index 000000000..884d07aaf --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/LR_OA_ProjectDetailEntity.cs @@ -0,0 +1,73 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-05-08 18:30 + /// 描 述:甘特图应用 + /// + public class LR_OA_ProjectDetailEntity + { + #region 实体成员 + /// + /// 主键 + /// + [Column("F_ID")] + public string F_Id { get; set; } + /// + /// 父ID + /// + [Column("F_PARENTID")] + public string F_ParentId { get; set; } + /// + /// 项目名称 + /// + [Column("F_ITEMNAME")] + public string F_ItemName { get; set; } + /// + /// 开始时间 + /// + [Column("F_STARTTIME")] + public DateTime? F_StartTime { get; set; } + /// + /// 结束时间 + /// + [Column("F_ENDTIME")] + public DateTime? F_EndTime { get; set; } + /// + /// 备注 + /// + [Column("F_REMARK")] + public string F_Remark { get; set; } + /// + /// 状态 + /// + [Column("F_STATUS")] + public string F_Status { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.F_Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.F_Id = keyValue; + } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/LR_OA_ProjectEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/LR_OA_ProjectEntity.cs new file mode 100644 index 000000000..33c051e77 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/GantProject/LR_OA_ProjectEntity.cs @@ -0,0 +1,70 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-05-08 18:30 + /// 描 述:甘特图应用 + /// + public class LR_OA_ProjectEntity + { + #region 实体成员 + /// + /// 主键 + /// + [Column("F_ID")] + public string F_Id { get; set; } + /// + /// 项目名称 + /// + [Column("F_PROJECTNAME")] + public string F_ProjectName { get; set; } + /// + /// 开始时间 + /// + [Column("F_STARTTIME")] + public DateTime? F_StartTime { get; set; } + /// + /// 结束时间 + /// + [Column("F_ENDTIME")] + public DateTime? F_EndTime { get; set; } + /// + /// 备注 + /// + [Column("F_REMARK")] + public string F_Remark { get; set; } + /// + /// 状态 + /// + [Column("F_STATUS")] + public string F_Status { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.F_Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.F_Id = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/LR_Demo_StockEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/LR_Demo_StockEntity.cs new file mode 100644 index 000000000..f574124b6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/LR_Demo_StockEntity.cs @@ -0,0 +1,65 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-12 18:49 + /// 描 述:库存 + /// + public class LR_Demo_StockEntity + { + #region 实体成员 + /// + /// 主键 + /// + [Column("F_ID")] + public string F_Id { get; set; } + /// + /// 货物名称 + /// + [Column("F_ITEMNAME")] + public string F_ItemName { get; set; } + /// + /// 数量 + /// + [Column("F_QTY")] + public int? F_Qty { get; set; } + /// + /// 单位 + /// + [Column("F_UNIT")] + public string F_Unit { get; set; } + /// + /// 库位 + /// + [Column("F_AREA")] + public string F_Area { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.F_Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.F_Id = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/StockDemoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/StockDemoBLL.cs new file mode 100644 index 000000000..7ffd5887a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/StockDemoBLL.cs @@ -0,0 +1,146 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-12 18:49 + /// 描 述:库存 + /// + public class StockDemoBLL : StockDemoIBLL + { + private StockDemoService stockDemoService = new StockDemoService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return stockDemoService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取库位列表数据 + /// + /// 位ID + /// + public IEnumerable GetStock(string stockArea) + { + try + { + return stockDemoService.GetStock(stockArea); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取LR_Demo_Stock表实体数据 + /// 主键 + /// + /// + public LR_Demo_StockEntity GetLR_Demo_StockEntity(string keyValue) + { + try + { + return stockDemoService.GetLR_Demo_StockEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + stockDemoService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, LR_Demo_StockEntity entity) + { + try + { + stockDemoService.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/LR_CodeDemo/StockDemo/StockDemoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/StockDemoIBLL.cs new file mode 100644 index 000000000..58c936523 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/StockDemoIBLL.cs @@ -0,0 +1,55 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-12 18:49 + /// 描 述:库存 + /// + public interface StockDemoIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 指定库位列表数据 + /// + /// 库位ID + /// + IEnumerable GetStock(string stockArea); + /// + /// 获取LR_Demo_Stock表实体数据 + /// 主键 + /// + /// + LR_Demo_StockEntity GetLR_Demo_StockEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + void SaveEntity(string keyValue, LR_Demo_StockEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/StockDemoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/StockDemoService.cs new file mode 100644 index 000000000..ca933d2d3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/StockDemo/StockDemoService.cs @@ -0,0 +1,204 @@ +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.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-12 18:49 + /// 描 述:库存 + /// + public class StockDemoService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.F_Id, + t.F_ItemName, + t.F_Qty, + t.F_Unit, + t.F_Area + "); + strSql.Append(" FROM LR_Demo_Stock t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["F_ItemName"].IsEmpty()) + { + dp.Add("F_ItemName", "%" + queryParam["F_ItemName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.F_ItemName Like @F_ItemName "); + } + if (!queryParam["F_Unit"].IsEmpty()) + { + dp.Add("F_Unit", "%" + queryParam["F_Unit"].ToString() + "%", DbType.String); + strSql.Append(" AND t.F_Unit Like @F_Unit "); + } + if (!queryParam["F_Area"].IsEmpty()) + { + dp.Add("F_Area",queryParam["F_Area"].ToString(), DbType.String); + strSql.Append(" AND t.F_Area = @F_Area "); + } + return this.BaseRepository().FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取指定库位列表数据 + /// + /// 库位ID + /// + public IEnumerable GetStock(string stockArea) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.F_Id, + t.F_ItemName, + t.F_Qty, + t.F_Unit, + t.F_Area + "); + strSql.Append(" FROM LR_Demo_Stock t "); + strSql.Append(" WHERE 1=1 "); + var dp = new DynamicParameters(new { }); + if (!string.IsNullOrEmpty(stockArea)) + { + dp.Add("F_Area", stockArea, DbType.String); + strSql.Append(" AND t.F_Area = @F_Area "); + } + return this.BaseRepository().FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取LR_Demo_Stock表实体数据 + /// 主键 + /// + /// + public LR_Demo_StockEntity GetLR_Demo_StockEntity(string keyValue) + { + try + { + return this.BaseRepository().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().Delete(t=>t.F_Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, LR_Demo_StockEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository().Update(entity); + } + else + { + entity.Create(); + this.BaseRepository().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/LR_CodeDemo/WorkOrder/LR_Demo_WorkOrderEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/WorkOrder/LR_Demo_WorkOrderEntity.cs new file mode 100644 index 000000000..088724018 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/WorkOrder/LR_Demo_WorkOrderEntity.cs @@ -0,0 +1,79 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-10 17:21 + /// 描 述:工单管理 + /// + public class LR_Demo_WorkOrderEntity + { + #region 实体成员 + /// + /// 工单ID + /// + [Column("F_ID")] + public string F_Id { get; set; } + /// + /// 工单编号 + /// + [Column("F_CODE")] + public string F_Code { get; set; } + /// + /// 生产部门 + /// + [Column("F_DEPARTMENTID")] + public string F_DepartmentId { get; set; } + /// + /// 处理人 + /// + [Column("F_MANAGERID")] + public string F_ManagerId { get; set; } + /// + /// 制程ID + /// + [Column("F_PROCESS")] + public string F_Process { get; set; } + /// + /// 数量 + /// + [Column("F_QTY")] + public int? F_Qty { get; set; } + /// + /// 状态 + /// + [Column("F_STATUS")] + public string F_Status { get; set; } + /// + /// 规格型号 + /// + [Column("F_SPEC")] + public string F_Spec { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.F_Id = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/WorkOrder/WorkOrderBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/WorkOrder/WorkOrderBLL.cs new file mode 100644 index 000000000..b6624ff6c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/WorkOrder/WorkOrderBLL.cs @@ -0,0 +1,217 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-10 17:21 + /// 描 述:工单管理 + /// + public class WorkOrderBLL : WorkOrderIBLL + { + private WorkOrderService workOrderService = new WorkOrderService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return workOrderService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取屏幕显示数据 + /// + /// + public DataTable GetList() + { + try + { + return workOrderService.GetList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取套打数据 + /// + /// 主键 + /// + public DataTable GetPrintItem(string keyValue) + { + return workOrderService.GetPrintItem(keyValue); + } + /// + /// 获取LR_Demo_WorkOrder表实体数据 + /// 主键 + /// + /// + public LR_Demo_WorkOrderEntity GetLR_Demo_WorkOrderEntity(string keyValue) + { + try + { + return workOrderService.GetLR_Demo_WorkOrderEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + public LR_Demo_WorkOrderEntity GetEntityByProcessId(string processId) + { + try + { + return workOrderService.GetEntityByProcessId(processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取左侧树形数据 + /// + /// + public List GetTree() + { + try + { + DataTable list = workOrderService.GetSqlTree(); + List treeList = new List(); + foreach (DataRow item in list.Rows) + { + TreeModel node = new TreeModel + { + id = item["f_departmentid"].ToString(), + text = item["f_fullname"].ToString(), + value = item["f_departmentid"].ToString(), + showcheck = false, + checkstate = 0, + isexpand = true, + parentId = item["f_parentid"].ToString() + }; + treeList.Add(node); + } + return treeList.ToTree(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + workOrderService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, LR_Demo_WorkOrderEntity entity) + { + try + { + workOrderService.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/LR_CodeDemo/WorkOrder/WorkOrderIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/WorkOrder/WorkOrderIBLL.cs new file mode 100644 index 000000000..892a3bb08 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/WorkOrder/WorkOrderIBLL.cs @@ -0,0 +1,71 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-10 17:21 + /// 描 述:工单管理 + /// + public interface WorkOrderIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取屏幕显示数据 + /// + /// + DataTable GetList(); + /// + /// 获取套打数据 + /// + /// 主键 + /// + DataTable GetPrintItem(string keyValue); + /// + /// 获取LR_Demo_WorkOrder表实体数据 + /// 主键 + /// + /// + LR_Demo_WorkOrderEntity GetLR_Demo_WorkOrderEntity(string keyValue); + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + LR_Demo_WorkOrderEntity GetEntityByProcessId(string processId); + /// + /// 获取左侧树形数据 + /// + /// + List GetTree(); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + void SaveEntity(string keyValue, LR_Demo_WorkOrderEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/WorkOrder/WorkOrderService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/WorkOrder/WorkOrderService.cs new file mode 100644 index 000000000..e378d9ee1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_CodeDemo/WorkOrder/WorkOrderService.cs @@ -0,0 +1,308 @@ +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.LR_CodeDemo +{ + /// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-10 17:21 + /// 描 述:工单管理 + /// + public class WorkOrderService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.F_Id, + t.F_Code, + t.F_DepartmentId, + t.F_ManagerId, + t.F_Qty, + t.F_Process, + t.F_Spec, + t.F_Status + "); + strSql.Append(" FROM LR_Demo_WorkOrder t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["F_Code"].IsEmpty()) + { + dp.Add("F_Code", "%" + queryParam["F_Code"].ToString() + "%", DbType.String); + strSql.Append(" AND t.F_Code Like @F_Code "); + } + if (!queryParam["F_DepartmentId"].IsEmpty()) + { + dp.Add("F_DepartmentId", queryParam["F_DepartmentId"].ToString(), DbType.String); + strSql.Append(" AND t.F_DepartmentId = @F_DepartmentId "); + } + if (!queryParam["F_ManagerId"].IsEmpty()) + { + dp.Add("F_ManagerId", "%" + queryParam["F_ManagerId"].ToString() + "%", DbType.String); + strSql.Append(" AND t.F_ManagerId Like @F_ManagerId "); + } + if (!queryParam["F_Process"].IsEmpty()) + { + dp.Add("F_Process", queryParam["F_Process"].ToString(), DbType.String); + strSql.Append(" AND t.F_Process = @F_Process "); + } + if (!queryParam["F_DepartmentId"].IsEmpty()) + { + dp.Add("F_DepartmentId", queryParam["F_DepartmentId"].ToString(), DbType.String); + strSql.Append(" AND t.F_DepartmentId = @F_DepartmentId "); + } + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取屏幕显示数据 + /// + /// + public DataTable GetList() + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + SUM(CASE WHEN F_Process='01' AND F_Status='1' THEN F_Qty ELSE 0 END) as '1-1' , + SUM(CASE WHEN F_Process='01' AND F_Status='2' THEN F_Qty ELSE 0 END) as '1-2' , + SUM(CASE WHEN F_Process='02' AND F_Status='1' THEN F_Qty ELSE 0 END) as '2-1' , + SUM(CASE WHEN F_Process='02' AND F_Status='2' THEN F_Qty ELSE 0 END) as '2-2' , + SUM(CASE WHEN F_Process='03' AND F_Status='1' THEN F_Qty ELSE 0 END) as '3-1' , + SUM(CASE WHEN F_Process='03' AND F_Status='2' THEN F_Qty ELSE 0 END) as '3-2' , + SUM(CASE WHEN F_Process='04' AND F_Status='1' THEN F_Qty ELSE 0 END) as '4-1' , + SUM(CASE WHEN F_Process='04' AND F_Status='2' THEN F_Qty ELSE 0 END) as '4-2' + "); + strSql.Append(" FROM LR_Demo_WorkOrder"); + strSql.Append(" WHERE 1=1 "); + return this.BaseRepository().FindTable(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取套打数据 + /// + /// 主键 + /// + public DataTable GetPrintItem(string keyValue) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + F_Code as '工单单号' + ,F_Code as '研发单号' + ,'A0980' as '生产料号' + ,'宝骏乘用车' as '品名' + ,F_Spec as '规格' + ,'A4仓' as '物料情况' + ,'标准样品' as '样品' + ,F_Spec as '样品品名' + ,'2019-07-30' as '单据日期' + ,'2019-05-15' as '订单日期' + ,'2019-09-28' as '交货日期' + ,F_ManagerId as '生管人员' + ,'杨伟' as '业务员' + ,'国六标准' as '机型' + "); + strSql.Append(" FROM LR_Demo_WorkOrder "); + strSql.Append(" WHERE 1=1 "); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!string.IsNullOrEmpty(keyValue)) + { + dp.Add("F_Id", keyValue, DbType.String); + strSql.Append(" AND F_Id = @F_Id "); + } + return this.BaseRepository().FindTable(strSql.ToString(),dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取LR_Demo_WorkOrder表实体数据 + /// 主键 + /// + /// + public LR_Demo_WorkOrderEntity GetLR_Demo_WorkOrderEntity(string keyValue) + { + try + { + return this.BaseRepository().FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + public LR_Demo_WorkOrderEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository().FindEntity(t => t.F_Id == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取树形数据 + /// + /// + public DataTable GetSqlTree() + { + try + { + return this.BaseRepository().FindTable(" select * from lr_base_department "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository().Delete(t => t.F_Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, LR_Demo_WorkOrderEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository().Update(entity); + } + else + { + entity.Create(); + this.BaseRepository().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 2587becbc..e68e86dcf 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 @@ -242,6 +242,19 @@ + + + + + + + + + + + + +