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.
 
 
 

64 lines
2.6 KiB

using Magicodes.ExporterAndImporter.Core;
using TaskManager.Contracts.Dtos;
using TaskManager.Controllers;
using TaskManager.Entity;
using TaskManager.Entity.Entitys;
using TaskManager.EntityFramework;
using Z.BulkOperations;
namespace TaskManager.Controllers
{
/// <summary>
/// M+6月物料需求计划风险确认
/// </summary>
public class CherySupplierMrpMonthService : CheryRecurringJobOutPageController<SUPPLIER_MRP_MONTH, SUPPLIER_MRP_MONTH_DETAIL_DTO>
{
public CherySupplierMrpMonthService(HttpClient httpClient, JobDbContext jobDbContext, LogController log, IRepository<SUPPLIER_MRP_MONTH> repository) : base(httpClient, jobDbContext, log, repository)
{
}
protected override async Task CreateTaskAsync(List<SUPPLIER_MRP_MONTH> plist, JobDbContext dbContext)
{
var taskId = Guid.NewGuid();
var task = new TaskSub();
task.TaskId = taskId;
task.TaskName = TaskName;
task.Subscriber = Client;
task.TableName = "SUPPLIER_CON_MMRP";
if (plist.Count > 0)
{
List<SUPPLIER_CON_MMRP> list = new List<SUPPLIER_CON_MMRP>();
plist.ForEach(p =>
{
var con = new SUPPLIER_CON_MMRP();
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);
});
dbContext.BulkInsert(list, new BulkOperationOptions<SUPPLIER_CON_MMRP>() { UseTableLock = false });
}
return;
}
}
}