| | |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using Topshelf; |
| | | using static System.Net.Mime.MediaTypeNames; |
| | | using Monitor = HH.WCS.QingXigongchang.core.Monitor; |
| | | |
| | | namespace HH.WCS.QingXigongchang |
| | |
| | | #endregion |
| | | |
| | | var uuu16 = "TN" + (DateTime.Now.ToString("yy")) + ((6180010 + "").PadLeft(8, '0')); |
| | | |
| | | Console.WriteLine(uuu16); |
| | | |
| | | switch ("") |
| | | { |
| | | case var _ when true: |
| | | { |
| | | |
| | | } |
| | | break; |
| | | default: break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | var orders = WCSHelper.GetWorkOrder2(); |
| | | var thisOrder = orders.Find(x => x.SQL_WorkNo == WorkNo); |
| | | LogHelper.Info("移库解锁 --当前工单 sid:" + thisOrder?.S_ID); |
| | | if (thisOrder != null) |
| | | { |
| | | var other = orders.Find(x => x.SQL_WorkNo != WorkNo && x.start_area == thisOrder.start_area && x.start_row == thisOrder.start_row); |
| | | LogHelper.Info($"移库解锁 --其他工单 x.start_area == {thisOrder.start_area} start_row == {thisOrder.start_row} SID:" + other?.S_ID); |
| | | if (other != null) |
| | | j解锁起点库区排 = false; |
| | | } |
| | | var allarea_rows = orders.FindAll(x => x.S_ID != thisOrder.S_ID && x.start_area == thisOrder.start_area && x.start_row == thisOrder.start_row); |
| | | LogHelper.Info("移库解锁 --当前工单 的同库区排 其他工单:" + JsonConvert.SerializeObject(allarea_rows)); |
| | | if (allarea_rows.Any()) |
| | | j解锁起点库区排 = false; |
| | | //if (thisOrder != null) |
| | | //{ |
| | | // var other = orders.Find(x => x.SQL_WorkNo != WorkNo && x.start_area == thisOrder.start_area && x.start_row == thisOrder.start_row); |
| | | // LogHelper.Info($"移库解锁 --其他工单 x.start_area == {thisOrder.start_area} start_row == {thisOrder.start_row} SID:" + other?.S_ID); |
| | | // if (other != null) |
| | | // j解锁起点库区排 = false; |
| | | //} |
| | | } |
| | | //if (sign == 1) |
| | | //{ |
| | |
| | | var info = db.Queryable<KuRong>().First(); |
| | | if (info == null || DateTime.Now.Subtract(info.T_MODIFY).TotalMinutes > min) |
| | | { |
| | | db.Deleteable<KuRong>().ExecuteCommand(); |
| | | info = null; |
| | | |
| | | //1、查到小板库区下面所有的库位 |
| | | var totalX = 0; |
| | | var totalRows = 0; |
| | |
| | | } |
| | | var totalDesiredCapacity = ordersCount * 4 * 3 * (totalX / totalRows); |
| | | LogHelper.Error($"成品小板区总货位是{totalX},总排数是{totalRows},当前执行工单数量是{ordersCount}", new Exception("Kurong")); |
| | | var totalAvailableCapacity = list.Sum(a => a.AvailableCapacity); |
| | | var totalAssignableCapacity = totalAvailableCapacity - totalDesiredCapacity; |
| | | list.ForEach(a => { a.DesiredCapacity = totalDesiredCapacity; a.CRC = totalAvailableCapacity; a.RAC = totalAssignableCapacity; }); |
| | | //var totalAvailableCapacity = list.Sum(a => a.AvailableCapacity); |
| | | //var totalAssignableCapacity = totalAvailableCapacity - totalDesiredCapacity; |
| | | //list.ForEach(a => { a.DesiredCapacity = totalDesiredCapacity; a.CRC = totalAvailableCapacity; a.RAC = totalAssignableCapacity; }); |
| | | var totalAvailableCapacity = list.Sum(a => a.MaxCapacity);// AvailableCapacity); |
| | | var DRC = list.Sum(x => x.FilledCapacity); |
| | | var totalAssignableCapacity = totalAvailableCapacity - DRC - totalDesiredCapacity; |
| | | var BAC = list.Sum(x => x.AvailableCapacity); |
| | | list.ForEach(a => |
| | | { |
| | | a.DesiredCapacity = totalDesiredCapacity; |
| | | a.CRC = totalAvailableCapacity; |
| | | a.RAC = totalAssignableCapacity; |
| | | a.BAC = BAC; |
| | | a.DRC = DRC; |
| | | }); |
| | | if (info == null) |
| | | { |
| | | /*SQL Server 1000 条/批次 单个 INSERT 语句最多支持 1000 条 VALUES 子句,超出会报语法错误。*/ |
| | |
| | | LogHelper.Info($"{plc.deviceName}-{workOrder.SQL_WorkNo}链接的产线号{LineTo} BolArea 未配置。"); |
| | | goto ______label____end; |
| | | } |
| | | bitslocs = LocationHelper.GetAreaNormalLocList(ba.UsingBolArea, true, false); |
| | | bitslocs = LocationHelper.GetAreaNormalLocList(ba.UsingBolArea); |
| | | |
| | | //var bits = Settings.GetInStockCacheList().Where(a => a.deviceName == _t)?.Select(x => x.location); |
| | | //bitslocs = LocationHelper.GetAllLocList().Where(x => bits.Contains(x.S_LOC_CODE.Trim())).ToList(); |
| | |
| | | [SuGG("库容表")] |
| | | public class KuRong : BaseModel |
| | | { |
| | | /// <summary> |
| | | /// 库位 |
| | | /// </summary> |
| | | public string StorageLoc { get; set; } |
| | | /// <summary> |
| | | /// AGV总库容 |
| | | /// </summary> |
| | | public int MaxCapacity { get; set; } |
| | | /// <summary> |
| | | /// 已占库容 |
| | | /// </summary> |
| | | public int FilledCapacity { get; set; } |
| | | /// <summary> |
| | | /// 品相 |
| | | /// </summary> |
| | | public string ProductItem { get; set; } |
| | | /// <summary> |
| | | /// 剩余库容量 |
| | | /// </summary> |
| | | public int AvailableCapacity { get; set; } |
| | | /// <summary> |
| | | /// agv所需库容。 |
| | | /// </summary> |
| | | public int DesiredCapacity { get; set; } |
| | | /// <summary> |
| | | /// 仓库总库容。 |
| | | /// </summary> |
| | | public int CRC { get; set; } |
| | | /// <summary> |
| | | /// 剩余空库容。 |
| | | /// </summary> |
| | | public int RAC { get; set; } |
| | | /// <summary> |
| | | /// 已占库容的和。 |
| | | /// </summary> |
| | | public int DRC { get; set; } |
| | | /// <summary> |
| | | /// 仓库剩余总库容。 |
| | | /// </summary> |
| | | public int BAC { get; set; } |
| | | } |
| | | //均州现场 |
| | | //[SugarTable("dbo.")] |