1
wankeda
2026-03-02 600f659aa5cbfc0cca52d883f4299cbb8dd66dcd
WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/InboundOrderService.cs
@@ -469,7 +469,8 @@
                    Dt_InboundOrderDetail notGroupDetail = new Dt_InboundOrderDetail();
                    notGroupDetail = inboundOrder.Details.Where(x => x.OrderDetailStatus <= OrderDetailStatusEnum.Inbounding.ObjToInt() && x.MaterielCode == model.MaterielCode && x.BatchNo == model.LotNo).FirstOrDefault();
                    notGroupDetail = inboundOrder.Details.Where(x => x.OrderDetailStatus <= OrderDetailStatusEnum.Inbounding.ObjToInt() && x.MaterielCode == model.MaterielCode && x.SupplierBatch == model.LotNo && x.OrderQuantity > x.ReceiptQuantity).FirstOrDefault();
                    if (notGroupDetail.MaterielType == 1)
                    {
                        stockInfo.WarehouseId = 6;
@@ -743,6 +744,8 @@
                            QtyOfpcs = item.QtyOfpcs,
                            QtyOfxout = item.QtyOfxout,
                            CPStockDetailStatus = (int)StockStatusEmun.组盘暂存,
                            LPNNO = item.LPNNO,
                            OrinalLocation = item.OrinalLocation,
                            Creater = "上游WMS",
                        };
                        stockInfoDetailCP.Add(stockInfoDetailCP1);
@@ -1136,6 +1139,7 @@
        #endregion
        public string ReceiveWMSTaskin = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveWMSTaskin"];
        /// <summary>
        /// 组盘合托
        /// </summary>
@@ -1295,7 +1299,7 @@
        public int GetPalletType(Dt_Warehouse warehouse, string palletCode)
        {
            if (warehouse.WarehouseCode == WarehouseEnum.SC01_BC.ObjToString())
            if (warehouse.WarehouseCode.Contains("BC"))
            {
                Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.CodeStartStr == palletCode.Substring(0, 3));
                if (palletTypeInfo == null)
@@ -1313,35 +1317,7 @@
                }
                return palletTypeInfo.PalletType;
            }
            //else if (warehouse.WarehouseCode == WarehouseEnum.HA152.ObjToString())
            //{
            //    Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.CodeStartStr == palletCode.Substring(0, 2));
            //    if (palletTypeInfo == null)
            //    {
            //        throw new Exception($"托盘号错误");
            //    }
            //    return palletTypeInfo.PalletType;
            //}
            //else if (warehouse.WarehouseCode == WarehouseEnum.HA57.ObjToString())
            //{
            //    Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.CodeStartStr == palletCode.Substring(0, 3));
            //    if (palletTypeInfo == null)
            //    {
            //        throw new Exception($"托盘号错误");
            //    }
            //    return palletTypeInfo.PalletType;
            //}
            //else if (warehouse.WarehouseCode == WarehouseEnum.HA58.ObjToString())
            //{
            //    Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.CodeStartStr == palletCode.Substring(0, 2));
            //    if (palletTypeInfo == null)
            //    {
            //        throw new Exception($"托盘号错误");
            //    }
            //    return palletTypeInfo.PalletType;
            //}
            return -1;
            return 0;
        }
        /// <summary>
        /// 判断正确时间格式
@@ -1415,10 +1391,6 @@
                    }
                    if (warehouse.WarehouseCode.Contains("CP"))
                    {
                        if (item.SupplierBatch == null)
                        {
                            return content.Error("供应商批次不可为空");
                        }
                        Dt_InboundOrder inboundOrderOld = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == model.AsnNo).Includes(x => x.Details).First();
                        if (inboundOrderOld != null)
@@ -1450,6 +1422,8 @@
                                        QtyOfpcs = (float)list.QtyOfpcs,
                                        QtyOfxout = (float)list.QtyOfxout,
                                        CPOrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(),
                                        LPNNO = list.LPNNO,
                                        OrinalLocation = list.OrinalLocation,
                                        Creater = "上游WMS",
                                    };
                                    cPInboundOrderDetail.Add(cPInboundOrderDetail1);
@@ -1492,6 +1466,8 @@
                                    QtyOfpcs = (float)list.QtyOfpcs,
                                    QtyOfxout = (float)list.QtyOfxout,
                                    CPOrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(),
                                    LPNNO = list.LPNNO,
                                    OrinalLocation = list.OrinalLocation,
                                    Creater = "上游WMS",
                                };
                                cPInboundOrderDetail.Add(cPInboundOrderDetail1);
@@ -1514,7 +1490,6 @@
                                OrinalLocation = item.OrinalLocation,
                                CPDetails = cPInboundOrderDetail
                            };
                            Dt_InboundOrder inboundOrder = new Dt_InboundOrder()
                            {
                                OrderNo = model.AsnNo,
@@ -1552,10 +1527,10 @@
                    }
                    else
                    {
                        if (item.SupplierBatch == null)
                        {
                            return content.Error("供应商批次不可为空");
                        }
                        //if (item.SupplierBatch == null)
                        //{
                        //    return content.Error("供应商批次不可为空");
                        //}
                        Dt_InboundOrder inboundOrderOld = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == model.AsnNo).Includes(x => x.Details).First();
                        if (inboundOrderOld != null)
@@ -1579,7 +1554,7 @@
                                {
                                    OrderId = orderDetail1.OrderId,
                                    MaterielCode = item.MaterielCode,
                                    MaterielType=item.MaterielType,
                                    MaterielType = item.MaterielType,
                                    BatchNo = item.BatchNo,
                                    OrderQuantity = item.OrderQuantity,
                                    ReceiptQuantity = 0,
@@ -1775,11 +1750,11 @@
                List<Dt_InboundOrder> dt_ReceiveOrders = new List<Dt_InboundOrder>();
                if (string.IsNullOrEmpty(orderNo))
                {
                    dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderStatus < InboundStatusEnum.入库完成.ObjToInt() && x.WarehouseId == warehouseId).Includes(x => x.Details).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 10);
                    dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderStatus < InboundStatusEnum.入库完成.ObjToInt() && x.WarehouseId == warehouseId).Includes(x => x.Details).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 50);
                }
                else
                {
                    dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => (x.OrderNo.Contains(orderNo)) && x.OrderStatus < InboundStatusEnum.入库完成.ObjToInt() && x.WarehouseId == warehouseId).Includes(x => x.Details).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 10);
                    dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => (x.OrderNo.Contains(orderNo)) && x.OrderStatus < InboundStatusEnum.入库完成.ObjToInt() && x.WarehouseId == warehouseId).Includes(x => x.Details).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 50);
                }
                content.OK(data: dt_ReceiveOrders);
@@ -1942,7 +1917,7 @@
        }
        //反拣回库单
        public WebResponseContent ReceiveReturnOrder(List<HouseReturnOrder> houseReturnOrder)
       {
        {
            try
            {
                Random random = new Random();