This commit is contained in:
hehaibing-1996
2025-01-08 17:42:12 +08:00
parent be07ee60ee
commit 8d81b36f73
5 changed files with 7 additions and 70 deletions

View File

@ -11,7 +11,6 @@ namespace WCS.DAL.DbModels
[SugarTable("wcs_shelf_info")]
public class ShelfInfo
{
/// <summary>
/// 主键 自增Id
/// </summary>
@ -19,34 +18,17 @@ namespace WCS.DAL.DbModels
public int Id { get; set; }
/// <summary>
/// 货架编码;货架一般按照报警灯来区分 一个报警灯指示的是一个货架
/// 货架编码
/// </summary>
[SugarColumn(ColumnName = "shelf_code", Length = 50, IsNullable = false, ColumnDescription = "货架编码;货架一般按照报警灯来区分 一个报警灯指示的是一个货架")]
[SugarColumn(ColumnName = "shelf_code", Length = 50, IsNullable = false, ColumnDescription = "货架编码")]
public string ShelfCode { get; set; }
/// <summary>
/// 货架类型Id
/// </summary>
[SugarColumn(ColumnName = "shelf_type_id", IsNullable = false, ColumnDescription = "货架类型Id")]
public int ShelfTypeId { get; set; }
/// <summary>
/// 货架类型名称
/// </summary>
[SugarColumn(ColumnName = "shelf_type_name", Length = 50, IsNullable = false, ColumnDescription = "货架类型名称")]
public string ShelfTypeName { get; set; }
[SugarColumn(ColumnName = "shelf_type", Length = 50, IsNullable = false, ColumnDescription = "货架类型")]
public string ShelfType { get; set; }
/// <summary>
/// 货架当前状态
/// </summary>
[SugarColumn(ColumnName = "current_mode", IsNullable = false, ColumnDescription = "货架当前状态")]
public Mode CurrentMode { get; set; }
/// <summary>
/// 货架设置当前模式的时间
/// </summary>
[SugarColumn(ColumnName = "set_current_mode_time", IsNullable = true, ColumnDescription = "设置货架当前模式的时间")]
public DateTime SetCurrentModeTime { get; set; }
/// <summary>
/// 货架行数

View File

@ -911,18 +911,7 @@ namespace WCS.BLL.HardWare
public void SetCurrentMode(Mode mode)
{
this.CurrentMode = mode;
this.SetCurrentModeTime = DateTime.Now;
Task.Run(() =>
{
var shelf = DbHelp.db.Queryable<ShelfInfo>().Where(t => t.Id == ShelfId).First();
if (shelf != null)
{
shelf.CurrentMode = mode;
shelf.SetCurrentModeTime = SetCurrentModeTime;
DbHelp.db.Updateable(shelf).ExecuteCommand();
}
});
}
void IShelfBase.Warning()

View File

@ -37,32 +37,7 @@ namespace WCS.BLL.Manager
public static IShelfBase InitShelf(ShelfInfo shelfInDb)
{
switch (shelfInDb.ShelfTypeId)
{
case 1:
return new SmartShelf(shelfInDb)
{
ShelfId = shelfInDb.Id,
ShelfCode = shelfInDb.ShelfCode,
GroupName = shelfInDb.GroupName,
};
case 2:
return new SingleLightShelf(shelfInDb)
{
ShelfId = shelfInDb.Id,
ShelfCode = shelfInDb.ShelfCode,
GroupName = shelfInDb.GroupName,
};
case 3:
return new SmartShelf(shelfInDb)
{
ShelfId = shelfInDb.Id,
ShelfCode = shelfInDb.ShelfCode,
GroupName = shelfInDb.GroupName,
};
default:
return null;
}
return null;
}
}
}

View File

@ -32,7 +32,7 @@ namespace WCS.BLL.Manager
.Select(t => new
{
IP = t.ClientIp,
ShelfTypeName = t.ShelfTypeName,
ShelfTypeName = t.ShelfType,
Port = t.Port,
})
.Distinct()
@ -220,10 +220,6 @@ namespace WCS.BLL.Manager
var shelfInfo = DbHelp.db.Queryable<ShelfInfo>().Where(t => t.ClientIp == tcpClient.RemoteIPHost).ToList();
if (shelfInfo.Count != 0)
{
if (shelfInfo[0].ShelfTypeName == "信息化货架")
{
return;
}
}
Task.Run(() =>

View File

@ -30,7 +30,6 @@ namespace WCS.BLL.Services.Service
try
{
var recordsQueryable = DbHelp.db.Queryable<ShelfInfo>()
.WhereIF(request.ShelfTypeId != 0, t => t.ShelfTypeId == request.ShelfTypeId)
.WhereIF(!string.IsNullOrEmpty(request.ShelfCode), t => t.ShelfCode.Contains(request.ShelfCode));
var totalCount = await recordsQueryable.CountAsync();
@ -101,8 +100,6 @@ namespace WCS.BLL.Services.Service
else
{
shelfnfo.ShelfCode = request.ShelfInfo.ShelfCode;
shelfnfo.ShelfTypeId = request.ShelfInfo.ShelfTypeId;
shelfnfo.ShelfTypeName = request.ShelfInfo.ShelfTypeName;
shelfnfo.Rowcounts = request.ShelfInfo.Rowcounts;
shelfnfo.Columncounts = request.ShelfInfo.Columncounts;
shelfnfo.LightId = request.ShelfInfo.LightId;
@ -148,8 +145,6 @@ namespace WCS.BLL.Services.Service
var newShelfInfo = new ShelfInfo()
{
ShelfCode = request.ShelfInfo.ShelfCode,
ShelfTypeId = request.ShelfInfo.ShelfTypeId,
ShelfTypeName = request.ShelfInfo.ShelfTypeName,
Rowcounts = request.ShelfInfo.Rowcounts,
Columncounts = request.ShelfInfo.Columncounts,
LightId = request.ShelfInfo.LightId,