|
|
@ -1,11 +1,13 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Diagnostics; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using Volo.Abp.AspNetCore.Mvc; |
|
|
|
using Volo.Abp.Json; |
|
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
|
using Win_in.Sfs.Basedata.Commons; |
|
|
|
using Win_in.Sfs.Basedata.Domain; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Wms.Pda.Controllers.BaseDatas; |
|
|
@ -63,4 +65,90 @@ public class SplitPackingRecController : AbpController |
|
|
|
return await _splitPackingRecApp.GetSamePoNumberListByToPackingCode(toPackingCode).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost("batch-insert-test")] |
|
|
|
public async Task<bool> BatchInsertTestAsync(List<SplitPackingRecEditInput> inputs, int recordCount) |
|
|
|
{ |
|
|
|
Stopwatch sw = new Stopwatch(); |
|
|
|
sw.Start(); |
|
|
|
List<SplitPackingRecEditInput> operLst = new List<SplitPackingRecEditInput>(); |
|
|
|
var firstObj = inputs[0]; |
|
|
|
for (int i = 1; i <= recordCount; i++) |
|
|
|
{ |
|
|
|
var newObj = CloneSplitPackingRec(firstObj); |
|
|
|
operLst.Add(newObj); |
|
|
|
} |
|
|
|
|
|
|
|
//分页
|
|
|
|
int pageSize = 50; |
|
|
|
int pageTotal = PageHelper.GetTotalPages(operLst.Count, pageSize); |
|
|
|
for (int i = 1; i <= pageTotal; i++) |
|
|
|
{ |
|
|
|
var curPage = PageHelper.GetPage<SplitPackingRecEditInput>(operLst, i, pageSize); |
|
|
|
bool ret = await _splitPackingRecApp.BatchInsertTestAsync(curPage).ConfigureAwait(false); |
|
|
|
} |
|
|
|
sw.Stop(); |
|
|
|
Console.WriteLine($"执行时间 = {sw.ElapsedMilliseconds} ms"); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
private static SplitPackingRecEditInput CloneSplitPackingRec(SplitPackingRecEditInput input) |
|
|
|
{ |
|
|
|
SplitPackingRecEditInput entity = new SplitPackingRecEditInput(); |
|
|
|
entity.OprType = input.OprType; |
|
|
|
entity.FromPackingCode = input.FromPackingCode; |
|
|
|
//entity.FromTopPackingCode = input.FromTopPackingCode;
|
|
|
|
entity.FromStdPackQty = input.FromStdPackQty; |
|
|
|
entity.FromUom = input.FromUom; |
|
|
|
entity.FromQty = input.FromQty; |
|
|
|
entity.ToPackingCode = input.ToPackingCode; |
|
|
|
//entity.ToTopPackingCode = input.ToTopPackingCode;
|
|
|
|
entity.ToStdPackQty = input.ToStdPackQty; |
|
|
|
entity.ToUom = input.ToUom; |
|
|
|
entity.ToQty = input.ToQty; |
|
|
|
entity.ItemCode = input.ItemCode; |
|
|
|
entity.ItemName = input.ItemName; |
|
|
|
entity.ItemDesc1 = input.ItemDesc1; |
|
|
|
entity.ItemDesc2 = input.ItemDesc2; |
|
|
|
entity.FromLot = input.FromLot; |
|
|
|
entity.ToLot = input.ToLot; |
|
|
|
entity.PurchaseInfo_PoNumber = input.PurchaseInfo_PoNumber; |
|
|
|
entity.PurchaseInfo_AsnNumber = input.PurchaseInfo_AsnNumber; |
|
|
|
entity.ArrivalNoticNumber = input.ArrivalNoticNumber; |
|
|
|
entity.TaskOrderNumber = input.TaskOrderNumber; |
|
|
|
entity.ReceiptRecNumber = input.ReceiptRecNumber; |
|
|
|
entity.PutOnShelfNumber = input.PutOnShelfNumber; |
|
|
|
entity.LabelType = input.LabelType; |
|
|
|
//entity.CreationTime = input.CreationTime;
|
|
|
|
//entity.CreatorId = input.CreatorId;
|
|
|
|
//entity.LastModificationTime = input.LastModificationTime;
|
|
|
|
//entity.LastModifierId = input.LastModifierId;
|
|
|
|
entity.Remark = input.Remark; |
|
|
|
|
|
|
|
entity.ArriveDate = input.ArriveDate; |
|
|
|
//entity.ContainerCode = input.ContainerCode;
|
|
|
|
entity.ExpireDate = input.ExpireDate; |
|
|
|
entity.FullBarcodeString = input.FullBarcodeString; |
|
|
|
entity.LabelStatus = input.LabelStatus; |
|
|
|
entity.LocationErpCode = input.LocationErpCode; |
|
|
|
entity.PlanArriveDate = input.PlanArriveDate; |
|
|
|
entity.ProduceDate = input.ProduceDate; |
|
|
|
//entity.ProdLine = input.ProdLine;
|
|
|
|
//entity.Shift = input.Shift;
|
|
|
|
//entity.Team = input.Team;
|
|
|
|
entity.RpNumber = input.RpNumber; |
|
|
|
entity.SupplierCode = input.SupplierCode; |
|
|
|
//entity.QLevel = input.QLevel;
|
|
|
|
//entity.QualityFile = input.QualityFile;
|
|
|
|
entity.RecommendLocationCode = input.RecommendLocationCode; |
|
|
|
//entity.Specifications = input.Specifications;
|
|
|
|
entity.SupplierBatch = input.SupplierBatch; |
|
|
|
entity.SupplierItemCode = input.SupplierItemCode; |
|
|
|
entity.SupplierItemName = input.SupplierItemName; |
|
|
|
entity.SupplierName = input.SupplierName; |
|
|
|
entity.SupplierSimpleName = input.SupplierSimpleName; |
|
|
|
return entity; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|