xian chang ceshi xuqiu

zw
lxw 6 months ago
parent c937290366
commit 63abdeec58

@ -1,4 +1,5 @@
using Entity.DbModel.Station; using System.Collections.Concurrent;
using Entity.DbModel.Station;
using Entity.Dto.Resp; using Entity.Dto.Resp;
using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity; using HybirdFrameworkCore.Entity;
@ -81,7 +82,7 @@ public class ChargerService
/// <returns></returns> /// <returns></returns>
public Result<bool> DistributeElecPriceForCharge(int version) public Result<bool> DistributeElecPriceForCharge(int version)
{ {
Dictionary<string,ChargerClient> chargerClients = ClientMgr.Dictionary; ConcurrentDictionary<string,ChargerClient> chargerClients = ClientMgr.Dictionary;
if (chargerClients.Values.Count <= 0) if (chargerClients.Values.Count <= 0)
{ {
return Result<bool>.Fail(); return Result<bool>.Fail();

@ -1,4 +1,5 @@
using Autofac; using System.Collections.Concurrent;
using Autofac;
using Common.Const; using Common.Const;
using DotNetty.Transport.Channels; using DotNetty.Transport.Channels;
using Entity.DbModel.Station; using Entity.DbModel.Station;
@ -19,7 +20,7 @@ public static class ClientMgr
{ {
private static readonly ILog Log = LogManager.GetLogger(typeof(ClientMgr)); private static readonly ILog Log = LogManager.GetLogger(typeof(ClientMgr));
public static readonly Dictionary<string, ChargerClient> Dictionary = new(); public static readonly ConcurrentDictionary<string, ChargerClient> Dictionary = new();
private static bool AutoChargeWorking { get; set; } private static bool AutoChargeWorking { get; set; }

Loading…
Cancel
Save