|
|
@ -9,125 +9,95 @@ using Volo.Abp.EntityFrameworkCore; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Temp; |
|
|
|
|
|
|
|
|
|
|
|
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
{ |
|
|
|
public class Meta |
|
|
|
{ |
|
|
|
public class SettleInvoiceDiff |
|
|
|
|
|
|
|
public class BalanceSum |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "零件号", IsBold = true)] |
|
|
|
public string MaterialCode { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "年份", IsBold = true)] |
|
|
|
public string Year { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "零件号", IsBold = true)] |
|
|
|
public string RealPartCode { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "零件名称", IsBold = true)] |
|
|
|
public string MaterialDesc { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "全年发票合计", IsBold = true)] |
|
|
|
public string SumInvoice { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "全年结算合计", IsBold = true)] |
|
|
|
public string SumSettle { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "全年合计差异", IsBold = true)] |
|
|
|
public string SumDiff { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "通用编码(生产码)", IsBold = true)] |
|
|
|
public string VinCode { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "库存余额数量", IsBold = true)] |
|
|
|
public string BalanceQty { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "有结无发合计", IsBold = true)] |
|
|
|
public string SettleQty { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "1月发票", IsBold = true)] |
|
|
|
public string January { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "1月结算", IsBold = true)] |
|
|
|
public string SettleJanuary { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "2月发票", IsBold = true)] |
|
|
|
public string InvoiceFebruary { set; get; } |
|
|
|
public string February { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "2月结算", IsBold = true)] |
|
|
|
public string SettleFebruary { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "3月发票", IsBold = true)] |
|
|
|
public string InvoiceMarch { set; get; } |
|
|
|
public string March { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "3月结算", IsBold = true)] |
|
|
|
public string SettleMarch { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "4月发票", IsBold = true)] |
|
|
|
public string InvoiceApril { set; get; } |
|
|
|
public string April { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "4月结算", IsBold = true)] |
|
|
|
public string SettleApril { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "5月发票", IsBold = true)] |
|
|
|
public string InvoiceMay { set; get; } |
|
|
|
public string May { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "5月结算", IsBold = true)] |
|
|
|
public string SettleMay { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "6月发票", IsBold = true)] |
|
|
|
public string InvoiceJune { set; get; } |
|
|
|
public string June { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "6月结算", IsBold = true)] |
|
|
|
public string SettleJune { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "7月发票", IsBold = true)] |
|
|
|
public string InvoiceJuly { set; get; } |
|
|
|
|
|
|
|
public string July { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "7月结算", IsBold = true)] |
|
|
|
public string SettleJuly { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "8月发票", IsBold = true)] |
|
|
|
public string InvoiceAugust { set; get; } |
|
|
|
|
|
|
|
public string August { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "8月结算", IsBold = true)] |
|
|
|
public string SettleAugust { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "9月发票", IsBold = true)] |
|
|
|
public string InvoiceSeptember { set; get; } |
|
|
|
|
|
|
|
public string September { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "9月结算", IsBold = true)] |
|
|
|
public string SettleSeptember { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "10月发票", IsBold = true)] |
|
|
|
public string InvoiceOctober { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public string October { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "10月结算", IsBold = true)] |
|
|
|
public string SettleOctober { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "11月发票", IsBold = true)] |
|
|
|
public string InvoiceNovember { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "11月结算", IsBold = true)] |
|
|
|
|
|
|
|
public string DiffNovember { set; get; } |
|
|
|
|
|
|
|
public string November { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "11月结算", IsBold = true)] |
|
|
|
public string SettleNovember { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "12月发票", IsBold = true)] |
|
|
|
public string InvoiceDecember { set; get; } |
|
|
|
public string December { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "12月结算", IsBold = true)] |
|
|
|
public string SettleDecember { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -145,7 +115,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
/// </summary>
|
|
|
|
/// <param name="p_year"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
public virtual object GetBalanceSum(string p_year) |
|
|
|
public virtual List<BalanceSum> GetBalanceSum(string p_year) |
|
|
|
{ |
|
|
|
var sql = "declare @lastyear as varchar(50)\n" + |
|
|
|
"declare @lastTime as varchar(50)\n" + |
|
|
@ -328,7 +298,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
"isnull(a.[{0}09],0)+\n" + |
|
|
|
"isnull(a.[{0}10],0)+\n" + |
|
|
|
"isnull(a.[{0}11],0)+\n" + |
|
|
|
"isnull(a.[{0}12],0) 库存余额数量,\n" + |
|
|
|
"isnull(a.[{0}12],0) BalanceQty ,\n" + |
|
|
|
"isnull(b.[{0}01],0) +\n" + |
|
|
|
"isnull(b.[{0}02],0) +\n" + |
|
|
|
"isnull(b.[{0}03],0) +\n" + |
|
|
@ -340,19 +310,19 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
"isnull(b.[{0}09],0) +\n" + |
|
|
|
"isnull(b.[{0}10],0) +\n" + |
|
|
|
"isnull(b.[{0}11],0) +\n" + |
|
|
|
"isnull(b.[{0}12],0) 有结无发合计,\n" + |
|
|
|
"isnull(a.[{0}01],0) [{0}01],isnull(b.[{0}01],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}02],0) [{0}02],isnull(b.[{0}02],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}03],0) [{0}03],isnull(b.[{0}03],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}04],0) [{0}04],isnull(b.[{0}04],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}05],0) [{0}05],isnull(b.[{0}05],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}06],0) [{0}06],isnull(b.[{0}06],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}07],0) [{0}07],isnull(b.[{0}07],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}08],0) [{0}08],isnull(b.[{0}08],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}09],0) [{0}09],isnull(b.[{0}09],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}10],0) [{0}10],isnull(b.[{0}10],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}11],0) [{0}11],isnull(b.[{0}11],0) [有结无发],\n" + |
|
|
|
"isnull(a.[{0}12],0) [{0}12],isnull(b.[{0}12],0) [有结无发] \n" + |
|
|
|
"isnull(b.[{0}12],0) SettleQty,\n" + |
|
|
|
"isnull(a.[{0}01],0) January,isnull(b.[{0}01],0) SettleJanuary,\n" + |
|
|
|
"isnull(a.[{0}02],0) February,isnull(b.[{0}02],0) SettleFebruary,\n" + |
|
|
|
"isnull(a.[{0}03],0) March,isnull(b.[{0}03],0) SettleMarch,\n" + |
|
|
|
"isnull(a.[{0}04],0) April,isnull(b.[{0}04],0) SettleApril,\n" + |
|
|
|
"isnull(a.[{0}05],0) May,isnull(b.[{0}05],0) SettleMay,\n" + |
|
|
|
"isnull(a.[{0}06],0) June,isnull(b.[{0}06],0) SettleJune,\n" + |
|
|
|
"isnull(a.[{0}07],0) July,isnull(b.[{0}07],0) SettleJuly,\n" + |
|
|
|
"isnull(a.[{0}08],0) August,isnull(b.[{0}08],0) SettleAugust,\n" + |
|
|
|
"isnull(a.[{0}09],0) September,isnull(b.[{0}09],0) SettleSeptember,\n" + |
|
|
|
"isnull(a.[{0}10],0) October,isnull(b.[{0}10],0) SettleOctober,\n" + |
|
|
|
"isnull(a.[{0}11],0) November,isnull(b.[{0}11],0) SettleNovember,\n" + |
|
|
|
"isnull(a.[{0}12],0) December,isnull(b.[{0}12],0) SettleDecember \n" + |
|
|
|
"from #temp_js a full join #temp_bh b on a.ErpToLoc=b.ErpToLoc and a.RealPartCode=b.RealPartCode\n" + |
|
|
|
"drop table #temp_js\n" + |
|
|
|
"drop table #temp_bh\n"; |
|
|
@ -361,10 +331,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
|
|
|
|
var query = string.Format(sql, p_year); |
|
|
|
|
|
|
|
var list = DbConnection.Query(query,null,null,false,1200,null); |
|
|
|
var entities = DbConnection.Query<BalanceSum>(query,null,null,false,1200,null); |
|
|
|
|
|
|
|
|
|
|
|
return ""; |
|
|
|
return entities.ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|