dengjunjie
2025-10-27 bad7d319665205633b0f354c8f7a0c3df19aa06b
添加通知信息处理方法
已修改13个文件
212 ■■■■■ 文件已修改
新建文件夹/WIDESEA_WMSServer/ClassLibrary1/IInventoryInfoService.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/ClassLibrary1/IMessageInfoService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/ClassLibrary1/ISupplyTaskHtyService.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/ClassLibrary2/InventoryInfoService.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/ClassLibrary2/MessageInfoService.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/ClassLibrary2/SupplyTaskHtyService.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/ClassLibrary2/SupplyTaskService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_Model/Models/WMSInfo/Dt_SupplyTask.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_Model/Models/WMSInfo/Dt_SupplyTask_Hty.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WMSInfo/InventoryInfoController.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WMSInfo/MessageInfoController.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WMSInfo/SupplyTaskHtyController.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
н¨Îļþ¼Ð/WIDESEA_WMSServer/ClassLibrary1/IInventoryInfoService.cs
@@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_DTO.SquareCabin;
@@ -14,6 +15,10 @@
    public interface IInventoryInfoService : IService<Dt_InventoryInfo>
    {
        IRepository<Dt_InventoryInfo> Repository { get; }
        /// <summary>
        /// èŽ·å–åº“å­˜ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        WebResponseContent GetInventory();
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/ClassLibrary1/IMessageInfoService.cs
@@ -24,5 +24,6 @@
        /// <param name="messageRemark"></param>
        /// <returns></returns>
        WebResponseContent AddMessageInfo(MessageGroupByEnum groupByEnum, string messageName, string messageInfo, MessageStatusEnum statusEnum = MessageStatusEnum.Undisposed, string messageRemark = "");
        WebResponseContent DeleteAndIntoHty(int[] keys);
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/ClassLibrary1/ISupplyTaskHtyService.cs
@@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_Model.Models;
@@ -10,6 +11,10 @@
{
    public interface ISupplyTaskHtyService : IService<Dt_SupplyTask_Hty>
    {
        /// <summary>
        /// æ•°å­—孪生获取出入库任务历史
        /// </summary>
        /// <returns></returns>
        WebResponseContent GetInOutTasks();
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/ClassLibrary2/InventoryInfoService.cs
@@ -6,6 +6,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
@@ -23,7 +24,53 @@
        {
        }
        public IRepository<Dt_InventoryInfo> Repository => BaseDal;
        /// <summary>
        /// èŽ·å–åº“å­˜
        /// </summary>
        /// <returns></returns>
        public WebResponseContent GetInventory()
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                List<object> lists = new List<object>();
                #region å†·å†»åº“
                string WareCodeLD = WarehouseEnum.冷冻库.ObjToInt().ToString("000");
                List<Dt_InventoryInfo> inventoryInfosLD = BaseDal.QueryData(x => x.WarehouseCode == WareCodeLD);
                object LDQty = new
                {
                    name = WarehouseEnum.冷冻库.ObjToString(),
                    count = inventoryInfosLD.Sum(x => x.StockQuantity).ObjToInt()
                };
                lists.Add(LDQty);
                #endregion
                #region éº»ç²¾åº“
                string WareCodeMJ = WarehouseEnum.麻精库.ObjToInt().ToString("000");
                List<Dt_InventoryInfo> inventoryInfosMJ = BaseDal.QueryData(x => x.WarehouseCode == WareCodeMJ);
                object MJQty = new
                {
                    name = WarehouseEnum.麻精库.ObjToString(),
                    count = inventoryInfosMJ.Sum(x => x.StockQuantity).ObjToInt()
                };
                lists.Add(MJQty);
                #endregion
                #region å¤§ä»¶åº“
                string WareCodeDJ = WarehouseEnum.大件库.ObjToInt().ToString("000");
                List<Dt_InventoryInfo> inventoryInfosDJ = BaseDal.QueryData(x => x.WarehouseCode == WareCodeDJ);
                object DJQty = new
                {
                    name = WarehouseEnum.大件库.ObjToString(),
                    count = inventoryInfosDJ.Sum(x => x.StockQuantity).ObjToInt()
                };
                lists.Add(DJQty);
                #endregion
                content.OK(data: lists);
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/ClassLibrary2/MessageInfoService.cs
@@ -8,6 +8,7 @@
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_IWMsInfoServices;
using WIDESEA_Model.Models;
@@ -67,5 +68,24 @@
            }
            return content;
        }
        public WebResponseContent DeleteAndIntoHty(int[] keys)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                List<Dt_MessageInfo> messageInfos = BaseDal.QueryData(x => keys.Contains(x.Id));
                foreach (var item in messageInfos)
                {
                    item.MessageStatus = MessageStatusEnum.Processed.ObjToInt();
                    item.Modifier = App.User.UserName;
                }
                BaseDal.DeleteAndMoveIntoHty(messageInfos, OperateTypeEnum.人工完成);
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/ClassLibrary2/SupplyTaskHtyService.cs
@@ -3,8 +3,11 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Helper;
using WIDESEA_IWMsInfoServices;
using WIDESEA_Model.Models;
@@ -15,5 +18,38 @@
        public SupplyTaskHtyService(IRepository<Dt_SupplyTask_Hty> BaseDal) : base(BaseDal)
        {
        }
        public WebResponseContent GetInOutTasks()
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                List<object> list = new List<object>();
                DateTime dateTime = DateTime.Now.AddDays(-6).Date;
                List<Dt_SupplyTask_Hty> supplyTask_Hties = BaseDal.QueryData(x => x.InsertTime >= dateTime);
                for (int i = 6; i >= 0; i--)
                {
                    DateTime dateTime1 = DateTime.Now.AddDays(-i).Date;
                    DateTime dateTime2 = DateTime.Now.AddDays(-i + 1).Date;
                    var supplyTasks = supplyTask_Hties.Where(x => x.InsertTime >= dateTime1 && x.InsertTime < dateTime2).ToList();
                    var inQty = Convert.ToInt32(supplyTasks.Where(x => x.TaskType == TaskTypeEnum.In.ObjToInt() || x.TaskType == TaskTypeEnum.OutReturn.ObjToInt()).Sum(x => x.StockQuantity));
                    var outQty = Convert.ToInt32(supplyTasks.Where(x => x.TaskType == TaskTypeEnum.Out.ObjToInt() || x.TaskType == TaskTypeEnum.InReturn.ObjToInt()).Sum(x => x.StockQuantity));
                    list.Add(new
                    {
                        date = dateTime1.ToString("yyyy-MM-dd"),
                        @in = inQty,
                        @out = outQty,
                    });
                }
                content.OK(data: new
                {
                    daily = list
                });
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/ClassLibrary2/SupplyTaskService.cs
@@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_IWMsInfoServices;
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_Model/Models/WMSInfo/Dt_SupplyTask.cs
@@ -22,7 +22,7 @@
        /// ä¸»é”®
        /// </summary>
        [ImporterHeader(Name = "主键")]
        [ExporterHeader(DisplayName = "主键")]
        [ExporterHeader(DisplayName = "主键", IsIgnore = true)]
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int TaskId { get; set; }
@@ -30,7 +30,7 @@
        /// ä»»åŠ¡å·ï¼›è®¢å•è¯¦æƒ…ä¸»é”®ï¼šID
        /// </summary>
        [ImporterHeader(Name = "任务号")]
        [ExporterHeader(DisplayName = "任务号")]
        [ExporterHeader(DisplayName = "任务号", IsIgnore = true)]
        [SugarColumn(IsNullable = false, ColumnDescription = "任务号"), Sequence(nameof(SequenceEnum.SeqTaskNum), 100000000)]
        public int TaskNum { get; set; }
@@ -38,7 +38,7 @@
        /// æ‰˜ç›˜ç¼–号
        /// </summary>
        [ImporterHeader(Name = "托盘编号")]
        [ExporterHeader(DisplayName = "托盘编号")]
        [ExporterHeader(DisplayName = "托盘编号", IsIgnore = true)]
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "托盘编号")]
        public string PalletCode { get; set; }
