You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8 KiB
C#

using Admin.Core.IRepository;
using Admin.Core.Service;
using Admin.Core.IService;
using Admin.Core.Model;
using System.Threading.Tasks;
using System.Collections.Generic;
using Admin.Core.Model.ViewModels;
namespace Admin.Core.Service
{
public class XlPlanServices : BaseServices<xl_plan>, IXlPlanServices
{
private readonly IBaseRepository<xl_plan> _dal;
private readonly Ixl_planRepository _planRepository;//小料计划
public XlPlanServices(IBaseRepository<xl_plan> dal, Ixl_planRepository planRepository)
{
this._dal = dal;
base.BaseDal = dal;
_planRepository = planRepository;
}
#region 获取小料所有计划
/// <summary>
/// 获取小料所有计划
/// </summary>
/// <returns></returns>
public async Task<List<AllXlPlanView>> GetAllXlPlanInfo()
{
List<AllXlPlanView> list = new List<AllXlPlanView>();
var plan = await _planRepository.QueryAsync();
plan.ForEach(x =>
{
AllXlPlanView view = new AllXlPlanView();
view.Plan_Id = x.Plan_Id;
view.Plan_Num = x.Plan_Num;
view.Real_Num = x.Real_Num;
view.Plan_Serial = x.Plan_Serial;
view.Plan_Date = x.Plan_Date;
view.Plan_State = x.Plan_State;
view.Plan_StateText = x.Plan_StateText;
view.Plan_TotalError = x.Plan_TotalError;
view.Plan_TotalWeight = x.Plan_TotalWeight;
view.Recipe_Code = x.Recipe_Code;
view.Recipe_Name = x.Recipe_Name;
list.Add(view);
});
return list;
}
#endregion
}
}