mahao 1 year ago
parent
commit
408b7cb4d2
  1. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
  2. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  3. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs
  4. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs

9
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs

@ -138,6 +138,15 @@ public class BBAC_SA_DETAIL_IMPORT_DTO
[Required(ErrorMessage = "{0}不能为空")] [Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "External Call Number")] [ImporterHeader(Name = "External Call Number")]
public string PN { get; set; } public string PN { get; set; }
/// <summary>
/// Movement Type
/// MovementType = 967,代表退货需要标记为负数
/// MovementType = 966,代表正常发货标记正数
/// </summary>
[Display(Name = "Movement Type")]
[ImporterHeader(Name = "Movement Type")]
public string MovementType { get; set; }
} }
/// <summary> /// <summary>

11
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -114,7 +114,16 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
{ {
#region 导入数据转换、数据校验 #region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var importDtos = await _exportImporter.UploadExcelImport<BBAC_SA_DETAIL_IMPORT_DTO>(files, _excelImportService); var importDtos = await _exportImporter.UploadExcelImport<BBAC_SA_DETAIL_IMPORT_DTO>(files, _excelImportService).ConfigureAwait(false);
importDtos.ForEach(importDto =>
{
if (importDto.MovementType == "967")
{
importDto.Qty = -importDto.Qty;
}
});
var importBBACSaDetails = ObjectMapper.Map<List<BBAC_SA_DETAIL_IMPORT_DTO>, List<BBAC_SA_DETAIL>>(importDtos); var importBBACSaDetails = ObjectMapper.Map<List<BBAC_SA_DETAIL_IMPORT_DTO>, List<BBAC_SA_DETAIL>>(importDtos);
//数据校验 //数据校验

12
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs

@ -67,17 +67,17 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
[ApiExplorerSettings(IgnoreApi = true)] [ApiExplorerSettings(IgnoreApi = true)]
public async Task Invoke(IServiceProvider serviceProvider) public async Task Invoke(IServiceProvider serviceProvider)
{ {
await this.Invoke(); await this.Invoke().ConfigureAwait(false);
} }
[HttpPost] [HttpPost]
public async Task Invoke() public async Task Invoke()
{ {
await SyncJitRecordAsync(); await SyncJitRecordAsync().ConfigureAwait(false);
await SyncJisRecordAsync(); await SyncJisRecordAsync().ConfigureAwait(false);
if (_addMaterialRelationships.Any()) if (_addMaterialRelationships.Any())
{ {
_addMaterialRelationships = _addMaterialRelationships.GroupBy(t => new { t.ErpMaterialCode }).Select(t => t.First()).ToList(); _addMaterialRelationships = _addMaterialRelationships.Where(t => !string.IsNullOrEmpty(t.ErpMaterialCode)).GroupBy(t => new { t.ErpMaterialCode }).Select(t => t.First()).ToList();
await _materialRelationshipManager.AddNewMaterialRelationships(_addMaterialRelationships).ConfigureAwait(false); await _materialRelationshipManager.AddNewMaterialRelationships(_addMaterialRelationships).ConfigureAwait(false);
} }
} }
@ -100,7 +100,7 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
} }
//WMS发运记录 //WMS发运记录
var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD.Where(predicate).OrderBy(b => b.UID).ToList(); var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD.Where(predicate).OrderBy(b => b.UID).Take(10000).ToList();
var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<BBAC_SE_DETAIL>>(wmsSeRecords); var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<BBAC_SE_DETAIL>>(wmsSeRecords);
if (bbacSeDetails.Any()) if (bbacSeDetails.Any())
@ -150,7 +150,7 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
} }
//WMS发运数据 //WMS发运数据
var wmsRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD.Where(predicate).OrderBy(b => b.UID).ToList(); var wmsRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD.Where(predicate).OrderBy(b => b.UID).Take(10000).ToList();
var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<BBAC_SE_DETAIL>>(wmsRecords); var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<BBAC_SE_DETAIL>>(wmsRecords);
if (bbacSeDetails.Any()) if (bbacSeDetails.Any())

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs

@ -88,7 +88,7 @@ public class HBPOSeSyncAppService : ApplicationService, IInvocable, IJobService
await SyncJisRecordAsync().ConfigureAwait(false); await SyncJisRecordAsync().ConfigureAwait(false);
if (_addMaterialRelationships.Any()) if (_addMaterialRelationships.Any())
{ {
_addMaterialRelationships = _addMaterialRelationships.GroupBy(t => new { t.ErpMaterialCode }).Select(t => t.First()).ToList(); _addMaterialRelationships = _addMaterialRelationships.Where(t => !string.IsNullOrEmpty(t.ErpMaterialCode)).GroupBy(t => new { t.ErpMaterialCode }).Select(t => t.First()).ToList();
await _materialRelationshipManager.AddNewMaterialRelationships(_addMaterialRelationships).ConfigureAwait(false); await _materialRelationshipManager.AddNewMaterialRelationships(_addMaterialRelationships).ConfigureAwait(false);
} }
} }

Loading…
Cancel
Save