@@ -78,7 +78,7 @@
        /// ä»»åŠ¡ç±»åž‹
        /// </summary>
        [ImporterHeader(Name = "任务类型")]
        [ExporterHeader(DisplayName = "任务类型")]
        [ExporterHeader(DisplayName = "任务类型", IsIgnore = true)]
        [SugarColumn(IsNullable = false, ColumnDescription = "任务类型")]
        public int TaskType { get; set; }
@@ -86,13 +86,15 @@
        /// ä»»åŠ¡çŠ¶æ€
        /// </summary>
        [ImporterHeader(Name = "任务状态")]
        [ExporterHeader(DisplayName = "任务状态")]
        [ExporterHeader(DisplayName = "任务状态", IsIgnore = true)]
        [SugarColumn(IsNullable = false, ColumnDescription = "任务状态")]
        public int TaskStatus { get; set; }
        /// <summary>
        /// åº“房编号
        /// </summary>
        [ImporterHeader(Name = "库房编号")]
        [ExporterHeader(DisplayName = "库房编号", IsIgnore = true)]
        [SugarColumn(IsNullable = false, Length = 30, ColumnDescription = "库房编号")]
        public string WarehouseCode { get; set; }
@@ -108,7 +110,7 @@
        /// åº“存数,任务数量
        /// </summary>
        [ImporterHeader(Name = "库存数")]
        [ExporterHeader(DisplayName = "库存数")]
        [ExporterHeader(DisplayName = "任务数")]
        [SugarColumn(IsNullable = false, ColumnDescription = "库存数")]
        public decimal StockQuantity { get; set; }
