diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index aaf7aef6..c9374e59 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -164,15 +164,9 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var result = await _exportImporter.UploadExcelImport(files, _excelImportService); - var list=result.Where(p => p.Type == 20).ToList(); - - - - - - var entityList = ObjectMapper.Map, List>(result); - var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); + var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); + foreach (var itm in _ls) { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs index 20c14eae..d8782102 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -165,7 +165,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var result = await _exportImporter.UploadExcelImport(files, _excelImportService); var entityList = ObjectMapper.Map, List>(result); - var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); + var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); foreach (var itm in _ls) { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs index 72806b30..0ac4dec9 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs @@ -78,7 +78,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var pricelist = GetPriceList(version); - //var LeftJoin = from emp in ListOfEmployees // join dept in ListOfDepartment // on emp.DeptID equals dept.ID into JoinedEmpDept diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs index 043c1e72..973cd208 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs @@ -32,10 +32,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string condition = " where 1=1 "; - if (!string.IsNullOrEmpty(materialCode)) - { - condition += string.Format(" d.MaterialCode='{0}' ", materialCode); - } + //if (!string.IsNullOrEmpty(materialCode)) + //{ + // condition += string.Format(" d.MaterialCode='{0}' ", materialCode); + //} if (!string.IsNullOrEmpty(begin)) { condition += string.Format(" a.BeginTime>='{0}' ", begin); @@ -52,14 +52,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { condition += string.Format(" B.cp7Time<='{0}' ", cp7end); } - if (!string.IsNullOrEmpty(kennCode)) - { - condition += string.Format(" B.kenncode='{0}' ", kennCode); - } - if (!string.IsNullOrEmpty(chassisNumber)) - { - condition += string.Format(" B.chassisNumber='{0}' ", chassisNumber); - } + //if (!string.IsNullOrEmpty(kennCode)) + //{ + // condition += string.Format(" B.kenncode='{0}' ", kennCode); + //} + //if (!string.IsNullOrEmpty(chassisNumber)) + //{ + // condition += string.Format(" B.chassisNumber='{0}' ", chassisNumber); + //} string str = "SELECT\n" + @@ -88,11 +88,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " c.InvoicePrice,\n" + " Round( c.InvoicePrice * a.qty,2 ) InvoiceAmt,\n" + " Round( c.InvoicePrice * a.Qty,2 ) SettleAmt,\n" + -" a.Qty - IsNull( B.Qty, 0 ) DiffSettleFisQty,\n" + +" 0 DiffSettleFisQty,\n" + " 0 DiffSettleInvQty,\n" + " a.Qty InvoiceQty \n" + " FROM\n" + -" ( SELECT * FROM set_settle WHERE version = '202110' ) a\n" + +" ( SELECT * FROM set_settle WHERE version = '{0}' ) a\n" + " LEFT JOIN Set_fis b ON a.ChassisNumber = b.ChassisNumber2 \n" + " AND a.KENNCode = b.KENNCode \n" + " AND a.MaterialCode = b.ItemCode\n" +