diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsDapperRepository.cs index 116c1313..38f9dc8d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsDapperRepository.cs @@ -38,6 +38,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public DateTime StartTime { set; get; } public DateTime EndTime { set; get; } + + public string PartDesc { set; get; } + public string PartGroup { set; get; } + + } @@ -69,15 +74,29 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public virtual List GetSalesStockSum(string locCode) + public virtual List GetSalesStockSum() { - string str = " select * from TM_PG_TIME_STOCK_DETAIL where LocCode ='{0}'"; - str=string.Format(str, locCode); + string str = + "SELECT A\n" + + " .*,\n" + + " B.PartDesc,\n" + + " B.PartGroup \n" + + "FROM\n" + + " TM_PG_TIME_STOCK_DETAIL\n" + + " A LEFT JOIN (\n" + + " SELECT DISTINCT\n" + + " [ PartCode ],\n" + + " ( ISNULL ( [ PartDesc1 ], '' ) + ISNULL ( [ PartDesc2 ], '' ) ) PartDesc,\n" + + " PartGroup \n" + + " FROM\n" + + " [ VIEW_PG_SIMPLE_PART ] \n" + + " ) B ON A.PartCode = B.PartCode"; var _list = DbConnection.Query(str); return _list.ToList(); + } //public virtual Dictionary GetSapList(List childList, string version, bool isNotHistoryPart = false) where T : ReportDetailBase, new() diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs index c8efff67..60dcef94 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs @@ -293,23 +293,26 @@ namespace SettleAccount.Job.Services.Report _ls.AddRange(GetHQKanbanSum(id, exportName, p_list)); _ls.AddRange(GetKanbanSum(id, exportName, p_list)); - - var _lst = _wmsDapper.GetSalesStockSum("PLJS"); - var query = from itm in _ls join itm1 in _lst on new { Version = itm.版本, PartCode = itm.物料号 } equals new { Version = itm1.Version, PartCode = itm1.PartCode } - into temp from tm in temp.DefaultIfEmpty() - select new UnSettledSum { - - 版本 = itm.版本, - 物料号 = itm.物料号, - 客户物料 = itm.客户物料, - 物料描述 = itm.物料描述, - 物料组车型 = itm.物料组车型, - SAS未结明细汇总 = itm.SAS未结明细汇总, - WMS期初库存 = tm == null ? "0" : tm.StartQty.ToString(), - WMS期末库存 = tm == null ? "0" : tm.EndQty.ToString(), - 库位 = tm == null ? "" : tm.LocCode, - 本月减少 = tm == null ? "" : tm.OutQty.ToString(), - 本月增加 = tm == null ? "" : tm.InQty.ToString(), + + var _lst = _wmsDapper.GetSalesStockSum(); + var query = from itm in _lst + join itm1 in _ls + on new { Version = itm.Version, PartCode = itm.PartCode } equals new { Version = itm1.版本, PartCode = itm1.物料号 } +into temp + from tm in temp.DefaultIfEmpty() + select new UnSettledSum + { + + 版本 = itm.Version, + 物料号 = itm.PartCode, + 物料描述 = itm.PartDesc, + 物料组车型 = itm.PartGroup, + SAS未结明细汇总 = tm == null ? "0" : tm.SAS未结明细汇总, + WMS期初库存 = itm.StartQty.ToString(), + WMS期末库存 = itm.EndQty.ToString(), + 库位 = itm.LocCode, + 本月减少 = itm.OutQty.ToString(), + 本月增加 = itm.InQty.ToString(), };