|
|
@ -83,12 +83,6 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
|
/// </summary>
|
|
|
|
private readonly EnumBusinessType _businessType = EnumBusinessType.JisBBAC; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 地点
|
|
|
|
/// </summary>
|
|
|
|
[Display(Name = "地点")] |
|
|
|
public string Site { get; set; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 构造
|
|
|
|
/// </summary>
|
|
|
@ -116,6 +110,15 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
|
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 地点
|
|
|
|
/// </summary>
|
|
|
|
public string Site { get; set; } |
|
|
|
/// <summary>
|
|
|
|
/// 期间
|
|
|
|
/// </summary>
|
|
|
|
public int Version { get; set; } |
|
|
|
|
|
|
|
#region 导入、导出
|
|
|
|
/// <summary>
|
|
|
|
/// 导入
|
|
|
@ -124,6 +127,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
|
public async Task<IActionResult> ImportAsync([FromForm] BBACSaImportRequestDto bbacSaImportRequestDto) |
|
|
|
{ |
|
|
|
Site = bbacSaImportRequestDto.Site; |
|
|
|
Version = bbacSaImportRequestDto.Version; |
|
|
|
#region 导入数据转换、数据校验
|
|
|
|
ExportImporter _exportImporter = new ExportImporter(); |
|
|
|
var importDtos = await _exportImporter.UploadExcelImport<BBAC_SA_DETAIL_IMPORT_DTO>(bbacSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false); |
|
|
@ -149,7 +153,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
|
importBBACSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index); |
|
|
|
} |
|
|
|
|
|
|
|
importBBACSaDetail.Version = bbacSaImportRequestDto.Version; |
|
|
|
importBBACSaDetail.Version = Version; |
|
|
|
importBBACSaDetail.Site = Site; |
|
|
|
}); |
|
|
|
|
|
|
@ -206,8 +210,13 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
|
[HttpPost] |
|
|
|
public async Task<PagedResultDto<BBAC_SA_DTO>> GetListAsync(RequestDto input) |
|
|
|
{ |
|
|
|
var entities = await _bbacSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); |
|
|
|
var totalCount = await _bbacSaRepository.GetCountByFilterAsync(input.Filters); |
|
|
|
var businessTypeFilterConditions = input.Filters.FindAll(t => t.Column.ToLower() == "businesstype"); |
|
|
|
businessTypeFilterConditions.ForEach(t => |
|
|
|
{ |
|
|
|
t.Value = EnumBusinessType.JisBBAC.ToString(); |
|
|
|
}); |
|
|
|
var entities = await _bbacSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); |
|
|
|
var totalCount = await _bbacSaRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); |
|
|
|
var dtos = ObjectMapper.Map<List<BBAC_SA>, List<BBAC_SA_DTO>>(entities); |
|
|
|
return new PagedResultDto<BBAC_SA_DTO>(totalCount, dtos); |
|
|
|
} |
|
|
@ -307,23 +316,23 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
|
//删除
|
|
|
|
if (bbacSas.Any()) |
|
|
|
{ |
|
|
|
await _bbacSaRepository.DeleteManyAsync(bbacSas); |
|
|
|
await _bbacSaRepository.DeleteManyAsync(bbacSas).ConfigureAwait(false); |
|
|
|
} |
|
|
|
if (bbacSaDetails.Any()) |
|
|
|
{ |
|
|
|
await _bbacSaDetailRepository.DbContext.BulkDeleteAsync(bbacSaDetails); |
|
|
|
await _bbacSaDetailRepository.DbContext.BulkDeleteAsync(bbacSaDetails).ConfigureAwait(false); |
|
|
|
} |
|
|
|
if (bbacCanSas.Any()) |
|
|
|
{ |
|
|
|
await _bbacCanSaRepository.DeleteManyAsync(bbacCanSas); |
|
|
|
await _bbacCanSaRepository.DeleteManyAsync(bbacCanSas).ConfigureAwait(false); |
|
|
|
} |
|
|
|
if (bbacCanSaDetails.Any()) |
|
|
|
{ |
|
|
|
await _bbacCanSaDetailRepository.DbContext.BulkDeleteAsync(bbacCanSaDetails); |
|
|
|
await _bbacCanSaDetailRepository.DbContext.BulkDeleteAsync(bbacCanSaDetails).ConfigureAwait(false); |
|
|
|
} |
|
|
|
if (bbacNotSaDetails.Any()) |
|
|
|
{ |
|
|
|
await _bbacNotSaDetailRepository.DbContext.BulkDeleteAsync(bbacNotSaDetails); |
|
|
|
await _bbacNotSaDetailRepository.DbContext.BulkDeleteAsync(bbacNotSaDetails).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
@ -342,7 +351,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
|
BillNum = bbacSaBillNum, |
|
|
|
State = "0", |
|
|
|
BusinessType = _businessType, |
|
|
|
Site = Site |
|
|
|
Site = Site, |
|
|
|
Version = Version |
|
|
|
}; |
|
|
|
//可结算单号
|
|
|
|
var bbacCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C"); |
|
|
@ -354,7 +364,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
|
SettleBillNum = bbacSaBillNum, |
|
|
|
State = SettleBillState.未结状态, |
|
|
|
BusinessType = _businessType, |
|
|
|
Site = Site |
|
|
|
Site = Site, |
|
|
|
Version = Version |
|
|
|
}; |
|
|
|
//可结算明细
|
|
|
|
var bbacCanSaDetails = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
|