| | |
| | | } |
| | | |
| | | //药水,低温仓组盘 |
| | | public WebResponseContent NEWMaterielGroup(SaveModel saveModel) |
| | | public WebResponseContent NewMaterielGroup(SaveModel saveModel) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | } |
| | | else |
| | | { |
| | | //if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt()) |
| | | //{ |
| | | return WebResponseContent.Instance.Error($"托盘号重复,该托盘已组过物料"); |
| | | //} |
| | | //beforeQuantity = stockInfo.Details.Sum(x => x.StockQuantity); |
| | | } |
| | | |
| | | if (warehouse.WarehouseCode == WarehouseEnum.SC01_BC.ToString()) |
| | | { |
| | | stockInfo.Remark = Initiallife.ToString(); |
| | | string batchNo = models.FirstOrDefault()?.LotNo ?? ""; |
| | | //Dt_StockInfoDetail existDetail = _stockRepository.StockInfoDetailRepository.QueryFirst(x => x.BatchNo == batchNo); |
| | | //if (existDetail != null) |
| | | //{ |
| | | // return WebResponseContent.Instance.Error($"{batchNo}测试架已存在"); |
| | | //} |
| | | if (models.Count >= 2) |
| | | { |
| | | return WebResponseContent.Instance.Error($"组盘明细不唯一"); |
| | | } |
| | | //if (palletCode.Substring(0, 1) == "6") |
| | | //{ |
| | | // stockInfo.PalletType = PalletTypeEnum.MediumPallet.ObjToInt(); |
| | | //} |
| | | //else |
| | | //{ |
| | | // stockInfo.PalletType = PalletTypeEnum.LargestPallet.ObjToInt(); |
| | | //} |
| | | } |
| | | else if (warehouse.WarehouseCode == WarehouseEnum.SC01_BC.ToString()) |
| | | { |
| | | if (models.Count >= 2) |
| | | { |
| | | return WebResponseContent.Instance.Error($"组盘明细不唯一"); |
| | | } |
| | | } |
| | | |
| | | List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); |
| | | foreach (var model in models) |
| | | { |
| | |
| | | OrderNo = inboundOrder.OrderNo, |
| | | BatchNo = notGroupDetail.BatchNo, |
| | | LinId = notGroupDetail.LinId, |
| | | StockQuantity = (quantitys.FirstOrDefault()), |
| | | StockQuantity = model.Quantity, |
| | | Status = (int)StockStatusEmun.组盘暂存, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | |
| | | stockInfoDetails.Add(stockInfoDetail); |
| | | |
| | | decimal decimalReceiptQuantity = Convert.ToDecimal(notGroupDetail.ReceiptQuantity); |
| | | decimal decimalModelQuantity = Convert.ToDecimal((quantitys.FirstOrDefault())); |
| | | decimal decimalModelQuantity = Convert.ToDecimal(notGroupDetail.OrderQuantity); |
| | | decimal decimalOrderQuantity = Convert.ToDecimal(notGroupDetail.OrderQuantity); |
| | | decimalReceiptQuantity += decimalModelQuantity; |
| | | decimalReceiptQuantity += model.Quantity; |
| | | // 检查是否超出订单数量 |
| | | if (decimalReceiptQuantity > decimalOrderQuantity) |
| | | { |
| | |
| | | }; |
| | | |
| | | var response = HttpHelper.Post<MomRequestContent>(ReceiveWMSTaskin, houseSyncretism, "立库入库数量回传WMS"); |
| | | // 判断Success的值 |
| | | if (!response.Success) |
| | | { |
| | | throw new Exception($"操作失败: {response.Message ?? "未提供错误信息"}"); |
| | |
| | | _stockRepository.StockInfoDetailRepository.DeleteData(sameItem.SourceItem); |
| | | } |
| | | _stockRepository.StockInfoRepository.UpdateData(targetstockInfo); |
| | | _stockRepository.StockInfoDetailRepository.UpdateData(targetstockInfo.Details); |
| | | _stockRepository.StockInfoRepository.DeleteData(stockInfo); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | |
| | | public int GetPalletType(Dt_Warehouse warehouse, string palletCode) |
| | | { |
| | | |
| | | if (warehouse.WarehouseCode == WarehouseEnum.SC01_BC.ObjToString()) |
| | | if (warehouse.WarehouseCode == WarehouseEnum.SC01_DW.ObjToString()) |
| | | { |
| | | Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.CodeStartStr == palletCode.Substring(0, 3)); |
| | | if (palletTypeInfo == null) |
| | |
| | | } |
| | | return palletTypeInfo.PalletType; |
| | | } |
| | | |
| | | |
| | | //else if (warehouse.WarehouseCode == WarehouseEnum.HA152.ObjToString()) |
| | | //{ |
| | | // Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.CodeStartStr == palletCode.Substring(0, 2)); |
| | |
| | | if (inboundOrderDetailOld != null) |
| | | { |
| | | inboundOrderDetailOld.OrderQuantity += item.OrderQuantity; |
| | | inboundOrderDetailOld.OrderDetailStatus = OrderDetailStatusEnum.Inbounding.ObjToInt(); |
| | | _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetailOld); |
| | | } |
| | | else |