ソースを参照

订单日志修改

样式分支
pry 2年前
コミット
c82268ff3d
5個のファイルの変更61行の追加24行の削除
  1. +16
    -11
      BPASmartClient.Business/Plugin/OrderProxy.cs
  2. +20
    -10
      BPASmartClient.MorkS/Control_Morks.cs
  3. +5
    -0
      BPASmartClient.MorkS/GVL_MORKS.cs
  4. +18
    -3
      BPASmartClient.ViewModel/LogOrAlarmViewModel.cs
  5. +2
    -0
      BPASmartClient/Control/LogOrAlarmView.xaml

+ 16
- 11
BPASmartClient.Business/Plugin/OrderProxy.cs ファイルの表示

@@ -145,19 +145,24 @@ namespace BPASmartClient.Business
};

#region API 订单状态修改
try
if (orderStatusChange.CookingStatus != ORDER_STATUS.WAIT)
{
string header = $"[{InternetInfo.OrderServer}/order/robotstatuschange]_[{DateTime.Now.Ticks}]".AESEncrypt();
string url = $"{InternetInfo.OrderServer}order/robotstatuschange";
result = APIHelper.GetInstance.HttpRequest(url, header, orderStatusChange, RequestType.POST);
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx(ex.ToString());
try
{
string header = $"[{InternetInfo.OrderServer}/order/robotstatuschange]_[{DateTime.Now.Ticks}]".AESEncrypt();
string url = $"{InternetInfo.OrderServer}order/robotstatuschange";
result = APIHelper.GetInstance.HttpRequest(url, header, orderStatusChange, RequestType.POST);
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx(ex.ToString());
}
var res = JsonConvert.DeserializeObject<OrderStatusRsp>(result);
ActionManage.GetInstance.Send("OrderStatusChange", orderStatusChangedEvent);
bool isSuccess = res == null ? false : res.isSuccess;
MessageLog.GetInstance.Show($"订单:{orderStatusChange.SuborderId} 状态:{orderStatusChange.CookingStatus} 执行结果:{isSuccess}");
//MessageLog.GetInstance.Show(string.Format("订单状态改变,调用API执行结果{0}", res == null ? false : res.isSuccess));
}
var res = JsonConvert.DeserializeObject<OrderStatusRsp>(result);
ActionManage.GetInstance.Send("OrderStatusChange", orderStatusChangedEvent);
MessageLog.GetInstance.Show(string.Format("订单状态改变,调用API执行结果{0}", res == null ? false : res.isSuccess));
#endregion




+ 20
- 10
BPASmartClient.MorkS/Control_Morks.cs ファイルの表示

@@ -288,18 +288,18 @@ namespace BPASmartClient.MorkS
else
IsHealth = true;

if (mORKS.AllowRun)
{
TakeBowlTask();
//if (mORKS.AllowRun)
//{
TakeBowlTask();

TakeNoodleTask();
TakeNoodleTask();

OutNoodleTask();
OutNoodleTask();

SingleDetect();
SingleDetect();

TurntableControl();
}
TurntableControl();
//}
}

private void BowlControl(OrderLocInfo orderLocInfo)
@@ -516,7 +516,7 @@ namespace BPASmartClient.MorkS
mORKS.OutMealId = mORKS.IngredientsCompleteId;
mORKS.IngredientsCompleteId = string.Empty;
mORKS.CookNodelId[loc] = string.Empty;
DeviceProcessLogShow($"{loc + 1}号位置出餐控制");
DeviceProcessLogShow($"{loc + 1} 号位置出餐控制,订单ID:{ mORKS.OutMealId}");
mORKS.OutNoodleing = true;
}
}
@@ -542,15 +542,25 @@ namespace BPASmartClient.MorkS
{
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_COOK);
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】制作完成");
mORKS.CookCompleteFlatBit = true;
mORKS.OutNoodleing = false;
}

//取餐完成逻辑处理
if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.RbOutMealComplete && !mORKS.TakeMealDetect, 2))
//if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.RbOutMealComplete && !mORKS.TakeMealDetect, 2))
//{
// OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
// DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成");
// ResetCookComplete();
// mORKS.OutMealId = string.Empty;
//}

