Merge branch 'master' of https://codeup.aliyun.com/62ce7bca487c500c27f70a79/OPS/WMS-Api
This commit is contained in:
@@ -28,11 +28,6 @@ namespace WMS.Web.Domain.Entitys
|
||||
[Column("BillNo")]
|
||||
public string BillNo { get; set; }
|
||||
/// <summary>
|
||||
/// 来源单号
|
||||
///</summary>
|
||||
[Column("SourceBillNo")]
|
||||
public string SourceBillNo { get; set; }
|
||||
/// <summary>
|
||||
/// 发货组织
|
||||
///</summary>
|
||||
[Column("DeliveryOrgId")]
|
||||
@@ -71,10 +66,10 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// 明细
|
||||
/// </summary>
|
||||
public List<OutStockTaskDetails> Details = new List<OutStockTaskDetails>();
|
||||
public void Create(OutStockType type, string sourceBillNo, int deliveryOrgId, int receiptCustomerId, DateTime createTime)
|
||||
public void Create(OutStockType type, int deliveryOrgId, int receiptCustomerId, DateTime createTime)
|
||||
{
|
||||
this.Type = type;
|
||||
this.SourceBillNo = sourceBillNo;
|
||||
//this.SourceBillNos.Add(sourceBillNo);
|
||||
this.DeliveryOrgId = deliveryOrgId;
|
||||
this.ReceiptCustomerId = receiptCustomerId;
|
||||
this.CreateTime = createTime;
|
||||
|
||||
@@ -32,6 +32,11 @@ namespace WMS.Web.Domain.Entitys
|
||||
[Column("Erp_DetailId")]
|
||||
public int Erp_DetailId { get; set; }
|
||||
/// <summary>
|
||||
/// 来源单号(合并后有多个)
|
||||
///</summary>
|
||||
[Column("SourceBillNo")]
|
||||
public List<string> SourceBillNos { get; set; }
|
||||
/// <summary>
|
||||
/// 销售订单号
|
||||
///</summary>
|
||||
[Column("SaleBillNo")]
|
||||
|
||||
@@ -24,7 +24,8 @@ namespace WMS.Web.Domain.Mappers
|
||||
CreateMap<OutStockTask, GetOutStockTaskByNoResponse>();
|
||||
CreateMap<OutStockTaskDetails, GetOutStockTaskByNoDetailsResponse>();
|
||||
|
||||
CreateMap<ErpDeliveryNoticeOutStockResultDto, OutStockTaskDetails>();
|
||||
CreateMap<ErpDeliveryNoticeOutStockResultDto, OutStockTaskDetails>()
|
||||
.ForPath(x => x.SourceBillNos, ops => ops.MapFrom(x =>new List<string>() { x.SourceBillNo }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace WMS.Web.Domain.Services
|
||||
foreach (var e in erp_list)
|
||||
{
|
||||
//代表单据已经存在 那么就对单据进行修改
|
||||
var data = data_list.FirstOrDefault(f => f.SourceBillNo == e.SourceBillNo);
|
||||
var data = data_list.FirstOrDefault(f => f.Details.SelectMany(s => s.SourceBillNos).Contains(e.SourceBillNo));
|
||||
var detail = data.Details.FirstOrDefault(w => w.MaterialId == e.MaterialId);
|
||||
//存在就修改,没有就添加
|
||||
if (detail != null)
|
||||
@@ -134,8 +134,7 @@ namespace WMS.Web.Domain.Services
|
||||
{
|
||||
var e = erp_list.FirstOrDefault(f => f.SourceBillNo == item);
|
||||
var dto = new OutStockTask();
|
||||
dto.SourceBillNo = e.SourceBillNo;
|
||||
dto.Create((OutStockType)e.Type, e.SourceBillNo, e.DeliveryOrgId, e.ReceiptCustomerId, (DateTime)e.CreateTime);
|
||||
dto.Create((OutStockType)e.Type, e.DeliveryOrgId, e.ReceiptCustomerId, (DateTime)e.CreateTime);
|
||||
|
||||
//找到当前对应来源单据编号的集合数据
|
||||
var current_erp_details = erp_list.Where(x => x.SourceBillNo == item).ToList();
|
||||
@@ -282,15 +281,15 @@ namespace WMS.Web.Domain.Services
|
||||
foreach (var entity in taskList)
|
||||
{
|
||||
if (entity.Type == OutStockType.Sal)
|
||||
DeliveryNotice_Nos.Add(entity.SourceBillNo);
|
||||
DeliveryNotice_Nos.AddRange(entity.Details.SelectMany(s => s.SourceBillNos));
|
||||
else if (entity.Type == OutStockType.Stkdirecttransfers)
|
||||
TransferDirect_Nos.Add(entity.SourceBillNo);
|
||||
TransferDirect_Nos.AddRange(entity.Details.SelectMany(s => s.SourceBillNos));
|
||||
else if (entity.Type == OutStockType.StktransferInst)
|
||||
TransferOut_Nos.Add(entity.SourceBillNo);
|
||||
TransferOut_Nos.AddRange(entity.Details.SelectMany(s => s.SourceBillNos));
|
||||
else if (entity.Type == OutStockType.Assembled)
|
||||
AssembledApp_Nos.Add(entity.SourceBillNo);
|
||||
AssembledApp_Nos.AddRange(entity.Details.SelectMany(s => s.SourceBillNos));
|
||||
else if (entity.Type == OutStockType.Miscellaneous)
|
||||
MisDeliveryOut_Nos.Add(entity.SourceBillNo);
|
||||
MisDeliveryOut_Nos.AddRange(entity.Details.SelectMany(s => s.SourceBillNos));
|
||||
}
|
||||
|
||||
if (DeliveryNotice_Nos.Count() > 0)
|
||||
|
||||
Reference in New Issue
Block a user