Browse Source

更新提交

master
学 赵 1 year ago
parent
commit
3a21ada508
  1. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs
  2. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs
  3. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs
  4. 15
      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. 40
      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

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

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

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

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

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

15
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;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -63,6 +63,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// 结算分组号 /// 结算分组号
/// </summary> /// </summary>
public string GroupNum { get; set; } public string GroupNum { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
public string PartCode { get; set; }
} }
public class HBPO_NOT_SA_DETAIL_EXP_DTO public class HBPO_NOT_SA_DETAIL_EXP_DTO
@ -98,7 +102,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public DateTime SettleDate { get; set; } public DateTime SettleDate { get; set; }
[ExporterHeader(DisplayName = "发票分组号")] [ExporterHeader(DisplayName = "发票分组号")]
public string InvGroupNum { get; set; } public string InvGroupNum { get; set; }
[ExporterHeader(DisplayName = "LU")] [ExporterHeader(DisplayName = "零件号(LU)")]
public string LU { get; set; } public string LU { get; set; }
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "物料描述")]
@ -112,6 +116,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ExporterHeader(DisplayName = "结算分组号")] [ExporterHeader(DisplayName = "结算分组号")]
public string GroupNum { get; set; } public string GroupNum { get; set; }
[ExporterHeader(DisplayName = "客户零件号")]
public string PartCode { get; set; }
} }
public class HBPO_NOT_SA_DETAIL_REQ_DTO : RequestInputBase public class HBPO_NOT_SA_DETAIL_REQ_DTO : RequestInputBase
{ {
@ -148,6 +156,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "结算分组号")] [Display(Name = "结算分组号")]
public string GroupNum { get; set; } 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 = "期间")] [Display(Name = "期间")]
public int Version { set; get; } public int Version { set; get; }
/// <summary> /// <summary>
///实际纸质发票号 ///实际纸质发票号
/// </summary> /// </summary>
[Display(Name = "实际纸质发票号")] [Display(Name = "金税发票号")]
public string RealnvBillNum { get; set; } public string RealnvBillNum { get; set; }
/// <summary> /// <summary>
///系统生成发票号 ///系统生成发票号
/// </summary> /// </summary>
[Display(Name = "系统生成发票号")] [Display(Name = "系统发票号")]
public string InvbillNum { get; set; } public string InvbillNum { get; set; }
/// <summary> /// <summary>
///未税金额 ///未税金额
@ -40,18 +39,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "税后金额")] [Display(Name = "税后金额")]
public decimal TaxAmt { get; set; } public decimal TaxAmt { get; set; }
[Display(Name = "金税发票税后金额")] [Display(Name = "金税发票金额")]
public decimal RealAmt { get; set; } public decimal RealAmt { get; set; }
/// <summary> /// <summary>
///发票分组号 ///发票分组号
/// </summary> /// </summary>
[Display(Name = "发票分组号")] [Display(Name = "发票分组号")]
public string InvGroupNum { get; set; } public string InvGroupNum { get; set; }
/// <summary>
///开票Excel文件
/// </summary>
[Display(Name = "开票Excel文件")]
public string FileName { get; set; }
/// <summary> /// <summary>
///业务类别 ///业务类别
/// </summary> /// </summary>
@ -78,12 +73,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// <summary> /// <summary>
///实际纸质发票号 ///实际纸质发票号
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "实际纸质发票号")] [ExporterHeader(DisplayName = "金税发票号")]
public string RealnvBillNum { get; set; } public string RealnvBillNum { get; set; }
/// <summary> /// <summary>
///系统生成发票号 ///系统生成发票号
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "系统生成发票号")] [ExporterHeader(DisplayName = "系统发票号")]
public string InvbillNum { get; set; } public string InvbillNum { get; set; }
/// <summary> /// <summary>
///未税金额 ///未税金额
@ -100,6 +95,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "税后金额")] [ExporterHeader(DisplayName = "税后金额")]
public decimal TaxAmt { get; set; } 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> /// </summary>
[Display(Name = "发票号")] [Display(Name = "发票号")]
public string InvBillNum { get; set; } public string InvBillNum { get; set; }
/// <summary> /// <summary>
/// 下线日期 /// 下线日期
/// </summary> /// </summary>
@ -63,6 +62,8 @@ public class PUB_ADJ_DETAIL_EXP_DTO
public decimal Qty { get; set; } public decimal Qty { get; set; }
[Display(Name = "结算分组号")] [Display(Name = "结算分组号")]
public string GroupNum { get; set; } 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; } public DateTime SettleDate { get; set; }
[Display(Name = "发票分组号")] [Display(Name = "发票分组号")]
public string InvGroupNum { get; set; } public string InvGroupNum { get; set; }
[Display(Name = "发票分组号")] [Display(Name = "零件号")]
public string LU { get; set; } public string LU { get; set; }
[Display(Name = "")] [Display(Name = "")]
public string PN { get; set; } public string PN { get; set; }
@ -105,8 +105,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "金额")] [Display(Name = "金额")]
public decimal Amt { get; set; } public decimal Amt { get; set; }
[Display(Name = "物料描述")]
public string MaterialDesc { set; get; } 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; } public decimal Qty { get; set; }
[ExporterHeader(DisplayName = "结算分组号")] [ExporterHeader(DisplayName = "结算分组号")]
public string GroupNum { get; set; } public string GroupNum { get; set; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName= "客户零件号")]
public string PartCode { get; set; }
} }

