|
@ -395,13 +395,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
/// <param name="begintime"></param>
|
|
|
/// <param name="begintime"></param>
|
|
|
/// <param name="endtime"></param>
|
|
|
/// <param name="endtime"></param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
public virtual List<SettleSparePartExport> GetWithCodeSettleSparePartReportList(string purchaseOrderNo, string version, string sapCode, string matialCode, |
|
|
public virtual List<SettleSparePartExportDto> GetWithCodeSettleSparePartReportList(string purchaseOrderNo, string version, string sapCode, string matialCode, |
|
|
string begintime, string endtime) |
|
|
string begintime, string endtime) |
|
|
{ |
|
|
{ |
|
|
string sqlString = "SELECT\n" + |
|
|
string sqlString = "SELECT\n" + |
|
|
" temp1.交货日期,\n" + |
|
|
" temp1.交货日期,\n" + |
|
|
" temp1.交货单号,\n" + |
|
|
" temp1.交货单号,\n" + |
|
|
" NULL 订单日期,\n" + |
|
|
" temp1.订单日期,\n" + |
|
|
" temp1.采购订单号,\n" + |
|
|
" temp1.采购订单号,\n" + |
|
|
" temp1.SAP编码,\n" + |
|
|
" temp1.SAP编码,\n" + |
|
|
" temp1.物料代码,\n" + |
|
|
" temp1.物料代码,\n" + |
|
@ -423,7 +423,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
" (\n" + |
|
|
" (\n" + |
|
|
" SELECT\n" + |
|
|
" SELECT\n" + |
|
|
" a.Version AS 期间,\n" + |
|
|
" a.Version AS 期间,\n" + |
|
|
" a.PurchaseOrderNoText AS 采购订单文本,\n" + |
|
|
" a.PurchaseOrderNoText AS 采购订单文本,CONVERT ( VARCHAR ( 100 ), a.SpareDate, 23 ) AS 订单日期,\n" + |
|
|
" '' AS 交货单号,\n" + |
|
|
" '' AS 交货单号,\n" + |
|
|
" NULL AS 交货日期,\n" + |
|
|
" NULL AS 交货日期,\n" + |
|
|
" a.PurchaseOrderNo 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(addSqlStr, addwhere); |
|
|
//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<SettleSparePartExportDto>(_sql, null, null, true, 1200, null); |
|
|
return _query.ToList(); |
|
|
return _query.ToList(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -643,22 +643,39 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
|
|
|
|
|
string condition = ""; |
|
|
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); |
|
|
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); |
|
|
condition += string.Format(" and a.SpareDate<='{0}' ", endtime); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
string conditionDate = ""; |
|
|
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); |
|
|
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); |
|
|
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" + |
|
|
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + |
|
|
" ) unint1"; |
|
|
" ) unint1"; |
|
|
|
|
|
|
|
|
|
|
|
#region old
|
|
|
//string sqlString = "SELECT\n" +
|
|
|
//string sqlString = "SELECT\n" +
|
|
|
//" * \n" +
|
|
|
//" * \n" +
|
|
|
//"FROM\n" +
|
|
|
//"FROM\n" +
|
|
@ -839,7 +857,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
//" AND temp1.SAP编码= temp3.MaterialCode\n" +
|
|
|
//" 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" +
|
|
|
//" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
|
|
|
//" ) unint2";
|
|
|
//" ) unint2";
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1062,6 +1080,51 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 大众备件有结算无发货
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
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 |
|
|
public class SettleSparePartDetailExport |
|
|
{ |
|
|
{ |
|
|