Browse Source

发货尾箱数和最大UID问题

master
mingliang.tang 2 years ago
parent
commit
9e984aa6b0
  1. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Agent/AsnBackgroundWorker/AsnBackgroundWorker.cs
  2. 5
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Asns/AsnFactory.cs
  3. 82
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Console/Program.cs
  4. 1
      WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Asns/TB_ASN.cs
  5. 2
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbAsnRepository.cs

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Agent/AsnBackgroundWorker/AsnBackgroundWorker.cs

@ -103,7 +103,7 @@ namespace Win_in.Sfs.Scp.WebApi
var noPoAsn = CreateNoPoAsn(asn, barcodes); var noPoAsn = CreateNoPoAsn(asn, barcodes);
asnX12List.Add(noPoAsn); asnX12List.Add(noPoAsn);
asn.IsPort = 1;
if (asn.AsnBillNum.StartsWith(_options.QadAsnPrefix))//ASN to QAD if (asn.AsnBillNum.StartsWith(_options.QadAsnPrefix))//ASN to QAD
{ {

5
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Asns/AsnFactory.cs

@ -90,6 +90,11 @@ namespace Win_in.Sfs.Scp.WebApi
var accumQty = 0;//TODO 如何计算 var accumQty = 0;//TODO 如何计算
var loadQty = b.BarcodeAndBatchs.Count; var loadQty = b.BarcodeAndBatchs.Count;
var unitQty = b.PackQty; var unitQty = b.PackQty;
if (unitQty != b.Qty)
{
unitQty = b.Qty;
loadQty = 1;
}
var item = CreateItem(b.PartCode, loadQty * unitQty, b.PoUnit, accumQty, var item = CreateItem(b.PartCode, loadQty * unitQty, b.PoUnit, accumQty,
b.PoBillNum, loadQty, unitQty, b.BarcodeAndBatchs); b.PoBillNum, loadQty, unitQty, b.BarcodeAndBatchs);
items.Add(item); items.Add(item);

82
WebApiService/src/Win_in.Sfs.Scp.WebApi.Console/Program.cs

@ -27,79 +27,79 @@ namespace Win_in.Sfs.Scp.WebApi.Console
{ {
BarCode = "BARCODE_01", BarCode = "BARCODE_01",
PartCode = "PART_A", PartCode = "PART_A",
Qty=20, Qty=28,
Batch="20220404", Batch="20220404",
PoUnit = "EA", PoUnit = "EA",
PoBillNum = "PO1111", PoBillNum = "PO1111",
PackQty = 20, PackQty = 28,
Extend2 = "PALLET_01" Extend2 = "PALLET_01"
}, },
new TS_BARCODE() new TS_BARCODE()
{ {
BarCode = "BARCODE_02", BarCode = "BARCODE_02",
PartCode = "PART_A", PartCode = "PART_A",
Qty=20, Qty=28,
Batch="20220404", Batch="20220404",
PoUnit = "EA", PoUnit = "EA",
PoBillNum = "PO1111", PoBillNum = "PO1111",
PackQty = 20, PackQty = 28,
Extend2 = "PALLET_01" Extend2 = "PALLET_01"
}, },
new TS_BARCODE() new TS_BARCODE()
{ {
BarCode = "BARCODE_03", BarCode = "BARCODE_03",
PartCode = "PART_B", PartCode = "PART_B",
Qty=15, Qty=28,
Batch="20220404", Batch="20220404",
PoUnit = "EA", PoUnit = "EA",
PoBillNum = "PO2222", PoBillNum = "PO2222",
PackQty = 15, PackQty = 28,
Extend2 = "PALLET_01" Extend2 = "PALLET_01"
}, },
new TS_BARCODE() new TS_BARCODE()
{ {
BarCode = "BARCODE_04", BarCode = "BARCODE_04",
PartCode = "PART_B", PartCode = "PART_B",
Qty=15, Qty=16,
Batch="20220404", Batch="20220404",
PoUnit = "EA", PoUnit = "EA",
PoBillNum = "PO2222", PoBillNum = "PO2222",
PackQty = 15, PackQty = 28,
Extend2 = "PALLET_01" Extend2 = "PALLET_01"
}, },
new TS_BARCODE() //new TS_BARCODE()
{ //{
BarCode = "BARCODE_05", // BarCode = "BARCODE_05",
PartCode = "PART_C", // PartCode = "PART_C",
Qty=40, // Qty=40,
Batch="20220404", // Batch="20220404",
PoUnit = "KG", // PoUnit = "KG",
PoBillNum = "PO3333", // PoBillNum = "PO3333",
PackQty = 40, // PackQty = 40,
Extend2 = "PALLET_02" // Extend2 = "PALLET_02"
}, //},
new TS_BARCODE() //new TS_BARCODE()
{ //{
BarCode = "BARCODE_06", // BarCode = "BARCODE_06",
PartCode = "PART_C", // PartCode = "PART_C",
Qty=40, // Qty=40,
Batch="20220404", // Batch="20220404",
PoUnit = "KG", // PoUnit = "KG",
PoBillNum = "PO3333", // PoBillNum = "PO3333",
PackQty = 40, // PackQty = 40,
Extend2 = "PALLET_02" // Extend2 = "PALLET_02"
}, //},
new TS_BARCODE() //new TS_BARCODE()
{ //{
BarCode = "BARCODE_07", // BarCode = "BARCODE_07",
PartCode = "PART_C", // PartCode = "PART_C",
Qty=40, // Qty=40,
Batch="20220404", // Batch="20220404",
PoUnit = "KG", // PoUnit = "KG",
PoBillNum = "PO3333", // PoBillNum = "PO3333",
PackQty = 23, // PackQty = 23,
Extend2 = "" // Extend2 = ""
}, //},
}; };
return barcodes; return barcodes;
} }

1
WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Asns/TB_ASN.cs

@ -45,6 +45,7 @@ namespace Win_in.Sfs.Scp.v1.Domain.Asns
public string SubSite { get; set; } public string SubSite { get; set; }
public int IsPort { get; set; }//接口是否读取
public Guid? TenantId { get; } public Guid? TenantId { get; }
} }
} }

2
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbAsnRepository.cs

@ -21,7 +21,7 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
var list = await dbSet var list = await dbSet
.Where(p =>p.Site==site .Where(p =>p.Site==site
&& p.State == 3 //已发货 && p.State == 3 //已发货
&& p.Id > uid) && p.IsPort==0)
.OrderBy(p => p.Id) .OrderBy(p => p.Id)
.Take(batchSize) .Take(batchSize)
.ToListAsync(); .ToListAsync();

Loading…
Cancel
Save