Browse Source

Merge branch 'master' of http://dev.ccwin-in.com:3000/BoXu.Zheng/BeiJinSettleAccount

master
wanggang 1 year ago
parent
commit
bee852b24d
  1. 32
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  2. 190
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  3. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  4. 69
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  5. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  6. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs
  7. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

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

@ -325,7 +325,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public class INVOICE_WAIT_DETAIL_BJ_DTO public class INVOICE_WAIT_DETAIL_BJ_DTO
{ {
public int Version { get; set; }
[Display(Name = "金税发票号")] [Display(Name = "金税发票号")]
public string RealInvbillNum { get; set; } public string RealInvbillNum { get; set; }
[Display(Name = "发票日期")] [Display(Name = "发票日期")]
@ -347,16 +347,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public string VendorCode { get; set; } public string VendorCode { get; set; }
[Display(Name = "供应商名称")] [Display(Name = "供应商名称")]
public string VendorName { get; set; } public string VendorName { get; set; }
[Display(Name = "PurchaseOrderNumber")]
public string PurchaseOrderNumber { get; set; } [Display(Name = "交付索引号")]
[Display(Name = "业务分类")]
public string DeliveryIndexNumber { get; set; } public string DeliveryIndexNumber { get; set; }
/// <summary> /// <summary>
///零件号 ///零件号
/// </summary> /// </summary>
[Display(Name = "零件号")] [Display(Name = "零件号")]
public string PartCode { get; set; } public string PartCode { get; set; }
[Display(Name = "PartName")] [Display(Name = "零件名称")]
public string PartName { get; set; } public string PartName { get; set; }
/// <summary> /// <summary>
///发票分组号 ///发票分组号
@ -409,7 +408,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
} }
// DeliveryNumber = inv1.GetProperty("DeliveryNumber", ""),//交货号
// InvoiceNumber = inv1.GetProperty("InvoiceNumber", ""),//发票号
// VendorCode = inv1.GetProperty("VendorCode", ""),//供应商代码
// VendorName = inv1.GetProperty("VendorName", ""),//供应商名称
// PurchaseOrderNumber = inv1.GetProperty("PurchaseOrderNumber", ""),//采购订单号
// DeliveryIndexNumber = inv1.GetProperty("DeliveryIndexNumber", ""),//交付索引号
// PartName = inv1.GetProperty("PartName", ""),//零件名称
@ -652,18 +657,31 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public class MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO public class MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO
{ {
/// <summary> /// <summary>
///发票分组号 ///发票分组号
/// </summary> /// </summary>
[Display(Name = "发票分组号")] [Display(Name = "发票分组号")]
public string InvGroupNum { get; set; } public string InvGroupNum { get; set; }
[Display(Name = "金税发票")]
public string RealInvBillNum { get; set; }
[Display(Name = "发票日期")]
public DateTime? InvDate { set; get; }
/// <summary>
///发票号
/// </summary>
[Display(Name = "发票号")]
public string InvbillNum { get; set; }
/// <summary> /// <summary>
///结算分组号 ///结算分组号
/// </summary> /// </summary>
[Display(Name = "五联单号")] [Display(Name = "五联单号")]
public string SettleGroupNum { get; set; } public string SettleGroupNum { get; set; }
[Display(Name = "现生产码")] [Display(Name = "现产品生产码")]
public string Extend1 { get; set; } public string Extend1 { get; set; }
} }

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

