Преглед на файлове

【修改】坐班考勤明细:考勤时间查询修改为范围;

黑艺新账号
dyy преди 1 година
родител
ревизия
ce695b6dc8
променени са 4 файла, в които са добавени 214 реда и са изтрити 168 реда
  1. +9
    -8
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ADR_Record/StatisticDetailIndex.cshtml
  2. +33
    -14
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ADR_Record/StatisticDetailIndex.js
  3. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordEntity.cs
  4. +171
    -145
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordService.cs

+ 9
- 8
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ADR_Record/StatisticDetailIndex.cshtml Целия файл

@@ -2,23 +2,24 @@
ViewBag.Title = "考勤记录统计";
Layout = "~/Views/Shared/_Index.cshtml";
}
<div class="lr-layout " >

<style>
.lr-search-date {
width: 100%;
}
</style>
<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">
<input id="date" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#date').trigger('change'); } })" placeholder="请选择日期" />
</div>
<div class="lr-layout-tool-item">
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;<span class="lrlt">查询</span></a>
</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="Date" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#Date').trigger('change'); } })" placeholder="请选择日期" />
@*<input id="Date" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#Date').trigger('change'); } })" placeholder="请选择日期" />*@
<div id="datesearch"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">职工编号</div>


+ 33
- 14
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ADR_Record/StatisticDetailIndex.js Целия файл

