yanjinhui
2025-11-14 8344f9ceac01f8dd87c22efecf2b20bdcb6b0a56
优化盘点以及人工入库进行校正
已修改4个文件
41 ■■■■ 文件已修改
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WIDESEA_WMSServer/WIDESEA_WMSServer/GoodsJob.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新建文件夹/WMS/src/views/Alarm/MessageInfo_Hty.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs
@@ -142,6 +142,15 @@
                cabinOrderDetail.Order_Inqty += Inqty;
                if (cabinOrderDetail.Order_Inqty > cabinOrderDetail.Order_qty)
                    return WebResponseContent.Instance.Error($"入库数量不可超出单据数量");
                //大件库整箱校验
                if (warehouseCode == WarehouseEnum.大件库.ObjToInt().ToString("000"))
                {
                    var BoxRule = materielInfo.BoxQty;
                    if (BoxRule > 0 && Inqty % BoxRule != 0)
                    {
                        return WebResponseContent.Instance.Error($"大件库只允许存放整箱货物!当前入库数量 {Convert.ToInt32(Inqty)} ä¸æ˜¯ç®±è§„ {Convert.ToInt32(BoxRule)} çš„æ•´æ•°å€");
                    }
                }
                #region å¤„理入库单,货位,库存,库存批次信息
                _unitOfWorkManage.BeginTran();
@@ -162,6 +171,7 @@
                #region è´§ä½
                var location = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode);
                if (location == null) return WebResponseContent.Instance.Error($"请维护货位编号【{LocationCode}】的货位信息");
                //if (location.EnableStatus == EnableStatusEnum.Disable.ObjToInt())
                //    return WebResponseContent.Instance.Error($"货位编号【{LocationCode}】已禁用,请恢复正常再使用");
                if (location.WarehouseCode != cabinOrderDetail.Reservoirarea)