@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Mvc;
using SettleAccount.Bases; using SettleAccount.Bases;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Shouldly; using Shouldly;
using SqlSugar;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Uow; using Volo.Abp.Uow;
@ -133,8 +134,8 @@ namespace Win.Sfs.SettleAccount.Bases
var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false);
var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false);
var mdtos = ObjectMapper.Map<List<INVOICE_MAP_GROUP>, List<INVOICE_MAP_GROUP_DTO>>(m); var mdtos = ObjectMapper.Map<List<INVOICE_MAP_GROUP>, List<INVOICE_MAP_GROUP_DTO>>(m);
var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var first = invs.FirstOrDefault();
var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s);
if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC) if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC)
{ {
var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false);
@ -146,7 +147,6 @@ namespace Win.Sfs.SettleAccount.Bases
select select
new INVOICE_WAIT_DETAIL_BBAC_DTO() new INVOICE_WAIT_DETAIL_BBAC_DTO()
{ {
PartDesc = tm == null ? string.Empty : itm.PartDesc, PartDesc = tm == null ? string.Empty : itm.PartDesc,
InvDate = itm1.CreationTime, InvDate = itm1.CreationTime,
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum,
@ -158,72 +158,106 @@ namespace Win.Sfs.SettleAccount.Bases
PRICE = itm.PRICE, PRICE = itm.PRICE,
Qty = itm.Qty, Qty = itm.Qty,
Amt = itm.Amt, Amt = itm.Amt,
BussiessType = itm.BussiessType,
Extend1 = itm.Extend1, Extend1 = itm.Extend1,
BeginDate = itm.BeginDate, BeginDate = itm.BeginDate,
EndDate = itm.EndDate, EndDate = itm.EndDate,
}; };
entity.INVOICE_WAIT_DETAIL_BBAC = wquery.ToList(); entity.INVOICE_WAIT_DETAIL_BBAC = wquery.OrderBy(p => p.LU).ToList();
} }
else if (invs.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) else if (invs.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian)
{ {
var B = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var B = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false);
var BMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BJ_DTO>>(B);
B.OrderBy(p => p.LineCode);
List<INVOICE_WAIT_DETAIL_BJ_DTO> BMap = new List<INVOICE_WAIT_DETAIL_BJ_DTO>();
foreach (var itm in B)
{
INVOICE_WAIT_DETAIL_BJ_DTO bj = new INVOICE_WAIT_DETAIL_BJ_DTO();
bj.LU = itm.LU;
bj.PartCode = itm.PartCode;
bj.PRICE = itm.PRICE;
bj.InvGroupNum = itm.InvGroupNum;
bj.DeliveryNumber = itm.ExtraProperties["DeliveryIndexNumber"].ToSqlValue();
//bj.DeliveryNumber = itm.GetProperty("DeliveryNumber", "");//交货号
//bj.InvbillNum = itm.GetProperty("InvoiceNumber", "");//发票号
//bj.VendorCode = itm.GetProperty("VendorCode", "");//供应商代码
//bj.VendorName = itm.GetProperty("VendorName", "");//供应商名称
//bj.PurchaseOrderNumber = itm.GetProperty("PurchaseOrderNumber", "");//采购订单号
//bj.DeliveryIndexNumber = itm.GetProperty("DeliveryIndexNumber", "");//交付索引号
//bj.PartName = itm.GetProperty("PartName", "");//零件名称
BMap.Add(bj);
}
//var BMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BJ_DTO>>(B);
var wquery = from itm in BMap var wquery = from itm in BMap
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
from tm in temp.DefaultIfEmpty() from tm in temp.DefaultIfEmpty()
select select
new INVOICE_WAIT_DETAIL_BJ_DTO() new INVOICE_WAIT_DETAIL_BJ_DTO()
{ {
PartDesc = tm == null ? string.Empty : itm.PartDesc, PartDesc = tm == null ? string.Empty : itm.PartDesc,
InvDate = itm1.CreationTime, InvDate = itm1.CreationTime,
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum,
Version = itm.Version, Version = itm.Version,
InvbillNum = itm.InvbillNum, InvbillNum = itm.InvbillNum,
InvGroupNum = itm.InvGroupNum, InvGroupNum = itm.InvGroupNum,
LU = itm.LU, LU = itm.LU,
PartCode = itm.PartCode, PartCode = itm.PartCode,
PRICE = itm.PRICE, PRICE = itm.PRICE,
Qty = itm.Qty, Qty = itm.Qty,
Amt = itm.Amt, Amt = itm.Amt,
DeliveryNumber = itm.DeliveryNumber,
Extend1 = itm.Extend1, VendorCode = itm.VendorCode,
BeginDate = itm.BeginDate, VendorName = itm.VendorName,
EndDate = itm.EndDate, //PurchaseOrderNumber = itm.PurchaseOrderNumber,
}; DeliveryIndexNumber = itm.DeliveryIndexNumber,
Extend1 = itm.Extend1,
BeginDate = itm.BeginDate,
EndDate = itm.EndDate,
};
entity.INVOICE_WAIT_DETAIL_BJ = wquery.ToList(); entity.INVOICE_WAIT_DETAIL_BJ = wquery.ToList();
} }
else else
{ {
var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false);
var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var wdtos = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(w); var wdtos = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(w);
var wquery = from itm in wdtos var wquery = from itm in wdtos
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
from tm in temp.DefaultIfEmpty() from tm in temp.DefaultIfEmpty()
select select
new INVOICE_WAIT_DETAIL_DTO() new INVOICE_WAIT_DETAIL_DTO()
{ {
PartDesc = tm == null ? string.Empty : itm.PartDesc, PartDesc = tm == null ? string.Empty : itm.PartDesc,
InvDate = itm1.CreationTime, InvDate = itm1.CreationTime,
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum,
Version = itm.Version, Version = itm.Version,
InvbillNum = itm.InvbillNum, InvbillNum = itm.InvbillNum,
InvGroupNum = itm.InvGroupNum, InvGroupNum = itm.InvGroupNum,
LU = itm.LU, LU = itm.LU,
PartCode = itm.PartCode, PartCode = itm.PartCode,
PRICE = itm.PRICE, PRICE = itm.PRICE,
Qty = itm.Qty, Qty = itm.Qty,
Amt = itm.Amt, Amt = itm.Amt,
BussiessType = itm.BussiessType, BussiessType = itm.BussiessType,
// Extend1 = itm.Extend1, //Extend1 = itm.Extend1,
BeginDate = itm.BeginDate, BeginDate = itm.BeginDate,
EndDate = itm.EndDate, EndDate = itm.EndDate,
}; };
entity.INVOICE_WAIT_DETAIL = wdtos; entity.INVOICE_WAIT_DETAIL = wquery.OrderBy(p => p.LU).ToList();
} }
var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false);
var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s);//不可结
var adjs = await _adjRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false);//调整数据
var adjdtos = ObjectMapper.Map<List<PUB_ADJ_DETAIL>, List<PUB_ADJ_DETAIL_DTO>>(adjs);//调整数据DTO
var notquery = from itm in sdtos var notquery = from itm in sdtos
join itm1 in invs on itm.InvBillNum equals itm1.InvbillNum join itm1 in invs on itm.InvBillNum equals itm1.InvbillNum
select select
@ -249,8 +283,7 @@ namespace Win.Sfs.SettleAccount.Bases
InvGroupNum = itm.InvGroupNum, InvGroupNum = itm.InvGroupNum,
SettleGroupNum = itm.SettleGroupNum SettleGroupNum = itm.SettleGroupNum
}; };
var adjs = await _adjRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false);
var adjdtos = ObjectMapper.Map<List<PUB_ADJ_DETAIL>, List<PUB_ADJ_DETAIL_DTO>>(adjs);
var adjQuery = from itm in adjdtos var adjQuery = from itm in adjdtos
join itm1 in invs on itm.InvBillNum equals itm1.InvbillNum join itm1 in invs on itm.InvBillNum equals itm1.InvbillNum
select select
@ -266,9 +299,68 @@ namespace Win.Sfs.SettleAccount.Bases
KeyCode = itm.KeyCode, KeyCode = itm.KeyCode,
Price = itm.Price Price = itm.Price
}; };
entity.INVOICE_NOT_SETTLE = notquery.ToList();
entity.INVOICE_MAP_GROUP = mquery.ToList(); entity.INVOICE_NOT_SETTLE = notquery.OrderBy(p => p.SettleGroupNum).ThenBy(p => p.LU).ToList();
entity.ADJ_DETAIL = adjQuery.ToList();
var lscompare = entity.INVOICE_NOT_SETTLE.GroupBy(x => new { x.InvBillNum, x.SettleGroupNum }).Select(p =>
new INVOICE_MAP_GROUP_DTO()
{
InvbillNum = p.FirstOrDefault().InvBillNum,
InvGroupNum = p.FirstOrDefault().InvGroupNum,
RealInvBillNum = p.FirstOrDefault().RealInvBillNum,
InvDate = p.FirstOrDefault().InvDate,
SettleGroupNum = p.FirstOrDefault().SettleGroupNum,
}
);
if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC)//BBAC直供未结
{
//var all = entity.INVOICE_NOT_SETTLE.Select(p => p.SettleGroupNum).Distinct().ToList();//全部分组号
//var part = mquery.ToList().Select(p => p.SettleGroupNum).Distinct().ToList();//发票对应分组号
//var unsettled = all.Where(p => !part.Contains(p));//排除发票对应分组号,都为不可结
var unsettledList = sdtos
.GroupBy(p => new { p.LU, p.SettleGroupNum })
.Select(p => new JIT_UNSETTLED_DETAIL_DTO { LU = p.Key.LU, GroupNum = p.Key.SettleGroupNum, Qty = p.Sum(itm => itm.Qty.Value) });
entity.JIT_UNSETTLED_DETAIL = unsettledList.ToList().OrderBy(p => p.GroupNum).ThenBy(p => p.LU).ToList();
}
if (first.BusinessType == EnumBusinessType.JisHBPO || first.BusinessType == EnumBusinessType.JisBBAC)
{
entity.INVOICE_MAP_GROUP = lscompare.ToList().OrderBy(p => p.SettleGroupNum).ToList();//包含不可结结算分组号
}
if (first.BusinessType == EnumBusinessType.MaiDanJianHBPO)
{
//List<MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO> maidan = new List<MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO>();
var maiquery = from itm in m
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
select
new MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO()
{
Extend1 = itm.Extend1,
InvGroupNum = itm.InvGroupNum,
SettleGroupNum = itm.SettleGroupNum,
InvbillNum = itm.InvbillNum,
RealInvBillNum = itm1.RealnvBillNum
};
entity.MAIDAN_HBPO_INVOICE_MAP_GROUP = maiquery.ToList();
List<MAIDAN_HBPO_UNSETTLED_DETAIL_DTO> unsettle = new List<MAIDAN_HBPO_UNSETTLED_DETAIL_DTO>();
foreach (var itm in notquery.ToList())
{
unsettle.Add(new MAIDAN_HBPO_UNSETTLED_DETAIL_DTO()
{
GroupNum = itm.InvGroupNum,
LU = itm.LU,
PN = itm.Extend1,
});
}
entity.MAIDAN_HBPO_UNSETTLED_DETAIL = unsettle;
}
entity.ADJ_DETAIL = adjQuery.ToList().OrderBy(p => p.GroupNum).ThenBy(p => p.LU).ToList();
return entity; return entity;
} }
/// <summary> /// <summary>

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

