fix:永丰售后修复BUG,

1,物料库存获取不到ERP:重新调整触发查询逻辑
2,工序变更导致物料无法出库:配置旧工序
3,测试出库订单ERP推送,任务下发
This commit is contained in:
sunwang committed 2026-10-29 13:12:11 +08:00
1 parent b2a9a38f38
commit c76e7bb681
69 files changed
+5510 -157

No files matched your search

@@ -2,11 +2,13 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Mvc;
using WalkingTec.Mvvm.Core.Extensions;
using HHWMS.Web;
using HHWMS.Web.Models;
using HHWMS.Web.Services.Erp;
namespace HHWMS.Web.Controllers
{
@@ -15,10 +17,12 @@ namespace HHWMS.Web.Controllers
public partial class MaterialController : BaseController
{
private readonly IUnitWork _unitWork;
private readonly ErpMaterialService _erpMaterialService;
public MaterialController(IUnitWork unitWork)
public MaterialController(IUnitWork unitWork, ErpMaterialService erpMaterialService)
{
_unitWork = unitWork;
_erpMaterialService = erpMaterialService;
}
#region Search
@@ -31,18 +35,20 @@ namespace HHWMS.Web.Controllers
[ActionDescription("Sys.Search")]
[HttpPost]
public string Search(MaterialSearcher searcher)
public async Task<string> Search(MaterialSearcher searcher)
{
if (!ModelState.IsValid)
{
return Wtm.CreateVM<MaterialListVM>(passInit: true).GetError();
}
// 先查本地物料表,查不到再调 ERP 回写:物料编码→InvCode,图号→InvDefine1
await _erpMaterialService.EnsureByCodeAsync(searcher.MaterialCode);
await _erpMaterialService.EnsureByTypeAsync(searcher.MaterialType);
var vm = Wtm.CreateVM<MaterialListVM>(passInit: true);
if (ModelState.IsValid)
{
vm.Searcher = searcher;
return vm.GetJson(false);
}
else
{
return vm.GetError();
}
vm.Searcher = searcher;
return vm.GetJson(false);
}
#endregion