昨天
This commit is contained in:
19
ZR.Service/mes/md/IService/IMdDeviceService.cs
Normal file
19
ZR.Service/mes/md/IService/IMdDeviceService.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
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 IMdDeviceService
|
||||
{
|
||||
int AddDevice(MdDevice device);
|
||||
|
||||
public (int, List<MdDevice>) GetAll(string deviceCode, string deviceName, int pageNum, int pageSize);
|
||||
public int UpdateDevice(MdDevice workshop);
|
||||
|
||||
public int deleteDevice(int[] ids);
|
||||
}
|
||||
}
|
||||
19
ZR.Service/mes/md/IService/IMdWorkstationService.cs
Normal file
19
ZR.Service/mes/md/IService/IMdWorkstationService.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
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 IMdWorkstationService
|
||||
{
|
||||
int AddWorkshop(MdWorkstation workshop);
|
||||
|
||||
public (int, List<MdWorkstation>) GetAll(string StationCode, string StationName, int pageNum, int pageSize);
|
||||
public int UpdateWorkshop(MdWorkstation workshop);
|
||||
|
||||
public int deleteWorkshop(int[] ids);
|
||||
}
|
||||
}
|
||||
49
ZR.Service/mes/md/MdDeviceService.cs
Normal file
49
ZR.Service/mes/md/MdDeviceService.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Infrastructure.Attribute;
|
||||
using JinianNet.JNTemplate;
|
||||
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;
|
||||
|
||||
namespace ZR.Service.mes.md
|
||||
{
|
||||
[AppService(ServiceType = typeof(IMdDeviceService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class MdDeviceService :BaseService<MdDevice>, IMdDeviceService
|
||||
{
|
||||
public int AddDevice(MdDevice workshop)
|
||||
{
|
||||
|
||||
return Insert(workshop);
|
||||
}
|
||||
|
||||
public int deleteDevice(int[] ids)
|
||||
{
|
||||
return Delete(ids);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public (int, List<MdDevice>) GetAll(string deviceCode, string deviceName, int pageNum, int pageSize)
|
||||
{
|
||||
int totalNum = 0;
|
||||
var predicate = Expressionable.Create<MdDevice>()
|
||||
.AndIF(!string.IsNullOrEmpty(deviceCode), it => it.DeviceCode.Contains(deviceCode))
|
||||
.AndIF(!string.IsNullOrEmpty(deviceName), it => it.DeviceName.Contains(deviceName))
|
||||
.ToExpression();
|
||||
List<MdDevice> data = Context.Queryable<MdDevice>().Where(predicate).ToPageList(pageNum, pageSize, ref totalNum);
|
||||
return (totalNum, data);
|
||||
}
|
||||
|
||||
public int UpdateDevice(MdDevice workshop)
|
||||
{
|
||||
return Update(workshop, true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
47
ZR.Service/mes/md/MdWorkstationService.cs
Normal file
47
ZR.Service/mes/md/MdWorkstationService.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
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;
|
||||
|
||||
namespace ZR.Service.mes.md
|
||||
{
|
||||
[AppService(ServiceType = typeof(IMdWorkstationService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class MdWorkstationService : BaseService<MdWorkstation>, IMdWorkstationService
|
||||
{
|
||||
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();
|
||||
List<MdWorkstation> data = Context.Queryable<MdWorkstation>().Where(predicate).ToPageList(pageNum, pageSize, ref totalNum);
|
||||
return (totalNum, data);
|
||||
}
|
||||
|
||||
public int UpdateWorkshop(MdWorkstation workshop)
|
||||
{
|
||||
return Update(workshop, true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user