Commit 6192d92b authored by 黄奎's avatar 黄奎

页面修改

parent 7df35840
......@@ -105,6 +105,16 @@ namespace Edu.Model.ViewModel.Duty
return str;
}
}
/// <summary>
/// 值班状态(0-未开始,1-值班中,2-已完成,3-未值班)
/// </summary>
public int QDutyStatus { get; set; }
/// <summary>
/// 出勤状态(1-迟到,2-早退,3-缺勤,4-正常)
/// </summary>
public int QAttendanceStatus { get; set; }
}
/// <summary>
......
......@@ -81,5 +81,15 @@ namespace Edu.Model.ViewModel.Duty
/// 交接工作总数
/// </summary>
public int TotalHandoverCount { get; set; }
/// <summary>
/// 值班状态(0-未开始,1-值班中,2-已完成,3-未值班)
/// </summary>
public int QDutyStatus { get; set; }
/// <summary>
/// 出勤状态(1-迟到,2-早退,3-缺勤,4-正常)
/// </summary>
public int QAttendanceStatus { get; set; }
}
}
......@@ -69,27 +69,11 @@ namespace Edu.Module.Duty
if (!string.IsNullOrEmpty(ids))
{
//QDutyMan=query.QDutyMan
planDetails = GetDutyPlanDetailsListModule(new RB_Duty_PlanDetails_ViewModel() { QPlanIds = ids, }, IsQueryDutyMan: true);
planDetails = GetDutyPlanDetailsListModule(new RB_Duty_PlanDetails_ViewModel() { QPlanIds = ids, QDutyStatus = query.QDutyStatus, QAttendanceStatus = query.QAttendanceStatus }, IsQueryDutyMan: true);
}
foreach (var item in list)
{
item.PlanDetails = planDetails?.Where(qitem => qitem.PlanId == item.Id)?.ToList() ?? new List<RB_Duty_PlanDetails_ViewModel>();
//item.DutyStatus = 0;
//if (item.PlanDetails != null && item.PlanDetails.Count > 0)
//{
// foreach (var subItem in item.PlanDetails)
// {
// if (subItem.Status == 2)
// {
// subItem.DutyStatus = DutyStatusEnum.DutyFinished;
// }
// else
// {
// subItem.DutyStatus = CalcDutyPlanStatusModule(item.Date, subItem?.StartTime, subItem?.EndTime);
// }
// }
// item.DutyStatus = CalcDutyStatusModule(item.PlanDetails);
//}
}
}
return list;
......@@ -117,7 +101,7 @@ namespace Edu.Module.Duty
List<RB_Duty_Content_ViewModel> dutyContentList = new List<RB_Duty_Content_ViewModel>();
if (!string.IsNullOrEmpty(ids))
{
planDetails = GetDutyPlanDetailsListModule(new RB_Duty_PlanDetails_ViewModel() { QPlanIds = ids }, IsQueryDutyMan: true);
planDetails = GetDutyPlanDetailsListModule(new RB_Duty_PlanDetails_ViewModel() { QPlanIds = ids, QDutyStatus=-1 }, IsQueryDutyMan: true);
dutyContentList = duty_ContentRepository.GetDutyContentListRepository(new RB_Duty_Content_ViewModel() { QPlanIds = ids });
}
if (planDetails != null && planDetails.Count > 0)
......@@ -224,7 +208,7 @@ namespace Edu.Module.Duty
DutyStatusEnum dutyStatus = DutyStatusEnum.NoStart;
var dutyStartTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(planDate) + " " + startTime);
var dutyEndTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(planDate) + " " + endTime);
var dt = DateTime.Now.AddMinutes(-30);
var dt = DateTime.Now.AddMinutes(30);
if (dt > dutyEndTime)
{
dutyStatus = Common.Enum.Duty.DutyStatusEnum.DutyFinished;
......@@ -526,8 +510,8 @@ namespace Edu.Module.Duty
result.Add("CheckLateTime", currentModel?.CheckLateTime);
result.Add("CheckLateTimeStr", (currentModel?.CheckLateTime > 0 ? string.Format("[迟到{0}分钟]", currentModel.CheckLateTime) : "[正常]"));
result.Add("FinishTime", currentModel?.FinishTimeStr);
result.Add("FinishTime", currentModel?.FinishTimeStr);
result.Add("FinishLateTimeStr", (currentModel.FinishLateTime > 0 ? string.Format("[早退{0}分钟]", currentModel.FinishLateTime) : "[正常]"));
result.Add("FinishLateTime", currentModel?.FinishLateTime);
result.Add("FinishLateTimeStr", (currentModel?.FinishLateTime > 0 ? string.Format("[早退{0}分钟]", currentModel.FinishLateTime) : "[正常]"));
result.Add("SchoolName", model?.SchoolName);
result.Add("ShiftName", currentModel?.ShiftName);
result.Add("StartTime", currentModel?.StartTime);
......
......@@ -47,6 +47,31 @@ WHERE 1=1
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Duty_PlanDetails_ViewModel.DutyMan), query.QDutyMan);
}
if (query.QDutyStatus > -1)
{
builder.AppendFormat(" AND A.Status={0} ", query.QDutyStatus);
}
//迟到
if (query.QAttendanceStatus == 1)
{
builder.AppendFormat(" AND A.CheckLateTime>0 ");
}
//早退
if (query.QAttendanceStatus == 2)
{
builder.AppendFormat(" AND A.FinishLateTime>0 ");
}
//缺勤
if (query.QAttendanceStatus == 3)
{
builder.AppendFormat(" AND A.Status=0 AND A.FinishLateTime=0 AND A.CheckLateTime=0 ");
}
//正常
if (query.QAttendanceStatus == 4)
{
builder.AppendFormat(" AND A.Status=2 AND A.FinishLateTime=0 AND A.CheckLateTime=0 ");
}
}
builder.AppendFormat(" ORDER BY B.{0} ASC ", nameof(RB_Duty_Frequency_ViewModel.StartTime));
return Get<RB_Duty_PlanDetails_ViewModel>(builder.ToString()).ToList();
......
......@@ -25,9 +25,38 @@ namespace Edu.Repository.Duty
{
rowsCount = 0;
string joinTable = "";
if (query != null && !string.IsNullOrEmpty(query.QDutyMan))
if (query != null && (!string.IsNullOrEmpty(query.QDutyMan)||query.QDutyStatus>-1 || query.QAttendanceStatus>0 ))
{
joinTable = string.Format(" INNER JOIN (SELECT PlanId,DutyMan FROM rb_duty_plandetails WHERE 1=1 AND DutyMan IN({0})) AS C ON A.Id=C.PlanId ", query.QDutyMan);
string joinWhere = "";
if (!string.IsNullOrEmpty(query.QDutyMan))
{
joinWhere += string.Format(" AND DutyMan IN({0}) ", query.QDutyMan);
}
if (query.QDutyStatus >-1)
{
joinWhere += string.Format(" AND Status={0} ", query.QDutyStatus);
}
//迟到
if (query.QAttendanceStatus == 1)
{
joinWhere += string.Format(" AND CheckLateTime>0 ");
}
//早退
if (query.QAttendanceStatus == 2)
{
joinWhere += string.Format(" AND FinishLateTime>0 ");
}
//缺勤
if (query.QAttendanceStatus == 3)
{
joinWhere += string.Format(" AND Status=0 AND FinishLateTime=0 AND CheckLateTime=0 ");
}
//正常
if (query.QAttendanceStatus == 4)
{
joinWhere += string.Format(" AND Status=2 AND FinishLateTime=0 AND CheckLateTime=0 ");
}
joinTable = string.Format(" INNER JOIN (SELECT PlanId FROM rb_duty_plandetails WHERE 1=1 {0} GROUP BY PlanId ) AS C ON A.Id=C.PlanId ", joinWhere);
}
StringBuilder builder = new StringBuilder();
......@@ -125,6 +154,10 @@ WHERE 1=1 AND A.`Status`=0
{
builder.AppendFormat(@" AND B.{0}={1} ", nameof(RB_Duty_PlanDetails_ViewModel.DutyMan), query.QDutyMan);
}
if (query.QShift>0)
{
builder.AppendFormat(@" AND B.{0}={1} ", nameof(RB_Duty_PlanDetails_ViewModel.Shift), query.QShift);
}
if (query.Id > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Duty_Plan_ViewModel.Id), query.Id);
......
......@@ -37,7 +37,16 @@ namespace Edu.WebApi.Controllers.Duty
QStartDate = base.ParmJObj.GetStringValue("StartDate"),
QEndDate = base.ParmJObj.GetStringValue("EndDate"),
IsFinish=base.ParmJObj.GetInt("IsFinish"),
QAttendanceStatus=base.ParmJObj.GetInt("QAttendanceStatus")
};
if (!string.IsNullOrEmpty(base.ParmJObj.GetStringValue("QDutyStatus")))
{
query.QDutyStatus = base.ParmJObj.GetInt("QDutyStatus", -1);
}
else
{
query.QDutyStatus = -1;
}
var dutyManList = Common.Plugin.JsonHelper.DeserializeObject<List<int>>(base.ParmJObj.GetStringValue("EmployeeIds"));
if (dutyManList != null && dutyManList.Count > 0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment