22
This commit is contained in:
parent
f1aab7790a
commit
7d3a84e9b0
@ -174,7 +174,10 @@ namespace MyCode.Project.Domain.Message.Response.InvoiceOrder
|
||||
/// </summary>
|
||||
public string FPurchaseOrgName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 每包数量
|
||||
/// </summary>
|
||||
public decimal CuseQty { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -191,5 +191,12 @@ namespace MyCode.Project.Domain.Model
|
||||
/// </summary>
|
||||
public int? EntityId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:每包数量
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public decimal? CuseQty {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ namespace MyCode.Project.Repositories
|
||||
,[Remark]
|
||||
,b.[PurchaseOrderId]
|
||||
,[InvoiceOrderId]
|
||||
|
||||
,b.CuseQty
|
||||
,[UnitName]
|
||||
,[TaxRate]
|
||||
,[FBillTaxAmount]
|
||||
|
@ -240,13 +240,24 @@ namespace MyCode.Project.Services.Implementation
|
||||
{
|
||||
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();
|
||||
|
||||
decimal zongQty = orderItem.Qty.SafeValue();
|
||||
int yu =(int) Math.Ceiling( zongQty % act.CuseQty);
|
||||
int yu = (int)Math.Ceiling(zongQty % act.CuseQty);
|
||||
int baoShu = 0;
|
||||
baoShu = (int)(zongQty / act.CuseQty);
|
||||
List<TiaoMa> addList = new List<TiaoMa>();
|
||||
|
||||
// 条码 :物料编码,数量,收料通知单号,供应商批号,key
|
||||
for (int i = 0; i < baoShu; i++)
|
||||
{
|
||||
@ -257,7 +268,7 @@ namespace MyCode.Project.Services.Implementation
|
||||
tiaoMa.Id = Guid.NewGuid();
|
||||
tiaoMa.FBarCode = FBarCode;
|
||||
tiaoMa.Qty = act.CuseQty;
|
||||
tiaoMa.SortNum = i+1;
|
||||
tiaoMa.SortNum = i + 1;
|
||||
tiaoMa.PurchaseBillNo = orderItem.FBillNo;
|
||||
tiaoMa.FBillNo = order.FBillNo;
|
||||
addList.Add(tiaoMa);
|
||||
@ -270,7 +281,7 @@ namespace MyCode.Project.Services.Implementation
|
||||
tiaoMa.Id = Guid.NewGuid();
|
||||
tiaoMa.FBarCode = FBarCode;
|
||||
tiaoMa.Qty = yu;
|
||||
tiaoMa.SortNum = baoShu+1;
|
||||
tiaoMa.SortNum = baoShu + 1;
|
||||
tiaoMa.PurchaseBillNo = orderItem.FBillNo;
|
||||
tiaoMa.FBillNo = order.FBillNo;
|
||||
addList.Add(tiaoMa);
|
||||
@ -281,7 +292,7 @@ namespace MyCode.Project.Services.Implementation
|
||||
List<AddTiaoMa> addTiaoMas = new List<AddTiaoMa>();
|
||||
addTiaoMas = addList.Select(t => new AddTiaoMa
|
||||
{
|
||||
FBarCode =t.FBarCode,
|
||||
FBarCode = t.FBarCode,
|
||||
FBarCodeRule = "03",
|
||||
FBillCode = t.FBillNo,
|
||||
FSupplierLot = t.FSupplierLot == null ? "" : t.FSupplierLot,
|
||||
@ -290,7 +301,7 @@ namespace MyCode.Project.Services.Implementation
|
||||
FQty = t.Qty.Value.ToString()
|
||||
}).ToList();
|
||||
_workProcessService.Add<IKingDeeService>(this.MerchantId, "AddTiaoMa", "生成条码档案", JsonHelper.ToJson(addTiaoMas), 5);
|
||||
|
||||
}
|
||||
TiaoMaResp result = new TiaoMaResp();
|
||||
result.Id = orderItem.Id;
|
||||
result.BarCodeList = addList.Select(t => t.FBarCode).ToList();
|
||||
|
Loading…
x
Reference in New Issue
Block a user