|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using SlnMesnac.Common;
|
|
|
|
|
using SlnMesnac.Model.domain;
|
|
|
|
|
using SlnMesnac.Repository.service.@base;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel.Design;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Linq.Expressions;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace SlnMesnac.Repository.service.Impl
|
|
|
|
|
{
|
|
|
|
|
public class ProdPlanInfoServiceImpl : BaseServiceImpl<ProdPLanInfo>, ProdPlanInfoService
|
|
|
|
|
{
|
|
|
|
|
private ILogger<ProdPlanInfoServiceImpl> _logger;
|
|
|
|
|
public ProdPlanInfoServiceImpl(Repository<ProdPLanInfo> repository, ILogger<ProdPlanInfoServiceImpl> logger) : base(repository)
|
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 通过订单编号、工单编号、物料码获取工单信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="orderCode"></param>
|
|
|
|
|
/// <param name="planCode"></param>
|
|
|
|
|
/// <param name="materialCode"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public List<ProdPLanInfo> GetRecordStaffAttendancesByConditions(string? orderCode, string? planCode, string? materialCode, string? stationCode)
|
|
|
|
|
{
|
|
|
|
|
List<ProdPLanInfo> recordStaffAttendances = new List<ProdPLanInfo>();
|
|
|
|
|
List<ProdPLanInfo> planInfoList = _rep.AsQueryable().WhereIF(!string.IsNullOrEmpty(orderCode), x => x.OrderCode == orderCode)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(planCode), x => x.PlanCode == planCode)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(materialCode), x => x.MaterialCode == materialCode)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(stationCode), x => x.StationCode == stationCode)
|
|
|
|
|
.ToList();
|
|
|
|
|
return planInfoList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<ProdPLanInfo> GetRecordStaffAttendances()
|
|
|
|
|
{
|
|
|
|
|
List<ProdPLanInfo> pLanInfos = null;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
pLanInfos = base._rep.GetList();
|
|
|
|
|
pLanInfos.Reverse();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError($"获取员工打卡信息异常{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
return pLanInfos;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|