WMS/WIDESEA_WMSServer/.vs/ProjectEvaluation/widesea_wmsserver.strings.v9.binBinary files differ
WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.995.13737/CodeChunks.dbBinary files differ
WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.995.13737/SemanticSymbols.dbBinary files differ
WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/46068755-0c27-498e-b4ef-d2ee7f39e8af.vsidxBinary files differ
WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/475e0097-8d79-4ade-8115-2df3f6920ebc.vsidxBinary files differ
WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/495dcb7d-0808-4295-8344-22604b0512d1.vsidxBinary files differ
WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/8243996f-363c-4613-87cd-1d30cb87c16e.vsidxBinary files differ
WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b8266b88-93a1-4523-87b3-6859ba57591b.vsidxBinary files differ
WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/c62f823c-87b1-4254-8b92-340321c32c9b.vsidxBinary files differ
WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/PalletTypeInfoService.cs
@@ -1,9 +1,13 @@ using System; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; using WIDESEA_Core; using WIDESEA_Core.BaseServices; using WIDESEA_Core.Const; using WIDESEA_IBasicRepository; using WIDESEA_IBasicService; using WIDESEA_Model.Models; @@ -15,5 +19,74 @@ public PalletTypeInfoService(IPalletTypeInfoRepository BaseDal) : base(BaseDal) { } /// <summary> /// æå°æçç /// </summary> /// <param name="num"></param> /// <returns></returns> public WebResponseContent PrintPalletCode(int num, string palletCodeType) { WebResponseContent content = new WebResponseContent(); try { List<string> PalletCodes = new List<string>(); for (int i = 0; i < num; i++) { //PalletCodes.Add(GetOrderPintCode("PalletCodes"),palletCodeType); } content= PrintPallet(PalletCodes); return content.OK(); } catch (Exception ex) { return content.Error("æªç¥é误ï¼è¯·è系管çå"); } } /// <summary> /// è·å订åç¼å· /// </summary> /// <param name="printCode"></param> /// <returns></returns> public string GetOrderPintCode(string printCode,string palletCodeType) { string PrintCode = ""; //var PrintSetting = SqlSugarHelper.DbWMS.Queryable<Dt_PrintSetting>().Where(x => x.PrintCode == printCode).ToList().FirstOrDefault(); //if (PrintSetting.Spare1 == DateTime.Now.ToString("yyyyMMdd")) //{ // PrintCode = PrintSetting.Spare1 + PrintSetting.PrintNo.ToString().PadLeft(PrintSetting.Spare2, '0'); // PrintSetting.PrintNo = PrintSetting.PrintNo + 1; //} //else //{ // PrintSetting.Spare1 = DateTime.Now.ToString("yyyyMMdd"); // PrintSetting.PrintNo = 2; // PrintCode = PrintSetting.Spare1 + 1.ToString().PadLeft(PrintSetting.Spare2, '0'); //} //SqlSugarHelper.DbWMS.Updateable(PrintSetting).ExecuteCommand(); return PrintCode; } /// <summary> /// è°ç¨æå°æçç æ¥å£ /// </summary> /// <param name="palletCodes"></param> /// <returns></returns> /// <exception cref="InvalidOperationException"></exception> public WebResponseContent PrintPallet(List<string> palletCodes) { var Base = ""; var ipAddress = ""; if (Base == null || ipAddress == null) { throw new InvalidOperationException("WMS IP æªé ç½®"); } var IpAddress = Base + ipAddress; //var result = HttpsClient.PostAsync(palletCodes.ToJsonString()).Result; //return JsonConvert.DeserializeObject<WebResponseContent>(); return WebResponseContent.Instance.OK(); } } } WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_FL.cs
@@ -90,7 +90,7 @@ if (palletTypeInfo.LocaitonCount == 2) { if (roadwayNo != "SC01_FL") if (roadwayNo != "SC01_DW") definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList(); else definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Column % 2 == 0).ToList(); @@ -122,7 +122,7 @@ { if (palletTypeInfo.LocaitonCount == 2) { if (roadwayNo != "SC01_FL") if (roadwayNo != "SC01_DW") undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList(); else undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 0).ToList(); WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs
@@ -52,7 +52,7 @@ "SC01_CP" => AssignLocation_CP(roadwayNo, palletType, palletTypeInfo, beRelocationCode, heightType), "SC02_CP" => AssignLocation_CP(roadwayNo, palletType, palletTypeInfo, beRelocationCode, heightType), "SC01_YS" => AssignLocation_YS(roadwayNo, palletType, palletTypeInfo, beRelocationCode, heightType), "SC01_FL" => AssignLocation_FL(roadwayNo, palletType, palletTypeInfo, beRelocationCode, heightType), "SC01_DW" => AssignLocation_FL(roadwayNo, palletType, palletTypeInfo, beRelocationCode, heightType), //"HA58" => AssignLocation_PP(roadwayNo, palletType, palletTypeInfo, beRelocationCode), //"HA152" => AssignLocation_GM(roadwayNo, palletType, palletTypeInfo, beRelocationCode), //"HA64" => AssignLocation_CSJ(roadwayNo, palletType, palletTypeInfo, beRelocationCode), WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IPalletTypeInfoService.cs
@@ -3,6 +3,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEA_Core; using WIDESEA_Core.BaseServices; using WIDESEA_Model.Models; @@ -10,5 +11,8 @@ { public interface IPalletTypeInfoService : IService<Dt_PalletTypeInfo> { WebResponseContent PrintPalletCode(int num, string palletCodeType); string GetOrderPintCode(string printCode,string palletCodeType); } } WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs
@@ -21,6 +21,7 @@ //WebResponseContent MaterielGroup(MaterielGroupDTO materielGroupDTO); WebResponseContent MaterielGroup(SaveModel saveModel); WebResponseContent NewMaterielGroup(SaveModel saveModel); WebResponseContent CPMaterielGroup(SaveModel saveModel); WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoService.cs
@@ -31,5 +31,8 @@ List<StockSelectViewDTO> GetStockSelectViews(string materielCode); List<Dt_StockInfo> GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, decimal needQuantity, out decimal residueQuantity); public List<Dt_StockInfo> DWANDYSGetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, string batchNo, decimal needQuantity, out decimal residueQuantity); } } WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/InboundOrderService.cs
@@ -349,7 +349,7 @@ } //è¯æ°´ï¼ä½æ¸©ä»ç»ç public WebResponseContent NEWMaterielGroup(SaveModel saveModel) public WebResponseContent NewMaterielGroup(SaveModel saveModel) { WebResponseContent content = new WebResponseContent(); try @@ -461,43 +461,8 @@ } 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) { @@ -517,7 +482,7 @@ OrderNo = inboundOrder.OrderNo, BatchNo = notGroupDetail.BatchNo, LinId = notGroupDetail.LinId, StockQuantity = (quantitys.FirstOrDefault()), StockQuantity = model.Quantity, Status = (int)StockStatusEmun.ç»çæå, Creater = "WMS", CreateDate = DateTime.Now, @@ -537,9 +502,9 @@ 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) { @@ -1311,6 +1276,7 @@ if (inboundOrderDetailOld != null) { inboundOrderDetailOld.OrderQuantity += item.OrderQuantity; inboundOrderDetailOld.OrderDetailStatus = OrderDetailStatusEnum.Inbounding.ObjToInt(); _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetailOld); } else WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_PrintSetting.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,54 @@ using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEA_Core.DB.Models; namespace WIDESEA_Model.Models { /// <summary> /// æå°é ç½® ///</summary> [SugarTable("Dt_PrintSetting")] public class Dt_PrintSetting : BaseEntity { /// <summary> /// å¤ æ³¨:åºåID /// é»è®¤å¼: ///</summary> [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] public int Id { get; set; } /// <summary> /// å¤ æ³¨:æå°ç¼ç /// é»è®¤å¼: ///</summary> [SugarColumn(ColumnName = "PrintCode")] public string PrintCode { get; set; } /// <summary> /// å¤ æ³¨:æå°æ°é /// é»è®¤å¼: ///</summary> [SugarColumn(ColumnName = "PrintNo")] public int PrintNo { get; set; } /// <summary> /// å¤ æ³¨:å¤ç¨ /// é»è®¤å¼: ///</summary> [SugarColumn(ColumnName = "Spare1")] public string? Spare1 { get; set; } /// <summary> /// å¤ æ³¨:å¤ç¨ /// é»è®¤å¼: ///</summary> [SugarColumn(ColumnName = "Spare2")] public int Spare2 { get; set; } } } WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs
@@ -355,11 +355,21 @@ { throw new Exception($"æªæ¾å°å¯åé åºå"); } List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, item.MaterielCode, needQuantity, out decimal residueQuantity); item.LockQuantity += needQuantity - residueQuantity; List<Dt_StockInfo> autoAssignStocks = new List<Dt_StockInfo>(); decimal newResidueQuantity = 0; if (warehouse.Any(x => x.WarehouseCode.Contains("DW")) || warehouse.Any(x => x.WarehouseCode.Contains("YS"))) { autoAssignStocks = _stockService.StockInfoService.DWANDYSGetOutboundStocks(stockInfos, item.MaterielCode, item.BatchNo, needQuantity,out decimal residueQuantity); newResidueQuantity = residueQuantity; } else { autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, item.MaterielCode, needQuantity, out decimal residueQuantity); newResidueQuantity = residueQuantity; } item.LockQuantity += needQuantity - newResidueQuantity; outStocks.AddRange(autoAssignStocks); decimal assignQuantity = needQuantity - residueQuantity; decimal assignQuantity = needQuantity - newResidueQuantity; List<Dt_OutboundOrderDetail> details = outboundOrderDetails.Where(x => !string.IsNullOrEmpty(x.BatchNo) ? x.BatchNo == item.BatchNo : true && x.MaterielCode == item.MaterielCode).ToList(); @@ -375,7 +385,17 @@ { palletAssignQuantity = outStockLockInfos.Where(x => x.MaterielCode == item.MaterielCode && x.PalletCode == autoAssignStocks[j].PalletCode).Sum(x => x.AssignQuantity);//åºåºè¯¦æ å·²åé æ°é } decimal palletOutboundQuantity = autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity); decimal palletOutboundQuantity = 0; if (warehouse.Any(x => x.WarehouseCode.Contains("DW")) || warehouse.Any(x => x.WarehouseCode.Contains("YS"))) { palletOutboundQuantity = autoAssignStocks[j].Details.Where(x => x.BatchNo == item.BatchNo).Sum(x => x.OutboundQuantity); } else { palletOutboundQuantity = autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity); } if (palletAssignQuantity < palletOutboundQuantity)//妿åºåºè¯¦æ å·²åé æ°éå°äºæçå·²åé æ°éï¼åå¯ä»¥ç»§ç»æ·»å 该æçåºåºä¿¡æ¯ { decimal orderDetailNeedQuantity = details[i].OrderQuantity - detailAssignQuantity; @@ -506,7 +526,8 @@ using (client = new HttpClient()) { // 2. åéè¯·æ± var response = HttpHelper.Post<WebResponseContent>(ToCancelOutFeedbackERP, postContent, "åºåºæç»åæ¶åä¼ ERP"); string url = $"{ToCancelOutFeedbackERP}?ids={Uri.EscapeDataString(ids)}"; var response = HttpHelper.Post<WebResponseContent>(url, "åºåºæç»åæ¶åä¼ ERP"); if (response.Code !=0) { WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoService.cs
@@ -1,6 +1,7 @@ using AutoMapper; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; using SqlSugar; using System; @@ -192,6 +193,112 @@ return outStocks; } //使¸©ãè¯æ°´åé åºå public List<Dt_StockInfo> DWANDYSGetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode,string batchNo ,decimal needQuantity, out decimal residueQuantity) { List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>(); decimal stockTotalQuantity = stockInfos.SelectMany(x => x.Details).Where(d => d.BatchNo == batchNo).Sum(v => v.StockQuantity - v.OutboundQuantity); stockInfos = stockInfos.Where(x => x.Details.Any(x => x.BatchNo == batchNo)).OrderBy(x => x.Id).ToList(); if (stockTotalQuantity >= needQuantity)//åºåå¤ { int index = 0; while (needQuantity > 0) { Dt_StockInfo stockInfo = stockInfos[index]; Dt_StockInfoDetail dt_StockInfoDetail = new Dt_StockInfoDetail(); foreach(var detail in stockInfo.Details) { if(detail.BatchNo == batchNo && detail.MaterielCode == materielCode) { dt_StockInfoDetail = detail; } } decimal useableStockQuantity = dt_StockInfoDetail.StockQuantity - dt_StockInfoDetail.OutboundQuantity; if (useableStockQuantity < needQuantity) { stockInfo.Details.ForEach(x => { if(x.MaterielCode == materielCode && x.BatchNo == batchNo) { x.OutboundQuantity = x.StockQuantity; } }); needQuantity -= useableStockQuantity; } else { stockInfo.Details.ForEach(x => { if (x.StockQuantity > x.OutboundQuantity && x.MaterielCode == materielCode && x.BatchNo == batchNo) { if (x.StockQuantity - x.OutboundQuantity >= needQuantity) { x.OutboundQuantity += needQuantity; needQuantity = 0; } else { needQuantity -= (x.StockQuantity - x.OutboundQuantity); x.OutboundQuantity = x.StockQuantity; } } }); } outStocks.Add(stockInfo); index++; } } else { for (int i = 0; i < stockInfos.Count; i++) { Dt_StockInfo stockInfo = stockInfos[i]; decimal useableStockQuantity = 0; foreach (var detail in stockInfo.Details) { if(detail.MaterielCode == materielCode && detail.BatchNo == batchNo) { useableStockQuantity = detail.StockQuantity - detail.OutboundQuantity; } } if (useableStockQuantity < needQuantity) { stockInfo.Details.ForEach(x => { if(x.MaterielCode == materielCode && x.BatchNo == batchNo) { x.OutboundQuantity = x.StockQuantity; } }); needQuantity -= useableStockQuantity; } else { stockInfo.Details.ForEach(x => { if (x.StockQuantity > x.OutboundQuantity && x.MaterielCode == materielCode && x.BatchNo == batchNo) { if (x.StockQuantity - x.OutboundQuantity >= needQuantity) { x.OutboundQuantity += needQuantity; needQuantity = 0; } else { needQuantity -= (x.StockQuantity - x.OutboundQuantity); x.OutboundQuantity = x.StockQuantity; } } }); } outStocks.Add(stockInfo); } } residueQuantity = needQuantity; return outStocks; } //å¯¼åº public override WebResponseContent Export(PageDataOptions options) { WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -889,6 +889,158 @@ } } } else if (warehouse.WarehouseCode.Contains("DW") || warehouse.WarehouseCode.Contains("YS")) { Dt_InboundOrder? inboundOrder = _inboundService.InbounOrderService.Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderNo == dt_StockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First(); //Dt_InboundOrderDetail? inboundOrderDetail = null; //åºåºå ¥åºé»è¾ if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt()) { int lastStatus = dt_LocationInfo.LocationStatus; dt_LocationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); // æ ¹æ®æçæç»è·å对åºçå ¥åºåæç» List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>(); // å¤çå¤ä¸ªåºåæç»çæ åµ foreach (var stockDetail in dt_StockInfo.Details) { if (!string.IsNullOrEmpty(stockDetail.OrderNo)) { var detail = inboundOrder.Details.FirstOrDefault(x => x.LinId == stockDetail.LinId && x.BatchNo == stockDetail.BatchNo); if (detail != null && !inboundOrderDetails.Any(x => x.Id == detail.Id)) { inboundOrderDetails.Add(detail); } } } if (!inboundOrderDetails.Any()) { return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçå ¥åºåæç»"); } // æ´æ°å ¥åºåæç»ç¶æ foreach (var inboundOrderDetail in inboundOrderDetails) { // æ£æ¥è¯¥æç»æ¯å¦å·²å ¨é¨å ¥åº decimal totalStockQuantity = dt_StockInfo.Details .Where(x => x.LinId == inboundOrderDetail.LinId && x.BatchNo == inboundOrderDetail.BatchNo) .Sum(x => x.StockQuantity); decimal orderQuantity = Convert.ToDecimal(inboundOrderDetail.OrderQuantity); decimal receiptQuantity = Convert.ToDecimal(inboundOrderDetail.ReceiptQuantity); decimal overInQuantity = Convert.ToDecimal(inboundOrderDetail.OverInQuantity); // æ´æ°æ¶è´§æ°é inboundOrderDetail.OverInQuantity = totalStockQuantity += overInQuantity; // æ£æ¥æ¯å¦å ¨é¨å®æ if (inboundOrderDetail.OverInQuantity == inboundOrderDetail.OrderQuantity) { inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); } else { inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Inbounding.ObjToInt(); } } ///æ´æ°åºåç¶æ dt_StockInfo.StockStatus = StockStatusEmun.å ¥åºå®æ.ObjToInt(); // æ´æ°åºåæç»ç¶æ dt_StockInfo.Details.ForEach(x => x.Status = StockStatusEmun.å ¥åºå®æ.ObjToInt()); try { _unitOfWorkManage.BeginTran(); // æ´æ°ä»»å¡ç¶æ UpdateTaskStatus(task); // æ´æ°è´§ä½ç¶æ UpdateLocationStatus(dt_LocationInfo, lastStatus); // æ´æ°åºåä¿¡æ¯ UpdateStockInfo(dt_StockInfo); // æ·»å è®°å½ AddRecords(task, dt_StockInfo, dt_LocationInfo, lastStatus); // æ´æ°å ¥åºåæç» if (inboundOrderDetails.Any()) { BaseDal.Db.Updateable(inboundOrderDetails).ExecuteCommand(); // æ£æ¥å ¥åºåæ¯å¦å ¨é¨å®æ bool allCompleted = inboundOrder.Details.All(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()); if (allCompleted) { inboundOrder.OrderStatus = InboundStatusEnum.å ¥åºå®æ.ObjToInt(); } else { inboundOrder.OrderStatus = InboundStatusEnum.å ¥åºä¸.ObjToInt(); } } // æ´æ°å ¥åºå UpdateInboundOrder(inboundOrder, inboundOrderDetails.FirstOrDefault()); // åæ®æ°éå ¨é¨ä¸æ¶å®æï¼å¤çWMSåä¼ if (inboundOrderDetails.Any(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()) && inboundOrder.System.Equals("ERP")) { if(inboundOrder.OrderStatus == InboundStatusEnum.å ¥åºå®æ.ObjToInt()) { bool allCompleted = inboundOrder.Details.All(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()); if (allCompleted) { foreach (var detail in inboundOrder.Details) { FeedBackInboundERP(inboundOrder.UpperOrderNo, detail.LinId); } } } } if (inboundOrder.OrderStatus == InboundStatusEnum.å ¥åºå®æ.ObjToInt() && inboundOrder.OrderType == 0 && inboundOrder.System.Equals("SMOM")) { } else if (inboundOrder.OrderStatus == InboundStatusEnum.å ¥åºå®æ.ObjToInt() && inboundOrder.OrderType == 2 && inboundOrder.System.Equals("SMOM")) { SendAllocateInfoToWMS(task, inboundOrder, dt_StockInfo); } _unitOfWorkManage.CommitTran(); return WebResponseContent.Instance.OK(); } catch (Exception ex) { _unitOfWorkManage.RollbackTran(); throw new Exception($"å ¥åºå¤ç失败ï¼{ex.Message}", ex); } } if (task.TaskType == TaskTypeEnum.SurplusReturn.ObjToInt() || task.TaskType == TaskTypeEnum.ReverseIn.ObjToInt()) { return ReturnInbound(task, dt_StockInfo, dt_LocationInfo); } if (task.TaskType == TaskTypeEnum.InInventory.ObjToInt()) { int lastStatus = dt_LocationInfo.LocationStatus; dt_LocationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); dt_StockInfo.StockStatus = StockStatusEmun.å ¥åºå®æ.ObjToInt(); // æ´æ°åºåæç»ç¶æ dt_StockInfo.Details.ForEach(x => x.Status = StockStatusEmun.å ¥åºå®æ.ObjToInt()); _unitOfWorkManage.BeginTran(); UpdateTaskStatus(task); UpdateLocationStatus(dt_LocationInfo, lastStatus); UpdateStockInfo(dt_StockInfo); AddRecords(task, dt_StockInfo, dt_LocationInfo, lastStatus); _unitOfWorkManage.CommitTran(); return WebResponseContent.Instance.OK(); } } else { Dt_InboundOrder? inboundOrder = _inboundService.InbounOrderService.Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderNo == dt_StockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First(); @@ -1786,6 +1938,41 @@ return WebResponseContent.Instance.Error($"å¤ç失败: {ex.Message}"); } } else if(warehouse.WarehouseCode.Contains("DW") || warehouse.WarehouseCode.Contains("YS")) { Dt_OutboundOrder inboundOrder = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrder>() .Where(x => x.OrderNo == task.OrderNo) .Includes(x => x.Details) .First(); if (inboundOrder == null) return WebResponseContent.Instance.Error("æªæ¾å°åºåºåä¿¡æ¯"); Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail(); foreach(var detail in stockInfo.Details) { outboundOrderDetail = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrderDetail>() .Where(x => x.OrderId == inboundOrder.Id && x.BatchNo == detail.BatchNo) .First(); if(outboundOrderDetail != null) break; } if (outboundOrderDetail.LocationName != null && outboundOrderDetail.LocationName != "") { foreach(var detail in stockInfo.Details) { outboundOrderDetail = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrderDetail>() .Where(x => x.OrderId == inboundOrder.Id && x.BatchNo == detail.BatchNo && x.LocationName == stockInfo.LocationCode) .First(); if (outboundOrderDetail != null) break; } } if (outboundOrderDetail == null) return WebResponseContent.Instance.Error("æªæ¾å°åºåºåä¿¡æ¯"); DWANDYSUpdateOutboundOrderDetails(stockInfo, inboundOrder, ref outboundOrderDetail); // 3. æ§è¡æ ¸å¿åºåºé»è¾ return ExecuteOutboundLogic(task, stockInfo, locationInfo, outboundOrderDetail, inboundOrder); } else { Dt_OutboundOrder inboundOrder = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrder>() @@ -1879,7 +2066,14 @@ _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); // æ´æ°åºåç¶æ ååºå if(locationInfo.RoadwayNo.Contains("DW") || locationInfo.RoadwayNo.Contains("YS")) { AddDWANDYSRetrueOrder(stockInfo, inboundOrder); } else { AddRetrueOrder(stockInfo, inboundOrder); } // åºååæ®æ°æ®æ¥æºæ´æ°è´§ä½ç¶æ if (inboundOrder.System == null) @@ -1958,6 +2152,39 @@ { inboundOrderDetail.OrderDetailStatus = OutboundStatusEnum.åºåºä¸.ObjToInt(); inboundOrder.OrderStatus = OutboundStatusEnum.åºåºä¸.ObjToInt(); } } if (inboundOrder.Details.Count == overCount) { inboundOrder.OrderStatus = OutboundStatusEnum.åºåºå®æ.ObjToInt(); } } //使¸©ãè¯æ°´ private void DWANDYSUpdateOutboundOrderDetails(Dt_StockInfo stockInfo, Dt_OutboundOrder inboundOrder, ref Dt_OutboundOrderDetail inboundOrderDetail) { string BatchNo = inboundOrderDetail.BatchNo; int overCount = inboundOrder.Details.Where(x => x.BatchNo == BatchNo).Count(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()); //inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BatchNo == stockInfo.Details.FirstOrDefault()?.BatchNo&&x.LPNNo==stockInfo.PalletCode); foreach (var item in stockInfo.Details) { if (inboundOrderDetail == null) continue; if(inboundOrderDetail.BatchNo == item.BatchNo) { inboundOrderDetail.OverOutQuantity += item.OutboundQuantity; if (inboundOrderDetail.OverOutQuantity == inboundOrderDetail.OrderQuantity) { inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); overCount++; } else if (inboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) { inboundOrderDetail.OrderDetailStatus = OutboundStatusEnum.åºåºä¸.ObjToInt(); inboundOrder.OrderStatus = OutboundStatusEnum.åºåºä¸.ObjToInt(); } } } if (inboundOrder.Details.Count == overCount) @@ -2228,8 +2455,7 @@ private void AddRetrueOrder(Dt_StockInfo stockInfo, Dt_OutboundOrder outboundOrder) { Dt_StockInfoDetail stockInfoDetail = _stockService.StockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>() .Where(x => x.StockId == stockInfo.Id) .First(); .Where(x => x.StockId == stockInfo.Id).First(); if (stockInfoDetail == null) { throw new Exception("建ç«ååºåæ¶ï¼æªæ¾å°è¯¥åºåä¿¡æ¯"); @@ -2289,6 +2515,95 @@ DeleteAndMoveIntoHtStockStatus(stockInfo); } } } //使¸©ãè¯æ°´ååºå private void AddDWANDYSRetrueOrder(Dt_StockInfo stockInfo, Dt_OutboundOrder outboundOrder) { List<Dt_StockInfoDetail> stockInfoDetails = _stockService.StockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>() .Where(x => x.StockId == stockInfo.Id).ToList(); Dt_ReturnOrder? lastReturnOrder = null; foreach (var stockInfoDetail in stockInfoDetails) { if (stockInfoDetail == null) { throw new Exception("建ç«ååºåæ¶ï¼æªæ¾å°è¯¥åºåä¿¡æ¯"); } if (outboundOrder.OrderType == OrderTypeEnum.忣åºåºå.ObjToInt()) { Dt_ReturnOrder returnOrder = _returnOrderRepository.QueryFirst(x => x.LPNNo == stockInfo.PalletCode && x.LocationCode == stockInfo.LocationCode && x.OrderStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()); if (returnOrder == null) { throw new Exception("忣åºåºåï¼æªæ¾å°å¯¹åºåæ£ååºåä¿¡æ¯"); } stockInfo.LocationCode = ""; stockInfo.StockStatus = StockStatusEmun.åæ£å ¥åº.ObjToInt(); stockInfo.Remark = "åæ£å ¥åº"; stockInfoDetail.OutboundQuantity = 0; stockInfoDetail.StockQuantity += returnOrder.OrderQuantity; stockInfoDetail.OrderNo = returnOrder.OrderNo; } else { bool allowCompeted = stockInfo.Details.All(x => x.StockQuantity == x.OutboundQuantity); if (allowCompeted) { DeleteAndMoveIntoHtStockStatus(stockInfo); } else { decimal returnQuantity = stockInfoDetail.StockQuantity - stockInfoDetail.OutboundQuantity; if (returnQuantity > 0) { Dt_ReturnOrder returnOrder = new Dt_ReturnOrder { MaterielCode = stockInfoDetail.MaterielCode, MaterielName = stockInfoDetail.MaterielName, BatchNo = stockInfoDetail.BatchNo, OrderQuantity = returnQuantity, ReceiptQuantity = returnQuantity, OrderStatus = InOrderStatusEnum.æªå¼å§.ObjToInt(), LinId = stockInfoDetail.LinId, LPNNo = stockInfo.PalletCode, Creater = "LK", CreateDate = DateTime.Now, OrderType = OrderTypeEnum.使ååºå.ObjToInt(), System = "WMS", Remark = stockInfoDetail.BatchNo }; if(lastReturnOrder != null) { lastReturnOrder.Remark = lastReturnOrder.Remark + $", {returnOrder.BatchNo}"; _returnOrderRepository.UpdateData(lastReturnOrder); } if (outboundOrder.System == "SMOM" && stockInfo.LocationCode != null) { returnOrder.LocationCode = stockInfo.LocationCode; } _unitOfWorkManage.BeginTran(); if(lastReturnOrder == null) { _returnOrderRepository.AddData(returnOrder); lastReturnOrder = returnOrder; } stockInfo.LocationCode = ""; stockInfo.StockStatus = StockStatusEmun.使éåº.ObjToInt(); stockInfo.Remark = "使éåº"; stockInfoDetail.OutboundQuantity = 0; stockInfoDetail.StockQuantity = returnQuantity; stockInfoDetail.OrderNo = lastReturnOrder.OrderNo; _stockService.StockInfoService.Repository.UpdateData(stockInfo); _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail); _unitOfWorkManage.CommitTran(); } } } } } @@ -2363,8 +2678,7 @@ var matchedStockDetail = stockInfoDetails.FirstOrDefault(x => x.MaterielCode == outboundDetail.MaterielCode && x.BatchNo == outboundDetail.BatchNo); if (matchedStockDetail == null) { matchedStockDetail = stockInfoDetails.FirstOrDefault(x => x.MaterielCode == outboundDetail.MaterielCode); matchedStockDetail = stockInfoDetails.FirstOrDefault(x =>x.MaterielCode == outboundDetail.MaterielCode); if (matchedStockDetail == null) { WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs
@@ -45,6 +45,12 @@ return Service.MaterielGroup(saveModel); } [HttpPost, HttpGet, Route("NewMaterielGroup")] public WebResponseContent NewMaterielGroup([FromBody] SaveModel saveModel) { return Service.NewMaterielGroup(saveModel); } [HttpPost, HttpGet, Route("CPMaterielGroup")] public WebResponseContent CPMaterielGroup([FromBody] SaveModel saveModel) { WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -18,8 +18,8 @@ "ReceiveWMSTaskAllocatein": "http://172.30.0.190:1031/api/dataportal/invoke", //è°æ¨ä»»å¡æ°éåä¼ WMS "ReceiveWMSTask": "http://192.168.110.172:9291/ReceiveWMSTask", //æ¥è¯¢åºåï¼ç¡®è®¤å ¥åºç«å° "ReceiveERPTaskout": "http://172.30.0.192:99/external/asrs/api/OutMaterialWarehousingCallback", //ç«åºåºåºæ°éä¿¡æ¯åä¼ ERP "CancelOutFeedbackERP": "http://172.30.0.192:99/external/asrs/api/CancelOutMaterialWarehousing", //åºåºåæç»åæ¶åä¼ ERP "ReceiveERPTaskout": "http://172.30.0.184:99/external/asrs/api/OutMaterialWarehousingCallback", //ç«åºåºåºæ°éä¿¡æ¯åä¼ ERP "CancelOutFeedbackERP": "http://172.30.0.184:99/external/asrs/api/CancelOutMaterialWarehousing", //åºåºåæç»åæ¶åä¼ ERP "InMaterialWarehousingCallback": "http://172.30.0.184:99/external/asrs/api/InMaterialWarehousingCallback", //å ¥åºå宿åä¼ ERP "CancelInMaterialWarehousing": "http://172.30.0.184:99/external/asrs/api/CancelInMaterialWarehousing", //å ¥åºååæ¶åä¼ ERP "ConnectionStringsEncryption": false, @@ -38,7 +38,7 @@ }, "ERP": "http://172.30.0.184:99", "WCS": "http://localhost:9291", "PrinterName": "192.168.99.3ä¸çLenovoM7605D", "PrinterName": "SHARP MX-5148NC PCL6", "ApiName": "WIDESEA", "ExpMinutes": 120, "QuartzJobAutoStart": true