From 96da4e4d7f79083de09d43f3c0aef637aa11bc96 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Thu, 17 Sep 2020 17:03:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E8=80=83?= =?UTF-8?q?=E5=8B=A4=E8=AE=B0=E5=BD=95=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ADR_RecordController.cs | 24 +++++++++++-------- .../Views/ADR_Record/StatisticIndex.js | 4 ++-- .../ADR_Record/ADR_RecordService.cs | 7 +++--- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ADR_RecordController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ADR_RecordController.cs index dd22b730b..f68ab1877 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ADR_RecordController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ADR_RecordController.cs @@ -14,6 +14,7 @@ using Stimulsoft.Report.Components; using Stimulsoft.Report.Engine; using Stimulsoft.Report.Export; using Stimulsoft.Report.Mvc; +using System.Linq; namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { @@ -59,7 +60,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { StiReport report = new StiReport(); report.Load(Server.MapPath("~/Areas/LogisticsManagement/Views/ADR_Record/Report.mrt")); - + var data = aDR_RecordIBLL.GetList("{}"); report.RegData(Util.DataBase.DataConvert.ToDataTable(data)); report.Compile(); @@ -151,15 +152,18 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers public ActionResult GetStatisticList(string pagination, string queryJson) { Pagination paginationobj = pagination.ToObject(); - var data = aDR_RecordIBLL.GetStatisticList(paginationobj, queryJson); - var jsonData = new - { - rows = data, - total = paginationobj.total, - page = paginationobj.page, - records = paginationobj.records - }; - return Success(jsonData); + var data = aDR_RecordIBLL.GetStatisticList(null, queryJson).GroupBy(x => new { x.UserNo, x.UserName }) + .Select(x => new ADR_RecordEntity() + { + UserNo = x.Key.UserNo, + UserName = x.Key.UserName, + ZhengChangNum = x.Where(y => y.ClockStatus == "1").Count().ToString(), + ChiDaoNum = x.Where(y => y.ClockStatus == "2").Count().ToString(), + ZaoTuiNum = x.Where(y => y.ClockStatus == "3").Count().ToString() + }).OrderBy(x => x.UserNo); + + + return Success(data); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ADR_Record/StatisticIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ADR_Record/StatisticIndex.js index beaa54488..3eb624dd4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ADR_Record/StatisticIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ADR_Record/StatisticIndex.js @@ -57,13 +57,13 @@ var bootstrap = function ($, learun) { headData: [ { label: "姓名", name: "UserName", width: 100, align: "left" }, { label: "职工编号", name: "UserNo", width: 100, align: "left" }, - { label: "打卡时间", name: "ClockDate", width: 100, align: "left" }, + //{ label: "打卡时间", name: "ClockDate", width: 100, align: "left" }, { label: "正常次数", name: "ZhengChangNum", width: 100, align: "left" }, { label: "迟到次数", name: "ChiDaoNum", width: 100, align: "left" }, { label: "早退次数", name: "ZaoTuiNum", width: 100, align: "left" }, ], mainId: '', - isPage: true, + isPage: false, sidx: "ClockDate desc,UserNo", }); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordService.cs index 8c807661a..03e312998 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordService.cs @@ -141,7 +141,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } strSql.Append(" order by t.UserNo,c.F_SortCode,t.ClockTime "); - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); } catch (Exception ex) { @@ -192,7 +192,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement var basedbname = BaseRepository().getDbConnection().Database; var strSql = new StringBuilder(); - strSql.Append("select t.UserNo,u.F_RealName as UserName,CONVERT(varchar(100), t.ClockTime, 23) as ClockDate,sum(case when t.ClockStatus='1' then 1 else 0 end) as ZhengChangNum,sum(case when t.ClockStatus='2' then 1 else 0 end) as ChiDaoNum,sum(case when t.ClockStatus='3' then 1 else 0 end) as ZaoTuiNum "); + strSql.Append("select t.*,u.F_RealName as UserName "); strSql.Append(" from ADR_Record t "); strSql.Append(" left join " + basedbname + ".dbo.LR_Base_User u on u. F_EnCode=T.UserNo "); strSql.Append(" where 1=1 "); @@ -215,9 +215,8 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement dp.Add("UserName", "%" + queryParam["UserName"].ToString() + "%", DbType.String); strSql.Append(" AND u.F_RealName Like @UserName "); } - strSql.Append(" group by t.UserNo,u.F_RealName,CONVERT(varchar(100), t.ClockTime, 23) "); - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); } catch (Exception ex) {