物料管理
This commit is contained in:
24
ZR.Service/mes/mm/IService/IMmAgvLocationService.cs
Normal file
24
ZR.Service/mes/mm/IService/IMmAgvLocationService.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.MES.mm;
|
||||
|
||||
namespace ZR.Service.mes.mm.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// agv位置表service接口
|
||||
/// </summary>
|
||||
public interface IMmAgvLocationService : IBaseService<MmAgvLocation>
|
||||
{
|
||||
PagedInfo<MmAgvLocationDto> GetList(MmAgvLocationQueryDto parm);
|
||||
|
||||
MmAgvLocation GetInfo(int Id);
|
||||
|
||||
MmAgvLocation AddMmAgvLocation(MmAgvLocation parm);
|
||||
|
||||
int UpdateMmAgvLocation(MmAgvLocation parm);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
namespace ZR.Service.mes.mm
|
||||
{
|
||||
[AppService(ServiceType = typeof(IMaterialInputService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class MaterialInputService : BaseService<AgvLocation>, IMaterialInputService
|
||||
public class MaterialInputService : BaseService<MmAgvLocation>, IMaterialInputService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取AGV上料起点
|
||||
@@ -26,7 +26,7 @@ namespace ZR.Service.mes.mm
|
||||
/// <returns></returns>
|
||||
public string[] Getstart_AGV_points()
|
||||
{
|
||||
List<AgvLocation> positions = Context.Queryable<AgvLocation>()
|
||||
List<MmAgvLocation> positions = Context.Queryable<MmAgvLocation>()
|
||||
.Where(it => it.AreaCode == 2)
|
||||
.Where(it => it.Type == 0)
|
||||
.ToList();
|
||||
@@ -44,7 +44,7 @@ namespace ZR.Service.mes.mm
|
||||
/// <returns></returns>
|
||||
public string[] Getend_AGV_points()
|
||||
{
|
||||
List<AgvLocation> positions = Context.Queryable<AgvLocation>()
|
||||
List<MmAgvLocation> positions = Context.Queryable<MmAgvLocation>()
|
||||
.Where(it => it.AreaCode == 2)
|
||||
.Where(it => it.Type == 1)
|
||||
.ToList();
|
||||
|
||||
87
ZR.Service/mes/mm/MmAgvLocationService.cs
Normal file
87
ZR.Service/mes/mm/MmAgvLocationService.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
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.mm;
|
||||
using ZR.Service.mes.mm.IService;
|
||||
|
||||
namespace ZR.Service.Business
|
||||
{
|
||||
/// <summary>
|
||||
/// agv位置表Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IMmAgvLocationService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class MmAgvLocationService : BaseService<MmAgvLocation>, IMmAgvLocationService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询agv位置表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<MmAgvLocationDto> GetList(MmAgvLocationQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<MmAgvLocation>();
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<MmAgvLocation, MmAgvLocationDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public MmAgvLocation GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加agv位置表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public MmAgvLocation AddMmAgvLocation(MmAgvLocation model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改agv位置表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateMmAgvLocation(MmAgvLocation model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new MmAgvLocation()
|
||||
//{
|
||||
// AreaCode = model.AreaCode,
|
||||
// Area = model.Area,
|
||||
// Type = model.Type,
|
||||
// Coordinate = model.Coordinate,
|
||||
// Status = model.Status,
|
||||
// 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