料架功能修改,亮灯看板功能修改
This commit is contained in:
@@ -9,7 +9,7 @@ namespace DOAN.Service.PBL;
|
||||
public class BigScreenService : BaseService<Storagelocation>, IBigScreenService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询料架灯 亮和灭 情况
|
||||
/// 查询料架灯 亮和灭 情况 (功能迁移至SearchBigScreenInfomation,新增最低安全库存等功能)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<BIgScreenDtoLightPickupDto> SearchShelfLightInfomation()
|
||||
@@ -17,7 +17,10 @@ public class BigScreenService : BaseService<Storagelocation>, IBigScreenService
|
||||
var result = new List<BIgScreenDtoLightPickupDto>();
|
||||
|
||||
// 1 查询所有料架
|
||||
var RackCodeArray = Context.Queryable<Storagelocation>().GroupBy(it => it.RackCode).Select(it => it.RackCode)
|
||||
var RackCodeArray = Context
|
||||
.Queryable<Storagelocation>()
|
||||
.GroupBy(it => it.RackCode)
|
||||
.Select(it => it.RackCode)
|
||||
.ToArray();
|
||||
|
||||
var DataSoure = Context.Queryable<Storagelocation>().ToList();
|
||||
@@ -37,8 +40,8 @@ public class BigScreenService : BaseService<Storagelocation>, IBigScreenService
|
||||
LayerObject.LayerNum = LayerSheelfList[j].LayerNum;
|
||||
LayerObject.Partnumber = LayerSheelfList[j].Partnumber;
|
||||
LayerObject.MaxCapacity = LayerSheelfList[j].MaxCapacity;
|
||||
LayerObject.PackageNum = LayerSheelfList[j].PackageNum;
|
||||
LayerObject.isLight = LayerSheelfList[j].IsLight == 1 ? true : false;
|
||||
LayerObject.PackageNum = LayerSheelfList[j].PackageNum ?? 0;
|
||||
LayerObject.IsLight = LayerSheelfList[j].IsLight == 1 ? true : false;
|
||||
LayerObjectfArray[j] = LayerObject;
|
||||
}
|
||||
|
||||
@@ -57,18 +60,21 @@ public class BigScreenService : BaseService<Storagelocation>, IBigScreenService
|
||||
result.Add(RackCodeObject);
|
||||
}
|
||||
|
||||
|
||||
return result.OrderBy(it => it.RackCode).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// (功能迁移至SearchBigScreenInfomation,新增最低安全库存等功能)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<BigSreeenDtoFeedingMaterial> SearchfeedingMaterialInfomation()
|
||||
{
|
||||
var result = new List<BigSreeenDtoFeedingMaterial>();
|
||||
|
||||
// 1 查询所有料架
|
||||
var RackCodeArray = Context.Queryable<Storagelocation>().GroupBy(it => it.RackCode).Select(it => it.RackCode)
|
||||
var RackCodeArray = Context
|
||||
.Queryable<Storagelocation>()
|
||||
.GroupBy(it => it.RackCode)
|
||||
.Select(it => it.RackCode)
|
||||
.ToArray();
|
||||
|
||||
var DataSoure = Context.Queryable<Storagelocation>().ToList();
|
||||
@@ -89,7 +95,8 @@ public class BigScreenService : BaseService<Storagelocation>, IBigScreenService
|
||||
LayerObject.Partnumber = LayerSheelfList[j].Partnumber;
|
||||
LayerObject.MaxCapacity = LayerSheelfList[j].MaxCapacity;
|
||||
LayerObject.PackageNum = LayerSheelfList[j].PackageNum;
|
||||
LayerObject.isFeedingMaterial = LayerSheelfList[j].PackageNum <= 2 ? true : false;
|
||||
LayerObject.isFeedingMaterial =
|
||||
LayerSheelfList[j].PackageNum <= 2 ? true : false;
|
||||
LayerObjectfArray[j] = LayerObject;
|
||||
}
|
||||
|
||||
@@ -108,9 +115,47 @@ public class BigScreenService : BaseService<Storagelocation>, IBigScreenService
|
||||
result.Add(RackCodeObject);
|
||||
}
|
||||
|
||||
|
||||
return result.OrderBy(it => it.RackCode).ToList();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 看板综合信息查询
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<BigScreenDto> SearchBigScreenInformation()
|
||||
{
|
||||
// 一次性获取所有数据并按RackCode分组
|
||||
var rackGroups = Context.Queryable<Storagelocation>()
|
||||
.ToList()
|
||||
.GroupBy(sl => sl.RackCode)
|
||||
.OrderBy(g => g.Key);
|
||||
|
||||
var result = new List<BigScreenDto>();
|
||||
|
||||
foreach (var group in rackGroups)
|
||||
{
|
||||
var layers = group.ToList();
|
||||
var layerObjects = layers.Select(layer => new LayerObject
|
||||
{
|
||||
LayerNum = layer.LayerNum,
|
||||
Partnumber = layer.Partnumber,
|
||||
MaxCapacity = layer.MaxCapacity,
|
||||
AlarmNum = layer.AlarmNum ?? 2, // 确认默认值
|
||||
PackageNum = layer.PackageNum ?? 0,
|
||||
IsLight = layer.IsLight == 1,
|
||||
IsFeedingMaterial = (layer.PackageNum ?? 0) <= (layer.AlarmNum ?? 2) && layer.IsLackAlarm == 1
|
||||
}).ToArray();
|
||||
var rackDto = new BigScreenDto
|
||||
{
|
||||
Title = group.Key,
|
||||
RackCode = group.Key,
|
||||
IsLight = layers.Any(l => l.IsLight == 1),
|
||||
IsInUse = layers.Any(l => l.IsLackAlarm == 1),
|
||||
IsFeedingMaterial = layers.Any(l => (l.PackageNum ?? 0) <= (l.AlarmNum ?? 2) && l.IsLackAlarm == 1),
|
||||
LayerObjectArray = layerObjects
|
||||
};
|
||||
result.Add(rackDto);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user