generated from wenjy/SlnMesnac
新增获取等待任务逻辑
parent
d66333989c
commit
63b59cca10
@ -0,0 +1,26 @@
|
||||
using SlnMesnac.Model.domain;
|
||||
using SlnMesnac.Repository.service.@base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SlnMesnac.Repository.service
|
||||
{
|
||||
public interface IAGVStateService: IBaseService<AGVState>
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询AGV状态
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<AGVState> GetAgvState();
|
||||
|
||||
/// <summary>
|
||||
/// 更新AGV设备状态信息
|
||||
/// </summary>
|
||||
/// <param name="record"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> UpdateAsync(AGVState record);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using SlnMesnac.Common;
|
||||
using SlnMesnac.Model.domain;
|
||||
using SlnMesnac.Repository.service.@base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SlnMesnac.Repository.service.Impl
|
||||
{
|
||||
public class AGVStateServiceImpl : BaseServiceImpl<AGVState>, IAGVStateService
|
||||
{
|
||||
private ILogger<AGVStateServiceImpl> _logger;
|
||||
public AGVStateServiceImpl(Repository<AGVState> repository, ILogger<AGVStateServiceImpl> logger) :base(repository)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
public List<AGVState> GetAgvState()
|
||||
{
|
||||
List<AGVState> agvStateInfoList = null;
|
||||
try
|
||||
{
|
||||
Expression<Func<AGVState, bool>> exp = x => true;
|
||||
exp = exp.And(x => x.agvno != "" && (x.taskno == null || x.taskno == "") && x.agvworkstate == "任务空闲");
|
||||
|
||||
agvStateInfoList = base._rep.GetList(exp);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError($"通过物料类型获取物料信息异常:{ex.Message}");
|
||||
}
|
||||
return agvStateInfoList;
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateAsync(AGVState record)
|
||||
{
|
||||
bool result = await _rep.UpdateAsync(record);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue