|
@@ -265,7 +265,7 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
+ else if (getOccupancyFee.Action == 2)
|
|
|
{
|
|
|
var report = new
|
|
|
{
|
|
@@ -301,7 +301,43 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var report = new
|
|
|
+ {
|
|
|
+ ChargeBoxId = session.ChargeBoxId,
|
|
|
+ occupancySN = getOccupancyFee.occupancySN
|
|
|
+
|
|
|
+ };
|
|
|
+ var response = await httpClient.Post(GlobalConfig.TCC_API_URL + "writeoff_occupancy", new Dictionary<string, string>()
|
|
|
+ {
|
|
|
+ { "PartnerId",session.CustomerId.ToString()}
|
|
|
+
|
|
|
+ }, report, GlobalConfig.TCC_SALTKEY);
|
|
|
+
|
|
|
+ if (!response.Success)
|
|
|
+ {
|
|
|
+ confirm.status = DataTransferStatus.Rejected;
|
|
|
+ confirm.data = JsonConvert.SerializeObject(occupancyFeeResult, GlobalConfig.JSONSERIALIZER_FORMAT);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ var _httpResult = JsonConvert.DeserializeObject<CPOOuterResponse>(response.Response);
|
|
|
+ if (_httpResult.StatusCode != 1000)
|
|
|
+ {
|
|
|
+ confirm.status = DataTransferStatus.Rejected;
|
|
|
+ confirm.data = JsonConvert.SerializeObject(occupancyFeeResult, GlobalConfig.JSONSERIALIZER_FORMAT);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ confirm.status = DataTransferStatus.Accepted;
|
|
|
+ confirm.data = JsonConvert.SerializeObject(occupancyFeeResult, GlobalConfig.JSONSERIALIZER_FORMAT);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
if (_request.messageId == "ID_OccupancyDeductResult")
|
|
|
{
|