diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs index ad3f48b0..3f7d8032 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs @@ -688,11 +688,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //选中,是否过滤掉当期结算数据 if (iscontionversion == "0") { - contion += string.Format(" WHERE Version <'{0}' and State = 2 ", version); + contion += string.Format(" WHERE Version <'{0}' and State = 2 ", version);//默认选中 } else { - contion += " WHERE 1=1 and State = 2 "; + contion += " WHERE 1=1 and State = 2 ";//去掉勾选 } //又更改规则了20220425 要求去比对出库单 string str = "SELECT\n" + diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs index d24826dd..acefb77f 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs @@ -395,13 +395,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report /// /// /// - public virtual List GetWithCodeSettleSparePartReportList(string purchaseOrderNo, string version, string sapCode, string matialCode, + public virtual List GetWithCodeSettleSparePartReportList(string purchaseOrderNo, string version, string sapCode, string matialCode, string begintime, string endtime) { string sqlString = "SELECT\n" + " temp1.交货日期,\n" + " temp1.交货单号,\n" + - " NULL 订单日期,\n" + + " temp1.订单日期,\n" + " temp1.采购订单号,\n" + " temp1.SAP编码,\n" + " temp1.物料代码,\n" + @@ -423,7 +423,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " (\n" + " SELECT\n" + " a.Version AS 期间,\n" + - " a.PurchaseOrderNoText AS 采购订单文本,\n" + + " a.PurchaseOrderNoText AS 采购订单文本,CONVERT ( VARCHAR ( 100 ), a.SpareDate, 23 ) AS 订单日期,\n" + " '' AS 交货单号,\n" + " NULL AS 交货日期,\n" + " a.PurchaseOrderNo AS 采购订单号,\n" + @@ -465,7 +465,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string _sql = string.Format(addSqlStr, addwhere); //string _sql = string.Format(sqlString, version); - var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); return _query.ToList(); } @@ -643,22 +643,39 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string condition = ""; - if (!string.IsNullOrEmpty(begintime) && Convert.ToDateTime(begintime) != DateTime.MinValue) + //if (!string.IsNullOrEmpty(begintime) && Convert.ToDateTime(begintime) != DateTime.MinValue) + //{ + // condition += string.Format(" and a.SpareDate>='{0}' ", begintime); + //} + //if (!string.IsNullOrEmpty(endtime) && Convert.ToDateTime(begintime) != DateTime.MinValue) + //{ + // condition += string.Format(" and a.SpareDate<='{0}' ", endtime); + //} + if (!string.IsNullOrEmpty(begintime)) { condition += string.Format(" and a.SpareDate>='{0}' ", begintime); } - if (!string.IsNullOrEmpty(endtime) && Convert.ToDateTime(begintime) != DateTime.MinValue) + if (!string.IsNullOrEmpty(endtime)) { condition += string.Format(" and a.SpareDate<='{0}' ", endtime); } string conditionDate = ""; - if (!string.IsNullOrEmpty(begintime) && Convert.ToDateTime(begintime) != DateTime.MinValue) + //if (!string.IsNullOrEmpty(begintime) && Convert.ToDateTime(begintime) != DateTime.MinValue) + //{ + // conditionDate += string.Format(" and SpareDate>='{0}' ", begintime); + //} + //if (!string.IsNullOrEmpty(endtime) && Convert.ToDateTime(begintime) != DateTime.MinValue) + //{ + // conditionDate += string.Format(" and SpareDate<='{0}' ", endtime); + //} + + if (!string.IsNullOrEmpty(begintime)) { conditionDate += string.Format(" and SpareDate>='{0}' ", begintime); } - if (!string.IsNullOrEmpty(endtime) && Convert.ToDateTime(begintime) != DateTime.MinValue) + if (!string.IsNullOrEmpty(endtime)) { conditionDate += string.Format(" and SpareDate<='{0}' ", endtime); } @@ -724,6 +741,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + " ) unint1"; + #region old //string sqlString = "SELECT\n" + //" * \n" + //"FROM\n" + @@ -839,7 +857,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //" AND temp1.SAP编码= temp3.MaterialCode\n" + //" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + //" ) unint2"; - + #endregion @@ -1062,6 +1080,51 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } + /// + /// 大众备件有结算无发货 + /// + public class SettleSparePartExportDto + { + + [ExporterHeader(DisplayName = "采购订单号")] + public string 采购订单号 { set; get; } + + [ExporterHeader(DisplayName = "订单日期")] + public string 订单日期 { set; get; } + + + [ExporterHeader(DisplayName = "SAP编码")] + public string SAP编码 { set; get; } + [ExporterHeader(DisplayName = "物料代码")] + public string 物料代码 { set; get; } + [ExporterHeader(DisplayName = "物料描述")] + public string 物料描述 { set; get; } + + [ExporterHeader(DisplayName = "采购订单文本")] + public string 采购订单文本 { set; get; } + + + [ExporterHeader(DisplayName = "收货数量",IsIgnore =true)] + public decimal 收货数量 { set; get; } + [ExporterHeader(DisplayName = "开票数量")] + public decimal 开票数量 { set; get; } + + [ExporterHeader(DisplayName = "开票单价")] + public decimal 开票单价 { set; get; } + + [ExporterHeader(DisplayName = "开票金额")] + public decimal 开票金额 { set; get; } + [ExporterHeader(DisplayName = "定价")] + public decimal 定价 { set; get; } + [ExporterHeader(DisplayName = "单价差异")] + public decimal 单价差异 { set; get; } + + [ExporterHeader(DisplayName = "差异总金额")] + public decimal 差异总金额 { set; get; } + + + } + public class SettleSparePartDetailExport {