wanggang 1 year ago
parent
commit
3bef2d92cc
  1. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  3. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  4. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  5. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs
  6. 155
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  7. 37
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
  8. 0
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/OrderNumberGenerator.cs
  9. 41
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs
  10. 34
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs
  11. 34
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs
  12. 97
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/CAN_SA_MNG.cs
  13. 42
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/NOT_SA_MNG.cs

6
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs

@ -65,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public class INVOICE_GRP_EXPORT_DTO
public class INVOICE_GRP_EXP_DTO
{
@ -133,7 +133,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal TaxAmt { get; set; }
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
[Display(Name = "发票号")]
public string InvbillNum { get; set; }
}

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

@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Bases
IExporter _excel = new ExcelExporter();
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXPORT_DTO>>(entities);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities);
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";

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

@ -115,6 +115,10 @@ namespace Win.Sfs.SettleAccount.Bases
return new PagedResultDto<TEntityDto>(totalCount, dtos);
}

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

@ -88,7 +88,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
IExporter _excel = new ExcelExporter();
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXPORT_DTO>>(entities);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities);
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs

@ -63,6 +63,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
private readonly ISettleAccountBranchEfCoreRepository<Prebatches.Prebatch, Guid> _preBatchRepository;
private readonly ISettleAccountBranchEfCoreRepository<SettleAccount, Guid> _repository;
private readonly ISettleAccountBranchEfCoreRepository<SettleAccountVersion, Guid> _versionRepository;
private readonly ISettleAccountBranchEfCoreRepository<FIS, Guid> _fisRepository;
@ -575,4 +577,4 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
}
}

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

@ -145,10 +145,163 @@ namespace Win.Sfs.SettleAccount
CreateMapPUB_SE_DETAIL();
CreateMapPUB_SA();
CreateMapBBAC_CAN_SA();
CreateMapBBAC_CAN_SA_DETAIL();
CreateMapBBAC_NOT_SA_DETAIL();
CreateMapHBPO_CAN_SA();
CreateMapHBPO_CAN_SA_DETAIL();
CreateMapHBPO_NOT_SA_DETAIL();
CreateMapINVOICE_GRP();
CreateMapINVOICE_MAP_GROUP();
CreateMapINVOICE_NOT_SETTLE();
CreateMapINVOICE_WAIT_DETAIL();
CreateMapPUB_CAN_SA();
CreateMapPUB_CAN_SA_DETAIL();
CreateMapPUB_NOT_SA_DETAIL();
}
#region BQ
/// <summary>
/// BBAC可结算
/// </summary>
private void CreateMapBBAC_CAN_SA()
{
CreateMap<BBAC_CAN_SA, BBAC_CAN_SA_DTO>().ReverseMap();
CreateMap<BBAC_CAN_SA, BBAC_CAN_SA_REQ_DTO>().ReverseMap();
}
private void CreateMapBBAC_CAN_SA_DETAIL()
{
CreateMap<BBAC_CAN_SA_DETAIL, BBAC_CAN_SA_DETAIL_DTO>().ReverseMap();
CreateMap<BBAC_CAN_SA_DETAIL, BBAC_CAN_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<BBAC_CAN_SA_DETAIL, BBAC_CAN_SA_DETAIL_EXP_DTO>().ReverseMap();
}
private void CreateMapBBAC_NOT_SA_DETAIL()
{
CreateMap<BBAC_NOT_SA_DETAIL, BBAC_NOT_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<BBAC_NOT_SA_DETAIL, BBAC_NOT_SA_DETAIL_EXP_DTO>().ReverseMap();
}
private void CreateMapHBPO_CAN_SA()
{
CreateMap<HBPO_CAN_SA, HBPO_CAN_SA_DTO>().ReverseMap();
CreateMap<HBPO_CAN_SA, HBPO_CAN_SA_REQ_DTO>().ReverseMap();
}
private void CreateMapHBPO_CAN_SA_DETAIL()
{
CreateMap<HBPO_CAN_SA_DETAIL, HBPO_CAN_SA_DETAIL_DTO>().ReverseMap();
CreateMap<HBPO_CAN_SA_DETAIL, HBPO_CAN_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<HBPO_CAN_SA_DETAIL, HBPO_CAN_SA_DETAIL_EXP_DTO>().ReverseMap();
}
private void CreateMapHBPO_NOT_SA_DETAIL()
{
CreateMap<HBPO_NOT_SA_DETAIL, HBPO_NOT_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<HBPO_NOT_SA_DETAIL, HBPO_NOT_SA_DETAIL_EXP_DTO>().ReverseMap();
}
private void CreateMapINVOICE_GRP()
{
CreateMap<INVOICE_GRP, INVOICE_GRP_DTO>().ReverseMap();
CreateMap<INVOICE_GRP, INVOICE_GRP_REQ_DTO>().ReverseMap();
CreateMap<INVOICE_GRP, INVOICE_GRP_IMP_DTO>().ReverseMap();
CreateMap<INVOICE_GRP, INVOICE_GRP_EXP_DTO>().ReverseMap();
}
private void CreateMapINVOICE_MAP_GROUP()
{
CreateMap<INVOICE_MAP_GROUP, INVOICE_MAP_GROUP_DTO>().ReverseMap();
CreateMap<INVOICE_MAP_GROUP, INVOICE_MAP_GROUP_EXP_DTO>().ReverseMap();
}
private void CreateMapINVOICE_NOT_SETTLE()
{
CreateMap<INVOICE_NOT_SETTLE, INVOICE_NOT_SETTLE_DTO>().ReverseMap();
CreateMap<INVOICE_NOT_SETTLE, INVOICE_NOT_SETTLE_REQ_DTO>().ReverseMap();
}
private void CreateMapINVOICE_WAIT_DETAIL()
{
CreateMap<INVOICE_WAIT_DETAIL, INVOICE_WAIT_DETAIL_DTO>().ReverseMap();
CreateMap<INVOICE_WAIT_DETAIL, INVOICE_WAIT_DETAIL_REQ_DTO>().ReverseMap();
}
private void CreateMapPUB_CAN_SA()
{
CreateMap<PUB_CAN_SA, PUB_CAN_SA_DTO>().ReverseMap();
CreateMap<PUB_CAN_SA, PUB_CAN_SA_REQ_DTO>().ReverseMap();
}
private void CreateMapPUB_CAN_SA_DETAIL()
{
CreateMap<PUB_CAN_SA_DETAIL, PUB_CAN_SA_DETAIL_DTO>().ReverseMap();
CreateMap<PUB_CAN_SA_DETAIL, PUB_CAN_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<PUB_CAN_SA_DETAIL, PUB_CAN_SA_DETAIL_EXP_DTO>().ReverseMap();
}
private void CreateMapPUB_NOT_SA_DETAIL()
{
CreateMap<PUB_NOT_SA_DETAIL, PUB_NOT_SA_DETAIL_DTO>().ReverseMap();
CreateMap<PUB_NOT_SA_DETAIL, PUB_NOT_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<PUB_NOT_SA_DETAIL, PUB_NOT_SA_DETAIL_EXP_DTO>().ReverseMap();
}

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

@ -1,10 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities.Auditing;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.SettleAccountDomain;
using static System.Runtime.CompilerServices.RuntimeHelpers;
@ -33,7 +36,36 @@ namespace SettleAccount.Bases
public decimal Qty { set; get; }
}
public interface ISA_BASE : ISBASE
public class SA_CAN_BASE_MAIN : FullAuditedAggregateRoot<Guid>
{
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "结算单据")]
public string BillNum { get; set; } = null!;
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; } = null!;
/// <summary>
/// 1、新建 2、已有出库3、已有扣减寄售库
/// </summary>
[Display(Name = "状态")]
public SettleBillState State { get; set; }
/// <summary>
/// 明细记录行数
/// </summary>
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; } = null!;
}
public interface ISA_BASE : ISBASE
{
/// <summary>
/// 期间
@ -238,6 +270,9 @@ namespace SettleAccount.Bases
}
}
public class SA_BASE : FullAuditedAggregateRoot<Guid>, ISA_BASE
{
/// <summary>

0
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs → code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/OrderNumberGenerator.cs

41
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs

@ -6,35 +6,28 @@ using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "BBAC可结算导入")]
public class BBAC_CAN_SA:FullAuditedAggregateRoot<Guid>
public class BBAC_CAN_SA : SA_CAN_BASE_MAIN
{
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "结算单据")]
public string BillNum { get; set; } = null!;
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; } = null!;
/// <summary>
/// 1、新建 2、已有出库3、已有扣减寄售库
/// </summary>
[Display(Name = "状态")]
public SettleBillState State { get; set; }
//[Display(Name = "期间")]
//public int Version { get; set; }
/// <summary>
/// 明细记录行数
/// </summary>
[Display(Name = "明细记录行数")]
public string InvGroupNum { get; set; } = null!;
//[Display(Name = "结算单据")]
//public string BillNum { get; set; } = null!;
//[Display(Name = "关联结算单号")]
//public string SettleBillNum { get; set; } = null!;
/// <summary>
/// 工厂地点
/// </summary>
[Display(Name = "工厂地点")]
public string Site { get; set; } = null!;
///// <summary>
///// 1、新建 2、已有出库3、已有扣减寄售库
///// </summary>
//[Display(Name = "状态")]
//public SettleBillState State { get; set; }
///// <summary>
///// 明细记录行数
///// </summary>
//[Display(Name = "发票分组号")]
//public string InvGroupNum { get; set; } = null!;
public BBAC_CAN_SA()
{

34
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs

@ -6,27 +6,27 @@ using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "HBPO可结算导入")]
public class HBPO_CAN_SA :FullAuditedAggregateRoot<Guid>
public class HBPO_CAN_SA : SA_CAN_BASE_MAIN
{
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; } = null!;
[Display(Name = "结算单据")]
//[Display(Name = "期间")]
//public int Version { get; set; }
//[Display(Name = "关联结算单号")]
//public string SettleBillNum { get; set; } = null!;
//[Display(Name = "结算单据")]
public string BillNum { get; set; } = null!;
//public string BillNum { get; set; } = null!;
/// <summary>
/// 1、新建 2、已有出库3、已有扣减寄售库
/// </summary>
[Display(Name = "状态")]
public SettleBillState State { get; set; }
///// <summary>
///// 1、新建 2、已有出库3、已有扣减寄售库
///// </summary>
//[Display(Name = "状态")]
//public SettleBillState State { get; set; }
/// <summary>
/// 明细记录行数
/// </summary>
[Display(Name = "明细记录行数")]
public string InvGroupNum { get; set; } = null!;
///// <summary>
///// 明细记录行数
///// </summary>
//[Display(Name = "明细记录行数")]
//public string InvGroupNum { get; set; } = null!;
/// <summary>
/// 工厂地点

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

@ -6,30 +6,30 @@ using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "PUB可结算导入")]
public class PUB_CAN_SA :FullAuditedAggregateRoot<Guid>
public class PUB_CAN_SA : SA_CAN_BASE_MAIN
{
[Display(Name = "期间")]
public int Version { get; set; }
//[Display(Name = "期间")]
//public int Version { get; set; }
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; } = null!;
//[Display(Name = "关联结算单号")]
//public string SettleBillNum { get; set; } = null!;
[Display(Name = "结算单据")]
public string BillNum { get; set; } = null!;
//[Display(Name = "结算单据")]
//public string BillNum { get; set; } = null!;
/// <summary>
/// 1、新建 2、已有出库3、已有扣减寄售库
/// </summary>
[Display(Name = "状态")]
public SettleBillState State { get; set; }
/// <summary>
/// 1、JIT 2、买单件 3、备件 3、印度件
/// </summary>
///// <summary>
///// 1、新建 2、已有出库3、已有扣减寄售库
///// </summary>
//[Display(Name = "状态")]
//public SettleBillState State { get; set; }
///// <summary>
///// 1、JIT 2、买单件 3、备件 3、印度件
///// </summary>
[Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "明细记录行数")]
public string InvGroupNum { get; set; } = null!;
//[Display(Name = "明细记录行数")]
//public string InvGroupNum { get; set; } = null!;
public PUB_CAN_SA(int version, string settleBillNum, string billNum, SettleBillState state, EnumBusinessType businessType, string invGroupNum)
{

97
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/CAN_SA_MNG.cs

@ -0,0 +1,97 @@
using Hangfire.Annotations;
using SettleAccount.Bases;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Services;
using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping;
using Win.Sfs.SettleAccount.Bases.DomainServices;
using Win.Sfs.SettleAccount.Boms;
using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.Managers
{
public class CAN_SA_MNG<TEntity,TEntityDetail> : DomainService
where TEntity : SA_CAN_BASE_MAIN
where TEntityDetail : SA_CAN_BASE
{
private readonly INormalEfCoreRepository<TEntity, Guid> _repository;
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
public CAN_SA_MNG
(
INormalEfCoreRepository<TEntity, Guid> repository,
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_repository= repository;
_detailRepository= detailRepository;
}
public virtual async Task<bool> SetState(TEntity p_entiy,SettleBillState state)
{
switch (p_entiy.State)
{
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态");
}
break;
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】");
}
break;
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【未结状态】状态,无法设置成【已开票】");
}
break;
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态");
}
break;
}
await _repository.UpdateAsync(p_entiy);
return true;
}
}
}

42
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/NOT_SA_MNG.cs

@ -0,0 +1,42 @@
using SettleAccount.Bases;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Services;
using Volo.Abp;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.Managers
{
/// <summary>
/// 不能結算管理
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TEntityDetail"></typeparam>
/// <typeparam name="TNOTDetail"></typeparam>
public class NOT_SA_MNG<TEntity,TEntityDetail, TNOTDetail> : DomainService
where TEntity : SA_CAN_BASE_MAIN
where TEntityDetail : SA_CAN_BASE
where TNOTDetail:SA_NOT_BASE
{
private readonly INormalEfCoreRepository<TEntity, Guid> _repository;
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
public NOT_SA_MNG
(
INormalEfCoreRepository<TEntity, Guid> repository,
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_repository = repository;
_detailRepository = detailRepository;
}
public virtual async Task<bool> GenerateSettlementOrder(List<TNOTDetail> p_list)
{
return true;
}
}
}
Loading…
Cancel
Save