@ -337,7 +337,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result });
} }
var invBilllist = new List<INVOICE_WAIT_DETAIL_DTO>(); var invBilllist = new List<INVOICE_WAIT_DETAIL_DTO>();
var adjlist = ObjectMapper.Map<List<PUB_ADJ_DETAIL_DTO>, List<PUB_ADJ_DETAIL>>(p_list); var adjlist = ObjectMapper.Map<List<PUB_ADJ_DETAIL_DTO>, List<PUB_ADJ_DETAIL>>(p_list);
if (adjlist == null && adjlist.Count == 0) if (adjlist == null && adjlist.Count == 0)
@ -398,7 +397,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
)); ));
} }
} }
var entitys = bbaclist;//合并库存调整单和发票可结算明细数据 var entitys = bbaclist;//合并库存调整单和发票可结算明细数据
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
var priceList = _priceRepository.ToList();//价格单 var priceList = _priceRepository.ToList();//价格单

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

@ -199,9 +199,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
bj.LU = itm.LU; bj.LU = itm.LU;
bj.PartCode = itm.PartCode; bj.PartCode = itm.PartCode;
bj.PRICE = itm.PRICE; bj.PRICE = itm.PRICE;
bj.InvbillNum = itm.InvbillNum;
bj.InvGroupNum = itm.InvGroupNum; bj.InvGroupNum = itm.InvGroupNum;
bj.DeliveryNumber =itm.ExtraProperties["DeliveryIndexNumber"].ToSqlValue(); bj.DeliveryNumber =itm.ExtraProperties["DeliveryIndexNumber"].ToSqlValue();
bj.Qty = itm.Qty;
bj.PRICE = itm.PRICE;
bj.Amt = Math.Round(itm.PRICE * itm.Qty, 2);
bj.Extend1=itm.Extend1;
bj.VendorCode = itm.ExtraProperties["VendorCode"].ToSqlValue();//供应商代码
bj.VendorName = itm.ExtraProperties["VendorName"].ToSqlValue();//供应商名称
bj.DeliveryNumber = itm.ExtraProperties["DeliveryNumber"].ToSqlValue();//交货号;
//bj.DeliveryNumber = itm.GetProperty("DeliveryNumber", "");//交货号 //bj.DeliveryNumber = itm.GetProperty("DeliveryNumber", "");//交货号
//bj.InvbillNum = itm.GetProperty("InvoiceNumber", "");//发票号 //bj.InvbillNum = itm.GetProperty("InvoiceNumber", "");//发票号
//bj.VendorCode = itm.GetProperty("VendorCode", "");//供应商代码 //bj.VendorCode = itm.GetProperty("VendorCode", "");//供应商代码
@ -209,10 +217,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//bj.PurchaseOrderNumber = itm.GetProperty("PurchaseOrderNumber", "");//采购订单号 //bj.PurchaseOrderNumber = itm.GetProperty("PurchaseOrderNumber", "");//采购订单号
//bj.DeliveryIndexNumber = itm.GetProperty("DeliveryIndexNumber", "");//交付索引号 //bj.DeliveryIndexNumber = itm.GetProperty("DeliveryIndexNumber", "");//交付索引号
//bj.PartName = itm.GetProperty("PartName", "");//零件名称 //bj.PartName = itm.GetProperty("PartName", "");//零件名称
BMap.Add(bj);
} }
//var BMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BJ_DTO>>(B); //var BMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BJ_DTO>>(B);
var wquery = from itm in BMap var bjquery = from itm in BMap
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
from tm in temp.DefaultIfEmpty() from tm in temp.DefaultIfEmpty()
@ -233,13 +243,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
DeliveryNumber = itm.DeliveryNumber , DeliveryNumber = itm.DeliveryNumber ,
VendorCode = itm.VendorCode , VendorCode = itm.VendorCode ,
VendorName = itm.VendorName , VendorName = itm.VendorName ,
PurchaseOrderNumber = itm.PurchaseOrderNumber, // PurchaseOrderNumber = itm.PurchaseOrderNumber,
DeliveryIndexNumber =itm.DeliveryIndexNumber , DeliveryIndexNumber =itm.DeliveryIndexNumber ,
Extend1 = itm.Extend1, Extend1 = itm.Extend1,
BeginDate = itm.BeginDate, BeginDate = itm.BeginDate,
EndDate = itm.EndDate, EndDate = itm.EndDate,
}; };
entity.INVOICE_WAIT_DETAIL_BJ = wquery.ToList(); entity.INVOICE_WAIT_DETAIL_BJ = bjquery.ToList();
} }
else else
{ {
@ -348,16 +358,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
if (first.BusinessType == EnumBusinessType.MaiDanJianHBPO) if (first.BusinessType == EnumBusinessType.MaiDanJianHBPO)
{ {
List<MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO> maidan = new List<MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO>(); //List<MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO> maidan = new List<MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO>();
foreach (var itm in m)
{ var maiquery = from itm in m
maidan.Add(new MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO() { join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
Extend1=itm.Extend1, select
InvGroupNum=itm.InvGroupNum, new MAIDAN_HBPO_INVOICE_MAP_GROUP_DTO()
SettleGroupNum=itm.SettleGroupNum {
}); Extend1 = itm.Extend1,
} InvGroupNum = itm.InvGroupNum,
entity.MAIDAN_HBPO_INVOICE_MAP_GROUP = maidan; SettleGroupNum = itm.SettleGroupNum,
InvbillNum = itm.InvbillNum,
RealInvBillNum = itm1.RealnvBillNum
};
entity.MAIDAN_HBPO_INVOICE_MAP_GROUP = maiquery.ToList();
List<MAIDAN_HBPO_UNSETTLED_DETAIL_DTO> unsettle = new List<MAIDAN_HBPO_UNSETTLED_DETAIL_DTO>(); List<MAIDAN_HBPO_UNSETTLED_DETAIL_DTO> unsettle = new List<MAIDAN_HBPO_UNSETTLED_DETAIL_DTO>();
foreach (var itm in notquery.ToList()) foreach (var itm in notquery.ToList())
{ {
@ -368,6 +383,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}); });
} }
entity.MAIDAN_HBPO_UNSETTLED_DETAIL = unsettle;
} }
@ -434,13 +450,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var unsettle = invdetail.UNSETTLED_DETAIL;//全部未结明细 var unsettle = invdetail.UNSETTLED_DETAIL;//全部未结明细
var hbpom = invdetail.MAIDAN_HBPO_INVOICE_MAP_GROUP;//买单HBPO分组对应 var hbpom = invdetail.MAIDAN_HBPO_INVOICE_MAP_GROUP;//买单HBPO分组对应
var hbpounsettle = invdetail.MAIDAN_HBPO_UNSETTLED_DETAIL;//买单HBPO未结 var hbpounsettle = invdetail.MAIDAN_HBPO_UNSETTLED_DETAIL;//买单HBPO未结
var jitunsettle = invdetail.JIT_UNSETTLED_DETAIL;//买单HBPO未结
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name; var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
#region 发票明细 #region 发票明细
if (entities.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC) if (entities.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC)
{ {
_excel.Append(bbac, "发票明细"); _excel.Append(bbac, "发票明细");
@ -458,7 +473,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
// 发票分组 // 发票分组
if (first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.JisHBPO) if (first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.JisHBPO)
{ {
_excel.Append(m, "发票结算分组对应");//发票分组对应结算号 if (m != null)
{
_excel.Append(m, "发票结算分组对应");//发票分组对应结算号
}
if (unsettle != null)
{
_excel.Append(unsettle, "未结零件汇总");
}
} }
if (first.BusinessType == EnumBusinessType.MaiDanJianHBPO) if (first.BusinessType == EnumBusinessType.MaiDanJianHBPO)
{ {
@ -466,15 +490,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
_excel.Append(hbpom, "发票结算分组对应"); _excel.Append(hbpom, "发票结算分组对应");
} }
if (unsettle != null) if (hbpounsettle != null)
{ {
_excel.Append(unsettle, "未结零件汇总"); _excel.Append(hbpounsettle, "未结零件汇总");
} }
} }
if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC)
{
_excel.Append(unsettle, "未结零件结算汇总");
}
//jis业务,发票分组对应关系,未结数据,调整数据 //jis业务,发票分组对应关系,未结数据,调整数据
if (first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.JisHBPO) if (first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.JisHBPO)
{ {

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

@ -80,7 +80,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单 var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单
foreach (var itm in priceListbj) foreach (var itm in priceListbj)
{ {
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price }); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price ,ClientCode="1049"});
} }
} }
else else

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

