Browse Source

【修改】考勤记录统计

中职版本
dyy 4 years ago
parent
commit
96da4e4d7f
3 changed files with 19 additions and 16 deletions
  1. +14
    -10
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ADR_RecordController.cs
  2. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ADR_Record/StatisticIndex.js
  3. +3
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordService.cs

+ 14
- 10
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ADR_RecordController.cs View File

@@ -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<Pagination>();
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


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ADR_Record/StatisticIndex.js View File

@@ -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",
});
},


+ 3
- 4
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordService.cs View File

@@ -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<ADR_RecordEntity>(strSql.ToString(),dp);
return this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(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<ADR_RecordEntity>(strSql.ToString(), dp, pagination);
return this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(strSql.ToString(), dp);
}
catch (Exception ex)
{


Loading…
Cancel
Save