change - 检索条件加版次下拉框

main
yinq 2 days ago
parent 57102edb09
commit 8624ff9330

@ -12,5 +12,7 @@ namespace SlnMesnac.Model.domain
public string SeqNo { get; set; } // seqNo
[SugarColumn(ColumnName = "workingHours")]
public string WorkingHours { get; set; } // workingHours
[SugarColumn(ColumnName = "classes")]
public string classes { get; set; } // classes
}
}

@ -25,8 +25,11 @@ namespace SlnMesnac.Repository.service.Impl
/// <param name="orderCode"></param>
/// <param name="planCode"></param>
/// <param name="materialCode"></param>
/// <param name="stationCode"></param>
/// <param name="planStatus"></param>
/// <param name="classes"></param>
/// <returns></returns>
public List<ProdPLanInfo> GetRecordStaffAttendancesByConditions(string? orderCode, string? planCode, string? materialCode, string? stationCode, string? planStatus)
public List<ProdPLanInfo> GetRecordStaffAttendancesByConditions(string? orderCode, string? planCode, string? materialCode, string? stationCode, string? planStatus, string? classes)
{
var query = _rep.Context.Queryable<ProdPLanInfo>()
.LeftJoin<ProdPlanErpInfo>((ppi, ppei) => ppi.PlanCode == ppei.SeqNo)
@ -35,6 +38,7 @@ namespace SlnMesnac.Repository.service.Impl
.WhereIF(!string.IsNullOrEmpty(materialCode), (ppi, ppei) => ppi.MaterialCode == materialCode)
.WhereIF(!string.IsNullOrEmpty(stationCode), (ppi, ppei) => ppi.StationCode == stationCode)
.WhereIF(!string.IsNullOrEmpty(planStatus), (ppi, ppei) => ppi.PlanStatus == planStatus || ppi.PlanStatus == "4")
.WhereIF(!string.IsNullOrEmpty(classes), (ppi, ppei) => ppei.classes == classes)
.Select((ppi, ppei) => new ProdPLanInfo
{
ObjId = ppi.ObjId,

@ -18,7 +18,7 @@ namespace SlnMesnac.Repository.service
/// 根据订单编号、工单编号、物料名称获取工单信息
/// </summary>
/// <returns></returns>
List<ProdPLanInfo> GetRecordStaffAttendancesByConditions(string orderCode,string planCode,string materialCode, string stationCode, string planStatus);
List<ProdPLanInfo> GetRecordStaffAttendancesByConditions(string orderCode,string planCode,string materialCode, string stationCode, string planStatus, string classes);
/// <summary>
/// 根据订单编号、工单编号、物料名称获取工单信息

@ -130,6 +130,12 @@
<TextBlock Text="{Binding StationTextBox}" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<!--<ComboBox x:Name="StationComboBox" ItemsSource="{Binding StationList}" SelectedItem="{Binding Station}" Width="180" Height="30" FontSize="15" HorizontalAlignment="Left"/>-->
</Border>
<Border Grid.Row="3" Grid.Column="2">
<TextBlock Text="班次:" FontSize="15" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="4" Grid.Column="3">
<ComboBox x:Name="ShiftComboBox" ItemsSource="{Binding ShiftList}" SelectedItem="{Binding SelectedShift}" Width="170" Height="30" FontSize="15" HorizontalAlignment="Left"/>
</Border>
<Border Grid.Row="1" Grid.Column="5">
<Button Content="检索工单" x:Name="Select" Command="{Binding SearchCommand}" CommandParameter="{Binding Name,ElementName=Select}" Style="{StaticResource BUTTON_AGREE}" FontSize="15" FontWeight="Bold" Background="#009999" BorderBrush="#FF36B5C1" Margin="20,5,20,5"/>
</Border>

@ -146,12 +146,12 @@ namespace SlnMesnac.WPF.ViewModel
set { materialCodeTextBox = value; OnPropertyChanged("MaterialCodeTextBox"); }
}
//private string materialNameTextBox;
//public string MaterialNameTextBox
//{
// get { return materialNameTextBox; }
// set { materialNameTextBox = value; OnPropertyChanged("MaterialNameTextBox"); }
//}
private string materialNameTextBox;
public string MaterialNameTextBox
{
get { return materialNameTextBox; }
set { materialNameTextBox = value; OnPropertyChanged("MaterialNameTextBox"); }
}
/// <summary>
/// 工位
@ -163,6 +163,26 @@ namespace SlnMesnac.WPF.ViewModel
set { stationTextBlock = value; OnPropertyChanged("StationTextBox"); }
}
/// <summary>
/// 班次列表
/// </summary>
private List<string> shiftList;
public List<string> ShiftList
{
get { return shiftList; }
set { shiftList = value; OnPropertyChanged("ShiftList"); }
}
/// <summary>
/// 选中的班次
/// </summary>
private string selectedShift;
public string SelectedShift
{
get { return selectedShift; }
set { selectedShift = value; OnPropertyChanged("SelectedShift"); }
}
/// <summary>
/// PlanDataGrid
/// </summary>
@ -320,6 +340,11 @@ namespace SlnMesnac.WPF.ViewModel
;
DeviceCode = configuration.GetSection("AppConfig")["DeviceCode"];
ProcessCode = configuration.GetSection("AppConfig")["ProcessCode"];
// 初始化班次列表
ShiftList = new List<string> { "白班", "小夜", "大夜" };
SelectedShift = "白班"; // 默认选择白班
HandoverCommand = new RelayCommand(Handover);
ProductionReportCommand = new RelayCommand(ProductionReport);
TechnologicalInformationCommand = new RelayCommand(TechnologicalInformation);
@ -468,7 +493,7 @@ namespace SlnMesnac.WPF.ViewModel
//在这里执行其他操作可以通过InputText获取用户输入的信息
//Console.WriteLine("用户输入的信息:" + OrderCodeTextBox + PlanCodeTextBox + MaterialCodeTextBox);
//ProductLineNameTextBlock = ConfigurationManager.AppSettings["ProductLineNameTextBlock"];
List<ProdPLanInfo> list = _prodPlanInfoService.GetRecordStaffAttendancesByConditions(OrderCodeTextBox, PlanCodeTextBox, MaterialCodeTextBox, RfidHandleBusniess.stationCode, "0");
List<ProdPLanInfo> list = _prodPlanInfoService.GetRecordStaffAttendancesByConditions(OrderCodeTextBox, PlanCodeTextBox, MaterialCodeTextBox, RfidHandleBusniess.stationCode, "0", SelectedShift);
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{
ProdPLanInfoDataGrid.Clear();
@ -556,7 +581,7 @@ namespace SlnMesnac.WPF.ViewModel
// 将当前记录存为实体可以通过parameter获取当前记录的信息
string orderCode = _selectedRow.OrderCode.ToString();
string planCode = _selectedRow.PlanCode.ToString();
pLanInfo = _prodPlanInfoService.GetRecordStaffAttendancesByConditions(orderCode, planCode, "", "", "0").First();
pLanInfo = _prodPlanInfoService.GetRecordStaffAttendancesByConditions(orderCode, planCode, "", "", "0", SelectedShift).First();
//RecordStaffAttendance currentRecord = _recordStaffAttendanceService.GetLastestOnRecord();
//BaseStaffInfo staffInfo = _baseStaffService.GetMonitorByTeamCode(currentRecord.TeamCode);
RecordStaffAttendance nextRecord = _recordStaffAttendanceService.GetLastestOffRecord();

@ -40,7 +40,7 @@ namespace SlnMesnac.WPF.ViewModel
_prodPlanDetailService = App.ServiceProvider.GetService<ProdPlanDetailService>();
_prodPlanInfoService = App.ServiceProvider.GetService<ProdPlanInfoService>();
_recordStaffAttendanceService = App.ServiceProvider.GetService<IRecordStaffAttendanceService>();
planInfo = _prodPlanInfoService.GetRecordStaffAttendancesByConditions("", "", "", "", "1").FirstOrDefault();
planInfo = _prodPlanInfoService.GetRecordStaffAttendancesByConditions("", "", "", "", "1", null).FirstOrDefault();
HandoverCommand = new RelayCommand(Handover);
Init();
_baseStaffService = App.ServiceProvider.GetService<IBaseStaffService>();

Loading…
Cancel
Save