+
+
+
+
+
+
+
+
-
+
-
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 = $('');
+ $month.append($y);
+ w = 0;
+ }
+ $day.append('');
+ 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 = $('');
+ $month.append($y);
+ w = 0;
+ }
+ $day.append('');
+ 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 = $('');
+ $month.append($y);
+ w = 0;
+ }
+ $day.append('');
+ 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 = $('');
+ $month.append($y);
+ w = 0;
+ }
+ $day.append('');
+ 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 提交数据
+
+ ///