|
|
@ -3,9 +3,12 @@ using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.ServiceModel.Channels; |
|
|
|
using System.Text; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using EFCore.BulkExtensions; |
|
|
|
using Microsoft.CodeAnalysis.CSharp.Syntax; |
|
|
|
using Nito.AsyncEx; |
|
|
|
using SettleAccount.Bases; |
|
|
|
using SettleAccount.Domain.BQ; |
|
|
|
using TaskJob.EventArgs; |
|
|
|
using TaskJob.Interfaces; |
|
|
@ -26,6 +29,7 @@ public class PendingDeductionService : ITransientDependency, IExportJob |
|
|
|
protected readonly INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> _hbpoRepository; |
|
|
|
protected readonly INormalEfCoreRepository<PUB_PD_DETAIL, Guid> _pubRepository; |
|
|
|
protected readonly INormalEfCoreRepository<CodeSetting, Guid> _codesetRepository; |
|
|
|
protected readonly INormalEfCoreRepository<VmiLog, Guid> _vmiRepository; |
|
|
|
|
|
|
|
public PendingDeductionService( |
|
|
|
INormalEfCoreRepository<BBAC_SEC_DETAIL, Guid> bbacSecRepository, |
|
|
@ -35,6 +39,7 @@ public class PendingDeductionService : ITransientDependency, IExportJob |
|
|
|
INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> hbpoRepository, |
|
|
|
INormalEfCoreRepository<PUB_PD_DETAIL, Guid> pubRepository, |
|
|
|
INormalEfCoreRepository<CodeSetting, Guid> codesetRepository, |
|
|
|
INormalEfCoreRepository<VmiLog, Guid> vmiRepository, |
|
|
|
VmiAppService vimservice |
|
|
|
) |
|
|
|
{ |
|
|
@ -46,368 +51,138 @@ public class PendingDeductionService : ITransientDependency, IExportJob |
|
|
|
_pubSecRepository= pubSecRepository; |
|
|
|
_vimservice =vimservice; |
|
|
|
_codesetRepository = codesetRepository; |
|
|
|
_vmiRepository = vmiRepository; |
|
|
|
} |
|
|
|
|
|
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
|
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
|
|
|
{ |
|
|
|
var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value; |
|
|
|
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value; |
|
|
|
var list=billList.Split(","); |
|
|
|
var projectList=_codesetRepository.Where(p => p.Project == "库位"); |
|
|
|
|
|
|
|
var list = billList.Split(","); |
|
|
|
var projectList = _codesetRepository.Where(p => p.Project == "库位"); |
|
|
|
if (type == "JisBBAC") |
|
|
|
{ |
|
|
|
var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan==false); |
|
|
|
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan ==true); |
|
|
|
var query = from itm in jisdetail |
|
|
|
select |
|
|
|
new |
|
|
|
{ |
|
|
|
BillTime = DateTime.Now, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
DeliverTime = itm.CreationTime, |
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
PartCode = itm.LU, |
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
PartCode2 = itm.LU, |
|
|
|
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4, |
|
|
|
VinCode = itm.PN, |
|
|
|
OrderNum = itm.GroupNum, |
|
|
|
//ErpToLoc = string.IsNullOrEmpty()
|
|
|
|
}; |
|
|
|
var ls=query.ToList(); |
|
|
|
if (ls != null && ls.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in ls) |
|
|
|
{ |
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
{ |
|
|
|
BillTime = itm.BillTime, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
AssembleData = itm.BillTime, |
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
RealPartCode = itm.PartCode, |
|
|
|
SettlementVinCode = itm.VinCode, |
|
|
|
//PartCode2 = itm.PartCode2,
|
|
|
|
CustPartCode = itm.CustomerPartCode, |
|
|
|
VinCode = itm.VinCode, |
|
|
|
//OrderNum = itm.OrderNum,
|
|
|
|
ErpToLoc = "C0001" |
|
|
|
}).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
var query1 = from itm in mdetail |
|
|
|
select new |
|
|
|
{ |
|
|
|
|
|
|
|
BillTime = DateTime.Now, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
DeliverTime = itm.CreationTime, |
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
PartCode = itm.LU, |
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
PartCode2 = itm.LU, |
|
|
|
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4, |
|
|
|
VinCode = itm.PN, |
|
|
|
OrderNum = itm.GroupNum, |
|
|
|
ErpToLoc = "C0001" |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
var ls1 = query1.ToList(); |
|
|
|
if (ls1 != null && ls1.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in ls1) |
|
|
|
{ |
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
{ |
|
|
|
BillTime = itm.BillTime, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
|
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
SettlementVinCode = itm.VinCode, |
|
|
|
VinCode = itm.VinCode, |
|
|
|
//OrderNum = itm.OrderNum,
|
|
|
|
ErpToLoc = "C0001" |
|
|
|
}).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis
|
|
|
|
Sync(jisdetail.ToList()); |
|
|
|
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianBBAC);//买单件
|
|
|
|
Sync(mdetail.ToList()); |
|
|
|
} |
|
|
|
else if (type == "JisHBPO") |
|
|
|
{ |
|
|
|
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList(); |
|
|
|
if (detailist != null && detailist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in detailist) |
|
|
|
{ |
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
{ |
|
|
|
BillTime = itm.CreationTime, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
|
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
|
|
|
|
RealPartCode = itm.LU,//客户
|
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
|
|
|
|
CustPartCode = itm.LU, |
|
|
|
VinCode = itm.PN, |
|
|
|
ErpToLoc = "C0001" |
|
|
|
}).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum) && p.BusinessType== EnumBusinessType.JisHBPO).ToList(); |
|
|
|
Sync(detailist); |
|
|
|
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianHBPO);//买单件
|
|
|
|
Sync(mdetail.ToList()); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList(); |
|
|
|
switch (type) |
|
|
|
{ |
|
|
|
case "ZhiGongJianBBAC": |
|
|
|
|
|
|
|
if (detailist != null && detailist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in detailist) |
|
|
|
{ |
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
{ |
|
|
|
BillTime = itm.CreationTime, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
// DeliverTime = ,
|
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
|
|
|
|
// BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
RealPartCode = itm.LU,//客户
|
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
//PartCode2 = itm.LU,//厂内
|
|
|
|
CustPartCode = itm.LU, |
|
|
|
VinCode = itm.PN, |
|
|
|
OrderNum = itm.PN, |
|
|
|
ErpToLoc = "C0001" |
|
|
|
}).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
case "ZhiGongJianHBPO": |
|
|
|
|
|
|
|
if (detailist != null && detailist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in detailist) |
|
|
|
{ |
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
{ |
|
|
|
BillTime = itm.CreationTime, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
// DeliverTime = ,
|
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
|
|
|
|
// BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
RealPartCode = itm.LU,//客户
|
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
//PartCode2 = itm.LU,//厂内
|
|
|
|
CustPartCode = itm.LU, |
|
|
|
VinCode = itm.PN, |
|
|
|
OrderNum = itm.PN,// 非JIS传ASN 交付识别号
|
|
|
|
ErpToLoc = "C0001" |
|
|
|
}).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case "MaiDanJianBBAC": |
|
|
|
|
|
|
|
if (detailist != null && detailist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in detailist) |
|
|
|
{ |
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
{ |
|
|
|
BillTime = itm.CreationTime, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
// DeliverTime = ,
|
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
|
|
|
|
// BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
RealPartCode = itm.LU,//客户
|
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
//PartCode2 = itm.LU,//厂内
|
|
|
|
CustPartCode = itm.LU, |
|
|
|
VinCode = itm.PN, |
|
|
|
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
|
|
|
|
ErpToLoc = "C0001" |
|
|
|
}).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case "MaiDanJianHBPO": |
|
|
|
|
|
|
|
|
|
|
|
if (detailist != null && detailist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in detailist) |
|
|
|
{ |
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
{ |
|
|
|
BillTime = itm.CreationTime, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
// DeliverTime = ,
|
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
|
|
|
|
// BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
RealPartCode = itm.LU,//客户
|
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
//PartCode2 = itm.LU,//厂内
|
|
|
|
CustPartCode = itm.LU, |
|
|
|
VinCode = itm.PN, |
|
|
|
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
|
|
|
|
ErpToLoc = "C0001" |
|
|
|
}).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
case "BeiJian": |
|
|
|
|
|
|
|
|
|
|
|
if (detailist != null && detailist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in detailist) |
|
|
|
{ |
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
{ |
|
|
|
BillTime = itm.CreationTime, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
// DeliverTime = ,
|
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
|
|
|
|
// BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
RealPartCode = itm.LU,//客户
|
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
//PartCode2 = itm.LU,//厂内
|
|
|
|
CustPartCode = itm.LU, |
|
|
|
VinCode = itm.PN, |
|
|
|
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
|
|
|
|
ErpToLoc = "C0001" |
|
|
|
}).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
case "YinDuJian": |
|
|
|
|
|
|
|
if (detailist != null && detailist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in detailist) |
|
|
|
{ |
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
{ |
|
|
|
BillTime = itm.CreationTime, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
// DeliverTime = ,
|
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
|
|
|
|
// BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
RealPartCode = itm.LU,//客户
|
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
//PartCode2 = itm.LU,//厂内
|
|
|
|
CustPartCode = itm.LU, |
|
|
|
VinCode = itm.PN, |
|
|
|
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
|
|
|
|
ErpToLoc = "C0001" |
|
|
|
}).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sync(detailist); |
|
|
|
|
|
|
|
////switch (type)
|
|
|
|
////{
|
|
|
|
//// case "ZhiGongJianBBAC":
|
|
|
|
//// if (detailist != null && detailist.Count > 0)
|
|
|
|
//// {
|
|
|
|
|
|
|
|
//// }
|
|
|
|
//// break;
|
|
|
|
//// case "ZhiGongJianHBPO":
|
|
|
|
//// if (detailist != null && detailist.Count > 0)
|
|
|
|
//// {
|
|
|
|
|
|
|
|
//// }
|
|
|
|
//// break;
|
|
|
|
//// case "MaiDanJianBBAC":
|
|
|
|
//// if (detailist != null && detailist.Count > 0)
|
|
|
|
//// {
|
|
|
|
|
|
|
|
//// }
|
|
|
|
//// break;
|
|
|
|
//// case "MaiDanJianHBPO":
|
|
|
|
//// if (detailist != null && detailist.Count > 0)
|
|
|
|
//// {
|
|
|
|
|
|
|
|
//// }
|
|
|
|
//// break;
|
|
|
|
//// case "BeiJian":
|
|
|
|
//// if (detailist != null && detailist.Count > 0)
|
|
|
|
//// {
|
|
|
|
|
|
|
|
//// }
|
|
|
|
//// break;
|
|
|
|
//// case "YinDuJian":
|
|
|
|
//// if (detailist != null && detailist.Count > 0)
|
|
|
|
//// {
|
|
|
|
|
|
|
|
//// }
|
|
|
|
//// break;
|
|
|
|
////}
|
|
|
|
//if (detailist != null && detailist.Count > 0)
|
|
|
|
//{
|
|
|
|
// foreach (var itm in detailist)
|
|
|
|
// {
|
|
|
|
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
} |
|
|
|
return id.ToString(); |
|
|
|
} |
|
|
|
public List<T> GetPagedData<T>(List<T> dataList, int pageNumber, int pageSize) |
|
|
|
{ |
|
|
|
int startIndex = (pageNumber - 1) * pageSize; |
|
|
|
|
|
|
|
return dataList.Skip(startIndex).Take(pageSize).ToList(); |
|
|
|
} |
|
|
|
public int CalculatePageCount(int totalCount, int pageSize) |
|
|
|
{ |
|
|
|
int pageCount = totalCount / pageSize; |
|
|
|
if (totalCount % pageSize != 0) |
|
|
|
{ |
|
|
|
pageCount += 1; |
|
|
|
} |
|
|
|
return pageCount; |
|
|
|
} |
|
|
|
|
|
|
|
public void Sync<T>(List<T> p_ls) where T : PD_BASE,new() |
|
|
|
{ |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
if (detailist != null && detailist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in detailist) |
|
|
|
{ |
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
var query = from itm in p_ls |
|
|
|
select new |
|
|
|
{ |
|
|
|
BillTime = itm.CreationTime, |
|
|
|
BillTime = DateTime.Now, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
AssembleData = itm.CreationTime, |
|
|
|
DeliverTime = itm.CreationTime, |
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
DeliverSubBillType = EnumDeliverSubBillType.小件BBAC, |
|
|
|
DeliverBillType = EnumDeliverBjBmpBillType.JIS件, |
|
|
|
RealPartCode = itm.LU, |
|
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
PartCode = itm.LU, |
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
//PartCode2 = itm.LU,
|
|
|
|
CustPartCode = itm.LU, |
|
|
|
PartCode2 = itm.LU, |
|
|
|
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4, |
|
|
|
VinCode = itm.PN, |
|
|
|
OrderNum = itm.GroupNum, |
|
|
|
ErpToLoc = "C0001" |
|
|
|
}).ConfigureAwait(false); |
|
|
|
} |
|
|
|
ErpToLoc = itm.Extend2, |
|
|
|
|
|
|
|
}; |
|
|
|
var ls = query.ToList(); |
|
|
|
if (ls != null && ls.Count > 0) |
|
|
|
{ |
|
|
|
var count = CalculatePageCount(ls.Count, 2000); |
|
|
|
for (int pagenumber = 0; pagenumber < count; pagenumber++) |
|
|
|
{ |
|
|
|
ls = GetPagedData(ls, pagenumber, 2000); |
|
|
|
_vmiRepository.DbContext.BulkInsert(ls); |
|
|
|
|
|
|
|
Task.Delay(500); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return id.ToString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|