Parcourir la source

冲突解决

master
itachilee il y a 2 ans
Parent
révision
ed9a181ca8
5 fichiers modifiés avec 47 ajouts et 22 suppressions
  1. +2
    -0
      HBLConsole.Abstract/AbstractMessageServer.cs
  2. +16
    -4
      HBLConsole.Business/AbstractServer/Base.cs
  3. +1
    -0
      HBLConsole.MainConsole/Main.cs
  4. +4
    -3
      HBLConsole/App.config
  5. +24
    -15
      HBLConsole/ViewModel/ViewModelBase.cs

+ 2
- 0
HBLConsole.Abstract/AbstractMessageServer.cs Voir le fichier

@@ -15,5 +15,7 @@ namespace HBLConsole.Abstract

public abstract bool OrderStatusChange(string subOrderId, ORDER_STATUS status);

public abstract void Chargeback<T>(T chargebackInfo);

}
}

+ 16
- 4
HBLConsole.Business/AbstractServer/Base.cs Voir le fichier

@@ -117,10 +117,6 @@ namespace HBLConsole.Business.AbstractServer
{
//MessageLog.GetInstance.Show($"辅料ID:=[{x.RecipeBomId}],{x.RecipeBomLoc}号位置:{x.RecipeBomCount}");
});




}
}

@@ -147,6 +143,22 @@ namespace HBLConsole.Business.AbstractServer
var res = JsonConvert.DeserializeObject<OrderStatusRsp>(result);
return res == null ? false : res.isSuccess;
}

/// <summary>
/// 退单消息
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="chargebackInfo"></param>
/// <exception cref="NotImplementedException"></exception>
public override void Chargeback<T>(T chargebackInfo)
{
if (chargebackInfo == null) return;
if (chargebackInfo is Chargeback chargeback)
{
ActionManage.GetInstance.Send("chargeback", chargeback.SubOrderId);
}
}

public class OrderStatusRsp
{
/// <summary>


+ 1
- 0
HBLConsole.MainConsole/Main.cs Voir le fichier

@@ -74,6 +74,7 @@ namespace HBLConsole.MainConsole
Topics.Clear();
Topics.Add(TOPIC.GetInstance.GetOrderPushTopic(GeneralConfig.DeviceType, InternetInfo.ClientId));
Topics.Add(TOPIC.GetInstance.GetBusinessTopic(GeneralConfig.DeviceType, InternetInfo.ClientId));
Topics.Add(TOPIC.GetInstance.GetChargebackTopic(GeneralConfig.DeviceType, InternetInfo.ClientId));

//MQTT 连接成功
MqttHelper.GetInstance.ConnectOk = new Action(() =>


+ 4
- 3
HBLConsole/App.config Voir le fichier

@@ -3,11 +3,12 @@
<appSettings>
<!--通用配置-->

<!--正式服务 Consul 地址-->
<!--<add key="ConsulAddress" value="http://1.14.74.54:9005" />-->

<!--测试服务 Consul 地址-->
<add key="ConsulAddress" value="http://1.14.74.54:9005" />
<add key="ConsulAddress" value="http://111.9.47.105:9011" />

<!--正式服务 Consul 地址-->
<!--<add key="ConsulAddress" value="http://162.14.105.138:9005" />-->

<!--客户端ID-->
<!--1:且时且多冰淇淋咖啡机,2:且时且多煮面机,3:海科煮面机测试店铺-->


+ 24
- 15
HBLConsole/ViewModel/ViewModelBase.cs Voir le fichier

@@ -1,4 +1,4 @@
//#define test
#define test
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -148,20 +148,20 @@ namespace HBLConsole.ViewModel
{
while (GeneralConfig.morkOrderPushes.Count > 0)
{
if (GeneralConfig.morkOrderPushes.TryDequeue(out MorkOrderPush morkOrder))
{
SimpleFactory.GetInstance.OrderChanged(morkOrder.SuborderId, ORDER_STATUS.COOKING);
MessageLog.GetInstance.Show($"{morkOrder.GoodsName},{ORDER_STATUS.COOKING}");
Thread.Sleep(5000);
SimpleFactory.GetInstance.OrderChanged(morkOrder.SuborderId, ORDER_STATUS.COMPLETED_COOK);
MessageLog.GetInstance.Show($"{morkOrder.GoodsName},{ORDER_STATUS.COMPLETED_COOK}");
Thread.Sleep(5000);
SimpleFactory.GetInstance.OrderChanged(morkOrder.SuborderId, ORDER_STATUS.COMPLETED_TAKE);
MessageLog.GetInstance.Show($"{morkOrder.GoodsName},{ORDER_STATUS.COMPLETED_TAKE}");
Thread.Sleep(5000);
}
//if (GeneralConfig.morkOrderPushes.TryDequeue(out MorkOrderPush morkOrder))
//{
// SimpleFactory.GetInstance.OrderChanged(morkOrder.SuborderId, ORDER_STATUS.COOKING);
// MessageLog.GetInstance.Show($"{morkOrder.GoodsName},{ORDER_STATUS.COOKING}");
// Thread.Sleep(5000);
// SimpleFactory.GetInstance.OrderChanged(morkOrder.SuborderId, ORDER_STATUS.COMPLETED_COOK);
// MessageLog.GetInstance.Show($"{morkOrder.GoodsName},{ORDER_STATUS.COMPLETED_COOK}");
// Thread.Sleep(5000);
// SimpleFactory.GetInstance.OrderChanged(morkOrder.SuborderId, ORDER_STATUS.COMPLETED_TAKE);
// MessageLog.GetInstance.Show($"{morkOrder.GoodsName},{ORDER_STATUS.COMPLETED_TAKE}");
// Thread.Sleep(5000);
//}
}
Thread.Sleep(500);
}), "test");
@@ -176,6 +176,15 @@ namespace HBLConsole.ViewModel
{
Test();

ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o == null) return;
if (o is string id)
{
SimpleFactory.GetInstance.OrderChanged(id, ORDER_STATUS.ABANDONED);
}
}), "chargeback");

//清除订单数据
ActionManage.GetInstance.Register(new Action(() =>
{


Chargement…
Annuler
Enregistrer