| | |
| | | res.Data = pageList; |
| | | return res; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取所有条码,原厂条码和客户条码在同一行,按条件 |
| | | /// </summary> |
| | | /// <param name="where"></param> |
| | | /// <returns></returns> |
| | | public async Task<ApiAction<List<SNData_His>>> GetAllSNDataHis(SNDataWhere where) |
| | | { |
| | | var res = new ApiAction<List<SNData_His>>(); |
| | | List<SNData_His> list = new List<SNData_His>(); |
| | | try |
| | | { |
| | | DateTime StartTime = DateTime.Now; |
| | | DateTime EndTime = DateTime.Now; |
| | | string[] strTime = where.strStartEnd?.Split(','); |
| | | if (!string.IsNullOrEmpty(where.strStartEnd)) { StartTime = Convert.ToDateTime(strTime[0].ToString()); EndTime = strTime.Length == 2 ? Convert.ToDateTime(strTime[1].ToString()) : DateTime.MinValue; } |
| | | RefAsync<int> total = 0; |
| | | list = await Db.Queryable<SNData_His>() |
| | | .WhereIF(!string.IsNullOrEmpty(where.strStartEnd), x => Convert.ToDateTime(x.ScanTime) > StartTime) |
| | | .WhereIF(!string.IsNullOrEmpty(where.strStartEnd) && strTime.Length == 2, x => Convert.ToDateTime(x.ScanTime) < EndTime) |
| | | .WhereIF(!string.IsNullOrEmpty(where.model), x => x.ModelCode == where.model) |
| | | .WhereIF(!string.IsNullOrEmpty(where.customerCode), x => x.CustomerCode.Equals(where.customerCode)) |
| | | .ToListAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | res.CatchExceptionWithLog(ex, "查询异常"); |
| | | } |
| | | res.Data = list; |
| | | return res; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取所有条码,原厂条码和客户条码分开两行,按条件 |
| | | /// </summary> |
| | | /// <param name="where"></param> |
| | | /// <returns></returns> |
| | | public async Task<ApiAction<List<SNData>>> GetAllSNData(SNDataWhere where) |
| | | { |
| | | var res = new ApiAction<List<SNData>>(); |
| | | List<SNData> list = new List<SNData>(); |
| | | try |
| | | { |
| | | DateTime StartTime = DateTime.Now; |
| | | DateTime EndTime = DateTime.Now; |
| | | string[] strTime = where.strStartEnd?.Split(','); |
| | | if (!string.IsNullOrEmpty(where.strStartEnd)) { StartTime = Convert.ToDateTime(strTime[0].ToString()); EndTime = strTime.Length == 2 ? Convert.ToDateTime(strTime[1].ToString()) : DateTime.MinValue; } |
| | | RefAsync<int> total = 0; |
| | | list = await Db.Queryable<SNData>() |
| | | .WhereIF(!string.IsNullOrEmpty(where.strStartEnd), x => Convert.ToDateTime(x.CREATE_TIME) > StartTime) |
| | | .WhereIF(!string.IsNullOrEmpty(where.strStartEnd) && strTime.Length == 2, x => Convert.ToDateTime(x.CREATE_TIME) < EndTime) |
| | | .WhereIF(!string.IsNullOrEmpty(where.model), x => x.ItemCode == where.model) |
| | | .WhereIF(!string.IsNullOrEmpty(where.customerCode), x => x.CustomerCode.Equals(where.customerCode)) |
| | | .ToListAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | res.CatchExceptionWithLog(ex, "查询异常"); |
| | | } |
| | | res.Data = list; |
| | | return res; |
| | | } |
| | | } |
| | | } |
| | | } |