|
@ -1,6 +1,7 @@ |
|
|
using CodeArts.Db; |
|
|
using CodeArts.Db; |
|
|
using DocumentFormat.OpenXml.Bibliography; |
|
|
using DocumentFormat.OpenXml.Bibliography; |
|
|
using DocumentFormat.OpenXml.Drawing.Diagrams; |
|
|
using DocumentFormat.OpenXml.Drawing.Diagrams; |
|
|
|
|
|
using DocumentFormat.OpenXml.Office.Drawing; |
|
|
using DocumentFormat.OpenXml.Spreadsheet; |
|
|
using DocumentFormat.OpenXml.Spreadsheet; |
|
|
using DocumentFormat.OpenXml.Wordprocessing; |
|
|
using DocumentFormat.OpenXml.Wordprocessing; |
|
|
using EFCore.BulkExtensions; |
|
|
using EFCore.BulkExtensions; |
|
@ -13,6 +14,7 @@ using Microsoft.AspNetCore.Mvc; |
|
|
using NPOI.HPSF; |
|
|
using NPOI.HPSF; |
|
|
using SettleAccount.Domain.BQ; |
|
|
using SettleAccount.Domain.BQ; |
|
|
using Shouldly; |
|
|
using Shouldly; |
|
|
|
|
|
using SqlSugar; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.ComponentModel.DataAnnotations; |
|
|
using System.ComponentModel.DataAnnotations; |
|
@ -161,13 +163,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); |
|
|
var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); |
|
|
var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); |
|
|
var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); |
|
|
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 first = invs.FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); |
|
|
var AMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BBAC_DTO>>(A); |
|
|
var AMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BBAC_DTO>>(A); |
|
|
var wquery = from itm in AMap |
|
|
var wquery = from itm in AMap |
|
|
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_BBAC_DTO() |
|
|
new INVOICE_WAIT_DETAIL_BBAC_DTO() |
|
@ -198,7 +204,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
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() |
|
|
{ |
|
|
{ |
|
@ -249,17 +255,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
BeginDate = itm.BeginDate, |
|
|
BeginDate = itm.BeginDate, |
|
|
EndDate = itm.EndDate, |
|
|
EndDate = itm.EndDate, |
|
|
}; |
|
|
}; |
|
|
|
|
|
entity.INVOICE_WAIT_DETAIL = wquery.OrderBy(p => p.LU).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
entity.INVOICE_WAIT_DETAIL= wquery.OrderBy(p=>p.LU).ToList(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); |
|
|
var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); |
|
|
var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s); |
|
|
var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s);//不可结
|
|
|
var adjs =await _adjRepository.GetListByFilterAsync(input.Filters); |
|
|
var adjs = await _adjRepository.GetListByFilterAsync(input.Filters);//调整数据
|
|
|
var adjdtos = ObjectMapper.Map<List<PUB_ADJ_DETAIL>, List<PUB_ADJ_DETAIL_DTO>>(adjs); |
|
|
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 |
|
@ -274,8 +276,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
Qty = itm.Qty, |
|
|
Qty = itm.Qty, |
|
|
Extend1 = itm.Extend1, |
|
|
Extend1 = itm.Extend1, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var mquery = from itm in mdtos |
|
|
var mquery = from itm in mdtos |
|
|
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum |
|
|
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum |
|
|
select |
|
|
select |
|
@ -304,12 +304,32 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
Price = itm.Price |
|
|
Price = itm.Price |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
entity.INVOICE_NOT_SETTLE = notquery.ToList(); |
|
|
entity.INVOICE_NOT_SETTLE = notquery.OrderBy(p=>p.SettleGroupNum).ThenBy(p=>p.LU).ToList(); |
|
|
entity.INVOICE_MAP_GROUP = mquery.ToList(); |
|
|
|
|
|
entity.ADJ_DETAIL = adjQuery.ToList(); |
|
|
var lscompare = entity.INVOICE_NOT_SETTLE.GroupBy(x => new { x.InvBillNum, x.SettleGroupNum }).Select(p => |
|
|
return entity; |
|
|
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, |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
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= entity.INVOICE_NOT_SETTLE.Where(p => unsettled.Contains(p.SettleGroupNum)) |
|
|
|
|
|
.GroupBy(p => new { p.LU, p.SettleGroupNum }) |
|
|
|
|
|
.Select(p => new UNSETTLED_DETAIL_DTO { LU = p.Key.LU, GroupNum = p.Key.SettleGroupNum, Qty = p.Sum(itm => itm.Qty.Value) }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
entity.UNSETTLED_DETAIL = unsettledList.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
entity.INVOICE_MAP_GROUP = lscompare.ToList().OrderBy(p => p.SettleGroupNum).ToList();//包含不可结结算分组号
|
|
|
|
|
|
entity.ADJ_DETAIL = adjQuery.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList(); |
|
|
|
|
|
return entity; |
|
|
} |
|
|
} |
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
public virtual async Task<string> ExportAsync(INVOICE_GRP_REQ_DTO input) |
|
|
public virtual async Task<string> ExportAsync(INVOICE_GRP_REQ_DTO input) |
|
@ -350,9 +370,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
return _fileName; |
|
|
return _fileName; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 导出发票组明细
|
|
|
/// 导出发票组明细
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
@ -363,26 +380,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
{ |
|
|
{ |
|
|
IExporter _csv = new CsvExporter(); |
|
|
IExporter _csv = new CsvExporter(); |
|
|
ExcelExporter _excel = new ExcelExporter(); |
|
|
ExcelExporter _excel = new ExcelExporter(); |
|
|
|
|
|
|
|
|
var materialList = await _baseservice.GetMaterialList(); |
|
|
var materialList = await _baseservice.GetMaterialList(); |
|
|
|
|
|
|
|
|
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); |
|
|
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); |
|
|
|
|
|
|
|
|
var first=entities.FirstOrDefault(); |
|
|
var first=entities.FirstOrDefault(); |
|
|
|
|
|
|
|
|
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities); |
|
|
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities); |
|
|
var invdetail= await DetailQueryAsync(input); |
|
|
var invdetail= await DetailQueryAsync(input); |
|
|
var m = invdetail.INVOICE_MAP_GROUP; |
|
|
var m = invdetail.INVOICE_MAP_GROUP; |
|
|
var not=invdetail.INVOICE_NOT_SETTLE; |
|
|
var not=invdetail.INVOICE_NOT_SETTLE;//零件结算对应关系
|
|
|
var detail =invdetail.INVOICE_WAIT_DETAIL; |
|
|
var detail =invdetail.INVOICE_WAIT_DETAIL;//常规明细
|
|
|
var adj = invdetail.ADJ_DETAIL; |
|
|
var adj = invdetail.ADJ_DETAIL;//调整表
|
|
|
var bbac = invdetail.INVOICE_WAIT_DETAIL_BBAC; |
|
|
var bbac = invdetail.INVOICE_WAIT_DETAIL_BBAC;//BBACJIS明细
|
|
|
var bj = invdetail.INVOICE_WAIT_DETAIL_BJ; |
|
|
var bj = invdetail.INVOICE_WAIT_DETAIL_BJ;//备件明细
|
|
|
|
|
|
var unsettle = invdetail.UNSETTLED_DETAIL;//未结明细
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"; |
|
|
|
|
|
|
|
|
|
|
|
//发票明细
|
|
|
if (entities.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC) |
|
|
if (entities.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
_excel.Append(bbac, "发票明细"); |
|
|
_excel.Append(bbac, "发票明细"); |
|
|
} |
|
|
} |
|
|
else if (entities.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) |
|
|
else if (entities.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) |
|
@ -393,6 +410,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
{ |
|
|
{ |
|
|
_excel.Append(detail, "发票明细"); |
|
|
_excel.Append(detail, "发票明细"); |
|
|
} |
|
|
} |
|
|
|
|
|
_excel.Append(m, "发票结算分组对应");//发票分组对应结算号
|
|
|
|
|
|
if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO) |
|
|
|
|
|
{ |
|
|
|
|
|
_excel.Append(unsettle, "未结零件分组汇总"); |
|
|
|
|
|
} |
|
|
foreach (var itm in entities) |
|
|
foreach (var itm in entities) |
|
|
{ |
|
|
{ |
|
|
var mgroup =m.Where(p => p.InvbillNum == itm.InvbillNum).ToList(); |
|
|
var mgroup =m.Where(p => p.InvbillNum == itm.InvbillNum).ToList(); |
|
@ -412,11 +434,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
RealInvBillNum =p.Key.RealInvBillNum, |
|
|
RealInvBillNum =p.Key.RealInvBillNum, |
|
|
InvDate =p.Key.InvDate, |
|
|
InvDate =p.Key.InvDate, |
|
|
InvBillNum =p.Key.InvBillNum, |
|
|
InvBillNum =p.Key.InvBillNum, |
|
|
|
|
|
|
|
|
InvGroupNum =p.Key.InvGroupNum, |
|
|
InvGroupNum =p.Key.InvGroupNum, |
|
|
Qty=p.Sum(itm=>itm.Qty) |
|
|
Qty=p.Sum(itm=>itm.Qty) |
|
|
|
|
|
|
|
|
}).ToList(); |
|
|
}).ToList(); |
|
|
|
|
|
|
|
|
var lsN = nolist.Where(p => p.Extend1 == "不可结算").ToList() |
|
|
var lsN = nolist.Where(p => p.Extend1 == "不可结算").ToList() |
|
|
.GroupBy(p => new |
|
|
.GroupBy(p => new |
|
|
{ |
|
|
{ |
|
@ -435,8 +457,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
InvGroupNum = p.Key.InvGroupNum, |
|
|
InvGroupNum = p.Key.InvGroupNum, |
|
|
Qty = p.Sum(itm => itm.Qty) |
|
|
Qty = p.Sum(itm => itm.Qty) |
|
|
}).ToList(); |
|
|
}).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var lineC = lsC.Count; |
|
|
var lineC = lsC.Count; |
|
|
var lineN = lsN.Count; |
|
|
var lineN = lsN.Count; |
|
|
List<INVOICE_NOT_SETTLE_EXT_DTO> ls = new List<INVOICE_NOT_SETTLE_EXT_DTO>(); |
|
|
List<INVOICE_NOT_SETTLE_EXT_DTO> ls = new List<INVOICE_NOT_SETTLE_EXT_DTO>(); |
|
@ -456,10 +476,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
ls.Add(invnot); |
|
|
ls.Add(invnot); |
|
|
} |
|
|
} |
|
|
var entity= nolist.FirstOrDefault(); |
|
|
var entity= nolist.FirstOrDefault(); |
|
|
var disList = mgroup.Select(p => p.SettleGroupNum).Distinct().ToList(); |
|
|
var disList = mgroup.Select(p => p.SettleGroupNum).Distinct().ToList(); |
|
|
|
|
|
for (int i = 0; i < lineC; i++)//更新可结信息
|
|
|
|
|
|
|
|
|
for (int i = 0; i < lineC; i++) |
|
|
|
|
|
{ |
|
|
{ |
|
|
ls[i].RealInvBillNum = entity.RealInvBillNum; |
|
|
ls[i].RealInvBillNum = entity.RealInvBillNum; |
|
|
ls[i].InvDate = entity.InvDate; |
|
|
ls[i].InvDate = entity.InvDate; |
|
@ -469,110 +487,29 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
ls[i].SettleLU = lsC[i].LU; |
|
|
ls[i].SettleLU = lsC[i].LU; |
|
|
ls[i].SettleQty = lsC[i].Qty == null ? string.Empty : lsC[i].Qty.ToString(); |
|
|
ls[i].SettleQty = lsC[i].Qty == null ? string.Empty : lsC[i].Qty.ToString(); |
|
|
} |
|
|
} |
|
|
for (int i = 0; i < lineN; i++) |
|
|
for (int i = 0; i < lineN; i++)//更新不可结信息
|
|
|
{ |
|
|
{ |
|
|
ls[i].RealInvBillNum = entity.RealInvBillNum; |
|
|
ls[i].RealInvBillNum = entity.RealInvBillNum; |
|
|
ls[i].InvDate = entity.InvDate; |
|
|
ls[i].InvDate = entity.InvDate; |
|
|
ls[i].InvBillNum = entity.InvBillNum; |
|
|
ls[i].InvBillNum = entity.InvBillNum; |
|
|
ls[i].InvGroupNum = entity.InvGroupNum; |
|
|
ls[i].InvGroupNum = entity.InvGroupNum; |
|
|
// ls[i].SettleGroupNum = entity.SettleGroupNum;
|
|
|
// ls[i].SettleGroupNum = entity.SettleGroupNum;
|
|
|
ls[i].NotSettleLU = lsN[i].LU; |
|
|
ls[i].NotSettleLU = lsN[i].LU; |
|
|
ls[i].Qty = lsN[i].Qty == null ? string.Empty : lsN[i].Qty.ToString(); |
|
|
ls[i].Qty = lsN[i].Qty == null ? string.Empty : lsN[i].Qty.ToString(); |
|
|
} |
|
|
} |
|
|
|
|
|
for (int i = 0; i < disList.Count; i++)//更新结算分组
|
|
|
for (int i = 0; i < disList.Count; i++) |
|
|
|
|
|
{ |
|
|
{ |
|
|
ls[i].SettleGroupNum = disList[i]; |
|
|
ls[i].SettleGroupNum = disList[i]; |
|
|
} |
|
|
} |
|
|
|
|
|
if (first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.JisHBPO) |
|
|
|
|
|
{ |
|
|
|
|
|
_excel.Append(ls, "结算分组零件" + itm.InvbillNum); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (lineC > lineN)//可结大于不可结行数时
|
|
|
|
|
|
//{
|
|
|
|
|
|
// for (int number = 0; number < lineC; number++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (number + 1 > lineN)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO();
|
|
|
|
|
|
// entity.RealInvBillNum = lsC[number].RealInvBillNum;
|
|
|
|
|
|
// entity.InvDate = lsC[number].InvDate;
|
|
|
|
|
|
// entity.InvBillNum = lsC[number].InvBillNum;
|
|
|
|
|
|
// entity.InvGroupNum = lsC[number].InvGroupNum;
|
|
|
|
|
|
// entity.SettleGroupNum = lsC[number].SettleGroupNum;
|
|
|
|
|
|
// entity.SettleLU = lsC[number].LU;
|
|
|
|
|
|
// entity.SettleQty = lsC[number].Qty == null ? string.Empty : lsC[number].Qty.ToString();
|
|
|
|
|
|
// entity.NotSettleLU = string.Empty;
|
|
|
|
|
|
// entity.Qty = string.Empty;
|
|
|
|
|
|
// ls.Add(entity);
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
// else
|
|
|
|
|
|
// {
|
|
|
|
|
|
// INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO();
|
|
|
|
|
|
// entity.RealInvBillNum = lsC[number].RealInvBillNum;
|
|
|
|
|
|
// entity.InvDate = lsC[number].InvDate;
|
|
|
|
|
|
// entity.InvBillNum = lsC[number].InvBillNum;
|
|
|
|
|
|
// entity.InvGroupNum = lsC[number].InvGroupNum;
|
|
|
|
|
|
// entity.SettleGroupNum = lsC[number].SettleGroupNum;
|
|
|
|
|
|
// entity.SettleLU = lsC[number].LU;
|
|
|
|
|
|
// entity.SettleQty= lsC[number].Qty==null?string.Empty:lsC[number].Qty.ToString();
|
|
|
|
|
|
// entity.NotSettleLU = lsN[number].LU;
|
|
|
|
|
|
// entity.Qty = lsN[number].Qty == null ? string.Empty : lsC[number].Qty.ToString();
|
|
|
|
|
|
// ls.Add(entity);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// for (int number = 0; number < lineN; number++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (number + 1 > lineC)//不可结大于可结行数时
|
|
|
|
|
|
// {
|
|
|
|
|
|
// INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO();
|
|
|
|
|
|
// entity.RealInvBillNum = lsN[number].RealInvBillNum;
|
|
|
|
|
|
// entity.InvDate = lsN[number].InvDate;
|
|
|
|
|
|
// entity.InvBillNum = lsN[number].InvBillNum;
|
|
|
|
|
|
// entity.InvGroupNum = lsN[number].InvGroupNum;
|
|
|
|
|
|
// entity.SettleGroupNum = lsN[number].SettleGroupNum;
|
|
|
|
|
|
// entity.SettleLU = string.Empty;
|
|
|
|
|
|
// entity.SettleQty = string.Empty;
|
|
|
|
|
|
// entity.NotSettleLU = lsN[number].LU;
|
|
|
|
|
|
// entity.Qty = lsN[number].Qty == null ? string.Empty : lsN[number].Qty.ToString();
|
|
|
|
|
|
// ls.Add(entity);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// else
|
|
|
|
|
|
// {
|
|
|
|
|
|
// INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO();
|
|
|
|
|
|
// entity.RealInvBillNum = lsN[number].RealInvBillNum;
|
|
|
|
|
|
// entity.InvDate = lsN[number].InvDate;
|
|
|
|
|
|
// entity.InvBillNum = lsN[number].InvBillNum;
|
|
|
|
|
|
// entity.InvGroupNum = lsN[number].InvGroupNum;
|
|
|
|
|
|
// entity.SettleGroupNum = lsN[number].SettleGroupNum;
|
|
|
|
|
|
// entity.SettleLU = lsC[number].LU;
|
|
|
|
|
|
// entity.NotSettleLU = lsN[number].LU;
|
|
|
|
|
|
// entity.Qty = lsN[number].Qty == null ? string.Empty : lsN[number].Qty.ToString(); ;
|
|
|
|
|
|
// entity.SettleQty = lsC[number].Qty == null ? string.Empty : lsC[number].Qty.ToString(); ;
|
|
|
|
|
|
// ls.Add(entity);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//var disList= ls.Select(p => p.SettleGroupNum).Distinct().ToList();
|
|
|
|
|
|
//foreach (var de in ls)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// de.SettleGroupNum = string.Empty;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//for (int i = 0; i < disList.Count; i++)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// ls[i].SettleGroupNum = disList[i];
|
|
|
|
|
|
//}
|
|
|
|
|
|
_excel.Append(ls, "结算分组零件" + itm.InvbillNum); |
|
|
|
|
|
_excel.Append(mgroup, "发票结算分组对应" + itm.InvbillNum).SeparateBySheet(); |
|
|
|
|
|
_excel.Append(adjp, "发票调整数据" + itm.InvbillNum).SeparateBySheet(); |
|
|
_excel.Append(adjp, "发票调整数据" + itm.InvbillNum).SeparateBySheet(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var result = _excel.ExportAppendDataAsByteArray(); |
|
|
var result = _excel.ExportAppendDataAsByteArray(); |
|
|
result.ShouldNotBeNull(); |
|
|
result.ShouldNotBeNull(); |
|
|
//保存导出文件到服务器存成二进制
|
|
|
//保存导出文件到服务器存成二进制
|
|
|