diff --git a/SlnMesnac.Business/ProdCompletionBusiness.cs b/SlnMesnac.Business/ProdCompletionBusiness.cs index 7ec99a2..d1de98e 100644 --- a/SlnMesnac.Business/ProdCompletionBusiness.cs +++ b/SlnMesnac.Business/ProdCompletionBusiness.cs @@ -80,7 +80,7 @@ namespace SlnMesnac.Business _mesProductOrderService = serviceProvider.GetRequiredService(); _baseMaterialInfoService = serviceProvider.GetRequiredService(); Init(); - + } private void test() @@ -282,7 +282,6 @@ namespace SlnMesnac.Business _logger.LogInformation("小包出口已经有RFID了,无需再读"); Thread.Sleep(5000); continue; - } string epcStr = await ReadEpcStrByRfidKeyAsync("secondFloorOut"); @@ -317,6 +316,18 @@ namespace SlnMesnac.Business } } + + // 校验该epc是否已经存在库存里,有的话重新读 + + + var hasLocation = sqlSugarClient.AsTenant().GetConnection("mes").Queryable().Where(x => x.ContainerCode == epcStr).First(); + if (hasLocation != null) + { + _logger.LogError("小包出口到位信号触发,读取RFID失败,该epc已经存在库存里:" + epcStr); + Thread.Sleep(5000); + continue; + } + RefreshMessage($"小包出口读取到RFID条码{epcStr},开始绑定流程:"); _mesProductPlanService.GetStartedProdPlan(out MesProductPlanDto productPlanDto); diff --git a/SlnMesnac.Model/domain/BaseLocation.cs b/SlnMesnac.Model/domain/BaseLocation.cs new file mode 100644 index 0000000..3f58f44 --- /dev/null +++ b/SlnMesnac.Model/domain/BaseLocation.cs @@ -0,0 +1,258 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +#region << 鐗 鏈 娉 閲 >> +/*-------------------------------------------------------------------- +* 鐗堟潈鎵鏈 (c) 2024 WenJY 淇濈暀鎵鏈夋潈鍒┿ +* CLR鐗堟湰锛4.0.30319.42000 +* 鏈哄櫒鍚嶇О锛歀APTOP-E0N2L34V +* 鍛藉悕绌洪棿锛歋lnMesnac.Model.domain +* 鍞竴鏍囪瘑锛歛4dbd270-62c5-47db-a5f7-7e7cb895d15a +* +* 鍒涘缓鑰咃細WenJY +* 鐢靛瓙閭锛歸enjy@mesnac.com +* 鍒涘缓鏃堕棿锛2024-04-07 16:55:22 +* 鐗堟湰锛歏1.0.0 +* 鎻忚堪锛 +* +*-------------------------------------------------------------------- +* 淇敼浜猴細 +* 鏃堕棿锛 +* 淇敼璇存槑锛 +* +* 鐗堟湰锛歏1.0.0 +*--------------------------------------------------------------------*/ +#endregion << 鐗 鏈 娉 閲 >> +namespace SlnMesnac.Model.domain +{ + /// + /// 搴撲綅淇℃伅 + /// + [SugarTable("wms_base_location"), TenantAttribute("mes")] + public class BaseLocation + { + /// + /// 搴撲綅ID + /// + [SugarColumn(ColumnName = "location_id", IsPrimaryKey = true, IsIdentity = true)] + public long LocationId { get; set; } + + /// + /// 浠撳簱ID + /// + [SugarColumn(ColumnName = "warehouse_id")] + public long WarehouseId { get; set; } + + /// + /// AGV浣嶇疆缂栫爜 + /// + [SugarColumn(ColumnName = "agv_position_code")] + public string AgvPositionCode { get; set; } + + /// + /// 浠撳簱妤煎眰 + /// + [SugarColumn(ColumnName = "warehouse_floor")] + public int WarehouseFloor { get; set; } + + /// + /// 搴撲綅缂栫爜 + /// + [SugarColumn(ColumnName = "location_code")] + public string LocationCode { get; set; } + + /// + /// 瀹瑰櫒缂栫爜 + /// + [SugarColumn(ColumnName = "container_code")] + public string ContainerCode { get; set; } + + /// + /// 琛屽彿 + /// + [SugarColumn(ColumnName = "loc_row")] + public int? LocRow { get; set; } + + /// + /// 鍒楀彿 + /// + [SugarColumn(ColumnName = "loc_column")] + public int? LocColumn { get; set; } + + /// + /// 灞傚彿 + /// + [SugarColumn(ColumnName = "layer_num")] + public int? LayerNum { get; set; } + + /// + /// 娣卞害 + /// + [SugarColumn(ColumnName = "loc_deep")] + public int? LocDeep { get; set; } + + /// + /// 婵娲绘爣蹇 + /// + [SugarColumn(ColumnName = "active_flag")] + public string ActiveFlag { get; set; } + + /// + /// 鎵嬪姩鏍囧織 + /// + [SugarColumn(ColumnName = "manual_flag")] + public string ManualFlag { get; set; } + + /// + /// 杩斿洖鏍囧織 + /// + [SugarColumn(ColumnName = "return_flag")] + public string ReturnFlag { get; set; } + + /// + /// 鏁伴噺闄愬埗 + /// + [SugarColumn(ColumnName = "qty_limit")] + public decimal? QtyLimit { get; set; } + + /// + /// 鍏ュ簱鏍囧織 + /// + [SugarColumn(ColumnName = "instock_flag")] + public string InstockFlag { get; set; } + + /// + /// 鍑哄簱鏍囧織 + /// + [SugarColumn(ColumnName = "outstock_flag")] + public string OutstockFlag { get; set; } + + /// + /// 搴撲綅鐘舵 + /// + [SugarColumn(ColumnName = "location_status")] + public string LocationStatus { get; set; } + + /// + /// 鎵规娣峰悎 + /// + [SugarColumn(ColumnName = "batch_mix")] + public string BatchMix { get; set; } + + /// + /// 鍒涘缓鑰 + /// + [SugarColumn(ColumnName = "create_by")] + public string CreateBy { get; set; } + + /// + /// 鍒涘缓鏃堕棿 + /// + [SugarColumn(ColumnName = "create_time")] + public DateTime? CreateTime { get; set; } + + /// + /// 鏇存柊鑰 + /// + [SugarColumn(ColumnName = "update_by")] + public string UpdateBy { get; set; } + + /// + /// 鏇存柊鏃堕棿 + /// + [SugarColumn(ColumnName = "update_time")] + public DateTime? UpdateTime { get; set; } + + /// + /// 澶囨敞 + /// + [SugarColumn(ColumnName = "remark")] + public string Remark { get; set; } + + /// + /// 鍒犻櫎鏍囧織 + /// + [SugarColumn(ColumnName = "del_flag")] + public string DelFlag { get; set; } + + /// + /// 璐ф灦鎺掑簭 + /// + [SugarColumn(ColumnName = "shelf_order")] + public string ShelfOrder { get; set; } + + /// + /// 妫鏌ユ帓搴 + /// + [SugarColumn(ColumnName = "check_order")] + public string CheckOrder { get; set; } + + /// + /// 鎷h揣鎺掑簭 + /// + [SugarColumn(ColumnName = "pick_order")] + public string PickOrder { get; set; } + + /// + /// 鎷h揣鏍囧織 + /// + [SugarColumn(ColumnName = "pick_flag")] + public string PickFlag { get; set; } + + /// + /// 寮绠辨爣蹇 + /// + [SugarColumn(ColumnName = "is_open_kn_flag")] + public string IsOpenKnFlag { get; set; } + + /// + /// 搴撲綅鎶ュ簾绫诲瀷 + /// + [SugarColumn(ColumnName = "location_scrap_type")] + public string LocationScrapType { get; set; } + + /// + /// 浣撶Н闄愬埗 + /// + [SugarColumn(ColumnName = "volume_limit")] + public decimal? VolumeLimit { get; set; } + + /// + /// 閲嶉噺闄愬埗 + /// + [SugarColumn(ColumnName = "weight_limit")] + public decimal? WeightLimit { get; set; } + + /// + /// 闀垮害 + /// + [SugarColumn(ColumnName = "length")] + public decimal? Length { get; set; } + + /// + /// 瀹藉害 + /// + [SugarColumn(ColumnName = "width")] + public decimal? Width { get; set; } + + /// + /// 楂樺害 + /// + [SugarColumn(ColumnName = "height")] + public decimal? Height { get; set; } + + /// + /// 瀹瑰櫒鐘舵 + /// + [SugarColumn(ColumnName = "container_status")] + public string ContainerStatus { get; set; } + + /// + /// 寮傚父鎻忚堪 + /// + [SugarColumn(ColumnName = "exception_desc")] + public string ExceptionDesc { get; set; } + } +} \ No newline at end of file