feat: 接入ERP成品发货出库流程
This commit is contained in:
1 parent
66a1f60428
commit
7c2722c88d
25 files changed
+2547
-22
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Linq;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
@@ -278,5 +279,46 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
|
||||
#endregion ERP领料出库补传
|
||||
|
||||
#region ERP成品出库补传
|
||||
|
||||
[ActionDescription("补传ERP成品出库")]
|
||||
public async Task<ActionResult> RetryAddSaleOut(string id)
|
||||
{
|
||||
if (!int.TryParse(id, out var transactionId))
|
||||
{
|
||||
return FFResult().Alert("库存交易记录参数错误").RefreshGrid();
|
||||
}
|
||||
|
||||
var transaction = _unitwork.FindSingle<InventoryTransaction>(x => x.ID == transactionId);
|
||||
if (transaction == null)
|
||||
{
|
||||
return FFResult().Alert("库存交易记录不存在").RefreshGrid();
|
||||
}
|
||||
|
||||
if (transaction.Type != InventoryTranType.出库
|
||||
|| transaction.BillType != InventoryTransaction.ErpSaleOutBillType)
|
||||
{
|
||||
return FFResult().Alert("只有成品发货出库记录允许执行此补传").RefreshGrid();
|
||||
}
|
||||
|
||||
if (transaction.UploadErpFlag == 1)
|
||||
{
|
||||
return FFResult().Alert("该批次已成功回传ERP,无需重复操作").RefreshGrid();
|
||||
}
|
||||
|
||||
var transactions = _unitwork.Find<InventoryTransaction>(x =>
|
||||
x.BillType == InventoryTransaction.ErpSaleOutBillType
|
||||
&& x.BillCode == transaction.BillCode
|
||||
&& x.UploadErpFlag != 1)
|
||||
.ToList();
|
||||
var vm = Wtm.CreateVM<InventoryVM>();
|
||||
var success = await vm.ProcessErpSaleOut(transactions, true);
|
||||
return success
|
||||
? FFResult().Alert("本批成品出库回传ERP成功").RefreshGrid()
|
||||
: FFResult().Alert("本批成品出库回传ERP失败").RefreshGrid();
|
||||
}
|
||||
|
||||
#endregion ERP成品出库补传
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user