wanggang 1 year ago
parent
commit
3a433172c2
  1. 94
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs
  2. 58
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  3. 31
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  4. 28
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs
  5. 31
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
  6. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  7. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  8. 55
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs
  9. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs
  10. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs
  11. 48
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs
  12. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  13. 49
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs
  14. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
  15. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/CAN_SA_MNG.cs
  16. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs
  17. 55
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs
  18. 4035
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719004135_20230719-1.Designer.cs
  19. 56
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719004135_20230719-1.cs
  20. 12
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

94
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs

@ -0,0 +1,94 @@
using Shouldly;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
namespace Win.Sfs.SettleAccount.Bases
{
public abstract class BASE_SERVICE: ApplicationService, ITransientDependency
{
protected readonly IExcelImportAppService _excelImportService;
protected readonly ISnowflakeIdGenerator _snowflakeIdGenerator;
protected readonly ICommonManager _commonManager;
protected BASE_SERVICE() { }
protected BASE_SERVICE(
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager)
{
_excelImportService = excelImportService;
_snowflakeIdGenerator = snowflakeIdGenerator;
_commonManager = commonManager;
}
/// <summary>
/// 输出报错信息
/// </summary>
/// <param name="errorList"></param>
/// <param name="fileName"></param>
/// <returns></returns>
protected async Task<string> ExportErrorReportAsync(List<ErrorExportDto> errorList, string fileName = "")
{
//没有信息返回成功
if (errorList == null || errorList.Count == 0)
{
return ApplicationConsts.SuccessStr;
}
if (string.IsNullOrEmpty(fileName))
{
//导出文件名称
fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.CheckErroFileName, _snowflakeIdGenerator.Create().ToString(), ApplicationConsts.FileExtension);
}
errorList = errorList.Distinct().OrderBy(p => p.Type).ThenBy(p => p.Model).ThenBy(p => p.ItemCode).ToList();
//声明导出容器
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExcelExporter(errorList);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = fileName,
Content = result
}
);
return fileName;
}
}
}

58
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs

@ -15,14 +15,17 @@ using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Bases
{
public abstract class BA_SERVICE:ApplicationService
public abstract class BA_SERVICE: BASE_SERVICE
{
private readonly INormalEfCoreRepository<INVOICE_GRP, Guid> _repository;
private readonly INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> _wRepository;
@ -31,28 +34,41 @@ namespace Win.Sfs.SettleAccount.Bases
//private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService;
protected BA_SERVICE(
INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository,
IExcelImportAppService excelImportService
//INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_excelImportService = excelImportService;
_repository = repository;
_wRepository = wRepository;
_mRepository = mRepository;
_sRepository = sRepository;
}
/// <summary>
/// 审核发票通过
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public virtual async Task<string> GenerateInvoice(INVOICE_GRP_REQ_DTO input)
{
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 主表查询
/// </summary>
/// <param name="input">主表查询条件</param>
/// <returns></returns>
[HttpPost]
//[Route("mainquery")]
public virtual async Task<PagedResultDto<INVOICE_GRP_DTO>> MainQueryAsync(INVOICE_GRP_REQ_DTO input)
@ -62,24 +78,34 @@ namespace Win.Sfs.SettleAccount.Bases
var dtos = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_DTO>>(entitys);
return new PagedResultDto<INVOICE_GRP_DTO>(totalCount, dtos);
}
/// <summary>
/// 查询明细明细
/// </summary>
/// <param name="input">明细查询条件</param>
/// <returns></returns>
[HttpPost]
public virtual async Task<INVOICE_GRP_DETAIL_DTO> DetailQueryAsync(INVOICE_GRP_REQ_DTO input)
{
INVOICE_GRP_DETAIL_DTO _entity=new INVOICE_GRP_DETAIL_DTO();
INVOICE_GRP_DETAIL_DTO entity=new INVOICE_GRP_DETAIL_DTO();
var m= await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var mdtos = ObjectMapper.Map<List<INVOICE_MAP_GROUP>, List<INVOICE_MAP_GROUP_DTO>>(m);
var w=await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var wdtos = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(w);
var s=await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s);
_entity.INVOICE_NOT_SETTLE = sdtos;
_entity.INVOICE_WAIT_DETAIL = wdtos;
_entity.INVOICE_MAP_GROUP = mdtos;
return _entity;
entity.INVOICE_NOT_SETTLE = sdtos;
entity.INVOICE_WAIT_DETAIL = wdtos;
entity.INVOICE_MAP_GROUP = mdtos;
return entity;
}
/// <summary>
/// 导出文件
/// </summary>
/// <param name="input">主表查询条件</param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> ExportAsync(INVOICE_GRP_REQ_DTO input)
{
@ -112,9 +138,27 @@ namespace Win.Sfs.SettleAccount.Bases
);
return _fileName;
}
/// <summary>
/// 退回
/// </summary>
/// <param name="input">主表查询条件</param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> RejectAsync(INVOICE_GRP_REQ_DTO input)
{
return ApplicationConsts.SuccessStr;
}
protected virtual async Task<string> RuleAsync(INVOICE_GRP_REQ_DTO input)
{
return ApplicationConsts.SuccessStr;
}