@ -25,7 +25,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
PUB_NOT_SA_DETAIL_EXP_DTO> PUB_NOT_SA_DETAIL_EXP_DTO>
{ {
private readonly PUB_NOT_SA_MNG _pubNotMng; private readonly PUB_NOT_SA_MNG _pubNotMng;
public PUB_NOT_SA_SERVICE(IExcelImportAppService excelImportService, public PUB_NOT_SA_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager, ICommonManager commonManager,
@ -57,9 +56,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist).ConfigureAwait(false) }); return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist).ConfigureAwait(false) });
} }
} }
return new JsonResult(new { Code = 200, Message = "生成成功" }); return new JsonResult(new { Code = 200, Message = "生成成功" });
} }
} }

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

@ -2177,7 +2177,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
InvoiceNumber = inv1.GetProperty("InvoiceNumber", ""),//发票号 InvoiceNumber = inv1.GetProperty("InvoiceNumber", ""),//发票号
VendorCode = inv1.GetProperty("VendorCode", ""),//供应商代码 VendorCode = inv1.GetProperty("VendorCode", ""),//供应商代码
VendorName = inv1.GetProperty("VendorName", ""),//供应商名称 VendorName = inv1.GetProperty("VendorName", ""),//供应商名称
PurchaseOrderNumber = inv1.GetProperty("PurchaseOrderNumber", ""),//采购订单号
DeliveryIndexNumber = inv1.GetProperty("DeliveryIndexNumber", ""),//交付索引号 DeliveryIndexNumber = inv1.GetProperty("DeliveryIndexNumber", ""),//交付索引号
PartName = inv1.GetProperty("PartName", ""),//零件名称 PartName = inv1.GetProperty("PartName", ""),//零件名称
}; };

Loading…
Cancel
Save