|
@@ -1,5 +1,6 @@
|
|
|
using ServiceCenter.Extensions;
|
|
|
using ServiceCenter.SqlSugars;
|
|
|
+using SqlSugar;
|
|
|
using System.ComponentModel;
|
|
|
using WCS.Core;
|
|
|
using WCS.Entity;
|
|
@@ -22,8 +23,6 @@ namespace WCS.WorkEngineering.Systems
|
|
|
{
|
|
|
protected override bool ParallelDo => true;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
public override void Do(Device<IStation520> objDev)
|
|
|
{
|
|
|
var lastIsTruss = objDev.Entity.GetFlag<bool>("LastIsTruss");
|
|
@@ -119,6 +118,21 @@ namespace WCS.WorkEngineering.Systems
|
|
|
var ringTask = db.Queryable<WCS_TaskInfo>().NoLock().First(x => x.Type == TaskType.OutDepot && x.Status <= TaskStatus.WaitingToExecute && x.SrmStation == obj.Entity.Code);
|
|
|
if (ringTask == null)
|
|
|
{
|
|
|
+ var code = obj.Entity.Code.GetWareCode();
|
|
|
+ var wareHouse = db.Queryable<BaseWarehouse>().First(x => x.Code == code);
|
|
|
+ if (wareHouse == null)
|
|
|
+ {
|
|
|
+ World.Log($"无对应仓库--[{code}]");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //检查是否有满跺记录
|
|
|
+ var ringPalletizingInfo = db.Queryable<BillRingPalletizingInfo>().Where(x => x.WareHouseId == wareHouse.Id && x.HaveQty > 0 && !x.Out).ToList()
|
|
|
+ .OrderBy(x => x.AddTime).FirstOrDefault(x => x.HaveQty == x.HWCountQty || x.AddTime < DateTime.Now.AddHours(-6));
|
|
|
+ if (ringPalletizingInfo == null)
|
|
|
+ {
|
|
|
+ World.Log("无满跺码垛信息");
|
|
|
+ return;
|
|
|
+ }
|
|
|
//开始申请码垛任务
|
|
|
var resData = WmsApi.ApplyPalletizingStockOut(obj.Entity.Code, obj.Entity.Sources.Single(x => x.HasFlag(DeviceFlags.Robot)).Code);
|
|
|
if (resData.ResCode != ResponseStatusCodeEnum.Sucess)
|
|
@@ -173,4 +187,98 @@ namespace WCS.WorkEngineering.Systems
|
|
|
return dev.Code == nameof(PalletizCreateEmptyTray);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 环形库码垛缓存信息
|
|
|
+ [Tenant("fj")]
|
|
|
+ [SugarTable("Bill_RingPalletizingInfo")]
|
|
|
+ public class BillRingPalletizingInfo : BaseModel
|
|
|
+ {
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 仓库ID
|
|
|
+ [SugarColumn(IsNullable = false, ColumnDescription = "仓库ID")]
|
|
|
+ public long WareHouseId { get; set; }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 任务
|
|
|
+ [Navigate(NavigateType.OneToOne, "WareHouseId")]
|
|
|
+ public BaseWarehouse WareHouse { get; set; }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 垛形主表ID
|
|
|
+ [SugarColumn(IsNullable = false, ColumnDescription = "垛形主表ID")]
|
|
|
+ public long BomSetGrpId { get; set; }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 工字轮个数
|
|
|
+ [SugarColumn(ColumnDataType = "int", IsNullable = false, ColumnDescription = "工字轮个数")]
|
|
|
+ public int HWCountQty { get; set; }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // BomCode(投料信息)/物料号
|
|
|
+ [SugarColumn(ColumnDataType = "nvarchar", Length = 200, IsNullable = false, ColumnDescription = "BomCode(投料信息)")]
|
|
|
+ public string BomCode { get; set; }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 已有工字轮个数
|
|
|
+ [SugarColumn(ColumnDataType = "int", IsNullable = false, ColumnDescription = "已有工字轮个数")]
|
|
|
+ public int HaveQty { get; set; }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 是否出库
|
|
|
+ [SugarColumn(IsNullable = false, ColumnDescription = "是否出库")]
|
|
|
+ public bool Out { get; set; }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 上一次分配时的放置位信息
|
|
|
+ [SugarColumn(ColumnDataType = "int", IsNullable = true)]
|
|
|
+ public int LastXYNO { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 仓库表
|
|
|
+ [Tenant("fj")]
|
|
|
+ [SugarTable("Base_Warehouse")]
|
|
|
+ public class BaseWarehouse : BaseModel
|
|
|
+ {
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 是否停用
|
|
|
+ [SugarColumn(ColumnDataType = "int", IsNullable = false)]
|
|
|
+ public int IsStop { get; set; }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 编号
|
|
|
+ [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = false)]
|
|
|
+ public string Code { get; set; }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // 名称
|
|
|
+ [SugarColumn(ColumnDataType = "nvarchar", Length = 100, IsNullable = false)]
|
|
|
+ public string Name { get; set; }
|
|
|
+
|
|
|
+ ////
|
|
|
+ //// 摘要:
|
|
|
+ //// 类型
|
|
|
+ //[SugarColumn(IsNullable = false)]
|
|
|
+ //public FjLocationType TypeNum { get; set; }
|
|
|
+
|
|
|
+ //
|
|
|
+ // 摘要:
|
|
|
+ // ConfigId
|
|
|
+ [SugarColumn(ColumnName = "ConfigId", ColumnDescription = "ConfigId")]
|
|
|
+ public long ConfigId { get; set; }
|
|
|
+ }
|
|
|
}
|