31
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs

@ -17,15 +17,18 @@ using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Volo.Abp.ObjectMapping;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Bases
{
public abstract class CAN_SA_SERVICE<TEntity, TEntityDto, TEntityDetail, TEntityDetailDto, TRequestMainInput, TRequestDetailInput, TEntityDetailExportDto> :ApplicationService
public abstract class CAN_SA_SERVICE<TEntity, TEntityDto, TEntityDetail, TEntityDetailDto, TRequestMainInput, TRequestDetailInput, TEntityDetailExportDto> : BASE_SERVICE
where TEntity : class, IEntity<Guid>
where TEntityDetail:SA_CAN_BASE
where TEntityDto : class, IEntityDto<Guid>, new()
@ -39,6 +42,7 @@ namespace Win.Sfs.SettleAccount.Bases
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService;
protected CAN_SA_SERVICE(
INormalEfCoreRepository<TEntity, Guid> repository,
IExcelImportAppService excelImportService,
@ -52,7 +56,11 @@ namespace Win.Sfs.SettleAccount.Bases
}
/// <summary>
///查询明细
/// </summary>
/// <param name="input">明细查询条件</param>
/// <returns></returns>
[HttpPost]
//[Route("detailquery")]
public virtual async Task<PagedResultDto<TEntityDetailDto>> DetailQueryAsync(TRequestDetailInput input)
@ -64,6 +72,11 @@ namespace Win.Sfs.SettleAccount.Bases
return new PagedResultDto<TEntityDetailDto>(totalCount, dtos);
}
/// <summary>
/// 导出
/// </summary>
/// <param name="input">明细查询条件</param>
/// <returns></returns>
[HttpPost]
//[Route("export")]
public virtual async Task<string> ExportAsync(TRequestDetailInput input)
@ -99,12 +112,22 @@ namespace Win.Sfs.SettleAccount.Bases
);
return _fileName;
}
/// <summary>
/// 生成发票
/// </summary>
/// <param name="input">主表查询条件</param>
/// <returns></returns>
[HttpPost]
//[Route("generateinvoice")]
public virtual async Task<string> GenerateInvoice(TRequestMainInput input)
{
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 查询主表
/// </summary>
/// <param name="input">主表查询条件</param>
/// <returns></returns>
[HttpPost]
//[Route("mainquery")]
public virtual async Task<PagedResultDto<TEntityDto>> MainQueryAsync(TRequestMainInput input)
@ -118,9 +141,5 @@ namespace Win.Sfs.SettleAccount.Bases
}
}

28
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs

@ -15,14 +15,17 @@ using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Bases
{
public abstract class NOT_SA_SERVICE<TEntityDetail, TEntityDetailDto, TRequestDetailInput, TEntityDetailExportDto> : ApplicationService
public abstract class NOT_SA_SERVICE<TEntityDetail, TEntityDetailDto, TRequestDetailInput, TEntityDetailExportDto> : BASE_SERVICE
where TEntityDetail : SA_NOT_BASE
@ -33,8 +36,9 @@ namespace Win.Sfs.SettleAccount.Bases
{
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService;
protected readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
protected readonly IExcelImportAppService _excelImportService;
protected NOT_SA_SERVICE(
@ -46,7 +50,11 @@ namespace Win.Sfs.SettleAccount.Bases
_excelImportService = excelImportService;
_detailRepository = detailRepository;
}
/// <summary>
/// 查询明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
//[Route("detailquery")]
public virtual async Task<PagedResultDto<TEntityDetailDto>> DetailQueryAsync(TRequestDetailInput input)
@ -58,6 +66,11 @@ namespace Win.Sfs.SettleAccount.Bases
return new PagedResultDto<TEntityDetailDto>(totalCount, dtos);
}
/// <summary>
/// 导出
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
//[Route("export")]
public virtual async Task<string> ExportAsync(TRequestDetailInput input)
@ -93,8 +106,13 @@ namespace Win.Sfs.SettleAccount.Bases
);
return _fileName;
}
/// <summary>
/// 生成可计算单
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input)
public virtual async Task<string> GenerateSettlementOrder(TRequestDetailInput input)
{
return ApplicationConsts.SuccessStr;
}

31
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs

@ -15,14 +15,17 @@ using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Bases
{
public class PD_SERVICE<TEntity, TEntityDto, TEntityDetail, TEntityDetailDto, TRequestMainInput, TRequestDetailInput, TEntityDetailExportDto> : ApplicationService
public class PD_SERVICE<TEntity, TEntityDto, TEntityDetail, TEntityDetailDto, TRequestMainInput, TRequestDetailInput, TEntityDetailExportDto> : BASE_SERVICE
where TEntity : PD_BASE_MAIN
where TEntityDetail : PD_BASE
where TEntityDto : class, IEntityDto<Guid>, new()
@ -36,6 +39,7 @@ namespace Win.Sfs.SettleAccount.Bases
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService;
protected PD_SERVICE(
INormalEfCoreRepository<TEntity, Guid> repository,
IExcelImportAppService excelImportService,
@ -50,6 +54,11 @@ namespace Win.Sfs.SettleAccount.Bases
}
/// <summary>
/// 查询明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
//[Route("detailquery")]
public virtual async Task<PagedResultDto<TEntityDetailDto>> DetailQueryAsync(TRequestDetailInput input)
@ -61,6 +70,11 @@ namespace Win.Sfs.SettleAccount.Bases
return new PagedResultDto<TEntityDetailDto>(totalCount, dtos);
}
/// <summary>
/// 导出
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
//[Route("export")]
public virtual async Task<string> ExportAsync(TRequestDetailInput input)
@ -102,6 +116,11 @@ namespace Win.Sfs.SettleAccount.Bases
{
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 查询主表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
//[Route("mainquery")]
public virtual async Task<PagedResultDto<TEntityDto>> MainQueryAsync(TRequestMainInput input)
@ -111,7 +130,11 @@ namespace Win.Sfs.SettleAccount.Bases
var dtos = ObjectMapper.Map<List<TEntity>, List<TEntityDto>>(entitys);
return new PagedResultDto<TEntityDto>(totalCount, dtos);
}
/// <summary>
/// 退回
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> RejectAsync(TRequestMainInput input)
{
@ -129,9 +152,5 @@ namespace Win.Sfs.SettleAccount.Bases
}
}

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs

