diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
index b2c75d92..870438e5 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
+++ b/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}不能为空")]
[ImporterHeader(Name = "External Call Number")]
public string PN { get; set; }
+
+ ///
+ /// Movement Type
+ /// MovementType = 967,代表退货需要标记为负数
+ /// MovementType = 966,代表正常发货标记正数
+ ///
+ [Display(Name = "Movement Type")]
+ [ImporterHeader(Name = "Movement Type")]
+ public string MovementType { get; set; }
}
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
index 22431613..e08ce6f5 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
@@ -114,7 +114,16 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase
{
#region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter();
- var importDtos = await _exportImporter.UploadExcelImport(files, _excelImportService);
+ var importDtos = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false);
+
+ importDtos.ForEach(importDto =>
+ {
+ if (importDto.MovementType == "967")
+ {
+ importDto.Qty = -importDto.Qty;
+ }
+ });
+
var importBBACSaDetails = ObjectMapper.Map, List>(importDtos);
//数据校验
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs
index ae136f48..0f36c5da 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs
+++ b/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)]
public async Task Invoke(IServiceProvider serviceProvider)
{
- await this.Invoke();
+ await this.Invoke().ConfigureAwait(false);
}
[HttpPost]
public async Task Invoke()
{
- await SyncJitRecordAsync();
- await SyncJisRecordAsync();
+ await SyncJitRecordAsync().ConfigureAwait(false);
+ await SyncJisRecordAsync().ConfigureAwait(false);
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);
}
}
@@ -100,7 +100,7 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
}
//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>(wmsSeRecords);
if (bbacSeDetails.Any())
@@ -150,7 +150,7 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
}
//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>(wmsRecords);
if (bbacSeDetails.Any())
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs
index 480740a9..70c6f1b7 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs
+++ b/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);
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);
}
}