Administrator 3 years ago
parent
commit
a5d820f6c8
  1. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
  2. 81
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs

4
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") if (iscontionversion == "0")
{ {
contion += string.Format(" WHERE Version <'{0}' and State = 2 ", version); contion += string.Format(" WHERE Version <'{0}' and State = 2 ", version);//默认选中
} }
else else
{ {
contion += " WHERE 1=1 and State = 2 "; contion += " WHERE 1=1 and State = 2 ";//去掉勾选
} }
//又更改规则了20220425 要求去比对出库单 //又更改规则了20220425 要求去比对出库单
string str = "SELECT\n" + string str = "SELECT\n" +

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

@ -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
{ {

Loading…
Cancel
Save