修改检查清单
This commit is contained in:
parent
f4082f8d7f
commit
9f3161f596
@ -77,6 +77,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
|||||||
public class CheckListNew
|
public class CheckListNew
|
||||||
{
|
{
|
||||||
public string MineType { get; set; }
|
public string MineType { get; set; }
|
||||||
|
public Guid? PRODUCTION_UNIT_ID { get; set; }
|
||||||
|
|
||||||
public string CheckType { get; set; }
|
public string CheckType { get; set; }
|
||||||
public string CheckCycle { get; set; }
|
public string CheckCycle { get; set; }
|
||||||
@ -2307,45 +2308,48 @@ namespace APT.SK.WebApi.Controllers.Api
|
|||||||
{
|
{
|
||||||
var loginDepart = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
|
var loginDepart = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
|
||||||
var loginUser = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
var loginUser = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||||
var userInfo = this.GetEntity<T_FM_USER>(t => t.ID == loginUser);
|
var userInfo = this.GetEntity<T_FM_USER>(t => t.ID == loginUser, "Nav_ProdutionUnit");
|
||||||
var departs = this.GetEntities<T_FM_DEPARTMENT>(t => t.ENABLE_STATUS == 0, new BaseFilter(filter.OrgId));
|
List<Guid> selectMinetype = new List<Guid>();
|
||||||
List<string> selectMinetype = new List<string>();
|
if (userInfo != null && userInfo.Nav_ProdutionUnit != null && userInfo.Nav_ProdutionUnit.Any())
|
||||||
var minetype = departs.FirstOrDefault(t => t.ID == loginDepart)?.MineType;
|
{
|
||||||
switch (minetype)
|
selectMinetype = userInfo.Nav_ProdutionUnit.Select(t => t.ID).Distinct().ToList();
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
selectMinetype.Add(SKProductionUnit.All.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.MineChoose.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.MineUnderGround.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.Minelast.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.Mine.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.Department.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.Nonmetallic.GetDescription());
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
selectMinetype.Add(SKProductionUnit.MineChoose.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.Minelast.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.Nonmetallic.GetDescription());
|
|
||||||
break;
|
|
||||||
case 20:
|
|
||||||
selectMinetype.Add(SKProductionUnit.Minelast.GetDescription());
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
selectMinetype.Add(SKProductionUnit.Mine.GetDescription());
|
|
||||||
break;
|
|
||||||
case 40:
|
|
||||||
selectMinetype.Add(SKProductionUnit.MineUnderGround.GetDescription());
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
selectMinetype.Add(SKProductionUnit.All.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.MineChoose.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.MineUnderGround.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.Minelast.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.Mine.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.Department.GetDescription());
|
|
||||||
selectMinetype.Add(SKProductionUnit.Nonmetallic.GetDescription());
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
//var minetype = departs.FirstOrDefault(t => t.ID == loginDepart)?.MineType;
|
||||||
|
//switch (minetype)
|
||||||
|
//{
|
||||||
|
// case 0:
|
||||||
|
// selectMinetype.Add(SKProductionUnit.All.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.MineChoose.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.MineUnderGround.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Minelast.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Mine.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Department.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Nonmetallic.GetDescription());
|
||||||
|
// break;
|
||||||
|
// case 10:
|
||||||
|
// selectMinetype.Add(SKProductionUnit.MineChoose.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Minelast.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Nonmetallic.GetDescription());
|
||||||
|
// break;
|
||||||
|
// case 20:
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Minelast.GetDescription());
|
||||||
|
// break;
|
||||||
|
// case 30:
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Mine.GetDescription());
|
||||||
|
// break;
|
||||||
|
// case 40:
|
||||||
|
// selectMinetype.Add(SKProductionUnit.MineUnderGround.GetDescription());
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// selectMinetype.Add(SKProductionUnit.All.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.MineChoose.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.MineUnderGround.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Minelast.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Mine.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Department.GetDescription());
|
||||||
|
// selectMinetype.Add(SKProductionUnit.Nonmetallic.GetDescription());
|
||||||
|
// break;
|
||||||
|
//}
|
||||||
//List<Guid> departmentIds = new List<Guid>() { loginDepart.Value };
|
//List<Guid> departmentIds = new List<Guid>() { loginDepart.Value };
|
||||||
//DepartmentService.GetDepartmentIds(filter.OrgId.Value, new List<Guid>() { loginDepart.Value }, ref departmentIds);
|
//DepartmentService.GetDepartmentIds(filter.OrgId.Value, new List<Guid>() { loginDepart.Value }, ref departmentIds);
|
||||||
var checkList = new JsonActionResult<List<CheckListNew>>();
|
var checkList = new JsonActionResult<List<CheckListNew>>();
|
||||||
@ -2383,7 +2387,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
|||||||
{
|
{
|
||||||
T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART de = new T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART();
|
T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART de = new T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART();
|
||||||
de.POST_NAME = post?.NAME;
|
de.POST_NAME = post?.NAME;
|
||||||
de.MineType = item.MineType;
|
de.PRODUCTION_UNIT_ID = item.PRODUCTION_UNIT_ID;
|
||||||
de.AREA_NAME = item.Nav_Area?.NAME;
|
de.AREA_NAME = item.Nav_Area?.NAME;
|
||||||
de.ENTERPRISE_LIBRARY_DETAIL_ID = contentFirst?.ENTERPRISE_LIBRARY_DETAIL_ID;
|
de.ENTERPRISE_LIBRARY_DETAIL_ID = contentFirst?.ENTERPRISE_LIBRARY_DETAIL_ID;
|
||||||
de.ENTERPRISE_LIBRARY_ID = item.ID;
|
de.ENTERPRISE_LIBRARY_ID = item.ID;
|
||||||
@ -2402,7 +2406,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
|||||||
{
|
{
|
||||||
T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART de = new T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART();
|
T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART de = new T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART();
|
||||||
de.POST_NAME = "未配置辨识岗位";
|
de.POST_NAME = "未配置辨识岗位";
|
||||||
de.MineType = item.MineType;
|
de.PRODUCTION_UNIT_ID = item.PRODUCTION_UNIT_ID;
|
||||||
de.AREA_NAME = item.Nav_Area?.NAME;
|
de.AREA_NAME = item.Nav_Area?.NAME;
|
||||||
de.ENTERPRISE_LIBRARY_DETAIL_ID = contentFirst?.ENTERPRISE_LIBRARY_DETAIL_ID;
|
de.ENTERPRISE_LIBRARY_DETAIL_ID = contentFirst?.ENTERPRISE_LIBRARY_DETAIL_ID;
|
||||||
de.ENTERPRISE_LIBRARY_ID = item.ID;
|
de.ENTERPRISE_LIBRARY_ID = item.ID;
|
||||||
@ -2455,18 +2459,18 @@ namespace APT.SK.WebApi.Controllers.Api
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var group = detailContents.GroupBy(t => new { t.MineType, t.CHECK_TYPE, t.CHECK_CYCLE, t.DEPART_NAME, t.DEPARTMENT_ID, t.CHECK_TYPE_ID, t.TYPE_NAME, t.POST_NAME }).ToList();
|
var group = detailContents.GroupBy(t => new { t.PRODUCTION_UNIT_ID, t.CHECK_TYPE, t.CHECK_CYCLE, t.DEPART_NAME, t.DEPARTMENT_ID, t.CHECK_TYPE_ID, t.TYPE_NAME, t.POST_NAME }).ToList();
|
||||||
foreach (var item in group)
|
foreach (var item in group)
|
||||||
{
|
{
|
||||||
CheckListNew listNew = new CheckListNew();
|
CheckListNew listNew = new CheckListNew();
|
||||||
listNew.MineType = item.Key.MineType.GetDescription();
|
listNew.PRODUCTION_UNIT_ID = item.Key.PRODUCTION_UNIT_ID;
|
||||||
listNew.CheckType = item.Key.TYPE_NAME;
|
listNew.CheckType = item.Key.TYPE_NAME;
|
||||||
listNew.CheckCycle = item.Key.CHECK_CYCLE.GetDescription();
|
listNew.CheckCycle = item.Key.CHECK_CYCLE.GetDescription();
|
||||||
listNew.CheckLevel = item.Key.CHECK_TYPE.GetDescription();
|
listNew.CheckLevel = item.Key.CHECK_TYPE.GetDescription();
|
||||||
listNew.Num = (int)item.Key.CHECK_TYPE;
|
listNew.Num = (int)item.Key.CHECK_TYPE;
|
||||||
listNew.CheckDepart = item.Key.DEPART_NAME;
|
listNew.CheckDepart = item.Key.DEPART_NAME;
|
||||||
listNew.CheckPost = item.Key.POST_NAME;
|
listNew.CheckPost = item.Key.POST_NAME;
|
||||||
var depathaveIds = detailContents.Where(t => t.DEPARTMENT_ID == item.Key.DEPARTMENT_ID && t.CHECK_TYPE_ID == item.Key.CHECK_TYPE_ID && t.CHECK_TYPE == item.Key.CHECK_TYPE && t.CHECK_CYCLE == item.Key.CHECK_CYCLE && t.MineType == item.Key.MineType && t.POST_NAME == item.Key.POST_NAME).Select(m => m.ENTERPRISE_LIBRARY_DETAIL_CONTENT_ID).Distinct().ToList();
|
var depathaveIds = detailContents.Where(t => t.DEPARTMENT_ID == item.Key.DEPARTMENT_ID && t.CHECK_TYPE_ID == item.Key.CHECK_TYPE_ID && t.CHECK_TYPE == item.Key.CHECK_TYPE && t.CHECK_CYCLE == item.Key.CHECK_CYCLE && t.PRODUCTION_UNIT_ID == item.Key.PRODUCTION_UNIT_ID && t.POST_NAME == item.Key.POST_NAME).Select(m => m.ENTERPRISE_LIBRARY_DETAIL_CONTENT_ID).Distinct().ToList();
|
||||||
var temps = contents.Where(t => depathaveIds.Contains(t.ID)).Distinct().ToList();
|
var temps = contents.Where(t => depathaveIds.Contains(t.ID)).Distinct().ToList();
|
||||||
if (temps.Any())
|
if (temps.Any())
|
||||||
{
|
{
|
||||||
@ -2489,11 +2493,11 @@ namespace APT.SK.WebApi.Controllers.Api
|
|||||||
}
|
}
|
||||||
if (userInfo != null && userInfo.NAME.Contains("管理员"))
|
if (userInfo != null && userInfo.NAME.Contains("管理员"))
|
||||||
{
|
{
|
||||||
checkList.Data = list.OrderBy(n => n.MineType).ThenBy(x => x.Num).ThenBy(n => n.CheckDepart).ToList();
|
checkList.Data = list.OrderBy(n => n.PRODUCTION_UNIT_ID).ThenBy(x => x.Num).ThenBy(n => n.CheckDepart).ToList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
checkList.Data = list.Where(t => selectMinetype.Contains(t.MineType)).OrderBy(n => n.MineType).ThenBy(x => x.Num).ThenBy(n => n.CheckDepart).ToList();
|
checkList.Data = list.Where(t => t.PRODUCTION_UNIT_ID!=null && selectMinetype.Contains((Guid)t.PRODUCTION_UNIT_ID)).OrderBy(n => n.PRODUCTION_UNIT_ID).ThenBy(x => x.Num).ThenBy(n => n.CheckDepart).ToList();
|
||||||
}
|
}
|
||||||
checkList.TotalCount = checkList.Data.Count;
|
checkList.TotalCount = checkList.Data.Count;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user