设备管理
This commit is contained in:
85
ZR.Service/mes/Device/DeviceFormConfigService.cs
Normal file
85
ZR.Service/mes/Device/DeviceFormConfigService.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
|
||||
using ZR.Repository;
|
||||
|
||||
using System.Linq;
|
||||
using ZR.Model.MES.dev;
|
||||
using ZR.Model.MES.dev.Dto;
|
||||
using ZR.Service.MES.dev.IService;
|
||||
|
||||
namespace ZR.Service.MES.dev
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检查项表单配置表Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IDeviceFormConfigService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class DeviceFormConfigService : BaseService<DeviceFormConfig>, IDeviceFormConfigService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询设备检查项表单配置表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<DeviceFormConfigDto> GetList(DeviceFormConfigQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<DeviceFormConfig>().And(it => it.FkDeviceInspectId == parm.FkDeviceInspectId);
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<DeviceFormConfig, DeviceFormConfigDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public DeviceFormConfig GetInfo(string Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加设备检查项表单配置表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public DeviceFormConfig AddDeviceFormConfig(DeviceFormConfig model)
|
||||
{
|
||||
model.Id= SnowFlakeSingle.Instance.NextId().ToString();
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改设备检查项表单配置表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateDeviceFormConfig(DeviceFormConfig model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new DeviceFormConfig()
|
||||
//{
|
||||
// Type = model.Type,
|
||||
// Content = model.Content,
|
||||
// CreatedBy = model.CreatedBy,
|
||||
// CreatedTime = model.CreatedTime,
|
||||
// UpdatedBy = model.UpdatedBy,
|
||||
// UpdatedTime = model.UpdatedTime,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user