40
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;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -50,24 +50,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "结算分组号")] [Display(Name = "结算分组号")]
public string GroupNum { get; set; } 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,22 +95,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal Qty { get; set; } public decimal Qty { get; set; }
[Display(Name = "结算分组号")] [Display(Name = "结算分组号")]
public string GroupNum { get; set; } public string GroupNum { get; set; }
/// <summary> [Display(Name = "物料描述")]
///扩展1 public string MaterialDesc { get; set; }
/// </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 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, protected BA_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager, ICommonManager commonManager,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, 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 entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters); var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters);
var dtos = ObjectMapper.Map<List<TEntityDetail>, List<TEntityDetailDto>>(entitys); var dtos = ObjectMapper.Map<List<TEntityDetail>, List<TEntityDetailDto>>(entitys);
return new PagedResultDto<TEntityDetailDto>(totalCount, dtos); return new PagedResultDto<TEntityDetailDto>(totalCount, dtos);
} }
/// <summary> /// <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]")] [Route("api/settleaccount/[controller]/[action]")]
public class BBAC_BA_SERVICE : BA_SERVICE public class BBAC_BA_SERVICE : BA_SERVICE
{ {
private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository; private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
public BBAC_BA_SERVICE(IExcelImportAppService excelImportService, public BBAC_BA_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager, ICommonManager commonManager,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
@ -53,7 +53,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PriceList, Guid> priceRepository 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; _priceRepository = priceRepository;
} }
@ -109,7 +109,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum, invGroupNum: itm.InvGroupNum,
contactid: itm.Extend1,//生产号 contactid: itm.Extend1,//生产号
invbillnum:string.Empty, invbillnum:string.Empty,
partcode:itm.PartCode 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 dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s var q = from d in dto1s
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 where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号
select new TEMP_CAN_SA_DETAIL select new TEMP_CAN_SA_DETAIL
{ {
SettleBillNum = d.SettleBillNum, SettleBillNum = d.SettleBillNum,
@ -147,7 +146,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = d.ContractDocID, ContractDocID = d.ContractDocID,
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime EndDate = p.EndTime,
PartCode= d.PartCode
}; };
var dtos = q.ToList(); var dtos = q.ToList();
if (dtos != null && dtos.Count > 0) 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), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = d.ContractDocID, ContractDocID = d.ContractDocID,
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime EndDate = p.EndTime,
PartCode = d.PartCode
}; };
var dtos = q.ToList(); var dtos = q.ToList();
@ -143,7 +144,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
InvGroupNum = p.InvGroupNum, InvGroupNum = p.InvGroupNum,
SettleDate = p.SettleDate, SettleDate = p.SettleDate,
GroupNum = p.GroupNum, GroupNum = p.GroupNum,
ContractDocID = string.Empty ContractDocID = string.Empty,
PartCode=p.PartCode
}).ToList();//不能结算 }).ToList();//不能结算
await FirstInvoice(entitys,new List<PUB_ADJ_DETAIL>(),dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType); 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 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; _priceRepository= priceRepository;
} }
@ -92,7 +92,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
qty: itm.Qty, qty: itm.Qty,
price: itm.Price, price: itm.Price,
businessType: itm.BusinessType, businessType: itm.BusinessType,
settleDate: itm.SettleDate, settleDate: itm.SettleDate,
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum, 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 dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in 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 where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL select new TEMP_CAN_SA_DETAIL
{ {
@ -132,7 +131,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "n", ContractDocID = "n",
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime EndDate = p.EndTime,
PartCode=d.PartCode
}; };
var dtos = q.ToList(); var dtos = q.ToList();
if (dtos != null && dtos.Count > 0) 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 DocumentFormat.OpenXml.Bibliography;
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
@ -112,7 +113,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID="no", ContractDocID="no",
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime EndDate = p.EndTime,
PartCode=d.PartCode
}; };
var dtos = q.ToList(); var dtos = q.ToList();
if (dtos != null && dtos.Count > 0) if (dtos != null && dtos.Count > 0)
@ -134,7 +137,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
InvGroupNum = p.InvGroupNum, InvGroupNum = p.InvGroupNum,
SettleDate = p.SettleDate, SettleDate = p.SettleDate,
GroupNum = p.GroupNum, GroupNum = p.GroupNum,
ContractDocID = string.Empty ContractDocID = string.Empty,
PartCode=p.PartCode
}).ToList();//不能结算 }).ToList();//不能结算
var falg= await FirstInvoice(entitys,new List<PUB_ADJ_DETAIL>(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty,main.BusinessType); 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] [HttpPost]
public virtual async Task<string> ApprovalPassed(List<string> p_invs) public virtual async Task<string> ApprovalPassed(List<string> p_invs)
{ {
await _invMng.SetForwardState(p_invs, SettleBillState.); await _invMng.SetForwardState(p_invs, SettleBillState.);
return ApplicationConsts.SuccessStr; 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; _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 dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in 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 where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL select new TEMP_CAN_SA_DETAIL
{ {
@ -135,7 +135,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "n", ContractDocID = "n",
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime EndDate = p.EndTime,
PartCode= d.PartCode
}; };
var dtos = q.ToList(); var dtos = q.ToList();
if (dtos != null && dtos.Count > 0) 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), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "no", ContractDocID = "no",
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime EndDate = p.EndTime,
PartCode=d.PartCode//客户零件号
}; };
var dtos = q.ToList(); var dtos = q.ToList();
if (dtos != null && dtos.Count > 0) 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; } public string InvbillNum { get; set; }
[Display(Name = "厂内零件号")]
public string PartCode { get; set; } 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) //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> /// </summary>
/// <param name="billNum"></param> /// <param name="billNum"></param>
/// <returns></returns> /// <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> /// </summary>
/// <param name="billNum"></param> /// <param name="billNum"></param>
/// <returns></returns> /// <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>(); 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, LU = p.Key.LU,
Amt = p.Sum(itm => itm.Amt), Amt = p.Sum(itm => itm.Amt),
Qty = p.Sum(itm => itm.Qty), Qty = p.Sum(itm => itm.Qty),
@ -969,8 +970,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
BeginDate = p.Key.BeginDate, BeginDate = p.Key.BeginDate,
EndDate = p.Key.EndDate EndDate = p.Key.EndDate
}).ToList();//汇总记录不出现重复值 }).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, LU = p.Key.LU,
Amt = p.Sum(itm => itm.Amt), Amt = p.Sum(itm => itm.Amt),
Qty = p.Sum(itm => itm.Qty), Qty = p.Sum(itm => itm.Qty),
@ -983,6 +985,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
foreach (var group in groups) foreach (var group in groups)
{ {
int i = groups1.Count(p => p.LU == group.LU int i = groups1.Count(p => p.LU == group.LU
&& p.PartCode==group.PartCode
&& p.BeginDate == group.BeginDate && p.BeginDate == group.BeginDate
&& p.EndDate == group.EndDate && p.EndDate == group.EndDate
&& p.ContractDocID == group.ContractDocID && p.ContractDocID == group.ContractDocID
@ -996,6 +999,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
foreach (var group1 in groups1) foreach (var group1 in groups1)
{ {
if (group.LU == group1.LU if (group.LU == group1.LU
&& group.PartCode == group1.PartCode
&& group.BeginDate == group1.BeginDate && group.BeginDate == group1.BeginDate
&& group.EndDate == group1.EndDate && group.EndDate == group1.EndDate
&& group1.ContractDocID == group.ContractDocID && group1.ContractDocID == group.ContractDocID
@ -1020,12 +1024,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invoiceMap.Add(invoiceBillNum, tempList); invoiceMap.Add(invoiceBillNum, tempList);
var query = from itm in groups1 //更新分组 var query = from itm in groups1 //更新分组
join itm1 in tempList join itm1 in tempList
on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID } on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID ,itm.PartCode}
equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID } into temp equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID,itm1.PartCode } into temp
from tm in temp from tm in temp
where tm == null where tm == null
select new TMEP_INV select new TMEP_INV
{ {
LU = itm.LU, LU = itm.LU,
Amt = itm.Amt, Amt = itm.Amt,
Qty = itm.Qty, Qty = itm.Qty,
@ -1050,11 +1055,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var key = group.Key;//发票票号 var key = group.Key;//发票票号
var ls = group.Value;//发票明细 var ls = group.Value;//发票明细
//反向查找结算数据
var query = from itm in dtos var query = from itm in dtos
join itm1 in ls join itm1 in ls
on new { itm.LU, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } 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.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate } join itm2 in p_list on new { itm.PartCode, itm.SettleDate } equals new { itm2.PartCode, itm2.SettleDate }
select itm2; select itm2;
foreach (var itm in query) foreach (var itm in query)
{ {
@ -1063,10 +1068,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
if (!string.IsNullOrEmpty(p_parentInvBillNum)) if (!string.IsNullOrEmpty(p_parentInvBillNum))
{ {
//反向查找调整数据
var query1 = from itm in dtos var query1 = from itm in dtos
join itm1 in ls join itm1 in ls
on new { itm.LU, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } 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.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate } join itm2 in p_ajdlist on new { itm.PartCode, itm.SettleDate } equals new { itm2.PartCode, itm2.SettleDate }
select itm2; select itm2;
foreach (var itm in query1) 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 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>(); 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, LU = p.Key.LU,
Amt = p.Sum(itm => itm.Amt), Amt = p.Sum(itm => itm.Amt),
Qty = p.Sum(itm => itm.Qty), Qty = p.Sum(itm => itm.Qty),
@ -1193,8 +1200,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
BeginDate = p.Key.BeginDate, BeginDate = p.Key.BeginDate,
EndDate = p.Key.EndDate EndDate = p.Key.EndDate
}).ToList();//汇总记录不出现重复值 }).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, LU = p.Key.LU,
Amt = p.Sum(itm => itm.Amt), Amt = p.Sum(itm => itm.Amt),
Qty = p.Sum(itm => itm.Qty), Qty = p.Sum(itm => itm.Qty),
@ -1207,6 +1215,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
foreach (var group in groups) foreach (var group in groups)
{ {
int i = groups1.Count(p => p.LU == group.LU int i = groups1.Count(p => p.LU == group.LU
&& p.PartCode==group.PartCode
&& p.BeginDate == group.BeginDate && p.BeginDate == group.BeginDate
&& p.EndDate == group.EndDate && p.EndDate == group.EndDate
&& p.ContractDocID == group.ContractDocID && p.ContractDocID == group.ContractDocID
@ -1231,6 +1240,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
&& group.BeginDate == group1.BeginDate && group.BeginDate == group1.BeginDate
&& group.EndDate == group1.EndDate && group.EndDate == group1.EndDate
&& group1.ContractDocID == group.ContractDocID && group1.ContractDocID == group.ContractDocID
&& group1.PartCode== group1.PartCode
) )
{ {
tempList.Add(group1); tempList.Add(group1);
@ -1249,15 +1259,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
sum += group1.Amt; sum += group1.Amt;
tempList.Add(group1); tempList.Add(group1);
} }
invoiceMap.Add(invoiceBillNum, tempList); invoiceMap.Add(invoiceBillNum, tempList);//每张发票的明细记录
var query = from itm in groups1 var query = from itm in groups1
join itm1 in tempList join itm1 in tempList
on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID } on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID ,itm.PartCode}
equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID } into temp equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID,itm1.PartCode } into temp
from tm in temp from tm in temp
where tm == null where tm == null
select new TMEP_INV select new TMEP_INV
{ {
PartCode= itm.PartCode,
LU = itm.LU, LU = itm.LU,
Amt = itm.Amt, Amt = itm.Amt,
Qty = itm.Qty, Qty = itm.Qty,
@ -1284,8 +1295,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
//更新结算记录更新 //更新结算记录更新
var query = from itm in dtos var query = from itm in dtos
join itm1 in ls 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 details on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate } join itm2 in details on new { itm.LU,itm.PartCode, itm.SettleDate } equals new { itm2.LU,itm2.PartCode,itm2.SettleDate }
select itm2; select itm2;
foreach (var itm in query) foreach (var itm in query)
{ {
@ -1296,7 +1307,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
var query1 = from itm in dtos var query1 = from itm in dtos
join itm1 in ls 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 } join itm2 in p_adjlist on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate }
select itm2; select itm2;
@ -1477,6 +1488,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
var key = itm.Key;//发票票号 var key = itm.Key;//发票票号
var ls = itm.Value;//结算分组号列表 var ls = itm.Value;//结算分组号列表
//反向查找结算数据
var invdetails = p_list.Where(p => ls.Contains(p.GroupNum)).ToList(); var invdetails = p_list.Where(p => ls.Contains(p.GroupNum)).ToList();
foreach (var detail in invdetails) foreach (var detail in invdetails)
{ {
@ -1485,6 +1497,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
if (!string.IsNullOrEmpty(p_parentInvBillNum)) if (!string.IsNullOrEmpty(p_parentInvBillNum))
{ {
//反向查找调整数据
var adjdetails = p_adjlist.Where(p => ls.Contains(p.GroupNum)).ToList(); var adjdetails = p_adjlist.Where(p => ls.Contains(p.GroupNum)).ToList();
foreach (var detail in adjdetails) 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 .Select(itm => new
{ {
InvGroupNum = itm.Key.InvGroupNum, InvGroupNum = itm.Key.InvGroupNum,
LU = itm.Key.LU, LU = itm.Key.PartCode,
ContactDocID = itm.Key.ContractDocID, ContactDocID = itm.Key.ContractDocID,
Price = itm.Key.Price, Price = itm.Key.Price,
Amt = Math.Round(itm.Sum(k => k.Qty) * itm.Key.Price, 2), 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, invbillNum: key,
invGroupNum: p_InvGroupNum, invGroupNum: p_InvGroupNum,
lU: detail.LU, lU: detail.LU,
qty: detail.Qty, qty: detail.Qty,
bussiessType: businessType, bussiessType: businessType,
amt: detail.Amt, 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> /// </summary>
/// <param name="billNum"></param> /// <param name="billNum"></param>
/// <returns></returns> /// <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; namespace Win.Sfs.SettleAccount.Entities.BQ.Temp;
public class TMEP_INV public class TMEP_INV
{ {
public string PartCode { set; get; }
public string LU { set; get; } public string LU { set; get; }
/// <summary> /// <summary>
/// 合同号 /// 合同号
@ -100,6 +101,11 @@ public class TEMP_CAN_SA_DETAIL
/// </summary> /// </summary>
public DateTime EndDate { get; set; } public DateTime EndDate { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
public string PartCode { get; set; }
} }
public class TEMP_NOT_SA_DETAIL : SA_NOT_BASE public class TEMP_NOT_SA_DETAIL : SA_NOT_BASE

Loading…
Cancel
Save