Browse Source

后端代码提交

branch_ccpg_220107
44673626 3 years ago
parent
commit
c230c381d6
  1. 2
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs
  2. 62
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
  3. 11
      src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs

2
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs

@ -132,7 +132,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public decimal SumDiffMoney { set; get; } public decimal SumDiffMoney { set; get; }
[ExporterHeader(DisplayName = "出库单号")] [ExporterHeader(DisplayName = "出库单号")]
public decimal DeliveryOrderNo { set; get; } public string DeliveryOrderNo { set; get; }
} }

62
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs

@ -20,37 +20,37 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public virtual List<SettleSparePartExport> GetSettleSparePartReportList(string state, string version, string year, string customcode, public virtual List<SettleSparePartExport> GetSettleSparePartReportList(string state, string version, string year, string customcode,
string begintime, string endtime) string begintime, string endtime)
{ {
string sqlString = "SELECT\n" + string sqlString = " SELECT \n" +
" * ,\n" + " * , \n" +
" (Price-InvoicePrice) as InvoiceDiffPrice, --单价差异\n" + " (Price-InvoicePrice) as InvoiceDiffPrice, --单价差异 \n" +
" ISNULL( Price * ReceiptQty-InvoiceMoney, 0 ) AS SumDiffMoney --总金额差异\n" + " ISNULL( Price * ReceiptQty-InvoiceMoney, 0 ) AS SumDiffMoney --总金额差异 \n" +
"FROM\n" + " FROM \n" +
" (\n" + " ( \n" +
" SELECT\n" + " SELECT \n" +
" c.Period as WMSDeliveryDate,--交货日期\n" + " c.Period as WMSDeliveryDate,--交货日期 \n" +
" c.DeliveryOrderNo,--交货单号\n" + " c.DeliveryOrderNo,--交货单号 \n" +
" c.SpareDate as OrderDate,--订单日期\n" + " c.SpareDate as OrderDate,--订单日期 \n" +
" a.PurchaseOrderNo,--采购订单号\n" + " a.PurchaseOrderNo,--采购订单号 \n" +
" b.MaterialCode as SAPCode,--SAP编码,即厂内物料号\n" + " b.MaterialCode as SAPCode,--SAP编码,即厂内物料号 \n" +
" a.MaterialCode,--物料代码\n" + " a.MaterialCode,--物料代码 \n" +
" b.MaterialDesc,--物料描述\n" + " b.MaterialDesc,--物料描述 \n" +
" a.PurchaseOrderNoText,--采购订单文本\n" + " a.PurchaseOrderNoText,--采购订单文本 \n" +
" c.ReceiptQty,-- 发货数量\n" + " c.ReceiptQty,-- 发货数量 \n" +
" d.Amt as InvoicedQty,--开票数量\n" + " d.Amt as InvoicedQty,--开票数量 \n" +
" (c.ReceiptQty-d.Amt) as SettleInvoiceDiffQty,--发货与开票差异\n" + " (c.ReceiptQty-d.Amt) as SettleInvoiceDiffQty,--发货与开票差异 \n" +
" d.InvoicePrice,--开票单价\n" + " d.InvoicePrice,--开票单价 \n" +
" (a.ReceiptQty * d.InvoicePrice) as InvoiceMoney --开票金额\n" + " (a.ReceiptQty * d.InvoicePrice) as InvoiceMoney --开票金额 \n" +
" \n" + " \n" +
" FROM\n" + " FROM \n" +
" Set_SparePart AS a\n" + " Set_SparePart AS a \n" +
" LEFT JOIN Set_material AS b ON a.MaterialCode= b.CustomerPartCode\n" + " LEFT JOIN Set_material AS b ON a.MaterialCode= b.CustomerPartCode \n" +
" LEFT JOIN Set_WMSSparePart c ON a.PurchaseOrderNo= c.WMSDeliveryNote \n" + " LEFT JOIN Set_WMSSparePart c ON a.PurchaseOrderNo= c.PurchaseOrderNo \n" +
" AND a.MaterialCode= c.MaterialCode\n" + " AND a.MaterialCode= c.MaterialCode \n" +
" LEFT JOIN ( SELECT SUM ( amt ) / SUM ( Qty ) InvoicePrice, MaterialCode,Amt FROM set_invoice WHERE version = '202109' GROUP BY materialcode,Amt ) d ON a.MaterialCode= d.MaterialCode \n" + " LEFT JOIN ( SELECT SUM ( amt ) / SUM ( Qty ) InvoicePrice, MaterialCode,Amt FROM set_invoice WHERE version = '202109' GROUP BY materialcode,Amt ) d ON a.MaterialCode= d.MaterialCode \n" +
" ) TEMP1\n" + " ) TEMP1 \n" +
" LEFT JOIN ( SELECT Price, --定价\n" + " LEFT JOIN ( SELECT Price, --定价 \n" +
" MaterialCode --厂内物料号\n" + " MaterialCode --厂内物料号 \n" +
" FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SAPCode= TEMP2.MaterialCode"; " FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SAPCode= TEMP2.MaterialCode ";
string _sql = string.Format(sqlString, version); string _sql = string.Format(sqlString, version);
var _query = DbConnection.Query<SettleSparePartExport>(_sql, null, null, true, 1200, null); var _query = DbConnection.Query<SettleSparePartExport>(_sql, null, null, true, 1200, null);
return _query.ToList(); return _query.ToList();

11
src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs

@ -108,6 +108,17 @@ namespace Win.Sfs.SettleAccount
return implementationFactory.GetService<SettleFisDiffExportService>(); return implementationFactory.GetService<SettleFisDiffExportService>();
} }
//大众看板结算与交货核对明细表(有条码)
if (key.Equals(typeof(SettleKBWithCodeExportService).FullName))
{
return implementationFactory.GetService<SettleKBWithCodeExportService>();
}
//大众备件结算核对明细表
if (key.Equals(typeof(SettleSparePartExportService).FullName))
{
return implementationFactory.GetService<SettleSparePartExportService>();
}
else else
{ {
throw new ArgumentException($"Not Support key:{key}"); throw new ArgumentException($"Not Support key:{key}");

Loading…
Cancel
Save