1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using SqlSugar;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using WMS.Core.APPBLL;
- using WMS.Info;
- using WMS.Util;
- namespace WMS.Core.ServiceCore
- {
- public class FxWcsLogCore
- {
- /// <summary>
- /// 获取分页数据
- /// <summary>
- /// <returns></returns>
- public IEnumerable<dynamic> GetTaskPageList(Pagination pagination, string queryJson)
- {
- SqlSugarClient client = null;
- try
- {
- client = SysDbCore.GetDbCtx();
- int count = 0;
- var queryParam = queryJson.ToJObject();
- var db = client.Queryable<WCS_LOG>();
- //单据日期
- if (!queryParam["Btime"].IsEmpty() && !queryParam["Etime"].IsEmpty())
- {
- db.Where(ord => ord.LOG_ADDDATETIME >= queryParam["Btime"].ToDate() && ord.LOG_ADDDATETIME <= queryParam["Etime"].ToDate());
- }
- if (!queryParam["keyword"].IsEmpty())
- {
- string kw = queryParam["keyword"].ToString();
- db.Where(ord => ord.LOG_INFO == kw);
- }
- if (pagination.sord.ToUpper() != "ASC")
- {
- pagination.sidx = pagination.sidx + " DESC";
- }
- if(pagination.sidx.Contains("LOG_ADDDATETIME"))
- pagination.sidx = pagination.sidx + " DESC";
- var list = db.OrderBy(pagination.sidx).Select<dynamic>(@"
- [ID],
- [LOG_WCSSYSTEM],
- [LOG_LEVEL],
- [LOG_FUNC],
- [LOG_IPADDERSS],
- [LOG_INFO],
- [LOG_INFODTL],
- [LOG_ADDUSERNO],
- [LOG_ADDDATETIME],
- [LOG_EDITUSERNO],
- [LOG_EDITDATETIME],
- [LOG_NOTES],
- [EDIT_TIMES]").ToPageList(pagination.page, pagination.rows, ref count);
- pagination.records = count;
- return list;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- finally
- {
- client.Dispose();
- }
- }
-
- }
- }
|