|
|
@ -801,6 +801,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
var logList = tupleList.Select(o => o.Item1).ToList(); |
|
|
|
logList.AsParallel().ForEach(Update); |
|
|
|
List<BBAC_SE_DETAIL> seDetails = new List<BBAC_SE_DETAIL>(); |
|
|
|
List<HBPO_SE_DETAIL> hbpo_seDetails=new List<HBPO_SE_DETAIL>(); |
|
|
|
List<PUB_SE_DETAIL> pub_seDetails=new List<PUB_SE_DETAIL>(); |
|
|
|
|
|
|
|
foreach (var item in logList) |
|
|
|
{ |
|
|
|
if(item.DeliverBillType== EnumDeliverBjBmpBillType.JIS件&&item.DeliverSubBillType== EnumDeliverSubBillType.保险杠BBAC) |
|
|
@ -839,6 +842,258 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
seDetails.Add(seDetail); |
|
|
|
} |
|
|
|
|
|
|
|
if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && item.DeliverSubBillType == EnumDeliverSubBillType.买单件小件BBAC) |
|
|
|
{ |
|
|
|
BBAC_SE_DETAIL seDetail = new BBAC_SE_DETAIL(); |
|
|
|
seDetail.SetId(item.Id); |
|
|
|
seDetail.BeginDate = DateTime.Now; |
|
|
|
seDetail.CreationTime = DateTime.Now; |
|
|
|
seDetail.IsDeleted = false; |
|
|
|
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); |
|
|
|
seDetail.ShippingDate = (DateTime)item.BillTime; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
seDetail.IsHaveEdiData = false; |
|
|
|
seDetail.BusinessType = EnumBusinessType.MaiDanJianBBAC; |
|
|
|
seDetail.AssembleData = (DateTime)item.AssembleData; |
|
|
|
seDetail.BillType = 0; |
|
|
|
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; |
|
|
|
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; |
|
|
|
seDetail.ProType = 0; |
|
|
|
seDetail.State = 0; |
|
|
|
seDetail.SubBillType = 0; |
|
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
|
seDetail.UID = 000; |
|
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
seDetail.VinCode = item.VinCode; |
|
|
|
seDetail.PN = item.VinCode; |
|
|
|
seDetail.LU = item.CustPartCode; |
|
|
|
seDetail.CustPartCode = item.CustPartCode; |
|
|
|
seDetail.BillTime = item.BillTime; |
|
|
|
|
|
|
|
seDetail.Remark = "期初初始化"; |
|
|
|
|
|
|
|
seDetails.Add(seDetail); |
|
|
|
} |
|
|
|
|
|
|
|
if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && item.DeliverSubBillType == EnumDeliverSubBillType.保险杠HBPO) |
|
|
|
{ |
|
|
|
HBPO_SE_DETAIL seDetail = new HBPO_SE_DETAIL(); |
|
|
|
seDetail.SetId(item.Id); |
|
|
|
seDetail.BeginDate = DateTime.Now; |
|
|
|
seDetail.CreationTime = DateTime.Now; |
|
|
|
seDetail.IsDeleted = false; |
|
|
|
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); |
|
|
|
seDetail.ShippingDate = (DateTime)item.BillTime; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
seDetail.IsHaveEdiData = false; |
|
|
|
seDetail.BusinessType = EnumBusinessType.JisHBPO; |
|
|
|
seDetail.AssembleData = (DateTime)item.AssembleData; |
|
|
|
seDetail.BillType = 0; |
|
|
|
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; |
|
|
|
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; |
|
|
|
seDetail.ProType = 0; |
|
|
|
seDetail.State = 0; |
|
|
|
seDetail.SubBillType = 0; |
|
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
|
seDetail.UID = 000; |
|
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
seDetail.VinCode = item.VinCode; |
|
|
|
seDetail.PN = item.VinCode; |
|
|
|
seDetail.LU = item.CustPartCode; |
|
|
|
seDetail.CustPartCode = item.CustPartCode; |
|
|
|
seDetail.BillTime = item.BillTime; |
|
|
|
|
|
|
|
seDetail.Remark = "期初初始化"; |
|
|
|
|
|
|
|
hbpo_seDetails.Add(seDetail); |
|
|
|
} |
|
|
|
|
|
|
|
if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && item.DeliverSubBillType == EnumDeliverSubBillType.买单件小件HBPO) |
|
|
|
{ |
|
|
|
HBPO_SE_DETAIL seDetail = new HBPO_SE_DETAIL(); |
|
|
|
seDetail.SetId(item.Id); |
|
|
|
seDetail.BeginDate = DateTime.Now; |
|
|
|
seDetail.CreationTime = DateTime.Now; |
|
|
|
seDetail.IsDeleted = false; |
|
|
|
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); |
|
|
|
seDetail.ShippingDate = (DateTime)item.BillTime; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
seDetail.IsHaveEdiData = false; |
|
|
|
seDetail.BusinessType = EnumBusinessType.MaiDanJianHBPO; |
|
|
|
seDetail.AssembleData = (DateTime)item.AssembleData; |
|
|
|
seDetail.BillType = 0; |
|
|
|
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; |
|
|
|
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; |
|
|
|
seDetail.ProType = 0; |
|
|
|
seDetail.State = 0; |
|
|
|
seDetail.SubBillType = 0; |
|
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
|
seDetail.UID = 000; |
|
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
|
seDetail.ErpToLoc = item.ErpToLoc; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
seDetail.VinCode = item.VinCode; |
|
|
|
seDetail.PN = item.VinCode; |
|
|
|
seDetail.LU = item.CustPartCode; |
|
|
|
seDetail.CustPartCode = item.CustPartCode; |
|
|
|
seDetail.BillTime = item.BillTime; |
|
|
|
|
|
|
|
seDetail.Remark = "期初初始化"; |
|
|
|
|
|
|
|
hbpo_seDetails.Add(seDetail); |
|
|
|
} |
|
|
|
|
|
|
|
if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIT直供件 && item.DeliverSubBillType == EnumDeliverSubBillType.JIT直供件BBAC) |
|
|
|
{ |
|
|
|
PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL(); |
|
|
|
seDetail.SetId(item.Id); |
|
|
|
seDetail.BeginDate = DateTime.Now; |
|
|
|
seDetail.CreationTime = DateTime.Now; |
|
|
|
seDetail.IsDeleted = false; |
|
|
|
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); |
|
|
|
seDetail.ShippingDate = (DateTime)item.BillTime; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
//seDetail.IsHaveEdiData = false;
|
|
|
|
seDetail.BusinessType = EnumBusinessType.ZhiGongJianBBAC; |
|
|
|
seDetail.AssembleData = (DateTime)item.AssembleData; |
|
|
|
seDetail.BillType = 0; |
|
|
|
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; |
|
|
|
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; |
|
|
|
seDetail.ProType = 0; |
|
|
|
seDetail.State = 0; |
|
|
|
seDetail.SubBillType = 0; |
|
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
|
seDetail.UID = 000; |
|
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
//seDetail.VinCode = item.VinCode;
|
|
|
|
seDetail.PN = item.VinCode; |
|
|
|
seDetail.LU = item.CustPartCode; |
|
|
|
seDetail.CustPartCode = item.CustPartCode; |
|
|
|
seDetail.BillTime = item.BillTime; |
|
|
|
|
|
|
|
seDetail.Remark = "期初初始化"; |
|
|
|
|
|
|
|
pub_seDetails.Add(seDetail); |
|
|
|
} |
|
|
|
|
|
|
|
if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIT直供件 && item.DeliverSubBillType == EnumDeliverSubBillType.JIT直供件HBPO) |
|
|
|
{ |
|
|
|
PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL(); |
|
|
|
seDetail.SetId(item.Id); |
|
|
|
seDetail.BeginDate = DateTime.Now; |
|
|
|
seDetail.CreationTime = DateTime.Now; |
|
|
|
seDetail.IsDeleted = false; |
|
|
|
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); |
|
|
|
seDetail.ShippingDate = (DateTime)item.BillTime; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
//seDetail.IsHaveEdiData = false;
|
|
|
|
seDetail.BusinessType = EnumBusinessType.ZhiGongJianHBPO; |
|
|
|
seDetail.AssembleData = (DateTime)item.AssembleData; |
|
|
|
seDetail.BillType = 0; |
|
|
|
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; |
|
|
|
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; |
|
|
|
seDetail.ProType = 0; |
|
|
|
seDetail.State = 0; |
|
|
|
seDetail.SubBillType = 0; |
|
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
|
seDetail.UID = 000; |
|
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
//seDetail.VinCode = item.VinCode;
|
|
|
|
seDetail.PN = item.VinCode; |
|
|
|
seDetail.LU = item.CustPartCode; |
|
|
|
seDetail.CustPartCode = item.CustPartCode; |
|
|
|
seDetail.BillTime = item.BillTime; |
|
|
|
|
|
|
|
seDetail.Remark = "期初初始化"; |
|
|
|
|
|
|
|
pub_seDetails.Add(seDetail); |
|
|
|
} |
|
|
|
|
|
|
|
if (item.DeliverBillType == EnumDeliverBjBmpBillType.北汽4S备件 && item.DeliverSubBillType == EnumDeliverSubBillType.北汽4S备件BBAC) |
|
|
|
{ |
|
|
|
PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL(); |
|
|
|
seDetail.SetId(item.Id); |
|
|
|
seDetail.BeginDate = DateTime.Now; |
|
|
|
seDetail.CreationTime = DateTime.Now; |
|
|
|
seDetail.IsDeleted = false; |
|
|
|
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); |
|
|
|
seDetail.ShippingDate = (DateTime)item.BillTime; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
//seDetail.IsHaveEdiData = false;
|
|
|
|
seDetail.BusinessType = EnumBusinessType.BeiJian; |
|
|
|
seDetail.AssembleData = (DateTime)item.AssembleData; |
|
|
|
seDetail.BillType = 0; |
|
|
|
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; |
|
|
|
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; |
|
|
|
seDetail.ProType = 0; |
|
|
|
seDetail.State = 0; |
|
|
|
seDetail.SubBillType = 0; |
|
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
|
seDetail.UID = 000; |
|
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
//seDetail.VinCode = item.VinCode;
|
|
|
|
seDetail.PN = item.VinCode; |
|
|
|
seDetail.LU = item.CustPartCode; |
|
|
|
seDetail.CustPartCode = item.CustPartCode; |
|
|
|
seDetail.BillTime = item.BillTime; |
|
|
|
|
|
|
|
seDetail.Remark = "期初初始化"; |
|
|
|
|
|
|
|
pub_seDetails.Add(seDetail); |
|
|
|
} |
|
|
|
|
|
|
|
if (item.DeliverBillType == EnumDeliverBjBmpBillType.印度件 && item.DeliverSubBillType == EnumDeliverSubBillType.印度件BBAC) |
|
|
|
{ |
|
|
|
PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL(); |
|
|
|
seDetail.SetId(item.Id); |
|
|
|
seDetail.BeginDate = DateTime.Now; |
|
|
|
seDetail.CreationTime = DateTime.Now; |
|
|
|
seDetail.IsDeleted = false; |
|
|
|
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); |
|
|
|
seDetail.ShippingDate = (DateTime)item.BillTime; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
//seDetail.IsHaveEdiData = false;
|
|
|
|
seDetail.BusinessType = EnumBusinessType.YinDuJian; |
|
|
|
seDetail.AssembleData = (DateTime)item.AssembleData; |
|
|
|
seDetail.BillType = 0; |
|
|
|
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; |
|
|
|
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; |
|
|
|
seDetail.ProType = 0; |
|
|
|
seDetail.State = 0; |
|
|
|
seDetail.SubBillType = 0; |
|
|
|
seDetail.TransType = EnumDelTransType.发货; |
|
|
|
seDetail.UID = 000; |
|
|
|
seDetail.FactoryPartCode = item.RealPartCode; |
|
|
|
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); |
|
|
|
seDetail.ToErpLocCode = item.ErpToLoc; |
|
|
|
seDetail.Qty = item.Qty; |
|
|
|
//seDetail.VinCode = item.VinCode;
|
|
|
|
seDetail.PN = item.VinCode; |
|
|
|
seDetail.LU = item.CustPartCode; |
|
|
|
seDetail.CustPartCode = item.CustPartCode; |
|
|
|
seDetail.BillTime = item.BillTime; |
|
|
|
|
|
|
|
seDetail.Remark = "期初初始化"; |
|
|
|
|
|
|
|
pub_seDetails.Add(seDetail); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -864,6 +1119,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
await context.BulkInsertAsync(logList).ConfigureAwait(false); |
|
|
|
//await context.BulkInsertAsync(messageList).ConfigureAwait(false);
|
|
|
|
await context.BulkInsertAsync(seDetails).ConfigureAwait(false); |
|
|
|
await context.BulkInsertAsync(hbpo_seDetails).ConfigureAwait(false); |
|
|
|
await context.BulkInsertAsync(pub_seDetails).ConfigureAwait(false); |
|
|
|
|
|
|
|
transaction.Commit(); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|