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; @@ -1298,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) @@ -1316,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> /// 判断正确时间格式 @@ -1777,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); WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Service/InboundOrderDetailService.cs
@@ -57,8 +57,11 @@ { string orderNo = saveModel.MainData["orderNo"].ToString(); Dt_InboundOrder inboundOrder = Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderNo == orderNo).Includes(x => x.Details).First(); if (inboundOrder != null) { content.OK(data: inboundOrder.Details); } } catch (Exception ex) { content.Error(ex.Message); WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/NewPartialTaskService_Outbound.cs
@@ -412,39 +412,41 @@ if (stockInfoDetailCPList != null) { _stockInfoDetailCPRepository.DeleteAndMoveIntoHty(stockInfoDetailCPList, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成); foreach(var stockLPNO in houseStockDetail.DetailList) { Dt_StockInfo dt_StockInfo = BaseDal.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == stockLPNO.LPNNo).Includes(x => x.Details).First(); for (int i = 0; i<stockInfoDetailCPList.Count(); i++) { foreach (var item1 in dt_StockInfo.Details) Dt_StockInfo dt_StockInfo = BaseDal.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == item.LPNNo).Includes(x => x.Details).First(); if (dt_StockInfo == null) { foreach (var batchNos in houseStockDetail.DetailList) { if (stockInfoDetailCPList[i].PartNum == item1.MaterielCode && batchNos.BatchNo == item.BatchNo) { item1.StockQuantity-=(decimal)stockInfoDetailCPList[i].QtyOfpcs; item1.OutboundQuantity = 0; _stockInfoDetailRepository.UpdateData(item1); return WebResponseContent.Instance.Error($"托盘{item.LPNNo}无箱码明细信息"); } if (item1.StockQuantity == 0) List<Dt_StockInfoDetail> stockdetails = dt_StockInfo.Details; var matchedDetail = stockdetails.FirstOrDefault(d => d.MaterielCode.Contains(stockInfoDetailCPList[i].PartNum) && d.BatchNo.Contains(item.BatchNo)); if (matchedDetail != null) { _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(item1, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成); matchedDetail.StockQuantity -= (decimal)stockInfoDetailCPList[i].QtyOfpcs; matchedDetail.OutboundQuantity += (decimal)stockInfoDetailCPList[i].QtyOfpcs; _stockInfoDetailRepository.UpdateData(matchedDetail); if (matchedDetail.StockQuantity == 0) { _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(matchedDetail, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成); } //全部都出库 删除库存 } else { return WebResponseContent.Instance.Error($"托盘{item.LPNNo}中未找到物料{stockInfoDetailCPList[i].PartNum}和批次{item.BatchNo}的明细"); } if (dt_StockInfo.Details.Sum(x => x.StockQuantity) == 0) { _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(dt_StockInfo, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成); } } } } } } _unitOfWorkManage.CommitTran(); } } catch (Exception ex) { WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
@@ -645,9 +645,8 @@ //查询仓库托盘货物类型 public int GetPalletType(Dt_Warehouse warehouse, string palletCode) { if (warehouse.WarehouseCode == WarehouseEnum.SC01_BC.ObjToString() || warehouse.WarehouseCode == WarehouseEnum.SC02_BC.ObjToString()) if (warehouse.WarehouseCode.Contains("BC")) { Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.CodeStartStr == palletCode.Substring(0, 3)); if (palletTypeInfo == null) { @@ -655,25 +654,16 @@ } 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; //} return 3; else { Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.CodeStartStr == palletCode.Substring(0, 2)); if (palletTypeInfo == null) { throw new Exception($"托盘号错误"); } return palletTypeInfo.PalletType; } return 0; } WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
@@ -1161,7 +1161,15 @@ BaseDal.AddData(tasks); _basicService.LocationInfoService.Repository.UpdateLocationStatus(locationInfos, locationStatus); _unitOfWorkManage.CommitTran(); if (tasks.FirstOrDefault().PalletCode.Contains("BC")) { PushTasksToWCS(tasks); } else { PushTasksWCS(tasks); } content.OK(); } catch (Exception ex) WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -3589,12 +3589,11 @@ { Console.WriteLine($"📄 正在打印到 {printerName}: {Path.GetFileName(filePath)}"); string command = $"lpr -P {printerName} \"{filePath}\""; // 使用 lp 命令,添加 -o raw 选项 string command = $"lp -d {printerName} -o raw \"{filePath}\""; ExecuteShellCommand(command); } /// <summary> /// 执行 Shell 命令 /// </summary>