工作单元关系确认
This commit is contained in:
20
ZR.Service/mes/md/IService/IMdWorklineService.cs
Normal file
20
ZR.Service/mes/md/IService/IMdWorklineService.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.mes.md;
|
||||
|
||||
namespace ZR.Service.MES.md.IService
|
||||
{
|
||||
|
||||
public interface IMdWorklineService
|
||||
{
|
||||
int AddWorkline(MdWorkline workline);
|
||||
|
||||
public (int, List<MdWorkline>) GetAll(string lineCode, string lineName, int pageNum, int pageSize);
|
||||
public int UpdateWorkline(MdWorkline workline);
|
||||
|
||||
public int deleteWorkline(int[] ids);
|
||||
}
|
||||
}
|
||||
44
ZR.Service/mes/md/MdWorklineService.cs
Normal file
44
ZR.Service/mes/md/MdWorklineService.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.mes.md;
|
||||
using ZR.Service.mes.md.IService;
|
||||
using ZR.Service.MES.md.IService;
|
||||
|
||||
namespace ZR.Service.MES.md
|
||||
{
|
||||
[AppService(ServiceType = typeof(IMdWorklineService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class MdWorklineService : BaseService<MdWorkline>, IMdWorklineService
|
||||
{
|
||||
int IMdWorklineService.AddWorkline(MdWorkline workline)
|
||||
{
|
||||
return Insert(workline);
|
||||
}
|
||||
|
||||
int IMdWorklineService.deleteWorkline(int[] ids)
|
||||
{
|
||||
return Delete(ids);
|
||||
}
|
||||
|
||||
(int, List<MdWorkline>) IMdWorklineService.GetAll(string lineCode, string lineName, int pageNum, int pageSize)
|
||||
{
|
||||
int totalNum = 0;
|
||||
var predicate = Expressionable.Create<MdWorkline>()
|
||||
.AndIF(!string.IsNullOrEmpty(lineCode), it => it.LineCode.Contains(lineCode))
|
||||
.AndIF(!string.IsNullOrEmpty(lineName), it => it.LineName.Contains(lineName))
|
||||
.ToExpression();
|
||||
List<MdWorkline> data = Context.Queryable<MdWorkline>().Where(predicate).ToPageList(pageNum, pageSize, ref totalNum);
|
||||
return (totalNum, data);
|
||||
}
|
||||
|
||||
int IMdWorklineService.UpdateWorkline(MdWorkline workline)
|
||||
{
|
||||
return Update(workline, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user