|
|
|
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.SupplierCode = "8EG";
|
|
|
|
con.PurchaseOrder =p.PurchaseOrder ;
|
|
|
|
con.SerialNumber =p.SerialNumber ;
|
|
|
|
con.QuantityMeet =p.QuantityDelivery ;
|
|
|
|
con.FeedbackResults ="" ;
|
|
|
|
con.VentureType ="" ;
|
|
|
|
con.VentureSpecific ="" ;
|
|
|
|
con.Measures ="";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//con.SupplierCode = "8EG";
|
|
|
|
//con.ReleaseEdition = p.ReleaseEdition;
|
|
|
|
//con.MaterialCode = p.MaterialCode;
|
|
|
|
//con.PlantId = p.PlantId;
|
|
|
|
//con.FeedbackResults = "0";
|
|
|
|
//con.VentureType = "1";
|
|
|
|
//con.VentureSpecific = "1";
|
|
|
|
//con.Measures = "1";
|
|
|
|
//con.StartMonth = p.StartMonth;
|
|
|
|
//con.QuantityMeet1 = p.QuantityDemand1;
|
|
|
|
//con.QuantityMeet2 = p.QuantityDemand2;
|
|
|
|
//con.QuantityMeet3 = p.QuantityDemand3;
|
|
|
|
//con.QuantityMeet4 = p.QuantityDemand4;
|
|
|
|
//con.QuantityMeet5 = p.QuantityDemand5;
|
|
|
|
//con.QuantityMeet6 = p.QuantityDemand6;
|
|
|
|
//con.QuantityMeet7 = p.QuantityDemand7;
|
|
|
|
//con.QuantityMeet8 = p.QuantityDemand8;
|
|
|
|
//con.QuantityMeet9 = p.QuantityDemand9;
|
|
|
|
//con.QuantityMeet10 = p.QuantityDemand10;
|
|
|
|
//con.QuantityMeet11 = p.QuantityDemand11;
|
|
|
|
//con.QuantityMeet12 = p.QuantityDemand12;
|
|
|
|
list.Add(con);
|
|
|
|
});
|
|
|
|
|
|
|
|
await dbContext.BulkInsertAsync(list, options => { options.Transaction = dbTransaction; options.UseTableLock = false; });
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|