feat: add ERP material issue outbound callback
This commit is contained in:
1 parent
3da4bddb98
commit
eda824cea7
13 files changed
+587
-20
No files matched your search
@@ -4,6 +4,8 @@ using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -239,5 +241,42 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
|
||||
#endregion Export
|
||||
|
||||
#region ERP领料出库补传
|
||||
|
||||
[AllRights]
|
||||
[ActionDescription("补传ERP领料出库")]
|
||||
public async Task<ActionResult> RetryAddOtherOut(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.ErpOtherOutBillType)
|
||||
{
|
||||
return FFResult().Alert("只有线边库领料出库记录允许回传ERP").RefreshGrid();
|
||||
}
|
||||
|
||||
if (transaction.UploadErpFlag == 1)
|
||||
{
|
||||
return FFResult().Alert("该出库记录已成功回传ERP,无需重复操作").RefreshGrid();
|
||||
}
|
||||
|
||||
var vm = Wtm.CreateVM<InventoryVM>();
|
||||
var success = await vm.ProcessErpOtherOut(transaction);
|
||||
return success
|
||||
? FFResult().Alert("回传ERP成功").RefreshGrid()
|
||||
: FFResult().Alert("回传ERP失败").RefreshGrid();
|
||||
}
|
||||
|
||||
#endregion ERP领料出库补传
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user