|
@ -5,6 +5,7 @@ using System.Text.Json; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using Volo.Abp.ObjectMapping; |
|
|
using Volo.Abp.ObjectMapping; |
|
|
using Win_in.Sfs.Auth.Application.Contracts; |
|
|
using Win_in.Sfs.Auth.Application.Contracts; |
|
|
|
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
using Win_in.Sfs.Shared.Domain.Shared; |
|
|
using Win_in.Sfs.Shared.Domain.Shared; |
|
|
using Win_in.Sfs.Wms.DataExchange.Domain; |
|
|
using Win_in.Sfs.Wms.DataExchange.Domain; |
|
|
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp; |
|
|
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp; |
|
@ -23,18 +24,22 @@ public class TransferNoteConverter : IOutgoingConverter |
|
|
private readonly IOutgoingToExternalManager _outgoingToExternalManager; |
|
|
private readonly IOutgoingToExternalManager _outgoingToExternalManager; |
|
|
private readonly IDepartmentAppService _departmentAppService; |
|
|
private readonly IDepartmentAppService _departmentAppService; |
|
|
private readonly IObjectMapper _objectMapper; |
|
|
private readonly IObjectMapper _objectMapper; |
|
|
|
|
|
private readonly IErpLocationAppService _erpLocationAppService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TransferNoteConverter( |
|
|
public TransferNoteConverter( |
|
|
IOutgoingFromWmsManager outgoingFromWmsManager |
|
|
IOutgoingFromWmsManager outgoingFromWmsManager |
|
|
, IOutgoingToExternalManager outgoingToExternalManager |
|
|
, IOutgoingToExternalManager outgoingToExternalManager |
|
|
, IDepartmentAppService departmentAppService |
|
|
, IDepartmentAppService departmentAppService |
|
|
, IObjectMapper objectMapper |
|
|
, IObjectMapper objectMapper |
|
|
|
|
|
, IErpLocationAppService erpLocationAppService |
|
|
) |
|
|
) |
|
|
{ |
|
|
{ |
|
|
_outgoingFromWmsManager = outgoingFromWmsManager; |
|
|
_outgoingFromWmsManager = outgoingFromWmsManager; |
|
|
_outgoingToExternalManager = outgoingToExternalManager; |
|
|
_outgoingToExternalManager = outgoingToExternalManager; |
|
|
_departmentAppService = departmentAppService; |
|
|
_departmentAppService = departmentAppService; |
|
|
_objectMapper = objectMapper; |
|
|
_objectMapper = objectMapper; |
|
|
|
|
|
_erpLocationAppService = erpLocationAppService; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -71,6 +76,8 @@ public class TransferNoteConverter : IOutgoingConverter |
|
|
DestinationSystem = EnumSystemType.ERP.ToString(), |
|
|
DestinationSystem = EnumSystemType.ERP.ToString(), |
|
|
DestinationDataId = "", |
|
|
DestinationDataId = "", |
|
|
}; |
|
|
}; |
|
|
|
|
|
var stat = "1"; |
|
|
|
|
|
|
|
|
outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); |
|
|
outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); |
|
|
outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceipt); |
|
|
outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceipt); |
|
|
string dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"); |
|
|
string dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"); |
|
@ -86,7 +93,17 @@ public class TransferNoteConverter : IOutgoingConverter |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
outgoingToExternal.DataType = EnumOutgoingDataType.TransferForCustom.ToString(); |
|
|
outgoingToExternal.DataType = EnumOutgoingDataType.TransferForCustom.ToString(); |
|
|
var putawayNoteWmsoutm = BuildWmsoutmDataInterface(exchangeReceipt, departmentCode, dt_w, tyrpNumber); |
|
|
|
|
|
|
|
|
var toLocationErpcode = details[0].ToLocationErpCode; |
|
|
|
|
|
var erplocation = await _erpLocationAppService.GetByCodeAsync(toLocationErpcode).ConfigureAwait(false); |
|
|
|
|
|
if (erplocation?.Type != "2") |
|
|
|
|
|
{ |
|
|
|
|
|
stat = "2"; |
|
|
|
|
|
} |
|
|
|
|
|
var location = stat == "1" ? details[0].ToLocationErpCode : details[0].FromLocationErpCode; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var putawayNoteWmsoutm = BuildWmsoutmDataInterface(exchangeReceipt, departmentCode, dt_w, tyrpNumber,location); |
|
|
outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteWmsoutm); |
|
|
outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteWmsoutm); |
|
|
|
|
|
|
|
|
WipDetails = details.GroupBy(r => new { r.Number, r.ItemCode, r.FromLocationErpCode }).Select(p => new TransferNoteDetailExchangeDto { Qty = p.Sum(itm => itm.Qty), Number = p.Key.Number, ItemCode = p.Key.ItemCode, FromLocationErpCode = p.Key.FromLocationErpCode }).ToList(); |
|
|
WipDetails = details.GroupBy(r => new { r.Number, r.ItemCode, r.FromLocationErpCode }).Select(p => new TransferNoteDetailExchangeDto { Qty = p.Sum(itm => itm.Qty), Number = p.Key.Number, ItemCode = p.Key.ItemCode, FromLocationErpCode = p.Key.FromLocationErpCode }).ToList(); |
|
@ -191,7 +208,7 @@ public class TransferNoteConverter : IOutgoingConverter |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="exchangeOrder"></param>
|
|
|
/// <param name="exchangeOrder"></param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
private Wmsoutm BuildWmsoutmDataInterface(TransferNoteExchangeDto exchangeOrder, string departmentCode, string dt_w,string tyrpNumber) |
|
|
private Wmsoutm BuildWmsoutmDataInterface(TransferNoteExchangeDto exchangeOrder, string departmentCode, string dt_w,string tyrpNumber,string location) |
|
|
{ |
|
|
{ |
|
|
var ret = new Wmsoutm() |
|
|
var ret = new Wmsoutm() |
|
|
{ |
|
|
{ |
|
@ -201,11 +218,11 @@ public class TransferNoteConverter : IOutgoingConverter |
|
|
wmsoutm_stat = "Y", |
|
|
wmsoutm_stat = "Y", |
|
|
wmsoutm_tyrp_dt = "", |
|
|
wmsoutm_tyrp_dt = "", |
|
|
wmsoutm_user = "WMS", |
|
|
wmsoutm_user = "WMS", |
|
|
wmsoutm_dept = departmentCode,//根据Worker从UserDepartment中获取
|
|
|
wmsoutm_dept = "450900",//根据Worker从UserDepartment中获取
|
|
|
wmsoutm_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), |
|
|
wmsoutm_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), |
|
|
wmsoutm_cust = "", |
|
|
wmsoutm_cust = "", |
|
|
wmsoutm_shm_nbr = "", |
|
|
wmsoutm_shm_nbr = "", |
|
|
wmsoutm_cust_loc = "", |
|
|
wmsoutm_cust_loc =location, |
|
|
wmsoutm_stock_stat = "1", |
|
|
wmsoutm_stock_stat = "1", |
|
|
wmsoutm_open_part = "", |
|
|
wmsoutm_open_part = "", |
|
|
wmsoutm_open_loc = "", |
|
|
wmsoutm_open_loc = "", |
|
|