diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/AlreadyPrintAppService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/AlreadyPrintAppService.cs index ef125a7..2a0e6df 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/AlreadyPrintAppService.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/AlreadyPrintAppService.cs @@ -42,7 +42,7 @@ namespace WY.NewJit.PrintTable return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "."; } } - private ILogger _logger; + private ILogger _logger; private readonly NewJitDapperRepository _newJitDapperRepository; /// @@ -50,7 +50,7 @@ namespace WY.NewJit.PrintTable /// private readonly IBlobContainer _blobContainer; - public AlreadyPrintAppService(ILogger logger, + public AlreadyPrintAppService(ILogger logger, NewJitDapperRepository newJitDapperRepository, IBlobContainer blobContainer ) @@ -59,41 +59,11 @@ namespace WY.NewJit.PrintTable _newJitDapperRepository = newJitDapperRepository; _blobContainer = blobContainer; } - /// - /// 已打印列表 - /// - /// 输入查询条件 - /// 返回符合条件的排序分页列表 - [HttpGet] - [UnitOfWork(false)] - [Route("list")] - public virtual async Task> GetAlreadyPrintListAsync(QueryAlreadyPrintDto input) - { - _logger.LogDebug(_errorMessagePrefix + "GetAlreadyPrintListAsync 进入"); - try - { - PagedResultDto ret = new PagedResultDto(); - string where = GetWhere(input); - ret.TotalCount = await GetEntityCountAsync("FisAlreadyPrint", where); - //计算分页 - int skipNum = input.SkipCount; - int takeNum = input.MaxResultCount; - var lst = await GetEntityListFromToAsync("FisAlreadyPrint", where, "HostSN2", skipNum, takeNum); - ret.Items = lst; - return ret; - } - catch (Exception ex) - { - string errMsg = _errorMessagePrefix + "GetAlreadyPrintListAsync 执行出错:" + ex.Message; - _logger.LogError(errMsg); - return new PagedResultDto(0, new List()); - } - } - + #region 私有方法 private static string GetWhere(QueryAlreadyPrintDto input) { - //select * from FisWaitPrint + //select * from FisAlreadyPrint //where 1=1 and BusinessType = 1 and ProductLine = '01' and PrintType = 1 and HostSN >= 10377 and HostSN <= 10388 //order by HostSN2 string where = ""; @@ -164,7 +134,6 @@ namespace WY.NewJit.PrintTable return where; } - /// /// 取单表记录总数 /// @@ -180,12 +149,45 @@ namespace WY.NewJit.PrintTable var ret = await _newJitDapperRepository.GetSingleBySqlAsync(sql); return ret; } + private async Task> GetEntityListFromToAsync(string tableName, string where, string orderFieldName, int skipNum, int takeNum) { string sql = $"select * from {tableName} where 1=1 {where} order by {orderFieldName} offset {skipNum} rows fetch next {takeNum} rows only"; var ret = await _newJitDapperRepository.GetListBySqlAsync(sql); return ret; } + #endregion + + /// + /// 已打印列表 + /// + /// 输入查询条件 + /// 返回符合条件的排序分页列表 + [HttpGet] + [UnitOfWork(false)] + [Route("list")] + public virtual async Task> GetAlreadyPrintListAsync(QueryAlreadyPrintDto input) + { + _logger.LogDebug(_errorMessagePrefix + "GetAlreadyPrintListAsync 进入"); + try + { + PagedResultDto ret = new PagedResultDto(); + string where = GetWhere(input); + ret.TotalCount = await GetEntityCountAsync("FisAlreadyPrint", where); + //计算分页 + int skipNum = input.SkipCount; + int takeNum = input.MaxResultCount; + var lst = await GetEntityListFromToAsync("FisAlreadyPrint", where, "HostSN2", skipNum, takeNum); + ret.Items = lst; + return ret; + } + catch (Exception ex) + { + string errMsg = _errorMessagePrefix + "GetAlreadyPrintListAsync 执行出错:" + ex.Message; + _logger.LogError(errMsg); + return new PagedResultDto(0, new List()); + } + } /// /// 导出信息 diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml index 1eb9ef7..ce9a8c9 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml @@ -1868,13 +1868,6 @@ BLOB存储 - - - 已打印列表 - - 输入查询条件 - 返回符合条件的排序分页列表 - 取单表记录总数 @@ -1886,6 +1879,13 @@ + + + 已打印列表 + + 输入查询条件 + 返回符合条件的排序分页列表 + 导出信息