add-泡后库添加任务全部删除按钮

foamRearStore
liuwf 3 weeks ago
parent 4358100f6e
commit 06875dc9ca

Binary file not shown.

@ -496,6 +496,23 @@ namespace Aucma.Scada.Business
}
}
public async Task<bool> DeleteTasksAsync()
{
try
{
List<RealTaskInfo> taskList = _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.foamStoreCode }, 1);
taskList = taskList.Take(1000).ToList();
bool result =await _taskInfoService.DeleteTasksAsync(taskList);
return result;
}catch (Exception ex)
{
PrintLogErrorMessage("删除所有任务异常", ex);
return false;
}
}
/// <summary>
/// 日志输出,界面刷新同时记录文件
/// </summary>

@ -199,10 +199,11 @@
</ComboBox>-->
<Button Content="查询" Command="{Binding QueryCommand}" Style="{StaticResource BUTTON_AGREE}" Background="#007DFA" BorderBrush="#007DFA" Foreground="White" Margin="20,0,0,0" Height="36" Width="80" FontSize="20"/>
<Button Content="重置" Command="{Binding ResetCommand}" Style="{StaticResource BUTTON_AGREE}" Background="#007DFA" BorderBrush="#007DFA" Foreground="White" Margin="20,0,0,0" Height="36" Width="80" FontSize="20"/>
<Label Content="货道号:" Margin="150 0 0 0" Foreground="White" FontSize="20"/>
<Button Content="全部删除" Command="{Binding DeleteCommand}" Style="{StaticResource BUTTON_AGREE}" Background="OrangeRed" BorderBrush="#007DFA" Foreground="White" Margin="20,0,0,0" Height="36" Width="120" FontSize="20"/>
<Label Content="货道号:" Margin="100 0 0 0" Foreground="White" FontSize="20"/>
<TextBox x:Name="SpaceCodeText" Style="{StaticResource TextBoxStyle}" Margin="10 0 0 0" Width="50" Height="25" Foreground= "#FFFFFF" VerticalAlignment="Center" FontSize="20"/>
<Button Content="手动入库" Style="{StaticResource BUTTON_AGREE}" Background="#FF9900" BorderBrush="#FF9900" Foreground="White" Margin="20 0 0 0" Height="36" Width="120" FontSize="20" Click="Button_Click"/>
<Button Content="手动入库" Style="{StaticResource BUTTON_AGREE}" Background="#FF9900" BorderBrush="#FF9900" Foreground="White" Margin="20 0 0 0" Height="36" Width="120" FontSize="20" Click="Button_Click"/>
</StackPanel>

@ -1,4 +1,4 @@

E:\c#\AUCMA\最新代码整合\登录版\泡后库\foam\Aucma.Scada.UI\obj\Debug\GeneratedInternalTypeHelper.g.cs
FE:\c#\AUCMA\最新代码整合\登录版\泡后库\foam\Aucma.Scada.UI\App.xaml;;
FE:\c#\AUCMA\最新代码整合\登录版\泡后库\foam\Aucma.Scada.UI\Page\AssemblyPlan\AssemblyPlanControl.xaml;;
FE:\c#\AUCMA\最新代码整合\登录版\泡后库\foam\Aucma.Scada.UI\Page\AssemblyPlan\PlanInfoEditWindow.xaml;;

@ -1,62 +1,2 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
/// <summary>
/// CreateInstance
/// </summary>
protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
| (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
}
/// <summary>
/// GetPropertyValue
/// </summary>
protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// SetPropertyValue
/// </summary>
protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// CreateDelegate
/// </summary>
protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
| (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
delegateType,
handler}, null)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}


@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "0525566B2108EF31BCE3AE0AE4825852465F7167B256C2FF88A40A2E86814F5F"
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4974A93BE032446BEB75FAA845E60B397BB792CF71760D90E0F62CD35E4136D3"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -51,7 +51,7 @@ namespace Aucma.Scada.UI.Page.InStoreInfo {
#line hidden
#line 210 "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml"
#line 211 "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid DG;
@ -59,7 +59,7 @@ namespace Aucma.Scada.UI.Page.InStoreInfo {
#line hidden
#line 257 "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml"
#line 258 "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ListBox listBox;
@ -108,9 +108,17 @@ namespace Aucma.Scada.UI.Page.InStoreInfo {
#line hidden
return;
case 3:
this.DG = ((System.Windows.Controls.DataGrid)(target));
#line 206 "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
return;
case 4:
this.DG = ((System.Windows.Controls.DataGrid)(target));
return;
case 5:
this.listBox = ((System.Windows.Controls.ListBox)(target));
return;
}

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "0525566B2108EF31BCE3AE0AE4825852465F7167B256C2FF88A40A2E86814F5F"
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4974A93BE032446BEB75FAA845E60B397BB792CF71760D90E0F62CD35E4136D3"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -51,7 +51,7 @@ namespace Aucma.Scada.UI.Page.InStoreInfo {
#line hidden
#line 210 "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml"
#line 211 "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid DG;
@ -59,7 +59,7 @@ namespace Aucma.Scada.UI.Page.InStoreInfo {
#line hidden
#line 257 "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml"
#line 258 "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ListBox listBox;
@ -108,9 +108,17 @@ namespace Aucma.Scada.UI.Page.InStoreInfo {
#line hidden
return;
case 3:
this.DG = ((System.Windows.Controls.DataGrid)(target));
#line 206 "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
return;
case 4:
this.DG = ((System.Windows.Controls.DataGrid)(target));
return;
case 5:
this.listBox = ((System.Windows.Controls.ListBox)(target));
return;
}

@ -46,7 +46,7 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
QueryCommand = new RelayCommand(Query);
ResetCommand = new RelayCommand(Reset);
DeleteCommand = new RelayCommand(DeleteAllTask);
materialTypeCombox = "所有";
@ -55,6 +55,16 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
}
/// <summary>
/// 删除所有多余的任务
/// </summary>
public async void DeleteAllTask()
{
bool result = await inStoreBusiness.DeleteTasksAsync();
PrintMessageToListBox($"删除任务成功每次最多删除1000条");
}
/// <summary>
/// 完成计划
/// </summary>
@ -198,9 +208,9 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
public RelayCommand QueryCommand { get; set; }
/// <summary>
/// 重置
/// 删除所有任务
/// </summary>
public RelayCommand ResetCommand { get; set; }
public RelayCommand DeleteCommand { get; set; }
#endregion

@ -1,5 +1,6 @@
using Aucma.Scada.Model.domain;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service
{
@ -12,6 +13,13 @@ namespace HighWayIot.Repository.service
/// <summary>
List<RealTaskInfo> GetAllInstoreTaskByStoreCode(string storeCode, string spaceCode, int taskType, int status);
/// <summary>
/// 删除所有任务信息
/// </summary>
/// <param name="taskInfo"></param>
Task<bool> DeleteTasksAsync(List<RealTaskInfo> taskList);
/// <summary>
/// 泡后库出库删除所有任务信息
/// </summary>

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service.Impl
{
@ -55,6 +56,27 @@ namespace HighWayIot.Repository.service.Impl
return result;
}
/// <summary>
/// 删除所有任务信息
/// </summary>
/// <param name="taskInfo"></param>
public async Task<bool> DeleteTasksAsync(List<RealTaskInfo> taskList)
{
bool result = false;
try
{
result = await _mesRepository.DeleteAsync(taskList);
}
catch (Exception ex)
{
logHelper.Error("删除任务信息异常", ex);
}
return result;
}
/// <summary>
/// 泡后库入库根据货道号查找所有执行中的任务
/// </summary>

Loading…
Cancel
Save