From 425eece09731f69865e309af493d475aa26cf8a2 Mon Sep 17 00:00:00 2001 From: hehaibing-1996 Date: Fri, 10 Jan 2025 08:19:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WCS.BLL/DbModels/STZL/AgvTask.cs | 100 +++++++++++ WCS.BLL/DbModels/{ => STZL}/AppVersion.cs | 0 WCS.BLL/DbModels/STZL/LocationInfo.cs | 86 +++++++++ WCS.BLL/DbModels/{ => STZL}/MatBaseInfo.cs | 46 ++--- WCS.BLL/DbModels/STZL/MatDetailCurrentInfo.cs | 117 ++++++++++++ WCS.BLL/DbModels/STZL/MatDetailHistoryInfo.cs | 130 ++++++++++++++ .../DbModels/STZL/MatDetailStocktakingInfo.cs | 135 ++++++++++++++ WCS.BLL/DbModels/STZL/ShelfInfo.cs | 118 +++++++++++++ WCS.BLL/DbModels/ShelfInfo.cs | 99 ----------- WCS.BLL/HardWare/SingleLightShelf.cs | 8 +- WCS.BLL/HardWare/SmartShelf.cs | 10 +- WCS.BLL/Manager/ShelfManager.cs | 4 +- WCS.BLL/Manager/TCPClientManager.cs | 167 +----------------- WCS.BLL/Services/Service/GenerateService.cs | 135 +++++++------- WCS.BLL/Services/Service/HomerService.cs | 3 - WCS.BLL/Services/Service/StoreInfoService.cs | 26 +-- 16 files changed, 777 insertions(+), 407 deletions(-) create mode 100644 WCS.BLL/DbModels/STZL/AgvTask.cs rename WCS.BLL/DbModels/{ => STZL}/AppVersion.cs (100%) create mode 100644 WCS.BLL/DbModels/STZL/LocationInfo.cs rename WCS.BLL/DbModels/{ => STZL}/MatBaseInfo.cs (63%) create mode 100644 WCS.BLL/DbModels/STZL/MatDetailCurrentInfo.cs create mode 100644 WCS.BLL/DbModels/STZL/MatDetailHistoryInfo.cs create mode 100644 WCS.BLL/DbModels/STZL/MatDetailStocktakingInfo.cs create mode 100644 WCS.BLL/DbModels/STZL/ShelfInfo.cs delete mode 100644 WCS.BLL/DbModels/ShelfInfo.cs diff --git a/WCS.BLL/DbModels/STZL/AgvTask.cs b/WCS.BLL/DbModels/STZL/AgvTask.cs new file mode 100644 index 0000000..d5ebdfb --- /dev/null +++ b/WCS.BLL/DbModels/STZL/AgvTask.cs @@ -0,0 +1,100 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WCS.DAL.DbModels; + +namespace WCS.BLL.DbModels +{ + /// + /// 当前库存存量表 + /// + [SugarTable("wcs_agv_task")] + public class AgvTask + { + /// + /// 主键 自增Id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] + public int Id { get; set; } + + #region 任务属性 + /// + /// 请求任务时的任务号 需要保证唯一性 + /// + [SugarColumn(ColumnName = "request_code", Length = 64, IsNullable = false, ColumnDescription = "请求任务时的任务号 需要保证唯一性")] + public string RequestCode { get; set; } = Guid.NewGuid().ToString(); + + /// + /// 任务类型 + /// + [SugarColumn(ColumnName = "task_type", Length = 64, IsNullable = false, ColumnDescription = "任务类型")] + public string TaskType { get; set; } = string.Empty; + + /// + /// 货架ID + /// + [SugarColumn(ColumnName = "start_location_id", IsNullable = true, ColumnDescription = "起点位置ID")] + public int StratLocationId { get; set; } = 0; + /// + /// 起点位置编码 + /// + [SugarColumn(ColumnName = "start_location_code", Length = 64, IsNullable = true, ColumnDescription = "起点位置编码")] + public string StartLocationCode { get; set; } = string.Empty ; + + /// + /// 货架ID + /// + [SugarColumn(ColumnName = "end_location_id", IsNullable = true, ColumnDescription = "终点位置ID")] + public int EndLocationId { get; set; } = 0; + /// + /// 终点位置编码 + /// + [SugarColumn(ColumnName = "end_location_code", Length = 64, IsNullable = true, ColumnDescription = "终点位置编码")] + public string EndLocationCode { get; set; } = string.Empty; + + /// + /// AGV编号 + /// + [SugarColumn(ColumnName = "agv_code", Length = 64, IsNullable = true, ColumnDescription = "AGV编号")] + public string AgvCode { get; set; } = string.Empty; + + /// + /// 任务发起人 + /// + [SugarColumn(ColumnName = "create_user", IsNullable = true, Length = 64, ColumnDescription = "任务发起人")] + public string? CreateUser { get; set; } + + /// + /// 任务创建时间 + /// + [SugarColumn(ColumnName = "create_time", IsNullable = true, ColumnDescription = "任务创建时间")] + public DateTime? CreateTime { get; set; } = DateTime.Now; + + #endregion + + /// + /// 序号 + /// + [SugarColumn(IsIgnore = true)] + public int RowNumber { get; set; } + + /// + /// 是否已经选择 + /// + [SugarColumn(IsIgnore = true)] + public bool IsSelected { get; set; } + } + + //1-已创建,2-正在执行,5-取消完成,9-已结束, 10-被打断 + public enum TaskStatusEnum + { + 已创建 = 1, + 正在执行 = 2, + 取消完成 = 5, + 已结束 = 9, + 被打断 = 10, + } +} diff --git a/WCS.BLL/DbModels/AppVersion.cs b/WCS.BLL/DbModels/STZL/AppVersion.cs similarity index 100% rename from WCS.BLL/DbModels/AppVersion.cs rename to WCS.BLL/DbModels/STZL/AppVersion.cs diff --git a/WCS.BLL/DbModels/STZL/LocationInfo.cs b/WCS.BLL/DbModels/STZL/LocationInfo.cs new file mode 100644 index 0000000..24e9479 --- /dev/null +++ b/WCS.BLL/DbModels/STZL/LocationInfo.cs @@ -0,0 +1,86 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WCS.BLL.HardWare; + +namespace WCS.DAL.DbModels +{ + [SugarTable("wcs_location_info")] + public class LocationInfo + { + /// + /// 主键 自增Id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 位置编码 + /// + [SugarColumn(ColumnName = "location_code", Length = 64, IsNullable = false, ColumnDescription = "位置编码")] + public string LocationCode { get; set; } + + /// + /// 位置区域 + /// + [SugarColumn(ColumnName = "location_area", Length = 64, IsNullable = false, ColumnDescription = "位置区域")] + public string LocationArea { get; set; } + + /// + /// RCS库位编号 + /// + [SugarColumn(ColumnName = "rcs_store_code", Length = 64, IsNullable = true, ColumnDescription = "RCS库位编号")] + public string RcsStoreCode { get; set; } + + /// + /// 可放置货架类型 + /// + [SugarColumn(ColumnName = "allow_shelf_types", Length = 512, IsNullable = true, ColumnDescription = "可放置货架类型")] + public string AllowShelfTypes { get; set; } + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "modify_user", Length = 128, IsNullable = true, ColumnDescription = "更新人")] + public string ModifyUser { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "modify_time", IsNullable = false, ColumnDescription = "更新时间")] + public DateTime ModifyTime { get; set; } = DateTime.Now; + + /// + /// 是否启用 + /// + [SugarColumn(ColumnName = "is_enable", IsNullable = false, ColumnDescription = "是否启用")] + public bool IsEnable { get; set; } = true; + + [SugarColumn(IsIgnore = true)] + public string IsEnableStr + { + get + { + if (IsEnable) + return "启用"; + else + return "禁用"; + } + } + + /// + /// 序号 + /// + [SugarColumn(IsIgnore = true)] + public int RowNumber { get; set; } + + /// + /// 是否已经选择 + /// + [SugarColumn(IsIgnore = true)] + public bool IsSelected { get; set; } + } +} diff --git a/WCS.BLL/DbModels/MatBaseInfo.cs b/WCS.BLL/DbModels/STZL/MatBaseInfo.cs similarity index 63% rename from WCS.BLL/DbModels/MatBaseInfo.cs rename to WCS.BLL/DbModels/STZL/MatBaseInfo.cs index 2b1b4a4..3b92e3d 100644 --- a/WCS.BLL/DbModels/MatBaseInfo.cs +++ b/WCS.BLL/DbModels/STZL/MatBaseInfo.cs @@ -13,73 +13,49 @@ namespace WCS.BLL.DbModels [SugarTable("wcs_mat_base_info")] public partial class MatBaseInfo { + /// - /// Desc: - /// Default: - /// Nullable:False - /// + /// ID + /// [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] public int Id { get; set; } /// /// 物料编码 /// - [SugarColumn(ColumnName = "mat_code", Length = 100, IsNullable = false, ColumnDescription = "物料编号")] + [SugarColumn(ColumnName = "mat_code", Length = 128, IsNullable = false, ColumnDescription = "物料编码")] public string MatCode { get; set; } + /// /// 物料名称 /// - [SugarColumn(ColumnName = "mat_name", Length = 150, IsNullable = false, ColumnDescription = "物料名称")] + [SugarColumn(ColumnName = "mat_name", Length = 128, IsNullable = false, ColumnDescription = "物料名称")] public string MatName { get; set; } /// /// 物料规格 /// - [SugarColumn(ColumnName = "mat_spec", Length = 150, IsNullable = true, ColumnDescription = "物料规格")] + [SugarColumn(ColumnName = "mat_spec", Length = 128, IsNullable = true, ColumnDescription = "物料规格")] public string? MatSpec { get; set; } /// - /// Desc:物料单位 - /// Default: - /// Nullable:True + /// 物料单位 /// - [SugarColumn(ColumnName = "mat_unit", Length = 100, IsNullable = true, ColumnDescription = "物料单位")] + [SugarColumn(ColumnName = "mat_unit", Length = 64, IsNullable = true, ColumnDescription = "物料单位")] public string? MatUnit { get; set; } - /// - /// 物料批次 - /// - [SugarColumn(ColumnName = "mat_batch", Length = 150, IsNullable = true, ColumnDescription = "物料批次")] - public string? MatBatch { get; set; } - /// /// 物料供应商 /// - [SugarColumn(ColumnName = "mat_supplier", Length = 150, IsNullable = true, ColumnDescription = "物料供应商")] + [SugarColumn(ColumnName = "mat_supplier", Length = 128, IsNullable = true, ColumnDescription = "物料供应商")] public string? MatSupplier { get; set; } /// /// 物料客户 /// - [SugarColumn(ColumnName = "mat_customer", Length = 150, IsNullable = true, ColumnDescription = "物料客户")] + [SugarColumn(ColumnName = "mat_customer", Length = 128, IsNullable = true, ColumnDescription = "物料客户")] public string? MatCustomer { get; set; } - /// - /// 默认数量 - /// - [SugarColumn(ColumnName = "default_qty", IsNullable = false, ColumnDescription = "默认数量")] - public int DefaultQty { get; set; } = 1000; - /// - /// 默认盘数 - /// - [SugarColumn(ColumnName = "default_count", IsNullable = false, ColumnDescription = "默认盘数")] - public int DefaultCount { get; set; } = 100; - - /// - /// 当前序列号 - /// - [SugarColumn(ColumnName = "serial_number", IsNullable = false, DefaultValue = "0", ColumnDescription = "默认盘数")] - public int SerialNumber { get; set; } = 0; /// /// Desc:更新人 diff --git a/WCS.BLL/DbModels/STZL/MatDetailCurrentInfo.cs b/WCS.BLL/DbModels/STZL/MatDetailCurrentInfo.cs new file mode 100644 index 0000000..3995e10 --- /dev/null +++ b/WCS.BLL/DbModels/STZL/MatDetailCurrentInfo.cs @@ -0,0 +1,117 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WCS.DAL.DbModels; + +namespace WCS.BLL.DbModels +{ + /// + /// 当前库存存量表 + /// + [SugarTable("wcs_mat_detail_current_info")] + public class MatDetailCurrentInfo + { + /// + /// 主键 自增Id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] + public int Id { get; set; } + + #region 货架属性 + /// + /// 货架ID + /// + [SugarColumn(ColumnName = "shelf_id", IsNullable = false, ColumnDescription = "货架ID")] + public int ShlefId { get; set; } + + /// + /// 货架编码 对应二维码 + /// + [SugarColumn(ColumnName = "shelf_code", Length = 64, IsNullable = false, ColumnDescription = "货架编码")] + public string ShelfCode { get; set; } + + /// + /// 货架类型 + /// + [SugarColumn(ColumnName = "shelf_type", Length = 64, IsNullable = true, ColumnDescription = "货架类型")] + public string ShelfType { get; set; } + + /// + /// 货架区域 + /// + [SugarColumn(ColumnName = "shelf_area", Length = 64, IsNullable = true, ColumnDescription = "货架区域")] + public string ShelfArea { get; set; } + + #endregion + + #region 物料属性 + /// + /// 物料编码 + /// + [SugarColumn(ColumnName = "mat_code", Length = 100, IsNullable = true, ColumnDescription = "物料编号")] + public string MatCode { get; set; } + /// + /// 物料名称 + /// + [SugarColumn(ColumnName = "mat_name", Length = 150, IsNullable = true, ColumnDescription = "物料名称")] + public string MatName { get; set; } + + /// + /// 物料规格 + /// + [SugarColumn(ColumnName = "mat_spec", Length = 150, IsNullable = true, ColumnDescription = "物料规格")] + public string MatSpec { get; set; } + + /// + /// 物料数量 + /// + [SugarColumn(ColumnName = "mat_qty", IsNullable = false, ColumnDescription = "物料数量")] + public int MatQty { get; set; } + + /// + /// 物料供应商 + /// + [SugarColumn(ColumnName = "mat_supplier", Length = 128, IsNullable = true, ColumnDescription = "物料供应商")] + public string? MatSupplier { get; set; } + + /// + /// 物料客户 + /// + [SugarColumn(ColumnName = "mat_customer", Length = 128, IsNullable = true, ColumnDescription = "物料客户")] + public string? MatCustomer { get; set; } + #endregion + + /// + /// 站位编号 用于物料批量绑定时区分是哪个工位绑定的明细 + /// + [SugarColumn(ColumnName = "station_code", Length = 64, IsNullable = true, ColumnDescription = "站位编号")] + public string StationCode { get; set; } + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "modify_user", IsNullable = true, Length = 50, ColumnDescription = "更新人")] + public string? ModifyUser { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "modify_time", IsNullable = true, ColumnDescription = "更新时间")] + public DateTime? ModifyTime { get; set; } = DateTime.Now; + + /// + /// 序号 + /// + [SugarColumn(IsIgnore = true)] + public int RowNumber { get; set; } + + /// + /// 是否已经选择 + /// + [SugarColumn(IsIgnore = true)] + public bool IsSelected { get; set; } + } +} diff --git a/WCS.BLL/DbModels/STZL/MatDetailHistoryInfo.cs b/WCS.BLL/DbModels/STZL/MatDetailHistoryInfo.cs new file mode 100644 index 0000000..4850247 --- /dev/null +++ b/WCS.BLL/DbModels/STZL/MatDetailHistoryInfo.cs @@ -0,0 +1,130 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WCS.DAL.DbModels; + +namespace WCS.BLL.DbModels +{ + /// + /// 当前库存盘点表 + /// + [SugarTable("wcs_mat_detail_history_info")] + public class MatDetailHistoryInfo + { + /// + /// 主键 自增Id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 货架库存明细当前的ID + /// + [SugarColumn(ColumnName = "mat_detail_current_id", IsNullable = false, ColumnDescription = "库存明细当前的ID")] + public int MatDetailCurrentId { get; set; } + + #region 货架属性 + /// + /// 货架ID + /// + [SugarColumn(ColumnName = "shelf_id", IsNullable = false, ColumnDescription = "货架ID")] + public int ShlefId { get; set; } + + /// + /// 货架编码 对应二维码 + /// + [SugarColumn(ColumnName = "shelf_code", Length = 64, IsNullable = false, ColumnDescription = "货架编码")] + public string ShelfCode { get; set; } + + /// + /// 货架类型 + /// + [SugarColumn(ColumnName = "shelf_type", Length = 64, IsNullable = true, ColumnDescription = "货架类型")] + public string ShelfType { get; set; } + + /// + /// 货架区域 + /// + [SugarColumn(ColumnName = "shelf_area", Length = 64, IsNullable = true, ColumnDescription = "货架区域")] + public string ShelfArea { get; set; } + + #endregion + + #region 物料属性 + /// + /// 物料编码 + /// + [SugarColumn(ColumnName = "mat_code", Length = 100, IsNullable = true, ColumnDescription = "物料编号")] + public string MatCode { get; set; } + /// + /// 物料名称 + /// + [SugarColumn(ColumnName = "mat_name", Length = 150, IsNullable = true, ColumnDescription = "物料名称")] + public string MatName { get; set; } + + /// + /// 物料规格 + /// + [SugarColumn(ColumnName = "mat_spec", Length = 150, IsNullable = true, ColumnDescription = "物料规格")] + public string MatSpec { get; set; } + + /// + /// 物料数量(更新前物料数量) + /// + [SugarColumn(ColumnName = "before_qty", IsNullable = false, ColumnDescription = "物料数量(更新前物料数量)")] + public int BeforeQty { get; set; } + + /// + /// 物料数量(更新后物料数量) + /// + [SugarColumn(ColumnName = "after_qty", IsNullable = false, ColumnDescription = "物料数量(更新后物料数量)")] + public int AfterQty { get; set; } + + /// + /// 物料供应商 + /// + [SugarColumn(ColumnName = "mat_supplier", Length = 128, IsNullable = true, ColumnDescription = "物料供应商")] + public string? MatSupplier { get; set; } + + /// + /// 物料客户 + /// + [SugarColumn(ColumnName = "mat_customer", Length = 128, IsNullable = true, ColumnDescription = "物料客户")] + public string? MatCustomer { get; set; } + #endregion + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "modify_user", IsNullable = true, Length = 50, ColumnDescription = "更新人")] + public string? ModifyUser { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "modify_time", IsNullable = false, ColumnDescription = "更新时间")] + public DateTime? ModifyTime { get; set; } = DateTime.Now; + + /// + /// 是否已删除 + /// + [SugarColumn(ColumnName = "is_delete", IsNullable = false, ColumnDescription = "是否已删除")] + public bool IsDelete { get; set; } = false; + + /// + /// 序号 + /// + [SugarColumn(IsIgnore = true)] + public int RowNumber { get; set; } + + /// + /// 是否已经选择 + /// + [SugarColumn(IsIgnore = true)] + public bool IsSelected { get; set; } + } + +} diff --git a/WCS.BLL/DbModels/STZL/MatDetailStocktakingInfo.cs b/WCS.BLL/DbModels/STZL/MatDetailStocktakingInfo.cs new file mode 100644 index 0000000..e0b68d1 --- /dev/null +++ b/WCS.BLL/DbModels/STZL/MatDetailStocktakingInfo.cs @@ -0,0 +1,135 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WCS.DAL.DbModels; + +namespace WCS.BLL.DbModels +{ + /// + /// 当前库存盘点表 + /// + [SugarTable("wcs_mat_detail_stocktaking_info")] + public class MatDetailStocktakingInfo + { + /// + /// 主键 自增Id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 货架库存明细当前的ID + /// + [SugarColumn(ColumnName = "mat_detail_current_id", IsNullable = false, ColumnDescription = "库存明细当前的ID")] + public int MatDetailCurrentId { get; set; } + + #region 货架属性 + /// + /// 货架ID + /// + [SugarColumn(ColumnName = "shelf_id", IsNullable = false, ColumnDescription = "货架ID")] + public int ShlefId { get; set; } + + /// + /// 货架编码 对应二维码 + /// + [SugarColumn(ColumnName = "shelf_code", Length = 64, IsNullable = false, ColumnDescription = "货架编码")] + public string ShelfCode { get; set; } + + /// + /// 货架类型 + /// + [SugarColumn(ColumnName = "shelf_type", Length = 64, IsNullable = true, ColumnDescription = "货架类型")] + public string ShelfType { get; set; } + + /// + /// 货架区域 + /// + [SugarColumn(ColumnName = "shelf_area", Length = 64, IsNullable = true, ColumnDescription = "货架区域")] + public string ShelfArea { get; set; } + + #endregion + + #region 物料属性 + /// + /// 物料编码 + /// + [SugarColumn(ColumnName = "mat_code", Length = 100, IsNullable = true, ColumnDescription = "物料编号")] + public string MatCode { get; set; } + /// + /// 物料名称 + /// + [SugarColumn(ColumnName = "mat_name", Length = 150, IsNullable = true, ColumnDescription = "物料名称")] + public string MatName { get; set; } + + /// + /// 物料规格 + /// + [SugarColumn(ColumnName = "mat_spec", Length = 150, IsNullable = true, ColumnDescription = "物料规格")] + public string MatSpec { get; set; } + + /// + /// 物料数量(原始数量) + /// + [SugarColumn(ColumnName = "mat_qty", IsNullable = false, ColumnDescription = "物料数量(原始数量)")] + public int MatQty { get; set; } + + /// + /// 物料数量(盘点数量) + /// + [SugarColumn(ColumnName = "stocktaking_qty", IsNullable = false, ColumnDescription = "物料数量(盘点数量)")] + public int StocktakingQty { get; set; } + + /// + /// 物料供应商 + /// + [SugarColumn(ColumnName = "mat_supplier", Length = 128, IsNullable = true, ColumnDescription = "物料供应商")] + public string? MatSupplier { get; set; } + + /// + /// 物料客户 + /// + [SugarColumn(ColumnName = "mat_customer", Length = 128, IsNullable = true, ColumnDescription = "物料客户")] + public string? MatCustomer { get; set; } + #endregion + + /// + /// 盘点人 + /// + [SugarColumn(ColumnName = "stocktaking_user", IsNullable = false, Length = 50, ColumnDescription = "盘点人")] + public string? StocktakingUser { get; set; } + + /// + /// 盘点时间 + /// + [SugarColumn(ColumnName = "stocktaking_time", IsNullable = false, ColumnDescription = "盘点时间")] + public DateTime? StocktakingTime { get; set; } = DateTime.Now; + + /// + /// 盘点状态 + /// + [SugarColumn(ColumnName = "stocktaking_status", IsNullable = false, ColumnDescription = "盘点状态")] + public StocktakingStatusEnum StocktakingStatus { get; set; } = StocktakingStatusEnum.未提交; + + /// + /// 序号 + /// + [SugarColumn(IsIgnore = true)] + public int RowNumber { get; set; } + + /// + /// 是否已经选择 + /// + [SugarColumn(IsIgnore = true)] + public bool IsSelected { get; set; } + } + + public enum StocktakingStatusEnum + { + 未提交 = 0, + 已提交 = 1, + } +} diff --git a/WCS.BLL/DbModels/STZL/ShelfInfo.cs b/WCS.BLL/DbModels/STZL/ShelfInfo.cs new file mode 100644 index 0000000..bf1b586 --- /dev/null +++ b/WCS.BLL/DbModels/STZL/ShelfInfo.cs @@ -0,0 +1,118 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WCS.BLL.HardWare; + +namespace WCS.DAL.DbModels +{ + [SugarTable("wcs_shelf_info")] + public class ShelfInfo + { + /// + /// 主键 自增Id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 货架编码 对应二维码 + /// + [SugarColumn(ColumnName = "shelf_code", Length = 64, IsNullable = false, ColumnDescription = "货架编码")] + public string ShelfCode { get; set; } + + /// + /// 货架类型 + /// + [SugarColumn(ColumnName = "shelf_type", Length = 64, IsNullable = true, ColumnDescription = "货架类型")] + public string ShelfType { get; set; } + + /// + /// 货架状态 货架当前的状态空货架/非空货架 + /// + [SugarColumn(ColumnName = "shelf_status", IsNullable = true, ColumnDescription = "货架状态")] + public ShelfStatusEnum ShelfStatus { get; set; } = ShelfStatusEnum.空货架; + + /// + /// 货架区域 + /// + [SugarColumn(ColumnName = "shelf_area", Length = 64, IsNullable = true, ColumnDescription = "货架区域")] + public string ShelfArea { get; set; } + + /// + /// 货架尺寸 + /// + [SugarColumn(ColumnName = "shelf_size", Length = 256, IsNullable = true, ColumnDescription = "货架尺寸")] + public string ShelfSize { get; set; } + + /// + /// 备注 + /// + [SugarColumn(ColumnName = "remark", Length = 128, IsNullable = true, ColumnDescription = "备注")] + public string Remark { get; set; } + + #region 当前位置信息 + /// + /// 当前位置ID + /// + [SugarColumn(ColumnName = "current_location_id", IsNullable = true, ColumnDescription = "当前位置ID")] + public int CurrentLocationId { get; set; } = 0; + + /// + /// 当前位置编码 + /// + [SugarColumn(ColumnName = "current_location_code", Length = 64, IsNullable = true, ColumnDescription = "当前位置编码")] + public string CurrentLocaiotnCode { get; set; } = string.Empty; + #endregion + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "modify_user", Length = 128, IsNullable = true, ColumnDescription = "更新人")] + public string ModifyUser { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "modify_time", IsNullable = false, ColumnDescription = "更新时间")] + public DateTime ModifyTime { get; set; } = DateTime.Now; + + /// + /// 是否启用 + /// + [SugarColumn(ColumnName = "is_enable", IsNullable = false, ColumnDescription = "是否启用")] + public bool IsEnable { get; set; } = true; + + [SugarColumn(IsIgnore = true)] + public string IsEnableStr + { + get + { + if (IsEnable) + return "启用"; + else + return "禁用"; + } + } + + /// + /// 序号 + /// + [SugarColumn(IsIgnore = true)] + public int RowNumber { get; set; } + + /// + /// 是否已经选择 + /// + [SugarColumn(IsIgnore = true)] + public bool IsSelected { get; set; } + } + + public enum ShelfStatusEnum + { + 空货架 = 0, + 非空货架 = 1, + } +} diff --git a/WCS.BLL/DbModels/ShelfInfo.cs b/WCS.BLL/DbModels/ShelfInfo.cs deleted file mode 100644 index f26872e..0000000 --- a/WCS.BLL/DbModels/ShelfInfo.cs +++ /dev/null @@ -1,99 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using WCS.BLL.HardWare; - -namespace WCS.DAL.DbModels -{ - [SugarTable("wcs_shelf_info")] - public class ShelfInfo - { - /// - /// 主键 自增Id - /// - [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] - public int Id { get; set; } - - /// - /// 货架编码 - /// - [SugarColumn(ColumnName = "shelf_code", Length = 50, IsNullable = false, ColumnDescription = "货架编码")] - public string ShelfCode { get; set; } - - /// - /// 货架类型名称 - /// - [SugarColumn(ColumnName = "shelf_type", Length = 50, IsNullable = false, ColumnDescription = "货架类型")] - public string ShelfType { get; set; } - - - /// - /// 货架行数 - /// - [SugarColumn(ColumnName = "row_counts", IsNullable = false, ColumnDescription = "货架行数")] - public int Rowcounts { get; set; } - - /// - /// 货架列数 - /// - [SugarColumn(ColumnName = "column_counts", IsNullable = false, ColumnDescription = "货架列数")] - public int Columncounts { get; set; } - - /// - /// 货架对应警示灯的Id - /// - [SugarColumn(ColumnName = "light_id", IsNullable = false, ColumnDescription = "货架对应警示灯的Id")] - public int LightId { get; set; } - - /// - /// 货架对应Can模块的Ip - /// - [SugarColumn(ColumnName = "client_ip", Length = 50, IsNullable = false, ColumnDescription = "货架对应Can模块的Ip")] - public string ClientIp { get; set; } - - /// - /// 连接Can模块的端口号 - /// - [SugarColumn(ColumnName = "port", Length = 50, IsNullable = true, ColumnDescription = "连接Can模块的端口号")] - public string Port { get; set; } - - /// - /// 货架对应后端的Ip - /// - [SugarColumn(ColumnName = "server_ip", Length = 50, IsNullable = false, ColumnDescription = "货架对应后端服务的Ip")] - public string ServerIp { get; set; } - - /// - /// 货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架) - /// - [SugarColumn(ColumnName = "group_name", Length = 50, IsNullable = false, ColumnDescription = "货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)")] - public string GroupName { get; set; } - - - /// - /// 是否串联绑定 - /// - [SugarColumn(ColumnName = "is_bind", IsNullable = false, ColumnDescription = "是否串联绑定")] - public bool IsBind { get; set; } - - /// - /// 串联绑定后的大货架编码 - /// - [SugarColumn(ColumnName = "Bind_shelf_code", IsNullable = true, ColumnDescription = "串联绑定后的大货架编码")] - public string? BigShelfCode { get; set; } = string.Empty; - - /// - /// 序号 - /// - [SugarColumn(IsIgnore = true)] - public int RowNumber { get; set; } - /// - /// 是否已经选择 - /// - [SugarColumn(IsIgnore = true)] - public bool IsSelected { get; set; } - } -} diff --git a/WCS.BLL/HardWare/SingleLightShelf.cs b/WCS.BLL/HardWare/SingleLightShelf.cs index ae8ea0e..0921806 100644 --- a/WCS.BLL/HardWare/SingleLightShelf.cs +++ b/WCS.BLL/HardWare/SingleLightShelf.cs @@ -16,13 +16,7 @@ namespace WCS.BLL.HardWare { public SingleLightShelf(ShelfInfo shelfInfo) { - ShelfId = shelfInfo.Id; - ShelfCode = shelfInfo.ShelfCode; - RowCounts = shelfInfo.Rowcounts; - ColumnCounts = shelfInfo.Columncounts; - SetCurrentMode(Mode.待机模式); - ClientIp = shelfInfo.ClientIp; - LightId = shelfInfo.LightId; + } public int ShelfId { get; set; } diff --git a/WCS.BLL/HardWare/SmartShelf.cs b/WCS.BLL/HardWare/SmartShelf.cs index ecfaf03..55b5172 100644 --- a/WCS.BLL/HardWare/SmartShelf.cs +++ b/WCS.BLL/HardWare/SmartShelf.cs @@ -19,14 +19,8 @@ namespace WCS.BLL.HardWare { public SmartShelf(ShelfInfo shelfInfo) { - ShelfId = shelfInfo.Id; - ShelfCode = shelfInfo.ShelfCode; - RowCounts = shelfInfo.Rowcounts; - ColumnCounts = shelfInfo.Columncounts; - SetCurrentMode(Mode.待机模式); - ClientIp = shelfInfo.ClientIp; - LightId = shelfInfo.LightId; - WarningLight = new WarningLight() { LightId = shelfInfo.LightId }; + //ShelfId = shelfInfo.Id; + } diff --git a/WCS.BLL/Manager/ShelfManager.cs b/WCS.BLL/Manager/ShelfManager.cs index cabe4d1..7e284b4 100644 --- a/WCS.BLL/Manager/ShelfManager.cs +++ b/WCS.BLL/Manager/ShelfManager.cs @@ -23,9 +23,7 @@ namespace WCS.BLL.Manager { Logs.Write("【InitShelves】开始", LogsType.StartBoot); - var shelvesInDbQueryable = DbHelp.db.Queryable(); - if (LocalFile.Config.IsMx) - shelvesInDbQueryable = shelvesInDbQueryable.Where(t => t.GroupName == LocalFile.Config.GroupName); + var shelvesInDbQueryable = DbHelp.db.Queryable(); var shelvesInDb = shelvesInDbQueryable.ToList(); foreach (var shelfInDb in shelvesInDb) { diff --git a/WCS.BLL/Manager/TCPClientManager.cs b/WCS.BLL/Manager/TCPClientManager.cs index 8497fd7..4ffb82d 100644 --- a/WCS.BLL/Manager/TCPClientManager.cs +++ b/WCS.BLL/Manager/TCPClientManager.cs @@ -23,169 +23,7 @@ namespace WCS.BLL.Manager /// public static List TCPClients = new List(); - public static void InitTcpClient() - { - Logs.Write("【InitTcpClient】开始", LogsType.StartBoot); - var clientsInDB = DbHelp.db.Queryable() - .WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName) - .Select(t => new - { - IP = t.ClientIp, - ShelfTypeName = t.ShelfType, - Port = t.Port, - }) - .Distinct() - .ToList(); - Logs.Write($"【InitTcpClient】需要连接的服务端地址如下:\r\n{string.Join(";", clientsInDB)}", LogsType.StartBoot); - foreach (var cleientInDB in clientsInDB) - { - Task.Run(() => - { - var tcpCleint = new TCPClient(cleientInDB.IP, cleientInDB.Port, cleientInDB.ShelfTypeName); - tcpCleint.tcpClient.Received += (client, e) => - { - var clientIpHost = client.IP + ":" + client.Port; - var TcpCleint = TCPClientManager.GetTCPClientByIPHost(clientIpHost); - if (TcpCleint == null) - { - return EasyTask.CompletedTask; - } - - var data = e.ByteBlock.Buffer.Take((int)e.ByteBlock.Length).ToArray(); - - - Logs.Write($"【接收{clientIpHost}】{BitConverter.ToString(data)}", LogsType.Instructions); - - e.ByteBlock.Clear(); - var len = data.Length; - - if (tcpCleint.ShelfTypeName == "信息化货架") - { - Logs.Write($"【信息化货架开始处理接收数据】{BitConverter.ToString(data)}", LogsType.InstructionsProcess); - Helper.ReturnDataProcess(TcpCleint, data); - Logs.Write($"【信息化货架完成处理接收数据】{BitConverter.ToString(data)}", LogsType.InstructionsProcess); - return EasyTask.CompletedTask; - } - - if (tcpCleint.ShelfTypeName == "液晶货架") - { - Logs.Write($"【液晶货架开始处理接收数据】{BitConverter.ToString(data)}", LogsType.InstructionsProcess); - //Helper.ReturnDataProcess(TcpCleint, data); - Logs.Write($"【液晶货架完成处理接收数据】{BitConverter.ToString(data)}", LogsType.InstructionsProcess); - return EasyTask.CompletedTask; - } - - for (int index = 0; index < data.Length - TcpCleint.PreFixLength; index++) - { - //协议拆包 通过前缀校验是否为完整数据包 - var prefixInData = data.Skip(index).Take(TcpCleint.PreFixLength); - var isEqual = prefixInData.SequenceEqual(TcpCleint.Prefix); - if (isEqual) - { - var dataTemp = data.Skip(index).Take(TcpCleint.PreFixLength + TcpCleint.DataLength).ToArray(); - if (dataTemp.Length < TcpCleint.PreFixLength + TcpCleint.DataLength)//拆包后不满足一条指令的长度 - { - continue; - } - Logs.Write($"【处理单条指令 开始】{BitConverter.ToString(dataTemp)}", LogsType.InstructionsProcess); - index += (TcpCleint.PreFixLength + TcpCleint.DataLength - 1);//每次循环index会+1 所以这里-1 - //获取板子ID - var boardId = (dataTemp[TcpCleint.PreFixLength + 0] << 8) + dataTemp[TcpCleint.PreFixLength + 1]; - var lightNumber = Convert.ToInt32(dataTemp[TcpCleint.PreFixLength + 3]); - //报警灯 返回来就修改对应的灯的颜色 - if (dataTemp[TcpCleint.PreFixLength + 2] == 0x20) - { - var shelf = ShelfManager.Shelves.Where(t => t.ClientIp == clientIpHost) - .Where(t => t.LightId == boardId) - .FirstOrDefault(); - var smartShelf = shelf as SmartShelf; - smartShelf?.WarningLightProcess(dataTemp, boardId, lightNumber); - } - //!= 0x20 货架类型协议返回 - else - { - var shelf = ShelfManager.Shelves - .Where(t => t.ClientIp == clientIpHost) - .Where(t => t.ModuleIds != null && t.ModuleIds.Contains(boardId)) - .FirstOrDefault(); - var smartShelf = shelf as SmartShelf; - smartShelf?.ProtocolProcess(dataTemp, boardId, lightNumber); - } - Logs.Write($"【处理单条指令 结束】{BitConverter.ToString(dataTemp)}", LogsType.InstructionsProcess); - } - } - return EasyTask.CompletedTask; - }; - //配置首次连接后复位操作 - tcpCleint.tcpClient.Connected += (client, e) => - { - Logs.Write($"【TcpClient】{client.IP}完成连接,端口号{client.Port}", LogsType.StartBoot); - var clientIpHost = client.IP + ":" + client.Port; - var TcpCleint = TCPClientManager.GetTCPClientByIPHost(clientIpHost); - if (TcpCleint == null) - { - return EasyTask.CompletedTask; - } - //首次连接 - if (TcpCleint.IsFirstConnected == false) - { - Logs.Write($"【InitTcpClient】{clientIpHost}完成首次连接", LogsType.StartBoot); - - - - Console.WriteLine($"【InitTcpClient】{clientIpHost}完成首次连接"); - InitStatus(TcpCleint); - TcpCleint.IsFirstConnected = true; - //获取剩余未完成连接的tcp - var noFirstConnectedTcps = TCPClientManager.TCPClients.Where(t => t.IsFirstConnected == false) - .Select(t => t.RemoteIPHost) - .ToList(); - Logs.Write($"【InitTcpClient】剩余未完成连接的TCP为{string.Join(";", noFirstConnectedTcps)}", LogsType.StartBoot); - } - return EasyTask.CompletedTask; - }; - - lock (TCPClients)//避免添加失败的情况 - { - TCPClients.Add(tcpCleint); - } - - tcpCleint.Connect(); - }); - } - - //启动线程监听所有TCP是否已经完成首次连接 - Task.Run(() => - { - while (true) - { - try - { - Thread.Sleep(1000); - var noFirstConnectedClients = TCPClientManager.TCPClients.Where(t => t.IsFirstConnected == false) - .ToList(); - if (noFirstConnectedClients.Count == 0) - { - break; - } - else - { - Console.WriteLine($"存在tcp未完成首次连接,继续重连!"); - noFirstConnectedClients.ForEach(t => - { - t.ReConnectAsync(); - }); - } - } - catch (Exception ex) - { - - } - } - }); - Logs.Write("【InitTcpClient】完成 后台继续连接", LogsType.StartBoot); - } //后台启动时给所有板子、警示灯发送复位操作 保持状态一致 public static void InitStatus() @@ -217,10 +55,7 @@ namespace WCS.BLL.Manager //后台启动时给所有板子、警示灯发送复位操作 保持状态一致 public static void InitStatus(TCPClient tcpClient) { - var shelfInfo = DbHelp.db.Queryable().Where(t => t.ClientIp == tcpClient.RemoteIPHost).ToList(); - if (shelfInfo.Count != 0) - { - } + Task.Run(() => { diff --git a/WCS.BLL/Services/Service/GenerateService.cs b/WCS.BLL/Services/Service/GenerateService.cs index 3e36046..8ed3faa 100644 --- a/WCS.BLL/Services/Service/GenerateService.cs +++ b/WCS.BLL/Services/Service/GenerateService.cs @@ -53,67 +53,72 @@ namespace WCS.BLL.Services.Service Data = null }; } - - //生成条码 - lock (matFlag) + return new ResponseCommon>() { - try - { - DbHelp.db.BeginTran(); - var startNumber = ++matBaseInfo.SerialNumber; - var matInfoList = new List(); - for (var i = 0; i < request.TotalCount; i++) - { - var matInfo = new MatInfo() - { - MatSn = GetMatSn(matBaseInfo, startNumber + i), - MatCode = matBaseInfo.MatCode, - MatName = matBaseInfo.MatName, - MatBatch = request.MatBatch, - MatSpec = matBaseInfo.MatSpec, - MatUnit = matBaseInfo.MatUnit, - MatSupplier = matBaseInfo.MatSupplier, + Code = 201, + Message = $"生成失败:该物料已被禁用", + Data = null + }; + ////生成条码 + //lock (matFlag) + //{ + // try + // { + // DbHelp.db.BeginTran(); + // var startNumber = ++matBaseInfo.SerialNumber; + // var matInfoList = new List(); + // for (var i = 0; i < request.TotalCount; i++) + // { + // var matInfo = new MatInfo() + // { + // MatSn = GetMatSn(matBaseInfo, startNumber + i), + // MatCode = matBaseInfo.MatCode, + // MatName = matBaseInfo.MatName, + // MatBatch = request.MatBatch, + // MatSpec = matBaseInfo.MatSpec, + // MatUnit = matBaseInfo.MatUnit, + // MatSupplier = matBaseInfo.MatSupplier, - MatCustomer = matBaseInfo.MatCustomer, - MatQty = request.MatQty, - ModifyUser = request.UserName - }; - matInfo.Id = DbHelp.db.Insertable(matInfo).ExecuteReturnIdentity(); - matInfoList.Add(matInfo); - } + // MatCustomer = matBaseInfo.MatCustomer, + // MatQty = request.MatQty, + // ModifyUser = request.UserName + // }; + // matInfo.Id = DbHelp.db.Insertable(matInfo).ExecuteReturnIdentity(); + // matInfoList.Add(matInfo); + // } - matBaseInfo.SerialNumber = startNumber + request.TotalCount; - DbHelp.db.Updateable(matBaseInfo).ExecuteCommand(); - DbHelp.db.CommitTran(); - return new ResponseCommon>() - { - Code = 200, - Message = "success", - Data = matInfoList - }; - } - catch (Exception ex) - { - DbHelp.db.RollbackTran(); - return new ResponseCommon>() - { - Code = 201, - Message = $"生成失败:{ex.Message}", - Data = null - }; - } - } + // matBaseInfo.SerialNumber = startNumber + request.TotalCount; + // DbHelp.db.Updateable(matBaseInfo).ExecuteCommand(); + // DbHelp.db.CommitTran(); + // return new ResponseCommon>() + // { + // Code = 200, + // Message = "success", + // Data = matInfoList + // }; + // } + // catch (Exception ex) + // { + // DbHelp.db.RollbackTran(); + // return new ResponseCommon>() + // { + // Code = 201, + // Message = $"生成失败:{ex.Message}", + // Data = null + // }; + // } + //} } private string GetMatSn(MatBaseInfo matBaseInfo, int serialNumber) { - var gongshi = "=A1&\"-\"&A2&A3"; - Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("A1", matBaseInfo.MatCode); - keyValuePairs.Add("A2", string.IsNullOrEmpty(matBaseInfo.MatBatch) ? "" : matBaseInfo.MatBatch); - keyValuePairs.Add("A3", serialNumber.ToString().PadLeft(6, '0')); - var matSn = PnHelp.Jx(gongshi, keyValuePairs); - return matSn; + //var gongshi = "=A1&\"-\"&A2&A3"; + //Dictionary keyValuePairs = new Dictionary(); + //keyValuePairs.Add("A1", matBaseInfo.MatCode); + //keyValuePairs.Add("A2", string.IsNullOrEmpty(matBaseInfo.MatBatch) ? "" : matBaseInfo.MatBatch); + //keyValuePairs.Add("A3", serialNumber.ToString().PadLeft(6, '0')); + //var matSn = PnHelp.Jx(gongshi, keyValuePairs); + return string.Empty; } public async Task generateStockTakingNumber() @@ -229,17 +234,17 @@ namespace WCS.BLL.Services.Service if (matBaseInfo != null) { //存在此物料的情况下 判断当前的数量 - if (request.CurrentSerilNumber != matBaseInfo.SerialNumber + 1) - { - return new ResponseBase() - { - Code = 201, - Message = "操作失败:当前物料流水号冲突!请重新扫码!", - Data = null - }; - } + //if (request.CurrentSerilNumber != matBaseInfo.SerialNumber + 1) + //{ + // return new ResponseBase() + // { + // Code = 201, + // Message = "操作失败:当前物料流水号冲突!请重新扫码!", + // Data = null + // }; + //} //流水号不冲突 - else + //else { var matInfoList = new List(); @@ -249,7 +254,7 @@ namespace WCS.BLL.Services.Service for (int i = 0; i < request.TotalPan; i++) { //保存matBaseInfo - matBaseInfo.SerialNumber++; + //matBaseInfo.SerialNumber++; //保存条码信息 var matInfo = new MatInfo() diff --git a/WCS.BLL/Services/Service/HomerService.cs b/WCS.BLL/Services/Service/HomerService.cs index 100bc83..510aea5 100644 --- a/WCS.BLL/Services/Service/HomerService.cs +++ b/WCS.BLL/Services/Service/HomerService.cs @@ -19,11 +19,8 @@ namespace WCS.BLL.Services.Service { //直接获取数据库数据 分组进行返回 var data = await DbHelp.db.Queryable() - .Where(t => !string.IsNullOrEmpty(t.BigShelfCode)) .Select(t => new GetShelfServerResponseItem() { - BigShelfCode = t.BigShelfCode, - ServerIp = t.ServerIp, }) .Distinct() .ToListAsync(); diff --git a/WCS.BLL/Services/Service/StoreInfoService.cs b/WCS.BLL/Services/Service/StoreInfoService.cs index 433cedb..1051f7c 100644 --- a/WCS.BLL/Services/Service/StoreInfoService.cs +++ b/WCS.BLL/Services/Service/StoreInfoService.cs @@ -30,7 +30,7 @@ namespace WCS.BLL.Services.Service try { var recordsQueryable = DbHelp.db.Queryable() - .WhereIF(!string.IsNullOrEmpty(request.ShelfCode), t => t.ShelfCode.Contains(request.ShelfCode)); + ; var totalCount = await recordsQueryable.CountAsync(); var records = await recordsQueryable @@ -69,7 +69,6 @@ namespace WCS.BLL.Services.Service try { var shelfnfo = await DbHelp.db.Queryable() - .Where(t => t.ShelfCode == request.ShelfInfo.ShelfCode) .FirstAsync(); //修改货架信息 if (request.AddOrUpdate == AddOrUpdate.Update) @@ -84,7 +83,7 @@ namespace WCS.BLL.Services.Service return new ResponseCommon { Code = 201, - Message = $"更新货架信息失败:货架{request.ShelfInfo.ShelfCode}不存在!", + Message = $"更新货架信息失败:货架不存在!", Data = null }; } @@ -93,20 +92,12 @@ namespace WCS.BLL.Services.Service return new ResponseCommon { Code = 201, - Message = $"更新货架信息失败:已存在货架编码{request.ShelfInfo.ShelfCode}!", + Message = $"更新货架信息失败:已存在货架编码!", Data = null }; } else { - shelfnfo.ShelfCode = request.ShelfInfo.ShelfCode; - shelfnfo.Rowcounts = request.ShelfInfo.Rowcounts; - shelfnfo.Columncounts = request.ShelfInfo.Columncounts; - shelfnfo.LightId = request.ShelfInfo.LightId; - shelfnfo.ClientIp = request.ShelfInfo.ClientIp; - shelfnfo.GroupName = request.ShelfInfo.GroupName; - shelfnfo.IsBind = request.ShelfInfo.IsBind; - shelfnfo.BigShelfCode = request.ShelfInfo.BigShelfCode; var rowNum = await DbHelp.db.Updateable(shelfnfo).ExecuteCommandAsync(); if (rowNum == 0) @@ -136,7 +127,7 @@ namespace WCS.BLL.Services.Service return new ResponseCommon { Code = 201, - Message = $"货架信息失败:货架{request.ShelfInfo.ShelfCode}已存在!", + Message = $"货架信息失败:货架已存在!", Data = null }; } @@ -144,14 +135,7 @@ namespace WCS.BLL.Services.Service { var newShelfInfo = new ShelfInfo() { - ShelfCode = request.ShelfInfo.ShelfCode, - Rowcounts = request.ShelfInfo.Rowcounts, - Columncounts = request.ShelfInfo.Columncounts, - LightId = request.ShelfInfo.LightId, - ClientIp = request.ShelfInfo.ClientIp, - GroupName = request.ShelfInfo.GroupName, - IsBind = request.ShelfInfo.IsBind, - BigShelfCode = request.ShelfInfo.BigShelfCode, + }; var rowNum = await DbHelp.db.Insertable(newShelfInfo).ExecuteCommandAsync(); if (rowNum == 0)