list)
+ {
+ fualityReportChildIBLL.SaveList(keyValue, list);
+
+ return Success("保存成功!");
+ }
+ ///
+ /// 提交
+ ///
+ ///
+ [HttpPost]
+ [AjaxOnly]
+ public ActionResult UpdateState(string keyValue, int Status)
+ {
+ fualityReportChildIBLL.UpdateState(keyValue, Status);
+
+ return Success("操作成功!");
+ }
+ ///
+ /// 删除
+ ///
+ ///
+ [HttpPost]
+ [AjaxOnly]
+ public ActionResult DeleteForm(string keyValue)
+ {
+ fualityReportChildIBLL.DeleteEntity(keyValue);
+
+ return Success("删除成功!");
+ }
+
+ #endregion
+
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Form.cshtml
new file mode 100644
index 000000000..dd069bcfa
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Form.cshtml
@@ -0,0 +1,27 @@
+@{
+ ViewBag.Title = "计算项目管理";
+ Layout = "~/Views/Shared/_Form.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/CalculateProject/Form.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Form.js
new file mode 100644
index 000000000..61f645896
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Form.js
@@ -0,0 +1,70 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-22 10:04
+ * 描 述:计算项目管理
+ */
+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 () {
+ $('#Type').lrDataItemSelect({
+ code: 'projectType', select: function (item) {
+ if (item) {
+ if (item.id == '常量') {
+ $("#valueDiv").attr("style", "display:block;");
+ } else {
+ $("#valueDiv").attr("style", "display:none;");
+ }
+ }
+ }
+ });
+ $('#IsEnable').lrRadioCheckbox({
+ type: 'radio',
+ code: 'EnableStatus',
+ });
+ },
+ initData: function () {
+ if (!!keyValue) {
+ $.lrSetForm(top.$.rootUrl + '/LR_Desktop/CalculateProject/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 strEntity = JSON.stringify($('body').lrGetFormData());
+ if (strEntity.type == '常量' && !strEntity.value) {
+ return learun.alert.warning('值不能为空!');
+ }
+
+ var postData = {
+ strEntity: strEntity
+ };
+ $.lrSaveForm(top.$.rootUrl + '/LR_Desktop/CalculateProject/SaveForm?keyValue=' + keyValue, postData, function (res) {
+ // 保存成功后才回调
+ if (!!callBack) {
+ callBack();
+ }
+ });
+ };
+ page.init();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.cshtml
new file mode 100644
index 000000000..91bfd0f93
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.cshtml
@@ -0,0 +1,41 @@
+@{
+ ViewBag.Title = "计算项目管理";
+ Layout = "~/Views/Shared/_Index.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/CalculateProject/Index.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.js
new file mode 100644
index 000000000..e5aca768f
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.js
@@ -0,0 +1,110 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-22 10:04
+ * 描 述:计算项目管理
+ */
+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);
+ $('#Type').lrDataItemSelect({ code: 'projectType' });
+ // 刷新
+ $('#lr_refresh').on('click', function () {
+ location.reload();
+ });
+ // 新增
+ $('#lr_add').on('click', function () {
+ learun.layerForm({
+ id: 'form',
+ title: '新增',
+ url: top.$.rootUrl + '/LR_Desktop/CalculateProject/Form',
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ });
+ // 编辑
+ $('#lr_edit').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerForm({
+ id: 'form',
+ title: '编辑',
+ url: top.$.rootUrl + '/LR_Desktop/CalculateProject/Form?keyValue=' + keyValue,
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ }
+ });
+ // 删除
+ $('#lr_delete').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerConfirm('是否确认删除该项!', function (res) {
+ if (res) {
+ learun.deleteForm(top.$.rootUrl + '/LR_Desktop/CalculateProject/DeleteForm', { keyValue: keyValue}, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ // 打印
+ $('#lr_print').on('click', function () {
+ $('#gridtable').jqprintTable();
+ });
+ },
+ // 初始化列表
+ initGird: function () {
+ $('#gridtable').jfGrid({
+ url: top.$.rootUrl + '/LR_Desktop/CalculateProject/GetPageList',
+ headData: [
+ { label: "计算项", name: "Name", width: 150, align: "left"},
+ { label: "类型", name: "Type", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op,$cell) {
+ learun.clientdata.getAsync('dataItem', {
+ key: value,
+ code: 'projectType',
+ callback: function (_data) {
+ callback(_data.text);
+ }
+ });
+ }},
+ { label: "值", name: "Value", width: 100, align: "left"},
+ { label: "排序", name: "Sort", width: 100, align: "left"},
+ { label: "是否启用", name: "IsEnable", width: 100, align: "left",
+ formatter: function (cellvalue) {
+ return cellvalue == 1 ? "" : "";
+ }},
+ ],
+ mainId:'Id',
+ isPage: true,
+ sidx: 'Sort',
+ sord: 'ASC',
+ });
+ 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_Desktop/Views/FormulaChild/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Form.cshtml
new file mode 100644
index 000000000..fd089aab2
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Form.cshtml
@@ -0,0 +1,19 @@
+@{
+ ViewBag.Title = "公式子表";
+ Layout = "~/Views/Shared/_Form.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/FormulaChild/Form.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Form.js
new file mode 100644
index 000000000..ed3a502c6
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Form.js
@@ -0,0 +1,52 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-22 11:26
+ * 描 述:公式子表
+ */
+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 () {
+ $('#MainId').lrDataSourceSelect({ code: 'FormulaMain',value: 'id',text: 'name' });
+ $('#ProjectId').lrDataSourceSelect({ code: 'CalculateProject',value: 'id',text: 'name' });
+ },
+ initData: function () {
+ if (!!keyValue) {
+ $.lrSetForm(top.$.rootUrl + '/LR_Desktop/FormulaChild/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_Desktop/FormulaChild/SaveForm?keyValue=' + keyValue, postData, function (res) {
+ // 保存成功后才回调
+ if (!!callBack) {
+ callBack();
+ }
+ });
+ };
+ page.init();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Index.cshtml
new file mode 100644
index 000000000..e5eeb6d2e
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Index.cshtml
@@ -0,0 +1,37 @@
+@{
+ ViewBag.Title = "公式子表";
+ Layout = "~/Views/Shared/_Index.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/FormulaChild/Index.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Index.js
new file mode 100644
index 000000000..b554c9c6c
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Index.js
@@ -0,0 +1,136 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-22 11:26
+ * 描 述:公式子表
+ */
+var refreshGirdData;
+var bootstrap = function ($, learun) {
+ "use strict";
+ var page = {
+ init: function () {
+ page.initGird();
+ page.bind();
+ },
+ bind: function () {
+ // 初始化左侧树形数据
+ $('#dataTree').lrtree({
+ url: top.$.rootUrl + '/LR_Desktop/FormulaChild/GetTree',
+ nodeClick: function (item) {
+ page.search({ MainId: item.value });
+ }
+ });
+ // 刷新
+ $('#lr_refresh').on('click', function () {
+ location.reload();
+ });
+ // 新增
+ $('#lr_add').on('click', function () {
+ learun.layerForm({
+ id: 'form',
+ title: '新增',
+ url: top.$.rootUrl + '/LR_Desktop/FormulaChild/Form',
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ });
+ // 编辑
+ $('#lr_edit').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerForm({
+ id: 'form',
+ title: '编辑',
+ url: top.$.rootUrl + '/LR_Desktop/FormulaChild/Form?keyValue=' + keyValue,
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ }
+ });
+ // 删除
+ $('#lr_delete').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerConfirm('是否确认删除该项!', function (res) {
+ if (res) {
+ learun.deleteForm(top.$.rootUrl + '/LR_Desktop/FormulaChild/DeleteForm', { keyValue: keyValue }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ //分类管理
+ $('#lr_main').on('click', function () {
+ learun.layerForm({
+ id: 'index',
+ title: '分类管理',
+ url: top.$.rootUrl + '/LR_Desktop/FormulaMain/Index',
+ width: 1000,
+ height: 700,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+
+ });
+
+ // 打印
+ $('#lr_print').on('click', function () {
+ $('#gridtable').jqprintTable();
+ });
+ },
+ // 初始化列表
+ initGird: function () {
+ $('#gridtable').lrAuthorizeJfGrid({
+ url: top.$.rootUrl + '/LR_Desktop/FormulaChild/GetPageList',
+ headData: [
+ {
+ label: "上级", name: "MainId", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'FormulaMain',
+ key: value,
+ keyId: '',
+ callback: function (_data) {
+ callback(_data['']);
+ }
+ });
+ }
+ },
+ {
+ label: "计算项目", name: "ProjectId", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CalculateProject',
+ key: value,
+ keyId: 'id',
+ callback: function (_data) {
+ callback(_data['name']);
+ }
+ });
+ }
+ },
+ { label: "顺序", name: "Sort", width: 100, align: "left" },
+ ],
+ mainId: 'Id',
+ isPage: true
+ });
+ page.search();
+ },
+ search: function (param) {
+ param = param || {};
+ $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
+ }
+ };
+ refreshGirdData = function () {
+ $('#gridtable').jfGridSet('reload');
+ };
+ page.init();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Form.cshtml
new file mode 100644
index 000000000..1800d2eb1
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Form.cshtml
@@ -0,0 +1,23 @@
+@{
+ ViewBag.Title = "公式管理";
+ Layout = "~/Views/Shared/_Form.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/FormulaMain/Form.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Form.js
new file mode 100644
index 000000000..16fd0da23
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Form.js
@@ -0,0 +1,54 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-22 11:07
+ * 描 述:公式管理
+ */
+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 () {
+ $('#IsEnable').lrRadioCheckbox({
+ type: 'radio',
+ code: 'EnableStatus',
+ });
+ },
+ initData: function () {
+ if (!!keyValue) {
+ $.lrSetForm(top.$.rootUrl + '/LR_Desktop/FormulaMain/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_Desktop/FormulaMain/SaveForm?keyValue=' + keyValue, postData, function (res) {
+ // 保存成功后才回调
+ if (!!callBack) {
+ callBack();
+ }
+ });
+ };
+ page.init();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.cshtml
new file mode 100644
index 000000000..54c3d5763
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.cshtml
@@ -0,0 +1,18 @@
+@{
+ ViewBag.Title = "公式子表";
+ Layout = "~/Views/Shared/_Form.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/FormulaMain/FormChild.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.js
new file mode 100644
index 000000000..8260a32f0
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.js
@@ -0,0 +1,217 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-22 11:26
+ * 描 述:公式子表
+ */
+var acceptClick;
+var keyValue = request('keyValue');
+var arr = [];
+var bootstrap = function ($, learun) {
+ "use strict";
+ var page = {
+ init: function () {
+ $('.lr-form-wrap').lrscroll();
+ page.bind();
+ page.initData();
+ page.addcontent();
+ },
+ bind: function () {
+ $('#MainId').lrselect({
+ allowSearch: true,
+ url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetList',
+ value: "Id",
+ text: "Name"
+ });
+ //$('#MainId').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' });
+ $('#ProjectId').lrDataSourceSelect({ code: 'CalculateProject', value: 'id', text: 'name' });
+ $('#MainId').lrselectSet(keyValue);
+ // 新增
+ $('#lr_add').on('click', function () {
+ page.addcontent();
+ });
+ // 删除
+ $('#form').on('click',
+ '.child_delete',
+ function () {
+ var id = $(this).attr("id");
+ //删除当前行
+ $('#' + id).remove();
+ arr.forEach(item => {
+ if (item.iid == id) {
+ //如果存在删除
+ removeByValue(arr, 'iid', id);
+ }
+ });
+ ////从数组删除
+ ////如果存在删除
+ //removeByValue(arr, 'iid', id);
+
+ //重新排序并显示
+ arr.sort(sortBy("Sort"));
+ page.refreshRes();
+ });
+
+ //失去焦点,重新排序并显示
+ $('#form').on('blur',
+ '.sort',
+ function () {
+ var id = $(this)[0].id;
+ var parId = id.replace('Sort', '');
+ arr.forEach(m => {
+ if (m.iid == parId) {
+ return m.Sort = $('#' + id).val();
+ }
+ });
+ arr.sort(sortBy("Sort"));
+ page.refreshRes();
+ });
+ },
+ initData: function () {
+ if (!!keyValue) {
+ $.lrSetForm(top.$.rootUrl + '/LR_Desktop/FormulaMain/GetFormChildList?keyValue=' + keyValue, function (data) {
+ $('#content1').html('');
+ var html = '';
+ if (data && data.length > 0) {
+ for (var i = 0; i < data.length; i++) {
+ var id = learun.newGuid();
+ var html = '';
+ html += '';
+ html += '
';
+ html += '
';
+ html += '
';
+
+ $('#content1').append(html);
+ $('#pro' + id).lrselect({
+ allowSearch: true,
+ url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetCalProject',
+ param: { strWhere: "1=1 " },
+ value: "id",
+ text: "name",
+ select:
+ function (item) {
+ if (item) {
+ var id = $(this).attr('id');
+ var parId = id.replace('pro', '');
+
+ arr.forEach(item => {
+ if (item.iid == parId) {
+ //如果存在删除
+ removeByValue(arr, 'iid', parId);
+ }
+ });
+ arr.push({ iid: parId, ProjectId: item.id, ProjectName: item.name, Sort: $('#Sort' + parId).val() });
+
+ arr.sort(sortBy("Sort"));
+ page.refreshRes();
+ }
+ }
+ });
+
+ $('#pro' + id).lrselectSet(data[i].ProjectId);
+ }
+
+ } else {
+ page.addcontent();
+ }
+ });
+ }
+ },
+ addcontent: function () {
+ var id = learun.newGuid();
+ var html = '';
+ html += '';
+ html += '
';
+ html += '
';
+ html += '
';
+ $('#content1').append(html);
+
+ $('#pro' + id).lrselect({
+ allowSearch: true,
+ url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetCalProject',
+ param: { strWhere: "1=1 " },
+ value: "id",
+ text: "name",
+ select:
+ function (item) {
+ if (item) {
+ var id = $(this).attr('id');
+ var parId = id.replace('pro', '');
+ arr.forEach(item => {
+ if (item.iid == parId) {
+ //如果存在删除
+ removeByValue(arr, 'iid', parId);
+ }
+ });
+ arr.push({ iid: parId, ProjectId: item.id, ProjectName: item.name, Sort: $('#Sort' + parId).val() });
+
+ arr.sort(sortBy("Sort"));
+ page.refreshRes();
+ }
+ }
+ });
+
+ },
+ refreshRes: function () {
+ //页面显示公式结果
+ var text = '';
+ arr.forEach(m => {
+ text += m.ProjectName;
+ });
+ $('#result').html(text);
+ }
+ };
+ // 保存数据
+ acceptClick = function (callBack) {
+ if (!$('body').lrValidform()) {
+ return false;
+ }
+ var strEntity = JSON.stringify($('body').lrGetFormData());
+
+ if (arr.length == 0) {
+ return learun.alert.warning('请选择计算项目!');
+ }
+ var postData = {
+ //mainEntity: strEntity,
+ strEntity: arr
+ };
+ $.lrSaveForm(top.$.rootUrl + '/LR_Desktop/FormulaChild/SaveList?MainId=' + keyValue, postData, function (res) {
+ // 保存成功后才回调
+ if (!!callBack) {
+ callBack();
+ }
+ });
+ };
+ page.init();
+ //删除数组元素
+ function removeByValue(arr, attr, value) {
+ var index = 0;
+ for (var i in arr) {
+ if (arr[i][attr] == value) {
+ index = i;
+ break;
+ }
+ }
+ arr.splice(index, 1);
+ }
+
+ //数组排序
+ function sortBy(props) {
+ return function (a, b) {
+ return a[props] - b[props];
+ }
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.cshtml
new file mode 100644
index 000000000..447c34b17
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.cshtml
@@ -0,0 +1,38 @@
+@{
+ ViewBag.Title = "公式管理";
+ Layout = "~/Views/Shared/_Index.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/FormulaMain/Index.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js
new file mode 100644
index 000000000..1908348ec
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js
@@ -0,0 +1,118 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-22 11:07
+ * 描 述:公式管理
+ */
+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_Desktop/FormulaMain/Form',
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ });
+ // 编辑
+ $('#lr_edit').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerForm({
+ id: 'form',
+ title: '编辑',
+ url: top.$.rootUrl + '/LR_Desktop/FormulaMain/Form?keyValue=' + keyValue,
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ }
+ });
+ // 设置公式
+ $('#lr_editgs').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerForm({
+ id: 'form',
+ title: '设置公式',
+ url: top.$.rootUrl + '/LR_Desktop/FormulaMain/FormChild?keyValue=' + keyValue,
+ width: 600,
+ height: 500,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ }
+ });
+ // 删除
+ $('#lr_delete').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerConfirm('是否确认删除该项!', function (res) {
+ if (res) {
+ learun.deleteForm(top.$.rootUrl + '/LR_Desktop/FormulaMain/DeleteForm', { keyValue: keyValue }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ // 打印
+ $('#lr_print').on('click', function () {
+ $('#gridtable').jqprintTable();
+ });
+ },
+ // 初始化列表
+ initGird: function () {
+ $('#gridtable').jfGrid({
+ url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetPageList',
+ headData: [
+ { label: "名称", name: "Name", width: 150, align: "left" },
+ { label: "公式", name: "Result", width: 350, align: "left" },
+ { label: "排序", name: "Sort", width: 100, align: "left" },
+ { label: "描述", name: "Desc", width: 200, align: "left" },
+ {
+ label: "启用", name: "IsEnable", width: 100, align: "left",
+ formatter: function (cellvalue) {
+ return cellvalue == 1 ? "" : "";
+ }
+ }
+ ],
+ mainId: 'Id',
+ isPage: true,
+ sidx: 'Sort',
+ sord: 'ASC',
+ });
+ 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_Desktop/Views/QualityReport/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.cshtml
new file mode 100644
index 000000000..82f4dcb7b
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.cshtml
@@ -0,0 +1,12 @@
+@{
+ ViewBag.Title = "数据上报";
+ Layout = "~/Views/Shared/_Form.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/QualityReport/Form.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.js
new file mode 100644
index 000000000..244559307
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.js
@@ -0,0 +1,104 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-22 11:07
+ * 描 述:数据上报
+ */
+var acceptClick;
+var keyValue = request('keyValue');
+var mainId = request('mainId');
+var ProjectName = request('ProjectName');
+var arr = [];
+var bootstrap = function ($, learun) {
+ "use strict";
+ var page = {
+ init: function () {
+ $('.lr-form-wrap').lrscroll();
+ page.bind();
+ page.initData();
+ },
+ bind: function () {
+ //文本框失去焦点,计算结果
+ $('#form').on('blur',
+ '.value',
+ function () {
+ var id = $(this)[0].id;
+ arr.forEach(m => {
+ if (m.Id == id) {
+ return m.Value = $('#' + id).val();
+ }
+ });
+ page.refreshRes();
+ });
+ },
+ initData: function () {
+ if (!!keyValue) {
+ $.lrSetForm(top.$.rootUrl + '/LR_Desktop/QualityReport/GetFormData?keyValue=' + keyValue + '&mainId=' + mainId, function (data) {
+
+ $('#content').html('');
+ for (var i = 0; i < data.length; i++) {
+ var id = data[i].Id;
+ arr.push({ Id: id, Value: data[i].Value, Sort: data[i].Sort, ProjectId: data[i].ProjectId });
+ var html = '';
+ html += '';
+ html += '';
+
+ $('#content').append(html);
+ $('#' + id).val(data[i].Value);
+ //CalType CalName
+ $('#pro' + id).lrDataSourceSelect({
+ code: 'CalculateProject',
+ value: 'id',
+ text: 'name'
+ });
+ $('#pro' + id).lrselectSet(data[i].ProjectId);
+ }
+ page.refreshRes();
+ });
+ }
+ },
+ refreshRes: function () {
+ //页面显示计算结果
+ var text = '';
+ arr.forEach(m => {
+ text += m.Value;
+ });
+ $('#result').html(text);
+ }
+ };
+ // 保存数据
+ acceptClick = function (callBack) {
+ if (!$('body').lrValidform()) {
+ return false;
+ }
+ if (arr.count <= 0) {
+ return learun.alert.warning('请设置上报数据!');
+ }
+
+ var postData = {
+ list: arr //JSON.stringify($('body').lrGetFormData())
+ };
+ $.lrSaveForm(top.$.rootUrl + '/LR_Desktop/QualityReport/SaveList?keyValue=' + keyValue, postData, function (res) {
+ // 保存成功后才回调
+ if (!!callBack) {
+ callBack();
+ }
+ });
+ };
+ page.init();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/FormView.cshtml
new file mode 100644
index 000000000..33f7bebba
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/FormView.cshtml
@@ -0,0 +1,12 @@
+@{
+ ViewBag.Title = "数据上报";
+ Layout = "~/Views/Shared/_Form.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/QualityReport/FormView.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/FormView.js
new file mode 100644
index 000000000..3e0bb12eb
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/FormView.js
@@ -0,0 +1,106 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-22 11:07
+ * 描 述:数据上报
+ */
+var acceptClick;
+var keyValue = request('keyValue');
+var mainId = request('mainId');
+var ProjectName = request('ProjectName');
+var arr = [];
+var bootstrap = function ($, learun) {
+ "use strict";
+ var page = {
+ init: function () {
+ $('.lr-form-wrap').lrscroll();
+ page.bind();
+ page.initData();
+ },
+ bind: function () {
+ //文本框失去焦点,计算结果
+ $('#form').on('blur',
+ '.value',
+ function () {
+ var id = $(this)[0].id;
+ arr.forEach(m => {
+ if (m.Id == id) {
+ return m.Value = $('#' + id).val();
+ }
+ });
+
+ page.refreshRes();
+
+ });
+ },
+ initData: function () {
+ if (!!keyValue) {
+ $.lrSetForm(top.$.rootUrl + '/LR_Desktop/QualityReport/GetFormData?keyValue=' + keyValue + '&mainId=' + mainId, function (data) {
+
+ $('#content').html('');
+ for (var i = 0; i < data.length; i++) {
+ var id = data[i].Id;
+ arr.push({ Id: id, Value: data[i].Value, Sort: data[i].Sort, ProjectId: data[i].ProjectId });
+ var html = '';
+ html += '';
+ html += '';
+
+ $('#content').append(html);
+ $('#' + id).val(data[i].Value);
+ //CalType CalName
+ $('#pro' + id).lrDataSourceSelect({
+ code: 'CalculateProject',
+ value: 'id',
+ text: 'name'
+ });
+ $('#pro' + id).lrselectSet(data[i].ProjectId);
+ }
+ page.refreshRes();
+ });
+ }
+ },
+ refreshRes: function () {
+ //页面显示计算结果
+ var text = '';
+ arr.forEach(m => {
+ text += m.Value;
+ });
+ $('#result').html(text);
+ }
+ };
+ // 保存数据
+ acceptClick = function (callBack) {
+ if (!$('body').lrValidform()) {
+ return false;
+ }
+ console.log('save', arr);
+ //return;
+ var postData = {
+ list: arr //JSON.stringify($('body').lrGetFormData())
+ };
+ $.lrSaveForm(top.$.rootUrl + '/LR_Desktop/QualityReport/SaveList?keyValue=' + keyValue, postData, function (res) {
+ // 保存成功后才回调
+ if (!!callBack) {
+ callBack();
+ }
+ });
+ };
+ page.init();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.cshtml
new file mode 100644
index 000000000..1375450e3
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.cshtml
@@ -0,0 +1,42 @@
+@{
+ ViewBag.Title = "数据上报";
+ Layout = "~/Views/Shared/_Index.cshtml";
+}
+
+
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/QualityReport/Index.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.js
new file mode 100644
index 000000000..d703314b2
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.js
@@ -0,0 +1,228 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-28 11:07
+ * 描 述:数据上报
+ */
+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 () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ var ProjectName = $('#gridtable').jfGridValue('ProjectName');
+ learun.httpAsyncGet(top.$.rootUrl + '/LR_Desktop/QualityReport/IsCanReport?keyValue=' + keyValue, function (res) {
+ if (res.code == 200) {
+ learun.layerForm({
+ id: 'form',
+ title: ProjectName + '填报',
+ url: top.$.rootUrl + '/LR_Desktop/QualityReport/Form?keyValue=' + keyValue + '&ProjectName=' + ProjectName,
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ }
+ else {
+ learun.alert.error(res.info);
+ }
+ });
+
+ }
+ });
+ // 删除
+ $('#lr_delete').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerConfirm('是否确认删除该项!', function (res) {
+ if (res) {
+ learun.deleteForm(top.$.rootUrl + '/LR_Desktop/FormulaMain/DeleteForm', { keyValue: keyValue }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ // 打印
+ $('#lr_print').on('click', function () {
+ $('#gridtable').jqprintTable();
+ });
+ },
+ // 初始化列表
+ initGird: function () {
+ $('#gridtable').jfGrid({
+ url: top.$.rootUrl + '/LR_Desktop/QualityReport/GetPageListForReport',
+ headData: [
+ { label: "核心工作模块", name: "WorderModule", width: 300, align: "left" },
+ { label: "项目名称", name: "ProjectName", width: 300, align: "left" },
+ {
+ label: "填报周期", name: "FillingCycle", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('dataItem', {
+ key: value,
+ code: 'ThisCycle',
+ callback: function (_data) {
+ callback(_data.text);
+ }
+ });
+ }
+ },
+ {
+ label: "填报时间", name: "FillingTime", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ if (value.indexOf(',') != -1) {
+ var content = '';
+ var timearr = value.split(',');
+ for (var i = 0; i < timearr.length; i++) {
+ learun.clientdata.getAsync('dataItem',
+ {
+ key: timearr[i],
+ code: 'CycleTime',
+ callback: function (_data) {
+ content += _data.text + ',';
+ }
+ });
+ }
+ content = content.substring(0, content.length - 1);
+ callback(content);
+ } else {
+ learun.clientdata.getAsync('dataItem',
+ {
+ key: value,
+ code: 'CycleTime',
+ callback: function (_data) {
+ callback(_data.text);
+ }
+ });
+ }
+ }
+ },
+ {
+ label: "填报部门", name: "FillingDept", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
+ key: value,
+ keyId: 'id',
+ callback: function (_data) {
+ callback(_data['name']);
+ }
+ });
+ }
+ },
+ {
+ label: "填报人", name: "FillingPeople", width: 150, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
+ key: value,
+ keyId: 'f_userid',
+ callback: function (_data) {
+ callback(_data['f_realname']);
+ }
+ });
+ }
+ },
+ //{
+ // label: "状态", name: "State", width: 150, align: "center",
+ // formatter: function (cellvalue) {
+ // if (cellvalue === 0) {
+ // return '草稿';
+ // } else if (cellvalue === 1) {
+ // return '待设置填报人';
+ // } else if (cellvalue === 2) {
+ // return '待设置公式';
+ // } else {
+ // return '已完成';
+ // }
+ // }
+ //},
+ { label: "备注", name: "Demo", width: 300, align: "left" },
+ ],
+ mainId: 'Id',
+ isPage: true,
+ sidx: 'FillingTime',
+ sord: 'DESC',
+ isSubGrid: true, // 是否有子表单
+ subGridExpanded: function (subContentId, rowItem) {
+ $('#' + subContentId).jfGrid({
+ url: top.$.rootUrl + '/LR_Desktop/QualityReport/GetList',
+ headData: [
+ //{ label: "核心工作模块", name: "WorderModule", width: 300, align: "left" },
+ //{ label: "项目名称", name: "ProjectName", width: 300, align: "left" },
+ {
+ label: "填报部门", name: "FillingDept", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
+ key: value,
+ keyId: 'id',
+ callback: function (_data) {
+ callback(_data['name']);
+ }
+ });
+ }
+ },
+ {
+ label: "填报人", name: "CreateUserName", width: 150, align: "left"
+ },
+ {
+ label: "公式计算结果", name: "Result", width: 150, align: "left"
+ },
+ {
+ label: "填报时间", name: "ReportTime", width: 150, align: "left", formatter: function (cellvalue) {
+ return learun.formatDate(cellvalue, 'yyyy-MM');
+ }
+ },
+ {
+ label: "状态", name: "Status", width: 150, align: "left",
+ formatter: function (cellvalue) {
+ if (cellvalue === 0) {
+ return '草稿';
+ } else if (cellvalue === 1) {
+ return '完成';
+ } else if (cellvalue === 99) {
+ return '作废';
+ }
+ }
+ },
+ ],
+ mainId: 'Id',
+ isPage: false,
+ });
+ var param;
+ param = param || {};
+ param.FillInFromId = rowItem.Id;
+ $('#' + subContentId).jfGridSet('reload', { queryJson: JSON.stringify(param) });
+ }
+ });
+ page.search();
+ },
+ search: function (param) {
+ param = param || {};
+ param.SqlParameter = ' AND (FillingPeople is not null and len(FillingPeople)>0) and (Formula is not null and len(Formula)>0) and IsFlag=0 and [State]=2';
+ param.FillingPeople = learun.clientdata.get(['userinfo']).userId;
+
+ $('#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_Desktop/Views/QualityReport/IndexReport.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml
new file mode 100644
index 000000000..58f3248cb
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml
@@ -0,0 +1,83 @@
+@{
+ ViewBag.Title = "上报数据管理";
+ Layout = "~/Views/Shared/_Index.cshtml";
+}
+
+
+@**@
+@Html.AppendJsFile("/Areas/LR_Desktop/Views/QualityReport/IndexReport.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js
new file mode 100644
index 000000000..ddc20314e
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js
@@ -0,0 +1,196 @@
+/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
+ * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ * 创建人:超级管理员
+ * 日 期:2021-06-25 11:07
+ * 描 述:上报数据管理
+ */
+var refreshGirdData;
+var FillInFromId;
+var bootstrap = function ($, learun) {
+ "use strict";
+ var page = {
+ init: function () {
+ page.inittree();
+ page.initGird();
+ page.bind();
+ },
+ bind: function () {
+ $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
+ page.search(queryJson);
+ }, 220, 400);
+ // 刷新
+ $('#lr_refresh').on('click', function () {
+ location.reload();
+ });
+
+ // 编辑
+ $('#lr_edit').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('fid');
+ var mainId = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ var Status = $('#gridtable').jfGridValue('Status');
+ if (Status == 1) {
+ return learun.alert.warning('该项已提交,不可编辑!');
+ }
+ learun.layerForm({
+ id: 'form',
+ title: '编辑',
+ url: top.$.rootUrl + '/LR_Desktop/QualityReport/Form?keyValue=' + keyValue + '&mainId=' + mainId,
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ }
+ });
+ // 查看
+ $('#lr_view').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('fid');
+ var mainId = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerForm({
+ id: 'form',
+ title: '查看',
+ url: top.$.rootUrl + '/LR_Desktop/QualityReport/FormView?keyValue=' + keyValue + '&mainId=' + mainId,
+ width: 600,
+ height: 400,
+ btn: null
+ });
+ }
+ });
+
+ //提交
+ $('#lr_submit').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ var Status = $('#gridtable').jfGridValue('Status');
+ if (Status == 1) {
+ return learun.alert.warning('该项已提交!');
+ }
+ learun.layerConfirm('是否确认提交该项!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/LR_Desktop/QualityReport/UpdateState', { keyValue: keyValue, Status: 1 }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+
+ //撤回
+ $('#lr_nosubmit').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ //var Status = $('#gridtable').jfGridValue('Status');
+ //if (Status == 0) {
+ // return learun.alert.warning('该项已提交!');
+ //}
+ learun.layerConfirm('是否确认撤回该项!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/LR_Desktop/QualityReport/UpdateState', { keyValue: keyValue, Status: 0 }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ //删除
+ $('#lr_delete').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ var Status = $('#gridtable').jfGridValue('Status');
+ if (Status == 1) {
+ return learun.alert.warning('该项已提交,不可删除!');
+ }
+ learun.layerConfirm('是否确认删除该项!', function (res) {
+ if (res) {
+ learun.deleteForm(top.$.rootUrl + '/LR_Desktop/QualityReport/DeleteForm', { keyValue: keyValue }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+
+ // 打印
+ $('#lr_print').on('click', function () {
+ $('#gridtable').jqprintTable();
+ });
+ },
+ inittree: function () {
+ // 初始化左侧树形数据
+ $('#dataTree').lrtree({
+ url: top.$.rootUrl + '/LR_Desktop/QualityReport/GetTree',
+ nodeClick: page.treeNodeClick
+ });
+ },
+ treeNodeClick: function (item) {
+ FillInFromId = item.id;
+ $('#titleinfo').text(item.text);
+ page.search();
+ },
+ // 初始化列表
+ initGird: function () {
+ $('#gridtable').jfGrid({
+ url: top.$.rootUrl + '/LR_Desktop/QualityReport/GetPageList',
+ headData: [
+ { label: "核心工作模块", name: "WorderModule", width: 300, align: "left" },
+ { label: "项目名称", name: "ProjectName", width: 300, align: "left" },
+ {
+ label: "填报部门", name: "FillingDept", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
+ key: value,
+ keyId: 'id',
+ callback: function (_data) {
+ callback(_data['name']);
+ }
+ });
+ }
+ },
+ {
+ label: "填报人", name: "CreateUserName", width: 150, align: "left"
+ },
+ {
+ label: "公式计算结果", name: "Result", width: 150, align: "left"
+ },
+ {
+ label: "填报时间", name: "ReportTime", width: 150, align: "left",
+ formatter: function (cellvalue) {
+ return learun.formatDate(cellvalue, 'yyyy-MM');
+ }
+ },
+ {
+ label: "状态", name: "Status", width: 150, align: "left",
+ formatter: function (cellvalue) {
+ if (cellvalue === 0) {
+ return '草稿';
+ } else if (cellvalue === 1) {
+ return '已提交';
+ } else if (cellvalue === 99) {
+ return '作废';
+ }
+ }
+ },
+ ],
+ mainId: 'Id',
+ isPage: true,
+ sidx: 'ReportTime',
+ sord: 'DESC',
+ });
+ page.search();
+ },
+ search: function (param) {
+ param = param || {};
+ param.FillInFromId = FillInFromId;
+ //param.CreateUserId = learun.clientdata.get(['userinfo']).userId;
+ $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
+ }
+ };
+ refreshGirdData = function () {
+ $('#gridtable').jfGridSet('reload');
+ };
+ page.init();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
index ea26ba23f..a6d9feb5a 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
@@ -324,6 +324,7 @@
+
@@ -388,11 +389,15 @@
+
+
+
+
@@ -965,6 +970,10 @@
+
+
+
+
@@ -1278,12 +1287,23 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -7265,6 +7285,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FillinFromMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FillinFromMap.cs
new file mode 100644
index 000000000..4f161b5bf
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FillinFromMap.cs
@@ -0,0 +1,29 @@
+using Learun.Application.TwoDevelopment.EducationalAdministration;
+using System.Data.Entity.ModelConfiguration;
+
+namespace Learun.Application.Mapping
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-21 18:39
+ /// 描 述:质量目标管理体系指标模块
+ ///
+ public class FillinFromMap : EntityTypeConfiguration
+ {
+ public FillinFromMap()
+ {
+ #region 表、主键
+ //表
+ this.ToTable("FILLINFROM");
+ //主键
+ this.HasKey(t => t.Id);
+ #endregion
+
+ #region 配置关系
+ #endregion
+ }
+ }
+}
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/CalculateProjectMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/CalculateProjectMap.cs
new file mode 100644
index 000000000..78780b402
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/CalculateProjectMap.cs
@@ -0,0 +1,29 @@
+using Learun.Application.TwoDevelopment.LR_Desktop;
+using System.Data.Entity.ModelConfiguration;
+
+namespace Learun.Application.Mapping
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 10:04
+ /// 描 述:计算项目管理
+ ///
+ public class CalculateProjectMap : EntityTypeConfiguration
+ {
+ public CalculateProjectMap()
+ {
+ #region 表、主键
+ //表
+ this.ToTable("CALCULATEPROJECT");
+ //主键
+ this.HasKey(t => t.Id);
+ #endregion
+
+ #region 配置关系
+ #endregion
+ }
+ }
+}
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/FormulaChildMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/FormulaChildMap.cs
new file mode 100644
index 000000000..64782dbd2
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/FormulaChildMap.cs
@@ -0,0 +1,29 @@
+using Learun.Application.TwoDevelopment.LR_Desktop;
+using System.Data.Entity.ModelConfiguration;
+
+namespace Learun.Application.Mapping
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 11:26
+ /// 描 述:公式子表
+ ///
+ public class FormulaChildMap : EntityTypeConfiguration
+ {
+ public FormulaChildMap()
+ {
+ #region 表、主键
+ //表
+ this.ToTable("FORMULACHILD");
+ //主键
+ this.HasKey(t => t.Id);
+ #endregion
+
+ #region 配置关系
+ #endregion
+ }
+ }
+}
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/FormulaMainMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/FormulaMainMap.cs
new file mode 100644
index 000000000..2935e1718
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/FormulaMainMap.cs
@@ -0,0 +1,29 @@
+using Learun.Application.TwoDevelopment.LR_Desktop;
+using System.Data.Entity.ModelConfiguration;
+
+namespace Learun.Application.Mapping
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 11:07
+ /// 描 述:公式管理
+ ///
+ public class FormulaMainMap : EntityTypeConfiguration
+ {
+ public FormulaMainMap()
+ {
+ #region 表、主键
+ //表
+ this.ToTable("FORMULAMAIN");
+ //主键
+ this.HasKey(t => t.Id);
+ #endregion
+
+ #region 配置关系
+ #endregion
+ }
+ }
+}
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/QualityReportChildMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/QualityReportChildMap.cs
new file mode 100644
index 000000000..dda39ca05
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/QualityReportChildMap.cs
@@ -0,0 +1,28 @@
+using Learun.Application.TwoDevelopment.LR_Desktop;
+using System.Data.Entity.ModelConfiguration;
+
+namespace Learun.Application.Mapping
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-23 17:26
+ /// 描 述:上报子表
+ ///
+ public class QualityReportChildMap : EntityTypeConfiguration
+ {
+ public QualityReportChildMap()
+ {
+ #region 表、主键
+ //表
+ this.ToTable("QUALITYREPORTCHILD");
+ //主键
+ this.HasKey(t => t.Id);
+ #endregion
+
+ #region 配置关系
+ #endregion
+ }
+ }
+}
\ No newline at end of file
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/QualityReportMainMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/QualityReportMainMap.cs
new file mode 100644
index 000000000..069e1b7e5
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/QualityReportMainMap.cs
@@ -0,0 +1,28 @@
+using Learun.Application.TwoDevelopment.LR_Desktop;
+using System.Data.Entity.ModelConfiguration;
+
+namespace Learun.Application.Mapping
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-23 17:12
+ /// 描 述:上报主表
+ ///
+ public class QualityReportMainMap : EntityTypeConfiguration
+ {
+ public QualityReportMainMap()
+ {
+ #region 表、主键
+ //表
+ this.ToTable("QUALITYREPORTMAIN");
+ //主键
+ this.HasKey(t => t.Id);
+ #endregion
+
+ #region 配置关系
+ #endregion
+ }
+ }
+}
\ No newline at end of file
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 cacb2b10f..07d86039f 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
@@ -78,6 +78,7 @@
+
@@ -113,8 +114,13 @@
+
+
+
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs
new file mode 100644
index 000000000..21ab5aacf
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs
@@ -0,0 +1,214 @@
+using Learun.Util;
+using System;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.EducationalAdministration
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-21 18:39
+ /// 描 述:质量目标管理体系指标模块
+ ///
+ public class FillinFromBLL : FillinFromIBLL
+ {
+ private FillinFromService fillinFromService = new FillinFromService();
+
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 分页参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ return fillinFromService.GetPageList(pagination, queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 获取页面显示列表数据--数据上报用
+ ///
+ /// 查询参数
+ ///
+ public IEnumerable GetPageListForReport(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ return fillinFromService.GetPageListForReport(pagination, queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取FillinFrom表实体数据
+ ///
+ /// 主键
+ ///
+ public FillinFromEntity GetFillinFromEntity(string keyValue)
+ {
+ try
+ {
+ return fillinFromService.GetFillinFromEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取树形数据
+ ///
+ ///
+ public IEnumerable GetTree(string queryJson)
+ {
+ try
+ {
+ List treeList = new List();
+ var list = fillinFromService.GetSqlTree(queryJson);
+ foreach (var item in list)
+ {
+ TreeModel node = new TreeModel
+ {
+ id = item.Id,
+ text = item.WorderModule + "--" + item.ProjectName,
+ value = item.Id,
+ showcheck = false,
+ checkstate = 0,
+ isexpand = true,
+ parentId = ""
+ };
+ treeList.Add(node);
+ }
+ return treeList.ToTree();
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ fillinFromService.DeleteEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ ///
+ public void SaveEntity(string keyValue, FillinFromEntity entity)
+ {
+ try
+ {
+ fillinFromService.SaveEntity(keyValue, entity);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+
+ #region 扩展数据
+ ///
+ /// 获取CdMajor表实体数据
+ /// 主键
+ ///
+ ///
+ public FillinFromEntity GetFillInNo(string keyValue)
+ {
+ try
+ {
+ return fillinFromService.GetFillInNo(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+ #endregion
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs
new file mode 100644
index 000000000..2e8b2ead9
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs
@@ -0,0 +1,125 @@
+using Learun.Util;
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Learun.Application.TwoDevelopment.EducationalAdministration
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-21 18:39
+ /// 描 述:质量目标管理体系指标模块
+ ///
+ public class FillinFromEntity
+ {
+ #region 实体成员
+ ///
+ /// 主键
+ ///
+ [Column("ID")]
+ public string Id { get; set; }
+ ///
+ /// 工作模块
+ ///
+ [Column("WORDERMODULE")]
+ public string WorderModule { get; set; }
+ ///
+ /// 序号
+ ///
+ [Column("SERIALNO")]
+ public string SerialNo { get; set; }
+ ///
+ /// 项目名称
+ ///
+ [Column("PROJECTNAME")]
+ public string ProjectName { get; set; }
+ ///
+ /// 数1
+ ///
+ [Column("FORMULA")]
+ public string Formula { get; set; }
+ ///
+ /// 结果
+ ///
+ [Column("LASTRESULT")]
+ public string LastResult { get; set; }
+ ///
+ /// 填报周期
+ ///
+ [Column("FILLINGCYCLE")]
+ public string FillingCycle { get; set; }
+ ///
+ /// 填报时间
+ ///
+ [Column("FILLINGTIME")]
+ public string FillingTime { get; set; }
+ ///
+ /// 填报部门
+ ///
+ [Column("FILLINGDEPT")]
+ public string FillingDept { get; set; }
+ ///
+ /// 填报人
+ ///
+ [Column("FILLINGPEOPLE")]
+ public string FillingPeople { get; set; }
+ ///
+ /// 提交人
+ ///
+ [Column("LRPEOPLE")]
+ public string lrPeople { get; set; }
+ ///
+ /// 录入时间
+ ///
+ [Column("LRTIME")]
+ public DateTime? lrTime { get; set; }
+ ///
+ /// 状态 0:草稿 1待指派部门 2待填写公式 3 已完成
+ ///
+ [Column("STATE")]
+ public int? State { get; set; }
+ ///
+ /// Demo
+ ///
+ [Column("DEMO")]
+ public string Demo { get; set; }
+ ///
+ /// 隐藏/显示
+ ///
+ [Column("ISFLAG")]
+ public int? IsFlag { get; set; }
+ #endregion
+
+ #region 扩展操作
+ ///
+ /// 新增调用
+ ///
+ public void Create()
+ {
+ this.Id = Guid.NewGuid().ToString();
+ }
+ ///
+ /// 编辑调用
+ ///
+ ///
+ public void Modify(string keyValue)
+ {
+ this.Id = keyValue;
+ }
+ #endregion
+ #region 扩展字段
+ ///
+ /// 填报时间
+ ///
+ [NotMapped]
+ public string FillingTime1 { get; set; }
+ ///
+ /// 填报时间
+ ///
+ [NotMapped]
+ public string FillingTime2 { get; set; }
+ #endregion
+ }
+}
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs
new file mode 100644
index 000000000..77e498333
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs
@@ -0,0 +1,70 @@
+using Learun.Util;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.EducationalAdministration
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-21 18:39
+ /// 描 述:质量目标管理体系指标模块
+ ///
+ public interface FillinFromIBLL
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ IEnumerable GetPageList(Pagination pagination, string queryJson);
+
+ ///
+ /// 获取页面显示列表数据--数据上报用
+ ///
+ /// 查询参数
+ ///
+ IEnumerable GetPageListForReport(Pagination pagination, string queryJson);
+
+ ///
+ /// 获取FillinFrom表实体数据
+ ///
+ /// 主键
+ ///
+ FillinFromEntity GetFillinFromEntity(string keyValue);
+
+
+ ///
+ /// 获取表实体数据
+ /// 主键
+ ///
+ ///
+ FillinFromEntity GetFillInNo(string keyValue);
+
+ ///
+ /// 获取树形数据
+ ///
+ ///
+ IEnumerable GetTree(string queryJson);
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ void DeleteEntity(string keyValue);
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ void SaveEntity(string keyValue, FillinFromEntity entity);
+ #endregion
+
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs
new file mode 100644
index 000000000..662cbc50b
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs
@@ -0,0 +1,342 @@
+using Dapper;
+using Learun.DataBase.Repository;
+using Learun.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Text;
+
+namespace Learun.Application.TwoDevelopment.EducationalAdministration
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-21 18:39
+ /// 描 述:质量目标管理体系指标模块
+ ///
+ public class FillinFromService : RepositoryFactory
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append("SELECT ");
+ strSql.Append(@"
+ t.Id,
+ t.WorderModule,
+ t.SerialNo,
+ t.ProjectName,
+ t.Formula,
+ t.LastResult,
+ t.FillingCycle,
+ t.FillingTime,
+ t.FillingDept,
+ t.FillingPeople,
+ t.Demo,
+ t.State,
+ t.lrPeople,
+ t.lrTime,
+ t.IsFlag
+ ");
+ strSql.Append(" FROM FillinFrom t ");
+ strSql.Append(" WHERE 1=1 ");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ if (!queryParam["WorderModule"].IsEmpty())
+ {
+ dp.Add("WorderModule", "%" + queryParam["WorderModule"].ToString() + "%", DbType.String);
+ strSql.Append(" AND t.WorderModule Like @WorderModule ");
+ }
+ if (!queryParam["ProjectName"].IsEmpty())
+ {
+ dp.Add("ProjectName", "%" + queryParam["ProjectName"].ToString() + "%", DbType.String);
+ strSql.Append(" AND t.ProjectName Like @ProjectName ");
+ }
+ if (!queryParam["FillingCycle"].IsEmpty())
+ {
+ dp.Add("FillingCycle", queryParam["FillingCycle"].ToString(), DbType.String);
+ strSql.Append(" AND t.FillingCycle = @FillingCycle ");
+ }
+ if (!queryParam["FillingPeople"].IsEmpty() && queryParam["FillingPeople"].ToString() != "System")
+ {
+ dp.Add("FillingPeople", queryParam["FillingPeople"].ToString(), DbType.String);
+ strSql.Append(" AND t.FillingPeople = @FillingPeople ");
+ }
+ if (!queryParam["IsFlag"].IsEmpty())
+ {
+ dp.Add("IsFlag", queryParam["IsFlag"].ToString(), DbType.String);
+ strSql.Append(" AND t.IsFlag = @IsFlag ");
+ }
+ if (queryParam["isSystem"].ToBool() == false)
+ {
+ if (!queryParam["departmentId"].IsEmpty())
+ {
+ dp.Add("FillingDept", queryParam["departmentId"].ToString(), DbType.String);
+ strSql.Append(" AND t.FillingDept = @FillingDept ");
+ }
+ else
+ {
+ dp.Add("FillingDept", "undefined11", DbType.String);
+ strSql.Append(" AND t.FillingDept = @FillingDept ");
+ }
+ }
+ //sql条件
+ if (!queryParam["SqlParameter"].IsEmpty())
+ {
+ strSql.Append(queryParam["SqlParameter"].ToString());
+ }
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 获取页面显示列表数据--数据上报用
+ ///
+ /// 查询参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageListForReport(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append("SELECT ");
+ strSql.Append(@"
+ t.Id,
+ t.WorderModule,
+ t.SerialNo,
+ t.ProjectName,
+ t.Formula,
+ t.LastResult,
+ t.FillingCycle,
+ t.FillingTime,
+ t.FillingDept,
+ t.FillingPeople,
+ t.Demo,
+ t.State,
+ t.lrPeople,
+ t.lrTime,
+ t.IsFlag
+ ");
+ strSql.Append(" FROM FillinFrom t ");
+ strSql.Append(" WHERE 1=1 ");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ if (!queryParam["WorderModule"].IsEmpty())
+ {
+ dp.Add("WorderModule", "%" + queryParam["WorderModule"].ToString() + "%", DbType.String);
+ strSql.Append(" AND t.WorderModule Like @WorderModule ");
+ }
+ if (!queryParam["ProjectName"].IsEmpty())
+ {
+ dp.Add("ProjectName", "%" + queryParam["ProjectName"].ToString() + "%", DbType.String);
+ strSql.Append(" AND t.ProjectName Like @ProjectName ");
+ }
+ if (!queryParam["FillingCycle"].IsEmpty())
+ {
+ dp.Add("FillingCycle", queryParam["FillingCycle"].ToString(), DbType.String);
+ strSql.Append(" AND t.FillingCycle = @FillingCycle ");
+ }
+ if (!queryParam["FillingPeople"].IsEmpty() && queryParam["FillingPeople"].ToString() != "System")
+ {
+ dp.Add("FillingPeople", queryParam["FillingPeople"].ToString(), DbType.String);
+ strSql.Append(" AND t.FillingPeople = @FillingPeople ");
+ }
+ if (!queryParam["IsFlag"].IsEmpty())
+ {
+ dp.Add("IsFlag", queryParam["IsFlag"].ToString(), DbType.String);
+ strSql.Append(" AND t.IsFlag = @IsFlag ");
+ }
+ //sql条件
+ if (!queryParam["SqlParameter"].IsEmpty())
+ {
+ strSql.Append(queryParam["SqlParameter"].ToString());
+ }
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ ///
+ /// 获取FillinFrom表实体数据
+ ///
+ /// 主键
+ ///
+ public FillinFromEntity GetFillinFromEntity(string keyValue)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public IEnumerable GetSqlTree(string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder("select t.* FROM FillinFrom t where IsFlag=0 ");
+ var queryParam = queryJson.ToJObject();
+ if (!queryParam["FillingDept"].IsEmpty())
+ {
+ strSql.Append($" AND t.FillingDept='{queryParam["FillingDept"].ToString()}'");
+ }
+ if (!queryParam["FillingPeople"].IsEmpty())
+ {
+ strSql.Append($" AND t.FillingPeople='{queryParam["FillingPeople"].ToString()}'");
+ }
+
+ strSql.Append($" and (t.[State]=2 or t.[State]=3 )");
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ public void SaveEntity(string keyValue, FillinFromEntity entity)
+ {
+ try
+ {
+ if (!string.IsNullOrEmpty(keyValue))
+ {
+ entity.Modify(keyValue);
+ this.BaseRepository("CollegeMIS").Update(entity);
+ }
+ else
+ {
+ entity.Create();
+ this.BaseRepository("CollegeMIS").Insert(entity);
+ }
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 扩展数据
+
+ ///
+ /// 获取CdMajor表实体数据
+ /// 主键
+ ///
+ ///
+ public FillinFromEntity GetFillInNo(string keyValue)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == keyValue);
+ }
+ 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_Desktop/CalculateProject/CalculateProjectBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectBLL.cs
new file mode 100644
index 000000000..a8b76310a
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectBLL.cs
@@ -0,0 +1,145 @@
+using Learun.Util;
+using System;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 10:04
+ /// 描 述:计算项目管理
+ ///
+ public class CalculateProjectBLL : CalculateProjectIBLL
+ {
+ private CalculateProjectService calculateProjectService = new CalculateProjectService();
+
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 分页参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ return calculateProjectService.GetPageList(pagination, queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取CalculateProject表实体数据
+ ///
+ /// 主键
+ ///
+ public CalculateProjectEntity GetCalculateProjectEntity(string keyValue)
+ {
+ try
+ {
+ return calculateProjectService.GetCalculateProjectEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ public DataTable GetListForDataSource()
+ {
+ try
+ {
+ return calculateProjectService.GetListForDataSource();
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ calculateProjectService.DeleteEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ ///
+ public void SaveEntity(string keyValue, CalculateProjectEntity entity)
+ {
+ try
+ {
+ calculateProjectService.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_Desktop/CalculateProject/CalculateProjectEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectEntity.cs
new file mode 100644
index 000000000..a266e4ffa
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectEntity.cs
@@ -0,0 +1,90 @@
+using Learun.Util;
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 10:04
+ /// 描 述:计算项目管理
+ ///
+ public class CalculateProjectEntity
+ {
+ #region 实体成员
+ ///
+ /// Id
+ ///
+ [Column("ID")]
+ public string Id { get; set; }
+ ///
+ /// 计算项名称
+ ///
+ [Column("NAME")]
+ public string Name { get; set; }
+ ///
+ /// 类型(常量、变量)
+ ///
+ [Column("TYPE")]
+ public string Type { get; set; }
+ ///
+ /// 常量值
+ ///
+ [Column("VALUE")]
+ public string Value { get; set; }
+ ///
+ /// 是否启用
+ ///
+ [Column("ISENABLE")]
+ public int? IsEnable { get; set; }
+ ///
+ /// 排序
+ ///
+ [Column("SORT")]
+ public int? Sort { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [Column("CREATETIME")]
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 创建人
+ ///
+ [Column("CREATEUSERID")]
+ public string CreateUserId { get; set; }
+ ///
+ /// 创建人
+ ///
+ [Column("CREATEUSERNAME")]
+ public string CreateUserName { get; set; }
+ #endregion
+
+ #region 扩展操作
+ ///
+ /// 新增调用
+ ///
+ public void Create()
+ {
+ this.Id = Guid.NewGuid().ToString();
+ this.CreateTime=DateTime.Now;
+ var userinfo = LoginUserInfo.Get();
+ this.CreateUserId = userinfo.userId;
+ this.CreateUserName = userinfo.realName;
+ }
+ ///
+ /// 编辑调用
+ ///
+ ///
+ public void Modify(string keyValue)
+ {
+ this.Id = keyValue;
+ }
+ #endregion
+ #region 扩展字段
+ #endregion
+ }
+}
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectIBLL.cs
new file mode 100644
index 000000000..c0753ad65
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectIBLL.cs
@@ -0,0 +1,53 @@
+using Learun.Util;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 10:04
+ /// 描 述:计算项目管理
+ ///
+ public interface CalculateProjectIBLL
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ IEnumerable GetPageList(Pagination pagination, string queryJson);
+ ///
+ /// 获取CalculateProject表实体数据
+ ///
+ /// 主键
+ ///
+ CalculateProjectEntity GetCalculateProjectEntity(string keyValue);
+ ///
+ ///
+ ///
+ ///
+ DataTable GetListForDataSource();
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ void DeleteEntity(string keyValue);
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ void SaveEntity(string keyValue, CalculateProjectEntity entity);
+ #endregion
+
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectService.cs
new file mode 100644
index 000000000..9f8396504
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectService.cs
@@ -0,0 +1,182 @@
+using Dapper;
+using Learun.DataBase.Repository;
+using Learun.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Text;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 10:04
+ /// 描 述:计算项目管理
+ ///
+ public class CalculateProjectService : RepositoryFactory
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append("SELECT ");
+ strSql.Append(@"
+ t.Id,
+ t.Name,
+ t.Type,
+ t.Value,
+ t.IsEnable,t.Sort
+ ");
+ strSql.Append(" FROM CalculateProject t ");
+ strSql.Append(" WHERE 1=1 ");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ if (!queryParam["Name"].IsEmpty())
+ {
+ dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String);
+ strSql.Append(" AND t.Name Like @Name ");
+ }
+ if (!queryParam["Type"].IsEmpty())
+ {
+ dp.Add("Type", queryParam["Type"].ToString(), DbType.String);
+ strSql.Append(" AND t.Type = @Type ");
+ }
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取CalculateProject表实体数据
+ ///
+ /// 主键
+ ///
+ public CalculateProjectEntity GetCalculateProjectEntity(string keyValue)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public DataTable GetListForDataSource()
+ {
+ try
+ {
+ string sql = $"select Id,Name from CalculateProject where IsEnable=1 ";
+ return this.BaseRepository("CollegeMIS").FindTable(sql);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ public void SaveEntity(string keyValue, CalculateProjectEntity entity)
+ {
+ try
+ {
+ if (!string.IsNullOrEmpty(keyValue))
+ {
+ entity.Modify(keyValue);
+ this.BaseRepository("CollegeMIS").Update(entity);
+ }
+ else
+ {
+ entity.Create();
+ this.BaseRepository("CollegeMIS").Insert(entity);
+ }
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildBLL.cs
new file mode 100644
index 000000000..6a895ad02
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildBLL.cs
@@ -0,0 +1,191 @@
+using Learun.Util;
+using System;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 11:26
+ /// 描 述:公式子表
+ ///
+ public class FormulaChildBLL : FormulaChildIBLL
+ {
+ private FormulaChildService formulaChildService = new FormulaChildService();
+
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 分页参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ return formulaChildService.GetPageList(pagination, queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取FormulaChild表实体数据
+ ///
+ /// 主键
+ ///
+ public FormulaChildEntity GetFormulaChildEntity(string keyValue)
+ {
+ try
+ {
+ return formulaChildService.GetFormulaChildEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+
+ ///
+ /// 获取左侧树形数据
+ ///
+ ///
+ public List GetTree()
+ {
+ try
+ {
+ DataTable list = formulaChildService.GetSqlTree();
+ List treeList = new List();
+ foreach (DataRow item in list.Rows)
+ {
+ TreeModel node = new TreeModel
+ {
+ id = item["Id"].ToString(),
+ text = item["Name"].ToString(),
+ value = item["Id"].ToString(),
+ showcheck = false,
+ checkstate = 0,
+ isexpand = true,
+ parentId = "0",
+ };
+ 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
+ {
+ formulaChildService.DeleteEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ ///
+ public void SaveEntity(string keyValue, FormulaChildEntity entity)
+ {
+ try
+ {
+ formulaChildService.SaveEntity(keyValue, entity);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ ///
+ public void SaveList(string MainId, List strEntity)
+ {
+ try
+ {
+ formulaChildService.SaveList(MainId, strEntity);
+ }
+ 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_Desktop/FormulaChild/FormulaChildEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildEntity.cs
new file mode 100644
index 000000000..e6b7d54e3
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildEntity.cs
@@ -0,0 +1,85 @@
+using Learun.Util;
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 11:26
+ /// 描 述:公式子表
+ ///
+ public class FormulaChildEntity
+ {
+ #region 实体成员
+ ///
+ /// Id
+ ///
+ [Column("ID")]
+ public string Id { get; set; }
+ ///
+ /// 主表Id
+ ///
+ [Column("MAINID")]
+ public string MainId { get; set; }
+ ///
+ /// 计算项目Id
+ ///
+ [Column("PROJECTID")]
+ public string ProjectId { get; set; }
+ ///
+ /// 顺序
+ ///
+ [Column("SORT")]
+ public int? Sort { get; set; }
+ ///
+ /// 创建时间
+ ///
+ [Column("CREATETIME")]
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 创建人
+ ///
+ [Column("CREATEUSERID")]
+ public string CreateUserId { get; set; }
+ ///
+ /// 创建人
+ ///
+ [Column("CREATEUSERNAME")]
+ public string CreateUserName { get; set; }
+ #endregion
+
+ #region 扩展操作
+ ///
+ /// 新增调用
+ ///
+ public void Create()
+ {
+ this.Id = Guid.NewGuid().ToString();
+ this.CreateTime = DateTime.Now;
+ var userinfo = LoginUserInfo.Get();
+ this.CreateUserId = userinfo.userId;
+ this.CreateUserName = userinfo.realName;
+ }
+ ///
+ /// 编辑调用
+ ///
+ ///
+ public void Modify(string keyValue)
+ {
+ this.Id = keyValue;
+ }
+ #endregion
+ #region 扩展字段
+ ///
+ /// 计算项名称
+ ///
+ [NotMapped]
+ public string ProjectName { get; set; }
+
+ #endregion
+ }
+}
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildIBLL.cs
new file mode 100644
index 000000000..4b342b450
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildIBLL.cs
@@ -0,0 +1,55 @@
+using Learun.Util;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 11:26
+ /// 描 述:公式子表
+ ///
+ public interface FormulaChildIBLL
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ IEnumerable GetPageList(Pagination pagination, string queryJson);
+ ///
+ /// 获取FormulaChild表实体数据
+ ///
+ /// 主键
+ ///
+ FormulaChildEntity GetFormulaChildEntity(string keyValue);
+
+ ///
+ /// 获取左侧树形数据
+ ///
+ ///
+ List GetTree();
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ void DeleteEntity(string keyValue);
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ void SaveEntity(string keyValue, FormulaChildEntity entity);
+ void SaveList(string MainId, List strEntity);
+ #endregion
+
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildService.cs
new file mode 100644
index 000000000..fc5675dd6
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildService.cs
@@ -0,0 +1,217 @@
+using Dapper;
+using Learun.DataBase.Repository;
+using Learun.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 11:26
+ /// 描 述:公式子表
+ ///
+ public class FormulaChildService : RepositoryFactory
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append("SELECT ");
+ strSql.Append(@"
+ t.Id,
+ t.MainId,
+ t.ProjectId,
+ t.Sort
+ ");
+ strSql.Append(" FROM FormulaChild t ");
+ strSql.Append(" WHERE 1=1 ");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ if (!queryParam["MainId"].IsEmpty())
+ {
+ dp.Add("MainId", queryParam["MainId"].ToString(), DbType.String);
+ strSql.Append(" AND t.MainId=@MainId ");
+ }
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取FormulaChild表实体数据
+ ///
+ /// 主键
+ ///
+ public FormulaChildEntity GetFormulaChildEntity(string keyValue)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 获取树形数据
+ ///
+ ///
+ public DataTable GetSqlTree()
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindTable(" SELECT Id,Name FROM FormulaMain where IsEnable=1 order by Sort");
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ public void SaveEntity(string keyValue, FormulaChildEntity entity)
+ {
+ try
+ {
+ if (!string.IsNullOrEmpty(keyValue))
+ {
+ entity.Modify(keyValue);
+ this.BaseRepository("CollegeMIS").Update(entity);
+ }
+ else
+ {
+ entity.Create();
+ this.BaseRepository("CollegeMIS").Insert(entity);
+ }
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 添加子表
+ ///
+ ///
+ ///
+ public void SaveList(string MainId, List strEntity)
+ {
+ var db = this.BaseRepository("CollegeMIS").BeginTrans();
+ try
+ {
+ var delSql = $"delete from FormulaChild where MainId='{MainId}'";
+ db.ExecuteBySql(delSql);
+ var projectNames= strEntity.OrderBy(x => x.Sort).Select(x=>x.ProjectName).ToList();
+ var result = string.Join("", projectNames.ToArray());
+ string updSql = $"update FormulaMain set Result='{result}' where Id='{MainId}'";
+ db.ExecuteBySql(updSql);
+ foreach (var item in strEntity)
+ {
+ FormulaChildEntity entity = new FormulaChildEntity();
+ entity.Create();
+ entity.MainId = MainId;
+ entity.ProjectId = item.ProjectId;
+ entity.Sort = item.Sort;
+ db.Insert(entity);
+ }
+ db.Commit();
+ }
+ catch (Exception ex)
+ {
+ db.Rollback();
+ 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_Desktop/FormulaMain/FormulaMainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainBLL.cs
new file mode 100644
index 000000000..b131aab2b
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainBLL.cs
@@ -0,0 +1,176 @@
+using Learun.Util;
+using System;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 11:07
+ /// 描 述:公式管理
+ ///
+ public class FormulaMainBLL : FormulaMainIBLL
+ {
+ private FormulaMainService formulaMainService = new FormulaMainService();
+
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 分页参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ return formulaMainService.GetPageList(pagination, queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ public IEnumerable GetList(string queryJson)
+ {
+ try
+ {
+ return formulaMainService.GetList(queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 获取FormulaMain表实体数据
+ ///
+ /// 主键
+ ///
+ public FormulaMainEntity GetFormulaMainEntity(string keyValue)
+ {
+ try
+ {
+ return formulaMainService.GetFormulaMainEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 获取FormulaMain表实体数据
+ ///
+ /// 主键
+ ///
+ public IEnumerable GetFormChildList(string keyValue)
+ {
+ try
+ {
+ return formulaMainService.GetFormChildList(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ formulaMainService.DeleteEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ ///
+ public void SaveEntity(string keyValue, FormulaMainEntity entity)
+ {
+ try
+ {
+ formulaMainService.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_Desktop/FormulaMain/FormulaMainEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainEntity.cs
new file mode 100644
index 000000000..51caa52d8
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainEntity.cs
@@ -0,0 +1,90 @@
+using Learun.Util;
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 11:07
+ /// 描 述:公式管理
+ ///
+ public class FormulaMainEntity
+ {
+ #region 实体成员
+ ///
+ /// Id
+ ///
+ [Column("ID")]
+ public string Id { get; set; }
+ ///
+ /// 名称
+ ///
+ [Column("NAME")]
+ public string Name { get; set; }
+ ///
+ /// 描述
+ ///
+ [Column("DESC")]
+ public string Desc { get; set; }
+ ///
+ /// 排序
+ ///
+ [Column("SORT")]
+ public int? Sort { get; set; }
+ ///
+ /// 是否启用
+ ///
+ [Column("ISENABLE")]
+ public int? IsEnable { get; set; }
+ ///
+ /// 公式
+ ///
+ [Column("RESULT")]
+ public string Result { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [Column("CREATETIME")]
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 创建人
+ ///
+ [Column("CREATEUSERID")]
+ public string CreateUserId { get; set; }
+ ///
+ /// 创建人
+ ///
+ [Column("CREATEUSERNAME")]
+ public string CreateUserName { get; set; }
+ #endregion
+
+ #region 扩展操作
+ ///
+ /// 新增调用
+ ///
+ public void Create()
+ {
+ this.Id = Guid.NewGuid().ToString();
+ this.CreateTime = DateTime.Now;
+ var userinfo = LoginUserInfo.Get();
+ this.CreateUserId = userinfo.userId;
+ this.CreateUserName = userinfo.realName;
+ }
+ ///
+ /// 编辑调用
+ ///
+ ///
+ public void Modify(string keyValue)
+ {
+ this.Id = keyValue;
+ }
+ #endregion
+ #region 扩展字段
+ #endregion
+ }
+}
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainIBLL.cs
new file mode 100644
index 000000000..1a2db67b7
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainIBLL.cs
@@ -0,0 +1,51 @@
+using Learun.Util;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 11:07
+ /// 描 述:公式管理
+ ///
+ public interface FormulaMainIBLL
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ IEnumerable GetPageList(Pagination pagination, string queryJson);
+ IEnumerable GetList(string queryJson);
+ ///
+ /// 获取FormulaMain表实体数据
+ ///
+ /// 主键
+ ///
+ FormulaMainEntity GetFormulaMainEntity(string keyValue);
+
+ IEnumerable GetFormChildList(string keyValue);
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ void DeleteEntity(string keyValue);
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ void SaveEntity(string keyValue, FormulaMainEntity entity);
+ #endregion
+
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainService.cs
new file mode 100644
index 000000000..fd90aa830
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainService.cs
@@ -0,0 +1,218 @@
+using Dapper;
+using Learun.DataBase.Repository;
+using Learun.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-22 11:07
+ /// 描 述:公式管理
+ ///
+ public class FormulaMainService : RepositoryFactory
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append("SELECT ");
+ strSql.Append(@"
+ t.Id,
+ t.Name,
+ t.Sort,
+ t.IsEnable,
+ t.[Desc],
+t.[Result]
+ ");
+ strSql.Append(" FROM FormulaMain t ");
+ strSql.Append(" WHERE 1=1 ");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ if (!queryParam["Name"].IsEmpty())
+ {
+ dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String);
+ strSql.Append(" AND t.Name Like @Name ");
+ }
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ public IEnumerable GetList(string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append("SELECT ");
+ strSql.Append(@"
+ t.Id,
+ t.Name
+ ");
+ strSql.Append(" FROM FormulaMain t ");
+ strSql.Append(" WHERE 1=1 ");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ if (!queryParam["Name"].IsEmpty())
+ {
+ dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String);
+ strSql.Append(" AND t.Name Like @Name ");
+ }
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ ///
+ /// 获取FormulaMain表实体数据
+ ///
+ /// 主键
+ ///
+ public FormulaMainEntity GetFormulaMainEntity(string keyValue)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取子表数据
+ ///
+ /// 主键
+ ///
+ public IEnumerable GetFormChildList(string keyValue)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindList(x => x.MainId == keyValue).OrderBy(x => x.Sort);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ public void SaveEntity(string keyValue, FormulaMainEntity entity)
+ {
+ try
+ {
+ if (!string.IsNullOrEmpty(keyValue))
+ {
+ entity.Modify(keyValue);
+ this.BaseRepository("CollegeMIS").Update(entity);
+ }
+ else
+ {
+ entity.Create();
+ this.BaseRepository("CollegeMIS").Insert(entity);
+ }
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildBLL.cs
new file mode 100644
index 000000000..882394e83
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildBLL.cs
@@ -0,0 +1,216 @@
+using Learun.Util;
+using System;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-23 17:26
+ /// 描 述:上报子表
+ ///
+ public class QualityReportChildBLL : QualityReportChildIBLL
+ {
+ private QualityReportChildService qualityReportChildService = new QualityReportChildService();
+
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 分页参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ return qualityReportChildService.GetPageList(pagination, queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 项目Id
+ ///
+ public IEnumerable GetListByFillId(string keyValue, string mainId)
+ {
+ try
+ {
+ return qualityReportChildService.GetListByFillId(keyValue, mainId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 获取QualityReportChild表实体数据
+ ///
+ /// 主键
+ ///
+ public QualityReportChildEntity GetQualityReportChildEntity(string keyValue)
+ {
+ try
+ {
+ return qualityReportChildService.GetQualityReportChildEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 判断是否可以上报
+ ///
+ /// 项目Id
+ ///
+ public string IsCanReport(string keyValue)
+ {
+ try
+ {
+ return qualityReportChildService.IsCanReport(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ qualityReportChildService.DeleteEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ ///
+ public void SaveEntity(string keyValue, QualityReportChildEntity entity)
+ {
+ try
+ {
+ qualityReportChildService.SaveEntity(keyValue, entity);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ public void SaveList(string keyValue, List list)
+ {
+ try
+ {
+ qualityReportChildService.SaveList(keyValue, list);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ public void UpdateState(string keyValue, int Status)
+ {
+ try
+ {
+ qualityReportChildService.UpdateState(keyValue, Status);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildEntity.cs
new file mode 100644
index 000000000..13eeb8d1e
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildEntity.cs
@@ -0,0 +1,76 @@
+using Learun.Util;
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-23 17:26
+ /// 描 述:上报子表
+ ///
+ public class QualityReportChildEntity
+ {
+ #region 实体成员
+ ///
+ /// Id
+ ///
+ [Column("ID")]
+ public string Id { get; set; }
+ ///
+ /// 主表Id
+ ///
+ [Column("MAINID")]
+ public string MainId { get; set; }
+ ///
+ /// 计算项目Id
+ ///
+ [Column("PROJECTID")]
+ public string ProjectId { get; set; }
+ ///
+ /// 值
+ ///
+ [Column("VALUE")]
+ public string Value { get; set; }
+ ///
+ /// 排序
+ ///
+ [Column("SORT")]
+ public int? Sort { get; set; }
+ #endregion
+
+ #region 扩展操作
+ ///
+ /// 新增调用
+ ///
+ public void Create()
+ {
+ this.Id = Guid.NewGuid().ToString();
+ }
+ ///
+ /// 编辑调用
+ ///
+ ///
+ public void Modify(string keyValue)
+ {
+ this.Id = keyValue;
+ }
+ #endregion
+ #region 扩展字段
+ ///
+ /// 计算项类型(变量、常量、符号)
+ ///
+ [NotMapped]
+ public string CalType { get; set; }
+
+ ///
+ /// 计算项名称
+ ///
+ [NotMapped]
+ public string CalName { get; set; }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildIBLL.cs
new file mode 100644
index 000000000..a570e6dbe
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildIBLL.cs
@@ -0,0 +1,73 @@
+using Learun.Util;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-23 17:26
+ /// 描 述:上报子表
+ ///
+ public interface QualityReportChildIBLL
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ IEnumerable GetPageList(Pagination pagination, string queryJson);
+ ///
+ ///
+ ///
+ ///
+ ///
+ IEnumerable GetListByFillId(string keyValue, string mainId);
+ ///
+ /// 获取QualityReportChild表实体数据
+ ///
+ /// 主键
+ ///
+ QualityReportChildEntity GetQualityReportChildEntity(string keyValue);
+ ///
+ /// 判断是否可以上报
+ ///
+ /// 项目Id
+ ///
+ string IsCanReport(string keyValue);
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ void DeleteEntity(string keyValue);
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ void SaveEntity(string keyValue, QualityReportChildEntity entity);
+ ///
+ /// 保存
+ ///
+ ///
+ ///
+ void SaveList(string keyValue, List list);
+ ///
+ /// 提交
+ ///
+ ///
+ ///
+ void UpdateState(string keyValue, int Status);
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildService.cs
new file mode 100644
index 000000000..a73dbcbad
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildService.cs
@@ -0,0 +1,428 @@
+using Dapper;
+using Learun.DataBase.Repository;
+using Learun.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using Learun.Application.TwoDevelopment.EducationalAdministration;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-23 17:26
+ /// 描 述:上报子表
+ ///
+ public class QualityReportChildService : RepositoryFactory
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append("SELECT ");
+ strSql.Append(@"
+ t.Id,
+ t.ProjectId
+ ");
+ strSql.Append(" FROM QualityReportChild t ");
+ strSql.Append(" WHERE 1=1 ");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 项目Id
+ ///
+ public IEnumerable GetListByFillId(string keyValue, string mainId)
+ {
+ try
+ {
+ var month = DateTime.Now.Month - 1;
+ var strSql = new StringBuilder();
+ strSql.Append(@" select t.*,c.[type] as CalType,c.Name as CalName from QualityReportChild t join QualityReportMain m on t.Mainid=m.id
+ join QualityReportMain a on t.MainId = a.Id join CalculateProject c on t.ProjectId=c.id ");
+ strSql.Append($" WHERE 1=1 and a.FillinFromId='{keyValue}' ");
+
+ if (!string.IsNullOrEmpty(mainId))
+ {
+ strSql.Append($" and t.MainId='{mainId}'");
+ }
+ else
+ {
+ strSql.Append($" and year(m.ReportTime)=year(getdate()) and month(m.ReportTime)='{month}'");
+ }
+
+ strSql.Append(" order by t.Sort ");
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ var list = this.BaseRepository("CollegeMIS").FindList(strSql.ToString());
+ if (list == null || list.Count() <= 0)
+ {
+ var db = this.BaseRepository("CollegeMIS").BeginTrans();
+ var sql =
+ $@"select c.Id,c.Name,c.[Type],(case c.[Type] when '变量' then '' when '常量' then c.Value when '符号' then c.Name end) as value,b.Sort
+ from FillinFrom a join FormulaChild b on a.Formula=b.MainId
+join CalculateProject c on b.ProjectId=c.id
+where a.Id='{keyValue}' order by b.Sort";
+ var dt = db.FindTable(sql);
+ QualityReportMainEntity main = new QualityReportMainEntity();
+ main.Create();
+ main.FillinFromId = keyValue;
+ main.ReportTime = DateTime.Now.AddMonths(-1);
+ main.Status = 0;
+ db.Insert(main);
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ QualityReportChildEntity entity = new QualityReportChildEntity();
+ entity.Create();
+ entity.MainId = main.Id;
+ entity.ProjectId = dt.Rows[i]["Id"].ToString();
+ entity.Value = dt.Rows[i]["value"].ToString();
+ entity.Sort = Convert.ToInt32(dt.Rows[i]["Sort"]);
+ db.Insert(entity);
+ }
+ db.Commit();
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString());
+ }
+ else
+ {
+ return list;
+ }
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 获取QualityReportChild表实体数据
+ ///
+ /// 主键
+ ///
+ public QualityReportChildEntity GetQualityReportChildEntity(string keyValue)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+
+
+ ///
+ /// 判断是否允许上报
+ ///
+ /// 项目Id
+ ///
+ public string IsCanReport(string keyValue)
+ {
+ try
+ {
+ if (DateTime.Now.Day >= 15)
+ {
+ return "每月1-15日才可填报!";
+ }
+
+ int mouth = DateTime.Now.Month - 1;
+ var entity = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == keyValue);
+ if (string.IsNullOrEmpty(entity.Formula))
+ {
+ return "请先设置公式!";
+ }
+
+ if (entity.FillingCycle == "1")
+ {
+ //填报周期--月(每月)
+ }
+ else if (entity.FillingCycle == "2")
+ {
+ //填报周期--学期((3月、9月))
+ var fillingTime = entity.FillingTime.Split(',').ToList();
+ if (!fillingTime.Any(x => Convert.ToInt32(x) + 1 == DateTime.Now.Month))
+ {
+ return "当前日期不可进行填报!";
+ }
+ }
+ else if (entity.FillingCycle == "2")
+ {
+ //填报周期--年(每年7月)
+ if (Convert.ToInt32(entity.FillingTime) != DateTime.Now.Month - 1)
+ {
+ return "当前日期不可进行填报!";
+ }
+ }
+
+ var qualityReportMainEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.FillinFromId == keyValue && x.ReportTime.Value.Month == mouth);
+ if (qualityReportMainEntity == null)
+ {
+ return "";
+ }
+ else if (qualityReportMainEntity.Status == 1)
+ {
+ return "上报数据已提交,不可重复上报!";
+ }
+
+ return "";
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ var db = this.BaseRepository("CollegeMIS").BeginTrans();
+ try
+ {
+ db.Delete(t => t.Id == keyValue);
+ var sql = $"delete from QualityReportChild where MainId='{keyValue}'";
+ db.ExecuteBySql(sql);
+
+ db.Commit();
+ }
+ catch (Exception ex)
+ {
+ db.Rollback();
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ public void SaveEntity(string keyValue, QualityReportChildEntity entity)
+ {
+ try
+ {
+ if (!string.IsNullOrEmpty(keyValue))
+ {
+ entity.Modify(keyValue);
+ this.BaseRepository("CollegeMIS").Update(entity);
+ }
+ else
+ {
+ entity.Create();
+ this.BaseRepository("CollegeMIS").Insert(entity);
+ }
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存
+ ///
+ ///
+ ///
+ public void SaveList(string keyValue, List list)
+ {
+ var db = this.BaseRepository("CollegeMIS").BeginTrans();
+ try
+ {
+ if (!string.IsNullOrEmpty(keyValue))
+ {
+ var mainId = "";
+ list = list.OrderBy(x => x.Sort).ToList();
+ var projectIds = list.Select(x => x.ProjectId).ToList();
+ var gs = "";
+ var result = "";
+ var calculateProjectList = db.FindList(x => projectIds.Contains(x.Id));
+ foreach (var entity in list)
+ {
+ QualityReportChildEntity
+ model = db.FindEntity(x => x.Id == entity.Id);
+ model.Value = entity.Value;
+ db.Update(model);
+ mainId = model.MainId;
+
+ //保存运算结果
+ //计算项目
+ var calculateProject = calculateProjectList.Where(x => x.Id == entity.ProjectId).FirstOrDefault();
+ if (calculateProject.Type == "变量")
+ {
+ var value = ToDecimal(entity.Value);
+ if (value == 0)
+ {
+ gs += entity.Value;
+ }
+ else
+ {
+ gs += value;
+ }
+ }
+ else
+ {
+ gs += entity.Value;
+ }
+
+
+ }
+
+ if (!string.IsNullOrEmpty(mainId))
+ {
+
+ //公式运算结果
+ if (list.Count == 1)
+ {
+ result = list.FirstOrDefault().Value;
+ }
+ else
+ {
+ gs = gs.Replace("(", "(").Replace(")", ")");
+ if (gs.Contains("%"))
+ {
+ gs = gs.Replace("%", "");
+ var dt = db.FindTable($"select convert(varchar,convert(decimal(18,0),{gs}))+'%' as num ");
+ result = dt.Rows[0][0].ToString();
+ }
+ else
+ {
+ var dt = db.FindTable($"select convert(decimal(18,2),{gs}) as num ");
+ result = dt.Rows[0][0].ToString();
+ }
+ }
+ QualityReportMainEntity main = db.FindEntity(x => x.Id == mainId);
+ main.Result = result;
+ db.Update(main);
+ }
+ }
+ db.Commit();
+ }
+ catch (Exception ex)
+ {
+ db.Rollback();
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+
+ public void UpdateState(string keyValue, int Status)
+ {
+ try
+ {
+ string sql = $"update QualityReportMain set [Status]='{Status}' where Id='{keyValue}'";
+ this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
+
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+
+ #endregion
+ ///
+ ///
+ ///
+ ///
+ private decimal ToDecimal(string value)
+ {
+ try
+ {
+ return Convert.ToDecimal(Convert.ToDecimal(value).ToString("f2"));
+ }
+ catch
+ {
+ return 0;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainBLL.cs
new file mode 100644
index 000000000..2a19c382e
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainBLL.cs
@@ -0,0 +1,218 @@
+using Learun.Util;
+using System;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-23 17:12
+ /// 描 述:上报主表
+ ///
+ public class QualityReportMainBLL : QualityReportMainIBLL
+ {
+ private QualityReportMainService qualityReportMainService = new QualityReportMainService();
+
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 分页参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ return qualityReportMainService.GetPageList(pagination, queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 分页参数
+ /// 查询参数
+ ///
+ public IEnumerable GetList(string queryJson)
+ {
+ try
+ {
+ return qualityReportMainService.GetList(queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+ ///
+ /// 获取QualityReportMain表实体数据
+ ///
+ /// 主键
+ ///
+ public QualityReportMainEntity GetQualityReportMainEntity(string keyValue)
+ {
+ try
+ {
+ return qualityReportMainService.GetQualityReportMainEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ qualityReportMainService.DeleteEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ ///
+ public void SaveEntity(string keyValue, QualityReportMainEntity entity)
+ {
+ try
+ {
+ qualityReportMainService.SaveEntity(keyValue, entity);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 项目删除,将状态改为作废
+ ///
+ /// 项目Id
+ public void DelProjectByFId(string FillinFromId)
+ {
+ try
+ {
+ qualityReportMainService.DelProjectByFId(FillinFromId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 项目删除,将状态改为作废
+ ///
+ /// 项目Id
+ public void EditProjectByFId(string FillinFromId)
+ {
+ try
+ {
+ qualityReportMainService.EditProjectByFId(FillinFromId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+ #endregion
+
+ ///
+ ///
+ ///
+ ///
+ public QualityReportMainEntity IsFinish(string keyValue)
+ {
+ try
+ {
+ return qualityReportMainService.IsFinish(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainEntity.cs
new file mode 100644
index 000000000..cd9a51519
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainEntity.cs
@@ -0,0 +1,104 @@
+using Learun.Util;
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-23 17:12
+ /// 描 述:上报主表
+ ///
+ public class QualityReportMainEntity
+ {
+ #region 实体成员
+ ///
+ /// Id
+ ///
+ [Column("ID")]
+ public string Id { get; set; }
+ ///
+ /// 选择上报的项目Id
+ ///
+ [Column("FILLINFROMID")]
+ public string FillinFromId { get; set; }
+ ///
+ /// 上报时间
+ ///
+ [Column("REPORTTIME")]
+ public DateTime? ReportTime { get; set; }
+ ///
+ /// 状态 0 草稿,1提交
+ ///
+ [Column("STATUS")]
+ public int? Status { get; set; }
+ ///
+ /// 公式运算结果
+ ///
+ [Column("RESULT")]
+ public string Result { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [Column("CREATETIME")]
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 创建人
+ ///
+ [Column("CREATEUSERID")]
+ public string CreateUserId { get; set; }
+ ///
+ /// 创建人
+ ///
+ [Column("CREATEUSERNAME")]
+ public string CreateUserName { get; set; }
+ #endregion
+
+ #region 扩展操作
+ ///
+ /// 新增调用
+ ///
+ public void Create()
+ {
+ this.Id = Guid.NewGuid().ToString();
+ this.CreateTime=DateTime.Now;
+ var userinfo = LoginUserInfo.Get();
+ this.CreateUserId = userinfo.userId;
+ this.CreateUserName = userinfo.realName;
+ }
+ ///
+ /// 编辑调用
+ ///
+ ///
+ public void Modify(string keyValue)
+ {
+ this.Id = keyValue;
+ }
+ #endregion
+ #region 扩展字段
+ ///
+ /// 核心模块
+ ///
+ [NotMapped]
+ public string WorderModule { get; set; }
+ ///
+ /// 项目名称
+ ///
+ [NotMapped]
+ public string ProjectName { get; set; }
+ ///
+ /// 部门
+ ///
+ [NotMapped]
+ public string FillingDept { get; set; }
+ ///
+ /// 项目表Id
+ ///
+ [NotMapped]
+ public string fid { get; set; }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainIBLL.cs
new file mode 100644
index 000000000..483ad45e5
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainIBLL.cs
@@ -0,0 +1,64 @@
+using Learun.Util;
+using System.Data;
+using System.Collections.Generic;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-23 17:12
+ /// 描 述:QualityReportMain
+ ///
+ public interface QualityReportMainIBLL
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ IEnumerable GetPageList(Pagination pagination, string queryJson);
+ IEnumerable GetList(string queryJson);
+ ///
+ /// 获取QualityReportMain表实体数据
+ ///
+ /// 主键
+ ///
+ QualityReportMainEntity GetQualityReportMainEntity(string keyValue);
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ void DeleteEntity(string keyValue);
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ void SaveEntity(string keyValue, QualityReportMainEntity entity);
+
+ ///
+ /// 项目删除,将状态改为作废
+ ///
+ ///
+ void DelProjectByFId(string FillinFromId);
+
+ ///
+ /// 项目编辑,将状态改为草稿
+ ///
+ ///
+ void EditProjectByFId(string FillinFromId);
+
+ QualityReportMainEntity IsFinish(string keyValue);
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs
new file mode 100644
index 000000000..718023e1b
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs
@@ -0,0 +1,281 @@
+using Dapper;
+using Learun.DataBase.Repository;
+using Learun.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+
+namespace Learun.Application.TwoDevelopment.LR_Desktop
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2021-06-23 17:12
+ /// 描 述:上报主表
+ ///
+ public class QualityReportMainService : RepositoryFactory
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append(@"select b.WorderModule,b.ProjectName,b.FillingDept,b.Id as fid,a.Id,a.ReportTime,a.Status,a.Result,a.CreateUserName from QualityReportMain a join FillinFrom b on a.FillinFromId=b.Id
+ ");
+
+ strSql.Append(" WHERE 1=1 and b.[State]=2 and b.IsFlag=0");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ if (!queryParam["FillInFromId"].IsEmpty())
+ {
+ strSql.Append($" AND a.FillInFromId='{queryParam["FillInFromId"].ToString()}' ");
+ }
+ if (!queryParam["CreateUserId"].IsEmpty() && queryParam["CreateUserId"].ToString() != "System")
+ {
+ strSql.Append($" AND a.CreateUserId='{queryParam["CreateUserId"].ToString()}' ");
+ }
+ if (!queryParam["FillingDept"].IsEmpty())
+ {
+ strSql.Append($" AND b.FillingDept='{queryParam["FillingDept"].ToString()}' ");
+ }
+
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ /// 查询参数
+ ///
+ public IEnumerable GetList(string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append(@"select b.WorderModule,b.ProjectName,b.FillingDept,b.Id as fid,a.Id,a.ReportTime,a.Status,a.Result,a.CreateUserName from QualityReportMain a join FillinFrom b on a.FillinFromId=b.Id
+ ");
+ strSql.Append(" WHERE 1=1 ");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ if (!queryParam["FillInFromId"].IsEmpty())
+ {
+ strSql.Append($" AND a.FillInFromId='{queryParam["FillInFromId"].ToString()}' ");
+ }
+
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp).OrderByDescending(x => x.ReportTime);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取QualityReportMain表实体数据
+ ///
+ /// 主键
+ ///
+ public QualityReportMainEntity GetQualityReportMainEntity(string keyValue)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ public void SaveEntity(string keyValue, QualityReportMainEntity entity)
+ {
+ try
+ {
+ if (!string.IsNullOrEmpty(keyValue))
+ {
+ entity.Modify(keyValue);
+ this.BaseRepository("CollegeMIS").Update(entity);
+ }
+ else
+ {
+ entity.Create();
+ this.BaseRepository("CollegeMIS").Insert(entity);
+ }
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+
+ ///
+ /// 项目删除,将状态改为作废
+ ///
+ /// 项目Id
+ public void DelProjectByFId(string FillinFromId)
+ {
+ try
+ {
+ UpdateStatusByFId(FillinFromId, 99);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 项目编辑,将状态改为草稿
+ ///
+ /// 项目Id
+ public void EditProjectByFId(string FillinFromId)
+ {
+ try
+ {
+ UpdateStatusByFId(FillinFromId, 0);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ ///
+ /// 修改上报记录为作废状态
+ ///
+ /// 项目Id
+ private void UpdateStatusByFId(string FillinFromId, int Status)
+ {
+ try
+ {
+ string sql = $"update QualityReportMain set [Status]='{Status}' where FillinFromId='{FillinFromId}'";
+ this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ #endregion
+
+ public QualityReportMainEntity IsFinish(string keyValue)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindEntity(x => x.FillinFromId == keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
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 4c16cc5ea..2c3ff147e 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
@@ -136,6 +136,10 @@
+
+
+
+
@@ -265,10 +269,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+