From 2a0428081a4bf4b946d3baebb65e00fb423a9e02 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 5 Jul 2021 15:31:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=E5=92=8C=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FormulaMainController.cs | 13 ++++++ .../Controllers/QualityReportController.cs | 4 +- .../LR_Desktop/Views/FormulaMain/FormChild.js | 44 +++++++++++++++---- .../Views/QualityReport/IndexReport.js | 2 +- .../ProjectDataManageController.cs | 30 +++++++------ .../Views/ProjectDataManage/Index.js | 25 ++++++++++- .../Views/ProjectDataManage/IndexData.js | 23 +++++++--- .../Views/ProjectManage/Index.cshtml | 2 +- .../Views/ProjectManage/Index.js | 18 ++++++-- .../FillinFrom/FillinFromBLL.cs | 4 +- .../FillinFrom/FillinFromIBLL.cs | 2 +- .../FillinFrom/FillinFromService.cs | 16 ++++++- .../CalculateProject/CalculateProjectBLL.cs | 20 +++++++++ .../CalculateProject/CalculateProjectIBLL.cs | 5 +++ .../CalculateProjectService.cs | 30 +++++++++++-- .../QualityReportMainService.cs | 4 ++ .../ProjectDataManageEntity.cs | 14 +++++- .../ProjectDataManageService.cs | 35 +++++++++++---- 18 files changed, 236 insertions(+), 55 deletions(-) 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 index 4c4e06352..3d6c89fa6 100644 --- 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 @@ -16,6 +16,7 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers public class FormulaMainController : MvcControllerBase { private FormulaMainIBLL formulaMainIBLL = new FormulaMainBLL(); + private CalculateProjectIBLL calculateProjectIBLL = new CalculateProjectBLL(); #region 视图功能 @@ -100,6 +101,18 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers return Success(list); } + /// + /// 获取所有计算项目 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetCalProject() + { + var list = calculateProjectIBLL.GetListForDataSource(); + + return Success(list); + } #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 index e86a1ba0c..3216cc138 100644 --- 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 @@ -71,9 +71,9 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers /// [HttpGet] [AjaxOnly] - public ActionResult GetTree() + public ActionResult GetTree(string queryJson) { - var data = fillinFromIBLL.GetTree(); + var data = fillinFromIBLL.GetTree(queryJson); return Success(data); } /// 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 index 8cf8c6108..709874975 100644 --- 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 @@ -60,7 +60,7 @@ var bootstrap = function ($, learun) { $.lrSetForm(top.$.rootUrl + '/LR_Desktop/FormulaMain/GetFormChildList?keyValue=' + keyValue, function (data) { $('#content1').html(''); var html = ''; - if (data) { + if (data && data.length > 0) { for (var i = 0; i < data.length; i++) { var id = learun.newGuid(); var html = ''; @@ -76,10 +76,12 @@ var bootstrap = function ($, learun) { html += ''; $('#content1').append(html); - $('#pro' + id).lrDataSourceSelect({ - code: 'CalculateProject', - value: 'id', - text: 'name', + $('#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) { @@ -121,10 +123,13 @@ var bootstrap = function ($, learun) { html += ''; html += ''; $('#content1').append(html); - $('#pro' + id).lrDataSourceSelect({ - code: 'CalculateProject', - value: 'id', - text: 'name', + + $('#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) { @@ -141,6 +146,27 @@ var bootstrap = function ($, learun) { } } }); + + //$('#pro' + id).lrDataSourceSelect({ + // code: 'CalculateProject', + // value: 'id', + // text: 'name', + // select: + // function (item) { + // if (item) { + // var id = $(this).attr('id'); + // var parId = id.replace('pro', ''); + // if (arr.indexOf(parId) != -1) { + // //如果存在删除 + // 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 () { //页面显示公式结果 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 index a828edf9f..ddc20314e 100644 --- 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 @@ -185,7 +185,7 @@ var bootstrap = function ($, learun) { search: function (param) { param = param || {}; param.FillInFromId = FillInFromId; - param.CreateUserId = learun.clientdata.get(['userinfo']).userId; + //param.CreateUserId = learun.clientdata.get(['userinfo']).userId; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectDataManageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectDataManageController.cs index 8654a5fb9..735c2f187 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectDataManageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectDataManageController.cs @@ -47,7 +47,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { return View(); } - + #endregion #region 获取数据 @@ -73,17 +73,17 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers }; return Success(jsonData); }/// - /// 获取页面显示列表数据 - /// - /// 分页参数 - /// 查询参数 - /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// [HttpGet] [AjaxOnly] - public ActionResult GetList( string queryJson) + public ActionResult GetList(string queryJson) { var data = projectDataManageIBLL.GetList(queryJson); - + return Success(data); } /// @@ -131,14 +131,13 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { ProjectDataManageEntity entity = strEntity.ToObject(); - entity.CreateTime = DateTime.Now; - entity.CreateUserId = LoginUserInfo.Get().userId; + projectDataManageIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } /// - /// 保存实体数据(新增、修改) + /// 上传项目资料 /// /// 主键 /// 实体 @@ -149,15 +148,20 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers public ActionResult SaveData(string keyValue, string strEntity) { ProjectDataManageEntity pentity = strEntity.ToObject(); - var entity= projectDataManageIBLL.GetProjectDataManageEntity(keyValue); + var entity = projectDataManageIBLL.GetProjectDataManageEntity(keyValue); entity.Files = pentity.Files; entity.Name = pentity.Name; entity.Remark = pentity.Remark; + if (!string.IsNullOrEmpty(entity.Files)) + { + entity.FileTime = DateTime.Now; + entity.FileStatus = 1; + } projectDataManageIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } - + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/Index.js index a7c36d14d..127935f81 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/Index.js @@ -5,6 +5,7 @@ * 描 述:项目资料管理 */ var refreshGirdData; +var acceptClick; var PPId; var PId = request("PId");//项目Id var type = request("type");//type==2,上传项目资料 @@ -72,6 +73,13 @@ var bootstrap = function ($, learun) { }); } }); + if (type == 2) { + $('#lr_add').hide(); + //$('#lr_edit').html(' 上传'); + } else { + $('#lr_add').show(); + //$('#lr_edit').html(' 编辑'); + } }, inittree: function () { // 初始化左侧树形数据 @@ -87,7 +95,7 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/LogisticsManagement/ProjectDataManage/GetPageList', headData: [ { label: "项目资料名称", name: "Name", width: 200, align: "left" }, @@ -115,7 +123,13 @@ var bootstrap = function ($, learun) { }); } }, - { label: "时间", name: "CreateTime", width: 130, align: "left" }, + { + label: "是否上传", name: "FileStatus", width: 130, align: "left", + formatter: function (value) { + return value == '1' ? '' : ''; + } + }, + { label: "上传时间", name: "FileTime", width: 130, align: "left" }, { label: "备注", name: "Remark", width: 100, align: "left" }, ], mainId: 'Id', @@ -134,5 +148,12 @@ var bootstrap = function ($, learun) { refreshGirdData = function () { $('#gridtable').jfGridSet('reload'); }; + // 保存数据 + acceptClick = function (callBack) { + if (!!callBack) { + callBack(); + } + learun.layerClose(window.name); + }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.js index 9aec74d39..6fcfe9cba 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.js @@ -35,7 +35,10 @@ var bootstrap = function ($, learun) { url: top.$.rootUrl + '/LogisticsManagement/ProjectDataManage/Index?PId=' + keyValue + '&type=2', width: 1000, height: 800, - btn: null + btn: ['确定'], + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } }); } }); @@ -86,9 +89,13 @@ var bootstrap = function ($, learun) { { label: "项目状态", name: "Status", width: 100, align: "left", formatter: function (value) { - return value == 0 - ? '草稿' - : '完成'; + if (value == 0) { + return '草稿'; + } else if (value == 1) { + return '进行中'; + } else if (value == 2) { + return '完成'; + } } }, { label: "备注", name: "Remark", width: 100, align: "left" }, @@ -138,7 +145,13 @@ var bootstrap = function ($, learun) { }); } }, - { label: "时间", name: "CreateTime", width: 130, align: "left" }, + { + label: "是否上传", name: "FileStatus", width: 130, align: "left", + formatter: function (value) { + return value == '1' ? '' : ''; + } + }, + { label: "上传时间", name: "FileTime", width: 130, align: "left" }, { label: "备注", name: "Remark", width: 100, align: "left" }, ], mainId: 'Id', diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml index 67c5cc520..2562a0618 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml @@ -42,7 +42,7 @@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js index c4d3b93e1..49bd5c2fe 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js @@ -170,9 +170,13 @@ var bootstrap = function ($, learun) { { label: "项目状态", name: "Status", width: 100, align: "left", formatter: function (value) { - return value == 0 - ? '草稿' - : '完成'; + if (value == 0) { + return '草稿'; + } else if (value == 1) { + return '进行中'; + } else if (value == 2) { + return '完成'; + } } }, { label: "备注", name: "Remark", width: 100, align: "left" }, @@ -222,7 +226,13 @@ var bootstrap = function ($, learun) { }); } }, - { label: "时间", name: "CreateTime", width: 130, align: "left" }, + { + label: "是否上传", name: "FileStatus", width: 130, align: "left", + formatter: function (value) { + return value == '1' ? '' : ''; + } + }, + { label: "上传时间", name: "FileTime", width: 130, align: "left" }, { label: "备注", name: "Remark", width: 100, align: "left" }, ], mainId: 'Id', 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 index 73e6d8710..21ab5aacf 100644 --- 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 @@ -96,12 +96,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 获取树形数据 /// /// - public IEnumerable GetTree() + public IEnumerable GetTree(string queryJson) { try { List treeList = new List(); - var list = fillinFromService.GetSqlTree(); + var list = fillinFromService.GetSqlTree(queryJson); foreach (var item in list) { TreeModel node = new TreeModel 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 index d2e6f62b5..77e498333 100644 --- 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 @@ -48,7 +48,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 获取树形数据 /// /// - IEnumerable GetTree(); + IEnumerable GetTree(string queryJson); #endregion #region 提交数据 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 index 0f3de80cf..662cbc50b 100644 --- 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 @@ -218,11 +218,23 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - public IEnumerable GetSqlTree() + public IEnumerable GetSqlTree(string queryJson) { try { - return this.BaseRepository("CollegeMIS").FindList(x => x.IsFlag == 0 && x.State == 2); + 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) { 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 index a43135dd5..a8b76310a 100644 --- 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 @@ -67,6 +67,26 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + + public DataTable GetListForDataSource() + { + try + { + return calculateProjectService.GetListForDataSource(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/CalculateProject/CalculateProjectIBLL.cs index 4b851034b..c0753ad65 100644 --- 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 @@ -27,6 +27,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// 主键 /// CalculateProjectEntity GetCalculateProjectEntity(string keyValue); + /// + /// + /// + /// + DataTable GetListForDataSource(); #endregion #region 提交数据 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 index 67a3d7a81..9f8396504 100644 --- 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 @@ -50,10 +50,10 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } if (!queryParam["Type"].IsEmpty()) { - dp.Add("Type",queryParam["Type"].ToString(), DbType.String); + dp.Add("Type", queryParam["Type"].ToString(), DbType.String); strSql.Append(" AND t.Type = @Type "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -92,6 +92,30 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + /// + /// + /// + /// + 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 提交数据 @@ -104,7 +128,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.Id == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); } catch (Exception ex) { 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 index 520b5ae25..7a8b8e908 100644 --- 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 @@ -46,6 +46,10 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { 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); } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageEntity.cs index f66c84e55..899b67d54 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageEntity.cs @@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// 日 期:2021-06-21 15:49 /// 描 述:项目资料管理 /// - public class ProjectDataManageEntity + public class ProjectDataManageEntity { #region 实体成员 /// @@ -64,6 +64,17 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// [Column("FILES")] public string Files { get; set; } + /// + /// 资料文件编辑时间 + /// + [Column("FILETIME")] + public DateTime? FileTime { get; set; } + /// + /// 上传状态 + /// + [Column("FILESTATUS")] + public int? FileStatus { get; set; } + #endregion #region 扩展操作 @@ -75,6 +86,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement this.Id = Guid.NewGuid().ToString(); this.CreateTime = DateTime.Now; this.CreateUserId = LoginUserInfo.Get().userId; + this.FileStatus = 0; } /// /// 编辑调用 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageService.cs index e007971df..c1af6086c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageService.cs @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.LogisticsManagement @@ -43,17 +44,17 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } if (!queryParam["DepartmentId"].IsEmpty()) { - dp.Add("DepartmentId",queryParam["DepartmentId"].ToString(), DbType.String); + dp.Add("DepartmentId", queryParam["DepartmentId"].ToString(), DbType.String); strSql.Append(" AND t.DepartmentId = @DepartmentId "); } if (!queryParam["ManagerId"].IsEmpty()) { - dp.Add("ManagerId",queryParam["ManagerId"].ToString(), DbType.String); + dp.Add("ManagerId", queryParam["ManagerId"].ToString(), DbType.String); strSql.Append(" AND t.ManagerId = @ManagerId "); } if (!queryParam["PId"].IsEmpty()) { - dp.Add("PId",queryParam["PId"].ToString(), DbType.String); + dp.Add("PId", queryParam["PId"].ToString(), DbType.String); strSql.Append(" AND t.PId = @PId "); } if (!queryParam["PPId"].IsEmpty()) @@ -61,7 +62,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement dp.Add("PPId", queryParam["PPId"].ToString(), DbType.String); strSql.Append(" AND t.PPId = @PPId "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -75,7 +76,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } } - + /// /// 获取页面显示列表数据 /// @@ -154,7 +155,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } } - + #endregion #region 提交数据 @@ -167,7 +168,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.Id == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); } catch (Exception ex) { @@ -189,21 +190,37 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// 实体 public void SaveEntity(string keyValue, ProjectDataManageEntity entity) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { if (!string.IsNullOrEmpty(keyValue)) { entity.Modify(keyValue); - this.BaseRepository("CollegeMIS").Update(entity); + db.Update(entity); + if (!string.IsNullOrEmpty(entity.Files)) + { + //判断当前项目各阶段是否已全部上传 + var list = db.FindList(x => x.PId == entity.PId && !string.IsNullOrEmpty(x.Files) && x.Id != keyValue); + if (list.Count() <= 0) + { + //如果全部已上传,将项目状态改为已完成 + var projectManageEntity = db.FindEntity(x => x.Id == entity.PId); + projectManageEntity.Status = "2"; + db.Update(projectManageEntity); + } + } + } else { entity.Create(); - this.BaseRepository("CollegeMIS").Insert(entity); + db.Insert(entity); } + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw;