diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/PartyManageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/PartyManageController.cs index bdad1fee1..b556d0e91 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/PartyManageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/PartyManageController.cs @@ -37,6 +37,12 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers { return View(); } + + [HttpGet] + public ActionResult StatsIndex() + { + return View(); + } #endregion #region 获取数据 @@ -90,6 +96,25 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers var data = partyManageIBLL.GetTree(CType); return Success(data); } + /// + /// 统计数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetStatsList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = partyManageIBLL.GetStatsList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/StatsIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/StatsIndex.cshtml new file mode 100644 index 000000000..fc14c1551 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/StatsIndex.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "统计"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
树形列表
+
+
+
+
+
+
+ 列表信息 +
+
+
+
+
+
+ @*
+
+
+
+
标题
+ +
+
+
学年
+
+
+
+
学期
+
+
+
+
+
*@ +
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/PersonnelManagement/Views/PartyManage/StatsIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/StatsIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/StatsIndex.js new file mode 100644 index 000000000..b04fc7b15 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/StatsIndex.js @@ -0,0 +1,140 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-11-07 14:25 + * 描 述:经费开支申报 + */ +var refreshGirdData; +var selectedId; +var CType = request('CType'); +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + if (!CType) { + CType = 1; + } + // 初始化左侧树形数据 + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/PersonnelManagement/PartyManage/GetTree?CType=' + CType, + nodeClick: function (item) { + selectedId = item.value; + page.search({ CateId: item.value }); + } + }); + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + if (selectedId) { + page.search({ CateId: selectedId }); + } + } + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + // if (selectedId) { + // queryJson.CateId = selectedId; + // page.search(queryJson); + // } + //}, 220, 400); + //$('#Year').lrselect({ + // placeholder: "学年", + // allowSearch: false, + // url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + // value: 'value', + // text: 'text', + // maxHeight: 200, + //}); + ////学期 + //$('#Semester').lrselect({ + // placeholder: "学期", + // allowSearch: false, + // url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + // value: 'value', + // text: 'text' + //}); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/PersonnelManagement/PartyManage/GetStatsList', + headData: [ + { + label: "申报部门", name: "Department", width: 200, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('department', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + } + }, + { label: "总人数", name: "Num", width: 200, align: "left", statistics: true }, + { label: "上传人数", name: "Number", width: 200, align: "left", statistics: true }, + { label: '未上传人数', name: 'Unit', width: 150, align: 'left', statistics: true }, + ], + mainId: 'Department', + isPage: true, + sidx: 'Department desc' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + if (selectedId) { + page.search({ CateId: selectedId }); + } + //if (!!res) { + // if (res.code == 200) { + // // 发起流程 + // var postData = { + // schemeCode: 'LC_FundsApply',// 填写流程对应模板编号 + // processId: processId, + // level: '1', + // }; + // learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + // learun.loading(false); + // }); + // } + // page.search(); + //} + }; + 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 cab64889d..b9be0e89f 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 @@ -1874,6 +1874,7 @@ + @@ -8180,6 +8181,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageBLL.cs index 13221646a..bea0a0384 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageBLL.cs @@ -42,6 +42,24 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } } + public IEnumerable GetStatsList(Pagination pagination, string queryJson) + { + try + { + return partyManageService.GetStatsList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取PartyManage表实体数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageEntity.cs index f464658cc..d2cdb88d2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageEntity.cs @@ -53,12 +53,18 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement public string CType { get; set; } [Column("YEAR")] public string Year { get; set; } - [Column("SEMESTER")] public string Semester { get; set; } + [Column("DEPARTMENT")] + public string Department { get; set; } #endregion - + [NotMapped] + public int Num { get; set; } + [NotMapped] + public int Number { get; set; } + [NotMapped] + public int cha { get; set; } #region 扩展操作 /// /// 新增调用 @@ -68,6 +74,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement this.ID = Guid.NewGuid().ToString(); this.Createtime = DateTime.Now; this.Creator = LoginUserInfo.Get().userId; + this.Department = LoginUserInfo.Get().departmentId; } /// /// 编辑调用 @@ -76,6 +83,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement public void Modify(string keyValue) { this.ID = keyValue; + this.Updatetime = DateTime.Now; } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageIBLL.cs index 3f92140b6..bd8d2f3dc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageIBLL.cs @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetStatsList(Pagination pagination, string queryJson); /// /// 获取PartyManage表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageService.cs index 3088e069f..6c33b869d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageService.cs @@ -78,6 +78,54 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + public IEnumerable GetStatsList(Pagination pagination, string queryJson) + { + try + { + var baseDataName = this.BaseRepository().getDbConnection().Database; + var baseDataName1 = this.BaseRepository("CollegeMIS").getDbConnection().Database; + + var strSql = new StringBuilder(); + strSql.Append($" select zb.F_DepartmentId as Department, COALESCE (aa.num, 0) num ,COALESCE (bb.number, 0) number from (select* from {baseDataName}.dbo.LR_Base_Department where f_companyid ='06890807-2106-4e6d-9f99-484527503be9') zb "); + strSql.Append($" left join(select F_DepartmentId,count(*) as num from {baseDataName}.dbo.LR_Base_User group by F_DepartmentId ) aa on aa.F_DepartmentId =zb.F_DepartmentId"); + strSql.Append($" left join (select Department,count(*) as number from {baseDataName1}.dbo.PartyManage where 1=1 "); + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["CateId"].IsEmpty()) + { + dp.Add("CateId", queryParam["CateId"].ToString(), DbType.String); + strSql.Append(" AND CateId = @CateId "); + } + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( Createtime >= @startTime AND Createtime <= @endTime ) "); + } + strSql.Append($" group by Department) bb on bb.Department= zb.F_DepartmentId "); + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + if (data != null) + { + foreach (var item in data) + { + item.cha = item.Num - item.Number; + } + } + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取PartyManage表实体数据 ///