diff --git a/SlnMesnac.Model/domain/BaseStaffInfo.cs b/SlnMesnac.Model/domain/BaseStaffInfo.cs index 2b379dd..3e2a98a 100644 --- a/SlnMesnac.Model/domain/BaseStaffInfo.cs +++ b/SlnMesnac.Model/domain/BaseStaffInfo.cs @@ -29,6 +29,12 @@ namespace SlnMesnac.Model.domain [SugarColumn(ColumnName = "staff_name")] public string StaffName { get; set; } + /// + /// 员工类型 + /// + [SugarColumn(ColumnName = "staff_type")] + public string StaffType { get; set; } + /// /// 卡号1 /// diff --git a/SlnMesnac.Model/domain/ProdPLanInfo.cs b/SlnMesnac.Model/domain/ProdPLanInfo.cs index 97a7b94..12608ef 100644 --- a/SlnMesnac.Model/domain/ProdPLanInfo.cs +++ b/SlnMesnac.Model/domain/ProdPLanInfo.cs @@ -26,7 +26,7 @@ namespace SlnMesnac.Model.domain /// ERP订单编号 /// [SugarColumn(ColumnName = "order_code")] - public string StaffId { get; set; } + public string OrderCode { get; set; } /// /// 物料编号 diff --git a/SlnMesnac.Repository/service/Impl/ProdPlanInfoServiceImpl.cs b/SlnMesnac.Repository/service/Impl/ProdPlanInfoServiceImpl.cs new file mode 100644 index 0000000..815ee7c --- /dev/null +++ b/SlnMesnac.Repository/service/Impl/ProdPlanInfoServiceImpl.cs @@ -0,0 +1,63 @@ +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; + } + } +} diff --git a/SlnMesnac.Repository/service/ProdPlanInfoService.cs b/SlnMesnac.Repository/service/ProdPlanInfoService.cs index 3c782ae..08714b6 100644 --- a/SlnMesnac.Repository/service/ProdPlanInfoService.cs +++ b/SlnMesnac.Repository/service/ProdPlanInfoService.cs @@ -9,9 +9,15 @@ namespace SlnMesnac.Repository.service public interface ProdPlanInfoService : IBaseService { /// - /// 获取工单信息 + /// 获取所有工单信息 /// /// - List GetRecordStaffAttendances(); + List GetRecordStaffAttendances(); + + /// + /// 根据订单编号、工单编号、物料名称获取工单信息 + /// + /// + List GetRecordStaffAttendancesByOrderCodeAndPlanCodeAndMaterialName(string orderCode,string planCode,string materialCode); } } diff --git a/SlnMesnac.WPF/UserControls/ExecutePage.xaml b/SlnMesnac.WPF/UserControls/ExecutePage.xaml index 4a303cc..97d106b 100644 --- a/SlnMesnac.WPF/UserControls/ExecutePage.xaml +++ b/SlnMesnac.WPF/UserControls/ExecutePage.xaml @@ -117,10 +117,10 @@ - + - +