|
|
|
@ -4,6 +4,11 @@ using HybirdFrameworkCore.AutoTask;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Service.Cloud.Client;
|
|
|
|
|
using Service.Cloud.Msg.Host.Req;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Service.Init;
|
|
|
|
|
using Service.Cloud.Common;
|
|
|
|
|
using Org.BouncyCastle.Asn1.X509;
|
|
|
|
|
using Org.BouncyCastle.Crypto.Tls;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace WebStarter.Controllers.System;
|
|
|
|
@ -35,7 +40,7 @@ public class TestController1
|
|
|
|
|
[HttpGet("/Cloud/UploadCloudReady")]
|
|
|
|
|
public Result<bool> UploadCloudReady(ReadyTopic readyTopic)
|
|
|
|
|
{
|
|
|
|
|
string jsonString = JsonSerializer.Serialize(readyTopic);
|
|
|
|
|
string jsonString = JsonConvert.SerializeObject(readyTopic, Formatting.Indented);
|
|
|
|
|
CloudClientMgr.Send("truck_topic_command_sub_find", jsonString);
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
|
}
|
|
|
|
@ -45,10 +50,115 @@ public class TestController1
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/Cloud/UploadCloudSwapFinish")]
|
|
|
|
|
public Result<bool> UploadCloudSwapFinish(SwapFinish swapFinish)
|
|
|
|
|
public Result<bool> UploadCloudSwapFinish()
|
|
|
|
|
{
|
|
|
|
|
string jsonString = JsonSerializer.Serialize(swapFinish);
|
|
|
|
|
CloudClientMgr.Send("truck_topic_command_sub_find", jsonString);
|
|
|
|
|
SwapFinish swapFinish = new SwapFinish()
|
|
|
|
|
{
|
|
|
|
|
stationSn = StaticStationInfo.StationSn,
|
|
|
|
|
type = "2",
|
|
|
|
|
carNumber = "沪AD84996",
|
|
|
|
|
status = "2",
|
|
|
|
|
alarmCode = "",
|
|
|
|
|
sn = "",
|
|
|
|
|
after_sn = "",
|
|
|
|
|
orderID = "123132123123",
|
|
|
|
|
stationStatus = "1",
|
|
|
|
|
before_soc = "45",
|
|
|
|
|
after_soc = "96",
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
string jsonString = JsonConvert.SerializeObject(swapFinish, Formatting.Indented);
|
|
|
|
|
CloudClientMgr.Send("truck_topic_command_sub_find_2", jsonString);
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 上传云端机器人状态
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/Cloud/UploadCloudRobotInfo")]
|
|
|
|
|
public Result<bool> UploadCloudRobotInfo()
|
|
|
|
|
{
|
|
|
|
|
RobotInfo swapFinish = new RobotInfo()
|
|
|
|
|
{
|
|
|
|
|
stationSn = StaticStationInfo.StationSn,
|
|
|
|
|
type = "2",
|
|
|
|
|
sn="001",
|
|
|
|
|
status ="1",
|
|
|
|
|
network_status = "1",
|
|
|
|
|
startTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
|
|
alarm_code = "",
|
|
|
|
|
soc = "100",
|
|
|
|
|
spare = "",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
string jsonString = JsonConvert.SerializeObject(swapFinish, Formatting.Indented);
|
|
|
|
|
CloudClientMgr.Send(CloudConst.robotInfo, jsonString);
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 上传云端告警信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/Cloud/UploadCloudAlarm")]
|
|
|
|
|
public Result<bool> UploadCloudAlarm()
|
|
|
|
|
{
|
|
|
|
|
Alarm swapFinish = new Alarm()
|
|
|
|
|
{
|
|
|
|
|
stationSn = StaticStationInfo.StationSn,
|
|
|
|
|
type = "4",
|
|
|
|
|
carNumber = "",
|
|
|
|
|
status = "1",
|
|
|
|
|
alarmCode="18",
|
|
|
|
|
title= "充电机告警",
|
|
|
|
|
sn = "C2001",
|
|
|
|
|
alarmLevel="3",
|
|
|
|
|
alarmSuggestions="",
|
|
|
|
|
startTime=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
|
|
endTime="",
|
|
|
|
|
deviceType="4",
|
|
|
|
|
content= "BMS通信故障",
|
|
|
|
|
deviceName="充电机01",
|
|
|
|
|
stationName= "城南换电站",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
string jsonString = JsonConvert.SerializeObject(swapFinish, Formatting.Indented);
|
|
|
|
|
CloudClientMgr.Send(CloudConst.stationAlarm, jsonString);
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 上传云端告警信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/Cloud/UploadCloudBatteryStatus")]
|
|
|
|
|
public Result<bool> UploadCloudBatteryStatus()
|
|
|
|
|
{
|
|
|
|
|
BatteryStatus batteryStatus = new BatteryStatus()
|
|
|
|
|
{
|
|
|
|
|
sn = "001",
|
|
|
|
|
soc = "23",
|
|
|
|
|
soh="",
|
|
|
|
|
energy = "56",
|
|
|
|
|
temperature = "23",
|
|
|
|
|
voltage_min = "20",
|
|
|
|
|
voltage_max = "220",
|
|
|
|
|
network_status = "1",
|
|
|
|
|
alarmCode = "",
|
|
|
|
|
status = "1",
|
|
|
|
|
isVehicle = "2",
|
|
|
|
|
longitude = "121.231321",
|
|
|
|
|
latitude = "29.2334",
|
|
|
|
|
battery_no = "1242203B1964",
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
string jsonString = JsonConvert.SerializeObject(batteryStatus, Formatting.Indented);
|
|
|
|
|
CloudClientMgr.Send(CloudConst.stationAlarm, jsonString);
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|