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
index 2064dfd33..b04fc7b15 100644
--- 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
@@ -5,6 +5,8 @@
* 描 述:经费开支申报
*/
var refreshGirdData;
+var selectedId;
+var CType = request('CType');
var bootstrap = function ($, learun) {
"use strict";
var startTime;
@@ -59,37 +61,36 @@ var bootstrap = function ($, learun) {
$('#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'
- });
+ //$('#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 + '/AssetManagementSystem/PartyManage/GetStatsList',
+ url: top.$.rootUrl + '/PersonnelManagement/PartyManage/GetStatsList',
headData: [
- { label: "日期", name: "ApplyTime", width: 150, align: "left" },
{
- label: "申报部门", name: "DeclarationDept", width: 200, align: "left",
+ label: "申报部门", name: "Department", width: 200, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('department', {
key: value,
@@ -99,62 +100,15 @@ var bootstrap = function ($, learun) {
});
}
},
- {
- label: "申报类别", name: "DeclarationType", width: 200, align: "left"
- , formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'DeclarationType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "项目内容", name: "ProjectContent", width: 200, align: "left" },
- { label: "数量", name: "Number", width: 200, align: "left" },
- {
- label: '单位', name: 'Unit', width: 150, align: 'left',
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'sldw',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "单价(元)", name: "Price", width: 200, align: "left",
- formatter: function (cellvalue) {
- return cellvalue != null && cellvalue != "" && cellvalue != undefined ? cellvalue.toFixed(2) : "0.00";
- }
- },
- {
- label: "金额(元)", name: "Amount", width: 200, align: "left", statistics: true,
- formatter: function (cellvalue) {
- return cellvalue != null && cellvalue != "" && cellvalue != undefined ? cellvalue.toFixed(2) : "0.00";
- }
- },
- {
- label: "固定资产", name: "IsFixedAssets", width: 100, align: "left"
- , formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'YesOrNoInt',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
+ { 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: 'Id',
+ mainId: 'Department',
isPage: true,
- sidx: 'ApplyTime desc'
+ sidx: 'Department desc'
});
- //page.search();
+ page.search();
},
search: function (param) {
param = param || {};
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 2904d9169..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
@@ -59,7 +59,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
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 扩展操作
///
/// 新增调用
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 651298a39..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
@@ -82,41 +82,36 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
try
{
+ var baseDataName = this.BaseRepository().getDbConnection().Database;
+ var baseDataName1 = this.BaseRepository("CollegeMIS").getDbConnection().Database;
+
var strSql = new StringBuilder();
- strSql.Append("SELECT ");
- strSql.Append(@"t.* ");
- strSql.Append(" FROM PartyManage t");
- strSql.Append(" WHERE 1=1 ");
+ 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["Year"].IsEmpty())
- {
- dp.Add("Year", queryParam["Year"].ToString(), DbType.String);
- strSql.Append(" AND t.Year = @Year ");
- }
- if (!queryParam["Semester"].IsEmpty())
- {
- dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String);
- strSql.Append(" AND t.Semester = @Semester ");
- }
- if (!queryParam["Creator"].IsEmpty())
- {
- dp.Add("Creator", queryParam["Creator"].ToString(), DbType.String);
- strSql.Append(" AND t.Creator = @Creator ");
- }
if (!queryParam["CateId"].IsEmpty())
{
dp.Add("CateId", queryParam["CateId"].ToString(), DbType.String);
- strSql.Append(" AND t.CateId = @CateId ");
+ 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 ( t.Createtime >= @startTime AND t.Createtime <= @endTime ) ");
+ strSql.Append(" AND ( Createtime >= @startTime AND Createtime <= @endTime ) ");
}
- return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
+ 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)
{