@ -14,13 +14,15 @@ using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
/// <summary>
///
/// BBAC业务商务审核
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/bbac_ba_service")]
public class BBAC_BA_SERVICE : BA_SERVICE
{
public BBAC_BA_SERVICE(INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService) : base(repository, wRepository, sRepository, mRepository, excelImportService)
public BBAC_BA_SERVICE(INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService)
: base(repository, wRepository, sRepository, mRepository, excelImportService)
{
}
}

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs

@ -19,7 +19,9 @@ using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
/// <summary>
/// BBAC-JIS可结算单
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class BBAC_CAN_SA_SERVICE : CAN_SA_SERVICE

55
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Authorization;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using System;
@ -8,13 +9,19 @@ using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
/// <summary>
/// BBAC-JIS不可结算单
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class BBAC_NOT_SA_SERVICE : NOT_SA_SERVICE
@ -23,8 +30,52 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
BBAC_NOT_SA_DETAIL_REQ_DTO,
BBAC_NOT_SA_DETAIL_EXP_DTO>
{
public BBAC_NOT_SA_SERVICE(IExcelImportAppService excelImportService, INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> detailRepository) : base(excelImportService, detailRepository)
public BBAC_NOT_SA_SERVICE(
IExcelImportAppService excelImportService,
INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> detailRepository) : base(excelImportService, detailRepository)
{
}
[HttpPost]
public override async Task<string> GenerateSettlementOrder(BBAC_NOT_SA_DETAIL_REQ_DTO input)
{
var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var billNum=OrderNumberGenerator.GenerateOrderNumber("C");
var bbac = new BBAC_CAN_SA(guid: GuidGenerator.Create(),
version: input.Version,
billNum: billNum,
settleBillNum: string.Empty,
state: SettleBillState.,
invGroupNum: billNum
);
List<BBAC_CAN_SA_DETAIL> ls = new List<BBAC_CAN_SA_DETAIL>();
foreach (var entity in entitys) {
new BBAC_CAN_SA_DETAIL(guid:entity.Id
, keyCode: entity.KeyCode
, version: entity.Version
, billNum: billNum
, settleBillNum: entity.SettleBillNum
, lU: entity.LU
, pN: entity.PN
, site: entity.Site
, qty: entity.Qty
, price: entity.Price
, category: entity.Category
, isReturn: entity.IsReturn
, settleDate: entity.SettleDate
, groupNum: entity.GroupNum
, invGroupNum: entity.InvGroupNum
);
}
await _detailRepository.DbContext.BulkInsertAsync(ls);
await _detailRepository.DbContext.BulkDeleteAsync(entitys);
await _detailRepository.DbContext.BulkInsertAsync(new List<BBAC_CAN_SA>() { bbac});
return ApplicationConsts.SuccessStr;
}
}
}

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs

@ -14,6 +14,9 @@ using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
/// <summary>
/// BBAC寄售库库存扣减审批
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/bbac_pd_service")]
public class BBAC_PD_SERVICE : PD_SERVICE<BBAC_PD, BBAC_PD_DTO,

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs

@ -16,6 +16,10 @@ using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
/// <summary>
/// HBPO-JIS可结算单
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class HBPO_CAN_SA_SERVICE : CAN_SA_SERVICE

