wanggang 1 year ago
parent
commit
d78174fe8f
  1. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
  2. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  3. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  4. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

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

@ -130,7 +130,7 @@ public class BBAC_SA_DETAIL_IMPORT_DTO
/// </summary>
[Display(Name = "Posting Date")]
[ImporterHeader(Name = "Posting Date")]
public DateTime SettleDate { set; get; }
public string SettleDate { set; get; }
/// <summary>
/// 结算分组号

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

@ -140,6 +140,15 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
importBBACSaDetails.ForEach(importBBACSaDetail =>
{
List<string> lus = importBBACSaDetail.LU.Split(" ").ToList();
importBBACSaDetail.LU = lus[0].Replace(" ", "");
if (lus.Count > 1)
{
lus.RemoveAt(0);
var luAssemble = lus.Select(t => t.Replace(" ", ""));
importBBACSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
importBBACSaDetail.Version = bbacSaImportRequestDto.Version;
importBBACSaDetail.Site = Site;
});
@ -331,7 +340,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
var bbacSa = new BBAC_SA()
{
BillNum = bbacSaBillNum,
State = "1",
State = "0",
BusinessType = _businessType,
Site = Site
};
@ -399,8 +408,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
#endregion
#region 添加入库
await _bbacSaRepository.InsertAsync(bbacSa);
await _bbacSaDetailRepository.DbContext.BulkInsertAsync(bbacSaDetails);
await _bbacSaRepository.InsertAsync(bbacSa).ConfigureAwait(false);
await _bbacSaDetailRepository.DbContext.BulkInsertAsync(bbacSaDetails).ConfigureAwait(false);
if (bbacCanSaDetails.Count > 0)
{
bbacCanSaDetails.ForEach(bbacCanSaDetail =>
@ -409,8 +418,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
bbacCanSaDetail.BusinessType = _businessType;
});
await _bbacCanSaRepository.InsertAsync(bbacCanSa);
await _bbacCanSaDetailRepository.DbContext.BulkInsertAsync(bbacCanSaDetails);
await _bbacCanSaRepository.InsertAsync(bbacCanSa).ConfigureAwait(false);
await _bbacCanSaDetailRepository.DbContext.BulkInsertAsync(bbacCanSaDetails).ConfigureAwait(false);
}
if (bbacNotSaDetails.Count > 0)
{
@ -419,7 +428,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
bbacNotSaDetail.BusinessType = _businessType;
});
await _bbacNotSaDetailRepository.InsertManyAsync(bbacNotSaDetails);
await _bbacNotSaDetailRepository.DbContext.BulkInsertAsync(bbacNotSaDetails).ConfigureAwait(false);
}
if (materialRelationships.Count > 0)
{
@ -443,8 +452,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
List<BBAC_CAN_SA_DETAIL> bbacCanSaDetails = new List<BBAC_CAN_SA_DETAIL>();
//不可结算
List<BBAC_NOT_SA_DETAIL> bbacNotSaDetails = new List<BBAC_NOT_SA_DETAIL>();
var bbacSaEntity = await _bbacSaRepository.FirstOrDefaultAsync(t => t.Id.Equals(id)).ConfigureAwait(false);
//var bbacSaEntity = await _bbacSaRepository.FindAsync(id).ConfigureAwait(false);
var bbacSaEntity = await _bbacSaRepository.FindAsync(id).ConfigureAwait(false);
if (bbacSaEntity != null)
{
//结算单据

9
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -118,6 +118,15 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
importHBOPSaDetails.ForEach(importHBOPSaDetail =>
{
importHBOPSaDetail.SetId(GuidGenerator.Create());
var lus = importHBOPSaDetail.LU.Split(" ").ToList();
importHBOPSaDetail.LU = lus[0].Replace(" ", "");
if (lus.Count > 1)
{
lus.RemoveAt(0);
var luAssemble = lus.Select(t => t.Replace(" ", ""));
importHBOPSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
importHBOPSaDetail.Version = hbpoSaImportRequestDto.Version;
});

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -1025,7 +1025,8 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum));
CreateMap<BBAC_SA_DETAIL, BBAC_SA_DETAIL_EXPORT_DTO>();
CreateMap<BBAC_SA_DETAIL_IMPORT_DTO, BBAC_SA_DETAIL>();
CreateMap<BBAC_SA_DETAIL_IMPORT_DTO, BBAC_SA_DETAIL>()
.ForMember(x => x.SettleDate, y => y.MapFrom(y => DateTime.ParseExact(y.SettleDate, "dd.MM.yyyy", System.Globalization.CultureInfo.CurrentCulture)));
}
/// <summary>

Loading…
Cancel
Save