Browse Source

订单通知提示

样式分支
pry 2 years ago
parent
commit
4603c2bab9
10 changed files with 35 additions and 23 deletions
  1. +1
    -1
      BPASmartClient.Business/BPASmartClient.Business.csproj
  2. +2
    -1
      BPASmartClient.Business/Plugin/OrderProxy.cs
  3. +1
    -1
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  4. +1
    -1
      BPASmartClient.Device/BPASmartClient.Device.csproj
  5. +0
    -10
      BPASmartClient.Device/BaseDevice.cs
  6. +1
    -1
      BPASmartClient.Model/BPASmartClient.Model.csproj
  7. +5
    -0
      BPASmartClient.Model/订单/OrderStatusChangedEvent.cs
  8. +2
    -2
      BPASmartClient.MorkS/Alarm.cs
  9. +19
    -2
      BPASmartClient.MorkS/Control_Morks.cs
  10. +3
    -4
      BPASmartClient/App.config

+ 1
- 1
BPASmartClient.Business/BPASmartClient.Business.csproj View File

@@ -8,7 +8,7 @@


<ItemGroup> <ItemGroup>
<PackageReference Include="BPA.ApolloClient" Version="1.0.12" /> <PackageReference Include="BPA.ApolloClient" Version="1.0.12" />
<PackageReference Include="BPA.Message" Version="1.0.26" />
<PackageReference Include="BPA.Message" Version="1.0.37" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" /> <PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />


+ 2
- 1
BPASmartClient.Business/Plugin/OrderProxy.cs View File

@@ -140,7 +140,8 @@ namespace BPASmartClient.Business
{ {
CookingStatus = orderStatusChangedEvent.Status, CookingStatus = orderStatusChangedEvent.Status,
SuborderId = orderStatusChangedEvent.SubOrderId, SuborderId = orderStatusChangedEvent.SubOrderId,
GoodName = orderStatusChangedEvent.GoodName
GoodName = orderStatusChangedEvent.GoodName,
SortNum = orderStatusChangedEvent.SortNum
}; };


#region API 订单状态修改 #region API 订单状态修改


+ 1
- 1
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj View File

@@ -204,7 +204,7 @@
</ItemGroup> </ItemGroup>


<ItemGroup> <ItemGroup>
<PackageReference Include="BPA.Message" Version="1.0.26" />
<PackageReference Include="BPA.Message" Version="1.0.37" />
</ItemGroup> </ItemGroup>


<ItemGroup> <ItemGroup>


+ 1
- 1
BPASmartClient.Device/BPASmartClient.Device.csproj View File

@@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>


<ItemGroup> <ItemGroup>
<PackageReference Include="BPA.Message" Version="1.0.26" />
<PackageReference Include="BPA.Message" Version="1.0.37" />
</ItemGroup> </ItemGroup>


<ItemGroup> <ItemGroup>


+ 0
- 10
BPASmartClient.Device/BaseDevice.cs View File

