料架功能修改,亮灯看板功能修改
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,13 @@ namespace DOAN.Service.PBL.IService;
|
||||
|
||||
public interface IBigScreenService : IBaseService<Storagelocation>
|
||||
{
|
||||
List<BIgScreenDtoLightPickupDto> SearchShelfLightInfomation();
|
||||
/// <summary>
|
||||
/// <20><>ѯ<EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD>صĻ<D8B5><C4BB><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<BigScreenDto> SearchBigScreenInformation();
|
||||
|
||||
List<BigSreeenDtoFeedingMaterial> SearchfeedingMaterialInfomation();
|
||||
List<BIgScreenDtoLightPickupDto> SearchShelfLightInfomation();
|
||||
|
||||
}
|
||||
List<BigSreeenDtoFeedingMaterial> SearchfeedingMaterialInfomation();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,19 @@ namespace DOAN.Service.PBL.IService
|
||||
/// </summary>
|
||||
public interface IStoragelocationService : IBaseService<Storagelocation>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取料架下拉数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<SelectOptionsDto> GetRackCodeOptions();
|
||||
/// <summary>
|
||||
/// 获取BOM中的零件号下拉
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<SelectOptionsDto> GetPartNumberOptions();
|
||||
|
||||
|
||||
|
||||
PagedInfo<StoragelocationDto> GetList(StoragelocationQueryDto parm);
|
||||
|
||||
Storagelocation GetInfo(int Id);
|
||||
@@ -22,5 +35,11 @@ namespace DOAN.Service.PBL.IService
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
List<StoragelocationPartNumberGroupDto> GetPartNumberList();
|
||||
|
||||
/// <summary>
|
||||
/// 修改料架的零件号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
int UpdateRackPartNumber(string rackCode,int layerNum,string partnumber);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,42 @@ namespace DOAN.Service.PBL
|
||||
return predicate;
|
||||
}
|
||||
|
||||
public List<SelectOptionsDto> GetRackCodeOptions()
|
||||
{
|
||||
var response = Queryable()
|
||||
.GroupBy(it => it.RackCode)
|
||||
.OrderBy(it => it.RackCode)
|
||||
.Select(it => new SelectOptionsDto()
|
||||
{
|
||||
Key = SqlFunc.AggregateMax(it.Id).ToString(),
|
||||
Label = SqlFunc.AggregateMax(it.RackCode),
|
||||
Value = SqlFunc.AggregateMax(it.RackCode)
|
||||
})
|
||||
.OrderBy(it => it.Key)
|
||||
.ToList();
|
||||
return response;
|
||||
}
|
||||
|
||||
public List<SelectOptionsDto> GetPartNumberOptions()
|
||||
{
|
||||
var response = Context.Queryable<Billofmaterials>()
|
||||
.Select(it => new SelectOptionsDto()
|
||||
{
|
||||
Key = it.Id.ToString(),
|
||||
Label = it.Productname + it.Productcode + " " + it.MirrorshellName + it.MirrorshellCode,
|
||||
Value = it.MirrorshellCode
|
||||
})
|
||||
.OrderBy(it => it.Key)
|
||||
.ToList();
|
||||
return response;
|
||||
}
|
||||
|
||||
public int UpdateRackPartNumber(string rackCode, int layerNum, string partnumber)
|
||||
{
|
||||
return Context.Updateable<Storagelocation>()
|
||||
.SetColumns(it => it.Partnumber == partnumber )
|
||||
.Where(it => it.RackCode == rackCode && it.LayerNum == layerNum)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user