Merge branch 'master' of http://121.41.2.71:3000/wyw/mh_jy_safe
This commit is contained in:
commit
bdd9eadeda
@ -68,7 +68,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
var id = filter.FilterGroup.Rules.FirstOrDefault(t => t.Field == "ID").Value.ToString();
|
var id = filter.FilterGroup.Rules.FirstOrDefault(t => t.Field == "ID").Value.ToString();
|
||||||
if (string.IsNullOrEmpty(id))
|
if (string.IsNullOrEmpty(id))
|
||||||
this.ThrowError("060010");
|
this.ThrowError("060010");
|
||||||
var entity = this.GetEntity<T_FO_TECH_DISCLOSURE_FROM>(id, "Nav_OperationStep", "Nav_JobName", "Nav_JobNameOut", "Nav_DisclosurePerson", "Nav_Files.Nav_ImgFile");
|
var entity = this.GetEntity<T_FO_TECH_DISCLOSURE_FROM>(id, "Nav_OperationStep", "Nav_JobName", "Nav_JobNameOut", "Nav_DisclosurePerson", "Nav_Files.Nav_ImgFile", "Nav_FireJob");
|
||||||
if (entity != null)
|
if (entity != null)
|
||||||
{
|
{
|
||||||
var newFilter = new BaseFilter(filter.OrgId);
|
var newFilter = new BaseFilter(filter.OrgId);
|
||||||
|
|||||||
@ -251,11 +251,12 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
//var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
|
||||||
List<T_FM_DEPARTMENT_COMPLETION> completions = new List<T_FM_DEPARTMENT_COMPLETION>();
|
List<T_FM_DEPARTMENT_COMPLETION> completions = new List<T_FM_DEPARTMENT_COMPLETION>();
|
||||||
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
|
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
|
||||||
var startTime = Convert.ToDateTime(DateTime.Now.AddMonths(-11).Year + "-" + DateTime.Now.AddMonths(-11).Month + "-01 00:00:00");
|
var startTime = Convert.ToDateTime(DateTime.Now.AddMonths(-5).Year + "-" + DateTime.Now.AddMonths(-5).Month + "-01 00:00:00");
|
||||||
var endTime = Convert.ToDateTime(DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + " 23:59:59");
|
var endTime = Convert.ToDateTime(DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + " 23:59:59");
|
||||||
baseFilter.SelectField = new string[] { "ID", "NAME", "DEPARTMENT_TYPE", "Nav_Parent.NAME", "Nav_Parent.Nav_Parent", "PARENT_ID" };
|
baseFilter.SelectField = new string[] { "ID", "NAME", "DEPARTMENT_TYPE", "Nav_Parent.NAME", "PARENT_ID" };
|
||||||
var departments = GetEntities<T_FM_DEPARTMENT>(t => !t.IS_DELETED && t.ENABLE_STATUS == 0, baseFilter);
|
var departments = GetEntities<T_FM_DEPARTMENT>(t => !t.IS_DELETED && t.ENABLE_STATUS == 0, baseFilter);
|
||||||
baseFilter.SelectField = new string[] { "ID", "DEPARTMENT_ID" };
|
baseFilter.SelectField = new string[] { "ID", "DEPARTMENT_ID" };
|
||||||
var teams = GetEntities<T_FM_TEAM>(t => !t.IS_DELETED && t.ENABLE_STATUS == 0, baseFilter);
|
var teams = GetEntities<T_FM_TEAM>(t => !t.IS_DELETED && t.ENABLE_STATUS == 0, baseFilter);
|
||||||
@ -1077,9 +1078,9 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
|
||||||
List<T_FM_WORK_TICKET_COMPLETION> completions = new List<T_FM_WORK_TICKET_COMPLETION>();
|
List<T_FM_WORK_TICKET_COMPLETION> completions = new List<T_FM_WORK_TICKET_COMPLETION>();
|
||||||
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
|
BaseFilter baseFilter = new BaseFilter(orgId);
|
||||||
baseFilter.IgnoreDataRule = true;
|
baseFilter.IgnoreDataRule = true;
|
||||||
var startTime = Convert.ToDateTime(DateTime.Now.AddMonths(-11).Year + "-" + DateTime.Now.AddMonths(-11).Month + "-01 00:00:00");
|
var startTime = Convert.ToDateTime(DateTime.Now.AddMonths(-11).Year + "-" + DateTime.Now.AddMonths(-11).Month + "-01 00:00:00");
|
||||||
var endTime = Convert.ToDateTime(DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + " 23:59:59");
|
var endTime = Convert.ToDateTime(DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + " 23:59:59");
|
||||||
|
|||||||
@ -21,6 +21,7 @@ using NPOI.SS.Formula.Functions;
|
|||||||
using Org.BouncyCastle.Utilities;
|
using Org.BouncyCastle.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace APT.SC.WebApi.Controllers.Api.BI
|
namespace APT.SC.WebApi.Controllers.Api.BI
|
||||||
@ -2349,7 +2350,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
var startTime = dtNow.AddMonths(-11);
|
var startTime = dtNow.AddMonths(-11);
|
||||||
var checkNotices = GetEntities<T_SK_SECURITY_INSPECTION_NOTICE>(e => e.APPLY_DEPARTMENT_ID.HasValue && e.CREATE_TIME.HasValue && e.CREATE_TIME >= startTime && e.Nav_CheckType!=null && !e.Nav_CheckType.NAME.Contains("岗位排查"), newFilter);
|
var checkNotices = GetEntities<T_SK_SECURITY_INSPECTION_NOTICE>(e => e.APPLY_DEPARTMENT_ID.HasValue && e.CREATE_TIME.HasValue && e.CREATE_TIME >= startTime && e.Nav_CheckType!=null && !e.Nav_CheckType.NAME.Contains("岗位排查"), newFilter);
|
||||||
var noticeIds = checkNotices.Select(t => t.ID).ToList();
|
var noticeIds = checkNotices.Select(t => t.ID).ToList();
|
||||||
var checkRecords = GetEntities<T_SK_SECURITY_INSPECTION_RECORD>(e => e.SECURITY_INSPECTION_NOTICE_ID.HasValue && noticeIds.Contains((Guid)e.SECURITY_INSPECTION_NOTICE_ID), newFilter);
|
var checkRecords = GetEntities<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY>(e => e.SECURITY_INSPECTION_NOTICE_ID.HasValue && noticeIds.Contains((Guid)e.SECURITY_INSPECTION_NOTICE_ID), newFilter);
|
||||||
var currentTime = Convert.ToDateTime(startTime.Year + "-" + startTime.Month + "-01 00:00:00");
|
var currentTime = Convert.ToDateTime(startTime.Year + "-" + startTime.Month + "-01 00:00:00");
|
||||||
List<HomeSafeCheckCountMonth> ListSafeCheckYearMonth = new List<HomeSafeCheckCountMonth>();
|
List<HomeSafeCheckCountMonth> ListSafeCheckYearMonth = new List<HomeSafeCheckCountMonth>();
|
||||||
//int befoMonth = 11;//计算 12 个月 就是提前 11个月
|
//int befoMonth = 11;//计算 12 个月 就是提前 11个月
|
||||||
@ -2564,7 +2565,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
var parentIds = listDepBZ.Where(e => e.PARENT_ID == item.Department_ID).Select(t => t.ID);
|
var parentIds = listDepBZ.Where(e => e.PARENT_ID == item.Department_ID).Select(t => t.ID);
|
||||||
var classIds = listDepBZ.Where(e => e.PARENT_ID!=null &&parentIds.Contains((Guid)e.PARENT_ID)).Select(t => t.ID);
|
var classIds = listDepBZ.Where(e => e.PARENT_ID!=null &&parentIds.Contains((Guid)e.PARENT_ID)).Select(t => t.ID);
|
||||||
item.listChild = listCheckDepCountBZ.Where(e => e.Department_ID!=null && (classIds.Contains((Guid)e.Department_ID) || parentIds.Contains(e.Department_ID))).OrderBy(e => e.DepartmentType).ThenBy(t=>t.NUM).ToList();
|
item.listChild = listCheckDepCountBZ.Where(e => e.Department_ID!=null && (classIds.Contains((Guid)e.Department_ID) || parentIds.Contains(e.Department_ID))).OrderBy(e => e.DepartmentType).ThenBy(t=>t.NUM).ToList();
|
||||||
item.RowCount = item.listChild.Count() == 0?1: item.listChild.Count();
|
item.RowCount = item.listChild.Count();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9678,11 +9678,51 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
|||||||
{
|
{
|
||||||
return SafeExecute<List<T_FM_DEPARTMENT_COMPLETION_SORT>>(() =>
|
return SafeExecute<List<T_FM_DEPARTMENT_COMPLETION_SORT>>(() =>
|
||||||
{
|
{
|
||||||
|
List<T_FM_DEPARTMENT_COMPLETION_SORT> completionSorts = new List<T_FM_DEPARTMENT_COMPLETION_SORT>();
|
||||||
|
#region 判断 从Redis中获取数据 有就直接返回到前端 没有就按原来的进行搜索 最后再判断存入Redis中
|
||||||
|
|
||||||
|
var redisCode = string.Format(RedisCacheKey.HomeJobCompletion, APT.Infrastructure.Api.AppContext.CurrentSession.OrgId);
|
||||||
|
DateTime dtNow = DateTime.Now;
|
||||||
|
bool isRedisConfig = true;
|
||||||
|
var redisConfig = APT.Infrastructure.Api.ConfigurationManager.AppSettings["RedisFormConfig"];
|
||||||
|
List<HomeResultMineType> listHomeRedis = null;
|
||||||
|
if (!string.IsNullOrEmpty(redisConfig))
|
||||||
|
isRedisConfig = bool.Parse(redisConfig);
|
||||||
|
|
||||||
|
if (isRedisConfig && CsRedisManager.KeyExists(redisCode))
|
||||||
|
listHomeRedis = CsRedisManager.StringGet<List<HomeResultMineType>>(redisCode);
|
||||||
|
|
||||||
|
if (listHomeRedis != null && listHomeRedis.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in listHomeRedis)
|
||||||
|
{
|
||||||
|
//if (item.MineType == MineType)
|
||||||
|
{
|
||||||
|
if (dtNow.ToString("yyyyMMddHH") == item.yyyyMMddHH)
|
||||||
|
{
|
||||||
|
completionSorts = item.deptResult;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
listHomeRedis.Remove(item);//Key不匹配 过期数据删除
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//redis获取到了数据
|
||||||
|
if (completionSorts != null && completionSorts.Count() > 0)
|
||||||
|
{
|
||||||
|
return completionSorts;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId.Value;
|
var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId.Value;
|
||||||
//var mineType = 30;
|
//var mineType = 30;
|
||||||
var departmentIds = new List<Guid>();
|
var departmentIds = new List<Guid>();
|
||||||
List<GroupbyDepartmentId> completionLists = new List<GroupbyDepartmentId>();
|
List<GroupbyDepartmentId> completionLists = new List<GroupbyDepartmentId>();
|
||||||
List<T_FM_DEPARTMENT_COMPLETION_SORT> completionSorts = new List<T_FM_DEPARTMENT_COMPLETION_SORT>();
|
|
||||||
//if (string.IsNullOrEmpty(filter.Keyword))
|
//if (string.IsNullOrEmpty(filter.Keyword))
|
||||||
// return completionSorts;
|
// return completionSorts;
|
||||||
//var departmentInfo = this.GetEntities<T_FM_DEPARTMENT>(t => t.MineType == int.Parse(filter.Keyword.ToString()), new BaseFilter(orgId));
|
//var departmentInfo = this.GetEntities<T_FM_DEPARTMENT>(t => t.MineType == int.Parse(filter.Keyword.ToString()), new BaseFilter(orgId));
|
||||||
@ -9695,7 +9735,7 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
|||||||
baseFilter.SelectField = new string[] { "ID", "DEPARTMENT_ID" };
|
baseFilter.SelectField = new string[] { "ID", "DEPARTMENT_ID" };
|
||||||
//var teams = GetEntities<T_FM_TEAM>(t => !t.IS_DELETED && departmentIds.Contains(t.DEPARTMENT_ID.Value), baseFilter);
|
//var teams = GetEntities<T_FM_TEAM>(t => !t.IS_DELETED && departmentIds.Contains(t.DEPARTMENT_ID.Value), baseFilter);
|
||||||
//var teamIds = teams.Select(t => t.ID);
|
//var teamIds = teams.Select(t => t.ID);
|
||||||
var completions = GetEntities<T_FM_DEPARTMENT_COMPLETION>(t => !t.IS_DELETED, new BaseFilter(orgId)).ToList();
|
var completions = GetClassCompletion(orgId);// GetEntities<T_FM_DEPARTMENT_COMPLETION>(t => !t.IS_DELETED, new BaseFilter(orgId)).ToList();
|
||||||
//var teamIds = completions.Select(t => t.TEAM_ID);
|
//var teamIds = completions.Select(t => t.TEAM_ID);
|
||||||
if (!string.IsNullOrEmpty(filter.Parameter2))
|
if (!string.IsNullOrEmpty(filter.Parameter2))
|
||||||
{
|
{
|
||||||
@ -9767,6 +9807,28 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
|||||||
item.NUM = i;
|
item.NUM = i;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
#region 搜索结果 判断存入Redis中
|
||||||
|
|
||||||
|
if (isRedisConfig)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (listHomeRedis == null)
|
||||||
|
listHomeRedis = new List<HomeResultMineType>();
|
||||||
|
|
||||||
|
listHomeRedis.Add(new HomeResultMineType()
|
||||||
|
{
|
||||||
|
//MineType = MineType,
|
||||||
|
yyyyMMddHH = dtNow.ToString("yyyyMMddHH"),
|
||||||
|
deptResult = completionSorts1
|
||||||
|
});
|
||||||
|
|
||||||
|
CsRedisManager.StringSet<List<HomeResultMineType>>(redisCode, listHomeRedis);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
return completionSorts1;
|
return completionSorts1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -9788,7 +9850,7 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
|||||||
//if (string.IsNullOrEmpty(filter.Keyword))
|
//if (string.IsNullOrEmpty(filter.Keyword))
|
||||||
// return ret;
|
// return ret;
|
||||||
//var departmentInfo = this.GetEntities<T_FM_DEPARTMENT>(t => t.PRODUCTION_UNIT_ID == Guid.Parse(filter.Keyword.ToString()), new BaseFilter(orgId));
|
//var departmentInfo = this.GetEntities<T_FM_DEPARTMENT>(t => t.PRODUCTION_UNIT_ID == Guid.Parse(filter.Keyword.ToString()), new BaseFilter(orgId));
|
||||||
var completions = GetEntities<T_FM_DEPARTMENT_COMPLETION>(t => !t.IS_DELETED, new BaseFilter(orgId)).ToList();
|
var completions = GetClassCompletion(orgId);//GetEntities<T_FM_DEPARTMENT_COMPLETION>(t => !t.IS_DELETED, new BaseFilter(orgId)).ToList();
|
||||||
var departmentInfos = this.GetEntities<T_FM_DEPARTMENT>(t => t.ENABLE_STATUS == 0 && t.CATEGORY == FMCATEGORY.ACTURE, new BaseFilter(orgId), "Nav_Parent");
|
var departmentInfos = this.GetEntities<T_FM_DEPARTMENT>(t => t.ENABLE_STATUS == 0 && t.CATEGORY == FMCATEGORY.ACTURE, new BaseFilter(orgId), "Nav_Parent");
|
||||||
|
|
||||||
//List<T_FM_DEPARTMENT> listDepBM = new List<T_FM_DEPARTMENT>();
|
//List<T_FM_DEPARTMENT> listDepBM = new List<T_FM_DEPARTMENT>();
|
||||||
@ -9888,6 +9950,8 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
|||||||
completionSort.shopName = parentInfo.NAME;
|
completionSort.shopName = parentInfo.NAME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
completionSort.deptType = item.DEPARTMENT_TYPE;
|
||||||
|
completionSort.num = item.NUM;
|
||||||
completionSort.teamDoneCount = coms.Sum(m => m.FINISH_COUNT);
|
completionSort.teamDoneCount = coms.Sum(m => m.FINISH_COUNT);
|
||||||
completionSort.teamOntimeCount = coms.Sum(m => m.ONTIME_COUNT);
|
completionSort.teamOntimeCount = coms.Sum(m => m.ONTIME_COUNT);
|
||||||
completionSort.teamTotalCount = coms.Sum(m => m.TOTAL_COUNT);
|
completionSort.teamTotalCount = coms.Sum(m => m.TOTAL_COUNT);
|
||||||
@ -9911,7 +9975,7 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
|||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
{
|
{
|
||||||
var coms = completions.Where(i => i.DEPARTMENT_ID == item.shopId);
|
var coms = completions.Where(i => i.TEAM_ID == item.shopId);
|
||||||
item.shopDoneCount = completionLists.Where(i => i.shopId == item.shopId).Sum(m => m.teamDoneCount)+ coms.Sum(m => m.FINISH_COUNT);
|
item.shopDoneCount = completionLists.Where(i => i.shopId == item.shopId).Sum(m => m.teamDoneCount)+ coms.Sum(m => m.FINISH_COUNT);
|
||||||
item.shopOntimeCount = completionLists.Where(i => i.shopId == item.shopId).Sum(m => m.teamOntimeCount) + coms.Sum(m => m.ONTIME_COUNT);
|
item.shopOntimeCount = completionLists.Where(i => i.shopId == item.shopId).Sum(m => m.teamOntimeCount) + coms.Sum(m => m.ONTIME_COUNT);
|
||||||
item.shopTotalCount = completionLists.Where(i => i.shopId == item.shopId).Sum(m => m.teamTotalCount) + coms.Sum(m => m.TOTAL_COUNT);
|
item.shopTotalCount = completionLists.Where(i => i.shopId == item.shopId).Sum(m => m.teamTotalCount) + coms.Sum(m => m.TOTAL_COUNT);
|
||||||
@ -9937,12 +10001,445 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret.retData = completionLists.OrderBy(t => t.shopName).ThenByDescending(m => m.teamOverDoneRate).ToList();
|
ret.retData = completionLists.OrderBy(t => t.shopName).ThenBy(m => m.deptType).ThenBy(n=>n.num).ToList();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 返回所有下级部门节点
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="orgId"></param>
|
||||||
|
/// <param name="listDepIDInt"></param>
|
||||||
|
/// <param name="departmentIdPs"></param>
|
||||||
|
public List<T_FM_DEPARTMENT_COMPLETION> GetClassCompletion(Guid orgId)
|
||||||
|
{
|
||||||
|
List<T_FM_DEPARTMENT_COMPLETION> completions = new List<T_FM_DEPARTMENT_COMPLETION>();
|
||||||
|
BaseFilter baseFilter = new BaseFilter(orgId);
|
||||||
|
var startTime = Convert.ToDateTime(DateTime.Now.AddMonths(-5).Year + "-" + DateTime.Now.AddMonths(-5).Month + "-01 00:00:00");
|
||||||
|
var endTime = Convert.ToDateTime(DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + " 23:59:59");
|
||||||
|
baseFilter.SelectField = new string[] { "ID", "NAME", "DEPARTMENT_TYPE", "Nav_Parent.NAME", "PARENT_ID" };
|
||||||
|
var departments = GetEntities<T_FM_DEPARTMENT>(t => !t.IS_DELETED && t.ENABLE_STATUS == 0, baseFilter);
|
||||||
|
baseFilter.SelectField = new string[] { "ID", "DEPARTMENT_ID" };
|
||||||
|
var teams = GetEntities<T_FM_TEAM>(t => !t.IS_DELETED && t.ENABLE_STATUS == 0, baseFilter);
|
||||||
|
baseFilter.SelectField = new string[] { "TEAM_ID", "Nav_Team.NAME", "PRE_MEETING_STATUS", "DEPARTMENT_ID", "OVERTIME", "CREATE_TIME", "Nav_User.DEPARTMENT_ID" }; //指定字段,包括导航属性
|
||||||
|
var preShiftMeetingTemp = GetEntities<T_FO_PRE_SHIFT_MEETING_RECORD>(i => i.CREATE_TIME >= startTime && i.IS_DELETED == false, baseFilter).ToList();
|
||||||
|
//baseFilter.SelectField = new string[] { "CLASS_TEAM_ID", "Nav_Team.NAME", "SHIFT_STATUS", "DEPARTMENT_ID", "OVERTIME", "CREATE_TIME", "Nav_Editor.DEPARTMENT_ID" }; //指定字段,包括导航属性
|
||||||
|
//var currentShiftTemp = GetEntities<T_FO_CURRENT_CLASS_RECORD>(i => i.CREATE_TIME >= startTime && i.IS_DELETED == false, baseFilter).ToList();
|
||||||
|
//baseFilter.SelectField = new string[] { "TEAM_ID", "Nav_Team.NAME", "SHIFT_STATUS", "DEPARTMENT_ID", "OVERTIME", "CREATE_TIME" }; //指定字段,包括导航属性
|
||||||
|
//var changeShiftTemp = GetEntities<T_FO_CHANGE_SHIFT_RECORD>(i => i.CREATE_TIME >= startTime && i.IS_DELETED == false, baseFilter).ToList();
|
||||||
|
baseFilter.SelectField = new string[] { "TEAM_ID", "Nav_Taem.NAME", "TA_STATUS", "Nav_Taem.DEPARTMENT_ID", "OVERTIME", "CREATE_TIME", "Nav_MainUser.DEPARTMENT_ID" }; //指定字段,包括导航属性
|
||||||
|
var teamActivityTemp = GetEntities<T_FO_TEAM_ACTIVITY>(i => i.CREATE_TIME >= startTime && i.IS_DELETED == false, baseFilter).ToList();
|
||||||
|
for (DateTime i = startTime; i <= endTime; i = i.AddMonths(i.Month - i.Month + 1).AddDays(1 - i.Day))
|
||||||
|
{
|
||||||
|
var monthEnd = Convert.ToDateTime(i.AddMonths(i.Month - i.Month + 1).AddDays(1 - i.Day - 1).ToString().Replace("0:00:00", "23:59:59"));
|
||||||
|
var preTemp = preShiftMeetingTemp.Where(t => t.CREATE_TIME >= i && t.CREATE_TIME <= monthEnd).ToList();
|
||||||
|
foreach (var item in preTemp)
|
||||||
|
{
|
||||||
|
if (item.TEAM_ID == null)
|
||||||
|
{
|
||||||
|
item.TEAM_ID = item.Nav_User?.DEPARTMENT_ID;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var deparId = teams.FirstOrDefault(t => t.ID == item.TEAM_ID)?.DEPARTMENT_ID;
|
||||||
|
item.TEAM_ID = deparId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var preShiftMeeting = preTemp.
|
||||||
|
GroupBy(m => new { m.TEAM_ID }).
|
||||||
|
Select(group => new
|
||||||
|
{
|
||||||
|
group.Key.TEAM_ID,
|
||||||
|
totalCount = group.Count(),
|
||||||
|
finishCount = group.Where(i => i.PRE_MEETING_STATUS == FOPreMeetingStatusEnum.归档).Count(),
|
||||||
|
waitingCount = group.Where(i => i.PRE_MEETING_STATUS != FOPreMeetingStatusEnum.归档).Count(),
|
||||||
|
onTimeCount = group.Where(i => i.PRE_MEETING_STATUS == FOPreMeetingStatusEnum.归档 && i.OVERTIME == FOISOVERTIME.超时).Count(),
|
||||||
|
overTimeCount = group.Where(i => i.PRE_MEETING_STATUS == FOPreMeetingStatusEnum.归档 && i.OVERTIME == FOISOVERTIME.超时).Count()
|
||||||
|
}).ToList();
|
||||||
|
if (preShiftMeeting.Any())
|
||||||
|
{
|
||||||
|
foreach (var item in preShiftMeeting)
|
||||||
|
{
|
||||||
|
//var deparId = teams.FirstOrDefault(t => t.ID == item.Key.TEAM_ID)?.DEPARTMENT_ID;
|
||||||
|
var departInfo = departments.FirstOrDefault(t => t.ID == item.TEAM_ID); //GetDepartmentId((Guid)item.Key.DEPARTMENT_ID);
|
||||||
|
T_FM_DEPARTMENT_COMPLETION completion = new T_FM_DEPARTMENT_COMPLETION();
|
||||||
|
completion.MONTH = i;
|
||||||
|
completion.MONTHStr = i.Year + "年" + i.Month + "月";
|
||||||
|
completion.TOTAL_COUNT = item.totalCount;
|
||||||
|
completion.WAITTING_COUNT = item.waitingCount;
|
||||||
|
completion.FINISH_COUNT = item.finishCount;
|
||||||
|
completion.ONTIME_COUNT = item.onTimeCount;
|
||||||
|
completion.OVERTIME_COUNT = item.overTimeCount;
|
||||||
|
completion.FORM_NAME = "班前会议";
|
||||||
|
completion.ORG_ID = orgId;
|
||||||
|
completion.START_TIME = i;
|
||||||
|
completion.END_TIME = monthEnd;
|
||||||
|
if (departInfo != null)
|
||||||
|
{
|
||||||
|
//if (departInfo.DEPARTMENT_TYPE == 10 || departInfo.DEPARTMENT_TYPE == 5)
|
||||||
|
//{
|
||||||
|
// completion.DEPARTMENT_ID = item.Key.TEAM_ID;
|
||||||
|
// completion.DEPARTMENT_NAME = item.Key.TeamName;
|
||||||
|
// completion.SHOP_DEPARTMENT_ID = null;
|
||||||
|
// completion.SHOP_DEPARTMENT_NAME = null;
|
||||||
|
// completion.TEAM_ID = null;
|
||||||
|
// completion.TEAM_NAME = null;
|
||||||
|
//}
|
||||||
|
//if (departInfo.DEPARTMENT_TYPE == 15)
|
||||||
|
//{
|
||||||
|
// completion.DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
// completion.SHOP_DEPARTMENT_ID = item.Key.TEAM_ID;
|
||||||
|
// completion.SHOP_DEPARTMENT_NAME = item.Key.TeamName;
|
||||||
|
// completion.TEAM_ID = null;
|
||||||
|
// completion.TEAM_NAME = null;
|
||||||
|
//}
|
||||||
|
//if (departInfo.DEPARTMENT_TYPE == 20)
|
||||||
|
//{
|
||||||
|
// completion.DEPARTMENT_ID = departInfo?.Nav_Parent?.PARENT_ID;
|
||||||
|
// completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.Nav_Parent?.NAME;
|
||||||
|
// completion.SHOP_DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// completion.SHOP_DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
// completion.TEAM_ID = departInfo.ID;
|
||||||
|
// completion.TEAM_NAME = departInfo.NAME;
|
||||||
|
//}
|
||||||
|
completion.DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
completion.DEPARTMENT_NAME = departments.FirstOrDefault(t => t.ID == completion.DEPARTMENT_ID)?.NAME;
|
||||||
|
completion.TEAM_ID = departInfo?.ID;
|
||||||
|
completion.TEAM_NAME = departInfo?.NAME;
|
||||||
|
}
|
||||||
|
completions.Add(completion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
T_FM_DEPARTMENT_COMPLETION completion = new T_FM_DEPARTMENT_COMPLETION();
|
||||||
|
completion.MONTH = i;
|
||||||
|
completion.MONTHStr = i.Year + "年" + i.Month + "月";
|
||||||
|
completion.TOTAL_COUNT = 0;
|
||||||
|
completion.WAITTING_COUNT = 0;
|
||||||
|
completion.FINISH_COUNT = 0;
|
||||||
|
completion.ONTIME_COUNT = 0;
|
||||||
|
completion.OVERTIME_COUNT = 0;
|
||||||
|
completion.FORM_NAME = "班前会议";
|
||||||
|
completion.ORG_ID = orgId;
|
||||||
|
completion.START_TIME = i;
|
||||||
|
completion.END_TIME = monthEnd;
|
||||||
|
completions.Add(completion);
|
||||||
|
}
|
||||||
|
// var currentTemp = currentShiftTemp.Where(t => t.CREATE_TIME >= i && t.CREATE_TIME <= monthEnd).ToList();
|
||||||
|
// foreach (var item in currentTemp)
|
||||||
|
// {
|
||||||
|
// if (item.CLASS_TEAM_ID == null)
|
||||||
|
// {
|
||||||
|
// item.CLASS_TEAM_ID = item.Nav_Editor?.DEPARTMENT_ID;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// var deparId = teams.FirstOrDefault(t => t.ID == item.CLASS_TEAM_ID)?.DEPARTMENT_ID;
|
||||||
|
// item.CLASS_TEAM_ID = deparId;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// var currentShift = currentTemp.
|
||||||
|
// GroupBy(m => new { TEAM_ID = m.CLASS_TEAM_ID }).
|
||||||
|
//Select(group => new
|
||||||
|
//{
|
||||||
|
// group.Key.TEAM_ID,
|
||||||
|
// totalCount = group.Count(),
|
||||||
|
// finishCount = group.Where(i => i.SHIFT_STATUS == (int)FOShiftStatusEnum.归档 || i.SHIFT_STATUS == (int)FOShiftStatusEnum.审批归档).Count(),
|
||||||
|
// waitingCount = group.Where(i => i.SHIFT_STATUS != (int)FOShiftStatusEnum.归档 && i.SHIFT_STATUS == (int)FOShiftStatusEnum.归档).Count(),
|
||||||
|
// onTimeCount = group.Where(i => (i.SHIFT_STATUS == (int)FOShiftStatusEnum.归档 || i.SHIFT_STATUS == (int)FOShiftStatusEnum.审批归档) && i.OVERTIME == FOISOVERTIME.未超时).Count(),
|
||||||
|
// overTimeCount = group.Where(i => (i.SHIFT_STATUS == (int)FOShiftStatusEnum.归档 || i.SHIFT_STATUS == (int)FOShiftStatusEnum.审批归档) && i.OVERTIME == FOISOVERTIME.超时).Count()
|
||||||
|
//}).ToList();
|
||||||
|
// if (currentShift.Any())
|
||||||
|
// {
|
||||||
|
// foreach (var item in currentShift)
|
||||||
|
// {
|
||||||
|
// //var deparId = teams.FirstOrDefault(t => t.ID == item.Key.CLASS_TEAM_ID)?.DEPARTMENT_ID;
|
||||||
|
// var departInfo = departments.FirstOrDefault(t => t.ID == item.TEAM_ID); //GetDepartmentId((Guid)item.Key.DEPARTMENT_ID);
|
||||||
|
// T_FM_DEPARTMENT_COMPLETION completion = new T_FM_DEPARTMENT_COMPLETION();
|
||||||
|
// //completion.DEPARTMENT_ID = departInfo?.Nav_Parent?.PARENT_ID;
|
||||||
|
// //completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.Nav_Parent?.NAME;
|
||||||
|
// //completion.SHOP_DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// //completion.SHOP_DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
// completion.MONTH = i;
|
||||||
|
// completion.MONTHStr = i.Year + "年" + i.Month + "月";
|
||||||
|
// //completion.TEAM_ID = item.Key.CLASS_TEAM_ID;
|
||||||
|
// //completion.TEAM_NAME = item.Key.TeamName;
|
||||||
|
// completion.TOTAL_COUNT = item.totalCount;
|
||||||
|
// completion.WAITTING_COUNT = item.waitingCount;
|
||||||
|
// completion.FINISH_COUNT = item.finishCount;
|
||||||
|
// completion.ONTIME_COUNT = item.onTimeCount;
|
||||||
|
// completion.OVERTIME_COUNT = item.overTimeCount;
|
||||||
|
// completion.FORM_NAME = "岗位当班";
|
||||||
|
// completion.ORG_ID = filter.GetOrgId();
|
||||||
|
// completion.START_TIME = i;
|
||||||
|
// completion.END_TIME = monthEnd;
|
||||||
|
// if (departInfo != null)
|
||||||
|
// {
|
||||||
|
// //if (departInfo.DEPARTMENT_TYPE == 10 || departInfo.DEPARTMENT_TYPE == 5)
|
||||||
|
// //{
|
||||||
|
// // completion.DEPARTMENT_ID = item.Key.CLASS_TEAM_ID;
|
||||||
|
// // completion.DEPARTMENT_NAME = item.Key.TeamName;
|
||||||
|
// // completion.SHOP_DEPARTMENT_ID = null;
|
||||||
|
// // completion.SHOP_DEPARTMENT_NAME = null;
|
||||||
|
// // completion.TEAM_ID = null;
|
||||||
|
// // completion.TEAM_NAME = null;
|
||||||
|
// //}
|
||||||
|
// //if (departInfo.DEPARTMENT_TYPE == 15)
|
||||||
|
// //{
|
||||||
|
// // completion.DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// // completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
// // completion.SHOP_DEPARTMENT_ID = item.Key.CLASS_TEAM_ID;
|
||||||
|
// // completion.SHOP_DEPARTMENT_NAME = item.Key.TeamName;
|
||||||
|
// // completion.TEAM_ID = null;
|
||||||
|
// // completion.TEAM_NAME = null;
|
||||||
|
// //}
|
||||||
|
// //if (departInfo.DEPARTMENT_TYPE == 20)
|
||||||
|
// //{
|
||||||
|
// // completion.DEPARTMENT_ID = departInfo?.Nav_Parent?.PARENT_ID;
|
||||||
|
// // completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.Nav_Parent?.NAME;
|
||||||
|
// // completion.SHOP_DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// // completion.SHOP_DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
// // completion.TEAM_ID = departInfo.ID;
|
||||||
|
// // completion.TEAM_NAME = departInfo.NAME;
|
||||||
|
// //}
|
||||||
|
// completion.DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// completion.DEPARTMENT_NAME = departments.FirstOrDefault(t => t.ID == completion.DEPARTMENT_ID)?.NAME;
|
||||||
|
// completion.TEAM_ID = departInfo?.ID;
|
||||||
|
// completion.TEAM_NAME = departInfo?.NAME;
|
||||||
|
// }
|
||||||
|
// completions.Add(completion);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
|
||||||
|
// T_FM_DEPARTMENT_COMPLETION completion = new T_FM_DEPARTMENT_COMPLETION();
|
||||||
|
// completion.MONTH = i;
|
||||||
|
// completion.MONTHStr = i.Year + "年" + i.Month + "月";
|
||||||
|
// completion.TOTAL_COUNT = 0;
|
||||||
|
// completion.WAITTING_COUNT = 0;
|
||||||
|
// completion.FINISH_COUNT = 0;
|
||||||
|
// completion.ONTIME_COUNT = 0;
|
||||||
|
// completion.OVERTIME_COUNT = 0;
|
||||||
|
// completion.FORM_NAME = "岗位当班";
|
||||||
|
// completion.ORG_ID = filter.GetOrgId();
|
||||||
|
// completion.START_TIME = i;
|
||||||
|
// completion.END_TIME = monthEnd;
|
||||||
|
// completions.Add(completion);
|
||||||
|
// }
|
||||||
|
// var changeTemp = changeShiftTemp.Where(t => t.CREATE_TIME >= i && t.CREATE_TIME <= monthEnd).ToList();
|
||||||
|
// foreach (var item in changeTemp)
|
||||||
|
// {
|
||||||
|
// if (item.TEAM_ID == null)
|
||||||
|
// {
|
||||||
|
// item.TEAM_ID = item.DEPARTMENT_ID;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// var deparId = teams.FirstOrDefault(t => t.ID == item.TEAM_ID)?.DEPARTMENT_ID;
|
||||||
|
// item.TEAM_ID = deparId;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// var changeShift = changeTemp.
|
||||||
|
// GroupBy(m => new { m.TEAM_ID }).
|
||||||
|
// Select(group => new
|
||||||
|
// {
|
||||||
|
// group.Key.TEAM_ID,
|
||||||
|
// totalCount = group.Count(),
|
||||||
|
// finishCount = group.Where(i => i.SHIFT_STATUS == (int)FOChangeShiftStatusEnum.归档).Count(),
|
||||||
|
// waitingCount = group.Where(i => i.SHIFT_STATUS != (int)FOChangeShiftStatusEnum.归档).Count(),
|
||||||
|
// onTimeCount = group.Where(i => i.SHIFT_STATUS == (int)FOChangeShiftStatusEnum.归档 && i.OVERTIME == FOISOVERTIME.未超时).Count(),
|
||||||
|
// overTimeCount = group.Where(i => i.SHIFT_STATUS == (int)FOChangeShiftStatusEnum.归档 && i.OVERTIME == FOISOVERTIME.超时).Count()
|
||||||
|
// }).ToList();
|
||||||
|
// if (changeShift.Any())
|
||||||
|
// {
|
||||||
|
// foreach (var item in changeShift)
|
||||||
|
// {
|
||||||
|
// var departInfo = departments.FirstOrDefault(t => t.ID == item.TEAM_ID);
|
||||||
|
// //var departInfo = departments.FirstOrDefault(t => t.ID == deparId); //GetDepartmentId((Guid)item.Key.DEPARTMENT_ID);
|
||||||
|
// T_FM_DEPARTMENT_COMPLETION completion = new T_FM_DEPARTMENT_COMPLETION();
|
||||||
|
// //completion.DEPARTMENT_ID = departInfo?.Nav_Parent?.PARENT_ID;
|
||||||
|
// //completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.Nav_Parent?.NAME;
|
||||||
|
// //completion.SHOP_DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// //completion.SHOP_DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
// completion.MONTH = i;
|
||||||
|
// completion.MONTHStr = i.Year + "年" + i.Month + "月";
|
||||||
|
// //completion.TEAM_ID = item.Key.TEAM_ID;
|
||||||
|
// //completion.TEAM_NAME = item.Key.TeamName;
|
||||||
|
// completion.TOTAL_COUNT = item.totalCount;
|
||||||
|
// completion.WAITTING_COUNT = item.waitingCount;
|
||||||
|
// completion.FINISH_COUNT = item.finishCount;
|
||||||
|
// completion.ONTIME_COUNT = item.onTimeCount;
|
||||||
|
// completion.OVERTIME_COUNT = item.overTimeCount;
|
||||||
|
// completion.FORM_NAME = "岗位交接班";
|
||||||
|
// completion.ORG_ID = filter.GetOrgId();
|
||||||
|
// completion.START_TIME = i;
|
||||||
|
// completion.END_TIME = monthEnd;
|
||||||
|
// if (departInfo != null)
|
||||||
|
// {
|
||||||
|
// //if (departInfo.DEPARTMENT_TYPE == 10 || departInfo.DEPARTMENT_TYPE == 5)
|
||||||
|
// //{
|
||||||
|
// // completion.DEPARTMENT_ID = item.Key.TEAM_ID;
|
||||||
|
// // completion.DEPARTMENT_NAME = item.Key.TeamName;
|
||||||
|
// // completion.SHOP_DEPARTMENT_ID = null;
|
||||||
|
// // completion.SHOP_DEPARTMENT_NAME = null;
|
||||||
|
// // completion.TEAM_ID = null;
|
||||||
|
// // completion.TEAM_NAME = null;
|
||||||
|
// //}
|
||||||
|
// //if (departInfo.DEPARTMENT_TYPE == 15)
|
||||||
|
// //{
|
||||||
|
// // completion.DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// // completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
// // completion.SHOP_DEPARTMENT_ID = item.Key.TEAM_ID;
|
||||||
|
// // completion.SHOP_DEPARTMENT_NAME = item.Key.TeamName;
|
||||||
|
// // completion.TEAM_ID = null;
|
||||||
|
// // completion.TEAM_NAME = null;
|
||||||
|
// //}
|
||||||
|
// //if (departInfo.DEPARTMENT_TYPE == 20)
|
||||||
|
// //{
|
||||||
|
// // completion.DEPARTMENT_ID = departInfo?.Nav_Parent?.PARENT_ID;
|
||||||
|
// // completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.Nav_Parent?.NAME;
|
||||||
|
// // completion.SHOP_DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// // completion.SHOP_DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
// // completion.TEAM_ID = departInfo.ID;
|
||||||
|
// // completion.TEAM_NAME = departInfo.NAME;
|
||||||
|
// //}
|
||||||
|
// completion.DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// completion.DEPARTMENT_NAME = departments.FirstOrDefault(t => t.ID == completion.DEPARTMENT_ID)?.NAME;
|
||||||
|
// completion.TEAM_ID = departInfo?.ID;
|
||||||
|
// completion.TEAM_NAME = departInfo?.NAME;
|
||||||
|
// }
|
||||||
|
// completions.Add(completion);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
|
||||||
|
// T_FM_DEPARTMENT_COMPLETION completion = new T_FM_DEPARTMENT_COMPLETION();
|
||||||
|
// completion.MONTH = i;
|
||||||
|
// completion.MONTHStr = i.Year + "年" + i.Month + "月";
|
||||||
|
// completion.TOTAL_COUNT = 0;
|
||||||
|
// completion.WAITTING_COUNT = 0;
|
||||||
|
// completion.FINISH_COUNT = 0;
|
||||||
|
// completion.ONTIME_COUNT = 0;
|
||||||
|
// completion.OVERTIME_COUNT = 0;
|
||||||
|
// completion.FORM_NAME = "岗位交接班";
|
||||||
|
// completion.ORG_ID = filter.GetOrgId();
|
||||||
|
// completion.START_TIME = i;
|
||||||
|
// completion.END_TIME = monthEnd;
|
||||||
|
// completions.Add(completion);
|
||||||
|
// }
|
||||||
|
|
||||||
|
var teamTemp = teamActivityTemp.Where(t => t.CREATE_TIME >= i && t.CREATE_TIME <= monthEnd).ToList();
|
||||||
|
foreach (var item in teamTemp)
|
||||||
|
{
|
||||||
|
if (item.TEAM_ID == null)
|
||||||
|
{
|
||||||
|
item.TEAM_ID = item.Nav_MainUser?.DEPARTMENT_ID;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var deparId = teams.FirstOrDefault(t => t.ID == item.TEAM_ID)?.DEPARTMENT_ID;
|
||||||
|
item.TEAM_ID = deparId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var teamActivity = teamTemp.
|
||||||
|
GroupBy(m => new { m.TEAM_ID }).
|
||||||
|
Select(group => new
|
||||||
|
{
|
||||||
|
group.Key.TEAM_ID,
|
||||||
|
totalCount = group.Count(),
|
||||||
|
finishCount = group.Where(i => i.TA_STATUS == (int)FOTeamActivityState.已归档).Count(),
|
||||||
|
waitingCount = group.Where(i => i.TA_STATUS != (int)FOTeamActivityState.已归档).Count(),
|
||||||
|
onTimeCount = group.Where(i => i.TA_STATUS == (int)FOTeamActivityState.已归档 && i.OVERTIME == FOISOVERTIME.未超时).Count(),
|
||||||
|
overTimeCount = group.Where(i => i.TA_STATUS == (int)FOTeamActivityState.已归档 && i.OVERTIME == FOISOVERTIME.超时).Count()
|
||||||
|
}).ToList();
|
||||||
|
if (teamActivity.Any())
|
||||||
|
{
|
||||||
|
foreach (var item in teamActivity)
|
||||||
|
{
|
||||||
|
//var deparId = teams.FirstOrDefault(t => t.ID == item.Key.TEAM_ID)?.DEPARTMENT_ID;
|
||||||
|
var departInfo = departments.FirstOrDefault(t => t.ID == item.TEAM_ID); //GetDepartmentId((Guid)item.Key.DEPARTMENT_ID);
|
||||||
|
T_FM_DEPARTMENT_COMPLETION completion = new T_FM_DEPARTMENT_COMPLETION();
|
||||||
|
//completion.DEPARTMENT_ID = departInfo?.Nav_Parent?.PARENT_ID;
|
||||||
|
//completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.Nav_Parent?.NAME;
|
||||||
|
//completion.SHOP_DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
//completion.SHOP_DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
completion.MONTH = i;
|
||||||
|
completion.MONTHStr = i.Year + "年" + i.Month + "月";
|
||||||
|
//completion.TEAM_ID = item.Key.TEAM_ID;
|
||||||
|
//completion.TEAM_NAME = item.Key.TeamName;
|
||||||
|
completion.TOTAL_COUNT = item.totalCount;
|
||||||
|
completion.WAITTING_COUNT = item.waitingCount;
|
||||||
|
completion.FINISH_COUNT = item.finishCount;
|
||||||
|
completion.ONTIME_COUNT = item.onTimeCount;
|
||||||
|
completion.OVERTIME_COUNT = item.overTimeCount;
|
||||||
|
completion.FORM_NAME = "班组安全活动记录";
|
||||||
|
completion.ORG_ID = orgId;
|
||||||
|
completion.START_TIME = i;
|
||||||
|
completion.END_TIME = monthEnd;
|
||||||
|
if (departInfo != null)
|
||||||
|
{
|
||||||
|
//if (departInfo.DEPARTMENT_TYPE == 10 || departInfo.DEPARTMENT_TYPE == 5)
|
||||||
|
//{
|
||||||
|
// completion.DEPARTMENT_ID = item.Key.TEAM_ID;
|
||||||
|
// completion.DEPARTMENT_NAME = item.Key.TeamName;
|
||||||
|
// completion.SHOP_DEPARTMENT_ID = null;
|
||||||
|
// completion.SHOP_DEPARTMENT_NAME = null;
|
||||||
|
// completion.TEAM_ID = null;
|
||||||
|
// completion.TEAM_NAME = null;
|
||||||
|
//}
|
||||||
|
//if (departInfo.DEPARTMENT_TYPE == 15)
|
||||||
|
//{
|
||||||
|
// completion.DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
// completion.SHOP_DEPARTMENT_ID = item.Key.TEAM_ID;
|
||||||
|
// completion.SHOP_DEPARTMENT_NAME = item.Key.TeamName;
|
||||||
|
// completion.TEAM_ID = null;
|
||||||
|
// completion.TEAM_NAME = null;
|
||||||
|
//}
|
||||||
|
//if (departInfo.DEPARTMENT_TYPE == 20)
|
||||||
|
//{
|
||||||
|
// completion.DEPARTMENT_ID = departInfo?.Nav_Parent?.PARENT_ID;
|
||||||
|
// completion.DEPARTMENT_NAME = departInfo?.Nav_Parent?.Nav_Parent?.NAME;
|
||||||
|
// completion.SHOP_DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
// completion.SHOP_DEPARTMENT_NAME = departInfo?.Nav_Parent?.NAME;
|
||||||
|
// completion.TEAM_ID = departInfo.ID;
|
||||||
|
// completion.TEAM_NAME = departInfo.NAME;
|
||||||
|
//}
|
||||||
|
completion.DEPARTMENT_ID = departInfo?.PARENT_ID;
|
||||||
|
completion.DEPARTMENT_NAME = departments.FirstOrDefault(t => t.ID == completion.DEPARTMENT_ID)?.NAME;
|
||||||
|
completion.TEAM_ID = departInfo?.ID;
|
||||||
|
completion.TEAM_NAME = departInfo?.NAME;
|
||||||
|
}
|
||||||
|
completions.Add(completion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
T_FM_DEPARTMENT_COMPLETION completion = new T_FM_DEPARTMENT_COMPLETION();
|
||||||
|
completion.MONTH = i;
|
||||||
|
completion.MONTHStr = i.Year + "年" + i.Month + "月";
|
||||||
|
completion.TOTAL_COUNT = 0;
|
||||||
|
completion.WAITTING_COUNT = 0;
|
||||||
|
completion.FINISH_COUNT = 0;
|
||||||
|
completion.ONTIME_COUNT = 0;
|
||||||
|
completion.OVERTIME_COUNT = 0;
|
||||||
|
completion.FORM_NAME = "班组安全活动记录";
|
||||||
|
completion.ORG_ID = orgId;
|
||||||
|
completion.START_TIME = i;
|
||||||
|
completion.END_TIME = monthEnd;
|
||||||
|
completions.Add(completion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return completions;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 首页工作票完成数前八
|
/// 首页工作票完成数前八
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -10299,14 +10796,17 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
|||||||
{
|
{
|
||||||
return completionSorts;
|
return completionSorts;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
completionSorts = new List<T_FM_WORK_TICKET_COMPLETION>();
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 获取数据
|
#region 获取数据
|
||||||
|
|
||||||
|
|
||||||
List<T_FM_WORK_TICKET_COMPLETION> completions = new List<T_FM_WORK_TICKET_COMPLETION>();
|
List<T_FM_WORK_TICKET_COMPLETION> completions = new List<T_FM_WORK_TICKET_COMPLETION>();
|
||||||
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
|
BaseFilter baseFilter = new BaseFilter(orgId);
|
||||||
baseFilter.IgnoreDataRule = true;
|
baseFilter.IgnoreDataRule = true;
|
||||||
var startTime = Convert.ToDateTime(DateTime.Now.Year + "-" + DateTime.Now.Month + "-01 00:00:00");
|
var startTime = Convert.ToDateTime(DateTime.Now.Year + "-" + DateTime.Now.Month + "-01 00:00:00");
|
||||||
var endTime = Convert.ToDateTime(DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + " 23:59:59");
|
var endTime = Convert.ToDateTime(DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + " 23:59:59");
|
||||||
@ -11859,6 +12359,7 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
|||||||
/// 存储信息
|
/// 存储信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<T_FM_WORK_TICKET_COMPLETION> result { get; set; }
|
public List<T_FM_WORK_TICKET_COMPLETION> result { get; set; }
|
||||||
|
public List<T_FM_DEPARTMENT_COMPLETION_SORT> deptResult { get; set; }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统运行情况报表
|
/// 系统运行情况报表
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user