if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.CookCompleteFlatBit && !mORKS.TakeMealDetect, 2))
{
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成");
ResetCookComplete();
mORKS.CookCompleteFlatBit = false;
mORKS.OutMealId = string.Empty;
}



+ 5
- 0
BPASmartClient.MorkS/GVL_MORKS.cs ファイルの表示

@@ -311,6 +311,11 @@ namespace BPASmartClient.MorkS
/// </summary>
public bool IsNoodles { get; set; } = true;

/// <summary>
/// 制作完成标志
/// </summary>
[VariableMonitor("制作完成标志")]
public bool CookCompleteFlatBit { get; set; }


#region 订单ID记录


+ 18
- 3
BPASmartClient.ViewModel/LogOrAlarmViewModel.cs ファイルの表示

@@ -115,6 +115,11 @@ namespace BPASmartClient.ViewModel
OnPropertyChanged("LogDataGrid");
}
}


public string SearchText { get { return _mSearchText; } set { _mSearchText = value; OnPropertyChanged(); } }
private string _mSearchText;

#endregion

#region Command
@@ -132,7 +137,7 @@ namespace BPASmartClient.ViewModel
BookExs.Add(new BookEx(new Book() { Name = "错误日志条件", Tag = "Error" }) { IsChecked = true });
BookExs.Add(new BookEx(new Book() { Name = "设备告警条件", Tag = "DeviceAlarm" }) { IsChecked = true });
SelectBookExs = new ObservableCollection<BookEx>();
ItemPropertyChanged(new BookEx(new Book()) { IsChecked = true },new PropertyChangedEventArgs("IsChecked"));
ItemPropertyChanged(new BookEx(new Book()) { IsChecked = true }, new PropertyChangedEventArgs("IsChecked"));
//查询
QueryCommand = new RelayCommand(() =>
{
@@ -157,7 +162,7 @@ namespace BPASmartClient.ViewModel
//2.根据选中查询日志
DataTable dataTable = ReadFile(path);
List<DataRow> datas = dataTable.Select($"({sql})").OrderByDescending(o => o["TIME"])?.ToList();
if (datas==null || datas.Count() <= 0)
if (datas == null || datas.Count() <= 0)
{
NoticeDemoViewModel.OpenMsg(EnumPromptType.Info, MainViewModel.GetInstance().window, "提示", $"查询结果为空!");
return;
@@ -169,9 +174,19 @@ namespace BPASmartClient.ViewModel
time = item["TIME"].ToString(),
type = item["LOGGER"].ToString(),
message = item["MESSAGE"].ToString()
// foreground = (item["LOGGER"].ToString() == "ERROR" || item["LOGGER"].ToString() == "DEVICEALARM") ? new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#ed0032")) : new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#21bb2e"))
// foreground = (item["LOGGER"].ToString() == "ERROR" || item["LOGGER"].ToString() == "DEVICEALARM") ? new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#ed0032")) : new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#21bb2e"))
});
}
if (SearchText?.Length > 0)
{
var SearchList = LogDataGrid.Where(p => p.message.Contains(SearchText)).ToList();
if (SearchList != null && SearchList.Count > 0)
{
LogDataGrid.Clear();
SearchList.ForEach((item) => { LogDataGrid.Add(item); });
}
}

}
else
{


+ 2
- 0
BPASmartClient/Control/LogOrAlarmView.xaml ファイルの表示

@@ -34,6 +34,8 @@
</ComboBox.ItemTemplate>
</ComboBox>
<DatePicker Margin="10,0,10,0" Text="{Binding DateTimeStr,Mode=TwoWay,NotifyOnTargetUpdated=True}"></DatePicker>
<TextBlock Text="请输入关键字:" FontSize="16"/>
<TextBox Text="{Binding SearchText}" Width="300" Margin="10,0,10,0" />
<Button Margin="10,0,0,0" Cursor="Hand" Command="{Binding QueryCommand}" >查询数据</Button>
<Button Margin="10,0,0,0" Cursor="Hand" Command="{Binding OpenCommand}" >打开文件目录</Button>
</StackPanel>


読み込み中…
キャンセル
保存