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; using System.Linq.Expressions; using System.Text; namespace SlnMesnac.Repository.service.Impl { public class ProdPlanInfoServiceImpl : BaseServiceImpl { private ILogger _logger; public ProdPlanInfoServiceImpl(Repository repository, ILogger logger) : base(repository) { _logger = logger; } /// /// 通过订单编号、工单编号、物料名称获取工单信息 /// /// /// /// /// public List GetRecordStaffAttendancesByOrderCodeAndPlanCodeAndMaterialName(string orderCode, string planCode, string materialCode) { List prodPLanInfos = null; Expression> exp = x => true; if (!string.IsNullOrEmpty(orderCode)) { exp = exp.And(x => x.OrderCode == orderCode); } if (!string.IsNullOrEmpty(planCode)) { exp = exp.And(x => x.PlanCode == planCode); } if (!string.IsNullOrEmpty(materialCode)) { exp = exp.And(x => x.MaterialCode == materialCode); } prodPLanInfos = base._rep.GetList(exp); return prodPLanInfos; } public List GetRecordStaffAttendances() { List pLanInfos = null; try { pLanInfos = base._rep.GetList(); pLanInfos.Reverse(); } catch (Exception ex) { _logger.LogError($"获取员工打卡信息异常{ex.Message}"); } return pLanInfos; } } }