From 5c5c18f6405e58fc78806fa70997291fa393f8f6 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Sat, 26 Mar 2022 16:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E6=97=97=E6=9C=AA=E7=BB=93=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E8=B0=83=E6=95=B4=E6=9C=AA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReportRequestDto/ReportRequestDto.cs | 8 +- .../ReportServices/ReportMakeService.cs | 1 + .../HQHSettledDetailDapperRepository.cs | 269 +++++++++++++++--- .../HQHUnSettledDetailDiffExportService.cs | 60 +--- 4 files changed, 243 insertions(+), 95 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs index 0fdd3de8..659aba97 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs @@ -29,9 +29,13 @@ namespace Win.Sfs.SettleAccount.Reports.ReportRequestDto public string State { set; get; } - - + + public string IsContainVersion { set; get; } + + + + } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs index c6f0afa0..9e1e93e5 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -755,6 +755,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban }); customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup }); customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode }); + customConditionList.Add(new CustomCondition() { Name = "IsContainVersion", Value = input.IsContainVersion }); var _taskid = await _service.ExportEnqueueAsync("红旗工厂未结明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHUnSettledDetailDiffExportService), customConditionList, (rs) => { }); 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 651f1653..4d3f1990 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 @@ -382,17 +382,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - //var _ls_1 = from itm1 in _list - // join itm2 in _ls on new { Kanban = itm1.订货看板编号, MaterialCode=itm1.Sap编码 } - // equals new { itm2.Kanban, itm2.MaterialCode } into g - // from t in g.DefaultIfEmpty() - // select new HQHSettledDetailDiff - // { - - // } ; - - - return _list; @@ -575,7 +564,16 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - + /// + /// 红旗未结比对(包含有发货有结算中发货大于结算的数据) + /// + /// + /// + /// + /// + /// + /// + /// public virtual List GetReverseSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup, string iscontionversion) { @@ -610,8 +608,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " SELECT\n" + " temp1.交货时间,\n" + " isnull( temp1.交货单号, '' ) 交货单号,\n" + - " temp1.收货仓库,\n" + - " temp1.收货仓库描述,\n" + " temp1.订货看板编号,\n" + " temp1.订货零件号,\n" + " temp1.Sap编码,\n" + @@ -619,7 +615,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " temp1.物料组,\n" + " temp1.零件中文名称,\n" + " temp1.发货数量,\n" + - " temp1.发货状态,\n" + " temp1.外部验收单号,\n" + " temp1.结算数量,\n" + " temp1.结算单价,\n" + @@ -635,23 +630,20 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " SELECT\n" + " a.WmsBillNum AS 交货单号,\n" + " CONVERT ( VARCHAR ( 100 ), a.LastModificationTime, 23 ) AS 交货时间 ,\n" + - " b.StorageLocation AS 收货仓库,\n" + - " b.StorageLocationDesc AS 收货仓库描述,\n" + " a.Kanban AS 订货看板编号,\n" + " b.MaterialCode AS 订货零件号,\n" + " c.MaterialCode Sap编码,\n" + " c.CustomerPartCode 客户物料号,\n" + " c.MaterialDesc AS 零件中文名称,\n" + " isnull( a.Qty, 0 ) AS 发货数量,\n" + - " isnull( a.State, 0 ) AS 发货状态,\n" + - " b.ExternalKanbanNumber AS 外部验收单号,\n" + + " '' AS 外部验收单号,\n" + " isnull( b.Qty, 0 ) AS 结算数量,\n" + - " isnull( b.Price, 0 ) AS 结算单价,\n" + - " isnull( b.Amt, 0 ) AS 结算金额 ,\n" + + " 0 AS 结算单价,\n" + + " 0 AS 结算金额 ,\n" + " C.EstimateTypeDesc AS 物料组 \n" + " FROM\n" + - " Set_HQ_H_Kanban AS a\n" + - " LEFT OUTER JOIN (select * from Set_HQ_H_Platform {0}) AS b ON a.Kanban = b.HQHKanBan \n" + + " ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode, WmsBillNum, LastModificationTime FROM Set_HQ_H_Kanban GROUP BY kanban, MaterialCode, WmsBillNum, LastModificationTime ) AS a\n" + + " LEFT OUTER JOIN ( SELECT SUM ( Qty ) Qty, HQHKanBan, MaterialCode FROM Set_HQ_H_Platform {0} GROUP BY HQHKanBan, MaterialCode ) AS b ON a.Kanban = b.HQHKanBan \n" + " AND a.MaterialCode = b.MaterialCode\n" + " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " WHERE\n" + @@ -669,8 +661,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " SELECT\n" + " temp1.交货时间,\n" + " isnull( temp1.交货单号, '' ) 交货单号,\n" + - " temp1.收货仓库,\n" + - " temp1.收货仓库描述,\n" + " temp1.订货看板编号,\n" + " temp1.订货零件号,\n" + " temp1.Sap编码,\n" + @@ -678,7 +668,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " temp1.物料组,\n" + " temp1.零件中文名称,\n" + " temp1.发货数量,\n" + - " temp1.发货状态,\n" + " temp1.外部验收单号,\n" + " temp1.结算数量,\n" + " temp1.结算单价,\n" + @@ -694,15 +683,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " SELECT\n" + " a.WmsBillNum AS 交货单号,\n" + " CONVERT ( VARCHAR ( 100 ), a.LastModificationTime, 23 ) AS 交货时间 ,\n" + - " '' AS 收货仓库,\n" + - " '' AS 收货仓库描述,\n" + " a.Kanban AS 订货看板编号,\n" + " b.MaterialCode AS 订货零件号,\n" + " c.MaterialCode Sap编码,\n" + " c.CustomerPartCode 客户物料号,\n" + " c.MaterialDesc AS 零件中文名称,\n" + " isnull( a.Qty, 0 ) AS 发货数量,\n" + - " 0 AS 发货状态,\n" + " '' AS 外部验收单号,\n" + " isnull( b.Qty, 0 ) AS 结算数量,\n" + " 0 AS 结算单价,\n" + @@ -714,17 +700,19 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " AND a.MaterialCode = b.MaterialCode\n" + " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " WHERE\n" + - " a.Qty> b.Qty {1}\n" + + " a.Qty> b.Qty {1}\n" + " ) AS temp1\n" + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode\n" + " LEFT JOIN set_backQty tt ON temp1.Sap编码 = tt.MaterialCode \n" + " AND temp1.订货看板编号 = tt.Code \n" + " ) UNION2"; - var _sql = string.Format(str,version, condition); + var _sql = string.Format(str, contion, condition); + + //发运数据中,查出看板号+物料号相同的重复数据 var sql2 = "SELECT\n" + " a.WmsBillNum,\n" + " t1.MaterialCode MaterialCode,\n" + @@ -735,19 +723,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " INNER JOIN ( SELECT MaterialCode, Kanban FROM Set_HQ_H_Kanban GROUP BY MaterialCode, Kanban HAVING COUNT(*)> 1 ) B ON A.Kanban = B.Kanban \n" + " AND A.MaterialCode = B.MaterialCode " + " left join Set_material t1 on a.MaterialCode=t1.CustomerPartCode "; - - - - - - - var listCompare = DbConnection.Query(sql2); - + //查询发运表中,看权号+物料号没有重复的数据 var sql3 = "SELECT\n" + " a.WmsBillNum,\n" + " t1.MaterialCode MaterialCode,\n" + @@ -762,14 +743,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "WHERE\n" + " B.Kanban IS NULL"; - - var listCompare1 = DbConnection.Query(sql3); - + //红旗结算数据中,看板号+物料号没有重复的 var sql10 = "SELECT DISTINCT\n" + " t1.* \n" + "FROM\n" + @@ -800,7 +779,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report - + //红旗结算数据中,看板号+物料号有重复的数据 var sql11 = "SELECT DISTINCT\n" + " t1.* \n" + "FROM\n" + @@ -825,8 +804,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "ORDER BY\n" + " t1.HQHKanBan,\n" + " t1.MaterialCode"; - - var list12 = DbConnection.Query(string.Format(sql11, version)); @@ -847,6 +824,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var list13 = DbConnection.Query(string.Format(sql12, version)); + //结算数据比较 List _lscopy = new List(); foreach (var itm in list11) @@ -873,6 +851,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } + //发运数据比较 List _ls = new List(); foreach (var itm in listCompare.ToList()) { @@ -933,8 +912,208 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } + /// + /// 原始红旗未结数据(不包括有发货有结算中发货大于结算的数据) + /// + /// + /// + /// + /// + /// + /// + /// + public virtual List GetOriginalSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup, string iscontionversion) + { + + List _list = new List(); + + string condition = " "; + + if (!string.IsNullOrEmpty(begin)) + { + condition += string.Format(" and a.LastModificationTime>='{0}' ", begin); + } + if (!string.IsNullOrEmpty(end)) + { + condition += string.Format(" and a.LastModificationTime<='{0}' ", end); + } + + string contion = string.Empty; + //选中,是否过滤掉当期结算数据 + if (iscontionversion == "0") + { + contion += string.Format(" WHERE Version <'{0}' ", version); + } + else + { + contion += " WHERE 1=1 "; + } + string str = "SELECT\n" + + " * \n" + + "FROM\n" + + " (\n" + + " SELECT\n" + + " temp1.交货时间,\n" + + " isnull( temp1.交货单号, '' ) 交货单号,\n" + + " temp1.收货仓库,\n" + + " temp1.收货仓库描述,\n" + + " temp1.订货看板编号,\n" + + " temp1.订货零件号,\n" + + " temp1.Sap编码,\n" + + " temp1.[客户物料号],\n" + + " temp1.物料组,\n" + + " temp1.零件中文名称,\n" + + " temp1.发货数量,\n" + + " temp1.发货状态,\n" + + " temp1.外部验收单号,\n" + + " temp1.结算数量,\n" + + " temp1.结算单价,\n" + + " temp1.结算金额,\n" + + " isnull( TEMP2.Price, 0 ) AS 发货定价,\n" + + " isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" + + " isnull( tt.Qty, 0 ) 退货数量,\n" + + " isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) AS 数量差异,\n" + + " temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" + + " ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * ( isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) ) AS 差异总金额 \n" + + " FROM\n" + + " (\n" + + " SELECT\n" + + " a.WmsBillNum AS 交货单号,\n" + + " CONVERT ( VARCHAR ( 100 ), a.LastModificationTime, 23 ) AS 交货时间 ,\n" + + " b.StorageLocation AS 收货仓库,\n" + + " b.StorageLocationDesc AS 收货仓库描述,\n" + + " a.Kanban AS 订货看板编号,\n" + + " b.MaterialCode AS 订货零件号,\n" + + " c.MaterialCode Sap编码,\n" + + " c.CustomerPartCode 客户物料号,\n" + + " c.MaterialDesc AS 零件中文名称,\n" + + " isnull( a.Qty, 0 ) AS 发货数量,\n" + + " isnull( a.State, 0 ) AS 发货状态,\n" + + " b.ExternalKanbanNumber AS 外部验收单号,\n" + + " isnull( b.Qty, 0 ) AS 结算数量,\n" + + " isnull( b.Price, 0 ) AS 结算单价,\n" + + " isnull( b.Amt, 0 ) AS 结算金额 ,\n" + + " C.EstimateTypeDesc AS 物料组 \n" + + " FROM\n" + + " Set_HQ_H_Kanban AS a\n" + + " LEFT OUTER JOIN (select * from Set_HQ_H_Platform {0}) AS b ON a.Kanban = b.HQHKanBan \n" + + " AND a.MaterialCode = b.MaterialCode\n" + + " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + + " WHERE\n" + + " b.HQHKanBan IS NULL \n" + + " AND b.MaterialCode IS NULL {1}\n" + + " ) AS temp1\n" + + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode\n" + + " LEFT JOIN set_backQty tt ON temp1.Sap编码 = tt.MaterialCode \n" + + " AND temp1.订货看板编号 = tt.Code \n" + + " ) UNION1 " ; + var _sql = string.Format(str, contion, condition); + + + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + _list = _query.ToList(); + + return _list; + + } + + /// + /// 有发货有结算数据且发货数量大于结算数量 + /// + /// + /// + /// + /// + /// + /// + /// + public virtual List GetInnerJoinSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup, string iscontionversion) + { + + List _list = new List(); + + string condition = " "; + + if (!string.IsNullOrEmpty(begin)) + { + condition += string.Format(" and a.LastModificationTime>='{0}' ", begin); + } + if (!string.IsNullOrEmpty(end)) + { + condition += string.Format(" and a.LastModificationTime<='{0}' ", end); + } + + string contion = string.Empty; + //选中,是否过滤掉当期结算数据 + if (iscontionversion == "0") + { + contion += string.Format(" WHERE Version <'{0}' ", version); + } + else + { + contion += " WHERE 1=1 "; + } + string str = "SELECT\n" + + " * \n" + + "FROM\n" + + " (\n" + + " SELECT\n" + + " temp1.交货时间,\n" + + " isnull( temp1.交货单号, '' ) 交货单号,\n" + + " temp1.订货看板编号,\n" + + " temp1.订货零件号,\n" + + " temp1.Sap编码,\n" + + " temp1.[客户物料号],\n" + + " temp1.物料组,\n" + + " temp1.零件中文名称,\n" + + " temp1.发货数量,\n" + + " temp1.外部验收单号,\n" + + " temp1.结算数量,\n" + + " temp1.结算单价,\n" + + " temp1.结算金额,\n" + + " isnull( TEMP2.Price, 0 ) AS 发货定价,\n" + + " isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" + + " isnull( tt.Qty, 0 ) 退货数量,\n" + + " isnull( temp1.发货数量, 0 ) - isnull( temp1.结算数量, 0 ) AS 数量差异,\n" + + " temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" + + " ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * ( isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) ) AS 差异总金额 \n" + + " FROM\n" + + " (\n" + + " SELECT\n" + + " a.WmsBillNum AS 交货单号,\n" + + " CONVERT ( VARCHAR ( 100 ), a.LastModificationTime, 23 ) AS 交货时间 ,\n" + + " a.Kanban AS 订货看板编号,\n" + + " b.MaterialCode AS 订货零件号,\n" + + " c.MaterialCode Sap编码,\n" + + " c.CustomerPartCode 客户物料号,\n" + + " c.MaterialDesc AS 零件中文名称,\n" + + " isnull( a.Qty, 0 ) AS 发货数量,\n" + + " '' AS 外部验收单号,\n" + + " isnull( b.Qty, 0 ) AS 结算数量,\n" + + " 0 AS 结算单价,\n" + + " 0 AS 结算金额 ,\n" + + " C.EstimateTypeDesc AS 物料组 \n" + + " FROM\n" + + " ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode, WmsBillNum, LastModificationTime FROM Set_HQ_H_Kanban GROUP BY kanban, MaterialCode, WmsBillNum, LastModificationTime ) AS a\n" + + " INNER JOIN ( SELECT SUM ( Qty ) Qty, HQHKanBan, MaterialCode FROM Set_HQ_H_Platform {0} GROUP BY HQHKanBan, MaterialCode ) AS b ON a.Kanban = b.HQHKanBan \n" + + " AND a.MaterialCode = b.MaterialCode\n" + + " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + + " WHERE\n" + + " a.Qty> b.Qty {1}\n" + + " ) AS temp1\n" + + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode\n" + + " LEFT JOIN set_backQty tt ON temp1.Sap编码 = tt.MaterialCode \n" + + " AND temp1.订货看板编号 = tt.Code \n" + + " ) UNION2"; + var _sql = string.Format(str, contion, condition); + + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + _list = _query.ToList(); + return _list; + + } public virtual List GetDiffQtyList(string version) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs index ad00f4a1..ba0eb0b0 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs @@ -60,53 +60,15 @@ namespace SettleAccount.Job.Services.Report - //有发货无结算,单独拿出去,财务要求 + //有发货无结算+有发货有结算中发货数量大于结算数量的数据-----组合 var _ls = _dapperRepository.GetReverseSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup, iscontionversion); + //原始正常的红旗未结数据(不包含有发货有结算中发货大于结算的数据,数量也未求和) + var _ls_original = _dapperRepository.GetOriginalSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup, iscontionversion); - - //if (!string.IsNullOrEmpty(kanban)) - //{ - // var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); - // if (_groupList.Count() > 0) - // { - // _ls = _ls.Where(p => _groupList.Contains(p.订货看板编号)).ToList(); - // } - //} - - //if (!string.IsNullOrEmpty(warehouseDesc)) - //{ - // var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList(); - // if (_groupList.Count() > 0) - // { - // _ls = _ls.Where(p => _groupList.Contains(p.收货仓库描述)).ToList(); - // } - //} - - //if (!string.IsNullOrEmpty(acceptNo)) - //{ - // var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList(); - // if (_groupList.Count() > 0) - // { - // _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList(); - // } - //} - //if (!string.IsNullOrEmpty(materialGroup)) - //{ - // var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - // if (_groupList.Count() > 0) - // { - // _ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList(); - // } - //} - //if (!string.IsNullOrEmpty(materialCode)) - //{ - // var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - // if (_groupList.Count() > 0) - // { - // _ls = _ls.Where(p => _groupList.Contains(p.发货零件号)).ToList(); - // } - //} + //有发货有结算,发货数量大于结算数量 + var _ls_innerjoin = _dapperRepository.GetInnerJoinSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup, iscontionversion); + if (!string.IsNullOrEmpty(sapCode)) { @@ -118,12 +80,14 @@ namespace SettleAccount.Job.Services.Report } - + ExcelExporter _exporter = new ExcelExporter();//导出Excel - var result = _exporter.Append(_ls.ToList(), "有发货无结算对比") - //.SeparateBySheet() - //.Append(_lsnoSettle.ToList(), "有结算无发货对比") + var result = _exporter.Append(_ls.ToList(), "有发货对比(无结算加指定条件结算)") + .SeparateBySheet() + .Append(_ls_original.ToList(), "原始红旗未结数据") + .SeparateBySheet() + .Append(_ls_innerjoin.ToList(), "有发货有结算(发货数量大于结算)") .ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true);