From cbff471988ec3f1882ee39382549332f2cf3b30c Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Fri, 13 Aug 2021 11:55:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E6=8E=A7=E6=8C=87=E6=A0=87=E9=A1=B9?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FillinFromController.cs | 295 ++++++++++++ .../Views/FillinFrom/Form.cshtml | 56 +++ .../Views/FillinFrom/Form.js | 99 ++++ .../Views/FillinFrom/FormIndex.cshtml | 46 ++ .../Views/FillinFrom/FormIndex.js | 228 ++++++++++ .../Views/FillinFrom/FormPeople.cshtml | 60 +++ .../Views/FillinFrom/FormPeople.js | 116 +++++ .../Views/FillinFrom/Index.cshtml | 58 +++ .../Views/FillinFrom/Index.js | 317 +++++++++++++ .../Controllers/CalculateProjectController.cs | 117 +++++ .../Controllers/FormulaChildController.cs | 124 +++++ .../Controllers/FormulaMainController.cs | 166 +++++++ .../Controllers/QualityReportController.cs | 215 +++++++++ .../Views/CalculateProject/Form.cshtml | 27 ++ .../LR_Desktop/Views/CalculateProject/Form.js | 70 +++ .../Views/CalculateProject/Index.cshtml | 41 ++ .../Views/CalculateProject/Index.js | 110 +++++ .../LR_Desktop/Views/FormulaChild/Form.cshtml | 19 + .../LR_Desktop/Views/FormulaChild/Form.js | 52 +++ .../Views/FormulaChild/Index.cshtml | 37 ++ .../LR_Desktop/Views/FormulaChild/Index.js | 136 ++++++ .../LR_Desktop/Views/FormulaMain/Form.cshtml | 23 + .../LR_Desktop/Views/FormulaMain/Form.js | 54 +++ .../Views/FormulaMain/FormChild.cshtml | 18 + .../LR_Desktop/Views/FormulaMain/FormChild.js | 217 +++++++++ .../LR_Desktop/Views/FormulaMain/Index.cshtml | 38 ++ .../LR_Desktop/Views/FormulaMain/Index.js | 118 +++++ .../Views/QualityReport/Form.cshtml | 12 + .../LR_Desktop/Views/QualityReport/Form.js | 104 +++++ .../Views/QualityReport/FormView.cshtml | 12 + .../Views/QualityReport/FormView.js | 106 +++++ .../Views/QualityReport/Index.cshtml | 42 ++ .../LR_Desktop/Views/QualityReport/Index.js | 228 ++++++++++ .../Views/QualityReport/IndexReport.cshtml | 83 ++++ .../Views/QualityReport/IndexReport.js | 196 ++++++++ .../Learun.Application.Web.csproj | 35 ++ .../FillinFromMap.cs | 29 ++ .../LR_Desktop/CalculateProjectMap.cs | 29 ++ .../LR_Desktop/FormulaChildMap.cs | 29 ++ .../LR_Desktop/FormulaMainMap.cs | 29 ++ .../LR_Desktop/QualityReportChildMap.cs | 28 ++ .../LR_Desktop/QualityReportMainMap.cs | 28 ++ .../Learun.Application.Mapping.csproj | 6 + .../FillinFrom/FillinFromBLL.cs | 214 +++++++++ .../FillinFrom/FillinFromEntity.cs | 125 +++++ .../FillinFrom/FillinFromIBLL.cs | 70 +++ .../FillinFrom/FillinFromService.cs | 342 ++++++++++++++ .../CalculateProject/CalculateProjectBLL.cs | 145 ++++++ .../CalculateProjectEntity.cs | 90 ++++ .../CalculateProject/CalculateProjectIBLL.cs | 53 +++ .../CalculateProjectService.cs | 182 ++++++++ .../FormulaChild/FormulaChildBLL.cs | 191 ++++++++ .../FormulaChild/FormulaChildEntity.cs | 85 ++++ .../FormulaChild/FormulaChildIBLL.cs | 55 +++ .../FormulaChild/FormulaChildService.cs | 217 +++++++++ .../LR_Desktop/FormulaMain/FormulaMainBLL.cs | 176 +++++++ .../FormulaMain/FormulaMainEntity.cs | 90 ++++ .../LR_Desktop/FormulaMain/FormulaMainIBLL.cs | 51 +++ .../FormulaMain/FormulaMainService.cs | 218 +++++++++ .../QualityReportChildBLL.cs | 216 +++++++++ .../QualityReportChildEntity.cs | 76 ++++ .../QualityReportChildIBLL.cs | 73 +++ .../QualityReportChildService.cs | 428 ++++++++++++++++++ .../QualityReportMain/QualityReportMainBLL.cs | 218 +++++++++ .../QualityReportMainEntity.cs | 104 +++++ .../QualityReportMainIBLL.cs | 64 +++ .../QualityReportMainService.cs | 281 ++++++++++++ .../Learun.Application.TwoDevelopment.csproj | 24 + 68 files changed, 7641 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/CalculateProjectController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaChildController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaMainController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaChild/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/FormView.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/FormView.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FillinFromMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/CalculateProjectMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/FormulaChildMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/FormulaMainMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/QualityReportChildMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/QualityReportMainMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectService.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaChild/FormulaChildService.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainService.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildService.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs new file mode 100644 index 000000000..74f3f633a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs @@ -0,0 +1,295 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; +using System.Linq; +using Learun.Application.Organization; +using Learun.Application.TwoDevelopment.LR_Desktop; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-21 18:39 + /// 描 述:质量目标管理体系指标模块 + /// + public class FillinFromController : MvcControllerBase + { + private FillinFromIBLL fillinFromIBLL = new FillinFromBLL(); + private DepartmentBLL departmentIBLL = new DepartmentBLL(); + private QualityReportMainIBLL qualityReportMainIBLL = new QualityReportMainBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + var logininfo = LoginUserInfo.Get(); + ViewBag.isSystem = logininfo.isSystem; + ViewBag.departmentId = ""; + var Model = departmentIBLL.GetEntity(logininfo.companyId, logininfo.departmentId); + if (Model.F_Manager == logininfo.realName) + { + ViewBag.departmentId = logininfo.departmentId; + } + return View(); + } + /// + /// + /// + /// + [HttpGet] + public ActionResult FormIndex() + { + var logininfo = LoginUserInfo.Get(); + ViewBag.isSystem = logininfo.isSystem; + ViewBag.departmentId = ""; + var Model = departmentIBLL.GetEntity(logininfo.companyId, logininfo.departmentId); + if (Model.F_Manager == logininfo.realName) + { + ViewBag.departmentId = logininfo.departmentId; + } + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 设置填报人 + /// + /// + [HttpGet] + public ActionResult FormPeople() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = fillinFromIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var FillinFromData = fillinFromIBLL.GetFillinFromEntity(keyValue); + if (FillinFromData.FillingCycle == "2") + { + FillinFromData.FillingTime2 = FillinFromData.FillingTime; + } + else + { + FillinFromData.FillingTime1 = FillinFromData.FillingTime; + } + var jsonData = new + { + FillinFrom = FillinFromData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + var Model = fillinFromIBLL.GetFillInNo(keyValue); + if (Model != null) + { + Model.State = -1; + qualityReportMainIBLL.DelProjectByFId(keyValue); + } + fillinFromIBLL.SaveEntity(keyValue, Model); + return Success("作废成功!"); + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + FillinFromEntity entity = strEntity.ToObject(); + if (!string.IsNullOrEmpty(keyValue)) + { + #region 修改状态 + if (entity.State == 1) + { + entity.State = 2; + } + #endregion + qualityReportMainIBLL.EditProjectByFId(keyValue); + + } + #region 处理填报日期 + + if (entity.FillingCycle == "1") + { + entity.FillingTime = ""; + } + else if (entity.FillingCycle == "2") + { + entity.FillingTime = entity.FillingTime2; + } + else if (entity.FillingCycle == "3") + { + entity.FillingTime = entity.FillingTime1; + } + #endregion + + fillinFromIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + #endregion + + #region 扩展数据 + + /// + /// 提交 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Submit(string keyValue) + { + var Model = fillinFromIBLL.GetFillInNo(keyValue); + if (Model != null) + { + //重新填写 + Model.State = 1; + } + fillinFromIBLL.SaveEntity(keyValue, Model); + return Success("保存成功!"); + } + + /// + /// 隐藏/显示 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult HideList(string keyValue) + { + var Model = fillinFromIBLL.GetFillInNo(keyValue); + if (Model != null) + { + if (Model.IsFlag == 0) + { + Model.IsFlag = 1; + } + else + { + Model.IsFlag = 0; + } + } + fillinFromIBLL.SaveEntity(keyValue, Model); + return Success("保存成功!"); + } + + /// + /// 撤回 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoCanCel(string keyValue) + { + var Model = fillinFromIBLL.GetFillInNo(keyValue); + if (Model != null) + { + //重新填写 + Model.State = 0; + Model.FillingPeople = ""; + } + qualityReportMainIBLL.EditProjectByFId(keyValue); + fillinFromIBLL.SaveEntity(keyValue, Model); + return Success("保存成功!"); + } + + /// + /// 归档 + /// + /// + /// + public ActionResult IsFile(string keyValue) + { + var Model = fillinFromIBLL.GetFillInNo(keyValue); + if (Model != null) + { + var ModeList = qualityReportMainIBLL.IsFinish(keyValue); + if (ModeList != null) + { + if (ModeList.Status == 1) + { + Model.State = 3; + } + else + { + return Success("归档失败!"); + } + } + else + { + return Success("归档失败!"); + } + } + fillinFromIBLL.SaveEntity(keyValue, Model); + return Success("归档成功!"); + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml new file mode 100644 index 000000000..8bc6dc9d0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml @@ -0,0 +1,56 @@ +@{ + ViewBag.Title = "质量目标管理体系指标模块"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
工作模块*
+ +
+
+
项目名称*
+ +
+
+
序      号*
+ +
+
+
填报部门*
+
+
+
+
填报周期*
+
+
+
+
填报时间
+
+
+
+
+
公      式*
+
+
+
+
备      注
+ +
+ + + + +
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js new file mode 100644 index 000000000..69a85e4ad --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js @@ -0,0 +1,99 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 18:39 + * 描 述:质量目标管理体系指标模块 + */ +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 () { + $('#Formula').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' }); + $('#Formula').lrGirdSelect({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=FormulaMain', + selectWord: 'name', + value: 'id', + text: 'name', + headData: + [ + { label: "公式", name: "result", width: 300, align: "left" }, + { label: "公式名称", name: "name", width: 300, align: "left" } + ], + select: function (item) { + } + }); + $('#lrPeople')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#lrPeople').val(learun.clientdata.get(['userinfo']).realName); + $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#FillingDept').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); + $('#FillingCycle').lrDataItemSelect({ + code: 'ThisCycle', + select: function (item) { + var Cycles = $("#FillingCycle").lrselectGet(); + if (Cycles == 3) { + $('#TimeHide').show(); + $('#FillingTime1').show(); + $('#FillingTime2').hide(); + $('#FillingTime1').lrDataItemSelect({ + code: 'CycleTime' + }); + } else if (Cycles == 2) { + $('#TimeHide').show(); + $('#FillingTime1').hide(); + $('#FillingTime2').show(); + } else if (Cycles == 1) { + //$('#FillingTime1').hide(); + //$('#FillingTime2').hide(); + //$('#FillingTime1').lrDataItemSelect({ code: 'undefined' }); + $('#TimeHide').hide(); + } + } + }); + $('#FillingTime1').lrselect(); + $('#FillingTime2').lrDataItemSelect({ + type: 'multiple', + code: 'CycleTime' + }); + $('#FillingTime2').hide(); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/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]); + } + } + }); + } + $('#State').val('0'); + $('#IsFlag').val('0'); + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.cshtml new file mode 100644 index 000000000..d50b9851e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.cshtml @@ -0,0 +1,46 @@ +@{ + ViewBag.Title = "质量目标管理体系指标模块"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + +
+
+
+
+
+
+
+
+
+
工作模块
+ +
+
+
项目名称
+ +
+
+
填报周期
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js new file mode 100644 index 000000000..513d89b4c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js @@ -0,0 +1,228 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 18:39 + * 描 述:质量目标管理体系指标模块 + */ +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); + $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle' }); + //$('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/Form', + width: 500, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var State = $('#gridtable').jfGridValue('State'); + if (State !== 0) { + learun.alert.warning("当前项目已提交不能修改!"); + return; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/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)) { + var State = $('#gridtable').jfGridValue('State'); + if (State !== 0) { + learun.alert.warning("当前项目已提交不能删除!"); + return; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //撤回 + $('#lr_cancel').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var RStatus = $('#gridtable').jfGridValue('State'); + if (RStatus == 1) { + learun.alert.warning("已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //设置填报人 + $('#lr_people').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var RStatus = $('#gridtable').jfGridValue('State'); + if (RStatus !== 1) { + learun.alert.warning("当前项不能设置填报人!"); + return false; + } + learun.layerForm({ + id: 'form', + title: '设置填报人', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/FormPeople?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + ////隐藏显示 + //$('#lr_hide').on('click', function () { + // var keyValue = $('#gridtable').jfGridValue('Id'); + // if (learun.checkrow(keyValue)) { + // var RStatus = $('#gridtable').jfGridValue('State'); + // if (RStatus == 1) { + // learun.alert.warning("已提交!"); + // return false; + // } + // learun.layerConfirm('是否确认提交该项!', function (res) { + // if (res) { + // learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { + // refreshGirdData(); + // }); + // } + // }); + // } + //}); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/GetPageList', + headData: [ + { label: "核心工作模块", name: "WorderModule", width: 300, align: "center" }, + { label: "序号", name: "SerialNo", width: 100, align: "center" }, + { label: "项目名称", name: "ProjectName", width: 300, align: "center" }, + { + label: "填报周期", name: "FillingCycle", width: 100, align: "center", + 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: "center", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'CycleTime', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "填报部门", name: "FillingDept", width: 100, align: "center", + 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: "center", + 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 === -1) { + return '作废'; + } else if (cellvalue === 0) { + return '草稿'; + } else if (cellvalue === 1) { + return '待设置填报人'; + } else if (cellvalue === 2) { + return '待填报'; + } else if (cellvalue === 3) { + return '已完成'; + } + } + }, + { label: "备注", name: "Demo", width: 300, align: "center" }, + ], + mainId: 'Id', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.IsFlag = 0; + param.isSystem = isSystem; + param.departmentId = departmentId; + $('#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/EducationalAdministration/Views/FillinFrom/FormPeople.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.cshtml new file mode 100644 index 000000000..545866036 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.cshtml @@ -0,0 +1,60 @@ +@{ + ViewBag.Title = "质量目标管理体系指标模块"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
工作模块*
+ +
+
+
项目名称*
+ +
+
+
序       号*
+ +
+
+
填报部门*
+
+
+
+
填报周期*
+
+
+
+
填报时间
+
+
+
+
+
填  报  人*
+
+
+
+
公      式*
+
+
+
+
备      注
+ +
+ + + + +
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js new file mode 100644 index 000000000..0eb1fb2e3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js @@ -0,0 +1,116 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 18:39 + * 描 述:质量目标管理体系指标模块 + */ +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 () { + $('#Formula').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' }); + //$('#Formula').lrGirdSelect({ + // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=FormulaMain', + // selectWord: 'name', + // value: 'id', + // text: 'name', + // headData: + // [ + // { label: "公式", name: "result", width: 300, align: "left" }, + // { label: "公式名称", name: "name", width: 300, align: "left" } + // ], + // select: function (item) { + // } + //}); + $('#lrPeople')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#lrPeople').val(learun.clientdata.get(['userinfo']).realName); + $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#FillingDept').lrDataSourceSelect({ + code: 'classdata', + value: 'id', + text: 'name', + select: function (item) { + var DeptCode = $('#FillingDept').lrselectGet(); + if (DeptCode != null && DeptCode != "" && DeptCode != undefined) { + $('#FillingPeople').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata', + value: 'f_userid', + text: 'f_realname', + param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" }, + maxHeight: 200, + }); + } + } + }); + $("#FillingPeople").lrselect(); + //设置周期 + $('#FillingCycle').lrDataItemSelect({ + code: 'ThisCycle', + select: function (item) { + var Cycles = $("#FillingCycle").lrselectGet(); + if (Cycles == 3) { + $('#TimeHide').show(); + $('#FillingTime1').show(); + $('#FillingTime2').hide(); + $('#FillingTime1').lrDataItemSelect({ + code: 'CycleTime' + }); + } else if (Cycles == 2) { + $('#TimeHide').show(); + $('#FillingTime1').hide(); + $('#FillingTime2').show(); + } else if (Cycles == 1) { + $('#TimeHide').hide(); + //$('#FillingTime1').hide(); + //$('#FillingTime2').hide(); + } + } + }); + $('#FillingTime1').lrselect(); + $('#FillingTime2').lrDataItemSelect({ + type: 'multiple', + code: 'CycleTime' + }); + $('#FillingTime2').hide(); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/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]); + } + } + }); + } + $('#State').val('0'); + $('#IsFlag').val('0'); + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml new file mode 100644 index 000000000..5a5a0eeba --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml @@ -0,0 +1,58 @@ +@{ + ViewBag.Title = "质量目标管理体系指标模块"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + +
+
+
+
+
+
+
+
+
+
工作模块
+ +
+
+
项目名称
+ +
+
+
填报周期
+
+
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js new file mode 100644 index 000000000..d83a109f1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js @@ -0,0 +1,317 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 18:39 + * 描 述:质量目标管理体系指标模块 + */ +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); + $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle' }); + //$('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var State = $('#gridtable').jfGridValue('State'); + var IsFlag = $('#gridtable').jfGridValue('IsFlag'); + if (State >= 1) { + learun.alert.warning("当前项已提交,请勿重复提交!"); + return false; + } else if (State == -1) { + learun.alert.warning("当前项已作废,不能提交!"); + return false; + } + if (IsFlag == 1) { + learun.alert.warning("当前项已隐藏,不能提交!"); + return false; + } + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/Submit', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var State = $('#gridtable').jfGridValue('State'); + if (State !== 0) { + learun.alert.warning("当前项不能修改!"); + return; + } + learun.layerConfirm('是否确认修改该项,修改成后会影响数据!', function (res) { + if (res) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + learun.layerConfirm('确定要修改当前项吗!', function (res) { + if (res) { + return top[id].acceptClick(refreshGirdData); + } + }) + } + }); + } + }) + } + }); + //作废 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var State = $('#gridtable').jfGridValue('State'); + if (State == -1) { + learun.alert.warning("当前项已作废,请勿重复操作 !"); + return false; + } + learun.layerConfirm('是否确认作废该项,此操作将改变数据!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //撤回 + $('#lr_cancel').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var State = $('#gridtable').jfGridValue('State'); + if (State <= 0) { + learun.alert.warning("当前项已撤回或作废,请勿重复操作!"); + return; + } + learun.layerConfirm('是否确认撤回该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/DoCancel', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //设置填报人 + $('#lr_people').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var RStatus = $('#gridtable').jfGridValue('State'); + if (RStatus !== 1) { + learun.alert.warning("当前项不能设置填报人!"); + return false; + } + learun.layerForm({ + id: 'form', + title: '设置填报人', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/FormPeople?keyValue=' + keyValue, + width: 600, + height: 500, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + + //隐藏显示 + $('#lr_hide').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认隐藏/显示该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/HideList', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //归档 + $('#lr_file').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('State'); + if (Status !== 2) { + learun.alert.warning("当前项未执行到此处,暂不能归档!"); + return false; + } + learun.layerConfirm('确定要归档么!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/IsFile', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/GetPageList', + headData: [ + { label: "核心工作模块", name: "WorderModule", width: 250, align: "center" }, + { label: "序号", name: "SerialNo", width: 100, align: "center" }, + { label: "项目名称", name: "ProjectName", width: 250, align: "center" }, + { + label: "填报周期", name: "FillingCycle", width: 80, align: "center", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'ThisCycle', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "公式", name: "Formula", width: 200, align: "center", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'FormulaMain', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + 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: "center", + 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: 100, align: "center", + 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 === -1) { + return '作废'; + } else if (cellvalue === 0) { + return '草稿'; + } else if (cellvalue === 1) { + return '待设置填报人'; + } else if (cellvalue === 2) { + return '待填报'; + } else if (cellvalue === 3) { + return '已完成'; + } + } + }, + { label: "备注", name: "Demo", width: 240, align: "center" }, + { + label: "隐藏/显示", name: "IsFlag", width: 100, align: "center", + formatter: function (cellvalue) { + if (cellvalue === 0) { + return '显示'; + } else if (cellvalue === 1) { + return '隐藏'; + } + } + }, + ], + mainId: 'Id', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.isSystem = isSystem; + param.departmentId = departmentId; + $('#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/Controllers/CalculateProjectController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/CalculateProjectController.cs new file mode 100644 index 000000000..f1f957487 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/CalculateProjectController.cs @@ -0,0 +1,117 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LR_Desktop; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.LR_Desktop.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-22 10:04 + /// 描 述:计算项目管理 + /// + public class CalculateProjectController : MvcControllerBase + { + private CalculateProjectIBLL calculateProjectIBLL = new CalculateProjectBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = calculateProjectIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var CalculateProjectData = calculateProjectIBLL.GetCalculateProjectEntity( keyValue ); + var jsonData = new { + CalculateProject = CalculateProjectData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + calculateProjectIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + CalculateProjectEntity entity = strEntity.ToObject(); + calculateProjectIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaChildController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaChildController.cs new file mode 100644 index 000000000..d82612555 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaChildController.cs @@ -0,0 +1,124 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LR_Desktop; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.LR_Desktop.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-22 11:26 + /// 描 述:公式子表 + /// + public class FormulaChildController : MvcControllerBase + { + private FormulaChildIBLL formulaChildIBLL = new FormulaChildBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + /// + /// 获取左侧树形数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTree() + { + var data = formulaChildIBLL.GetTree(); + return Success(data); + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = formulaChildIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var FormulaChildData = formulaChildIBLL.GetFormulaChildEntity(keyValue); + var jsonData = new + { + FormulaChild = FormulaChildData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + formulaChildIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveList(string MainId, List strEntity) + { + formulaChildIBLL.SaveList(MainId, strEntity); + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaMainController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaMainController.cs new file mode 100644 index 000000000..0fa6e0701 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaMainController.cs @@ -0,0 +1,166 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LR_Desktop; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.LR_Desktop.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-22 11:07 + /// 描 述:公式管理 + /// + public class FormulaMainController : MvcControllerBase + { + private FormulaMainIBLL formulaMainIBLL = new FormulaMainBLL(); + private CalculateProjectIBLL calculateProjectIBLL = new CalculateProjectBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormChild() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = formulaMainIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + + /// + /// 获取 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList(string queryJson) + { + var list = formulaMainIBLL.GetList(queryJson); + + return Success(list); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var FormulaMainData = formulaMainIBLL.GetFormulaMainEntity( keyValue ); + var jsonData = new { + FormulaMain = FormulaMainData, + }; + return Success(jsonData); + } + /// + /// 获取子表数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormChildList(string keyValue) + { + var list = formulaMainIBLL.GetFormChildList(keyValue); + + return Success(list); + } + /// + /// 获取所有计算项目 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetCalProject() + { + var list = calculateProjectIBLL.GetListForDataSource(); + + return Success(list); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + formulaMainIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + FormulaMainEntity entity = strEntity.ToObject(); + formulaMainIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs new file mode 100644 index 000000000..3216cc138 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs @@ -0,0 +1,215 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LR_Desktop; +using System.Web.Mvc; +using System.Collections.Generic; +using Learun.Application.TwoDevelopment.EducationalAdministration; + +namespace Learun.Application.Web.Areas.LR_Desktop.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-22 11:07 + /// 描 述:上报 + /// + public class QualityReportController : MvcControllerBase + { + private QualityReportMainIBLL fualityReportMainIBLL = new QualityReportMainBLL(); + private QualityReportChildIBLL fualityReportChildIBLL = new QualityReportChildBLL(); + private FillinFromIBLL fillinFromIBLL = new FillinFromBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 上报数据管理 + /// + /// + [HttpGet] + public ActionResult IndexReport() + { + return View(); + } + + /// + /// 上报数据管理 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取树形结构数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTree(string queryJson) + { + var data = fillinFromIBLL.GetTree(queryJson); + return Success(data); + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForReport(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = fillinFromIBLL.GetPageListForReport(paginationobj, queryJson); + + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = fualityReportMainIBLL.GetPageList(paginationobj, queryJson); + + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList(string queryJson) + { + var data = fualityReportMainIBLL.GetList(queryJson); + + return Success(data); + } + /// + /// 判断是否可以上报 + /// + /// 项目Id + /// + [HttpGet] + [AjaxOnly] + public ActionResult IsCanReport(string keyValue) + { + var str = fualityReportChildIBLL.IsCanReport(keyValue); + if (!string.IsNullOrEmpty(str)) + { + return Fail(str); + } + + return Success(""); + } + /// + /// 获取表单数据 + /// + /// 项目Id + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue,string mainId) + { + var ReportData = fualityReportChildIBLL.GetListByFillId(keyValue, mainId); + + return Success(ReportData); + } + + + #endregion + + #region 提交数据 + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveList(string keyValue, List 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 += '
'; + html += '
'; + 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 += '
'; + + html += '
'; + 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 += '
计算项*
'; + html += '
'; + html += '
'; + html += '
'; + html += '
*
'; + if (data[i].CalName.indexOf('文字描述') != -1) { + html += + ''; + } else if (data[i].CalType != '变量') { + html += + ''; + } else { + 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 += '
计算项*
'; + html += '
'; + html += '
'; + html += '
'; + html += '
*
'; + html += + ''; + //if (data[i].CalName.indexOf('文字描述') != -1) { + // html += + // ''; + //} else if (data[i].CalType != '变量') { + // html += + // ''; + //} else { + // 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 @@ + + + + + + + + + + + + + + + + + + + +