48
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Authorization;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
@ -11,11 +12,15 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
///<summary>
/// HBPO-JIS不可结算单
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class HBPO_NOT_SA_SERVICE : NOT_SA_SERVICE
@ -26,6 +31,47 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{
public HBPO_NOT_SA_SERVICE(IExcelImportAppService excelImportService, INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> detailRepository) : base(excelImportService, detailRepository)
{
}
public override async Task<string> GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input)
{
var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var billNum = OrderNumberGenerator.GenerateOrderNumber("C");
var hbpo= new HBPO_CAN_SA(guid: GuidGenerator.Create(),
version: input.Version,
billNum: billNum,
settleBillNum: string.Empty,
state: SettleBillState.,
invGroupNum: billNum
);
List<HBPO_CAN_SA_DETAIL> ls = new List<HBPO_CAN_SA_DETAIL>();
foreach (var entity in entitys)
{
new HBPO_CAN_SA_DETAIL(guid: entity.Id
, keyCode: entity.KeyCode
, version: entity.Version
, billNum: billNum
, settleBillNum: entity.SettleBillNum
, lU: entity.LU
, pN: entity.PN
, site: entity.Site
, qty: entity.Qty
, price: entity.Price
, settleDate: entity.SettleDate
, groupNum: entity.GroupNum
, invGroupNum: entity.InvGroupNum
);
}
await _detailRepository.DbContext.BulkInsertAsync(ls);
await _detailRepository.DbContext.BulkDeleteAsync(entitys);
await _detailRepository.DbContext.BulkInsertAsync(new List<HBPO_CAN_SA>() { hbpo});
return ApplicationConsts.SuccessStr;
}
}
}

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs

@ -16,6 +16,10 @@ using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
/// <summary>
/// 通用业务可结算单
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class PUB_CAN_SA_SERVICE : CAN_SA_SERVICE

49
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Authorization;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
@ -11,6 +12,7 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.Shared.RepositoryBase;
@ -27,5 +29,50 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public PUB_NOT_SA_SERVICE(IExcelImportAppService excelImportService, INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> detailRepository) : base(excelImportService, detailRepository)
{
}
public override async Task<string> GenerateSettlementOrder(PUB_NOT_SA_DETAIL_REQ_DTO input)
{
var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var billNum = OrderNumberGenerator.GenerateOrderNumber("C");
var hbpo = new PUB_CAN_SA(guid: GuidGenerator.Create(),
version: input.Version,
billNum: billNum,
settleBillNum: string.Empty,
state: SettleBillState.,
invGroupNum: billNum,
businessType:entitys.FirstOrDefault().BusinessType
);
List<PUB_CAN_SA_DETAIL> ls = new List<PUB_CAN_SA_DETAIL>();
foreach (var entity in entitys)
{
new PUB_CAN_SA_DETAIL(
guid: entity.Id
, keyCode: entity.KeyCode
, version: entity.Version
, billNum: billNum
, settleBillNum: entity.SettleBillNum
, lU: entity.LU
, pN: entity.PN
, site: entity.Site
, qty: entity.Qty
, price: entity.Price
,businessType:entity.BusinessType
, settleDate: entity.SettleDate
, groupNum: entity.GroupNum
, invGroupNum: entity.InvGroupNum
);
}
await _detailRepository.DbContext.BulkInsertAsync(ls);
await _detailRepository.DbContext.BulkDeleteAsync(entitys);
await _detailRepository.DbContext.BulkInsertAsync(new List<PUB_CAN_SA>() { hbpo });
return ApplicationConsts.SuccessStr;
}
}
}

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs

@ -300,8 +300,6 @@ namespace SettleAccount.Bases
public bool IsPriceList { set; get; }
public BASE_CONF(bool isRelationShip, bool isMaterial, bool isBom)
{
IsRelationShip = isRelationShip;

13
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/CAN_SA_MNG.cs

@ -1,5 +1,6 @@
using EFCore.BulkExtensions;
using Hangfire.Annotations;
using Microsoft.EntityFrameworkCore;
using SettleAccount.Bases;
using System;
using System.Collections.Generic;
@ -114,10 +115,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return await SetNewState(p_entiy.BillNum);
}
public virtual async Task<bool> SetNewState(string billNUm)
public virtual async Task<bool> SetNewState(string billNum)
{
var ls = _repository.Where(p => p.InvGroupNum == billNUm).ToList();
var ls = _repository.Where(p => p.InvGroupNum == billNum).ToList();
foreach (var l in ls)
{
l.State = SettleBillState.;
@ -127,6 +128,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return true;
}
public virtual async Task<List<TEntityDetail>> GetAllList(string billNum)
{
return await _detailRepository.Where(p=>p.InvGroupNum==billNum).ToListAsync();
}
}

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs

