private void Srv_OrderStateChangeEvent(OrderItem arg1, OrderServiceEnum arg2, int arg3) { Redis.RedisHelper <OrderItem> redisHelper = new Redis.RedisHelper <OrderItem>(); if (arg1 == null) { var count = redisHelper.GetAll().Count(d => d.State == OrderItemStateEnum.DOWORK); if (count >= 2) { var obj = redisHelper.GetAll().Where(d => d.State == OrderItemStateEnum.DOWORK).OrderBy(d => d.CreateDateTime).FirstOrDefault(); if (obj != null) { obj.State = OrderItemStateEnum.DONE; redisHelper.Update(obj); redisHelper.Push(obj.Id); logger.Info("【OrderStateChange】=>DoWork=>DONE" + obj.ToString()); ShowMessageEvent?.Invoke("【OrderStateChange】=>DoWork=>DONE" + obj.ToString()); } } return; } redisHelper.Update(arg1); redisHelper.Push(arg1.Id); logger.Info("【OrderStateChange】=" + arg1.ToString()); ShowMessageEvent?.Invoke("【OrderStateChange】" + arg1.ToString()); }
private void Srv_UpdateOrderActualQuantityEvent(OrderServiceEnum arg1, int arg2) { Redis.RedisHelper <OrderItem> redisHelper = new Redis.RedisHelper <OrderItem>(); var obj = redisHelper.GetAll().Where(d => d.State == OrderItemStateEnum.DOWORK).OrderBy(d => d.CreateDateTime).FirstOrDefault(); if (obj != null && obj.ActualQuantity != arg2) { obj.ActualQuantity = arg2; redisHelper.Update(obj); redisHelper.Push(obj.Id); logger.Info("【UpdateOrderActualQuantity】" + obj.ToString()); ShowMessageEvent?.Invoke("【UpdateOrderActualQuantity】" + obj.ToString()); } }