序列号集合的变更-EF调整

This commit is contained in:
tongfei
2023-11-27 18:10:18 +08:00
parent 0bc2787ef4
commit 3bd25ab075
5 changed files with 52 additions and 9 deletions

View File

@@ -29,10 +29,12 @@ namespace WMS.Web.Api.Controllers
private readonly IBoxService _boxService;
private readonly IOutStockTaskRepositories _outStockTaskRepositories;
private readonly IOutStockTaskService _outStockTaskService;
public TestController(IErpService erpService, IInStockTaskService inStockTaskService,
private readonly IBoxInventoryRepositories _boxInventoryRepositories;
public TestController(IErpService erpService, IInStockTaskService inStockTaskService, IBoxInventoryRepositories boxInventoryRepositories,
IBasicsRepositories transactionRepositories, IOpsService opsService, IBoxService boxService,
IOutStockTaskRepositories outStockTaskRepositories, IOutStockTaskService outStockTaskService)
{
_boxInventoryRepositories = boxInventoryRepositories;
this._erpService = erpService;
this._inStockTaskService = inStockTaskService;
this._transactionRepositories = transactionRepositories;
@@ -80,11 +82,46 @@ namespace WMS.Web.Api.Controllers
[Route("tf")]
public async Task<string> TestTF()
{
//var result = await this._erpService.BillQueryForOrg();
var result = await this._erpService.BillQueryForBillType();
if (!result.IsSuccess)
return "";
return JsonConvert.SerializeObject(result.Data);
////var result = await this._erpService.BillQueryForOrg();
//var result = await this._erpService.BillQueryForBillType();
//if (!result.IsSuccess)
// return "";
//return JsonConvert.SerializeObject(result.Data);
var tttt = new List<string>() { "ABCD14200999" };
var boxInventorys = await _boxInventoryRepositories.Get(142);
var data = new List<BoxInventory>();
//var entity = new BoxInventory();
//entity.Id = 34;
//entity.BoxId = 142;
//entity.OrgCode = "101";
//entity.StockCode = "CK003";
//entity.SubStockId = 2949;
//var det = new BoxInventoryDetails();
//det.Id = 266;
//det.Fid = 34;
//det.MaterialId = 4799560;
//det.SerialNumbers = new List<string>() { "ABCD143001", "ABCD142002" };
//det.Qty = 2;
//entity.Details.Add(det);
boxInventorys.Details.ForEach(x=>
{
x.SerialNumbers.RemoveAll(t => tttt.Contains(t));
//x.SerialNumbers.AddRange(tttt);
x.Qty = 3;
});
data.Add(boxInventorys);
var result= await _boxInventoryRepositories.UpdateRange(data);
return "";
}