@@ -132,7 +134,7 @@
        /// ä»»åŠ¡ä¸‹å‘æ—¶é—´
        /// </summary>
        [ImporterHeader(Name = "任务下发时间")]
        [ExporterHeader(DisplayName = "任务下发时间")]
        [ExporterHeader(DisplayName = "创建时间")]
        [SugarColumn(IsNullable = true, ColumnDescription = "任务下发时间")]
        public DateTime? Dispatchertime { get; set; }
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_Model/Models/WMSInfo/Dt_SupplyTask_Hty.cs
@@ -21,7 +21,7 @@
        /// åŽŸè¡¨ä¸»é”®
        /// </summary>
        [ImporterHeader(Name = "原表主键")]
        [ExporterHeader(DisplayName = "原表主键")]
        [ExporterHeader(DisplayName = "原表主键", IsIgnore = true)]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "原表主键")]
        public int SourceId { get; set; }
@@ -37,7 +37,7 @@
        /// ç§»å…¥åŽ†å²æ—¶é—´
        /// </summary>
        [ImporterHeader(Name = "移入历史时间")]
        [ExporterHeader(DisplayName = "移入历史时间")]
        [ExporterHeader(DisplayName = "完成时间")]
        [SugarColumn(IsNullable = false, ColumnDescription = "移入历史时间")]
        public DateTime InsertTime { get; set; }
    }
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs
@@ -152,7 +152,7 @@
                        _unitOfWorkManage.RollbackTran();
                        _messageInfoService.AddMessageInfo(messageGroupBy, name, ex.Message, messageStatus);
                        SendErrorToUpstream(1, "", ex.Message, "");
                        return responseContent.Error("同步失败: " + ex.Message);
                        //return responseContent.Error("同步失败: " + ex.Message);
                    }
                };
                return responseContent.OK("同步入库单成功");
@@ -279,7 +279,7 @@
                        _unitOfWorkManage.RollbackTran();
                        _messageInfoService.AddMessageInfo(messageGroupBy, name, ex.Message, messageStatus);
                        SendErrorToUpstream(3, "", ex.Message, "");
                        return responseContent.Error("同步失败: " + ex.Message);
                        //return responseContent.Error("同步失败: " + ex.Message);
                    }
                }
                return responseContent.OK($"同步出库单成功,共{_DeliveryOrders.Count}条");
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WMSInfo/InventoryInfoController.cs
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_IWMsInfoServices;
@@ -15,7 +17,33 @@
        public InventoryInfoController(IInventoryInfoService service) : base(service)
        {
        }
        /// <summary>
        /// æ•°å­—孪生获取库存信息
        /// </summary>
        /// <param name="keys"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("GetInventory"), AllowAnonymous]
        public object GetInventory()
        {
            WebResponseContent content = Service.GetInventory();
            if (!content.Status)
            {
                return new
                {
                    code = "404",
                    note = content.Message
                };
            }
            else
            {
                return new
                {
                    code = "000",
                    note = "成功",
                    date = content.Data
                };
            }
        }
      
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WMSInfo/MessageInfoController.cs
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_IWMsInfoServices;
using WIDESEA_Model.Models;
@@ -13,5 +14,10 @@
        public MessageInfoController(IMessageInfoService service) : base(service)
        {
        }
        [HttpPost, HttpGet, Route("DeleteAndIntoHty")]
        public WebResponseContent DeleteAndIntoHty([FromBody] int[] keys)
        {
            return Service.DeleteAndIntoHty(keys);
        }
    }
}
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WMSInfo/SupplyTaskHtyController.cs
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_IWMsInfoServices;
using WIDESEA_Model.Models;
@@ -13,5 +15,28 @@
        public SupplyTaskHtyController(ISupplyTaskHtyService service) : base(service)
        {
        }
        [HttpPost, HttpGet, Route("GetInOutTasks"), AllowAnonymous]
        public object GetInOutTasks()
        {
            WebResponseContent content = Service.GetInOutTasks();
            if (!content.Status)
            {
                return new
                {
                    code = "404",
                    note = content.Message
                };
            }
            else
            {
                return new
                {
                    code = "000",
                    note = "成功",
                    date = content.Data
                };
            }
        }
    }
}