57 lines
1.9 KiB
C#
57 lines
1.9 KiB
C#
using System;
|
|
using SqlSugar;
|
|
using Infrastructure.Attribute;
|
|
using Infrastructure.Extensions;
|
|
using ZR.Model;
|
|
|
|
using ZR.Repository;
|
|
using ZR.Service.Business.IBusinessService;
|
|
using System.Linq;
|
|
using ZR.Model.MES.wms;
|
|
using ZR.Model.MES.wms.Dto;
|
|
using ZR.Service.mes.wms.IService;
|
|
using ZR.Model.MES.pro;
|
|
using Mapster;
|
|
|
|
namespace ZR.Service.Business
|
|
{
|
|
/// <summary>
|
|
/// 盘点记录Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IWmAGVService), ServiceLifetime = LifeTime.Transient)]
|
|
public class WmAGVService : BaseService<AgvTask>, IWmAGVService
|
|
{
|
|
/// <summary>
|
|
/// 1.获取工单列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public List<AGVWorkorderDto> GetList(QueryAGVparam param)
|
|
{
|
|
List<AGVWorkorderDto> aGVWorkorderDtos = new List<AGVWorkorderDto>();
|
|
var predicate = Expressionable.Create<ProWorkorder_v2>()
|
|
.AndIF(param.year > 0, it => it.Year == param.year)
|
|
.AndIF(param.week > 0, it => it.Week == param.week)
|
|
.AndIF(param.day > 0, it => it.Date == param.day);
|
|
|
|
var response = Context.Queryable<ProWorkorder_v2>()
|
|
.Where(predicate.ToExpression()).ToList();
|
|
foreach (var item in response)
|
|
{
|
|
aGVWorkorderDtos.Add(item.Adapt<AGVWorkorderDto>());
|
|
}
|
|
return aGVWorkorderDtos;
|
|
}
|
|
/// <summary>
|
|
/// 2.获取当前工单下的所有AGV小车任务
|
|
/// </summary>
|
|
/// <param name="workorder_id"></param>
|
|
/// <returns></returns>
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
public List<AgvTask> QueryAGVTask(string workorder_id)
|
|
{
|
|
return Context.Queryable<AgvTask>().Where(it => it.FkWorkorderId == workorder_id).OrderByDescending(it=>it.Sort).ToList();
|
|
}
|
|
}
|
|
}
|