212 changed files with 5059 additions and 1671 deletions
@ -0,0 +1,7 @@ |
|||
{ |
|||
"ExpandedNodes": [ |
|||
"" |
|||
], |
|||
"SelectedNode": "\\WZC2.sln", |
|||
"PreviewInSolutionExplorer": false |
|||
} |
@ -0,0 +1,58 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Domain.Entities; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes; |
|||
public class Backflu : Entity |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// MES写入时间
|
|||
/// </summary>
|
|||
public string scmout_dt_w { get; set; } |
|||
/// <summary>
|
|||
/// 单据类型
|
|||
/// </summary>
|
|||
public string scmout_type { get; set; } |
|||
/// <summary>
|
|||
/// TYRP单号
|
|||
/// </summary>
|
|||
[Key] |
|||
public string scmout_nbr { get; set; } |
|||
/// <summary>
|
|||
/// 料号
|
|||
/// </summary>
|
|||
public string scmout_part { get; set; } |
|||
/// <summary>
|
|||
/// 追加码/预定交货日/序号/储位
|
|||
/// </summary>
|
|||
public string scmout_no { get; set; } |
|||
/// <summary>
|
|||
/// TYRP异动储位
|
|||
/// </summary>
|
|||
public string scmout_loc { get; set; } |
|||
/// <summary>
|
|||
/// 库存交易年月
|
|||
/// </summary>
|
|||
public string scmout_ym { get; set; } |
|||
/// <summary>
|
|||
/// 库存交易日
|
|||
/// </summary>
|
|||
public string scmout_date { get; set; } |
|||
/// <summary>
|
|||
/// 数量
|
|||
/// </summary>
|
|||
public decimal scmout_qty { get; set; } |
|||
/// <summary>
|
|||
/// 调入储位
|
|||
/// </summary>
|
|||
public string scmout_in_loc { get; set; } |
|||
/// <summary>
|
|||
/// 有效码
|
|||
/// </summary>
|
|||
public string scmout_stat { get; set; } |
|||
|
|||
public override object[] GetKeys() |
|||
{ |
|||
return new object[] { scmout_nbr }; |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes; |
|||
public class BackfluManager : DomainService, IBackfluManager |
|||
{ |
|||
private readonly IBackfluRepository _repository; |
|||
public BackfluManager(IBackfluRepository repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
public async Task<List<Backflu>> GetToBeProcessedListAsync() |
|||
{ |
|||
var Backflu = await _repository.GetListAsync().ConfigureAwait(false); |
|||
|
|||
return Backflu.ToList(); |
|||
} |
|||
public virtual async Task UpdateProcessedListAsync(List<Backflu> entities) |
|||
{ |
|||
foreach (var entitie in entities) |
|||
{ |
|||
entitie.scmout_stat = "N"; |
|||
await _repository.UpdateAsync(entitie).ConfigureAwait(false); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,10 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes; |
|||
public interface IBackfluManager : IDomainService |
|||
{ |
|||
Task<List<Backflu>> GetToBeProcessedListAsync(); |
|||
Task UpdateProcessedListAsync(List<Backflu> entities); |
|||
} |
@ -0,0 +1,7 @@ |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes; |
|||
public interface IBackfluRepository : IRepository<Backflu> |
|||
{ |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
|
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore.Modeling; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes; |
|||
public static class BackfluDbContextModelCreatingExtensions |
|||
{ |
|||
public static void ConfigureBackflu(this ModelBuilder builder, MesModelBuilderConfigurationOptions options) |
|||
{ |
|||
builder.Entity<Backflu>(b => |
|||
{ |
|||
//Configure table & schema Name
|
|||
b.ToTable(options.TablePrefix + "scmout", options.Schema); |
|||
//Configure ABP properties
|
|||
b.ConfigureByConvention(); |
|||
b.Property(q => q.scmout_dt_w).HasMaxLength(20); |
|||
b.Property(q => q.scmout_type).HasMaxLength(6); |
|||
b.Property(q => q.scmout_nbr).HasMaxLength(12); |
|||
b.Property(q => q.scmout_part).HasMaxLength(20); |
|||
b.Property(q => q.scmout_no).HasMaxLength(10); |
|||
b.Property(q => q.scmout_loc).HasMaxLength(10); |
|||
b.Property(q => q.scmout_ym).HasMaxLength(6); |
|||
b.Property(q => q.scmout_date).HasMaxLength(8); |
|||
b.Property(q => q.scmout_qty).HasPrecision(10, 2); |
|||
b.Property(q => q.scmout_in_loc).HasMaxLength(10); |
|||
b.Property(q => q.scmout_stat).HasMaxLength(1); |
|||
}); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes; |
|||
public class BackfluEfCoreRepository : EfCoreRepository<MesDbContext, Backflu>, IBackfluRepository |
|||
{ |
|||
public BackfluEfCoreRepository(IDbContextProvider<MesDbContext> dbContextProvider) |
|||
: base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
@ -0,0 +1,83 @@ |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text.Json; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.Logging; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Win_in.Sfs.Basedata.Application.Contracts; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain; |
|||
using Win_in.Sfs.Wms.DataExchange.WMS.BackFlushNote; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; |
|||
|
|||
public class BackFluConverter : IIncomingConverter |
|||
{ |
|||
private readonly IIncomingFromExternalManager _incomingFromExternalManager; |
|||
private readonly IIncomingToWmsManager _incomingToWmsManager; |
|||
private readonly IItemBasicAppService _itemBasicAppService; |
|||
private readonly IObjectMapper _objectMapper; |
|||
private readonly ILogger<BackFluConverter> _logger; |
|||
public BackFluConverter( |
|||
IIncomingToWmsManager incomingToWmsManager, |
|||
IItemBasicAppService itemBasicAppService, |
|||
IObjectMapper objectMapper, |
|||
ILogger<BackFluConverter> logger |
|||
, |
|||
IIncomingFromExternalManager incomingFromExternalManager |
|||
|
|||
) |
|||
{ |
|||
_incomingToWmsManager = incomingToWmsManager; |
|||
_itemBasicAppService = itemBasicAppService; |
|||
_objectMapper = objectMapper; |
|||
_logger = logger; |
|||
_incomingFromExternalManager = incomingFromExternalManager; |
|||
} |
|||
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) |
|||
{ |
|||
if (!incomingFromExternalList.Any()) |
|||
{ |
|||
_logger.LogInformation("no backflus"); |
|||
return; |
|||
} |
|||
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); |
|||
await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false); |
|||
//归档
|
|||
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false); |
|||
|
|||
} |
|||
|
|||
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList) |
|||
{ |
|||
await Task.CompletedTask.ConfigureAwait(false); |
|||
var incomingToWmsList = new List<IncomingToWms>(); |
|||
var groups = incomingDataList.GroupBy(p => p.SourceDataGroupCode); |
|||
foreach (var group in groups) |
|||
{ |
|||
var first = group.First(); |
|||
var incomingToWms = new IncomingToWms() |
|||
{ |
|||
DataType = first.DataType, |
|||
DataAction = first.DataAction, |
|||
SourceSystem = first.SourceSystem, |
|||
DataIdentityCode = first.SourceDataGroupCode, |
|||
}; |
|||
incomingToWms.SetEffectiveDate(first.EffectiveDate); |
|||
var exchangeBack = JsonSerializer.Deserialize<BackFlushNoteExchangeDto>(first.DestinationDataContent); |
|||
var wmsBack = _objectMapper.Map<BackFlushNoteExchangeDto, BackFlushNoteEditInput>(exchangeBack); |
|||
wmsBack.Details = new List<BackFlushNoteDetailInput>(); |
|||
foreach (var incomingFromExternal in group.ToList()) |
|||
{ |
|||
var back = JsonSerializer.Deserialize<BackFlushNoteExchangeDto>(incomingFromExternal.DestinationDataContent); |
|||
var wmsBackDetail = _objectMapper.Map<BackFlushNoteDetailExchangeDto, BackFlushNoteDetailInput>(back.Detail); |
|||
|
|||
wmsBack.Details.Add(wmsBackDetail); |
|||
} |
|||
incomingToWms.DataContent = JsonSerializer.Serialize(wmsBack); |
|||
incomingToWmsList.Add(incomingToWms); |
|||
} |
|||
return incomingToWmsList; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,112 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text.Json; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.Logging; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; |
|||
|
|||
using Win_in.Sfs.Wms.DataExchange.WMS.BackFlushNote; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; |
|||
|
|||
public class BackFluReader : IReader |
|||
{ |
|||
private readonly IBackfluManager _ibackfluManager; |
|||
private readonly IIncomingFromExternalManager _incomingFromExternalManager; |
|||
private readonly ILogger<BackFluReader> _logger; |
|||
private readonly IConfiguration _configuration; |
|||
public BackFluReader( |
|||
IBackfluManager ibackfuManager |
|||
, IIncomingFromExternalManager incomingFromExternalManager |
|||
, ILogger<BackFluReader> logger |
|||
, IConfiguration configuration |
|||
) |
|||
{ |
|||
_ibackfluManager = ibackfuManager; |
|||
_incomingFromExternalManager = incomingFromExternalManager; |
|||
_logger = logger; |
|||
_configuration = configuration; |
|||
} |
|||
public virtual async Task<List<IncomingFromExternal>> ReadAsync() |
|||
{ |
|||
//从Tyrp读取待处理bom
|
|||
var BackFull = await _ibackfluManager.GetToBeProcessedListAsync().ConfigureAwait(false); |
|||
var toBeProcessedBack = BackFull.Where(p => p.scmout_stat == "Y").ToList(); |
|||
if (!toBeProcessedBack.Any()) |
|||
{ |
|||
_logger.LogInformation("no backflus"); |
|||
return new List<IncomingFromExternal>(); |
|||
} |
|||
//bom逐一转换为bomNote
|
|||
var incomingDataList = BuildIncomingFromExternalFromBomAsync(toBeProcessedBack); |
|||
await _incomingFromExternalManager.CreateManyAsync(incomingDataList).ConfigureAwait(false); |
|||
await _ibackfluManager.UpdateProcessedListAsync(toBeProcessedBack).ConfigureAwait(false); |
|||
return incomingDataList; |
|||
} |
|||
private List<IncomingFromExternal> BuildIncomingFromExternalFromBomAsync(List<Backflu> toBeProcessedIssue) |
|||
{ |
|||
var incomingDataList = new List<IncomingFromExternal>(); |
|||
foreach (var backflu in toBeProcessedIssue) |
|||
{ |
|||
var incomingData = BuildIncomingFromExternal(backflu); |
|||
|
|||
incomingData.SetEffectiveDate(DateTime.Now); |
|||
|
|||
try |
|||
{ |
|||
var bm = BuildScrapNoteOrderExchangeMes(backflu); |
|||
incomingData.DestinationDataContent = JsonSerializer.Serialize(backflu); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
incomingData.SetError(EnumExchangeDataErrorCode.Exception, ex.Message, ex.ToString()); |
|||
} |
|||
|
|||
incomingDataList.Add(incomingData); |
|||
|
|||
} |
|||
return incomingDataList; |
|||
} |
|||
private IncomingFromExternal BuildIncomingFromExternal(Backflu backflu) |
|||
{ |
|||
var incomingData = new IncomingFromExternal() |
|||
{ |
|||
DataType = EnumIncomingDataType.BackFlush.ToString(), |
|||
DataAction = EnumExchangeDataAction.Add, |
|||
SourceSystem = EnumSystemType.ERP.ToString(), |
|||
SourceDataId = backflu.scmout_type, |
|||
SourceDataGroupCode = backflu.scmout_nbr, |
|||
SourceDataDetailCode = backflu.scmout_part, |
|||
SourceDataContent = JsonSerializer.Serialize(backflu), |
|||
WriteTime = DateTime.Now, |
|||
Writer = nameof(MesIncomingBackgroundWorker), |
|||
DestinationSystem = EnumSystemType.ERP.ToString(), |
|||
}; |
|||
return incomingData; |
|||
} |
|||
|
|||
private static BackFlushNoteExchangeDto BuildScrapNoteOrderExchangeMes(Backflu backflu) |
|||
{ |
|||
|
|||
var back = new BackFlushNoteExchangeDto() |
|||
{ |
|||
|
|||
ActiveDate = Convert.ToDateTime(backflu.scmout_dt_w.Substring(0, 4) + "-" + backflu.scmout_dt_w.Substring(4, 2) + "-" + backflu.scmout_dt_w.Substring(6, 2)), |
|||
ItemCode = backflu.scmout_part, |
|||
Number = backflu.scmout_nbr |
|||
}; |
|||
var bakcdetail = new BackFlushNoteDetailExchangeDto() |
|||
{ |
|||
Number = backflu.scmout_nbr, |
|||
ItemCode = backflu.scmout_part, |
|||
Qty = backflu.scmout_qty, |
|||
LocationErpCode = backflu.scmout_loc |
|||
}; |
|||
back.Detail = bakcdetail; |
|||
return back; |
|||
} |
|||
} |
@ -0,0 +1,139 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text.Json; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Win_in.Sfs.Auth.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; |
|||
using Win_in.Sfs.Wms.DataExchange.WMS.ItemTransformNote; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing; |
|||
|
|||
public class ItemTransformNoteConverter : IOutgoingConverter |
|||
{ |
|||
private readonly IOutgoingFromWmsManager _outgoingFromWmsManager; |
|||
private readonly IOutgoingToExternalManager _outgoingToExternalManager; |
|||
private readonly ISupplierAsnAppService _supplierAsnAppService; |
|||
private readonly IDepartmentAppService _departmentAppService; |
|||
private readonly IObjectMapper _objectMapper; |
|||
|
|||
public ItemTransformNoteConverter( |
|||
IOutgoingFromWmsManager outgoingFromWmsManager |
|||
, IOutgoingToExternalManager outgoingToExternalManager |
|||
, ISupplierAsnAppService supplierAsnAppService |
|||
, IDepartmentAppService departmentAppService |
|||
, IObjectMapper objectMapper |
|||
) |
|||
{ |
|||
_outgoingFromWmsManager = outgoingFromWmsManager; |
|||
_outgoingToExternalManager = outgoingToExternalManager; |
|||
_supplierAsnAppService = supplierAsnAppService; |
|||
_departmentAppService = departmentAppService; |
|||
_objectMapper = objectMapper; |
|||
} |
|||
|
|||
public virtual async Task<List<OutgoingToExternal>> ConvertAsync() |
|||
{ |
|||
var outgoingToExternalList = new List<OutgoingToExternal>(); |
|||
var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.Item_Transform, EnumSystemType.ERP).ConfigureAwait(false); |
|||
foreach (var outgoingFromWms in outgoingFromWmsList) |
|||
{ |
|||
var wmsCountAdjust = JsonSerializer.Deserialize<ItemTransformNoteDTO>(outgoingFromWms.DataContent); |
|||
if (Enum.Parse<EnumTransSubType>(wmsCountAdjust.Type) == EnumTransSubType.Item_Transform) |
|||
{ |
|||
var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false); |
|||
var departmentCode = department == null ? "" : department.Code; |
|||
var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.ToItemCode, r.LocationErpCode, r.ToLocationCode }).Select(p => new ItemTransformNoteDetailExchangeDto { ToQty = p.Sum(itm => itm.ToQty), FromQty = p.Sum(itm => itm.FromQty), ItemCode = p.Key.ItemCode, ToItemCode = p.Key.ToItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) }); |
|||
foreach (var detail in details) |
|||
{ |
|||
List<ItemTransformNoteDetailExchangeDto> ItemTransform = new List<ItemTransformNoteDetailExchangeDto>(); |
|||
ItemTransformNoteDetailExchangeDto ItemTrans = new ItemTransformNoteDetailExchangeDto(); |
|||
ItemTrans.ItemCode = detail.ItemCode; |
|||
ItemTrans.LocationErpCode = detail.LocationErpCode; |
|||
ItemTrans.FromQty = detail.FromQty - detail.FromQty - detail.FromQty; |
|||
ItemTrans.ReasonCode = detail.ReasonCode; |
|||
ItemTransform.Add(ItemTrans); |
|||
ItemTransformNoteDetailExchangeDto ItemTranss = new ItemTransformNoteDetailExchangeDto(); |
|||
ItemTranss.ItemCode = detail.ToItemCode; |
|||
ItemTranss.LocationErpCode = detail.LocationErpCode; |
|||
ItemTranss.FromQty = detail.ToQty; |
|||
ItemTranss.ReasonCode = detail.ReasonCode; |
|||
ItemTransform.Add(ItemTranss); |
|||
foreach (var Item in ItemTransform) |
|||
{ |
|||
var outgoingToExternal = new OutgoingToExternal() |
|||
{ |
|||
DataType = outgoingFromWms.DataType, |
|||
DataAction = outgoingFromWms.DataAction, |
|||
SourceSystem = EnumSystemType.WMS.ToString(), |
|||
SourceDataId = wmsCountAdjust.Number, |
|||
SourceDataGroupCode = wmsCountAdjust.Number, |
|||
SourceDataDetailCode = Item.ItemCode, |
|||
Writer = nameof(TyrpOutgoingBackgroundWorker), |
|||
DestinationSystem = EnumSystemType.ERP.ToString(), |
|||
DestinationDataId = "", |
|||
}; |
|||
outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); |
|||
var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, Item).ConfigureAwait(false); |
|||
outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue); |
|||
var arrive = BuildIssue(exchangeIssue, departmentCode); |
|||
outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); |
|||
|
|||
outgoingToExternalList.Add(outgoingToExternal); |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false); ; |
|||
//将outgoingFromWms数据归档
|
|||
await _outgoingFromWmsManager.ArchiveManyAsync(outgoingFromWmsList).ConfigureAwait(false); ; |
|||
return outgoingToExternalList; |
|||
//插入到中间表OutgoingToExternal
|
|||
} |
|||
|
|||
private CountAdjust BuildIssue(ItemTransformNoteExchangeDto exchangeCountAdjust, string departmentCode) |
|||
{ |
|||
var detail = exchangeCountAdjust.Detail; |
|||
string asdtype = ""; |
|||
if (Enum.Parse<EnumTransSubType>(exchangeCountAdjust.Type) == EnumTransSubType.Item_Transform) |
|||
{ |
|||
asdtype = "4003"; |
|||
} |
|||
var counta = new CountAdjust() |
|||
{ |
|||
mesout_asd_refc = departmentCode, |
|||
mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), |
|||
mesout_asd_type = asdtype, |
|||
mesout_asd_part = detail.ItemCode, |
|||
mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"), |
|||
mesout_asd_loc = detail.LocationErpCode, |
|||
mesout_asd_code = detail.ReasonCode, |
|||
mesout_asd_qty = detail.FromQty, |
|||
mesout_asd_user = exchangeCountAdjust.Worker, |
|||
mesout_asd_k = string.Empty, |
|||
mesout_asd_stat = "Y" |
|||
|
|||
}; |
|||
|
|||
|
|||
return counta; |
|||
|
|||
} |
|||
|
|||
private async Task<ItemTransformNoteExchangeDto> BuildPurchaseReceiptExchangeDtoAsync( |
|||
ItemTransformNoteDTO wmsCountAdjust, ItemTransformNoteDetailExchangeDto wmsCountAdjustDetail) |
|||
{ |
|||
|
|||
var exchangeCountAdjust = _objectMapper.Map<ItemTransformNoteDTO, ItemTransformNoteExchangeDto>(wmsCountAdjust); |
|||
|
|||
exchangeCountAdjust.Detail = wmsCountAdjustDetail; |
|||
return exchangeCountAdjust; |
|||
} |
|||
} |
|||
|
@ -1,58 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.Account; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Win_in.Sfs.Auth.Application.Contracts; |
|||
using Win_in.Sfs.Wms.Pda.Authenticaitons; |
|||
using Win_in.Sfs.Wms.Pda.Models; |
|||
using PdaMenuDto = Win_in.Sfs.Wms.Pda.Models.PdaMenuDto; |
|||
using PdaMenuGroupDto = Win_in.Sfs.Wms.Pda.Models.PdaMenuGroupDto; |
|||
|
|||
namespace Win_in.Sfs.Wms.Pda.Controllers.Accounts; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[AllowAnonymous] |
|||
[ApiController] |
|||
[Route($"{PdaHostConst.ROOT_ROUTE}asfasf")] |
|||
|
|||
public class TestController: AbpController |
|||
{ |
|||
//private readonly IProfileAppService _profileAppService;
|
|||
//private readonly ITokenService _tokenService;
|
|||
private readonly IUserMenuAppService _userMenuAppService; |
|||
//private readonly IUserWorkGroupAppService _userWorkGroupAppService;
|
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="profileAppService"></param>
|
|||
/// <param name="tokenService"></param>
|
|||
/// <param name="userMenuAppService"></param>
|
|||
/// <param name="userWorkGroupAppService"></param>
|
|||
public TestController( |
|||
IUserMenuAppService userMenuAppService |
|||
, IUserWorkGroupAppService userWorkGroupAppService |
|||
) |
|||
{ |
|||
//_profileAppService = profileAppService;
|
|||
//_tokenService = tokenService;
|
|||
_userMenuAppService = userMenuAppService; |
|||
//_userWorkGroupAppService = userWorkGroupAppService;
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Test
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpGet("Test")] |
|||
public virtual async Task<List<string>> Test() |
|||
{ |
|||
return new List<string>() { "sdfsdf'" }; |
|||
} |
|||
} |
@ -0,0 +1,45 @@ |
|||
|
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.WMS.ItemTransformNote; |
|||
|
|||
public class ItemTransformNoteDetailExchangeDto |
|||
{ |
|||
/// <summary>
|
|||
/// 物品代码
|
|||
/// </summary>
|
|||
[Display(Name = "物品代码")] |
|||
public string ItemCode { get; set; } |
|||
/// <summary>
|
|||
/// ERP库位
|
|||
/// </summary>
|
|||
[Display(Name = "ERP库位")] |
|||
public string LocationErpCode { get; set; } |
|||
/// <summary>
|
|||
/// 原因代码
|
|||
/// </summary>
|
|||
[Display(Name = "原因代码")] |
|||
public string ReasonCode { get; set; } |
|||
/// <summary>
|
|||
/// 调整数量
|
|||
/// </summary>
|
|||
[Display(Name = "来源数量")] |
|||
public decimal FromQty { get; set; } |
|||
/// <summary>
|
|||
/// 目标数量
|
|||
/// </summary>
|
|||
[Display(Name = "目标数量")] |
|||
public decimal ToQty { get; set; } |
|||
/// <summary>
|
|||
/// 目标库位
|
|||
/// </summary>
|
|||
[Display(Name = "目标库位")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string ToLocationCode { get; set; } |
|||
/// <summary>
|
|||
/// 目标物品代码
|
|||
/// </summary>
|
|||
[Display(Name = "目标物品代码")] |
|||
public string ToItemCode { get; set; } |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
namespace Win_in.Sfs.Wms.DataExchange.WMS.ItemTransformNote; |
|||
|
|||
public class ItemTransformNoteExchangeDto |
|||
{ |
|||
/// <summary>
|
|||
/// 单据号
|
|||
/// </summary>
|
|||
public string Number { get; set; } |
|||
/// <summary>
|
|||
/// 生效日期
|
|||
/// </summary>
|
|||
public DateTime ActiveDate { get; set; } = DateTime.Now.Date; |
|||
/// <summary>
|
|||
/// 操作员
|
|||
/// </summary>
|
|||
public string Worker { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 类型
|
|||
/// </summary>
|
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 明细
|
|||
/// </summary>
|
|||
[Display(Name = "明细")] |
|||
public ItemTransformNoteDetailExchangeDto Detail { get; set; } = new(); |
|||
} |
@ -0,0 +1,41 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 线边调整-实体DTO
|
|||
/// </summary>
|
|||
public class WipWarehouseAdjustNoteDTO : SfsStoreDTOBase<WipWarehouseAdjustNoteDetailDTO>, IHasNumber |
|||
{ |
|||
/// <summary>
|
|||
/// 线边仓调整申请单号
|
|||
/// </summary>
|
|||
[Display(Name = "线边仓调整申请单号")] |
|||
public string RequestNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务ID
|
|||
/// </summary>
|
|||
[Display(Name = "任务ID")] |
|||
public string JobNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调整类型
|
|||
/// </summary>
|
|||
[Display(Name = "调整类型")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 已确认
|
|||
/// </summary>
|
|||
[Display(Name = "已确认")] |
|||
public bool Confirmed { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 确认时间
|
|||
/// </summary>
|
|||
[Display(Name = "确认时间")] |
|||
public DateTime? ConfirmTime { get; set; } |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 线边调整记录-明细表
|
|||
/// </summary>
|
|||
public class WipWarehouseAdjustNoteDetailDTO : SfsStoreDetailWithFromToDTOBase |
|||
{ |
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
[Display(Name = "调整原因")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调整代码
|
|||
/// </summary>
|
|||
[Display(Name = "原因代码")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string ReasonCode { get; set; } |
|||
} |
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public interface IWipWarehouseAdjustNoteAppService : |
|||
ISfsStoreMasterReadOnlyAppServiceBase<WipWarehouseAdjustNoteDTO, SfsStoreRequestInputBase, |
|||
WipWarehouseAdjustNoteDetailDTO, SfsStoreRequestInputBase> |
|||
{ |
|||
Task<WipWarehouseAdjustNoteDTO> ConfirmAsync(Guid id); |
|||
|
|||
/// <summary>
|
|||
/// 新增实体
|
|||
/// </summary>
|
|||
/// <param name="input">CreateInput</param>
|
|||
Task<WipWarehouseAdjustNoteDTO> CreateAsync(WipWarehouseAdjustNoteEditInput input); |
|||
} |
@ -0,0 +1,24 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 线边仓调整-明细表DTO
|
|||
/// </summary>
|
|||
public class WipWarehouseAdjustNoteDetailInput : SfsStoreDetailWithFromToInputBase |
|||
{ |
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
[Display(Name = "调整原因")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调整代码
|
|||
/// </summary>
|
|||
[Display(Name = "原因代码")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string ReasonCode { get; set; } |
|||
} |
@ -0,0 +1,48 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 新增和更新基础DTO
|
|||
/// </summary>
|
|||
public class WipWarehouseAdjustNoteEditInput : SfsStoreCreateOrUpdateInputBase |
|||
{ |
|||
#region Base
|
|||
/// <summary>
|
|||
/// 已确认
|
|||
/// </summary>
|
|||
[Display(Name = "已确认")] |
|||
public bool Confirmed { get; set; } |
|||
#endregion
|
|||
|
|||
#region Update
|
|||
/// <summary>
|
|||
/// 确认时间
|
|||
/// </summary>
|
|||
[Display(Name = "确认时间")] |
|||
public DateTime? ConfirmTime { get; set; } |
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 线边仓调整申请单号
|
|||
/// </summary>
|
|||
[Display(Name = "线边仓调整申请单号")] |
|||
public string RequestNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务ID
|
|||
/// </summary>
|
|||
[Display(Name = "任务ID")] |
|||
public string JobNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调整类型")] |
|||
public string Type { get; set; } |
|||
|
|||
[Display(Name = "详情")] |
|||
public List<WipWarehouseAdjustNoteDetailInput> Details { get; set; } = new List<WipWarehouseAdjustNoteDetailInput>(); |
|||
} |
@ -0,0 +1,71 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using DocumentFormat.OpenXml.Drawing; |
|||
using Win_in.Sfs.Shared.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public class WipWarehouseAdjustNoteImportInput : SfsStoreImportInputBase |
|||
{ |
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
[ImporterHeader(Name = "调拨类型")] |
|||
[ExporterHeader(DisplayName = "调拨类型")] |
|||
[ValueMapping("区域内调拨(储位内移库)", EnumTransSubType.Transfer_Inside)] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 已确认
|
|||
/// </summary>
|
|||
[Display(Name = "已确认")] |
|||
[ImporterHeader(IsIgnore = true)] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public bool Confirmed { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 物料号
|
|||
/// </summary>
|
|||
[Display(Name = "物料号")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string ItemCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调拨数量
|
|||
/// </summary>
|
|||
[Display(Name = "调拨数量")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public decimal Qty { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调出库位
|
|||
/// </summary>
|
|||
[Display(Name = "调出库位")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string FromLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调入库位
|
|||
/// </summary>
|
|||
[Display(Name = "调入库位")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string ToLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 箱码
|
|||
/// </summary>
|
|||
[Display(Name = "箱码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string PackingCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 状态
|
|||
/// </summary>
|
|||
[Display(Name = "状态")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public EnumInventoryStatus Status { get; set; } |
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public static class WipWarehouseAdjustNotePermissions |
|||
{ |
|||
public const string Default = StorePermissions.GroupName + "." + nameof(WipWarehouseAdjustNote); |
|||
public const string Create = Default + "." + StorePermissions.CreateStr; |
|||
public const string Update = Default + "." + StorePermissions.UpdateStr; |
|||
public const string Delete = Default + "." + StorePermissions.DeleteStr; |
|||
|
|||
public static void AddWipWarehouseAdjustNotePermission(this PermissionGroupDefinition permissionGroup) |
|||
{ |
|||
var WipWarehouseAdjustNotePermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(WipWarehouseAdjustNote))); |
|||
WipWarehouseAdjustNotePermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); |
|||
WipWarehouseAdjustNotePermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); |
|||
WipWarehouseAdjustNotePermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,6 @@ |
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public class ProductionReturnRequestDetailInput : SfsStoreDetailWithFromToInputBase |
|||
{ |
|||
|
|||
} |
@ -0,0 +1,15 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 线边调整-实体DTO
|
|||
/// </summary>
|
|||
public class WipWarehouseAdjustRequestDTO : SfsStoreRequestDTOBase<WipWarehouseAdjustRequestDetailDTO>, IHasNumber |
|||
{ |
|||
/// <summary>
|
|||
/// 调整类型
|
|||
/// </summary>
|
|||
[Display(Name = "调整类型")] |
|||
public string Type { get; set; } |
|||
} |
@ -0,0 +1,24 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 线边调整-明细表
|
|||
/// </summary>
|
|||
public class WipWarehouseAdjustRequestDetailDTO : SfsStoreDetailWithFromToDTOBase |
|||
{ |
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
[Display(Name = "调整原因")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调整代码
|
|||
/// </summary>
|
|||
[Display(Name = "原因代码")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string ReasonCode { get; set; } |
|||
} |
@ -0,0 +1,7 @@ |
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public interface IWipWarehouseAdjustRequestAppService |
|||
: ISfsStoreRequestMasterAppServiceBase<WipWarehouseAdjustRequestDTO, SfsStoreRequestInputBase, |
|||
WipWarehouseAdjustRequestEditInput, WipWarehouseAdjustRequestDetailDTO, SfsStoreRequestInputBase> |
|||
{ |
|||
} |
@ -0,0 +1,24 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 库存转移记录-明细表
|
|||
/// </summary>
|
|||
public class WipWarehouseAdjustRequestDetailInput : SfsStoreDetailWithFromToInputBase |
|||
{ |
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
[Display(Name = "调整原因")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调整代码
|
|||
/// </summary>
|
|||
[Display(Name = "原因代码")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string ReasonCode { get; set; } |
|||
} |
@ -0,0 +1,26 @@ |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 新增和更新基础DTO
|
|||
/// </summary>
|
|||
public class WipWarehouseAdjustRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase |
|||
{ |
|||
#region Base
|
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调整类型")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 明细列表
|
|||
/// </summary>
|
|||
[Display(Name = "明细列表")] |
|||
public List<WipWarehouseAdjustRequestDetailInput> Details { get; set; } |
|||
|
|||
#endregion
|
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue