Browse Source

更新提交

master
学 赵 1 year ago
parent
commit
3a21ada508
  1. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs
  2. 17
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs
  3. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs
  4. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs
  5. 36
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  6. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs
  7. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs
  8. 44
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs
  9. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  10. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  11. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  12. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  13. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  14. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs
  15. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  16. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  17. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  18. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
  19. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs
  20. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs
  21. 53
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  22. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs
  23. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs

12
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs

@ -103,7 +103,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public string ContractDocID { set; get; }
/// <summary>
/// 客户零件号
/// </summary>
public string PartCode { get; set; }
@ -156,6 +161,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal Qty { get; set; }
[ExporterHeader(DisplayName = "结算分组号")]
public string GroupNum { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[ExporterHeader(DisplayName = "客户零件号")]
public string PartCode { get; set; }
}
//public class BBAC_CAN_SA_EXP_DTO

17
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs

@ -1,4 +1,4 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@ -60,6 +60,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary>
public string GroupNum { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
public string PartCode { get; set; }
}
public class BBAC_NOT_SA_DETAIL_EXP_DTO
{
@ -110,7 +118,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal Qty { get; set; }
[ExporterHeader(DisplayName = "结算分组号")]
public string GroupNum { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[ExporterHeader(DisplayName = "何苦零件号")]
public string PartCode { get; set; }
}
public class BBAC_NOT_SA_DETAIL_REQ_DTO : RequestInputBase
{

15
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs

@ -94,7 +94,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary>
public string GroupNum { get; set; }
public decimal Amt { get; set; }
public decimal Amt { get; set; }
public string PartCode { get; set; }
}
public class HBPO_CAN_SA_DETAIL_EXP_DTO
{
@ -129,13 +132,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public DateTime SettleDate { get; set; }
[ExporterHeader(DisplayName = "发票分组号")]
public string InvGroupNum { get; set; }
[ExporterHeader(DisplayName = "LU")]
[ExporterHeader(DisplayName = "零件号")]
public string LU { get; set; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { get; set; }
[ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; }
public string KeyCode { get; set; }
@ -143,7 +145,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal Qty { get; set; }
[ExporterHeader(DisplayName = "结算分组号")]
public string GroupNum { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[ExporterHeader(DisplayName = "客户零件号")]
public string PartCode { get; set; }
}
public class HBPO_CAN_SA_REQ_DTO : RequestInputBase

19
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs

@ -1,4 +1,4 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@ -63,6 +63,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// 结算分组号
/// </summary>
public string GroupNum { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
public string PartCode { get; set; }
}
public class HBPO_NOT_SA_DETAIL_EXP_DTO
@ -98,7 +102,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public DateTime SettleDate { get; set; }
[ExporterHeader(DisplayName = "发票分组号")]
public string InvGroupNum { get; set; }
[ExporterHeader(DisplayName = "LU")]
[ExporterHeader(DisplayName = "零件号(LU)")]
public string LU { get; set; }
[ExporterHeader(DisplayName = "物料描述")]
@ -111,7 +115,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal Qty { get; set; }
[ExporterHeader(DisplayName = "结算分组号")]
public string GroupNum { get; set; }
[ExporterHeader(DisplayName = "客户零件号")]
public string PartCode { get; set; }
}
public class HBPO_NOT_SA_DETAIL_REQ_DTO : RequestInputBase
{
@ -147,7 +155,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "结算分组号")]
public string GroupNum { get; set; }
public string PartCode { get; set; }
}

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

@ -18,16 +18,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
[Display(Name = "期间")]
public int Version { set; get; }
/// <summary>
///实际纸质发票号
/// </summary>
[Display(Name = "实际纸质发票号")]
[Display(Name = "金税发票号")]
public string RealnvBillNum { get; set; }
/// <summary>
///系统生成发票号
/// </summary>
[Display(Name = "系统生成发票号")]
[Display(Name = "系统发票号")]
public string InvbillNum { get; set; }
/// <summary>
///未税金额
@ -40,18 +39,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "税后金额")]
public decimal TaxAmt { get; set; }
[Display(Name = "金税发票税后金额")]
[Display(Name = "金税发票金额")]
public decimal RealAmt { get; set; }
/// <summary>
///发票分组号
/// </summary>
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
///开票Excel文件
/// </summary>
[Display(Name = "开票Excel文件")]
public string FileName { get; set; }
/// <summary>
///业务类别
/// </summary>
@ -78,12 +73,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// <summary>
///实际纸质发票号
/// </summary>
[ExporterHeader(DisplayName = "实际纸质发票号")]
[ExporterHeader(DisplayName = "金税发票号")]
public string RealnvBillNum { get; set; }
/// <summary>
///系统生成发票号
/// </summary>
[ExporterHeader(DisplayName = "系统生成发票号")]
[ExporterHeader(DisplayName = "系统发票号")]
public string InvbillNum { get; set; }
/// <summary>
///未税金额
@ -100,6 +95,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary>
[ExporterHeader(DisplayName = "税后金额")]
public decimal TaxAmt { get; set; }
/// <summary>
///业务类别
/// </summary>
[ExporterHeader(DisplayName = "业务类别")]
public EnumBusinessType BusinessType { get; set; }
[ExporterHeader(DisplayName = "状态")]
public SettleBillState State { get; set; }
[ExporterHeader(DisplayName = "发票状态")]
public InvoiceBillState InvoiceState { get; set; }
//[ExporterHeader(DisplayName ="发票税后尾差")]
//public decimal TaxDiff { get; set; }
[Display(Name = "客户代码")]
public string ClientCode { get; set; }
}

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs

@ -23,7 +23,6 @@ public class PUB_ADJ_DETAIL_DTO : EntityDto<Guid>
/// </summary>
[Display(Name = "发票号")]
public string InvBillNum { get; set; }
/// <summary>
/// 下线日期
/// </summary>
@ -63,6 +62,8 @@ public class PUB_ADJ_DETAIL_EXP_DTO
public decimal Qty { get; set; }
[Display(Name = "结算分组号")]
public string GroupNum { get; set; }
public string PartCode { get; set; }
}

15
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs

@ -92,7 +92,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public DateTime SettleDate { get; set; }
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
[Display(Name = "发票分组号")]
[Display(Name = "零件号")]
public string LU { get; set; }
[Display(Name = "")]
public string PN { get; set; }
@ -105,8 +105,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "金额")]
public decimal Amt { get; set; }
[Display(Name = "物料描述")]
public string MaterialDesc { set; get; }
[Display(Name = "客户零件号")]
public string PartCode { get; set; }
}
@ -149,6 +151,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal Qty { get; set; }
[ExporterHeader(DisplayName = "结算分组号")]
public string GroupNum { get; set; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName= "客户零件号")]
public string PartCode { get; set; }
}

44
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs

@ -1,4 +1,4 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@ -50,24 +50,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "结算分组号")]
public string GroupNum { get; set; }
/// <summary>
///扩展1
/// </summary>
[Display(Name = "扩展1")]
public string Extend1 { get; set; }
/// <summary>
///扩展2
/// </summary>
[Display(Name = "扩展2")]
public string Extend2 { get; set; }
/// <summary>
///扩展3
/// </summary>
[Display(Name = "扩展3")]
public string Extend3 { get; set; }
/// <summary>
///业务分类
/// </summary>
}
@ -112,23 +95,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal Qty { get; set; }
[Display(Name = "结算分组号")]
public string GroupNum { get; set; }
/// <summary>
///扩展1
/// </summary>
[ExporterHeader(DisplayName = "扩展1")]
public string Extend1 { get; set; }
/// <summary>
///扩展2
/// </summary>
[ExporterHeader(DisplayName = "扩展2")]
public string Extend2 { get; set; }
/// <summary>
///扩展3
/// </summary>
[ExporterHeader(DisplayName = "扩展3")]
public string Extend3 { get; set; }
[Display(Name = "物料描述")]
public string MaterialDesc { get; set; }
[Display(Name = "客户零件号")]
public string PartCode { get; set; }
}

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

@ -65,7 +65,6 @@ namespace Win.Sfs.SettleAccount.Bases
protected BA_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,

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

@ -83,6 +83,10 @@ namespace Win.Sfs.SettleAccount.Bases
var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters);
var dtos = ObjectMapper.Map<List<TEntityDetail>, List<TEntityDetailDto>>(entitys);
return new PagedResultDto<TEntityDetailDto>(totalCount, dtos);
}
/// <summary>

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

@ -33,13 +33,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
[Route("api/settleaccount/[controller]/[action]")]
public class BBAC_BA_SERVICE : BA_SERVICE
{
private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
public BBAC_BA_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
@ -53,7 +53,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PriceList, Guid> priceRepository
) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service)
) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service)
{
_priceRepository = priceRepository;
}
@ -109,7 +109,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
contactid: itm.Extend1,//生产号
invbillnum:string.Empty,
partcode:itm.PartCode
));
@ -128,8 +127,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s
join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
join p in priceList on d.PartCode equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号
select new TEMP_CAN_SA_DETAIL
{
SettleBillNum = d.SettleBillNum,
@ -147,7 +146,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = d.ContractDocID,
BeginDate = p.BeginTime,
EndDate = p.EndTime
EndDate = p.EndTime,
PartCode= d.PartCode
};
var dtos = q.ToList();
if (dtos != null && dtos.Count > 0)

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

@ -120,7 +120,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = d.ContractDocID,
BeginDate = p.BeginTime,
EndDate = p.EndTime
EndDate = p.EndTime,
PartCode = d.PartCode
};
var dtos = q.ToList();
@ -143,7 +144,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
InvGroupNum = p.InvGroupNum,
SettleDate = p.SettleDate,
GroupNum = p.GroupNum,
ContractDocID = string.Empty
ContractDocID = string.Empty,
PartCode=p.PartCode
}).ToList();//不能结算
await FirstInvoice(entitys,new List<PUB_ADJ_DETAIL>(),dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType);
}

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs

@ -38,7 +38,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PriceList, Guid> priceRepository
)
: base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service)
: base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service)
{
_priceRepository= priceRepository;
}
@ -92,7 +92,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
qty: itm.Qty,
price: itm.Price,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
@ -113,7 +112,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
// var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in entitys
join p in priceList on d.LU equals p.LU
join p in priceList on d.PartCode equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL
{
@ -132,7 +131,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "n",
BeginDate = p.BeginTime,
EndDate = p.EndTime
EndDate = p.EndTime,
PartCode=d.PartCode
};
var dtos = q.ToList();
if (dtos != null && dtos.Count > 0)

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

@ -1,3 +1,4 @@
using CodeArts;
using DocumentFormat.OpenXml.Bibliography;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization;
@ -112,7 +113,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID="no",
BeginDate = p.BeginTime,
EndDate = p.EndTime
EndDate = p.EndTime,
PartCode=d.PartCode
};
var dtos = q.ToList();
if (dtos != null && dtos.Count > 0)
@ -134,7 +137,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
InvGroupNum = p.InvGroupNum,
SettleDate = p.SettleDate,
GroupNum = p.GroupNum,
ContractDocID = string.Empty
ContractDocID = string.Empty,
PartCode=p.PartCode
}).ToList();//不能结算
var falg= await FirstInvoice(entitys,new List<PUB_ADJ_DETAIL>(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty,main.BusinessType);

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

@ -82,7 +82,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
[HttpPost]
public virtual async Task<string> ApprovalPassed(List<string> p_invs)
{
await _invMng.SetForwardState(p_invs, SettleBillState.);
return ApplicationConsts.SuccessStr;
}

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

@ -37,7 +37,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service)
) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service)
{
_priceRepository = priceRepository;
@ -116,7 +116,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
// var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in entitys
join p in priceList on d.LU equals p.LU
join p in priceList on d.PartCode equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL
{
@ -135,7 +135,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "n",
BeginDate = p.BeginTime,
EndDate = p.EndTime
EndDate = p.EndTime,
PartCode= d.PartCode
};
var dtos = q.ToList();
if (dtos != null && dtos.Count > 0)

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

@ -112,7 +112,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "no",
BeginDate = p.BeginTime,
EndDate = p.EndTime
EndDate = p.EndTime,
PartCode=d.PartCode//客户零件号
};
var dtos = q.ToList();
if (dtos != null && dtos.Count > 0)

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

@ -431,7 +431,7 @@ namespace SettleAccount.Bases
public string InvbillNum { get; set; }
[Display(Name = "厂内零件号")]
public string PartCode { get; set; }
//public SA_CAN_BASE(int version, decimal price, string billNum, DateTime settleDate, string invGroupNum, string lU, string pN, string keyCode, decimal qty, string groupNum)

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs

@ -248,9 +248,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// </summary>
/// <param name="billNum"></param>
/// <returns></returns>
public virtual async Task<List<BBAC_CAN_SA_DETAIL>> GetContainsAsync(string p_canSettleBillNum, List<string> p_list)
public virtual async Task<List<BBAC_CAN_SA_DETAIL>> GetContainsAsync(string p_invbillnum, List<string> p_list)
{
return await _detailRepository.Where(p =>p.InvGroupNum==p_canSettleBillNum && p_list.Contains(p.GroupNum)).ToListAsync();
return await _detailRepository.Where(p =>p.InvbillNum== p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync();
}

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs

@ -258,9 +258,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// </summary>
/// <param name="billNum"></param>
/// <returns></returns>
public virtual async Task<List<HBPO_CAN_SA_DETAIL>> GetContainsAsync(string p_canSettleBillNum, List<string> p_list)
public virtual async Task<List<HBPO_CAN_SA_DETAIL>> GetContainsAsync(string p_invbillnum, List<string> p_list)
{
return await _detailRepository.Where(p => p.InvGroupNum == p_canSettleBillNum && p_list.Contains(p.GroupNum)).ToListAsync();
return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync();
}

53
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -959,8 +959,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
List<string> _invls = new List<string>();
var groups1 = dtos.GroupBy(p => new { p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV
var groups1 = dtos.GroupBy(p => new {p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV
{
PartCode=p.Key.PartCode,
LU = p.Key.LU,
Amt = p.Sum(itm => itm.Amt),
Qty = p.Sum(itm => itm.Qty),
@ -969,8 +970,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
BeginDate = p.Key.BeginDate,
EndDate = p.Key.EndDate
}).ToList();//汇总记录不出现重复值
var groups = dtos.GroupBy(p => new { p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV
var groups = dtos.GroupBy(p => new {p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV
{
PartCode = p.Key.PartCode,
LU = p.Key.LU,
Amt = p.Sum(itm => itm.Amt),
Qty = p.Sum(itm => itm.Qty),
@ -983,6 +985,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
foreach (var group in groups)
{
int i = groups1.Count(p => p.LU == group.LU
&& p.PartCode==group.PartCode
&& p.BeginDate == group.BeginDate
&& p.EndDate == group.EndDate
&& p.ContractDocID == group.ContractDocID
@ -996,6 +999,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
foreach (var group1 in groups1)
{
if (group.LU == group1.LU
&& group.PartCode == group1.PartCode
&& group.BeginDate == group1.BeginDate
&& group.EndDate == group1.EndDate
&& group1.ContractDocID == group.ContractDocID
@ -1020,12 +1024,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invoiceMap.Add(invoiceBillNum, tempList);
var query = from itm in groups1 //更新分组
join itm1 in tempList
on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID }
equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID } into temp
on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID ,itm.PartCode}
equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID,itm1.PartCode } into temp
from tm in temp
where tm == null
select new TMEP_INV
{
LU = itm.LU,
Amt = itm.Amt,
Qty = itm.Qty,
@ -1050,11 +1055,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var key = group.Key;//发票票号
var ls = group.Value;//发票明细
//反向查找结算数据
var query = from itm in dtos
join itm1 in ls
on new { itm.LU, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate }
join itm2 in p_list on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate }
on new { itm.LU,itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU,itm1.PartCode, itm1.BeginDate, itm1.EndDate }
join itm2 in p_list on new { itm.PartCode, itm.SettleDate } equals new { itm2.PartCode, itm2.SettleDate }
select itm2;
foreach (var itm in query)
{
@ -1063,10 +1068,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
}
if (!string.IsNullOrEmpty(p_parentInvBillNum))
{
//反向查找调整数据
var query1 = from itm in dtos
join itm1 in ls
on new { itm.LU, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate }
join itm2 in p_ajdlist on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate }
on new { itm.LU,itm.PartCode ,itm.BeginDate, itm.EndDate } equals new { itm1.LU,itm1.PartCode, itm1.BeginDate, itm1.EndDate }
join itm2 in p_ajdlist on new { itm.PartCode, itm.SettleDate } equals new { itm2.PartCode, itm2.SettleDate }
select itm2;
foreach (var itm in query1)
@ -1183,8 +1189,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
public async Task<List<string>> MakeInvoice<TDetail>(List<TDetail> details,List<PUB_ADJ_DETAIL> p_adjlist, List<TEMP_CAN_SA_DETAIL> dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType, bool p_first) where TDetail : SA_CAN_BASE
{
List<string> _invls = new List<string>();
var groups1 = dtos.GroupBy(p => new { p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV
var groups1 = dtos.GroupBy(p => new { p.PartCode,p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV
{
PartCode=p.Key.PartCode,
LU = p.Key.LU,
Amt = p.Sum(itm => itm.Amt),
Qty = p.Sum(itm => itm.Qty),
@ -1193,8 +1200,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
BeginDate = p.Key.BeginDate,
EndDate = p.Key.EndDate
}).ToList();//汇总记录不出现重复值
var groups = dtos.GroupBy(p => new { p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV
var groups = dtos.GroupBy(p => new {p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV
{
PartCode=p.Key.PartCode,
LU = p.Key.LU,
Amt = p.Sum(itm => itm.Amt),
Qty = p.Sum(itm => itm.Qty),
@ -1207,6 +1215,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
foreach (var group in groups)
{
int i = groups1.Count(p => p.LU == group.LU
&& p.PartCode==group.PartCode
&& p.BeginDate == group.BeginDate
&& p.EndDate == group.EndDate
&& p.ContractDocID == group.ContractDocID
@ -1231,6 +1240,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
&& group.BeginDate == group1.BeginDate
&& group.EndDate == group1.EndDate
&& group1.ContractDocID == group.ContractDocID
&& group1.PartCode== group1.PartCode
)
{
tempList.Add(group1);
@ -1249,15 +1259,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
sum += group1.Amt;
tempList.Add(group1);
}
invoiceMap.Add(invoiceBillNum, tempList);
invoiceMap.Add(invoiceBillNum, tempList);//每张发票的明细记录
var query = from itm in groups1
join itm1 in tempList
on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID }
equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID } into temp
on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID ,itm.PartCode}
equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID,itm1.PartCode } into temp
from tm in temp
where tm == null
select new TMEP_INV
{
PartCode= itm.PartCode,
LU = itm.LU,
Amt = itm.Amt,
Qty = itm.Qty,
@ -1284,8 +1295,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
//更新结算记录更新
var query = from itm in dtos
join itm1 in ls
on new { itm.LU, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate }
join itm2 in details on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate }
on new { LU=itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate }
join itm2 in details on new { itm.LU,itm.PartCode, itm.SettleDate } equals new { itm2.LU,itm2.PartCode,itm2.SettleDate }
select itm2;
foreach (var itm in query)
{
@ -1296,7 +1307,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
var query1 = from itm in dtos
join itm1 in ls
on new { itm.LU, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate }
on new {LU= itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate }
join itm2 in p_adjlist on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate }
select itm2;
@ -1477,6 +1488,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
var key = itm.Key;//发票票号
var ls = itm.Value;//结算分组号列表
//反向查找结算数据
var invdetails = p_list.Where(p => ls.Contains(p.GroupNum)).ToList();
foreach (var detail in invdetails)
{
@ -1485,6 +1497,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
}
if (!string.IsNullOrEmpty(p_parentInvBillNum))
{
//反向查找调整数据
var adjdetails = p_adjlist.Where(p => ls.Contains(p.GroupNum)).ToList();
foreach (var detail in adjdetails)
{
@ -1493,11 +1506,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
}
}
var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID })
var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID })
.Select(itm => new
{
InvGroupNum = itm.Key.InvGroupNum,
LU = itm.Key.LU,
LU = itm.Key.PartCode,
ContactDocID = itm.Key.ContractDocID,
Price = itm.Key.Price,
Amt = Math.Round(itm.Sum(k => k.Qty) * itm.Key.Price, 2),
@ -1537,6 +1551,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invbillNum: key,
invGroupNum: p_InvGroupNum,
lU: detail.LU,
qty: detail.Qty,
bussiessType: businessType,
amt: detail.Amt,

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs

@ -249,9 +249,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// </summary>
/// <param name="billNum"></param>
/// <returns></returns>
public virtual async Task<List<PUB_CAN_SA_DETAIL>> GetContainsAsync(string p_canSettleBillNum, List<string> p_list)
public virtual async Task<List<PUB_CAN_SA_DETAIL>> GetContainsAsync(string p_invbillnum, List<string> p_list)
{
return await _detailRepository.Where(p => p.InvGroupNum == p_canSettleBillNum && p_list.Contains(p.GroupNum)).ToListAsync();
return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync();
}

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs

@ -9,6 +9,7 @@ using SettleAccount.Bases;
namespace Win.Sfs.SettleAccount.Entities.BQ.Temp;
public class TMEP_INV
{
public string PartCode { set; get; }
public string LU { set; get; }
/// <summary>
/// 合同号
@ -100,6 +101,11 @@ public class TEMP_CAN_SA_DETAIL
/// </summary>
public DateTime EndDate { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
public string PartCode { get; set; }
}
public class TEMP_NOT_SA_DETAIL : SA_NOT_BASE

Loading…
Cancel
Save