You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.8 KiB
59 lines
1.8 KiB
using System.Data.Common;
|
|
using TaskManager.Contracts.Dtos;
|
|
using TaskManager.Controllers;
|
|
using TaskManager.Entity;
|
|
using TaskManager.Entity.Entitys;
|
|
using TaskManager.EntityFramework;
|
|
|
|
|
|
namespace TaskManager.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 采购订单
|
|
/// </summary>
|
|
public class CherySupplierPoService : CheryRecurringJobOutPageController<SUPPLIER_PO, SUPPLIER_PO_DETAIL_DTO>
|
|
{
|
|
public CherySupplierPoService(HttpClient httpClient, JobDbContext jobDbContext, LogController log, IRepository<SUPPLIER_PO> repository) : base(httpClient, jobDbContext, log, repository)
|
|
{
|
|
}
|
|
protected override async Task ConfirmDataInsertAsync(List<SUPPLIER_PO> plist, JobDbContext dbContext, DbTransaction dbTransaction)
|
|
{
|
|
if (plist.Count > 0)
|
|
{
|
|
List<SUPPLIER_CON_PO> list = new List<SUPPLIER_CON_PO>();
|
|
plist.ForEach(p =>
|
|
{
|
|
var con = new SUPPLIER_CON_PO();
|
|
con.Id = p.Id;
|
|
|
|
con.SupplierCode = "8EG";
|
|
con.PurchaseOrder =p.PurchaseOrder ;
|
|
con.SerialNumber =p.SerialNumber ;
|
|
con.QuantityMeet =p.QuantityDelivery==null? p.QuantityDelivery.Value : 0 ;
|
|
con.FeedbackResults ="" ;
|
|
con.VentureType ="" ;
|
|
con.VentureSpecific ="" ;
|
|
con.Measures ="";
|
|
|
|
|
|
|
|
|
|
list.Add(con);
|
|
});
|
|
|
|
await dbContext.BulkMergeAsync(list, options => { options.Transaction = dbTransaction; options.UseTableLock = false;
|
|
|
|
options.ColumnPrimaryKeyExpression = p => p.Id;
|
|
|
|
|
|
});
|
|
}
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|