From d90378f820e853c649913c819b34e807ae5e1dd9 Mon Sep 17 00:00:00 2001 From: hehaibing-1996 Date: Wed, 8 Jan 2025 16:01:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WCS.BLL/DbModels/MatInfo.cs | 2 +- WCS.BLL/DbModels/ShelfTypeInfo.cs | 22 --- WCS.BLL/DbModels/StoreInfoHistoryVoltage.cs | 141 ------------------ WCS.BLL/DbModels/Task/CurrentTask.cs | 121 --------------- WCS.BLL/DbModels/Task/FinishedTask.cs | 125 ---------------- WCS.BLL/DbModels/Task/UploadedTask.cs | 125 ---------------- WCS.BLL/HardWare/SmartShelf.cs | 30 ---- WCS.BLL/Manager/DbInit.cs | 20 +-- WCS.BLL/Services/IService/IMXL4Service.cs | 20 --- .../Services/IService/IStoreInfoService.cs | 7 - WCS.BLL/Services/Service/MXL4Service.cs | 126 ---------------- WCS.BLL/Services/Service/OutstoreService.cs | 57 ------- WCS.BLL/Services/Service/StoreInfoService.cs | 74 --------- .../ApiModel/MXL4/SysOrderMXL4Request.cs | 74 --------- WCS.Model/ApiModel/MXL4/TaskEnum.cs | 29 ---- WCS.WebApi/Controllers/HomeController.cs | 35 ----- WCS.WebApi/Controllers/MXL4Controller.cs | 49 ------ WCS.WebApi/Controllers/StoreInfoController.cs | 6 - WCS.WebApi/Program.cs | 1 - 19 files changed, 4 insertions(+), 1060 deletions(-) delete mode 100644 WCS.BLL/DbModels/ShelfTypeInfo.cs delete mode 100644 WCS.BLL/DbModels/StoreInfoHistoryVoltage.cs delete mode 100644 WCS.BLL/DbModels/Task/CurrentTask.cs delete mode 100644 WCS.BLL/DbModels/Task/FinishedTask.cs delete mode 100644 WCS.BLL/DbModels/Task/UploadedTask.cs delete mode 100644 WCS.BLL/Services/IService/IMXL4Service.cs delete mode 100644 WCS.BLL/Services/Service/MXL4Service.cs delete mode 100644 WCS.Model/ApiModel/MXL4/SysOrderMXL4Request.cs delete mode 100644 WCS.Model/ApiModel/MXL4/TaskEnum.cs delete mode 100644 WCS.WebApi/Controllers/MXL4Controller.cs diff --git a/WCS.BLL/DbModels/MatInfo.cs b/WCS.BLL/DbModels/MatInfo.cs index 896f613..a603c6b 100644 --- a/WCS.BLL/DbModels/MatInfo.cs +++ b/WCS.BLL/DbModels/MatInfo.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace WCS.BLL.DbModels { /// - ///物料信息表 + ///物料明细表 /// [SugarTable("wcs_mat_info")] public class MatInfo diff --git a/WCS.BLL/DbModels/ShelfTypeInfo.cs b/WCS.BLL/DbModels/ShelfTypeInfo.cs deleted file mode 100644 index 5e84a14..0000000 --- a/WCS.BLL/DbModels/ShelfTypeInfo.cs +++ /dev/null @@ -1,22 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WCS.BLL.DbModels -{ - /// - /// 货架类型 - /// - [SugarTable("wcs_shelf_type")] - public class ShelfTypeInfo - { - [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] - public int Id { get; set; } - - [SugarColumn(ColumnName = "shelf_type_name", Length = 50, IsNullable = true, ColumnDescription = "货架类型名称")] - public string ShelfTypeName { get; set; } - } -} diff --git a/WCS.BLL/DbModels/StoreInfoHistoryVoltage.cs b/WCS.BLL/DbModels/StoreInfoHistoryVoltage.cs deleted file mode 100644 index b556495..0000000 --- a/WCS.BLL/DbModels/StoreInfoHistoryVoltage.cs +++ /dev/null @@ -1,141 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WCS.DAL.DbModels -{ - [SugarTable("wcs_store_info_history_voltage")] - public partial class StoreInfoHistoryVoltage - { - /// - /// Id - /// - [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] - public int Id { get; set; } - - [SugarColumn(ColumnName = "store_id")] - public int StoreId { get; set; } - /// - /// 入库的库位编码 - /// - [SugarColumn(ColumnName = "store_code", Length = 50, IsNullable = false, ColumnDescription = "库位编码")] - public string StoreCode { get; set; } - /// - /// 货架类型Id - /// - [SugarColumn(ColumnName = "shelf_type_id", IsNullable = false, DefaultValue = "0", ColumnDescription = "货架类型Id")] - public int ShelfTypeId { get; set; } - /// - /// 模组Id - /// - [SugarColumn(ColumnName = "module_id", IsNullable = false, ColumnDescription = "模组Id")] - public int ModuleId { get; set; } - - /// - /// 模组编号 - /// - [SugarColumn(ColumnName = "module_code", Length = 50, IsNullable = false, ColumnDescription = "模组编码")] - public string ModuleCode { get; set; } - - /// - /// 货架Id - /// - [SugarColumn(ColumnName = "shelf_id", IsNullable = false, ColumnDescription = "货架Id")] - public int ShelfId { get; set; } - - /// - /// 货架号 - /// - [SugarColumn(ColumnName = "shelf_code", Length = 50, IsNullable = false, ColumnDescription = "货架编码;货架一般按照报警灯来区分 一个报警灯指示的是一个货架")] - public string ShelfCode { get; set; } - - /// - /// 板子的Id - /// - [SugarColumn(ColumnName = "board_id", IsNullable = false, ColumnDescription = "模组pcb板id")] - public int BoardId { get; set; } - - /// - /// 板子上第几个灯 - /// - [SugarColumn(ColumnName = "light_number", IsNullable = true, ColumnDescription = "板子上第几个灯")] - public int LightNumber { get; set; } - - /// - /// 优先级;为钢网柜推荐库位预留 - /// - [SugarColumn(ColumnName = "priority", IsNullable = true, ColumnDescription = "板子上第几个灯")] - public int Priority { get; set; } - - /// - /// 记录一下查询时的历史是否有物料 - /// - [SugarColumn(ColumnName = "current_mat_sn", Length = 200, IsNullable = true, ColumnDescription = "当前物料")] - public string CurrentMatSn { get; set; } - - /// - /// 当前电压;当前电压,调试排查问题用 - /// - [SugarColumn(ColumnName = "current_voltage", IsNullable = true, ColumnDescription = "当前电压值")] - public decimal CurrentVoltage { get; set; } - - /// - /// 标准电压;标准电压,调试排查问题用 - /// - [SugarColumn(ColumnName = "standard_voltage", IsNullable = true, ColumnDescription = "标准电压值")] - public decimal StandardVoltage { get; set; } - - /// - /// 偏差电压;偏差电压,调试排查问题用 - /// - [SugarColumn(ColumnName = "offset_voltage", IsNullable = true, ColumnDescription = "电压偏移值")] - public decimal OffsetVoltage { get; set; } - - /// - /// 串联绑定后的大货架编码 - /// - [SugarColumn(ColumnName = "Bind_shelf_code", IsNullable = true, ColumnDescription = "串联绑定后的大货架编码")] - public string? BigShelfCode { get; set; } = string.Empty; - /// - /// Row 行 - /// - [SugarColumn(ColumnName = "R", Length = 10, IsNullable = true, ColumnDescription = "库位 行")] - public string R { get; set; } - /// - /// Column 列 - /// - [SugarColumn(ColumnName = "C", Length = 10, IsNullable = true, ColumnDescription = "库位 列")] - public string C { get; set; } - /// - /// Column 位 - /// - [SugarColumn(ColumnName = "Wei", Length = 10, IsNullable = true, ColumnDescription = "库位 位 第几个库位灯")] - public string Wei { get; set; } - - /// - /// 货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架) - /// - [SugarColumn(ColumnName = "group_name", Length = 50, IsNullable = false, DefaultValue = "0", ColumnDescription = "货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)")] - public string GroupName { get; set; } - - /// - /// 创建时间 - /// - [SugarColumn(ColumnName = "create_time", IsNullable = false, ColumnDescription = "创建时间")] - public DateTime CreateTime { 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/Task/CurrentTask.cs b/WCS.BLL/DbModels/Task/CurrentTask.cs deleted file mode 100644 index 6bc009b..0000000 --- a/WCS.BLL/DbModels/Task/CurrentTask.cs +++ /dev/null @@ -1,121 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using WCS.BLL.DbModels.Task; -using WCS.DAL.DbModels; - -namespace WCS.BLL.DbModels -{ - /// - /// 当前正在进行中的任务 - /// - [SugarTable("wcs_current_task")] - public class CurrentTask - { - /// - /// 主键 自增Id - /// - [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] - public int Id { get; set; } - - #region 库位属性 - /// - /// 入库的库位表ID - /// - [SugarColumn(ColumnName = "store_id", IsNullable = false, ColumnDescription = "库位ID")] - public int StoreId { get; set; } - - /// - /// 入库的库位编码 - /// - [SugarColumn(ColumnName = "store_code", Length = 50, IsNullable = false, ColumnDescription = "库位编码")] - public string StoreCode { get; set; } - - [Navigate(NavigateType.OneToOne, nameof(StoreId))] - public StoreInfo StoreInfo { get; set; } - #endregion - - #region 任务属性 - /// - /// 任务Id - /// - [SugarColumn(ColumnName = "task_id", IsNullable = false, ColumnDescription = "任务Id,同一个库位只支持1-7")] - public int TaskID { get; set; } = 0; - - /// - /// Guid - /// - [SugarColumn(ColumnName = "guid", IsNullable = false, ColumnDescription = "Guid 系统那边任务的唯一ID")] - public Guid Guid { get; set; } - - /// - /// 任务模式:入库模式 = 0, 出库模式 = 1, 盘点模式 = 2 - /// - [SugarColumn(ColumnName = "task_mode", IsNullable = false, ColumnDescription = "任务模式:入库模式 = 0, 出库模式 = 1, 盘点模式 = 2")] - public TaskModeEnum TaskMode { get; set; } - - /// - /// 出库单据号 - /// - [SugarColumn(ColumnName = "order_number", Length = 50, IsNullable = false, ColumnDescription = "出库单据号")] - public string OrderNumber { get; set; } - - /// - /// 按钮颜色 - /// - [SugarColumn(ColumnName = "button_color", IsNullable = false, ColumnDescription = "按钮颜色 红色 = 1, 绿色 = 2, 黄色 = 3, 蓝色 = 4, 紫色 = 5, 青色 = 6, 白色 = 7,")] - public ButtonColorEnum ButtonColor { get; set; } - - /// - /// 物料编码 - /// - [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_batch", Length = 150, IsNullable = true, ColumnDescription = "物料批次")] - public string MatBatch { get; set; } - - /// - /// 物料数量 - /// - [SugarColumn(ColumnName = "qty", IsNullable = false, ColumnDescription = "目标数量")] - public int Qty { get; set; } - - /// - /// 创建时间 - /// - [SugarColumn(ColumnName = "create_time", IsNullable = false, ColumnDescription = "创建时间")] - public DateTime CreateTime { get; set; } = DateTime.Now; - - /// - /// 任务是否被挂起 用于入库时取消入库,还没切换库位时 认为任务被挂起 同时只支持一个库位的任务被挂起 - /// - [SugarColumn(ColumnName = "is_suspended", IsNullable = false, ColumnDescription = "任务是否被挂起 用于入库时取消入库,还没切换库位时 认为任务被挂起")] - public bool IsSuspended { get; set; } = false; - - /// - /// 任务是否已发送至标签 - /// - [SugarColumn(ColumnName = "is_sended", IsNullable = false, ColumnDescription = "任务是否已发送至标签")] - public bool IsSended { get; set; } = false; - #endregion - } -} diff --git a/WCS.BLL/DbModels/Task/FinishedTask.cs b/WCS.BLL/DbModels/Task/FinishedTask.cs deleted file mode 100644 index c3a7e59..0000000 --- a/WCS.BLL/DbModels/Task/FinishedTask.cs +++ /dev/null @@ -1,125 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using WCS.BLL.DbModels.Task; -using WCS.DAL.DbModels; - -namespace WCS.BLL.DbModels -{ - /// - /// 已完成未提交的任务 - /// - [SugarTable("wcs_finished_task")] - public class FinishedTask - { - /// - /// 主键 自增Id - /// - [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] - public int Id { get; set; } - - #region 库位属性 - /// - /// 入库的库位表ID - /// - [SugarColumn(ColumnName = "store_id", IsNullable = false, ColumnDescription = "库位ID")] - public int StoreId { get; set; } - - /// - /// 入库的库位编码 - /// - [SugarColumn(ColumnName = "store_code", Length = 50, IsNullable = false, ColumnDescription = "库位编码")] - public string StoreCode { get; set; } - - [Navigate(NavigateType.OneToOne, nameof(StoreId))] - public StoreInfo StoreInfo { get; set; } - #endregion - - #region 任务属性 - /// - /// 任务Id - /// - [SugarColumn(ColumnName = "task_id", IsNullable = false, ColumnDescription = "任务Id,同一个库位只支持1-7")] - public int TaskID { get; set; } - - /// - /// Guid - /// - [SugarColumn(ColumnName = "guid", IsNullable = false, ColumnDescription = "Guid 系统那边任务的唯一ID")] - public Guid Guid { get; set; } - - /// - /// 任务模式:入库模式 = 0, 出库模式 = 1, 盘点模式 = 2 - /// - [SugarColumn(ColumnName = "task_mode", IsNullable = false, ColumnDescription = "任务模式:入库模式 = 0, 出库模式 = 1, 盘点模式 = 2")] - public TaskModeEnum TaskMode { get; set; } - - /// - /// 出库单据号 - /// - [SugarColumn(ColumnName = "order_number", Length = 50, IsNullable = false, ColumnDescription = "出库单据号")] - public string OrderNumber { get; set; } - - /// - /// 按钮颜色 - /// - [SugarColumn(ColumnName = "button_color", IsNullable = false, ColumnDescription = "按钮颜色 红色 = 1, 绿色 = 2, 黄色 = 3, 蓝色 = 4, 紫色 = 5, 青色 = 6, 白色 = 7,")] - public ButtonColorEnum ButtonColor { get; set; } - - /// - /// 物料编码 - /// - [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_batch", Length = 150, IsNullable = true, ColumnDescription = "物料批次")] - public string MatBatch { get; set; } - - /// - /// 物料数量 - /// - [SugarColumn(ColumnName = "qty", IsNullable = false, ColumnDescription = "目标数量")] - public int Qty { get; set; } - - /// - /// 创建时间 - /// - [SugarColumn(ColumnName = "create_time", IsNullable = false, ColumnDescription = "创建时间")] - public DateTime CreateTime { get; set; } = DateTime.Now; - - /// - /// 创建人 - /// - [SugarColumn(ColumnName = "create_user", Length = 100, IsNullable = true, ColumnDescription = "创建人")] - public string CreateUser { get; set; } = string.Empty; - - /// - /// 完成时物料数量 - /// - [SugarColumn(ColumnName = "finish_qty", IsNullable = false, ColumnDescription = "完成数量")] - public int FinishQty { get; set; } = 0; - /// - /// 完成时间 - /// - [SugarColumn(ColumnName = "finish_time", IsNullable = false, ColumnDescription = "完成时间")] - public DateTime FinishTime { get; set; } = DateTime.Now; - #endregion - } -} diff --git a/WCS.BLL/DbModels/Task/UploadedTask.cs b/WCS.BLL/DbModels/Task/UploadedTask.cs deleted file mode 100644 index f6b7ebd..0000000 --- a/WCS.BLL/DbModels/Task/UploadedTask.cs +++ /dev/null @@ -1,125 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using WCS.BLL.DbModels.Task; -using WCS.DAL.DbModels; - -namespace WCS.BLL.DbModels -{ - /// - /// 已完成已提交的历史任务 - /// - [SugarTable("wcs_uploaded_task")] - public class UploadededTask - { - /// - /// 主键 自增Id - /// - [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] - public int Id { get; set; } - - #region 库位属性 - /// - /// 入库的库位表ID - /// - [SugarColumn(ColumnName = "store_id", IsNullable = false, ColumnDescription = "库位ID")] - public int StoreId { get; set; } - - /// - /// 入库的库位编码 - /// - [SugarColumn(ColumnName = "store_code", Length = 50, IsNullable = false, ColumnDescription = "库位编码")] - public string StoreCode { get; set; } - - [Navigate(NavigateType.OneToOne, nameof(StoreId))] - public StoreInfo StoreInfo { get; set; } - #endregion - - #region 任务属性 - /// - /// 任务Id - /// - [SugarColumn(ColumnName = "task_id", IsNullable = false, ColumnDescription = "任务Id,同一个库位只支持1-7")] - public int TaskID { get; set; } - - /// - /// Guid - /// - [SugarColumn(ColumnName = "guid", IsNullable = false, ColumnDescription = "Guid 系统那边任务的唯一ID")] - public Guid Guid { get; set; } - - /// - /// 任务模式:入库模式 = 0, 出库模式 = 1, 盘点模式 = 2 - /// - [SugarColumn(ColumnName = "task_mode", IsNullable = false, ColumnDescription = "任务模式:入库模式 = 0, 出库模式 = 1, 盘点模式 = 2")] - public TaskModeEnum TaskMode { get; set; } - - /// - /// 出库单据号 - /// - [SugarColumn(ColumnName = "order_number", Length = 50, IsNullable = false, ColumnDescription = "出库单据号")] - public string OrderNumber { get; set; } - - /// - /// 按钮颜色 - /// - [SugarColumn(ColumnName = "button_color", IsNullable = false, ColumnDescription = "按钮颜色 红色 = 1, 绿色 = 2, 黄色 = 3, 蓝色 = 4, 紫色 = 5, 青色 = 6, 白色 = 7,")] - public ButtonColorEnum ButtonColor { get; set; } - - /// - /// 物料编码 - /// - [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_batch", Length = 150, IsNullable = true, ColumnDescription = "物料批次")] - public string MatBatch { get; set; } - - /// - /// 物料数量 - /// - [SugarColumn(ColumnName = "qty", IsNullable = false, ColumnDescription = "目标数量")] - public int Qty { get; set; } - - /// - /// 创建时间 - /// - [SugarColumn(ColumnName = "create_time", IsNullable = false, ColumnDescription = "创建时间")] - public DateTime CreateTime { get; set; } = DateTime.Now; - - /// - /// 创建人 - /// - [SugarColumn(ColumnName = "create_user", Length = 100, IsNullable = true, ColumnDescription = "创建人")] - public string CreateUser { get; set; } = string.Empty; - - /// - /// 完成时物料数量 - /// - [SugarColumn(ColumnName = "finish_qty", IsNullable = false, ColumnDescription = "完成数量")] - public int FinishQty { get; set; } = 0; - /// - /// 完成时间 - /// - [SugarColumn(ColumnName = "finish_time", IsNullable = false, ColumnDescription = "完成时间")] - public DateTime FinishTime { get; set; } = DateTime.Now; - #endregion - } -} diff --git a/WCS.BLL/HardWare/SmartShelf.cs b/WCS.BLL/HardWare/SmartShelf.cs index b2cb037..5bac694 100644 --- a/WCS.BLL/HardWare/SmartShelf.cs +++ b/WCS.BLL/HardWare/SmartShelf.cs @@ -1703,36 +1703,6 @@ namespace WCS.BLL.HardWare data[TcpCleint.PreFixLength + 8] == 0x0D && data[TcpCleint.PreFixLength + 9] == 0x0D) { - Task.Run(() => - { - var historyVoltage = new StoreInfoHistoryVoltage() - { - StoreId = storeInfo.Id, - StoreCode = storeInfo.StoreCode, - ShelfTypeId = storeInfo.ShelfTypeId, - ModuleId = storeInfo.ModuleId, - ModuleCode = storeInfo.ModuleCode, - ShelfId = storeInfo.ShelfId, - ShelfCode = storeInfo.ShelfCode, - BoardId = storeInfo.BoardId, - LightNumber = storeInfo.LightNumber, - Priority = storeInfo.Priority, - CurrentMatSn = storeInfo.CurrentMatSn, - CurrentVoltage = storeInfo.CurrentVoltage, - StandardVoltage = storeInfo.StandardVoltage, - OffsetVoltage = storeInfo.OffsetVoltage, - BigShelfCode = storeInfo.BigShelfCode, - R = storeInfo.R, - C = storeInfo.C, - Wei = storeInfo.Wei, - GroupName = "出库自动标定记录历史电压", - CreateTime = DateTime.Now, - }; - //自动保存最新的电压值 - storeInfo.CurrentVoltage = (data[TcpCleint.PreFixLength + 4] << 8) + data[TcpCleint.PreFixLength + 5]; - DbHelp.db.Insertable(historyVoltage).ExecuteCommand(); - DbHelp.db.Updateable(storeInfo).ExecuteCommand(); - }); Thread.Sleep(10); return; } diff --git a/WCS.BLL/Manager/DbInit.cs b/WCS.BLL/Manager/DbInit.cs index 1f7efba..d04c24b 100644 --- a/WCS.BLL/Manager/DbInit.cs +++ b/WCS.BLL/Manager/DbInit.cs @@ -70,9 +70,9 @@ namespace WCS.BLL.Manager DbHelp.dbLog.DbMaintenance.CreateDatabase(); Logs.Write("【初始化数据库】创建数据库", LogsType.StartBoot); - DbHelp.db.CodeFirst.InitTables(typeof(ModuleInfo), typeof(ShelfInfo), typeof(StoreInfo),typeof(StoreInfoHistoryVoltage) + DbHelp.db.CodeFirst.InitTables(typeof(ModuleInfo), typeof(ShelfInfo), typeof(StoreInfo) , typeof(InventoryDetail), typeof(OutOrder), typeof(OutOrderDetail), typeof(OutOrderMatDetail) - , typeof(ShelfTypeInfo), typeof(MatBaseInfo), typeof(MatInfo) + , typeof(MatBaseInfo), typeof(MatInfo) , typeof(StockTakingOrder), typeof(StockTakingOrderMatDetail), typeof(InOutRecord) , typeof(DocumentSerialNumber), typeof(OrderLight), typeof(MatInfoLog) , typeof(AppVersion) @@ -102,21 +102,7 @@ namespace WCS.BLL.Manager } Logs.Write("【初始化数据库】DocumentSerialNumber", LogsType.StartBoot); - //初始化货架类型 - if (!DbHelp.db.Queryable().Any()) - { - var smartShelf = new ShelfTypeInfo() - { - ShelfTypeName = "智能货架" - }; - var singleLight = new ShelfTypeInfo() - { - ShelfTypeName = "信息化货架" - }; - DbHelp.db.Insertable(smartShelf).ExecuteCommand(); - DbHelp.db.Insertable(singleLight).ExecuteCommand(); - } - Logs.Write("【初始化数据库】初始化货架类型", LogsType.StartBoot); + //初始化权限数据库 AuthDbHelp.InitDb(); diff --git a/WCS.BLL/Services/IService/IMXL4Service.cs b/WCS.BLL/Services/IService/IMXL4Service.cs deleted file mode 100644 index 08e9a61..0000000 --- a/WCS.BLL/Services/IService/IMXL4Service.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using WCS.Model; -using WCS.Model.ApiModel.MXL4; -using WCS.Model.ApiModel.SingleLight; -using WCS.Model.WebSocketModel; - -namespace WCS.BLL.Services.IService -{ - /// - /// 处理、查询报警使用的服务 - /// - public interface IMXL4Service - { - public Task> sysOrderMXL4(SysOrderMXL4Request request); - } -} diff --git a/WCS.BLL/Services/IService/IStoreInfoService.cs b/WCS.BLL/Services/IService/IStoreInfoService.cs index fc9633e..a3f6141 100644 --- a/WCS.BLL/Services/IService/IStoreInfoService.cs +++ b/WCS.BLL/Services/IService/IStoreInfoService.cs @@ -52,13 +52,6 @@ namespace WCS.BLL.Services.IService /// public Task queryModuleVoltage(QueryModuleVoltageRequest request); - - /// - /// 查询库位历史电压值-非硬件查询 仅查询软件记录的历史电压 - /// - /// - /// - public Task queryStoreInfoHistoryVoltage(QueryStoreInfoHistoryVoltageRequest request); /// /// 标定+设置偏移量 /// diff --git a/WCS.BLL/Services/Service/MXL4Service.cs b/WCS.BLL/Services/Service/MXL4Service.cs deleted file mode 100644 index 2834501..0000000 --- a/WCS.BLL/Services/Service/MXL4Service.cs +++ /dev/null @@ -1,126 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.Xml.Xsl; -using TouchSocket.Core; -using WCS.BLL.DbModels; -using WCS.BLL.Manager; -using WCS.BLL.Services.IService; -using WCS.BLL.Tool; -using WCS.DAL; -using WCS.DAL.Db; -using WCS.DAL.Db.AuthDb; -using WCS.DAL.DbModels; -using WCS.Model; -using WCS.Model.ApiModel; -using WCS.Model.ApiModel.MXL4; -using WCS.Model.ApiModel.SingleLight; -using WCS.Model.ApiModel.User; -using WCS.Model.WebSocketModel; -using static System.Formats.Asn1.AsnWriter; -using static WCS.BLL.Tool.Helper; - -namespace WCS.BLL.Services.Service -{ - public class MXL4Service : IMXL4Service - { - public async Task> sysOrderMXL4(SysOrderMXL4Request request) - { - try - { - //第一步:获取所有库位码 校验库位在数据库中是否都存在 - var storeCodeList = request.List.Select(t => t.StoreCode) - .Distinct() - .ToList(); - var stores = DbHelp.db.Queryable() - .LeftJoin((si, sti) => si.ShelfTypeId == sti.Id) - .Where((si, sti) => sti.ShelfTypeName == "液晶货架") - .Where((si, sti) => storeCodeList.Contains(si.StoreCode)) - .Select((st, sti) => st) - .ToList(); - if (stores.Count < storeCodeList.Count) - { - var storeCodesInDB = stores.Select(t => t.StoreCode).ToList(); - storeCodeList.RemoveAll(t => storeCodesInDB.Contains(t)); - return new ResponseCommon - { - Code = 200, - Message = $"操作失败:库位【{string.Join(",", storeCodeList)}】不存在!", - }; - } - - //第二步 获取库位正在进行的任务 - //模式相同视为可以继续发送任务 - var currenTasks = DbHelp.db.Queryable() - .Where(t => storeCodeList.Contains(t.StoreCode)) - .ToList(); - var currenTasksNotThisMode = currenTasks.Where(t => t.TaskMode != request.OrderType).ToList(); ; - if (currenTasksNotThisMode.Any()) - { - var task = currenTasksNotThisMode.First(); - return new ResponseCommon - { - Code = 200, - Message = $"操作失败:库位【{task.StoreCode}】当前在{task.TaskMode}!", - }; - } - var tasks = new List(); - //生成任务数据 - foreach (var orderDetail in request.List) - { - var store = stores.Where(t => t.StoreCode == orderDetail.StoreCode).First(); - var task = new CurrentTask() - { - StoreId = store.Id, - StoreCode = store.StoreCode, - - Guid = orderDetail.Guid, - TaskMode = request.OrderType, - OrderNumber = request.OrderNumber, - ButtonColor = request.Corlor, - MatCode = orderDetail.MatCode, - MatName = orderDetail.MatName, - MatSpec = orderDetail.MatSpec, - MatBatch = orderDetail.MatBatch, - Qty = orderDetail.Qty - }; - tasks.Add(task); - } - try - { - DbHelp.db.BeginTran(); - DbHelp.db.Insertable(tasks).ExecuteCommand(); - DbHelp.db.CommitTran(); - } - catch (Exception ex) - { - DbHelp.db.RollbackTran(); - return new ResponseCommon - { - Code = 300, - Message = $"操作失败:{ex.Message}" - }; - } - //发送任务至各个标签 - return new ResponseCommon - { - Code = 200, - Message = "success" - }; - } - catch (Exception ex) - { - return new ResponseCommon - { - Code = 200, - Message = "操作失败:" + ex.Message, - - }; - } - } - } -} diff --git a/WCS.BLL/Services/Service/OutstoreService.cs b/WCS.BLL/Services/Service/OutstoreService.cs index 54682d6..44118cb 100644 --- a/WCS.BLL/Services/Service/OutstoreService.cs +++ b/WCS.BLL/Services/Service/OutstoreService.cs @@ -78,23 +78,6 @@ namespace WCS.BLL.Services.Service Message = "出库单据同步失败:缺少需要出库的物料类型!" }; } - //补齐货架类型名称 - if (string.IsNullOrEmpty(request.ShelfTypeName)) - { - var shelfType = await DbHelp.db.Queryable() - .Where(t => t.Id == request.ShelfTypeId) - .FirstAsync(); - if (shelfType == null) - { - return new ResponseBase() - { - Code = 201, - Message = $"出库单据同步失败:缺少必要参数!ShelfTypeId" - }; - } - else - request.ShelfTypeName = shelfType.ShelfTypeName; - } //保存数据 await DbHelp.db.BeginTranAsync(); @@ -1410,26 +1393,6 @@ namespace WCS.BLL.Services.Service }; } - //获取库位是否是信息化货架的库位 - var shelf = await DbHelp.db.Queryable() - .LeftJoin((si, sti) => si.ShelfTypeId == sti.Id) - .Where((si, sti) => si.Id == invetoryDetail.StoreId) - .Select((si, sti) => new - { - ShelfId = si.ShelfId, - ShelfTypeName = sti.ShelfTypeName - }) - .FirstAsync(); - if (shelf != null && shelf.ShelfTypeName != "信息化货架") - { - return new ResponseCommon() - { - Code = 201, - Message = $"该物料库存不在信息化货架上,不能进行出库!", - Data = null - }; - } - //物料需求明细校验 var outOrderDetail = await DbHelp.db.Queryable().Where(it => it.OrderNumber == request.OrderNumber) @@ -1470,26 +1433,6 @@ namespace WCS.BLL.Services.Service outOrderDetail.OutQty += invetoryDetail.MatQty; DbHelp.db.Updateable(outOrderDetail).ExecuteCommand(); - //蜂鸣器提示 - Task.Run(() => - { - Logs.Write("【单灯出库蜂鸣器提示】开始"); - if (shelf != null) - { - var Shelf = DbHelp.db.Queryable().Where(t => t.Id == shelf.ShelfId).First(); - if (Shelf != null) - { - TCPClient tCPClient = TCPClientManager.GetTCPClientByIPHost(Shelf.ClientIp); - byte[] lightOn = Helper.CommitOutstoreBee(Shelf.LightId); - tCPClient.Send(lightOn); - Logs.Write($"【单灯出库蜂鸣器提示】已发送指令"); - } - else - Logs.Write($"【单灯出库蜂鸣器提示】Shelf == null ID为{shelf.ShelfId}"); - } - else - Logs.Write("【单灯出库蜂鸣器提示】shelf == null"); - }); return new ResponseCommon() diff --git a/WCS.BLL/Services/Service/StoreInfoService.cs b/WCS.BLL/Services/Service/StoreInfoService.cs index 619e965..16bbb3f 100644 --- a/WCS.BLL/Services/Service/StoreInfoService.cs +++ b/WCS.BLL/Services/Service/StoreInfoService.cs @@ -492,39 +492,6 @@ namespace WCS.BLL.Services.Service } } - - /// - /// 发送指令获取模组的电压值 - /// - /// - /// - /// - public async Task queryStoreInfoHistoryVoltage(QueryStoreInfoHistoryVoltageRequest request) - { - try - { - //获取数据 - var list = await DbHelp.db.Queryable() - .Where(t => request.StoreIds.Contains(t.StoreId)) - .OrderByDescending(t => t.Id) - .ToListAsync(); - return new ResponseCommon() - { - Code = 200, - Message = "Success", - Data = list - }; - } - catch (Exception ex) - { - return new ResponseCommon() - { - Code = 300, - Message = "操作失败:" + ex.Message - }; - } - } - public async Task calibrationSetOffset(CalibrationSetOffsetRequest request) { try @@ -537,47 +504,6 @@ namespace WCS.BLL.Services.Service if (shelf != null && shelf is SmartShelf) { var smartShelf = (SmartShelf)shelf; - #region 记录当前模组所有库位的上一次的电压 - //2024/11/11 程心怡说刘一科长喊加的 - //需求来源:微信 - //软件加光衰标定值,观察光衰数据 - //相当于就是你那边软件要记录一下上一次标定的值 - //相当于,到时候我们这边板子上完了,我会手动用你的软件标定一次,你那边就记录数据。 - var time = DateTime.Now; - var historyList = new List(); - var storeInfos = DbHelp.db.Queryable() - .Where(t => t.ModuleId == module.Id) - .Where(t => t.BoardId == module.BoardId) - .OrderBy(t => t.LightNumber) - .ToList(); - storeInfos.ForEach(t => - { - historyList.Add(new StoreInfoHistoryVoltage() - { - StoreId = t.Id, - StoreCode = t.StoreCode, - ShelfTypeId = t.ShelfTypeId, - ModuleId = module.Id, - ModuleCode = t.ModuleCode, - ShelfId = t.ShelfId, - ShelfCode = t.ShelfCode, - BoardId = t.BoardId, - LightNumber = t.LightNumber, - Priority = t.Priority, - CurrentMatSn = t.CurrentMatSn, - CurrentVoltage = t.CurrentVoltage, - StandardVoltage = t.StandardVoltage, - OffsetVoltage = t.OffsetVoltage, - BigShelfCode = t.BigShelfCode, - R = t.R, - C = t.C, - Wei = t.Wei, - GroupName = t.GroupName, - CreateTime = time, - }); - }); - DbHelp.db.Insertable(historyList).ExecuteCommand(); - #endregion smartShelf.CalibrationSetOffset(module.Id, request.OffSet); isSend = true; } diff --git a/WCS.Model/ApiModel/MXL4/SysOrderMXL4Request.cs b/WCS.Model/ApiModel/MXL4/SysOrderMXL4Request.cs deleted file mode 100644 index 56242eb..0000000 --- a/WCS.Model/ApiModel/MXL4/SysOrderMXL4Request.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using WCS.BLL.DbModels.Task; - -namespace WCS.Model.ApiModel.MXL4 -{ - public class SysOrderMXL4Request : RequestBase - { - - /// - /// 按钮颜色 - /// - public ButtonColorEnum Corlor { get; set; } - - /// - /// 任务单号 - /// - public string OrderNumber { get; set; } - - /// - /// 任务类型 出库/入库/盘点 - /// - public TaskModeEnum OrderType { get; set; } - - /// - /// 单据明细 - /// - public List List { get; set; } - } - - public class MXL4OrderDetail - { - /// - /// Guid系统那边任务的主键 - /// - public Guid Guid { get; set; } - - /// - /// 库位编码 - /// - public string StoreCode { get; set; } - - /// - /// 物料编码 - /// - public string MatCode { get; set; } - - /// - /// 物料名称 - /// - public string MatName { get; set; } - - /// - /// 物料规格 - /// - public string MatSpec { get; set; } - - /// - /// 物料批次 - /// - public string MatBatch { get; set; } - - /// - /// 物料SN - /// - public string MatSN { get; set; } - - /// - /// 数量 - /// - public int Qty { get; set; } - } -} diff --git a/WCS.Model/ApiModel/MXL4/TaskEnum.cs b/WCS.Model/ApiModel/MXL4/TaskEnum.cs deleted file mode 100644 index b92b9a3..0000000 --- a/WCS.Model/ApiModel/MXL4/TaskEnum.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WCS.BLL.DbModels.Task -{ - /// - /// 按键灯颜色 - /// - public enum ButtonColorEnum - { - 红色 = 1, - 绿色 = 2, - 黄色 = 3, - 蓝色 = 4, - 紫色 = 5, - 青色 = 6, - 白色 = 7, - } - - public enum TaskModeEnum - { - 入库模式 = 0, - 出库模式 = 1, - 盘点模式 = 2 - } -} diff --git a/WCS.WebApi/Controllers/HomeController.cs b/WCS.WebApi/Controllers/HomeController.cs index 7d74fb0..4f31b5f 100644 --- a/WCS.WebApi/Controllers/HomeController.cs +++ b/WCS.WebApi/Controllers/HomeController.cs @@ -29,41 +29,6 @@ namespace WCS.WebApi.Controllers _selfCheckService = selfCheckService; } - [Route("getShelfTypes")] - [HttpPost(Name = "getShelfTypes")] - public async Task getShelfTypes(RequestBase request) - { - try - { - //直接获取当前所有货架类型并返回 - var shelfTypes = DbHelp.db.Queryable() - .Select(t => new ShelfTypeModel() - { - Id = t.Id, - ShelfTypeName = t.ShelfTypeName - }) - .ToList(); - return new PageQueryResponse() - { - Code = 200, - Message = "success", - Data = new PageQueryResponseData - { - Lists = shelfTypes, - Count = shelfTypes.Count - } - }; - } - catch (Exception ex) - { - return new PageQueryResponse() - { - Code = 300, - Message = $"查询失败:{ex.Message}", - }; - } - } - [Route("getShelfStatus")] [HttpPost(Name = "getShelfStatus")] public async Task getShelfStatus(GetShelfStatusRequest request) diff --git a/WCS.WebApi/Controllers/MXL4Controller.cs b/WCS.WebApi/Controllers/MXL4Controller.cs deleted file mode 100644 index baa4203..0000000 --- a/WCS.WebApi/Controllers/MXL4Controller.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using WCS.BLL.Services.IService; -using WCS.BLL.Services.Service; -using WCS.Model; -using WCS.Model.ApiModel; -using WCS.Model.ApiModel.MXL4; -using WCS.Model.ApiModel.SelfCheck; -using WCS.Model.ApiModel.SingleLight; -using WCS.Model.ApiModel.Stocktaking; -using WCS.Model.ApiModel.User; -using WCS.Model.WebSocketModel; - -namespace WCS.WebApi.Controllers -{ - /// - /// 液晶面板 煤科院钻探分院项目 - /// - [ApiController] - [Route("[controller]")] - public class MXL4Controller : ControllerBase - { - - public IMXL4Service _mxl4Service { get; set; } - - public MXL4Controller(IMXL4Service mxl4Service) - { - _mxl4Service = mxl4Service; - } - - [Route("sysOrderMXL4")] - [HttpPost(Name = "sysOrderMXL4")] - public async Task sysOrderMXL4(SysOrderMXL4Request request) - { - try - { - return await _mxl4Service.sysOrderMXL4(request); - } - catch (Exception ex) - { - return new ResponseBase() - { - Code = 300, - Message = "操作失败:" + ex.Message, - }; - } - } - - } -} diff --git a/WCS.WebApi/Controllers/StoreInfoController.cs b/WCS.WebApi/Controllers/StoreInfoController.cs index 4c95616..c278f84 100644 --- a/WCS.WebApi/Controllers/StoreInfoController.cs +++ b/WCS.WebApi/Controllers/StoreInfoController.cs @@ -66,12 +66,6 @@ namespace WCS.WebApi.Controllers return await _storeInfoService.queryModuleVoltage(request); } - [Route("queryStoreInfoHistoryVoltage")] - [HttpPost(Name = "queryStoreInfoHistoryVoltage")] - public async Task queryStoreInfoHistoryVoltage(QueryStoreInfoHistoryVoltageRequest request) - { - return await _storeInfoService.queryStoreInfoHistoryVoltage(request); - } [Route("calibrationSetOffset")] [HttpPost(Name = "calibrationSetOffset")] diff --git a/WCS.WebApi/Program.cs b/WCS.WebApi/Program.cs index ef77c18..afb0ef6 100644 --- a/WCS.WebApi/Program.cs +++ b/WCS.WebApi/Program.cs @@ -82,7 +82,6 @@ namespace WebApi builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); - builder.Services.AddScoped(); //롢ɵõģʽ builder.Services.AddSingleton();