@@ -208,20 +208,10 @@ namespace BPASmartClient.Device
{ {
InterfaceStatus = item.GetValue(this) as IStatus; InterfaceStatus = item.GetValue(this) as IStatus;
GetMonitorData(InterfaceStatus); GetMonitorData(InterfaceStatus);
//ThreadManage.GetInstance().StopTask($"{item.Name}:{DeviceId}", new Action(() =>
// {
//ThreadManage.GetInstance().StartLong(new Action(() =>
//{
// UpdateValue(InterfaceStatus);
// Thread.Sleep(1000);
//}), $"GvlStatusMonitor:{DeviceId}");
//}));
} }
else if (faces.Name == "IAlarm") else if (faces.Name == "IAlarm")
{ {
InterfaceAlarm = item.GetValue(this) as IAlarm; InterfaceAlarm = item.GetValue(this) as IAlarm;
//IAlarm alarm = item.GetValue(this) as IAlarm;
//AlarmHelper alarmHelper = new AlarmHelper();
alarmHelper.AddAction += new Action<string>((s) => alarmHelper.AddAction += new Action<string>((s) =>
{ {
var res = alarmHelper.Alarms.FirstOrDefault(p => p.Info == s); var res = alarmHelper.Alarms.FirstOrDefault(p => p.Info == s);


+ 1
- 1
BPASmartClient.Model/BPASmartClient.Model.csproj View File

@@ -15,7 +15,7 @@
</ItemGroup> </ItemGroup>


<ItemGroup> <ItemGroup>
<PackageReference Include="BPA.Message" Version="1.0.26" />
<PackageReference Include="BPA.Message" Version="1.0.37" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" /> <PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
</ItemGroup> </ItemGroup>




+ 5
- 0
BPASmartClient.Model/订单/OrderStatusChangedEvent.cs View File

@@ -25,5 +25,10 @@ namespace BPASmartClient.Model
/// 商品名称 /// 商品名称
/// </summary> /// </summary>
public string GoodName { get; set; } public string GoodName { get; set; }

/// <summary>
/// 订单排序号
/// </summary>
public string SortNum { get; set; }
} }
} }

+ 2
- 2
BPASmartClient.MorkS/Alarm.cs View File

@@ -98,11 +98,11 @@ namespace BPASmartClient.MorkS
public bool DeviceEstop { get; set; } public bool DeviceEstop { get; set; }


/// <summary> /// <summary>
/// 机器人初始化失败
/// PLC电池电压低
/// PLC ---> M231.3 /// PLC ---> M231.3
/// ModbusTcp --> 1583 /// ModbusTcp --> 1583
/// </summary> /// </summary>
[Alarm("机器人初始化失败")]
[Alarm("PLC电池电压低")]
public bool RobotInitError { get; set; } public bool RobotInitError { get; set; }


/// <summary> /// <summary>


+ 19
- 2
BPASmartClient.MorkS/Control_Morks.cs View File

@@ -100,8 +100,13 @@ namespace BPASmartClient.MorkS
{ {
var res = mORKS.doOrderEvents.FirstOrDefault(p => p.MorkOrder.SuborderId == subid); var res = mORKS.doOrderEvents.FirstOrDefault(p => p.MorkOrder.SuborderId == subid);
string goodName = string.Empty; string goodName = string.Empty;
if (res != null) goodName = res.MorkOrder.GoodsName;
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType });
string SortNum = string.Empty;
if (res != null)
{
goodName = res.MorkOrder.GoodsName;
SortNum = res.MorkOrder.SortNum.ToString();
}
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType });
} }


private void GetStatus(string key, Action<object> action) private void GetStatus(string key, Action<object> action)
@@ -235,6 +240,18 @@ namespace BPASmartClient.MorkS
mORKS.doOrderEvents.Add(order); mORKS.doOrderEvents.Add(order);
if (order.MorkOrder.GoodBatchings == null) return; if (order.MorkOrder.GoodBatchings == null) return;
OrderCount++; OrderCount++;

new OrderStatusChangedEvent()
{
DeviceId = DeviceId,
SubOrderId = order.MorkOrder.SuborderId,
Status = ORDER_STATUS.WAIT,
GoodName = order.MorkOrder.GoodsName,
SortNum = order.MorkOrder.SortNum.ToString(),
deviceClientType = DeviceType
}.Publish();


DeviceProcessLogShow($"接收到{OrderCount}次订单"); DeviceProcessLogShow($"接收到{OrderCount}次订单");
foreach (var item in order.MorkOrder.GoodBatchings) foreach (var item in order.MorkOrder.GoodBatchings)
{ {


+ 3
- 4
BPASmartClient/App.config View File

@@ -3,19 +3,18 @@
<appSettings> <appSettings>


<!--通用配置--> <!--通用配置-->
<add key="ClientId" value="51"/>
<add key="ClientId" value="54"/>
<add key="IsEnableTest" value="False"/>


<!--开发环境--> <!--开发环境-->
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/> <!--<add key="apollouri" value="http://10.2.1.21:28080/"/>
<add key="AppId" value="dev1_common"/> <add key="AppId" value="dev1_common"/>
<add key ="Namespaces" value="DEV.Config"/>
<add key="IsEnableTest" value="False"/>-->
<add key ="Namespaces" value="DEV.Config"/>-->


<!--正式环境--> <!--正式环境-->
<add key="apollouri" value="http://47.108.65.220:28080/"/> <add key="apollouri" value="http://47.108.65.220:28080/"/>
<add key="AppId" value="order"/> <add key="AppId" value="order"/>
<add key ="Namespaces" value="TEST1.Config"/> <add key ="Namespaces" value="TEST1.Config"/>
<add key="IsEnableTest" value="False"/>


<!--阿里云上报启动方式:API 或者 LOCAL--> <!--阿里云上报启动方式:API 或者 LOCAL-->
<!--API :通过客户端ID,调用接口查询“设备连接信息”--> <!--API :通过客户端ID,调用接口查询“设备连接信息”-->


Loading…
Cancel
Save