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 @@
-
+
-
+
@@ -169,7 +169,8 @@
-
+
+
@@ -239,6 +240,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SlnMesnac.WPF/UserControls/ExecutePage.xaml.cs b/SlnMesnac.WPF/UserControls/ExecutePage.xaml.cs
index 195863f..1d6e246 100644
--- a/SlnMesnac.WPF/UserControls/ExecutePage.xaml.cs
+++ b/SlnMesnac.WPF/UserControls/ExecutePage.xaml.cs
@@ -1,4 +1,5 @@
-using SlnMesnac.WPF.Views;
+using SlnMesnac.WPF.ViewModel;
+using SlnMesnac.WPF.Views;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -24,6 +25,7 @@ namespace SlnMesnac.WPF.Page
public ExecutePage()
{
InitializeComponent();
+ this.DataContext = new ExecuteViewModel();
}
#region 弹出工单信息窗口
@@ -37,7 +39,12 @@ namespace SlnMesnac.WPF.Page
planDetailWin.ShowDialog();
}
-
+
#endregion
+
+ private void ChangeShifts_Click(object sender, RoutedEventArgs e)
+ {
+
+ }
}
}
diff --git a/SlnMesnac.WPF/ViewModel/EmployeeLoginViewModel.cs b/SlnMesnac.WPF/ViewModel/EmployeeLoginViewModel.cs
index d5ac524..549a89f 100644
--- a/SlnMesnac.WPF/ViewModel/EmployeeLoginViewModel.cs
+++ b/SlnMesnac.WPF/ViewModel/EmployeeLoginViewModel.cs
@@ -216,7 +216,7 @@ namespace SlnMesnac.WPF.ViewModel
private ObservableCollection item = new ObservableCollection();
//
- private ObservableCollection recordStaffAttendanceDataGrid=new ObservableCollection();
+ private ObservableCollection recordStaffAttendanceDataGrid = new ObservableCollection();
public ObservableCollection RecordStaffAttendanceDataGrid
{
diff --git a/SlnMesnac.WPF/ViewModel/ExecuteViewModel.cs b/SlnMesnac.WPF/ViewModel/ExecuteViewModel.cs
new file mode 100644
index 0000000..b9aac40
--- /dev/null
+++ b/SlnMesnac.WPF/ViewModel/ExecuteViewModel.cs
@@ -0,0 +1,39 @@
+using GalaSoft.MvvmLight.Command;
+using SlnMesnac.WPF.Views;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Input;
+
+namespace SlnMesnac.WPF.ViewModel
+{
+ public class ExecuteViewModel
+ {
+ ///
+ /// 换班命令
+ ///
+ public ICommand HandoverCommand { get; private set; }
+
+ public ExecuteViewModel()
+ {
+ HandoverCommand = new RelayCommand(Handover);
+ }
+
+ ///
+ /// 换班弹窗
+ ///
+ private void Handover()
+ {
+ var handOverWin = new HandOverWin();
+ handOverWin.WindowStartupLocation = WindowStartupLocation.CenterScreen; // 让窗体出现在屏幕中央
+
+ handOverWin.ShowDialog();//窗体出现后禁止后面的用户控件
+ //其他操作
+ }
+
+
+ }
+}
diff --git a/SlnMesnac.WPF/ViewModel/HandOverViewModel.cs b/SlnMesnac.WPF/ViewModel/HandOverViewModel.cs
new file mode 100644
index 0000000..de14873
--- /dev/null
+++ b/SlnMesnac.WPF/ViewModel/HandOverViewModel.cs
@@ -0,0 +1,65 @@
+using ConsoleApp;
+using Microsoft.Extensions.DependencyInjection;
+using SlnMesnac.Model.domain;
+using SlnMesnac.Repository.service;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SlnMesnac.WPF.ViewModel
+{
+ public class HandOverViewModel
+ {
+ private HidUtils hidUtils = new HidUtils();
+ private IBaseStaffService _baseStaffService;
+
+ public HandOverViewModel()
+ {
+ Init();
+ _baseStaffService = App.ServiceProvider.GetService();
+ }
+
+ #region
+
+ /////
+ ///// 员工id
+ /////
+ //private string staffId;
+ //public string StaffIdText
+ //{
+ // get { return staffId; }
+ // set { staffId = value; OnPropertyChanged("StaffIdText"); }
+ //}
+
+ #endregion
+
+ private void Init()
+ {
+ hidUtils.Initial();
+ hidUtils.StartScan();
+ hidUtils.pushReceiveDataEvent += (bytes, str) =>
+ {
+ str = str.ToString().Replace(" ", "");
+ BaseStaffInfo user = _baseStaffService.GetStaffInfoByCardId(str);
+ if (user != null)
+ {
+ string staffType = user.StaffType;
+ if(staffType == "1")
+ {
+
+ }
+ else
+ {
+
+ }
+ }
+ else
+ {
+
+ }
+ };
+ }
+ }
+}
diff --git a/SlnMesnac.WPF/Views/HandOverWin.xaml b/SlnMesnac.WPF/Views/HandOverWin.xaml
new file mode 100644
index 0000000..dd71ee1
--- /dev/null
+++ b/SlnMesnac.WPF/Views/HandOverWin.xaml
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SlnMesnac.WPF/Views/HandOverWin.xaml.cs b/SlnMesnac.WPF/Views/HandOverWin.xaml.cs
new file mode 100644
index 0000000..e9247eb
--- /dev/null
+++ b/SlnMesnac.WPF/Views/HandOverWin.xaml.cs
@@ -0,0 +1,29 @@
+using SlnMesnac.WPF.ViewModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace SlnMesnac.WPF.Views
+{
+ ///
+ /// HandOverWin.xaml 的交互逻辑
+ ///
+ public partial class HandOverWin : Window
+ {
+ public HandOverWin()
+ {
+ InitializeComponent();
+ this.DataContext = new HandOverViewModel();
+ }
+ }
+}