调整出库申请代码逻辑
This commit is contained in:
@@ -9,10 +9,13 @@ using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Utils;
|
||||
using Tnb.QcMgr.Entities.Enums;
|
||||
using Tnb.QcMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
using Tnb.QcMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -22,11 +25,13 @@ namespace Tnb.WarehouseMgr
|
||||
public class WmsSaleService : WmsPurchaseAndSaleCommonService<WmsSaleD>, IWmsSaleService
|
||||
{
|
||||
private readonly IWmsOutStockService _wmsOutStockService;
|
||||
private readonly IQcCheckPlanService _qcCheckPlanService;
|
||||
|
||||
public WmsSaleService(ISqlSugarRepository<WmsPurchaseH> repo, IUserManager userManager, IWmsOutStockService wmsOutStockService)
|
||||
public WmsSaleService(ISqlSugarRepository<WmsPurchaseH> repo, IUserManager userManager, IWmsOutStockService wmsOutStockService, IQcCheckPlanService qcCheckPlanService)
|
||||
: base(repo, userManager)
|
||||
{
|
||||
_wmsOutStockService = wmsOutStockService;
|
||||
_qcCheckPlanService = qcCheckPlanService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 销售发货
|
||||
@@ -43,10 +48,15 @@ namespace Tnb.WarehouseMgr
|
||||
visualDevModelDataInput.data = PocoToDictionary.ToDictionary(input) as Dictionary<string, object>;
|
||||
visualDevModelDataInput.data["location_id"] = "26412597341221";
|
||||
visualDevModelDataInput.data["location_code"] = "YCL01-01-01";
|
||||
if (_wmsOutStockService != null)
|
||||
{
|
||||
await _wmsOutStockService.OutStockApplyFor(visualDevModelDataInput);
|
||||
}
|
||||
|
||||
(string pkId, List <WmsOutstockD> outStockDList) multi = await _wmsOutStockService.OutStockApplyFor(visualDevModelDataInput);
|
||||
|
||||
CreateTaskEntity ctEntity = new();
|
||||
ctEntity.maintableid = multi.pkId;
|
||||
ctEntity.materialids = multi.outStockDList?.Select(x => x.material_id).ToList() ?? Array.Empty<string>().ToList();
|
||||
ctEntity.triggerevent = EnumTriggerEvent.出厂检按入厂频次;
|
||||
_ = _qcCheckPlanService.CreateWmsTask(ctEntity);
|
||||
|
||||
return await Task.FromResult(1);
|
||||
}
|
||||
/// <summary>
|
||||
@@ -67,9 +77,9 @@ namespace Tnb.WarehouseMgr
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<bool> Audit(PurchaseAndSaleAuditUpInput input)
|
||||
public async Task<bool> Audit(PurchaseAndSaleAuditUpInput input)
|
||||
{
|
||||
return await Audit<WmsSaleH>(input);
|
||||
return await Audit<WmsSaleH>(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user