89 lines
2.7 KiB
C#
89 lines
2.7 KiB
C#
|
|
using Infrastructure.Attribute;
|
||
|
|
using SqlSugar;
|
||
|
|
using ZR.Model;
|
||
|
|
using ZR.Model.dc;
|
||
|
|
using ZR.Model.Dto;
|
||
|
|
using ZR.Repository;
|
||
|
|
using ZR.Service.MES.dc.IService;
|
||
|
|
|
||
|
|
namespace ZR.Service.Business
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Service业务层处理
|
||
|
|
/// </summary>
|
||
|
|
[AppService(ServiceType = typeof(IDeviceUploadDataService), ServiceLifetime = LifeTime.Transient)]
|
||
|
|
public class DeviceUploadDataService : BaseService<DeviceUploadData>, IDeviceUploadDataService
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 查询列表
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="parm"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public PagedInfo<DeviceUploadDataDto> GetList(DeviceUploadDataQueryDto parm)
|
||
|
|
{
|
||
|
|
var predicate = Expressionable.Create<DeviceUploadData>();
|
||
|
|
|
||
|
|
var response = Queryable()
|
||
|
|
.Where(predicate.ToExpression())
|
||
|
|
.ToPage<DeviceUploadData, DeviceUploadDataDto>(parm);
|
||
|
|
|
||
|
|
return response;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 获取详情
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="Id"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public DeviceUploadData GetInfo(long Id)
|
||
|
|
{
|
||
|
|
var response = Queryable()
|
||
|
|
.Where(x => x.Id == Id)
|
||
|
|
.First();
|
||
|
|
|
||
|
|
return response;
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 添加
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="model"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public DeviceUploadData AddDeviceUploadData(DeviceUploadData model)
|
||
|
|
{
|
||
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 修改
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="model"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public int UpdateDeviceUploadData(DeviceUploadData model)
|
||
|
|
{
|
||
|
|
//var response = Update(w => w.Id == model.Id, it => new DeviceUploadData()
|
||
|
|
//{
|
||
|
|
// FactoryCode = model.FactoryCode,
|
||
|
|
// WorkshopCode = model.WorkshopCode,
|
||
|
|
// LineCode = model.LineCode,
|
||
|
|
// DeviceCode = model.DeviceCode,
|
||
|
|
// DictCode = model.DictCode,
|
||
|
|
// Remark = model.Remark,
|
||
|
|
// Value01 = model.Value01,
|
||
|
|
// Value02 = model.Value02,
|
||
|
|
// Value03 = model.Value03,
|
||
|
|
// Value04 = model.Value04,
|
||
|
|
// Value05 = model.Value05,
|
||
|
|
// Value06 = model.Value06,
|
||
|
|
// Value07 = model.Value07,
|
||
|
|
// Value08 = model.Value08,
|
||
|
|
// Value09 = model.Value09,
|
||
|
|
// Value10 = model.Value10,
|
||
|
|
//});
|
||
|
|
//return response;
|
||
|
|
return Update(model, true);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|