diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectBasicController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectBasicController.cs index d5ee136c0..c22093bcc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectBasicController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectBasicController.cs @@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,8 +35,18 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult IndexTJ() + { + return View(); + } + #endregion #region 获取数据 @@ -62,6 +72,28 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers }; return Success(jsonData); } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForTJ(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = sRProjectBasicIBLL.GetPageListForTJ(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } /// /// 获取页面显示列表数据 /// @@ -82,8 +114,9 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var SRProjectBasicData = sRProjectBasicIBLL.GetSRProjectBasicEntity( keyValue ); - var jsonData = new { + var SRProjectBasicData = sRProjectBasicIBLL.GetSRProjectBasicEntity(keyValue); + var jsonData = new + { SRProjectBasic = SRProjectBasicData, }; return Success(jsonData); @@ -116,7 +149,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { SRProjectBasicEntity entity = strEntity.ToObject(); - sRProjectBasicIBLL.SaveEntity(keyValue,entity); + sRProjectBasicIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectBasic/IndexTJ.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectBasic/IndexTJ.cshtml new file mode 100644 index 000000000..194dafae7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectBasic/IndexTJ.cshtml @@ -0,0 +1,50 @@ +@{ + ViewBag.Title = "项目基本信息管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
项目编号
+ +
+
+
项目名称
+ +
+
+
项目类型
+
+
+
+
项目级别
+
+
+
+
立项组织
+
+
+
+
+
+
+
+
+ +
+
+  打印 +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/SRProjectBasic/IndexTJ.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectBasic/IndexTJ.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectBasic/IndexTJ.js new file mode 100644 index 000000000..cba354e56 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectBasic/IndexTJ.js @@ -0,0 +1,141 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-09-15 15:53 + * 描 述:项目基本信息管理 + */ +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); + }, 320, 400); + $('#Type').lrDataItemSelect({ code: 'ProjectType_ZZ' }); + $('#Lev').lrDataItemSelect({ code: 'ProjectLev_ZZ' }); + $('#ProjectOrganization').lrDataItemSelect({ code: 'ProjectOrganization_ZZ' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/CustomFunction/SRProjectBasic/GetPageListForTJ', + headData: [ + { label: "项目编号", name: "EnCode", width: 100, align: "left" }, + { label: "项目名称", name: "Name", width: 100, align: "left" }, + { + label: "项目类型", name: "Type", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'ProjectType_ZZ', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "项目级别", name: "Lev", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'ProjectLev_ZZ', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "立项组织", name: "ProjectOrganization", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'ProjectOrganization_ZZ', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "项目总经费", name: "CostSum", width: 100, align: "left", statistics: true }, + { label: "项目来源", name: "Source", width: 100, align: "left" }, + { + label: "项目负责人", name: "ManageName", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: value, + keyId: 'empid', + callback: function (_data) { + callback(_data['empname']); + } + }); + } + }, + { + label: "项目成员", name: "Players", 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('custmerData', + { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', + key: timearr[i], + keyId: 'f_userid', + callback: function (_data) { + content += _data['f_realname'] + ','; + } + }); + } + content = content.substring(0, content.length - 1); + callback(content); + } else { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', + key: value, + keyId: 'f_userid', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + + + + } + }, + { label: "项目成果个数", name: "acount", width: 100, align: "left" }, + { label: "开始时间", name: "StartTime", width: 100, align: "left" }, + { label: "结束时间", name: "EndTime", 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/CustomFunction/Views/SRProjectPeople/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.js index 0b0dc8528..b5b6026f9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.js @@ -21,7 +21,7 @@ var bootstrap = function ($, learun) { value: "ID", text: "EnCode" }); - $('#ManageName').lrDataSourceSelect({ code: 'EmpInfo', value: 'empid', text: 'empname' }); + $('#ManageName').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); $('#Players').lrUserSelect({ type: '1' }); //$('#Players').lrselect({ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js index 0ad9ba6c3..55b3abe05 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js @@ -84,11 +84,11 @@ var bootstrap = function ($, learun) { label: "项目负责人", name: "ManageName", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', key: value, - keyId: 'empid', + keyId: 'f_userid', callback: function (_data) { - callback(_data['empname']); + callback(_data['f_realname']); } }); } 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 19c6bf33b..4857d99d2 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 @@ -938,6 +938,7 @@ + @@ -7344,6 +7345,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicBLL.cs index dab7c9f06..56eb1d877 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicBLL.cs @@ -43,6 +43,30 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageListForTJ(Pagination pagination, string queryJson) + { + try + { + return sRProjectBasicService.GetPageListForTJ(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取页面显示列表数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicEntity.cs index 58c269af1..6f0689c07 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicEntity.cs @@ -118,6 +118,13 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } #endregion #region 扩展字段 + [NotMapped] + public string ManageName { get; set; } + [NotMapped] + public string Players { get; set; } + [NotMapped] + public int? acount { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicIBLL.cs index 2f7c8d9d6..2730bbd36 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicIBLL.cs @@ -22,6 +22,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// IEnumerable GetPageList(Pagination pagination, string queryJson); IEnumerable GetList(); + IEnumerable GetPageListForTJ(Pagination pagination, string queryJson); /// /// 获取SRProjectBasic表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicService.cs index c8c4ac796..57d0d87ec 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectBasic/SRProjectBasicService.cs @@ -89,6 +89,77 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageListForTJ(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.ID, + t.EnCode, + t.Name, + t.Type, + t.Lev, + t.ProjectOrganization, + t.CostSum, + t.StartTime, + t.EndTime, + t.Source, + t.ContractNo,p.ManageName,p.Players,a.acount + "); + strSql.Append(" FROM SRProjectBasic t "); + strSql.Append(@" left join SRProjectPeople p on p.SRProjectBasicId=t.id + left join ( select SRProjectBasicId,count(1) as acount from SRProjectAchievement group by SRProjectBasicId) a on a.SRProjectBasicId=t.ID "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["EnCode"].IsEmpty()) + { + dp.Add("EnCode", "%" + queryParam["EnCode"].ToString() + "%", DbType.String); + strSql.Append(" AND t.EnCode Like @EnCode "); + } + 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 "); + } + if (!queryParam["Lev"].IsEmpty()) + { + dp.Add("Lev", queryParam["Lev"].ToString(), DbType.String); + strSql.Append(" AND t.Lev = @Lev "); + } + if (!queryParam["ProjectOrganization"].IsEmpty()) + { + dp.Add("ProjectOrganization", queryParam["ProjectOrganization"].ToString(), DbType.String); + strSql.Append(" AND t.ProjectOrganization = @ProjectOrganization "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// ///