分拣任务变更 现场问题处理
This commit is contained in:
@@ -135,10 +135,6 @@ namespace Tnb.WarehouseMgr
|
||||
try
|
||||
{
|
||||
WmsPurchaseH wmsPurchaseH = await _db.Queryable<WmsPurchaseH>().Where(r => r.bill_code == input.bill_code).FirstAsync();
|
||||
if (wmsPurchaseH.make_method == "自制")
|
||||
{
|
||||
throw Oops.Bah("自制采购收货单不能操作此按钮");
|
||||
}
|
||||
await _db.Ado.BeginTranAsync();
|
||||
WmsInstockH? instock = null;
|
||||
var purchaseDs = await PurchaseAndSaleUpdate(input);
|
||||
@@ -203,16 +199,32 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
throw Oops.Bah($"采购收货单明细行物料{item.material_code} 批次{item.code_batch} 到货数量不能超过采购数量!");
|
||||
}
|
||||
WmsPurchaseOrderD wmsPurchaseOrderD = wmsPurchaseOrderDs.Where(r => r.erp_line_pk == item.erp_purchase_order_d_pk).ToList()[0];
|
||||
wmsPurchaseOrderD.actual_quantity += purchase_arriveqty;
|
||||
if (wmsPurchaseOrderD.actual_quantity > wmsPurchaseOrderD.purchase_quantity)
|
||||
|
||||
if (wmsPurchaseOrderDs.Count > 0)
|
||||
{
|
||||
throw Oops.Bah($"采购订单明细行物料{wmsPurchaseOrderD.matcode} 批次{wmsPurchaseOrderD.code_batch} 到货数量不能超过采购数量!");
|
||||
WmsPurchaseOrderD wmsPurchaseOrderD = wmsPurchaseOrderDs.Where(r => r.erp_line_pk == item.erp_purchase_order_d_pk).First();
|
||||
wmsPurchaseOrderD.actual_quantity += purchase_arriveqty;
|
||||
if (wmsPurchaseOrderD.actual_quantity > wmsPurchaseOrderD.purchase_quantity)
|
||||
{
|
||||
throw Oops.Bah($"采购订单明细行物料{wmsPurchaseOrderD.matcode} 批次{wmsPurchaseOrderD.code_batch} 到货数量不能超过采购数量!");
|
||||
}
|
||||
}
|
||||
|
||||
if (purchase_arriveqty > 0)
|
||||
{
|
||||
item.warehousing_time = DateTime.Now;
|
||||
}
|
||||
}
|
||||
await _db.Updateable(dList).UpdateColumns(r => r.purchase_prqty).ExecuteCommandAsync();
|
||||
await _db.Updateable(wmsPurchaseOrderDs).UpdateColumns(r => r.actual_quantity).ExecuteCommandAsync();
|
||||
await _db.Updateable(dList).UpdateColumns(r => new { r.purchase_prqty, r.warehousing_time }).ExecuteCommandAsync();
|
||||
if (wmsPurchaseOrderDs.Count > 0)
|
||||
await _db.Updateable(wmsPurchaseOrderDs).UpdateColumns(r => r.actual_quantity).ExecuteCommandAsync();
|
||||
|
||||
|
||||
if (wmsPurchaseH.make_method == "自制")
|
||||
{
|
||||
await _db.Ado.CommitTranAsync();
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
List<String> materialIds = purchaseDs.Select(x=>x.material_id).Distinct().ToList();
|
||||
List<String> unitCodes = purchaseDs.Select(x => x.unit_id).Distinct().ToList();
|
||||
List<DictionaryDataEntity> unitDatas = await _db.Queryable<DictionaryTypeEntity>()
|
||||
|
||||
Reference in New Issue
Block a user