diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedIssueNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedIssueNoteConverter.cs index ae78b9886..32a79c4ee 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedIssueNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedIssueNoteConverter.cs @@ -52,14 +52,14 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter var exchangeReceipt = _objectMapper.Map(wmsReceipt); //var department = await _departmentAppService.GetByUsernameAsync(exchangeReceipt.Worker).ConfigureAwait(false); //var departmentCode = department == null ? "" : department.Code; - //if (Guid.TryParse(exchangeReceipt.CreatorId.ToString(), out Guid guid)) - //{ - // var username = await _sfsUserAppService.GetUserNameById(guid).ConfigureAwait(false); - // if (!string.IsNullOrEmpty(username)) - // { - // exchangeReceipt.Worker = username; - // } - //} + if (Guid.TryParse(exchangeReceipt.CreatorId.ToString(), out Guid guid)) + { + var username = await _sfsUserAppService.GetUserNameById(guid).ConfigureAwait(false); + if (!string.IsNullOrEmpty(username)) + { + exchangeReceipt.Worker = username; + } + } var purchaseOrder = BuildDataInterface(exchangeReceipt); var outgoingToExternal = new OutgoingToExternal() @@ -127,7 +127,7 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter wmsoutm_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), wmsoutm_stat = "Y", wmsoutm_tyrp_dt = "", - wmsoutm_user = exchangeOrder.Worker.Length >= 6 ? exchangeOrder.Worker.Substring(0, 6) : exchangeOrder.Worker, + wmsoutm_user = exchangeOrder.Worker.Length >= 6 ? exchangeOrder.Worker.Substring(exchangeOrder.Worker.Length- 6) : exchangeOrder.Worker, wmsoutm_dept = "",//根据Worker从UserDepartment中获取 wmsoutm_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), wmsoutm_cust = "", diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedReceiptNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedReceiptNoteConverter.cs index 5b15bd310..be51b0791 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedReceiptNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedReceiptNoteConverter.cs @@ -53,14 +53,14 @@ public class UnplannedReceiptNoteConverter : IOutgoingConverter var exchangeReceipt = _objectMapper.Map(wmsReceipt); //var department = await _departmentAppService.GetByUsernameAsync(exchangeReceipt.Worker).ConfigureAwait(false); //var departmentCode = department == null ? "" : department.Code; - //if (Guid.TryParse(exchangeReceipt.CreatorId.ToString(), out Guid guid)) - //{ - // var username = await _sfsUserAppService.GetUserNameById(guid).ConfigureAwait(false); - // if (!string.IsNullOrEmpty(username)) - // { - // exchangeReceipt.Worker = username; - // } - //} + if (Guid.TryParse(exchangeReceipt.CreatorId.ToString(), out Guid guid)) + { + var username = await _sfsUserAppService.GetUserNameById(guid).ConfigureAwait(false); + if (!string.IsNullOrEmpty(username)) + { + exchangeReceipt.Worker = username; + } + } var purchaseOrder = BuildDataInterface(exchangeReceipt); var outgoingToExternal = new OutgoingToExternal() { @@ -128,7 +128,7 @@ public class UnplannedReceiptNoteConverter : IOutgoingConverter wmsoutm_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), wmsoutm_stat = "Y", wmsoutm_tyrp_dt = "", - wmsoutm_user = exchangeOrder.Worker.Length>=6? exchangeOrder.Worker.Substring(0,6): exchangeOrder.Worker, + wmsoutm_user = exchangeOrder.Worker.Length>=6? exchangeOrder.Worker.Substring(exchangeOrder.Worker.Length-6) : exchangeOrder.Worker, wmsoutm_dept = "",//根据Worker从UserDepartment中获取 wmsoutm_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), wmsoutm_cust = "",