Browse Source

BBAC期间

master
mahao 1 year ago
parent
commit
5b69f31123
  1. 43
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  2. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

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

@ -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>();

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

@ -104,6 +104,11 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
}
/// <summary>
/// 期间
/// </summary>
public int Version { get; set; }
#region 导入、导出
/// <summary>
/// 导入
@ -111,6 +116,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
[HttpPost]
public async Task<IActionResult> ImportAsync([FromForm] HBPOSaImportRequestDto hbpoSaImportRequestDto)
{
Version = hbpoSaImportRequestDto.Version;
#region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<HBPO_SA_DETAIL_IMPORT_DTO>(hbpoSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false);
@ -127,7 +133,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
var luAssemble = lus.Select(t => t.Replace(" ", ""));
importHBOPSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
importHBOPSaDetail.Version = hbpoSaImportRequestDto.Version;
importHBOPSaDetail.Version = Version;
});
//Site包含CN1 亦庄
@ -272,6 +278,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
State = "1",
BusinessType = _businessType,
Site = site,
Version = Version
};
//可结算单号
var hbpoCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C");
@ -284,6 +291,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
State = SettleBillState.,
BusinessType = _businessType,
Site = site,
Version = Version
};
//可结算明细
var hbpoCanSaDetails = new List<HBPO_CAN_SA_DETAIL>();

Loading…
Cancel
Save