This commit is contained in:
余宇波 2025-04-27 13:44:26 +08:00
parent f1aab7790a
commit 7d3a84e9b0
4 changed files with 69 additions and 48 deletions

View File

@ -174,7 +174,10 @@ namespace MyCode.Project.Domain.Message.Response.InvoiceOrder
/// </summary> /// </summary>
public string FPurchaseOrgName { get; set; } public string FPurchaseOrgName { get; set; }
/// <summary>
/// 每包数量
/// </summary>
public decimal CuseQty { get; set; }
} }
} }

View File

@ -191,5 +191,12 @@ namespace MyCode.Project.Domain.Model
/// </summary> /// </summary>
public int? EntityId {get;set;} public int? EntityId {get;set;}
/// <summary>
/// Desc:每包数量
/// Default:
/// Nullable:True
/// </summary>
public decimal? CuseQty {get;set;}
} }
} }

View File

@ -78,7 +78,7 @@ namespace MyCode.Project.Repositories
,[Remark] ,[Remark]
,b.[PurchaseOrderId] ,b.[PurchaseOrderId]
,[InvoiceOrderId] ,[InvoiceOrderId]
,b.CuseQty
,[UnitName] ,[UnitName]
,[TaxRate] ,[TaxRate]
,[FBillTaxAmount] ,[FBillTaxAmount]

View File

@ -240,13 +240,24 @@ namespace MyCode.Project.Services.Implementation
{ {
throw new BaseException("不正确的ID值"); throw new BaseException("不正确的ID值");
} }
List<TiaoMa> addList = new List<TiaoMa>();
if (orderItem.CuseQty == act.CuseQty)
{
var barcodeList = _tiaoMaRepository.Queryable().Where(t => t.InvoceOrderItemId == orderItem.Id).ToList();
addList = barcodeList;
}
else
{
orderItem.CuseQty = act.CuseQty;
_invoiceOrderItemRepository.Update(orderItem);
var order = _invoiceOrderRepository.Queryable().Where(t => t.Id == orderItem.InvoiceOrderId).First(); var order = _invoiceOrderRepository.Queryable().Where(t => t.Id == orderItem.InvoiceOrderId).First();
decimal zongQty = orderItem.Qty.SafeValue(); decimal zongQty = orderItem.Qty.SafeValue();
int yu = (int)Math.Ceiling(zongQty % act.CuseQty); int yu = (int)Math.Ceiling(zongQty % act.CuseQty);
int baoShu = 0; int baoShu = 0;
baoShu = (int)(zongQty / act.CuseQty); baoShu = (int)(zongQty / act.CuseQty);
List<TiaoMa> addList = new List<TiaoMa>();
// 条码 物料编码数量收料通知单号供应商批号key // 条码 物料编码数量收料通知单号供应商批号key
for (int i = 0; i < baoShu; i++) for (int i = 0; i < baoShu; i++)
{ {
@ -290,7 +301,7 @@ namespace MyCode.Project.Services.Implementation
FQty = t.Qty.Value.ToString() FQty = t.Qty.Value.ToString()
}).ToList(); }).ToList();
_workProcessService.Add<IKingDeeService>(this.MerchantId, "AddTiaoMa", "生成条码档案", JsonHelper.ToJson(addTiaoMas), 5); _workProcessService.Add<IKingDeeService>(this.MerchantId, "AddTiaoMa", "生成条码档案", JsonHelper.ToJson(addTiaoMas), 5);
}
TiaoMaResp result = new TiaoMaResp(); TiaoMaResp result = new TiaoMaResp();
result.Id = orderItem.Id; result.Id = orderItem.Id;
result.BarCodeList = addList.Select(t => t.FBarCode).ToList(); result.BarCodeList = addList.Select(t => t.FBarCode).ToList();