Files
shgx_tz_mes_backend_sync/ZR.Service/mes/md/MdWorkstationService.cs

46 lines
1.4 KiB
C#
Raw Normal View History

2023-08-16 09:51:28 +08:00
using Infrastructure.Attribute;
using SqlSugar;
using ZR.Model.mes.md;
using ZR.Service.mes.md.IService;
namespace ZR.Service.mes.md
{
[AppService(ServiceType = typeof(IMdWorkstationService), ServiceLifetime = LifeTime.Transient)]
2024-06-07 11:04:26 +08:00
public class MdWorkstationService : BaseService<MdWorkstation>, IMdWorkstationService
2023-08-16 09:51:28 +08:00
{
public int AddWorkshop(MdWorkstation workshop)
{
return Add(workshop);
}
public int deleteWorkshop(int[] ids)
{
return Delete(ids);
}
public (int, List<MdWorkstation>) GetAll(string StationCode, string StationName, int pageNum, int pageSize)
{
int totalNum = 0;
var predicate = Expressionable.Create<MdWorkstation>()
.AndIF(!string.IsNullOrEmpty(StationCode), it => it.StationCode.Contains(StationCode))
.AndIF(!string.IsNullOrEmpty(StationName), it => it.StationName.Contains(StationName))
.ToExpression();
2023-09-08 13:10:26 +08:00
List<MdWorkstation> data = Context.Queryable<MdWorkstation>().Includes(x => x.Workline).Where(predicate).ToPageList(pageNum, pageSize, ref totalNum);
2023-08-16 09:51:28 +08:00
return (totalNum, data);
}
2023-09-08 13:10:26 +08:00
2023-08-16 09:51:28 +08:00
public int UpdateWorkshop(MdWorkstation workshop)
{
return Update(workshop, true);
}
2023-09-08 13:10:26 +08:00
public List<MdWorkline> GetworkLineList()
{
return Context.Queryable<MdWorkline>().ToList();
}
2023-08-16 09:51:28 +08:00
}
}