@@ -37,7 +37,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -46,7 +46,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
[HttpGet] | |||
@@ -80,6 +80,15 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
} | |||
/// <summary> | |||
/// 统计主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult StatisticIndex() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -125,12 +134,34 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var ADR_RecordData = aDR_RecordIBLL.GetADR_RecordEntity( keyValue ); | |||
var jsonData = new { | |||
var ADR_RecordData = aDR_RecordIBLL.GetADR_RecordEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
ADR_Record = ADR_RecordData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 考勤记录统计 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
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); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -159,10 +190,10 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
{ | |||
UserInfo userInfo = LoginUserInfo.Get(); | |||
ADR_RecordEntity entity = strEntity.ToObject<ADR_RecordEntity>(); | |||
aDR_RecordIBLL.SaveEntity(keyValue,entity); | |||
aDR_RecordIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,38 @@ | |||
@{ | |||
ViewBag.Title = "考勤记录统计"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="datesearch"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">职工编号</div> | |||
<input id="UserNo" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">职工姓名</div> | |||
<input id="UserName" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/ADR_Record/StatisticIndex.js") |
@@ -0,0 +1,81 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-08-28 18:09 | |||
* 描 述:考勤记录统计 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var startTime; | |||
var endTime; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 时间搜索框 | |||
$('#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; | |||
page.search(); | |||
} | |||
}); | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/ADR_Record/GetStatisticList', | |||
headData: [ | |||
{ label: "姓名", name: "UserName", width: 100, align: "left" }, | |||
{ label: "职工编号", name: "UserNo", 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, | |||
sidx: "ClockDate desc,UserNo", | |||
}); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.StartTime = startTime; | |||
param.EndTime = endTime; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -1141,6 +1141,7 @@ | |||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\Allocation.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\DormitoryAdd.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ADR_Record\AttendanceReportByWeek.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ADR_Record\StatisticIndex.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\APAppointmentPsychologist\Form.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\APAppointmentPsychologist\Index.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\CompanyNews\Form.js" /> | |||
@@ -6813,6 +6814,7 @@ | |||
<Content Include="Areas\LogisticsManagement\Views\ADR_Record\AttendanceReportByWeek.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ADR_Record\Report.mrt" /> | |||
<Content Include="Areas\EducationalAdministration\Views\EADateArrange\InitByConditionForm.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ADR_Record\StatisticIndex.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | |||
@@ -808,7 +808,6 @@ | |||
path.setAttribute("stroke", "gray"); | |||
path.setAttribute("marker-end", "url(#arrow1)"); | |||
} | |||
/ | |||
line.appendChild(hi); | |||
line.appendChild(path); | |||
line.style.cursor = "crosshair"; | |||
@@ -109,6 +109,30 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 考勤记录统计 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ADR_RecordEntity> GetStatisticList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return aDR_RecordService.GetStatisticList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -99,6 +99,27 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
/// <summary> | |||
/// 打卡时间 | |||
/// </summary> | |||
[NotMapped] | |||
public string ClockDate { get; set; } | |||
/// <summary> | |||
/// 正常次数 | |||
/// </summary> | |||
[NotMapped] | |||
public string ZhengChangNum { get; set; } | |||
/// <summary> | |||
/// 迟到次数 | |||
/// </summary> | |||
[NotMapped] | |||
public string ChiDaoNum { get; set; } | |||
/// <summary> | |||
/// 早退次数 | |||
/// </summary> | |||
[NotMapped] | |||
public string ZaoTuiNum { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -36,6 +36,13 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
ADR_RecordEntity GetADR_RecordEntity(string keyValue); | |||
IEnumerable<ADR_RecordEntity> GetADR_RecordEntityByEmpNo(string year, string month, string day, string empno); | |||
/// <summary> | |||
/// 考勤记录统计 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<ADR_RecordEntity> GetStatisticList(Pagination pagination, string queryJson); | |||
#endregion | |||
#region 提交数据 | |||
@@ -63,7 +63,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
if (!queryParam["Department"].IsEmpty()) | |||
{ | |||
dp.Add("Department",queryParam["Department"].ToString(), DbType.String); | |||
dp.Add("Department", queryParam["Department"].ToString(), DbType.String); | |||
strSql.Append(" AND emp.F_DepartmentId = @Department "); | |||
} | |||
if (!queryParam["ADR_Device"].IsEmpty()) | |||
@@ -76,7 +76,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
dp.Add("ADStatus", queryParam["ADStatus"].ToString(), DbType.String); | |||
strSql.Append(" AND t.ClockStatus = @ADStatus "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(strSql.ToString(),dp, pagination); | |||
return this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -180,6 +180,58 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
} | |||
/// <summary> | |||
/// 考勤记录统计 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ADR_RecordEntity> GetStatisticList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
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(" 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 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
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.ClockTime >= @startTime AND t.ClockTime <= @endTime ) "); | |||
} | |||
if (!queryParam["UserNo"].IsEmpty()) | |||
{ | |||
dp.Add("UserNo", queryParam["UserNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.UserNo = @UserNo "); | |||
} | |||
if (!queryParam["UserName"].IsEmpty()) | |||
{ | |||
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); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -193,7 +245,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<ADR_RecordEntity>(t=>t.ID == keyValue); | |||
this.BaseRepository("CollegeMIS").Delete<ADR_RecordEntity>(t => t.ID == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -249,11 +301,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
/// <param name="day"></param> | |||
/// <param name="empno"></param> | |||
/// <returns></returns> | |||
public IEnumerable<ADR_RecordEntity> GetADR_RecordEntityByEmpNo(string year,string month,string day,string empno) | |||
public IEnumerable<ADR_RecordEntity> GetADR_RecordEntityByEmpNo(string year, string month, string day, string empno) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(m=>m.ADYear==year&&m.ADMonth==month&&m.ADDay==day&&m.UserNo==empno); | |||
return this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(m => m.ADYear == year && m.ADMonth == month && m.ADDay == day && m.UserNo == empno); | |||
} | |||
catch (Exception ex) | |||
{ | |||