diff --git a/src/WMS.Web.Domain/Entitys/InstockTask.cs b/src/WMS.Web.Domain/Entitys/InstockTask.cs index dd6b1510..af08c760 100644 --- a/src/WMS.Web.Domain/Entitys/InstockTask.cs +++ b/src/WMS.Web.Domain/Entitys/InstockTask.cs @@ -103,11 +103,18 @@ namespace WMS.Web.Domain.Entitys public void Create(InstockType type, string sourceBillNo, DateTime createTime, int supplierId, string orgCode) { if (type == InstockType.Purchase) + { this.Status = InstockStatus.Wait; + } + else if (type == InstockType.ProduceSotck) + { this.Status = InstockStatus.Wait; + } else + { this.Status = InstockStatus.WaitInStock; + } this.Type = type; this.SourceBillNo = sourceBillNo; this.SupplierId = supplierId; @@ -205,6 +212,8 @@ namespace WMS.Web.Domain.Entitys this.Status = InstockStatus.Already; else if (totalReceiveQty <= 0 && this.Type == InstockType.Purchase) this.Status = InstockStatus.Wait; + else if (totalReceiveQty <= 0 && this.Type == InstockType.ProduceSotck) + this.Status = InstockStatus.Wait; else if (totalRealityQty <= 0) this.Status = InstockStatus.WaitInStock; else diff --git a/src/WMS.Web.Domain/Services/BoxInventoryService.cs b/src/WMS.Web.Domain/Services/BoxInventoryService.cs index 6d6cb86a..c255190b 100644 --- a/src/WMS.Web.Domain/Services/BoxInventoryService.cs +++ b/src/WMS.Web.Domain/Services/BoxInventoryService.cs @@ -2016,6 +2016,9 @@ namespace WMS.Web.Domain.Services return OrderType.Stkdirecttransfers_In; case InstockType.StktransferInst: return OrderType.StktransferInst_In; + case InstockType.ProduceSotck: + return OrderType.ProduceSotck_In; + default: return OrderType.StktransferInst_In; } diff --git a/src/WMS.Web.Domain/Services/InStockTaskService.cs b/src/WMS.Web.Domain/Services/InStockTaskService.cs index 26fe8ed2..5c3cbabd 100644 --- a/src/WMS.Web.Domain/Services/InStockTaskService.cs +++ b/src/WMS.Web.Domain/Services/InStockTaskService.cs @@ -313,7 +313,7 @@ namespace WMS.Web.Domain.Services List TransferDirect_sourceBillNos = new List(); List Transferin_sourceBillNos = new List(); List AssembledApp_sourceBillNos = new List(); - + List ProduceStock_sourceBillNos = new List(); var taskList = await _inStockTaskRepositories.GetListBy(billNos); foreach (var entity in taskList) { @@ -327,6 +327,10 @@ namespace WMS.Web.Domain.Services AssembledApp_sourceBillNos.Add(entity.SourceBillNo); else if (entity.Type == InstockType.Miscellaneous) Miscellaneous_sourceBillNos.Add(entity.SourceBillNo); + else if (entity.Type == InstockType.ProduceSotck) + ProduceStock_sourceBillNos.Add(entity.SourceBillNo); + + } if (Instock_sourceBillNos.Count() > 0) @@ -364,6 +368,15 @@ namespace WMS.Web.Domain.Services if (!AssembledApp_result.IsSuccess) return Result.ReFailure(AssembledApp_result.Message, AssembledApp_result.Status); } + + if (ProduceStock_sourceBillNos.Count() > 0) + { + //5.同步数据:生产汇报单 + var ProduceStock_result = await this.SsynPurchaseInStock(ProduceStock_sourceBillNos, isTransaction); + if (!ProduceStock_result.IsSuccess) + return Result.ReFailure(ProduceStock_result.Message, ProduceStock_result.Status); + } + } return Result.ReSuccess(); } @@ -634,16 +647,16 @@ namespace WMS.Web.Domain.Services bool IsAny = details_Groups.Any(d => d.RealityQtyTotal != 0 && d.AccruedQtyTotal > d.RealityQtyTotal); if (IsAny) order.Status = InstockStatus.Part; - else if (details_Groups.Sum(x => x.ReceiveQtyTotal) <= 0 && order.Type == InstockType.Purchase) + else if (details_Groups.Sum(x => x.ReceiveQtyTotal) <= 0 && (order.Type == InstockType.Purchase || order.Type == InstockType.ProduceSotck)) order.Status = InstockStatus.Wait; else if (details_Groups.Sum(x => x.RealityQtyTotal) <= 0) { - //if (order.Type == InstockType.ProduceSotck) - // { - // order.Status = InstockStatus.Wait; - // } - // else - // { + //if (order.Type == InstockType.ProduceSotck) + //{ + // order.Status = InstockStatus.Wait; + //} + //else + //{ order.Status = InstockStatus.WaitInStock; //} } @@ -805,7 +818,7 @@ namespace WMS.Web.Domain.Services List TransferDirect_sourceBillNos = new List(); List Transferin_sourceBillNos = new List(); List AssembledApp_sourceBillNos = new List(); - // List ProduceSotck_sourceBillNos = new List();//生产入库 + List ProduceSotck_sourceBillNos = new List();//生产入库 foreach (var entity in list) { @@ -819,8 +832,8 @@ namespace WMS.Web.Domain.Services AssembledApp_sourceBillNos.Add(entity.SourceBillNo); else if (entity.Type == InstockType.Miscellaneous) Miscellaneous_sourceBillNos.Add(entity.SourceBillNo); - //else if (entity.Type == InstockType.ProduceSotck) - // ProduceSotck_sourceBillNos.Add(entity.SourceBillNo); + else if (entity.Type == InstockType.ProduceSotck) + ProduceSotck_sourceBillNos.Add(entity.SourceBillNo); } //if (ProduceSotck_sourceBillNos.Count() > 0)//生产入库 diff --git a/src/WMS.Web.Domain/Values/OrderType.cs b/src/WMS.Web.Domain/Values/OrderType.cs index 0252bfe9..6c6a1786 100644 --- a/src/WMS.Web.Domain/Values/OrderType.cs +++ b/src/WMS.Web.Domain/Values/OrderType.cs @@ -80,5 +80,12 @@ namespace WMS.Web.Domain.Values /// [EnumRemark("盘点单")] Take = 14, + + /// + /// 盘点单 + /// + [EnumRemark("生产入库")] + ProduceSotck_In = 15, + } }