@@ -321,6 +331,16 @@
            {
                string WareCodeMJ = WarehouseEnum.麻精库.ObjToInt().ToString("000");
                string WareCodeLD = WarehouseEnum.冷冻库.ObjToInt().ToString("000");
                #region æ£€æŸ¥æ˜¯å¦æœ‰æœªå®Œæˆçš„盘点任务
                var dt_bath = _inventory_BatchServices.Repository.QueryData(x => order.details.Select(d => d.goods_no).Contains(x.MaterielCode)).ToList();
                if (dt_bath.Count>=1)
                {
                    foreach (var item in dt_bath)
                    {
                        if (item.SupplyQuantity > 0) throw new Exception($"入库单【{order.order_no}】物料编号【{dt_bath[0].MaterielCode}】存在未完成的盘盈入库任务,请处理完成后再进行正常入库操作");
                    }
                }
                #endregion
                List<Dt_CabinOrder> dt_CabinOrders = new List<Dt_CabinOrder>();
                #region ç‰¹æ®Šè¯å“å…¥ç‰¹æ®Šåº“房
                if (order.warehouse_no == WareCodeMJ || order.warehouse_no == WareCodeLD)
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs
@@ -247,6 +247,7 @@
                        Dt_Inventory_Batch? inventory_Batch = inventory_Batchs.Where(x => x.MaterielCode == item.Goods_no && x.BatchNo == item.Batch_num).FirstOrDefault();
                        if (inventory_Batch == null) throw new Exception($"未找到出库单号【{entityOrder.Out_no}】中物料编号【{item.Goods_no}】物料批次【{item.Batch_num}】的库存批次信息");
                        if (inventory_Batch.AvailableQuantity < item.Order_qty) throw new Exception($"出库单号【{entityOrder.Out_no}】中物料编号【{item.Goods_no}】物料批次【{item.Batch_num}】的库存批次信息可用数量不足");
                        if (inventory_Batch.SupplyQuantity > 0) throw new Exception($"出库单号【{entityOrder.Out_no}】中物料编号【{item.Goods_no}】物料批次【{item.Batch_num}】的库存批次信息存在未完成的盘点任务,无法创建出库单");
                        inventory_Batch.AvailableQuantity -= item.Order_qty;
                        inventory_Batch.OutboundQuantity += item.Order_qty;
                        List<Dt_InventoryInfo> dt_InventoryInfos = InventoryInfos.Where(x => x.MaterielCode == item.Goods_no && x.BatchNo == item.Batch_num).ToList();
@@ -324,6 +325,7 @@
                #endregion
                else
                {
                    string WareCodeDJ = WarehouseEnum.大件库.ObjToInt().ToString("000");
                    string WareCodeLK = WarehouseEnum.立库.ObjToInt().ToString("000");
                    #region åˆ›å»ºå¤§ä»¶åº“、立库出库头表
@@ -363,6 +365,7 @@
                        Dt_Inventory_Batch? inventory_Batch = inventory_Batchs.Where(x => x.MaterielCode == detail.goods_no && x.BatchNo == detail.batch_num).FirstOrDefault();
                        if (inventory_Batch == null) throw new Exception($"未找到出库单号【{outorder.order_no}】中物料编号【{detail.goods_no}】物料批次【{detail.batch_num}】的库存批次信息");
                        if (inventory_Batch.AvailableQuantity < detail.order_qty) throw new Exception($"出库单号【{outorder.order_no}】中物料编号【{detail.goods_no}】物料批次【{detail.batch_num}】的库存批次信息可用数量不足");
                        if(inventory_Batch.SupplyQuantity>0) throw new Exception($"出库单号【{outorder.order_no}】中物料编号【{detail.goods_no}】物料批次【{detail.batch_num}】的库存批次信息存在未完成的盘点任务,无法创建出库单");
                        inventory_Batch.AvailableQuantity -= detail.order_qty;
                        inventory_Batch.OutboundQuantity += detail.order_qty;
                        List<Dt_InventoryInfo> dt_InventoryInfos = InventoryInfos.Where(x => x.MaterielCode == inventory_Batch.MaterielCode && x.BatchNo == inventory_Batch.BatchNo).ToList();
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_WMSServer/GoodsJob.cs
@@ -1,22 +1,26 @@
using Pomelo.AspNetCore.TimedJob;
using WIDESEA_ISquareCabinServices;
using WIDESEA_ISystemService;
using WIDESEA_IWMsInfoServices;
using static WIDESEA_DTO.SquareCabin.TowcsDto;
namespace WIDESEA_WMSServer
{
    public class GoodsJob : Job
    {
        private readonly IMaterielInfoService _materielInfoService;
        public GoodsJob(IMaterielInfoService materielInfoService)
        private readonly ISys_LogService _logger;
        public GoodsJob(IMaterielInfoService materielInfoService, ISys_LogService logger)
        {
            _materielInfoService = materielInfoService;
            _logger=logger;
        }
        //每隔1秒执行一次
        [Invoke(Begin = "2025-09-01", Interval = 1000 * 5, IsEnabled = false, SkipWhileExecuting = true)]
        [Invoke(Begin = "2025-09-01", Interval = 1000 * 60 * 60 * 24 * 7, IsEnabled = true, SkipWhileExecuting = true)]
        public void Run()
        {
            Console.WriteLine($"物料信息任务执行结束:{DateTime.Now}");
            _logger.ScheduledDeletion();
            Console.WriteLine($"删除日志执行结束:{DateTime.Now}");
            //Console.WriteLine($"物料信息任务执行结束:{DateTime.Now}");
        }
    }
}
н¨Îļþ¼Ð/WMS/src/views/Alarm/MessageInfo_Hty.vue
@@ -136,7 +136,7 @@
        type: "string",
        width: 150,
        align: "center",
        bind: { key: "messageGroupBy", data: [] },
        bind: { key: "MessageGroupByEnum", data: [] },
        require: true,
      },
      {
@@ -145,7 +145,7 @@
        type: "string",
        width: 100,
        align: "center",
        bind: { key: "messageStatus", data: [] },
        bind: { key: "MessageStatusEnum", data: [] },
        require: true,
      },
      {