@ -31,8 +31,9 @@ public class PUB_CAN_SA : SA_CAN_BASE_MAIN
//[Display(Name = "明细记录行数")]
//public string InvGroupNum { get; set; } = null!;
public PUB_CAN_SA(int version, string settleBillNum, string billNum, SettleBillState state, EnumBusinessType businessType, string invGroupNum)
public PUB_CAN_SA(Guid guid, int version, string settleBillNum, string billNum, SettleBillState state, EnumBusinessType businessType, string invGroupNum)
{
Id = guid;
Version = version;
SettleBillNum = settleBillNum;
BillNum = billNum;
@ -117,8 +118,9 @@ public class PUB_CAN_SA_DETAIL : SA_CAN_BASE
//[Display(Name = "结算分组")]
//public string GroupNum { get; set; } = null!;
public PUB_CAN_SA_DETAIL(string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType, string groupNum)
public PUB_CAN_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType, string groupNum)
{
Id = guid;
KeyCode = keyCode;
Version = version;
BillNum = billNum;

55
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs

@ -82,14 +82,28 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
public string ClientCode { get; set; }
/// <summary>
/// 业务类别
/// 合同签订时间
/// </summary>
[Display(Name = "业务类别")]
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "合同签订时间")]
public DateTime Date { get; set; }
/// <summary>
/// 合同号
/// </summary>
[Display(Name = "合同号")]
public string ContractNo { get; set; }
/// <summary>
/// 业务类别
/// </summary>
[Display(Name = "业务类别")]
public EnumBusinessType BusinessType { get; set; }
/// <summary>
///版本
/// </summary>
@ -166,12 +180,34 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
[Display(Name = "价格")]
public Decimal Price { set; get; }
/// <summary>
/// 开始时间
/// </summary>
[Display(Name = "开始时间")]
public DateTime BeginDate { set; get; }
/// <summary>
/// 结束时间
/// </summary>
[Display(Name = "结算时间")]
public DateTime EndDate { set; get; }
/// <summary>
/// 客户编码
/// </summary>
[Display(Name = "客户编码")]
public string ClientCode { get; set; }
/// <summary>
/// 合同签订时间
/// </summary>
[Display(Name = "合同签订时间")]
public DateTime Date { get; set; }
/// <summary>
/// 合同号
/// </summary>
[Display(Name = "合同号")]
public string ContractNo { get; set; }
@ -187,19 +223,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
[Display(Name = "版本")]
public string Version { set; get; }
/// <summary>
/// 开始时间
/// </summary>
[Display(Name = "开始时间")]
public DateTime BeginDate { set; get; }
/// <summary>
/// 结束时间
/// </summary>
[Display(Name = "结算时间")]
public DateTime EndDate { set; get; }
/// <summary>
/// 物料编号
/// </summary>

4035
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719004135_20230719-1.Designer.cs

File diff suppressed because it is too large

56
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719004135_20230719-1.cs

@ -0,0 +1,56 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202307191 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ContractNo",
table: "Set_PriceListBJ",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "Date",
table: "Set_PriceListBJ",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<string>(
name: "ContractNo",
table: "Set_PriceList",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "Date",
table: "Set_PriceList",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ContractNo",
table: "Set_PriceListBJ");
migrationBuilder.DropColumn(
name: "Date",
table: "Set_PriceListBJ");
migrationBuilder.DropColumn(
name: "ContractNo",
table: "Set_PriceList");
migrationBuilder.DropColumn(
name: "Date",
table: "Set_PriceList");
}
}
}

12
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -3617,6 +3617,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("ContractNo")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
@ -3629,6 +3632,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime>("Date")
.HasColumnType("datetime2");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
@ -3709,6 +3715,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("ContractNo")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
@ -3721,6 +3730,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime>("Date")
.HasColumnType("datetime2");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");

Loading…
Cancel
Save