using PadApplication.DB;
using PadApplication.Entites.DbModels;
using PadApplication.Entites.Dto;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;
using SqlSugar;
namespace PadApplication.Services;
///
/// 工单状态管理类,负责工单状态相关的数据操作
/// 继承自Repository基类,包含基础的CRUD操作
///
public class MesCutterLedgerManager : Repository
{
private readonly MesQaItemsDetect02Manager
mesQaItemsDetect02Manager = new();
///
/// 刀具查询(支持编号或名称模糊查询)
///
/// 查询关键字
/// 页码
/// 每页大小
/// 刀具查询结果
public MesCutterLedger QueryTools(string searchKey, int pageIndex, int pageSize)
{
var query = Db.Queryable()
.WhereIF(!string.IsNullOrEmpty(searchKey),
t => t.CutterId.Contains(searchKey) || t.CutterName.Contains(searchKey));
var total = query.Count();
var tbBillList = query
.OrderBy(t => t.CutterId)
.Skip((pageIndex - 1) * pageSize)
.Take(pageSize)
.ToList();
return new MesCutterLedger
{
tbBillList = tbBillList,
total = total
};
}
}