diff --git a/Entity/Constant/InfoEnum.cs b/Entity/Constant/InfoEnum.cs index cdb22b8..0d3e784 100644 --- a/Entity/Constant/InfoEnum.cs +++ b/Entity/Constant/InfoEnum.cs @@ -47,6 +47,7 @@ public class InfoEnum [Info("换电任务启动","换电任务启动")] StartSwapInfo, [Info("航车拍照中,请稍后","航车拍照中,请稍后")] CarTakePhotoInfo, [Info("启动换电失败,请联系站务人员","启动换电失败,请联系站务人员")] ErrStartSwap, + [Info("电池移仓中","电池移仓中")] InfoBatteryMove, } diff --git a/Service/BusinessTask/MyTask/BatteryMoveTask.cs b/Service/BusinessTask/MyTask/BatteryMoveTask.cs index d39d5ba..794560d 100644 --- a/Service/BusinessTask/MyTask/BatteryMoveTask.cs +++ b/Service/BusinessTask/MyTask/BatteryMoveTask.cs @@ -44,14 +44,16 @@ public class BatteryMoveTask : AbstractTaskHandler return; } - BinInfo? binInfo = _binInfoRepository.QueryListByClause(i => i.ChargeStatus == 4, "battery_enter_seq asc") - .First(); + List queryListByClause = _binInfoRepository.QueryListByClause(i => i.ChargeStatus == 4 && i.CacheBinFlag==0, "battery_enter_seq asc"); - if (binInfo == null) + + if (queryListByClause.Count<=0) { return; } + var binInfo = queryListByClause[0]; + Result success = _monitorService.BatteryRelocation(ushort.Parse(binInfo.No), ushort.Parse(cacheBin.No)); //查询人物状态 diff --git a/Service/Mgr/PlcTaskMgr.cs b/Service/Mgr/PlcTaskMgr.cs index d913fdd..a6cd56d 100644 --- a/Service/Mgr/PlcTaskMgr.cs +++ b/Service/Mgr/PlcTaskMgr.cs @@ -1,6 +1,8 @@ +using Entity.Constant; using HybirdFrameworkCore.Autofac.Attribute; using log4net; using Service.Execute; +using Service.Execute.StaticTools; using Service.Plc.Client; namespace Service.Mgr; @@ -34,7 +36,17 @@ public class PlcTaskMgr { isSuccess = true; } - }, () => { Log.Info($"PlcTaskMgr.QueryPlcTask taskNo={taskNo} execute ing"); }, true, () => { } + }, () => + { + + Log.Info($"PlcTaskMgr.QueryPlcTask taskNo={taskNo} execute ing"); + if (taskNo == 2) + { + SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoBatteryMove); + }else if (taskNo == 5) + { + } + }, true, () => { } , 5, InvokeStatus.Exception); if (InvokeStatus.Exception == invokeStatus) diff --git a/Service/Plc/Client/PlcMgr.cs b/Service/Plc/Client/PlcMgr.cs index 6029802..306de3a 100644 --- a/Service/Plc/Client/PlcMgr.cs +++ b/Service/Plc/Client/PlcMgr.cs @@ -326,7 +326,7 @@ public class PlcMgr { HostToPlc writeHostToPlc = new HostToPlc(); writeHostToPlc.LightingControl.Value = 1000; - bResult = PlcClient.WriteValue(writeHostToPlc.LightIn); + bResult = PlcClient.WriteValue(writeHostToPlc.LightingControl); } return bResult; @@ -357,7 +357,7 @@ public class PlcMgr { HostToPlc writeHostToPlc = new HostToPlc(); writeHostToPlc.LightingControl.Value = 1010; - bResult = PlcClient.WriteValue(writeHostToPlc.LightIn); + bResult = PlcClient.WriteValue(writeHostToPlc.LightingControl); } return bResult; diff --git a/Service/Station/MonitorService.cs b/Service/Station/MonitorService.cs index bba4867..61cbe3a 100644 --- a/Service/Station/MonitorService.cs +++ b/Service/Station/MonitorService.cs @@ -27,7 +27,7 @@ public class MonitorService public ChargeOrderRepository ChargeOrderRepository { get; set; } public PlcTaskMgr PlcTaskMgr { get; set; } - public Result GetSwapMonitorData() + public Result GetSwapMonitorData() { var configBinInfo = new MapperConfiguration(cfg => cfg.CreateMap().ReverseMap()); @@ -35,7 +35,7 @@ public class MonitorService List stateInfoList = mapperBinInfo.Map>(StationSoftMgr.SwappingStateMachine.StepModel); - Task carInfo = TBoxApi.GetCarInfo(); + var tboxCarInfoModel = StationSoftMgr.SwappingStateMachine.BoxCarInfoModel; List binInfos = BinInfoRepository.QueryListByClause(i => i.Exists == 1 && i.Status == 1); SwapMonitorScreenResp monitorScreenResp = new() @@ -55,8 +55,8 @@ public class MonitorService VelMac = StationSoftMgr.SwappingStateMachine.RfidReadModel != null ? StationSoftMgr.SwappingStateMachine.RfidReadModel.VelMac : null, - LockStatus = carInfo.Result != null ? carInfo.Result.HeartBeatMsg.LockStatus : null, - KeyStatus = carInfo.Result != null ? carInfo.Result.HeartBeatMsg.KeyStatus : null, + LockStatus = tboxCarInfoModel != null ? tboxCarInfoModel.HeartBeatMsg.LockStatus : null, + KeyStatus = tboxCarInfoModel != null ? tboxCarInfoModel.HeartBeatMsg.KeyStatus : null, VelNo = StationSoftMgr.SwappingStateMachine.RfidReadModel != null ? StationSoftMgr.SwappingStateMachine.RfidReadModel.VelNo : null, @@ -152,7 +152,7 @@ public class MonitorService } BinInfo? putBin = BinInfoRepository.QueryByClause(i => - i.No.Equals(putBinNo) && (i.ChargeStatus == 2 || i.ChargeStatus == 4) && i.Exists == 0 && i.AmtLock == 0 && + i.No.Equals(putBinNo) && i.Exists == 0 && i.AmtLock == 0 && i.Status == 1); if (putBin == null) { diff --git a/WebStarter/appsettings.prod.json b/WebStarter/appsettings.prod.json index 1b2eb56..d6398d1 100644 --- a/WebStarter/appsettings.prod.json +++ b/WebStarter/appsettings.prod.json @@ -2,7 +2,7 @@ "ConnectionStrings": { "ConfigId": "master", "DbType": "MySql", - "SqlConnection": "server=192.168.2.2;Port=3306;Database=huanneng_dev;Uid=root;Pwd=Rszn123;Charset=utf8;" + "SqlConnection": "server=127.0.0.1;Port=3306;Database=huanneng_dev;Uid=root;Pwd=anyixing2023!@#;Charset=utf8;" }, "Update": { "AutoUpdate": "false", @@ -10,7 +10,7 @@ "Url": "http://121.4.95.243:8090/Updates/AutoUpdaterStarter.xml" }, "Redis": { - "Connection": "106.12.36.89:6379,password=123456", + "Connection": "127.0.0.1:6379,password=123456", "InstanceName": "local", "DefaultDB": "8" }, @@ -101,7 +101,7 @@ // 缓存前缀 }, "HttpContextRequest": { - "Scheme": "http://0.0.0.0:5034" + "Scheme": "" }, "Kestrel": { "Endpoints": { @@ -111,7 +111,7 @@ } }, "cloud": { - "enable": true + "enable": false }, "plc": { "enable": true