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.

90 lines
3.1 KiB

2 weeks ago
using Magicodes.ExporterAndImporter.Core;
5 days ago
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
2 weeks ago
using System.Data.Common;
5 days ago
using System.Linq.Dynamic.Core;
2 weeks ago
using TaskManager.Contracts.Dtos;
3 weeks ago
using TaskManager.Controllers;
using TaskManager.Entity;
2 weeks ago
using TaskManager.Entity.Entitys;
3 weeks ago
using TaskManager.EntityFramework;
2 weeks ago
using Z.BulkOperations;
5 days ago
using Z.EntityFramework.Extensions;
2 weeks ago
3 weeks ago
namespace TaskManager.Controllers
{
2 weeks ago
/// <summary>
1 week ago
/// M+6月物料需求计划风险
2 weeks ago
/// </summary>
3 weeks ago
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)
{
2 weeks ago
2 weeks ago
2 weeks ago
}
5 days ago
[HttpGet]
public async Task<SUPPLIER_MRP_MONTH> GetDetialByID(String id)
{
SUPPLIER_MRP_MONTH first = new SUPPLIER_MRP_MONTH();
var m = await _jobDbContext.SUPPLIER_MRP_MONTH.FirstOrDefaultAsync(p => p.Id == id);
if (m != null)
{
return m;
}
return first;
}
2 weeks ago
protected override async Task ConfirmDataInsertAsync(List<SUPPLIER_MRP_MONTH> plist, JobDbContext dbContext, DbTransaction dbTransaction)
2 weeks ago
{
if (plist.Count > 0)
{
List<SUPPLIER_CON_MMRP> list = new List<SUPPLIER_CON_MMRP>();
plist.ForEach(p =>
{
var con = new SUPPLIER_CON_MMRP();
1 week ago
con.Id = p.Id;
2 weeks ago
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);
});
2 weeks ago
7 days ago
await dbContext.BulkMergeAsync(list, options=> { options.Transaction = dbTransaction; options.UseTableLock = false;
options.ColumnPrimaryKeyExpression = p => p.Id;
});
2 weeks ago
}
2 weeks ago
return;
3 weeks ago
}
2 weeks ago
3 weeks ago
}
}