wangxinhui
2 天以前 2c889b38311883ceb703c4e0034c798fdaa2e21c
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -100,6 +100,7 @@
                        PalletType = stockInfo.PalletType,
                        MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode,
                        Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity),
                        BatchNo = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.BatchNo
                    };
                    //获取是否存在入库单
                    Dt_InboundOrder? inboundOrder =  null;
@@ -395,10 +396,12 @@
                    };
                    string MaterielCodeGMPP = stockInfoPPorGM.Details?.Where(x => x.StockId == stockInfoPPorGM.Id).FirstOrDefault()?.MaterielCode;
                    float QuantityGMPP = (float)stockInfoPPorGM.Details?.Where(x => x.StockId == stockInfoPPorGM.Id).Sum(x => x.StockQuantity);
                    if (MaterielCodeGMPP != null && QuantityGMPP != null)
                    string batchNo = stockInfoPPorGM.Details?.Where(x => x.StockId == stockInfoPPorGM.Id).FirstOrDefault()?.BatchNo;
                    if (MaterielCodeGMPP != null && QuantityGMPP != null && batchNo != null)
                    {
                        newTaskPPorGM.MaterielCode = MaterielCodeGMPP;
                        newTaskPPorGM.Quantity = QuantityGMPP;
                        newTaskPPorGM.BatchNo = batchNo;
                    }
                    //获取是否存在入库单
@@ -469,10 +472,12 @@
                };
                string MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode;
                float Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity);
                if (MaterielCode != null && Quantity != null)
                string BatchNo = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.BatchNo;
                if (MaterielCode != null && Quantity != null && BatchNo != null)
                {
                    newTask.MaterielCode = MaterielCode;
                    newTask.Quantity = Quantity;
                    newTask.BatchNo = BatchNo;
                }
                //获取是否存在入库单
@@ -594,10 +599,12 @@
                };
                string MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode;
                float Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity);
                if (MaterielCode != null && Quantity != null)
                string BatchNo = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.BatchNo;
                if (MaterielCode != null && Quantity != null && BatchNo != null)
                {
                    newTask.MaterielCode = MaterielCode;
                    newTask.Quantity = (float)Quantity;
                    newTask.Quantity = Quantity;
                    newTask.BatchNo = BatchNo;
                }
                if (stockInfo.StockStatus == StockStatusEmun.手动组盘暂存.ObjToInt())
@@ -700,10 +707,12 @@
                };
                string MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode;
                float Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity);
                if (MaterielCode != null && Quantity != null)
                string BatchNo = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.BatchNo;
                if (MaterielCode != null && Quantity != null && BatchNo != null)
                {
                    newTask.MaterielCode = MaterielCode;
                    newTask.Quantity = Quantity;
                    newTask.BatchNo = BatchNo;
                }
                if (stockInfo.StockStatus == StockStatusEmun.手动组盘暂存.ObjToInt())
                {
@@ -844,7 +853,7 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                //获取测试架原库存信息
                //获取阻焊库存信息
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA154.ToString());
                //获取库存记录
                List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x =>
@@ -863,21 +872,21 @@
                {
                    return content.Error($"托盘类型信息不存在");
                }
                ////获取阻焊批次
                //WebResponseContent requestLotInfo = GetZHMesMaterialLot(materialLot);
                //if (!requestLotInfo.Status)
                //{
                //    return content.Error($"请求阻焊批次信息失败,{requestLotInfo.Message}");
                //}
                //MesLotInfoModel mesLotInfo = JsonConvert.DeserializeObject<MesLotInfoModel>(requestLotInfo.Data.ToString());
                MesLotInfoModel mesLotInfo = new MesLotInfoModel()
                //获取阻焊批次
                WebResponseContent requestLotInfo = GetZHMesMaterialLot(materialLot);
                if (!requestLotInfo.Status)
                {
                    Product="FH001",
                    ProductVersion="A1",
                    Qty=20,
                    LotNo= materialLot,
                    IsFullNumber=true
                };
                    return content.Error($"请求阻焊批次信息失败,{requestLotInfo.Message}");
                }
                MesLotInfoModel mesLotInfo = JsonConvert.DeserializeObject<MesLotInfoModel>(requestLotInfo.Data.ToString());
                //MesLotInfoModel mesLotInfo = new MesLotInfoModel()
                //{
                //    Product="FH001",
                //    ProductVersion="A1",
                //    Qty=20,
                //    LotNo= materialLot,
                //    IsFullNumber=true
                //};
                Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail()
                {
                    MaterielSpec = mesLotInfo.ProductVersion,
@@ -921,6 +930,7 @@
                    WarehouseId = warehouse.WarehouseId,
                    MaterielCode = mesLotInfo.Product,
                    Quantity = (float)mesLotInfo.Qty,
                    BatchNo = mesLotInfo.LotNo
                };
                _unitOfWorkManage.BeginTran();
                Db.InsertNav(stockInfo).Include(x => x.Details).ExecuteCommand();
@@ -1033,7 +1043,9 @@
                    WarehouseId = warePoint.WarehouseId,
                    PalletType = proStockInfo.PalletType,
                    MaterielCode = proStockInfo.proStockInfoDetails?.Where(x => x.ProStockId == proStockInfo.Id).FirstOrDefault()?.ProductCode,
                    Quantity = (float)proStockInfo.proStockInfoDetails?.Where(x => x.ProStockId == proStockInfo.Id).Sum(x => x.StockPcsQty)
                    Quantity = (float)proStockInfo.proStockInfoDetails?.Where(x => x.ProStockId == proStockInfo.Id).Sum(x => x.StockPcsQty),
                    BatchNo = proStockInfo.proStockInfoDetails?.Where(x => x.ProStockId == proStockInfo.Id).FirstOrDefault()?.LotNumber
                };
                _unitOfWorkManage.BeginTran();
                int taskId = BaseDal.AddData(newTask);