出入库任务单在金蝶没查到任务单 就作废

This commit is contained in:
18942506660
2024-07-29 16:00:44 +08:00
parent bb3a28bcfd
commit 0fe5c20eff
14 changed files with 378 additions and 37 deletions

View File

@@ -12,7 +12,7 @@ namespace WMS.Web.Domain.Entitys
/// erp入库任务表
/// </summary>
[Serializable]
[Table("t_erp_instock_task")]
[Table("t_erp_instock_task")]
public class InStockTask : EntityBase
{
/// <summary>
@@ -91,7 +91,7 @@ namespace WMS.Web.Domain.Entitys
/// <summary>
/// 明细
/// </summary>
public List<InStockTaskDetails> Details { get; set; }
public List<InStockTaskDetails> Details { get; set; }
/// <summary>
/// 创建
@@ -99,7 +99,7 @@ namespace WMS.Web.Domain.Entitys
/// <param name="type"></param>
/// <param name="sourceBillNo"></param>
/// <param name="createTime"></param>
public void Create(InstockType type,string sourceBillNo, DateTime createTime,int supplierId,string orgCode)
public void Create(InstockType type, string sourceBillNo, DateTime createTime, int supplierId, string orgCode)
{
if (type == InstockType.Purchase)
this.Status = InstockStatus.Wait;
@@ -115,10 +115,10 @@ namespace WMS.Web.Domain.Entitys
/// <summary>
/// 作废
/// </summary>
public void Repeal(int repealerId,List<int> detailsIds)
public void Repeal(int repealerId, List<int> detailsIds)
{
this.RepealerId = repealerId;
this.RepealTime= DateTime.Now;
this.RepealTime = DateTime.Now;
//明细行作废
this.Details.Where(x => detailsIds.Contains(x.Id)).ToList().ForEach(x => { x.IsRepeal = true; });
@@ -181,7 +181,7 @@ namespace WMS.Web.Domain.Entitys
}
//改变状态
public void ChangeInstockStatus()
public void ChangeInstockStatus()
{
//明细中:所有的应入数量之和
var totalAccruedQty = this.Details.Where(x => x.IsRepeal != true).Sum(x => x.AccruedQty);
@@ -194,9 +194,9 @@ namespace WMS.Web.Domain.Entitys
if (totalAccruedQty <= totalRealityQty)
this.Status = InstockStatus.Already;
else if(totalReceiveQty<= 0 && this.Type == InstockType.Purchase)
else if (totalReceiveQty <= 0 && this.Type == InstockType.Purchase)
this.Status = InstockStatus.Wait;
else if(totalRealityQty<=0)
else if (totalRealityQty <= 0)
this.Status = InstockStatus.WaitInStock;
else
this.Status = InstockStatus.Part;
@@ -218,7 +218,7 @@ namespace WMS.Web.Domain.Entitys
/// 非采购上架
/// </summary>
/// <param name="creatorId"></param>
public void NoPurchaseShelf(int creatorId)
public void NoPurchaseShelf(int creatorId)
{
this.ChangeInstockStatus();
this.ReceiverId = creatorId;
@@ -226,5 +226,17 @@ namespace WMS.Web.Domain.Entitys
this.ShelferId = creatorId;
this.ShelfTime = DateTime.Now;
}
/// <summary>
/// erp删单 作废处理
/// </summary>
public void ErpDel()
{
foreach (var d in this.Details)
{
d.AccruedQty = 0;
d.IsRepeal = true;
}
this.Status = InstockStatus.Repeal;
}
}
}