提交
This commit is contained in:
@ -11,7 +11,6 @@ namespace WCS.DAL.DbModels
|
|||||||
[SugarTable("wcs_shelf_info")]
|
[SugarTable("wcs_shelf_info")]
|
||||||
public class ShelfInfo
|
public class ShelfInfo
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 主键 自增Id
|
/// 主键 自增Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -19,34 +18,17 @@ namespace WCS.DAL.DbModels
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货架编码;货架一般按照报警灯来区分 一个报警灯指示的是一个货架
|
/// 货架编码
|
||||||
/// </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; }
|
public string ShelfCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 货架类型Id
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnName = "shelf_type_id", IsNullable = false, ColumnDescription = "货架类型Id")]
|
|
||||||
public int ShelfTypeId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货架类型名称
|
/// 货架类型名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "shelf_type_name", Length = 50, IsNullable = false, ColumnDescription = "货架类型名称")]
|
[SugarColumn(ColumnName = "shelf_type", Length = 50, IsNullable = false, ColumnDescription = "货架类型")]
|
||||||
public string ShelfTypeName { get; set; }
|
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>
|
/// <summary>
|
||||||
/// 货架行数
|
/// 货架行数
|
||||||
|
@ -911,18 +911,7 @@ namespace WCS.BLL.HardWare
|
|||||||
|
|
||||||
public void SetCurrentMode(Mode mode)
|
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()
|
void IShelfBase.Warning()
|
||||||
|
@ -37,32 +37,7 @@ namespace WCS.BLL.Manager
|
|||||||
|
|
||||||
public static IShelfBase InitShelf(ShelfInfo shelfInDb)
|
public static IShelfBase InitShelf(ShelfInfo shelfInDb)
|
||||||
{
|
{
|
||||||
switch (shelfInDb.ShelfTypeId)
|
return null;
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace WCS.BLL.Manager
|
|||||||
.Select(t => new
|
.Select(t => new
|
||||||
{
|
{
|
||||||
IP = t.ClientIp,
|
IP = t.ClientIp,
|
||||||
ShelfTypeName = t.ShelfTypeName,
|
ShelfTypeName = t.ShelfType,
|
||||||
Port = t.Port,
|
Port = t.Port,
|
||||||
})
|
})
|
||||||
.Distinct()
|
.Distinct()
|
||||||
@ -220,10 +220,6 @@ namespace WCS.BLL.Manager
|
|||||||
var shelfInfo = DbHelp.db.Queryable<ShelfInfo>().Where(t => t.ClientIp == tcpClient.RemoteIPHost).ToList();
|
var shelfInfo = DbHelp.db.Queryable<ShelfInfo>().Where(t => t.ClientIp == tcpClient.RemoteIPHost).ToList();
|
||||||
if (shelfInfo.Count != 0)
|
if (shelfInfo.Count != 0)
|
||||||
{
|
{
|
||||||
if (shelfInfo[0].ShelfTypeName == "信息化货架")
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
|
@ -30,7 +30,6 @@ namespace WCS.BLL.Services.Service
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var recordsQueryable = DbHelp.db.Queryable<ShelfInfo>()
|
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));
|
.WhereIF(!string.IsNullOrEmpty(request.ShelfCode), t => t.ShelfCode.Contains(request.ShelfCode));
|
||||||
|
|
||||||
var totalCount = await recordsQueryable.CountAsync();
|
var totalCount = await recordsQueryable.CountAsync();
|
||||||
@ -101,8 +100,6 @@ namespace WCS.BLL.Services.Service
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
shelfnfo.ShelfCode = request.ShelfInfo.ShelfCode;
|
shelfnfo.ShelfCode = request.ShelfInfo.ShelfCode;
|
||||||
shelfnfo.ShelfTypeId = request.ShelfInfo.ShelfTypeId;
|
|
||||||
shelfnfo.ShelfTypeName = request.ShelfInfo.ShelfTypeName;
|
|
||||||
shelfnfo.Rowcounts = request.ShelfInfo.Rowcounts;
|
shelfnfo.Rowcounts = request.ShelfInfo.Rowcounts;
|
||||||
shelfnfo.Columncounts = request.ShelfInfo.Columncounts;
|
shelfnfo.Columncounts = request.ShelfInfo.Columncounts;
|
||||||
shelfnfo.LightId = request.ShelfInfo.LightId;
|
shelfnfo.LightId = request.ShelfInfo.LightId;
|
||||||
@ -148,8 +145,6 @@ namespace WCS.BLL.Services.Service
|
|||||||
var newShelfInfo = new ShelfInfo()
|
var newShelfInfo = new ShelfInfo()
|
||||||
{
|
{
|
||||||
ShelfCode = request.ShelfInfo.ShelfCode,
|
ShelfCode = request.ShelfInfo.ShelfCode,
|
||||||
ShelfTypeId = request.ShelfInfo.ShelfTypeId,
|
|
||||||
ShelfTypeName = request.ShelfInfo.ShelfTypeName,
|
|
||||||
Rowcounts = request.ShelfInfo.Rowcounts,
|
Rowcounts = request.ShelfInfo.Rowcounts,
|
||||||
Columncounts = request.ShelfInfo.Columncounts,
|
Columncounts = request.ShelfInfo.Columncounts,
|
||||||
LightId = request.ShelfInfo.LightId,
|
LightId = request.ShelfInfo.LightId,
|
||||||
|
Reference in New Issue
Block a user