销售出库与拣货接口以及部分问题修复
This commit is contained in:
93
WarehouseMgr/Tnb.WarehouseMgr/WmsSortingtaskService.cs
Normal file
93
WarehouseMgr/Tnb.WarehouseMgr/WmsSortingtaskService.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.BasicData.Interfaces;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 销售出库服务
|
||||
/// </summary>
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSSORTINGTASK_ID)]
|
||||
[ServiceModule(BizTypeId)]
|
||||
public class WmsSortingtaskService : BaseWareHouseService, IPdaStroage
|
||||
{
|
||||
private const string BizTypeId = "34088685351445";
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
private readonly IBasLocationService _basLocationService;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IWmsCarryBindService _wmsCarryBindService;
|
||||
public WmsSortingtaskService(
|
||||
ISqlSugarRepository<WmsDelivery> repository,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService,
|
||||
IBasLocationService basLocationService,
|
||||
IBillRullService billRullService,
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
_basLocationService = basLocationService;
|
||||
_billRullService = billRullService;
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
|
||||
OverideFuncs.CreateAsync = Create;
|
||||
}
|
||||
|
||||
private async Task<dynamic> Create(VisualDevModelDataCrInput input)
|
||||
{
|
||||
//在线开发
|
||||
try
|
||||
{
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSSORTINGTASK_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
return Task.FromResult(1);
|
||||
}
|
||||
public override async Task ModifyAsync(WareHouseUpInput input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
|
||||
int row = await _db.Updateable<WmsDelivery>().SetColumns(it => new WmsDelivery { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
|
||||
if (row < 1)
|
||||
{
|
||||
throw Oops.Oh(ErrorCode.COM1001);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user