@@ -7,7 +7,8 @@
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
//var date = "";
var startTime;
var endTime;
var page = {
init: function () {
page.initGird();
@@ -17,22 +18,39 @@ var bootstrap = function ($, learun) {
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
page.search(queryJson);
}, 250, 400);
// 时间搜索框
$('#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: '0',
selectfn: function (begin, end) {
startTime = begin;
endTime = end;
}
});
//当前年
var now = learun.formatDate(new Date(), 'yyyy-MM-dd');
$('#Date').val(now);
//var now = learun.formatDate(new Date(), 'yyyy-MM-dd');
//$('#Date').val(now);
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
//查询
//$('#btn_Search').on('click', function () {
// date = $('#date').val();
// if (date == null || date == undefined || date == "") {
// learun.alert.warning("请选择查询时间!");
// return;
// }
// page.search();
//});
// 部门选择
$('#F_DepartmentId').lrselect({
type: 'tree',
@@ -121,13 +139,14 @@ var bootstrap = function ($, learun) {
],
mainId: '',
isPage: true,
sidx: 'UserNo,UserName,ClockTime'
sidx: ''
});
page.search();
},
search: function (param) {
param = param || {};
//param.Date = date;
param.startTime = startTime;
param.endTime = endTime;
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordEntity.cs Целия файл

@@ -120,7 +120,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
#endregion
#region 扩展字段
/// <summary>
/// 打卡时间
/// 打卡时间(年月日)
/// </summary>
[NotMapped]
public string ClockDate { get; set; }


+ 171
- 145
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordService.cs Целия файл

@@ -246,175 +246,201 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
{
var basedbname = BaseRepository().getDbConnection().Database;
var queryParam = queryJson.ToJObject();
var date = DateTime.Now.ToDateString();
if (!queryParam["Date"].IsEmpty())
var datest = DateTime.Now.ToDateString();
var dateet = datest;
if (!queryParam["startTime"].IsEmpty())
{
date = queryParam["Date"].ToDate().ToDateString();
datest = queryParam["startTime"].ToDate().ToDateString();
}
var strSql = new StringBuilder();
strSql.Append("select u.F_Encode as UserNo,u.F_RealName as UserName,u.F_DepartmentId as Department,t.ID,t.ADType,t.ADTime,t.ClockTime,t.ClockStatus ");
strSql.Append(" from " + basedbname + ".dbo.LR_Base_User u ");
strSql.Append(" inner join EmpInfo emp on u.F_EnCode=emp.EmpNo ");
strSql.Append(" left join ADR_Record t on u.F_EnCode=t.UserNo and t.ADYear='" + date.Substring(0, 4) + "' and t.ADMonth='" + date.Substring(5, 2) + "' and t.ADDay='" + date.Substring(8, 2) + "' ");
strSql.Append(" where u.F_Description='教师' AND u.F_DeleteMark = 0 AND u.F_EnabledMark = 1 and u.F_Encode is not null ");

var UserNoPrev = Config.GetValue("ADR_RecordUserNoPrev");
if (!string.IsNullOrEmpty(UserNoPrev))
{
strSql.Append(" and u.F_encode like '" + UserNoPrev + "%' ");
}
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["UserNo"].IsEmpty())
{
dp.Add("UserNo", queryParam["UserNo"].ToString(), DbType.String);
strSql.Append(" AND u.F_EnCode = @UserNo ");
}
if (!queryParam["UserName"].IsEmpty())
{
dp.Add("UserName", "%" + queryParam["UserName"].ToString() + "%", DbType.String);
strSql.Append(" AND u.F_RealName Like @UserName ");
}
if (!queryParam["F_DepartmentId"].IsEmpty())
if (!queryParam["endTime"].IsEmpty())
{
dp.Add("F_DepartmentId", queryParam["F_DepartmentId"].ToString(), DbType.String);
strSql.Append(" AND emp.F_DepartmentId = @F_DepartmentId ");
dateet = queryParam["endTime"].ToDate().ToDateString();
}
if (!queryParam["ClockStatus"].IsEmpty())
{
dp.Add("ClockStatus", queryParam["ClockStatus"].ToString(), DbType.String);
if (queryParam["ClockStatus"].ToString() == "6" || queryParam["ClockStatus"].ToString() == "0")//缺勤、旷工
//考勤时间段查询结果
var totalResult = new List<ADR_RecordEntity>();
//启用的考勤规则
var restrictionEntity = this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(m => m.REnable == true);
if (restrictionEntity == null)
{
return totalResult;
}
//考勤时间段查询语句
var totalSql = new StringBuilder();
totalSql.Append("select top 100 percent * from ( ");
//考勤时间段查询
for (int i = 0; i < (dateet.ToDate() - datest.ToDate()).Days + 1; i++)
{
//当天日期
var date = datest.ToDate().AddDays(i).ToDateString();
//当天查询语句
var strSql = new StringBuilder();
strSql.Append($"select u.F_Encode as UserNo,u.F_RealName as UserName,u.F_DepartmentId as Department,t.ID,t.ADType,t.ADTime,t.ClockTime,t.ClockStatus,'{date}' as ClockDate ");
strSql.Append(" from " + basedbname + ".dbo.LR_Base_User u ");
strSql.Append(" inner join EmpInfo emp on u.F_EnCode=emp.EmpNo ");
strSql.Append(" left join ADR_Record t on u.F_EnCode=t.UserNo and t.ADYear='" + date.Substring(0, 4) + "' and t.ADMonth='" + date.Substring(5, 2) + "' and t.ADDay='" + date.Substring(8, 2) + "' ");
strSql.Append(" where u.F_Description='教师' AND u.F_DeleteMark = 0 AND u.F_EnabledMark = 1 and u.F_Encode is not null ");

var UserNoPrev = Config.GetValue("ADR_RecordUserNoPrev");
if (!string.IsNullOrEmpty(UserNoPrev))
{
strSql.Append(" AND t.ClockStatus is null ");
strSql.Append(" and u.F_encode like '" + UserNoPrev + "%' ");
}
else
// 虚拟参数
if (!queryParam["UserNo"].IsEmpty())
{
strSql.Append(" AND t.ClockStatus = @ClockStatus ");
strSql.Append($" AND u.F_EnCode = '{queryParam["UserNo"].ToString()}' ");
}
}
//某天记录列表
var data = this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(strSql.ToString(), dp, pagination)
.GroupBy(x => new { x.UserNo, x.UserName, x.Department }).Select(x => new
if (!queryParam["UserName"].IsEmpty())
{
strSql.Append($" AND u.F_RealName Like '%{queryParam["UserName"].ToString()}%' ");
}
if (!queryParam["F_DepartmentId"].IsEmpty())
{
strSql.Append($" AND emp.F_DepartmentId = '{queryParam["F_DepartmentId"].ToString()}' ");
}
if (!queryParam["ClockStatus"].IsEmpty())
{
UserNo = x.Key.UserNo,
UserName = x.Key.UserName,
Department = x.Key.Department,
Group = x.Select(y => new ADR_RecordEntity()
if (queryParam["ClockStatus"].ToString() == "6" || queryParam["ClockStatus"].ToString() == "0")//缺勤、旷工
{
ADType = y.ADType,
ClockTime = y.ClockTime,
ClockStatus = y.ClockStatus
})
});
//结果列表
var result = new List<ADR_RecordEntity>();
//启用的考勤规则
var restrictionEntity = this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(m => m.REnable == true);
if (restrictionEntity != null)
{
//上班时间
var WorkTimeTemp = string.Format("{0} {1}", date, restrictionEntity.WorkTime).ToDate();
//下班时间
var CloseTimeTemp = string.Format("{0} {1}", date, restrictionEntity.CloseTime).ToDate();
if (restrictionEntity.ClockTime == "二次打卡")
strSql.Append(" AND t.ClockStatus is null ");
}
else
{
strSql.Append($" AND t.ClockStatus = '{queryParam["ClockStatus"].ToString()}' ");
}
}
totalSql.Append(strSql);
if (i < (dateet.ToDate() - datest.ToDate()).Days)
{
totalSql.Append(" union ");
}
}
totalSql.Append(" ) as bb where 1=1 order by bb.ClockDate");
//当天记录列表
var data = this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(totalSql.ToString(), pagination)
.GroupBy(x => new { x.UserNo, x.UserName, x.Department, x.ClockDate }).Select(x => new
{
UserNo = x.Key.UserNo,
UserName = x.Key.UserName,
Department = x.Key.Department,
ClockDate = x.Key.ClockDate,
Group = x.Select(y => new ADR_RecordEntity()
{
ADType = y.ADType,
ClockTime = y.ClockTime,
ClockStatus = y.ClockStatus
})
});
if (restrictionEntity.ClockTime == "二次打卡")
{
#region 二次打卡

foreach (var item in data)
{
#region 二次打卡
//上班时间
var WorkTimeTemp = string.Format("{0} {1}", item.ClockDate, restrictionEntity.WorkTime).ToDate();
//下班时间
var CloseTimeTemp = string.Format("{0} {1}", item.ClockDate, restrictionEntity.CloseTime).ToDate();
var WholeMinutes = (CloseTimeTemp - WorkTimeTemp).TotalMinutes.ToInt();//全天应工作分钟数

foreach (var item in data)
var adtype1 = item.Group.FirstOrDefault(x => x.ADType == "1");//上班
var adtype2 = item.Group.FirstOrDefault(x => x.ADType == "2");//下班
//全天
var whole = new ADR_RecordEntity()
{
var adtype1 = item.Group.FirstOrDefault(x => x.ADType == "1");//上班
var adtype2 = item.Group.FirstOrDefault(x => x.ADType == "2");//下班
//全天
var whole = new ADR_RecordEntity()
{
UserNo = item.UserNo,
UserName = item.UserName,
Department = item.Department,
ClockDate = date,
BanCi = "上下班",
TimePeriodNo = 0,
TimePeriod = string.Format("上下班({0}-{1})", restrictionEntity.WorkTime, restrictionEntity.CloseTime),
ADStatusWork = adtype1 != null ? adtype1.ClockStatus : "6",
ADStatusClose = adtype2 != null ? adtype2.ClockStatus : "6",
ClockTimeWork = adtype1 != null ? adtype1.ClockTime.ToTimeString() : "-",
ClockTimeClose = adtype2 != null ? adtype2.ClockTime.ToTimeString() : "-",
ChidaoMinutes = adtype1 != null ? adtype1.ClockStatus == "2" ? (adtype1.ClockTime.Value - WorkTimeTemp).TotalMinutes.ToInt() : 0 : 0,
ZaoTuiMinutes = adtype2 != null ? adtype2.ClockStatus == "3" ? (CloseTimeTemp - adtype2.ClockTime.Value).TotalMinutes.ToInt() : 0 : 0,
ChuQinMinutes = adtype1 != null && adtype2 != null ? (adtype2.ClockTime.Value - adtype1.ClockTime.Value).TotalMinutes.ToInt() : 0,
QueQinMinutes = adtype1 != null && adtype2 != null ? 0 : WholeMinutes,
RestMinutes = 0
};
whole.WorkMinutes = WholeMinutes == whole.QueQinMinutes ? 0 : WholeMinutes - whole.ChidaoMinutes - whole.ZaoTuiMinutes - whole.QueQinMinutes;
result.Add(whole);
}
#endregion
UserNo = item.UserNo,
UserName = item.UserName,
Department = item.Department,
ClockDate = item.ClockDate,
BanCi = "上下班",
TimePeriodNo = 0,
TimePeriod = string.Format("上下班({0}-{1})", restrictionEntity.WorkTime, restrictionEntity.CloseTime),
ADStatusWork = adtype1 != null ? adtype1.ClockStatus : "6",
ADStatusClose = adtype2 != null ? adtype2.ClockStatus : "6",
ClockTimeWork = adtype1 != null ? adtype1.ClockTime.ToTimeString() : "-",
ClockTimeClose = adtype2 != null ? adtype2.ClockTime.ToTimeString() : "-",
ChidaoMinutes = adtype1 != null ? adtype1.ClockStatus == "2" ? (adtype1.ClockTime.Value - WorkTimeTemp).TotalMinutes.ToInt() : 0 : 0,
ZaoTuiMinutes = adtype2 != null ? adtype2.ClockStatus == "3" ? (CloseTimeTemp - adtype2.ClockTime.Value).TotalMinutes.ToInt() : 0 : 0,
ChuQinMinutes = adtype1 != null && adtype2 != null ? (adtype2.ClockTime.Value - adtype1.ClockTime.Value).TotalMinutes.ToInt() : 0,
QueQinMinutes = adtype1 != null && adtype2 != null ? 0 : WholeMinutes,
RestMinutes = 0
};
whole.WorkMinutes = WholeMinutes == whole.QueQinMinutes ? 0 : WholeMinutes - whole.ChidaoMinutes - whole.ZaoTuiMinutes - whole.QueQinMinutes;
totalResult.Add(whole);
}
else
#endregion
}
else
{
#region 四次打卡

foreach (var item in data)
{
#region 四次打卡
//上班时间
var WorkTimeTemp = string.Format("{0} {1}", item.ClockDate, restrictionEntity.WorkTime).ToDate();
//下班时间
var CloseTimeTemp = string.Format("{0} {1}", item.ClockDate, restrictionEntity.CloseTime).ToDate();
//中午下班时间
var NoonCloseTimeTemp = string.Format("{0} {1}", date, restrictionEntity?.NoonCloseTime).ToDate();
var NoonCloseTimeTemp = string.Format("{0} {1}", item.ClockDate, restrictionEntity?.NoonCloseTime).ToDate();
//中午上班时间
var NoonWorkTimeTemp = string.Format("{0} {1}", date, restrictionEntity?.NoonWorkTime).ToDate();
var NoonWorkTimeTemp = string.Format("{0} {1}", item.ClockDate, restrictionEntity?.NoonWorkTime).ToDate();
var MorningMinutes = (NoonCloseTimeTemp - WorkTimeTemp).TotalMinutes.ToInt();//上午应工作分钟数
var AfternoonMinutes = (CloseTimeTemp - NoonWorkTimeTemp).TotalMinutes.ToInt();//下午应工作分钟数

foreach (var item in data)
var adtype1 = item.Group.FirstOrDefault(x => x.ADType == "1");//上班
var adtype8 = item.Group.FirstOrDefault(x => x.ADType == "8");//中午下班
var adtype7 = item.Group.FirstOrDefault(x => x.ADType == "7");//中午上班
var adtype2 = item.Group.FirstOrDefault(x => x.ADType == "2");//下班
//上午
var morning = new ADR_RecordEntity()
{
var adtype1 = item.Group.FirstOrDefault(x => x.ADType == "1");//上班
var adtype8 = item.Group.FirstOrDefault(x => x.ADType == "8");//中午下班
var adtype7 = item.Group.FirstOrDefault(x => x.ADType == "7");//中午上班
var adtype2 = item.Group.FirstOrDefault(x => x.ADType == "2");//下班
//上午
var morning = new ADR_RecordEntity()
{
UserNo = item.UserNo,
UserName = item.UserName,
Department = item.Department,
ClockDate = date,
BanCi = "上下班",
TimePeriodNo = 1,
TimePeriod = string.Format("上午上下班({0}-{1})", restrictionEntity.WorkTime, restrictionEntity.NoonCloseTime),
ADStatusWork = adtype1 != null ? adtype1.ClockStatus : "6",
ADStatusClose = adtype8 != null ? adtype8.ClockStatus : "6",
ClockTimeWork = adtype1 != null ? adtype1.ClockTime.ToTimeString() : "-",
ClockTimeClose = adtype8 != null ? adtype8.ClockTime.ToTimeString() : "-",
ChidaoMinutes = adtype1 != null ? adtype1.ClockStatus == "2" ? (adtype1.ClockTime.Value - WorkTimeTemp).TotalMinutes.ToInt() : 0 : 0,
ZaoTuiMinutes = adtype8 != null ? adtype8.ClockStatus == "3" ? (NoonCloseTimeTemp - adtype8.ClockTime.Value).TotalMinutes.ToInt() : 0 : 0,
ChuQinMinutes = adtype1 != null && adtype8 != null ? (adtype8.ClockTime.Value - adtype1.ClockTime.Value).TotalMinutes.ToInt() : 0,
QueQinMinutes = adtype1 != null && adtype8 != null ? 0 : MorningMinutes,
RestMinutes = 0
};
morning.WorkMinutes = MorningMinutes == morning.QueQinMinutes ? 0 : MorningMinutes - morning.ChidaoMinutes - morning.ZaoTuiMinutes - morning.QueQinMinutes;
result.Add(morning);
//下午
var afternoon = new ADR_RecordEntity()
{
UserNo = item.UserNo,
UserName = item.UserName,
Department = item.Department,
ClockDate = date,
BanCi = "上下班",
TimePeriodNo = 2,
TimePeriod = string.Format("下午上下班({0}-{1})", restrictionEntity.NoonWorkTime, restrictionEntity.CloseTime),
ADStatusWork = adtype7 != null ? adtype7.ClockStatus : "6",
ADStatusClose = adtype2 != null ? adtype2.ClockStatus : "6",
ClockTimeWork = adtype7 != null ? adtype7.ClockTime.ToTimeString() : "-",
ClockTimeClose = adtype2 != null ? adtype2.ClockTime.ToTimeString() : "-",
ChidaoMinutes = adtype7 != null ? adtype7.ClockStatus == "2" ? (adtype7.ClockTime.Value - NoonWorkTimeTemp).TotalMinutes.ToInt() : 0 : 0,
ZaoTuiMinutes = adtype2 != null ? adtype2.ClockStatus == "3" ? (CloseTimeTemp - adtype2.ClockTime.Value).TotalMinutes.ToInt() : 0 : 0,
ChuQinMinutes = adtype7 != null && adtype2 != null ? (adtype2.ClockTime.Value - adtype7.ClockTime.Value).TotalMinutes.ToInt() : 0,
QueQinMinutes = adtype7 != null && adtype2 != null ? 0 : AfternoonMinutes,
RestMinutes = 0
};
afternoon.WorkMinutes = AfternoonMinutes == afternoon.QueQinMinutes ? 0 : AfternoonMinutes - afternoon.ChidaoMinutes - afternoon.ZaoTuiMinutes - afternoon.QueQinMinutes;
result.Add(afternoon);
}
#endregion
UserNo = item.UserNo,
UserName = item.UserName,
Department = item.Department,
ClockDate = item.ClockDate,
BanCi = "上下班",
TimePeriodNo = 1,
TimePeriod = string.Format("上午上下班({0}-{1})", restrictionEntity.WorkTime, restrictionEntity.NoonCloseTime),
ADStatusWork = adtype1 != null ? adtype1.ClockStatus : "6",
ADStatusClose = adtype8 != null ? adtype8.ClockStatus : "6",
ClockTimeWork = adtype1 != null ? adtype1.ClockTime.ToTimeString() : "-",
ClockTimeClose = adtype8 != null ? adtype8.ClockTime.ToTimeString() : "-",
ChidaoMinutes = adtype1 != null ? adtype1.ClockStatus == "2" ? (adtype1.ClockTime.Value - WorkTimeTemp).TotalMinutes.ToInt() : 0 : 0,
ZaoTuiMinutes = adtype8 != null ? adtype8.ClockStatus == "3" ? (NoonCloseTimeTemp - adtype8.ClockTime.Value).TotalMinutes.ToInt() : 0 : 0,
ChuQinMinutes = adtype1 != null && adtype8 != null ? (adtype8.ClockTime.Value - adtype1.ClockTime.Value).TotalMinutes.ToInt() : 0,
QueQinMinutes = adtype1 != null && adtype8 != null ? 0 : MorningMinutes,
RestMinutes = 0
};
morning.WorkMinutes = MorningMinutes == morning.QueQinMinutes ? 0 : MorningMinutes - morning.ChidaoMinutes - morning.ZaoTuiMinutes - morning.QueQinMinutes;
totalResult.Add(morning);
//下午
var afternoon = new ADR_RecordEntity()
{
UserNo = item.UserNo,
UserName = item.UserName,
Department = item.Department,
ClockDate = item.ClockDate,
BanCi = "上下班",
TimePeriodNo = 2,
TimePeriod = string.Format("下午上下班({0}-{1})", restrictionEntity.NoonWorkTime, restrictionEntity.CloseTime),
ADStatusWork = adtype7 != null ? adtype7.ClockStatus : "6",
ADStatusClose = adtype2 != null ? adtype2.ClockStatus : "6",
ClockTimeWork = adtype7 != null ? adtype7.ClockTime.ToTimeString() : "-",
ClockTimeClose = adtype2 != null ? adtype2.ClockTime.ToTimeString() : "-",
ChidaoMinutes = adtype7 != null ? adtype7.ClockStatus == "2" ? (adtype7.ClockTime.Value - NoonWorkTimeTemp).TotalMinutes.ToInt() : 0 : 0,
ZaoTuiMinutes = adtype2 != null ? adtype2.ClockStatus == "3" ? (CloseTimeTemp - adtype2.ClockTime.Value).TotalMinutes.ToInt() : 0 : 0,
ChuQinMinutes = adtype7 != null && adtype2 != null ? (adtype2.ClockTime.Value - adtype7.ClockTime.Value).TotalMinutes.ToInt() : 0,
QueQinMinutes = adtype7 != null && adtype2 != null ? 0 : AfternoonMinutes,
RestMinutes = 0
};
afternoon.WorkMinutes = AfternoonMinutes == afternoon.QueQinMinutes ? 0 : AfternoonMinutes - afternoon.ChidaoMinutes - afternoon.ZaoTuiMinutes - afternoon.QueQinMinutes;
totalResult.Add(afternoon);
}
#endregion
}
return result.OrderBy(x => x.UserNo).ThenBy(x => x.UserName).ThenBy(x => x.TimePeriodNo);

return totalResult.OrderBy(x => x.ClockDate).ThenBy(x => x.UserNo).ThenBy(x => x.TimePeriodNo);
}
catch (Exception ex)
{


Зареждане…
Отказ
Запис